@gitlab/ui 66.0.0 → 66.1.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/toggle/toggle.js +17 -38
- 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/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/dist/utils/constants.js +0 -1
- package/package.json +8 -8
- package/src/components/base/toggle/toggle.scss +6 -35
- package/src/components/base/toggle/toggle.spec.js +26 -38
- package/src/components/base/toggle/toggle.stories.js +0 -6
- package/src/components/base/toggle/toggle.vue +55 -76
- package/src/scss/utilities.scss +24 -8
- package/src/scss/utility-mixins/flex.scss +0 -4
- package/src/scss/utility-mixins/spacing.scss +16 -0
- package/src/utils/constants.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [66.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.0.1...v66.1.0) (2023-08-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **css:** Add gl-mb-n* util classes ([12fd76f](https://gitlab.com/gitlab-org/gitlab-ui/commit/12fd76f3841823aed4a411b03e0b7bbaa151e897))
|
|
7
|
+
|
|
8
|
+
## [66.0.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v66.0.0...v66.0.1) (2023-08-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Reverts
|
|
12
|
+
|
|
13
|
+
* feat(GlToggle): Add a block level toggle ([c092403](https://gitlab.com/gitlab-org/gitlab-ui/commit/c0924031044b00711eceb8f3f63e4a5d2351c4e4))
|
|
14
|
+
|
|
1
15
|
# [66.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v65.4.0...v66.0.0) (2023-08-24)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -88,40 +88,18 @@ var script = {
|
|
|
88
88
|
};
|
|
89
89
|
},
|
|
90
90
|
computed: {
|
|
91
|
-
layoutAllowsDescription() {
|
|
92
|
-
return this.isVerticalLayout || this.isBlockLayout;
|
|
93
|
-
},
|
|
94
91
|
shouldRenderDescription() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
labelIsSrOnly() {
|
|
98
|
-
return this.labelPosition === 'hidden';
|
|
99
|
-
},
|
|
100
|
-
layoutAllowsHelp() {
|
|
101
|
-
return this.isVerticalLayout || this.isBlockLayout;
|
|
92
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
93
|
+
return Boolean(this.$scopedSlots.description || this.description) && this.isVerticalLayout;
|
|
102
94
|
},
|
|
103
95
|
shouldRenderHelp() {
|
|
104
|
-
|
|
96
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
97
|
+
return Boolean(this.$slots.help || this.help) && this.isVerticalLayout;
|
|
105
98
|
},
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
'gl-
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
labelClasses() {
|
|
112
|
-
if (this.labelIsSrOnly) return 'gl-sr-only';
|
|
113
|
-
return {
|
|
114
|
-
'gl-mb-2': this.shouldRenderDescription,
|
|
115
|
-
'gl-mb-3': !this.shouldRenderDescription && !this.isVerticalLayout
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
wrapperClasses() {
|
|
119
|
-
return {
|
|
120
|
-
'gl-flex-direction-column': this.isVerticalLayout,
|
|
121
|
-
'gl-toggle-label-inline': !this.isVerticalLayout,
|
|
122
|
-
'is-disabled': this.disabled,
|
|
123
|
-
'gl-toggle-label-position-block': this.isBlockLayout
|
|
124
|
-
};
|
|
99
|
+
toggleClasses() {
|
|
100
|
+
return [{
|
|
101
|
+
'gl-sr-only': this.labelPosition === 'hidden'
|
|
102
|
+
}, this.shouldRenderDescription ? 'gl-mb-2' : 'gl-mb-3'];
|
|
125
103
|
},
|
|
126
104
|
icon() {
|
|
127
105
|
return this.value ? 'mobile-issue-close' : 'close';
|
|
@@ -134,9 +112,6 @@ var script = {
|
|
|
134
112
|
},
|
|
135
113
|
isVerticalLayout() {
|
|
136
114
|
return this.labelPosition === 'top' || this.labelPosition === 'hidden';
|
|
137
|
-
},
|
|
138
|
-
isBlockLayout() {
|
|
139
|
-
return this.labelPosition === 'block';
|
|
140
115
|
}
|
|
141
116
|
},
|
|
142
117
|
beforeCreate() {
|
|
@@ -162,11 +137,15 @@ var script = {
|
|
|
162
137
|
const __vue_script__ = script;
|
|
163
138
|
|
|
164
139
|
/* template */
|
|
165
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-toggle-wrapper gl-display-flex gl-mb-0
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
140
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-toggle-wrapper gl-display-flex gl-mb-0",class:{
|
|
141
|
+
'gl-flex-direction-column': _vm.isVerticalLayout,
|
|
142
|
+
'gl-toggle-label-inline': !_vm.isVerticalLayout,
|
|
143
|
+
'is-disabled': _vm.disabled,
|
|
144
|
+
},attrs:{"data-testid":"toggle-wrapper"}},[_c('span',{staticClass:"gl-toggle-label gl-flex-shrink-0",class:_vm.toggleClasses,attrs:{"id":_vm.labelId,"data-testid":"toggle-label"}},[_vm._t("label",function(){return [_vm._v(_vm._s(_vm.label))]})],2),_vm._v(" "),(_vm.shouldRenderDescription)?_c('span',{staticClass:"gl-description-label gl-mb-3",attrs:{"data-testid":"toggle-description"}},[_vm._t("description",function(){return [_vm._v(_vm._s(_vm.description))]})],2):_vm._e(),_vm._v(" "),(_vm.name)?_c('input',{attrs:{"name":_vm.name,"type":"hidden"},domProps:{"value":_vm.value}}):_vm._e(),_vm._v(" "),_c('button',{staticClass:"gl-flex-shrink-0",class:{
|
|
145
|
+
'gl-toggle': true,
|
|
146
|
+
'is-checked': _vm.value,
|
|
147
|
+
'is-disabled': _vm.disabled,
|
|
148
|
+
},attrs:{"role":"switch","aria-checked":_vm.isChecked,"aria-labelledby":_vm.labelId,"aria-describedby":_vm.helpId,"aria-disabled":_vm.disabled,"type":"button"},on:{"click":function($event){$event.preventDefault();return _vm.toggleFeature.apply(null, arguments)}}},[(_vm.isLoading)?_c('gl-loading-icon',{staticClass:"toggle-loading",attrs:{"color":"light"}}):_c('span',{class:{ 'toggle-icon': true, disabled: _vm.disabled }},[_c('gl-icon',{attrs:{"name":_vm.icon,"size":16}})],1)],1),_vm._v(" "),(_vm.shouldRenderHelp)?_c('span',{staticClass:"gl-help-label",attrs:{"id":_vm.helpId,"data-testid":"toggle-help"}},[_vm._t("help",function(){return [_vm._v(_vm._s(_vm.help))]})],2):_vm._e()])};
|
|
170
149
|
var __vue_staticRenderFns__ = [];
|
|
171
150
|
|
|
172
151
|
/* style */
|