@stamcat/craftsman 0.0.23-alpha.8 → 0.0.23

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 (99) hide show
  1. package/AGENTS.md +372 -0
  2. package/Components.d.ts +2 -0
  3. package/Components.esm.js +20 -3
  4. package/Styles.d.ts +2 -0
  5. package/Styles.esm.js +8 -0
  6. package/Utilities.d.ts +2 -0
  7. package/Utilities.esm.js +2 -0
  8. package/_virtual/_rolldown/runtime.esm.js +11 -0
  9. package/package.json +49 -11
  10. package/src/components/Button.d.ts +7 -0
  11. package/src/components/Button.esm.js +27 -0
  12. package/src/components/Button.module.css +1 -0
  13. package/src/components/Button.module.esm.js +9 -0
  14. package/src/components/Button.module.scss +5 -0
  15. package/src/components/Checkbox.d.ts +7 -0
  16. package/src/components/Checkbox.esm.js +10 -0
  17. package/src/components/Input.d.ts +11 -0
  18. package/src/components/Input.esm.js +40 -0
  19. package/src/components/Input.module.css +1 -0
  20. package/src/components/Input.module.esm.js +11 -0
  21. package/src/components/Input.module.scss +141 -0
  22. package/src/components/InputPassword.d.ts +6 -0
  23. package/src/components/InputPassword.esm.js +32 -0
  24. package/src/components/Loader.d.ts +8 -0
  25. package/src/components/Loader.esm.js +20 -0
  26. package/src/components/Modal.d.ts +22 -0
  27. package/src/components/Modal.esm.js +61 -0
  28. package/src/components/Modal.module.css +1 -0
  29. package/src/components/Modal.module.esm.js +13 -0
  30. package/src/components/Modal.module.scss +133 -0
  31. package/src/components/RadioButton.d.ts +7 -0
  32. package/src/components/RadioButton.esm.js +10 -0
  33. package/src/components/index.d.ts +7 -0
  34. package/src/main.d.ts +1 -0
  35. package/src/styles/components/ThemeProvider.d.ts +7 -0
  36. package/src/styles/components/ThemeProvider.esm.js +8 -0
  37. package/src/styles/global/components/_button.scss +64 -0
  38. package/src/styles/global/components/_checkbox.scss +78 -0
  39. package/src/styles/global/components/_code.scss +19 -0
  40. package/src/styles/global/components/_input.scss +46 -0
  41. package/src/styles/global/components/_mixins.scss +2 -0
  42. package/src/styles/global/components/_modal.scss +9 -0
  43. package/src/styles/global/components/_radioButton.scss +33 -0
  44. package/src/styles/global/components/_typography.scss +7 -0
  45. package/src/styles/global/components/button.d.ts +7 -0
  46. package/src/styles/global/components/loaders.d.ts +15 -0
  47. package/src/styles/global/components/loaders.esm.js +54 -0
  48. package/src/styles/global/components/loaders.module.css +1 -0
  49. package/src/styles/global/components/loaders.module.esm.js +21 -0
  50. package/src/styles/global/components/loaders.module.scss +246 -0
  51. package/src/styles/global/globalStyles.d.ts +1 -0
  52. package/src/styles/global/globalStyles.esm.js +4 -0
  53. package/src/styles/global/globalStyles.module.scss +129 -0
  54. package/src/styles/global/variables.d.ts +2 -0
  55. package/src/styles/global/variables.esm.js +11 -0
  56. package/src/styles/index.d.ts +7 -0
  57. package/{styles → src/styles}/theme/components.d.ts +1 -1
  58. package/src/styles/theme/components.esm.js +12 -0
  59. package/src/styles/theme/constants.d.ts +1 -0
  60. package/src/styles/theme/constants.esm.js +4 -0
  61. package/src/styles/theme/theme.d.ts +2 -0
  62. package/src/styles/theme/theme.esm.js +56 -0
  63. package/{styles → src/styles}/theme/types.d.ts +10 -3
  64. package/src/styles/theme/utilities.d.ts +3 -0
  65. package/src/styles/theme/utilities.esm.js +48 -0
  66. package/src/styles/utilities/color.d.ts +174 -0
  67. package/src/styles/utilities/color.esm.js +15 -0
  68. package/src/styles/utilities/constants.d.ts +172 -0
  69. package/src/styles/utilities/constants.esm.js +183 -0
  70. package/src/styles/utilities/layout.d.ts +17 -0
  71. package/src/styles/utilities/layout.esm.js +47 -0
  72. package/src/styles/utilities/types.d.ts +85 -0
  73. package/src/styles/utilities/types.esm.js +54 -0
  74. package/src/utilities/index.d.ts +1 -0
  75. package/src/utilities/validations.esm.js +9 -0
  76. package/Button.esm.js +0 -5
  77. package/Input.esm.js +0 -5
  78. package/components/Button.d.ts +0 -2
  79. package/components/Input.d.ts +0 -2
  80. package/components/index.d.ts +0 -2
  81. package/icons/IconCalendar.d.ts +0 -3
  82. package/icons/IconChevronRight.d.ts +0 -2
  83. package/icons/IconCircleAlert.d.ts +0 -2
  84. package/icons/IconCircleCheck.d.ts +0 -2
  85. package/icons/IconCircleHelp.d.ts +0 -2
  86. package/icons/IconCircleInfo.d.ts +0 -2
  87. package/icons/IconEye.d.ts +0 -2
  88. package/icons/IconEyeClosed.d.ts +0 -2
  89. package/icons/IconX.d.ts +0 -2
  90. package/stories/Button.stories.d.ts +0 -8
  91. package/styles/global/colors.d.ts +0 -1
  92. package/styles/global/components/button.d.ts +0 -1
  93. package/styles/global/globalStyles.d.ts +0 -1
  94. package/styles/theme/components/button.d.ts +0 -1
  95. package/styles/theme/constants.d.ts +0 -2
  96. package/styles/theme/theme.d.ts +0 -8
  97. package/styles/utilities/color.d.ts +0 -69
  98. /package/{main.d.ts → src/components/Progress.d.ts} +0 -0
  99. /package/{utilities → src/utilities}/validations.d.ts +0 -0
@@ -0,0 +1,47 @@
1
+ import { defaultWidths as e } from "./constants.esm.js";
2
+ import { LayoutWidthsSchema as t } from "./types.esm.js";
3
+ //#region src/styles/utilities/layout.ts
4
+ var n = Object.fromEntries(t.options.map((t) => [t, `var(--w-${t}, ${e[t]}px)`])), r = {
5
+ get mobile() {
6
+ return "(min-width: 0px)";
7
+ },
8
+ get mobileMax() {
9
+ return `(max-width: ${n.mobileMax}px)`;
10
+ },
11
+ get tablet() {
12
+ return `(min-width: ${n.tablet}px)`;
13
+ },
14
+ get tabletMax() {
15
+ return `(max-width: ${n.tabletMax}px)`;
16
+ },
17
+ get desktop() {
18
+ return `(min-width: ${n.desktop}px)`;
19
+ },
20
+ get desktopMax() {
21
+ return `(max-width: ${n.desktopMax}px)`;
22
+ },
23
+ get extDesktop() {
24
+ return `(min-width: ${n.extDesktop}px)`;
25
+ },
26
+ get mobileOnly() {
27
+ return `(min-width: 0px) and (max-width: ${n.mobileMax}px)`;
28
+ },
29
+ get tabletOnly() {
30
+ return `(min-width: ${n.tablet}px) and (max-width: ${n.tabletMax}px)`;
31
+ },
32
+ get mobileTablet() {
33
+ return `(min-width: 0px) and (max-width: ${n.tabletMax}px)`;
34
+ },
35
+ get desktopOnly() {
36
+ return `(min-width: ${n.desktop}px) and (max-width: ${n.desktopMax}px)`;
37
+ }
38
+ }, i = (e, t = 1, r = !0) => {
39
+ let i = n[e];
40
+ if (e === "column") {
41
+ let e = t - 1, a = `calc((${i} * ${t}) + (${n.gutter} * ${e}))`;
42
+ return r ? a : `calc(((${i} / 1px) * ${t}) + ((${n.gutter} / 1px) * ${e}))`;
43
+ }
44
+ return r ? t === 1 ? i : `calc(${i} * ${t})` : t === 1 ? `calc(${i} / 1px)` : `calc((${i} / 1px) * ${t})`;
45
+ }, a = (e, t) => `@media ${r[e]} { ${String(t)} }`;
46
+ //#endregion
47
+ export { a as breakpoint, r as media, i as width, n as widths };
@@ -0,0 +1,85 @@
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
+ text: "text";
30
+ gutter: "gutter";
31
+ column: "column";
32
+ tablet: "tablet";
33
+ desktop: "desktop";
34
+ extDesktop: "extDesktop";
35
+ mobileMax: "mobileMax";
36
+ tabletMax: "tabletMax";
37
+ desktopMax: "desktopMax";
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>;
45
+ export type Colors = Record<string, string>;
46
+ export type ColorType = "rgba" | "hex";
47
+ export declare const zTextInputExclusions: z.ZodEnum<{
48
+ checkbox: "checkbox";
49
+ radio: "radio";
50
+ }>;
51
+ export type TextInputExclusions = z.infer<typeof zTextInputExclusions>;
52
+ export declare const zTextInputTypes: readonly ["color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week", "radio", "checkbox"];
53
+ export declare const zTextInputType: z.ZodEnum<{
54
+ number: "number";
55
+ text: "text";
56
+ checkbox: "checkbox";
57
+ radio: "radio";
58
+ color: "color";
59
+ date: "date";
60
+ "datetime-local": "datetime-local";
61
+ email: "email";
62
+ file: "file";
63
+ hidden: "hidden";
64
+ image: "image";
65
+ month: "month";
66
+ password: "password";
67
+ range: "range";
68
+ reset: "reset";
69
+ search: "search";
70
+ submit: "submit";
71
+ tel: "tel";
72
+ time: "time";
73
+ url: "url";
74
+ week: "week";
75
+ }>;
76
+ export type TextInputType = z.infer<typeof zTextInputType>;
77
+ export declare const zLabelPosition: z.ZodEnum<{
78
+ hidden: "hidden";
79
+ top: "top";
80
+ left: "left";
81
+ bottom: "bottom";
82
+ right: "right";
83
+ inside: "inside";
84
+ }>;
85
+ export type LabelPosition = z.infer<typeof zLabelPosition>;
@@ -0,0 +1,54 @@
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"]), s = [
24
+ "color",
25
+ "date",
26
+ "datetime-local",
27
+ "email",
28
+ "file",
29
+ "hidden",
30
+ "image",
31
+ "month",
32
+ "number",
33
+ "password",
34
+ "range",
35
+ "reset",
36
+ "search",
37
+ "submit",
38
+ "tel",
39
+ "text",
40
+ "time",
41
+ "url",
42
+ "week",
43
+ "radio",
44
+ "checkbox"
45
+ ], c = e.enum(s), l = e.enum([
46
+ "top",
47
+ "left",
48
+ "bottom",
49
+ "right",
50
+ "inside",
51
+ "hidden"
52
+ ]);
53
+ //#endregion
54
+ export { t as BaseWidthSchema, i as BreakpointSchema, a as LayoutWidthsSchema, r as MaxScreenWidthSchema, n as ScreenWidthSchema, l as zLabelPosition, o as zTextInputExclusions, c as zTextInputType, s as zTextInputTypes };
@@ -0,0 +1 @@
1
+ export * from './validations';
@@ -0,0 +1,9 @@
1
+ //#region src/utilities/validations.ts
2
+ function e(e) {
3
+ return e == null || typeof e == "object" && Object.keys(e).length === 0 || typeof e == "string" && e.trim().length === 0 || typeof e == "string" && e === " ";
4
+ }
5
+ function t(e) {
6
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
7
+ }
8
+ //#endregion
9
+ export { e as isEmpty, t as validateEmail };
package/Button.esm.js DELETED
@@ -1,5 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- //#region src/components/Button.tsx
3
- var t = (t) => /* @__PURE__ */ e("button", { ...t });
4
- //#endregion
5
- export { t as Button };
package/Input.esm.js DELETED
@@ -1,5 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- //#region src/components/Input.tsx
3
- var t = (t) => /* @__PURE__ */ e("input", { ...t });
4
- //#endregion
5
- export { t as Input };
@@ -1,2 +0,0 @@
1
- export type ButtonProps = React.ComponentProps<"button">;
2
- export declare const Button: React.FC<ButtonProps>;
@@ -1,2 +0,0 @@
1
- export type InputProps = React.ComponentProps<"input">;
2
- export declare const Input: React.FC<InputProps>;
@@ -1,2 +0,0 @@
1
- export { Button } from './Button';
2
- export { Input } from './Input';
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconCalendar(props: Readonly<React.SVGProps<SVGSVGElement>>): React.JSX.Element;
3
- export default IconCalendar;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconChevronRight(props: Readonly<React.SVGProps<SVGSVGElement>>): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconCircleAlert(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconCircleCheck(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconCircleHelp(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconCircleInfo(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconEye(props: Readonly<React.SVGProps<SVGSVGElement>>): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconEyeClosed(props: Readonly<React.SVGProps<SVGSVGElement>>): React.JSX.Element;
package/icons/IconX.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function IconX(props: Readonly<React.SVGProps<SVGSVGElement>>): React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { Button } from '../components/Button';
3
- declare const meta: Meta<typeof Button>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const Disabled: Story;
8
- export declare const AsSubmit: Story;
@@ -1 +0,0 @@
1
- export declare const colors: import('@emotion/utils').SerializedStyles;
@@ -1 +0,0 @@
1
- export declare const button: import('@emotion/utils').SerializedStyles;
@@ -1 +0,0 @@
1
- export declare const globalStyles: import('@emotion/utils').SerializedStyles;
@@ -1 +0,0 @@
1
- export declare const button: import('@emotion/utils').SerializedStyles;
@@ -1,2 +0,0 @@
1
- import { Theme } from './types';
2
- export declare const defaultAppTheme: Theme;
@@ -1,8 +0,0 @@
1
- import { SerializedStyles } from '@emotion/react';
2
- import { default as React } from 'react';
3
- import { Theme, ThemeProviderProps } from './types';
4
- export declare function CraftsmanThemeProvider({ theme, children }: ThemeProviderProps): React.ReactElement<{
5
- theme: Theme;
6
- children?: React.ReactNode;
7
- }, string | React.JSXElementConstructor<any>>;
8
- export declare function themeBuilder(theme: Theme): SerializedStyles;
@@ -1,69 +0,0 @@
1
- export type ColorType = "rgba" | "hex";
2
- export declare const colors: {
3
- white: string;
4
- black: string;
5
- transparent: string;
6
- grey50: string;
7
- grey100: string;
8
- grey200: string;
9
- grey300: string;
10
- grey400: string;
11
- grey500: string;
12
- grey600: string;
13
- grey700: string;
14
- grey800: string;
15
- grey900: string;
16
- blue50: string;
17
- blue100: string;
18
- blue200: string;
19
- blue300: string;
20
- blue400: string;
21
- blue500: string;
22
- blue600: string;
23
- blue700: string;
24
- blue800: string;
25
- blue900: string;
26
- green50: string;
27
- green100: string;
28
- green200: string;
29
- green300: string;
30
- green400: string;
31
- green500: string;
32
- green600: string;
33
- green700: string;
34
- green800: string;
35
- green900: string;
36
- yellow50: string;
37
- yellow100: string;
38
- yellow200: string;
39
- yellow300: string;
40
- yellow400: string;
41
- yellow500: string;
42
- yellow600: string;
43
- yellow700: string;
44
- yellow800: string;
45
- yellow900: string;
46
- red50: string;
47
- red100: string;
48
- red200: string;
49
- red300: string;
50
- red400: string;
51
- red500: string;
52
- red600: string;
53
- red700: string;
54
- red800: string;
55
- red900: string;
56
- purple50: string;
57
- purple100: string;
58
- purple200: string;
59
- purple300: string;
60
- purple400: string;
61
- purple500: string;
62
- purple600: string;
63
- purple700: string;
64
- purple800: string;
65
- purple900: string;
66
- };
67
- export type ColorKey = keyof typeof colors;
68
- export declare function hexToRgba(hex: string, alpha?: number): string;
69
- export declare const color: (name: ColorKey, type?: ColorType, alpha?: number) => string;
File without changes
File without changes