@studiometa/ui 0.2.4 → 0.2.7

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 (65) hide show
  1. package/atoms/Button/Button.twig +68 -0
  2. package/atoms/Button/StyledButton.twig +47 -0
  3. package/atoms/Cursor/Cursor.twig +28 -0
  4. package/atoms/Figure/Figure.cjs +12 -3
  5. package/atoms/Figure/Figure.d.ts +18 -0
  6. package/atoms/Figure/Figure.js +1 -1
  7. package/atoms/Figure/Figure.twig +120 -0
  8. package/atoms/Figure/FigureTwicPics.cjs +72 -0
  9. package/atoms/Figure/FigureTwicPics.d.ts +48 -0
  10. package/atoms/Figure/FigureTwicPics.js +1 -0
  11. package/atoms/Figure/index.cjs +31 -0
  12. package/atoms/Figure/index.d.ts +2 -0
  13. package/atoms/Figure/index.js +1 -0
  14. package/atoms/Icon/Icon.twig +13 -0
  15. package/atoms/LargeText/LargeText.twig +49 -0
  16. package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +126 -0
  17. package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +133 -0
  18. package/atoms/ScrollAnimation/AbstractScrollAnimation.js +1 -0
  19. package/atoms/ScrollAnimation/ScrollAnimation.cjs +51 -0
  20. package/atoms/ScrollAnimation/ScrollAnimation.d.ts +55 -0
  21. package/atoms/ScrollAnimation/ScrollAnimation.js +1 -0
  22. package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +51 -0
  23. package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +13 -0
  24. package/atoms/ScrollAnimation/ScrollAnimationChild.js +1 -0
  25. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +41 -0
  26. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +6 -0
  27. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +1 -0
  28. package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +48 -0
  29. package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +35 -0
  30. package/atoms/ScrollAnimation/ScrollAnimationParent.js +1 -0
  31. package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +41 -0
  32. package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +6 -0
  33. package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +1 -0
  34. package/atoms/ScrollAnimation/animationScrollWithEase.cjs +70 -0
  35. package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +11 -0
  36. package/atoms/ScrollAnimation/animationScrollWithEase.js +1 -0
  37. package/atoms/ScrollAnimation/index.cjs +41 -0
  38. package/atoms/ScrollAnimation/index.d.ts +7 -0
  39. package/atoms/ScrollAnimation/index.js +1 -0
  40. package/atoms/index.cjs +2 -2
  41. package/atoms/index.d.ts +2 -1
  42. package/atoms/index.js +1 -1
  43. package/index.cjs +1 -0
  44. package/index.d.ts +1 -0
  45. package/index.js +1 -1
  46. package/molecules/Accordion/Accordion.twig +54 -0
  47. package/molecules/Modal/Modal.twig +108 -0
  48. package/molecules/Modal/StyledModal.twig +39 -0
  49. package/molecules/Panel/Panel.twig +73 -0
  50. package/molecules/Panel/StyledPanel.twig +28 -0
  51. package/molecules/Slider/Slider.cjs +12 -4
  52. package/molecules/Slider/Slider.d.ts +11 -0
  53. package/molecules/Slider/Slider.js +1 -1
  54. package/molecules/Slider/SliderItem.cjs +5 -4
  55. package/molecules/Slider/SliderItem.d.ts +5 -0
  56. package/molecules/Slider/SliderItem.js +1 -1
  57. package/molecules/Sticky/Sticky.twig +31 -0
  58. package/molecules/Tabs/Tabs.twig +20 -0
  59. package/organisms/Frame/Frame.cjs +40 -1
  60. package/organisms/Frame/Frame.d.ts +34 -1
  61. package/organisms/Frame/Frame.js +1 -1
  62. package/organisms/Frame/FrameTarget.cjs +3 -3
  63. package/organisms/Frame/FrameTarget.js +1 -1
  64. package/organisms/ImageGrid/ImageGrid.twig +42 -0
  65. package/package.json +2 -2
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @typedef {AbstractScrollAnimation & {
3
+ * $options: {
4
+ * playRange: string,
5
+ * dampFactor: number,
6
+ * dampPrecision: number,
7
+ * from: AnimationOptions,
8
+ * to: AnimationOptions,
9
+ * },
10
+ * }} ScrollAnimationChildInterface
11
+ */
12
+ /**
13
+ * AbstractScrollAnimation class.
14
+ *
15
+ * @todo add support for magic values in options to access key values:
16
+ * - viewport size
17
+ * - target size
18
+ * - root element size
19
+ * - etc.
20
+ *
21
+ * ```
22
+ * data-option-to="{ x: 100%, y: innerWidth / 2 }"
23
+ * ```
24
+ */
25
+ export default class AbstractScrollAnimation extends Base {
26
+ /**
27
+ * Config.
28
+ */
29
+ static config: {
30
+ name: string;
31
+ options: {
32
+ playRange: {
33
+ type: ArrayConstructor;
34
+ default: () => number[];
35
+ };
36
+ dampFactor: {
37
+ type: NumberConstructor;
38
+ default: number;
39
+ };
40
+ dampPrecision: {
41
+ type: NumberConstructor;
42
+ default: number;
43
+ };
44
+ from: {
45
+ type: ObjectConstructor;
46
+ default: typeof getDefaults;
47
+ merge: boolean;
48
+ };
49
+ to: {
50
+ type: ObjectConstructor;
51
+ default: typeof getDefaults;
52
+ merge: boolean;
53
+ };
54
+ };
55
+ };
56
+ /**
57
+ * Get the target element for the animation.
58
+ *
59
+ * @returns {HTMLElement}
60
+ */
61
+ get target(): HTMLElement;
62
+ /**
63
+ * Flags for style detection.
64
+ */
65
+ get has(): {
66
+ x: boolean;
67
+ y: boolean;
68
+ z: boolean;
69
+ scale: boolean;
70
+ scaleX: boolean;
71
+ scaleY: boolean;
72
+ rotate: boolean;
73
+ skewX: boolean;
74
+ skewY: boolean;
75
+ opacity: boolean;
76
+ transform: boolean;
77
+ };
78
+ /**
79
+ * @todo do not add unnecessary styles
80
+ */
81
+ scrolledInView(props: any): void;
82
+ /**
83
+ * Render the animation for the given progress.
84
+ *
85
+ * @param {number} progress
86
+ * @returns {void}
87
+ */
88
+ render(progress: number): void;
89
+ }
90
+ export type AbstractScrollAnimationConstructor = typeof AbstractScrollAnimation;
91
+ export type AnimationOptions = {
92
+ x?: number;
93
+ y?: number;
94
+ z?: number;
95
+ scale?: number;
96
+ scaleX?: number;
97
+ scaleY?: number;
98
+ rotate?: number;
99
+ skewX?: number;
100
+ skewY?: number;
101
+ opacity?: number;
102
+ };
103
+ export type ScrollAnimationChildInterface = AbstractScrollAnimation & {
104
+ $options: {
105
+ playRange: string;
106
+ dampFactor: number;
107
+ dampPrecision: number;
108
+ from: AnimationOptions;
109
+ to: AnimationOptions;
110
+ };
111
+ };
112
+ import { Base } from "@studiometa/js-toolkit";
113
+ /**
114
+ * @typedef {typeof AbstractScrollAnimation} AbstractScrollAnimationConstructor
115
+ * @typedef {{
116
+ * x?: number;
117
+ * y?: number;
118
+ * z?: number;
119
+ * scale?: number;
120
+ * scaleX?: number;
121
+ * scaleY?: number;
122
+ * rotate?: number;
123
+ * skewX?: number;
124
+ * skewY?: number;
125
+ * opacity?: number;
126
+ * }} AnimationOptions
127
+ */
128
+ /**
129
+ * Get animation configuration defaults.
130
+ * @returns {AnimationOptions}
131
+ */
132
+ declare function getDefaults(): AnimationOptions;
133
+ export {};
@@ -0,0 +1 @@
1
+ import{Base as a,withFreezedOptions as n}from"@studiometa/js-toolkit";import{matrix as h,lerp as e,map as o,clamp as r}from"@studiometa/js-toolkit/utils";function i(){return{x:0,y:0,z:0,scale:1,scaleX:1,scaleY:1,rotate:0,skewX:0,skewY:0,opacity:1}}class l extends n(a){static config={name:"AbstractScrollAnimation",options:{playRange:{type:Array,default:()=>[0,1]},dampFactor:{type:Number,default:.5},dampPrecision:{type:Number,default:.001},from:{type:Object,default:i,merge:!0},to:{type:Object,default:i,merge:!0}}};get target(){return this.$el}get has(){const t={x:!1,y:!1,z:!1,scale:!1,scaleX:!1,scaleY:!1,rotate:!1,skewX:!1,skewY:!1,opacity:!1,transform:!1};return Object.keys(this.$options.from).forEach(s=>{t[s]=this.$options.from[s]!==this.$options.to[s]}),t.transform=Object.keys(t).filter(s=>s!=="opacity"&&s!=="transform").some(s=>t[s]),Object.defineProperty(this,"has",{value:t}),t}scrolledInView(t){if(!this.has.opacity&&!this.has.transform)return;const s=o(r(t.dampedProgress.y,this.$options.playRange[0],this.$options.playRange[1]),this.$options.playRange[0],this.$options.playRange[1],0,1);this.render(s)}render(t){if(this.has.opacity&&(this.target.style.opacity=String(o(t,0,1,this.$options.from.opacity,this.$options.to.opacity))),this.has.transform){let s=h({translateX:this.has.x?e(this.$options.from.x,this.$options.to.x,t):void 0,translateY:this.has.y?e(this.$options.from.y,this.$options.to.y,t):void 0,scaleX:this.has.scale?e(this.$options.from.scale,this.$options.to.scale,t):this.has.scaleX?e(this.$options.from.scaleX,this.$options.to.scaleX,t):void 0,scaleY:this.has.scale?e(this.$options.from.scale,this.$options.to.scale,t):this.has.scaleY?e(this.$options.from.scaleY,this.$options.to.scaleY,t):void 0,skewX:this.has.skewX?e(this.$options.from.skewX,this.$options.to.skewX,t):void 0,skewY:this.has.skewY?e(this.$options.from.skewY,this.$options.to.skewY,t):void 0});this.has.rotate&&(s+=` rotate(${e(this.$options.from.rotate,this.$options.to.rotate,t)}deg)`),s+=`translateZ(${this.has.z?e(this.$options.from.z,this.$options.to.z,t):0})`,this.target.style.transform=s}}}export{l as default};
@@ -0,0 +1,51 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var __publicField = (obj, key, value) => {
23
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
+ return value;
25
+ };
26
+
27
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimation.js
28
+ var ScrollAnimation_exports = {};
29
+ __export(ScrollAnimation_exports, {
30
+ default: () => ScrollAnimation
31
+ });
32
+ module.exports = __toCommonJS(ScrollAnimation_exports);
33
+ var import_js_toolkit = require("@studiometa/js-toolkit");
34
+ var import_AbstractScrollAnimation = __toESM(require("./AbstractScrollAnimation.cjs"), 1);
35
+ var ScrollAnimation = class extends (0, import_js_toolkit.withScrolledInView)(import_AbstractScrollAnimation.default, {}) {
36
+ get target() {
37
+ return this.$refs.target;
38
+ }
39
+ get dampFactor() {
40
+ return this.$options.dampFactor;
41
+ }
42
+ get dampPrecision() {
43
+ return this.$options.dampPrecision;
44
+ }
45
+ };
46
+ __publicField(ScrollAnimation, "config", {
47
+ ...import_AbstractScrollAnimation.default.config,
48
+ name: "ScrollAnimation",
49
+ refs: ["target"]
50
+ });
51
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @typedef {ScrollAnimation & { $refs: { target: HTMLElement }}} ScrollAnimationInterface
3
+ */
4
+ /**
5
+ * ScrollAnimation class.
6
+ */
7
+ export default class ScrollAnimation extends AbstractScrollAnimation {
8
+ /**
9
+ * Config.
10
+ */
11
+ static config: {
12
+ name: string;
13
+ refs: string[];
14
+ options: {
15
+ playRange: {
16
+ type: ArrayConstructor;
17
+ default: () => number[];
18
+ };
19
+ dampFactor: {
20
+ type: NumberConstructor;
21
+ default: number;
22
+ };
23
+ dampPrecision: {
24
+ type: NumberConstructor;
25
+ default: number;
26
+ };
27
+ from: {
28
+ type: ObjectConstructor;
29
+ default: () => import("./AbstractScrollAnimation.js").AnimationOptions;
30
+ merge: boolean;
31
+ };
32
+ to: {
33
+ type: ObjectConstructor;
34
+ default: () => import("./AbstractScrollAnimation.js").AnimationOptions;
35
+ merge: boolean;
36
+ };
37
+ };
38
+ };
39
+ /**
40
+ * Get the damp factor from the freezed options.
41
+ * @returns {number}
42
+ */
43
+ get dampFactor(): number;
44
+ /**
45
+ * Get the damp precision from the freezed options.
46
+ * @returns {number}
47
+ */
48
+ get dampPrecision(): number;
49
+ }
50
+ export type ScrollAnimationInterface = ScrollAnimation & {
51
+ $refs: {
52
+ target: HTMLElement;
53
+ };
54
+ };
55
+ import AbstractScrollAnimation from "./AbstractScrollAnimation.js";
@@ -0,0 +1 @@
1
+ import{withScrolledInView as r}from"@studiometa/js-toolkit";import t from"./AbstractScrollAnimation.js";class i extends r(t,{}){static config={...t.config,name:"ScrollAnimation",refs:["target"]};get target(){return this.$refs.target}get dampFactor(){return this.$options.dampFactor}get dampPrecision(){return this.$options.dampPrecision}}export{i as default};
@@ -0,0 +1,51 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var __publicField = (obj, key, value) => {
23
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
+ return value;
25
+ };
26
+
27
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationChild.js
28
+ var ScrollAnimationChild_exports = {};
29
+ __export(ScrollAnimationChild_exports, {
30
+ default: () => ScrollAnimationChild
31
+ });
32
+ module.exports = __toCommonJS(ScrollAnimationChild_exports);
33
+ var import_utils = require("@studiometa/js-toolkit/utils");
34
+ var import_AbstractScrollAnimation = __toESM(require("./AbstractScrollAnimation.cjs"), 1);
35
+ var ScrollAnimationChild = class extends import_AbstractScrollAnimation.default {
36
+ dampedProgress = {
37
+ x: 0,
38
+ y: 0
39
+ };
40
+ scrolledInView(props) {
41
+ this.dampedProgress.y = (0, import_utils.damp)(props.progress.y, this.dampedProgress.y, this.$options.dampFactor, this.$options.dampPrecision);
42
+ this.dampedProgress.x = (0, import_utils.damp)(props.progress.x, this.dampedProgress.x, this.$options.dampFactor, this.$options.dampPrecision);
43
+ props.dampedProgress = this.dampedProgress;
44
+ super.scrolledInView(props);
45
+ }
46
+ };
47
+ __publicField(ScrollAnimationChild, "config", {
48
+ name: "ScrollAnimationChild",
49
+ ...import_AbstractScrollAnimation.default.config
50
+ });
51
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ScrollAnimationChild class.
3
+ */
4
+ export default class ScrollAnimationChild extends AbstractScrollAnimation {
5
+ /**
6
+ * Local damped progress.
7
+ */
8
+ dampedProgress: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ }
13
+ import AbstractScrollAnimation from "./AbstractScrollAnimation.js";
@@ -0,0 +1 @@
1
+ import{damp as o}from"@studiometa/js-toolkit/utils";import i from"./AbstractScrollAnimation.js";class r extends i{static config={name:"ScrollAnimationChild",...i.config};dampedProgress={x:0,y:0};scrolledInView(s){this.dampedProgress.y=o(s.progress.y,this.dampedProgress.y,this.$options.dampFactor,this.$options.dampPrecision),this.dampedProgress.x=o(s.progress.x,this.dampedProgress.x,this.$options.dampFactor,this.$options.dampPrecision),s.dampedProgress=this.dampedProgress,super.scrolledInView(s)}}export{r as default};
@@ -0,0 +1,41 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var __publicField = (obj, key, value) => {
23
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
+ return value;
25
+ };
26
+
27
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js
28
+ var ScrollAnimationChildWithEase_exports = {};
29
+ __export(ScrollAnimationChildWithEase_exports, {
30
+ default: () => ScrollAnimationChildWithEase
31
+ });
32
+ module.exports = __toCommonJS(ScrollAnimationChildWithEase_exports);
33
+ var import_ScrollAnimationChild = __toESM(require("./ScrollAnimationChild.cjs"), 1);
34
+ var import_animationScrollWithEase = __toESM(require("./animationScrollWithEase.cjs"), 1);
35
+ var ScrollAnimationChildWithEase = class extends (0, import_animationScrollWithEase.default)(import_ScrollAnimationChild.default) {
36
+ };
37
+ __publicField(ScrollAnimationChildWithEase, "config", {
38
+ ...import_ScrollAnimationChild.default.config,
39
+ name: "ScrollAnimationChildWithEase"
40
+ });
41
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * ScrollAnimationChild class.
3
+ */
4
+ export default class ScrollAnimationChildWithEase extends ScrollAnimationChild {
5
+ }
6
+ import ScrollAnimationChild from "./ScrollAnimationChild.js";
@@ -0,0 +1 @@
1
+ import i from"./ScrollAnimationChild.js";import o from"./animationScrollWithEase.js";class t extends o(i){static config={...i.config,name:"ScrollAnimationChildWithEase"}}export{t as default};
@@ -0,0 +1,48 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var __publicField = (obj, key, value) => {
23
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
+ return value;
25
+ };
26
+
27
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationParent.js
28
+ var ScrollAnimationParent_exports = {};
29
+ __export(ScrollAnimationParent_exports, {
30
+ default: () => ScrollAnimationParent
31
+ });
32
+ module.exports = __toCommonJS(ScrollAnimationParent_exports);
33
+ var import_js_toolkit = require("@studiometa/js-toolkit");
34
+ var import_ScrollAnimationChild = __toESM(require("./ScrollAnimationChild.cjs"), 1);
35
+ var ScrollAnimationParent = class extends (0, import_js_toolkit.withScrolledInView)(import_js_toolkit.Base, {}) {
36
+ scrolledInView(props) {
37
+ this.$children.ScrollAnimationChild.forEach((child) => {
38
+ child.scrolledInView(props);
39
+ });
40
+ }
41
+ };
42
+ __publicField(ScrollAnimationParent, "config", {
43
+ name: "ScrollAnimationParent",
44
+ components: {
45
+ ScrollAnimationChild: import_ScrollAnimationChild.default
46
+ }
47
+ });
48
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @typedef {ScrollAnimationParent & {
3
+ * $children: {
4
+ * ScrollAnimationChild: ScrollAnimationChild[],
5
+ * },
6
+ * }} ScrollAnimationInterface
7
+ */
8
+ /**
9
+ * ScrollAnimationParent class.
10
+ */
11
+ export default class ScrollAnimationParent extends Base {
12
+ /**
13
+ * Config.
14
+ */
15
+ static config: {
16
+ name: string;
17
+ components: {
18
+ ScrollAnimationChild: typeof ScrollAnimationChild;
19
+ };
20
+ };
21
+ /**
22
+ * @todo Optimize default value read
23
+ * @todo do not add unnecessary styles
24
+ * @todo freeze options for better perf
25
+ * @this {ScrollAnimationInterface}
26
+ */
27
+ scrolledInView(this: ScrollAnimationInterface, props: any): void;
28
+ }
29
+ export type ScrollAnimationInterface = ScrollAnimationParent & {
30
+ $children: {
31
+ ScrollAnimationChild: ScrollAnimationChild[];
32
+ };
33
+ };
34
+ import { Base } from "@studiometa/js-toolkit";
35
+ import ScrollAnimationChild from "./ScrollAnimationChild.js";
@@ -0,0 +1 @@
1
+ import{Base as l,withScrolledInView as n}from"@studiometa/js-toolkit";import e from"./ScrollAnimationChild.js";class r extends n(l,{}){static config={name:"ScrollAnimationParent",components:{ScrollAnimationChild:e}};scrolledInView(i){this.$children.ScrollAnimationChild.forEach(o=>{o.scrolledInView(i)})}}export{r as default};
@@ -0,0 +1,41 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var __publicField = (obj, key, value) => {
23
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
+ return value;
25
+ };
26
+
27
+ // packages/ui/atoms/ScrollAnimation/ScrollAnimationWithEase.js
28
+ var ScrollAnimationWithEase_exports = {};
29
+ __export(ScrollAnimationWithEase_exports, {
30
+ default: () => ScrollAnimationWithEase
31
+ });
32
+ module.exports = __toCommonJS(ScrollAnimationWithEase_exports);
33
+ var import_ScrollAnimation = __toESM(require("./ScrollAnimation.cjs"), 1);
34
+ var import_animationScrollWithEase = __toESM(require("./animationScrollWithEase.cjs"), 1);
35
+ var ScrollAnimationWithEase = class extends (0, import_animationScrollWithEase.default)(import_ScrollAnimation.default) {
36
+ };
37
+ __publicField(ScrollAnimationWithEase, "config", {
38
+ ...import_ScrollAnimation.default.config,
39
+ name: "ScrollAnimationWithEase"
40
+ });
41
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * ScrollAnimation class.
3
+ */
4
+ export default class ScrollAnimationWithEase extends ScrollAnimation {
5
+ }
6
+ import ScrollAnimation from "./ScrollAnimation.js";
@@ -0,0 +1 @@
1
+ import i from"./ScrollAnimation.js";import o from"./animationScrollWithEase.js";class t extends o(i){static config={...i.config,name:"ScrollAnimationWithEase"}}export{t as default};
@@ -0,0 +1,70 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // packages/ui/atoms/ScrollAnimation/animationScrollWithEase.js
20
+ var animationScrollWithEase_exports = {};
21
+ __export(animationScrollWithEase_exports, {
22
+ default: () => animationScrollWithEase
23
+ });
24
+ module.exports = __toCommonJS(animationScrollWithEase_exports);
25
+ var import_utils = require("@studiometa/js-toolkit/utils");
26
+ var eases = {
27
+ outQuad: import_utils.easeOutQuad,
28
+ inQuad: import_utils.easeInQuad,
29
+ inOutQuad: import_utils.easeInOutQuad,
30
+ outCubic: import_utils.easeOutCubic,
31
+ inCubic: import_utils.easeInCubic,
32
+ inOutCubic: import_utils.easeInOutCubic,
33
+ outQuart: import_utils.easeOutQuart,
34
+ inQuart: import_utils.easeInQuart,
35
+ inOutQuart: import_utils.easeInOutQuart,
36
+ outQuint: import_utils.easeOutQuint,
37
+ inQuint: import_utils.easeInQuint,
38
+ inOutQuint: import_utils.easeInOutQuint,
39
+ outSine: import_utils.easeOutSine,
40
+ inSine: import_utils.easeInSine,
41
+ inOutSine: import_utils.easeInOutSine,
42
+ outCirc: import_utils.easeOutCirc,
43
+ inCirc: import_utils.easeInCirc,
44
+ inOutCirc: import_utils.easeInOutCirc,
45
+ outExpo: import_utils.easeOutExpo,
46
+ inExpo: import_utils.easeInExpo,
47
+ inOutExpo: import_utils.easeInOutExpo
48
+ };
49
+ function animationScrollWithEase(ScrollAnimation) {
50
+ return class extends ScrollAnimation {
51
+ static config = {
52
+ ...ScrollAnimation.config,
53
+ name: `${ScrollAnimation.config.name}WithEase`,
54
+ options: {
55
+ ...ScrollAnimation.config.options,
56
+ ease: {
57
+ type: String,
58
+ default: "outExpo"
59
+ }
60
+ }
61
+ };
62
+ render(progress) {
63
+ if (eases[this.$options.ease]) {
64
+ progress = eases[this.$options.ease](progress);
65
+ }
66
+ super.render(progress);
67
+ }
68
+ };
69
+ }
70
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @typedef {import('./AbstractScrollAnimation.js').AbstractScrollAnimationConstructor} AbstractScrollAnimationConstructor
3
+ */
4
+ /**
5
+ * Extend a `ScrollAnimation` component to use easings.
6
+ * @template {AbstractScrollAnimationConstructor} T
7
+ * @param {T} ScrollAnimation A child class of the `AbstractScrollAnimation` class.
8
+ * @returns {T}
9
+ */
10
+ export default function animationScrollWithEase<T extends typeof import("./AbstractScrollAnimation.js").default>(ScrollAnimation: T): T;
11
+ export type AbstractScrollAnimationConstructor = import('./AbstractScrollAnimation.js').AbstractScrollAnimationConstructor;
@@ -0,0 +1 @@
1
+ import{easeOutQuad as n,easeInQuad as i,easeInOutQuad as a,easeOutCubic as s,easeInCubic as o,easeInOutCubic as O,easeOutQuart as c,easeInQuart as Q,easeInOutQuart as r,easeOutQuint as I,easeInQuint as p,easeInOutQuint as C,easeOutSine as d,easeInSine as f,easeInOutSine as x,easeOutCirc as E,easeInCirc as b,easeInOutCirc as S,easeOutExpo as h,easeInExpo as g,easeInOutExpo as $}from"@studiometa/js-toolkit/utils";const u={outQuad:n,inQuad:i,inOutQuad:a,outCubic:s,inCubic:o,inOutCubic:O,outQuart:c,inQuart:Q,inOutQuart:r,outQuint:I,inQuint:p,inOutQuint:C,outSine:d,inSine:f,inOutSine:x,outCirc:E,inCirc:b,inOutCirc:S,outExpo:h,inExpo:g,inOutExpo:$};function m(e){return class extends e{static config={...e.config,name:`${e.config.name}WithEase`,options:{...e.config.options,ease:{type:String,default:"outExpo"}}};render(t){u[this.$options.ease]&&(t=u[this.$options.ease](t)),super.render(t)}}}export{m as default};
@@ -0,0 +1,41 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // packages/ui/atoms/ScrollAnimation/index.js
23
+ var ScrollAnimation_exports = {};
24
+ __export(ScrollAnimation_exports, {
25
+ AbstractScrollAnimation: () => import_AbstractScrollAnimation.default,
26
+ ScrollAnimation: () => import_ScrollAnimation.default,
27
+ ScrollAnimationChild: () => import_ScrollAnimationChild.default,
28
+ ScrollAnimationChildWithEase: () => import_ScrollAnimationChildWithEase.default,
29
+ ScrollAnimationParent: () => import_ScrollAnimationParent.default,
30
+ ScrollAnimationWithEase: () => import_ScrollAnimationWithEase.default,
31
+ animationScrollWithEase: () => import_animationScrollWithEase.default
32
+ });
33
+ module.exports = __toCommonJS(ScrollAnimation_exports);
34
+ var import_AbstractScrollAnimation = __toESM(require("./AbstractScrollAnimation.cjs"), 1);
35
+ var import_animationScrollWithEase = __toESM(require("./animationScrollWithEase.cjs"), 1);
36
+ var import_ScrollAnimation = __toESM(require("./ScrollAnimation.cjs"), 1);
37
+ var import_ScrollAnimationWithEase = __toESM(require("./ScrollAnimationWithEase.cjs"), 1);
38
+ var import_ScrollAnimationChild = __toESM(require("./ScrollAnimationChild.cjs"), 1);
39
+ var import_ScrollAnimationChildWithEase = __toESM(require("./ScrollAnimationChildWithEase.cjs"), 1);
40
+ var import_ScrollAnimationParent = __toESM(require("./ScrollAnimationParent.cjs"), 1);
41
+ if (module.exports.default) module.exports = module.exports.default;
@@ -0,0 +1,7 @@
1
+ export { default as AbstractScrollAnimation } from "./AbstractScrollAnimation.js";
2
+ export { default as animationScrollWithEase } from "./animationScrollWithEase.js";
3
+ export { default as ScrollAnimation } from "./ScrollAnimation.js";
4
+ export { default as ScrollAnimationWithEase } from "./ScrollAnimationWithEase.js";
5
+ export { default as ScrollAnimationChild } from "./ScrollAnimationChild.js";
6
+ export { default as ScrollAnimationChildWithEase } from "./ScrollAnimationChildWithEase.js";
7
+ export { default as ScrollAnimationParent } from "./ScrollAnimationParent.js";
@@ -0,0 +1 @@
1
+ import{default as t}from"./AbstractScrollAnimation.js";import{default as r}from"./animationScrollWithEase.js";import{default as e}from"./ScrollAnimation.js";import{default as f}from"./ScrollAnimationWithEase.js";import{default as s}from"./ScrollAnimationChild.js";import{default as c}from"./ScrollAnimationChildWithEase.js";import{default as u}from"./ScrollAnimationParent.js";export{t as AbstractScrollAnimation,e as ScrollAnimation,s as ScrollAnimationChild,c as ScrollAnimationChildWithEase,u as ScrollAnimationParent,f as ScrollAnimationWithEase,r as animationScrollWithEase};