@delightui/components 0.1.149 → 0.1.151
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/cjs/components/atoms/Button/Button.contants.d.ts +2 -0
- package/dist/cjs/components/atoms/Button/Button.types.d.ts +6 -0
- package/dist/cjs/components/atoms/Button/ButtonExample.d.ts +3 -0
- package/dist/cjs/components/atoms/ToggleButton/ToggleButton.presenter.d.ts +1 -0
- package/dist/cjs/components/organisms/Dropzone/Dropzone.d.ts +2 -2
- package/dist/cjs/components/organisms/Dropzone/Dropzone.presenter.d.ts +5 -4
- package/dist/cjs/components/organisms/Dropzone/Dropzone.types.d.ts +16 -2
- package/dist/cjs/library.css +75 -44
- package/dist/cjs/library.js +3 -3
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.contants.d.ts +2 -0
- package/dist/esm/components/atoms/Button/Button.types.d.ts +6 -0
- package/dist/esm/components/atoms/Button/ButtonExample.d.ts +3 -0
- package/dist/esm/components/atoms/ToggleButton/ToggleButton.presenter.d.ts +1 -0
- package/dist/esm/components/organisms/Dropzone/Dropzone.d.ts +2 -2
- package/dist/esm/components/organisms/Dropzone/Dropzone.presenter.d.ts +5 -4
- package/dist/esm/components/organisms/Dropzone/Dropzone.types.d.ts +16 -2
- package/dist/esm/library.css +75 -44
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +23 -4
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ export type ButtonTypeEnum = 'Filled' | 'Outlined' | 'Ghost';
|
|
|
4
4
|
export type ButtonStyleEnum = 'Primary' | 'Secondary' | 'Destructive';
|
|
5
5
|
export type ButtonSizeEnum = 'Small' | 'Medium' | 'Large';
|
|
6
6
|
export type ButtonActionTypeEnum = 'button' | 'submit' | 'reset';
|
|
7
|
+
export type ButtonContentAlignmentEnum = 'Center' | 'SpaceBetween';
|
|
7
8
|
export type ButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, 'style'> & {
|
|
8
9
|
/**
|
|
9
10
|
* Appearance of the button.
|
|
@@ -56,4 +57,9 @@ export type ButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, 'style'> & {
|
|
|
56
57
|
* @default 'button'
|
|
57
58
|
*/
|
|
58
59
|
actionType?: ButtonActionTypeEnum;
|
|
60
|
+
/**
|
|
61
|
+
* Specifies alignment of the content like leading icon, content and trailing icon
|
|
62
|
+
* @default 'Center'
|
|
63
|
+
*/
|
|
64
|
+
alignContent?: ButtonContentAlignmentEnum;
|
|
59
65
|
};
|
|
@@ -264,6 +264,7 @@ declare const usePresenter: (props: ToggleButtonProps) => {
|
|
|
264
264
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
265
265
|
leadingIcon?: import("react").ReactNode;
|
|
266
266
|
trailingIcon?: import("react").ReactNode;
|
|
267
|
+
alignContent?: import("../Button/Button.types").ButtonContentAlignmentEnum;
|
|
267
268
|
initialValue?: boolean | undefined;
|
|
268
269
|
};
|
|
269
270
|
isChecked: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DropzoneContextType, DropzoneProps } from './Dropzone.types';
|
|
2
|
-
declare const Dropzone: (props: DropzoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare const useDropzoneContext: () => DropzoneContextType
|
|
2
|
+
declare const Dropzone: <T extends File | string = File>(props: DropzoneProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const useDropzoneContext: <T extends File | string = File>() => DropzoneContextType<T>;
|
|
4
4
|
export default Dropzone;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { DropzoneProps, DropzoneStatus } from './Dropzone.types';
|
|
2
|
-
declare const usePresenter: (props: DropzoneProps) => {
|
|
2
|
+
declare const usePresenter: <T extends File | string = File>(props: DropzoneProps<T>) => {
|
|
3
3
|
variantProps: {
|
|
4
4
|
'component-variant': string;
|
|
5
5
|
};
|
|
6
|
-
files:
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
files: T[] | undefined;
|
|
7
|
+
userSelectedFiles: File[] | undefined;
|
|
8
|
+
getRootProps: <T_1 extends import("react-dropzone").DropzoneRootProps>(props?: T_1) => T_1;
|
|
9
|
+
getInputProps: <T_1 extends import("react-dropzone").DropzoneInputProps>(props?: T_1) => T_1;
|
|
9
10
|
open: () => void;
|
|
10
11
|
empty: import("react").ReactNode;
|
|
11
12
|
loading: import("react").ReactNode;
|
|
@@ -2,6 +2,7 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
import { ButtonProps, IconButtonProps, TextProps } from '../../atoms';
|
|
3
3
|
import { ControlledFormComponentProps } from '../../molecules/FormField/FormField.types';
|
|
4
4
|
export type DropzoneStatus = 'Empty' | 'Loading' | 'Uploaded';
|
|
5
|
+
export type DropzoneAcceptTypeEnum = 'File' | 'URL';
|
|
5
6
|
/**
|
|
6
7
|
* Dropzone component props
|
|
7
8
|
* @param empty React.ReactNode - The empty state of the dropzone.
|
|
@@ -13,7 +14,7 @@ export type DropzoneStatus = 'Empty' | 'Loading' | 'Uploaded';
|
|
|
13
14
|
* @param onFilesUpload (file: File) => void - callback when files are selected
|
|
14
15
|
* @param onFilesReset () => void - callback when files are reset
|
|
15
16
|
*/
|
|
16
|
-
export type DropzoneProps = ControlledFormComponentProps<
|
|
17
|
+
export type DropzoneProps<T extends File | string = File> = ControlledFormComponentProps<T[]> & {
|
|
17
18
|
className?: string;
|
|
18
19
|
/**
|
|
19
20
|
* the view when no file is selected.
|
|
@@ -54,6 +55,18 @@ export type DropzoneProps = ControlledFormComponentProps<File[]> & {
|
|
|
54
55
|
* callback when files are reset
|
|
55
56
|
*/
|
|
56
57
|
onFilesReset?: () => void;
|
|
58
|
+
/**
|
|
59
|
+
* Callback when files are changed for dropzone
|
|
60
|
+
* @param Files updated selected files by user
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
handleFilesChange?: (Files: File[]) => void;
|
|
64
|
+
/**
|
|
65
|
+
* specifies what the component needs to accept as value
|
|
66
|
+
* sync this with Dropzone generics
|
|
67
|
+
* @default 'File'
|
|
68
|
+
*/
|
|
69
|
+
type?: 'File' | 'URL';
|
|
57
70
|
};
|
|
58
71
|
/**
|
|
59
72
|
* Dropzone context type
|
|
@@ -62,7 +75,7 @@ export type DropzoneProps = ControlledFormComponentProps<File[]> & {
|
|
|
62
75
|
* @param selectFile () => void - The function to call when the file is selected.
|
|
63
76
|
* @param resetUpload () => void - The function to call when the file is reset.
|
|
64
77
|
*/
|
|
65
|
-
export type DropzoneContextType = {
|
|
78
|
+
export type DropzoneContextType<T extends File | string = File> = {
|
|
66
79
|
/**
|
|
67
80
|
* The status of the dropzone.
|
|
68
81
|
*/
|
|
@@ -81,6 +94,7 @@ export type DropzoneContextType = {
|
|
|
81
94
|
accept: {
|
|
82
95
|
[key: string]: readonly string[];
|
|
83
96
|
};
|
|
97
|
+
value?: T[];
|
|
84
98
|
/**
|
|
85
99
|
* The function to call to open the file dialog.
|
|
86
100
|
*/
|
package/dist/esm/library.css
CHANGED
|
@@ -125,6 +125,52 @@
|
|
|
125
125
|
-o-object-fit: cover;
|
|
126
126
|
object-fit: cover;
|
|
127
127
|
}
|
|
128
|
+
.Text-module_text__qmiLT {
|
|
129
|
+
font-family: var(--text-font-family);
|
|
130
|
+
font-weight: var(--text-font-weight);
|
|
131
|
+
font-size: var(--text-font-size);
|
|
132
|
+
letter-spacing: var(--text-letter-spacing);
|
|
133
|
+
line-height: var(--text-line-height);
|
|
134
|
+
color: var(--text-color);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.Text-module_italic__b92M- {
|
|
138
|
+
font-style: italic;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.Text-module_underline__i8JpB {
|
|
142
|
+
-webkit-text-decoration: underline;
|
|
143
|
+
text-decoration: underline;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.Text-module_strikethrough__AHLhC {
|
|
147
|
+
-webkit-text-decoration: line-through;
|
|
148
|
+
text-decoration: line-through;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.Text-module_nowrap__JVMFL {
|
|
152
|
+
text-wrap: nowrap;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.Text-module_whiteSpaceNoWrap__GYqL2 {
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.Text-module_capitalize__r9qCk {
|
|
160
|
+
text-transform: capitalize;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.Text-module_upperCase__VCs2x {
|
|
164
|
+
text-transform: uppercase;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.Text-module_lowerCase__0T-7t {
|
|
168
|
+
text-transform: lowercase;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.Text-module_ellipsis__UXzJI {
|
|
172
|
+
text-overflow: ellipsis;
|
|
173
|
+
}
|
|
128
174
|
.Button-module_button__y6Gwz {
|
|
129
175
|
display: flex;
|
|
130
176
|
align-items: center;
|
|
@@ -164,7 +210,6 @@
|
|
|
164
210
|
color: var(--button-color);
|
|
165
211
|
}
|
|
166
212
|
.Button-module_button__y6Gwz .Button-module_content__IipV4 {
|
|
167
|
-
flex: 1;
|
|
168
213
|
display: flex;
|
|
169
214
|
justify-content: center;
|
|
170
215
|
justify-content: var(--button-content-justify-content, center);
|
|
@@ -201,51 +246,17 @@
|
|
|
201
246
|
.Button-module_button__y6Gwz:disabled {
|
|
202
247
|
cursor: not-allowed;
|
|
203
248
|
}
|
|
204
|
-
.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
font-size: var(--text-font-size);
|
|
208
|
-
letter-spacing: var(--text-letter-spacing);
|
|
209
|
-
line-height: var(--text-line-height);
|
|
210
|
-
color: var(--text-color);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.Text-module_italic__b92M- {
|
|
214
|
-
font-style: italic;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.Text-module_underline__i8JpB {
|
|
218
|
-
-webkit-text-decoration: underline;
|
|
219
|
-
text-decoration: underline;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.Text-module_strikethrough__AHLhC {
|
|
223
|
-
-webkit-text-decoration: line-through;
|
|
224
|
-
text-decoration: line-through;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.Text-module_nowrap__JVMFL {
|
|
228
|
-
text-wrap: nowrap;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.Text-module_whiteSpaceNoWrap__GYqL2 {
|
|
232
|
-
white-space: nowrap;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.Text-module_capitalize__r9qCk {
|
|
236
|
-
text-transform: capitalize;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.Text-module_upperCase__VCs2x {
|
|
240
|
-
text-transform: uppercase;
|
|
249
|
+
.Button-module_button__y6Gwz.Button-module_center__fnkix {
|
|
250
|
+
display: flex;
|
|
251
|
+
justify-content: center;
|
|
241
252
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
253
|
+
.Button-module_button__y6Gwz.Button-module_spaceBetween__OFllq {
|
|
254
|
+
display: flex;
|
|
255
|
+
justify-content: space-between;
|
|
245
256
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
257
|
+
.Button-module_button__y6Gwz.Button-module_spaceBetween__OFllq .Button-module_content__IipV4 {
|
|
258
|
+
display: flex;
|
|
259
|
+
flex: 1;
|
|
249
260
|
}
|
|
250
261
|
.Icon-module_icon__sUgmV {
|
|
251
262
|
--icon-size: fit-content;
|
|
@@ -317,6 +328,7 @@
|
|
|
317
328
|
--button-letter-spacing: var(--icon-button-letter-spacing);
|
|
318
329
|
--button-line-height: var(--icon-button-line-height);
|
|
319
330
|
}
|
|
331
|
+
@charset "UTF-8";
|
|
320
332
|
.Input-module_input__NAeHe {
|
|
321
333
|
display: flex;
|
|
322
334
|
align-items: center;
|
|
@@ -378,6 +390,25 @@
|
|
|
378
390
|
.Input-module_input__NAeHe .Input-module_disabled__6XebD {
|
|
379
391
|
--b: 100;
|
|
380
392
|
}
|
|
393
|
+
.Input-module_input__NAeHe .Input-module_inputElement__Tjw4v:-webkit-autofill,
|
|
394
|
+
.Input-module_input__NAeHe .Input-module_inputElement__Tjw4v:-webkit-autofill:hover,
|
|
395
|
+
.Input-module_input__NAeHe .Input-module_inputElement__Tjw4v:-webkit-autofill:focus,
|
|
396
|
+
.Input-module_input__NAeHe textarea.Input-module_inputElement__Tjw4v:-webkit-autofill,
|
|
397
|
+
.Input-module_input__NAeHe select.Input-module_inputElement__Tjw4v:-webkit-autofill {
|
|
398
|
+
/* Text color when autofilled */
|
|
399
|
+
-webkit-text-fill-color: var(--input-color);
|
|
400
|
+
/* Desired background color */
|
|
401
|
+
-webkit-box-shadow: 0 0 0px cal(var(--input-height)/2) var(--input-background-color) inset;
|
|
402
|
+
/* Prevent flicker */
|
|
403
|
+
-webkit-transition: background-color 5000s ease-in-out 0s;
|
|
404
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
405
|
+
/* Caret color so it’s visible */
|
|
406
|
+
caret-color: var(--input-color);
|
|
407
|
+
border-top-left-radius: var(--input-border-top-left-radius);
|
|
408
|
+
border-top-right-radius: var(--input-border-top-right-radius);
|
|
409
|
+
border-bottom-right-radius: var(--input-border-bottom-right-radius);
|
|
410
|
+
border-bottom-left-radius: var(--input-border-bottom-left-radius);
|
|
411
|
+
}
|
|
381
412
|
.Password-module_password__nk-zf.Password-module_password__nk-zf {
|
|
382
413
|
--input-opacity: var(--password-opacity);
|
|
383
414
|
--input-height: var(--password-height);
|