@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.
@@ -1 +1 @@
1
- {"version":3,"file":"NumberBubble.css.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAIrB,CAAC"}
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
- top: '50%',
8
- left: '50%',
9
- transform: 'translate(-50%, -50%)'
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,EAAE,MAAM,YAAY,CAAC;AACjC,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;AAaD,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAqC7D,CAAC"}
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 { sprinkles } from "../../styles/index.js";
11
+ import { textStyles } from "../../styles/typography.js";
12
12
  import { toPrettyBigNumber } from "../../utils/number.js";
13
- import { Box } from "../Box/Box.js";
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 valuePaddingMap = {
18
- SMALL: '2',
19
- MEDIUM: '3',
20
- LARGE: '4',
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 > 9 && value < 100) return 'MEDIUM';
32
- if (value > 99 && value < 9999) return 'LARGE';
33
- if (value >= 9999) return 'LARGE';
34
- return 'SMALL';
29
+ if (value < 10) return 'SMALL';
30
+ if (value >= 10 && value < 100) return 'MEDIUM';
31
+ return 'LARGE';
35
32
  }, [value]);
36
- return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
37
- borderRadius: "full",
38
- backgroundColour: "gray900",
39
- display: "inline-block",
40
- position: "relative",
41
- padding: valuePaddingMap[size],
42
- odComponent: "number-bubble"
43
- }, boxProps), {}, {
44
- children: /*#__PURE__*/_jsx(Text, {
45
- size: "2",
46
- strong: true,
47
- className: clsx(styles.bubbleText, sprinkles({
48
- position: 'absolute'
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,3 +1,2 @@
1
1
  export { Text } from './Text';
2
- export { textStyles as useTextStyles } from '../../styles/typography';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAC9B,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,yBAAyB,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"}
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
 
3
- export { Text } from "./Text.js";
4
- export { textStyles as useTextStyles } from "../../styles/typography.js";
3
+ export { Text } from "./Text.js";
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
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.44.3",
3
+ "version": "4.44.4-next.1",
4
4
  "description": "Overdrive is a product component library, and design system for AutoGuru.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",