@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
package/types.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import type tokens from "@easypost/easy-ui-tokens/js/tokens";
3
+ export type DesignTokens = typeof tokens;
4
+ export type DesignTokenAliases = keyof DesignTokens;
5
+ export type Falsy = boolean | undefined | null | 0;
6
+ export type Namespace<Set, Needle extends string> = Set extends `${Needle}${infer _X}` ? _X : never;
7
+ export type TokenNamespace<Needle extends string> = Namespace<DesignTokenAliases, `${Needle}-`>;
8
+ export type NamespaceWithSuffix<Set, NeedlePrefix extends string, NeedleSuffix extends string> = Set extends `${NeedlePrefix}${infer _X}${NeedleSuffix}` ? _X : never;
9
+ export type TokenNamespaceWithSuffix<NeedlePrefix extends string, NeedleSuffix extends string> = NamespaceWithSuffix<DesignTokenAliases, `${NeedlePrefix}-`, `-${NeedleSuffix}`>;
10
+ type IconSymbolProps = React.SVGProps<SVGSVGElement> & {
11
+ title?: string;
12
+ titleId?: string;
13
+ };
14
+ export type IconSymbol = React.FunctionComponent<IconSymbolProps>;
15
+ export {};
16
+ //# sourceMappingURL=types.d.ts.map
package/types.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,oCAAoC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC;AACzC,MAAM,MAAM,kBAAkB,GAAG,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC;AAGnD,MAAM,MAAM,SAAS,CACnB,GAAG,EACH,MAAM,SAAS,MAAM,IACnB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAMpD,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,MAAM,IAAI,SAAS,CAC3D,kBAAkB,EAClB,GAAG,MAAM,GAAG,CACb,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAC7B,GAAG,EACH,YAAY,SAAS,MAAM,EAC3B,YAAY,SAAS,MAAM,IACzB,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAOzE,MAAM,MAAM,wBAAwB,CAClC,YAAY,SAAS,MAAM,EAC3B,YAAY,SAAS,MAAM,IACzB,mBAAmB,CACrB,kBAAkB,EAClB,GAAG,YAAY,GAAG,EAClB,IAAI,YAAY,EAAE,CACnB,CAAC;AAEF,KAAK,eAAe,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import type { Falsy, TokenNamespace } from "../types";
3
+ export type BreakpointsAlias = TokenNamespace<"breakpoint">;
4
+ export type ResponsiveProp<T> = T | {
5
+ [Breakpoint in BreakpointsAlias]?: T;
6
+ };
7
+ export declare function classNames(...classes: (string | Falsy)[]): string;
8
+ export declare function variationName(name: string, value: string): string;
9
+ export declare function sanitizeCustomProperties(styles: React.CSSProperties): {
10
+ [k: string]: any;
11
+ } | undefined;
12
+ export declare function getComponentToken(componentName: string, componentProp: string, tokenSubgroup: string, token?: string): {
13
+ [x: string]: string;
14
+ };
15
+ export declare function getResponsiveToken(componentName: string, componentProp: string, tokenSubgroup: string, responsiveProp?: ResponsiveProp<string>): {
16
+ [x: string]: string;
17
+ };
18
+ export declare function getResponsiveValue(componentName: string, componentProp: string, responsiveValue?: ResponsiveProp<string>): {
19
+ [k: string]: any;
20
+ } | undefined;
21
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/utilities/css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG;KAAG,UAAU,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC;CAAE,CAAC;AAE7E,wBAAgB,UAAU,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,UAExD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAExD;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa;;cAKnE;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,KAAK,CAAC,EAAE,MAAM;;EAQf;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,cAAc,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;;EAgBxC;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,eAAe,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;;cAoBzC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function $(...e){return e.filter(Boolean).join(" ")}function c(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}function u(e){const t=Object.entries(e).filter(([,i])=>i!=null);return t.length?Object.fromEntries(t):void 0}function a(e,t,i,n){return n?{[`--ezui-c-${e}-${t}`]:`var(--ezui-${i}-${n})`}:{}}function f(e,t,i,n){return n?typeof n=="string"?{[`--ezui-c-${e}-${t}-xs`]:`var(--ezui-${i}-${n})`}:Object.fromEntries(Object.entries(n).map(([r,s])=>[`--ezui-c-${e}-${t}-${r}`,`var(--ezui-${i}-${s})`])):{}}function o(e,t,i){return i?u(typeof i=="string"?{[`--ezui-c-${e}-${t}-xs`]:i}:Object.fromEntries(Object.entries(i).map(([n,r])=>[`--ezui-c-${e}-${t}-${n}`,r]))):{}}exports.classNames=$;exports.getComponentToken=a;exports.getResponsiveToken=f;exports.getResponsiveValue=o;exports.sanitizeCustomProperties=u;exports.variationName=c;
@@ -0,0 +1,47 @@
1
+ function f(...t) {
2
+ return t.filter(Boolean).join(" ");
3
+ }
4
+ function c(t, e) {
5
+ return `${t}${e.charAt(0).toUpperCase()}${e.slice(1)}`;
6
+ }
7
+ function u(t) {
8
+ const e = Object.entries(t).filter(
9
+ ([, i]) => i != null
10
+ );
11
+ return e.length ? Object.fromEntries(e) : void 0;
12
+ }
13
+ function s(t, e, i, r) {
14
+ return r ? {
15
+ [`--ezui-c-${t}-${e}`]: `var(--ezui-${i}-${r})`
16
+ } : {};
17
+ }
18
+ function a(t, e, i, r) {
19
+ return r ? typeof r == "string" ? {
20
+ [`--ezui-c-${t}-${e}-xs`]: `var(--ezui-${i}-${r})`
21
+ } : Object.fromEntries(
22
+ Object.entries(r).map(([n, $]) => [
23
+ `--ezui-c-${t}-${e}-${n}`,
24
+ `var(--ezui-${i}-${$})`
25
+ ])
26
+ ) : {};
27
+ }
28
+ function z(t, e, i) {
29
+ return i ? u(typeof i == "string" ? {
30
+ [`--ezui-c-${t}-${e}-xs`]: i
31
+ } : Object.fromEntries(
32
+ Object.entries(i).map(
33
+ ([r, n]) => [
34
+ `--ezui-c-${t}-${e}-${r}`,
35
+ n
36
+ ]
37
+ )
38
+ )) : {};
39
+ }
40
+ export {
41
+ f as classNames,
42
+ s as getComponentToken,
43
+ a as getResponsiveToken,
44
+ z as getResponsiveValue,
45
+ u as sanitizeCustomProperties,
46
+ c as variationName
47
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=css.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.test.d.ts","sourceRoot":"","sources":["../../src/utilities/css.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./css.js");describe("classNames",()=>{it("returns a single string from multiple classes",()=>{expect(e.classNames("btn","btn-sm")).toBe("btn btn-sm")}),it("filters out falsy values",()=>{expect(e.classNames("btn","btn-sm",!1,void 0,null,0)).toBe("btn btn-sm")})});describe("variationName",()=>{it("returns a name with the first character in the value capitalized",()=>{expect(e.variationName("size","medium")).toBe("sizeMedium")})});describe("getResponsiveToken",()=>{it("takes a string and returns the custom token",()=>{expect(e.getResponsiveToken("stack","space","space","4")).toMatchObject({"--ezui-c-stack-space-xs":"var(--ezui-space-4)"})}),it("takes an object with a breakpoint and value and returns the token for each breakpoint",()=>{expect(e.getResponsiveToken("stack","space","space",{xs:"2",md:"8"})).toMatchObject({"--ezui-c-stack-space-xs":"var(--ezui-space-2)","--ezui-c-stack-space-md":"var(--ezui-space-8)"})})});describe("getResponsiveValue",()=>{it("takes a string and returns the custom value",()=>{expect(e.getResponsiveValue("stack","space","4")).toMatchObject({"--ezui-c-stack-space-xs":"4"})}),it("takes an object with a breakpoint and value and returns the value for each breakpoint",()=>{expect(e.getResponsiveValue("stack","space",{xs:"2",md:"8"})).toMatchObject({"--ezui-c-stack-space-xs":"2","--ezui-c-stack-space-md":"8"})}),it("takes an object with a breakpoint and null value and sanitizes its output",()=>{expect(e.getResponsiveValue("stack","space",{xs:"2",md:null})).toMatchObject({"--ezui-c-stack-space-xs":"2"})})});
@@ -0,0 +1,56 @@
1
+ import { classNames as t, variationName as s, getResponsiveToken as a, getResponsiveValue as e } from "./css.mjs";
2
+ describe("classNames", () => {
3
+ it("returns a single string from multiple classes", () => {
4
+ expect(t("btn", "btn-sm")).toBe("btn btn-sm");
5
+ }), it("filters out falsy values", () => {
6
+ expect(
7
+ t(
8
+ "btn",
9
+ "btn-sm",
10
+ !1,
11
+ void 0,
12
+ null,
13
+ 0
14
+ )
15
+ ).toBe("btn btn-sm");
16
+ });
17
+ });
18
+ describe("variationName", () => {
19
+ it("returns a name with the first character in the value capitalized", () => {
20
+ expect(s("size", "medium")).toBe("sizeMedium");
21
+ });
22
+ });
23
+ describe("getResponsiveToken", () => {
24
+ it("takes a string and returns the custom token", () => {
25
+ expect(a("stack", "space", "space", "4")).toMatchObject({
26
+ "--ezui-c-stack-space-xs": "var(--ezui-space-4)"
27
+ });
28
+ }), it("takes an object with a breakpoint and value and returns the token for each breakpoint", () => {
29
+ expect(
30
+ a("stack", "space", "space", { xs: "2", md: "8" })
31
+ ).toMatchObject({
32
+ "--ezui-c-stack-space-xs": "var(--ezui-space-2)",
33
+ "--ezui-c-stack-space-md": "var(--ezui-space-8)"
34
+ });
35
+ });
36
+ });
37
+ describe("getResponsiveValue", () => {
38
+ it("takes a string and returns the custom value", () => {
39
+ expect(e("stack", "space", "4")).toMatchObject({
40
+ "--ezui-c-stack-space-xs": "4"
41
+ });
42
+ }), it("takes an object with a breakpoint and value and returns the value for each breakpoint", () => {
43
+ expect(
44
+ e("stack", "space", { xs: "2", md: "8" })
45
+ ).toMatchObject({
46
+ "--ezui-c-stack-space-xs": "2",
47
+ "--ezui-c-stack-space-md": "8"
48
+ });
49
+ }), it("takes an object with a breakpoint and null value and sanitizes its output", () => {
50
+ expect(
51
+ e("stack", "space", { xs: "2", md: null })
52
+ ).toMatchObject({
53
+ "--ezui-c-stack-space-xs": "2"
54
+ });
55
+ });
56
+ });
@@ -0,0 +1,33 @@
1
+ export declare function createLabelledOptionsControl(opts: Record<string, unknown>, control?: {}): {
2
+ options: string[];
3
+ mapping: Record<string, unknown>;
4
+ control: {
5
+ type: string;
6
+ labels: {};
7
+ };
8
+ };
9
+ export declare function createFontStyleTokensControl(): {
10
+ options: string[];
11
+ mapping: Record<string, unknown>;
12
+ control: {
13
+ type: string;
14
+ labels: {};
15
+ };
16
+ };
17
+ export declare function createColorTokensControl(): {
18
+ options: string[];
19
+ mapping: Record<string, unknown>;
20
+ control: {
21
+ type: string;
22
+ labels: {};
23
+ };
24
+ };
25
+ export declare function getTokensControl(pattern: string): {
26
+ options: string[];
27
+ mapping: Record<string, unknown>;
28
+ control: {
29
+ type: string;
30
+ labels: {};
31
+ };
32
+ };
33
+ //# sourceMappingURL=storybook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storybook.d.ts","sourceRoot":"","sources":["../../src/utilities/storybook.ts"],"names":[],"mappings":"AAGA,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,KAAK;;;;;;;EAWb;AAED,wBAAgB,4BAA4B;;;;;;;EAE3C;AAED,wBAAgB,wBAAwB;;;;;;;EAEvC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM;;;;;;;EAO/C"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../tokens-e7406ce6.js"),c=require("./tokens.js");function l(e,o={}){return{options:Object.keys(e),mapping:e,control:{type:"select",labels:Object.keys(e).reduce((t,r)=>({...t,[r]:r}),{}),...o}}}function i(){return n("font-style-{alias}-family")}function a(){return n("color-{alias}")}function n(e){return l(c.getTokenAliases(s.tokens,e).reduce((o,t)=>({...o,[t]:t}),{}))}exports.createColorTokensControl=a;exports.createFontStyleTokensControl=i;exports.createLabelledOptionsControl=l;exports.getTokensControl=n;
@@ -0,0 +1,33 @@
1
+ import { t as l } from "../tokens-713623f4.mjs";
2
+ import { getTokenAliases as c } from "./tokens.mjs";
3
+ function s(e, t = {}) {
4
+ return {
5
+ options: Object.keys(e),
6
+ mapping: e,
7
+ control: {
8
+ type: "select",
9
+ labels: Object.keys(e).reduce((o, n) => ({ ...o, [n]: n }), {}),
10
+ ...t
11
+ }
12
+ };
13
+ }
14
+ function u() {
15
+ return r("font-style-{alias}-family");
16
+ }
17
+ function f() {
18
+ return r("color-{alias}");
19
+ }
20
+ function r(e) {
21
+ return s(
22
+ c(l, e).reduce(
23
+ (t, o) => ({ ...t, [o]: o }),
24
+ {}
25
+ )
26
+ );
27
+ }
28
+ export {
29
+ f as createColorTokensControl,
30
+ u as createFontStyleTokensControl,
31
+ s as createLabelledOptionsControl,
32
+ r as getTokensControl
33
+ };
@@ -0,0 +1,2 @@
1
+ export declare function getTokenAliases<T extends object>(tokens: T, pattern: string): string[];
2
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/utilities/tokens.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,YAS3E"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(a,s){if(!s.includes("{alias}"))throw new Error("Provided pattern must include {alias}");const t=new RegExp(`^${s.replace("{alias}","([a-z0-9-]+)")}$`);return Object.keys(a).filter(e=>t.test(e)).map(e=>e.match(t)[1])}exports.getTokenAliases=i;
@@ -0,0 +1,9 @@
1
+ function r(t, a) {
2
+ if (!a.includes("{alias}"))
3
+ throw new Error("Provided pattern must include {alias}");
4
+ const s = new RegExp(`^${a.replace("{alias}", "([a-z0-9-]+)")}$`);
5
+ return Object.keys(t).filter((e) => s.test(e)).map((e) => e.match(s)[1]);
6
+ }
7
+ export {
8
+ r as getTokenAliases
9
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tokens.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.test.d.ts","sourceRoot":"","sources":["../../src/utilities/tokens.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type tokens from "@easypost/easy-ui-tokens/js/tokens";
2
+ export type DesignTokens = typeof tokens;
3
+ export type DesignTokenAliases = keyof DesignTokens;
4
+ export type Falsy = boolean | undefined | null | 0;
5
+ export type Namespace<Set, Needle extends string> = Set extends `${Needle}${infer _X}` ? _X : never;
6
+ export type TokenNamespace<Needle extends string> = Namespace<DesignTokenAliases, `${Needle}-`>;
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utilities/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,oCAAoC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC;AACzC,MAAM,MAAM,kBAAkB,GAAG,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC;AAGnD,MAAM,MAAM,SAAS,CACnB,GAAG,EACH,MAAM,SAAS,MAAM,IACnB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAMpD,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,MAAM,IAAI,SAAS,CAC3D,kBAAkB,EAClB,GAAG,MAAM,GAAG,CACb,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+