@necto-react/components 1.1.0 → 1.2.1

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,6 +1,6 @@
1
1
  import { HTMLElements } from '@necto/dom';
2
+ import { ElementType, ComponentPropsWithRef, ForwardRefExoticComponent, Ref, ReactElement, FC, ReactNode } from 'react';
2
3
  import { DOM } from '@necto/constants';
3
- import { ElementType, ComponentPropsWithRef, ForwardRefExoticComponent, Ref, ReactElement } from 'react';
4
4
 
5
5
  /**
6
6
  * Copyright (c) Corinvo, LLC. and affiliates.
@@ -36,10 +36,210 @@ type Primitives = {
36
36
  * @param {Ref<any>} ref - Forwarded ref for the rendered element or cloned child.
37
37
  * @returns {ReactElement | null} The rendered element or null.
38
38
  */
39
- declare const Primitive: (<E extends ElementType = (typeof HTMLElements)["Div"]>(props: PrimitiveProps<E> & {
39
+ declare const Primitive: (<E extends ElementType = (typeof HTMLElements)['Div']>(props: PrimitiveProps<E> & {
40
40
  ref?: Ref<any>;
41
- }) => ReactElement | null) & Primitives & {
41
+ }) => ReactElement | null) & FC<PrimitiveProps<ElementType>> & Primitives & {
42
42
  [k: string]: any;
43
43
  };
44
44
 
45
- export { Primitive };
45
+ /**
46
+ * Copyright (c) Corinvo, LLC. and affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ *
51
+ */
52
+
53
+ interface IfProps {
54
+ condition: boolean | (() => boolean);
55
+ keepAlive?: boolean;
56
+ children: ReactNode | Array<ReactNode>;
57
+ }
58
+
59
+ /**
60
+ * Copyright (c) Corinvo, LLC. and affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ *
65
+ */
66
+
67
+ declare const If: FC<IfProps>;
68
+
69
+ interface ElseProps {
70
+ children: ReactNode | Array<ReactNode> | (() => ReactNode);
71
+ }
72
+
73
+ /**
74
+ * Copyright (c) Corinvo, LLC. and affiliates.
75
+ *
76
+ * This source code is licensed under the MIT license found in the
77
+ * LICENSE file in the root directory of this source tree.
78
+ *
79
+ */
80
+
81
+ declare const Else: FC<ElseProps>;
82
+
83
+ type AppleButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
84
+ children?: ReactNode;
85
+ iconPosition?: 'left' | 'right';
86
+ showIcon?: boolean;
87
+ iconSize?: number;
88
+ disabled?: boolean;
89
+ };
90
+
91
+ /**
92
+ * Copyright (c) Corinvo, LLC. and affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ *
97
+ */
98
+
99
+ declare const AppleButton: FC<AppleButtonProps>;
100
+
101
+ type AtlassianButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
102
+ children?: ReactNode;
103
+ iconPosition?: 'left' | 'right';
104
+ showIcon?: boolean;
105
+ iconSize?: number;
106
+ disabled?: boolean;
107
+ };
108
+
109
+ /**
110
+ * Copyright (c) Corinvo, LLC. and affiliates.
111
+ *
112
+ * This source code is licensed under the MIT license found in the
113
+ * LICENSE file in the root directory of this source tree.
114
+ *
115
+ */
116
+
117
+ declare const AtlassianButton: FC<AtlassianButtonProps>;
118
+
119
+ type BitbucketButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
120
+ children?: ReactNode;
121
+ iconPosition?: 'left' | 'right';
122
+ showIcon?: boolean;
123
+ iconSize?: number;
124
+ disabled?: boolean;
125
+ };
126
+
127
+ /**
128
+ * Copyright (c) Corinvo, LLC. and affiliates.
129
+ *
130
+ * This source code is licensed under the MIT license found in the
131
+ * LICENSE file in the root directory of this source tree.
132
+ *
133
+ */
134
+
135
+ declare const BitbucketButton: FC<BitbucketButtonProps>;
136
+
137
+ type DiscordButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
138
+ children?: ReactNode;
139
+ iconPosition?: 'left' | 'right';
140
+ showIcon?: boolean;
141
+ iconSize?: number;
142
+ disabled?: boolean;
143
+ };
144
+
145
+ /**
146
+ * Copyright (c) Corinvo, LLC. and affiliates.
147
+ *
148
+ * This source code is licensed under the MIT license found in the
149
+ * LICENSE file in the root directory of this source tree.
150
+ *
151
+ */
152
+
153
+ declare const DiscordButton: FC<DiscordButtonProps>;
154
+
155
+ type DropboxButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
156
+ children?: ReactNode;
157
+ iconPosition?: 'left' | 'right';
158
+ showIcon?: boolean;
159
+ iconSize?: number;
160
+ disabled?: boolean;
161
+ };
162
+
163
+ /**
164
+ * Copyright (c) Corinvo, LLC. and affiliates.
165
+ *
166
+ * This source code is licensed under the MIT license found in the
167
+ * LICENSE file in the root directory of this source tree.
168
+ *
169
+ */
170
+
171
+ declare const DropboxButton: FC<DropboxButtonProps>;
172
+
173
+ type FacebookButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
174
+ children?: ReactNode;
175
+ iconPosition?: 'left' | 'right';
176
+ showIcon?: boolean;
177
+ iconSize?: number;
178
+ disabled?: boolean;
179
+ };
180
+
181
+ /**
182
+ * Copyright (c) Corinvo, LLC. and affiliates.
183
+ *
184
+ * This source code is licensed under the MIT license found in the
185
+ * LICENSE file in the root directory of this source tree.
186
+ *
187
+ */
188
+
189
+ declare const FacebookButton: FC<FacebookButtonProps>;
190
+
191
+ type GitHubButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
192
+ children?: ReactNode;
193
+ iconPosition?: 'left' | 'right';
194
+ showIcon?: boolean;
195
+ iconSize?: number;
196
+ disabled?: boolean;
197
+ };
198
+
199
+ /**
200
+ * Copyright (c) Corinvo, LLC. and affiliates.
201
+ *
202
+ * This source code is licensed under the MIT license found in the
203
+ * LICENSE file in the root directory of this source tree.
204
+ *
205
+ */
206
+
207
+ declare const GitHubButton: FC<GitHubButtonProps>;
208
+
209
+ type GitLabButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
210
+ children?: ReactNode;
211
+ iconPosition?: 'left' | 'right';
212
+ showIcon?: boolean;
213
+ iconSize?: number;
214
+ disabled?: boolean;
215
+ };
216
+
217
+ /**
218
+ * Copyright (c) Corinvo, LLC. and affiliates.
219
+ *
220
+ * This source code is licensed under the MIT license found in the
221
+ * LICENSE file in the root directory of this source tree.
222
+ *
223
+ */
224
+
225
+ declare const GitLabButton: FC<GitLabButtonProps>;
226
+
227
+ type GoogleButtonProps<T extends ElementType = 'button'> = PrimitiveProps<T> & {
228
+ children?: ReactNode;
229
+ iconPosition?: 'left' | 'right';
230
+ showIcon?: boolean;
231
+ iconSize?: number;
232
+ disabled?: boolean;
233
+ };
234
+
235
+ /**
236
+ * Copyright (c) Corinvo, LLC. and affiliates.
237
+ *
238
+ * This source code is licensed under the MIT license found in the
239
+ * LICENSE file in the root directory of this source tree.
240
+ *
241
+ */
242
+
243
+ declare const GoogleButton: FC<GoogleButtonProps>;
244
+
245
+ export { AppleButton, type AppleButtonProps, AtlassianButton, type AtlassianButtonProps, BitbucketButton, type BitbucketButtonProps, DiscordButton, type DiscordButtonProps, DropboxButton, type DropboxButtonProps, Else, type ElseProps, FacebookButton, type FacebookButtonProps, GitHubButton, type GitHubButtonProps, GitLabButton, type GitLabButtonProps, GoogleButton, type GoogleButtonProps, If, type IfProps, Primitive };