@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.
Files changed (133) hide show
  1. package/Badge/index.js +32 -26
  2. package/Badge/index.mjs +32 -26
  3. package/Banner/index.js +15 -16
  4. package/Banner/index.mjs +15 -16
  5. package/Button/Button.d.ts +61 -0
  6. package/Button/Button.d.ts.map +1 -1
  7. package/Button/index.js +34 -69
  8. package/Button/index.mjs +33 -68
  9. package/CHANGELOG.md +21 -0
  10. package/Card/index.js +84 -5
  11. package/Card/index.mjs +84 -5
  12. package/Checkbox/index.js +84 -72
  13. package/Checkbox/index.mjs +84 -72
  14. package/CodeBlock/index.js +43 -49
  15. package/CodeBlock/index.mjs +43 -49
  16. package/DropdownButton/DropdownButton.d.ts +48 -0
  17. package/DropdownButton/DropdownButton.d.ts.map +1 -1
  18. package/DropdownButton/index.js +29 -101
  19. package/DropdownButton/index.mjs +29 -85
  20. package/HorizontalGrid/index.js +11 -31
  21. package/HorizontalGrid/index.mjs +11 -31
  22. package/HorizontalStack/index.js +48 -4
  23. package/HorizontalStack/index.mjs +48 -4
  24. package/Icon/Icon.d.ts +51 -0
  25. package/Icon/Icon.d.ts.map +1 -1
  26. package/Icon/index.js +38 -4
  27. package/Icon/index.mjs +38 -4
  28. package/IconButton/IconButton.d.ts +62 -0
  29. package/IconButton/IconButton.d.ts.map +1 -1
  30. package/IconButton/index.js +26 -43
  31. package/IconButton/index.mjs +25 -42
  32. package/InputField/Label.d.ts +2 -2
  33. package/InputField/index.js +282 -10
  34. package/InputField/index.mjs +266 -10
  35. package/InputField/utilities.d.ts +1 -1
  36. package/InputField/utilities.d.ts.map +1 -1
  37. package/Menu/MenuOverlay.d.ts.map +1 -1
  38. package/Menu/index.js +178 -1958
  39. package/Menu/index.mjs +168 -1948
  40. package/Menu/utilities.d.ts +11 -0
  41. package/Menu/utilities.d.ts.map +1 -0
  42. package/Notification/index.js +1534 -14
  43. package/Notification/index.mjs +1518 -14
  44. package/Provider/index.js +15 -15
  45. package/Provider/index.mjs +15 -15
  46. package/RadioGroup/index.js +63 -63
  47. package/RadioGroup/index.mjs +63 -63
  48. package/Select/Select.d.ts +88 -0
  49. package/Select/Select.d.ts.map +1 -0
  50. package/Select/Select.stories.d.ts +17 -0
  51. package/Select/Select.stories.d.ts.map +1 -0
  52. package/Select/Select.test.d.ts +2 -0
  53. package/Select/Select.test.d.ts.map +1 -0
  54. package/Select/SelectContext.d.ts +14 -0
  55. package/Select/SelectContext.d.ts.map +1 -0
  56. package/Select/SelectField.d.ts +62 -0
  57. package/Select/SelectField.d.ts.map +1 -0
  58. package/Select/SelectOption.d.ts +23 -0
  59. package/Select/SelectOption.d.ts.map +1 -0
  60. package/Select/SelectOverlay.d.ts +3 -0
  61. package/Select/SelectOverlay.d.ts.map +1 -0
  62. package/Select/SelectSection.d.ts +22 -0
  63. package/Select/SelectSection.d.ts.map +1 -0
  64. package/Select/SelectTrigger.d.ts +30 -0
  65. package/Select/SelectTrigger.d.ts.map +1 -0
  66. package/Select/index.d.ts +2 -0
  67. package/Select/index.d.ts.map +1 -0
  68. package/Select/index.js +816 -0
  69. package/Select/index.mjs +816 -0
  70. package/SelectorErrorTooltip/index.js +102 -11
  71. package/SelectorErrorTooltip/index.mjs +86 -11
  72. package/Text/index.js +85 -4
  73. package/Text/index.mjs +85 -4
  74. package/TextField/index.js +19 -38
  75. package/TextField/index.mjs +19 -38
  76. package/Textarea/index.js +20 -37
  77. package/Textarea/index.mjs +20 -37
  78. package/Theme/index.js +145 -9
  79. package/Theme/index.mjs +145 -9
  80. package/Toggle/index.js +51 -50
  81. package/Toggle/index.mjs +51 -50
  82. package/Tooltip/index.js +299 -10
  83. package/Tooltip/index.mjs +299 -10
  84. package/UnstyledButton/index.js +4 -4
  85. package/UnstyledButton/index.mjs +3 -3
  86. package/VerticalStack/index.js +13 -47
  87. package/VerticalStack/index.mjs +13 -47
  88. package/__chunks__/ExpandMore400-7c5263a4.mjs +49 -0
  89. package/__chunks__/ExpandMore400-92646971.js +65 -0
  90. package/__chunks__/InputIcon-2317befd.mjs +148 -0
  91. package/__chunks__/InputIcon-d3963cf8.js +147 -0
  92. package/__chunks__/{import-e7f45c7e.mjs → import-0561e1ba.mjs} +3 -3
  93. package/__chunks__/{import-b7971a11.mjs → import-19bc38ac.mjs} +72 -34
  94. package/__chunks__/{import-01299af6.js → import-24a482e1.js} +3 -2
  95. package/__chunks__/{import-baa3cd0c.mjs → import-29af6941.mjs} +4 -3
  96. package/__chunks__/{import-0d1b4d93.js → import-2b302763.js} +193 -141
  97. package/__chunks__/{import-ab878fb6.mjs → import-3d962a94.mjs} +205 -153
  98. package/__chunks__/{import-86330a7c.mjs → import-6a831ca1.mjs} +16 -15
  99. package/__chunks__/{import-7545401a.js → import-8b6c0bc7.js} +3 -3
  100. package/__chunks__/{import-63bf0645.js → import-a1e0f814.js} +47 -9
  101. package/__chunks__/{import-3ab42f86.js → import-a2023d8f.js} +35 -22
  102. package/__chunks__/{import-76076ca6.js → import-dea5a24d.js} +15 -14
  103. package/__chunks__/{import-856e0385.mjs → import-f1f4792a.mjs} +36 -23
  104. package/__chunks__/{UnstyledButton-883f0c6c.mjs → index-29d7bca9.mjs} +17 -42
  105. package/__chunks__/{UnstyledButton-96172ec0.js → index-3985350a.js} +17 -42
  106. package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
  107. package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
  108. package/__chunks__/{real-module-e4cd2301.mjs → real-module-515df21d.mjs} +1 -1
  109. package/__chunks__/{real-module-ae2a4342.js → real-module-e36b1436.js} +1 -1
  110. package/__chunks__/useTriggerWidth-156b038a.js +2030 -0
  111. package/__chunks__/useTriggerWidth-addcd1d6.mjs +2031 -0
  112. package/package.json +11 -11
  113. package/style.css +1423 -1196
  114. package/utilities/css.js +14 -58
  115. package/utilities/css.mjs +14 -58
  116. package/__chunks__/Card-7bbd41e0.mjs +0 -110
  117. package/__chunks__/Card-dac53c75.js +0 -109
  118. package/__chunks__/HorizontalStack-a441c63f.mjs +0 -80
  119. package/__chunks__/HorizontalStack-a862839b.js +0 -79
  120. package/__chunks__/Icon-3d00481a.js +0 -44
  121. package/__chunks__/Icon-a75b5201.mjs +0 -45
  122. package/__chunks__/InputField-4fbaae06.js +0 -487
  123. package/__chunks__/InputField-a272f602.mjs +0 -472
  124. package/__chunks__/Notification-b8eafec6.mjs +0 -1456
  125. package/__chunks__/Notification-c5b34eb3.js +0 -1471
  126. package/__chunks__/SelectorErrorTooltip-43c5e29e.js +0 -84
  127. package/__chunks__/SelectorErrorTooltip-b6204987.mjs +0 -69
  128. package/__chunks__/Text-1ae70c19.js +0 -102
  129. package/__chunks__/Text-4ae50d5c.mjs +0 -103
  130. package/__chunks__/Theme-4e498252.mjs +0 -132
  131. package/__chunks__/Theme-751e5575.js +0 -131
  132. package/__chunks__/Tooltip-bd55165e.js +0 -317
  133. package/__chunks__/Tooltip-f7e67b21.mjs +0 -318
@@ -18,14 +18,7 @@ import React__default, { forwardRef } from "react";
18
18
  import { getResponsiveValue, getResponsiveDesignToken, getComponentToken } from "../utilities/css.mjs";
19
19
  function formatHorizontalGrid(columns) {
20
20
  if (typeof columns === "object" && columns !== null && !Array.isArray(columns)) {
21
- return Object.fromEntries(
22
- Object.entries(columns).map(
23
- ([breakpointAlias, breakpointHorizontalGrid]) => [
24
- breakpointAlias,
25
- getColumnValue(breakpointHorizontalGrid)
26
- ]
27
- )
28
- );
21
+ return Object.fromEntries(Object.entries(columns).map(([breakpointAlias, breakpointHorizontalGrid]) => [breakpointAlias, getColumnValue(breakpointHorizontalGrid)]));
29
22
  }
30
23
  return getColumnValue(columns);
31
24
  }
@@ -52,32 +45,19 @@ function getColumnValue(columns) {
52
45
  }
53
46
  }).join(" ");
54
47
  }
55
- const HorizontalGrid$1 = "_HorizontalGrid_vzocn_5";
48
+ const HorizontalGrid$1 = "_HorizontalGrid_1wcnj_5";
56
49
  const styles = {
57
50
  HorizontalGrid: HorizontalGrid$1
58
51
  };
59
- const HorizontalGrid = forwardRef(
60
- (props, ref) => {
61
- const {
62
- alignItems,
63
- as: As = "div",
64
- children,
65
- columns,
66
- gap,
67
- inline
68
- } = props;
69
- const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, getResponsiveValue(
70
- "horizontal-grid",
71
- "grid-template-columns",
72
- formatHorizontalGrid(columns)
73
- )), getResponsiveDesignToken("horizontal-grid", "gap", "space", gap)), getComponentToken("horizontal-grid", "align-items", alignItems)), getComponentToken(
74
- "horizontal-grid",
75
- "display",
76
- inline ? "inline-grid" : "grid"
77
- ));
78
- return /* @__PURE__ */ React__default.createElement(As, { className: styles.HorizontalGrid, style, ref }, children);
79
- }
80
- );
52
+ const HorizontalGrid = forwardRef((props, ref) => {
53
+ const { alignItems, as: As = "div", children, columns, gap, inline } = props;
54
+ const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, getResponsiveValue("horizontal-grid", "grid-template-columns", formatHorizontalGrid(columns))), getResponsiveDesignToken("horizontal-grid", "gap", "space", gap)), getComponentToken("horizontal-grid", "align-items", alignItems)), getComponentToken("horizontal-grid", "display", inline ? "inline-grid" : "grid"));
55
+ return React__default.createElement(As, {
56
+ className: styles.HorizontalGrid,
57
+ style,
58
+ ref
59
+ }, children);
60
+ });
81
61
  HorizontalGrid.displayName = "HorizontalGrid";
82
62
  export {
83
63
  HorizontalGrid
@@ -1,6 +1,50 @@
1
1
  "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
2
33
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const HorizontalStack = require("../__chunks__/HorizontalStack-a862839b.js");
4
- require("react");
5
- require("../utilities/css.js");
6
- exports.HorizontalStack = HorizontalStack.HorizontalStack;
34
+ const React = require("react");
35
+ const utilities_css = require("../utilities/css.js");
36
+ const HorizontalStack$1 = "_HorizontalStack_7gzzs_5";
37
+ const styles = {
38
+ HorizontalStack: HorizontalStack$1
39
+ };
40
+ const HorizontalStack = React.forwardRef((props, ref) => {
41
+ const _a = props, { as: As = "div", align, blockAlign, gap, wrap = true, children, inline } = _a, restProps = __objRest(_a, ["as", "align", "blockAlign", "gap", "wrap", "children", "inline"]);
42
+ const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, utilities_css.getResponsiveDesignToken("horizontal-stack", "gap", "space", gap)), utilities_css.getComponentToken("horizontal-stack", "align", align)), utilities_css.getComponentToken("horizontal-stack", "block-align", blockAlign)), utilities_css.getComponentToken("horizontal-stack", "wrap", wrap ? "wrap" : "nowrap")), utilities_css.getComponentToken("horizontal-stack", "display", inline ? "inline-flex" : "flex"));
43
+ return React.createElement(As, __spreadProps(__spreadValues({}, restProps), {
44
+ className: styles.HorizontalStack,
45
+ style,
46
+ ref
47
+ }), children);
48
+ });
49
+ HorizontalStack.displayName = "HorizontalStack";
50
+ exports.HorizontalStack = HorizontalStack;
@@ -1,6 +1,50 @@
1
- import { H } from "../__chunks__/HorizontalStack-a441c63f.mjs";
2
- import "react";
3
- import "../utilities/css.mjs";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import React__default, { forwardRef } from "react";
33
+ import { getResponsiveDesignToken, getComponentToken } from "../utilities/css.mjs";
34
+ const HorizontalStack$1 = "_HorizontalStack_7gzzs_5";
35
+ const styles = {
36
+ HorizontalStack: HorizontalStack$1
37
+ };
38
+ const HorizontalStack = forwardRef((props, ref) => {
39
+ const _a = props, { as: As = "div", align, blockAlign, gap, wrap = true, children, inline } = _a, restProps = __objRest(_a, ["as", "align", "blockAlign", "gap", "wrap", "children", "inline"]);
40
+ const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, getResponsiveDesignToken("horizontal-stack", "gap", "space", gap)), getComponentToken("horizontal-stack", "align", align)), getComponentToken("horizontal-stack", "block-align", blockAlign)), getComponentToken("horizontal-stack", "wrap", wrap ? "wrap" : "nowrap")), getComponentToken("horizontal-stack", "display", inline ? "inline-flex" : "flex"));
41
+ return React__default.createElement(As, __spreadProps(__spreadValues({}, restProps), {
42
+ className: styles.HorizontalStack,
43
+ style,
44
+ ref
45
+ }), children);
46
+ });
47
+ HorizontalStack.displayName = "HorizontalStack";
4
48
  export {
5
- H as HorizontalStack
49
+ HorizontalStack
6
50
  };
package/Icon/Icon.d.ts CHANGED
@@ -13,5 +13,56 @@ export type IconProps = {
13
13
  /** Description of icon for informative symbols */
14
14
  accessibilityLabel?: string;
15
15
  };
16
+ /**
17
+ * Icons are helpful and familiar visual symbols used to communicate
18
+ * ideas and represent objects and actions.
19
+ *
20
+ * @remarks
21
+ * Can accept any Easy UI icon via `symbol` prop. Supports customizable
22
+ * responsive sizing, theme and design token colors, and an accessibility
23
+ * label for informative symbols.
24
+ *
25
+ * @example
26
+ * _Default:_
27
+ * ```tsx
28
+ * import { Icon } from "@easypost/easy-ui/Icon";
29
+ * import AddIcon from "@easypost/easy-ui-icons/Add";
30
+ *
31
+ * export function Component() {
32
+ * return <Icon symbol={AddIcon} />;
33
+ * }
34
+ * ```
35
+ *
36
+ * @example
37
+ * _With accessibility label:_
38
+ * ```tsx
39
+ * import { Icon } from "@easypost/easy-ui/Icon";
40
+ * import AddIcon from "@easypost/easy-ui-icons/Add";
41
+ *
42
+ * export function Component() {
43
+ * return <Icon symbol={AddIcon} accessibilityLabel="Add item" />;
44
+ * }
45
+ * ```
46
+ * @example
47
+ * _With color and size:_
48
+ * ```tsx
49
+ * import { Icon } from "@easypost/easy-ui/Icon";
50
+ * import AddIcon from "@easypost/easy-ui-icons/Add";
51
+ *
52
+ * export function Component() {
53
+ * return <Icon symbol={AddIcon} color="success.inverse" size="sm" />;
54
+ * }
55
+ * ```
56
+ * @example
57
+ * _With responsive sizing:_
58
+ * ```tsx
59
+ * import { Icon } from "@easypost/easy-ui/Icon";
60
+ * import AddIcon from "@easypost/easy-ui-icons/Add";
61
+ *
62
+ * export function Component() {
63
+ * return <Icon symbol={AddIcon} size={{ sm: "sm", md: "md", lg: "lg" }} />;
64
+ * }
65
+ * ```
66
+ */
16
67
  export declare function Icon({ symbol: Symbol, size, color, accessibilityLabel, }: IconProps): React.JSX.Element;
17
68
  //# sourceMappingURL=Icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,QAAQ,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,0DAA0D;IAC1D,MAAM,EAAE,UAAU,CAAC;IACnB,uBAAuB;IACvB,IAAI,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAChC,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,IAAI,CAAC,EACnB,MAAM,EAAE,MAAM,EACd,IAAW,EACX,KAAK,EACL,kBAAkB,GACnB,EAAE,SAAS,qBAgBX"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,QAAQ,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,0DAA0D;IAC1D,MAAM,EAAE,UAAU,CAAC;IACnB,uBAAuB;IACvB,IAAI,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAChC,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,IAAI,CAAC,EACnB,MAAM,EAAE,MAAM,EACd,IAAW,EACX,KAAK,EACL,kBAAkB,GACnB,EAAE,SAAS,qBAgBX"}
package/Icon/index.js CHANGED
@@ -1,6 +1,40 @@
1
1
  "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __spreadValues = (a, b) => {
8
+ for (var prop in b || (b = {}))
9
+ if (__hasOwnProp.call(b, prop))
10
+ __defNormalProp(a, prop, b[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b)) {
13
+ if (__propIsEnum.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ }
16
+ return a;
17
+ };
2
18
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Icon = require("../__chunks__/Icon-3d00481a.js");
4
- require("react");
5
- require("../utilities/css.js");
6
- exports.Icon = Icon.Icon;
19
+ const React = require("react");
20
+ const utilities_css = require("../utilities/css.js");
21
+ const Icon$1 = "_Icon_1i611_5";
22
+ const Svg = "_Svg_1i611_54";
23
+ const styles = {
24
+ Icon: Icon$1,
25
+ Svg
26
+ };
27
+ function Icon({ symbol: Symbol2, size = "md", color, accessibilityLabel }) {
28
+ const style = __spreadValues(__spreadValues({}, utilities_css.getComponentThemeToken("icon", "color", "color.text", color)), utilities_css.getResponsiveDesignToken("icon", "size", "size.icon", size));
29
+ return React.createElement("span", {
30
+ className: styles.Icon,
31
+ style
32
+ }, React.createElement(Symbol2, {
33
+ className: styles.Svg,
34
+ focusable: "false",
35
+ role: "img",
36
+ title: accessibilityLabel,
37
+ "aria-hidden": !accessibilityLabel ? "true" : void 0
38
+ }));
39
+ }
40
+ exports.Icon = Icon;
package/Icon/index.mjs CHANGED
@@ -1,6 +1,40 @@
1
- import { I } from "../__chunks__/Icon-a75b5201.mjs";
2
- import "react";
3
- import "../utilities/css.mjs";
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import React__default from "react";
18
+ import { getComponentThemeToken, getResponsiveDesignToken } from "../utilities/css.mjs";
19
+ const Icon$1 = "_Icon_1i611_5";
20
+ const Svg = "_Svg_1i611_54";
21
+ const styles = {
22
+ Icon: Icon$1,
23
+ Svg
24
+ };
25
+ function Icon({ symbol: Symbol2, size = "md", color, accessibilityLabel }) {
26
+ const style = __spreadValues(__spreadValues({}, getComponentThemeToken("icon", "color", "color.text", color)), getResponsiveDesignToken("icon", "size", "size.icon", size));
27
+ return React__default.createElement("span", {
28
+ className: styles.Icon,
29
+ style
30
+ }, React__default.createElement(Symbol2, {
31
+ className: styles.Svg,
32
+ focusable: "false",
33
+ role: "img",
34
+ title: accessibilityLabel,
35
+ "aria-hidden": !accessibilityLabel ? "true" : void 0
36
+ }));
37
+ }
4
38
  export {
5
- I as Icon
39
+ Icon
6
40
  };
@@ -15,6 +15,68 @@ export type IconButtonProps = AriaButtonProps & {
15
15
  /** Disables button */
16
16
  isDisabled?: boolean;
17
17
  };
18
+ /**
19
+ * Button element that represents its behavior with a contextually
20
+ * appropriate icon instead of text.
21
+ *
22
+ * @remarks
23
+ * Use to communicate an action the user can take in order to continue
24
+ * flow in the UI. Supports multiple colors, an outlined variation, and
25
+ * an accessibility label that describes the icon. Underlying element
26
+ * is a button.
27
+ *
28
+ * @example
29
+ * _Default:_
30
+ * ```tsx
31
+ * import { IconButton } from "@easypost/easy-ui/IconButton";
32
+ * import ArrowBackIcon from "@easypost/easy-ui-icons/ArrowBack";
33
+ *
34
+ * export function Component() {
35
+ * return (
36
+ * <IconButton
37
+ * onPress={() => alert("clicked")}
38
+ * icon={ArrowBackIcon}
39
+ * accessibilityLabel="Back"
40
+ * />
41
+ * );
42
+ * }
43
+ * ```
44
+ *
45
+ * @example
46
+ * _Outlined variant:_
47
+ * ```tsx
48
+ * import { IconButton } from "@easypost/easy-ui/IconButton";
49
+ * import ArrowBackIcon from "@easypost/easy-ui-icons/ArrowBack";
50
+ *
51
+ * export function Component() {
52
+ * return (
53
+ * <IconButton
54
+ * onPress={() => alert("clicked")}
55
+ * icon={ArrowBackIcon}
56
+ * accessibilityLabel="Back"
57
+ * variant="outlined"
58
+ * />
59
+ * );
60
+ * }
61
+ * ```
62
+ * @example
63
+ * _Success color:_
64
+ * ```tsx
65
+ * import { IconButton } from "@easypost/easy-ui/IconButton";
66
+ * import ArrowBackIcon from "@easypost/easy-ui-icons/ArrowBack";
67
+ *
68
+ * export function Component() {
69
+ * return (
70
+ * <IconButton
71
+ * onPress={() => alert("clicked")}
72
+ * icon={ArrowBackIcon}
73
+ * accessibilityLabel="Back"
74
+ * color="success"
75
+ * />
76
+ * );
77
+ * }
78
+ * ```
79
+ */
18
80
  export declare const IconButton: React.ForwardRefExoticComponent<AriaButtonProps<"button"> & {
19
81
  /** Button color */
20
82
  color?: ButtonColor | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC9C,mBAAmB;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,0BAA0B;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,UAAU;IAZrB,mBAAmB;;IAEnB,qBAAqB;;IAErB,kBAAkB;UACZ,UAAU;IAChB,0BAA0B;wBACN,MAAM;IAC1B,sBAAsB;;8BA+BtB,CAAC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC9C,mBAAmB;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,0BAA0B;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,eAAO,MAAM,UAAU;IA1ErB,mBAAmB;;IAEnB,qBAAqB;;IAErB,kBAAkB;UACZ,UAAU;IAChB,0BAA0B;wBACN,MAAM;IAC1B,sBAAsB;;8BA6FtB,CAAC"}
@@ -29,23 +29,23 @@ var __objRest = (source, exclude) => {
29
29
  };
30
30
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
31
31
  const React = require("react");
32
- const UnstyledButton = require("../__chunks__/UnstyledButton-96172ec0.js");
33
- const Icon = require("../__chunks__/Icon-3d00481a.js");
34
- const Text = require("../__chunks__/Text-1ae70c19.js");
32
+ const UnstyledButton_index = require("../__chunks__/index-3985350a.js");
33
+ const Icon_index = require("../Icon/index.js");
34
+ const Text_index = require("../Text/index.js");
35
35
  const utilities_css = require("../utilities/css.js");
36
- require("../__chunks__/import-63bf0645.js");
36
+ require("../__chunks__/import-a1e0f814.js");
37
37
  require("../__chunks__/omit-fca26542.js");
38
- require("../__chunks__/import-0d1b4d93.js");
39
- const IconButton$1 = "_IconButton_9zpqn_5";
40
- const colorPrimary = "_colorPrimary_9zpqn_20";
41
- const colorSecondary = "_colorSecondary_9zpqn_28";
42
- const colorSuccess = "_colorSuccess_9zpqn_36";
43
- const colorWarning = "_colorWarning_9zpqn_44";
44
- const colorNeutral = "_colorNeutral_9zpqn_52";
45
- const colorSupport = "_colorSupport_9zpqn_60";
46
- const colorInverse = "_colorInverse_9zpqn_66";
47
- const variantOutlined = "_variantOutlined_9zpqn_72";
48
- const variantFilled = "_variantFilled_9zpqn_103";
38
+ require("../__chunks__/import-2b302763.js");
39
+ const IconButton$1 = "_IconButton_1yv50_5";
40
+ const colorPrimary = "_colorPrimary_1yv50_20";
41
+ const colorSecondary = "_colorSecondary_1yv50_28";
42
+ const colorSuccess = "_colorSuccess_1yv50_36";
43
+ const colorWarning = "_colorWarning_1yv50_44";
44
+ const colorNeutral = "_colorNeutral_1yv50_52";
45
+ const colorSupport = "_colorSupport_1yv50_60";
46
+ const colorInverse = "_colorInverse_1yv50_66";
47
+ const variantOutlined = "_variantOutlined_1yv50_72";
48
+ const variantFilled = "_variantFilled_1yv50_103";
49
49
  const styles = {
50
50
  IconButton: IconButton$1,
51
51
  colorPrimary,
@@ -59,34 +59,17 @@ const styles = {
59
59
  variantFilled
60
60
  };
61
61
  const IconButton = React.forwardRef((props, inRef) => {
62
- const _a = props, {
63
- color = "primary",
64
- variant = "filled",
65
- icon,
66
- accessibilityLabel,
67
- isDisabled = false
68
- } = _a, restProps = __objRest(_a, [
69
- "color",
70
- "variant",
71
- "icon",
72
- "accessibilityLabel",
73
- "isDisabled"
74
- ]);
75
- UnstyledButton.logWarningIfInvalidColorVariantCombination(color, variant);
76
- return /* @__PURE__ */ React.createElement(
77
- UnstyledButton.UnstyledButton,
78
- __spreadValues({
79
- isDisabled,
80
- ref: inRef,
81
- className: utilities_css.classNames(
82
- styles.IconButton,
83
- styles[utilities_css.variationName("variant", variant)],
84
- styles[utilities_css.variationName("color", color)]
85
- )
86
- }, restProps),
87
- /* @__PURE__ */ React.createElement(Text.Text, { visuallyHidden: true }, accessibilityLabel),
88
- /* @__PURE__ */ React.createElement(Icon.Icon, { symbol: icon })
89
- );
62
+ const _a = props, { color = "primary", variant = "filled", icon, accessibilityLabel, isDisabled = false } = _a, restProps = __objRest(_a, ["color", "variant", "icon", "accessibilityLabel", "isDisabled"]);
63
+ UnstyledButton_index.logWarningIfInvalidColorVariantCombination(color, variant);
64
+ return React.createElement(UnstyledButton_index.UnstyledButton, __spreadValues({
65
+ isDisabled,
66
+ ref: inRef,
67
+ className: utilities_css.classNames(styles.IconButton, styles[utilities_css.variationName("variant", variant)], styles[utilities_css.variationName("color", color)])
68
+ }, restProps), React.createElement(Text_index.Text, {
69
+ visuallyHidden: true
70
+ }, accessibilityLabel), React.createElement(Icon_index.Icon, {
71
+ symbol: icon
72
+ }));
90
73
  });
91
74
  IconButton.displayName = "IconButton";
92
75
  exports.IconButton = IconButton;
@@ -27,23 +27,23 @@ 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__/UnstyledButton-883f0c6c.mjs";
31
- import { I as Icon } from "../__chunks__/Icon-a75b5201.mjs";
32
- import { T as Text } from "../__chunks__/Text-4ae50d5c.mjs";
30
+ import { l as logWarningIfInvalidColorVariantCombination, U as UnstyledButton } from "../__chunks__/index-29d7bca9.mjs";
31
+ import { Icon } from "../Icon/index.mjs";
32
+ import { Text } from "../Text/index.mjs";
33
33
  import { classNames, variationName } from "../utilities/css.mjs";
34
- import "../__chunks__/import-b7971a11.mjs";
34
+ import "../__chunks__/import-19bc38ac.mjs";
35
35
  import "../__chunks__/omit-f17deb8f.mjs";
36
- import "../__chunks__/import-ab878fb6.mjs";
37
- const IconButton$1 = "_IconButton_9zpqn_5";
38
- const colorPrimary = "_colorPrimary_9zpqn_20";
39
- const colorSecondary = "_colorSecondary_9zpqn_28";
40
- const colorSuccess = "_colorSuccess_9zpqn_36";
41
- const colorWarning = "_colorWarning_9zpqn_44";
42
- const colorNeutral = "_colorNeutral_9zpqn_52";
43
- const colorSupport = "_colorSupport_9zpqn_60";
44
- const colorInverse = "_colorInverse_9zpqn_66";
45
- const variantOutlined = "_variantOutlined_9zpqn_72";
46
- const variantFilled = "_variantFilled_9zpqn_103";
36
+ import "../__chunks__/import-3d962a94.mjs";
37
+ const IconButton$1 = "_IconButton_1yv50_5";
38
+ const colorPrimary = "_colorPrimary_1yv50_20";
39
+ const colorSecondary = "_colorSecondary_1yv50_28";
40
+ const colorSuccess = "_colorSuccess_1yv50_36";
41
+ const colorWarning = "_colorWarning_1yv50_44";
42
+ const colorNeutral = "_colorNeutral_1yv50_52";
43
+ const colorSupport = "_colorSupport_1yv50_60";
44
+ const colorInverse = "_colorInverse_1yv50_66";
45
+ const variantOutlined = "_variantOutlined_1yv50_72";
46
+ const variantFilled = "_variantFilled_1yv50_103";
47
47
  const styles = {
48
48
  IconButton: IconButton$1,
49
49
  colorPrimary,
@@ -57,34 +57,17 @@ const styles = {
57
57
  variantFilled
58
58
  };
59
59
  const IconButton = forwardRef((props, inRef) => {
60
- const _a = props, {
61
- color = "primary",
62
- variant = "filled",
63
- icon,
64
- accessibilityLabel,
65
- isDisabled = false
66
- } = _a, restProps = __objRest(_a, [
67
- "color",
68
- "variant",
69
- "icon",
70
- "accessibilityLabel",
71
- "isDisabled"
72
- ]);
60
+ const _a = props, { color = "primary", variant = "filled", icon, accessibilityLabel, isDisabled = false } = _a, restProps = __objRest(_a, ["color", "variant", "icon", "accessibilityLabel", "isDisabled"]);
73
61
  logWarningIfInvalidColorVariantCombination(color, variant);
74
- return /* @__PURE__ */ React__default.createElement(
75
- UnstyledButton,
76
- __spreadValues({
77
- isDisabled,
78
- ref: inRef,
79
- className: classNames(
80
- styles.IconButton,
81
- styles[variationName("variant", variant)],
82
- styles[variationName("color", color)]
83
- )
84
- }, restProps),
85
- /* @__PURE__ */ React__default.createElement(Text, { visuallyHidden: true }, accessibilityLabel),
86
- /* @__PURE__ */ React__default.createElement(Icon, { symbol: icon })
87
- );
62
+ return React__default.createElement(UnstyledButton, __spreadValues({
63
+ isDisabled,
64
+ ref: inRef,
65
+ className: classNames(styles.IconButton, styles[variationName("variant", variant)], styles[variationName("color", color)])
66
+ }, restProps), React__default.createElement(Text, {
67
+ visuallyHidden: true
68
+ }, accessibilityLabel), React__default.createElement(Icon, {
69
+ symbol: icon
70
+ }));
88
71
  });
89
72
  IconButton.displayName = "IconButton";
90
73
  export {
@@ -12,10 +12,10 @@ export type LabelProps = {
12
12
  */
13
13
  isLabelEmphasized?: boolean;
14
14
  /**
15
- * Size of associated input.
15
+ * Size of associated field.
16
16
  * @default 'md'
17
17
  */
18
- inputSize?: InputSize;
18
+ fieldSize?: InputSize;
19
19
  /**
20
20
  * Label text displays with error styles.
21
21
  * @default false