@gitlab/ui 128.0.0 → 128.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.
Files changed (40) hide show
  1. package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -3
  2. package/dist/components/base/form/form_checkbox/form_checkbox_group.js +132 -3
  3. package/dist/index.css +1 -1
  4. package/dist/index.css.map +1 -1
  5. package/dist/tailwind.css +1 -1
  6. package/dist/tailwind.css.map +1 -1
  7. package/dist/tokens/build/js/tokens.dark.js +127 -127
  8. package/dist/tokens/build/js/tokens.js +110 -110
  9. package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -3
  10. package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +1 -2
  11. package/package.json +1 -1
  12. package/src/tokens/build/css/tokens.css +24 -24
  13. package/src/tokens/build/css/tokens.dark.css +26 -26
  14. package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +82 -82
  15. package/src/tokens/build/docs/tokens-tailwind-docs.json +81 -81
  16. package/src/tokens/build/figma/constants.tokens.json +2245 -226
  17. package/src/tokens/build/figma/contextual.tokens.json +753 -77
  18. package/src/tokens/build/figma/deprecated.tokens.json +4151 -420
  19. package/src/tokens/build/figma/semantic.tokens.json +171 -19
  20. package/src/tokens/build/js/tokens.dark.js +130 -127
  21. package/src/tokens/build/js/tokens.js +113 -110
  22. package/src/tokens/build/json/tokens.dark.json +161 -161
  23. package/src/tokens/build/json/tokens.json +142 -142
  24. package/src/tokens/build/scss/_tokens.dark.scss +26 -26
  25. package/src/tokens/build/scss/_tokens.scss +24 -24
  26. package/src/tokens/constant/color.alpha.tokens.json +135 -15
  27. package/src/tokens/constant/color.tokens.json +2110 -211
  28. package/src/tokens/contextual/avatar.tokens.json +54 -6
  29. package/src/tokens/contextual/button.tokens.json +90 -10
  30. package/src/tokens/contextual/chart.tokens.json +9 -1
  31. package/src/tokens/contextual/illustration.tokens.json +600 -60
  32. package/src/tokens/deprecated/deprecated.color.data_viz.tokens.json +1100 -110
  33. package/src/tokens/deprecated/deprecated.color.theme.tokens.json +1440 -144
  34. package/src/tokens/deprecated/deprecated.color.tokens.json +1490 -149
  35. package/src/tokens/deprecated/deprecated.color.transparency.tokens.json +147 -43
  36. package/src/tokens/semantic/action.tokens.json +162 -18
  37. package/src/tokens/semantic/background.tokens.json +9 -1
  38. package/dist/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.js +0 -37
  39. package/dist/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.js +0 -134
  40. package/dist/vendor/bootstrap-vue/src/components/form-checkbox/index.js +0 -2
@@ -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',[_c('b-form-checkbox-group',_vm._b({staticClass:"gl-form-checkbox-group",attrs:{"stacked":""},on:{"change":function($event){return _vm.$emit('change', $event)},"input":function($event){return _vm.$emit('input', $event)}}},'b-form-checkbox-group',_vm.$attrs,false),[_vm._t("first"),_vm._v(" "),_vm._l((_vm.formOptions),function(option,idx){return _c('gl-form-checkbox',{key:idx,attrs:{"value":option.value,"disabled":option.disabled}},[(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)],1)};
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 */