@studiometa/ui 0.2.3 → 0.2.6

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 (163) hide show
  1. package/atoms/AnchorScrollTo/AnchorScrollTo.cjs +8 -13
  2. package/atoms/AnchorScrollTo/AnchorScrollTo.js +1 -26
  3. package/atoms/Button/Button.twig +68 -0
  4. package/atoms/Button/StyledButton.twig +47 -0
  5. package/atoms/Cursor/Cursor.cjs +14 -22
  6. package/atoms/Cursor/Cursor.d.ts +2 -2
  7. package/atoms/Cursor/Cursor.js +1 -103
  8. package/atoms/Cursor/Cursor.twig +28 -0
  9. package/atoms/Figure/Figure.cjs +20 -16
  10. package/atoms/Figure/Figure.d.ts +19 -1
  11. package/atoms/Figure/Figure.js +1 -27
  12. package/atoms/Figure/Figure.twig +120 -0
  13. package/atoms/Figure/FigureTwicPics.cjs +72 -0
  14. package/atoms/Figure/FigureTwicPics.d.ts +48 -0
  15. package/atoms/Figure/FigureTwicPics.js +1 -0
  16. package/atoms/Figure/index.cjs +31 -0
  17. package/atoms/Figure/index.d.ts +2 -0
  18. package/atoms/Figure/index.js +1 -0
  19. package/atoms/Icon/Icon.twig +13 -0
  20. package/atoms/LargeText/LargeText.cjs +15 -23
  21. package/atoms/LargeText/LargeText.d.ts +3 -3
  22. package/atoms/LargeText/LargeText.js +1 -64
  23. package/atoms/LargeText/LargeText.twig +49 -0
  24. package/atoms/LazyInclude/LazyInclude.cjs +8 -13
  25. package/atoms/LazyInclude/LazyInclude.d.ts +4 -4
  26. package/atoms/LazyInclude/LazyInclude.js +1 -46
  27. package/atoms/Prefetch/AbstractPrefetch.cjs +8 -13
  28. package/atoms/Prefetch/AbstractPrefetch.d.ts +1 -1
  29. package/atoms/Prefetch/AbstractPrefetch.js +1 -58
  30. package/atoms/Prefetch/PrefetchWhenOver.cjs +12 -34
  31. package/atoms/Prefetch/PrefetchWhenOver.d.ts +1 -1
  32. package/atoms/Prefetch/PrefetchWhenOver.js +1 -35
  33. package/atoms/Prefetch/PrefetchWhenVisible.cjs +12 -34
  34. package/atoms/Prefetch/PrefetchWhenVisible.d.ts +1 -1
  35. package/atoms/Prefetch/PrefetchWhenVisible.js +1 -36
  36. package/atoms/Prefetch/index.cjs +9 -16
  37. package/atoms/Prefetch/index.js +1 -8
  38. package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +126 -0
  39. package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +133 -0
  40. package/atoms/ScrollAnimation/AbstractScrollAnimation.js +1 -0
  41. package/atoms/ScrollAnimation/ScrollAnimation.cjs +51 -0
  42. package/atoms/ScrollAnimation/ScrollAnimation.d.ts +55 -0
  43. package/atoms/ScrollAnimation/ScrollAnimation.js +1 -0
  44. package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +51 -0
  45. package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +13 -0
  46. package/atoms/ScrollAnimation/ScrollAnimationChild.js +1 -0
  47. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +41 -0
  48. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +6 -0
  49. package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +1 -0
  50. package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +48 -0
  51. package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +35 -0
  52. package/atoms/ScrollAnimation/ScrollAnimationParent.js +1 -0
  53. package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +41 -0
  54. package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +6 -0
  55. package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +1 -0
  56. package/atoms/ScrollAnimation/animationScrollWithEase.cjs +70 -0
  57. package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +11 -0
  58. package/atoms/ScrollAnimation/animationScrollWithEase.js +1 -0
  59. package/atoms/ScrollAnimation/index.cjs +41 -0
  60. package/atoms/ScrollAnimation/index.d.ts +7 -0
  61. package/atoms/ScrollAnimation/index.js +1 -0
  62. package/atoms/index.cjs +13 -19
  63. package/atoms/index.d.ts +2 -1
  64. package/atoms/index.js +1 -13
  65. package/index.cjs +12 -15
  66. package/index.d.ts +1 -0
  67. package/index.js +1 -3
  68. package/molecules/Accordion/Accordion.cjs +12 -34
  69. package/molecules/Accordion/Accordion.js +1 -35
  70. package/molecules/Accordion/Accordion.twig +54 -0
  71. package/molecules/Accordion/AccordionCore.cjs +8 -13
  72. package/molecules/Accordion/AccordionCore.d.ts +2 -2
  73. package/molecules/Accordion/AccordionCore.js +1 -34
  74. package/molecules/Accordion/AccordionItem.cjs +70 -114
  75. package/molecules/Accordion/AccordionItem.d.ts +7 -6
  76. package/molecules/Accordion/AccordionItem.js +1 -178
  77. package/molecules/Menu/Menu.cjs +148 -0
  78. package/molecules/Menu/Menu.d.ts +140 -0
  79. package/molecules/Menu/Menu.js +1 -0
  80. package/molecules/Menu/MenuBtn.cjs +53 -0
  81. package/molecules/Menu/MenuBtn.d.ts +39 -0
  82. package/molecules/Menu/MenuBtn.js +1 -0
  83. package/molecules/Menu/MenuList.cjs +134 -0
  84. package/molecules/Menu/MenuList.d.ts +101 -0
  85. package/molecules/Menu/MenuList.js +1 -0
  86. package/molecules/Menu/index.cjs +33 -0
  87. package/molecules/Menu/index.d.ts +3 -0
  88. package/molecules/Menu/index.js +1 -0
  89. package/molecules/Modal/Modal.cjs +42 -71
  90. package/molecules/Modal/Modal.d.ts +5 -5
  91. package/molecules/Modal/Modal.js +1 -150
  92. package/molecules/Modal/Modal.twig +108 -0
  93. package/molecules/Modal/ModalWithTransition.cjs +13 -43
  94. package/molecules/Modal/ModalWithTransition.js +1 -69
  95. package/molecules/Modal/StyledModal.twig +39 -0
  96. package/molecules/Panel/Panel.cjs +42 -76
  97. package/molecules/Panel/Panel.js +1 -117
  98. package/molecules/Panel/Panel.twig +73 -0
  99. package/molecules/Panel/StyledPanel.twig +28 -0
  100. package/molecules/Slider/AbstractSliderChild.cjs +10 -20
  101. package/molecules/Slider/AbstractSliderChild.d.ts +6 -2
  102. package/molecules/Slider/AbstractSliderChild.js +1 -43
  103. package/molecules/Slider/Slider.cjs +14 -24
  104. package/molecules/Slider/Slider.d.ts +6 -6
  105. package/molecules/Slider/Slider.js +1 -209
  106. package/molecules/Slider/SliderBtn.cjs +9 -16
  107. package/molecules/Slider/SliderBtn.d.ts +1 -1
  108. package/molecules/Slider/SliderBtn.js +1 -34
  109. package/molecules/Slider/SliderCount.cjs +9 -16
  110. package/molecules/Slider/SliderCount.js +1 -19
  111. package/molecules/Slider/SliderDots.cjs +9 -16
  112. package/molecules/Slider/SliderDots.js +1 -24
  113. package/molecules/Slider/SliderDrag.cjs +8 -13
  114. package/molecules/Slider/SliderDrag.js +1 -19
  115. package/molecules/Slider/SliderItem.cjs +14 -37
  116. package/molecules/Slider/SliderItem.js +1 -105
  117. package/molecules/Slider/SliderProgress.cjs +9 -16
  118. package/molecules/Slider/SliderProgress.js +1 -23
  119. package/molecules/Slider/index.cjs +9 -16
  120. package/molecules/Slider/index.js +1 -18
  121. package/molecules/Sticky/Sticky.cjs +11 -19
  122. package/molecules/Sticky/Sticky.d.ts +8 -8
  123. package/molecules/Sticky/Sticky.js +1 -107
  124. package/molecules/Sticky/Sticky.twig +31 -0
  125. package/molecules/TableOfContent/TableOfContent.cjs +9 -16
  126. package/molecules/TableOfContent/TableOfContent.d.ts +1 -1
  127. package/molecules/TableOfContent/TableOfContent.js +1 -42
  128. package/molecules/TableOfContent/TableOfContentAnchor.cjs +8 -13
  129. package/molecules/TableOfContent/TableOfContentAnchor.js +1 -39
  130. package/molecules/TableOfContent/index.cjs +9 -16
  131. package/molecules/TableOfContent/index.js +1 -6
  132. package/molecules/Tabs/Tabs.cjs +54 -82
  133. package/molecules/Tabs/Tabs.d.ts +5 -4
  134. package/molecules/Tabs/Tabs.js +1 -126
  135. package/molecules/Tabs/Tabs.twig +20 -0
  136. package/molecules/index.cjs +13 -18
  137. package/molecules/index.d.ts +1 -0
  138. package/molecules/index.js +1 -18
  139. package/organisms/Frame/Frame.cjs +107 -99
  140. package/organisms/Frame/Frame.d.ts +37 -4
  141. package/organisms/Frame/Frame.js +1 -171
  142. package/organisms/Frame/FrameAnchor.cjs +8 -13
  143. package/organisms/Frame/FrameAnchor.js +1 -22
  144. package/organisms/Frame/FrameForm.cjs +8 -13
  145. package/organisms/Frame/FrameForm.js +1 -22
  146. package/organisms/Frame/FrameTarget.cjs +31 -73
  147. package/organisms/Frame/FrameTarget.js +1 -109
  148. package/organisms/Frame/index.cjs +9 -16
  149. package/organisms/Frame/index.js +1 -10
  150. package/organisms/ImageGrid/ImageGrid.twig +42 -0
  151. package/organisms/index.cjs +9 -13
  152. package/organisms/index.js +1 -1
  153. package/package.json +3 -4
  154. package/primitives/Draggable/Draggable.cjs +15 -28
  155. package/primitives/Draggable/Draggable.d.ts +0 -5
  156. package/primitives/Draggable/Draggable.js +1 -38
  157. package/primitives/Sentinel/Sentinel.cjs +8 -13
  158. package/primitives/Sentinel/Sentinel.js +1 -15
  159. package/primitives/Transition/Transition.cjs +12 -17
  160. package/primitives/Transition/Transition.d.ts +2 -4
  161. package/primitives/Transition/Transition.js +1 -45
  162. package/primitives/index.cjs +9 -16
  163. package/primitives/index.js +1 -8
@@ -0,0 +1,42 @@
1
+ {#
2
+ /**
3
+ * @file
4
+ * Image Grid.
5
+ *
6
+ * @param array<Figure> $images
7
+ * List of images to display. See Figure.twig for the composition of each image.
8
+ * @param array $attr
9
+ * Custom attributes for the root element.
10
+ * @param array $inner_attr
11
+ * Custom attributes for the inner element.
12
+ * @param array $image_attr
13
+ * Custom attributes for the images' elements.
14
+ */
15
+ #}
16
+
17
+ {% set attributes = merge_html_attributes(attr ?? null, { class: 'image-grid' }) %}
18
+ {% set inner_attributes =
19
+ merge_html_attributes(inner_attr ?? null, { class: 'image-grid__inner s:grid grid-cols-12 gap-10' })
20
+ %}
21
+
22
+ <div {{ html_attributes(attributes) }}>
23
+ <div {{ html_attributes(inner_attributes) }}>
24
+ {% for image in images %}
25
+ {% set modulo = loop.index % 5 %}
26
+ {% set image_attributes = merge_html_attributes(image_attr ?? null, {
27
+ class: 'image-grid__img'
28
+ }, {
29
+ class: {
30
+ 's:col-span-7': modulo == 1 or modulo == 4,
31
+ 's:col-span-5 mt-10': modulo == 2,
32
+ 's:col-span-5 mt-10 clear-m-left': modulo == 3 and not loop.last,
33
+ 's:col-start-2 s:col-end-11': modulo == 0 or (modulo in [0,3] and loop.last),
34
+ 's:col-start-2 s:col-end-13': loop.first and loop.last
35
+ }
36
+ }) %}
37
+ <div {{ html_attributes(image_attributes) }}>
38
+ {% include '@ui/atoms/Figure/Figure.twig' with image only %}
39
+ </div>
40
+ {% endfor %}
41
+ </div>
42
+ </div>
@@ -2,23 +2,19 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
- var __reExport = (target, module2, copyDefault, desc) => {
7
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
8
- for (let key of __getOwnPropNames(module2))
9
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
10
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
10
  }
12
- return target;
11
+ return to;
13
12
  };
14
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
15
- return (module2, temp) => {
16
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
17
- };
18
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
15
 
20
16
  // packages/ui/organisms/index.js
21
17
  var organisms_exports = {};
22
- __reExport(organisms_exports, require("./Frame/index.cjs"));
23
18
  module.exports = __toCommonJS(organisms_exports);
19
+ __reExport(organisms_exports, require("./Frame/index.cjs"), module.exports);
24
20
  if (module.exports.default) module.exports = module.exports.default;
@@ -1 +1 @@
1
- export * from "./Frame/index.js";
1
+ export*from"./Frame/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.6",
4
4
  "description": "A set of opiniated, unstyled and accessible components",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,8 +29,7 @@
29
29
  },
30
30
  "homepage": "https://github.com/studiometa/ui#readme",
31
31
  "dependencies": {
32
- "@studiometa/js-toolkit": "^2.0.0-beta.18",
33
- "deepmerge": "^4.2.2",
34
- "motion": "^10.5.0"
32
+ "@studiometa/js-toolkit": "^2.0.0",
33
+ "deepmerge": "^4.2.2"
35
34
  }
36
35
  }
@@ -3,24 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
10
9
  };
11
- var __reExport = (target, module2, copyDefault, desc) => {
12
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
- for (let key of __getOwnPropNames(module2))
14
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
15
  }
17
- return target;
16
+ return to;
18
17
  };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
19
  var __publicField = (obj, key, value) => {
25
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
26
21
  return value;
@@ -31,16 +26,14 @@ var Draggable_exports = {};
31
26
  __export(Draggable_exports, {
32
27
  default: () => Draggable
33
28
  });
34
- var import_motion = require("motion");
29
+ module.exports = __toCommonJS(Draggable_exports);
35
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
36
- var _Draggable = class extends (0, import_js_toolkit.withDrag)(import_js_toolkit.Base) {
37
- constructor() {
38
- super(...arguments);
39
- __publicField(this, "x", 0);
40
- __publicField(this, "y", 0);
41
- __publicField(this, "originX", 0);
42
- __publicField(this, "originY", 0);
43
- }
31
+ var import_utils = require("@studiometa/js-toolkit/utils");
32
+ var Draggable = class extends (0, import_js_toolkit.withDrag)(import_js_toolkit.Base) {
33
+ x = 0;
34
+ y = 0;
35
+ originX = 0;
36
+ originY = 0;
44
37
  dragged(props) {
45
38
  if (props.mode === "start") {
46
39
  this.originX = this.x;
@@ -49,16 +42,10 @@ var _Draggable = class extends (0, import_js_toolkit.withDrag)(import_js_toolkit
49
42
  }
50
43
  this.x = this.originX + props.x - props.origin.x;
51
44
  this.y = this.originY + props.y - props.origin.y;
52
- (0, import_motion.animate)(this.$el, { x: this.x, y: this.y }, _Draggable.animateOptions);
45
+ this.$el.style.transform = (0, import_utils.matrix)({ translateX: this.x, translateY: this.y });
53
46
  }
54
47
  };
55
- var Draggable = _Draggable;
56
48
  __publicField(Draggable, "config", {
57
49
  name: "DraggableElement"
58
50
  });
59
- __publicField(Draggable, "animateOptions", {
60
- easing: "linear",
61
- duration: 0
62
- });
63
- module.exports = __toCommonJS(Draggable_exports);
64
51
  if (module.exports.default) module.exports = module.exports.default;
@@ -5,11 +5,6 @@ export default class Draggable extends Base {
5
5
  static config: {
6
6
  name: string;
7
7
  };
8
- /**
9
- * Options for the animate function.
10
- * @type {import('motion').AnimationListOptions}
11
- */
12
- static animateOptions: import('motion').AnimationListOptions;
13
8
  /**
14
9
  * Horizontal transformation.
15
10
  * @type {number}
@@ -1,38 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { animate } from "motion";
8
- import { Base, withDrag } from "@studiometa/js-toolkit";
9
- const _Draggable = class extends withDrag(Base) {
10
- constructor() {
11
- super(...arguments);
12
- __publicField(this, "x", 0);
13
- __publicField(this, "y", 0);
14
- __publicField(this, "originX", 0);
15
- __publicField(this, "originY", 0);
16
- }
17
- dragged(props) {
18
- if (props.mode === "start") {
19
- this.originX = this.x;
20
- this.originY = this.y;
21
- return;
22
- }
23
- this.x = this.originX + props.x - props.origin.x;
24
- this.y = this.originY + props.y - props.origin.y;
25
- animate(this.$el, { x: this.x, y: this.y }, _Draggable.animateOptions);
26
- }
27
- };
28
- let Draggable = _Draggable;
29
- __publicField(Draggable, "config", {
30
- name: "DraggableElement"
31
- });
32
- __publicField(Draggable, "animateOptions", {
33
- easing: "linear",
34
- duration: 0
35
- });
36
- export {
37
- Draggable as default
38
- };
1
+ import{Base as t,withDrag as r}from"@studiometa/js-toolkit";import{matrix as a}from"@studiometa/js-toolkit/utils";class e extends r(t){static config={name:"DraggableElement"};x=0;y=0;originX=0;originY=0;dragged(i){if(i.mode==="start"){this.originX=this.x,this.originY=this.y;return}this.x=this.originX+i.x-i.origin.x,this.y=this.originY+i.y-i.origin.y,this.$el.style.transform=a({translateX:this.x,translateY:this.y})}}export{e as default};
@@ -3,24 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
10
9
  };
11
- var __reExport = (target, module2, copyDefault, desc) => {
12
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
- for (let key of __getOwnPropNames(module2))
14
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
15
  }
17
- return target;
16
+ return to;
18
17
  };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
19
  var __publicField = (obj, key, value) => {
25
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
26
21
  return value;
@@ -31,11 +26,11 @@ var Sentinel_exports = {};
31
26
  __export(Sentinel_exports, {
32
27
  default: () => Sentinel
33
28
  });
29
+ module.exports = __toCommonJS(Sentinel_exports);
34
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
35
31
  var Sentinel = class extends (0, import_js_toolkit.withIntersectionObserver)(import_js_toolkit.Base, { threshold: [0, 1] }) {
36
32
  };
37
33
  __publicField(Sentinel, "config", {
38
34
  name: "Sentinel"
39
35
  });
40
- module.exports = __toCommonJS(Sentinel_exports);
41
36
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,15 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { Base, withIntersectionObserver } from "@studiometa/js-toolkit";
8
- class Sentinel extends withIntersectionObserver(Base, { threshold: [0, 1] }) {
9
- }
10
- __publicField(Sentinel, "config", {
11
- name: "Sentinel"
12
- });
13
- export {
14
- Sentinel as default
15
- };
1
+ import{Base as e,withIntersectionObserver as t}from"@studiometa/js-toolkit";class n extends t(e,{threshold:[0,1]}){static config={name:"Sentinel"}}export{n as default};
@@ -3,24 +3,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
10
9
  };
11
- var __reExport = (target, module2, copyDefault, desc) => {
12
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
- for (let key of __getOwnPropNames(module2))
14
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
15
  }
17
- return target;
16
+ return to;
18
17
  };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
19
  var __publicField = (obj, key, value) => {
25
20
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
26
21
  return value;
@@ -31,6 +26,7 @@ var Transition_exports = {};
31
26
  __export(Transition_exports, {
32
27
  default: () => Transition
33
28
  });
29
+ module.exports = __toCommonJS(Transition_exports);
34
30
  var import_js_toolkit = require("@studiometa/js-toolkit");
35
31
  var import_utils = require("@studiometa/js-toolkit/utils");
36
32
  var Transition = class extends import_js_toolkit.Base {
@@ -38,17 +34,17 @@ var Transition = class extends import_js_toolkit.Base {
38
34
  return this.$el;
39
35
  }
40
36
  enter() {
41
- const { enterFrom, enterActive, enterTo, enterKeep } = this.$options;
37
+ const { enterFrom, enterActive, enterTo, enterKeep, leaveTo } = this.$options;
42
38
  return (0, import_utils.transition)(this.target, {
43
- from: enterFrom,
39
+ from: (leaveTo + " " + enterFrom).trim(),
44
40
  active: enterActive,
45
41
  to: enterTo
46
42
  }, enterKeep && "keep");
47
43
  }
48
44
  leave() {
49
- const { leaveFrom, leaveActive, leaveTo, leaveKeep } = this.$options;
45
+ const { leaveFrom, leaveActive, leaveTo, leaveKeep, enterTo } = this.$options;
50
46
  return (0, import_utils.transition)(this.target, {
51
- from: leaveFrom,
47
+ from: (enterTo + " " + leaveFrom).trim(),
52
48
  active: leaveActive,
53
49
  to: leaveTo
54
50
  }, leaveKeep && "keep");
@@ -67,5 +63,4 @@ __publicField(Transition, "config", {
67
63
  leaveKeep: Boolean
68
64
  }
69
65
  });
70
- module.exports = __toCommonJS(Transition_exports);
71
66
  if (module.exports.default) module.exports = module.exports.default;
@@ -36,19 +36,17 @@ export default class Transition extends Base {
36
36
  /**
37
37
  * Trigger the enter transition.
38
38
  *
39
- * @todo merge leaveTo and enterFrom classes when leaveKeep is active
40
39
  * @this {TransitionInterface}
41
40
  * @returns {Promise<void>}
42
41
  */
43
- enter(): Promise<void>;
42
+ enter(this: TransitionInterface): Promise<void>;
44
43
  /**
45
44
  * Trigger the leave transition.
46
45
  *
47
- * @todo merge enterTo and leaveTo classes when enterKeep is active
48
46
  * @this {TransitionInterface}
49
47
  * @returns {Promise<void>}
50
48
  */
51
- leave(): Promise<void>;
49
+ leave(this: TransitionInterface): Promise<void>;
52
50
  }
53
51
  export type TransitionOptions = {
54
52
  enterFrom: string;
@@ -1,45 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { Base } from "@studiometa/js-toolkit";
8
- import { transition } from "@studiometa/js-toolkit/utils";
9
- class Transition extends Base {
10
- get target() {
11
- return this.$el;
12
- }
13
- enter() {
14
- const { enterFrom, enterActive, enterTo, enterKeep } = this.$options;
15
- return transition(this.target, {
16
- from: enterFrom,
17
- active: enterActive,
18
- to: enterTo
19
- }, enterKeep && "keep");
20
- }
21
- leave() {
22
- const { leaveFrom, leaveActive, leaveTo, leaveKeep } = this.$options;
23
- return transition(this.target, {
24
- from: leaveFrom,
25
- active: leaveActive,
26
- to: leaveTo
27
- }, leaveKeep && "keep");
28
- }
29
- }
30
- __publicField(Transition, "config", {
31
- name: "Transition",
32
- options: {
33
- enterFrom: String,
34
- enterActive: String,
35
- enterTo: String,
36
- enterKeep: Boolean,
37
- leaveFrom: String,
38
- leaveActive: String,
39
- leaveTo: String,
40
- leaveKeep: Boolean
41
- }
42
- });
43
- export {
44
- Transition as default
45
- };
1
+ import{Base as a}from"@studiometa/js-toolkit";import{transition as i}from"@studiometa/js-toolkit/utils";class s extends a{static config={name:"Transition",options:{enterFrom:String,enterActive:String,enterTo:String,enterKeep:Boolean,leaveFrom:String,leaveActive:String,leaveTo:String,leaveKeep:Boolean}};get target(){return this.$el}enter(){const{enterFrom:e,enterActive:t,enterTo:r,enterKeep:n,leaveTo:o}=this.$options;return i(this.target,{from:(o+" "+e).trim(),active:t,to:r},n&&"keep")}leave(){const{leaveFrom:e,leaveActive:t,leaveTo:r,leaveKeep:n,enterTo:o}=this.$options;return i(this.target,{from:(o+" "+e).trim(),active:t,to:r},n&&"keep")}}export{s as default};
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
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 });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
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);
28
21
 
29
22
  // packages/ui/primitives/index.js
30
23
  var primitives_exports = {};
@@ -33,8 +26,8 @@ __export(primitives_exports, {
33
26
  Sentinel: () => import_Sentinel.default,
34
27
  Transition: () => import_Transition.default
35
28
  });
29
+ module.exports = __toCommonJS(primitives_exports);
36
30
  var import_Draggable = __toESM(require("./Draggable/Draggable.cjs"), 1);
37
31
  var import_Sentinel = __toESM(require("./Sentinel/Sentinel.cjs"), 1);
38
32
  var import_Transition = __toESM(require("./Transition/Transition.cjs"), 1);
39
- module.exports = __toCommonJS(primitives_exports);
40
33
  if (module.exports.default) module.exports = module.exports.default;
@@ -1,8 +1 @@
1
- import { default as default2 } from "./Draggable/Draggable.js";
2
- import { default as default3 } from "./Sentinel/Sentinel.js";
3
- import { default as default4 } from "./Transition/Transition.js";
4
- export {
5
- default2 as Draggable,
6
- default3 as Sentinel,
7
- default4 as Transition
8
- };
1
+ import{default as r}from"./Draggable/Draggable.js";import{default as o}from"./Sentinel/Sentinel.js";import{default as l}from"./Transition/Transition.js";export{r as Draggable,o as Sentinel,l as Transition};