@gusarov-studio/rubik-ui 2.2.0 → 2.4.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/dist/Box/Box.d.ts CHANGED
@@ -1,28 +1,35 @@
1
1
  import React from "react";
2
2
  import "./Box.scss";
3
- type SpacingValue = "spacing-none" | "spacing-xxs" | "spacing-xs" | "spacing-sm" | "spacing-md" | "spacing-lg" | "spacing-xl" | "spacing-2xl" | "spacing-3xl" | "spacing-4xl" | "spacing-5xl" | "spacing-6xl" | "spacing-7xl" | "spacing-8xl" | "spacing-9xl" | "spacing-10xl" | "spacing-11xl";
4
- interface SpacingProps {
5
- margin?: SpacingValue;
6
- marginTop?: SpacingValue;
7
- marginRight?: SpacingValue;
8
- marginBottom?: SpacingValue;
9
- marginLeft?: SpacingValue;
10
- padding?: SpacingValue;
11
- paddingTop?: SpacingValue;
12
- paddingRight?: SpacingValue;
13
- paddingBottom?: SpacingValue;
14
- paddingLeft?: SpacingValue;
3
+ import type { CSSUnit } from "../types/CSSUnit";
4
+ type SingleValue = CSSUnit | "0" | `calc(${string})`;
5
+ type MultiValue<T extends string> = T | `${T} ${T}` | `${T} ${T} ${T}` | `${T} ${T} ${T} ${T}`;
6
+ type StyleSingleValue = SingleValue | number;
7
+ type StyleMultiValue = MultiValue<SingleValue> | number;
8
+ interface StyleProps {
9
+ margin?: StyleMultiValue;
10
+ marginTop?: StyleSingleValue;
11
+ marginRight?: StyleSingleValue;
12
+ marginBottom?: StyleSingleValue;
13
+ marginLeft?: StyleSingleValue;
14
+ padding?: StyleMultiValue;
15
+ paddingTop?: StyleSingleValue;
16
+ paddingRight?: StyleSingleValue;
17
+ paddingBottom?: StyleSingleValue;
18
+ paddingLeft?: StyleSingleValue;
19
+ radius?: StyleMultiValue;
20
+ radiusTopLeft?: StyleSingleValue;
21
+ radiusTopRight?: StyleSingleValue;
22
+ radiusBottomRight?: StyleSingleValue;
23
+ radiusBottomLeft?: StyleSingleValue;
24
+ borderWidth?: StyleMultiValue;
25
+ borderTopWidth?: StyleSingleValue;
26
+ borderRightWidth?: StyleSingleValue;
27
+ borderBottomWidth?: StyleSingleValue;
28
+ borderLeftWidth?: StyleSingleValue;
15
29
  }
16
- interface BoxProps extends React.PropsWithChildren, SpacingProps {
30
+ interface BoxProps extends React.HTMLAttributes<HTMLDivElement>, StyleProps {
31
+ variant?: "transparent" | "primary" | "secondary";
17
32
  className?: string;
18
- breakpoints?: {
19
- xs?: SpacingProps;
20
- sm?: SpacingProps;
21
- md?: SpacingProps;
22
- lg?: SpacingProps;
23
- xl?: SpacingProps;
24
- xxl?: SpacingProps;
25
- };
26
33
  }
27
- declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLDivElement>>;
28
- export { Box };
34
+ declare const Box: React.MemoExoticComponent<React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLDivElement>>>;
35
+ export { Box, type BoxProps, type StyleProps };
@@ -0,0 +1,5 @@
1
+ import type { StyleProps } from "../Box";
2
+ declare const generateStyles: (props: StyleProps) => {
3
+ styles: Record<string, string | number>;
4
+ };
5
+ export { generateStyles };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const isValidSize: (value: string) => boolean;
2
+ export { isValidSize };
@@ -0,0 +1,12 @@
1
+ declare const parseValue: (value: string | number) => {
2
+ top: string;
3
+ right: string;
4
+ bottom: string;
5
+ left: string;
6
+ } | {
7
+ top: number;
8
+ right: number;
9
+ bottom: number;
10
+ left: number;
11
+ };
12
+ export { parseValue };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ declare const processValue: (key: string, value: string | number) => {
2
+ marginTop: string | number;
3
+ marginRight: string | number;
4
+ marginBottom: string | number;
5
+ marginLeft: string | number;
6
+ paddingTop?: undefined;
7
+ paddingRight?: undefined;
8
+ paddingBottom?: undefined;
9
+ paddingLeft?: undefined;
10
+ borderTopLeftRadius?: undefined;
11
+ borderTopRightRadius?: undefined;
12
+ borderBottomRightRadius?: undefined;
13
+ borderBottomLeftRadius?: undefined;
14
+ borderTopWidth?: undefined;
15
+ borderRightWidth?: undefined;
16
+ borderBottomWidth?: undefined;
17
+ borderLeftWidth?: undefined;
18
+ } | {
19
+ paddingTop: string | number;
20
+ paddingRight: string | number;
21
+ paddingBottom: string | number;
22
+ paddingLeft: string | number;
23
+ marginTop?: undefined;
24
+ marginRight?: undefined;
25
+ marginBottom?: undefined;
26
+ marginLeft?: undefined;
27
+ borderTopLeftRadius?: undefined;
28
+ borderTopRightRadius?: undefined;
29
+ borderBottomRightRadius?: undefined;
30
+ borderBottomLeftRadius?: undefined;
31
+ borderTopWidth?: undefined;
32
+ borderRightWidth?: undefined;
33
+ borderBottomWidth?: undefined;
34
+ borderLeftWidth?: undefined;
35
+ } | {
36
+ borderTopLeftRadius: string | number;
37
+ borderTopRightRadius: string | number;
38
+ borderBottomRightRadius: string | number;
39
+ borderBottomLeftRadius: string | number;
40
+ marginTop?: undefined;
41
+ marginRight?: undefined;
42
+ marginBottom?: undefined;
43
+ marginLeft?: undefined;
44
+ paddingTop?: undefined;
45
+ paddingRight?: undefined;
46
+ paddingBottom?: undefined;
47
+ paddingLeft?: undefined;
48
+ borderTopWidth?: undefined;
49
+ borderRightWidth?: undefined;
50
+ borderBottomWidth?: undefined;
51
+ borderLeftWidth?: undefined;
52
+ } | {
53
+ borderTopWidth: string | number;
54
+ borderRightWidth: string | number;
55
+ borderBottomWidth: string | number;
56
+ borderLeftWidth: string | number;
57
+ marginTop?: undefined;
58
+ marginRight?: undefined;
59
+ marginBottom?: undefined;
60
+ marginLeft?: undefined;
61
+ paddingTop?: undefined;
62
+ paddingRight?: undefined;
63
+ paddingBottom?: undefined;
64
+ paddingLeft?: undefined;
65
+ borderTopLeftRadius?: undefined;
66
+ borderTopRightRadius?: undefined;
67
+ borderBottomRightRadius?: undefined;
68
+ borderBottomLeftRadius?: undefined;
69
+ } | undefined;
70
+ export { processValue };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import "./Clickable.scss";
3
3
  interface ClickableProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
- onClick: (e?: React.SyntheticEvent<unknown>) => void;
4
+ onClick?: (e?: React.MouseEvent<HTMLAnchorElement>) => void;
5
5
  displayType?: "block" | "inline";
6
6
  }
7
7
  declare const Clickable: React.ForwardRefExoticComponent<ClickableProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -1,11 +1,15 @@
1
1
  import React from "react";
2
- import "./index.scss";
3
- type Gap = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "10xl" | "11xl";
2
+ import "./Stack.scss";
3
+ import type { CSSUnit } from "../types/CSSUnit";
4
+ type GapProperty = CSSUnit | `${number} ` | `calc(${string})` | number;
4
5
  interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
5
- gap: Gap;
6
- direction?: "horizontal" | "vertical";
6
+ direction?: "row" | "row-reverse" | "column" | "column-reverse";
7
+ spacing?: GapProperty;
8
+ alignItems?: "start" | "center" | "end" | "stretch" | "baseline";
9
+ justifyContent?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
10
+ wrap?: boolean;
7
11
  as?: React.ElementType;
8
- className?: string;
12
+ children: React.ReactNode;
9
13
  }
10
14
  declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
11
- export { Stack };
15
+ export { Stack, type StackProps };