@easypost/easy-ui 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (109) hide show
  1. package/Badge/index.js +12 -12
  2. package/Badge/index.mjs +12 -12
  3. package/Banner/index.js +4 -4
  4. package/Banner/index.mjs +4 -4
  5. package/Button/index.js +18 -18
  6. package/Button/index.mjs +18 -18
  7. package/CHANGELOG.md +21 -0
  8. package/Card/index.js +9 -9
  9. package/Card/index.mjs +9 -9
  10. package/Checkbox/index.js +21 -21
  11. package/Checkbox/index.mjs +21 -21
  12. package/CodeBlock/CodeBlock.d.ts +49 -61
  13. package/CodeBlock/CodeBlock.d.ts.map +1 -1
  14. package/CodeBlock/CodeBlock.stories.d.ts +3 -2
  15. package/CodeBlock/CodeBlock.stories.d.ts.map +1 -1
  16. package/CodeBlock/CopyButton.d.ts +9 -0
  17. package/CodeBlock/CopyButton.d.ts.map +1 -0
  18. package/CodeBlock/LanguageMenu.d.ts +18 -0
  19. package/CodeBlock/LanguageMenu.d.ts.map +1 -0
  20. package/CodeBlock/context.d.ts +11 -0
  21. package/CodeBlock/context.d.ts.map +1 -0
  22. package/CodeBlock/index.js +310 -5335
  23. package/CodeBlock/index.mjs +299 -5340
  24. package/CodeSnippet/CodeSnippet.d.ts +82 -0
  25. package/CodeSnippet/CodeSnippet.d.ts.map +1 -0
  26. package/CodeSnippet/CodeSnippet.stories.d.ts +14 -0
  27. package/CodeSnippet/CodeSnippet.stories.d.ts.map +1 -0
  28. package/CodeSnippet/CodeSnippet.test.d.ts +2 -0
  29. package/CodeSnippet/CodeSnippet.test.d.ts.map +1 -0
  30. package/CodeSnippet/SyntaxHighlighter.d.ts +8 -0
  31. package/CodeSnippet/SyntaxHighlighter.d.ts.map +1 -0
  32. package/CodeSnippet/index.d.ts +2 -0
  33. package/CodeSnippet/index.d.ts.map +1 -0
  34. package/CodeSnippet/index.js +11 -0
  35. package/CodeSnippet/index.mjs +11 -0
  36. package/CodeSnippet/theme.d.ts.map +1 -0
  37. package/CodeSnippet/useScrollbar.d.ts.map +1 -0
  38. package/DropdownButton/index.js +13 -13
  39. package/DropdownButton/index.mjs +13 -13
  40. package/HorizontalGrid/index.js +1 -1
  41. package/HorizontalGrid/index.mjs +1 -1
  42. package/HorizontalStack/index.js +1 -1
  43. package/HorizontalStack/index.mjs +1 -1
  44. package/Icon/index.js +2 -2
  45. package/Icon/index.mjs +2 -2
  46. package/IconButton/index.js +12 -12
  47. package/IconButton/index.mjs +12 -12
  48. package/InputField/index.js +3 -3
  49. package/InputField/index.mjs +3 -3
  50. package/Menu/index.js +11 -11
  51. package/Menu/index.mjs +11 -11
  52. package/Notification/index.js +14 -14
  53. package/Notification/index.mjs +14 -14
  54. package/Provider/index.js +3 -3
  55. package/Provider/index.mjs +3 -3
  56. package/RadioGroup/index.js +15 -15
  57. package/RadioGroup/index.mjs +15 -15
  58. package/Select/index.js +23 -23
  59. package/Select/index.mjs +23 -23
  60. package/SelectorErrorTooltip/index.js +4 -4
  61. package/SelectorErrorTooltip/index.mjs +4 -4
  62. package/Text/index.js +27 -27
  63. package/Text/index.mjs +27 -27
  64. package/TextField/index.js +3 -3
  65. package/TextField/index.mjs +3 -3
  66. package/Textarea/index.js +3 -3
  67. package/Textarea/index.mjs +3 -3
  68. package/Theme/index.js +1 -1
  69. package/Theme/index.mjs +1 -1
  70. package/Toggle/index.js +12 -12
  71. package/Toggle/index.mjs +12 -12
  72. package/Tooltip/Tooltip.stories.d.ts +1 -0
  73. package/Tooltip/Tooltip.stories.d.ts.map +1 -1
  74. package/Tooltip/index.js +8 -297
  75. package/Tooltip/index.mjs +8 -297
  76. package/UnstyledButton/index.js +2 -2
  77. package/UnstyledButton/index.mjs +2 -2
  78. package/VerticalStack/index.js +3 -3
  79. package/VerticalStack/index.mjs +3 -3
  80. package/__chunks__/{InputIcon-2317befd.mjs → InputIcon-db15c32a.mjs} +24 -24
  81. package/__chunks__/{InputIcon-d3963cf8.js → InputIcon-e721be51.js} +24 -24
  82. package/__chunks__/{import-a2023d8f.js → import-0f8555a4.js} +1 -1
  83. package/__chunks__/{import-2b302763.js → import-26676303.js} +1 -0
  84. package/__chunks__/{import-3d962a94.mjs → import-3faba3a6.mjs} +2 -1
  85. package/__chunks__/{import-8b6c0bc7.js → import-890ae60e.js} +1 -1
  86. package/__chunks__/{import-f1f4792a.mjs → import-c4caaddf.mjs} +5 -5
  87. package/__chunks__/{import-0561e1ba.mjs → import-eb35a9b9.mjs} +1 -1
  88. package/__chunks__/index-0c519caa.mjs +5421 -0
  89. package/__chunks__/index-12ba1ea7.js +299 -0
  90. package/__chunks__/{index-29d7bca9.mjs → index-45f05366.mjs} +1 -1
  91. package/__chunks__/{index-3985350a.js → index-5f429325.js} +1 -1
  92. package/__chunks__/index-766f8373.mjs +300 -0
  93. package/__chunks__/index-9964b6cd.js +5420 -0
  94. package/__chunks__/{tokens-6be8e137.mjs → tokens-3c27019b.mjs} +1 -0
  95. package/__chunks__/{tokens-e696ca96.js → tokens-ad06cd2c.js} +1 -0
  96. package/__chunks__/{useTriggerWidth-addcd1d6.mjs → useTriggerWidth-b554acaf.mjs} +23 -23
  97. package/__chunks__/{useTriggerWidth-156b038a.js → useTriggerWidth-e11bf6d6.js} +2 -2
  98. package/package.json +7 -5
  99. package/style.css +562 -491
  100. package/utilities/react.d.ts +15 -0
  101. package/utilities/react.d.ts.map +1 -0
  102. package/utilities/react.js +333 -0
  103. package/utilities/react.mjs +333 -0
  104. package/CodeBlock/SyntaxHighlighter.d.ts +0 -5
  105. package/CodeBlock/SyntaxHighlighter.d.ts.map +0 -1
  106. package/CodeBlock/theme.d.ts.map +0 -1
  107. package/CodeBlock/useScrollbar.d.ts.map +0 -1
  108. /package/{CodeBlock → CodeSnippet}/theme.d.ts +0 -0
  109. /package/{CodeBlock → CodeSnippet}/useScrollbar.d.ts +0 -0
package/Badge/index.js CHANGED
@@ -4,18 +4,18 @@ const React = require("react");
4
4
  const Icon_index = require("../Icon/index.js");
5
5
  const Text_index = require("../Text/index.js");
6
6
  const utilities_css = require("../utilities/css.js");
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";
7
+ const root = "_root_1n0s2_5";
8
+ const primary = "_primary_1n0s2_16";
9
+ const secondary = "_secondary_1n0s2_17";
10
+ const text = "_text_1n0s2_32";
11
+ const variantPrimary = "_variantPrimary_1n0s2_37";
12
+ const variantSecondary = "_variantSecondary_1n0s2_44";
13
+ const variantBlack = "_variantBlack_1n0s2_51";
14
+ const variantInverse = "_variantInverse_1n0s2_58";
15
+ const variantGray = "_variantGray_1n0s2_65";
16
+ const variantSuccess = "_variantSuccess_1n0s2_72";
17
+ const variantWarning = "_variantWarning_1n0s2_79";
18
+ const variantDanger = "_variantDanger_1n0s2_86";
19
19
  const styles = {
20
20
  root,
21
21
  primary,
package/Badge/index.mjs CHANGED
@@ -2,18 +2,18 @@ import React__default from "react";
2
2
  import { Icon } from "../Icon/index.mjs";
3
3
  import { Text } from "../Text/index.mjs";
4
4
  import { classNames, variationName } from "../utilities/css.mjs";
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";
5
+ const root = "_root_1n0s2_5";
6
+ const primary = "_primary_1n0s2_16";
7
+ const secondary = "_secondary_1n0s2_17";
8
+ const text = "_text_1n0s2_32";
9
+ const variantPrimary = "_variantPrimary_1n0s2_37";
10
+ const variantSecondary = "_variantSecondary_1n0s2_44";
11
+ const variantBlack = "_variantBlack_1n0s2_51";
12
+ const variantInverse = "_variantInverse_1n0s2_58";
13
+ const variantGray = "_variantGray_1n0s2_65";
14
+ const variantSuccess = "_variantSuccess_1n0s2_72";
15
+ const variantWarning = "_variantWarning_1n0s2_79";
16
+ const variantDanger = "_variantDanger_1n0s2_86";
17
17
  const styles = {
18
18
  root,
19
19
  primary,
package/Banner/index.js CHANGED
@@ -3,10 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const Text_index = require("../Text/index.js");
5
5
  const utilities_css = require("../utilities/css.js");
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";
6
+ const colorSuccess = "_colorSuccess_dg1vs_5";
7
+ const colorPrimary = "_colorPrimary_dg1vs_10";
8
+ const colorNeutral = "_colorNeutral_dg1vs_11";
9
+ const Banner$1 = "_Banner_dg1vs_23";
10
10
  const styles = {
11
11
  colorSuccess,
12
12
  colorPrimary,
package/Banner/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import React__default from "react";
2
2
  import { Text } from "../Text/index.mjs";
3
3
  import { classNames, variationName } from "../utilities/css.mjs";
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";
4
+ const colorSuccess = "_colorSuccess_dg1vs_5";
5
+ const colorPrimary = "_colorPrimary_dg1vs_10";
6
+ const colorNeutral = "_colorNeutral_dg1vs_11";
7
+ const Banner$1 = "_Banner_dg1vs_23";
8
8
  const styles = {
9
9
  colorSuccess,
10
10
  colorPrimary,
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 UnstyledButton_index = require("../__chunks__/index-3985350a.js");
32
+ const UnstyledButton_index = require("../__chunks__/index-5f429325.js");
33
33
  const Icon_index = require("../Icon/index.js");
34
34
  const utilities_css = require("../utilities/css.js");
35
35
  require("../__chunks__/import-a1e0f814.js");
36
36
  require("../__chunks__/omit-fca26542.js");
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";
37
+ require("../__chunks__/import-26676303.js");
38
+ const Button$1 = "_Button_1uegy_5";
39
+ const colorPrimary = "_colorPrimary_1uegy_20";
40
+ const colorSecondary = "_colorSecondary_1uegy_28";
41
+ const colorSuccess = "_colorSuccess_1uegy_36";
42
+ const colorWarning = "_colorWarning_1uegy_44";
43
+ const colorNeutral = "_colorNeutral_1uegy_52";
44
+ const colorSupport = "_colorSupport_1uegy_60";
45
+ const colorInverse = "_colorInverse_1uegy_66";
46
+ const variantFilled = "_variantFilled_1uegy_72";
47
+ const variantOutlined = "_variantOutlined_1uegy_99";
48
+ const variantLink = "_variantLink_1uegy_127";
49
+ const sizeMd = "_sizeMd_1uegy_153";
50
+ const sizeSm = "_sizeSm_1uegy_161";
51
+ const block = "_block_1uegy_180";
52
+ const iconAtStart = "_iconAtStart_1uegy_185";
53
+ const iconAtEnd = "_iconAtEnd_1uegy_189";
54
54
  const styles = {
55
55
  Button: Button$1,
56
56
  colorPrimary,
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__/index-29d7bca9.mjs";
30
+ import { l as logWarningIfInvalidColorVariantCombination, U as UnstyledButton } from "../__chunks__/index-45f05366.mjs";
31
31
  import { Icon } from "../Icon/index.mjs";
32
32
  import { classNames, variationName } from "../utilities/css.mjs";
33
33
  import "../__chunks__/import-19bc38ac.mjs";
34
34
  import "../__chunks__/omit-f17deb8f.mjs";
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";
35
+ import "../__chunks__/import-3faba3a6.mjs";
36
+ const Button$1 = "_Button_1uegy_5";
37
+ const colorPrimary = "_colorPrimary_1uegy_20";
38
+ const colorSecondary = "_colorSecondary_1uegy_28";
39
+ const colorSuccess = "_colorSuccess_1uegy_36";
40
+ const colorWarning = "_colorWarning_1uegy_44";
41
+ const colorNeutral = "_colorNeutral_1uegy_52";
42
+ const colorSupport = "_colorSupport_1uegy_60";
43
+ const colorInverse = "_colorInverse_1uegy_66";
44
+ const variantFilled = "_variantFilled_1uegy_72";
45
+ const variantOutlined = "_variantOutlined_1uegy_99";
46
+ const variantLink = "_variantLink_1uegy_127";
47
+ const sizeMd = "_sizeMd_1uegy_153";
48
+ const sizeSm = "_sizeSm_1uegy_161";
49
+ const block = "_block_1uegy_180";
50
+ const iconAtStart = "_iconAtStart_1uegy_185";
51
+ const iconAtEnd = "_iconAtEnd_1uegy_189";
52
52
  const styles = {
53
53
  Button: Button$1,
54
54
  colorPrimary,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @easypost/easy-ui
2
2
 
3
+ ## 1.0.0-alpha.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e64ff79]
8
+ - @easypost/easy-ui-icons@1.0.0-alpha.8
9
+
10
+ ## 1.0.0-alpha.7
11
+
12
+ ### Minor Changes
13
+
14
+ - f98ca90: Add max width to `<Tooltip />`
15
+ - 644a07b: Create `<CodeBlock />` component
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [44ceab3]
20
+ - Updated dependencies [644a07b]
21
+ - @easypost/easy-ui-icons@1.0.0-alpha.7
22
+ - @easypost/easy-ui-tokens@1.0.0-alpha.4
23
+
3
24
  ## 1.0.0-alpha.6
4
25
 
5
26
  ### Patch Changes
package/Card/index.js CHANGED
@@ -31,15 +31,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
31
31
  const omit = require("../__chunks__/omit-fca26542.js");
32
32
  const React = require("react");
33
33
  const utilities_css = require("../utilities/css.js");
34
- const container = "_container_p14mb_5";
35
- const area = "_area_p14mb_22";
36
- const variantOutlined = "_variantOutlined_p14mb_58";
37
- const variantFlagged = "_variantFlagged_p14mb_59";
38
- const selected = "_selected_p14mb_71";
39
- const disabled = "_disabled_p14mb_75";
40
- const statusDanger = "_statusDanger_p14mb_79";
41
- const statusWarning = "_statusWarning_p14mb_83";
42
- const statusSuccess = "_statusSuccess_p14mb_87";
34
+ const container = "_container_1yrys_5";
35
+ const area = "_area_1yrys_23";
36
+ const variantOutlined = "_variantOutlined_1yrys_59";
37
+ const variantFlagged = "_variantFlagged_1yrys_60";
38
+ const selected = "_selected_1yrys_72";
39
+ const disabled = "_disabled_1yrys_76";
40
+ const statusDanger = "_statusDanger_1yrys_80";
41
+ const statusWarning = "_statusWarning_1yrys_84";
42
+ const statusSuccess = "_statusSuccess_1yrys_88";
43
43
  const styles = {
44
44
  container,
45
45
  area,
package/Card/index.mjs CHANGED
@@ -29,15 +29,15 @@ var __objRest = (source, exclude) => {
29
29
  import { o as omit } from "../__chunks__/omit-f17deb8f.mjs";
30
30
  import React__default from "react";
31
31
  import { classNames, variationName, getComponentThemeToken, getResponsiveDesignToken } from "../utilities/css.mjs";
32
- const container = "_container_p14mb_5";
33
- const area = "_area_p14mb_22";
34
- const variantOutlined = "_variantOutlined_p14mb_58";
35
- const variantFlagged = "_variantFlagged_p14mb_59";
36
- const selected = "_selected_p14mb_71";
37
- const disabled = "_disabled_p14mb_75";
38
- const statusDanger = "_statusDanger_p14mb_79";
39
- const statusWarning = "_statusWarning_p14mb_83";
40
- const statusSuccess = "_statusSuccess_p14mb_87";
32
+ const container = "_container_1yrys_5";
33
+ const area = "_area_1yrys_23";
34
+ const variantOutlined = "_variantOutlined_1yrys_59";
35
+ const variantFlagged = "_variantFlagged_1yrys_60";
36
+ const selected = "_selected_1yrys_72";
37
+ const disabled = "_disabled_1yrys_76";
38
+ const statusDanger = "_statusDanger_1yrys_80";
39
+ const statusWarning = "_statusWarning_1yrys_84";
40
+ const statusSuccess = "_statusSuccess_1yrys_88";
41
41
  const styles = {
42
42
  container,
43
43
  area,
package/Checkbox/index.js CHANGED
@@ -24,10 +24,10 @@ const Icon_index = require("../Icon/index.js");
24
24
  const SelectorErrorTooltip_index = require("../SelectorErrorTooltip/index.js");
25
25
  const Text_index = require("../Text/index.js");
26
26
  const utilities_css = require("../utilities/css.js");
27
- const _import = require("../__chunks__/import-8b6c0bc7.js");
28
- const _import$1 = require("../__chunks__/import-2b302763.js");
29
- require("../Tooltip/index.js");
30
- require("../__chunks__/import-a2023d8f.js");
27
+ const _import = require("../__chunks__/import-890ae60e.js");
28
+ const _import$1 = require("../__chunks__/import-26676303.js");
29
+ require("../__chunks__/index-12ba1ea7.js");
30
+ require("../__chunks__/import-0f8555a4.js");
31
31
  require("../__chunks__/import-a1e0f814.js");
32
32
  require("react-dom");
33
33
  require("../__chunks__/import-dea5a24d.js");
@@ -108,7 +108,7 @@ const Check600 = (_a) => {
108
108
  }, props), title ? React__namespace.createElement("title", {
109
109
  id: titleId
110
110
  }, title) : null, React__namespace.createElement("path", {
111
- d: "M378-248.391q-7.696 0-14.674-2.848t-13.109-8.978l-181-181Q157.391-453.043 157.391-470t11.826-28.783q11.826-11.826 28.066-11.826 16.239 0 28.63 11.826L378-346.696l355.652-355.087q11.826-11.826 28.283-12.109 16.456-.282 28.283 12.109 11.826 11.826 11.826 28.566 0 16.739-11.826 28.565L405.783-260.217q-6.131 6.13-13.109 8.978T378-248.391Z"
111
+ d: "m378-346.696 355.652-355.087q11.968-11.826 28.354-11.826 16.385 0 28.212 11.879 11.826 11.879 11.826 28.452 0 16.574-11.826 28.626l-383.87 383.87q-12.032 11.826-28.451 11.826t-28.245-11.826l-180.87-180.87q-11.826-12.119-11.609-28.712.218-16.593 12.097-28.419t28.452-11.826q16.574 0 28.626 11.826L378-346.696Z"
112
112
  }));
113
113
  };
114
114
  var __defProp2 = Object.defineProperty;
@@ -153,24 +153,24 @@ const Remove600 = (_a) => {
153
153
  }, props), title ? React__namespace.createElement("title", {
154
154
  id: titleId
155
155
  }, title) : null, React__namespace.createElement("path", {
156
- d: "M190.391-440.391v-79.218h579.218v79.218H190.391Z"
156
+ d: "M185.869-440.391v-79.218h588.827v79.218H185.869Z"
157
157
  }));
158
158
  };
159
- const Checkbox$1 = "_Checkbox_1r930_5";
160
- const label = "_label_1r930_17";
161
- const box = "_box_1r930_40";
162
- const check = "_check_1r930_41";
163
- const focusVisible = "_focusVisible_1r930_56";
164
- const text = "_text_1r930_72";
165
- const indeterminateSvg = "_indeterminateSvg_1r930_77";
166
- const nested = "_nested_1r930_81";
167
- const sizeLg = "_sizeLg_1r930_85";
168
- const invalid = "_invalid_1r930_91";
169
- const disabled = "_disabled_1r930_95";
170
- const indeterminate = "_indeterminate_1r930_77";
171
- const selected = "_selected_1r930_100";
172
- const hovered = "_hovered_1r930_116";
173
- const readOnly = "_readOnly_1r930_116";
159
+ const Checkbox$1 = "_Checkbox_ff1e1_5";
160
+ const label = "_label_ff1e1_17";
161
+ const box = "_box_ff1e1_41";
162
+ const check = "_check_ff1e1_42";
163
+ const focusVisible = "_focusVisible_ff1e1_57";
164
+ const text = "_text_ff1e1_73";
165
+ const indeterminateSvg = "_indeterminateSvg_ff1e1_78";
166
+ const nested = "_nested_ff1e1_82";
167
+ const sizeLg = "_sizeLg_ff1e1_86";
168
+ const invalid = "_invalid_ff1e1_92";
169
+ const disabled = "_disabled_ff1e1_96";
170
+ const indeterminate = "_indeterminate_ff1e1_78";
171
+ const selected = "_selected_ff1e1_101";
172
+ const hovered = "_hovered_ff1e1_117";
173
+ const readOnly = "_readOnly_ff1e1_117";
174
174
  const styles = {
175
175
  Checkbox: Checkbox$1,
176
176
  label,
@@ -23,10 +23,10 @@ import { Icon } from "../Icon/index.mjs";
23
23
  import { SelectorErrorTooltip } from "../SelectorErrorTooltip/index.mjs";
24
24
  import { Text } from "../Text/index.mjs";
25
25
  import { classNames, variationName } from "../utilities/css.mjs";
26
- import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577, a as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../__chunks__/import-0561e1ba.mjs";
27
- import { e as $f7dceffc5ad7768b$export$4e328f61c538687f, f as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/import-3d962a94.mjs";
28
- import "../Tooltip/index.mjs";
29
- import "../__chunks__/import-f1f4792a.mjs";
26
+ import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577, a as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../__chunks__/import-eb35a9b9.mjs";
27
+ import { e as $f7dceffc5ad7768b$export$4e328f61c538687f, f as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/import-3faba3a6.mjs";
28
+ import "../__chunks__/index-766f8373.mjs";
29
+ import "../__chunks__/import-c4caaddf.mjs";
30
30
  import "../__chunks__/import-19bc38ac.mjs";
31
31
  import "react-dom";
32
32
  import "../__chunks__/import-6a831ca1.mjs";
@@ -90,7 +90,7 @@ const Check600 = (_a) => {
90
90
  }, props), title ? React.createElement("title", {
91
91
  id: titleId
92
92
  }, title) : null, React.createElement("path", {
93
- d: "M378-248.391q-7.696 0-14.674-2.848t-13.109-8.978l-181-181Q157.391-453.043 157.391-470t11.826-28.783q11.826-11.826 28.066-11.826 16.239 0 28.63 11.826L378-346.696l355.652-355.087q11.826-11.826 28.283-12.109 16.456-.282 28.283 12.109 11.826 11.826 11.826 28.566 0 16.739-11.826 28.565L405.783-260.217q-6.131 6.13-13.109 8.978T378-248.391Z"
93
+ d: "m378-346.696 355.652-355.087q11.968-11.826 28.354-11.826 16.385 0 28.212 11.879 11.826 11.879 11.826 28.452 0 16.574-11.826 28.626l-383.87 383.87q-12.032 11.826-28.451 11.826t-28.245-11.826l-180.87-180.87q-11.826-12.119-11.609-28.712.218-16.593 12.097-28.419t28.452-11.826q16.574 0 28.626 11.826L378-346.696Z"
94
94
  }));
95
95
  };
96
96
  var __defProp2 = Object.defineProperty;
@@ -135,24 +135,24 @@ const Remove600 = (_a) => {
135
135
  }, props), title ? React.createElement("title", {
136
136
  id: titleId
137
137
  }, title) : null, React.createElement("path", {
138
- d: "M190.391-440.391v-79.218h579.218v79.218H190.391Z"
138
+ d: "M185.869-440.391v-79.218h588.827v79.218H185.869Z"
139
139
  }));
140
140
  };
141
- const Checkbox$1 = "_Checkbox_1r930_5";
142
- const label = "_label_1r930_17";
143
- const box = "_box_1r930_40";
144
- const check = "_check_1r930_41";
145
- const focusVisible = "_focusVisible_1r930_56";
146
- const text = "_text_1r930_72";
147
- const indeterminateSvg = "_indeterminateSvg_1r930_77";
148
- const nested = "_nested_1r930_81";
149
- const sizeLg = "_sizeLg_1r930_85";
150
- const invalid = "_invalid_1r930_91";
151
- const disabled = "_disabled_1r930_95";
152
- const indeterminate = "_indeterminate_1r930_77";
153
- const selected = "_selected_1r930_100";
154
- const hovered = "_hovered_1r930_116";
155
- const readOnly = "_readOnly_1r930_116";
141
+ const Checkbox$1 = "_Checkbox_ff1e1_5";
142
+ const label = "_label_ff1e1_17";
143
+ const box = "_box_ff1e1_41";
144
+ const check = "_check_ff1e1_42";
145
+ const focusVisible = "_focusVisible_ff1e1_57";
146
+ const text = "_text_ff1e1_73";
147
+ const indeterminateSvg = "_indeterminateSvg_ff1e1_78";
148
+ const nested = "_nested_ff1e1_82";
149
+ const sizeLg = "_sizeLg_ff1e1_86";
150
+ const invalid = "_invalid_ff1e1_92";
151
+ const disabled = "_disabled_ff1e1_96";
152
+ const indeterminate = "_indeterminate_ff1e1_78";
153
+ const selected = "_selected_ff1e1_101";
154
+ const hovered = "_hovered_ff1e1_117";
155
+ const readOnly = "_readOnly_ff1e1_117";
156
156
  const styles = {
157
157
  Checkbox: Checkbox$1,
158
158
  label,
@@ -1,82 +1,70 @@
1
- import React from "react";
2
- import { SnippetLanguages } from "./SyntaxHighlighter";
3
- export type CodeBlockProps = Partial<Omit<HTMLDivElement, "children">> & {
1
+ import React, { ReactNode } from "react";
2
+ import { CodeSnippetProps } from "../CodeSnippet";
3
+ import { SnippetLanguage } from "../CodeSnippet/SyntaxHighlighter";
4
+ export type CodeBlockProps = {
4
5
  /**
5
- * `children` is not supported. Use `code` instead.
6
+ * CodeBlock content. This should be a header and collection of snippets.
6
7
  */
7
- children?: never;
8
+ children: ReactNode;
8
9
  /**
9
- * The code snippet to be rendered.
10
+ * Selected language.
10
11
  */
11
- code: string;
12
+ language: SnippetLanguage;
12
13
  /**
13
- * The language of the code snippet.
14
+ * Callback for when the selected language changes.
14
15
  */
15
- language: SnippetLanguages;
16
+ onLanguageChange: (language: SnippetLanguage) => void;
17
+ };
18
+ export type CodeBlockHeaderProps = {
16
19
  /**
17
- * Constrains the height of code block to a set number of lines.
20
+ * Header title.
18
21
  */
19
- maxLines?: number;
22
+ children: ReactNode;
20
23
  /**
21
- * Include line numbers in code block.
24
+ * Header color.
25
+ *
26
+ * @default neutral
22
27
  */
23
- showLineNumbers?: boolean;
28
+ color?: "neutral" | "primary" | "secondary";
24
29
  };
30
+ export type CodeBlockSnippetProps = CodeSnippetProps;
31
+ declare function CodeBlockHeader(props: CodeBlockHeaderProps): React.JSX.Element;
32
+ declare namespace CodeBlockHeader {
33
+ var displayName: string;
34
+ }
35
+ declare function CodeBlockSnippet(props: CodeBlockSnippetProps): React.JSX.Element;
36
+ declare namespace CodeBlockSnippet {
37
+ var displayName: string;
38
+ }
25
39
  /**
26
- * A display element for readable blocks of code.
40
+ * A component to display and switch between readable blocks of code.
27
41
  *
28
42
  * @remarks
29
- * Use a Code Block to improve readability of embedded code samples with
30
- * syntax highlighting and automatic line numbering.
43
+ * Use a `CodeBlock` to improve readability of embedded code samples, to allow
44
+ * the user to select between multiple `CodeSnippet`s, and to allow copying
45
+ * code to the user's clipboard.
31
46
  *
32
47
  * @example
33
48
  * ```tsx
34
- * <CodeBlock
35
- * code={`console.log("Hello world");`}
36
- * language="javascript"
37
- * />
38
- * ```
49
+ * import { CodeBlock } from "@easypost/easy-ui/CodeBlock";
39
50
  *
40
- * @example
41
- * _Line numbers:_
42
- * ```tsx
43
- * <CodeBlock
44
- * code={`console.log("Hello world");`}
45
- * language="javascript"
46
- * showLineNumbers
47
- * />
48
- * ```
49
- *
50
- * @example
51
- * _Max lines:_
52
- * ```tsx
53
- * <CodeBlock
54
- * code={`console.log("Hello world");`}
55
- * language="javascript"
56
- * maxLines={8}
57
- * />
51
+ * function Component() {
52
+ * const [language, setLanguage] = useState("javascript");
53
+ * return (
54
+ * <CodeBlock language={language} onLanguageChange={setLanguage}>
55
+ * <CodeBlock.Header>Header</CodeVisualizer.Header>
56
+ * <CodeBlock.Snippet language="javascript" code={``} />
57
+ * <CodeBlock.Snippet language="csharp" code={``} />
58
+ * </CodeBlock>
59
+ * );
60
+ * }
58
61
  * ```
59
62
  */
60
- export declare const CodeBlock: React.ForwardRefExoticComponent<Partial<Omit<HTMLDivElement, "children">> & {
61
- /**
62
- * `children` is not supported. Use `code` instead.
63
- */
64
- children?: undefined;
65
- /**
66
- * The code snippet to be rendered.
67
- */
68
- code: string;
69
- /**
70
- * The language of the code snippet.
71
- */
72
- language: SnippetLanguages;
73
- /**
74
- * Constrains the height of code block to a set number of lines.
75
- */
76
- maxLines?: number | undefined;
77
- /**
78
- * Include line numbers in code block.
79
- */
80
- showLineNumbers?: boolean | undefined;
81
- } & React.RefAttributes<HTMLDivElement>>;
63
+ export declare function CodeBlock(props: CodeBlockProps): React.JSX.Element;
64
+ export declare namespace CodeBlock {
65
+ var displayName: string;
66
+ var Header: typeof CodeBlockHeader;
67
+ var Snippet: typeof CodeBlockSnippet;
68
+ }
69
+ export {};
82
70
  //# sourceMappingURL=CodeBlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,qBAAqB,CAAC;AAM1E,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,GAAG;IACvE;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,SAAS;IA7DpB;;OAEG;;IAGH;;OAEG;UACG,MAAM;IAEZ;;OAEG;cACO,gBAAgB;IAE1B;;OAEG;;IAGH;;OAEG;;wCA+DJ,CAAC"}
1
+ {"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAClD,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAWnE,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;OAEG;IACH,gBAAgB,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAErD,iBAAS,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAgCnD;kBAhCQ,eAAe;;;AAoCxB,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAErD;kBAFQ,gBAAgB;;;AAMzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA8C9C;yBA9Ce,SAAS"}
@@ -4,6 +4,7 @@ type Story = StoryObj<typeof CodeBlock>;
4
4
  declare const meta: Meta<typeof CodeBlock>;
5
5
  export default meta;
6
6
  export declare const Default: Story;
7
- export declare const LineNumbers: Story;
8
- export declare const MaxLines: Story;
7
+ export declare const SingleLanguageMode: Story;
8
+ export declare const CustomHeader: StoryObj<typeof CodeBlock.Header>;
9
+ export declare const SideBySide: Story;
9
10
  //# sourceMappingURL=CodeBlock.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.stories.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAGxD,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAMxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAQhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC"}
1
+ {"version":3,"file":"CodeBlock.stories.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CodeBlock.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAGxD,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AA2BxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAgBhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAehC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,OAAO,SAAS,CAAC,MAAM,CAuB1D,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAyBxB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export type CopyButtonProps = {
3
+ text: string;
4
+ };
5
+ export declare function CopyButton({ text }: CopyButtonProps): React.JSX.Element;
6
+ export declare namespace CopyButton {
7
+ var displayName: string;
8
+ }
9
+ //# sourceMappingURL=CopyButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/CopyButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,qBAwBnD;yBAxBe,UAAU"}
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { SnippetLanguage } from "../CodeSnippet/SyntaxHighlighter";
3
+ export type LanguageMenuProps = {
4
+ /**
5
+ * List of languages.
6
+ */
7
+ languages: SnippetLanguage[];
8
+ /**
9
+ * Selected language.
10
+ */
11
+ language: SnippetLanguage;
12
+ /**
13
+ * Callback for when the selected language changes.
14
+ */
15
+ onChange: (language: SnippetLanguage) => void;
16
+ };
17
+ export declare function LanguageMenu(props: LanguageMenuProps): React.JSX.Element;
18
+ //# sourceMappingURL=LanguageMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LanguageMenu.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/LanguageMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAS1C,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,EAAE,eAAe,EAAE,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA8BpD"}
@@ -0,0 +1,11 @@
1
+ import { ReactElement } from "react";
2
+ import { SnippetLanguage } from "../CodeSnippet/SyntaxHighlighter";
3
+ export type CodeBlockContextType = {
4
+ languages: SnippetLanguage[];
5
+ snippet: ReactElement;
6
+ language: SnippetLanguage;
7
+ onLanguageChange: (language: SnippetLanguage) => void;
8
+ };
9
+ export declare const CodeBlockContext: import("react").Context<CodeBlockContextType | null>;
10
+ export declare const useCodeBlock: () => CodeBlockContextType;
11
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/CodeBlock/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6B,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAE5B,CAAC;AAEF,eAAO,MAAM,YAAY,4BAMxB,CAAC"}