@gitlab/ui 64.21.2 → 64.23.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/CHANGELOG.md +14 -0
- package/dist/components/base/form/form_fields/form_fields.js +2 -1
- package/dist/components/base/form/input_group_text/input_group_text.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +4 -4
- package/src/components/base/form/form_fields/form_fields.md +3 -0
- package/src/components/base/form/form_fields/form_fields.spec.js +9 -0
- package/src/components/base/form/form_fields/form_fields.stories.js +2 -1
- package/src/components/base/form/form_fields/form_fields.vue +2 -0
- package/src/components/base/form/input_group_text/input_group_text.scss +6 -0
- package/src/components/base/form/input_group_text/input_group_text.spec.js +5 -0
- package/src/components/base/form/input_group_text/input_group_text.vue +1 -1
- package/src/scss/components.scss +1 -0
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "64.
|
|
3
|
+
"version": "64.23.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@gitlab/eslint-plugin": "19.0.0",
|
|
92
92
|
"@gitlab/fonts": "^1.2.0",
|
|
93
93
|
"@gitlab/stylelint-config": "4.1.0",
|
|
94
|
-
"@gitlab/svgs": "3.
|
|
94
|
+
"@gitlab/svgs": "3.57.0",
|
|
95
95
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
96
96
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
97
97
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
"babel-loader": "^8.0.5",
|
|
119
119
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
120
120
|
"bootstrap": "4.6.2",
|
|
121
|
-
"cypress": "12.17.
|
|
121
|
+
"cypress": "12.17.2",
|
|
122
122
|
"emoji-regex": "^10.0.0",
|
|
123
|
-
"eslint": "8.
|
|
123
|
+
"eslint": "8.45.0",
|
|
124
124
|
"eslint-import-resolver-jest": "3.0.2",
|
|
125
125
|
"eslint-plugin-cypress": "2.13.3",
|
|
126
126
|
"eslint-plugin-storybook": "0.6.12",
|
|
@@ -24,6 +24,7 @@ const TEST_FIELDS = {
|
|
|
24
24
|
(val) => (val % 2 === 1 ? 'Count must be even' : ''),
|
|
25
25
|
],
|
|
26
26
|
inputAttrs: { size: 'xs', type: 'number' },
|
|
27
|
+
groupAttrs: { class: 'unique-class' },
|
|
27
28
|
},
|
|
28
29
|
allCaps: {
|
|
29
30
|
label: 'All caps (optional)',
|
|
@@ -68,6 +69,7 @@ describe('GlFormFields', () => {
|
|
|
68
69
|
label: formGroup.attributes('label'),
|
|
69
70
|
state: formGroup.attributes('state'),
|
|
70
71
|
invalidFeedback: formGroup.attributes('invalid-feedback'),
|
|
72
|
+
class: formGroup.attributes('class'),
|
|
71
73
|
input: {
|
|
72
74
|
// Ensure that "value" is present even if undefined
|
|
73
75
|
value: input.attributes('value'),
|
|
@@ -110,6 +112,7 @@ describe('GlFormFields', () => {
|
|
|
110
112
|
label: TEST_FIELDS.username.label,
|
|
111
113
|
state: undefined,
|
|
112
114
|
invalidFeedback: '',
|
|
115
|
+
class: undefined,
|
|
113
116
|
input: {
|
|
114
117
|
id: 'gl-form-field-testunique',
|
|
115
118
|
value: undefined,
|
|
@@ -119,6 +122,7 @@ describe('GlFormFields', () => {
|
|
|
119
122
|
label: TEST_FIELDS.evenCount.label,
|
|
120
123
|
state: undefined,
|
|
121
124
|
invalidFeedback: '',
|
|
125
|
+
class: TEST_FIELDS.evenCount.groupAttrs.class,
|
|
122
126
|
input: {
|
|
123
127
|
id: 'gl-form-field-testunique',
|
|
124
128
|
value: '0',
|
|
@@ -129,6 +133,7 @@ describe('GlFormFields', () => {
|
|
|
129
133
|
label: TEST_FIELDS.allCaps.label,
|
|
130
134
|
state: undefined,
|
|
131
135
|
invalidFeedback: '',
|
|
136
|
+
class: undefined,
|
|
132
137
|
input: {
|
|
133
138
|
id: 'gl-form-field-testunique',
|
|
134
139
|
value: undefined,
|
|
@@ -222,6 +227,7 @@ describe('GlFormFields', () => {
|
|
|
222
227
|
label: TEST_FIELDS.username.label,
|
|
223
228
|
invalidFeedback: 'User name is required',
|
|
224
229
|
state: undefined,
|
|
230
|
+
class: undefined,
|
|
225
231
|
input: {
|
|
226
232
|
value: undefined,
|
|
227
233
|
id: 'gl-form-field-testunique',
|
|
@@ -231,6 +237,7 @@ describe('GlFormFields', () => {
|
|
|
231
237
|
label: TEST_FIELDS.evenCount.label,
|
|
232
238
|
invalidFeedback: 'Count is required',
|
|
233
239
|
state: undefined,
|
|
240
|
+
class: TEST_FIELDS.evenCount.groupAttrs.class,
|
|
234
241
|
input: expect.objectContaining({
|
|
235
242
|
value: '0',
|
|
236
243
|
id: 'gl-form-field-testunique',
|
|
@@ -240,6 +247,7 @@ describe('GlFormFields', () => {
|
|
|
240
247
|
label: TEST_FIELDS.allCaps.label,
|
|
241
248
|
invalidFeedback: '',
|
|
242
249
|
state: undefined,
|
|
250
|
+
class: undefined,
|
|
243
251
|
input: {
|
|
244
252
|
value: undefined,
|
|
245
253
|
id: 'gl-form-field-testunique',
|
|
@@ -274,6 +282,7 @@ describe('GlFormFields', () => {
|
|
|
274
282
|
label: TEST_FIELDS.evenCount.label,
|
|
275
283
|
invalidFeedback: 'Count must be even',
|
|
276
284
|
state: undefined,
|
|
285
|
+
class: TEST_FIELDS.evenCount.groupAttrs.class,
|
|
277
286
|
input: {
|
|
278
287
|
...TEST_FIELDS.evenCount.inputAttrs,
|
|
279
288
|
id: 'gl-form-field-testunique',
|
|
@@ -24,8 +24,9 @@ const Template = () => ({
|
|
|
24
24
|
validators: [required('NAME IS REQUIRED!!!')],
|
|
25
25
|
},
|
|
26
26
|
password: {
|
|
27
|
-
label: 'Password',
|
|
27
|
+
label: 'Password with group styling',
|
|
28
28
|
inputAttrs: { type: 'password' },
|
|
29
|
+
groupAttrs: { class: 'gl-bg-purple-50 gl-w-20' },
|
|
29
30
|
validators: [required('Password is required')],
|
|
30
31
|
},
|
|
31
32
|
confirmPassword: {
|
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
* @typedef {object} FieldDefinition
|
|
26
26
|
* @template TValue=string
|
|
27
27
|
* @property {string} label - Label text to show for this field.
|
|
28
|
+
* @property {undefined | Object} groupAttrs - Properties that are passed to the group wrapping this field.
|
|
28
29
|
* @property {undefined | Object} inputAttrs - Properties that are passed to the actual input for this field.
|
|
29
30
|
* @property {undefined | function(string): TValue} mapValue - Function that maps the inputted string value to the field's actual value (e.g. a Number).
|
|
30
31
|
* @property {undefined | Array<function(TValue): string | undefined>=} validators - Collection of validator functions.
|
|
@@ -188,6 +189,7 @@ export default {
|
|
|
188
189
|
<div>
|
|
189
190
|
<gl-form-group
|
|
190
191
|
v-for="(field, fieldName) in fieldsToRender"
|
|
192
|
+
v-bind="field.groupAttrs"
|
|
191
193
|
:key="fieldName"
|
|
192
194
|
:label="field.label"
|
|
193
195
|
:label-for="field.id"
|
|
@@ -6,4 +6,9 @@ describe('GlInputGroupText', () => {
|
|
|
6
6
|
const wrapper = shallowMount(GlInputGroupText);
|
|
7
7
|
expect(wrapper).toBeInstanceOf(Object);
|
|
8
8
|
});
|
|
9
|
+
|
|
10
|
+
it('applies gl-input-group-text class', () => {
|
|
11
|
+
const wrapper = shallowMount(GlInputGroupText);
|
|
12
|
+
expect(wrapper.classes('gl-input-group-text')).toBe(true);
|
|
13
|
+
});
|
|
9
14
|
});
|
package/src/scss/components.scss
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
@import '../components/base/form/form_select/form_select';
|
|
45
45
|
@import '../components/base/form/form_textarea/form_textarea';
|
|
46
46
|
@import '../components/base/form/form_combobox/form_combobox';
|
|
47
|
+
@import '../components/base/form/input_group_text/input_group_text';
|
|
47
48
|
@import '../components/base/icon/icon';
|
|
48
49
|
@import '../components/base/infinite_scroll/infinite_scroll';
|
|
49
50
|
@import '../components/base/label/label';
|