@stamcat/craftsman 0.0.30 → 0.0.31-beta.2
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 +2 -2
- package/Styles.esm.js +4 -3
- package/package.json +51 -45
- package/src/components/SortableList/types.d.ts +5 -0
- package/src/styles/index.d.ts +2 -0
- package/src/styles/theme/types.d.ts +4 -4
- package/src/styles/theme/utilities.d.ts +2 -2
- package/src/styles/utilities/layout.esm.js +10 -10
- package/src/styles/global/globalStyles.module.scss +0 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install @stamcat/craftsman
|
|
|
24
24
|
import { ThemeProvider } from "@stamcat/craftsman/styles";
|
|
25
25
|
import { Button } from "@stamcat/craftsman/Button";
|
|
26
26
|
import { Input } from "@stamcat/craftsman/Input";
|
|
27
|
-
import "@stamcat/craftsman/styles/globalStyles";
|
|
27
|
+
import "@stamcat/craftsman/styles/globalStyles.scss";
|
|
28
28
|
|
|
29
29
|
const appTheme = {
|
|
30
30
|
root: {
|
|
@@ -48,7 +48,7 @@ Use this pattern in React Server Component architectures (for example Next.js Ap
|
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
50
|
import { ThemeProvider } from "@stamcat/craftsman/styles";
|
|
51
|
-
import "@stamcat/craftsman/styles/globalStyles";
|
|
51
|
+
import "@stamcat/craftsman/styles/globalStyles.scss";
|
|
52
52
|
|
|
53
53
|
const appTheme = {
|
|
54
54
|
root: {
|
package/Styles.esm.js
CHANGED
|
@@ -2,6 +2,7 @@ import { BaseWidthSchema as e, BreakpointSchema as t, ButtonType as n, CarouselP
|
|
|
2
2
|
import { defaultColors as _, defaultWidths as v } from "./src/styles/utilities/constants.esm.js";
|
|
3
3
|
import { color as y, colors as b, hexToRgba as x } from "./src/styles/utilities/color.esm.js";
|
|
4
4
|
import { breakpoint as S, media as C, width as w, widths as T } from "./src/styles/utilities/layout.esm.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { componentSelectors as E } from "./src/styles/theme/components.esm.js";
|
|
6
|
+
import { themeBuilder as D } from "./src/styles/theme/theme.esm.js";
|
|
7
|
+
import { ThemeProvider as O } from "./src/styles/components/ThemeProvider.esm.js";
|
|
8
|
+
export { e as BaseWidthSchema, t as BreakpointSchema, n as ButtonType, r as CarouselPageType, i as LayoutWidthsSchema, a as MaxScreenWidthSchema, o as NoticeType, s as ScreenWidthSchema, c as TextSize, l as TextTags, u as TextType, O as ThemeProvider, S as breakpoint, y as color, b as colors, E as componentSelectors, _ as defaultColors, v as defaultWidths, x as hexToRgba, C as media, D as themeBuilder, w as width, T as widths, d as zCheckboxLabelPosition, f as zLabelPosition, p as zRadioLabelPosition, m as zTextInputExclusions, h as zTextInputType, g as zTextInputTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamcat/craftsman",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A powerful, lightweight framework for design systems",
|
|
6
6
|
"repository": {
|
|
@@ -70,93 +70,99 @@
|
|
|
70
70
|
"./styles/config": {
|
|
71
71
|
"default": "./src/styles/_config.scss"
|
|
72
72
|
},
|
|
73
|
+
"./styles/utilities/_functions": {
|
|
74
|
+
"default": "./src/styles/utilities/_functions.scss"
|
|
75
|
+
},
|
|
76
|
+
"./styles/utilities/_placeholders": {
|
|
77
|
+
"default": "./src/styles/utilities/_placeholders.scss"
|
|
78
|
+
},
|
|
73
79
|
"./Button": {
|
|
74
|
-
"types": "./src/components/Button.d.ts",
|
|
75
|
-
"default": "./src/components/Button.esm.js"
|
|
80
|
+
"types": "./src/components/Button/Button.d.ts",
|
|
81
|
+
"default": "./src/components/Button/Button.esm.js"
|
|
76
82
|
},
|
|
77
83
|
"./Input": {
|
|
78
|
-
"types": "./src/components/Input.d.ts",
|
|
79
|
-
"default": "./src/components/Input.esm.js"
|
|
84
|
+
"types": "./src/components/Input/Input.d.ts",
|
|
85
|
+
"default": "./src/components/Input/Input.esm.js"
|
|
80
86
|
},
|
|
81
87
|
"./InputPassword": {
|
|
82
|
-
"types": "./src/components/InputPassword.d.ts",
|
|
83
|
-
"default": "./src/components/InputPassword.esm.js"
|
|
88
|
+
"types": "./src/components/InputPassword/InputPassword.d.ts",
|
|
89
|
+
"default": "./src/components/InputPassword/InputPassword.esm.js"
|
|
84
90
|
},
|
|
85
91
|
"./Loader": {
|
|
86
|
-
"types": "./src/components/Loader.d.ts",
|
|
87
|
-
"default": "./src/components/Loader.esm.js"
|
|
92
|
+
"types": "./src/components/Loader/Loader.d.ts",
|
|
93
|
+
"default": "./src/components/Loader/Loader.esm.js"
|
|
88
94
|
},
|
|
89
95
|
"./RadioButton": {
|
|
90
|
-
"types": "./src/components/RadioButton.d.ts",
|
|
91
|
-
"default": "./src/components/RadioButton.esm.js"
|
|
96
|
+
"types": "./src/components/RadioButton/RadioButton.d.ts",
|
|
97
|
+
"default": "./src/components/RadioButton/RadioButton.esm.js"
|
|
92
98
|
},
|
|
93
99
|
"./Checkbox": {
|
|
94
|
-
"types": "./src/components/Checkbox.d.ts",
|
|
95
|
-
"default": "./src/components/Checkbox.esm.js"
|
|
100
|
+
"types": "./src/components/Checkbox/Checkbox.d.ts",
|
|
101
|
+
"default": "./src/components/Checkbox/Checkbox.esm.js"
|
|
96
102
|
},
|
|
97
103
|
"./Textarea": {
|
|
98
|
-
"types": "./src/components/Textarea.d.ts",
|
|
99
|
-
"default": "./src/components/Textarea.esm.js"
|
|
104
|
+
"types": "./src/components/Textarea/Textarea.d.ts",
|
|
105
|
+
"default": "./src/components/Textarea/Textarea.esm.js"
|
|
100
106
|
},
|
|
101
107
|
"./Text": {
|
|
102
|
-
"types": "./src/components/Text.d.ts",
|
|
103
|
-
"default": "./src/components/Text.esm.js"
|
|
108
|
+
"types": "./src/components/Text/Text.d.ts",
|
|
109
|
+
"default": "./src/components/Text/Text.esm.js"
|
|
104
110
|
},
|
|
105
111
|
"./Modal": {
|
|
106
|
-
"types": "./src/components/Modal.d.ts",
|
|
107
|
-
"default": "./src/components/Modal.esm.js"
|
|
112
|
+
"types": "./src/components/Modal/Modal.d.ts",
|
|
113
|
+
"default": "./src/components/Modal/Modal.esm.js"
|
|
108
114
|
},
|
|
109
115
|
"./Select": {
|
|
110
|
-
"types": "./src/components/Select.d.ts",
|
|
111
|
-
"default": "./src/components/Select.esm.js"
|
|
116
|
+
"types": "./src/components/Select/Select.d.ts",
|
|
117
|
+
"default": "./src/components/Select/Select.esm.js"
|
|
112
118
|
},
|
|
113
119
|
"./DatePicker": {
|
|
114
|
-
"types": "./src/components/DatePicker.d.ts",
|
|
115
|
-
"default": "./src/components/DatePicker.esm.js"
|
|
120
|
+
"types": "./src/components/DatePicker/DatePicker.d.ts",
|
|
121
|
+
"default": "./src/components/DatePicker/DatePicker.esm.js"
|
|
116
122
|
},
|
|
117
123
|
"./DateRangePicker": {
|
|
118
|
-
"types": "./src/components/DateRangePicker.d.ts",
|
|
119
|
-
"default": "./src/components/DateRangePicker.esm.js"
|
|
124
|
+
"types": "./src/components/DateRangePicker/DateRangePicker.d.ts",
|
|
125
|
+
"default": "./src/components/DateRangePicker/DateRangePicker.esm.js"
|
|
120
126
|
},
|
|
121
127
|
"./InputPhone": {
|
|
122
|
-
"types": "./src/components/InputPhone.d.ts",
|
|
123
|
-
"default": "./src/components/InputPhone.esm.js"
|
|
128
|
+
"types": "./src/components/InputPhone/InputPhone.d.ts",
|
|
129
|
+
"default": "./src/components/InputPhone/InputPhone.esm.js"
|
|
124
130
|
},
|
|
125
131
|
"./InputNumber": {
|
|
126
|
-
"types": "./src/components/InputNumber.d.ts",
|
|
127
|
-
"default": "./src/components/InputNumber.esm.js"
|
|
132
|
+
"types": "./src/components/InputNumber/InputNumber.d.ts",
|
|
133
|
+
"default": "./src/components/InputNumber/InputNumber.esm.js"
|
|
128
134
|
},
|
|
129
135
|
"./Toggle": {
|
|
130
|
-
"types": "./src/components/Toggle.d.ts",
|
|
131
|
-
"default": "./src/components/Toggle.esm.js"
|
|
136
|
+
"types": "./src/components/Toggle/Toggle.d.ts",
|
|
137
|
+
"default": "./src/components/Toggle/Toggle.esm.js"
|
|
132
138
|
},
|
|
133
139
|
"./Pagination": {
|
|
134
|
-
"types": "./src/components/Pagination.d.ts",
|
|
135
|
-
"default": "./src/components/Pagination.esm.js"
|
|
140
|
+
"types": "./src/components/Pagination/Pagination.d.ts",
|
|
141
|
+
"default": "./src/components/Pagination/Pagination.esm.js"
|
|
136
142
|
},
|
|
137
143
|
"./Carousel": {
|
|
138
|
-
"types": "./src/components/Carousel.d.ts",
|
|
139
|
-
"default": "./src/components/Carousel.esm.js"
|
|
144
|
+
"types": "./src/components/Carousel/Carousel.d.ts",
|
|
145
|
+
"default": "./src/components/Carousel/Carousel.esm.js"
|
|
140
146
|
},
|
|
141
147
|
"./TimePicker": {
|
|
142
|
-
"types": "./src/components/TimePicker.d.ts",
|
|
143
|
-
"default": "./src/components/TimePicker.esm.js"
|
|
148
|
+
"types": "./src/components/TimePicker/TimePicker.d.ts",
|
|
149
|
+
"default": "./src/components/TimePicker/TimePicker.esm.js"
|
|
144
150
|
},
|
|
145
151
|
"./DateTimePicker": {
|
|
146
|
-
"types": "./src/components/DateTimePicker.d.ts",
|
|
147
|
-
"default": "./src/components/DateTimePicker.esm.js"
|
|
152
|
+
"types": "./src/components/DateTimePicker/DateTimePicker.d.ts",
|
|
153
|
+
"default": "./src/components/DateTimePicker/DateTimePicker.esm.js"
|
|
148
154
|
},
|
|
149
155
|
"./Tooltip": {
|
|
150
|
-
"types": "./src/components/Tooltip.d.ts",
|
|
151
|
-
"default": "./src/components/Tooltip.esm.js"
|
|
156
|
+
"types": "./src/components/Tooltip/Tooltip.d.ts",
|
|
157
|
+
"default": "./src/components/Tooltip/Tooltip.esm.js"
|
|
152
158
|
},
|
|
153
159
|
"./Notice": {
|
|
154
|
-
"types": "./src/components/Notice.d.ts",
|
|
155
|
-
"default": "./src/components/Notice.esm.js"
|
|
160
|
+
"types": "./src/components/Notice/Notice.d.ts",
|
|
161
|
+
"default": "./src/components/Notice/Notice.esm.js"
|
|
156
162
|
},
|
|
157
163
|
"./SortableList": {
|
|
158
|
-
"types": "./src/components/SortableList.d.ts",
|
|
159
|
-
"default": "./src/components/SortableList.esm.js"
|
|
164
|
+
"types": "./src/components/SortableList/SortableList.d.ts",
|
|
165
|
+
"default": "./src/components/SortableList/SortableList.esm.js"
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
}
|
package/src/styles/index.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export * from './utilities/constants';
|
|
|
3
3
|
export * from './utilities/layout';
|
|
4
4
|
export * from '../utilities/types';
|
|
5
5
|
export * from './theme/theme';
|
|
6
|
+
export type { AppTheme, ColorVariableName, ComponentThemeOverrides, CSSObject, SerializedStyles, RegisteredComponent, Theme, ThemeProviderProps, WidthOverrides, Colors as ThemeColors, } from './theme/types';
|
|
7
|
+
export { type RegisteredComponentName, componentSelectors } from './theme/components';
|
|
6
8
|
export { ThemeProvider } from './components/ThemeProvider';
|
|
@@ -5,21 +5,21 @@ export type ColorVariableName = `--${ColorKey}`;
|
|
|
5
5
|
export type CSSObject = {
|
|
6
6
|
[key: string]: string | number | CSSObject | undefined;
|
|
7
7
|
};
|
|
8
|
-
export type
|
|
8
|
+
export type SerializedStyles = {
|
|
9
9
|
name: string;
|
|
10
10
|
styles: string;
|
|
11
|
-
next?:
|
|
11
|
+
next?: SerializedStyles;
|
|
12
12
|
};
|
|
13
13
|
export type RegisteredComponent = keyof typeof componentSelectors;
|
|
14
14
|
export type ComponentThemeOverrides = {
|
|
15
|
-
[K in RegisteredComponent]?: CSSObject |
|
|
15
|
+
[K in RegisteredComponent]?: CSSObject | SerializedStyles | string;
|
|
16
16
|
};
|
|
17
17
|
export type Colors = Partial<Record<ColorVariableName, string>>;
|
|
18
18
|
export type WidthOverrides = Partial<Record<LayoutWidthsType, number>>;
|
|
19
19
|
export type Theme = {
|
|
20
20
|
colors?: Colors;
|
|
21
21
|
widths?: WidthOverrides;
|
|
22
|
-
root?: CSSObject |
|
|
22
|
+
root?: CSSObject | SerializedStyles | string;
|
|
23
23
|
components?: ComponentThemeOverrides;
|
|
24
24
|
};
|
|
25
25
|
export type ThemeProviderProps = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CSSObject,
|
|
2
|
-
export declare function toCSSObject(value: CSSObject |
|
|
1
|
+
import { CSSObject, SerializedStyles } from './types';
|
|
2
|
+
export declare function toCSSObject(value: CSSObject | SerializedStyles): CSSObject;
|
|
3
3
|
export declare function cssObjectToCssText(selector: string, value: CSSObject): string;
|
|
@@ -6,34 +6,34 @@ var n = Object.fromEntries(e.options.map((e) => [e, `var(--w-${e}, ${t[e]}px)`])
|
|
|
6
6
|
return "(min-width: 0px)";
|
|
7
7
|
},
|
|
8
8
|
get mobileMax() {
|
|
9
|
-
return `(max-width: ${
|
|
9
|
+
return `(max-width: ${t.mobileMax}px)`;
|
|
10
10
|
},
|
|
11
11
|
get tablet() {
|
|
12
|
-
return `(min-width: ${
|
|
12
|
+
return `(min-width: ${t.tablet}px)`;
|
|
13
13
|
},
|
|
14
14
|
get tabletMax() {
|
|
15
|
-
return `(max-width: ${
|
|
15
|
+
return `(max-width: ${t.tabletMax}px)`;
|
|
16
16
|
},
|
|
17
17
|
get desktop() {
|
|
18
|
-
return `(min-width: ${
|
|
18
|
+
return `(min-width: ${t.desktop}px)`;
|
|
19
19
|
},
|
|
20
20
|
get desktopMax() {
|
|
21
|
-
return `(max-width: ${
|
|
21
|
+
return `(max-width: ${t.desktopMax}px)`;
|
|
22
22
|
},
|
|
23
23
|
get extDesktop() {
|
|
24
|
-
return `(min-width: ${
|
|
24
|
+
return `(min-width: ${t.extDesktop}px)`;
|
|
25
25
|
},
|
|
26
26
|
get mobileOnly() {
|
|
27
|
-
return `(min-width: 0px) and (max-width: ${
|
|
27
|
+
return `(min-width: 0px) and (max-width: ${t.mobileMax}px)`;
|
|
28
28
|
},
|
|
29
29
|
get tabletOnly() {
|
|
30
|
-
return `(min-width: ${
|
|
30
|
+
return `(min-width: ${t.tablet}px) and (max-width: ${t.tabletMax}px)`;
|
|
31
31
|
},
|
|
32
32
|
get mobileTablet() {
|
|
33
|
-
return `(min-width: 0px) and (max-width: ${
|
|
33
|
+
return `(min-width: 0px) and (max-width: ${t.tabletMax}px)`;
|
|
34
34
|
},
|
|
35
35
|
get desktopOnly() {
|
|
36
|
-
return `(min-width: ${
|
|
36
|
+
return `(min-width: ${t.desktop}px) and (max-width: ${t.desktopMax}px)`;
|
|
37
37
|
}
|
|
38
38
|
}, i = (e, t = 1, r = !0) => {
|
|
39
39
|
let i = n[e];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@use "./globalStyles.scss";
|