@gitlab/ui 112.3.2 → 112.3.3

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.
@@ -33,8 +33,8 @@ var script = {
33
33
  if (!this.isBackgroundColorStory) return '';
34
34
  const textColorVariant = colorFromBackground(value, 4.5);
35
35
  return {
36
- 'gl-text-gray-950': textColorVariant === 'dark',
37
- 'gl-text-white': textColorVariant === 'light'
36
+ 'gl-text-neutral-950': textColorVariant === 'dark',
37
+ 'gl-text-neutral-0': textColorVariant === 'light'
38
38
  };
39
39
  },
40
40
  getStyle(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "112.3.2",
3
+ "version": "112.3.3",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -96,7 +96,10 @@
96
96
  "resolutions": {
97
97
  "chokidar": "^3.5.2",
98
98
  "sane": "^5.0.1",
99
- "jackspeak": "2.1.1"
99
+ "jackspeak": "2.1.1",
100
+ "postcss": "8.5.3",
101
+ "json5": "2.2.3",
102
+ "rollup-plugin-vue/@vue/component-compiler/postcss-modules-sync/generic-names/loader-utils": "1.4.2"
100
103
  },
101
104
  "devDependencies": {
102
105
  "@babel/core": "^7.26.10",
@@ -138,7 +141,7 @@
138
141
  "@yarnpkg/lockfile": "^1.1.0",
139
142
  "acorn": "^8.11.3",
140
143
  "acorn-walk": "^8.3.2",
141
- "autoprefixer": "^9.7.6",
144
+ "autoprefixer": "10.4.21",
142
145
  "axe-playwright": "^2.1.0",
143
146
  "babel-jest": "29.0.1",
144
147
  "babel-loader": "^8.0.5",
@@ -170,11 +173,11 @@
170
173
  "npm-run-all": "^4.1.5",
171
174
  "patch-package": "^8.0.0",
172
175
  "pikaday": "^1.8.0",
173
- "playwright": "^1.51.1",
174
- "playwright-core": "^1.51.1",
175
- "postcss": "8.4.28",
176
- "postcss-loader": "^7.0.2",
177
- "postcss-scss": "4.0.4",
176
+ "playwright": "^1.52.0",
177
+ "playwright-core": "^1.52.0",
178
+ "postcss": "8.5.3",
179
+ "postcss-loader": "8.1.1",
180
+ "postcss-scss": "4.0.9",
178
181
  "prettier": "3.3.2",
179
182
  "prettier-plugin-tailwindcss": "^0.6.5",
180
183
  "react": "^18.2.0",
@@ -1,17 +1,109 @@
1
1
  <script>
2
- import { BNavItem } from '../../../vendor/bootstrap-vue/src/components/nav/nav-item';
2
+ import GlLink from '../link/link.vue';
3
3
 
4
4
  export default {
5
5
  name: 'GlNavItem',
6
6
  components: {
7
- BNavItem,
7
+ GlLink,
8
+ },
9
+ props: {
10
+ /**
11
+ * When set to `true`, places the component in the active state with active styling
12
+ */
13
+ active: {
14
+ type: Boolean,
15
+ required: false,
16
+ default: false,
17
+ },
18
+ /**
19
+ * When set to `true`, disables the component's functionality and places it in a disabled state.
20
+ */
21
+ disabled: {
22
+ type: Boolean,
23
+ required: false,
24
+ default: false,
25
+ },
26
+ /**
27
+ * Denotes the target URL of the link for standard links.
28
+ */
29
+ href: {
30
+ type: String,
31
+ required: false,
32
+ default: undefined,
33
+ },
34
+ /**
35
+ * <router-link> prop: Denotes the target route of the link.
36
+ * When clicked, the value of the to prop will be passed to `router.push()` internally,
37
+ * so the value can be either a string or a Location descriptor object.
38
+ */
39
+ to: {
40
+ type: [Object, String],
41
+ required: false,
42
+ default: undefined,
43
+ },
44
+ /**
45
+ * <router-link> prop: Configure the active CSS class applied when the link is active.
46
+ */
47
+ activeClass: {
48
+ type: String,
49
+ required: false,
50
+ default: undefined,
51
+ },
52
+ /**
53
+ * <router-link> prop: Configure the active CSS class applied when the link is active with exact match.
54
+ */
55
+ exactActiveClass: {
56
+ type: String,
57
+ required: false,
58
+ default: undefined,
59
+ },
60
+ /**
61
+ * Attributes for the link element
62
+ */
63
+ linkAttrs: {
64
+ type: Object,
65
+ required: false,
66
+ default: null,
67
+ },
68
+ /**
69
+ * Classes for the link element
70
+ */
71
+ linkClasses: {
72
+ type: Array,
73
+ required: false,
74
+ default: () => [],
75
+ },
76
+ },
77
+ computed: {
78
+ computedLinkClasses() {
79
+ const classes = this.linkClasses;
80
+
81
+ // the `unstyled` link variant does not do this by itself
82
+ if (this.disabled) classes.push('disabled');
83
+ if (this.active) classes.push('active');
84
+
85
+ return classes;
86
+ },
8
87
  },
9
- inheritAttrs: false,
10
88
  };
11
89
  </script>
12
90
 
13
91
  <template>
14
- <b-nav-item v-bind="$attrs" v-on="$listeners">
15
- <slot></slot>
16
- </b-nav-item>
92
+ <li class="nav-item">
93
+ <gl-link
94
+ class="nav-link"
95
+ variant="unstyled"
96
+ :active="active"
97
+ :class="computedLinkClasses"
98
+ :disabled="disabled"
99
+ :href="href"
100
+ :to="to"
101
+ :active-class="activeClass"
102
+ :exact-active-class="exactActiveClass"
103
+ v-bind="linkAttrs"
104
+ v-on="$listeners"
105
+ >
106
+ <slot></slot>
107
+ </gl-link>
108
+ </li>
17
109
  </template>
@@ -21,11 +21,11 @@ export default {
21
21
  return HEX_REGEX.test(this.foreground) && HEX_REGEX.test(this.background);
22
22
  },
23
23
  classes() {
24
- if (!this.isValidColorCombination) return 'gl-text-gray-950';
24
+ if (!this.isValidColorCombination) return 'gl-text-neutral-950';
25
25
  const { grade } = this.contrast.level;
26
26
  const isFail = grade === 'F';
27
27
  const contrastScore = getColorContrast('#fff', this.background).score > 4.5;
28
- const textClass = contrastScore ? 'gl-text-white' : 'gl-text-gray-950';
28
+ const textClass = contrastScore ? 'gl-text-neutral-0' : 'gl-text-neutral-950';
29
29
  const failClasses = contrastScore
30
30
  ? 'gl-shadow-inner-1-red-300 gl-text-red-300'
31
31
  : 'gl-shadow-inner-1-red-500 gl-text-red-500';