@code0-tech/pictor 0.1.1 → 0.2.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/index.d.ts CHANGED
@@ -1,12 +1,62 @@
1
- import React, { ReactNode, HTMLProps, DetailedHTMLProps, AnchorHTMLAttributes, ReactElement, InputHTMLAttributes } from 'react';
1
+ import React, { HTMLProps, ReactNode, ReactElement, DetailedHTMLProps, InputHTMLAttributes } from 'react';
2
2
  import { TablerIconsProps } from '@tabler/icons-react';
3
3
  import { PositionProps, OverlayTriggerProps } from '@react-types/overlays';
4
4
  import { AriaMenuProps, Key } from 'react-aria';
5
5
 
6
6
  type Color = "primary" | "secondary" | "info" | "success" | "warning" | "error";
7
- type Size = "xs" | "sm" | "md" | "lg" | "xl";
7
+ type Code0Sizes = "xs" | "sm" | "md" | "lg" | "xl";
8
+ type Code0FontSizes = "0.75" | "0.8" | "1" | "1.2" | "1.25";
9
+ type StyleProp<Value> = Value;
10
+ interface Code0ComponentProps {
11
+ m?: StyleProp<number | `${number}`>;
12
+ my?: StyleProp<number | `${number}`>;
13
+ mx?: StyleProp<number | `${number}`>;
14
+ mt?: StyleProp<number | `${number}`>;
15
+ mb?: StyleProp<number | `${number}`>;
16
+ ml?: StyleProp<number | `${number}`>;
17
+ mr?: StyleProp<number | `${number}`>;
18
+ p?: StyleProp<number | `${number}`>;
19
+ py?: StyleProp<number | `${number}`>;
20
+ px?: StyleProp<number | `${number}`>;
21
+ pt?: StyleProp<number | `${number}`>;
22
+ pb?: StyleProp<number | `${number}`>;
23
+ pl?: StyleProp<number | `${number}`>;
24
+ pr?: StyleProp<number | `${number}`>;
25
+ bg?: React.CSSProperties['backgroundColor'];
26
+ c?: React.CSSProperties['color'];
27
+ opacity?: React.CSSProperties['opacity'];
28
+ ff?: StyleProp<'mono' | 'text' | 'heading' | (string & {})>;
29
+ fz?: StyleProp<Code0FontSizes | number | `${number}`>;
30
+ fw?: StyleProp<React.CSSProperties['fontWeight']>;
31
+ lts?: StyleProp<React.CSSProperties['letterSpacing']>;
32
+ ta?: StyleProp<React.CSSProperties['textAlign']>;
33
+ lh?: StyleProp<number | (string & {})>;
34
+ fs?: StyleProp<React.CSSProperties['fontStyle']>;
35
+ tt?: StyleProp<React.CSSProperties['textTransform']>;
36
+ td?: StyleProp<React.CSSProperties['textDecoration']>;
37
+ w?: StyleProp<React.CSSProperties['width']>;
38
+ miw?: StyleProp<React.CSSProperties['minWidth']>;
39
+ maw?: StyleProp<React.CSSProperties['maxWidth']>;
40
+ h?: StyleProp<React.CSSProperties['height']>;
41
+ mih?: StyleProp<React.CSSProperties['minHeight']>;
42
+ mah?: StyleProp<React.CSSProperties['maxHeight']>;
43
+ bgsz?: StyleProp<React.CSSProperties['backgroundSize']>;
44
+ bgp?: StyleProp<React.CSSProperties['backgroundPosition']>;
45
+ bgr?: StyleProp<React.CSSProperties['backgroundRepeat']>;
46
+ bga?: StyleProp<React.CSSProperties['backgroundAttachment']>;
47
+ pos?: StyleProp<React.CSSProperties['position']>;
48
+ top?: StyleProp<React.CSSProperties['top']>;
49
+ left?: StyleProp<React.CSSProperties['left']>;
50
+ bottom?: StyleProp<React.CSSProperties['bottom']>;
51
+ right?: StyleProp<React.CSSProperties['right']>;
52
+ inset?: StyleProp<React.CSSProperties['inset']>;
53
+ display?: StyleProp<React.CSSProperties['display']>;
54
+ flex?: StyleProp<React.CSSProperties['flex']>;
55
+ }
56
+ interface Code0Component<T> extends Code0ComponentProps, HTMLProps<T> {
57
+ }
8
58
 
9
- interface AlertType {
59
+ interface AlertType extends Omit<Code0Component<HTMLDivElement>, "title"> {
10
60
  children?: ReactNode | ReactNode[];
11
61
  title: ReactNode;
12
62
  color?: Color;
@@ -16,32 +66,32 @@ interface AlertType {
16
66
  }
17
67
  declare const Alert: React.FC<AlertType>;
18
68
 
19
- interface BadgeType extends HTMLProps<HTMLSpanElement> {
69
+ interface BadgeType extends Code0Component<HTMLSpanElement> {
20
70
  children: string;
21
71
  color?: Color;
22
72
  }
23
73
  declare const Badge: React.FC<BadgeType>;
24
74
 
25
- interface ButtonType extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
75
+ interface ButtonType extends Code0Component<HTMLAnchorElement> {
26
76
  children: ReactNode | ReactNode[];
27
77
  color?: Color;
28
78
  variant?: "none" | "normal" | "outlined" | "filled";
29
79
  active?: boolean;
30
80
  disabled?: boolean;
31
81
  }
32
- interface ButtonIconType {
82
+ interface ButtonIconType extends Code0Component<HTMLSpanElement> {
33
83
  children: ReactNode;
34
84
  }
35
85
  declare const _default$7: React.FC<ButtonType> & {
36
86
  Icon: React.FC<ButtonIconType>;
37
87
  };
38
88
 
39
- interface ButtonGroupType {
89
+ interface ButtonGroupType extends Code0Component<HTMLDivElement> {
40
90
  children: ReactElement<ButtonType>[];
41
91
  }
42
92
  declare const ButtonGroup: React.FC<ButtonGroupType>;
43
93
 
44
- interface CardType extends HTMLProps<HTMLDivElement> {
94
+ interface CardType extends Code0Component<HTMLDivElement> {
45
95
  children: ReactNode | ReactNode[];
46
96
  color?: Color;
47
97
  variant?: "none" | "normal" | "outlined" | "filled";
@@ -49,7 +99,7 @@ interface CardType extends HTMLProps<HTMLDivElement> {
49
99
  gradientPosition?: "top-left" | "top-right" | "bottom-right" | "bottom-left";
50
100
  outline?: boolean;
51
101
  }
52
- interface SectionType {
102
+ interface SectionType extends Code0Component<HTMLDivElement> {
53
103
  children: ReactNode | ReactNode[];
54
104
  image?: boolean;
55
105
  border?: boolean;
@@ -59,7 +109,7 @@ declare const _default$6: React.FC<CardType> & {
59
109
  };
60
110
 
61
111
  type ColBreakPointRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
62
- interface ColType extends HTMLProps<HTMLDivElement> {
112
+ interface ColType extends Code0Component<HTMLDivElement> {
63
113
  children: ReactNode | ReactNode[];
64
114
  xs?: ColBreakPointRange;
65
115
  sm?: ColBreakPointRange;
@@ -70,7 +120,7 @@ interface ColType extends HTMLProps<HTMLDivElement> {
70
120
  }
71
121
  declare const Col: React.FC<ColType>;
72
122
 
73
- interface ContainerType extends HTMLProps<HTMLDivElement> {
123
+ interface ContainerType extends Code0Component<HTMLDivElement> {
74
124
  children: ReactNode | ReactNode[];
75
125
  }
76
126
  declare const Container: React.FC<ContainerType>;
@@ -113,9 +163,9 @@ declare const _default$5: React.FC<DropdownType$1> & {
113
163
  };
114
164
  };
115
165
 
116
- interface FontType extends Omit<Omit<HTMLProps<HTMLSpanElement>, "children">, "size"> {
166
+ interface FontType extends Omit<Omit<Code0Component<HTMLSpanElement>, "children">, "size"> {
117
167
  children: string;
118
- size: Size;
168
+ size: Code0Sizes;
119
169
  hierarchy?: "primary" | "secondary" | "tertiary";
120
170
  }
121
171
  declare const Text: React.FC<FontType>;
@@ -223,7 +273,7 @@ interface QuoteType extends Omit<CardType, "children"> {
223
273
  }
224
274
  declare const Quote: React.FC<QuoteType>;
225
275
 
226
- interface RowType extends HTMLProps<HTMLDivElement> {
276
+ interface RowType extends Code0Component<HTMLDivElement> {
227
277
  children: ReactNode | ReactNode[];
228
278
  }
229
279
  declare const Row: React.FC<RowType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "A simple template for a custom React component library",
5
5
  "scripts": {
6
6
  "dev": "npm run storybook:dev",
@@ -70,6 +70,7 @@
70
70
  "access": "public"
71
71
  },
72
72
  "dependencies": {
73
+ "merge-props": "^6.0.0",
73
74
  "react-aria": "^3.31.1",
74
75
  "react-stately": "^3.29.1",
75
76
  "rollup-plugin-visualizer": "^5.11.0"