@autoguru/overdrive 4.57.2 → 4.58.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/Alert/Alert.js +3 -3
- package/dist/components/AutoSuggest/AutoSuggest.d.ts.map +1 -1
- package/dist/components/AutoSuggest/AutoSuggest.js +4 -4
- package/dist/components/Button/Button.css.d.ts.map +1 -1
- package/dist/components/Button/Button.css.js +3 -2
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +9 -1
- package/dist/components/Calendar/Calendar.css.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.css.js +3 -2
- package/dist/components/Calendar/Calendar.js +3 -3
- package/dist/components/Columns/Column.css.d.ts.map +1 -1
- package/dist/components/Columns/Column.css.js +3 -1
- package/dist/components/DateInput/DateInput.css.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput.css.js +3 -2
- package/dist/components/DatePicker/DatePicker.css.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.css.js +3 -2
- package/dist/components/DateTimeField/DateTimeField.css.d.ts.map +1 -1
- package/dist/components/DateTimeField/DateTimeField.css.js +3 -2
- package/dist/components/DropDown/DropDown.d.ts.map +1 -1
- package/dist/components/DropDown/DropDown.js +2 -2
- package/dist/components/EditableText/EditableText.css.d.ts.map +1 -1
- package/dist/components/EditableText/EditableText.css.js +3 -2
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +3 -3
- package/dist/components/MarkdownRenderer/MarkdownRenderer.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.css.js +3 -2
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.css.js +3 -1
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.css.js +3 -2
- package/dist/components/MarkdownRenderer/components/MarkdownEmphasis.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownEmphasis.css.js +3 -2
- package/dist/components/MarkdownRenderer/components/MarkdownImage.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownImage.css.js +3 -2
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.css.js +3 -1
- package/dist/components/MarkdownRenderer/components/MarkdownStrikethrough.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownStrikethrough.css.js +3 -2
- package/dist/components/MarkdownRenderer/components/MarkdownTable.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownTable.css.js +3 -2
- package/dist/components/NumberBubble/NumberBubble.css.d.ts.map +1 -1
- package/dist/components/NumberBubble/NumberBubble.css.js +3 -2
- package/dist/components/OptionGrid/OptionGrid.css.d.ts.map +1 -1
- package/dist/components/OptionGrid/OptionGrid.css.js +7 -3
- package/dist/components/OptionList/OptionList.css.d.ts.map +1 -1
- package/dist/components/OptionList/OptionList.css.js +6 -3
- package/dist/components/Pagination/Pagination.js +5 -5
- package/dist/components/Popover/Popover.css.d.ts.map +1 -1
- package/dist/components/Popover/Popover.css.js +3 -2
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/SearchBar/SearchBar.css.d.ts.map +1 -1
- package/dist/components/SearchBar/SearchBar.css.js +3 -2
- package/dist/components/SearchBar/SearchBar.js +3 -3
- package/dist/components/SelectInput/SelectInput.js +2 -2
- package/dist/components/SimplePagination/SimplePagination.js +3 -3
- package/dist/components/Slider/Slider.css.d.ts.map +1 -1
- package/dist/components/Slider/Slider.css.js +3 -2
- package/dist/components/SplitButton/SplitButton.css.d.ts +21 -0
- package/dist/components/SplitButton/SplitButton.css.d.ts.map +1 -0
- package/dist/components/SplitButton/SplitButton.css.js +57 -0
- package/dist/components/SplitButton/SplitButton.d.ts +63 -0
- package/dist/components/SplitButton/SplitButton.d.ts.map +1 -0
- package/dist/components/SplitButton/SplitButton.js +131 -0
- package/dist/components/SplitButton/default.d.ts +2 -0
- package/dist/components/SplitButton/default.d.ts.map +1 -0
- package/dist/components/SplitButton/default.js +1 -0
- package/dist/components/SplitButton/index.d.ts +2 -0
- package/dist/components/SplitButton/index.d.ts.map +1 -0
- package/dist/components/SplitButton/index.js +1 -0
- package/dist/components/Stack/Stack.css.d.ts.map +1 -1
- package/dist/components/Stack/Stack.css.js +3 -2
- package/dist/components/StandardModal/StandardModal.js +2 -2
- package/dist/components/StarRating/StarRating.d.ts.map +1 -1
- package/dist/components/StarRating/StarRating.js +10 -3
- package/dist/components/Switch/Switch.css.d.ts.map +1 -1
- package/dist/components/Switch/Switch.css.js +3 -2
- package/dist/components/Table/TableHeadCell.js +2 -2
- package/dist/components/TextLink/TextLink.d.ts +1 -1
- package/dist/components/TextLink/TextLink.js +1 -1
- package/dist/components/ToggleButtons/ToggleButtons.css.d.ts.map +1 -1
- package/dist/components/ToggleButtons/ToggleButtons.css.js +3 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/layers.css.d.ts +10 -0
- package/dist/styles/layers.css.d.ts.map +1 -1
- package/dist/styles/layers.css.js +12 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CaretLeftIcon, CaretRightIcon } from '@autoguru/icons';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useCallback, useMemo } from 'react';
|
|
@@ -48,7 +48,7 @@ const Loading = ({
|
|
|
48
48
|
}),
|
|
49
49
|
children: [/*#__PURE__*/_jsx(NavButton, {
|
|
50
50
|
disabled: true,
|
|
51
|
-
icon:
|
|
51
|
+
icon: CaretLeftIcon
|
|
52
52
|
}), Array.from({
|
|
53
53
|
length: placeholderBubblesNum
|
|
54
54
|
}).fill('').map((_, index) => /*#__PURE__*/_jsx(Bubble, {
|
|
@@ -56,7 +56,7 @@ const Loading = ({
|
|
|
56
56
|
className: styles.disabled
|
|
57
57
|
}, index)), /*#__PURE__*/_jsx(NavButton, {
|
|
58
58
|
disabled: true,
|
|
59
|
-
icon:
|
|
59
|
+
icon: CaretRightIcon
|
|
60
60
|
})]
|
|
61
61
|
});
|
|
62
62
|
export const Pagination = ({
|
|
@@ -82,7 +82,7 @@ export const Pagination = ({
|
|
|
82
82
|
children: [/*#__PURE__*/_jsx(NavButton, {
|
|
83
83
|
disabled: activePage <= 1,
|
|
84
84
|
label: "navigate back",
|
|
85
|
-
icon:
|
|
85
|
+
icon: CaretLeftIcon,
|
|
86
86
|
onClick: handleClick(activePage - 1)
|
|
87
87
|
}), buildPagesList(numPages, allowedActive, numPagesDisplayed, numPages - numPagesDisplayed).map(num => /*#__PURE__*/_jsx(Bubble, {
|
|
88
88
|
gap: num < 0,
|
|
@@ -93,7 +93,7 @@ export const Pagination = ({
|
|
|
93
93
|
}, num)), /*#__PURE__*/_jsx(NavButton, {
|
|
94
94
|
disabled: activePage >= numPages,
|
|
95
95
|
label: "navigate forward",
|
|
96
|
-
icon:
|
|
96
|
+
icon: CaretRightIcon,
|
|
97
97
|
onClick: handleClick(allowedActive + 1)
|
|
98
98
|
})]
|
|
99
99
|
}) : /*#__PURE__*/_jsx(Loading, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Popover/Popover.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Popover.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Popover/Popover.css.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,QAiBvB,CAAC;AAEH,eAAO,MAAM,YAAY,QAgBvB,CAAC;AAEH,eAAO,MAAM,eAAe,QAY1B,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/Popover/Popover.css.ts", "@autoguru/overdrive");
|
|
3
|
-
import { style } from '@vanilla-extract/css';
|
|
4
|
-
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
3
|
+
import { globalLayer, style } from '@vanilla-extract/css';
|
|
4
|
+
import { LAYER_ORDER, cssLayerComponent } from "../../styles/layers.css.js";
|
|
5
5
|
import { selectors } from "../../styles/selectors.js";
|
|
6
6
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
7
7
|
import { overdriveTokens as tokens } from "../../themes/theme.css.js";
|
|
8
|
+
globalLayer(LAYER_ORDER);
|
|
8
9
|
export const overlayStyle = style([sprinkles({
|
|
9
10
|
borderRadius: 'md',
|
|
10
11
|
borderWidth: '1',
|
|
@@ -4,7 +4,7 @@ const _excluded = ["children"],
|
|
|
4
4
|
_excluded2 = ["children", "offset", "state", "triggerRef", "lang"];
|
|
5
5
|
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; }
|
|
6
6
|
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; }
|
|
7
|
-
import {
|
|
7
|
+
import { XIcon } from '@autoguru/icons';
|
|
8
8
|
import React, { useRef, useEffect } from 'react';
|
|
9
9
|
import { usePopover, useDialog, DismissButton, Overlay } from 'react-aria';
|
|
10
10
|
import { useMedia } from "../../hooks/useMedia/useMedia.js";
|
|
@@ -99,7 +99,7 @@ export const Popover = _ref2 => {
|
|
|
99
99
|
onClick: state.close,
|
|
100
100
|
"aria-label": textValues.close,
|
|
101
101
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
102
|
-
icon:
|
|
102
|
+
icon: XIcon
|
|
103
103
|
})
|
|
104
104
|
})
|
|
105
105
|
}), children]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.css.d.ts","sourceRoot":"","sources":["../../../lib/components/SearchBar/SearchBar.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.css.d.ts","sourceRoot":"","sources":["../../../lib/components/SearchBar/SearchBar.css.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,cAAc,QAsCzB,CAAC;AAEH,eAAO,MAAM,UAAU,QAiBrB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;EA2C9B,CAAC;AAEH,eAAO,MAAM,YAAY,QAQvB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/SearchBar/SearchBar.css.ts", "@autoguru/overdrive");
|
|
3
|
-
import { style } from '@vanilla-extract/css';
|
|
3
|
+
import { globalLayer, style } from '@vanilla-extract/css';
|
|
4
4
|
import { recipe } from '@vanilla-extract/recipes';
|
|
5
5
|
import { focusOutlineStyle } from "../../styles/focusOutline.css.js";
|
|
6
|
-
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
6
|
+
import { LAYER_ORDER, cssLayerComponent } from "../../styles/layers.css.js";
|
|
7
7
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
8
8
|
import { overdriveTokens as tokens } from "../../themes/theme.css.js";
|
|
9
|
+
globalLayer(LAYER_ORDER);
|
|
9
10
|
const hideWebkitAppearance = style({
|
|
10
11
|
'@layer': {
|
|
11
12
|
[cssLayerComponent]: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
|
-
import {
|
|
4
|
+
import { MagnifyingGlassIcon, XIcon } from '@autoguru/icons';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { mergeProps, useButton, useFocusRing, useSearchField } from 'react-aria';
|
|
7
7
|
import { useSearchFieldState } from 'react-stately';
|
|
@@ -74,7 +74,7 @@ export const SearchBar = componentProps => {
|
|
|
74
74
|
"aria-label": (_componentProps$lang$ = (_componentProps$lang = componentProps.lang) === null || _componentProps$lang === void 0 ? void 0 : _componentProps$lang.clear) !== null && _componentProps$lang$ !== void 0 ? _componentProps$lang$ : defaultEnglish.clear
|
|
75
75
|
}, clearButtonProps), {}, {
|
|
76
76
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
77
|
-
icon:
|
|
77
|
+
icon: XIcon,
|
|
78
78
|
size: "100%"
|
|
79
79
|
})
|
|
80
80
|
}));
|
|
@@ -96,7 +96,7 @@ export const SearchBar = componentProps => {
|
|
|
96
96
|
className: sprinkles({
|
|
97
97
|
flexShrink: '0'
|
|
98
98
|
}),
|
|
99
|
-
icon:
|
|
99
|
+
icon: MagnifyingGlassIcon,
|
|
100
100
|
size: "large"
|
|
101
101
|
}), /*#__PURE__*/_jsxs("div", {
|
|
102
102
|
className: fieldWrapper,
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
const _excluded = ["field", "eventHandlers", "suffixed", "prefixed", "validation", "isFocused", "isLoading", "size", "fieldIcon"];
|
|
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
|
-
import {
|
|
6
|
+
import { CaretDownIcon } from '@autoguru/icons';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Box } from "../Box/index.js";
|
|
@@ -21,7 +21,7 @@ export const SelectInput = withEnhancedInput(_ref => {
|
|
|
21
21
|
isFocused,
|
|
22
22
|
isLoading,
|
|
23
23
|
size,
|
|
24
|
-
fieldIcon =
|
|
24
|
+
fieldIcon = CaretDownIcon
|
|
25
25
|
} = _ref,
|
|
26
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
27
|
return /*#__PURE__*/_jsxs(Box, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CaretLeftIcon, CaretRightIcon } from '@autoguru/icons';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { noop } from "../../utils/index.js";
|
|
4
4
|
import { Button } from "../Button/Button.js";
|
|
@@ -34,7 +34,7 @@ export const SimplePagination = ({
|
|
|
34
34
|
onClick: handleClick(EChangeDirection.Previous),
|
|
35
35
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
36
36
|
size: "medium",
|
|
37
|
-
icon:
|
|
37
|
+
icon: CaretLeftIcon
|
|
38
38
|
})
|
|
39
39
|
}), /*#__PURE__*/_jsx(Button, {
|
|
40
40
|
rounded: true,
|
|
@@ -46,7 +46,7 @@ export const SimplePagination = ({
|
|
|
46
46
|
onClick: handleClick(EChangeDirection.Next),
|
|
47
47
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
48
48
|
size: "medium",
|
|
49
|
-
icon:
|
|
49
|
+
icon: CaretRightIcon
|
|
50
50
|
})
|
|
51
51
|
})]
|
|
52
52
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Slider/Slider.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Slider.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Slider/Slider.css.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS,QAKpB,CAAC;AAEH,eAAO,MAAM,KAAK,QAIhB,CAAC;AAEH,eAAO,MAAM,YAAY,QAIvB,CAAC;AAEH,eAAO,MAAM,SAAS,QAIpB,CAAC;AAEH,eAAO,MAAM,eAAe,QAK1B,CAAC;AAEH,eAAO,MAAM,cAAc,QAIzB,CAAC;AAEH,eAAO,MAAM,KAAK,QAoBhB,CAAC;AAEH,eAAO,MAAM,KAAK,QAkChB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/Slider/Slider.css.ts", "@autoguru/overdrive");
|
|
3
|
-
import { style } from '@vanilla-extract/css';
|
|
3
|
+
import { globalLayer, style } from '@vanilla-extract/css';
|
|
4
4
|
import { focusOutlineStyle } from "../../styles/focusOutline.css.js";
|
|
5
|
-
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
5
|
+
import { LAYER_ORDER, cssLayerComponent } from "../../styles/layers.css.js";
|
|
6
6
|
import { selectors } from "../../styles/selectors.js";
|
|
7
7
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
8
8
|
import { overdriveTokens as vars } from "../../themes/theme.css.js";
|
|
9
|
+
globalLayer(LAYER_ORDER);
|
|
9
10
|
export const container = sprinkles({
|
|
10
11
|
display: 'flex',
|
|
11
12
|
flexDirection: 'column',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrapper that joins the primary action and the menu trigger into a single
|
|
3
|
+
* visual control.
|
|
4
|
+
*/
|
|
5
|
+
export declare const group: string;
|
|
6
|
+
/**
|
|
7
|
+
* Primary action segment (left). Only the outer (left) corners are rounded so
|
|
8
|
+
* it visually fuses with the trigger segment.
|
|
9
|
+
*
|
|
10
|
+
* The radius override lives in the `component` layer, which sits *after*
|
|
11
|
+
* `styleprops` (where the Button's base `borderRadius: 'md'` sprinkle is
|
|
12
|
+
* emitted) in `LAYER_ORDER`, so it reliably wins.
|
|
13
|
+
*/
|
|
14
|
+
export declare const primary: string;
|
|
15
|
+
/**
|
|
16
|
+
* Menu trigger segment (right, the chevron). Only the outer (right) corners are
|
|
17
|
+
* rounded. A negative left margin collapses the adjacent 1px borders of the two
|
|
18
|
+
* bordered segments into a single divider line.
|
|
19
|
+
*/
|
|
20
|
+
export declare const trigger: string;
|
|
21
|
+
//# sourceMappingURL=SplitButton.css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitButton.css.d.ts","sourceRoot":"","sources":["../../../lib/components/SplitButton/SplitButton.css.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,eAAO,MAAM,KAAK,QAMhB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,QAOlB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,OAAO,QAelB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
|
+
__vanilla_filescope__.setFileScope("lib/components/SplitButton/SplitButton.css.ts", "@autoguru/overdrive");
|
|
3
|
+
import { globalLayer, style } from '@vanilla-extract/css';
|
|
4
|
+
import { LAYER_ORDER, cssLayerComponent } from "../../styles/layers.css.js";
|
|
5
|
+
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
6
|
+
import { overdriveTokens as vars } from "../../themes/theme.css.js";
|
|
7
|
+
globalLayer(LAYER_ORDER);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper that joins the primary action and the menu trigger into a single
|
|
11
|
+
* visual control.
|
|
12
|
+
*/
|
|
13
|
+
export const group = style([sprinkles({
|
|
14
|
+
display: 'flex',
|
|
15
|
+
position: 'relative',
|
|
16
|
+
width: 'fit-content'
|
|
17
|
+
})], "group");
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Primary action segment (left). Only the outer (left) corners are rounded so
|
|
21
|
+
* it visually fuses with the trigger segment.
|
|
22
|
+
*
|
|
23
|
+
* The radius override lives in the `component` layer, which sits *after*
|
|
24
|
+
* `styleprops` (where the Button's base `borderRadius: 'md'` sprinkle is
|
|
25
|
+
* emitted) in `LAYER_ORDER`, so it reliably wins.
|
|
26
|
+
*/
|
|
27
|
+
export const primary = style({
|
|
28
|
+
'@layer': {
|
|
29
|
+
[cssLayerComponent]: {
|
|
30
|
+
borderBottomRightRadius: 0,
|
|
31
|
+
borderTopRightRadius: 0
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, "primary");
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Menu trigger segment (right, the chevron). Only the outer (right) corners are
|
|
38
|
+
* rounded. A negative left margin collapses the adjacent 1px borders of the two
|
|
39
|
+
* bordered segments into a single divider line.
|
|
40
|
+
*/
|
|
41
|
+
export const trigger = style({
|
|
42
|
+
'@layer': {
|
|
43
|
+
[cssLayerComponent]: {
|
|
44
|
+
borderBottomLeftRadius: 0,
|
|
45
|
+
borderTopLeftRadius: 0,
|
|
46
|
+
marginLeft: `calc(-1 * ${vars.border.width['1']})`,
|
|
47
|
+
selectors: {
|
|
48
|
+
// Render the active segment above its sibling so the focus
|
|
49
|
+
// outline and overlapped border are never clipped.
|
|
50
|
+
'&:hover, &:focus-visible': {
|
|
51
|
+
zIndex: 1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, "trigger");
|
|
57
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { IconType } from '@autoguru/icons';
|
|
2
|
+
import { ComponentProps, FunctionComponent, ReactNode } from 'react';
|
|
3
|
+
import type { TestIdProp } from '../../types';
|
|
4
|
+
import { Button } from '../Button/Button';
|
|
5
|
+
import { Flyout } from '../Flyout/Flyout';
|
|
6
|
+
/**
|
|
7
|
+
* Button props shared by *both* the primary action and the menu trigger. The
|
|
8
|
+
* `children`/`onClick`/`aria-label` of the underlying buttons are managed
|
|
9
|
+
* internally, so they are omitted here.
|
|
10
|
+
*/
|
|
11
|
+
type SharedButtonProps = Pick<ComponentProps<typeof Button>, 'variant' | 'size' | 'disabled' | 'minimal' | 'rounded' | 'isLoading'>;
|
|
12
|
+
type FlyoutProps = Pick<ComponentProps<typeof Flyout>, 'alignment'>;
|
|
13
|
+
export interface SplitButtonProps extends SharedButtonProps, FlyoutProps, TestIdProp {
|
|
14
|
+
/**
|
|
15
|
+
* Text label for the primary action segment (left).
|
|
16
|
+
*/
|
|
17
|
+
label: string;
|
|
18
|
+
/**
|
|
19
|
+
* Handler for the primary action. This does **not** open the menu.
|
|
20
|
+
*/
|
|
21
|
+
onClick?: ComponentProps<typeof Button>['onClick'];
|
|
22
|
+
/**
|
|
23
|
+
* Menu options, typically `DropDownOption` elements.
|
|
24
|
+
*/
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Icon shown in the menu trigger segment (right).
|
|
28
|
+
* @default CaretDownIcon
|
|
29
|
+
*/
|
|
30
|
+
icon?: IconType;
|
|
31
|
+
/**
|
|
32
|
+
* Accessible label for the menu trigger segment.
|
|
33
|
+
* @default 'More options'
|
|
34
|
+
*/
|
|
35
|
+
menuLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Controls the open state of the menu. When provided the component becomes
|
|
38
|
+
* controlled; otherwise it manages its own open state.
|
|
39
|
+
*/
|
|
40
|
+
isOpen?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Called whenever the menu requests to open or close.
|
|
43
|
+
*/
|
|
44
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A `SplitButton` pairs a primary action with a dropdown menu of related
|
|
48
|
+
* secondary actions. The left segment triggers the primary action, while the
|
|
49
|
+
* chevron on the right opens a menu of `DropDownOption` children.
|
|
50
|
+
*
|
|
51
|
+
* Both segments share a single `variant`/`size`. Following the WAI-ARIA
|
|
52
|
+
* pattern, the two segments are independent buttons grouped together; the
|
|
53
|
+
* trigger exposes `aria-haspopup` and `aria-expanded`.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* <SplitButton label="Bulk upload" onClick={handleUpload}>
|
|
57
|
+
* <DropDownOption label="Single upload" icon={UploadIcon} onClick={...} />
|
|
58
|
+
* <DropDownOption label="Import CSV" onClick={...} />
|
|
59
|
+
* </SplitButton>
|
|
60
|
+
*/
|
|
61
|
+
export declare const SplitButton: FunctionComponent<SplitButtonProps>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=SplitButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitButton.d.ts","sourceRoot":"","sources":["../../../lib/components/SplitButton/SplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACN,cAAc,EACd,iBAAiB,EAGjB,SAAS,EAMT,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAO1C;;;;GAIG;AACH,KAAK,iBAAiB,GAAG,IAAI,CAC5B,cAAc,CAAC,OAAO,MAAM,CAAC,EAC7B,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CACrE,CAAC;AAEF,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;AAEpE,MAAM,WAAW,gBAChB,SAAQ,iBAAiB,EACzB,WAAW,EACX,UAAU;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAiH3D,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
const _excluded = ["label", "onClick", "children", "icon", "menuLabel", "alignment", "isOpen", "onOpenChange", "testId"];
|
|
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
|
+
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
|
+
import { CaretDownIcon } from '@autoguru/icons';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
import { Button } from "../Button/Button.js";
|
|
10
|
+
import { DropDownOptionsList } from "../DropDown/DropDownOptionsList.js";
|
|
11
|
+
import { Flyout } from "../Flyout/Flyout.js";
|
|
12
|
+
import { Icon } from "../Icon/Icon.js";
|
|
13
|
+
import { useOutsideClick } from "../OutsideClick/OutsideClick.js";
|
|
14
|
+
import { EPositionerAlignment } from "../Positioner/index.js";
|
|
15
|
+
import * as styles from "./SplitButton.css.js";
|
|
16
|
+
/**
|
|
17
|
+
* Button props shared by *both* the primary action and the menu trigger. The
|
|
18
|
+
* `children`/`onClick`/`aria-label` of the underlying buttons are managed
|
|
19
|
+
* internally, so they are omitted here.
|
|
20
|
+
*/
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
+
/**
|
|
23
|
+
* A `SplitButton` pairs a primary action with a dropdown menu of related
|
|
24
|
+
* secondary actions. The left segment triggers the primary action, while the
|
|
25
|
+
* chevron on the right opens a menu of `DropDownOption` children.
|
|
26
|
+
*
|
|
27
|
+
* Both segments share a single `variant`/`size`. Following the WAI-ARIA
|
|
28
|
+
* pattern, the two segments are independent buttons grouped together; the
|
|
29
|
+
* trigger exposes `aria-haspopup` and `aria-expanded`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <SplitButton label="Bulk upload" onClick={handleUpload}>
|
|
33
|
+
* <DropDownOption label="Single upload" icon={UploadIcon} onClick={...} />
|
|
34
|
+
* <DropDownOption label="Import CSV" onClick={...} />
|
|
35
|
+
* </SplitButton>
|
|
36
|
+
*/
|
|
37
|
+
export const SplitButton = _ref => {
|
|
38
|
+
let {
|
|
39
|
+
label,
|
|
40
|
+
onClick,
|
|
41
|
+
children,
|
|
42
|
+
icon = CaretDownIcon,
|
|
43
|
+
menuLabel = 'More options',
|
|
44
|
+
alignment = EPositionerAlignment.BOTTOM_RIGHT,
|
|
45
|
+
isOpen: controlledIsOpen,
|
|
46
|
+
onOpenChange,
|
|
47
|
+
testId
|
|
48
|
+
} = _ref,
|
|
49
|
+
sharedProps = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const triggerRef = useRef(null);
|
|
51
|
+
const menuRef = useRef(null);
|
|
52
|
+
const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState(false);
|
|
53
|
+
|
|
54
|
+
// Use controlled state if provided, otherwise use uncontrolled state.
|
|
55
|
+
const isOpen = controlledIsOpen !== null && controlledIsOpen !== void 0 ? controlledIsOpen : uncontrolledIsOpen;
|
|
56
|
+
const handleOpenChange = useCallback(newIsOpen => {
|
|
57
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newIsOpen);
|
|
58
|
+
if (controlledIsOpen === undefined) {
|
|
59
|
+
setUncontrolledIsOpen(newIsOpen);
|
|
60
|
+
}
|
|
61
|
+
}, [controlledIsOpen, onOpenChange]);
|
|
62
|
+
|
|
63
|
+
// Only request a close when the menu is actually open. `useOutsideClick`
|
|
64
|
+
// fires on any mouseup outside the trigger/menu (e.g. clicking the primary
|
|
65
|
+
// action), so without this guard `onOpenChange(false)` would be emitted
|
|
66
|
+
// even when the menu is already closed.
|
|
67
|
+
const handleClose = useCallback(() => {
|
|
68
|
+
if (isOpen) handleOpenChange(false);
|
|
69
|
+
}, [isOpen, handleOpenChange]);
|
|
70
|
+
const closeAndFocusTrigger = useCallback(() => {
|
|
71
|
+
var _triggerRef$current;
|
|
72
|
+
handleClose();
|
|
73
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.focus();
|
|
74
|
+
}, [handleClose]);
|
|
75
|
+
const onTriggerClick = useCallback(() => handleOpenChange(!isOpen), [isOpen, handleOpenChange]);
|
|
76
|
+
const onTriggerKeyDown = useCallback(event => {
|
|
77
|
+
if (event.key === 'Escape') closeAndFocusTrigger();
|
|
78
|
+
}, [closeAndFocusTrigger]);
|
|
79
|
+
|
|
80
|
+
// `useOutsideClick` keeps the refs array in its effect deps, so memoise it to
|
|
81
|
+
// avoid tearing down and re-binding the document `mouseup` listener on every
|
|
82
|
+
// render. The refs themselves are stable, so an empty dep list is correct.
|
|
83
|
+
const outsideClickRefs = useMemo(() => [menuRef, triggerRef], []);
|
|
84
|
+
useOutsideClick(outsideClickRefs, handleClose);
|
|
85
|
+
|
|
86
|
+
// The menu renders in a portal, so an Escape keypress while focus is inside
|
|
87
|
+
// it does not bubble to the trigger. Listen on the menu element directly so
|
|
88
|
+
// Escape closes regardless of where focus sits.
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
const node = menuRef.current;
|
|
91
|
+
if (!isOpen || !node) return;
|
|
92
|
+
const onKeyDown = event => {
|
|
93
|
+
if (event.key === 'Escape') closeAndFocusTrigger();
|
|
94
|
+
};
|
|
95
|
+
node.addEventListener('keydown', onKeyDown);
|
|
96
|
+
return () => node.removeEventListener('keydown', onKeyDown);
|
|
97
|
+
}, [isOpen, closeAndFocusTrigger]);
|
|
98
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
99
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
100
|
+
role: "group",
|
|
101
|
+
"aria-label": label,
|
|
102
|
+
className: styles.group,
|
|
103
|
+
"data-testid": testId,
|
|
104
|
+
children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
105
|
+
className: styles.primary,
|
|
106
|
+
onClick: onClick,
|
|
107
|
+
children: label
|
|
108
|
+
})), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
109
|
+
ref: triggerRef,
|
|
110
|
+
className: styles.trigger,
|
|
111
|
+
"aria-label": menuLabel,
|
|
112
|
+
"aria-haspopup": true,
|
|
113
|
+
"aria-expanded": isOpen,
|
|
114
|
+
onClick: onTriggerClick,
|
|
115
|
+
onKeyDown: onTriggerKeyDown,
|
|
116
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
117
|
+
icon: icon
|
|
118
|
+
})
|
|
119
|
+
}))]
|
|
120
|
+
}), /*#__PURE__*/_jsx(Flyout, {
|
|
121
|
+
triggerRef: triggerRef,
|
|
122
|
+
isOpen: isOpen,
|
|
123
|
+
alignment: alignment,
|
|
124
|
+
children: /*#__PURE__*/_jsx(DropDownOptionsList, {
|
|
125
|
+
ref: menuRef,
|
|
126
|
+
children: children
|
|
127
|
+
})
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
SplitButton.displayName = 'SplitButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../lib/components/SplitButton/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SplitButton as default } from "./SplitButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/SplitButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SplitButton } from "./SplitButton.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Stack/Stack.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stack.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Stack/Stack.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,EAAE,QAWb,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAO5B,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/Stack/Stack.css.ts", "@autoguru/overdrive");
|
|
3
|
-
import { style } from '@vanilla-extract/css';
|
|
4
|
-
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
3
|
+
import { globalLayer, style } from '@vanilla-extract/css';
|
|
4
|
+
import { LAYER_ORDER, cssLayerComponent } from "../../styles/layers.css.js";
|
|
5
5
|
import { gapVar } from "../../styles/vars.css.js";
|
|
6
6
|
import { overdriveTokens as vars } from "../../themes/theme.css.js";
|
|
7
|
+
globalLayer(LAYER_ORDER);
|
|
7
8
|
export const hr = style({
|
|
8
9
|
'@layer': {
|
|
9
10
|
[cssLayerComponent]: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XIcon } from '@autoguru/icons';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useLayoutEffect, useRef } from 'react';
|
|
@@ -114,7 +114,7 @@ export const StandardModal = ({
|
|
|
114
114
|
className: textStyles({
|
|
115
115
|
colour: 'muted'
|
|
116
116
|
}),
|
|
117
|
-
icon:
|
|
117
|
+
icon: XIcon,
|
|
118
118
|
size: "medium"
|
|
119
119
|
})
|
|
120
120
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarRating.d.ts","sourceRoot":"","sources":["../../../lib/components/StarRating/StarRating.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StarRating.d.ts","sourceRoot":"","sources":["../../../lib/components/StarRating/StarRating.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA2B,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAatE,oBAAY,eAAe;IAC1B,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AA8BD,MAAM,WAAW,eAAe;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,UAAU,EAAE,oBAAoB,CAAC,eAAe,CAgC5D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarHalfIcon, StarIcon } from '@autoguru/icons';
|
|
1
|
+
import { StarFilledIcon, StarHalfIcon, StarIcon } from '@autoguru/icons';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { memo } from 'react';
|
|
@@ -20,7 +20,14 @@ var EStarType = /*#__PURE__*/function (EStarType) {
|
|
|
20
20
|
EStarType[EStarType["Half"] = 1] = "Half";
|
|
21
21
|
EStarType[EStarType["Empty"] = 2] = "Empty";
|
|
22
22
|
return EStarType;
|
|
23
|
-
}(EStarType || {});
|
|
23
|
+
}(EStarType || {}); // In @autoguru/icons 2.x (Phosphor), `StarIcon` is the hollow outline and
|
|
24
|
+
// `StarFilledIcon` is the solid star, so full ratings use the filled variant
|
|
25
|
+
// while empty ratings keep the outline.
|
|
26
|
+
const starIconMap = {
|
|
27
|
+
[EStarType.Full]: StarFilledIcon,
|
|
28
|
+
[EStarType.Half]: StarHalfIcon,
|
|
29
|
+
[EStarType.Empty]: StarIcon
|
|
30
|
+
};
|
|
24
31
|
const starSizeMap = new Map([[EStarRatingSize.Medium, 'medium'], [EStarRatingSize.Small, 'small']]);
|
|
25
32
|
const labelSizeMap = new Map([[EStarRatingSize.Small, '3'], [EStarRatingSize.Medium, '4']]);
|
|
26
33
|
export const StarRating = /*#__PURE__*/memo(({
|
|
@@ -80,7 +87,7 @@ const Star = ({
|
|
|
80
87
|
size = EStarRatingSize.Medium
|
|
81
88
|
}) => {
|
|
82
89
|
const starType = getStarIconType(index, rating);
|
|
83
|
-
const star = starType
|
|
90
|
+
const star = starIconMap[starType];
|
|
84
91
|
return /*#__PURE__*/_jsx(Icon, {
|
|
85
92
|
icon: star,
|
|
86
93
|
size: starSizeMap.get(size),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Switch/Switch.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Switch/Switch.css.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI,QAMf,CAAC;AAEH,eAAO,MAAM,MAAM,QAqBjB,CAAC;AAEH,eAAO,MAAM,QAAQ,QAMnB,CAAC;AAEH,eAAO,MAAM,QAAQ,QAOnB,CAAC;AAKH,eAAO,MAAM,MAAM,sCAkCjB,CAAC;AAEH,eAAO,MAAM,UAAU,QAOrB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/Switch/Switch.css.ts", "@autoguru/overdrive");
|
|
3
|
-
import { style, styleVariants } from '@vanilla-extract/css';
|
|
3
|
+
import { globalLayer, style, styleVariants } from '@vanilla-extract/css';
|
|
4
4
|
import { focusOutlineStyle } from "../../styles/focusOutline.css.js";
|
|
5
|
-
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
5
|
+
import { LAYER_ORDER, cssLayerComponent } from "../../styles/layers.css.js";
|
|
6
6
|
import { overdriveTokens as vars } from "../../themes/theme.css.js";
|
|
7
|
+
globalLayer(LAYER_ORDER);
|
|
7
8
|
const colorAccent = vars.colours.foreground.body;
|
|
8
9
|
const colorContrast = vars.colours.background.body;
|
|
9
10
|
const colorMid = vars.colours.background.neutral;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArrowsDownUpIcon } from '@autoguru/icons';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { forwardRef, useCallback } from 'react';
|
|
@@ -33,7 +33,7 @@ export const TableHeadCell = /*#__PURE__*/forwardRef(({
|
|
|
33
33
|
}, [onSort]);
|
|
34
34
|
const shouldSort = typeof sort === 'string';
|
|
35
35
|
const sorter = /*#__PURE__*/_jsx(Icon, {
|
|
36
|
-
icon:
|
|
36
|
+
icon: ArrowsDownUpIcon,
|
|
37
37
|
size: "small",
|
|
38
38
|
className: clsx([styles.sorter.root, styles.sorter[sort !== null && sort !== void 0 ? sort : 'none']])
|
|
39
39
|
});
|
|
@@ -20,7 +20,7 @@ export interface TextLinkProps extends FilteredAnchorProps, FilteredTextStylePro
|
|
|
20
20
|
* <TextLink href="https://example.com">Click me</TextLink>
|
|
21
21
|
*
|
|
22
22
|
* // With an icon
|
|
23
|
-
* <TextLink href="/settings" icon={
|
|
23
|
+
* <TextLink href="/settings" icon={GearIcon}>Settings</TextLink>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export declare const TextLink: React.ForwardRefExoticComponent<TextLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -19,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
* <TextLink href="https://example.com">Click me</TextLink>
|
|
20
20
|
*
|
|
21
21
|
* // With an icon
|
|
22
|
-
* <TextLink href="/settings" icon={
|
|
22
|
+
* <TextLink href="/settings" icon={GearIcon}>Settings</TextLink>
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export const TextLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButtons.css.d.ts","sourceRoot":"","sources":["../../../lib/components/ToggleButtons/ToggleButtons.css.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"ToggleButtons.css.d.ts","sourceRoot":"","sources":["../../../lib/components/ToggleButtons/ToggleButtons.css.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAWzE,eAAO,MAAM,sBAAsB,QAAoB,CAAC;AACxD,eAAO,MAAM,2BAA2B,QAOtC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;gBAuBzB,CAAC,iBAAiB,CAAC;;;;kBAIlB;;;;EAQJ,CAAC;AAIH,eAAO,MAAM,YAAY,QA0FvB,CAAC"}
|