@easypost/easy-ui 1.0.0-alpha.5 → 1.0.0-alpha.7

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 (138) hide show
  1. package/Badge/index.js +16 -16
  2. package/Badge/index.mjs +14 -14
  3. package/Banner/index.js +7 -7
  4. package/Banner/index.mjs +5 -5
  5. package/Button/Button.d.ts +61 -0
  6. package/Button/Button.d.ts.map +1 -1
  7. package/Button/index.js +23 -23
  8. package/Button/index.mjs +20 -20
  9. package/CHANGELOG.md +22 -0
  10. package/Card/index.js +84 -5
  11. package/Card/index.mjs +84 -5
  12. package/Checkbox/index.js +28 -28
  13. package/Checkbox/index.mjs +26 -26
  14. package/CodeBlock/CodeBlock.d.ts +49 -61
  15. package/CodeBlock/CodeBlock.d.ts.map +1 -1
  16. package/CodeBlock/CodeBlock.stories.d.ts +3 -2
  17. package/CodeBlock/CodeBlock.stories.d.ts.map +1 -1
  18. package/CodeBlock/CopyButton.d.ts +9 -0
  19. package/CodeBlock/CopyButton.d.ts.map +1 -0
  20. package/CodeBlock/LanguageMenu.d.ts +18 -0
  21. package/CodeBlock/LanguageMenu.d.ts.map +1 -0
  22. package/CodeBlock/context.d.ts +11 -0
  23. package/CodeBlock/context.d.ts.map +1 -0
  24. package/CodeBlock/index.js +310 -5335
  25. package/CodeBlock/index.mjs +299 -5340
  26. package/CodeSnippet/CodeSnippet.d.ts +82 -0
  27. package/CodeSnippet/CodeSnippet.d.ts.map +1 -0
  28. package/CodeSnippet/CodeSnippet.stories.d.ts +14 -0
  29. package/CodeSnippet/CodeSnippet.stories.d.ts.map +1 -0
  30. package/CodeSnippet/CodeSnippet.test.d.ts +2 -0
  31. package/CodeSnippet/CodeSnippet.test.d.ts.map +1 -0
  32. package/CodeSnippet/SyntaxHighlighter.d.ts +8 -0
  33. package/CodeSnippet/SyntaxHighlighter.d.ts.map +1 -0
  34. package/CodeSnippet/index.d.ts +2 -0
  35. package/CodeSnippet/index.d.ts.map +1 -0
  36. package/CodeSnippet/index.js +11 -0
  37. package/CodeSnippet/index.mjs +11 -0
  38. package/CodeSnippet/theme.d.ts.map +1 -0
  39. package/CodeSnippet/useScrollbar.d.ts.map +1 -0
  40. package/DropdownButton/DropdownButton.d.ts +48 -0
  41. package/DropdownButton/DropdownButton.d.ts.map +1 -1
  42. package/DropdownButton/index.js +17 -17
  43. package/DropdownButton/index.mjs +15 -15
  44. package/HorizontalGrid/index.js +1 -1
  45. package/HorizontalGrid/index.mjs +1 -1
  46. package/HorizontalStack/index.js +48 -4
  47. package/HorizontalStack/index.mjs +48 -4
  48. package/Icon/Icon.d.ts +51 -0
  49. package/Icon/Icon.d.ts.map +1 -1
  50. package/Icon/index.js +38 -4
  51. package/Icon/index.mjs +38 -4
  52. package/IconButton/IconButton.d.ts +62 -0
  53. package/IconButton/IconButton.d.ts.map +1 -1
  54. package/IconButton/index.js +18 -18
  55. package/IconButton/index.mjs +15 -15
  56. package/InputField/index.js +282 -11
  57. package/InputField/index.mjs +266 -11
  58. package/Menu/index.js +57 -15
  59. package/Menu/index.mjs +58 -16
  60. package/Notification/index.js +1534 -14
  61. package/Notification/index.mjs +1518 -14
  62. package/Provider/index.js +9 -9
  63. package/Provider/index.mjs +9 -9
  64. package/RadioGroup/index.js +24 -24
  65. package/RadioGroup/index.mjs +22 -22
  66. package/Select/index.js +71 -29
  67. package/Select/index.mjs +71 -29
  68. package/SelectorErrorTooltip/index.js +99 -8
  69. package/SelectorErrorTooltip/index.mjs +85 -10
  70. package/Text/index.js +85 -4
  71. package/Text/index.mjs +85 -4
  72. package/TextField/index.js +7 -7
  73. package/TextField/index.mjs +8 -8
  74. package/Textarea/index.js +7 -7
  75. package/Textarea/index.mjs +8 -8
  76. package/Theme/index.js +145 -9
  77. package/Theme/index.mjs +145 -9
  78. package/Toggle/index.js +14 -14
  79. package/Toggle/index.mjs +14 -14
  80. package/Tooltip/Tooltip.stories.d.ts +1 -0
  81. package/Tooltip/Tooltip.stories.d.ts.map +1 -1
  82. package/Tooltip/index.js +5 -5
  83. package/Tooltip/index.mjs +6 -6
  84. package/UnstyledButton/index.js +3 -3
  85. package/UnstyledButton/index.mjs +3 -3
  86. package/VerticalStack/index.js +3 -3
  87. package/VerticalStack/index.mjs +3 -3
  88. package/__chunks__/{InputIcon-4a8e5243.mjs → InputIcon-1f2ed127.mjs} +26 -26
  89. package/__chunks__/{InputIcon-70dad3e5.js → InputIcon-f456e366.js} +29 -29
  90. package/__chunks__/{import-87c465c9.js → import-0f8555a4.js} +1 -1
  91. package/__chunks__/{import-fbe7cc7e.mjs → import-19bc38ac.mjs} +26 -26
  92. package/__chunks__/{import-9581a2dc.js → import-26676303.js} +44 -1
  93. package/__chunks__/{import-d2e79ac1.mjs → import-29af6941.mjs} +3 -3
  94. package/__chunks__/{import-a6cadfe8.mjs → import-3faba3a6.mjs} +58 -15
  95. package/__chunks__/{import-d52cd5cf.js → import-890ae60e.js} +1 -1
  96. package/__chunks__/{import-29edaaea.mjs → import-c4caaddf.mjs} +9 -9
  97. package/__chunks__/{import-9c958e32.mjs → import-eb35a9b9.mjs} +2 -2
  98. package/__chunks__/{UnstyledButton-981cd9af.mjs → index-45f05366.mjs} +2 -2
  99. package/__chunks__/{UnstyledButton-5bbb3c5e.js → index-5f429325.js} +1 -1
  100. package/__chunks__/index-72137376.mjs +5421 -0
  101. package/__chunks__/index-a7b6b429.js +5420 -0
  102. package/__chunks__/{Tooltip-c5076ca7.js → index-affe5510.js} +13 -12
  103. package/__chunks__/{Tooltip-b4e23b78.mjs → index-e989a741.mjs} +14 -13
  104. package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
  105. package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
  106. package/__chunks__/{real-module-2f165429.mjs → real-module-515df21d.mjs} +4 -4
  107. package/__chunks__/{tokens-6be8e137.mjs → tokens-3c27019b.mjs} +1 -0
  108. package/__chunks__/{tokens-e696ca96.js → tokens-ad06cd2c.js} +1 -0
  109. package/__chunks__/{useTriggerWidth-29becc21.mjs → useTriggerWidth-b554acaf.mjs} +50 -8
  110. package/__chunks__/{useTriggerWidth-9528009c.js → useTriggerWidth-e11bf6d6.js} +48 -6
  111. package/package.json +10 -8
  112. package/style.css +2182 -2110
  113. package/utilities/react.d.ts +15 -0
  114. package/utilities/react.d.ts.map +1 -0
  115. package/utilities/react.js +333 -0
  116. package/utilities/react.mjs +333 -0
  117. package/CodeBlock/SyntaxHighlighter.d.ts +0 -5
  118. package/CodeBlock/SyntaxHighlighter.d.ts.map +0 -1
  119. package/CodeBlock/theme.d.ts.map +0 -1
  120. package/CodeBlock/useScrollbar.d.ts.map +0 -1
  121. package/__chunks__/Card-2bd533c4.js +0 -85
  122. package/__chunks__/Card-4ad318ba.mjs +0 -86
  123. package/__chunks__/HorizontalStack-65adb570.mjs +0 -50
  124. package/__chunks__/HorizontalStack-f331bfc7.js +0 -49
  125. package/__chunks__/Icon-1a25dcae.js +0 -39
  126. package/__chunks__/Icon-6eb724b4.mjs +0 -40
  127. package/__chunks__/InputField-cc829736.mjs +0 -268
  128. package/__chunks__/InputField-f5072e37.js +0 -283
  129. package/__chunks__/Notification-8d749bd1.mjs +0 -1533
  130. package/__chunks__/Notification-b7a2c277.js +0 -1548
  131. package/__chunks__/SelectorErrorTooltip-4d820c45.mjs +0 -83
  132. package/__chunks__/SelectorErrorTooltip-b7bb5b9d.js +0 -98
  133. package/__chunks__/Text-2efbe1fe.js +0 -86
  134. package/__chunks__/Text-ec2b8d8a.mjs +0 -87
  135. package/__chunks__/Theme-123ba2c3.mjs +0 -147
  136. package/__chunks__/Theme-57f8311c.js +0 -146
  137. /package/{CodeBlock → CodeSnippet}/theme.d.ts +0 -0
  138. /package/{CodeBlock → CodeSnippet}/useScrollbar.d.ts +0 -0
@@ -1,15 +1,90 @@
1
- import { S } from "../__chunks__/SelectorErrorTooltip-4d820c45.mjs";
2
- import "react";
3
- import "../__chunks__/Icon-6eb724b4.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 * as React from "react";
18
+ import React__default from "react";
19
+ import { Icon } from "../Icon/index.mjs";
20
+ import { Text } from "../Text/index.mjs";
21
+ import { T as Tooltip } from "../__chunks__/index-e989a741.mjs";
4
22
  import "../utilities/css.mjs";
5
- import "../__chunks__/Text-ec2b8d8a.mjs";
6
- import "../__chunks__/Tooltip-b4e23b78.mjs";
7
- import "../__chunks__/import-29edaaea.mjs";
8
- import "../__chunks__/import-fbe7cc7e.mjs";
9
- import "../__chunks__/import-a6cadfe8.mjs";
23
+ import "../__chunks__/import-c4caaddf.mjs";
24
+ import "../__chunks__/import-19bc38ac.mjs";
25
+ import "../__chunks__/import-3faba3a6.mjs";
10
26
  import "react-dom";
11
27
  import "../__chunks__/import-6a831ca1.mjs";
12
- import "../__chunks__/real-module-2f165429.mjs";
28
+ import "../__chunks__/real-module-515df21d.mjs";
29
+ var __defProp2 = Object.defineProperty;
30
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
31
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
32
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
33
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, {
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true,
37
+ value
38
+ }) : obj[key] = value;
39
+ var __spreadValues2 = (a, b) => {
40
+ for (var prop in b || (b = {}))
41
+ if (__hasOwnProp2.call(b, prop))
42
+ __defNormalProp2(a, prop, b[prop]);
43
+ if (__getOwnPropSymbols2)
44
+ for (var prop of __getOwnPropSymbols2(b)) {
45
+ if (__propIsEnum2.call(b, prop))
46
+ __defNormalProp2(a, prop, b[prop]);
47
+ }
48
+ return a;
49
+ };
50
+ var __objRest = (source, exclude) => {
51
+ var target = {};
52
+ for (var prop in source)
53
+ if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
54
+ target[prop] = source[prop];
55
+ if (source != null && __getOwnPropSymbols2)
56
+ for (var prop of __getOwnPropSymbols2(source)) {
57
+ if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop))
58
+ target[prop] = source[prop];
59
+ }
60
+ return target;
61
+ };
62
+ const ErrorFill = (_a) => {
63
+ var _b = _a, { title, titleId } = _b, props = __objRest(_b, ["title", "titleId"]);
64
+ return React.createElement("svg", __spreadValues2({
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ viewBox: "0 -960 960 960",
67
+ "aria-labelledby": titleId
68
+ }, props), title ? React.createElement("title", {
69
+ id: titleId
70
+ }, title) : null, React.createElement("path", {
71
+ d: "M479.982-290.77q11.902 0 19.575-7.655 7.673-7.656 7.673-19.558 0-11.902-7.655-19.575t-19.557-7.673q-11.902 0-19.575 7.656-7.673 7.655-7.673 19.557 0 11.902 7.655 19.575t19.557 7.673Zm-20.443-141.076h45.383v-249.538h-45.383v249.538Zm20.794 331.845q-78.955 0-147.897-29.92t-120.755-81.71q-51.814-51.791-81.747-120.777t-29.933-148.025q0-78.655 29.92-147.864t81.71-120.522q51.791-51.314 120.777-81.247t148.025-29.933q78.655 0 147.864 29.92t120.522 81.21q51.314 51.291 81.247 120.629 29.933 69.337 29.933 147.907 0 78.955-29.92 147.897t-81.21 120.571q-51.291 51.629-120.629 81.746-69.337 30.118-147.907 30.118Z"
72
+ }));
73
+ };
74
+ const SelectorErrorTooltip$1 = "_SelectorErrorTooltip_1umds_5";
75
+ const styles = {
76
+ SelectorErrorTooltip: SelectorErrorTooltip$1
77
+ };
78
+ function SelectorErrorTooltip(props) {
79
+ return React__default.createElement(Tooltip, __spreadValues({}, props), React__default.createElement("span", {
80
+ tabIndex: 0,
81
+ className: styles.SelectorErrorTooltip
82
+ }, React__default.createElement(Text, {
83
+ visuallyHidden: true
84
+ }, "Error"), React__default.createElement(Icon, {
85
+ symbol: ErrorFill
86
+ })));
87
+ }
13
88
  export {
14
- S as SelectorErrorTooltip
89
+ SelectorErrorTooltip
15
90
  };
package/Text/index.js CHANGED
@@ -1,6 +1,87 @@
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 Text = require("../__chunks__/Text-2efbe1fe.js");
4
- require("react");
5
- require("../utilities/css.js");
6
- exports.Text = Text.Text;
19
+ const React = require("react");
20
+ const utilities_css = require("../utilities/css.js");
21
+ const Text$1 = "_Text_1jvl7_5";
22
+ const heading1 = "_heading1_1jvl7_13";
23
+ const heading2 = "_heading2_1jvl7_30";
24
+ const heading3 = "_heading3_1jvl7_47";
25
+ const heading4 = "_heading4_1jvl7_64";
26
+ const heading5 = "_heading5_1jvl7_72";
27
+ const subtitle1 = "_subtitle1_1jvl7_80";
28
+ const subtitle2 = "_subtitle2_1jvl7_88";
29
+ const body1 = "_body1_1jvl7_96";
30
+ const body2 = "_body2_1jvl7_104";
31
+ const caption = "_caption_1jvl7_112";
32
+ const overline = "_overline_1jvl7_120";
33
+ const button = "_button_1jvl7_128";
34
+ const normal = "_normal_1jvl7_144";
35
+ const medium = "_medium_1jvl7_148";
36
+ const semibold = "_semibold_1jvl7_152";
37
+ const bold = "_bold_1jvl7_156";
38
+ const truncate = "_truncate_1jvl7_160";
39
+ const block = "_block_1jvl7_166";
40
+ const visuallyHidden = "_visuallyHidden_1jvl7_170";
41
+ const start = "_start_1jvl7_183";
42
+ const center = "_center_1jvl7_187";
43
+ const end = "_end_1jvl7_191";
44
+ const justify = "_justify_1jvl7_195";
45
+ const numeric = "_numeric_1jvl7_203";
46
+ const styles = {
47
+ Text: Text$1,
48
+ heading1,
49
+ heading2,
50
+ heading3,
51
+ heading4,
52
+ heading5,
53
+ subtitle1,
54
+ subtitle2,
55
+ body1,
56
+ body2,
57
+ caption,
58
+ overline,
59
+ button,
60
+ "small-button": "_small-button_1jvl7_136",
61
+ normal,
62
+ medium,
63
+ semibold,
64
+ bold,
65
+ truncate,
66
+ block,
67
+ visuallyHidden,
68
+ start,
69
+ center,
70
+ end,
71
+ justify,
72
+ "break": "_break_1jvl7_199",
73
+ numeric
74
+ };
75
+ function Text({ alignment, as: Component = "span", breakWord = false, children, color, id, truncate: truncate2 = false, variant, visuallyHidden: visuallyHidden2 = false, weight }) {
76
+ const className = utilities_css.classNames(styles.Text, variant && styles[cleanVariant(variant)], weight && styles[weight], (alignment || truncate2) && styles.block, alignment && styles[alignment], breakWord && styles.break, truncate2 && styles.truncate, visuallyHidden2 && styles.visuallyHidden);
77
+ const style = __spreadValues({}, utilities_css.getComponentThemeToken("text", "color", "color.text", color));
78
+ return React.createElement(Component, {
79
+ className,
80
+ style,
81
+ id: id ? id : void 0
82
+ }, children);
83
+ }
84
+ function cleanVariant(variant) {
85
+ return variant.replace(/_/, "-");
86
+ }
87
+ exports.Text = Text;
package/Text/index.mjs CHANGED
@@ -1,6 +1,87 @@
1
- import { T } from "../__chunks__/Text-ec2b8d8a.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 { classNames, getComponentThemeToken } from "../utilities/css.mjs";
19
+ const Text$1 = "_Text_1jvl7_5";
20
+ const heading1 = "_heading1_1jvl7_13";
21
+ const heading2 = "_heading2_1jvl7_30";
22
+ const heading3 = "_heading3_1jvl7_47";
23
+ const heading4 = "_heading4_1jvl7_64";
24
+ const heading5 = "_heading5_1jvl7_72";
25
+ const subtitle1 = "_subtitle1_1jvl7_80";
26
+ const subtitle2 = "_subtitle2_1jvl7_88";
27
+ const body1 = "_body1_1jvl7_96";
28
+ const body2 = "_body2_1jvl7_104";
29
+ const caption = "_caption_1jvl7_112";
30
+ const overline = "_overline_1jvl7_120";
31
+ const button = "_button_1jvl7_128";
32
+ const normal = "_normal_1jvl7_144";
33
+ const medium = "_medium_1jvl7_148";
34
+ const semibold = "_semibold_1jvl7_152";
35
+ const bold = "_bold_1jvl7_156";
36
+ const truncate = "_truncate_1jvl7_160";
37
+ const block = "_block_1jvl7_166";
38
+ const visuallyHidden = "_visuallyHidden_1jvl7_170";
39
+ const start = "_start_1jvl7_183";
40
+ const center = "_center_1jvl7_187";
41
+ const end = "_end_1jvl7_191";
42
+ const justify = "_justify_1jvl7_195";
43
+ const numeric = "_numeric_1jvl7_203";
44
+ const styles = {
45
+ Text: Text$1,
46
+ heading1,
47
+ heading2,
48
+ heading3,
49
+ heading4,
50
+ heading5,
51
+ subtitle1,
52
+ subtitle2,
53
+ body1,
54
+ body2,
55
+ caption,
56
+ overline,
57
+ button,
58
+ "small-button": "_small-button_1jvl7_136",
59
+ normal,
60
+ medium,
61
+ semibold,
62
+ bold,
63
+ truncate,
64
+ block,
65
+ visuallyHidden,
66
+ start,
67
+ center,
68
+ end,
69
+ justify,
70
+ "break": "_break_1jvl7_199",
71
+ numeric
72
+ };
73
+ function Text({ alignment, as: Component = "span", breakWord = false, children, color, id, truncate: truncate2 = false, variant, visuallyHidden: visuallyHidden2 = false, weight }) {
74
+ const className = classNames(styles.Text, variant && styles[cleanVariant(variant)], weight && styles[weight], (alignment || truncate2) && styles.block, alignment && styles[alignment], breakWord && styles.break, truncate2 && styles.truncate, visuallyHidden2 && styles.visuallyHidden);
75
+ const style = __spreadValues({}, getComponentThemeToken("text", "color", "color.text", color));
76
+ return React__default.createElement(Component, {
77
+ className,
78
+ style,
79
+ id: id ? id : void 0
80
+ }, children);
81
+ }
82
+ function cleanVariant(variant) {
83
+ return variant.replace(/_/, "-");
84
+ }
4
85
  export {
5
- T as Text
86
+ Text
6
87
  };
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
- const InputField = require("../__chunks__/InputField-f5072e37.js");
4
+ const InputField_index = require("../InputField/index.js");
5
5
  require("../utilities/css.js");
6
- require("../__chunks__/InputIcon-70dad3e5.js");
7
- require("../__chunks__/Text-2efbe1fe.js");
8
- require("../__chunks__/Icon-1a25dcae.js");
9
- require("../__chunks__/UnstyledButton-5bbb3c5e.js");
6
+ require("../__chunks__/InputIcon-f456e366.js");
7
+ require("../Text/index.js");
8
+ require("../Icon/index.js");
9
+ require("../__chunks__/index-5f429325.js");
10
10
  require("../__chunks__/import-a1e0f814.js");
11
11
  require("../__chunks__/omit-fca26542.js");
12
- require("../__chunks__/import-9581a2dc.js");
12
+ require("../__chunks__/import-26676303.js");
13
13
  require("../__chunks__/import-24a482e1.js");
14
14
  function TextField(props) {
15
15
  const { type = "text", size = "md", isLabelVisuallyHidden = false, isDisabled = false, isRequired = false, validationState = "valid", isLabelEmphasized = false, autoFocus = false, label, errorText, helperText, placeholder, value, defaultValue, iconAtStart, iconAtEnd } = props;
16
- return React.createElement(InputField.InputField, {
16
+ return React.createElement(InputField_index.InputField, {
17
17
  type,
18
18
  size,
19
19
  isLabelVisuallyHidden,
@@ -1,14 +1,14 @@
1
1
  import React__default from "react";
2
- import { I as InputField } from "../__chunks__/InputField-cc829736.mjs";
2
+ import { InputField } from "../InputField/index.mjs";
3
3
  import "../utilities/css.mjs";
4
- import "../__chunks__/InputIcon-4a8e5243.mjs";
5
- import "../__chunks__/Text-ec2b8d8a.mjs";
6
- import "../__chunks__/Icon-6eb724b4.mjs";
7
- import "../__chunks__/UnstyledButton-981cd9af.mjs";
8
- import "../__chunks__/import-fbe7cc7e.mjs";
4
+ import "../__chunks__/InputIcon-1f2ed127.mjs";
5
+ import "../Text/index.mjs";
6
+ import "../Icon/index.mjs";
7
+ import "../__chunks__/index-45f05366.mjs";
8
+ import "../__chunks__/import-19bc38ac.mjs";
9
9
  import "../__chunks__/omit-f17deb8f.mjs";
10
- import "../__chunks__/import-a6cadfe8.mjs";
11
- import "../__chunks__/import-d2e79ac1.mjs";
10
+ import "../__chunks__/import-3faba3a6.mjs";
11
+ import "../__chunks__/import-29af6941.mjs";
12
12
  function TextField(props) {
13
13
  const { type = "text", size = "md", isLabelVisuallyHidden = false, isDisabled = false, isRequired = false, validationState = "valid", isLabelEmphasized = false, autoFocus = false, label, errorText, helperText, placeholder, value, defaultValue, iconAtStart, iconAtEnd } = props;
14
14
  return React__default.createElement(InputField, {
package/Textarea/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
- const InputField = require("../__chunks__/InputField-f5072e37.js");
4
+ const InputField_index = require("../InputField/index.js");
5
5
  require("../utilities/css.js");
6
- require("../__chunks__/InputIcon-70dad3e5.js");
7
- require("../__chunks__/Text-2efbe1fe.js");
8
- require("../__chunks__/Icon-1a25dcae.js");
9
- require("../__chunks__/UnstyledButton-5bbb3c5e.js");
6
+ require("../__chunks__/InputIcon-f456e366.js");
7
+ require("../Text/index.js");
8
+ require("../Icon/index.js");
9
+ require("../__chunks__/index-5f429325.js");
10
10
  require("../__chunks__/import-a1e0f814.js");
11
11
  require("../__chunks__/omit-fca26542.js");
12
- require("../__chunks__/import-9581a2dc.js");
12
+ require("../__chunks__/import-26676303.js");
13
13
  require("../__chunks__/import-24a482e1.js");
14
14
  function Textarea(props) {
15
15
  const { size = "md", isLabelVisuallyHidden = false, isDisabled = false, isRequired = false, validationState = "valid", isLabelEmphasized = false, autoFocus = false, label, errorText, helperText, placeholder, value, defaultValue, rows = 1 } = props;
16
- return React.createElement(InputField.InputField, {
16
+ return React.createElement(InputField_index.InputField, {
17
17
  isMultiline: true,
18
18
  size,
19
19
  isLabelVisuallyHidden,
@@ -1,14 +1,14 @@
1
1
  import React__default from "react";
2
- import { I as InputField } from "../__chunks__/InputField-cc829736.mjs";
2
+ import { InputField } from "../InputField/index.mjs";
3
3
  import "../utilities/css.mjs";
4
- import "../__chunks__/InputIcon-4a8e5243.mjs";
5
- import "../__chunks__/Text-ec2b8d8a.mjs";
6
- import "../__chunks__/Icon-6eb724b4.mjs";
7
- import "../__chunks__/UnstyledButton-981cd9af.mjs";
8
- import "../__chunks__/import-fbe7cc7e.mjs";
4
+ import "../__chunks__/InputIcon-1f2ed127.mjs";
5
+ import "../Text/index.mjs";
6
+ import "../Icon/index.mjs";
7
+ import "../__chunks__/index-45f05366.mjs";
8
+ import "../__chunks__/import-19bc38ac.mjs";
9
9
  import "../__chunks__/omit-f17deb8f.mjs";
10
- import "../__chunks__/import-a6cadfe8.mjs";
11
- import "../__chunks__/import-d2e79ac1.mjs";
10
+ import "../__chunks__/import-3faba3a6.mjs";
11
+ import "../__chunks__/import-29af6941.mjs";
12
12
  function Textarea(props) {
13
13
  const { size = "md", isLabelVisuallyHidden = false, isDisabled = false, isRequired = false, validationState = "valid", isLabelEmphasized = false, autoFocus = false, label, errorText, helperText, placeholder, value, defaultValue, rows = 1 } = props;
14
14
  return React__default.createElement(InputField, {
package/Theme/index.js CHANGED
@@ -1,11 +1,147 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Theme = require("../__chunks__/Theme-57f8311c.js");
4
- require("react");
5
- require("../__chunks__/tokens-e696ca96.js");
6
- require("../utilities/tokens.js");
7
- require("../utilities/css.js");
8
- exports.ThemeProvider = Theme.ThemeProvider;
9
- exports.createTheme = Theme.createTheme;
10
- exports.defaultTheme = Theme.defaultTheme;
11
- exports.getThemeTokenAliases = Theme.getThemeTokenAliases;
3
+ const React = require("react");
4
+ const tokens = require("../__chunks__/tokens-ad06cd2c.js");
5
+ const utilities_tokens = require("../utilities/tokens.js");
6
+ const utilities_css = require("../utilities/css.js");
7
+ const defaultTheme = createTheme(() => {
8
+ return getThemeFromTokens("theme.base");
9
+ });
10
+ const invertedColorSchemes = {
11
+ light: "dark",
12
+ dark: "light",
13
+ system: "inverted",
14
+ inverted: "system"
15
+ };
16
+ function NoopComponent(props) {
17
+ return React.createElement(React.Fragment, null, props.children);
18
+ }
19
+ const TrackerContext = React.createContext(0);
20
+ const ThemeContext = React.createContext(null);
21
+ const ColorSchemeContext = React.createContext(null);
22
+ function ThemeProvider({ children, colorScheme: colorSchemeFromUser, theme: themeFromUser }) {
23
+ const parentTheme = React.useContext(ThemeContext);
24
+ const isRoot = !parentTheme;
25
+ if (!isRoot && !themeFromUser && !colorSchemeFromUser) {
26
+ throw new Error("Must supply theme or colorScheme to ThemeProvider");
27
+ }
28
+ const parentContext = React.useContext(TrackerContext);
29
+ const [count] = React.useState(() => parentContext + 1);
30
+ const ThemeContextComponent = isRoot || themeFromUser ? ThemeContextProvider : NoopComponent;
31
+ const ColorSchemeContextComponent = isRoot || colorSchemeFromUser ? ColorSchemeContextProvider : NoopComponent;
32
+ const theme = themeFromUser ? themeFromUser : defaultTheme;
33
+ const colorScheme = colorSchemeFromUser ? colorSchemeFromUser : "system";
34
+ return React.createElement(TrackerContext.Provider, {
35
+ value: count
36
+ }, React.createElement(ThemeContextComponent, {
37
+ theme
38
+ }, React.createElement(ColorSchemeContextComponent, {
39
+ colorScheme
40
+ }, React.createElement(React.Fragment, null, React.createElement(Style, {
41
+ isRoot
42
+ }), children))));
43
+ }
44
+ function createTheme(themeCreator) {
45
+ return themeCreator;
46
+ }
47
+ function useTheme() {
48
+ const themeContext = React.useContext(ThemeContext);
49
+ if (!themeContext) {
50
+ throw new Error("useTheme() must be used within a ThemeProvier");
51
+ }
52
+ return themeContext;
53
+ }
54
+ function useColorScheme() {
55
+ const colorSchemeContext = React.useContext(ColorSchemeContext);
56
+ if (!colorSchemeContext) {
57
+ throw new Error("useColorScheme() must be used within a ThemeProvider");
58
+ }
59
+ return colorSchemeContext;
60
+ }
61
+ function Style({ isRoot }) {
62
+ const parentContext = React.useContext(TrackerContext);
63
+ const themeCreator = useTheme();
64
+ const { resolvedColorScheme } = useColorScheme();
65
+ const fingerprint = React.useMemo(() => {
66
+ return `ezui-theme-style-level-${parentContext}`;
67
+ }, [parentContext]);
68
+ const selector = isRoot ? ":root" : `#${fingerprint} ~ *`;
69
+ const css = React.useMemo(() => {
70
+ return resolvedColorScheme === "system" ? `${selector} {
71
+ ${renderThemeVariables(themeCreator({
72
+ colorScheme: "light"
73
+ }))}
74
+ }
75
+ @media (prefers-color-scheme: dark) {
76
+ ${selector} {
77
+ ${renderThemeVariables(themeCreator({
78
+ colorScheme: "dark"
79
+ }))}
80
+ }
81
+ }` : resolvedColorScheme === "inverted" ? `${selector} {
82
+ ${renderThemeVariables(themeCreator({
83
+ colorScheme: "dark"
84
+ }))}
85
+ }
86
+ @media (prefers-color-scheme: dark) {
87
+ ${selector} {
88
+ ${renderThemeVariables(themeCreator({
89
+ colorScheme: "light"
90
+ }))}
91
+ }
92
+ }` : `${selector} {
93
+ ${renderThemeVariables(themeCreator({
94
+ colorScheme: resolvedColorScheme
95
+ }))}
96
+ }`;
97
+ }, [resolvedColorScheme, selector, themeCreator]);
98
+ return React.createElement("style", {
99
+ id: fingerprint,
100
+ dangerouslySetInnerHTML: {
101
+ __html: css
102
+ }
103
+ });
104
+ }
105
+ function ThemeContextProvider({ theme, children }) {
106
+ return React.createElement(ThemeContext.Provider, {
107
+ value: theme
108
+ }, children);
109
+ }
110
+ function ColorSchemeContextProvider({ colorScheme, children }) {
111
+ const parentColorSchemeContext = React.useContext(ColorSchemeContext);
112
+ const colorSchemeContextValue = React.useMemo(() => {
113
+ const resolvedColorScheme = colorScheme === "inverted" && parentColorSchemeContext ? invertedColorSchemes[parentColorSchemeContext.resolvedColorScheme] : colorScheme;
114
+ return {
115
+ userColorScheme: colorScheme,
116
+ resolvedColorScheme
117
+ };
118
+ }, [colorScheme, parentColorSchemeContext]);
119
+ return React.createElement(ColorSchemeContext.Provider, {
120
+ value: colorSchemeContextValue
121
+ }, children);
122
+ }
123
+ function getThemeInstanceVariables(theme) {
124
+ return Object.fromEntries(Object.entries(theme).map(([key, value]) => {
125
+ const property = utilities_css.tokenSafeKebabCase(key);
126
+ return [`--ezui-t-${property}`, value];
127
+ }));
128
+ }
129
+ function renderThemeVariables(theme) {
130
+ const variables = getThemeInstanceVariables(theme);
131
+ const css = Object.entries(variables).map((entry) => entry.join(": ") + ";").join("\n");
132
+ return css;
133
+ }
134
+ function getThemeFromTokens(prefix) {
135
+ const theme = Object.fromEntries(Object.keys(tokens.ezuiTokens).filter((key) => key.startsWith(`${prefix}.`)).map((key) => key.replace(new RegExp(`^${prefix}.`), "")).map((key) => {
136
+ const value = `var(--ezui-${utilities_css.tokenSafeKebabCase(prefix)}-${utilities_css.tokenSafeKebabCase(key)})`;
137
+ return [key, value];
138
+ }));
139
+ return theme;
140
+ }
141
+ function getThemeTokenAliases(pattern) {
142
+ return utilities_tokens.getTokenAliases(getThemeFromTokens("theme.base"), pattern);
143
+ }
144
+ exports.ThemeProvider = ThemeProvider;
145
+ exports.createTheme = createTheme;
146
+ exports.defaultTheme = defaultTheme;
147
+ exports.getThemeTokenAliases = getThemeTokenAliases;