@gitlab/ui 134.2.0 → 134.3.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/nav_item/nav_item.js +122 -0
- package/dist/components/index.js +1 -0
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +20 -1
- package/dist/tokens/build/js/tokens.js +20 -1
- package/package.json +8 -8
- package/src/components/base/nav_item/nav_item.scss +90 -0
- package/src/components/base/nav_item/nav_item.vue +156 -0
- package/src/components/index.js +1 -0
- package/src/scss/components.scss +1 -0
- package/src/tokens/build/css/tokens.css +19 -0
- package/src/tokens/build/css/tokens.dark.css +19 -0
- package/src/tokens/build/figma/mode.dark.json +190 -0
- package/src/tokens/build/figma/mode.json +190 -0
- package/src/tokens/build/js/tokens.dark.js +19 -0
- package/src/tokens/build/js/tokens.js +19 -0
- package/src/tokens/build/json/tokens.dark.json +658 -0
- package/src/tokens/build/json/tokens.json +658 -0
- package/src/tokens/build/scss/_tokens.dark.scss +19 -0
- package/src/tokens/build/scss/_tokens.scss +19 -0
- package/src/tokens/build/scss/_tokens_custom_properties.scss +19 -0
- package/src/tokens/contextual/nav.tokens.json +218 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import GlAnimatedChevronRightDownIcon from '../animated_icon/animated_chevron_right_down_icon';
|
|
2
|
+
import GlIcon from '../icon/icon';
|
|
3
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
+
|
|
5
|
+
var script = {
|
|
6
|
+
name: 'GlNavItem',
|
|
7
|
+
components: {
|
|
8
|
+
GlAnimatedChevronRightDownIcon,
|
|
9
|
+
GlIcon
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
/**
|
|
13
|
+
* Link href attribute
|
|
14
|
+
*/
|
|
15
|
+
href: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
default: null
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Icon name
|
|
22
|
+
*/
|
|
23
|
+
icon: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false,
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Is icon only
|
|
30
|
+
*/
|
|
31
|
+
isIconOnly: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: false,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* Is parent
|
|
38
|
+
*/
|
|
39
|
+
isParent: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
required: false,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Expanded
|
|
46
|
+
*/
|
|
47
|
+
expanded: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
required: false,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Is currently selected
|
|
54
|
+
*/
|
|
55
|
+
selected: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
required: false,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Router link to property
|
|
62
|
+
*/
|
|
63
|
+
to: {
|
|
64
|
+
type: [String, Object],
|
|
65
|
+
required: false,
|
|
66
|
+
default: null
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
computed: {
|
|
70
|
+
ariaExpanded() {
|
|
71
|
+
return this.isParent ? String(this.expanded) : null;
|
|
72
|
+
},
|
|
73
|
+
classes() {
|
|
74
|
+
return ['gl-nav-item', {
|
|
75
|
+
'gl-nav-item-is-icon-only': this.isIconOnly,
|
|
76
|
+
'gl-nav-item-has-start-slot': this.icon || Boolean(this.$scopedSlots.icon),
|
|
77
|
+
'gl-nav-item-has-end-slot': Boolean(this.$scopedSlots.end) || this.isParent,
|
|
78
|
+
selected: this.selected
|
|
79
|
+
}];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/* script */
|
|
85
|
+
const __vue_script__ = script;
|
|
86
|
+
|
|
87
|
+
/* template */
|
|
88
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.to)?_c('router-link',{attrs:{"to":_vm.to,"active-class":"selected","custom":""},scopedSlots:_vm._u([{key:"default",fn:function(ref){
|
|
89
|
+
var navigate = ref.navigate;
|
|
90
|
+
return [_c('a',{class:_vm.classes,attrs:{"aria-current":_vm.selected ? 'page' : null},on:{"click":navigate}},[(_vm.icon || _vm.$scopedSlots.icon)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-start"}},[_vm._t("icon",function(){return [_c('gl-icon',{attrs:{"name":_vm.icon}})]})],2):_vm._e(),_vm._v(" "),(!_vm.isIconOnly)?[(_vm.$scopedSlots.default)?_c('span',{staticClass:"gl-nav-item-label",attrs:{"data-testid":"nav-item-label"}},[_vm._t("default",null,{"isActive":_vm.selected})],2):_vm._e(),_vm._v(" "),(_vm.$scopedSlots.end)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-end"}},[_vm._t("end")],2):_vm._e()]:_vm._e()],2)]}}],null,true)}):(_vm.href)?_c('a',{class:_vm.classes,attrs:{"href":_vm.href,"aria-current":_vm.selected ? 'page' : null},on:{"click":function($event){return _vm.$emit('click')},"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"escape",undefined,$event.key,undefined)){ return null; }return _vm.$emit('escape')},"pointerover":function($event){return _vm.$emit('pointerover', $event)},"pointerleave":function($event){return _vm.$emit('pointerleave', $event)}}},[(_vm.icon || _vm.$scopedSlots.icon)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-start"}},[_vm._t("icon",function(){return [_c('gl-icon',{attrs:{"name":_vm.icon}})]})],2):_vm._e(),_vm._v(" "),(!_vm.isIconOnly)?[(_vm.$scopedSlots.default)?_c('span',{staticClass:"gl-nav-item-label",attrs:{"data-testid":"nav-item-label"}},[_vm._t("default")],2):_vm._e(),_vm._v(" "),(_vm.$scopedSlots.end)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-end"}},[_vm._t("end")],2):_vm._e()]:_vm._e()],2):_c('button',{class:_vm.classes,attrs:{"aria-expanded":_vm.ariaExpanded},on:{"click":function($event){return _vm.$emit('click')},"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"escape",undefined,$event.key,undefined)){ return null; }return _vm.$emit('escape')},"pointerover":function($event){return _vm.$emit('pointerover', $event)},"pointerleave":function($event){return _vm.$emit('pointerleave', $event)}}},[(_vm.icon || _vm.$scopedSlots.icon)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-start"}},[_vm._t("icon",function(){return [_c('gl-icon',{attrs:{"name":_vm.icon}})]})],2):_vm._e(),_vm._v(" "),(!_vm.isIconOnly)?[(_vm.$scopedSlots.default)?_c('span',{staticClass:"gl-nav-item-label",attrs:{"data-testid":"nav-item-label"}},[_vm._t("default")],2):_vm._e(),_vm._v(" "),(_vm.$scopedSlots.end)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-end"}},[_vm._t("end")],2):(_vm.isParent)?_c('span',{staticClass:"gl-nav-item-slot",attrs:{"data-testid":"nav-item-chevron"}},[_c('gl-animated-chevron-right-down-icon',{staticClass:"gl-nav-item-chevron",attrs:{"is-on":_vm.expanded}})],1):_vm._e()]:_vm._e()],2)};
|
|
91
|
+
var __vue_staticRenderFns__ = [];
|
|
92
|
+
|
|
93
|
+
/* style */
|
|
94
|
+
const __vue_inject_styles__ = undefined;
|
|
95
|
+
/* scoped */
|
|
96
|
+
const __vue_scope_id__ = undefined;
|
|
97
|
+
/* module identifier */
|
|
98
|
+
const __vue_module_identifier__ = undefined;
|
|
99
|
+
/* functional template */
|
|
100
|
+
const __vue_is_functional_template__ = false;
|
|
101
|
+
/* style inject */
|
|
102
|
+
|
|
103
|
+
/* style inject SSR */
|
|
104
|
+
|
|
105
|
+
/* style inject shadow dom */
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
110
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
111
|
+
__vue_inject_styles__,
|
|
112
|
+
__vue_script__,
|
|
113
|
+
__vue_scope_id__,
|
|
114
|
+
__vue_is_functional_template__,
|
|
115
|
+
__vue_module_identifier__,
|
|
116
|
+
false,
|
|
117
|
+
undefined,
|
|
118
|
+
undefined,
|
|
119
|
+
undefined
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export { __vue_component__ as default };
|
package/dist/components/index.js
CHANGED
|
@@ -93,6 +93,7 @@ export { default as GlBroadcastMessage } from './base/broadcast_message/broadcas
|
|
|
93
93
|
export { default as GlCollapse } from './base/collapse/collapse';
|
|
94
94
|
export { default as GlAccordion } from './base/accordion/accordion';
|
|
95
95
|
export { default as GlAccordionItem } from './base/accordion/accordion_item';
|
|
96
|
+
export { default as GlNavItem } from './base/nav_item/nav_item';
|
|
96
97
|
export { default as GlDashboardLayout } from './dashboards/dashboard_layout/dashboard_layout';
|
|
97
98
|
export { default as GlDashboardPanel } from './dashboards/dashboard_panel/dashboard_panel';
|
|
98
99
|
export { default as GlExperimentBadge } from './experimental/experiment_badge/experiment_badge';
|