@autoguru/overdrive 4.35.1 → 4.36.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/Box/Box.d.ts +1 -1
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +5 -3
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/Box/index.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.d.ts +4 -3
- package/dist/components/Box/useBoxStyles.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.js +2 -1
- package/dist/components/Icon/Icon.d.ts +2 -1
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/OptionGrid/OptionGrid.css.d.ts +31 -0
- package/dist/components/OptionGrid/OptionGrid.css.d.ts.map +1 -0
- package/dist/components/OptionGrid/OptionGrid.css.js +192 -0
- package/dist/components/OptionGrid/OptionGrid.d.ts +22 -0
- package/dist/components/OptionGrid/OptionGrid.d.ts.map +1 -0
- package/dist/components/OptionGrid/OptionGrid.js +99 -0
- package/dist/components/OptionList/IconTick.d.ts +3 -0
- package/dist/components/OptionList/IconTick.d.ts.map +1 -0
- package/dist/components/OptionList/IconTick.js +18 -0
- package/dist/components/OptionList/OptionList.css.d.ts +14 -0
- package/dist/components/OptionList/OptionList.css.d.ts.map +1 -0
- package/dist/components/OptionList/OptionList.css.js +111 -0
- package/dist/components/OptionList/OptionList.d.ts +54 -0
- package/dist/components/OptionList/OptionList.d.ts.map +1 -0
- package/dist/components/OptionList/OptionList.js +53 -0
- package/dist/components/OptionList/OptionListItem.d.ts +17 -0
- package/dist/components/OptionList/OptionListItem.d.ts.map +1 -0
- package/dist/components/OptionList/OptionListItem.js +76 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +2 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.d.ts +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.css.js +8 -2
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +4 -7
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +12 -11
- package/dist/stories/helpers/index.d.ts +5 -5
- package/dist/stories/helpers/index.d.ts.map +1 -1
- package/dist/styles/focusOutline.css.d.ts +3 -0
- package/dist/styles/focusOutline.css.d.ts.map +1 -0
- package/dist/styles/focusOutline.css.js +14 -0
- package/dist/styles/sprinkles.css.d.ts +320 -21
- package/dist/styles/sprinkles.css.d.ts.map +1 -1
- package/dist/styles/sprinkles.css.js +129 -8
- package/dist/styles/stack.css.d.ts.map +1 -1
- package/dist/styles/stack.css.js +7 -7
- package/dist/themes/base/index.d.ts +3 -2
- package/dist/themes/base/index.d.ts.map +1 -1
- package/dist/themes/base/tokens.d.ts.map +1 -1
- package/dist/themes/base/tokens.js +4 -3
- package/dist/themes/flat_red/index.d.ts +3 -2
- package/dist/themes/flat_red/index.d.ts.map +1 -1
- package/dist/themes/neutral/index.d.ts +3 -2
- package/dist/themes/neutral/index.d.ts.map +1 -1
- package/dist/themes/neutral/tokens.d.ts.map +1 -1
- package/dist/themes/neutral/tokens.js +4 -3
- package/dist/themes/theme.css.d.ts +3 -2
- package/dist/themes/theme.css.d.ts.map +1 -1
- package/dist/themes/theme.css.js +4 -3
- package/dist/themes/tokens.d.ts +2 -1
- package/dist/themes/tokens.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/utils/dataAttrs.d.ts +7 -0
- package/dist/utils/dataAttrs.d.ts.map +1 -0
- package/dist/utils/dataAttrs.js +11 -0
- package/package.json +44 -35
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
5
|
+
__vanilla_filescope__.setFileScope("lib/components/OptionList/OptionList.css.ts", "@autoguru/overdrive");
|
|
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
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
+
import { style } from '@vanilla-extract/css';
|
|
9
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
10
|
+
import { tokens } from 'lib/themes/base/tokens';
|
|
11
|
+
import { focusOutline } from "../../styles/focusOutline.css.js";
|
|
12
|
+
import { odStyle } from "../../styles/sprinkles.css.js";
|
|
13
|
+
export const styleGroup = odStyle({
|
|
14
|
+
marginTop: '6'
|
|
15
|
+
});
|
|
16
|
+
export const styleGroupLabel = odStyle({
|
|
17
|
+
font: 'xxl',
|
|
18
|
+
fontWeight: 'bold',
|
|
19
|
+
marginBottom: '3'
|
|
20
|
+
});
|
|
21
|
+
export const styleDescription = odStyle({
|
|
22
|
+
color: 'gray400',
|
|
23
|
+
font: 'md'
|
|
24
|
+
});
|
|
25
|
+
const buttonBorderRadius = tokens.border.radius['2'];
|
|
26
|
+
const optionBorders = style({
|
|
27
|
+
selectors: {
|
|
28
|
+
['&+&']: {
|
|
29
|
+
borderTopStyle: 'none'
|
|
30
|
+
},
|
|
31
|
+
['&:first-child']: {
|
|
32
|
+
borderTopLeftRadius: buttonBorderRadius,
|
|
33
|
+
borderTopRightRadius: buttonBorderRadius
|
|
34
|
+
},
|
|
35
|
+
['&:last-child']: {
|
|
36
|
+
borderBottomLeftRadius: buttonBorderRadius,
|
|
37
|
+
borderBottomRightRadius: buttonBorderRadius
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, "optionBorders");
|
|
41
|
+
export const styledOptionItem = recipe({
|
|
42
|
+
base: [{
|
|
43
|
+
userSelect: 'none'
|
|
44
|
+
}, odStyle({
|
|
45
|
+
background: {
|
|
46
|
+
initial: 'white',
|
|
47
|
+
hover: 'gray200',
|
|
48
|
+
focusVisible: 'gray200',
|
|
49
|
+
disabled: 'white'
|
|
50
|
+
},
|
|
51
|
+
borderColor: 'gray',
|
|
52
|
+
borderStyle: 'solid',
|
|
53
|
+
borderWidth: '1',
|
|
54
|
+
cursor: {
|
|
55
|
+
hover: 'pointer',
|
|
56
|
+
disabled: 'default'
|
|
57
|
+
},
|
|
58
|
+
display: 'flex',
|
|
59
|
+
gap: '2',
|
|
60
|
+
outlineColor: 'link',
|
|
61
|
+
outlineStyle: 'solid',
|
|
62
|
+
outlineOffset: 'md',
|
|
63
|
+
outlineWidth: {
|
|
64
|
+
initial: 'none',
|
|
65
|
+
focusVisible: 'default'
|
|
66
|
+
},
|
|
67
|
+
paddingX: '4',
|
|
68
|
+
paddingY: '3',
|
|
69
|
+
width: '100%'
|
|
70
|
+
}), optionBorders]
|
|
71
|
+
}, "styledOptionItem");
|
|
72
|
+
const checkboxHovered = style({
|
|
73
|
+
selectors: {
|
|
74
|
+
[`${styledOptionItem.classNames.base}:hover &:not([data-checked]):not([data-disabled])`]: {
|
|
75
|
+
color: tokens.colours.background.body,
|
|
76
|
+
background: tokens.colours.gamut.gray300,
|
|
77
|
+
transitionDuration: '15ms'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, "checkboxHovered");
|
|
81
|
+
const checkboxTransition = style({
|
|
82
|
+
transitionProperty: 'background',
|
|
83
|
+
transitionTimingFunction: 'ease-in',
|
|
84
|
+
transitionDuration: '80ms'
|
|
85
|
+
}, "checkboxTransition");
|
|
86
|
+
export const checkbox = recipe({
|
|
87
|
+
base: [odStyle(_objectSpread(_objectSpread({
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
background: {
|
|
90
|
+
initial: 'white',
|
|
91
|
+
checked: 'gray900'
|
|
92
|
+
},
|
|
93
|
+
borderColor: {
|
|
94
|
+
initial: 'gray',
|
|
95
|
+
checked: 'dark'
|
|
96
|
+
},
|
|
97
|
+
borderStyle: 'solid',
|
|
98
|
+
borderRadius: '1',
|
|
99
|
+
borderWidth: '1',
|
|
100
|
+
color: {
|
|
101
|
+
initial: 'transparent',
|
|
102
|
+
checked: 'white'
|
|
103
|
+
},
|
|
104
|
+
display: 'flex',
|
|
105
|
+
flexShrink: 0,
|
|
106
|
+
justifyContent: 'center'
|
|
107
|
+
}, focusOutline), {}, {
|
|
108
|
+
size: '6'
|
|
109
|
+
})), checkboxTransition, checkboxHovered]
|
|
110
|
+
}, "checkbox");
|
|
111
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AriaCheckboxGroupProps } from 'react-aria';
|
|
3
|
+
import { type CheckboxGroupState } from 'react-stately';
|
|
4
|
+
import type { WithTestId } from '../../types';
|
|
5
|
+
type ElementAttributes = Pick<React.ComponentPropsWithRef<'div'>, 'className' | 'ref' | 'style'>;
|
|
6
|
+
export interface OptionListProps extends AriaCheckboxGroupProps, ElementAttributes {
|
|
7
|
+
label: AriaCheckboxGroupProps['label'];
|
|
8
|
+
description?: AriaCheckboxGroupProps['description'];
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
name?: AriaCheckboxGroupProps['name'];
|
|
11
|
+
defaultValue?: AriaCheckboxGroupProps['defaultValue'];
|
|
12
|
+
value?: AriaCheckboxGroupProps['value'];
|
|
13
|
+
onChange?: AriaCheckboxGroupProps['onChange'];
|
|
14
|
+
}
|
|
15
|
+
export declare const OptionListContext: React.Context<CheckboxGroupState | null>;
|
|
16
|
+
export declare const OptionList: {
|
|
17
|
+
(props: WithTestId<OptionListProps>): React.JSX.Element;
|
|
18
|
+
Item: {
|
|
19
|
+
(props: {
|
|
20
|
+
value: string;
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
autoFocus?: boolean | undefined;
|
|
25
|
+
'aria-controls'?: string | undefined;
|
|
26
|
+
'aria-describedby'?: string | undefined;
|
|
27
|
+
'aria-details'?: string | undefined;
|
|
28
|
+
'aria-errormessage'?: string | undefined;
|
|
29
|
+
'aria-label'?: string | undefined;
|
|
30
|
+
'aria-labelledby'?: string | undefined;
|
|
31
|
+
onFocus?: ((e: React.FocusEvent<Element, Element>) => void) | undefined;
|
|
32
|
+
onBlur?: ((e: React.FocusEvent<Element, Element>) => void) | undefined;
|
|
33
|
+
onChange?: ((isSelected: boolean) => void) | undefined;
|
|
34
|
+
onKeyDown?: ((e: import("@react-types/shared").KeyboardEvent) => void) | undefined;
|
|
35
|
+
onKeyUp?: ((e: import("@react-types/shared").KeyboardEvent) => void) | undefined;
|
|
36
|
+
isDisabled?: boolean | undefined;
|
|
37
|
+
isReadOnly?: boolean | undefined;
|
|
38
|
+
onFocusChange?: ((isFocused: boolean) => void) | undefined;
|
|
39
|
+
excludeFromTabOrder?: boolean | undefined;
|
|
40
|
+
isRequired?: boolean | undefined;
|
|
41
|
+
isInvalid?: boolean | undefined;
|
|
42
|
+
validationState?: import("react-stately").ValidationState | undefined;
|
|
43
|
+
validationBehavior?: "aria" | "native" | undefined;
|
|
44
|
+
validate?: ((value: boolean) => true | import("@react-types/shared").ValidationError | null | undefined) | undefined;
|
|
45
|
+
}): React.JSX.Element;
|
|
46
|
+
displayName: string;
|
|
47
|
+
};
|
|
48
|
+
ItemSplitLabel: {
|
|
49
|
+
({ children, content }: import("./OptionListItem").SplitLabelProps): React.JSX.Element | null;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=OptionList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionList.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionList/OptionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAoB,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,eAAe,CAAC;AAE/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAU9C,KAAK,iBAAiB,GAAG,IAAI,CAC5B,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAClC,WAAW,GAAG,KAAK,GAAG,OAAO,CAC7B,CAAC;AAEF,MAAM,WAAW,eAChB,SAAQ,sBAAsB,EAC7B,iBAAiB;IAIlB,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAIpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC;IAItD,KAAK,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAKxC,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,iBAAiB,0CAAiD,CAAC;AAchF,eAAO,MAAM,UAAU;YAAW,WAAW,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B5D,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
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 React, { createContext } from 'react';
|
|
7
|
+
import { useCheckboxGroup } from 'react-aria';
|
|
8
|
+
import { useCheckboxGroupState } from 'react-stately';
|
|
9
|
+
import { dataAttrs } from "../../utils/dataAttrs.js";
|
|
10
|
+
import { styleDescription, styleGroup, styleGroupLabel } from "./OptionList.css.js";
|
|
11
|
+
import { OptionListItem, ItemSplitLabel } from "./OptionListItem.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export const OptionListContext = createContext(null);
|
|
14
|
+
export const OptionList = props => {
|
|
15
|
+
const {
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
description,
|
|
19
|
+
label,
|
|
20
|
+
ref,
|
|
21
|
+
style
|
|
22
|
+
} = props;
|
|
23
|
+
const elementAttrs = {
|
|
24
|
+
ref,
|
|
25
|
+
className,
|
|
26
|
+
style
|
|
27
|
+
};
|
|
28
|
+
const state = useCheckboxGroupState(props);
|
|
29
|
+
const {
|
|
30
|
+
groupProps,
|
|
31
|
+
labelProps,
|
|
32
|
+
descriptionProps
|
|
33
|
+
} = useCheckboxGroup(props, state);
|
|
34
|
+
return _jsxs("div", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, groupProps), elementAttrs), dataAttrs({
|
|
35
|
+
'test-id': props.testId
|
|
36
|
+
})), {}, {
|
|
37
|
+
children: [_jsx("div", _objectSpread(_objectSpread({}, labelProps), {}, {
|
|
38
|
+
className: styleGroupLabel,
|
|
39
|
+
children: label
|
|
40
|
+
})), description && _jsx("div", _objectSpread(_objectSpread({}, descriptionProps), {}, {
|
|
41
|
+
className: styleDescription,
|
|
42
|
+
children: description
|
|
43
|
+
})), _jsx(OptionListContext.Provider, {
|
|
44
|
+
value: state,
|
|
45
|
+
children: _jsx("div", {
|
|
46
|
+
className: styleGroup,
|
|
47
|
+
children: children
|
|
48
|
+
})
|
|
49
|
+
})]
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
52
|
+
OptionList.Item = OptionListItem;
|
|
53
|
+
OptionList.ItemSplitLabel = ItemSplitLabel;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AriaCheckboxGroupItemProps } from 'react-aria';
|
|
3
|
+
type FilteredCheckboxProps = Omit<AriaCheckboxGroupItemProps, 'isIndeterminate'>;
|
|
4
|
+
export declare const OptionListItem: {
|
|
5
|
+
(props: FilteredCheckboxProps): React.JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
export interface SplitLabelProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
content?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare const ItemSplitLabel: {
|
|
13
|
+
({ children, content }: SplitLabelProps): React.JSX.Element | null;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=OptionListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionListItem.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionList/OptionListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAIN,KAAK,0BAA0B,EAC/B,MAAM,YAAY,CAAC;AAUpB,KAAK,qBAAqB,GAAG,IAAI,CAChC,0BAA0B,EAC1B,iBAAiB,CACjB,CAAC;AAMF,eAAO,MAAM,cAAc;YAAW,qBAAqB;;CAuC1D,CAAC;AAIF,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAI3B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAKD,eAAO,MAAM,cAAc;4BAA2B,eAAe;;CAepE,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
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 React, { useContext, useRef } from 'react';
|
|
7
|
+
import { useCheckboxGroupItem, useFocusRing, mergeProps } from 'react-aria';
|
|
8
|
+
import { odStyle } from "../../styles/sprinkles.css.js";
|
|
9
|
+
import { dataAttrs } from "../../utils/dataAttrs.js";
|
|
10
|
+
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
11
|
+
import { IconTick } from "./IconTick.js";
|
|
12
|
+
import { OptionListContext } from "./OptionList.js";
|
|
13
|
+
import { checkbox, styledOptionItem } from "./OptionList.css.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
export const OptionListItem = props => {
|
|
16
|
+
const ref = useRef(null);
|
|
17
|
+
const state = useContext(OptionListContext);
|
|
18
|
+
const {
|
|
19
|
+
inputProps,
|
|
20
|
+
isSelected
|
|
21
|
+
} = useCheckboxGroupItem(props, state, ref);
|
|
22
|
+
const {
|
|
23
|
+
isFocusVisible,
|
|
24
|
+
focusProps
|
|
25
|
+
} = useFocusRing();
|
|
26
|
+
return _jsxs("label", _objectSpread(_objectSpread({
|
|
27
|
+
className: styledOptionItem()
|
|
28
|
+
}, dataAttrs({
|
|
29
|
+
'focus-visible': isFocusVisible
|
|
30
|
+
})), {}, {
|
|
31
|
+
children: [_jsx(VisuallyHidden, {
|
|
32
|
+
children: _jsx("input", _objectSpread(_objectSpread({}, mergeProps(inputProps, focusProps)), {}, {
|
|
33
|
+
ref: ref
|
|
34
|
+
}))
|
|
35
|
+
}), _jsxs("div", {
|
|
36
|
+
className: odStyle({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
gap: '2',
|
|
39
|
+
width: '100%'
|
|
40
|
+
}),
|
|
41
|
+
children: [_jsx("div", _objectSpread(_objectSpread({
|
|
42
|
+
className: checkbox()
|
|
43
|
+
}, dataAttrs({
|
|
44
|
+
checked: isSelected
|
|
45
|
+
})), {}, {
|
|
46
|
+
children: _jsx(IconTick, {})
|
|
47
|
+
})), _jsx("div", {
|
|
48
|
+
className: odStyle({
|
|
49
|
+
alignSelf: 'center',
|
|
50
|
+
font: 'sm',
|
|
51
|
+
width: '100%'
|
|
52
|
+
}),
|
|
53
|
+
children: props.children
|
|
54
|
+
})]
|
|
55
|
+
})]
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
OptionListItem.displayName = 'OptionList.Item';
|
|
59
|
+
export const ItemSplitLabel = _ref => {
|
|
60
|
+
let {
|
|
61
|
+
children,
|
|
62
|
+
content
|
|
63
|
+
} = _ref;
|
|
64
|
+
if (!children && !content) return null;
|
|
65
|
+
return _jsx("div", {
|
|
66
|
+
className: odStyle({
|
|
67
|
+
display: 'flex',
|
|
68
|
+
gap: '2',
|
|
69
|
+
justifyContent: 'space-between'
|
|
70
|
+
}),
|
|
71
|
+
children: children !== null && children !== void 0 ? children : content === null || content === void 0 ? void 0 : content.map((item, idx) => _jsx("span", {
|
|
72
|
+
children: item
|
|
73
|
+
}, idx))
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
ItemSplitLabel.displayName = 'OptionList.ItemSplitLabel';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../lib/components/Switch/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAU,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../lib/components/Switch/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAU,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,EAAgB,MAAM,YAAY,CAAC;AAOrD,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,eAAe,GACxC,IAAI,CACH,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,OAAO,GAAG,IAAI,GAAG,UAAU,CACxC,GAAG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAInB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEH,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,CAiEjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -9,9 +9,10 @@ import { useToggleState } from '@react-stately/toggle';
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import { useRef } from 'react';
|
|
12
|
-
import { useSwitch, useFocusRing
|
|
12
|
+
import { useSwitch, useFocusRing } from 'react-aria';
|
|
13
13
|
import { Box, useBoxStyles } from "../Box/index.js";
|
|
14
14
|
import { useTextStyles } from "../Text/index.js";
|
|
15
|
+
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
15
16
|
import * as styles from "./Switch.css.js";
|
|
16
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
export const Switch = _ref => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const visuallyHidden: string;
|
|
2
2
|
//# sourceMappingURL=VisuallyHidden.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden.css.d.ts","sourceRoot":"","sources":["../../../lib/components/VisuallyHidden/VisuallyHidden.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.css.d.ts","sourceRoot":"","sources":["../../../lib/components/VisuallyHidden/VisuallyHidden.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,QAWzB,CAAC"}
|
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
4
|
__vanilla_filescope__.setFileScope("lib/components/VisuallyHidden/VisuallyHidden.css.ts", "@autoguru/overdrive");
|
|
5
5
|
import { style } from '@vanilla-extract/css';
|
|
6
|
-
export const
|
|
6
|
+
export const visuallyHidden = style({
|
|
7
7
|
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
8
|
+
clipPath: 'inset(50%)',
|
|
8
9
|
height: 1,
|
|
10
|
+
margin: -1,
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
padding: 0,
|
|
13
|
+
position: 'absolute',
|
|
14
|
+
userSelect: 'none',
|
|
9
15
|
whiteSpace: 'nowrap',
|
|
10
16
|
width: 1
|
|
11
|
-
}, "
|
|
17
|
+
}, "visuallyHidden");
|
|
12
18
|
__vanilla_filescope__.endFileScope();
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const VisuallyHidden: FunctionComponent<Props>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type BoxProps } from '../Box';
|
|
3
|
+
type VisuallyHiddenProps = Pick<BoxProps, 'as' | 'children' | 'is'>;
|
|
4
|
+
export declare const VisuallyHidden: ({ children, ...props }: VisuallyHiddenProps) => React.JSX.Element;
|
|
8
5
|
export default VisuallyHidden;
|
|
9
6
|
//# sourceMappingURL=VisuallyHidden.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../../lib/components/VisuallyHidden/VisuallyHidden.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.d.ts","sourceRoot":"","sources":["../../../lib/components/VisuallyHidden/VisuallyHidden.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI5C,KAAK,mBAAmB,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC;AAOpE,eAAO,MAAM,cAAc,2BAA4B,mBAAmB,sBAIzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
const _excluded = ["children"];
|
|
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
|
+
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; }
|
|
3
8
|
import * as React from 'react';
|
|
4
9
|
import { Box } from "../Box/index.js";
|
|
5
|
-
import
|
|
10
|
+
import { visuallyHidden } from "./VisuallyHidden.css.js";
|
|
6
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
12
|
export const VisuallyHidden = _ref => {
|
|
8
13
|
let {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return _jsx(Box, {
|
|
13
|
-
|
|
14
|
-
position: "absolute",
|
|
15
|
-
overflow: "hidden",
|
|
16
|
-
userSelect: "none",
|
|
17
|
-
className: styles.root,
|
|
14
|
+
children
|
|
15
|
+
} = _ref,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
return _jsx(Box, _objectSpread(_objectSpread({}, props), {}, {
|
|
18
|
+
className: visuallyHidden,
|
|
18
19
|
children: children
|
|
19
|
-
});
|
|
20
|
+
}));
|
|
20
21
|
};
|
|
21
22
|
export default VisuallyHidden;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ODStyle } from '../../styles/sprinkles.css';
|
|
3
3
|
import { type RecipeStackProps } from '../../styles/stack.css';
|
|
4
4
|
import { type VariantColourSwatchProps } from './styles.css';
|
|
5
5
|
type ElementAttributes = React.ComponentPropsWithoutRef<'div'>;
|
|
6
6
|
type FilteredAttributes = Pick<ElementAttributes, 'className' | 'style'>;
|
|
7
7
|
type ComponentProps<P> = React.PropsWithChildren<P & FilteredAttributes>;
|
|
8
|
-
export declare const Box: ({ children, className, style, ...props }: ComponentProps<
|
|
9
|
-
type StackSprinkles = Pick<
|
|
8
|
+
export declare const Box: ({ children, className, style, ...props }: ComponentProps<ODStyle>) => React.JSX.Element;
|
|
9
|
+
type StackSprinkles = Pick<ODStyle, 'alignItems' | 'flexDirection' | 'flexWrap' | 'gap' | 'justifyContent'>;
|
|
10
10
|
export declare const Stack: ({ alignItems, children, className, flexDirection, flexWrap, gap, horizontal, justifyContent, space, style, ...props }: ComponentProps<StackSprinkles & RecipeStackProps>) => React.JSX.Element;
|
|
11
|
-
type ColourSwatchProps = ComponentProps<Omit<
|
|
11
|
+
type ColourSwatchProps = ComponentProps<Omit<ODStyle, 'size'> & VariantColourSwatchProps>;
|
|
12
12
|
export declare const ColourSwatch: ({ shape, size, ...props }: ColourSwatchProps) => React.JSX.Element;
|
|
13
|
-
export { type
|
|
13
|
+
export { type ODStyle } from '../../styles/sprinkles.css';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/stories/helpers/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/stories/helpers/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAS,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,cAAc,CAAC;AAEtB,KAAK,iBAAiB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAC/D,KAAK,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC;AACzE,KAAK,cAAc,CAAC,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC;AAEzE,eAAO,MAAM,GAAG,6CAKb,eAAe,OAAO,CAAC,sBAIzB,CAAC;AAEF,KAAK,cAAc,GAAG,IAAI,CACzB,OAAO,EACP,YAAY,GAAG,eAAe,GAAG,UAAU,GAAG,KAAK,GAAG,gBAAgB,CACtE,CAAC;AACF,eAAO,MAAM,KAAK,0HAYf,eAAe,cAAc,GAAG,gBAAgB,CAAC,sBAkBnD,CAAC;AAEF,KAAK,iBAAiB,GAAG,cAAc,CACtC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,wBAAwB,CAChD,CAAC;AACF,eAAO,MAAM,YAAY,8BAA+B,iBAAiB,sBAExE,CAAC;AAEF,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusOutline.css.d.ts","sourceRoot":"","sources":["../../lib/styles/focusOutline.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,eAAO,MAAM,YAAY,EAAE,OAK1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
__vanilla_filescope__.setFileScope("lib/styles/focusOutline.css.ts", "@autoguru/overdrive");
|
|
5
|
+
export const focusOutline = {
|
|
6
|
+
outlineColor: 'link',
|
|
7
|
+
outlineStyle: 'solid',
|
|
8
|
+
outlineOffset: 'md',
|
|
9
|
+
outlineWidth: {
|
|
10
|
+
initial: 'none',
|
|
11
|
+
focusVisible: 'default'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
__vanilla_filescope__.endFileScope();
|