@autoguru/overdrive 4.14.2 → 4.14.4
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/DividerLine/DividerLine.d.ts +1 -2
- package/dist/components/DividerLine/DividerLine.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.css.d.ts +1 -0
- package/dist/components/TextLink/TextLink.css.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.css.js +6 -0
- package/dist/components/TextLink/TextLink.d.ts +2 -0
- package/dist/components/TextLink/TextLink.d.ts.map +1 -1
- package/dist/components/TextLink/TextLink.js +17 -5
- package/dist/components/TextLink/stories.js +21 -1
- package/package.json +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ComponentProps, FunctionComponent } from 'react';
|
|
2
2
|
import { Box } from '../';
|
|
3
|
-
import { Tokens } from '../../themes/tokens';
|
|
4
3
|
import * as styles from './DividerLine.css';
|
|
5
4
|
interface Props {
|
|
6
5
|
isVertical?: boolean;
|
|
7
6
|
className?: string;
|
|
8
7
|
space: ComponentProps<typeof Box>['marginY'];
|
|
9
|
-
colour?:
|
|
8
|
+
colour?: ComponentProps<typeof Box>['backgroundColour'];
|
|
10
9
|
size?: keyof typeof styles.size['horizontal'];
|
|
11
10
|
}
|
|
12
11
|
export declare const DividerLine: FunctionComponent<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DividerLine.d.ts","sourceRoot":"","sources":["../../../lib/components/DividerLine/DividerLine.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"DividerLine.d.ts","sourceRoot":"","sources":["../../../lib/components/DividerLine/DividerLine.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,UAAU,KAAK;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACxD,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,KAAK,CAgBhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextLink.css.d.ts","sourceRoot":"","sources":["../../../lib/components/TextLink/TextLink.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QASf,CAAC;AAEH,eAAO,MAAM,KAAK,QAKhB,CAAC"}
|
|
1
|
+
{"version":3,"file":"TextLink.css.d.ts","sourceRoot":"","sources":["../../../lib/components/TextLink/TextLink.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,QASf,CAAC;AAEH,eAAO,MAAM,IAAI,QAKf,CAAC;AAGH,eAAO,MAAM,KAAK,QAKhB,CAAC"}
|
|
@@ -14,6 +14,12 @@ export const root = style({
|
|
|
14
14
|
boxShadow: "inset 0 -2px 0 0 ".concat(vars.typography.colour.link)
|
|
15
15
|
}
|
|
16
16
|
}, "root");
|
|
17
|
+
export const icon = style({
|
|
18
|
+
transition: "transform 0.2s ".concat(vars.animation.easing.decelerate, " 0s"),
|
|
19
|
+
right: 0,
|
|
20
|
+
top: '50%',
|
|
21
|
+
transform: 'translateY(-50%)'
|
|
22
|
+
}, "icon");
|
|
17
23
|
export const muted = style({
|
|
18
24
|
':hover': {
|
|
19
25
|
color: 'white',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconType } from '@autoguru/icons';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { AnchorHTMLAttributes, ComponentProps, ElementType, ReactElement, ReactNode } from 'react';
|
|
3
4
|
import { Text } from '../Text';
|
|
@@ -8,6 +9,7 @@ export interface Props extends TextProps, AnchorProps {
|
|
|
8
9
|
className?: string;
|
|
9
10
|
is?: ElementType | ReactElement;
|
|
10
11
|
muted?: boolean;
|
|
12
|
+
icon?: IconType;
|
|
11
13
|
}
|
|
12
14
|
export declare const TextLink: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLAnchorElement>>;
|
|
13
15
|
export default TextLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextLink.d.ts","sourceRoot":"","sources":["../../../lib/components/TextLink/TextLink.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextLink.d.ts","sourceRoot":"","sources":["../../../lib/components/TextLink/TextLink.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,oBAAoB,EAEpB,cAAc,EAEd,WAAW,EAGX,YAAY,EACZ,SAAS,EACT,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI/B,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAC;AACpE,KAAK,WAAW,GAAG,IAAI,CACtB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,SAAS,CAC7C,CAAC;AAEF,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,WAAW;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,QAAQ,iFAoEpB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["is", "children", "className", "strong", "fontWeight", "muted", "size"];
|
|
5
|
+
const _excluded = ["is", "children", "className", "strong", "fontWeight", "muted", "size", "icon"];
|
|
6
6
|
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; }
|
|
7
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
8
|
import { invariant } from '@autoguru/utilities';
|
|
@@ -10,9 +10,11 @@ import clsx from 'clsx';
|
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import { cloneElement, createElement, forwardRef, isValidElement } from 'react';
|
|
12
12
|
import { Box, useBoxStyles } from "../Box/index.js";
|
|
13
|
+
import { Icon } from "../Icon/index.js";
|
|
13
14
|
import { Text } from "../Text/index.js";
|
|
14
15
|
import * as styles from "./TextLink.css.js";
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
export const TextLink = forwardRef((_ref, ref) => {
|
|
17
19
|
var _props$rel;
|
|
18
20
|
let {
|
|
@@ -22,11 +24,12 @@ export const TextLink = forwardRef((_ref, ref) => {
|
|
|
22
24
|
strong,
|
|
23
25
|
fontWeight = 'semiBold',
|
|
24
26
|
muted = false,
|
|
25
|
-
size
|
|
27
|
+
size,
|
|
28
|
+
icon
|
|
26
29
|
} = _ref,
|
|
27
30
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
31
|
!!(Component !== undefined && props.href !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, 'You cannot have both href and as defined.') : invariant(false) : void 0;
|
|
29
|
-
const body =
|
|
32
|
+
const body = _jsxs(Text, {
|
|
30
33
|
is: "span",
|
|
31
34
|
colour: muted ? 'muted' : 'link',
|
|
32
35
|
size: size,
|
|
@@ -34,11 +37,20 @@ export const TextLink = forwardRef((_ref, ref) => {
|
|
|
34
37
|
strong: strong,
|
|
35
38
|
className: clsx(useBoxStyles({
|
|
36
39
|
is: 'span',
|
|
37
|
-
pointerEvents: 'none'
|
|
40
|
+
pointerEvents: 'none',
|
|
41
|
+
position: 'relative',
|
|
42
|
+
paddingRight: icon ? '5' : void 0
|
|
38
43
|
}), {
|
|
39
44
|
[styles.muted]: muted
|
|
40
45
|
}),
|
|
41
|
-
children: children
|
|
46
|
+
children: [children, icon ? _jsx(Icon, {
|
|
47
|
+
icon: icon,
|
|
48
|
+
size: "small",
|
|
49
|
+
display: "inlineBlock",
|
|
50
|
+
className: clsx(styles.icon, useBoxStyles({
|
|
51
|
+
position: 'absolute'
|
|
52
|
+
}))
|
|
53
|
+
}) : null]
|
|
42
54
|
});
|
|
43
55
|
const allProps = _objectSpread(_objectSpread({
|
|
44
56
|
rel: (_props$rel = props.rel) !== null && _props$rel !== void 0 ? _props$rel : 'noopener noreferrer'
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
|
+
import { ArrowRightIcon, ChevronRightIcon } from '@autoguru/icons';
|
|
6
7
|
import * as React from 'react';
|
|
7
8
|
import { Box } from "../Box/index.js";
|
|
8
9
|
import { Text } from "../Text/index.js";
|
|
@@ -12,6 +13,10 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
13
|
const sizeScale = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
13
14
|
const alignOptions = ['left', 'center', 'right'];
|
|
14
15
|
const fontWeightOptions = ['normal', 'semiBold', 'bold'];
|
|
16
|
+
const iconOptions = {
|
|
17
|
+
ArrowRightIcon,
|
|
18
|
+
ChevronRightIcon
|
|
19
|
+
};
|
|
15
20
|
const noWrapOptions = [false, true];
|
|
16
21
|
const transformOptions = ['uppercase', 'capitalize', undefined];
|
|
17
22
|
export default {
|
|
@@ -26,6 +31,14 @@ export default {
|
|
|
26
31
|
children: story()
|
|
27
32
|
})],
|
|
28
33
|
argTypes: {
|
|
34
|
+
icon: {
|
|
35
|
+
defaultValue: void 0,
|
|
36
|
+
description: 'Input field Icon',
|
|
37
|
+
options: iconOptions,
|
|
38
|
+
control: {
|
|
39
|
+
type: 'select'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
29
42
|
noWrap: {
|
|
30
43
|
options: noWrapOptions,
|
|
31
44
|
defaultValue: false,
|
|
@@ -88,4 +101,11 @@ const standardProps = {
|
|
|
88
101
|
export const standard = Template.bind(standardProps);
|
|
89
102
|
standard.args = standardProps;
|
|
90
103
|
export const insideParagraph = InsideParagraphTemplate.bind(standardProps);
|
|
91
|
-
insideParagraph.args = standardProps;
|
|
104
|
+
insideParagraph.args = standardProps;
|
|
105
|
+
const withIconProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
106
|
+
icon: ArrowRightIcon
|
|
107
|
+
});
|
|
108
|
+
export const withIcon = Template.bind(withIconProps);
|
|
109
|
+
withIcon.args = withIconProps;
|
|
110
|
+
export const withIconInsideParagraph = InsideParagraphTemplate.bind(withIconProps);
|
|
111
|
+
withIconInsideParagraph.args = withIconProps;
|