@easypost/easy-ui 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/Button/Button.d.ts +27 -0
  2. package/Button/Button.d.ts.map +1 -0
  3. package/Button/Button.test.d.ts +2 -0
  4. package/Button/Button.test.d.ts.map +1 -0
  5. package/Button/index.d.ts +2 -0
  6. package/Button/index.d.ts.map +1 -0
  7. package/Button/index.js +1 -0
  8. package/Button/index.mjs +49 -0
  9. package/Button/utilities.d.ts +5 -0
  10. package/Button/utilities.d.ts.map +1 -0
  11. package/Button.module-115ca683.mjs +818 -0
  12. package/Button.module-14fa8511.js +1 -0
  13. package/Button.module-1fb91980.js +1 -0
  14. package/Button.module-494257e9.js +1 -0
  15. package/Button.module-5cc363bc.js +1 -0
  16. package/Button.module-5ce97013.mjs +818 -0
  17. package/Button.module-607d5623.mjs +818 -0
  18. package/Button.module-679f6b64.js +1 -0
  19. package/Button.module-7023bed7.mjs +818 -0
  20. package/Button.module-77f21f0f.mjs +818 -0
  21. package/Button.module-7d974638.mjs +818 -0
  22. package/Button.module-7f3d0216.js +1 -0
  23. package/Button.module-82af93cc.mjs +818 -0
  24. package/Button.module-9123c201.mjs +818 -0
  25. package/Button.module-91cfa338.js +1 -0
  26. package/Button.module-942c4274.js +1 -0
  27. package/Button.module-94a630d2.js +1 -0
  28. package/Button.module-a2c386c5.mjs +818 -0
  29. package/Button.module-aa9387fb.js +1 -0
  30. package/Button.module-baa496d5.mjs +818 -0
  31. package/DropdownButton/DropdownButton.d.ts +15 -0
  32. package/DropdownButton/DropdownButton.d.ts.map +1 -0
  33. package/DropdownButton/DropdownButton.test.d.ts +2 -0
  34. package/DropdownButton/DropdownButton.test.d.ts.map +1 -0
  35. package/DropdownButton/index.d.ts +2 -0
  36. package/DropdownButton/index.d.ts.map +1 -0
  37. package/DropdownButton/index.js +1 -0
  38. package/DropdownButton/index.mjs +40 -0
  39. package/Icon/Icon.d.ts +17 -0
  40. package/Icon/Icon.d.ts.map +1 -0
  41. package/Icon/Icon.test.d.ts +2 -0
  42. package/Icon/Icon.test.d.ts.map +1 -0
  43. package/Icon/index.d.ts +2 -0
  44. package/Icon/index.d.ts.map +1 -0
  45. package/Icon/index.js +1 -0
  46. package/Icon/index.mjs +6 -0
  47. package/Icon-0c035f66.mjs +30 -0
  48. package/Icon-1b63144c.js +1 -0
  49. package/Icon-37ce3d9a.mjs +30 -0
  50. package/Icon-53acbca3.mjs +30 -0
  51. package/Icon-5639942d.js +1 -0
  52. package/Icon-570b5898.js +1 -0
  53. package/Icon-666c3de5.js +1 -0
  54. package/Icon-68936d33.mjs +30 -0
  55. package/Icon-6abef12c.mjs +30 -0
  56. package/Icon-8baad3e8.js +1 -0
  57. package/Icon-8d3de3bb.js +1 -0
  58. package/Icon-96d00995.mjs +30 -0
  59. package/Icon-98a40b01.mjs +30 -0
  60. package/Icon-aa3be33e.js +1 -0
  61. package/Icon-d82e92cf.js +1 -0
  62. package/Icon-da4359df.mjs +30 -0
  63. package/Icon-e3fea9c2.mjs +30 -0
  64. package/Icon-e457e65d.js +1 -0
  65. package/Icon-eacb00d7.js +1 -0
  66. package/Icon-fea6a93a.mjs +30 -0
  67. package/Placeholder/Placeholder.d.ts +15 -0
  68. package/Placeholder/Placeholder.d.ts.map +1 -0
  69. package/Placeholder/Placeholder.test.d.ts +2 -0
  70. package/Placeholder/Placeholder.test.d.ts.map +1 -0
  71. package/Placeholder/index.d.ts +2 -0
  72. package/Placeholder/index.d.ts.map +1 -0
  73. package/Placeholder/index.js +1 -0
  74. package/Placeholder/index.mjs +65 -0
  75. package/Provider/Provider.d.ts +10 -0
  76. package/Provider/Provider.d.ts.map +1 -0
  77. package/Provider/index.d.ts +2 -0
  78. package/Provider/index.d.ts.map +1 -0
  79. package/Provider/index.js +1 -0
  80. package/Provider/index.mjs +9 -0
  81. package/Text/Text.d.ts +70 -0
  82. package/Text/Text.d.ts.map +1 -0
  83. package/Text/Text.test.d.ts +2 -0
  84. package/Text/Text.test.d.ts.map +1 -0
  85. package/Text/index.d.ts +2 -0
  86. package/Text/index.d.ts.map +1 -0
  87. package/Text/index.js +1 -0
  88. package/Text/index.mjs +60 -0
  89. package/Theme/Container.d.ts +6 -0
  90. package/Theme/Container.d.ts.map +1 -0
  91. package/Theme/Theme.d.ts +63 -0
  92. package/Theme/Theme.d.ts.map +1 -0
  93. package/Theme/Theme.test.d.ts +2 -0
  94. package/Theme/Theme.test.d.ts.map +1 -0
  95. package/Theme/index.d.ts +2 -0
  96. package/Theme/index.d.ts.map +1 -0
  97. package/Theme/index.js +1 -0
  98. package/Theme/index.mjs +8 -0
  99. package/Theme-0f0cbd77.mjs +396 -0
  100. package/Theme-122e766e.mjs +63 -0
  101. package/Theme-141dde98.js +7 -0
  102. package/Theme-161aed4a.mjs +389 -0
  103. package/Theme-1644b1f8.js +1 -0
  104. package/Theme-1a567898.js +18 -0
  105. package/Theme-2364878e.js +33 -0
  106. package/Theme-5ea4ba90.js +5 -0
  107. package/Theme-6ff68130.mjs +3764 -0
  108. package/Theme-93ca6374.js +18 -0
  109. package/Theme-e616f85f.mjs +57 -0
  110. package/Theme-f6215b48.mjs +375 -0
  111. package/package.json +19 -0
  112. package/style.css +1 -0
  113. package/styles/ezui-theme.scss.js +1 -0
  114. package/styles/ezui-theme.scss.mjs +4 -0
  115. package/theme.css +13 -0
  116. package/tokens-19a34c03.js +1 -0
  117. package/tokens-32b892de.mjs +192 -0
  118. package/tokens-4571c29d.js +1 -0
  119. package/tokens-713623f4.mjs +210 -0
  120. package/tokens-e7406ce6.js +1 -0
  121. package/tokens-ecab3956.mjs +196 -0
  122. package/types.d.ts +16 -0
  123. package/types.d.ts.map +1 -0
  124. package/utilities/css.d.ts +21 -0
  125. package/utilities/css.d.ts.map +1 -0
  126. package/utilities/css.js +1 -0
  127. package/utilities/css.mjs +47 -0
  128. package/utilities/css.test.d.ts +2 -0
  129. package/utilities/css.test.d.ts.map +1 -0
  130. package/utilities/css.test.js +1 -0
  131. package/utilities/css.test.mjs +56 -0
  132. package/utilities/storybook.d.ts +33 -0
  133. package/utilities/storybook.d.ts.map +1 -0
  134. package/utilities/storybook.js +1 -0
  135. package/utilities/storybook.mjs +33 -0
  136. package/utilities/tokens.d.ts +2 -0
  137. package/utilities/tokens.d.ts.map +1 -0
  138. package/utilities/tokens.js +1 -0
  139. package/utilities/tokens.mjs +9 -0
  140. package/utilities/tokens.test.d.ts +2 -0
  141. package/utilities/tokens.test.d.ts.map +1 -0
  142. package/utilities/types.d.ts +7 -0
  143. package/utilities/types.d.ts.map +1 -0
  144. package/utilities/types.js +1 -0
  145. package/utilities/types.mjs +1 -0
@@ -0,0 +1,9 @@
1
+ import t from "react";
2
+ import { T as m } from "../Theme-161aed4a.mjs";
3
+ import "../tokens-713623f4.mjs";
4
+ function c({ children: r, theme: e, colorScheme: o }) {
5
+ return /* @__PURE__ */ t.createElement(m, { theme: e, colorScheme: o }, r);
6
+ }
7
+ export {
8
+ c as Provider
9
+ };
package/Text/Text.d.ts ADDED
@@ -0,0 +1,70 @@
1
+ import { ReactNode } from "react";
2
+ import { TokenNamespace, TokenNamespaceWithSuffix } from "../types";
3
+ export type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span";
4
+ export type TextColor = TokenNamespace<"color">;
5
+ export type TextVariant = TokenNamespaceWithSuffix<"font-style", "family">;
6
+ export type TextWeight = "normal" | "medium" | "semibold" | "bold";
7
+ export type TextProps = {
8
+ /** Adjusts horizontal alignment of text */
9
+ alignment?: "start" | "center" | "end" | "justify";
10
+ as?: TextAs;
11
+ /** Prevent text from overflowing inline container */
12
+ breakWord?: boolean;
13
+ /** Text to display */
14
+ children: ReactNode;
15
+ /** Adjust color of text */
16
+ color?: TextColor;
17
+ /** HTML id attribute */
18
+ id?: string;
19
+ /** Truncate text overflow with ellipsis */
20
+ truncate?: boolean;
21
+ /** Adjusts the style of text that's rendered */
22
+ variant?: TextVariant;
23
+ /** Visually hide the text but keep it accessible */
24
+ visuallyHidden?: boolean;
25
+ /** Adjust weight of text */
26
+ weight?: TextWeight;
27
+ };
28
+ /**
29
+ * A typography helper that will apply text styles to the text inside.
30
+ *
31
+ * @remarks
32
+ * Accepts an Easy UI text variant along with other font-related props to adjust
33
+ * the rendered text within Easy UI's constraint system.
34
+ *
35
+ * This component is helpful in product-facing scenarios where components tend
36
+ * to be used all the way down the stack, it may be less helpful in
37
+ * marketing-facing situations where long-form prose is required.
38
+ *
39
+ * @example
40
+ * Standard body text:
41
+ * ```tsx
42
+ * <Text variant="body1">Standard body text rendered as a span</Text>
43
+ * ```
44
+ *
45
+ * @example
46
+ * Working with alignment and color:
47
+ * ```tsx
48
+ * <Text variant="body1" alignment="center" color="blue-500">
49
+ * Standard body text rendered as a span, centered, and colored blue 500
50
+ * </Text>
51
+ * ```
52
+ *
53
+ * @example
54
+ * Working with headings:
55
+ * ```tsx
56
+ * <Text variant="heading2" as="h2" id="unique-heading-id">
57
+ * Heading level 2 text
58
+ * </Text>
59
+ * ```
60
+ *
61
+ * @example
62
+ * Visually hidden for accessibility purposes:
63
+ * ```tsx
64
+ * <Text visuallyHidden>
65
+ * Description of icon or image visually hidden but still in tree
66
+ * </Text>
67
+ * ```
68
+ */
69
+ export declare function Text({ alignment, as: Component, breakWord, children, color, id, truncate, variant, visuallyHidden, weight, }: TextProps): JSX.Element;
70
+ //# sourceMappingURL=Text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAKpE,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC;AAC5E,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG;IACtB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAEnD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB;IACtB,QAAQ,EAAE,SAAS,CAAC;IACpB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wBAAwB;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,IAAI,CAAC,EACnB,SAAS,EACT,EAAE,EAAE,SAAkB,EACtB,SAAiB,EACjB,QAAQ,EACR,KAAK,EACL,EAAE,EACF,QAAgB,EAChB,OAAO,EACP,cAAsB,EACtB,MAAM,GACP,EAAE,SAAS,eAqBX"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Text.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.test.d.ts","sourceRoot":"","sources":["../../src/Text/Text.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./Text";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Text/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
package/Text/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),c=require("../utilities/css.js"),m="_Text_74t3j_5",y="_heading1_74t3j_12",g="_heading2_74t3j_29",h="_heading3_74t3j_46",f="_heading4_74t3j_63",k="_heading5_74t3j_71",v="_subtitle1_74t3j_79",T="_subtitle2_74t3j_87",x="_body1_74t3j_95",p="_body2_74t3j_103",H="_caption_74t3j_111",q="_overline_74t3j_119",N="_button_74t3j_127",S="_normal_74t3j_143",C="_medium_74t3j_147",E="_semibold_74t3j_151",M="_bold_74t3j_155",O="_truncate_74t3j_159",P="_block_74t3j_165",R="_visuallyHidden_74t3j_169",$="_start_74t3j_182",z="_center_74t3j_186",A="_end_74t3j_190",B="_justify_74t3j_194",D="_numeric_74t3j_202",t={Text:m,heading1:y,heading2:g,heading3:h,heading4:f,heading5:k,subtitle1:v,subtitle2:T,body1:x,body2:p,caption:H,overline:q,button:N,"small-button":"_small-button_74t3j_135",normal:S,medium:C,semibold:E,bold:M,truncate:O,block:P,visuallyHidden:R,start:$,center:z,end:A,justify:B,break:"_break_74t3j_198",numeric:D};function F({alignment:e,as:i="span",breakWord:l=!1,children:a,color:d,id:_,truncate:n=!1,variant:o,visuallyHidden:u=!1,weight:s}){const r=c.classNames(t.Text,o&&t[o],s&&t[s],(e||n)&&t.block,e&&t[e],l&&t.break,n&&t.truncate,u&&t.visuallyHidden),b={...c.getComponentToken("text","color","color",d)};return j.createElement(i,{className:r,style:b,id:_||void 0},a)}exports.Text=F;
package/Text/index.mjs ADDED
@@ -0,0 +1,60 @@
1
+ import r from "react";
2
+ import { classNames as u, getComponentToken as m } from "../utilities/css.mjs";
3
+ const y = "_Text_74t3j_5", h = "_heading1_74t3j_12", g = "_heading2_74t3j_29", f = "_heading3_74t3j_46", k = "_heading4_74t3j_63", p = "_heading5_74t3j_71", v = "_subtitle1_74t3j_79", x = "_subtitle2_74t3j_87", T = "_body1_74t3j_95", H = "_body2_74t3j_103", N = "_caption_74t3j_111", C = "_overline_74t3j_119", E = "_button_74t3j_127", R = "_normal_74t3j_143", $ = "_medium_74t3j_147", q = "_semibold_74t3j_151", z = "_bold_74t3j_155", A = "_truncate_74t3j_159", B = "_block_74t3j_165", D = "_visuallyHidden_74t3j_169", F = "_start_74t3j_182", G = "_center_74t3j_186", I = "_end_74t3j_190", J = "_justify_74t3j_194", K = "_numeric_74t3j_202", t = {
4
+ Text: y,
5
+ heading1: h,
6
+ heading2: g,
7
+ heading3: f,
8
+ heading4: k,
9
+ heading5: p,
10
+ subtitle1: v,
11
+ subtitle2: x,
12
+ body1: T,
13
+ body2: H,
14
+ caption: N,
15
+ overline: C,
16
+ button: E,
17
+ "small-button": "_small-button_74t3j_135",
18
+ normal: R,
19
+ medium: $,
20
+ semibold: q,
21
+ bold: z,
22
+ truncate: A,
23
+ block: B,
24
+ visuallyHidden: D,
25
+ start: F,
26
+ center: G,
27
+ end: I,
28
+ justify: J,
29
+ break: "_break_74t3j_198",
30
+ numeric: K
31
+ };
32
+ function O({
33
+ alignment: _,
34
+ as: c = "span",
35
+ breakWord: i = !1,
36
+ children: a,
37
+ color: d,
38
+ id: e,
39
+ truncate: n = !1,
40
+ variant: o,
41
+ visuallyHidden: l = !1,
42
+ weight: s
43
+ }) {
44
+ const b = u(
45
+ t.Text,
46
+ o && t[o],
47
+ s && t[s],
48
+ (_ || n) && t.block,
49
+ _ && t[_],
50
+ i && t.break,
51
+ n && t.truncate,
52
+ l && t.visuallyHidden
53
+ ), j = {
54
+ ...m("text", "color", "color", d)
55
+ };
56
+ return /* @__PURE__ */ r.createElement(c, { className: b, style: j, id: e || void 0 }, a);
57
+ }
58
+ export {
59
+ O as Text
60
+ };
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ export type ContainerProps = {
3
+ children: ReactNode;
4
+ };
5
+ export declare function Container({ children }: ContainerProps): JSX.Element;
6
+ //# sourceMappingURL=Container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/Theme/Container.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKzC,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAIF,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,cAAc,eAWrD"}
@@ -0,0 +1,63 @@
1
+ import { ReactNode } from "react";
2
+ export type Theme = {
3
+ "font.family": string;
4
+ "color.text": string;
5
+ "color.text.heading": string;
6
+ "color.background.disabled": string;
7
+ "color.background.support": string;
8
+ "color.background.primary": string;
9
+ "color.background.primary.hovered": string;
10
+ "color.background.primary.pressed": string;
11
+ "color.background.secondary": string;
12
+ "color.background.secondary.hovered": string;
13
+ "color.background.secondary.pressed": string;
14
+ "color.background.neutral": string;
15
+ "color.background.neutral.hovered": string;
16
+ "color.background.neutral.pressed": string;
17
+ "color.background.success": string;
18
+ "color.background.success.hovered": string;
19
+ "color.background.success.pressed": string;
20
+ "color.background.danger": string;
21
+ "color.background.danger.hovered": string;
22
+ "color.background.danger.pressed": string;
23
+ };
24
+ export type ColorScheme = "light" | "dark" | "system" | "inverted";
25
+ export declare const defaultThemeCreator: ThemeCreator;
26
+ export type ThemeableColorScheme = Extract<ColorScheme, "light" | "dark">;
27
+ export type ThemePreferences = {
28
+ colorScheme: ThemeableColorScheme;
29
+ };
30
+ export type ThemeCreator = (preferences: ThemePreferences) => Theme;
31
+ export type ThemeProviderProps = {
32
+ /** Component tree to apply specified theme. */
33
+ children: ReactNode;
34
+ /**
35
+ * Color scheme to apply to Easy UI.
36
+ * @default system
37
+ */
38
+ colorScheme?: ColorScheme;
39
+ /**
40
+ * Theme to apply to Easy UI. Use `createTheme()` to build theme object.
41
+ * @default defaultTheme
42
+ */
43
+ theme?: ThemeCreator;
44
+ };
45
+ /**
46
+ * Makes the specified `theme` and `colorScheme` applicable to the provided
47
+ * React tree. CSS variables within modules will adjust to
48
+ * the new configuration.
49
+ *
50
+ * @param props.children Component tree to apply specified theme
51
+ * @param props.colorScheme Color scheme to apply to Easy UI
52
+ * @param props.theme Theme to apply to Easy UI. Use `createTheme()` to build theme object
53
+ * @returns Themed component tree
54
+ */
55
+ export declare function ThemeProvider({ children, colorScheme: colorSchemeFromUser, theme: themeFromUser, }: ThemeProviderProps): JSX.Element;
56
+ /**
57
+ * Create a theme to use for Easy UI.
58
+ *
59
+ * @param themeCreator function that returns a theme object
60
+ * @returns theme creation function
61
+ */
62
+ export declare function createTheme(themeCreator: ThemeCreator): ThemeCreator;
63
+ //# sourceMappingURL=Theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/Theme/Theme.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,KAAK,GAAG;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,2BAA2B,EAAE,MAAM,CAAC;IACpC,0BAA0B,EAAE,MAAM,CAAC;IACnC,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,kCAAkC,EAAE,MAAM,CAAC;IAC3C,4BAA4B,EAAE,MAAM,CAAC;IACrC,oCAAoC,EAAE,MAAM,CAAC;IAC7C,oCAAoC,EAAE,MAAM,CAAC;IAC7C,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,kCAAkC,EAAE,MAAM,CAAC;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,kCAAkC,EAAE,MAAM,CAAC;IAC3C,yBAAyB,EAAE,MAAM,CAAC;IAClC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,iCAAiC,EAAE,MAAM,CAAC;CAC3C,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEnE,eAAO,MAAM,mBAAmB,cAE9B,CAAC;AASH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GAAG;IAAE,WAAW,EAAE,oBAAoB,CAAA;CAAE,CAAC;AACrE,MAAM,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,gBAAgB,KAAK,KAAK,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AA4BF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EAAE,mBAAmB,EAChC,KAAK,EAAE,aAAa,GACrB,EAAE,kBAAkB,eAgCpB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,gBAErD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Theme.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Theme.test.d.ts","sourceRoot":"","sources":["../../src/Theme/Theme.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./Theme";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
package/Theme/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Theme-93ca6374.js");require("react");require("../tokens-e7406ce6.js");exports.ThemeProvider=e.ThemeProvider;exports.createTheme=e.createTheme;exports.defaultThemeCreator=e.defaultThemeCreator;
@@ -0,0 +1,8 @@
1
+ import { T as o, c as t, d as T } from "../Theme-161aed4a.mjs";
2
+ import "react";
3
+ import "../tokens-713623f4.mjs";
4
+ export {
5
+ o as ThemeProvider,
6
+ t as createTheme,
7
+ T as defaultThemeCreator
8
+ };
@@ -0,0 +1,396 @@
1
+ import a, { createContext as g, useContext as s, useState as h, useMemo as x, useEffect as _ } from "react";
2
+ import { t as X } from "./tokens-32b892de.mjs";
3
+ var l = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
4
+ function F(e, r, t, o) {
5
+ var n = -1, u = e == null ? 0 : e.length;
6
+ for (o && u && (t = e[++n]); ++n < u; )
7
+ t = r(t, e[n], n, e);
8
+ return t;
9
+ }
10
+ var ee = F;
11
+ function re(e) {
12
+ return function(r) {
13
+ return e == null ? void 0 : e[r];
14
+ };
15
+ }
16
+ var te = re, oe = te, ne = {
17
+ // Latin-1 Supplement block.
18
+ À: "A",
19
+ Á: "A",
20
+ Â: "A",
21
+ Ã: "A",
22
+ Ä: "A",
23
+ Å: "A",
24
+ à: "a",
25
+ á: "a",
26
+ â: "a",
27
+ ã: "a",
28
+ ä: "a",
29
+ å: "a",
30
+ Ç: "C",
31
+ ç: "c",
32
+ Ð: "D",
33
+ ð: "d",
34
+ È: "E",
35
+ É: "E",
36
+ Ê: "E",
37
+ Ë: "E",
38
+ è: "e",
39
+ é: "e",
40
+ ê: "e",
41
+ ë: "e",
42
+ Ì: "I",
43
+ Í: "I",
44
+ Î: "I",
45
+ Ï: "I",
46
+ ì: "i",
47
+ í: "i",
48
+ î: "i",
49
+ ï: "i",
50
+ Ñ: "N",
51
+ ñ: "n",
52
+ Ò: "O",
53
+ Ó: "O",
54
+ Ô: "O",
55
+ Õ: "O",
56
+ Ö: "O",
57
+ Ø: "O",
58
+ ò: "o",
59
+ ó: "o",
60
+ ô: "o",
61
+ õ: "o",
62
+ ö: "o",
63
+ ø: "o",
64
+ Ù: "U",
65
+ Ú: "U",
66
+ Û: "U",
67
+ Ü: "U",
68
+ ù: "u",
69
+ ú: "u",
70
+ û: "u",
71
+ ü: "u",
72
+ Ý: "Y",
73
+ ý: "y",
74
+ ÿ: "y",
75
+ Æ: "Ae",
76
+ æ: "ae",
77
+ Þ: "Th",
78
+ þ: "th",
79
+ ß: "ss",
80
+ // Latin Extended-A block.
81
+ Ā: "A",
82
+ Ă: "A",
83
+ Ą: "A",
84
+ ā: "a",
85
+ ă: "a",
86
+ ą: "a",
87
+ Ć: "C",
88
+ Ĉ: "C",
89
+ Ċ: "C",
90
+ Č: "C",
91
+ ć: "c",
92
+ ĉ: "c",
93
+ ċ: "c",
94
+ č: "c",
95
+ Ď: "D",
96
+ Đ: "D",
97
+ ď: "d",
98
+ đ: "d",
99
+ Ē: "E",
100
+ Ĕ: "E",
101
+ Ė: "E",
102
+ Ę: "E",
103
+ Ě: "E",
104
+ ē: "e",
105
+ ĕ: "e",
106
+ ė: "e",
107
+ ę: "e",
108
+ ě: "e",
109
+ Ĝ: "G",
110
+ Ğ: "G",
111
+ Ġ: "G",
112
+ Ģ: "G",
113
+ ĝ: "g",
114
+ ğ: "g",
115
+ ġ: "g",
116
+ ģ: "g",
117
+ Ĥ: "H",
118
+ Ħ: "H",
119
+ ĥ: "h",
120
+ ħ: "h",
121
+ Ĩ: "I",
122
+ Ī: "I",
123
+ Ĭ: "I",
124
+ Į: "I",
125
+ İ: "I",
126
+ ĩ: "i",
127
+ ī: "i",
128
+ ĭ: "i",
129
+ į: "i",
130
+ ı: "i",
131
+ Ĵ: "J",
132
+ ĵ: "j",
133
+ Ķ: "K",
134
+ ķ: "k",
135
+ ĸ: "k",
136
+ Ĺ: "L",
137
+ Ļ: "L",
138
+ Ľ: "L",
139
+ Ŀ: "L",
140
+ Ł: "L",
141
+ ĺ: "l",
142
+ ļ: "l",
143
+ ľ: "l",
144
+ ŀ: "l",
145
+ ł: "l",
146
+ Ń: "N",
147
+ Ņ: "N",
148
+ Ň: "N",
149
+ Ŋ: "N",
150
+ ń: "n",
151
+ ņ: "n",
152
+ ň: "n",
153
+ ŋ: "n",
154
+ Ō: "O",
155
+ Ŏ: "O",
156
+ Ő: "O",
157
+ ō: "o",
158
+ ŏ: "o",
159
+ ő: "o",
160
+ Ŕ: "R",
161
+ Ŗ: "R",
162
+ Ř: "R",
163
+ ŕ: "r",
164
+ ŗ: "r",
165
+ ř: "r",
166
+ Ś: "S",
167
+ Ŝ: "S",
168
+ Ş: "S",
169
+ Š: "S",
170
+ ś: "s",
171
+ ŝ: "s",
172
+ ş: "s",
173
+ š: "s",
174
+ Ţ: "T",
175
+ Ť: "T",
176
+ Ŧ: "T",
177
+ ţ: "t",
178
+ ť: "t",
179
+ ŧ: "t",
180
+ Ũ: "U",
181
+ Ū: "U",
182
+ Ŭ: "U",
183
+ Ů: "U",
184
+ Ű: "U",
185
+ Ų: "U",
186
+ ũ: "u",
187
+ ū: "u",
188
+ ŭ: "u",
189
+ ů: "u",
190
+ ű: "u",
191
+ ų: "u",
192
+ Ŵ: "W",
193
+ ŵ: "w",
194
+ Ŷ: "Y",
195
+ ŷ: "y",
196
+ Ÿ: "Y",
197
+ Ź: "Z",
198
+ Ż: "Z",
199
+ Ž: "Z",
200
+ ź: "z",
201
+ ż: "z",
202
+ ž: "z",
203
+ IJ: "IJ",
204
+ ij: "ij",
205
+ Œ: "Oe",
206
+ œ: "oe",
207
+ ʼn: "'n",
208
+ ſ: "s"
209
+ }, ue = oe(ne), ae = ue, ce = typeof l == "object" && l && l.Object === Object && l, se = ce, ie = se, fe = typeof self == "object" && self && self.Object === Object && self, de = ie || fe || Function("return this")(), le = de, xe = le, be = xe.Symbol, v = be;
210
+ function me(e, r) {
211
+ for (var t = -1, o = e == null ? 0 : e.length, n = Array(o); ++t < o; )
212
+ n[t] = r(e[t], t, e);
213
+ return n;
214
+ }
215
+ var ge = me, he = Array.isArray, ve = he, S = v, k = Object.prototype, pe = k.hasOwnProperty, Se = k.toString, f = S ? S.toStringTag : void 0;
216
+ function Te(e) {
217
+ var r = pe.call(e, f), t = e[f];
218
+ try {
219
+ e[f] = void 0;
220
+ var o = !0;
221
+ } catch {
222
+ }
223
+ var n = Se.call(e);
224
+ return o && (r ? e[f] = t : delete e[f]), n;
225
+ }
226
+ var ye = Te, Ce = Object.prototype, $e = Ce.toString;
227
+ function Oe(e) {
228
+ return $e.call(e);
229
+ }
230
+ var je = Oe, T = v, Re = ye, we = je, Ee = "[object Null]", Ae = "[object Undefined]", y = T ? T.toStringTag : void 0;
231
+ function _e(e) {
232
+ return e == null ? e === void 0 ? Ae : Ee : y && y in Object(e) ? Re(e) : we(e);
233
+ }
234
+ var ke = _e;
235
+ function Le(e) {
236
+ return e != null && typeof e == "object";
237
+ }
238
+ var Pe = Le, Me = ke, Ie = Pe, We = "[object Symbol]";
239
+ function ze(e) {
240
+ return typeof e == "symbol" || Ie(e) && Me(e) == We;
241
+ }
242
+ var Ne = ze, C = v, Ge = ge, Ue = ve, Ze = Ne, De = 1 / 0, $ = C ? C.prototype : void 0, O = $ ? $.toString : void 0;
243
+ function L(e) {
244
+ if (typeof e == "string")
245
+ return e;
246
+ if (Ue(e))
247
+ return Ge(e, L) + "";
248
+ if (Ze(e))
249
+ return O ? O.call(e) : "";
250
+ var r = e + "";
251
+ return r == "0" && 1 / e == -De ? "-0" : r;
252
+ }
253
+ var He = L, Ve = He;
254
+ function Je(e) {
255
+ return e == null ? "" : Ve(e);
256
+ }
257
+ var P = Je, Ye = ae, Be = P, qe = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ke = "\\u0300-\\u036f", Qe = "\\ufe20-\\ufe2f", Xe = "\\u20d0-\\u20ff", Fe = Ke + Qe + Xe, er = "[" + Fe + "]", rr = RegExp(er, "g");
258
+ function tr(e) {
259
+ return e = Be(e), e && e.replace(qe, Ye).replace(rr, "");
260
+ }
261
+ var or = tr, nr = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
262
+ function ur(e) {
263
+ return e.match(nr) || [];
264
+ }
265
+ var ar = ur, cr = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
266
+ function sr(e) {
267
+ return cr.test(e);
268
+ }
269
+ var ir = sr, M = "\\ud800-\\udfff", fr = "\\u0300-\\u036f", dr = "\\ufe20-\\ufe2f", lr = "\\u20d0-\\u20ff", xr = fr + dr + lr, I = "\\u2700-\\u27bf", W = "a-z\\xdf-\\xf6\\xf8-\\xff", br = "\\xac\\xb1\\xd7\\xf7", mr = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", gr = "\\u2000-\\u206f", hr = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", z = "A-Z\\xc0-\\xd6\\xd8-\\xde", vr = "\\ufe0e\\ufe0f", N = br + mr + gr + hr, G = "['’]", j = "[" + N + "]", pr = "[" + xr + "]", U = "\\d+", Sr = "[" + I + "]", Z = "[" + W + "]", D = "[^" + M + N + U + I + W + z + "]", Tr = "\\ud83c[\\udffb-\\udfff]", yr = "(?:" + pr + "|" + Tr + ")", Cr = "[^" + M + "]", H = "(?:\\ud83c[\\udde6-\\uddff]){2}", V = "[\\ud800-\\udbff][\\udc00-\\udfff]", c = "[" + z + "]", $r = "\\u200d", R = "(?:" + Z + "|" + D + ")", Or = "(?:" + c + "|" + D + ")", w = "(?:" + G + "(?:d|ll|m|re|s|t|ve))?", E = "(?:" + G + "(?:D|LL|M|RE|S|T|VE))?", J = yr + "?", Y = "[" + vr + "]?", jr = "(?:" + $r + "(?:" + [Cr, H, V].join("|") + ")" + Y + J + ")*", Rr = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", wr = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Er = Y + J + jr, Ar = "(?:" + [Sr, H, V].join("|") + ")" + Er, _r = RegExp([
270
+ c + "?" + Z + "+" + w + "(?=" + [j, c, "$"].join("|") + ")",
271
+ Or + "+" + E + "(?=" + [j, c + R, "$"].join("|") + ")",
272
+ c + "?" + R + "+" + w,
273
+ c + "+" + E,
274
+ wr,
275
+ Rr,
276
+ U,
277
+ Ar
278
+ ].join("|"), "g");
279
+ function kr(e) {
280
+ return e.match(_r) || [];
281
+ }
282
+ var Lr = kr, Pr = ar, Mr = ir, Ir = P, Wr = Lr;
283
+ function zr(e, r, t) {
284
+ return e = Ir(e), r = t ? void 0 : r, r === void 0 ? Mr(e) ? Wr(e) : Pr(e) : e.match(r) || [];
285
+ }
286
+ var Nr = zr, Gr = ee, Ur = or, Zr = Nr, Dr = "['’]", Hr = RegExp(Dr, "g");
287
+ function Vr(e) {
288
+ return function(r) {
289
+ return Gr(Zr(Ur(r).replace(Hr, "")), e, "");
290
+ };
291
+ }
292
+ var Jr = Vr, Yr = Jr, Br = Yr(function(e, r, t) {
293
+ return e + (t ? "-" : "") + r.toLowerCase();
294
+ }), qr = Br;
295
+ const Kr = () => nt(X, "theme-light"), Qr = {
296
+ light: "dark",
297
+ dark: "light",
298
+ system: "inverted",
299
+ inverted: "system"
300
+ };
301
+ function A(e) {
302
+ return /* @__PURE__ */ a.createElement(a.Fragment, null, e.children);
303
+ }
304
+ const b = g(0), p = g(null), m = g(null);
305
+ function ct({
306
+ children: e,
307
+ colorScheme: r,
308
+ theme: t
309
+ }) {
310
+ const n = !s(p);
311
+ if (!n && !t && !r)
312
+ throw new Error("Must supply theme or colorScheme to ThemeProvider");
313
+ const u = s(b), [i] = h(() => u + 1), B = n || t ? rt : A, q = n || r ? tt : A, K = t || Kr, Q = r || "system";
314
+ return /* @__PURE__ */ a.createElement(b.Provider, { value: i }, /* @__PURE__ */ a.createElement(B, { theme: K }, /* @__PURE__ */ a.createElement(q, { colorScheme: Q }, /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(et, { isRoot: n }), e))));
315
+ }
316
+ function st(e) {
317
+ return e;
318
+ }
319
+ function Xr() {
320
+ const e = s(p);
321
+ if (!e)
322
+ throw new Error("useTheme() must be used within a ThemeProvier");
323
+ return e;
324
+ }
325
+ function Fr() {
326
+ const e = s(m);
327
+ if (!e)
328
+ throw new Error("useColorScheme() must be used within a ThemeProvider");
329
+ return e;
330
+ }
331
+ function et({ isRoot: e }) {
332
+ const r = s(b), [t] = Xr(), [, , o] = Fr(), n = x(() => `ezui-theme-style-level-${r}`, [r]), u = e ? ":root" : `#${n} ~ *`, i = x(() => o === "system" ? `${u} {
333
+ ${d(t({ colorScheme: "light" }))}
334
+ }
335
+ @media (prefers-color-scheme: dark) {
336
+ ${u} {
337
+ ${d(t({ colorScheme: "dark" }))}
338
+ }
339
+ }` : o === "inverted" ? `${u} {
340
+ ${d(t({ colorScheme: "dark" }))}
341
+ }
342
+ @media (prefers-color-scheme: dark) {
343
+ ${u} {
344
+ ${d(t({ colorScheme: "light" }))}
345
+ }
346
+ }` : `${u} {
347
+ ${d(t({ colorScheme: o }))}
348
+ }`, [o, u, t]);
349
+ return /* @__PURE__ */ a.createElement("style", { id: n, dangerouslySetInnerHTML: { __html: i } });
350
+ }
351
+ function rt({
352
+ theme: e,
353
+ children: r
354
+ }) {
355
+ const [t, o] = h(() => e), n = x(() => [t, o], [t, o]);
356
+ return _(() => {
357
+ o(() => e);
358
+ }, [e]), /* @__PURE__ */ a.createElement(p.Provider, { value: n }, r);
359
+ }
360
+ function tt({
361
+ colorScheme: e,
362
+ children: r
363
+ }) {
364
+ const t = s(m), [o, n] = h(
365
+ () => e
366
+ ), u = x(() => {
367
+ const i = o === "inverted" && t ? Qr[t[2]] : o;
368
+ return [o, n, i];
369
+ }, [o, n, t]);
370
+ return _(() => {
371
+ n(() => e);
372
+ }, [e]), /* @__PURE__ */ a.createElement(m.Provider, { value: u }, r);
373
+ }
374
+ function ot(e) {
375
+ return Object.fromEntries(
376
+ Object.entries(e).map(([r, t]) => [`--ezui-t-${qr(r)}`, t])
377
+ );
378
+ }
379
+ function d(e) {
380
+ const r = ot(e);
381
+ return Object.entries(r).map((o) => o.join(": ") + ";").join(`
382
+ `);
383
+ }
384
+ function nt(e, r) {
385
+ return Object.fromEntries(
386
+ Object.keys(e).filter((o) => o.startsWith(r)).map((o) => {
387
+ const n = o.replace(`${r}-`, "").replace("-", "."), u = `var(--ezui-${o})`;
388
+ return [n, u];
389
+ })
390
+ );
391
+ }
392
+ export {
393
+ ct as T,
394
+ st as c,
395
+ Kr as d
396
+ };