@gitlab/ui 40.6.2 → 40.6.3

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [40.6.3](https://gitlab.com/gitlab-org/gitlab-ui/compare/v40.6.2...v40.6.3) (2022-05-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Set story container height with decorator ([672f6f9](https://gitlab.com/gitlab-org/gitlab-ui/commit/672f6f948710db39fad59b6a0da673783ce63bc5))
7
+
1
8
  ## [40.6.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v40.6.1...v40.6.2) (2022-05-19)
2
9
 
3
10
 
@@ -78,7 +78,7 @@ var script = {
78
78
  const __vue_script__ = script;
79
79
 
80
80
  /* template */
81
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-input-group',[(_vm.activeOption || _vm.$scopedSlots.prepend)?_c('b-input-group-prepend',[_vm._t("prepend"),_vm._v(" "),(_vm.activeOption)?_c('gl-dropdown',{attrs:{"text":_vm.activeOption}},_vm._l((_vm.predefinedOptions),function(option){return _c('gl-dropdown-item',{key:option.value,attrs:{"is-check-item":"","is-checked":_vm.activeOption === option.name},on:{"click":function($event){return _vm.updateValue(option)}}},[_vm._v("\n "+_vm._s(option.name)+"\n ")])}),1):_vm._e()],2):_vm._e(),_vm._v(" "),_vm._t("default",[_c('b-form-input',_vm._g(_vm._b({ref:"input",class:['gl-form-input', _vm.inputClass],attrs:{"aria-label":_vm.label},on:{"click":_vm.handleClick},model:{value:(_vm.localValue),callback:function ($$v) {_vm.localValue=$$v;},expression:"localValue"}},'b-form-input',_vm.$attrs,false),_vm.$listeners))]),_vm._v(" "),(_vm.$scopedSlots.append)?_c('b-input-group-append',[_vm._t("append")],2):_vm._e()],2)],1)};
81
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-input-group',[(_vm.activeOption || _vm.$scopedSlots.prepend)?_c('b-input-group-prepend',[_vm._t("prepend"),_vm._v(" "),(_vm.activeOption)?_c('gl-dropdown',{attrs:{"text":_vm.activeOption}},_vm._l((_vm.predefinedOptions),function(option){return _c('gl-dropdown-item',{key:option.value,attrs:{"is-check-item":"","is-checked":_vm.activeOption === option.name},on:{"click":function($event){return _vm.updateValue(option)}}},[_vm._v("\n "+_vm._s(option.name)+"\n ")])}),1):_vm._e()],2):_vm._e(),_vm._v(" "),_vm._t("default",[_c('b-form-input',_vm._g(_vm._b({ref:"input",class:['gl-form-input', _vm.inputClass],attrs:{"aria-label":_vm.label},on:{"click":_vm.handleClick},model:{value:(_vm.localValue),callback:function ($$v) {_vm.localValue=$$v;},expression:"localValue"}},'b-form-input',_vm.$attrs,false),_vm.$listeners))]),_vm._v(" "),(_vm.$scopedSlots.append)?_c('b-input-group-append',[_vm._t("append")],2):_vm._e()],2)};
82
82
  var __vue_staticRenderFns__ = [];
83
83
 
84
84
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "40.6.2",
3
+ "version": "40.6.3",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -81,21 +81,21 @@
81
81
  "@arkweid/lefthook": "0.7.7",
82
82
  "@babel/core": "^7.10.2",
83
83
  "@babel/preset-env": "^7.10.2",
84
- "@gitlab/eslint-plugin": "12.2.0",
84
+ "@gitlab/eslint-plugin": "12.3.0",
85
85
  "@gitlab/stylelint-config": "4.0.0",
86
86
  "@gitlab/svgs": "2.14.0",
87
87
  "@rollup/plugin-commonjs": "^11.1.0",
88
88
  "@rollup/plugin-node-resolve": "^7.1.3",
89
89
  "@rollup/plugin-replace": "^2.3.2",
90
- "@storybook/addon-a11y": "6.5.2",
91
- "@storybook/addon-docs": "6.5.2",
92
- "@storybook/addon-essentials": "6.5.2",
90
+ "@storybook/addon-a11y": "6.5.4",
91
+ "@storybook/addon-docs": "6.5.4",
92
+ "@storybook/addon-essentials": "6.5.4",
93
93
  "@storybook/addon-knobs": "6.4.0",
94
- "@storybook/addon-storyshots": "6.5.2",
95
- "@storybook/addon-storyshots-puppeteer": "6.5.2",
96
- "@storybook/addon-viewport": "6.5.2",
97
- "@storybook/theming": "6.5.2",
98
- "@storybook/vue": "6.5.2",
94
+ "@storybook/addon-storyshots": "6.5.4",
95
+ "@storybook/addon-storyshots-puppeteer": "6.5.4",
96
+ "@storybook/addon-viewport": "6.5.4",
97
+ "@storybook/theming": "6.5.4",
98
+ "@storybook/vue": "6.5.4",
99
99
  "@vue/test-utils": "1.3.0",
100
100
  "autoprefixer": "^9.7.6",
101
101
  "babel-jest": "^26.6.3",
@@ -140,6 +140,7 @@
140
140
  "sass-loader": "^10.2.0",
141
141
  "sass-true": "^5.0.0",
142
142
  "start-server-and-test": "^1.10.6",
143
+ "storybook-dark-mode": "^1.0.8",
143
144
  "stylelint": "14.3.0",
144
145
  "stylelint-config-prettier": "9.0.3",
145
146
  "stylelint-prettier": "2.0.0",
@@ -31,7 +31,8 @@ While this component is based on
31
31
 
32
32
  - Has a different set of valid `variant`s. See the examples or props
33
33
  documentation for those values.
34
- - Always sets the `pill` prop of the underlying `BBadge` to `true`. Any passed
34
+ - Always sets the `pill` prop of the underlying
35
+ [`BBadge`](https://bootstrap-vue.org/docs/components/badge) to `true`. Any passed
35
36
  in `pill` prop value is ignored.
36
37
  - Does _not_ scale itself to match the size of its immediate parent, like
37
- `BBadge` does.
38
+ [`BBadge`](https://bootstrap-vue.org/docs/components/badge) does.
@@ -1,6 +1,7 @@
1
1
  import { GlDatepicker } from '../../../index';
2
2
  import { disableControls } from '../../../utils/stories_utils';
3
3
  import { useFakeDate } from '../../../utils/use_fake_date';
4
+ import { makeContainer } from '../../../utils/story_decorators/container';
4
5
  import readme from './datepicker.md';
5
6
 
6
7
  const defaults = {
@@ -18,8 +19,6 @@ const generateProps = ({ minDate = defaultMinDate, maxDate = defaultMaxDate } =
18
19
  maxDate,
19
20
  });
20
21
 
21
- const wrap = (template) => `<div style="height: 280px">${template}</div>`;
22
-
23
22
  export const Default = (_args, { argTypes }) => ({
24
23
  ...defaults,
25
24
  props: Object.keys(argTypes),
@@ -28,9 +27,7 @@ export const Default = (_args, { argTypes }) => ({
28
27
  pickerValue: defaultDate,
29
28
  };
30
29
  },
31
- template: wrap(`
32
- <gl-datepicker :max-date="maxDate" :min-date="minDate" :start-opened="true" v-model="pickerValue" />
33
- `),
30
+ template: `<gl-datepicker :max-date="maxDate" :min-date="minDate" :start-opened="true" v-model="pickerValue" />`,
34
31
  });
35
32
  Default.args = generateProps();
36
33
 
@@ -42,14 +39,15 @@ export const CustomTrigger = (_args, { argTypes }) => ({
42
39
  pickerValue: null,
43
40
  };
44
41
  },
45
- template: wrap(`
46
- <div class="dropdown">
47
- <button type="button" class="dropdown-menu-toggle">
48
- <span class="dropdown-toggle-text"> Start date: {{value}} </span>
49
- </button>
50
- </div>
51
- <gl-datepicker v-model="pickerValue" target=".dropdown-menu-toggle" :container="null" />
52
- `),
42
+ template: `
43
+ <div>
44
+ <div class="dropdown">
45
+ <button type="button" class="dropdown-menu-toggle">
46
+ <span class="dropdown-toggle-text"> Start date: {{value}} </span>
47
+ </button>
48
+ </div>
49
+ <gl-datepicker v-model="pickerValue" target=".dropdown-menu-toggle" :container="null" />
50
+ </div>`,
53
51
  });
54
52
  CustomTrigger.args = generateProps();
55
53
 
@@ -61,15 +59,14 @@ export const WithClearButton = (_args, { argTypes }) => ({
61
59
  pickerValue: defaultDate,
62
60
  };
63
61
  },
64
- template: wrap(`
65
- <gl-datepicker showClearButton :max-date="maxDate" :min-date="minDate" v-model="pickerValue" />
66
- `),
62
+ template: `<gl-datepicker showClearButton :max-date="maxDate" :min-date="minDate" v-model="pickerValue" />`,
67
63
  });
68
64
  WithClearButton.args = generateProps();
69
65
 
70
66
  export default {
71
67
  title: 'base/datepicker',
72
68
  component: GlDatepicker,
69
+ decorators: [makeContainer({ height: '280px' })],
73
70
  parameters: {
74
71
  docs: {
75
72
  description: {
@@ -1,4 +1,5 @@
1
1
  import { disableControls } from '../../../utils/stories_utils';
2
+ import { makeContainer } from '../../../utils/story_decorators/container';
2
3
  import readme from './daterange_picker.md';
3
4
  import GlDaterangePicker from './daterange_picker.vue';
4
5
 
@@ -113,6 +114,7 @@ export default {
113
114
  followsDesignSystem: true,
114
115
  title: 'base/daterange-picker',
115
116
  component: GlDaterangePicker,
117
+ decorators: [makeContainer({ height: '300px' })],
116
118
  parameters: {
117
119
  knobs: { disable: true },
118
120
  docs: {
@@ -64,39 +64,37 @@ export default {
64
64
  };
65
65
  </script>
66
66
  <template>
67
- <div>
68
- <b-input-group>
69
- <b-input-group-prepend v-if="activeOption || $scopedSlots.prepend">
70
- <!-- @slot Is rendered in front of the input field. -->
71
- <slot name="prepend"></slot>
72
- <gl-dropdown v-if="activeOption" :text="activeOption">
73
- <gl-dropdown-item
74
- v-for="option in predefinedOptions"
75
- :key="option.value"
76
- is-check-item
77
- :is-checked="activeOption === option.name"
78
- @click="updateValue(option)"
79
- >
80
- {{ option.name }}
81
- </gl-dropdown-item>
82
- </gl-dropdown>
83
- </b-input-group-prepend>
84
- <!-- @slot Allows replacement of default input field. -->
85
- <slot>
86
- <b-form-input
87
- ref="input"
88
- v-model="localValue"
89
- :class="['gl-form-input', inputClass]"
90
- :aria-label="label"
91
- v-bind="$attrs"
92
- v-on="$listeners"
93
- @click="handleClick"
94
- />
95
- </slot>
96
- <b-input-group-append v-if="$scopedSlots.append">
97
- <!-- @slot Is rendered after the input field. -->
98
- <slot name="append"></slot>
99
- </b-input-group-append>
100
- </b-input-group>
101
- </div>
67
+ <b-input-group>
68
+ <b-input-group-prepend v-if="activeOption || $scopedSlots.prepend">
69
+ <!-- @slot Is rendered in front of the input field. -->
70
+ <slot name="prepend"></slot>
71
+ <gl-dropdown v-if="activeOption" :text="activeOption">
72
+ <gl-dropdown-item
73
+ v-for="option in predefinedOptions"
74
+ :key="option.value"
75
+ is-check-item
76
+ :is-checked="activeOption === option.name"
77
+ @click="updateValue(option)"
78
+ >
79
+ {{ option.name }}
80
+ </gl-dropdown-item>
81
+ </gl-dropdown>
82
+ </b-input-group-prepend>
83
+ <!-- @slot Allows replacement of default input field. -->
84
+ <slot>
85
+ <b-form-input
86
+ ref="input"
87
+ v-model="localValue"
88
+ :class="['gl-form-input', inputClass]"
89
+ :aria-label="label"
90
+ v-bind="$attrs"
91
+ v-on="$listeners"
92
+ @click="handleClick"
93
+ />
94
+ </slot>
95
+ <b-input-group-append v-if="$scopedSlots.append">
96
+ <!-- @slot Is rendered after the input field. -->
97
+ <slot name="append"></slot>
98
+ </b-input-group-append>
99
+ </b-input-group>
102
100
  </template>
@@ -141,7 +141,7 @@ export const Default = (args, { argTypes }) => ({
141
141
  template: template('', `<span class="gl-my-0" id="listbox-label">Select a department</span>`),
142
142
  });
143
143
  Default.args = generateProps({ ariaLabelledby: 'listbox-label' });
144
- Default.decorators = [makeContainer({ height: '150px' })];
144
+ Default.decorators = [makeContainer({ height: '370px' })];
145
145
 
146
146
  export const HeaderAndFooter = (args, { argTypes }) => ({
147
147
  props: Object.keys(argTypes),
@@ -178,7 +178,7 @@ export const HeaderAndFooter = (args, { argTypes }) => ({
178
178
  </template>`),
179
179
  });
180
180
  HeaderAndFooter.args = generateProps({ toggleText: 'Header and Footer', multiple: true });
181
- HeaderAndFooter.decorators = [makeContainer({ height: '220px' })];
181
+ HeaderAndFooter.decorators = [makeContainer({ height: '370px' })];
182
182
 
183
183
  export const CustomListItem = (args, { argTypes }) => ({
184
184
  props: Object.keys(argTypes),
@@ -26,6 +26,7 @@ const generateOptions = (seriesLength, seriesNameType) => {
26
26
  showSymbol: true,
27
27
  type: 'line',
28
28
  })),
29
+ animation: false,
29
30
  };
30
31
  };
31
32
 
@@ -13,6 +13,8 @@
13
13
 
14
14
  @import 'components';
15
15
 
16
+ @import 'storybook_dark_mode';
17
+
16
18
  /**
17
19
  * Custom padding for docs pages. This improves the integration in Pajamas pages.
18
20
  */
@@ -0,0 +1,23 @@
1
+ // conditional overrides for dark mode for use in storybook.
2
+ // Because we only use application.css from gitlab (and not
3
+ // application_dark), we need to override some base rules so
4
+ // that we can more easily test components in dark mode
5
+
6
+ // This is because dark mode in gitlab currently depends on
7
+ // overriding SCSS variables, but we want gitlab-ui dark mode
8
+ // to use Custom Properties instead
9
+
10
+ .gl-dark {
11
+ --color-body-bg: #1f1f1f;
12
+ --color-body-text: #fff;
13
+
14
+ color-scheme: dark;
15
+
16
+ &,
17
+ body {
18
+ // We can delete these once $body-bg and $body-color
19
+ // variables in variables.scss are updated to use CSS custom properties
20
+ background-color: var(--color-body-bg);
21
+ color: var(--color-body-text);
22
+ }
23
+ }