@gitlab/ui 32.65.1 → 33.0.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.
Files changed (23) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/components/utilities/intersection_observer/intersection_observer.documentation.js +1 -20
  3. package/dist/components/utilities/intersection_observer/intersection_observer.js +12 -0
  4. package/dist/utility_classes.css +1 -1
  5. package/dist/utility_classes.css.map +1 -1
  6. package/documentation/documented_stories.js +1 -0
  7. package/package.json +2 -2
  8. package/scss_to_js/scss_variables.js +1 -0
  9. package/scss_to_js/scss_variables.json +5 -0
  10. package/src/components/utilities/intersection_observer/intersection_observer.documentation.js +0 -23
  11. package/src/components/utilities/intersection_observer/intersection_observer.stories.js +91 -80
  12. package/src/components/utilities/intersection_observer/intersection_observer.vue +15 -0
  13. package/src/scss/utilities.scss +46 -26
  14. package/src/scss/utility-mixins/flex.scss +1 -8
  15. package/src/scss/utility-mixins/sizing.scss +16 -0
  16. package/src/scss/utility-mixins/spacing.scss +7 -7
  17. package/src/scss/variables.scss +1 -0
  18. package/dist/components/utilities/intersection_observer/examples/index.js +0 -19
  19. package/dist/components/utilities/intersection_observer/examples/intersection_observer.image.example.js +0 -62
  20. package/dist/components/utilities/intersection_observer/examples/intersection_observer.last_appeared.example.js +0 -83
  21. package/src/components/utilities/intersection_observer/examples/index.js +0 -23
  22. package/src/components/utilities/intersection_observer/examples/intersection_observer.image.example.vue +0 -29
  23. package/src/components/utilities/intersection_observer/examples/intersection_observer.last_appeared.example.vue +0 -43
@@ -1,83 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- var script = {
4
- data: () => ({
5
- appearedAt: null,
6
- now: null,
7
- interval: null
8
- }),
9
- computed: {
10
- secondsSinceAppearance() {
11
- if (!this.appearedAt) {
12
- return 0;
13
- }
14
-
15
- return Math.floor((this.now - this.appearedAt) / 1000);
16
- }
17
-
18
- },
19
-
20
- destroyed() {
21
- this.clearInterval();
22
- },
23
-
24
- methods: {
25
- appear() {
26
- this.clearInterval();
27
- this.interval = setInterval(this.tick, 1000);
28
- this.tick();
29
- this.appearedAt = this.now;
30
- },
31
-
32
- disappear() {
33
- this.clearInterval();
34
- },
35
-
36
- clearInterval() {
37
- clearInterval(this.interval);
38
- },
39
-
40
- tick() {
41
- this.now = new Date().getTime();
42
- }
43
-
44
- }
45
- };
46
-
47
- /* script */
48
- const __vue_script__ = script;
49
-
50
- /* template */
51
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-intersection-observer',{on:{"appear":_vm.appear,"disappear":_vm.disappear}},[_c('span',[_vm._v("Last appeared "+_vm._s(_vm.secondsSinceAppearance)+" seconds ago")])])};
52
- var __vue_staticRenderFns__ = [];
53
-
54
- /* style */
55
- const __vue_inject_styles__ = undefined;
56
- /* scoped */
57
- const __vue_scope_id__ = undefined;
58
- /* module identifier */
59
- const __vue_module_identifier__ = undefined;
60
- /* functional template */
61
- const __vue_is_functional_template__ = false;
62
- /* style inject */
63
-
64
- /* style inject SSR */
65
-
66
- /* style inject shadow dom */
67
-
68
-
69
-
70
- const __vue_component__ = __vue_normalize__(
71
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
72
- __vue_inject_styles__,
73
- __vue_script__,
74
- __vue_scope_id__,
75
- __vue_is_functional_template__,
76
- __vue_module_identifier__,
77
- false,
78
- undefined,
79
- undefined,
80
- undefined
81
- );
82
-
83
- export default __vue_component__;
@@ -1,23 +0,0 @@
1
- import ImageExample from './intersection_observer.image.example.vue';
2
- import LastAppearedExample from './intersection_observer.last_appeared.example.vue';
3
-
4
- export default [
5
- {
6
- name: 'Intersection observer',
7
- items: [
8
- {
9
- id: 'intersection-observer-last-appeared',
10
- name: 'Last appeared at',
11
- description: 'Logs when the component last appeared on the screen',
12
- component: LastAppearedExample,
13
- },
14
- {
15
- id: 'intersection-observer-lazy-loaded-image',
16
- name: 'Lazy loaded image',
17
- description:
18
- "This image switches between a gif and a still image when it's on or off the screen",
19
- component: ImageExample,
20
- },
21
- ],
22
- },
23
- ];
@@ -1,29 +0,0 @@
1
- <script>
2
- export default {
3
- data: () => ({
4
- isInView: false,
5
- }),
6
- computed: {
7
- imageUrl() {
8
- // If the image is in view, return the high res one. If not return nothing, or a low res one
9
- return this.isInView
10
- ? '../../img/gitlab-summit-south-africa.jpg'
11
- : '../../img/gitlab-summit-south-africa-min.jpg';
12
- },
13
- },
14
- methods: {
15
- appear() {
16
- this.isInView = true;
17
- },
18
- disappear() {
19
- this.isInView = false;
20
- },
21
- },
22
- };
23
- </script>
24
-
25
- <template>
26
- <gl-intersection-observer @appear="appear" @disappear="disappear">
27
- <img :src="imageUrl" style="max-width: 100%; height: auto" />
28
- </gl-intersection-observer>
29
- </template>
@@ -1,43 +0,0 @@
1
- <script>
2
- export default {
3
- data: () => ({
4
- appearedAt: null,
5
- now: null,
6
- interval: null,
7
- }),
8
- computed: {
9
- secondsSinceAppearance() {
10
- if (!this.appearedAt) {
11
- return 0;
12
- }
13
- return Math.floor((this.now - this.appearedAt) / 1000);
14
- },
15
- },
16
- destroyed() {
17
- this.clearInterval();
18
- },
19
- methods: {
20
- appear() {
21
- this.clearInterval();
22
- this.interval = setInterval(this.tick, 1000);
23
- this.tick();
24
- this.appearedAt = this.now;
25
- },
26
- disappear() {
27
- this.clearInterval();
28
- },
29
- clearInterval() {
30
- clearInterval(this.interval);
31
- },
32
- tick() {
33
- this.now = new Date().getTime();
34
- },
35
- },
36
- };
37
- </script>
38
-
39
- <template>
40
- <gl-intersection-observer @appear="appear" @disappear="disappear">
41
- <span>Last appeared {{ secondsSinceAppearance }} seconds ago</span>
42
- </gl-intersection-observer>
43
- </template>