@stamcat/craftsman 0.0.23-alpha.14 → 0.0.23-alpha.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamcat/craftsman",
3
- "version": "0.0.23-alpha.14",
3
+ "version": "0.0.23-alpha.17",
4
4
  "type": "module",
5
5
  "description": "A powerful, lightweight framework for design systems",
6
6
  "repository": {
@@ -1,27 +1,30 @@
1
1
  import { isEmpty as e } from "../utilities/validations.esm.js";
2
- import { css as t, useTheme as n } from "@emotion/react";
2
+ import { ThemeContext as t, css as n } from "@emotion/react";
3
3
  import r from "@emotion/styled";
4
4
  import { Fragment as i, jsx as a } from "react/jsx-runtime";
5
5
  //#region src/components/Button.tsx
6
6
  var o = r.button`
7
7
  ${(e) => e.styles}
8
- ${((e) => e.size && t`
8
+ ${((e) => e.size && n`
9
9
  border-radius: calc(var(--btn-border-radius) * ${e.size});
10
10
  padding: calc(var(--btn-pad-y) * ${e.size}) calc(var(--btn-pad-x) * ${e.size});
11
11
  font-size: max(10px, calc(var(--w-text) * ${e.size}));
12
12
  `)}
13
- `, s = (t) => {
14
- let { type: r = "button", variant: s = "default", className: c, size: l, ...u } = t, d = typeof l == "number" ? Math.min(10, Math.max(.1, l)) : void 0, f = n(), p = typeof f?.components?.button == "string" ? f.components.button : void 0, m = [
15
- s === "default" ? void 0 : s,
16
- p,
17
- c
18
- ].filter(Boolean).join(" ") || void 0;
19
- return e(t.children) ? /* @__PURE__ */ a(i, {}) : /* @__PURE__ */ a(o, {
20
- type: r,
21
- size: d,
22
- className: m,
23
- ...u
24
- });
13
+ `, s = (n) => {
14
+ let { type: r = "button", variant: s = "default", className: c, size: l, ...u } = n, d = typeof l == "number" ? Math.min(10, Math.max(.1, l)) : void 0;
15
+ return e(n.children) ? /* @__PURE__ */ a(i, {}) : /* @__PURE__ */ a(t.Consumer, { children: (e) => {
16
+ let t = e, n = typeof t?.components?.button == "string" ? t.components.button : void 0, i = [
17
+ s === "default" ? void 0 : s,
18
+ n,
19
+ c
20
+ ].filter(Boolean).join(" ") || void 0;
21
+ return /* @__PURE__ */ a(o, {
22
+ type: r,
23
+ size: d,
24
+ className: i,
25
+ ...u
26
+ });
27
+ } });
25
28
  };
26
29
  //#endregion
27
30
  export { s as Button };