@gitlab/ui 38.6.0 → 38.8.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "38.6.0",
3
+ "version": "38.8.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -114,6 +114,7 @@
114
114
  "eslint": "7.32.0",
115
115
  "eslint-import-resolver-jest": "3.0.2",
116
116
  "eslint-plugin-cypress": "2.12.1",
117
+ "eslint-plugin-storybook": "^0.5.7",
117
118
  "file-loader": "^4.2.0",
118
119
  "glob": "^7.2.0",
119
120
  "identity-obj-proxy": "^3.0.0",
@@ -180,6 +180,7 @@ export default {
180
180
  this.applyNewValue(cloneDeep(newValue));
181
181
  }
182
182
  },
183
+ deep: true,
183
184
  immediate: true,
184
185
  },
185
186
  },
@@ -13,16 +13,15 @@
13
13
  @include form-control-focus($ignore-warning: true);
14
14
  @include gl-appearance-none;
15
15
 
16
- &[type='color']:read-only {
17
- cursor: pointer;
18
- }
19
-
20
16
  &:disabled,
21
17
  &:not(.form-control-plaintext):not([type='color']):read-only {
22
18
  @include gl-bg-gray-10;
23
- @include gl-text-gray-400;
24
19
  @include gl-inset-border-1-gray-100;
20
+ }
21
+
22
+ &:disabled {
25
23
  @include gl-cursor-not-allowed;
24
+ @include gl-text-gray-400;
26
25
  }
27
26
 
28
27
  &:not(.form-control-plaintext):focus {
@@ -5,6 +5,7 @@ import readme from './form_input.md';
5
5
  const template = `
6
6
  <gl-form-input
7
7
  type="text"
8
+ :readonly="readonly"
8
9
  :disabled="disabled"
9
10
  :value="value"
10
11
  :size="size"
@@ -14,10 +15,12 @@ const generateProps = ({
14
15
  size = GlFormInput.props.size.default,
15
16
  value = '',
16
17
  disabled = false,
18
+ readonly = false,
17
19
  } = {}) => ({
18
20
  size,
19
21
  value,
20
22
  disabled,
23
+ readonly,
21
24
  });
22
25
 
23
26
  const Template = (args) => ({
@@ -32,6 +35,9 @@ Default.args = generateProps();
32
35
  export const Disabled = Template.bind({});
33
36
  Disabled.args = generateProps({ value: 'some text', disabled: true });
34
37
 
38
+ export const Readonly = Template.bind({});
39
+ Readonly.args = generateProps({ value: 'readonly text', readonly: true });
40
+
35
41
  export const Sizes = (args, { argTypes }) => ({
36
42
  components: { GlFormInput },
37
43
  props: Object.keys(argTypes),
@@ -25,7 +25,7 @@ const generateTemplate = ({ props = {}, slots = {} } = {}) => {
25
25
  :action-primary="{text: 'Okay'}"
26
26
  :action-secondary="{text: 'Discard Changes'}"
27
27
  :action-cancel="{text: 'Cancel'}"
28
- :visible="visible"
28
+ :visible="$options.viewMode !== 'docs'"
29
29
  :scrollable="scrollable"
30
30
  modal-id="test-modal-id"
31
31
  title="Example title"
@@ -42,18 +42,18 @@ const generateTemplate = ({ props = {}, slots = {} } = {}) => {
42
42
  `;
43
43
  };
44
44
 
45
- const Template = (args, { argTypes }) => ({
45
+ const Template = (args, { argTypes, viewMode }) => ({
46
46
  components: { GlModal, GlButton },
47
47
  directives: { GlModalDirective },
48
48
  props: Object.keys(argTypes),
49
49
  template: generateTemplate(),
50
+ viewMode,
50
51
  });
51
52
 
52
53
  const generateProps = ({
53
54
  variant = variantOptionsWithNoDefault.default,
54
55
  contentPagraphs = 1,
55
56
  scrollable = false,
56
- visible = false,
57
57
  } = {}) => ({
58
58
  headerBgVariant: variant,
59
59
  headerBorderVariant: variant,
@@ -65,23 +65,18 @@ const generateProps = ({
65
65
  footerTextVariant: variant,
66
66
  contentParagraphs: contentPagraphs,
67
67
  scrollable,
68
- visible,
69
68
  });
70
69
 
71
70
  export const Default = Template.bind({});
72
71
  Default.args = generateProps();
73
72
 
74
- export const OpenedModal = Template.bind({});
75
- OpenedModal.args = generateProps({ visible: true });
76
-
77
73
  export const WithScrollingContent = Template.bind({});
78
74
  WithScrollingContent.args = generateProps({
79
75
  contentPagraphs: 100,
80
76
  scrollable: true,
81
- visible: true,
82
77
  });
83
78
 
84
- export const WithAHeader = (args, { argTypes }) => ({
79
+ export const WithAHeader = (args, { argTypes, viewMode }) => ({
85
80
  components: { GlModal, GlButton },
86
81
  directives: { GlModalDirective },
87
82
  props: Object.keys(argTypes),
@@ -90,22 +85,24 @@ export const WithAHeader = (args, { argTypes }) => ({
90
85
  'modal-header': '<h4>A custom header</h4>',
91
86
  },
92
87
  }),
88
+ viewMode,
93
89
  });
94
- WithAHeader.args = generateProps({ visible: true });
90
+ WithAHeader.args = generateProps();
95
91
 
96
- export const WithoutAFooter = (args, { argTypes }) => ({
92
+ export const WithoutAFooter = (args, { argTypes, viewMode }) => ({
97
93
  components: { GlModal, GlButton },
98
94
  directives: { GlModalDirective },
99
95
  props: Object.keys(argTypes),
100
96
  template: generateTemplate({
101
97
  props: { 'hide-footer': true },
102
98
  }),
99
+ viewMode,
103
100
  });
104
- WithoutAFooter.args = generateProps({ visible: true });
101
+ WithoutAFooter.args = generateProps();
105
102
 
106
103
  export default {
107
104
  title: 'base/modal',
108
- components: { GlModal, GlButton },
105
+ component: GlModal,
109
106
  directives: { GlModalDirective },
110
107
  bootstrapComponent: 'b-modal',
111
108
  parameters: {
@@ -35,13 +35,14 @@ const Template = (_args, { argTypes }) => ({
35
35
  });
36
36
 
37
37
  export const Default = Template.bind({});
38
- Default.args = generateProps();
38
+ Default.args = generateProps({ color: '' });
39
39
 
40
40
  export const WithLongName = Template.bind({});
41
- WithLongName.args = generateProps({ text: SERIES_NAME[SERIES_NAME_LONG] });
41
+ WithLongName.args = generateProps({ color: '', text: SERIES_NAME[SERIES_NAME_LONG] });
42
42
 
43
43
  export const WithLongNameWithNoSpaces = Template.bind({});
44
44
  WithLongNameWithNoSpaces.args = generateProps({
45
+ color: '',
45
46
  text: SERIES_NAME[SERIES_NAME_LONG_WITHOUT_SPACES],
46
47
  });
47
48
 
@@ -71,10 +72,6 @@ export default {
71
72
  },
72
73
  },
73
74
  argTypes: {
74
- type: {
75
- control: 'select',
76
- options: ['solid', 'dashed'],
77
- },
78
75
  color: {
79
76
  control: 'color',
80
77
  },
@@ -12,9 +12,6 @@ export default {
12
12
  type: String,
13
13
  required: false,
14
14
  default: 'solid',
15
- validator(value) {
16
- return ['solid', 'dashed'].indexOf(value) !== -1;
17
- },
18
15
  },
19
16
  },
20
17
  data() {
@@ -26,6 +26,7 @@ Default.parameters = {
26
26
 
27
27
  export default {
28
28
  title: 'directives/outside-directive',
29
+ component: GlOutsideDirective,
29
30
  parameters: {
30
31
  knobs: { disable: true },
31
32
  docs: {
@@ -39,6 +39,7 @@ Default.parameters = {
39
39
  },
40
40
  };
41
41
 
42
+ // eslint-disable-next-line storybook/csf-component
42
43
  export default {
43
44
  title: 'scss/typescale',
44
45
  parameters: {
@@ -2561,6 +2561,18 @@
2561
2561
  display: none !important;
2562
2562
  }
2563
2563
 
2564
+ .gl-xs-display-none {
2565
+ @include gl-media-breakpoint-down(sm) {
2566
+ display: none;
2567
+ }
2568
+ }
2569
+
2570
+ .gl-xs-display-none\! {
2571
+ @include gl-media-breakpoint-down(sm) {
2572
+ display: none !important;
2573
+ }
2574
+ }
2575
+
2564
2576
  .gl-sm-display-none {
2565
2577
  @include gl-media-breakpoint-up(sm) {
2566
2578
  display: none;
@@ -2605,6 +2617,18 @@
2605
2617
  display: flex !important;
2606
2618
  }
2607
2619
 
2620
+ .gl-xs-display-flex {
2621
+ @include gl-media-breakpoint-down(sm) {
2622
+ display: flex;
2623
+ }
2624
+ }
2625
+
2626
+ .gl-xs-display-flex\! {
2627
+ @include gl-media-breakpoint-down(sm) {
2628
+ display: flex !important;
2629
+ }
2630
+ }
2631
+
2608
2632
  .gl-sm-display-flex {
2609
2633
  @include gl-media-breakpoint-up(sm) {
2610
2634
  display: flex;
@@ -2649,6 +2673,18 @@
2649
2673
  display: inline-flex !important;
2650
2674
  }
2651
2675
 
2676
+ .gl-xs-display-inline-flex {
2677
+ @include gl-media-breakpoint-down(sm) {
2678
+ display: inline-flex;
2679
+ }
2680
+ }
2681
+
2682
+ .gl-xs-display-inline-flex\! {
2683
+ @include gl-media-breakpoint-down(sm) {
2684
+ display: inline-flex !important;
2685
+ }
2686
+ }
2687
+
2652
2688
  .gl-sm-display-inline-flex {
2653
2689
  @include gl-media-breakpoint-up(sm) {
2654
2690
  display: inline-flex;
@@ -2693,6 +2729,18 @@
2693
2729
  display: block !important;
2694
2730
  }
2695
2731
 
2732
+ .gl-xs-display-block {
2733
+ @include gl-media-breakpoint-down(sm) {
2734
+ display: block;
2735
+ }
2736
+ }
2737
+
2738
+ .gl-xs-display-block\! {
2739
+ @include gl-media-breakpoint-down(sm) {
2740
+ display: block !important;
2741
+ }
2742
+ }
2743
+
2696
2744
  .gl-sm-display-block {
2697
2745
  @include gl-media-breakpoint-up(sm) {
2698
2746
  display: block;
@@ -2737,6 +2785,18 @@
2737
2785
  display: inline !important;
2738
2786
  }
2739
2787
 
2788
+ .gl-xs-display-inline {
2789
+ @include gl-media-breakpoint-down(sm) {
2790
+ display: inline;
2791
+ }
2792
+ }
2793
+
2794
+ .gl-xs-display-inline\! {
2795
+ @include gl-media-breakpoint-down(sm) {
2796
+ display: inline !important;
2797
+ }
2798
+ }
2799
+
2740
2800
  .gl-sm-display-inline {
2741
2801
  @include gl-media-breakpoint-up(sm) {
2742
2802
  display: inline;
@@ -2781,6 +2841,18 @@
2781
2841
  display: inline-block !important;
2782
2842
  }
2783
2843
 
2844
+ .gl-xs-display-inline-block {
2845
+ @include gl-media-breakpoint-down(sm) {
2846
+ display: inline-block;
2847
+ }
2848
+ }
2849
+
2850
+ .gl-xs-display-inline-block\! {
2851
+ @include gl-media-breakpoint-down(sm) {
2852
+ display: inline-block !important;
2853
+ }
2854
+ }
2855
+
2784
2856
  .gl-sm-display-inline-block {
2785
2857
  @include gl-media-breakpoint-up(sm) {
2786
2858
  display: inline-block;
@@ -4227,6 +4299,42 @@
4227
4299
  }
4228
4300
  }
4229
4301
 
4302
+ .gl-sm-w-full {
4303
+ @include gl-media-breakpoint-up(sm) {
4304
+ width: 100%;
4305
+ }
4306
+ }
4307
+
4308
+ .gl-sm-w-full\! {
4309
+ @include gl-media-breakpoint-up(sm) {
4310
+ width: 100% !important;
4311
+ }
4312
+ }
4313
+
4314
+ .gl-md-w-full {
4315
+ @include gl-media-breakpoint-up(md) {
4316
+ width: 100%;
4317
+ }
4318
+ }
4319
+
4320
+ .gl-md-w-full\! {
4321
+ @include gl-media-breakpoint-up(md) {
4322
+ width: 100% !important;
4323
+ }
4324
+ }
4325
+
4326
+ .gl-lg-w-full {
4327
+ @include gl-media-breakpoint-up(lg) {
4328
+ width: 100%;
4329
+ }
4330
+ }
4331
+
4332
+ .gl-lg-w-full\! {
4333
+ @include gl-media-breakpoint-up(lg) {
4334
+ width: 100% !important;
4335
+ }
4336
+ }
4337
+
4230
4338
  .gl-w-max-content {
4231
4339
  width: max-content;
4232
4340
  }
@@ -7,6 +7,12 @@
7
7
  display: none;
8
8
  }
9
9
 
10
+ @mixin gl-xs-display-none {
11
+ @include gl-media-breakpoint-down(sm) {
12
+ @include gl-display-none;
13
+ }
14
+ }
15
+
10
16
  @mixin gl-sm-display-none {
11
17
  @include gl-media-breakpoint-up(sm) {
12
18
  @include gl-display-none;
@@ -29,6 +35,12 @@
29
35
  display: flex;
30
36
  }
31
37
 
38
+ @mixin gl-xs-display-flex {
39
+ @include gl-media-breakpoint-down(sm) {
40
+ @include gl-display-flex;
41
+ }
42
+ }
43
+
32
44
  @mixin gl-sm-display-flex {
33
45
  @include gl-media-breakpoint-up(sm) {
34
46
  @include gl-display-flex;
@@ -51,6 +63,12 @@
51
63
  display: inline-flex;
52
64
  }
53
65
 
66
+ @mixin gl-xs-display-inline-flex {
67
+ @include gl-media-breakpoint-down(sm) {
68
+ @include gl-display-inline-flex;
69
+ }
70
+ }
71
+
54
72
  @mixin gl-sm-display-inline-flex {
55
73
  @include gl-media-breakpoint-up(sm) {
56
74
  @include gl-display-inline-flex;
@@ -73,6 +91,12 @@
73
91
  display: block;
74
92
  }
75
93
 
94
+ @mixin gl-xs-display-block {
95
+ @include gl-media-breakpoint-down(sm) {
96
+ @include gl-display-block;
97
+ }
98
+ }
99
+
76
100
  @mixin gl-sm-display-block {
77
101
  @include gl-media-breakpoint-up(sm) {
78
102
  @include gl-display-block;
@@ -95,6 +119,12 @@
95
119
  display: inline;
96
120
  }
97
121
 
122
+ @mixin gl-xs-display-inline {
123
+ @include gl-media-breakpoint-down(sm) {
124
+ @include gl-display-inline;
125
+ }
126
+ }
127
+
98
128
  @mixin gl-sm-display-inline {
99
129
  @include gl-media-breakpoint-up(sm) {
100
130
  @include gl-display-inline;
@@ -117,6 +147,12 @@
117
147
  display: inline-block;
118
148
  }
119
149
 
150
+ @mixin gl-xs-display-inline-block {
151
+ @include gl-media-breakpoint-down(sm) {
152
+ @include gl-display-inline-block;
153
+ }
154
+ }
155
+
120
156
  @mixin gl-sm-display-inline-block {
121
157
  @include gl-media-breakpoint-up(sm) {
122
158
  @include gl-display-inline-block;
@@ -128,6 +128,24 @@
128
128
  }
129
129
  }
130
130
 
131
+ @mixin gl-sm-w-full {
132
+ @include gl-media-breakpoint-up(sm) {
133
+ @include gl-w-full;
134
+ }
135
+ }
136
+
137
+ @mixin gl-md-w-full {
138
+ @include gl-media-breakpoint-up(md) {
139
+ @include gl-w-full;
140
+ }
141
+ }
142
+
143
+ @mixin gl-lg-w-full {
144
+ @include gl-media-breakpoint-up(lg) {
145
+ @include gl-w-full;
146
+ }
147
+ }
148
+
131
149
  @mixin gl-w-max-content {
132
150
  width: max-content;
133
151
  }