@umbraco-ui/uui-menu-item 1.6.0-rc.0 → 1.6.0-rc.1

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.
@@ -207,6 +207,10 @@
207
207
  {
208
208
  "name": "--uui-menu-item-indent",
209
209
  "description": "set indentation of the menu items"
210
+ },
211
+ {
212
+ "name": "--uui-menu-item-flat-structure",
213
+ "description": "set to 1 to remove the indentation of the chevron. Use this when you have a flat menu structure"
210
214
  }
211
215
  ]
212
216
  }
package/lib/index.js CHANGED
@@ -122,13 +122,18 @@ UUIMenuItemElement.styles = [
122
122
  display: block;
123
123
  --uui-menu-item-child-indent: calc(var(--uui-menu-item-indent, 0) + 1);
124
124
  user-select: none;
125
+ --flat-structure-reversed: calc(
126
+ 1 - var(--uui-menu-item-flat-structure, 0)
127
+ );
125
128
  }
126
129
 
127
130
  #menu-item {
128
131
  position: relative;
129
132
  padding-left: calc(var(--uui-menu-item-indent, 0) * var(--uui-size-4,12px));
130
133
  display: grid;
131
- grid-template-columns: var(--uui-size-8,24px) 1fr;
134
+ grid-template-columns:
135
+ calc(var(--flat-structure-reversed) * var(--uui-size-8,24px))
136
+ 1fr;
132
137
  grid-template-rows: 1fr;
133
138
  white-space: nowrap;
134
139
  }
@@ -311,7 +316,10 @@ UUIMenuItemElement.styles = [
311
316
  grid-column-start: 2;
312
317
  white-space: nowrap;
313
318
  overflow: hidden;
314
-
319
+ padding-right: var(--uui-size-space-3,9px);
320
+ padding-left: calc(
321
+ var(--uui-menu-item-flat-structure) * var(--uui-size-space-3,9px)
322
+ );
315
323
  display: inline-flex;
316
324
  align-items: center;
317
325
  text-decoration: none;
@@ -329,10 +337,6 @@ UUIMenuItemElement.styles = [
329
337
  pointer-events: none; /* avoid hovering state on this. */
330
338
  }
331
339
 
332
- #caret-button + #label-button {
333
- padding-left: 0;
334
- }
335
-
336
340
  #caret-button {
337
341
  position: relative;
338
342
  width: 100%;
@@ -3,6 +3,7 @@ declare const UUIMenuItemElement_base: (new (...args: any[]) => import("@umbraco
3
3
  /**
4
4
  * @element uui-menu-item
5
5
  * @cssprop --uui-menu-item-indent - set indentation of the menu items
6
+ * @cssprop --uui-menu-item-flat-structure - set to 1 to remove the indentation of the chevron. Use this when you have a flat menu structure
6
7
  * @fires {UUIMenuItemEvent} show-children - fires when the expand icon is clicked to show nested menu items
7
8
  * @fires {UUIMenuItemEvent} hide-children - fires when the expend icon is clicked to hide nested menu items
8
9
  * @fires {UUIMenuItemEvent} click-label - fires when the label is clicked
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-menu-item",
3
- "version": "1.6.0-rc.0",
3
+ "version": "1.6.0-rc.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,9 +30,9 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.6.0-rc.0",
34
- "@umbraco-ui/uui-loader-bar": "1.6.0-rc.0",
35
- "@umbraco-ui/uui-symbol-expand": "1.6.0-rc.0"
33
+ "@umbraco-ui/uui-base": "1.6.0-rc.1",
34
+ "@umbraco-ui/uui-loader-bar": "1.6.0-rc.1",
35
+ "@umbraco-ui/uui-symbol-expand": "1.6.0-rc.1"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
@@ -43,5 +43,5 @@
43
43
  "access": "public"
44
44
  },
45
45
  "homepage": "https://uui.umbraco.com/?path=/story/uui-menu-item",
46
- "gitHead": "04709c32cb81b058bdf7976b69533e5b793c49ab"
46
+ "gitHead": "9708ccbac569560b716431080c782c5531c66ea5"
47
47
  }