@gitlab/ui 49.4.0 → 49.5.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 +15 -0
- package/dist/components/base/datepicker/datepicker.js +14 -2
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +1 -1
- package/dist/components/charts/heatmap/heatmap.js +1 -1
- package/dist/components/charts/legend/legend.js +1 -1
- package/dist/components/charts/line/line.js +1 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/dist/utils/charts/theme.js +8 -8
- package/dist/utils/constants.js +5 -1
- package/package.json +3 -3
- package/scss_to_js/scss_variables.js +23 -23
- package/scss_to_js/scss_variables.json +35 -35
- package/src/components/base/datepicker/datepicker.scss +0 -7
- package/src/components/base/datepicker/datepicker.spec.js +15 -0
- package/src/components/base/datepicker/datepicker.stories.js +23 -2
- package/src/components/base/datepicker/datepicker.vue +20 -3
- package/src/components/base/filtered_search/__snapshots__/filtered_search_term.spec.js.snap +23 -4
- package/src/components/base/icon/__snapshots__/icon.spec.js.snap +9 -2
- package/src/components/base/paginated_list/__snapshots__/paginated_list.spec.js.snap +0 -70
- package/src/components/base/path/__snapshots__/path.spec.js.snap +3 -68
- package/src/scss/variables.scss +12 -12
- package/src/utils/constants.js +5 -0
|
@@ -3,14 +3,14 @@ import { hexToRgba } from '../utils';
|
|
|
3
3
|
|
|
4
4
|
const whiteNormal = '#f0f0f0';
|
|
5
5
|
const red500 = '#dd2b0e';
|
|
6
|
-
const gray50 = '#
|
|
7
|
-
const gray100 = '#
|
|
8
|
-
const gray200 = '#
|
|
9
|
-
const gray300 = '#
|
|
10
|
-
const gray500 = '#
|
|
11
|
-
const gray600 = '#
|
|
12
|
-
const gray700 = '#
|
|
13
|
-
const gray900 = '#
|
|
6
|
+
const gray50 = '#ececef';
|
|
7
|
+
const gray100 = '#dcdcde';
|
|
8
|
+
const gray200 = '#bfbfc3';
|
|
9
|
+
const gray300 = '#a4a3a8';
|
|
10
|
+
const gray500 = '#737278';
|
|
11
|
+
const gray600 = '#626168';
|
|
12
|
+
const gray700 = '#535158';
|
|
13
|
+
const gray900 = '#333238';
|
|
14
14
|
const dataVizGreen500 = '#619025';
|
|
15
15
|
const dataVizGreen600 = '#4e7f0e';
|
|
16
16
|
const dataVizGreen700 = '#366800';
|
package/dist/utils/constants.js
CHANGED
|
@@ -112,6 +112,10 @@ const buttonSizeOptionsMap = {
|
|
|
112
112
|
small: 'sm',
|
|
113
113
|
medium: 'md'
|
|
114
114
|
};
|
|
115
|
+
const datepickerSizeOptionsMap = {
|
|
116
|
+
small: 'sm',
|
|
117
|
+
medium: 'md'
|
|
118
|
+
};
|
|
115
119
|
|
|
116
120
|
// size options all have corresponding styles (e.g. .s12 defined in icon.scss)
|
|
117
121
|
const iconSizeOptions = glIconSizes.split(' ').map(Number);
|
|
@@ -252,4 +256,4 @@ const loadingIconSizes = {
|
|
|
252
256
|
'xl (64x64)': 'xl'
|
|
253
257
|
};
|
|
254
258
|
|
|
255
|
-
export { COMMA, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonSizeOptionsMap, buttonVariantOptions, colorThemes, columnOptions, defaultDateFormat, drawerVariants, dropdownVariantOptions, focusableTags, formInputSizes, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, labelSizeOptions, loadingIconSizes, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, resizeDebounceTime, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipDelay, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, variantOptions, variantOptionsWithNoDefault, viewModeOptions };
|
|
259
|
+
export { COMMA, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, bannerVariants, buttonCategoryOptions, buttonSizeOptions, buttonSizeOptionsMap, buttonVariantOptions, colorThemes, columnOptions, datepickerSizeOptionsMap, defaultDateFormat, drawerVariants, dropdownVariantOptions, focusableTags, formInputSizes, formStateOptions, glThemes, iconSizeOptions, keyboard, labelColorOptions, labelSizeOptions, loadingIconSizes, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, resizeDebounceTime, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipDelay, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, variantOptions, variantOptionsWithNoDefault, viewModeOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "49.
|
|
3
|
+
"version": "49.5.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "NODE_ENV=production rollup -c",
|
|
24
24
|
"prebuild": "run-s build-scss-variables generate-utilities",
|
|
25
|
+
"prepare": "run-s build-scss-variables generate-utilities",
|
|
25
26
|
"generate-utilities": "make src/scss/utilities.scss",
|
|
26
27
|
"build-scss-variables": "make scss_to_js/scss_variables.js",
|
|
27
28
|
"clean": "rm -r dist storybook scss_to_js/scss_variables.* src/scss/utilities.scss",
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
"eslint": "8.26.0",
|
|
108
109
|
"eslint-import-resolver-jest": "3.0.2",
|
|
109
110
|
"eslint-plugin-cypress": "2.12.1",
|
|
110
|
-
"eslint-plugin-storybook": "0.6.
|
|
111
|
+
"eslint-plugin-storybook": "0.6.7",
|
|
111
112
|
"file-loader": "^4.2.0",
|
|
112
113
|
"glob": "^7.2.0",
|
|
113
114
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -115,7 +116,6 @@
|
|
|
115
116
|
"jest": "^29.2.2",
|
|
116
117
|
"jest-circus": "29.2.2",
|
|
117
118
|
"jest-environment-jsdom": "29.2.2",
|
|
118
|
-
"jest-serializer-vue": "^2.0.2",
|
|
119
119
|
"markdownlint-cli": "^0.29.0",
|
|
120
120
|
"mockdate": "^2.0.5",
|
|
121
121
|
"npm-run-all": "^4.1.5",
|
|
@@ -90,18 +90,18 @@ export const purple700 = '#5943b6'
|
|
|
90
90
|
export const purple800 = '#453894'
|
|
91
91
|
export const purple900 = '#2f2a6b'
|
|
92
92
|
export const purple950 = '#232150'
|
|
93
|
-
export const gray10 = '#
|
|
94
|
-
export const gray50 = '#
|
|
95
|
-
export const gray100 = '#
|
|
96
|
-
export const gray200 = '#
|
|
97
|
-
export const gray300 = '#
|
|
98
|
-
export const gray400 = '#
|
|
99
|
-
export const gray500 = '#
|
|
100
|
-
export const gray600 = '#
|
|
101
|
-
export const gray700 = '#
|
|
102
|
-
export const gray800 = '#
|
|
103
|
-
export const gray900 = '#
|
|
104
|
-
export const gray950 = '#
|
|
93
|
+
export const gray10 = '#fbfafd'
|
|
94
|
+
export const gray50 = '#ececef'
|
|
95
|
+
export const gray100 = '#dcdcde'
|
|
96
|
+
export const gray200 = '#bfbfc3'
|
|
97
|
+
export const gray300 = '#a4a3a8'
|
|
98
|
+
export const gray400 = '#89888d'
|
|
99
|
+
export const gray500 = '#737278'
|
|
100
|
+
export const gray600 = '#626168'
|
|
101
|
+
export const gray700 = '#535158'
|
|
102
|
+
export const gray800 = '#434248'
|
|
103
|
+
export const gray900 = '#333238'
|
|
104
|
+
export const gray950 = '#1f1e24'
|
|
105
105
|
export const themeIndigo50 = '#f1f1ff'
|
|
106
106
|
export const themeIndigo100 = '#dbdbf8'
|
|
107
107
|
export const themeIndigo200 = '#c7c7f2'
|
|
@@ -232,8 +232,8 @@ export const tGrayA04 = 'rgba(0, 0, 0, 0.04)'
|
|
|
232
232
|
export const tGrayA06 = 'rgba(0, 0, 0, 0.06)'
|
|
233
233
|
export const tGrayA08 = 'rgba(0, 0, 0, 0.08)'
|
|
234
234
|
export const tGrayA24 = 'rgba(0, 0, 0, 0.24)'
|
|
235
|
-
export const glTextColor = '#
|
|
236
|
-
export const glTextColorSecondary = '#
|
|
235
|
+
export const glTextColor = '#333238'
|
|
236
|
+
export const glTextColorSecondary = '#737278'
|
|
237
237
|
export const glFontWeightLight = '300'
|
|
238
238
|
export const glFontWeightNormal = '400'
|
|
239
239
|
export const glFontWeightBold = '600'
|
|
@@ -279,7 +279,7 @@ export const glFontSizeMonospaceSm = '0.6875rem'
|
|
|
279
279
|
export const glMonospaceFont = ''
|
|
280
280
|
export const glRegularFont = ''
|
|
281
281
|
export const glFonts = '("monospace": ("Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace), "regular": (-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"))'
|
|
282
|
-
export const borderColor = '#
|
|
282
|
+
export const borderColor = '#dcdcde'
|
|
283
283
|
export const glBorderSize1 = '1px'
|
|
284
284
|
export const glBorderSize2 = '2px'
|
|
285
285
|
export const glBorderSize3 = '3px'
|
|
@@ -322,13 +322,13 @@ export const glBroadcastMessageTextMaxWidth = '58.375rem'
|
|
|
322
322
|
export const glModalSmallWidth = '32rem'
|
|
323
323
|
export const glModalMediumWidth = '48rem'
|
|
324
324
|
export const glModalLargeWidth = '61.875rem'
|
|
325
|
-
export const modalHeaderBorderColor = '#
|
|
326
|
-
export const modalFooterBorderColor = '#
|
|
325
|
+
export const modalHeaderBorderColor = '#bfbfc3'
|
|
326
|
+
export const modalFooterBorderColor = '#bfbfc3'
|
|
327
327
|
export const modalTitleLineHeight = '1.25rem'
|
|
328
328
|
export const modalBackdropBg = '#000'
|
|
329
329
|
export const modalBackdropOpacity = '0.64'
|
|
330
|
-
export const bodyColor = '#
|
|
331
|
-
export const secondary = '#
|
|
330
|
+
export const bodyColor = '#333238'
|
|
331
|
+
export const secondary = '#ececef'
|
|
332
332
|
export const success = '#108548'
|
|
333
333
|
export const info = '#1f75cb'
|
|
334
334
|
export const warning = '#ab6100'
|
|
@@ -344,13 +344,13 @@ export const h5FontSize = '1.09375rem'
|
|
|
344
344
|
export const h6FontSize = '0.875rem'
|
|
345
345
|
export const spacer = '0.5rem'
|
|
346
346
|
export const spacers = '(1: 0.25rem, 2: 0.5rem, 3: 1rem, 4: 1.5rem, 5: 2rem, 6: 2.5rem, 7: 3rem, 8: 3.5rem, 9: 4rem)'
|
|
347
|
-
export const tableAccentBg = '#
|
|
348
|
-
export const cardBorderColor = '#
|
|
349
|
-
export const cardCapBg = '#
|
|
347
|
+
export const tableAccentBg = '#ececef'
|
|
348
|
+
export const cardBorderColor = '#dcdcde'
|
|
349
|
+
export const cardCapBg = '#fbfafd'
|
|
350
350
|
export const glFormInputSizes = '(xs: 5rem, sm: 10rem, md: 15rem, lg: 20rem, xl: 35rem)'
|
|
351
351
|
export const popoverBg = '#fff'
|
|
352
352
|
export const popoverArrowWidth = '0.5rem'
|
|
353
353
|
export const popoverArrowHeight = '0.25rem'
|
|
354
354
|
export const popoverArrowColor = '#fff'
|
|
355
|
-
export const popoverArrowOuterColor = '#
|
|
355
|
+
export const popoverArrowOuterColor = '#dcdcde'
|
|
356
356
|
export const tooltipOpacity = '1'
|
|
@@ -489,63 +489,63 @@
|
|
|
489
489
|
},
|
|
490
490
|
{
|
|
491
491
|
"name": "$gray-10",
|
|
492
|
-
"value": "#
|
|
493
|
-
"compiledValue": "#
|
|
492
|
+
"value": "#fbfafd",
|
|
493
|
+
"compiledValue": "#fbfafd"
|
|
494
494
|
},
|
|
495
495
|
{
|
|
496
496
|
"name": "$gray-50",
|
|
497
|
-
"value": "#
|
|
498
|
-
"compiledValue": "#
|
|
497
|
+
"value": "#ececef",
|
|
498
|
+
"compiledValue": "#ececef"
|
|
499
499
|
},
|
|
500
500
|
{
|
|
501
501
|
"name": "$gray-100",
|
|
502
|
-
"value": "#
|
|
503
|
-
"compiledValue": "#
|
|
502
|
+
"value": "#dcdcde",
|
|
503
|
+
"compiledValue": "#dcdcde"
|
|
504
504
|
},
|
|
505
505
|
{
|
|
506
506
|
"name": "$gray-200",
|
|
507
|
-
"value": "#
|
|
508
|
-
"compiledValue": "#
|
|
507
|
+
"value": "#bfbfc3",
|
|
508
|
+
"compiledValue": "#bfbfc3"
|
|
509
509
|
},
|
|
510
510
|
{
|
|
511
511
|
"name": "$gray-300",
|
|
512
|
-
"value": "#
|
|
513
|
-
"compiledValue": "#
|
|
512
|
+
"value": "#a4a3a8",
|
|
513
|
+
"compiledValue": "#a4a3a8"
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
"name": "$gray-400",
|
|
517
|
-
"value": "#
|
|
518
|
-
"compiledValue": "#
|
|
517
|
+
"value": "#89888d",
|
|
518
|
+
"compiledValue": "#89888d"
|
|
519
519
|
},
|
|
520
520
|
{
|
|
521
521
|
"name": "$gray-500",
|
|
522
|
-
"value": "#
|
|
523
|
-
"compiledValue": "#
|
|
522
|
+
"value": "#737278",
|
|
523
|
+
"compiledValue": "#737278"
|
|
524
524
|
},
|
|
525
525
|
{
|
|
526
526
|
"name": "$gray-600",
|
|
527
|
-
"value": "#
|
|
528
|
-
"compiledValue": "#
|
|
527
|
+
"value": "#626168",
|
|
528
|
+
"compiledValue": "#626168"
|
|
529
529
|
},
|
|
530
530
|
{
|
|
531
531
|
"name": "$gray-700",
|
|
532
|
-
"value": "#
|
|
533
|
-
"compiledValue": "#
|
|
532
|
+
"value": "#535158",
|
|
533
|
+
"compiledValue": "#535158"
|
|
534
534
|
},
|
|
535
535
|
{
|
|
536
536
|
"name": "$gray-800",
|
|
537
|
-
"value": "#
|
|
538
|
-
"compiledValue": "#
|
|
537
|
+
"value": "#434248",
|
|
538
|
+
"compiledValue": "#434248"
|
|
539
539
|
},
|
|
540
540
|
{
|
|
541
541
|
"name": "$gray-900",
|
|
542
|
-
"value": "#
|
|
543
|
-
"compiledValue": "#
|
|
542
|
+
"value": "#333238",
|
|
543
|
+
"compiledValue": "#333238"
|
|
544
544
|
},
|
|
545
545
|
{
|
|
546
546
|
"name": "$gray-950",
|
|
547
|
-
"value": "#
|
|
548
|
-
"compiledValue": "#
|
|
547
|
+
"value": "#1f1e24",
|
|
548
|
+
"compiledValue": "#1f1e24"
|
|
549
549
|
},
|
|
550
550
|
{
|
|
551
551
|
"name": "$theme-indigo-50",
|
|
@@ -1200,12 +1200,12 @@
|
|
|
1200
1200
|
{
|
|
1201
1201
|
"name": "$gl-text-color",
|
|
1202
1202
|
"value": "$gray-900",
|
|
1203
|
-
"compiledValue": "#
|
|
1203
|
+
"compiledValue": "#333238"
|
|
1204
1204
|
},
|
|
1205
1205
|
{
|
|
1206
1206
|
"name": "$gl-text-color-secondary",
|
|
1207
1207
|
"value": "$gray-500",
|
|
1208
|
-
"compiledValue": "#
|
|
1208
|
+
"compiledValue": "#737278"
|
|
1209
1209
|
},
|
|
1210
1210
|
{
|
|
1211
1211
|
"name": "$gl-font-weight-light",
|
|
@@ -1459,7 +1459,7 @@
|
|
|
1459
1459
|
{
|
|
1460
1460
|
"name": "$border-color",
|
|
1461
1461
|
"value": "$gray-100",
|
|
1462
|
-
"compiledValue": "#
|
|
1462
|
+
"compiledValue": "#dcdcde"
|
|
1463
1463
|
},
|
|
1464
1464
|
{
|
|
1465
1465
|
"name": "$gl-border-size-1",
|
|
@@ -1723,12 +1723,12 @@
|
|
|
1723
1723
|
{
|
|
1724
1724
|
"name": "$modal-header-border-color",
|
|
1725
1725
|
"value": "$gray-200",
|
|
1726
|
-
"compiledValue": "#
|
|
1726
|
+
"compiledValue": "#bfbfc3"
|
|
1727
1727
|
},
|
|
1728
1728
|
{
|
|
1729
1729
|
"name": "$modal-footer-border-color",
|
|
1730
1730
|
"value": "$gray-200",
|
|
1731
|
-
"compiledValue": "#
|
|
1731
|
+
"compiledValue": "#bfbfc3"
|
|
1732
1732
|
},
|
|
1733
1733
|
{
|
|
1734
1734
|
"name": "$modal-title-line-height",
|
|
@@ -1748,12 +1748,12 @@
|
|
|
1748
1748
|
{
|
|
1749
1749
|
"name": "$body-color",
|
|
1750
1750
|
"value": "$gl-text-color",
|
|
1751
|
-
"compiledValue": "#
|
|
1751
|
+
"compiledValue": "#333238"
|
|
1752
1752
|
},
|
|
1753
1753
|
{
|
|
1754
1754
|
"name": "$secondary",
|
|
1755
1755
|
"value": "$gray-50",
|
|
1756
|
-
"compiledValue": "#
|
|
1756
|
+
"compiledValue": "#ececef"
|
|
1757
1757
|
},
|
|
1758
1758
|
{
|
|
1759
1759
|
"name": "$success",
|
|
@@ -1880,17 +1880,17 @@
|
|
|
1880
1880
|
{
|
|
1881
1881
|
"name": "$table-accent-bg",
|
|
1882
1882
|
"value": "$gray-50",
|
|
1883
|
-
"compiledValue": "#
|
|
1883
|
+
"compiledValue": "#ececef"
|
|
1884
1884
|
},
|
|
1885
1885
|
{
|
|
1886
1886
|
"name": "$card-border-color",
|
|
1887
1887
|
"value": "$gray-100",
|
|
1888
|
-
"compiledValue": "#
|
|
1888
|
+
"compiledValue": "#dcdcde"
|
|
1889
1889
|
},
|
|
1890
1890
|
{
|
|
1891
1891
|
"name": "$card-cap-bg",
|
|
1892
1892
|
"value": "$gray-10",
|
|
1893
|
-
"compiledValue": "#
|
|
1893
|
+
"compiledValue": "#fbfafd"
|
|
1894
1894
|
},
|
|
1895
1895
|
{
|
|
1896
1896
|
"name": "$gl-form-input-sizes",
|
|
@@ -1947,7 +1947,7 @@
|
|
|
1947
1947
|
{
|
|
1948
1948
|
"name": "$popover-arrow-outer-color",
|
|
1949
1949
|
"value": "$gray-100",
|
|
1950
|
-
"compiledValue": "#
|
|
1950
|
+
"compiledValue": "#dcdcde"
|
|
1951
1951
|
},
|
|
1952
1952
|
{
|
|
1953
1953
|
"name": "$tooltip-opacity",
|
|
@@ -20,13 +20,6 @@ $pd-week-color: $gray-500;
|
|
|
20
20
|
|
|
21
21
|
@import 'pikaday/scss/pikaday';
|
|
22
22
|
|
|
23
|
-
// Datepicker Max Width: 240px
|
|
24
|
-
$gl-datepicker-width: $grid-size * 30;
|
|
25
|
-
|
|
26
|
-
.gl-datepicker-input {
|
|
27
|
-
width: $gl-datepicker-width;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
23
|
.gl-datepicker-actions {
|
|
31
24
|
@include gl-font-sm;
|
|
32
25
|
@include gl-absolute;
|
|
@@ -413,4 +413,19 @@ describe('datepicker component', () => {
|
|
|
413
413
|
expect(config.parse).not.toBeUndefined();
|
|
414
414
|
expect(config.parse(dateString)).toEqual(parsedDate);
|
|
415
415
|
});
|
|
416
|
+
|
|
417
|
+
it.each`
|
|
418
|
+
size | expectedClass
|
|
419
|
+
${undefined} | ${'gl-form-input-md'}
|
|
420
|
+
${'small'} | ${'gl-form-input-sm'}
|
|
421
|
+
${'medium'} | ${'gl-form-input-md'}
|
|
422
|
+
`('applies $expectedClass class when size is $size', ({ size, expectedClass }) => {
|
|
423
|
+
const wrapper = mountWithOptions({
|
|
424
|
+
propsData: {
|
|
425
|
+
size,
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
expect(wrapper.classes()).toContain(expectedClass);
|
|
430
|
+
});
|
|
416
431
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GlDatepicker } from '../../../index';
|
|
1
|
+
import { GlFormGroup, GlDatepicker } from '../../../index';
|
|
2
2
|
import { disableControls } from '../../../utils/stories_utils';
|
|
3
3
|
import { useFakeDate } from '../../../utils/use_fake_date';
|
|
4
4
|
import { makeContainer } from '../../../utils/story_decorators/container';
|
|
5
5
|
import readme from './datepicker.md';
|
|
6
6
|
|
|
7
7
|
const defaults = {
|
|
8
|
-
components: { GlDatepicker },
|
|
8
|
+
components: { GlFormGroup, GlDatepicker },
|
|
9
9
|
mixins: [useFakeDate()],
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -63,6 +63,27 @@ export const WithClearButton = (_args, { argTypes }) => ({
|
|
|
63
63
|
});
|
|
64
64
|
WithClearButton.args = generateProps();
|
|
65
65
|
|
|
66
|
+
export const DifferentSizes = (_args, { argTypes }) => ({
|
|
67
|
+
...defaults,
|
|
68
|
+
props: Object.keys(argTypes),
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
pickerValue: defaultDate,
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
template: `
|
|
75
|
+
<div class="gl-display-flex gl-flex-direction-column gl-gap-3">
|
|
76
|
+
<gl-form-group label="Size: sm">
|
|
77
|
+
<gl-datepicker showClearButton :max-date="maxDate" :min-date="minDate" v-model="pickerValue" size="small" />
|
|
78
|
+
</gl-form-group>
|
|
79
|
+
<gl-form-group label="Size: md (default)">
|
|
80
|
+
<gl-datepicker showClearButton :max-date="maxDate" :min-date="minDate" v-model="pickerValue" size="medium" />
|
|
81
|
+
</gl-form-group>
|
|
82
|
+
</div>
|
|
83
|
+
`,
|
|
84
|
+
});
|
|
85
|
+
DifferentSizes.args = generateProps();
|
|
86
|
+
|
|
66
87
|
export default {
|
|
67
88
|
title: 'base/datepicker',
|
|
68
89
|
component: GlDatepicker,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<script>
|
|
3
3
|
import { isString } from 'lodash';
|
|
4
4
|
import Pikaday from 'pikaday';
|
|
5
|
-
import { defaultDateFormat } from '../../../utils/constants';
|
|
5
|
+
import { defaultDateFormat, datepickerSizeOptionsMap } from '../../../utils/constants';
|
|
6
6
|
import { areDatesEqual } from '../../../utils/datetime_utility';
|
|
7
7
|
import GlButton from '../button/button.vue';
|
|
8
8
|
import GlFormInput from '../form/form_input/form_input.vue';
|
|
@@ -171,6 +171,12 @@ export default {
|
|
|
171
171
|
required: false,
|
|
172
172
|
default: null,
|
|
173
173
|
},
|
|
174
|
+
size: {
|
|
175
|
+
type: String,
|
|
176
|
+
required: false,
|
|
177
|
+
default: 'medium',
|
|
178
|
+
validator: (value) => Object.keys(datepickerSizeOptionsMap).includes(value),
|
|
179
|
+
},
|
|
174
180
|
},
|
|
175
181
|
data() {
|
|
176
182
|
return {
|
|
@@ -204,6 +210,17 @@ export default {
|
|
|
204
210
|
|
|
205
211
|
return null;
|
|
206
212
|
},
|
|
213
|
+
datepickerClasses() {
|
|
214
|
+
return [
|
|
215
|
+
'gl-datepicker',
|
|
216
|
+
'd-inline-block',
|
|
217
|
+
'gl-w-full',
|
|
218
|
+
`gl-form-input-${this.datepickerSize}`,
|
|
219
|
+
];
|
|
220
|
+
},
|
|
221
|
+
datepickerSize() {
|
|
222
|
+
return datepickerSizeOptionsMap[this.size];
|
|
223
|
+
},
|
|
207
224
|
},
|
|
208
225
|
watch: {
|
|
209
226
|
value(val) {
|
|
@@ -338,7 +355,7 @@ export default {
|
|
|
338
355
|
</script>
|
|
339
356
|
|
|
340
357
|
<template>
|
|
341
|
-
<div class="
|
|
358
|
+
<div :class="datepickerClasses">
|
|
342
359
|
<div v-if="showDefaultField" class="gl-relative">
|
|
343
360
|
<!--
|
|
344
361
|
@slot (optional) Input to display and bind the datepicker to. Defaults to `<gl-form-input />`
|
|
@@ -350,7 +367,7 @@ export default {
|
|
|
350
367
|
v-model="textInput"
|
|
351
368
|
:name="inputName"
|
|
352
369
|
data-testid="gl-datepicker-input"
|
|
353
|
-
class="gl-
|
|
370
|
+
class="gl-w-full"
|
|
354
371
|
:class="renderClearButton ? 'gl-pr-9!' : 'gl-pr-7!'"
|
|
355
372
|
:value="formattedDate"
|
|
356
373
|
:placeholder="placeholder"
|
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Filtered search term renders input with value in active mode 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
|
|
4
|
+
<div
|
|
5
|
+
class="gl-h-auto gl-filtered-search-term"
|
|
6
|
+
data-testid="filtered-search-term"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
active="true"
|
|
10
|
+
class="gl-filtered-search-term-token"
|
|
11
|
+
cursor-position="end"
|
|
12
|
+
value="test-value"
|
|
13
|
+
>
|
|
14
|
+
test-value
|
|
15
|
+
</div>
|
|
6
16
|
</div>
|
|
7
17
|
`;
|
|
8
18
|
|
|
9
19
|
exports[`Filtered search term renders value in inactive mode 1`] = `
|
|
10
|
-
<div
|
|
11
|
-
|
|
20
|
+
<div
|
|
21
|
+
class="gl-h-auto gl-filtered-search-term"
|
|
22
|
+
data-testid="filtered-search-term"
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
class="gl-filtered-search-term-token"
|
|
26
|
+
cursor-position="end"
|
|
27
|
+
value="test-value"
|
|
28
|
+
>
|
|
29
|
+
test-value
|
|
30
|
+
</div>
|
|
12
31
|
</div>
|
|
13
32
|
`;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Icon component when created shows svg class "s8" and path "/path/to/icons.svg#check-circle" 1`] = `
|
|
4
|
-
<svg
|
|
5
|
-
|
|
4
|
+
<svg
|
|
5
|
+
aria-hidden="true"
|
|
6
|
+
class="gl-icon s8"
|
|
7
|
+
data-testid="check-circle-icon"
|
|
8
|
+
role="img"
|
|
9
|
+
>
|
|
10
|
+
<use
|
|
11
|
+
href="/path/to/icons.svg#check-circle"
|
|
12
|
+
/>
|
|
6
13
|
</svg>
|
|
7
14
|
`;
|