@autoguru/overdrive 4.44.3 → 4.44.4-next.1
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/NumberBubble/NumberBubble.css.d.ts.map +1 -1
- package/dist/components/NumberBubble/NumberBubble.css.js +6 -3
- package/dist/components/NumberBubble/NumberBubble.d.ts.map +1 -1
- package/dist/components/NumberBubble/NumberBubble.js +27 -26
- package/dist/components/Text/index.d.ts +0 -1
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +1 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberBubble.css.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumberBubble.css.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,QAMrB,CAAC"}
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
4
4
|
__vanilla_filescope__.setFileScope("lib/components/NumberBubble/NumberBubble.css.ts", "@autoguru/overdrive");
|
|
5
5
|
import { style } from '@vanilla-extract/css';
|
|
6
|
+
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
6
7
|
export const bubbleText = style({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
'@layer': {
|
|
9
|
+
[cssLayerComponent]: {
|
|
10
|
+
transform: 'translateY(-0.525px)'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
10
13
|
}, "bubbleText");
|
|
11
14
|
__vanilla_filescope__.endFileScope();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberBubble.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAInE,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"NumberBubble.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAInE,OAAO,EAAE,GAAG,EAAiB,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,cAAc,CAAC,OAAO,GAAG,CAAC,EAC1B,cAAc,GAAG,UAAU,GAAG,SAAS,CACvC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;CACnD;AASD,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAmC7D,CAAC"}
|
|
@@ -8,17 +8,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import { useMemo } from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { textStyles } from "../../styles/typography.js";
|
|
12
12
|
import { toPrettyBigNumber } from "../../utils/number.js";
|
|
13
|
-
import {
|
|
14
|
-
import { Text } from "../Text/Text.js";
|
|
13
|
+
import { useBox } from "../Box/useBox/useBox.js";
|
|
15
14
|
import * as styles from "./NumberBubble.css.js";
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
const
|
|
18
|
-
SMALL: '
|
|
19
|
-
MEDIUM: '
|
|
20
|
-
LARGE: '
|
|
21
|
-
X_LARGE: '5'
|
|
16
|
+
const sizeMap = {
|
|
17
|
+
SMALL: '4',
|
|
18
|
+
MEDIUM: '6',
|
|
19
|
+
LARGE: '7'
|
|
22
20
|
};
|
|
23
21
|
export const NumberBubble = _ref => {
|
|
24
22
|
let {
|
|
@@ -28,26 +26,29 @@ export const NumberBubble = _ref => {
|
|
|
28
26
|
} = _ref,
|
|
29
27
|
boxProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
28
|
const size = useMemo(() => {
|
|
31
|
-
if (value
|
|
32
|
-
if (value
|
|
33
|
-
|
|
34
|
-
return 'SMALL';
|
|
29
|
+
if (value < 10) return 'SMALL';
|
|
30
|
+
if (value >= 10 && value < 100) return 'MEDIUM';
|
|
31
|
+
return 'LARGE';
|
|
35
32
|
}, [value]);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
const {
|
|
34
|
+
Component,
|
|
35
|
+
componentProps
|
|
36
|
+
} = useBox(_objectSpread({
|
|
37
|
+
odComponent: 'number-bubble',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
backgroundColour: 'gray900',
|
|
40
|
+
borderRadius: 'full',
|
|
41
|
+
display: 'inline-flex',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
size: sizeMap[size]
|
|
44
|
+
}, boxProps));
|
|
45
|
+
return /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
46
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
47
|
+
className: clsx(styles.bubbleText, textStyles({
|
|
48
|
+
size: '2',
|
|
49
|
+
colour: textColour,
|
|
50
|
+
strong: true
|
|
49
51
|
})),
|
|
50
|
-
colour: textColour,
|
|
51
52
|
children: rawNumbers ? value : toPrettyBigNumber(value)
|
|
52
53
|
})
|
|
53
54
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from './hooks';
|
|
|
3
3
|
export * from './styles';
|
|
4
4
|
export { overdriveTokens as tokens } from './themes/theme.css';
|
|
5
5
|
export { sprinkles as css } from './styles/sprinkles.css';
|
|
6
|
+
export { elementStyles as useBoxStyles, textStyles as useTextStyles, type ElementStylesProps as BoxStyleProps, } from './styles';
|
|
6
7
|
export { useId, arrayRingLookup } from './utils/index';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,aAAa,IAAI,YAAY,EAC7B,UAAU,IAAI,aAAa,EAC3B,KAAK,kBAAkB,IAAI,aAAa,GACxC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export * from "./hooks/index.js";
|
|
|
5
5
|
export * from "./styles/index.js";
|
|
6
6
|
export { overdriveTokens as tokens } from "./themes/theme.css.js";
|
|
7
7
|
export { sprinkles as css } from "./styles/sprinkles.css.js";
|
|
8
|
+
export { elementStyles as useBoxStyles, textStyles as useTextStyles } from "./styles/index.js";
|
|
8
9
|
export { useId, arrayRingLookup } from "./utils/index.js";
|