@veeqo/ui 16.1.0 → 16.2.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/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.cjs +37 -15
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.cjs.map +1 -1
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.d.ts +13 -3
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.js +38 -16
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.js.map +1 -1
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss.cjs +2 -2
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss.cjs.map +1 -1
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss.js +2 -2
- package/dist/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss.js.map +1 -1
- package/dist/components/LoginWithAmazonButton/index.d.ts +1 -0
- package/dist/components/LoginWithAmazonButton/types.d.ts +25 -0
- package/dist/components/Skeleton/Skeleton.cjs +11 -0
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +13 -0
- package/dist/components/Skeleton/Skeleton.js +11 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,29 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var LoginWithAmazonButton_module = require('./LoginWithAmazonButton.module.scss.cjs');
|
|
5
|
+
var buildClassnames = require('../../utils/buildClassnames.cjs');
|
|
6
|
+
require('uid/secure');
|
|
7
|
+
var Action = require('../Action/Action.cjs');
|
|
5
8
|
|
|
6
9
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
10
|
|
|
8
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
9
12
|
|
|
10
|
-
const buttonImg = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa/btnLWA_gold_312x64.png';
|
|
11
|
-
const buttonPressedImg = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa/btnLWA_gold_312x64_pressed.png';
|
|
12
13
|
const buttonDescription = 'Log in with Amazon';
|
|
14
|
+
const LWA_IMAGE_BASE = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa';
|
|
15
|
+
/** Amazon's abbreviated colour code used in the button asset filenames. */
|
|
16
|
+
const VARIANT_COLOR = {
|
|
17
|
+
gold: 'gold',
|
|
18
|
+
darkgray: 'drkgry',
|
|
19
|
+
lightgray: 'gry',
|
|
20
|
+
};
|
|
21
|
+
/** Intrinsic pixel dimensions of the button asset for each size. */
|
|
22
|
+
const SIZE_DIMENSIONS = {
|
|
23
|
+
base: '312x64',
|
|
24
|
+
sm: '152x64',
|
|
25
|
+
xs: '64x64',
|
|
26
|
+
};
|
|
27
|
+
/** Rendered size (half the 2x asset). Set on the <img> so the browser reserves space before load (CLS). */
|
|
28
|
+
const RENDERED_SIZE = {
|
|
29
|
+
base: { width: 156, height: 32 },
|
|
30
|
+
sm: { width: 76, height: 32 },
|
|
31
|
+
xs: { width: 32, height: 32 },
|
|
32
|
+
};
|
|
33
|
+
const lwaImageSrc = (variant, size, pressed) => `${LWA_IMAGE_BASE}/btnLWA_${VARIANT_COLOR[variant]}_${SIZE_DIMENSIONS[size]}${pressed ? '_pressed' : ''}.png`;
|
|
13
34
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Amazon button guidelines
|
|
35
|
+
* A "Log in with Amazon" button rendered from Amazon's official button artwork,
|
|
36
|
+
* in line with the [Login with Amazon button guidelines](https://developer.amazon.com/docs/login-with-amazon/button.html).
|
|
37
|
+
*
|
|
38
|
+
* Built on `Action` (`appearance="unstyled"`), so it inherits Action's reset, native
|
|
39
|
+
* `disabled` handling and data-attribute support. The button swaps to its pressed artwork
|
|
40
|
+
* via `:active`, so mouse, touch and keyboard activation all show it. Colour is chosen with
|
|
41
|
+
* `variant` (gold / darkgray / lightgray) and dimensions with `size` (base / sm / xs); the
|
|
42
|
+
* two together select the exact asset. The accessible name defaults to "Log in with Amazon"
|
|
43
|
+
* and can be overridden via `aria-label` for localisation.
|
|
44
|
+
*
|
|
45
|
+
* @summary official Amazon sign-in button
|
|
16
46
|
*/
|
|
17
|
-
const LoginWithAmazonButton = (props) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
setImage(buttonPressedImg);
|
|
21
|
-
};
|
|
22
|
-
const handleMouseUp = () => {
|
|
23
|
-
setImage(buttonImg);
|
|
24
|
-
};
|
|
25
|
-
return (React__default.default.createElement("button", { type: "button", className: LoginWithAmazonButton_module.loginButton, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, "aria-label": buttonDescription, ...props },
|
|
26
|
-
React__default.default.createElement("img", { src: image, alt: buttonDescription })));
|
|
27
|
-
};
|
|
47
|
+
const LoginWithAmazonButton = ({ variant = 'gold', size = 'base', className, ...props }) => (React__default.default.createElement(Action.Action, { "aria-label": buttonDescription, ...props, appearance: "unstyled", className: buildClassnames.buildClassnames([LoginWithAmazonButton_module.loginButton, className]) },
|
|
48
|
+
React__default.default.createElement("img", { className: LoginWithAmazonButton_module['default-state'], src: lwaImageSrc(variant, size, false), alt: "", ...RENDERED_SIZE[size] }),
|
|
49
|
+
React__default.default.createElement("img", { className: LoginWithAmazonButton_module['pressed-state'], src: lwaImageSrc(variant, size, true), alt: "", ...RENDERED_SIZE[size] })));
|
|
28
50
|
|
|
29
51
|
exports.LoginWithAmazonButton = LoginWithAmazonButton;
|
|
30
52
|
exports.buttonDescription = buttonDescription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginWithAmazonButton.cjs","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"LoginWithAmazonButton.cjs","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.tsx"],"sourcesContent":["import React from 'react';\nimport styles from './LoginWithAmazonButton.module.scss';\nimport { buildClassnames } from '../../utils';\nimport { Action } from '../Action';\nimport type {\n LoginWithAmazonButtonProps,\n LoginWithAmazonButtonSize,\n LoginWithAmazonButtonVariant,\n} from './types';\n\nexport const buttonDescription = 'Log in with Amazon';\n\nconst LWA_IMAGE_BASE = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa';\n\n/** Amazon's abbreviated colour code used in the button asset filenames. */\nconst VARIANT_COLOR: Record<LoginWithAmazonButtonVariant, string> = {\n gold: 'gold',\n darkgray: 'drkgry',\n lightgray: 'gry',\n};\n\n/** Intrinsic pixel dimensions of the button asset for each size. */\nconst SIZE_DIMENSIONS: Record<LoginWithAmazonButtonSize, string> = {\n base: '312x64',\n sm: '152x64',\n xs: '64x64',\n};\n\n/** Rendered size (half the 2x asset). Set on the <img> so the browser reserves space before load (CLS). */\nconst RENDERED_SIZE: Record<LoginWithAmazonButtonSize, { width: number; height: number }> = {\n base: { width: 156, height: 32 },\n sm: { width: 76, height: 32 },\n xs: { width: 32, height: 32 },\n};\n\nconst lwaImageSrc = (\n variant: LoginWithAmazonButtonVariant,\n size: LoginWithAmazonButtonSize,\n pressed: boolean,\n) =>\n `${LWA_IMAGE_BASE}/btnLWA_${VARIANT_COLOR[variant]}_${SIZE_DIMENSIONS[size]}${pressed ? '_pressed' : ''}.png`;\n\n/**\n * A \"Log in with Amazon\" button rendered from Amazon's official button artwork,\n * in line with the [Login with Amazon button guidelines](https://developer.amazon.com/docs/login-with-amazon/button.html).\n *\n * Built on `Action` (`appearance=\"unstyled\"`), so it inherits Action's reset, native\n * `disabled` handling and data-attribute support. The button swaps to its pressed artwork\n * via `:active`, so mouse, touch and keyboard activation all show it. Colour is chosen with\n * `variant` (gold / darkgray / lightgray) and dimensions with `size` (base / sm / xs); the\n * two together select the exact asset. The accessible name defaults to \"Log in with Amazon\"\n * and can be overridden via `aria-label` for localisation.\n *\n * @summary official Amazon sign-in button\n */\nexport const LoginWithAmazonButton = ({\n variant = 'gold',\n size = 'base',\n className,\n ...props\n}: LoginWithAmazonButtonProps) => (\n <Action\n aria-label={buttonDescription}\n {...props}\n appearance=\"unstyled\"\n className={buildClassnames([styles.loginButton, className])}\n >\n {/* Both images are rendered so the pressed artwork is preloaded; CSS shows one at a time.\n They are decorative (alt=\"\") because the button's aria-label carries the accessible name. */}\n <img\n className={styles['default-state']}\n src={lwaImageSrc(variant, size, false)}\n alt=\"\"\n {...RENDERED_SIZE[size]}\n />\n <img\n className={styles['pressed-state']}\n src={lwaImageSrc(variant, size, true)}\n alt=\"\"\n {...RENDERED_SIZE[size]}\n />\n </Action>\n);\n"],"names":["React","Action","buildClassnames","styles"],"mappings":";;;;;;;;;;;;AAUO,MAAM,iBAAiB,GAAG;AAEjC,MAAM,cAAc,GAAG,yDAAyD;AAEhF;AACA,MAAM,aAAa,GAAiD;AAClE,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,SAAS,EAAE,KAAK;CACjB;AAED;AACA,MAAM,eAAe,GAA8C;AACjE,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,EAAE,EAAE,OAAO;CACZ;AAED;AACA,MAAM,aAAa,GAAyE;IAC1F,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;IAChC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC7B,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;CAC9B;AAED,MAAM,WAAW,GAAG,CAClB,OAAqC,EACrC,IAA+B,EAC/B,OAAgB,KAEhB,CAAA,EAAG,cAAc,CAAA,QAAA,EAAW,aAAa,CAAC,OAAO,CAAC,CAAA,CAAA,EAAI,eAAe,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,UAAU,GAAG,EAAE,MAAM;AAE/G;;;;;;;;;;;;AAYG;MACU,qBAAqB,GAAG,CAAC,EACpC,OAAO,GAAG,MAAM,EAChB,IAAI,GAAG,MAAM,EACb,SAAS,EACT,GAAG,KAAK,EACmB,MAC3BA,sBAAA,CAAA,aAAA,CAACC,aAAM,kBACO,iBAAiB,EAAA,GACzB,KAAK,EACT,UAAU,EAAC,UAAU,EACrB,SAAS,EAAEC,+BAAe,CAAC,CAACC,4BAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,EAAA;IAI3DH,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEG,4BAAM,CAAC,eAAe,CAAC,EAClC,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EACtC,GAAG,EAAC,EAAE,EAAA,GACF,aAAa,CAAC,IAAI,CAAC,EAAA,CACvB;AACF,IAAAH,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEG,4BAAM,CAAC,eAAe,CAAC,EAClC,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EACrC,GAAG,EAAC,EAAE,EAAA,GACF,aAAa,CAAC,IAAI,CAAC,EAAA,CACvB,CACK;;;;;"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { LoginWithAmazonButtonProps } from './types';
|
|
2
3
|
export declare const buttonDescription = "Log in with Amazon";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Amazon button guidelines
|
|
5
|
+
* A "Log in with Amazon" button rendered from Amazon's official button artwork,
|
|
6
|
+
* in line with the [Login with Amazon button guidelines](https://developer.amazon.com/docs/login-with-amazon/button.html).
|
|
7
|
+
*
|
|
8
|
+
* Built on `Action` (`appearance="unstyled"`), so it inherits Action's reset, native
|
|
9
|
+
* `disabled` handling and data-attribute support. The button swaps to its pressed artwork
|
|
10
|
+
* via `:active`, so mouse, touch and keyboard activation all show it. Colour is chosen with
|
|
11
|
+
* `variant` (gold / darkgray / lightgray) and dimensions with `size` (base / sm / xs); the
|
|
12
|
+
* two together select the exact asset. The accessible name defaults to "Log in with Amazon"
|
|
13
|
+
* and can be overridden via `aria-label` for localisation.
|
|
14
|
+
*
|
|
15
|
+
* @summary official Amazon sign-in button
|
|
6
16
|
*/
|
|
7
|
-
export declare const LoginWithAmazonButton: React.
|
|
17
|
+
export declare const LoginWithAmazonButton: ({ variant, size, className, ...props }: LoginWithAmazonButtonProps) => React.JSX.Element;
|
|
@@ -1,24 +1,46 @@
|
|
|
1
|
-
import React__default
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import styles from './LoginWithAmazonButton.module.scss.js';
|
|
3
|
+
import { buildClassnames } from '../../utils/buildClassnames.js';
|
|
4
|
+
import 'uid/secure';
|
|
5
|
+
import { Action } from '../Action/Action.js';
|
|
3
6
|
|
|
4
|
-
const buttonImg = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa/btnLWA_gold_312x64.png';
|
|
5
|
-
const buttonPressedImg = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa/btnLWA_gold_312x64_pressed.png';
|
|
6
7
|
const buttonDescription = 'Log in with Amazon';
|
|
8
|
+
const LWA_IMAGE_BASE = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa';
|
|
9
|
+
/** Amazon's abbreviated colour code used in the button asset filenames. */
|
|
10
|
+
const VARIANT_COLOR = {
|
|
11
|
+
gold: 'gold',
|
|
12
|
+
darkgray: 'drkgry',
|
|
13
|
+
lightgray: 'gry',
|
|
14
|
+
};
|
|
15
|
+
/** Intrinsic pixel dimensions of the button asset for each size. */
|
|
16
|
+
const SIZE_DIMENSIONS = {
|
|
17
|
+
base: '312x64',
|
|
18
|
+
sm: '152x64',
|
|
19
|
+
xs: '64x64',
|
|
20
|
+
};
|
|
21
|
+
/** Rendered size (half the 2x asset). Set on the <img> so the browser reserves space before load (CLS). */
|
|
22
|
+
const RENDERED_SIZE = {
|
|
23
|
+
base: { width: 156, height: 32 },
|
|
24
|
+
sm: { width: 76, height: 32 },
|
|
25
|
+
xs: { width: 32, height: 32 },
|
|
26
|
+
};
|
|
27
|
+
const lwaImageSrc = (variant, size, pressed) => `${LWA_IMAGE_BASE}/btnLWA_${VARIANT_COLOR[variant]}_${SIZE_DIMENSIONS[size]}${pressed ? '_pressed' : ''}.png`;
|
|
7
28
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Amazon button guidelines
|
|
29
|
+
* A "Log in with Amazon" button rendered from Amazon's official button artwork,
|
|
30
|
+
* in line with the [Login with Amazon button guidelines](https://developer.amazon.com/docs/login-with-amazon/button.html).
|
|
31
|
+
*
|
|
32
|
+
* Built on `Action` (`appearance="unstyled"`), so it inherits Action's reset, native
|
|
33
|
+
* `disabled` handling and data-attribute support. The button swaps to its pressed artwork
|
|
34
|
+
* via `:active`, so mouse, touch and keyboard activation all show it. Colour is chosen with
|
|
35
|
+
* `variant` (gold / darkgray / lightgray) and dimensions with `size` (base / sm / xs); the
|
|
36
|
+
* two together select the exact asset. The accessible name defaults to "Log in with Amazon"
|
|
37
|
+
* and can be overridden via `aria-label` for localisation.
|
|
38
|
+
*
|
|
39
|
+
* @summary official Amazon sign-in button
|
|
10
40
|
*/
|
|
11
|
-
const LoginWithAmazonButton = (props) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setImage(buttonPressedImg);
|
|
15
|
-
};
|
|
16
|
-
const handleMouseUp = () => {
|
|
17
|
-
setImage(buttonImg);
|
|
18
|
-
};
|
|
19
|
-
return (React__default.createElement("button", { type: "button", className: styles.loginButton, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, "aria-label": buttonDescription, ...props },
|
|
20
|
-
React__default.createElement("img", { src: image, alt: buttonDescription })));
|
|
21
|
-
};
|
|
41
|
+
const LoginWithAmazonButton = ({ variant = 'gold', size = 'base', className, ...props }) => (React__default.createElement(Action, { "aria-label": buttonDescription, ...props, appearance: "unstyled", className: buildClassnames([styles.loginButton, className]) },
|
|
42
|
+
React__default.createElement("img", { className: styles['default-state'], src: lwaImageSrc(variant, size, false), alt: "", ...RENDERED_SIZE[size] }),
|
|
43
|
+
React__default.createElement("img", { className: styles['pressed-state'], src: lwaImageSrc(variant, size, true), alt: "", ...RENDERED_SIZE[size] })));
|
|
22
44
|
|
|
23
45
|
export { LoginWithAmazonButton, buttonDescription };
|
|
24
46
|
//# sourceMappingURL=LoginWithAmazonButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginWithAmazonButton.js","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"LoginWithAmazonButton.js","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.tsx"],"sourcesContent":["import React from 'react';\nimport styles from './LoginWithAmazonButton.module.scss';\nimport { buildClassnames } from '../../utils';\nimport { Action } from '../Action';\nimport type {\n LoginWithAmazonButtonProps,\n LoginWithAmazonButtonSize,\n LoginWithAmazonButtonVariant,\n} from './types';\n\nexport const buttonDescription = 'Log in with Amazon';\n\nconst LWA_IMAGE_BASE = 'https://images-na.ssl-images-amazon.com/images/G/01/lwa';\n\n/** Amazon's abbreviated colour code used in the button asset filenames. */\nconst VARIANT_COLOR: Record<LoginWithAmazonButtonVariant, string> = {\n gold: 'gold',\n darkgray: 'drkgry',\n lightgray: 'gry',\n};\n\n/** Intrinsic pixel dimensions of the button asset for each size. */\nconst SIZE_DIMENSIONS: Record<LoginWithAmazonButtonSize, string> = {\n base: '312x64',\n sm: '152x64',\n xs: '64x64',\n};\n\n/** Rendered size (half the 2x asset). Set on the <img> so the browser reserves space before load (CLS). */\nconst RENDERED_SIZE: Record<LoginWithAmazonButtonSize, { width: number; height: number }> = {\n base: { width: 156, height: 32 },\n sm: { width: 76, height: 32 },\n xs: { width: 32, height: 32 },\n};\n\nconst lwaImageSrc = (\n variant: LoginWithAmazonButtonVariant,\n size: LoginWithAmazonButtonSize,\n pressed: boolean,\n) =>\n `${LWA_IMAGE_BASE}/btnLWA_${VARIANT_COLOR[variant]}_${SIZE_DIMENSIONS[size]}${pressed ? '_pressed' : ''}.png`;\n\n/**\n * A \"Log in with Amazon\" button rendered from Amazon's official button artwork,\n * in line with the [Login with Amazon button guidelines](https://developer.amazon.com/docs/login-with-amazon/button.html).\n *\n * Built on `Action` (`appearance=\"unstyled\"`), so it inherits Action's reset, native\n * `disabled` handling and data-attribute support. The button swaps to its pressed artwork\n * via `:active`, so mouse, touch and keyboard activation all show it. Colour is chosen with\n * `variant` (gold / darkgray / lightgray) and dimensions with `size` (base / sm / xs); the\n * two together select the exact asset. The accessible name defaults to \"Log in with Amazon\"\n * and can be overridden via `aria-label` for localisation.\n *\n * @summary official Amazon sign-in button\n */\nexport const LoginWithAmazonButton = ({\n variant = 'gold',\n size = 'base',\n className,\n ...props\n}: LoginWithAmazonButtonProps) => (\n <Action\n aria-label={buttonDescription}\n {...props}\n appearance=\"unstyled\"\n className={buildClassnames([styles.loginButton, className])}\n >\n {/* Both images are rendered so the pressed artwork is preloaded; CSS shows one at a time.\n They are decorative (alt=\"\") because the button's aria-label carries the accessible name. */}\n <img\n className={styles['default-state']}\n src={lwaImageSrc(variant, size, false)}\n alt=\"\"\n {...RENDERED_SIZE[size]}\n />\n <img\n className={styles['pressed-state']}\n src={lwaImageSrc(variant, size, true)}\n alt=\"\"\n {...RENDERED_SIZE[size]}\n />\n </Action>\n);\n"],"names":["React"],"mappings":";;;;;;AAUO,MAAM,iBAAiB,GAAG;AAEjC,MAAM,cAAc,GAAG,yDAAyD;AAEhF;AACA,MAAM,aAAa,GAAiD;AAClE,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,SAAS,EAAE,KAAK;CACjB;AAED;AACA,MAAM,eAAe,GAA8C;AACjE,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,EAAE,EAAE,OAAO;CACZ;AAED;AACA,MAAM,aAAa,GAAyE;IAC1F,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;IAChC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC7B,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;CAC9B;AAED,MAAM,WAAW,GAAG,CAClB,OAAqC,EACrC,IAA+B,EAC/B,OAAgB,KAEhB,CAAA,EAAG,cAAc,CAAA,QAAA,EAAW,aAAa,CAAC,OAAO,CAAC,CAAA,CAAA,EAAI,eAAe,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,UAAU,GAAG,EAAE,MAAM;AAE/G;;;;;;;;;;;;AAYG;MACU,qBAAqB,GAAG,CAAC,EACpC,OAAO,GAAG,MAAM,EAChB,IAAI,GAAG,MAAM,EACb,SAAS,EACT,GAAG,KAAK,EACmB,MAC3BA,cAAA,CAAA,aAAA,CAAC,MAAM,kBACO,iBAAiB,EAAA,GACzB,KAAK,EACT,UAAU,EAAC,UAAU,EACrB,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,EAAA;IAI3DA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAClC,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EACtC,GAAG,EAAC,EAAE,EAAA,GACF,aAAa,CAAC,IAAI,CAAC,EAAA,CACvB;AACF,IAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAClC,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EACrC,GAAG,EAAC,EAAE,EAAA,GACF,aAAa,CAAC,IAAI,CAAC,EAAA,CACvB,CACK;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
4
|
|
|
5
|
-
___$insertStyle(".
|
|
6
|
-
var styles = {"loginButton":"
|
|
5
|
+
___$insertStyle("._loginButton_1aojq_1 {\n --lwa-outline-width: var(--sizes-xs);\n --lwa-highlight-color: var(--colors-secondary-blue-light);\n}\n._loginButton_1aojq_1 img {\n display: block;\n}\n._loginButton_1aojq_1:hover:not(:disabled) {\n opacity: 0.9;\n}\n._loginButton_1aojq_1:focus-visible {\n outline: var(--lwa-outline-width) solid var(--lwa-highlight-color);\n}\n._loginButton_1aojq_1:disabled, ._loginButton_1aojq_1:disabled:hover {\n cursor: not-allowed;\n opacity: 0.5;\n}\n._loginButton_1aojq_1 ._pressed-state_1aojq_18, ._loginButton_1aojq_1:active:not(:disabled) ._default-state_1aojq_18 {\n display: none;\n}\n._loginButton_1aojq_1:active:not(:disabled) ._pressed-state_1aojq_18 {\n display: block;\n}");
|
|
6
|
+
var styles = {"loginButton":"_loginButton_1aojq_1","pressed-state":"_pressed-state_1aojq_18","default-state":"_default-state_1aojq_18"};
|
|
7
7
|
|
|
8
8
|
module.exports = styles;
|
|
9
9
|
//# sourceMappingURL=LoginWithAmazonButton.module.scss.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginWithAmazonButton.module.scss.cjs","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss"],"sourcesContent":[".loginButton {\n
|
|
1
|
+
{"version":3,"file":"LoginWithAmazonButton.module.scss.cjs","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss"],"sourcesContent":["// Reset (appearance/border/background/padding/cursor) comes from Action's `unstyled` appearance.\n// Image dimensions are set via width/height attributes on the <img> (see RENDERED_SIZE in the\n// component) so the browser reserves space before load.\n.loginButton {\n --lwa-outline-width: var(--sizes-xs);\n --lwa-highlight-color: var(--colors-secondary-blue-light);\n\n img {\n display: block;\n }\n\n // The fill is fixed raster artwork, so a background hover would be invisible;\n // a slight dim is the treatment Amazon's own LWA guidelines use.\n &:hover:not(:disabled) {\n opacity: 0.9;\n }\n\n &:focus-visible {\n outline: var(--lwa-outline-width) solid var(--lwa-highlight-color);\n }\n\n // `&:disabled:hover` out-specifies Action's reset `:hover { cursor: pointer }`,\n // which would otherwise win depending on stylesheet load order.\n &:disabled,\n &:disabled:hover {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .pressed-state,\n &:active:not(:disabled) .default-state {\n display: none;\n }\n\n &:active:not(:disabled) .pressed-state {\n display: block;\n }\n}\n"],"names":[],"mappings":";;;;AAIE,eAAA,CAAA,wsBAAA;AACA,aAAA,CAAA,aAAA,CAAA,sBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,eAAA,CAAA,yBAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
2
|
|
|
3
|
-
insertStyle(".
|
|
4
|
-
var styles = {"loginButton":"
|
|
3
|
+
insertStyle("._loginButton_1aojq_1 {\n --lwa-outline-width: var(--sizes-xs);\n --lwa-highlight-color: var(--colors-secondary-blue-light);\n}\n._loginButton_1aojq_1 img {\n display: block;\n}\n._loginButton_1aojq_1:hover:not(:disabled) {\n opacity: 0.9;\n}\n._loginButton_1aojq_1:focus-visible {\n outline: var(--lwa-outline-width) solid var(--lwa-highlight-color);\n}\n._loginButton_1aojq_1:disabled, ._loginButton_1aojq_1:disabled:hover {\n cursor: not-allowed;\n opacity: 0.5;\n}\n._loginButton_1aojq_1 ._pressed-state_1aojq_18, ._loginButton_1aojq_1:active:not(:disabled) ._default-state_1aojq_18 {\n display: none;\n}\n._loginButton_1aojq_1:active:not(:disabled) ._pressed-state_1aojq_18 {\n display: block;\n}");
|
|
4
|
+
var styles = {"loginButton":"_loginButton_1aojq_1","pressed-state":"_pressed-state_1aojq_18","default-state":"_default-state_1aojq_18"};
|
|
5
5
|
|
|
6
6
|
export { styles as default };
|
|
7
7
|
//# sourceMappingURL=LoginWithAmazonButton.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginWithAmazonButton.module.scss.js","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss"],"sourcesContent":[".loginButton {\n
|
|
1
|
+
{"version":3,"file":"LoginWithAmazonButton.module.scss.js","sources":["../../../src/components/LoginWithAmazonButton/LoginWithAmazonButton.module.scss"],"sourcesContent":["// Reset (appearance/border/background/padding/cursor) comes from Action's `unstyled` appearance.\n// Image dimensions are set via width/height attributes on the <img> (see RENDERED_SIZE in the\n// component) so the browser reserves space before load.\n.loginButton {\n --lwa-outline-width: var(--sizes-xs);\n --lwa-highlight-color: var(--colors-secondary-blue-light);\n\n img {\n display: block;\n }\n\n // The fill is fixed raster artwork, so a background hover would be invisible;\n // a slight dim is the treatment Amazon's own LWA guidelines use.\n &:hover:not(:disabled) {\n opacity: 0.9;\n }\n\n &:focus-visible {\n outline: var(--lwa-outline-width) solid var(--lwa-highlight-color);\n }\n\n // `&:disabled:hover` out-specifies Action's reset `:hover { cursor: pointer }`,\n // which would otherwise win depending on stylesheet load order.\n &:disabled,\n &:disabled:hover {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .pressed-state,\n &:active:not(:disabled) .default-state {\n display: none;\n }\n\n &:active:not(:disabled) .pressed-state {\n display: block;\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AAIEA,WAAA,CAAA,wsBAAA;AACA,aAAA,CAAA,aAAA,CAAA,sBAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,eAAA,CAAA,yBAAA;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ActionProps } from '../Action';
|
|
2
|
+
export type LoginWithAmazonButtonVariant = 'gold' | 'darkgray' | 'lightgray';
|
|
3
|
+
export type LoginWithAmazonButtonSize = 'base' | 'sm' | 'xs';
|
|
4
|
+
/**
|
|
5
|
+
* Built on `Action` with the `unstyled` appearance. The Action props that would fight
|
|
6
|
+
* the fixed Amazon artwork are removed: `children`/`iconSlot`/`dropdown` (the artwork IS
|
|
7
|
+
* the content), `href`/`as` (always a `<button>`), Action's own `variant`/`size`/
|
|
8
|
+
* `appearance` (replaced by the artwork-specific ones below), and `loading` (Action's
|
|
9
|
+
* spinner is absolutely positioned against `.base`, which `unstyled` does not apply, so
|
|
10
|
+
* it would render outside the button).
|
|
11
|
+
*/
|
|
12
|
+
export type LoginWithAmazonButtonProps = Omit<ActionProps<'button'>, 'appearance' | 'as' | 'children' | 'dropdown' | 'href' | 'iconSlot' | 'loading' | 'size' | 'variant'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Official Amazon button colour. `gold` is Amazon's recommended default;
|
|
15
|
+
* use `darkgray` on light surfaces and `lightgray` on dark surfaces where
|
|
16
|
+
* gold lacks contrast. Selects the hardcoded Amazon artwork — not themeable.
|
|
17
|
+
*/
|
|
18
|
+
variant?: LoginWithAmazonButtonVariant;
|
|
19
|
+
/**
|
|
20
|
+
* Button size, selecting both the rendered dimensions and the matching artwork.
|
|
21
|
+
* `base` (156×32) and `sm` (76×32) are wide badges; `xs` (32×32) is Amazon's
|
|
22
|
+
* square icon-only mark, so it is a different aspect ratio rather than a smaller badge.
|
|
23
|
+
*/
|
|
24
|
+
size?: LoginWithAmazonButtonSize;
|
|
25
|
+
};
|
|
@@ -10,6 +10,17 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Skeleton is a shimmering placeholder shown while content is loading, giving a
|
|
15
|
+
* consistent sense of where content will appear before it arrives. Size it with
|
|
16
|
+
* `width` and `height` to match the content it stands in for.
|
|
17
|
+
*
|
|
18
|
+
* It is intentionally barebones and is hidden from screen readers
|
|
19
|
+
* (`aria-hidden`). Loading must be communicated to assistive technology at the
|
|
20
|
+
* container or page level using `aria-busy` and a `ScreenReaderOnly` label.
|
|
21
|
+
*
|
|
22
|
+
* @summary loading placeholder for content
|
|
23
|
+
*/
|
|
13
24
|
const Skeleton = ({ width, height, style, className, ...rest }) => {
|
|
14
25
|
return (React__default.default.createElement("div", { "aria-hidden": "true", style: { ...assignCssVars.assignCssVars({ width, height }), ...style }, className: buildClassnames.buildClassnames([Skeleton_module.skeleton, className]), ...rest }));
|
|
15
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.cjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { HTMLAttributes } from 'react';\n\nimport { buildClassnames } from '../../utils';\nimport { assignCssVars } from '../../utils/assignCssVars';\n\nimport styles from './Skeleton.module.scss';\n\ntype SkeletonProps = HTMLAttributes<HTMLDivElement> & {\n width?: string;\n height?: string;\n};\n\nexport const Skeleton = ({ width, height, style, className, ...rest }: SkeletonProps) => {\n return (\n <div\n aria-hidden=\"true\"\n style={{ ...assignCssVars({ width, height }), ...style }}\n className={buildClassnames([styles.skeleton, className])}\n {...rest}\n />\n );\n};\n"],"names":["React","assignCssVars","buildClassnames","styles"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Skeleton.cjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { HTMLAttributes } from 'react';\n\nimport { buildClassnames } from '../../utils';\nimport { assignCssVars } from '../../utils/assignCssVars';\n\nimport styles from './Skeleton.module.scss';\n\ntype SkeletonProps = HTMLAttributes<HTMLDivElement> & {\n /** Width of the placeholder as any CSS length. Defaults to `100%`. */\n width?: string;\n /** Height of the placeholder as any CSS length. Defaults to `20px`. */\n height?: string;\n};\n\n/**\n * Skeleton is a shimmering placeholder shown while content is loading, giving a\n * consistent sense of where content will appear before it arrives. Size it with\n * `width` and `height` to match the content it stands in for.\n *\n * It is intentionally barebones and is hidden from screen readers\n * (`aria-hidden`). Loading must be communicated to assistive technology at the\n * container or page level using `aria-busy` and a `ScreenReaderOnly` label.\n *\n * @summary loading placeholder for content\n */\nexport const Skeleton = ({ width, height, style, className, ...rest }: SkeletonProps) => {\n return (\n <div\n aria-hidden=\"true\"\n style={{ ...assignCssVars({ width, height }), ...style }}\n className={buildClassnames([styles.skeleton, className])}\n {...rest}\n />\n );\n};\n"],"names":["React","assignCssVars","buildClassnames","styles"],"mappings":";;;;;;;;;;;;AAcA;;;;;;;;;;AAUG;AACI,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB,KAAI;AACtF,IAAA,QACEA,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,MAAM,EAClB,KAAK,EAAE,EAAE,GAAGC,2BAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,EACxD,SAAS,EAAEC,+BAAe,CAAC,CAACC,eAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,KACpD,IAAI,EAAA,CACR;AAEN;;;;"}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
type SkeletonProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
/** Width of the placeholder as any CSS length. Defaults to `100%`. */
|
|
3
4
|
width?: string;
|
|
5
|
+
/** Height of the placeholder as any CSS length. Defaults to `20px`. */
|
|
4
6
|
height?: string;
|
|
5
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Skeleton is a shimmering placeholder shown while content is loading, giving a
|
|
10
|
+
* consistent sense of where content will appear before it arrives. Size it with
|
|
11
|
+
* `width` and `height` to match the content it stands in for.
|
|
12
|
+
*
|
|
13
|
+
* It is intentionally barebones and is hidden from screen readers
|
|
14
|
+
* (`aria-hidden`). Loading must be communicated to assistive technology at the
|
|
15
|
+
* container or page level using `aria-busy` and a `ScreenReaderOnly` label.
|
|
16
|
+
*
|
|
17
|
+
* @summary loading placeholder for content
|
|
18
|
+
*/
|
|
6
19
|
export declare const Skeleton: ({ width, height, style, className, ...rest }: SkeletonProps) => React.JSX.Element;
|
|
7
20
|
export {};
|
|
@@ -4,6 +4,17 @@ import 'uid/secure';
|
|
|
4
4
|
import { assignCssVars } from '../../utils/assignCssVars.js';
|
|
5
5
|
import styles from './Skeleton.module.scss.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Skeleton is a shimmering placeholder shown while content is loading, giving a
|
|
9
|
+
* consistent sense of where content will appear before it arrives. Size it with
|
|
10
|
+
* `width` and `height` to match the content it stands in for.
|
|
11
|
+
*
|
|
12
|
+
* It is intentionally barebones and is hidden from screen readers
|
|
13
|
+
* (`aria-hidden`). Loading must be communicated to assistive technology at the
|
|
14
|
+
* container or page level using `aria-busy` and a `ScreenReaderOnly` label.
|
|
15
|
+
*
|
|
16
|
+
* @summary loading placeholder for content
|
|
17
|
+
*/
|
|
7
18
|
const Skeleton = ({ width, height, style, className, ...rest }) => {
|
|
8
19
|
return (React__default.createElement("div", { "aria-hidden": "true", style: { ...assignCssVars({ width, height }), ...style }, className: buildClassnames([styles.skeleton, className]), ...rest }));
|
|
9
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { HTMLAttributes } from 'react';\n\nimport { buildClassnames } from '../../utils';\nimport { assignCssVars } from '../../utils/assignCssVars';\n\nimport styles from './Skeleton.module.scss';\n\ntype SkeletonProps = HTMLAttributes<HTMLDivElement> & {\n width?: string;\n height?: string;\n};\n\nexport const Skeleton = ({ width, height, style, className, ...rest }: SkeletonProps) => {\n return (\n <div\n aria-hidden=\"true\"\n style={{ ...assignCssVars({ width, height }), ...style }}\n className={buildClassnames([styles.skeleton, className])}\n {...rest}\n />\n );\n};\n"],"names":["React"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import React, { HTMLAttributes } from 'react';\n\nimport { buildClassnames } from '../../utils';\nimport { assignCssVars } from '../../utils/assignCssVars';\n\nimport styles from './Skeleton.module.scss';\n\ntype SkeletonProps = HTMLAttributes<HTMLDivElement> & {\n /** Width of the placeholder as any CSS length. Defaults to `100%`. */\n width?: string;\n /** Height of the placeholder as any CSS length. Defaults to `20px`. */\n height?: string;\n};\n\n/**\n * Skeleton is a shimmering placeholder shown while content is loading, giving a\n * consistent sense of where content will appear before it arrives. Size it with\n * `width` and `height` to match the content it stands in for.\n *\n * It is intentionally barebones and is hidden from screen readers\n * (`aria-hidden`). Loading must be communicated to assistive technology at the\n * container or page level using `aria-busy` and a `ScreenReaderOnly` label.\n *\n * @summary loading placeholder for content\n */\nexport const Skeleton = ({ width, height, style, className, ...rest }: SkeletonProps) => {\n return (\n <div\n aria-hidden=\"true\"\n style={{ ...assignCssVars({ width, height }), ...style }}\n className={buildClassnames([styles.skeleton, className])}\n {...rest}\n />\n );\n};\n"],"names":["React"],"mappings":";;;;;;AAcA;;;;;;;;;;AAUG;AACI,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB,KAAI;AACtF,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,MAAM,EAClB,KAAK,EAAE,EAAE,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,EACxD,SAAS,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,KACpD,IAAI,EAAA,CACR;AAEN;;;;"}
|
|
@@ -39,7 +39,7 @@ export { InputAffix } from './InputAffix';
|
|
|
39
39
|
export { InputGroup, type InputGroupProps } from './InputGroup';
|
|
40
40
|
export { LegacyDataTable } from './LegacyDataTable';
|
|
41
41
|
export { Loader } from './Loader';
|
|
42
|
-
export { LoginWithAmazonButton } from './LoginWithAmazonButton';
|
|
42
|
+
export { LoginWithAmazonButton, type LoginWithAmazonButtonProps, type LoginWithAmazonButtonSize, type LoginWithAmazonButtonVariant, } from './LoginWithAmazonButton';
|
|
43
43
|
export { Modal, type Action as ModalAction, type ModalProps } from './Modal';
|
|
44
44
|
export { Pagination } from './Pagination';
|
|
45
45
|
export { Popover } from './Popover';
|