@randstad-uca/design-system 1.0.45 → 1.0.48
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/components/Button.d.ts +1 -1
- package/dist/components/DatePicker.d.ts +51 -13
- package/dist/components/File.d.ts +58 -0
- package/dist/components/Form.d.ts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1074 -167
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/stories/DatePicker.stories.d.ts +14 -0
- package/dist/stories/Form.stories.d.ts +7 -3
- package/dist/stories/UploadFile.stories.d.ts +83 -0
- package/dist/styles/forms.css +106 -107
- package/dist/utils/file-format.d.ts +3 -0
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -40,13 +40,27 @@ declare const _default: {
|
|
|
40
40
|
maxDate: {
|
|
41
41
|
control: string;
|
|
42
42
|
};
|
|
43
|
+
errorMessage: {
|
|
44
|
+
control: string;
|
|
45
|
+
};
|
|
46
|
+
helper: {
|
|
47
|
+
control: string;
|
|
48
|
+
};
|
|
49
|
+
helperAlign: {
|
|
50
|
+
control: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
options: string[];
|
|
54
|
+
};
|
|
43
55
|
};
|
|
44
56
|
};
|
|
45
57
|
export default _default;
|
|
46
58
|
export declare const Default: StoryFn;
|
|
47
59
|
export declare const WithoutClearButton: StoryFn;
|
|
48
60
|
export declare const WithDefaultValueAndRequired: StoryFn;
|
|
61
|
+
export declare const WithOptional: StoryFn;
|
|
49
62
|
export declare const Disabled: StoryFn;
|
|
50
63
|
export declare const WithError: StoryFn;
|
|
64
|
+
export declare const WithHelperAndError: StoryFn;
|
|
51
65
|
export declare const WithCustomWidth: StoryFn;
|
|
52
66
|
export declare const WithDateRange: StoryFn;
|
|
@@ -21,6 +21,9 @@ export interface FormProps {
|
|
|
21
21
|
maxLength?: number;
|
|
22
22
|
required?: boolean;
|
|
23
23
|
optional?: boolean;
|
|
24
|
+
heightTextArea?: string;
|
|
25
|
+
maxHeightTextArea?: string;
|
|
26
|
+
helperAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
24
27
|
}
|
|
25
28
|
declare const meta: Meta<FormProps>;
|
|
26
29
|
export default meta;
|
|
@@ -28,15 +31,16 @@ type Story = StoryObj<FormProps>;
|
|
|
28
31
|
export declare const Default: Story;
|
|
29
32
|
export declare const Filled: Story;
|
|
30
33
|
export declare const Disabled: Story;
|
|
31
|
-
export declare const
|
|
34
|
+
export declare const WithHelperCenter: Story;
|
|
32
35
|
export declare const WithError: Story;
|
|
33
|
-
export declare const
|
|
36
|
+
export declare const WithHelperLeftError: Story;
|
|
34
37
|
export declare const WithSuccess: Story;
|
|
35
38
|
export declare const WithIconLeft: Story;
|
|
36
39
|
export declare const WithIconRight: Story;
|
|
37
40
|
export declare const PasswordField: Story;
|
|
38
41
|
export declare const TextareaField: Story;
|
|
39
|
-
export declare const
|
|
42
|
+
export declare const TextareaWithHelperRight: Story;
|
|
43
|
+
export declare const TextareaWithHeightAndScroll: Story;
|
|
40
44
|
export declare const TextareaWithError: Story;
|
|
41
45
|
export declare const TextareaDisabled: Story;
|
|
42
46
|
export declare const Help: Story;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { StoryFn } from '@storybook/web-components';
|
|
2
|
+
import '../components/File';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
labelColor: {
|
|
12
|
+
control: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
buttonText: {
|
|
16
|
+
control: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
helper: {
|
|
20
|
+
control: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
helperAlign: {
|
|
24
|
+
control: string;
|
|
25
|
+
options: string[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
maxFiles: {
|
|
29
|
+
control: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
acceptedFileTypes: {
|
|
33
|
+
control: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
maxFileSize: {
|
|
37
|
+
control: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
disabled: {
|
|
41
|
+
control: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
error: {
|
|
45
|
+
control: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
errorMessage: {
|
|
49
|
+
control: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
required: {
|
|
53
|
+
control: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
optional: {
|
|
57
|
+
control: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
files: {
|
|
61
|
+
control: string;
|
|
62
|
+
description: string;
|
|
63
|
+
table: {
|
|
64
|
+
disable: boolean;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
onFilesChanged: {
|
|
68
|
+
action: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
actions: {
|
|
72
|
+
argTypesRegex: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export default _default;
|
|
76
|
+
export declare const Default: StoryFn;
|
|
77
|
+
export declare const RequiredField: StoryFn;
|
|
78
|
+
export declare const OptionalField: StoryFn;
|
|
79
|
+
export declare const WithHelperAndValidate: StoryFn;
|
|
80
|
+
export declare const MultipleFiles: StoryFn;
|
|
81
|
+
export declare const Disabled: StoryFn;
|
|
82
|
+
export declare const WithValue: StoryFn;
|
|
83
|
+
export declare const ErrorState: StoryFn;
|
package/dist/styles/forms.css
CHANGED
|
@@ -1,151 +1,150 @@
|
|
|
1
1
|
/* Base form styles */
|
|
2
2
|
.form {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 0.3rem;
|
|
6
|
+
font-family: 'Graphik', sans-serif;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/* Form labels */
|
|
10
10
|
.form-label {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
line-height: 25px;
|
|
13
|
+
font-weight: 400;
|
|
14
|
+
color: var(--secondary-color-80);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/* Form inputs */
|
|
18
18
|
.form-input {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
line-height: 30px;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
border: 1px solid var(--secondary-color-10);
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
outline: none;
|
|
25
|
+
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.form.error:not(.disabled) .form-input:hover {
|
|
29
|
-
|
|
29
|
+
box-shadow: 0px 0px 0px 4px #E00F0F1A;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.form:not(.disabled) .form-input:hover {
|
|
33
|
-
|
|
33
|
+
box-shadow: 0px 0px 0px 4px #0F19411A;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.form-input:focus {
|
|
37
|
-
|
|
37
|
+
border: 1px solid var(--primary-color);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.form.error .form-input {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
background-color: #FDF3F3;
|
|
42
|
+
border-color: #e3342f;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.form-input.success {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
border-color: #28a745;
|
|
47
|
+
background-color: #d4edda;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
input::placeholder {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
color: var(--secondary-color-40);
|
|
52
|
+
font-size: 16px;
|
|
53
|
+
line-height: 30px;
|
|
54
|
+
font-weight: 400;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/* Buttons inside forms */
|
|
58
58
|
.form-button {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
font-size: 16px;
|
|
60
|
+
padding: 10px 20px;
|
|
61
|
+
background-color: #007bff;
|
|
62
|
+
color: #ffffff;
|
|
63
|
+
border: none;
|
|
64
|
+
border-radius: 4px;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
transition: background-color 0.3s ease;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.helper-description {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
color: var(--secondary-color-40);
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
line-height: 25px;
|
|
73
|
+
margin: 0px;
|
|
74
|
+
color: var(--secondary-color-40);
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
.error-message {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
line-height: 25px;
|
|
80
|
+
color: var(--ui-negative);
|
|
81
|
+
margin: 0px;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
.toggle-password {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
background: none;
|
|
86
|
+
border: none;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
padding: 5px;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
.form-container {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
93
|
+
position: relative;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.input-with-button {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
position: relative;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.input-with-button input {
|
|
105
|
+
width: 100%;
|
|
106
|
+
padding-right: 40px; /* Espacio para el botón */
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.input-with-button button {
|
|
110
|
+
position: absolute;
|
|
111
|
+
right: 10px;
|
|
112
|
+
top: 50%;
|
|
113
|
+
transform: translateY(-50%); /* Siempre centrado verticalmente */
|
|
114
|
+
background: transparent;
|
|
115
|
+
border: none;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
width: 40px; /* Ajusta según necesites */
|
|
121
|
+
height: 40px; /* Asegura que el botón tenga un tamaño uniforme */
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.toggle-password randstad-icon {
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
max-width: 32px;
|
|
128
|
+
max-height: 32px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
textarea {
|
|
132
|
+
font-family: Graphik;
|
|
133
|
+
font-weight: 400;
|
|
134
|
+
font-size: 18px;
|
|
135
|
+
line-height: 30px;
|
|
136
|
+
letter-spacing: 0%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
textarea.form-input {
|
|
141
|
+
/* Estilos específicos para textarea */
|
|
142
|
+
min-height: 100px; /* Diferenciarlo del input */
|
|
143
|
+
resize: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.form.disabled textarea.form-input,
|
|
147
|
+
.form.disabled input.form-input {
|
|
148
|
+
background-color: #f5f5f5;
|
|
149
|
+
cursor: default;
|
|
150
|
+
}
|