@gitlab/ui 128.0.0 → 128.2.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/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
- package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -3
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +132 -3
- package/dist/components/index.js +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +127 -127
- package/dist/tokens/build/js/tokens.js +110 -110
- package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -3
- package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +1 -2
- package/package.json +4 -4
- package/src/components/base/color_mode_toggle/color_mode_toggle.vue +65 -0
- package/src/components/index.js +1 -0
- package/src/tokens/build/css/tokens.css +24 -24
- package/src/tokens/build/css/tokens.dark.css +26 -26
- package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +82 -82
- package/src/tokens/build/docs/tokens-tailwind-docs.json +81 -81
- package/src/tokens/build/figma/constants.tokens.json +2245 -226
- package/src/tokens/build/figma/contextual.tokens.json +753 -77
- package/src/tokens/build/figma/deprecated.tokens.json +4151 -420
- package/src/tokens/build/figma/semantic.tokens.json +171 -19
- package/src/tokens/build/js/tokens.dark.js +130 -127
- package/src/tokens/build/js/tokens.js +113 -110
- package/src/tokens/build/json/tokens.dark.json +161 -161
- package/src/tokens/build/json/tokens.json +142 -142
- package/src/tokens/build/scss/_tokens.dark.scss +26 -26
- package/src/tokens/build/scss/_tokens.scss +24 -24
- package/src/tokens/constant/color.alpha.tokens.json +135 -15
- package/src/tokens/constant/color.tokens.json +2110 -211
- package/src/tokens/contextual/avatar.tokens.json +54 -6
- package/src/tokens/contextual/button.tokens.json +90 -10
- package/src/tokens/contextual/chart.tokens.json +9 -1
- package/src/tokens/contextual/illustration.tokens.json +600 -60
- package/src/tokens/deprecated/deprecated.color.data_viz.tokens.json +1100 -110
- package/src/tokens/deprecated/deprecated.color.theme.tokens.json +1440 -144
- package/src/tokens/deprecated/deprecated.color.tokens.json +1490 -149
- package/src/tokens/deprecated/deprecated.color.transparency.tokens.json +147 -43
- package/src/tokens/semantic/action.tokens.json +162 -18
- package/src/tokens/semantic/background.tokens.json +9 -1
- package/translations.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.js +0 -37
- package/dist/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.js +0 -134
- package/dist/vendor/bootstrap-vue/src/components/form-checkbox/index.js +0 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { translate } from '../../../utils/i18n';
|
|
2
|
+
import GlButton from '../button/button';
|
|
3
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
+
|
|
5
|
+
var script = {
|
|
6
|
+
name: 'GlColorModeToggle',
|
|
7
|
+
components: {
|
|
8
|
+
GlButton
|
|
9
|
+
},
|
|
10
|
+
props: {
|
|
11
|
+
/**
|
|
12
|
+
* Whether dark mode is currently active.
|
|
13
|
+
*/
|
|
14
|
+
isDarkMode: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: false,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* The label when in dark mode. Screen-reader only.
|
|
21
|
+
*/
|
|
22
|
+
darkLabel: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
default: () => translate('GlColorModeToggle.darkLabel', 'Dark mode')
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* The label when in light mode. Screen-reader only.
|
|
29
|
+
*/
|
|
30
|
+
lightLabel: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
default: () => translate('GlColorModeToggle.lightLabel', 'Light mode')
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
ariaLabel() {
|
|
38
|
+
return this.isDarkMode ? this.darkLabel : this.lightLabel;
|
|
39
|
+
},
|
|
40
|
+
iconName() {
|
|
41
|
+
return this.isDarkMode ? 'moon' : 'sun';
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
/**
|
|
46
|
+
* Emitted when the toggle button is clicked.
|
|
47
|
+
*
|
|
48
|
+
* @event toggle
|
|
49
|
+
*/
|
|
50
|
+
handleClick() {
|
|
51
|
+
this.$emit('toggle');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/* script */
|
|
57
|
+
const __vue_script__ = script;
|
|
58
|
+
|
|
59
|
+
/* template */
|
|
60
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button',{staticClass:"btn-icon",attrs:{"aria-label":_vm.ariaLabel,"category":"tertiary","icon":_vm.iconName},on:{"click":_vm.handleClick}})};
|
|
61
|
+
var __vue_staticRenderFns__ = [];
|
|
62
|
+
|
|
63
|
+
/* style */
|
|
64
|
+
const __vue_inject_styles__ = undefined;
|
|
65
|
+
/* scoped */
|
|
66
|
+
const __vue_scope_id__ = undefined;
|
|
67
|
+
/* module identifier */
|
|
68
|
+
const __vue_module_identifier__ = undefined;
|
|
69
|
+
/* functional template */
|
|
70
|
+
const __vue_is_functional_template__ = false;
|
|
71
|
+
/* style inject */
|
|
72
|
+
|
|
73
|
+
/* style inject SSR */
|
|
74
|
+
|
|
75
|
+
/* style inject shadow dom */
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
80
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
81
|
+
__vue_inject_styles__,
|
|
82
|
+
__vue_script__,
|
|
83
|
+
__vue_scope_id__,
|
|
84
|
+
__vue_is_functional_template__,
|
|
85
|
+
__vue_module_identifier__,
|
|
86
|
+
false,
|
|
87
|
+
undefined,
|
|
88
|
+
undefined,
|
|
89
|
+
undefined
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
export { __vue_component__ as default };
|
|
@@ -8,9 +8,6 @@ var script = {
|
|
|
8
8
|
name: 'GlFormCheckbox',
|
|
9
9
|
inject: {
|
|
10
10
|
getGroup: {
|
|
11
|
-
// When we remove BFormCheckboxGroup from GlFormCheckboxGroup, we can rename
|
|
12
|
-
// the `getBvCheckGroup` provide to `getCheckGroup`.
|
|
13
|
-
from: 'getBvCheckGroup',
|
|
14
11
|
default: () => () => null
|
|
15
12
|
}
|
|
16
13
|
},
|
|
@@ -1,23 +1,152 @@
|
|
|
1
|
+
import uniqueId from 'lodash/uniqueId';
|
|
2
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
|
+
import omit from 'lodash/omit';
|
|
4
|
+
import pick from 'lodash/pick';
|
|
5
|
+
import { looseEqual } from '../../../../vendor/bootstrap-vue/src/utils/loose-equal';
|
|
1
6
|
import { formOptionsMixin } from '../../../../vendor/bootstrap-vue/src/mixins/form-options';
|
|
2
|
-
import { BFormCheckboxGroup } from '../../../../vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group';
|
|
3
7
|
import { SafeHtmlDirective } from '../../../../directives/safe_html/safe_html';
|
|
4
8
|
import GlFormCheckbox from './form_checkbox';
|
|
5
9
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
6
10
|
|
|
11
|
+
// Attributes to pass down to checks/radios instead of applying them to the group
|
|
12
|
+
const PASS_DOWN_ATTRS = ['aria-describedby', 'aria-labelledby'];
|
|
7
13
|
var script = {
|
|
8
14
|
name: 'GlFormCheckboxGroup',
|
|
9
15
|
components: {
|
|
10
|
-
BFormCheckboxGroup,
|
|
11
16
|
GlFormCheckbox
|
|
12
17
|
},
|
|
13
18
|
directives: {
|
|
14
19
|
SafeHtml: SafeHtmlDirective
|
|
15
20
|
},
|
|
16
21
|
mixins: [formOptionsMixin],
|
|
22
|
+
provide() {
|
|
23
|
+
return {
|
|
24
|
+
getGroup: () => this
|
|
25
|
+
};
|
|
26
|
+
},
|
|
17
27
|
inheritAttrs: false,
|
|
18
28
|
model: {
|
|
19
29
|
prop: 'checked',
|
|
20
30
|
event: 'input'
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
/**
|
|
34
|
+
* Used to set the `id` attribute on the rendered content, and used as the base to generate any additional element IDs as needed.
|
|
35
|
+
*/
|
|
36
|
+
id: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false,
|
|
39
|
+
default: undefined
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* The current value of the checkbox.
|
|
43
|
+
*/
|
|
44
|
+
checked: {
|
|
45
|
+
type: Array,
|
|
46
|
+
required: false,
|
|
47
|
+
default: () => []
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Array of items to render in the component
|
|
51
|
+
*/
|
|
52
|
+
options: {
|
|
53
|
+
type: Array,
|
|
54
|
+
required: false,
|
|
55
|
+
default: () => []
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* When set to `true`, disables the component's functionality and places it in a disabled state.
|
|
59
|
+
*/
|
|
60
|
+
disabled: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
required: false,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Sets the value of the `name` attribute on the form control.
|
|
67
|
+
*/
|
|
68
|
+
name: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: false,
|
|
71
|
+
default: undefined
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Adds the `required` attribute to the form control.
|
|
75
|
+
*/
|
|
76
|
+
required: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
required: false,
|
|
79
|
+
default: false
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Controls the validation state appearance of the component. `true` for valid, `false` for invalid, or `null` for no validation state.
|
|
83
|
+
*/
|
|
84
|
+
state: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
required: false,
|
|
87
|
+
default: null
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Optional value to set for the 'aria-invalid' attribute. Supported values are 'true' and 'false'. If not set, the 'state' prop will dictate the value
|
|
91
|
+
*/
|
|
92
|
+
ariaInvalid: {
|
|
93
|
+
type: [Boolean, String],
|
|
94
|
+
required: false,
|
|
95
|
+
default: false
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
internalId: this.id ? this.id : uniqueId('gitlab_ui_checkbox_group_'),
|
|
101
|
+
localChecked: this.checked
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
computed: {
|
|
105
|
+
computedState() {
|
|
106
|
+
return isBoolean(this.state) ? this.state : null;
|
|
107
|
+
},
|
|
108
|
+
stateClass() {
|
|
109
|
+
if (this.computedState === true) return 'is-valid';
|
|
110
|
+
if (this.computedState === false) return 'is-invalid';
|
|
111
|
+
return null;
|
|
112
|
+
},
|
|
113
|
+
computedAriaInvalid() {
|
|
114
|
+
const {
|
|
115
|
+
ariaInvalid
|
|
116
|
+
} = this;
|
|
117
|
+
if (ariaInvalid === true || ariaInvalid === 'true' || ariaInvalid === '') {
|
|
118
|
+
return 'true';
|
|
119
|
+
}
|
|
120
|
+
return this.computedState === false ? 'true' : ariaInvalid;
|
|
121
|
+
},
|
|
122
|
+
computedAttrs() {
|
|
123
|
+
return {
|
|
124
|
+
...omit(this.$attrs, PASS_DOWN_ATTRS),
|
|
125
|
+
id: this.internalId,
|
|
126
|
+
'aria-invalid': this.computedAriaInvalid,
|
|
127
|
+
'aria-required': this.required || null
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
passDownAttrs() {
|
|
131
|
+
return pick(this.$attrs, PASS_DOWN_ATTRS);
|
|
132
|
+
},
|
|
133
|
+
groupName() {
|
|
134
|
+
// Checks/Radios tied to the same model must have the same name,
|
|
135
|
+
// especially for ARIA accessibility
|
|
136
|
+
return this.name || this.internalId;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
watch: {
|
|
140
|
+
checked(newValue) {
|
|
141
|
+
if (!looseEqual(newValue, this.localChecked)) {
|
|
142
|
+
this.localChecked = newValue;
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
localChecked(newValue, oldValue) {
|
|
146
|
+
if (!looseEqual(newValue, oldValue)) {
|
|
147
|
+
this.$emit('input', newValue);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
21
150
|
}
|
|
22
151
|
};
|
|
23
152
|
|
|
@@ -25,7 +154,7 @@ var script = {
|
|
|
25
154
|
const __vue_script__ = script;
|
|
26
155
|
|
|
27
156
|
/* template */
|
|
28
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',
|
|
157
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._b({staticClass:"gl-form-checkbox-group gl-outline-none",attrs:{"role":"group","tabindex":"-1"}},'div',_vm.computedAttrs,false),[_vm._t("first"),_vm._v(" "),_vm._l((_vm.formOptions),function(option,idx){return _c('gl-form-checkbox',_vm._b({key:idx,attrs:{"value":option.value,"disabled":option.disabled}},'gl-form-checkbox',_vm.passDownAttrs,false),[(option.html)?_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(option.html),expression:"option.html"}]}):_c('span',[_vm._v(_vm._s(option.text))])])}),_vm._v(" "),_vm._t("default")],2)};
|
|
29
158
|
var __vue_staticRenderFns__ = [];
|
|
30
159
|
|
|
31
160
|
/* style */
|
package/dist/components/index.js
CHANGED
|
@@ -74,6 +74,7 @@ export { default as GlLabel } from './base/label/label';
|
|
|
74
74
|
export { default as GlDatepicker } from './base/datepicker/datepicker';
|
|
75
75
|
export { default as GlDaterangePicker } from './base/daterange_picker/daterange_picker';
|
|
76
76
|
export { default as GlToggle } from './base/toggle/toggle';
|
|
77
|
+
export { default as GlColorModeToggle } from './base/color_mode_toggle/color_mode_toggle';
|
|
77
78
|
export { default as GlSorting } from './base/sorting/sorting';
|
|
78
79
|
export { default as GlInfiniteScroll } from './base/infinite_scroll/infinite_scroll';
|
|
79
80
|
export { default as GlAlert } from './base/alert/alert';
|