@cyber-harbour/ui 1.0.31 → 1.0.33
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/dist/index.d.mts +24 -42
- package/dist/index.d.ts +24 -42
- package/dist/index.js +265 -264
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +158 -157
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/Box/Box.tsx +10 -4
- package/src/Core/Input/Input.tsx +34 -35
- package/src/Core/Line/Line.tsx +1 -1
- package/src/Core/Typography/Typography.tsx +6 -1
- package/src/Graph2D/Graph2D.tsx +248 -38
- package/src/Graph2D/types.ts +6 -4
- package/src/Layouts/Container/Container.tsx +14 -8
- package/src/Theme/theme.ts +45 -4
- package/src/Theme/types.ts +4 -2
- package/src/Theme/utils.ts +22 -19
- package/tsup.config.ts +4 -2
package/src/Theme/utils.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { DefaultTheme } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Breakpoint,
|
|
4
|
+
ButtonColor,
|
|
5
|
+
ButtonSize,
|
|
6
|
+
ButtonState,
|
|
7
|
+
ButtonVariant,
|
|
8
|
+
InputSize,
|
|
9
|
+
InputState,
|
|
10
|
+
InputVariant,
|
|
11
|
+
} from './types';
|
|
3
12
|
|
|
4
13
|
/**
|
|
5
14
|
* Helper function to resolve nested color paths from theme
|
|
@@ -64,8 +73,9 @@ export const pxToRem = (pxValue: number | string, baseSize: number = 16): string
|
|
|
64
73
|
return `${remValue}rem`;
|
|
65
74
|
};
|
|
66
75
|
|
|
67
|
-
const IGNORE_CONVERT_KEYS: Record<string, string[]> = {
|
|
76
|
+
const IGNORE_CONVERT_KEYS: Record<string, string[] | boolean> = {
|
|
68
77
|
contextMenu: ['padding'],
|
|
78
|
+
baseSize: true,
|
|
69
79
|
};
|
|
70
80
|
|
|
71
81
|
/**
|
|
@@ -98,7 +108,10 @@ export const convertPaletteToRem = (
|
|
|
98
108
|
key.toLowerCase().includes(prop.toLowerCase())
|
|
99
109
|
)
|
|
100
110
|
) {
|
|
101
|
-
if (
|
|
111
|
+
if (
|
|
112
|
+
!(parentKey && Array.isArray(IGNORE_CONVERT_KEYS[parentKey]) && IGNORE_CONVERT_KEYS[parentKey].includes(key)) &&
|
|
113
|
+
!IGNORE_CONVERT_KEYS[key]
|
|
114
|
+
) {
|
|
102
115
|
result[key] = pxToRem(value, baseSize);
|
|
103
116
|
} else {
|
|
104
117
|
result[key] = value; // Keep original value if it's in the ignore list
|
|
@@ -130,22 +143,12 @@ export const getButtonSizeStyles = (theme: DefaultTheme, size: ButtonSize) => {
|
|
|
130
143
|
return theme.button.sizes[size];
|
|
131
144
|
};
|
|
132
145
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// size: InputSize = 'medium'
|
|
140
|
-
// ) => {
|
|
141
|
-
// const variantStyles = theme.input[variant][state];
|
|
142
|
-
// const sizeStyles = theme.input.sizes[size];
|
|
143
|
-
|
|
144
|
-
// return {
|
|
145
|
-
// ...variantStyles,
|
|
146
|
-
// ...sizeStyles,
|
|
147
|
-
// };
|
|
148
|
-
// };
|
|
146
|
+
/**
|
|
147
|
+
* Функція для отримання стилів інпута за варіантом та станом
|
|
148
|
+
*/
|
|
149
|
+
export const getInputStyles = (theme: DefaultTheme, variant: InputVariant, state: InputState) => {
|
|
150
|
+
return theme.input[variant][state];
|
|
151
|
+
};
|
|
149
152
|
|
|
150
153
|
/**
|
|
151
154
|
* Функція для отримання типографічних стилів
|
package/tsup.config.ts
CHANGED
|
@@ -19,8 +19,10 @@ export default defineConfig({
|
|
|
19
19
|
platform: 'browser',
|
|
20
20
|
skipNodeModulesBundle: true,
|
|
21
21
|
esbuildOptions(options) {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
if (process.env.NODE_ENV === 'development') {
|
|
23
|
+
options.drop = ['console', 'debugger'];
|
|
24
|
+
options.pure = ['console.log', 'console.info', 'console.debug', 'console.warn'];
|
|
25
|
+
}
|
|
24
26
|
},
|
|
25
27
|
shims: true,
|
|
26
28
|
keepNames: true,
|