@arkyn/components 1.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/bundle.js +1348 -0
- package/dist/bundle.umd.cjs +32 -0
- package/dist/components/Badge/index.d.ts +5 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Badge/index.js +8 -0
- package/dist/components/Breadcrumb/index.d.ts +6 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.js +18 -0
- package/dist/components/Button/index.d.ts +5 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +9 -0
- package/dist/components/Divider/index.d.ts +5 -0
- package/dist/components/Divider/index.d.ts.map +1 -0
- package/dist/components/Divider/index.js +8 -0
- package/dist/components/Form/FormController/index.d.ts +6 -0
- package/dist/components/Form/FormController/index.d.ts.map +1 -0
- package/dist/components/Form/FormController/index.js +17 -0
- package/dist/components/Form/FormError/index.d.ts +4 -0
- package/dist/components/Form/FormError/index.d.ts.map +1 -0
- package/dist/components/Form/FormError/index.js +10 -0
- package/dist/components/Form/FormLabel/index.d.ts +5 -0
- package/dist/components/Form/FormLabel/index.d.ts.map +1 -0
- package/dist/components/Form/FormLabel/index.js +9 -0
- package/dist/components/Form/index.d.ts +4 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/Form/index.js +3 -0
- package/dist/components/IconButton/index.d.ts +5 -0
- package/dist/components/IconButton/index.d.ts.map +1 -0
- package/dist/components/IconButton/index.js +15 -0
- package/dist/components/Input/CpfCpnjInput/getConfig.d.ts +308 -0
- package/dist/components/Input/CpfCpnjInput/getConfig.d.ts.map +1 -0
- package/dist/components/Input/CpfCpnjInput/getConfig.js +35 -0
- package/dist/components/Input/CpfCpnjInput/index.d.ts +4 -0
- package/dist/components/Input/CpfCpnjInput/index.d.ts.map +1 -0
- package/dist/components/Input/CpfCpnjInput/index.js +47 -0
- package/dist/components/Input/CpfCpnjInput/utils.d.ts +10 -0
- package/dist/components/Input/CpfCpnjInput/utils.d.ts.map +1 -0
- package/dist/components/Input/CpfCpnjInput/utils.js +24 -0
- package/dist/components/Input/CurrencyInput/getConfig.d.ts +309 -0
- package/dist/components/Input/CurrencyInput/getConfig.d.ts.map +1 -0
- package/dist/components/Input/CurrencyInput/getConfig.js +37 -0
- package/dist/components/Input/CurrencyInput/index.d.ts +4 -0
- package/dist/components/Input/CurrencyInput/index.d.ts.map +1 -0
- package/dist/components/Input/CurrencyInput/index.js +41 -0
- package/dist/components/Input/CurrencyInput/utils.d.ts +11 -0
- package/dist/components/Input/CurrencyInput/utils.d.ts.map +1 -0
- package/dist/components/Input/CurrencyInput/utils.js +39 -0
- package/dist/components/Input/MaskInput/getConfig.d.ts +312 -0
- package/dist/components/Input/MaskInput/getConfig.d.ts.map +1 -0
- package/dist/components/Input/MaskInput/getConfig.js +36 -0
- package/dist/components/Input/MaskInput/index.d.ts +4 -0
- package/dist/components/Input/MaskInput/index.d.ts.map +1 -0
- package/dist/components/Input/MaskInput/index.js +42 -0
- package/dist/components/Input/SimpleInput/getConfig.d.ts +308 -0
- package/dist/components/Input/SimpleInput/getConfig.d.ts.map +1 -0
- package/dist/components/Input/SimpleInput/getConfig.js +35 -0
- package/dist/components/Input/SimpleInput/index.d.ts +4 -0
- package/dist/components/Input/SimpleInput/index.d.ts.map +1 -0
- package/dist/components/Input/SimpleInput/index.js +34 -0
- package/dist/components/Input/index.d.ts +5 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +16 -0
- package/dist/components/Input/utils/morpheme.d.ts +4 -0
- package/dist/components/Input/utils/morpheme.d.ts.map +1 -0
- package/dist/components/Input/utils/morpheme.js +10 -0
- package/dist/components/Modal/Container/index.d.ts +10 -0
- package/dist/components/Modal/Container/index.d.ts.map +1 -0
- package/dist/components/Modal/Container/index.js +12 -0
- package/dist/components/Modal/Footer/index.d.ts +5 -0
- package/dist/components/Modal/Footer/index.d.ts.map +1 -0
- package/dist/components/Modal/Footer/index.js +8 -0
- package/dist/components/Modal/Header/index.d.ts +5 -0
- package/dist/components/Modal/Header/index.d.ts.map +1 -0
- package/dist/components/Modal/Header/index.js +13 -0
- package/dist/components/Modal/index.d.ts +9 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/index.js +4 -0
- package/dist/components/Tooltip/index.d.ts +5 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.js +7 -0
- package/dist/config/buildBadgeConfig.d.ts +274 -0
- package/dist/config/buildBadgeConfig.d.ts.map +1 -0
- package/dist/config/buildBadgeConfig.js +15 -0
- package/dist/config/buildBreadcrumLinkConfig.d.ts +288 -0
- package/dist/config/buildBreadcrumLinkConfig.d.ts.map +1 -0
- package/dist/config/buildBreadcrumLinkConfig.js +14 -0
- package/dist/config/buildBreadcrumbConfig.d.ts +272 -0
- package/dist/config/buildBreadcrumbConfig.d.ts.map +1 -0
- package/dist/config/buildBreadcrumbConfig.js +6 -0
- package/dist/config/buildButtonConfig.d.ts +286 -0
- package/dist/config/buildButtonConfig.d.ts.map +1 -0
- package/dist/config/buildButtonConfig.js +18 -0
- package/dist/config/buildFormLabelConfig.d.ts +274 -0
- package/dist/config/buildFormLabelConfig.d.ts.map +1 -0
- package/dist/config/buildFormLabelConfig.js +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/style.css +1 -0
- package/dist/utils/generateIcon.d.ts +4 -0
- package/dist/utils/generateIcon.d.ts.map +1 -0
- package/dist/utils/generateIcon.js +7 -0
- package/package.json +30 -0
- package/src/components/Badge/index.tsx +18 -0
- package/src/components/Badge/styles.css +119 -0
- package/src/components/Breadcrumb/index.tsx +35 -0
- package/src/components/Breadcrumb/styles.css +39 -0
- package/src/components/Button/index.tsx +27 -0
- package/src/components/Button/styles.css +363 -0
- package/src/components/Divider/index.tsx +17 -0
- package/src/components/Divider/styles.css +17 -0
- package/src/components/Form/FormController/index.tsx +36 -0
- package/src/components/Form/FormController/styles.css +5 -0
- package/src/components/Form/FormError/index.tsx +11 -0
- package/src/components/Form/FormError/styles.css +6 -0
- package/src/components/Form/FormLabel/index.tsx +13 -0
- package/src/components/Form/FormLabel/styles.css +15 -0
- package/src/components/Form/index.ts +3 -0
- package/src/components/IconButton/index.tsx +44 -0
- package/src/components/IconButton/styles.css +318 -0
- package/src/components/Input/CpfCpnjInput/getConfig.tsx +60 -0
- package/src/components/Input/CpfCpnjInput/index.tsx +112 -0
- package/src/components/Input/CpfCpnjInput/utils.ts +30 -0
- package/src/components/Input/CurrencyInput/getConfig.tsx +64 -0
- package/src/components/Input/CurrencyInput/index.tsx +103 -0
- package/src/components/Input/CurrencyInput/utils.ts +56 -0
- package/src/components/Input/MaskInput/getConfig.tsx +62 -0
- package/src/components/Input/MaskInput/index.tsx +89 -0
- package/src/components/Input/SimpleInput/getConfig.tsx +60 -0
- package/src/components/Input/SimpleInput/index.tsx +87 -0
- package/src/components/Input/index.tsx +17 -0
- package/src/components/Input/styles.css +223 -0
- package/src/components/Input/utils/morpheme.tsx +19 -0
- package/src/components/Modal/Container/index.tsx +53 -0
- package/src/components/Modal/Container/styles.css +35 -0
- package/src/components/Modal/Footer/index.tsx +12 -0
- package/src/components/Modal/Footer/styles.css +27 -0
- package/src/components/Modal/Header/index.tsx +26 -0
- package/src/components/Modal/Header/styles.css +36 -0
- package/src/components/Modal/index.ts +5 -0
- package/src/components/Tooltip/index.tsx +26 -0
- package/src/components/Tooltip/styles.css +112 -0
- package/src/config/buildBadgeConfig.tsx +32 -0
- package/src/config/buildBreadcrumLinkConfig.tsx +27 -0
- package/src/config/buildBreadcrumbConfig.tsx +12 -0
- package/src/config/buildButtonConfig.tsx +38 -0
- package/src/config/buildFormLabelConfig.tsx +17 -0
- package/src/index.ts +16 -0
- package/src/utils/generateIcon.tsx +9 -0
- package/tsconfig.json +23 -0
- package/vite.config.js +25 -0
@@ -0,0 +1,363 @@
|
|
1
|
+
/* BASE */
|
2
|
+
.arkyn_button {
|
3
|
+
background: transparent;
|
4
|
+
border: 1px solid transparent;
|
5
|
+
outline: 1px solid transparent;
|
6
|
+
position: relative;
|
7
|
+
transition: 0.15s all ease-out;
|
8
|
+
}
|
9
|
+
|
10
|
+
.arkyn_button:hover {
|
11
|
+
cursor: pointer;
|
12
|
+
}
|
13
|
+
|
14
|
+
.arkyn_button:disabled {
|
15
|
+
cursor: not-allowed;
|
16
|
+
opacity: 0.5;
|
17
|
+
}
|
18
|
+
|
19
|
+
.arkyn_button .content {
|
20
|
+
display: flex;
|
21
|
+
align-items: center;
|
22
|
+
justify-content: center;
|
23
|
+
white-space: nowrap;
|
24
|
+
}
|
25
|
+
|
26
|
+
/* VARIANTS */
|
27
|
+
.arkyn_button.solid {
|
28
|
+
color: #fff;
|
29
|
+
}
|
30
|
+
|
31
|
+
.arkyn_button.solid:disabled {
|
32
|
+
opacity: 0.4;
|
33
|
+
}
|
34
|
+
|
35
|
+
.arkyn_button.solid.primary {
|
36
|
+
background-color: var(--primary-500);
|
37
|
+
}
|
38
|
+
|
39
|
+
.arkyn_button.solid.primary:hover {
|
40
|
+
background-color: var(--primary-400);
|
41
|
+
}
|
42
|
+
|
43
|
+
.arkyn_button.solid.primary:disabled {
|
44
|
+
background-color: var(--primary-400);
|
45
|
+
}
|
46
|
+
|
47
|
+
.arkyn_button.solid.danger {
|
48
|
+
background-color: var(--danger-600);
|
49
|
+
}
|
50
|
+
|
51
|
+
.arkyn_button.solid.danger:hover {
|
52
|
+
background-color: var(--danger-500);
|
53
|
+
}
|
54
|
+
|
55
|
+
.arkyn_button.solid.danger:disabled {
|
56
|
+
background-color: var(--danger-500);
|
57
|
+
}
|
58
|
+
|
59
|
+
.arkyn_button.solid.success {
|
60
|
+
background-color: var(--success-500);
|
61
|
+
}
|
62
|
+
|
63
|
+
.arkyn_button.solid.success:hover {
|
64
|
+
background-color: var(--success-400);
|
65
|
+
}
|
66
|
+
|
67
|
+
.arkyn_button.solid.success:disabled {
|
68
|
+
background-color: var(--success-400);
|
69
|
+
}
|
70
|
+
|
71
|
+
.arkyn_button.solid.warning {
|
72
|
+
background-color: var(--warning-600);
|
73
|
+
}
|
74
|
+
|
75
|
+
.arkyn_button.solid.warning:hover {
|
76
|
+
background-color: var(--warning-500);
|
77
|
+
}
|
78
|
+
|
79
|
+
.arkyn_button.solid.warning:disabled {
|
80
|
+
background-color: var(--warning-500);
|
81
|
+
}
|
82
|
+
|
83
|
+
.arkyn_button.outline {
|
84
|
+
border-color: var(--secondary-300);
|
85
|
+
}
|
86
|
+
|
87
|
+
.arkyn_button.outline:hover {
|
88
|
+
border-color: var(--secondary-200);
|
89
|
+
}
|
90
|
+
|
91
|
+
.arkyn_button.outline:disabled {
|
92
|
+
border-color: var(--secondary-200);
|
93
|
+
}
|
94
|
+
|
95
|
+
.arkyn_button.outline.primary {
|
96
|
+
color: var(--primary-500);
|
97
|
+
}
|
98
|
+
|
99
|
+
.arkyn_button.outline.primary:hover {
|
100
|
+
color: var(--primary-400);
|
101
|
+
}
|
102
|
+
|
103
|
+
.arkyn_button.outline.primary:disabled {
|
104
|
+
color: var(--primary-400);
|
105
|
+
}
|
106
|
+
|
107
|
+
.arkyn_button.outline.danger {
|
108
|
+
color: var(--danger-600);
|
109
|
+
}
|
110
|
+
|
111
|
+
.arkyn_button.outline.danger:hover {
|
112
|
+
color: var(--danger-500);
|
113
|
+
}
|
114
|
+
|
115
|
+
.arkyn_button.outline.danger:disabled {
|
116
|
+
color: var(--danger-500);
|
117
|
+
}
|
118
|
+
|
119
|
+
.arkyn_button.outline.success {
|
120
|
+
color: var(--success-500);
|
121
|
+
}
|
122
|
+
|
123
|
+
.arkyn_button.outline.success:hover {
|
124
|
+
color: var(--success-400);
|
125
|
+
}
|
126
|
+
|
127
|
+
.arkyn_button.outline.success:disabled {
|
128
|
+
color: var(--success-400);
|
129
|
+
}
|
130
|
+
|
131
|
+
.arkyn_button.outline.warning {
|
132
|
+
color: var(--warning-600);
|
133
|
+
}
|
134
|
+
|
135
|
+
.arkyn_button.outline.warning:hover {
|
136
|
+
color: var(--warning-500);
|
137
|
+
}
|
138
|
+
|
139
|
+
.arkyn_button.outline.warning:disabled {
|
140
|
+
color: var(--warning-500);
|
141
|
+
}
|
142
|
+
|
143
|
+
.arkyn_button.ghost:disabled {
|
144
|
+
opacity: 0.4;
|
145
|
+
}
|
146
|
+
|
147
|
+
.arkyn_button.ghost.primary {
|
148
|
+
color: var(--primary-500);
|
149
|
+
background-color: var(--primary-100);
|
150
|
+
}
|
151
|
+
|
152
|
+
.arkyn_button.ghost.primary:hover {
|
153
|
+
color: var(--primary-400);
|
154
|
+
background-color: var(--primary-50);
|
155
|
+
}
|
156
|
+
|
157
|
+
.arkyn_button.ghost.primary:disabled {
|
158
|
+
color: var(--primary-400);
|
159
|
+
background-color: var(--primary-50);
|
160
|
+
}
|
161
|
+
|
162
|
+
.arkyn_button.ghost.danger {
|
163
|
+
color: var(--danger-600);
|
164
|
+
background-color: var(--danger-100);
|
165
|
+
}
|
166
|
+
|
167
|
+
.arkyn_button.ghost.danger:hover {
|
168
|
+
color: var(--danger-500);
|
169
|
+
background-color: var(--danger-50);
|
170
|
+
}
|
171
|
+
|
172
|
+
.arkyn_button.ghost.danger:disabled {
|
173
|
+
color: var(--danger-500);
|
174
|
+
background-color: var(--danger-50);
|
175
|
+
}
|
176
|
+
|
177
|
+
.arkyn_button.ghost.success {
|
178
|
+
color: var(--success-500);
|
179
|
+
background-color: var(--success-100);
|
180
|
+
}
|
181
|
+
|
182
|
+
.arkyn_button.ghost.success:hover {
|
183
|
+
color: var(--success-400);
|
184
|
+
background-color: var(--success-50);
|
185
|
+
}
|
186
|
+
|
187
|
+
.arkyn_button.ghost.success:disabled {
|
188
|
+
color: var(--success-400);
|
189
|
+
background-color: var(--success-50);
|
190
|
+
}
|
191
|
+
|
192
|
+
.arkyn_button.ghost.warning {
|
193
|
+
color: var(--warning-600);
|
194
|
+
background-color: var(--warning-100);
|
195
|
+
}
|
196
|
+
|
197
|
+
.arkyn_button.ghost.warning:hover {
|
198
|
+
color: var(--warning-500);
|
199
|
+
background-color: var(--warning-50);
|
200
|
+
}
|
201
|
+
|
202
|
+
.arkyn_button.ghost.warning:disabled {
|
203
|
+
color: var(--warning-500);
|
204
|
+
background-color: var(--warning-50);
|
205
|
+
}
|
206
|
+
|
207
|
+
.arkyn_button.invisible:disabled {
|
208
|
+
opacity: 0.4;
|
209
|
+
}
|
210
|
+
|
211
|
+
.arkyn_button.invisible.primary {
|
212
|
+
color: var(--primary-500);
|
213
|
+
}
|
214
|
+
|
215
|
+
.arkyn_button.invisible.primary:hover {
|
216
|
+
color: var(--primary-400);
|
217
|
+
}
|
218
|
+
|
219
|
+
.arkyn_button.invisible.primary:disabled {
|
220
|
+
color: var(--primary-400);
|
221
|
+
}
|
222
|
+
|
223
|
+
.arkyn_button.invisible.danger {
|
224
|
+
color: var(--danger-600);
|
225
|
+
}
|
226
|
+
|
227
|
+
.arkyn_button.invisible.danger:hover {
|
228
|
+
color: var(--danger-500);
|
229
|
+
}
|
230
|
+
|
231
|
+
.arkyn_button.invisible.danger:disabled {
|
232
|
+
color: var(--danger-500);
|
233
|
+
}
|
234
|
+
|
235
|
+
.arkyn_button.invisible.success {
|
236
|
+
color: var(--success-500);
|
237
|
+
}
|
238
|
+
|
239
|
+
.arkyn_button.invisible.success:hover {
|
240
|
+
color: var(--success-400);
|
241
|
+
}
|
242
|
+
|
243
|
+
.arkyn_button.invisible.success:disabled {
|
244
|
+
color: var(--success-400);
|
245
|
+
}
|
246
|
+
|
247
|
+
.arkyn_button.invisible.warning {
|
248
|
+
color: var(--warning-600);
|
249
|
+
}
|
250
|
+
|
251
|
+
.arkyn_button.invisible.warning:hover {
|
252
|
+
color: var(--warning-500);
|
253
|
+
}
|
254
|
+
|
255
|
+
.arkyn_button.invisible.warning:disabled {
|
256
|
+
color: var(--warning-500);
|
257
|
+
}
|
258
|
+
|
259
|
+
/* SIZE */
|
260
|
+
.arkyn_button.lg {
|
261
|
+
font-weight: 600;
|
262
|
+
font-size: 14px;
|
263
|
+
line-height: 14px;
|
264
|
+
|
265
|
+
border-radius: 6px;
|
266
|
+
padding: 0px 20px;
|
267
|
+
height: 44px;
|
268
|
+
}
|
269
|
+
|
270
|
+
.arkyn_button.lg .content,
|
271
|
+
.arkyn_button.lg .spinner {
|
272
|
+
gap: 16px;
|
273
|
+
}
|
274
|
+
|
275
|
+
.arkyn_button.md {
|
276
|
+
font-weight: 600;
|
277
|
+
font-size: 14px;
|
278
|
+
line-height: 14px;
|
279
|
+
|
280
|
+
border-radius: 6px;
|
281
|
+
gap: 16px;
|
282
|
+
padding: 0px 16px;
|
283
|
+
height: 40px;
|
284
|
+
}
|
285
|
+
|
286
|
+
.arkyn_button.md .content,
|
287
|
+
.arkyn_button.md .spinner {
|
288
|
+
gap: 14px;
|
289
|
+
}
|
290
|
+
|
291
|
+
.arkyn_button.sm {
|
292
|
+
font-weight: 600;
|
293
|
+
font-size: 12px;
|
294
|
+
line-height: 12px;
|
295
|
+
|
296
|
+
border-radius: 6px;
|
297
|
+
padding: 0px 16px;
|
298
|
+
height: 32px;
|
299
|
+
}
|
300
|
+
|
301
|
+
.arkyn_button.sm .content,
|
302
|
+
.arkyn_button.sm .spinner {
|
303
|
+
gap: 12px;
|
304
|
+
}
|
305
|
+
|
306
|
+
.arkyn_button.xs {
|
307
|
+
font-weight: 600;
|
308
|
+
font-size: 10px;
|
309
|
+
line-height: 10px;
|
310
|
+
|
311
|
+
border-radius: 4px;
|
312
|
+
padding: 0px 16px;
|
313
|
+
height: 24px;
|
314
|
+
}
|
315
|
+
|
316
|
+
.arkyn_button.xs .content,
|
317
|
+
.arkyn_button.xs .spinner {
|
318
|
+
gap: 8px;
|
319
|
+
}
|
320
|
+
|
321
|
+
/* SPIN */
|
322
|
+
.arkyn_button .spinner {
|
323
|
+
display: flex;
|
324
|
+
align-items: center;
|
325
|
+
justify-content: center;
|
326
|
+
|
327
|
+
white-space: nowrap;
|
328
|
+
opacity: 0;
|
329
|
+
}
|
330
|
+
|
331
|
+
.arkyn_button .spinner > svg {
|
332
|
+
animation: spin 2s linear infinite;
|
333
|
+
}
|
334
|
+
|
335
|
+
.arkyn_button.loading_text_false .spinner {
|
336
|
+
position: absolute;
|
337
|
+
left: 50%;
|
338
|
+
top: 50%;
|
339
|
+
transform: translate(-50%, -50%);
|
340
|
+
}
|
341
|
+
|
342
|
+
.arkyn_button.loading_text_true .spinner {
|
343
|
+
max-height: 0px;
|
344
|
+
}
|
345
|
+
|
346
|
+
.arkyn_button.loading_true .content {
|
347
|
+
opacity: 0;
|
348
|
+
max-height: 0px;
|
349
|
+
}
|
350
|
+
|
351
|
+
.arkyn_button.loading_true .spinner {
|
352
|
+
opacity: 1;
|
353
|
+
max-height: unset;
|
354
|
+
}
|
355
|
+
|
356
|
+
@keyframes spin {
|
357
|
+
from {
|
358
|
+
transform: rotate(0deg);
|
359
|
+
}
|
360
|
+
to {
|
361
|
+
transform: rotate(360deg);
|
362
|
+
}
|
363
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { DividerProps } from "@arkyn/types";
|
2
|
+
|
3
|
+
import "./styles.css";
|
4
|
+
|
5
|
+
function Divider(args: DividerProps) {
|
6
|
+
const {
|
7
|
+
className: baseClassName,
|
8
|
+
orientation = "horizontal",
|
9
|
+
...rest
|
10
|
+
} = args;
|
11
|
+
|
12
|
+
const className = `arkyn_divider ${orientation} ${baseClassName}`;
|
13
|
+
|
14
|
+
return <div className={className} {...rest} />;
|
15
|
+
}
|
16
|
+
|
17
|
+
export { Divider };
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.arkyn_divider {
|
2
|
+
display: block;
|
3
|
+
flex: 1;
|
4
|
+
background-color: var(--secondary-300);
|
5
|
+
}
|
6
|
+
|
7
|
+
.arkyn_divider.horizontal {
|
8
|
+
width: 100%;
|
9
|
+
min-height: 1px;
|
10
|
+
max-height: 1px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.arkyn_divider.vertical {
|
14
|
+
height: 100%;
|
15
|
+
min-width: 1px;
|
16
|
+
max-width: 1px;
|
17
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import type {
|
2
|
+
FormControllerContextProps,
|
3
|
+
FormControllerProps,
|
4
|
+
} from "@arkyn/types";
|
5
|
+
|
6
|
+
import { useActionData } from "@remix-run/react";
|
7
|
+
import { createContext, useContext, useId, useRef } from "react";
|
8
|
+
|
9
|
+
import "./styles.css";
|
10
|
+
|
11
|
+
const FormControllerContext = createContext({} as FormControllerContextProps);
|
12
|
+
|
13
|
+
function FormController({ children, ...rest }: FormControllerProps) {
|
14
|
+
const actionData = useActionData<any>();
|
15
|
+
|
16
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
17
|
+
|
18
|
+
const name = inputRef.current?.name || "";
|
19
|
+
const error = actionData?.fieldErrors?.[name] || null;
|
20
|
+
|
21
|
+
const id = useId();
|
22
|
+
|
23
|
+
return (
|
24
|
+
<FormControllerContext.Provider value={{ error, id, inputRef }}>
|
25
|
+
<section className="arkyn_form_controller" {...rest}>
|
26
|
+
{children}
|
27
|
+
</section>
|
28
|
+
</FormControllerContext.Provider>
|
29
|
+
);
|
30
|
+
}
|
31
|
+
|
32
|
+
function useFormController() {
|
33
|
+
return useContext(FormControllerContext);
|
34
|
+
}
|
35
|
+
|
36
|
+
export { FormController, useFormController };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { useFormController } from "../FormController";
|
2
|
+
|
3
|
+
import "./styles.css";
|
4
|
+
|
5
|
+
function FormError() {
|
6
|
+
const { error } = useFormController();
|
7
|
+
if (!error) return <></>;
|
8
|
+
return <strong className="arkyn_form_error">{error}</strong>;
|
9
|
+
}
|
10
|
+
|
11
|
+
export { FormError };
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { FormLabelProps } from "@arkyn/types";
|
2
|
+
|
3
|
+
import { buildFormLabelConfig } from "../../../config/buildFormLabelConfig";
|
4
|
+
import { useFormController } from "../FormController";
|
5
|
+
|
6
|
+
import "./styles.css";
|
7
|
+
|
8
|
+
function FormLabel(props: FormLabelProps) {
|
9
|
+
const { id } = useFormController();
|
10
|
+
return <label {...buildFormLabelConfig(props)} htmlFor={id} />;
|
11
|
+
}
|
12
|
+
|
13
|
+
export { FormLabel };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.arkyn_form_label {
|
2
|
+
color: var(--secondary-700);
|
3
|
+
font-size: 14px;
|
4
|
+
font-weight: 600;
|
5
|
+
line-height: 19.07px;
|
6
|
+
}
|
7
|
+
|
8
|
+
.arkyn_form_label.show-asterisk::before {
|
9
|
+
content: "* ";
|
10
|
+
font-size: 12px;
|
11
|
+
font-weight: 600;
|
12
|
+
line-height: 16.34px;
|
13
|
+
text-align: left;
|
14
|
+
color: var(--danger-600);
|
15
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import type { IconButtonProps } from "@arkyn/types";
|
2
|
+
import { Loader2 } from "lucide-react";
|
3
|
+
|
4
|
+
import "./styles.css";
|
5
|
+
|
6
|
+
const iconSize = {
|
7
|
+
xs: 12,
|
8
|
+
sm: 16,
|
9
|
+
md: 20,
|
10
|
+
lg: 24,
|
11
|
+
};
|
12
|
+
|
13
|
+
function IconButton(args: IconButtonProps) {
|
14
|
+
const {
|
15
|
+
isLoading = false,
|
16
|
+
scheme = "primary",
|
17
|
+
variant = "solid",
|
18
|
+
size = "md",
|
19
|
+
icon: Icon,
|
20
|
+
disabled,
|
21
|
+
className: baseClassName = "",
|
22
|
+
...rest
|
23
|
+
} = args;
|
24
|
+
|
25
|
+
const className = `arkyn_icon_button ${variant} ${scheme} ${size} loading_${isLoading} ${baseClassName}`;
|
26
|
+
|
27
|
+
return (
|
28
|
+
<button
|
29
|
+
disabled={disabled || isLoading}
|
30
|
+
className={className.trim()}
|
31
|
+
{...rest}
|
32
|
+
>
|
33
|
+
<div className="spinner">
|
34
|
+
<Loader2 size={iconSize[size]} strokeWidth={2.5} />
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div className={"content " + size}>
|
38
|
+
<Icon size={iconSize[size]} strokeWidth={2.5} />
|
39
|
+
</div>
|
40
|
+
</button>
|
41
|
+
);
|
42
|
+
}
|
43
|
+
|
44
|
+
export { IconButton };
|