@autoguru/overdrive 4.45.0-next.0 → 4.45.0-next.2
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/Button/Button.css.js +1 -1
- package/dist/components/NumberBubble/NumberBubble.css.d.ts +2 -0
- package/dist/components/NumberBubble/NumberBubble.css.d.ts.map +1 -0
- package/dist/components/NumberBubble/NumberBubble.css.js +14 -0
- package/dist/components/NumberBubble/NumberBubble.d.ts +7 -6
- package/dist/components/NumberBubble/NumberBubble.d.ts.map +1 -1
- package/dist/components/NumberBubble/NumberBubble.js +16 -14
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ export const button = recipe({
|
|
|
30
30
|
alignItems: 'center',
|
|
31
31
|
borderRadius: 'md',
|
|
32
32
|
borderStyle: 'none',
|
|
33
|
-
display: 'flex',
|
|
34
33
|
fontWeight: 'semiBold',
|
|
35
34
|
gap: '1',
|
|
36
35
|
justifyContent: 'center',
|
|
@@ -40,6 +39,7 @@ export const button = recipe({
|
|
|
40
39
|
'@layer': {
|
|
41
40
|
[cssLayerComponent]: {
|
|
42
41
|
cursor: 'pointer',
|
|
42
|
+
display: 'flex',
|
|
43
43
|
lineHeight: 1,
|
|
44
44
|
padding: `0 ${vars.space[4]}`,
|
|
45
45
|
transform: 'translate(0, 0) scale(1)',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberBubble.css.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,QAMtB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
|
+
__vanilla_filescope__.setFileScope("lib/components/NumberBubble/NumberBubble.css.ts", "@autoguru/overdrive");
|
|
5
|
+
import { style } from '@vanilla-extract/css';
|
|
6
|
+
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
7
|
+
export const numberStyle = style({
|
|
8
|
+
'@layer': {
|
|
9
|
+
[cssLayerComponent]: {
|
|
10
|
+
transform: 'translateY(-0.51px)'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}, "numberStyle");
|
|
14
|
+
__vanilla_filescope__.endFileScope();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export interface NumberBubbleProps extends
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type UseBoxProps } from '../Box/useBox/useBox';
|
|
3
|
+
import { type TextProps } from '../Text/Text';
|
|
4
|
+
export interface NumberBubbleProps extends Pick<UseBoxProps, 'backgroundColor' | 'backgroundColour'> {
|
|
5
5
|
value: number;
|
|
6
6
|
rawNumbers?: boolean;
|
|
7
|
-
|
|
7
|
+
textColor?: TextProps['color'];
|
|
8
|
+
textColour?: TextProps['colour'];
|
|
8
9
|
}
|
|
9
|
-
export declare const NumberBubble:
|
|
10
|
+
export declare const NumberBubble: ({ backgroundColor, backgroundColour, rawNumbers, textColor, textColour, value, }: NumberBubbleProps) => React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=NumberBubble.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberBubble.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumberBubble.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,WAAW,iBAChB,SAAQ,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;CACjC;AASD,eAAO,MAAM,YAAY,GAAI,kFAO1B,iBAAiB,sBAgCnB,CAAC"}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["value", "textColour", "rawNumbers"];
|
|
6
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; }
|
|
7
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; }
|
|
8
|
-
import
|
|
9
|
-
import { useMemo } from 'react';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
10
7
|
import { textStyles } from "../../styles/typography.js";
|
|
11
8
|
import { toPrettyBigNumber } from "../../utils/number.js";
|
|
12
9
|
import { useBox } from "../Box/useBox/useBox.js";
|
|
10
|
+
import * as styles from "./NumberBubble.css.js";
|
|
13
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
12
|
const sizeMap = {
|
|
15
13
|
SMALL: '4',
|
|
16
14
|
MEDIUM: '6',
|
|
17
15
|
LARGE: '7'
|
|
18
16
|
};
|
|
19
|
-
export const NumberBubble =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
export const NumberBubble = ({
|
|
18
|
+
backgroundColor,
|
|
19
|
+
backgroundColour = backgroundColor ? undefined : 'gray900',
|
|
20
|
+
rawNumbers = false,
|
|
21
|
+
textColor,
|
|
22
|
+
textColour = textColor ? undefined : 'white',
|
|
23
|
+
value
|
|
24
|
+
}) => {
|
|
26
25
|
const size = useMemo(() => {
|
|
27
26
|
if (value < 10) return 'SMALL';
|
|
28
27
|
if (value >= 10 && value < 100) return 'MEDIUM';
|
|
@@ -31,19 +30,22 @@ export const NumberBubble = _ref => {
|
|
|
31
30
|
const {
|
|
32
31
|
Component,
|
|
33
32
|
componentProps
|
|
34
|
-
} = useBox(
|
|
33
|
+
} = useBox({
|
|
35
34
|
odComponent: 'number-bubble',
|
|
36
35
|
alignItems: 'center',
|
|
37
|
-
|
|
36
|
+
backgroundColor,
|
|
37
|
+
backgroundColour,
|
|
38
38
|
borderRadius: 'full',
|
|
39
39
|
display: 'inline-flex',
|
|
40
40
|
justifyContent: 'center',
|
|
41
41
|
size: sizeMap[size]
|
|
42
|
-
}
|
|
42
|
+
});
|
|
43
43
|
return /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
44
44
|
children: /*#__PURE__*/_jsx("span", {
|
|
45
45
|
className: textStyles({
|
|
46
46
|
size: '2',
|
|
47
|
+
className: styles.numberStyle,
|
|
48
|
+
color: textColor,
|
|
47
49
|
colour: textColour,
|
|
48
50
|
strong: true
|
|
49
51
|
}),
|
package/package.json
CHANGED