@stamcat/craftsman 0.0.25 → 0.0.27-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.
package/README.md CHANGED
@@ -17,7 +17,7 @@ Use this pattern in React Server Component architectures (for example Next.js Ap
17
17
 
18
18
  ```tsx
19
19
  import { ThemeProvider } from "@stamcat/craftsman/styles";
20
- import "@stamcat/craftsman/styles";
20
+ import "@stamcat/craftsman/styles/globalStyles.module.scss";
21
21
 
22
22
  const appTheme = {
23
23
  root: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamcat/craftsman",
3
- "version": "0.0.25",
3
+ "version": "0.0.27-alpha.0",
4
4
  "type": "module",
5
5
  "description": "A powerful, lightweight framework for design systems",
6
6
  "repository": {
@@ -54,6 +54,9 @@
54
54
  "types": "./src/utilities/index.d.ts",
55
55
  "default": "./Utilities.esm.js"
56
56
  },
57
+ "./styles/globalStyles.module.scss": {
58
+ "default": "./src/styles/global/globalStyles.module.scss"
59
+ },
57
60
  "./Button": {
58
61
  "types": "./src/components/Button.d.ts",
59
62
  "default": "./src/components/Button.esm.js"
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { isEmpty as e } from "../utilities/validations.esm.js";
2
3
  import { width as t } from "../styles/utilities/layout.esm.js";
3
4
  import "../../Styles.esm.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Input as e } from "./Input.esm.js";
2
3
  import { jsx as t } from "react/jsx-runtime";
3
4
  //#region src/components/Checkbox.tsx
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { isEmpty as e } from "../utilities/validations.esm.js";
2
3
  import t from "./Input.module.esm.js";
3
4
  import n from "clsx";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Button as e } from "./Button.esm.js";
2
3
  import { Input as t } from "./Input.esm.js";
3
4
  import { jsx as n } from "react/jsx-runtime";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { isEmpty as e } from "../utilities/validations.esm.js";
2
3
  import { loaders as t } from "../styles/global/components/loaders.esm.js";
3
4
  import n from "../styles/global/components/loaders.module.esm.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { isEmpty as e } from "../utilities/validations.esm.js";
2
3
  import { color as t } from "../styles/utilities/color.esm.js";
3
4
  import { Button as n } from "./Button.esm.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Input as e } from "./Input.esm.js";
2
3
  import { jsx as t } from "react/jsx-runtime";
3
4
  //#region src/components/RadioButton.tsx
@@ -2,6 +2,8 @@ import { Theme } from '../theme/types';
2
2
  type ThemeProviderProps = {
3
3
  theme?: Theme;
4
4
  children?: React.ReactNode;
5
+ precedence?: string;
6
+ href?: string;
5
7
  };
6
- export declare function ThemeProvider({ theme, children }: ThemeProviderProps): import("react").JSX.Element;
8
+ export declare function ThemeProvider({ theme, children, precedence, href, }: ThemeProviderProps): import("react").JSX.Element;
7
9
  export {};
@@ -1,8 +1,12 @@
1
1
  import { themeBuilder as e } from "../theme/theme.esm.js";
2
2
  import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
3
  //#region src/styles/components/ThemeProvider.tsx
4
- function i({ theme: i, children: a }) {
5
- return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("style", { dangerouslySetInnerHTML: { __html: e(i || {}) } }), a] });
4
+ function i({ theme: i, children: a, precedence: o = "default", href: s = "stamcat-craftsman-theme-provider" }) {
5
+ return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("style", {
6
+ precedence: o,
7
+ href: s,
8
+ dangerouslySetInnerHTML: { __html: e(i || {}) }
9
+ }), a] });
6
10
  }
7
11
  //#endregion
8
12
  export { i as ThemeProvider };
@@ -1 +1,3 @@
1
- export declare const globalStyles = "globalStyles";
1
+ import { default as styles } from './globalStyles.module.scss';
2
+ export declare const globalStyles: CSSModuleClasses;
3
+ export default styles;
@@ -1,4 +1,5 @@
1
+ import e from "./globalStyles.module.esm.js";
1
2
  //#region src/styles/global/globalStyles.ts
2
- var e = "globalStyles";
3
+ var t = e;
3
4
  //#endregion
4
- export { e as globalStyles };
5
+ export { t as globalStyles };
@@ -0,0 +1 @@
1
+ body{color:var(--text);font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;font-weight:400;line-height:1.5;font-size:var(--w-text,14px)}code{background-color:var(--gray200);color:var(--gray800);padding:calc(var(--w-gutter,16px) * .125) calc(var(--w-gutter,16px) * .25);margin:calc(var(--w-gutter,16px) * .125);font-size:var(--w-text,14px);display:inline-block}code:has(pre){padding:var(--w-gutter,16px);border-radius:calc(var(--w-gutter,16px) * .5);background-color:var(--gray800);color:var(--gray200)}code:has(pre) pre{margin:0}input[type=checkbox]{appearance:none;box-sizing:border-box;vertical-align:baseline;border:1px solid var(--blue500);background:#fff;border-radius:4px;width:16px;height:16px;margin:0;padding:0;display:inline-block;position:relative;top:.08em}input[type=checkbox]:before{content:"";background:0 0;border-radius:4px;transition:background-color .15s;position:absolute;inset:0}input[type=checkbox]:after{content:"";transform-origin:50%;border:2px solid #fff;border-width:0 2px 2px 0;width:5px;height:8px;transition:transform .15s;display:block;position:absolute;top:45%;left:50%;transform:translate(-50%,-58%)rotate(45deg)scale(0)}input[type=checkbox]:checked{border-color:var(--blue500)}input[type=checkbox]:checked:before{background-color:var(--blue500);border-radius:unset}input[type=checkbox]:checked:after{transform:translate(-50%,-58%)rotate(45deg)scale(1)}input[type=checkbox]:disabled{border-color:var(--gray500)}input[type=checkbox]:disabled:before{background-color:var(--gray200)}input[type=checkbox]:disabled:after{border-color:var(--gray200);transform:translate(-50%,-58%)rotate(45deg)scale(1)}input[type=checkbox]:checked:disabled{border-color:var(--gray400)}input[type=checkbox]:checked:disabled:before{background:var(--gray400)}input[type=checkbox]:checked:disabled:after{border-color:var(--white);transform:translate(-50%,-58%)rotate(45deg)scale(1)}input[type=radio]{--radio-btn-size:16px;appearance:none;cursor:pointer;width:var(--radio-btn-size);height:var(--radio-btn-size);border:1px solid var(--blue600);box-sizing:border-box;border-radius:50%;place-content:center;padding:0;transition:border-color .2s;display:inline-grid;position:relative}input[type=radio]:before{content:"";width:calc(var(--radio-btn-size) * .5);height:calc(var(--radio-btn-size) * .5);background-color:var(--blue600);border-radius:50%;transition:transform .2s;transform:scale(0)}input[type=radio]:checked{border-color:var(--gray500)}input[type=radio]:checked:before{transform:scale(1)}a,button.text,button[data-variant=text]{color:var(--blue500);background:0 0;border:none;padding:0}a:not(:disabled):not(.disabled):hover,button.text:not(:disabled):not(.disabled):hover,button[data-variant=text]:not(:disabled):not(.disabled):hover{color:var(--teal700);cursor:pointer;background-color:#0000;text-decoration:underline}button{--btn-pad-y:calc(var(--w-gutter,16px) * .5);--btn-pad-x:calc(var(--w-gutter,16px) * .75);--btn-border-radius:calc(var(--w-gutter,16px) * .75);color:var(--blue600);cursor:pointer;padding:var(--btn-pad-y) var(--btn-pad-x);border-radius:var(--btn-border-radius);border:none;border:1px solid var(--blue500);background-color:var(--white);flex-flow:wrap;align-items:center;font-weight:500;transition:all .125s;display:inline-flex}button:not(:disabled):not(.disabled):hover{background-color:var(--teal200)}button:disabled,button.disabled{cursor:not-allowed;border-color:var(--gray200);color:var(--gray400)}button:disabled.primary,button:disabled[data-variant=primary],button.disabled.primary,button.disabled[data-variant=primary]{border-color:var(--gray200);background-color:var(--gray400);color:var(--gray200)}button.primary,button[data-variant=primary]{color:var(--white);background-color:var(--blue500)}button.primary:not(:disabled):not(.disabled):hover,button[data-variant=primary]:not(:disabled):not(.disabled):hover{background-color:var(--blue700)}input:focus{box-shadow:none;outline:0}input{color:var(--text);border:1px solid var(--gray400);padding:calc(var(--w-gutter,16px) * .5);background-color:var(--white);border-radius:3px}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield}input:disabled,input.disabled{border-color:var(--gray200);background-color:var(--gray100)}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:#ddd}::-webkit-scrollbar-thumb{background:#000;border-radius:6px}::-webkit-scrollbar-thumb:hover{background:#555}body,ul{margin:0;padding:0}body{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;background-color:#fff}fieldset{border:0;padding:0}h1{font-size:calc(var(--w-text,14px) * 3.125);line-height:1.2}h2{font-size:calc(var(--w-text,14px) * 2.625);font-weight:625;line-height:1.1}h3{font-size:calc(var(--w-text,14px) * 1.625);line-height:1.1}h4{font-size:calc(var(--w-text,14px) * 1.25);margin:calc(var(--w-gutter,16px) * .5) 0;line-height:1.1}h5{font-size:var(--w-text,14px);line-height:1.2}h6{font-size:calc(var(--w-text,14px) * .875);font-weight:600;line-height:1.2}p{font-style:normal;font-size:var(--w-text,14px);margin:0;line-height:1.5}@media (width<=660px){h4{font-size:var(--w-text,14px)}p{font-size:calc(var(--w-text,14px) * .875)}}
@@ -0,0 +1,4 @@
1
+ import './globalStyles.module.css';//#region src/styles/global/globalStyles.module.scss
2
+ var e = {};
3
+ //#endregion
4
+ export { e as default };
@@ -3,5 +3,5 @@ export * from './utilities/constants';
3
3
  export * from './utilities/layout';
4
4
  export * from './utilities/types';
5
5
  export * from './theme/theme';
6
- export * from './global/globalStyles';
6
+ export { globalStyles } from './global/globalStyles';
7
7
  export { ThemeProvider } from './components/ThemeProvider';