@easypost/easy-ui 1.0.0-alpha.4 → 1.0.0-alpha.6
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/Badge/index.js +32 -26
- package/Badge/index.mjs +32 -26
- package/Banner/index.js +15 -16
- package/Banner/index.mjs +15 -16
- package/Button/Button.d.ts +61 -0
- package/Button/Button.d.ts.map +1 -1
- package/Button/index.js +34 -69
- package/Button/index.mjs +33 -68
- package/CHANGELOG.md +21 -0
- package/Card/index.js +84 -5
- package/Card/index.mjs +84 -5
- package/Checkbox/index.js +84 -72
- package/Checkbox/index.mjs +84 -72
- package/CodeBlock/index.js +43 -49
- package/CodeBlock/index.mjs +43 -49
- package/DropdownButton/DropdownButton.d.ts +48 -0
- package/DropdownButton/DropdownButton.d.ts.map +1 -1
- package/DropdownButton/index.js +29 -101
- package/DropdownButton/index.mjs +29 -85
- package/HorizontalGrid/index.js +11 -31
- package/HorizontalGrid/index.mjs +11 -31
- package/HorizontalStack/index.js +48 -4
- package/HorizontalStack/index.mjs +48 -4
- package/Icon/Icon.d.ts +51 -0
- package/Icon/Icon.d.ts.map +1 -1
- package/Icon/index.js +38 -4
- package/Icon/index.mjs +38 -4
- package/IconButton/IconButton.d.ts +62 -0
- package/IconButton/IconButton.d.ts.map +1 -1
- package/IconButton/index.js +26 -43
- package/IconButton/index.mjs +25 -42
- package/InputField/Label.d.ts +2 -2
- package/InputField/index.js +282 -10
- package/InputField/index.mjs +266 -10
- package/InputField/utilities.d.ts +1 -1
- package/InputField/utilities.d.ts.map +1 -1
- package/Menu/MenuOverlay.d.ts.map +1 -1
- package/Menu/index.js +178 -1958
- package/Menu/index.mjs +168 -1948
- package/Menu/utilities.d.ts +11 -0
- package/Menu/utilities.d.ts.map +1 -0
- package/Notification/index.js +1534 -14
- package/Notification/index.mjs +1518 -14
- package/Provider/index.js +15 -15
- package/Provider/index.mjs +15 -15
- package/RadioGroup/index.js +63 -63
- package/RadioGroup/index.mjs +63 -63
- package/Select/Select.d.ts +88 -0
- package/Select/Select.d.ts.map +1 -0
- package/Select/Select.stories.d.ts +17 -0
- package/Select/Select.stories.d.ts.map +1 -0
- package/Select/Select.test.d.ts +2 -0
- package/Select/Select.test.d.ts.map +1 -0
- package/Select/SelectContext.d.ts +14 -0
- package/Select/SelectContext.d.ts.map +1 -0
- package/Select/SelectField.d.ts +62 -0
- package/Select/SelectField.d.ts.map +1 -0
- package/Select/SelectOption.d.ts +23 -0
- package/Select/SelectOption.d.ts.map +1 -0
- package/Select/SelectOverlay.d.ts +3 -0
- package/Select/SelectOverlay.d.ts.map +1 -0
- package/Select/SelectSection.d.ts +22 -0
- package/Select/SelectSection.d.ts.map +1 -0
- package/Select/SelectTrigger.d.ts +30 -0
- package/Select/SelectTrigger.d.ts.map +1 -0
- package/Select/index.d.ts +2 -0
- package/Select/index.d.ts.map +1 -0
- package/Select/index.js +816 -0
- package/Select/index.mjs +816 -0
- package/SelectorErrorTooltip/index.js +102 -11
- package/SelectorErrorTooltip/index.mjs +86 -11
- package/Text/index.js +85 -4
- package/Text/index.mjs +85 -4
- package/TextField/index.js +19 -38
- package/TextField/index.mjs +19 -38
- package/Textarea/index.js +20 -37
- package/Textarea/index.mjs +20 -37
- package/Theme/index.js +145 -9
- package/Theme/index.mjs +145 -9
- package/Toggle/index.js +51 -50
- package/Toggle/index.mjs +51 -50
- package/Tooltip/index.js +299 -10
- package/Tooltip/index.mjs +299 -10
- package/UnstyledButton/index.js +4 -4
- package/UnstyledButton/index.mjs +3 -3
- package/VerticalStack/index.js +13 -47
- package/VerticalStack/index.mjs +13 -47
- package/__chunks__/ExpandMore400-7c5263a4.mjs +49 -0
- package/__chunks__/ExpandMore400-92646971.js +65 -0
- package/__chunks__/InputIcon-2317befd.mjs +148 -0
- package/__chunks__/InputIcon-d3963cf8.js +147 -0
- package/__chunks__/{import-e7f45c7e.mjs → import-0561e1ba.mjs} +3 -3
- package/__chunks__/{import-b7971a11.mjs → import-19bc38ac.mjs} +72 -34
- package/__chunks__/{import-01299af6.js → import-24a482e1.js} +3 -2
- package/__chunks__/{import-baa3cd0c.mjs → import-29af6941.mjs} +4 -3
- package/__chunks__/{import-0d1b4d93.js → import-2b302763.js} +193 -141
- package/__chunks__/{import-ab878fb6.mjs → import-3d962a94.mjs} +205 -153
- package/__chunks__/{import-86330a7c.mjs → import-6a831ca1.mjs} +16 -15
- package/__chunks__/{import-7545401a.js → import-8b6c0bc7.js} +3 -3
- package/__chunks__/{import-63bf0645.js → import-a1e0f814.js} +47 -9
- package/__chunks__/{import-3ab42f86.js → import-a2023d8f.js} +35 -22
- package/__chunks__/{import-76076ca6.js → import-dea5a24d.js} +15 -14
- package/__chunks__/{import-856e0385.mjs → import-f1f4792a.mjs} +36 -23
- package/__chunks__/{UnstyledButton-883f0c6c.mjs → index-29d7bca9.mjs} +17 -42
- package/__chunks__/{UnstyledButton-96172ec0.js → index-3985350a.js} +17 -42
- package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
- package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
- package/__chunks__/{real-module-e4cd2301.mjs → real-module-515df21d.mjs} +1 -1
- package/__chunks__/{real-module-ae2a4342.js → real-module-e36b1436.js} +1 -1
- package/__chunks__/useTriggerWidth-156b038a.js +2030 -0
- package/__chunks__/useTriggerWidth-addcd1d6.mjs +2031 -0
- package/package.json +11 -11
- package/style.css +1423 -1196
- package/utilities/css.js +14 -58
- package/utilities/css.mjs +14 -58
- package/__chunks__/Card-7bbd41e0.mjs +0 -110
- package/__chunks__/Card-dac53c75.js +0 -109
- package/__chunks__/HorizontalStack-a441c63f.mjs +0 -80
- package/__chunks__/HorizontalStack-a862839b.js +0 -79
- package/__chunks__/Icon-3d00481a.js +0 -44
- package/__chunks__/Icon-a75b5201.mjs +0 -45
- package/__chunks__/InputField-4fbaae06.js +0 -487
- package/__chunks__/InputField-a272f602.mjs +0 -472
- package/__chunks__/Notification-b8eafec6.mjs +0 -1456
- package/__chunks__/Notification-c5b34eb3.js +0 -1471
- package/__chunks__/SelectorErrorTooltip-43c5e29e.js +0 -84
- package/__chunks__/SelectorErrorTooltip-b6204987.mjs +0 -69
- package/__chunks__/Text-1ae70c19.js +0 -102
- package/__chunks__/Text-4ae50d5c.mjs +0 -103
- package/__chunks__/Theme-4e498252.mjs +0 -132
- package/__chunks__/Theme-751e5575.js +0 -131
- package/__chunks__/Tooltip-bd55165e.js +0 -317
- package/__chunks__/Tooltip-f7e67b21.mjs +0 -318
package/Badge/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const Icon_index = require("../Icon/index.js");
|
|
5
|
+
const Text_index = require("../Text/index.js");
|
|
6
6
|
const utilities_css = require("../utilities/css.js");
|
|
7
|
-
const root = "
|
|
8
|
-
const primary = "
|
|
9
|
-
const secondary = "
|
|
10
|
-
const text = "
|
|
11
|
-
const variantPrimary = "
|
|
12
|
-
const variantSecondary = "
|
|
13
|
-
const variantBlack = "
|
|
14
|
-
const variantInverse = "
|
|
15
|
-
const variantGray = "
|
|
16
|
-
const variantSuccess = "
|
|
17
|
-
const variantWarning = "
|
|
18
|
-
const variantDanger = "
|
|
7
|
+
const root = "_root_w4lra_5";
|
|
8
|
+
const primary = "_primary_w4lra_16";
|
|
9
|
+
const secondary = "_secondary_w4lra_17";
|
|
10
|
+
const text = "_text_w4lra_32";
|
|
11
|
+
const variantPrimary = "_variantPrimary_w4lra_37";
|
|
12
|
+
const variantSecondary = "_variantSecondary_w4lra_44";
|
|
13
|
+
const variantBlack = "_variantBlack_w4lra_51";
|
|
14
|
+
const variantInverse = "_variantInverse_w4lra_58";
|
|
15
|
+
const variantGray = "_variantGray_w4lra_65";
|
|
16
|
+
const variantSuccess = "_variantSuccess_w4lra_72";
|
|
17
|
+
const variantWarning = "_variantWarning_w4lra_79";
|
|
18
|
+
const variantDanger = "_variantDanger_w4lra_86";
|
|
19
19
|
const styles = {
|
|
20
20
|
root,
|
|
21
21
|
primary,
|
|
@@ -32,17 +32,8 @@ const styles = {
|
|
|
32
32
|
};
|
|
33
33
|
const DEFAULT_VARIANT = "primary";
|
|
34
34
|
function Badge(props) {
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
children,
|
|
38
|
-
secondaryLabel,
|
|
39
|
-
icon,
|
|
40
|
-
variant = DEFAULT_VARIANT
|
|
41
|
-
} = props;
|
|
42
|
-
const className = utilities_css.classNames(
|
|
43
|
-
styles.root,
|
|
44
|
-
styles[utilities_css.variationName("variant", variant)]
|
|
45
|
-
);
|
|
35
|
+
const { accessibilityLabel, children, secondaryLabel, icon, variant = DEFAULT_VARIANT } = props;
|
|
36
|
+
const className = utilities_css.classNames(styles.root, styles[utilities_css.variationName("variant", variant)]);
|
|
46
37
|
if (!icon && !children) {
|
|
47
38
|
console.warn("Badge requires one of children or icon");
|
|
48
39
|
}
|
|
@@ -52,7 +43,22 @@ function Badge(props) {
|
|
|
52
43
|
if (icon && !children && !accessibilityLabel) {
|
|
53
44
|
console.warn("Badge with only icon must have accessibilityLabel");
|
|
54
45
|
}
|
|
55
|
-
return
|
|
46
|
+
return React.createElement("span", {
|
|
47
|
+
className
|
|
48
|
+
}, accessibilityLabel && React.createElement(Text_index.Text, {
|
|
49
|
+
visuallyHidden: true
|
|
50
|
+
}, accessibilityLabel), React.createElement("span", {
|
|
51
|
+
className: styles.primary
|
|
52
|
+
}, icon ? React.createElement(Icon_index.Icon, {
|
|
53
|
+
symbol: icon,
|
|
54
|
+
size: "sm"
|
|
55
|
+
}) : React.createElement("span", {
|
|
56
|
+
className: styles.text
|
|
57
|
+
}, children)), children && (icon || secondaryLabel) && React.createElement("span", {
|
|
58
|
+
className: styles.secondary
|
|
59
|
+
}, React.createElement("span", {
|
|
60
|
+
className: styles.text
|
|
61
|
+
}, icon ? React.createElement(React.Fragment, null, children) : React.createElement(React.Fragment, null, secondaryLabel))));
|
|
56
62
|
}
|
|
57
63
|
exports.Badge = Badge;
|
|
58
64
|
exports.DEFAULT_VARIANT = DEFAULT_VARIANT;
|
package/Badge/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Icon } from "../Icon/index.mjs";
|
|
3
|
+
import { Text } from "../Text/index.mjs";
|
|
4
4
|
import { classNames, variationName } from "../utilities/css.mjs";
|
|
5
|
-
const root = "
|
|
6
|
-
const primary = "
|
|
7
|
-
const secondary = "
|
|
8
|
-
const text = "
|
|
9
|
-
const variantPrimary = "
|
|
10
|
-
const variantSecondary = "
|
|
11
|
-
const variantBlack = "
|
|
12
|
-
const variantInverse = "
|
|
13
|
-
const variantGray = "
|
|
14
|
-
const variantSuccess = "
|
|
15
|
-
const variantWarning = "
|
|
16
|
-
const variantDanger = "
|
|
5
|
+
const root = "_root_w4lra_5";
|
|
6
|
+
const primary = "_primary_w4lra_16";
|
|
7
|
+
const secondary = "_secondary_w4lra_17";
|
|
8
|
+
const text = "_text_w4lra_32";
|
|
9
|
+
const variantPrimary = "_variantPrimary_w4lra_37";
|
|
10
|
+
const variantSecondary = "_variantSecondary_w4lra_44";
|
|
11
|
+
const variantBlack = "_variantBlack_w4lra_51";
|
|
12
|
+
const variantInverse = "_variantInverse_w4lra_58";
|
|
13
|
+
const variantGray = "_variantGray_w4lra_65";
|
|
14
|
+
const variantSuccess = "_variantSuccess_w4lra_72";
|
|
15
|
+
const variantWarning = "_variantWarning_w4lra_79";
|
|
16
|
+
const variantDanger = "_variantDanger_w4lra_86";
|
|
17
17
|
const styles = {
|
|
18
18
|
root,
|
|
19
19
|
primary,
|
|
@@ -30,17 +30,8 @@ const styles = {
|
|
|
30
30
|
};
|
|
31
31
|
const DEFAULT_VARIANT = "primary";
|
|
32
32
|
function Badge(props) {
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
children,
|
|
36
|
-
secondaryLabel,
|
|
37
|
-
icon,
|
|
38
|
-
variant = DEFAULT_VARIANT
|
|
39
|
-
} = props;
|
|
40
|
-
const className = classNames(
|
|
41
|
-
styles.root,
|
|
42
|
-
styles[variationName("variant", variant)]
|
|
43
|
-
);
|
|
33
|
+
const { accessibilityLabel, children, secondaryLabel, icon, variant = DEFAULT_VARIANT } = props;
|
|
34
|
+
const className = classNames(styles.root, styles[variationName("variant", variant)]);
|
|
44
35
|
if (!icon && !children) {
|
|
45
36
|
console.warn("Badge requires one of children or icon");
|
|
46
37
|
}
|
|
@@ -50,7 +41,22 @@ function Badge(props) {
|
|
|
50
41
|
if (icon && !children && !accessibilityLabel) {
|
|
51
42
|
console.warn("Badge with only icon must have accessibilityLabel");
|
|
52
43
|
}
|
|
53
|
-
return
|
|
44
|
+
return React__default.createElement("span", {
|
|
45
|
+
className
|
|
46
|
+
}, accessibilityLabel && React__default.createElement(Text, {
|
|
47
|
+
visuallyHidden: true
|
|
48
|
+
}, accessibilityLabel), React__default.createElement("span", {
|
|
49
|
+
className: styles.primary
|
|
50
|
+
}, icon ? React__default.createElement(Icon, {
|
|
51
|
+
symbol: icon,
|
|
52
|
+
size: "sm"
|
|
53
|
+
}) : React__default.createElement("span", {
|
|
54
|
+
className: styles.text
|
|
55
|
+
}, children)), children && (icon || secondaryLabel) && React__default.createElement("span", {
|
|
56
|
+
className: styles.secondary
|
|
57
|
+
}, React__default.createElement("span", {
|
|
58
|
+
className: styles.text
|
|
59
|
+
}, icon ? React__default.createElement(React__default.Fragment, null, children) : React__default.createElement(React__default.Fragment, null, secondaryLabel))));
|
|
54
60
|
}
|
|
55
61
|
export {
|
|
56
62
|
Badge,
|
package/Banner/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const Text_index = require("../Text/index.js");
|
|
5
5
|
const utilities_css = require("../utilities/css.js");
|
|
6
|
-
const colorSuccess = "
|
|
7
|
-
const colorPrimary = "
|
|
8
|
-
const colorNeutral = "
|
|
9
|
-
const Banner$1 = "
|
|
6
|
+
const colorSuccess = "_colorSuccess_7ilj4_5";
|
|
7
|
+
const colorPrimary = "_colorPrimary_7ilj4_10";
|
|
8
|
+
const colorNeutral = "_colorNeutral_7ilj4_11";
|
|
9
|
+
const Banner$1 = "_Banner_7ilj4_23";
|
|
10
10
|
const styles = {
|
|
11
11
|
colorSuccess,
|
|
12
12
|
colorPrimary,
|
|
@@ -15,16 +15,15 @@ const styles = {
|
|
|
15
15
|
};
|
|
16
16
|
function Banner(props) {
|
|
17
17
|
const { color = "success", emphasisText, children } = props;
|
|
18
|
-
return
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
18
|
+
return React.createElement("div", {
|
|
19
|
+
className: utilities_css.classNames(styles.Banner, styles[utilities_css.variationName("color", color)])
|
|
20
|
+
}, emphasisText && React.createElement(Text_index.Text, {
|
|
21
|
+
as: "strong",
|
|
22
|
+
variant: "subtitle1",
|
|
23
|
+
alignment: "center"
|
|
24
|
+
}, !children ? React.createElement(React.Fragment, null, emphasisText) : React.createElement(React.Fragment, null, emphasisText, ": ")), children && React.createElement(Text_index.Text, {
|
|
25
|
+
variant: "body1",
|
|
26
|
+
alignment: "center"
|
|
27
|
+
}, children));
|
|
29
28
|
}
|
|
30
29
|
exports.Banner = Banner;
|
package/Banner/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Text } from "../Text/index.mjs";
|
|
3
3
|
import { classNames, variationName } from "../utilities/css.mjs";
|
|
4
|
-
const colorSuccess = "
|
|
5
|
-
const colorPrimary = "
|
|
6
|
-
const colorNeutral = "
|
|
7
|
-
const Banner$1 = "
|
|
4
|
+
const colorSuccess = "_colorSuccess_7ilj4_5";
|
|
5
|
+
const colorPrimary = "_colorPrimary_7ilj4_10";
|
|
6
|
+
const colorNeutral = "_colorNeutral_7ilj4_11";
|
|
7
|
+
const Banner$1 = "_Banner_7ilj4_23";
|
|
8
8
|
const styles = {
|
|
9
9
|
colorSuccess,
|
|
10
10
|
colorPrimary,
|
|
@@ -13,17 +13,16 @@ const styles = {
|
|
|
13
13
|
};
|
|
14
14
|
function Banner(props) {
|
|
15
15
|
const { color = "success", emphasisText, children } = props;
|
|
16
|
-
return
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
16
|
+
return React__default.createElement("div", {
|
|
17
|
+
className: classNames(styles.Banner, styles[variationName("color", color)])
|
|
18
|
+
}, emphasisText && React__default.createElement(Text, {
|
|
19
|
+
as: "strong",
|
|
20
|
+
variant: "subtitle1",
|
|
21
|
+
alignment: "center"
|
|
22
|
+
}, !children ? React__default.createElement(React__default.Fragment, null, emphasisText) : React__default.createElement(React__default.Fragment, null, emphasisText, ": ")), children && React__default.createElement(Text, {
|
|
23
|
+
variant: "body1",
|
|
24
|
+
alignment: "center"
|
|
25
|
+
}, children));
|
|
27
26
|
}
|
|
28
27
|
export {
|
|
29
28
|
Banner
|
package/Button/Button.d.ts
CHANGED
|
@@ -24,6 +24,67 @@ export type ButtonProps = AriaButtonProps & {
|
|
|
24
24
|
/** Link's destination */
|
|
25
25
|
href?: string;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Allow users to perform an action or to navigate to another page.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Use to communicate an action the user can take in order to continue
|
|
32
|
+
* flow in the UI. Supports icons, multiple colors, outlined and link variations,
|
|
33
|
+
* and small size buttons. Underlying element is a button, but becomes an
|
|
34
|
+
* anchor when `href` is provided.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* _Default:_
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { Button } from "@easypost/easy-ui/Button";
|
|
40
|
+
*
|
|
41
|
+
* export function Component() {
|
|
42
|
+
* return <Button onPress={() => alert("clicked")}>Button</Button>;
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* _Outlined variant:_
|
|
48
|
+
* ```tsx
|
|
49
|
+
* import { Button } from "@easypost/easy-ui/Button";
|
|
50
|
+
*
|
|
51
|
+
* export function Component() {
|
|
52
|
+
* return (
|
|
53
|
+
* <Button onPress={() => alert("clicked")} variant="outlined">
|
|
54
|
+
* Button
|
|
55
|
+
* </Button>
|
|
56
|
+
* );
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* _Success color:_
|
|
62
|
+
* ```tsx
|
|
63
|
+
* import { Button } from "@easypost/easy-ui/Button";
|
|
64
|
+
*
|
|
65
|
+
* export function Component() {
|
|
66
|
+
* return (
|
|
67
|
+
* <Button onPress={() => alert("clicked")} color="success">
|
|
68
|
+
* Button
|
|
69
|
+
* </Button>
|
|
70
|
+
* );
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
* @example
|
|
74
|
+
* _With href and icon:_
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import { Button } from "@easypost/easy-ui/Button";
|
|
77
|
+
* import ArrowBackIcon from "@easypost/easy-ui-icons/ArrowBack";
|
|
78
|
+
*
|
|
79
|
+
* export function Component() {
|
|
80
|
+
* return (
|
|
81
|
+
* <Button href="https://www.easypost.com/" iconAtEnd={ArrowBackIcon}>
|
|
82
|
+
* Button
|
|
83
|
+
* </Button>
|
|
84
|
+
* );
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
27
88
|
export declare const Button: React.ForwardRefExoticComponent<AriaButtonProps<"button"> & {
|
|
28
89
|
/** Button color */
|
|
29
90
|
color?: ButtonColor | undefined;
|
package/Button/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C,mBAAmB;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kBAAkB;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,sBAAsB;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,MAAM;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C,mBAAmB;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kBAAkB;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,sBAAsB;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,eAAO,MAAM,MAAM;IAjFjB,mBAAmB;;IAEnB,qBAAqB;;IAErB,kBAAkB;;IAElB,sBAAsB;;IAEtB,6CAA6C;;IAE7C,4CAA4C;;IAE5C,2CAA2C;;IAE3C,6BAA6B;eAClB,SAAS;IACpB,yBAAyB;;8BAuHzB,CAAC"}
|
package/Button/index.js
CHANGED
|
@@ -29,28 +29,28 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
31
31
|
const React = require("react");
|
|
32
|
-
const
|
|
33
|
-
const
|
|
32
|
+
const UnstyledButton_index = require("../__chunks__/index-3985350a.js");
|
|
33
|
+
const Icon_index = require("../Icon/index.js");
|
|
34
34
|
const utilities_css = require("../utilities/css.js");
|
|
35
|
-
require("../__chunks__/import-
|
|
35
|
+
require("../__chunks__/import-a1e0f814.js");
|
|
36
36
|
require("../__chunks__/omit-fca26542.js");
|
|
37
|
-
require("../__chunks__/import-
|
|
38
|
-
const Button$1 = "
|
|
39
|
-
const colorPrimary = "
|
|
40
|
-
const colorSecondary = "
|
|
41
|
-
const colorSuccess = "
|
|
42
|
-
const colorWarning = "
|
|
43
|
-
const colorNeutral = "
|
|
44
|
-
const colorSupport = "
|
|
45
|
-
const colorInverse = "
|
|
46
|
-
const variantFilled = "
|
|
47
|
-
const variantOutlined = "
|
|
48
|
-
const variantLink = "
|
|
49
|
-
const sizeMd = "
|
|
50
|
-
const sizeSm = "
|
|
51
|
-
const block = "
|
|
52
|
-
const iconAtStart = "
|
|
53
|
-
const iconAtEnd = "
|
|
37
|
+
require("../__chunks__/import-2b302763.js");
|
|
38
|
+
const Button$1 = "_Button_l4y1n_5";
|
|
39
|
+
const colorPrimary = "_colorPrimary_l4y1n_20";
|
|
40
|
+
const colorSecondary = "_colorSecondary_l4y1n_28";
|
|
41
|
+
const colorSuccess = "_colorSuccess_l4y1n_36";
|
|
42
|
+
const colorWarning = "_colorWarning_l4y1n_44";
|
|
43
|
+
const colorNeutral = "_colorNeutral_l4y1n_52";
|
|
44
|
+
const colorSupport = "_colorSupport_l4y1n_60";
|
|
45
|
+
const colorInverse = "_colorInverse_l4y1n_66";
|
|
46
|
+
const variantFilled = "_variantFilled_l4y1n_72";
|
|
47
|
+
const variantOutlined = "_variantOutlined_l4y1n_99";
|
|
48
|
+
const variantLink = "_variantLink_l4y1n_127";
|
|
49
|
+
const sizeMd = "_sizeMd_l4y1n_153";
|
|
50
|
+
const sizeSm = "_sizeSm_l4y1n_161";
|
|
51
|
+
const block = "_block_l4y1n_180";
|
|
52
|
+
const iconAtStart = "_iconAtStart_l4y1n_185";
|
|
53
|
+
const iconAtEnd = "_iconAtEnd_l4y1n_189";
|
|
54
54
|
const styles = {
|
|
55
55
|
Button: Button$1,
|
|
56
56
|
colorPrimary,
|
|
@@ -70,60 +70,25 @@ const styles = {
|
|
|
70
70
|
iconAtEnd
|
|
71
71
|
};
|
|
72
72
|
const Button = React.forwardRef((props, inRef) => {
|
|
73
|
-
const _a = props, {
|
|
74
|
-
color = "primary",
|
|
75
|
-
variant = "filled",
|
|
76
|
-
size = "md",
|
|
77
|
-
isDisabled = false,
|
|
78
|
-
isBlock = false,
|
|
79
|
-
iconAtStart: iconAtStart2,
|
|
80
|
-
iconAtEnd: iconAtEnd2,
|
|
81
|
-
children = "Button",
|
|
82
|
-
href = ""
|
|
83
|
-
} = _a, restProps = __objRest(_a, [
|
|
84
|
-
"color",
|
|
85
|
-
"variant",
|
|
86
|
-
"size",
|
|
87
|
-
"isDisabled",
|
|
88
|
-
"isBlock",
|
|
89
|
-
"iconAtStart",
|
|
90
|
-
"iconAtEnd",
|
|
91
|
-
"children",
|
|
92
|
-
"href"
|
|
93
|
-
]);
|
|
73
|
+
const _a = props, { color = "primary", variant = "filled", size = "md", isDisabled = false, isBlock = false, iconAtStart: iconAtStart2, iconAtEnd: iconAtEnd2, children = "Button", href = "" } = _a, restProps = __objRest(_a, ["color", "variant", "size", "isDisabled", "isBlock", "iconAtStart", "iconAtEnd", "children", "href"]);
|
|
94
74
|
const bothIconPropsDefined = iconAtEnd2 && iconAtStart2;
|
|
95
75
|
if (bothIconPropsDefined) {
|
|
96
76
|
console.warn("Cannot simultaneously define `iconAtEnd` and `iconAtStart`");
|
|
97
77
|
}
|
|
98
78
|
const canUseIcon = (iconAtEnd2 || iconAtStart2) && !bothIconPropsDefined && variant !== "link" && size !== "sm";
|
|
99
|
-
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
href
|
|
113
|
-
}, restProps),
|
|
114
|
-
iconAtStart2 && canUseIcon && /* @__PURE__ */ React.createElement(Icon.Icon, { symbol: iconAtStart2 }),
|
|
115
|
-
/* @__PURE__ */ React.createElement(
|
|
116
|
-
"span",
|
|
117
|
-
{
|
|
118
|
-
className: utilities_css.classNames(
|
|
119
|
-
iconAtStart2 && canUseIcon && styles.iconAtStart,
|
|
120
|
-
iconAtEnd2 && canUseIcon && styles.iconAtEnd
|
|
121
|
-
)
|
|
122
|
-
},
|
|
123
|
-
children
|
|
124
|
-
),
|
|
125
|
-
iconAtEnd2 && canUseIcon && /* @__PURE__ */ React.createElement(Icon.Icon, { symbol: iconAtEnd2 })
|
|
126
|
-
);
|
|
79
|
+
UnstyledButton_index.logWarningIfInvalidColorVariantCombination(color, variant);
|
|
80
|
+
return React.createElement(UnstyledButton_index.UnstyledButton, __spreadValues({
|
|
81
|
+
isDisabled,
|
|
82
|
+
ref: inRef,
|
|
83
|
+
className: utilities_css.classNames(styles.Button, styles[utilities_css.variationName("color", color)], styles[utilities_css.variationName("variant", variant)], styles[utilities_css.variationName("size", size)], isBlock && styles.block),
|
|
84
|
+
href
|
|
85
|
+
}, restProps), iconAtStart2 && canUseIcon && React.createElement(Icon_index.Icon, {
|
|
86
|
+
symbol: iconAtStart2
|
|
87
|
+
}), React.createElement("span", {
|
|
88
|
+
className: utilities_css.classNames(iconAtStart2 && canUseIcon && styles.iconAtStart, iconAtEnd2 && canUseIcon && styles.iconAtEnd)
|
|
89
|
+
}, children), iconAtEnd2 && canUseIcon && React.createElement(Icon_index.Icon, {
|
|
90
|
+
symbol: iconAtEnd2
|
|
91
|
+
}));
|
|
127
92
|
});
|
|
128
93
|
Button.displayName = "Button";
|
|
129
94
|
exports.Button = Button;
|
package/Button/index.mjs
CHANGED
|
@@ -27,28 +27,28 @@ var __objRest = (source, exclude) => {
|
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
29
|
import React__default, { forwardRef } from "react";
|
|
30
|
-
import { l as logWarningIfInvalidColorVariantCombination, U as UnstyledButton } from "../__chunks__/
|
|
31
|
-
import {
|
|
30
|
+
import { l as logWarningIfInvalidColorVariantCombination, U as UnstyledButton } from "../__chunks__/index-29d7bca9.mjs";
|
|
31
|
+
import { Icon } from "../Icon/index.mjs";
|
|
32
32
|
import { classNames, variationName } from "../utilities/css.mjs";
|
|
33
|
-
import "../__chunks__/import-
|
|
33
|
+
import "../__chunks__/import-19bc38ac.mjs";
|
|
34
34
|
import "../__chunks__/omit-f17deb8f.mjs";
|
|
35
|
-
import "../__chunks__/import-
|
|
36
|
-
const Button$1 = "
|
|
37
|
-
const colorPrimary = "
|
|
38
|
-
const colorSecondary = "
|
|
39
|
-
const colorSuccess = "
|
|
40
|
-
const colorWarning = "
|
|
41
|
-
const colorNeutral = "
|
|
42
|
-
const colorSupport = "
|
|
43
|
-
const colorInverse = "
|
|
44
|
-
const variantFilled = "
|
|
45
|
-
const variantOutlined = "
|
|
46
|
-
const variantLink = "
|
|
47
|
-
const sizeMd = "
|
|
48
|
-
const sizeSm = "
|
|
49
|
-
const block = "
|
|
50
|
-
const iconAtStart = "
|
|
51
|
-
const iconAtEnd = "
|
|
35
|
+
import "../__chunks__/import-3d962a94.mjs";
|
|
36
|
+
const Button$1 = "_Button_l4y1n_5";
|
|
37
|
+
const colorPrimary = "_colorPrimary_l4y1n_20";
|
|
38
|
+
const colorSecondary = "_colorSecondary_l4y1n_28";
|
|
39
|
+
const colorSuccess = "_colorSuccess_l4y1n_36";
|
|
40
|
+
const colorWarning = "_colorWarning_l4y1n_44";
|
|
41
|
+
const colorNeutral = "_colorNeutral_l4y1n_52";
|
|
42
|
+
const colorSupport = "_colorSupport_l4y1n_60";
|
|
43
|
+
const colorInverse = "_colorInverse_l4y1n_66";
|
|
44
|
+
const variantFilled = "_variantFilled_l4y1n_72";
|
|
45
|
+
const variantOutlined = "_variantOutlined_l4y1n_99";
|
|
46
|
+
const variantLink = "_variantLink_l4y1n_127";
|
|
47
|
+
const sizeMd = "_sizeMd_l4y1n_153";
|
|
48
|
+
const sizeSm = "_sizeSm_l4y1n_161";
|
|
49
|
+
const block = "_block_l4y1n_180";
|
|
50
|
+
const iconAtStart = "_iconAtStart_l4y1n_185";
|
|
51
|
+
const iconAtEnd = "_iconAtEnd_l4y1n_189";
|
|
52
52
|
const styles = {
|
|
53
53
|
Button: Button$1,
|
|
54
54
|
colorPrimary,
|
|
@@ -68,60 +68,25 @@ const styles = {
|
|
|
68
68
|
iconAtEnd
|
|
69
69
|
};
|
|
70
70
|
const Button = forwardRef((props, inRef) => {
|
|
71
|
-
const _a = props, {
|
|
72
|
-
color = "primary",
|
|
73
|
-
variant = "filled",
|
|
74
|
-
size = "md",
|
|
75
|
-
isDisabled = false,
|
|
76
|
-
isBlock = false,
|
|
77
|
-
iconAtStart: iconAtStart2,
|
|
78
|
-
iconAtEnd: iconAtEnd2,
|
|
79
|
-
children = "Button",
|
|
80
|
-
href = ""
|
|
81
|
-
} = _a, restProps = __objRest(_a, [
|
|
82
|
-
"color",
|
|
83
|
-
"variant",
|
|
84
|
-
"size",
|
|
85
|
-
"isDisabled",
|
|
86
|
-
"isBlock",
|
|
87
|
-
"iconAtStart",
|
|
88
|
-
"iconAtEnd",
|
|
89
|
-
"children",
|
|
90
|
-
"href"
|
|
91
|
-
]);
|
|
71
|
+
const _a = props, { color = "primary", variant = "filled", size = "md", isDisabled = false, isBlock = false, iconAtStart: iconAtStart2, iconAtEnd: iconAtEnd2, children = "Button", href = "" } = _a, restProps = __objRest(_a, ["color", "variant", "size", "isDisabled", "isBlock", "iconAtStart", "iconAtEnd", "children", "href"]);
|
|
92
72
|
const bothIconPropsDefined = iconAtEnd2 && iconAtStart2;
|
|
93
73
|
if (bothIconPropsDefined) {
|
|
94
74
|
console.warn("Cannot simultaneously define `iconAtEnd` and `iconAtStart`");
|
|
95
75
|
}
|
|
96
76
|
const canUseIcon = (iconAtEnd2 || iconAtStart2) && !bothIconPropsDefined && variant !== "link" && size !== "sm";
|
|
97
77
|
logWarningIfInvalidColorVariantCombination(color, variant);
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
href
|
|
111
|
-
}, restProps),
|
|
112
|
-
iconAtStart2 && canUseIcon && /* @__PURE__ */ React__default.createElement(Icon, { symbol: iconAtStart2 }),
|
|
113
|
-
/* @__PURE__ */ React__default.createElement(
|
|
114
|
-
"span",
|
|
115
|
-
{
|
|
116
|
-
className: classNames(
|
|
117
|
-
iconAtStart2 && canUseIcon && styles.iconAtStart,
|
|
118
|
-
iconAtEnd2 && canUseIcon && styles.iconAtEnd
|
|
119
|
-
)
|
|
120
|
-
},
|
|
121
|
-
children
|
|
122
|
-
),
|
|
123
|
-
iconAtEnd2 && canUseIcon && /* @__PURE__ */ React__default.createElement(Icon, { symbol: iconAtEnd2 })
|
|
124
|
-
);
|
|
78
|
+
return React__default.createElement(UnstyledButton, __spreadValues({
|
|
79
|
+
isDisabled,
|
|
80
|
+
ref: inRef,
|
|
81
|
+
className: classNames(styles.Button, styles[variationName("color", color)], styles[variationName("variant", variant)], styles[variationName("size", size)], isBlock && styles.block),
|
|
82
|
+
href
|
|
83
|
+
}, restProps), iconAtStart2 && canUseIcon && React__default.createElement(Icon, {
|
|
84
|
+
symbol: iconAtStart2
|
|
85
|
+
}), React__default.createElement("span", {
|
|
86
|
+
className: classNames(iconAtStart2 && canUseIcon && styles.iconAtStart, iconAtEnd2 && canUseIcon && styles.iconAtEnd)
|
|
87
|
+
}, children), iconAtEnd2 && canUseIcon && React__default.createElement(Icon, {
|
|
88
|
+
symbol: iconAtEnd2
|
|
89
|
+
}));
|
|
125
90
|
});
|
|
126
91
|
Button.displayName = "Button";
|
|
127
92
|
export {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @easypost/easy-ui
|
|
2
2
|
|
|
3
|
+
## 1.0.0-alpha.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [f03de81]
|
|
8
|
+
- Updated dependencies [b652cd3]
|
|
9
|
+
- @easypost/easy-ui-icons@1.0.0-alpha.6
|
|
10
|
+
|
|
11
|
+
## 1.0.0-alpha.5
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 1bdf32b: Add `Select` component
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 88673e3: Add layout primitive stories
|
|
20
|
+
- Updated dependencies [1bdf32b]
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @easypost/easy-ui-icons@1.0.0-alpha.5
|
|
23
|
+
|
|
3
24
|
## 1.0.0-alpha.4
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|