@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.
Files changed (43) hide show
  1. package/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
  2. package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -3
  3. package/dist/components/base/form/form_checkbox/form_checkbox_group.js +132 -3
  4. package/dist/components/index.js +1 -0
  5. package/dist/index.css +1 -1
  6. package/dist/index.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 +4 -4
  12. package/src/components/base/color_mode_toggle/color_mode_toggle.vue +65 -0
  13. package/src/components/index.js +1 -0
  14. package/src/tokens/build/css/tokens.css +24 -24
  15. package/src/tokens/build/css/tokens.dark.css +26 -26
  16. package/src/tokens/build/docs/tokens-tailwind-docs.dark.json +82 -82
  17. package/src/tokens/build/docs/tokens-tailwind-docs.json +81 -81
  18. package/src/tokens/build/figma/constants.tokens.json +2245 -226
  19. package/src/tokens/build/figma/contextual.tokens.json +753 -77
  20. package/src/tokens/build/figma/deprecated.tokens.json +4151 -420
  21. package/src/tokens/build/figma/semantic.tokens.json +171 -19
  22. package/src/tokens/build/js/tokens.dark.js +130 -127
  23. package/src/tokens/build/js/tokens.js +113 -110
  24. package/src/tokens/build/json/tokens.dark.json +161 -161
  25. package/src/tokens/build/json/tokens.json +142 -142
  26. package/src/tokens/build/scss/_tokens.dark.scss +26 -26
  27. package/src/tokens/build/scss/_tokens.scss +24 -24
  28. package/src/tokens/constant/color.alpha.tokens.json +135 -15
  29. package/src/tokens/constant/color.tokens.json +2110 -211
  30. package/src/tokens/contextual/avatar.tokens.json +54 -6
  31. package/src/tokens/contextual/button.tokens.json +90 -10
  32. package/src/tokens/contextual/chart.tokens.json +9 -1
  33. package/src/tokens/contextual/illustration.tokens.json +600 -60
  34. package/src/tokens/deprecated/deprecated.color.data_viz.tokens.json +1100 -110
  35. package/src/tokens/deprecated/deprecated.color.theme.tokens.json +1440 -144
  36. package/src/tokens/deprecated/deprecated.color.tokens.json +1490 -149
  37. package/src/tokens/deprecated/deprecated.color.transparency.tokens.json +147 -43
  38. package/src/tokens/semantic/action.tokens.json +162 -18
  39. package/src/tokens/semantic/background.tokens.json +9 -1
  40. package/translations.js +2 -0
  41. package/dist/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.js +0 -37
  42. package/dist/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.js +0 -134
  43. package/dist/vendor/bootstrap-vue/src/components/form-checkbox/index.js +0 -2
@@ -1,134 +0,0 @@
1
- import { extend } from '../../vue';
2
- import { NAME_FORM_CHECKBOX } from '../../constants/components';
3
- import { EVENT_NAME_CHANGE, MODEL_EVENT_NAME_PREFIX } from '../../constants/events';
4
- import { PROP_TYPE_BOOLEAN, PROP_TYPE_ANY } from '../../constants/props';
5
- import { isArray } from '../../utils/inspect';
6
- import { looseEqual } from '../../utils/loose-equal';
7
- import { looseIndexOf } from '../../utils/loose-index-of';
8
- import { sortKeys } from '../../utils/object';
9
- import { makePropsConfigurable, makeProp } from '../../utils/props';
10
- import { props as props$1, formRadioCheckMixin, MODEL_EVENT_NAME } from '../../mixins/form-radio-check';
11
-
12
- // --- Constants ---
13
-
14
- const MODEL_PROP_NAME_INDETERMINATE = 'indeterminate';
15
- const MODEL_EVENT_NAME_INDETERMINATE = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_INDETERMINATE;
16
-
17
- // --- Props ---
18
-
19
- const props = makePropsConfigurable(sortKeys({
20
- ...props$1,
21
- // Not applicable in multi-check mode
22
- [MODEL_PROP_NAME_INDETERMINATE]: makeProp(PROP_TYPE_BOOLEAN, false),
23
- // Custom switch styling
24
- switch: makeProp(PROP_TYPE_BOOLEAN, false),
25
- // Not applicable in multi-check mode
26
- uncheckedValue: makeProp(PROP_TYPE_ANY, false),
27
- value: makeProp(PROP_TYPE_ANY, true)
28
- }), NAME_FORM_CHECKBOX);
29
-
30
- // --- Main component ---
31
-
32
- // @vue/component
33
- const BFormCheckbox = /*#__PURE__*/extend({
34
- name: NAME_FORM_CHECKBOX,
35
- mixins: [formRadioCheckMixin],
36
- inject: {
37
- getBvGroup: {
38
- from: 'getBvCheckGroup',
39
- default: () => () => null
40
- }
41
- },
42
- props,
43
- computed: {
44
- bvGroup() {
45
- return this.getBvGroup();
46
- },
47
- isChecked() {
48
- const {
49
- value,
50
- computedLocalChecked: checked
51
- } = this;
52
- return isArray(checked) ? looseIndexOf(checked, value) > -1 : looseEqual(checked, value);
53
- },
54
- isRadio() {
55
- return false;
56
- }
57
- },
58
- watch: {
59
- [MODEL_PROP_NAME_INDETERMINATE](newValue, oldValue) {
60
- if (!looseEqual(newValue, oldValue)) {
61
- this.setIndeterminate(newValue);
62
- }
63
- }
64
- },
65
- mounted() {
66
- // Set initial indeterminate state
67
- this.setIndeterminate(this[MODEL_PROP_NAME_INDETERMINATE]);
68
- },
69
- methods: {
70
- computedLocalCheckedWatcher(newValue, oldValue) {
71
- if (!looseEqual(newValue, oldValue)) {
72
- this.$emit(MODEL_EVENT_NAME, newValue);
73
- const $input = this.$refs.input;
74
- if ($input) {
75
- this.$emit(MODEL_EVENT_NAME_INDETERMINATE, $input.indeterminate);
76
- }
77
- }
78
- },
79
- handleChange(_ref) {
80
- let {
81
- target: {
82
- checked,
83
- indeterminate
84
- }
85
- } = _ref;
86
- const {
87
- value,
88
- uncheckedValue
89
- } = this;
90
-
91
- // Update `computedLocalChecked`
92
- let localChecked = this.computedLocalChecked;
93
- if (isArray(localChecked)) {
94
- const index = looseIndexOf(localChecked, value);
95
- if (checked && index < 0) {
96
- // Add value to array
97
- localChecked = localChecked.concat(value);
98
- } else if (!checked && index > -1) {
99
- // Remove value from array
100
- localChecked = localChecked.slice(0, index).concat(localChecked.slice(index + 1));
101
- }
102
- } else {
103
- localChecked = checked ? value : uncheckedValue;
104
- }
105
- this.computedLocalChecked = localChecked;
106
-
107
- // Fire events in a `$nextTick()` to ensure the `v-model` is updated
108
- this.$nextTick(() => {
109
- // Change is only emitted on user interaction
110
- this.$emit(EVENT_NAME_CHANGE, localChecked);
111
-
112
- // If this is a child of a group, we emit a change event on it as well
113
- if (this.isGroup) {
114
- this.bvGroup.$emit(EVENT_NAME_CHANGE, localChecked);
115
- }
116
- this.$emit(MODEL_EVENT_NAME_INDETERMINATE, indeterminate);
117
- });
118
- },
119
- setIndeterminate(state) {
120
- // Indeterminate only supported in single checkbox mode
121
- if (isArray(this.computedLocalChecked)) {
122
- state = false;
123
- }
124
- const $input = this.$refs.input;
125
- if ($input) {
126
- $input.indeterminate = state;
127
- // Emit update event to prop
128
- this.$emit(MODEL_EVENT_NAME_INDETERMINATE, state);
129
- }
130
- }
131
- }
132
- });
133
-
134
- export { BFormCheckbox, props };
@@ -1,2 +0,0 @@
1
- export { BFormCheckbox } from './form-checkbox';
2
- export { BFormCheckboxGroup } from './form-checkbox-group';