@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.
- package/Styles.esm.js +7 -7
- package/package.json +1 -1
- package/src/components/Button.esm.js +12 -10
- package/src/components/Input.d.ts +11 -1
- package/src/components/Input.esm.js +134 -3
- package/src/components/Modal.esm.js +60 -58
- package/src/styles/components/ClientProvider.d.ts +0 -2
- package/src/styles/components/ClientProvider.esm.js +9 -10
- package/src/styles/components/NextJSProvider.d.ts +1 -3
- package/src/styles/components/NextJSProvider.esm.js +19 -21
- package/src/styles/global/components/button.d.ts +1 -0
- package/src/styles/global/components/button.esm.js +35 -29
- package/src/styles/global/components/code.esm.js +14 -11
- package/src/styles/global/components/input.d.ts +1 -0
- package/src/styles/global/components/input.esm.js +32 -0
- package/src/styles/global/components/loaders.d.ts +1 -3
- package/src/styles/global/components/loaders.esm.js +1 -11
- package/src/styles/global/components/loaders.module.css +1 -1
- package/src/styles/global/components/loaders.module.esm.js +13 -17
- package/src/styles/global/components/loaders.module.scss +73 -67
- package/src/styles/global/components/typography.esm.js +31 -27
- package/src/styles/global/globalStyles.esm.js +13 -6
- package/src/styles/global/variables.esm.js +8 -3
- package/src/styles/index.d.ts +0 -1
- package/src/styles/theme/components.esm.js +5 -5
- package/src/styles/utilities/color.d.ts +170 -1
- package/src/styles/utilities/color.esm.js +4 -8
- package/src/styles/utilities/constants.d.ts +168 -73
- package/src/styles/utilities/constants.esm.js +174 -70
- package/src/styles/utilities/layout.d.ts +5 -2
- package/src/styles/utilities/layout.esm.js +19 -24
- package/src/styles/utilities/types.d.ts +48 -14
- package/src/styles/utilities/types.esm.js +25 -0
- package/src/styles/utilities/config.d.ts +0 -7
- package/src/styles/utilities/config.esm.js +0 -41
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CSSObject, SerializedStyles } from '@emotion/react';
|
|
2
|
-
import { Breakpoint, LayoutWidthsType
|
|
3
|
-
export declare const widths:
|
|
2
|
+
import { Breakpoint, LayoutWidthsType } from './types';
|
|
3
|
+
export declare const widths: Record<LayoutWidthsType, string>;
|
|
4
4
|
export declare const media: {
|
|
5
5
|
readonly mobile: string;
|
|
6
|
+
readonly mobileMax: string;
|
|
6
7
|
readonly tablet: string;
|
|
8
|
+
readonly tabletMax: string;
|
|
7
9
|
readonly desktop: string;
|
|
10
|
+
readonly desktopMax: string;
|
|
8
11
|
readonly extDesktop: string;
|
|
9
12
|
readonly mobileOnly: string;
|
|
10
13
|
readonly tabletOnly: string;
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { defaultWidths as e } from "./constants.esm.js";
|
|
2
|
+
import { LayoutWidthsSchema as t } from "./types.esm.js";
|
|
3
|
+
import { css as n } from "@emotion/react";
|
|
3
4
|
//#region src/styles/utilities/layout.ts
|
|
4
|
-
var
|
|
5
|
-
"text",
|
|
6
|
-
"column",
|
|
7
|
-
"gutter",
|
|
8
|
-
"extDesktop",
|
|
9
|
-
"extNav",
|
|
10
|
-
"desktop",
|
|
11
|
-
"tablet",
|
|
12
|
-
"extMobile",
|
|
13
|
-
"mobileMax",
|
|
14
|
-
"tabletMax",
|
|
15
|
-
"desktopMax"
|
|
16
|
-
].reduce((t, n) => (t[n] = {
|
|
17
|
-
enumerable: !0,
|
|
18
|
-
get: () => e().widths[n]
|
|
19
|
-
}, t), {}), r = Object.defineProperties({}, n), i = {
|
|
5
|
+
var r = Object.fromEntries(t.options.map((t) => [t, `var(--w-${t}, ${e[t]}px)`])), i = {
|
|
20
6
|
get mobile() {
|
|
21
7
|
return "(min-width: 0px)";
|
|
22
8
|
},
|
|
9
|
+
get mobileMax() {
|
|
10
|
+
return `(max-width: ${r.mobileMax}px)`;
|
|
11
|
+
},
|
|
23
12
|
get tablet() {
|
|
24
13
|
return `(min-width: ${r.tablet}px)`;
|
|
25
14
|
},
|
|
15
|
+
get tabletMax() {
|
|
16
|
+
return `(max-width: ${r.tabletMax}px)`;
|
|
17
|
+
},
|
|
26
18
|
get desktop() {
|
|
27
19
|
return `(min-width: ${r.desktop}px)`;
|
|
28
20
|
},
|
|
21
|
+
get desktopMax() {
|
|
22
|
+
return `(max-width: ${r.desktopMax}px)`;
|
|
23
|
+
},
|
|
29
24
|
get extDesktop() {
|
|
30
25
|
return `(min-width: ${r.extDesktop}px)`;
|
|
31
26
|
},
|
|
@@ -42,14 +37,14 @@ var n = [
|
|
|
42
37
|
return `(min-width: ${r.desktop}px) and (max-width: ${r.desktopMax}px)`;
|
|
43
38
|
}
|
|
44
39
|
}, a = (e, t = 1, n = !0) => {
|
|
45
|
-
let i =
|
|
40
|
+
let i = r[e];
|
|
46
41
|
if (e === "column") {
|
|
47
|
-
let e = t - 1
|
|
48
|
-
i
|
|
42
|
+
let e = t - 1, a = `calc((${i} * ${t}) + (${r.gutter} * ${e}))`;
|
|
43
|
+
return n ? a : `calc(((${i} / 1px) * ${t}) + ((${r.gutter} / 1px) * ${e}))`;
|
|
49
44
|
}
|
|
50
|
-
return
|
|
51
|
-
}, o = (e,
|
|
52
|
-
${
|
|
45
|
+
return n ? t === 1 ? i : `calc(${i} * ${t})` : t === 1 ? `calc(${i} / 1px)` : `calc((${i} / 1px) * ${t})`;
|
|
46
|
+
}, o = (e, t) => n`@media ${i[e]} {
|
|
47
|
+
${t}
|
|
53
48
|
}`;
|
|
54
49
|
//#endregion
|
|
55
50
|
export { o as breakpoint, i as media, a as width, r as widths };
|
|
@@ -1,17 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
1
|
+
import { default as z } from 'zod';
|
|
2
|
+
export declare const BaseWidthSchema: z.ZodEnum<{
|
|
3
|
+
gutter: "gutter";
|
|
4
|
+
column: "column";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ScreenWidthSchema: z.ZodEnum<{
|
|
7
|
+
tablet: "tablet";
|
|
8
|
+
desktop: "desktop";
|
|
9
|
+
extDesktop: "extDesktop";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const MaxScreenWidthSchema: z.ZodEnum<{
|
|
12
|
+
mobileMax: "mobileMax";
|
|
13
|
+
tabletMax: "tabletMax";
|
|
14
|
+
desktopMax: "desktopMax";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const BreakpointSchema: z.ZodEnum<{
|
|
17
|
+
tablet: "tablet";
|
|
18
|
+
desktop: "desktop";
|
|
19
|
+
extDesktop: "extDesktop";
|
|
20
|
+
mobileMax: "mobileMax";
|
|
21
|
+
tabletMax: "tabletMax";
|
|
22
|
+
desktopMax: "desktopMax";
|
|
23
|
+
mobileOnly: "mobileOnly";
|
|
24
|
+
tabletOnly: "tabletOnly";
|
|
25
|
+
mobileTablet: "mobileTablet";
|
|
26
|
+
desktopOnly: "desktopOnly";
|
|
27
|
+
}>;
|
|
28
|
+
export declare const LayoutWidthsSchema: z.ZodEnum<{
|
|
29
|
+
gutter: "gutter";
|
|
30
|
+
column: "column";
|
|
31
|
+
tablet: "tablet";
|
|
32
|
+
desktop: "desktop";
|
|
33
|
+
extDesktop: "extDesktop";
|
|
34
|
+
mobileMax: "mobileMax";
|
|
35
|
+
tabletMax: "tabletMax";
|
|
36
|
+
desktopMax: "desktopMax";
|
|
37
|
+
text: "text";
|
|
38
|
+
}>;
|
|
39
|
+
export type BaseWidth = z.infer<typeof BaseWidthSchema>;
|
|
40
|
+
export type ScreenWidth = z.infer<typeof ScreenWidthSchema>;
|
|
41
|
+
export type MaxScreenWidth = z.infer<typeof MaxScreenWidthSchema>;
|
|
42
|
+
export type Breakpoint = z.infer<typeof BreakpointSchema>;
|
|
43
|
+
export type LayoutWidthsType = z.infer<typeof LayoutWidthsSchema>;
|
|
44
|
+
export type Width = Record<LayoutWidthsType, number>;
|
|
7
45
|
export type Colors = Record<string, string>;
|
|
8
46
|
export type ColorType = "rgba" | "hex";
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export type CraftsmanStyleConfig = Partial<{
|
|
14
|
-
colors: Partial<Colors>;
|
|
15
|
-
widths: Partial<Width>;
|
|
47
|
+
export declare const zTextInputExclusions: z.ZodEnum<{
|
|
48
|
+
checkbox: "checkbox";
|
|
49
|
+
radio: "radio";
|
|
16
50
|
}>;
|
|
17
|
-
export
|
|
51
|
+
export type TextInputExclusions = z.infer<typeof zTextInputExclusions>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "zod";
|
|
2
|
+
//#region src/styles/utilities/types.ts
|
|
3
|
+
var t = e.enum(["gutter", "column"]), n = e.enum([
|
|
4
|
+
"tablet",
|
|
5
|
+
"desktop",
|
|
6
|
+
"extDesktop"
|
|
7
|
+
]), r = e.enum([
|
|
8
|
+
"mobileMax",
|
|
9
|
+
"tabletMax",
|
|
10
|
+
"desktopMax"
|
|
11
|
+
]), i = e.enum([
|
|
12
|
+
...n.options,
|
|
13
|
+
...r.options,
|
|
14
|
+
"mobileOnly",
|
|
15
|
+
"tabletOnly",
|
|
16
|
+
"mobileTablet",
|
|
17
|
+
"desktopOnly"
|
|
18
|
+
]), a = e.enum([
|
|
19
|
+
...t.options,
|
|
20
|
+
...n.options,
|
|
21
|
+
...r.options,
|
|
22
|
+
"text"
|
|
23
|
+
]), o = e.enum(["checkbox", "radio"]);
|
|
24
|
+
//#endregion
|
|
25
|
+
export { t as BaseWidthSchema, i as BreakpointSchema, a as LayoutWidthsSchema, r as MaxScreenWidthSchema, n as ScreenWidthSchema, o as zTextInputExclusions };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ResponsiveWidth, CraftsmanStyleConfig } from './types';
|
|
2
|
-
export declare function setCraftsmanConfig(config: CraftsmanStyleConfig): void;
|
|
3
|
-
export declare function resetCraftsmanConfig(): void;
|
|
4
|
-
export declare function getCraftsmanConfig(): {
|
|
5
|
-
colors: Record<string, string>;
|
|
6
|
-
widths: ResponsiveWidth;
|
|
7
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defaultColors as e, defaultWidths as t } from "./constants.esm.js";
|
|
2
|
-
//#region src/styles/utilities/config.ts
|
|
3
|
-
var n = {
|
|
4
|
-
colors: e,
|
|
5
|
-
widths: t
|
|
6
|
-
}, r = {
|
|
7
|
-
colors: { ...n.colors },
|
|
8
|
-
widths: { ...n.widths }
|
|
9
|
-
};
|
|
10
|
-
function i(e) {
|
|
11
|
-
return {
|
|
12
|
-
...e,
|
|
13
|
-
mobileMax: e.tablet - 1e-5,
|
|
14
|
-
tabletMax: e.desktop - 1e-5,
|
|
15
|
-
desktopMax: e.extDesktop - 1e-5
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function a(e) {
|
|
19
|
-
let t = Object.entries(e.colors ?? {}).reduce((e, [t, n]) => (typeof n == "string" && (e[t] = n), e), {}), n = e.widths ? { ...e.widths } : {};
|
|
20
|
-
r = {
|
|
21
|
-
colors: {
|
|
22
|
-
...r.colors,
|
|
23
|
-
...t
|
|
24
|
-
},
|
|
25
|
-
widths: {
|
|
26
|
-
...r.widths,
|
|
27
|
-
...n
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function o() {
|
|
32
|
-
r = { ...n };
|
|
33
|
-
}
|
|
34
|
-
function s() {
|
|
35
|
-
return {
|
|
36
|
-
colors: { ...r.colors },
|
|
37
|
-
widths: i(r.widths)
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { s as getCraftsmanConfig, o as resetCraftsmanConfig, a as setCraftsmanConfig };
|