@gitlab/ui 78.6.1 → 78.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [78.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.6.1...v78.7.0) (2024-04-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * **BaseDropdown:** Adds "right-start" placement ([c1c82d6](https://gitlab.com/gitlab-org/gitlab-ui/commit/c1c82d651dc1327e2f6d1404fa14b4509a4e80fa))
7
+
1
8
  ## [78.6.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.6.0...v78.6.1) (2024-04-02)
2
9
 
3
10
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 02 Apr 2024 12:11:35 GMT
3
+ * Generated on Wed, 03 Apr 2024 15:46:06 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 02 Apr 2024 12:11:35 GMT
3
+ * Generated on Wed, 03 Apr 2024 15:46:06 GMT
4
4
  */
5
5
 
6
6
  :root.gl-dark {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 02 Apr 2024 12:11:35 GMT
3
+ * Generated on Wed, 03 Apr 2024 15:46:06 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#133a03";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 02 Apr 2024 12:11:35 GMT
3
+ * Generated on Wed, 03 Apr 2024 15:46:06 GMT
4
4
  */
5
5
 
6
6
  export const DATA_VIZ_GREEN_50 = "#ddfab7";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 02 Apr 2024 12:11:35 GMT
3
+ // Generated on Wed, 03 Apr 2024 15:46:06 GMT
4
4
 
5
5
  $gl-text-tertiary: #737278 !default;
6
6
  $gl-text-secondary: #89888d !default;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Tue, 02 Apr 2024 12:11:35 GMT
3
+ // Generated on Wed, 03 Apr 2024 15:46:06 GMT
4
4
 
5
5
  $gl-text-tertiary: #89888d !default;
6
6
  $gl-text-secondary: #737278 !default;
@@ -121,12 +121,14 @@ const dropdownVariantOptions = {
121
121
  link: 'link'
122
122
  };
123
123
  const dropdownPlacements = {
124
+ 'right-start': 'right-start',
124
125
  left: 'bottom-start',
125
126
  center: 'bottom',
126
127
  right: 'bottom-end'
127
128
  };
128
129
  const dropdownAnyCornerPlacement = [dropdownPlacements.left, 'top-start', dropdownPlacements.right, 'top-end'];
129
130
  const dropdownAllowedAutoPlacements = {
131
+ 'right-start': ['right-start', 'right-end', 'left-start', 'left-end'],
130
132
  left: dropdownAnyCornerPlacement,
131
133
  center: [dropdownPlacements.center, 'top'],
132
134
  right: dropdownAnyCornerPlacement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "78.6.1",
3
+ "version": "78.7.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -102,7 +102,7 @@
102
102
  "@gitlab/eslint-plugin": "19.5.0",
103
103
  "@gitlab/fonts": "^1.3.0",
104
104
  "@gitlab/stylelint-config": "6.1.0",
105
- "@gitlab/svgs": "3.93.0",
105
+ "@gitlab/svgs": "3.94.0",
106
106
  "@rollup/plugin-commonjs": "^11.1.0",
107
107
  "@rollup/plugin-node-resolve": "^7.1.3",
108
108
  "@rollup/plugin-replace": "^2.3.2",
@@ -162,6 +162,27 @@ describe('base dropdown', () => {
162
162
  );
163
163
  });
164
164
 
165
+ it('initializes Floating UI with reference and floating elements and config for `right-start` aligned menu', async () => {
166
+ buildWrapper({ placement: 'right-start' });
167
+ await findDefaultDropdownToggle().trigger('click');
168
+
169
+ expect(computePosition).toHaveBeenCalledWith(
170
+ findDefaultDropdownToggle().element,
171
+ findDropdownMenu().element,
172
+ {
173
+ placement: 'right-start',
174
+ strategy: 'absolute',
175
+ middleware: [
176
+ offset({ mainAxis: DEFAULT_OFFSET }),
177
+ autoPlacement({
178
+ alignment: 'start',
179
+ allowedPlacements: ['right-start', 'right-end', 'left-start', 'left-end'],
180
+ }),
181
+ ],
182
+ }
183
+ );
184
+ });
185
+
165
186
  it("passes custom offset to Floating UI's middleware", async () => {
166
187
  const customOffset = { mainAxis: 10, crossAxis: 40 };
167
188
  buildWrapper({
@@ -146,6 +146,7 @@ export const dropdownVariantOptions = {
146
146
  };
147
147
 
148
148
  export const dropdownPlacements = {
149
+ 'right-start': 'right-start',
149
150
  left: 'bottom-start',
150
151
  center: 'bottom',
151
152
  right: 'bottom-end',
@@ -159,6 +160,7 @@ const dropdownAnyCornerPlacement = [
159
160
  ];
160
161
 
161
162
  export const dropdownAllowedAutoPlacements = {
163
+ 'right-start': ['right-start', 'right-end', 'left-start', 'left-end'],
162
164
  left: dropdownAnyCornerPlacement,
163
165
  center: [dropdownPlacements.center, 'top'],
164
166
  right: dropdownAnyCornerPlacement,