@gitlab/ui 38.5.1 → 38.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "38.5.1",
3
+ "version": "38.8.0",
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: {
@@ -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
  }
@@ -4611,6 +4719,18 @@
4611
4719
  max-width: 100vw !important;
4612
4720
  }
4613
4721
 
4722
+ .gl-md-max-w-26 {
4723
+ @include gl-media-breakpoint-up(md) {
4724
+ max-width: $gl-spacing-scale-26;
4725
+ }
4726
+ }
4727
+
4728
+ .gl-md-max-w-26\! {
4729
+ @include gl-media-breakpoint-up(md) {
4730
+ max-width: $gl-spacing-scale-26 !important;
4731
+ }
4732
+ }
4733
+
4614
4734
  .gl-md-max-w-15p {
4615
4735
  @include gl-media-breakpoint-up(md) {
4616
4736
  max-width: 15%;
@@ -6931,169 +7051,179 @@
6931
7051
  .gl-table-layout-fixed\! {
6932
7052
  table-layout: fixed !important
6933
7053
  }
6934
- .gl-text-left{
6935
- text-align: left
7054
+ .gl-text-left {
7055
+ text-align: left;
6936
7056
  }
6937
- .gl-text-left\!{
6938
- text-align: left !important
7057
+ .gl-text-left\! {
7058
+ text-align: left !important;
6939
7059
  }
6940
- .gl-text-center{
6941
- text-align: center
7060
+ .gl-text-center {
7061
+ text-align: center;
6942
7062
  }
6943
- .gl-text-center\!{
6944
- text-align: center !important
7063
+ .gl-text-center\! {
7064
+ text-align: center !important;
6945
7065
  }
6946
- .gl-text-right{
6947
- text-align: right
7066
+ .gl-text-right {
7067
+ text-align: right;
6948
7068
  }
6949
- .gl-text-right\!{
6950
- text-align: right !important
7069
+ .gl-text-right\! {
7070
+ text-align: right !important;
6951
7071
  }
6952
- .gl-reset-text-align{
6953
- text-align: inherit
7072
+ .gl-reset-text-align {
7073
+ text-align: inherit;
6954
7074
  }
6955
- .gl-reset-text-align\!{
6956
- text-align: inherit !important
7075
+ .gl-reset-text-align\! {
7076
+ text-align: inherit !important;
6957
7077
  }
6958
- .gl-text-decoration-none{
6959
- text-decoration: none
7078
+ .gl-text-decoration-none {
7079
+ text-decoration: none;
6960
7080
  }
6961
- .gl-active-text-decoration-none:active{
6962
- text-decoration: none
7081
+ .gl-active-text-decoration-none:active {
7082
+ text-decoration: none;
6963
7083
  }
6964
- .gl-focus-text-decoration-none:focus{
6965
- text-decoration: none
7084
+ .gl-focus-text-decoration-none:focus {
7085
+ text-decoration: none;
6966
7086
  }
6967
- .gl-hover-text-decoration-none:hover{
6968
- text-decoration: none
7087
+ .gl-hover-text-decoration-none:hover {
7088
+ text-decoration: none;
6969
7089
  }
6970
- .gl-text-decoration-none\!{
6971
- text-decoration: none !important
7090
+ .gl-text-decoration-none\! {
7091
+ text-decoration: none !important;
6972
7092
  }
6973
- .gl-active-text-decoration-none\!:active{
6974
- text-decoration: none !important
7093
+ .gl-active-text-decoration-none\!:active {
7094
+ text-decoration: none !important;
6975
7095
  }
6976
- .gl-focus-text-decoration-none\!:focus{
6977
- text-decoration: none !important
7096
+ .gl-focus-text-decoration-none\!:focus {
7097
+ text-decoration: none !important;
6978
7098
  }
6979
- .gl-hover-text-decoration-none\!:hover{
6980
- text-decoration: none !important
7099
+ .gl-hover-text-decoration-none\!:hover {
7100
+ text-decoration: none !important;
6981
7101
  }
6982
- .gl-text-decoration-underline{
6983
- text-decoration: underline
7102
+ .gl-text-decoration-underline {
7103
+ text-decoration: underline;
6984
7104
  }
6985
- .gl-text-decoration-underline\!{
6986
- text-decoration: underline !important
7105
+ .gl-text-decoration-underline\! {
7106
+ text-decoration: underline !important;
6987
7107
  }
6988
- .gl-reset-text-decoration-color{
6989
- text-decoration-color: inherit
7108
+ .gl-reset-text-decoration-color {
7109
+ text-decoration-color: inherit;
6990
7110
  }
6991
- .gl-reset-text-decoration-color\!{
6992
- text-decoration-color: inherit !important
7111
+ .gl-reset-text-decoration-color\! {
7112
+ text-decoration-color: inherit !important;
6993
7113
  }
6994
- .gl-text-decoration-color-gray-500{
6995
- text-decoration-color: $gray-500
7114
+ .gl-text-decoration-color-gray-500 {
7115
+ text-decoration-color: $gray-500;
6996
7116
  }
6997
- .gl-text-decoration-color-gray-500\!{
6998
- text-decoration-color: $gray-500 !important
7117
+ .gl-text-decoration-color-gray-500\! {
7118
+ text-decoration-color: $gray-500 !important;
6999
7119
  }
7000
- .gl-text-decoration-color-gray-700{
7001
- text-decoration-color: $gray-700
7120
+ .gl-text-decoration-color-gray-700 {
7121
+ text-decoration-color: $gray-700;
7002
7122
  }
7003
- .gl-text-decoration-color-gray-700\!{
7004
- text-decoration-color: $gray-700 !important
7123
+ .gl-text-decoration-color-gray-700\! {
7124
+ text-decoration-color: $gray-700 !important;
7005
7125
  }
7006
- .gl-text-decoration-color-gray-900{
7007
- text-decoration-color: $gray-900
7126
+ .gl-text-decoration-color-gray-900 {
7127
+ text-decoration-color: $gray-900;
7008
7128
  }
7009
- .gl-text-decoration-color-gray-900\!{
7010
- text-decoration-color: $gray-900 !important
7129
+ .gl-text-decoration-color-gray-900\! {
7130
+ text-decoration-color: $gray-900 !important;
7011
7131
  }
7012
- .gl-text-transform-none{
7013
- text-transform: none
7132
+ .gl-text-transform-none {
7133
+ text-transform: none;
7014
7134
  }
7015
- .gl-text-transform-none\!{
7016
- text-transform: none !important
7135
+ .gl-text-transform-none\! {
7136
+ text-transform: none !important;
7017
7137
  }
7018
- .gl-text-overflow-ellipsis{
7019
- text-overflow: ellipsis
7138
+ .gl-text-overflow-ellipsis {
7139
+ text-overflow: ellipsis;
7020
7140
  }
7021
- .gl-text-overflow-ellipsis\!{
7022
- text-overflow: ellipsis !important
7141
+ .gl-text-overflow-ellipsis\! {
7142
+ text-overflow: ellipsis !important;
7023
7143
  }
7024
- .gl-text-indent-0{
7025
- text-indent: 0
7144
+ .gl-text-indent-0 {
7145
+ text-indent: 0;
7026
7146
  }
7027
- .gl-text-indent-0\!{
7028
- text-indent: 0 !important
7147
+ .gl-text-indent-0\! {
7148
+ text-indent: 0 !important;
7029
7149
  }
7030
- .gl-text-indent-hide{
7031
- text-indent: -9999px
7150
+ .gl-text-indent-hide {
7151
+ text-indent: -9999px;
7032
7152
  }
7033
- .gl-text-indent-hide\!{
7034
- text-indent: -9999px !important
7153
+ .gl-text-indent-hide\! {
7154
+ text-indent: -9999px !important;
7035
7155
  }
7036
- .gl-white-space-normal{
7037
- white-space: normal
7156
+ .gl-white-space-normal {
7157
+ white-space: normal;
7038
7158
  }
7039
- .gl-white-space-normal\!{
7040
- white-space: normal !important
7159
+ .gl-white-space-normal\! {
7160
+ white-space: normal !important;
7041
7161
  }
7042
- .gl-white-space-nowrap{
7043
- white-space: nowrap
7162
+ .gl-white-space-nowrap {
7163
+ white-space: nowrap;
7044
7164
  }
7045
- .gl-white-space-nowrap\!{
7046
- white-space: nowrap !important
7165
+ .gl-white-space-nowrap\! {
7166
+ white-space: nowrap !important;
7047
7167
  }
7048
- .gl-white-space-pre-wrap{
7049
- white-space: pre-wrap
7168
+ .gl-white-space-pre-wrap {
7169
+ white-space: pre-wrap;
7050
7170
  }
7051
- .gl-white-space-pre-wrap\!{
7052
- white-space: pre-wrap !important
7171
+ .gl-white-space-pre-wrap\! {
7172
+ white-space: pre-wrap !important;
7053
7173
  }
7054
- .gl-white-space-pre-line{
7055
- white-space: pre-line
7174
+ .gl-white-space-pre-line {
7175
+ white-space: pre-line;
7056
7176
  }
7057
- .gl-white-space-pre-line\!{
7058
- white-space: pre-line !important
7177
+ .gl-white-space-pre-line\! {
7178
+ white-space: pre-line !important;
7059
7179
  }
7060
- .gl-word-break-all{
7061
- word-break: break-all
7180
+ .gl-md-white-space-nowrap {
7181
+ @include gl-media-breakpoint-up(md) {
7182
+ white-space: nowrap;
7183
+ }
7062
7184
  }
7063
- .gl-word-break-all\!{
7064
- word-break: break-all !important
7185
+ .gl-md-white-space-nowrap\! {
7186
+ @include gl-media-breakpoint-up(md) {
7187
+ white-space: nowrap !important;
7188
+ }
7189
+ }
7190
+ .gl-word-break-all {
7191
+ word-break: break-all;
7065
7192
  }
7066
- .gl-word-break-word{
7067
- word-break: break-word
7193
+ .gl-word-break-all\! {
7194
+ word-break: break-all !important;
7068
7195
  }
7069
- .gl-word-break-word\!{
7070
- word-break: break-word !important
7196
+ .gl-word-break-word {
7197
+ word-break: break-word;
7071
7198
  }
7072
- .gl-overflow-break-word{
7199
+ .gl-word-break-word\! {
7200
+ word-break: break-word !important;
7201
+ }
7202
+ .gl-overflow-break-word {
7073
7203
  overflow-wrap: break-word;
7074
7204
  word-wrap: break-word;
7075
- hyphens: auto
7205
+ hyphens: auto;
7076
7206
  }
7077
- .gl-overflow-break-word\!{
7207
+ .gl-overflow-break-word\! {
7078
7208
  overflow-wrap: break-word !important;
7079
7209
  word-wrap: break-word !important;
7080
- hyphens: auto !important
7210
+ hyphens: auto !important;
7081
7211
  }
7082
- .gl-str-truncated{
7083
- @include str-truncated
7212
+ .gl-str-truncated {
7213
+ @include str-truncated;
7084
7214
  }
7085
- .gl-str-truncated\!{
7086
- @include str-truncated
7215
+ .gl-str-truncated\! {
7216
+ @include str-truncated;
7087
7217
  }
7088
- .gl-text-truncate{
7218
+ .gl-text-truncate {
7089
7219
  overflow: hidden;
7090
7220
  text-overflow: ellipsis;
7091
- white-space: nowrap
7221
+ white-space: nowrap;
7092
7222
  }
7093
- .gl-text-truncate\!{
7223
+ .gl-text-truncate\! {
7094
7224
  overflow: hidden !important;
7095
7225
  text-overflow: ellipsis !important;
7096
- white-space: nowrap !important
7226
+ white-space: nowrap !important;
7097
7227
  }
7098
7228
  .gl-translate-x-0 {
7099
7229
  transform: translateX(0)