@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.
@@ -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,2 @@
1
+ export declare const numberStyle: string;
2
+ //# sourceMappingURL=NumberBubble.css.d.ts.map
@@ -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 { ComponentProps, FunctionComponent } from 'react';
2
- import { Box } from '../Box/Box';
3
- import { Text } from '../Text/Text';
4
- export interface NumberBubbleProps extends Omit<ComponentProps<typeof Box>, 'borderRadius' | 'position' | 'padding'> {
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
- textColour?: ComponentProps<typeof Text>['colour'];
7
+ textColor?: TextProps['color'];
8
+ textColour?: TextProps['colour'];
8
9
  }
9
- export declare const NumberBubble: FunctionComponent<NumberBubbleProps>;
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":"AACA,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;AAEpC,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,CAoC7D,CAAC"}
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 * as React from 'react';
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 = _ref => {
20
- let {
21
- value,
22
- textColour = 'white',
23
- rawNumbers = false
24
- } = _ref,
25
- boxProps = _objectWithoutProperties(_ref, _excluded);
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(_objectSpread({
33
+ } = useBox({
35
34
  odComponent: 'number-bubble',
36
35
  alignItems: 'center',
37
- backgroundColour: 'gray900',
36
+ backgroundColor,
37
+ backgroundColour,
38
38
  borderRadius: 'full',
39
39
  display: 'inline-flex',
40
40
  justifyContent: 'center',
41
41
  size: sizeMap[size]
42
- }, boxProps));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.45.0-next.0",
3
+ "version": "4.45.0-next.2",
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",