@autoguru/overdrive 4.1.18 → 4.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @autoguru/overdrive
2
2
 
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ff5cd80: Button: Gets new colour variants
8
+
9
+ ## 4.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 5d20ae8: NumberBuble: Fixed wrong sizing for the value of 10
14
+
15
+ ## 4.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - b6959f7: NumberBubble component intoduced
20
+
3
21
  ## 4.1.18
4
22
 
5
23
  ### Patch Changes
@@ -13,11 +13,17 @@ export declare const variant: {
13
13
  primary: string;
14
14
  secondary: string;
15
15
  danger: string;
16
+ information: string;
17
+ warning: string;
18
+ success: string;
16
19
  };
17
20
  export declare const defaultStates: {
18
21
  primary: string;
19
22
  secondary: string;
20
23
  danger: string;
24
+ information: string;
25
+ warning: string;
26
+ success: string;
21
27
  };
22
28
  export declare const minimal: {
23
29
  defaults: string;
@@ -27,5 +33,8 @@ export declare const minimalStates: {
27
33
  primary: string;
28
34
  secondary: string;
29
35
  danger: string;
36
+ information: string;
37
+ warning: string;
38
+ success: string;
30
39
  };
31
40
  //# sourceMappingURL=Button.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Button/Button.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QAQf,CAAC;AAEH,eAAO,MAAM,IAAI,QAIf,CAAC;AAEH,eAAO,MAAM,aAAa,QAExB,CAAC;AACH,eAAO,MAAM,OAAO,QAElB,CAAC;AAEH,eAAO,MAAM,OAAO,QAElB,CAAC;AAEH,eAAO,MAAM,QAAQ,QAGnB,CAAC;AAEH,eAAO,MAAM,OAAO,QAElB,CAAC;AAIH,eAAO,MAAM,IAAI;;;CA2BhB,CAAC;AACF,eAAO,MAAM,OAAO;;;;CAgBnB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAwCzB,CAAC;AAEF,eAAO,MAAM,OAAO;;;CAOnB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAqCzB,CAAC"}
1
+ {"version":3,"file":"Button.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Button/Button.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QAQf,CAAC;AAEH,eAAO,MAAM,IAAI,QAIf,CAAC;AAEH,eAAO,MAAM,aAAa,QAExB,CAAC;AACH,eAAO,MAAM,OAAO,QAElB,CAAC;AAEH,eAAO,MAAM,OAAO,QAElB,CAAC;AAEH,eAAO,MAAM,QAAQ,QAGnB,CAAC;AAEH,eAAO,MAAM,OAAO,QAElB,CAAC;AAIH,eAAO,MAAM,IAAI;;;CA2BhB,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;CA+BnB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;CA+EzB,CAAC;AAEF,eAAO,MAAM,OAAO;;;CAOnB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;CAyEzB,CAAC"}
@@ -74,6 +74,21 @@ export const variant = {
74
74
  color: vars.colours.intent.danger.foreground,
75
75
  boxShadow: `inset 0 0 0 1px ${vars.colours.intent.danger.border}, ${vars.elevation['2']}`,
76
76
  }),
77
+ information: style({
78
+ backgroundColor: vars.colours.intent.information.background.standard,
79
+ color: vars.colours.intent.information.foreground,
80
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.information.border}, ${vars.elevation['2']}`,
81
+ }),
82
+ warning: style({
83
+ backgroundColor: vars.colours.intent.warning.background.standard,
84
+ color: vars.colours.intent.warning.foreground,
85
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.warning.border}, ${vars.elevation['2']}`,
86
+ }),
87
+ success: style({
88
+ backgroundColor: vars.colours.intent.success.background.standard,
89
+ color: vars.colours.intent.success.foreground,
90
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.success.border}, ${vars.elevation['2']}`,
91
+ }),
77
92
  };
78
93
  export const defaultStates = {
79
94
  primary: style({
@@ -115,6 +130,45 @@ export const defaultStates = {
115
130
  boxShadow: `inset 0 0 0 1px ${vars.colours.intent.danger.border}, ${vars.elevation['1']}`,
116
131
  },
117
132
  }),
133
+ information: style({
134
+ ':hover': {
135
+ color: vars.colours.intent.information.foreground,
136
+ backgroundColor: vars.colours.intent.information.background.strong,
137
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.information.border}, ${vars.elevation['3']}`,
138
+ },
139
+ ':active': {
140
+ transform: 'scale(0.97)',
141
+ color: vars.colours.intent.information.foreground,
142
+ backgroundColor: vars.colours.intent.information.background.strong,
143
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.information.border}, ${vars.elevation['1']}`,
144
+ },
145
+ }),
146
+ warning: style({
147
+ ':hover': {
148
+ color: vars.colours.intent.warning.foreground,
149
+ backgroundColor: vars.colours.intent.warning.background.strong,
150
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.warning.border}, ${vars.elevation['3']}`,
151
+ },
152
+ ':active': {
153
+ transform: 'scale(0.97)',
154
+ color: vars.colours.intent.warning.foreground,
155
+ backgroundColor: vars.colours.intent.warning.background.strong,
156
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.warning.border}, ${vars.elevation['1']}`,
157
+ },
158
+ }),
159
+ success: style({
160
+ ':hover': {
161
+ color: vars.colours.intent.success.foreground,
162
+ backgroundColor: vars.colours.intent.success.background.strong,
163
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.success.border}, ${vars.elevation['3']}`,
164
+ },
165
+ ':active': {
166
+ transform: 'scale(0.97)',
167
+ color: vars.colours.intent.success.foreground,
168
+ backgroundColor: vars.colours.intent.success.background.strong,
169
+ boxShadow: `inset 0 0 0 1px ${vars.colours.intent.success.border}, ${vars.elevation['1']}`,
170
+ },
171
+ }),
118
172
  };
119
173
  export const minimal = {
120
174
  defaults: style({
@@ -161,4 +215,40 @@ export const minimalStates = {
161
215
  boxShadow: 'none',
162
216
  },
163
217
  }),
218
+ information: style({
219
+ ':hover': {
220
+ color: vars.colours.intent.information.background.strong,
221
+ backgroundColor: vars.colours.intent.information.background.mild,
222
+ boxShadow: 'none',
223
+ },
224
+ ':active': {
225
+ color: vars.colours.intent.information.background.strong,
226
+ backgroundColor: vars.colours.intent.information.background.mild,
227
+ boxShadow: 'none',
228
+ },
229
+ }),
230
+ warning: style({
231
+ ':hover': {
232
+ color: vars.colours.intent.warning.background.strong,
233
+ backgroundColor: vars.colours.intent.warning.background.mild,
234
+ boxShadow: 'none',
235
+ },
236
+ ':active': {
237
+ color: vars.colours.intent.warning.background.strong,
238
+ backgroundColor: vars.colours.intent.warning.background.mild,
239
+ boxShadow: 'none',
240
+ },
241
+ }),
242
+ success: style({
243
+ ':hover': {
244
+ color: vars.colours.intent.success.background.strong,
245
+ backgroundColor: vars.colours.intent.success.background.mild,
246
+ boxShadow: 'none',
247
+ },
248
+ ':active': {
249
+ color: vars.colours.intent.success.background.strong,
250
+ backgroundColor: vars.colours.intent.success.background.mild,
251
+ boxShadow: 'none',
252
+ },
253
+ }),
164
254
  };
@@ -231,4 +231,40 @@ const secondaryMediumProps = {
231
231
  variant: 'secondary'
232
232
  };
233
233
  export const secondaryMedium = TemplateMulti.bind(secondaryMediumProps);
234
- secondaryMedium.args = secondaryMediumProps;
234
+ secondaryMedium.args = secondaryMediumProps;
235
+ const informationSmallProps = {
236
+ size: 'small',
237
+ variant: 'information'
238
+ };
239
+ export const informationSmall = TemplateMulti.bind(informationSmallProps);
240
+ informationSmall.args = informationSmallProps;
241
+ const informationMediumProps = {
242
+ size: 'medium',
243
+ variant: 'information'
244
+ };
245
+ export const informationMedium = TemplateMulti.bind(informationMediumProps);
246
+ informationMedium.args = informationMediumProps;
247
+ const warningSmallProps = {
248
+ size: 'small',
249
+ variant: 'warning'
250
+ };
251
+ export const warningSmall = TemplateMulti.bind(warningSmallProps);
252
+ warningSmall.args = warningSmallProps;
253
+ const warningMediumProps = {
254
+ size: 'medium',
255
+ variant: 'warning'
256
+ };
257
+ export const warningMedium = TemplateMulti.bind(warningMediumProps);
258
+ warningMedium.args = warningMediumProps;
259
+ const successSmallProps = {
260
+ size: 'small',
261
+ variant: 'success'
262
+ };
263
+ export const successSmall = TemplateMulti.bind(successSmallProps);
264
+ successSmall.args = successSmallProps;
265
+ const successMediumProps = {
266
+ size: 'medium',
267
+ variant: 'success'
268
+ };
269
+ export const successMedium = TemplateMulti.bind(successMediumProps);
270
+ successMedium.args = successMediumProps;
@@ -0,0 +1,2 @@
1
+ export declare const bubbleText: 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":"AAEA,eAAO,MAAM,UAAU,QAIrB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { style } from '@vanilla-extract/css';
2
+ export const bubbleText = style({
3
+ top: '50%',
4
+ left: '50%',
5
+ transform: 'translate(-50%, -50%)',
6
+ });
@@ -0,0 +1,9 @@
1
+ import { ComponentProps, FunctionComponent } from 'react';
2
+ import { Box } from '../Box';
3
+ import { Text } from '../Text';
4
+ export interface Props extends Omit<ComponentProps<typeof Box>, 'borderRadius' | 'position' | 'padding'> {
5
+ value: number;
6
+ textColour?: ComponentProps<typeof Text>['colour'];
7
+ }
8
+ export declare const NumberBubble: FunctionComponent<Props>;
9
+ //# sourceMappingURL=NumberBubble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberBubble.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/NumberBubble.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAgB,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI/B,MAAM,WAAW,KAChB,SAAQ,IAAI,CACX,cAAc,CAAC,OAAO,GAAG,CAAC,EAC1B,cAAc,GAAG,UAAU,GAAG,SAAS,CACvC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,KAAK,CA4BjD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import clsx from 'clsx';
2
+ import * as React from 'react';
3
+ import { Box, useBoxStyles } from '../Box';
4
+ import { Text } from '../Text';
5
+ import * as styles from './NumberBubble.css';
6
+ export const NumberBubble = ({ value, textColour = 'white', ...boxProps }) => {
7
+ const largeBubble = value > 9 || value < 0;
8
+ return (React.createElement(Box, { borderRadius: "full", backgroundColour: "gray900", display: "inlineBlock", position: "relative", padding: largeBubble ? '3' : '2', ...boxProps },
9
+ React.createElement(Text, { size: "2", strong: true, className: clsx(styles.bubbleText, useBoxStyles({
10
+ position: 'absolute',
11
+ })), colour: textColour }, value)));
12
+ };
@@ -0,0 +1,2 @@
1
+ export { NumberBubble } from './NumberBubble';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/NumberBubble/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export { NumberBubble } from './NumberBubble';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ import * as React from 'react';
10
+ import { boxArgTypes } from "../Box/argTypes.js";
11
+ import { NumberBubble } from "./index.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ export default {
14
+ title: 'Foundation/Typography/NumberBubble',
15
+ component: NumberBubble,
16
+ argTypes: {
17
+ paddingX: boxArgTypes.paddingX
18
+ }
19
+ };
20
+
21
+ const template = args => _jsx(NumberBubble, _objectSpread({}, args));
22
+
23
+ const standardProps = {
24
+ value: 0
25
+ };
26
+ export const standard = template.bind(standardProps);
27
+ standard.args = standardProps;
@@ -50,4 +50,5 @@ export * from './Tooltip';
50
50
  export * from './VisuallyHidden';
51
51
  export * from './MinimalModal';
52
52
  export * from './Image';
53
+ export * from './NumberBubble';
53
54
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,c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from './MinimalModal';
52
52
  export * from './Image';
53
+ export * from './NumberBubble';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.1.18",
3
+ "version": "4.3.0",
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",