tide-design-system 2.2.1 → 2.2.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.
@@ -6,26 +6,44 @@ import { nextTick } from 'vue';
6
6
  * HTML dialog elements.
7
7
  */
8
8
  export const setScrollLock = async (isLocked: boolean) => {
9
- const BODY_LOCK_CLASS = 'body-scroll-lock';
9
+ // Cannot be applied to body tag in marketplace repo due to data-css-scope
10
+ // const BODY_LOCK_CLASS = 'body-scroll-lock';
11
+
10
12
  const body = document.body;
11
13
 
12
14
  if (isLocked) {
13
15
  if (!body.dataset.scrollLockY) {
14
16
  const scrollY = window.scrollY;
17
+
15
18
  body.dataset.scrollLockY = scrollY.toString();
16
19
  body.style.setProperty('--saved-scroll-y', `${scrollY}px`);
17
- body.classList.add(BODY_LOCK_CLASS);
20
+ body.style.setProperty('inset', '0');
21
+ body.style.setProperty('margin-top', `calc(0px - var(--saved-scroll-y, 0px))`);
22
+ body.style.setProperty('overflow-y', 'scroll');
23
+ body.style.setProperty('position', 'fixed');
24
+
25
+ // Cannot be applied to body tag in marketplace repo due to data-css-scope
26
+ // body.classList.add(BODY_LOCK_CLASS);
18
27
  }
19
28
  } else {
20
29
  await nextTick();
21
30
  if (!document.querySelector('dialog[open]')) {
22
31
  const savedScrollY = parseInt(body.dataset.scrollLockY || '0');
23
- body.classList.remove(BODY_LOCK_CLASS);
32
+
33
+ // Cannot be applied to body tag in marketplace repo due to data-css-scope
34
+ // body.classList.remove(BODY_LOCK_CLASS);
35
+
36
+ body.style.removeProperty('inset');
37
+ body.style.removeProperty('marginTop');
38
+ body.style.removeProperty('overflowY');
39
+ body.style.removeProperty('position');
24
40
  body.style.removeProperty('--saved-scroll-y');
41
+
25
42
  window.scrollTo({
26
43
  behavior: 'auto',
27
44
  top: savedScrollY,
28
45
  });
46
+
29
47
  delete body.dataset.scrollLockY;
30
48
  }
31
49
  }
package/package.json CHANGED
@@ -61,7 +61,7 @@
61
61
  "main": "dist/tide-design-system.cjs",
62
62
  "module": "dist/tide-design-system.esm.js",
63
63
  "types": "dist/tide-design-system.esm.d.ts",
64
- "version": "2.2.1",
64
+ "version": "2.2.3",
65
65
  "dependencies": {
66
66
  "@floating-ui/vue": "^1.1.6"
67
67
  }
@@ -5,6 +5,7 @@ body {
5
5
  line-height: 1.4;
6
6
  }
7
7
 
8
+ /* Cannot be applied to body tag in marketplace repo due to data-css-scope */
8
9
  .body-scroll-lock {
9
10
  inset: 0;
10
11
  margin-top: calc(0px - var(--saved-scroll-y, 0px));
@@ -185,6 +185,7 @@
185
185
  :class="[
186
186
  'tide-carousel-button-overlay',
187
187
  CSS.POSITION.ABSOLUTE,
188
+ CSS.POSITIONING.TOP,
188
189
  CSS.DISPLAY.FLEX,
189
190
  CSS.AXIS1.BETWEEN,
190
191
  CSS.AXIS2.CENTER,
@@ -14,12 +14,20 @@
14
14
  </script>
15
15
 
16
16
  <template>
17
- <div
18
- :class="[
19
- CSS.BORDER.COLOR.LOW,
20
- props.orientation === ORIENTATION.HORIZONTAL
21
- ? [CSS.MARGIN.Y.HALF, CSS.BORDER.BOTTOM.ONE]
22
- : [CSS.MARGIN.X.HALF, CSS.BORDER.RIGHT.ONE],
23
- ]"
24
- />
17
+ <div :class="['tide-divider']">
18
+ <div
19
+ :class="[
20
+ CSS.BORDER.COLOR.LOW,
21
+ props.orientation === ORIENTATION.HORIZONTAL
22
+ ? [CSS.MARGIN.Y.HALF, CSS.BORDER.BOTTOM.ONE, CSS.WIDTH.FULL]
23
+ : [CSS.MARGIN.X.HALF, CSS.BORDER.RIGHT.ONE, CSS.HEIGHT.FULL],
24
+ ]"
25
+ />
26
+ </div>
25
27
  </template>
28
+
29
+ <style scoped>
30
+ .tide-divider {
31
+ align-self: stretch;
32
+ }
33
+ </style>
@@ -4,7 +4,6 @@ import { disabledArgType, formatArgType, parameters, prependNoneAsUndefined } fr
4
4
 
5
5
  const formatArgs = (args: any) => {
6
6
  args.flexDirection = args.orientation === ORIENTATION.VERTICAL ? 'tide-flex-row' : 'tide-flex-column';
7
- args.divTemplate = `<div class="sb-border-blue-light sb-font-blue-light tide-display-flex tide-axis1-center tide-axis2-center tide-padding-1 tide-width-full" style="min-width: 100px; min-height:100px;" />`;
8
7
 
9
8
  return { args };
10
9
  };
@@ -12,12 +11,12 @@ const formatArgs = (args: any) => {
12
11
  const render = (args: any) => ({
13
12
  components: { TideDivider },
14
13
  setup: () => formatArgs(args),
15
- template: `<div :class="['tide-display-flex', args.flexDirection]">
16
- <div class="sb-border-blue-light sb-font-blue-light tide-display-flex tide-axis1-center tide-axis2-center tide-padding-1 tide-width-full" style="min-width: 100px; min-height:100px;" />
14
+ template: `<div :class="['tide-display-inline-flex', args.flexDirection]">
15
+ <div class="sb-border-blue-light tide-padding-1">Demo</div>
17
16
 
18
17
  <TideDivider :orientation="args.orientation" />
19
18
 
20
- <div class="sb-border-blue-light sb-font-blue-light tide-display-flex tide-axis1-center tide-axis2-center tide-padding-1 tide-width-full" style="min-width: 100px; height:100px;" />
19
+ <div class="sb-border-blue-light tide-padding-1">Demo</div>
21
20
  </div>`,
22
21
  updated: () => formatArgs(args),
23
22
  });
@@ -6,26 +6,44 @@ import { nextTick } from 'vue';
6
6
  * HTML dialog elements.
7
7
  */
8
8
  export const setScrollLock = async (isLocked: boolean) => {
9
- const BODY_LOCK_CLASS = 'body-scroll-lock';
9
+ // Cannot be applied to body tag in marketplace repo due to data-css-scope
10
+ // const BODY_LOCK_CLASS = 'body-scroll-lock';
11
+
10
12
  const body = document.body;
11
13
 
12
14
  if (isLocked) {
13
15
  if (!body.dataset.scrollLockY) {
14
16
  const scrollY = window.scrollY;
17
+
15
18
  body.dataset.scrollLockY = scrollY.toString();
16
19
  body.style.setProperty('--saved-scroll-y', `${scrollY}px`);
17
- body.classList.add(BODY_LOCK_CLASS);
20
+ body.style.setProperty('inset', '0');
21
+ body.style.setProperty('margin-top', `calc(0px - var(--saved-scroll-y, 0px))`);
22
+ body.style.setProperty('overflow-y', 'scroll');
23
+ body.style.setProperty('position', 'fixed');
24
+
25
+ // Cannot be applied to body tag in marketplace repo due to data-css-scope
26
+ // body.classList.add(BODY_LOCK_CLASS);
18
27
  }
19
28
  } else {
20
29
  await nextTick();
21
30
  if (!document.querySelector('dialog[open]')) {
22
31
  const savedScrollY = parseInt(body.dataset.scrollLockY || '0');
23
- body.classList.remove(BODY_LOCK_CLASS);
32
+
33
+ // Cannot be applied to body tag in marketplace repo due to data-css-scope
34
+ // body.classList.remove(BODY_LOCK_CLASS);
35
+
36
+ body.style.removeProperty('inset');
37
+ body.style.removeProperty('marginTop');
38
+ body.style.removeProperty('overflowY');
39
+ body.style.removeProperty('position');
24
40
  body.style.removeProperty('--saved-scroll-y');
41
+
25
42
  window.scrollTo({
26
43
  behavior: 'auto',
27
44
  top: savedScrollY,
28
45
  });
46
+
29
47
  delete body.dataset.scrollLockY;
30
48
  }
31
49
  }