@minimalstuff/ui 0.0.15 → 0.0.18

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,11 +1,25 @@
1
+ /// <reference types="react" />
2
+
3
+ import { AnchorHTMLAttributes } from 'react';
1
4
  import { ButtonHTMLAttributes } from 'react';
5
+ import { ClassAttributes } from 'react';
2
6
  import { Context } from 'react';
7
+ import { CSSProperties } from 'react';
3
8
  import { DetailedHTMLProps } from 'react';
4
9
  import { ElementType } from 'react';
10
+ import { FormatOptionLabelMeta } from 'react-select';
11
+ import { FormHTMLAttributes } from 'react';
12
+ import { GroupBase } from 'react-select';
5
13
  import { HTMLAttributes } from 'react';
14
+ import { IconType } from 'react-icons/lib';
15
+ import { ImgHTMLAttributes } from 'react';
16
+ import { InputHTMLAttributes } from 'react';
6
17
  import { JSX as JSX_2 } from 'react';
7
18
  import { JSX as JSX_3 } from '@emotion/react/jsx-runtime';
19
+ import { LiHTMLAttributes } from 'react';
20
+ import { OptionsOrGroups } from 'react-select';
8
21
  import { PropsWithChildren } from 'react';
22
+ import { ReactNode } from 'react';
9
23
  import { StyledComponent } from '@emotion/styled';
10
24
  import { Theme } from '@emotion/react';
11
25
 
@@ -25,6 +39,8 @@ declare type ButtonProps = {
25
39
  secondary?: boolean;
26
40
  };
27
41
 
42
+ export declare function Checkbox({ name, label, checked, errors, onChange, required, ...props }: InputProps): JSX.Element;
43
+
28
44
  export declare type Colors = {
29
45
  font: string;
30
46
  background: string;
@@ -39,6 +55,53 @@ export declare type Colors = {
39
55
  boxShadow: string;
40
56
  };
41
57
 
58
+ export declare function Dropdown({ children, label, className, svgSize, }: DropdownProps): JSX_3.Element;
59
+
60
+ export declare const DropdownContainer: StyledComponent< {
61
+ theme?: Theme | undefined;
62
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
63
+ } & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
64
+ theme?: Theme | undefined;
65
+ } & {
66
+ show: boolean;
67
+ }, {}, {}>;
68
+
69
+ export declare const DropdownItemButton: StyledComponent< {
70
+ theme?: Theme | undefined;
71
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
72
+ } & {
73
+ danger?: boolean | undefined;
74
+ } & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
75
+ theme?: Theme | undefined;
76
+ }, {}, {}>;
77
+
78
+ export declare const DropdownItemLink: StyledComponent< {
79
+ theme?: Theme | undefined;
80
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
81
+ } & {
82
+ danger?: boolean | undefined;
83
+ } & ClassAttributes<HTMLAnchorElement> & AnchorHTMLAttributes<HTMLAnchorElement> & {
84
+ theme?: Theme | undefined;
85
+ }, {}, {}>;
86
+
87
+ export declare const DropdownLabel: StyledComponent< {
88
+ theme?: Theme | undefined;
89
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
90
+ }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
91
+
92
+ declare interface DropdownProps {
93
+ children: ReactNode;
94
+ label: ReactNode | string;
95
+ className?: string;
96
+ svgSize?: number;
97
+ }
98
+
99
+ export declare function ExternalLink({ children, title, ...props }: AnchorHTMLAttributes<HTMLAnchorElement> & PropsWithChildren & {
100
+ style?: CSSProperties;
101
+ title?: string;
102
+ className?: string;
103
+ }): JSX_3.Element;
104
+
42
105
  export declare type FadedColor = {
43
106
  lightest: string;
44
107
  light: string;
@@ -51,10 +114,83 @@ declare type FontSizes = {
51
114
  [key in SizeType]: string;
52
115
  };
53
116
 
117
+ export declare const Form: StyledComponent< {
118
+ theme?: Theme | undefined;
119
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
120
+ }, DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, {}>;
121
+
122
+ declare interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
123
+ label: string;
124
+ name: string;
125
+ checked: boolean;
126
+ errors?: string[];
127
+ onChange?: (name: string, checked: boolean) => void;
128
+ }
129
+
130
+ declare interface InputProps_2 extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
131
+ label: string;
132
+ name: string;
133
+ value?: string;
134
+ errors?: string[];
135
+ onChange?: (name: string, value: string) => void;
136
+ }
137
+
54
138
  declare type Medias = {
55
139
  [key in ScreenType]: string;
56
140
  };
57
141
 
142
+ export declare function Modal({ title, children, opened, hideCloseBtn, className, close, }: ModalProps): false | JSX_3.Element;
143
+
144
+ export declare const ModalBody: StyledComponent< {
145
+ theme?: Theme | undefined;
146
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
147
+ }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
148
+
149
+ export declare const ModalCloseBtn: StyledComponent< {
150
+ theme?: Theme | undefined;
151
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
152
+ }, DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
153
+
154
+ export declare const ModalContainer: StyledComponent< {
155
+ theme?: Theme | undefined;
156
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
157
+ } & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
158
+ theme?: Theme | undefined;
159
+ }, {}, {}>;
160
+
161
+ export declare const ModalHeader: StyledComponent< {
162
+ theme?: Theme | undefined;
163
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
164
+ }, DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
165
+
166
+ declare interface ModalProps {
167
+ title?: string;
168
+ children: ReactNode;
169
+ opened: boolean;
170
+ hideCloseBtn?: boolean;
171
+ className?: string;
172
+ close: () => void;
173
+ }
174
+
175
+ export declare const ModalWrapper: StyledComponent< {
176
+ theme?: Theme | undefined;
177
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
178
+ }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
179
+
180
+ declare type Option_2 = {
181
+ label: string | number;
182
+ value: string | number;
183
+ };
184
+
185
+ export declare const RoundedImage: StyledComponent< {
186
+ theme?: Theme | undefined;
187
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
188
+ } & RoundedImageProps, DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
189
+
190
+ declare interface RoundedImageProps {
191
+ size?: number;
192
+ }
193
+
58
194
  declare type ScreenType =
59
195
  | 'mobile'
60
196
  | 'tablet'
@@ -63,10 +199,57 @@ declare type ScreenType =
63
199
  | 'large_desktop'
64
200
  | 'xlarge_desktop';
65
201
 
202
+ export declare function Selector({ name, label, value, options, onChangeCallback, formatOptionLabel, required, ...props }: SelectorProps): JSX.Element;
203
+
204
+ declare interface SelectorProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
205
+ label: string;
206
+ name: string;
207
+ errors?: string[];
208
+ options: OptionsOrGroups<Option_2, GroupBase<Option_2>>;
209
+ value: number | string;
210
+ onChangeCallback?: (value: number | string) => void;
211
+ formatOptionLabel?: (data: Option_2, formatOptionLabelMeta: FormatOptionLabelMeta<Option_2>) => ReactNode;
212
+ }
213
+
66
214
  declare type SizeType = 'xs' | 's' | 'm' | 'l' | 'xl';
67
215
 
68
216
  declare type SpeedType = 'fast' | 'normal' | 'slow';
69
217
 
218
+ export declare function StyleReset(): JSX_3.Element;
219
+
220
+ export declare interface Tab {
221
+ title: string;
222
+ content: ReactNode;
223
+ icon?: IconType;
224
+ danger?: boolean;
225
+ }
226
+
227
+ export declare const TabItem: StyledComponent< {
228
+ theme?: Theme | undefined;
229
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
230
+ } & {
231
+ active?: boolean | undefined;
232
+ danger?: boolean | undefined;
233
+ }, DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
234
+
235
+ export declare const TabList: StyledComponent< {
236
+ theme?: Theme | undefined;
237
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
238
+ }, DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
239
+
240
+ export declare const TabPanel: StyledComponent< {
241
+ theme?: Theme | undefined;
242
+ as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
243
+ }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
244
+
245
+ export declare function Tabs({ tabs }: TabsProps): JSX_3.Element;
246
+
247
+ export declare interface TabsProps {
248
+ tabs: Tab[];
249
+ }
250
+
251
+ export declare function Textbox({ name, label, value, errors, onChange, required, ...props }: InputProps_2): JSX.Element;
252
+
70
253
  export declare const TextEllipsis: StyledComponent< {
71
254
  theme?: Theme | undefined;
72
255
  as?: ElementType<any, keyof JSX_2.IntrinsicElements> | undefined;
@@ -81,8 +264,7 @@ isDarkTheme: boolean;
81
264
  toggleDarkTheme: (_value: boolean) => void;
82
265
  }>;
83
266
 
84
- export declare function ThemeContextProvider({ preferDarkTheme, children, onPreferenceChange, }: {
85
- preferDarkTheme?: boolean;
267
+ export declare function ThemeContextProvider({ children, onPreferenceChange, }: {
86
268
  onPreferenceChange?: (isDarkTheme: boolean) => void;
87
269
  } & PropsWithChildren): JSX_3.Element;
88
270