@stamcat/craftsman 0.0.23-alpha.24 → 0.0.23-alpha.26

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 (35) hide show
  1. package/Styles.esm.js +7 -7
  2. package/package.json +1 -1
  3. package/src/components/Button.esm.js +12 -10
  4. package/src/components/Input.d.ts +11 -1
  5. package/src/components/Input.esm.js +134 -3
  6. package/src/components/Modal.esm.js +60 -58
  7. package/src/styles/components/ClientProvider.d.ts +0 -2
  8. package/src/styles/components/ClientProvider.esm.js +9 -10
  9. package/src/styles/components/NextJSProvider.d.ts +1 -3
  10. package/src/styles/components/NextJSProvider.esm.js +19 -21
  11. package/src/styles/global/components/button.d.ts +1 -0
  12. package/src/styles/global/components/button.esm.js +35 -29
  13. package/src/styles/global/components/code.esm.js +14 -11
  14. package/src/styles/global/components/input.d.ts +1 -0
  15. package/src/styles/global/components/input.esm.js +32 -0
  16. package/src/styles/global/components/loaders.d.ts +1 -3
  17. package/src/styles/global/components/loaders.esm.js +1 -11
  18. package/src/styles/global/components/loaders.module.css +1 -1
  19. package/src/styles/global/components/loaders.module.esm.js +13 -17
  20. package/src/styles/global/components/loaders.module.scss +73 -67
  21. package/src/styles/global/components/typography.esm.js +31 -27
  22. package/src/styles/global/globalStyles.esm.js +13 -6
  23. package/src/styles/global/variables.esm.js +8 -3
  24. package/src/styles/index.d.ts +0 -1
  25. package/src/styles/theme/components.esm.js +5 -5
  26. package/src/styles/utilities/color.d.ts +170 -1
  27. package/src/styles/utilities/color.esm.js +4 -8
  28. package/src/styles/utilities/constants.d.ts +168 -73
  29. package/src/styles/utilities/constants.esm.js +174 -70
  30. package/src/styles/utilities/layout.d.ts +5 -2
  31. package/src/styles/utilities/layout.esm.js +19 -24
  32. package/src/styles/utilities/types.d.ts +48 -14
  33. package/src/styles/utilities/types.esm.js +25 -0
  34. package/src/styles/utilities/config.d.ts +0 -7
  35. package/src/styles/utilities/config.esm.js +0 -41
package/Styles.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { defaultColors as e, defaultWidths as t } from "./src/styles/utilities/constants.esm.js";
2
- import { getCraftsmanConfig as n, resetCraftsmanConfig as r, setCraftsmanConfig as i } from "./src/styles/utilities/config.esm.js";
3
- import { breakpoint as a, media as o, width as s, widths as c } from "./src/styles/utilities/layout.esm.js";
4
- import { color as l, colors as u, hexToRgba as d } from "./src/styles/utilities/color.esm.js";
5
- import { CraftsmanThemeProvider as f, themeBuilder as p } from "./src/styles/theme/theme.esm.js";
6
- import { globalStyles as m } from "./src/styles/global/globalStyles.esm.js";
7
- import { ClientProvider as h } from "./src/styles/components/ClientProvider.esm.js";
8
- export { h as ClientProvider, f as CraftsmanThemeProvider, a as breakpoint, l as color, u as colors, e as defaultColors, t as defaultWidths, n as getCraftsmanConfig, m as globalStyles, d as hexToRgba, o as media, r as resetCraftsmanConfig, i as setCraftsmanConfig, p as themeBuilder, s as width, c as widths };
2
+ import { color as n, colors as r, hexToRgba as i } from "./src/styles/utilities/color.esm.js";
3
+ import { BaseWidthSchema as a, BreakpointSchema as o, LayoutWidthsSchema as s, MaxScreenWidthSchema as c, ScreenWidthSchema as l, zTextInputExclusions as u } from "./src/styles/utilities/types.esm.js";
4
+ import { breakpoint as d, media as f, width as p, widths as m } from "./src/styles/utilities/layout.esm.js";
5
+ import { CraftsmanThemeProvider as h, themeBuilder as g } from "./src/styles/theme/theme.esm.js";
6
+ import { globalStyles as _ } from "./src/styles/global/globalStyles.esm.js";
7
+ import { ClientProvider as v } from "./src/styles/components/ClientProvider.esm.js";
8
+ export { a as BaseWidthSchema, o as BreakpointSchema, v as ClientProvider, h as CraftsmanThemeProvider, s as LayoutWidthsSchema, c as MaxScreenWidthSchema, l as ScreenWidthSchema, d as breakpoint, n as color, r as colors, e as defaultColors, t as defaultWidths, _ as globalStyles, i as hexToRgba, f as media, g as themeBuilder, p as width, m as widths, u as zTextInputExclusions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamcat/craftsman",
3
- "version": "0.0.23-alpha.24",
3
+ "version": "0.0.23-alpha.26",
4
4
  "type": "module",
5
5
  "description": "A powerful, lightweight framework for design systems",
6
6
  "repository": {
@@ -1,18 +1,20 @@
1
1
  import { isEmpty as e } from "../utilities/validations.esm.js";
2
- import { css as t } from "@emotion/react";
3
- import n from "@emotion/styled";
4
- import { Fragment as r, jsx as i } from "react/jsx-runtime";
2
+ import { width as t } from "../styles/utilities/layout.esm.js";
3
+ import "../../Styles.esm.js";
4
+ import { css as n } from "@emotion/react";
5
+ import r from "@emotion/styled";
6
+ import { Fragment as i, jsx as a } from "react/jsx-runtime";
5
7
  //#region src/components/Button.tsx
6
- var a = n.button`
8
+ var o = r.button`
7
9
  ${(e) => e.styles}
8
- ${((e) => e.size && t`
10
+ ${((e) => e.size && n`
9
11
  border-radius: calc(var(--btn-border-radius) * ${e.size});
10
12
  padding: calc(var(--btn-pad-y) * ${e.size}) calc(var(--btn-pad-x) * ${e.size});
11
- font-size: max(10px, calc(var(--w-text) * ${e.size}));
13
+ font-size: max(10px, calc(${t("text")} * ${e.size}));
12
14
  `)}
13
- `, o = (t) => {
14
- let { type: n = "button", variant: o = "default", className: s, size: c, ...l } = t, u = typeof c == "number" ? Math.min(10, Math.max(.1, c)) : void 0, d = [o === "default" ? void 0 : o, s].filter(Boolean).join(" ") || void 0;
15
- return e(t.children) ? /* @__PURE__ */ i(r, {}) : /* @__PURE__ */ i(a, {
15
+ `, s = (t) => {
16
+ let { type: n = "button", variant: r = "default", className: s, size: c, ...l } = t, u = typeof c == "number" ? Math.min(10, Math.max(.1, c)) : void 0, d = [r === "default" ? void 0 : r, s].filter(Boolean).join(" ") || void 0;
17
+ return e(t.children) ? /* @__PURE__ */ a(i, {}) : /* @__PURE__ */ a(o, {
16
18
  type: n,
17
19
  size: u,
18
20
  className: d,
@@ -20,4 +22,4 @@ var a = n.button`
20
22
  });
21
23
  };
22
24
  //#endregion
23
- export { o as Button };
25
+ export { s as Button };
@@ -1,2 +1,12 @@
1
- export type InputProps = React.ComponentProps<"input">;
1
+ import { SerializedStyles } from '@emotion/react';
2
+ import { TextInputExclusions } from '../styles';
3
+ export type LabelPosition = "top" | "left" | "bottom" | "right" | "inside" | "hidden";
4
+ export type InputProps = React.ComponentProps<"input"> & {
5
+ label?: string | React.ReactNode;
6
+ labelPosition?: LabelPosition;
7
+ error?: string | boolean | React.ReactNode;
8
+ required?: boolean;
9
+ styles?: SerializedStyles;
10
+ type?: Exclude<React.HTMLInputTypeAttribute, TextInputExclusions>;
11
+ };
2
12
  export declare const Input: React.FC<InputProps>;
@@ -1,5 +1,136 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { isEmpty as e } from "../utilities/validations.esm.js";
2
+ import { color as t } from "../styles/utilities/color.esm.js";
3
+ import { width as n } from "../styles/utilities/layout.esm.js";
4
+ import "../../Styles.esm.js";
5
+ import { css as r } from "@emotion/react";
6
+ import i from "@emotion/styled";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
8
  //#region src/components/Input.tsx
3
- var t = (t) => /* @__PURE__ */ e("input", { ...t });
9
+ var s = r`
10
+ .input-label {
11
+ top: -0.5rem;
12
+ left: ${n("gutter", .25)};
13
+ font-size: ${n("text", .75)};
14
+ }
15
+ `, c = (e) => r`
16
+ --react-international-phone-height: 50px;
17
+ --react-international-phone-border-radius: 8px;
18
+ --react-international-phone-border-color: #c0c0c0ff;
19
+ position: relative;
20
+
21
+ .input-label {
22
+ position: absolute;
23
+ background-color: white;
24
+ z-index: 1;
25
+ width: fit-content;
26
+ padding: 0 5px;
27
+ top: ${n("gutter", .25)};
28
+ left: ${n("gutter", .25)};
29
+ pointer-events: none;
30
+ transition: top 150ms ease, left 150ms ease, font-size 150ms ease, color 150ms ease;
31
+ }
32
+
33
+ > label > input,
34
+ > input {
35
+ transition: border-color 200ms ease;
36
+ }
37
+ &:focus-within {
38
+ ${s}
39
+ .input-label {
40
+ color: ${t("blue500")};
41
+ }
42
+ input {
43
+ border-color: ${t("blue500")};
44
+ }
45
+ }
46
+
47
+ &:has(input:not(:placeholder-shown)) {
48
+ ${s}
49
+ }
50
+
51
+ &:has(input:-webkit-autofill) {
52
+ ${s}
53
+ }
54
+
55
+ ${e ? s : ""}
56
+ input[type="tel"] {
57
+ width: 100%;
58
+ }
59
+
60
+ input::placeholder {
61
+ opacity: 0;
62
+ transition: opacity 200ms ease;
63
+ }
64
+
65
+ &:focus-within input::placeholder {
66
+ opacity: 1;
67
+ }
68
+ `, l = i.div`
69
+ label {
70
+ .input-label {
71
+ margin-bottom: ${n("gutter", .25)};
72
+ ${(e) => e.required && r`
73
+ ::after {
74
+ content: "*";
75
+ color: ${t("red700")};
76
+ }
77
+ `}
78
+
79
+ }
80
+ }
81
+ &.left label {
82
+ .input-label {
83
+ width: fit-content;
84
+ margin-right: ${n("gutter", .75)};
85
+ }
86
+ display: inline-flex;
87
+ align-items: center;
88
+ }
89
+ &.bottom label {
90
+ display: inline-flex;
91
+ flex-direction: column-reverse;
92
+ align-items: flex-start;
93
+ .input-label {
94
+ display: block;
95
+ margin-bottom: 0;
96
+ margin-top: ${n("gutter", .25)};
97
+ }
98
+ }
99
+ &.right label {
100
+ display: inline-flex;
101
+ flex-direction: row-reverse;
102
+ align-items: center;
103
+ .input-label {
104
+ display: block;
105
+ margin-left: ${n("gutter", .75)};
106
+ }
107
+ }
108
+ &.inside {
109
+ ${(e) => c(e.hasInput)}
110
+ }
111
+ ${(e) => e.styles}
112
+ `, u = i.div`
113
+ margin-top: ${n("gutter", .25)};
114
+ font-size: ${n("text", .75)};
115
+ color: ${t("red700")};
116
+ `, d = ({ label: t, id: n, labelPosition: r = "top", required: i = !1, error: s, styles: c, ...d }) => {
117
+ let f = n || crypto.randomUUID(), p = !e(d.value) || !e(d.defaultValue), m = !e(s);
118
+ return /* @__PURE__ */ o(l, {
119
+ className: r,
120
+ required: i,
121
+ hasInput: p,
122
+ styles: c,
123
+ children: [e(t) ? /* @__PURE__ */ a("input", {
124
+ id: f,
125
+ ...d
126
+ }) : /* @__PURE__ */ o("label", { children: [r !== "hidden" && /* @__PURE__ */ a("div", {
127
+ className: "input-label",
128
+ children: t
129
+ }), /* @__PURE__ */ a("input", {
130
+ id: f,
131
+ ...d
132
+ })] }), m && /* @__PURE__ */ a(u, { children: s })]
133
+ });
134
+ };
4
135
  //#endregion
5
- export { t as Input };
136
+ export { d as Input };
@@ -1,41 +1,41 @@
1
- import { Button as e } from "./Button.esm.js";
2
- import { breakpoint as t } from "../styles/utilities/layout.esm.js";
3
- import { color as n } from "../styles/utilities/color.esm.js";
4
- import { css as r, keyframes as i } from "@emotion/react";
5
- import a from "@emotion/styled";
6
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import l from "react";
8
- import { LuX as u } from "react-icons/lu";
1
+ import { color as e } from "../styles/utilities/color.esm.js";
2
+ import { breakpoint as t, width as n } from "../styles/utilities/layout.esm.js";
3
+ import { Button as r } from "./Button.esm.js";
4
+ import { css as i, keyframes as a } from "@emotion/react";
5
+ import o from "@emotion/styled";
6
+ import s from "react";
7
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { LuX as d } from "react-icons/lu";
9
9
  //#region src/components/Modal.tsx
10
- var d = i`
10
+ var f = a`
11
11
  from {
12
12
  opacity: 0;
13
13
  }
14
14
  to {
15
15
  opacity: 1;
16
16
  }
17
- `, f = i`
17
+ `, p = a`
18
18
  from {
19
19
  opacity: 1;
20
20
  }
21
21
  to {
22
22
  opacity: 0;
23
23
  }
24
- `, p = i`
24
+ `, m = a`
25
25
  from {
26
26
  transform: translateY(100%);
27
27
  }
28
28
  to {
29
29
  transform: translateY(0);
30
30
  }
31
- `, m = i`
31
+ `, h = a`
32
32
  from {
33
33
  transform: translateY(0);
34
34
  }
35
35
  to {
36
36
  transform: translateY(100%);
37
37
  }
38
- `, h = a.div`
38
+ `, g = o.div`
39
39
  position: fixed;
40
40
  width: 100%;
41
41
  height: 100%;
@@ -48,9 +48,9 @@ var d = i`
48
48
  justify-content: center;
49
49
  align-items: center;
50
50
  ${(e) => e.styles}
51
- `, g = a.div`
51
+ `, _ = o.div`
52
52
  background-color: rgba(0, 0, 0, 0.5);
53
- animation: ${(e) => e.isClosing ? f : d} 0.3s ease-in-out;
53
+ animation: ${(e) => e.isClosing ? p : f} 0.3s ease-in-out;
54
54
  animation-fill-mode: forwards;
55
55
  position: fixed;
56
56
  width: 100%;
@@ -60,60 +60,63 @@ var d = i`
60
60
  right: 0;
61
61
  bottom: 0;
62
62
  z-index: 1001;
63
- `, _ = r`
63
+ `, v = i`
64
64
  width: 100%;
65
65
  height: 100%;
66
- `, v = r`
67
- width: calc(var(--w-column) * 4);
68
- `, y = r`
69
- width: calc(var(--w-column) * 4);
70
- ${t("tablet", r`
71
- width: calc(var(--w-column) * 6);
66
+ `, y = i`
67
+ width: ${n("column", 4)};
68
+ `, b = i`
69
+ width: ${n("column", 4)};
70
+ ${t("tablet", i`
71
+ width: ${n("column", 6)};
72
72
  `)}
73
- ${t("desktop", r`
74
- width: calc(var(--w-column) * 8);
73
+ ${t("desktop", i`
74
+ width: ${n("column", 8)};
75
75
  `)}
76
- `, b = r`
76
+ `, x = i`
77
77
  position: fixed;
78
78
  top: 0;
79
79
  right: 0;
80
80
  height: 100%;
81
- ${t("mobileOnly", _)}
82
- ${t("tablet", v)}
83
- `, x = r`
84
- border-radius: 8px;
85
- ${t("mobileOnly", _)}
81
+ ${t("mobileOnly", v)}
86
82
  ${t("tablet", y)}
87
- `, S = a.div`
88
- padding: calc(var(--w-gutter));
83
+ `, S = i`
84
+ border-radius: 8px;
85
+ ${t("mobileOnly", v)}
86
+ ${t("tablet", b)}
87
+ `, C = o.div`
88
+ padding: ${n("gutter")};
89
89
  z-index: 1002;
90
- background-color: var(--white);
90
+ background-color: ${e("white")};
91
91
  max-height: 80vh;
92
92
  overflow-y: auto;
93
93
  -webkit-overflow-scrolling: touch;
94
94
  touch-action: pan-y;
95
- animation: ${(e) => e.isClosing ? m : p} 0.3s ease-in-out;
95
+ animation: ${(e) => e.isClosing ? h : m} 0.3s ease-in-out;
96
96
  animation-fill-mode: forwards;
97
- ${(e) => e.type === "panel" && b}
98
- ${(e) => e.type === "dialog" && x}
97
+ ${(e) => e.type === "panel" && x}
98
+ ${(e) => e.type === "dialog" && S}
99
99
  header {
100
100
  display: inline-flex;
101
101
  width: 100%;
102
102
  justify-content: space-between;
103
- margin-bottom: calc(var(--w-gutter) * 0.5);
103
+ margin-bottom: ${n("gutter", .5)};
104
104
  }
105
- `, C = r`
105
+ `, w = i`
106
106
  text-decoration: none;
107
- height: 36px;
108
- width: 36px;
107
+ height: 30px;
108
+ width: 30px;
109
109
  border-radius: 50%;
110
- `, w = a.footer`
111
- margin-top: calc(var(--w-gutter) * 2);
112
- background-color:var(--white);
110
+ padding: 0;
111
+ display: inline-flex;
112
+ justify-content: center;
113
+ `, T = o.footer`
114
+ margin-top: ${n("gutter", 2)};
115
+ background-color: ${e("white")};
113
116
  height: fit-content;
114
117
  display: flex;
115
- gap: var(--w-gutter);
116
- `, T = class extends l.PureComponent {
118
+ gap: ${n("gutter")};
119
+ `, E = class extends s.PureComponent {
117
120
  state = { isClosing: !1 };
118
121
  onDismiss = () => {
119
122
  this.props.onDismiss && (this.setState({ isClosing: !0 }), setTimeout(() => {
@@ -124,31 +127,30 @@ var d = i`
124
127
  (this.props.backgroundDismiss || !0) === !0 && this.onDismiss();
125
128
  };
126
129
  render() {
127
- return this.props.visible ? /* @__PURE__ */ c(h, {
130
+ return this.props.visible ? /* @__PURE__ */ u(g, {
128
131
  styles: this.props.styles,
129
- children: [/* @__PURE__ */ c(S, {
132
+ children: [/* @__PURE__ */ u(C, {
130
133
  type: this.props.type || "dialog",
131
134
  isClosing: this.state.isClosing,
132
135
  children: [
133
- /* @__PURE__ */ c("header", { children: [this.props.header && /* @__PURE__ */ s(o, { children: this.props.header }), !this.props.hideDismissIcon && /* @__PURE__ */ s(e, {
136
+ /* @__PURE__ */ u("header", { children: [this.props.header && /* @__PURE__ */ l(c, { children: this.props.header }), !this.props.hideDismissIcon && /* @__PURE__ */ l(r, {
134
137
  variant: "primary",
135
- styles: C,
138
+ styles: w,
136
139
  onClick: this.onDismiss,
137
- children: /* @__PURE__ */ s(u, {
138
- fill: n("white"),
139
- viewBox: "6 8 14 14",
140
- size: 24
140
+ children: /* @__PURE__ */ l(d, {
141
+ fill: e("white"),
142
+ size: 18
141
143
  })
142
144
  })] }),
143
- /* @__PURE__ */ s("section", { children: this.props.children }),
144
- this.props.footer && /* @__PURE__ */ s(w, { children: this.props.footer })
145
+ /* @__PURE__ */ l("section", { children: this.props.children }),
146
+ this.props.footer && /* @__PURE__ */ l(T, { children: this.props.footer })
145
147
  ]
146
- }), /* @__PURE__ */ s(g, {
148
+ }), /* @__PURE__ */ l(_, {
147
149
  isClosing: this.state.isClosing,
148
150
  onClick: this.onClickBackground
149
151
  })]
150
- }) : /* @__PURE__ */ s(o, {});
152
+ }) : /* @__PURE__ */ l(c, {});
151
153
  }
152
154
  };
153
155
  //#endregion
154
- export { T as Modal };
156
+ export { E as Modal };
@@ -1,7 +1,5 @@
1
- import { CraftsmanStyleConfig } from '../utilities/types';
2
1
  import { Theme } from '../theme/types';
3
2
  type ClientProviderProps = {
4
- config?: CraftsmanStyleConfig;
5
3
  theme?: Theme;
6
4
  children?: React.ReactNode;
7
5
  };
@@ -1,14 +1,13 @@
1
- import { setCraftsmanConfig as e } from "../utilities/config.esm.js";
2
- import { CraftsmanThemeProvider as t, themeBuilder as n } from "../theme/theme.esm.js";
3
- import { globalStyles as r } from "../global/globalStyles.esm.js";
4
- import { Global as i } from "@emotion/react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
1
+ import { CraftsmanThemeProvider as e, themeBuilder as t } from "../theme/theme.esm.js";
2
+ import { globalStyles as n } from "../global/globalStyles.esm.js";
3
+ import { Global as r } from "@emotion/react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
5
  //#region src/styles/components/ClientProvider.tsx
7
- function s(s) {
8
- return s.config && e(s.config), /* @__PURE__ */ o(t, {
9
- theme: s.theme || {},
10
- children: [/* @__PURE__ */ a(i, { styles: (e) => [r, n(e)] }), s.children]
6
+ function o(o) {
7
+ return /* @__PURE__ */ a(e, {
8
+ theme: o.theme || {},
9
+ children: [/* @__PURE__ */ i(r, { styles: (e) => [n, t(e)] }), o.children]
11
10
  });
12
11
  }
13
12
  //#endregion
14
- export { s as ClientProvider };
13
+ export { o as ClientProvider };
@@ -1,10 +1,8 @@
1
- import { CraftsmanStyleConfig } from '../utilities/types';
2
1
  import { Theme } from '../theme/types';
3
2
  type StyleProviderProps = {
4
3
  key?: string;
5
4
  children?: React.ReactNode;
6
- config?: CraftsmanStyleConfig;
7
5
  theme?: Theme;
8
6
  };
9
- export declare function NextJSProvider({ children, key, config, theme }: StyleProviderProps): import("react").JSX.Element;
7
+ export declare function NextJSProvider({ children, key, theme }: StyleProviderProps): import("react").JSX.Element;
10
8
  export {};
@@ -1,17 +1,15 @@
1
1
  "use client";
2
- import { setCraftsmanConfig as e } from "../utilities/config.esm.js";
3
- import { CraftsmanThemeProvider as t, themeBuilder as n } from "../theme/theme.esm.js";
4
- import { globalStyles as r } from "../global/globalStyles.esm.js";
5
- import { CacheProvider as i, Global as a } from "@emotion/react";
2
+ import { CraftsmanThemeProvider as e, themeBuilder as t } from "../theme/theme.esm.js";
3
+ import { globalStyles as n } from "../global/globalStyles.esm.js";
4
+ import { CacheProvider as r, Global as i } from "@emotion/react";
5
+ import { useState as a } from "react";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { useState as c } from "react";
8
- import l from "@emotion/cache";
9
- import { useServerInsertedHTML as u } from "next/navigation";
7
+ import c from "@emotion/cache";
8
+ import { useServerInsertedHTML as l } from "next/navigation";
10
9
  //#region src/styles/components/NextJSProvider.tsx
11
- function d({ children: d, key: f = "app", config: p, theme: m }) {
12
- p && e(p);
13
- let [{ cache: h, flush: g }] = c(() => {
14
- let e = l({ key: f });
10
+ function u({ children: u, key: d = "app", theme: f }) {
11
+ let [{ cache: p, flush: m }] = a(() => {
12
+ let e = c({ key: d });
15
13
  e.compat = !0;
16
14
  let t = e.insert, n = [];
17
15
  return e.insert = (...r) => {
@@ -25,22 +23,22 @@ function d({ children: d, key: f = "app", config: p, theme: m }) {
25
23
  }
26
24
  };
27
25
  });
28
- return u(() => {
29
- let e = g();
26
+ return l(() => {
27
+ let e = m();
30
28
  if (e.length === 0) return null;
31
29
  let t = "";
32
- for (let n of e) t += h.inserted[n];
30
+ for (let n of e) t += p.inserted[n];
33
31
  return /* @__PURE__ */ o("style", {
34
- "data-emotion": `${h.key} ${e.join(" ")}`,
32
+ "data-emotion": `${p.key} ${e.join(" ")}`,
35
33
  dangerouslySetInnerHTML: { __html: t }
36
34
  });
37
- }), /* @__PURE__ */ o(i, {
38
- value: h,
39
- children: /* @__PURE__ */ s(t, {
40
- theme: m || {},
41
- children: [/* @__PURE__ */ o(a, { styles: (e) => [r, n(e)] }), d]
35
+ }), /* @__PURE__ */ o(r, {
36
+ value: p,
37
+ children: /* @__PURE__ */ s(e, {
38
+ theme: f || {},
39
+ children: [/* @__PURE__ */ o(i, { styles: (e) => [n, t(e)] }), u]
42
40
  })
43
41
  });
44
42
  }
45
43
  //#endregion
46
- export { d as NextJSProvider };
44
+ export { u as NextJSProvider };
@@ -5,4 +5,5 @@ export declare const ButtonType: z.ZodEnum<{
5
5
  default: "default";
6
6
  }>;
7
7
  export type ButtonType = z.infer<typeof ButtonType>;
8
+ export declare const textLinkStyles: import('@emotion/utils').SerializedStyles;
8
9
  export declare const button: import('@emotion/utils').SerializedStyles;
@@ -1,16 +1,29 @@
1
- import { typography as e } from "./typography.esm.js";
2
- import { css as t } from "@emotion/react";
3
- import n from "zod";
4
- n.enum([
1
+ import { color as e } from "../../utilities/color.esm.js";
2
+ import { width as t } from "../../utilities/layout.esm.js";
3
+ import { typography as n } from "./typography.esm.js";
4
+ import { css as r } from "@emotion/react";
5
+ import i from "zod";
6
+ i.enum([
5
7
  "primary",
6
8
  "default",
7
9
  "text"
8
10
  ]);
9
- var r = t`
10
- --btn-pad-y: calc(var(--w-gutter) * 0.5);
11
- --btn-pad-x: calc(var(--w-gutter) * 0.75);
12
- --btn-border-radius: calc(var(--w-gutter) * 0.75);
13
- ${e.body}
11
+ var a = r`
12
+ padding: 0;
13
+ border: none;
14
+ background: none;
15
+ color: ${e("blue500")};
16
+ &:not(:disabled):not(.disabled):hover {
17
+ color: ${e("teal700")};
18
+ background-color: transparent;
19
+ text-decoration: underline;
20
+ cursor: pointer;
21
+ }
22
+ `, o = r`
23
+ --btn-pad-y: ${t("gutter", .5)};
24
+ --btn-pad-x: ${t("gutter", .75)};
25
+ --btn-border-radius: ${t("gutter", .75)};
26
+ ${n.body}
14
27
  border: none;
15
28
  cursor: pointer;
16
29
  display: inline-flex;
@@ -20,39 +33,32 @@ var r = t`
20
33
  transition: 0.125s;
21
34
  padding: var(--btn-pad-y) var(--btn-pad-x);
22
35
  border-radius: var(--btn-border-radius);
23
- border: 1px solid var(--blue600);
24
- background-color: var(--white);
36
+ border: 1px solid ${e("blue500")};
37
+ background-color: ${e("white")};
25
38
  &:not(:disabled):not(.disabled):hover {
26
- background-color: var(--blue200);
39
+ background-color: ${e("teal200")};
27
40
  }
28
41
  &.text {
29
- padding: 0;
30
- border: none;
31
- background: none;
32
- &:not(:disabled):not(.disabled):hover {
33
- color: var(--blue800);
34
- background-color: transparent;
35
- text-decoration: underline;
36
- }
42
+ ${a}
37
43
  }
38
44
  &:disabled,
39
45
  &.disabled {
40
46
  cursor: not-allowed;
41
- border-color: var(--grey200);
42
- color: var(--grey400);
47
+ border-color: ${e("gray200")};
48
+ color: ${e("gray400")};
43
49
  &.primary {
44
- border-color: var(--grey200);
45
- background-color: var(--grey400);
46
- color: var(--grey200);
50
+ border-color: ${e("gray200")};
51
+ background-color: ${e("gray400")};
52
+ color: ${e("gray200")};
47
53
  }
48
54
  }
49
55
  &.primary {
50
- color: var(--white);
51
- background-color: var(--blue500);
56
+ color: ${e("white")};
57
+ background-color: ${e("blue500")};
52
58
  &:not(:disabled):not(.disabled):hover {
53
- background-color: var(--blue700);
59
+ background-color: ${e("blue700")};
54
60
  }
55
61
  }
56
62
  `;
57
63
  //#endregion
58
- export { r as button };
64
+ export { o as button, a as textLinkStyles };