@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.
- package/atoms/AnchorScrollTo/AnchorScrollTo.cjs +8 -13
- package/atoms/AnchorScrollTo/AnchorScrollTo.js +1 -26
- package/atoms/Button/Button.twig +68 -0
- package/atoms/Button/StyledButton.twig +47 -0
- package/atoms/Cursor/Cursor.cjs +14 -22
- package/atoms/Cursor/Cursor.d.ts +2 -2
- package/atoms/Cursor/Cursor.js +1 -103
- package/atoms/Cursor/Cursor.twig +28 -0
- package/atoms/Figure/Figure.cjs +20 -16
- package/atoms/Figure/Figure.d.ts +19 -1
- package/atoms/Figure/Figure.js +1 -27
- package/atoms/Figure/Figure.twig +120 -0
- package/atoms/Figure/FigureTwicPics.cjs +72 -0
- package/atoms/Figure/FigureTwicPics.d.ts +48 -0
- package/atoms/Figure/FigureTwicPics.js +1 -0
- package/atoms/Figure/index.cjs +31 -0
- package/atoms/Figure/index.d.ts +2 -0
- package/atoms/Figure/index.js +1 -0
- package/atoms/Icon/Icon.twig +13 -0
- package/atoms/LargeText/LargeText.cjs +15 -23
- package/atoms/LargeText/LargeText.d.ts +3 -3
- package/atoms/LargeText/LargeText.js +1 -64
- package/atoms/LargeText/LargeText.twig +49 -0
- package/atoms/LazyInclude/LazyInclude.cjs +8 -13
- package/atoms/LazyInclude/LazyInclude.d.ts +4 -4
- package/atoms/LazyInclude/LazyInclude.js +1 -46
- package/atoms/Prefetch/AbstractPrefetch.cjs +8 -13
- package/atoms/Prefetch/AbstractPrefetch.d.ts +1 -1
- package/atoms/Prefetch/AbstractPrefetch.js +1 -58
- package/atoms/Prefetch/PrefetchWhenOver.cjs +12 -34
- package/atoms/Prefetch/PrefetchWhenOver.d.ts +1 -1
- package/atoms/Prefetch/PrefetchWhenOver.js +1 -35
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +12 -34
- package/atoms/Prefetch/PrefetchWhenVisible.d.ts +1 -1
- package/atoms/Prefetch/PrefetchWhenVisible.js +1 -36
- package/atoms/Prefetch/index.cjs +9 -16
- package/atoms/Prefetch/index.js +1 -8
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +126 -0
- package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +133 -0
- package/atoms/ScrollAnimation/AbstractScrollAnimation.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimation.cjs +51 -0
- package/atoms/ScrollAnimation/ScrollAnimation.d.ts +55 -0
- package/atoms/ScrollAnimation/ScrollAnimation.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +51 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +13 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +41 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +6 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +48 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +35 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.js +1 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +41 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +6 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +1 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs +70 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +11 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.js +1 -0
- package/atoms/ScrollAnimation/index.cjs +41 -0
- package/atoms/ScrollAnimation/index.d.ts +7 -0
- package/atoms/ScrollAnimation/index.js +1 -0
- package/atoms/index.cjs +13 -19
- package/atoms/index.d.ts +2 -1
- package/atoms/index.js +1 -13
- package/index.cjs +12 -15
- package/index.d.ts +1 -0
- package/index.js +1 -3
- package/molecules/Accordion/Accordion.cjs +12 -34
- package/molecules/Accordion/Accordion.js +1 -35
- package/molecules/Accordion/Accordion.twig +54 -0
- package/molecules/Accordion/AccordionCore.cjs +8 -13
- package/molecules/Accordion/AccordionCore.d.ts +2 -2
- package/molecules/Accordion/AccordionCore.js +1 -34
- package/molecules/Accordion/AccordionItem.cjs +70 -114
- package/molecules/Accordion/AccordionItem.d.ts +7 -6
- package/molecules/Accordion/AccordionItem.js +1 -178
- package/molecules/Menu/Menu.cjs +148 -0
- package/molecules/Menu/Menu.d.ts +140 -0
- package/molecules/Menu/Menu.js +1 -0
- package/molecules/Menu/MenuBtn.cjs +53 -0
- package/molecules/Menu/MenuBtn.d.ts +39 -0
- package/molecules/Menu/MenuBtn.js +1 -0
- package/molecules/Menu/MenuList.cjs +134 -0
- package/molecules/Menu/MenuList.d.ts +101 -0
- package/molecules/Menu/MenuList.js +1 -0
- package/molecules/Menu/index.cjs +33 -0
- package/molecules/Menu/index.d.ts +3 -0
- package/molecules/Menu/index.js +1 -0
- package/molecules/Modal/Modal.cjs +42 -71
- package/molecules/Modal/Modal.d.ts +5 -5
- package/molecules/Modal/Modal.js +1 -150
- package/molecules/Modal/Modal.twig +108 -0
- package/molecules/Modal/ModalWithTransition.cjs +13 -43
- package/molecules/Modal/ModalWithTransition.js +1 -69
- package/molecules/Modal/StyledModal.twig +39 -0
- package/molecules/Panel/Panel.cjs +42 -76
- package/molecules/Panel/Panel.js +1 -117
- package/molecules/Panel/Panel.twig +73 -0
- package/molecules/Panel/StyledPanel.twig +28 -0
- package/molecules/Slider/AbstractSliderChild.cjs +10 -20
- package/molecules/Slider/AbstractSliderChild.d.ts +6 -2
- package/molecules/Slider/AbstractSliderChild.js +1 -43
- package/molecules/Slider/Slider.cjs +14 -24
- package/molecules/Slider/Slider.d.ts +6 -6
- package/molecules/Slider/Slider.js +1 -209
- package/molecules/Slider/SliderBtn.cjs +9 -16
- package/molecules/Slider/SliderBtn.d.ts +1 -1
- package/molecules/Slider/SliderBtn.js +1 -34
- package/molecules/Slider/SliderCount.cjs +9 -16
- package/molecules/Slider/SliderCount.js +1 -19
- package/molecules/Slider/SliderDots.cjs +9 -16
- package/molecules/Slider/SliderDots.js +1 -24
- package/molecules/Slider/SliderDrag.cjs +8 -13
- package/molecules/Slider/SliderDrag.js +1 -19
- package/molecules/Slider/SliderItem.cjs +14 -37
- package/molecules/Slider/SliderItem.js +1 -105
- package/molecules/Slider/SliderProgress.cjs +9 -16
- package/molecules/Slider/SliderProgress.js +1 -23
- package/molecules/Slider/index.cjs +9 -16
- package/molecules/Slider/index.js +1 -18
- package/molecules/Sticky/Sticky.cjs +11 -19
- package/molecules/Sticky/Sticky.d.ts +8 -8
- package/molecules/Sticky/Sticky.js +1 -107
- package/molecules/Sticky/Sticky.twig +31 -0
- package/molecules/TableOfContent/TableOfContent.cjs +9 -16
- package/molecules/TableOfContent/TableOfContent.d.ts +1 -1
- package/molecules/TableOfContent/TableOfContent.js +1 -42
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +8 -13
- package/molecules/TableOfContent/TableOfContentAnchor.js +1 -39
- package/molecules/TableOfContent/index.cjs +9 -16
- package/molecules/TableOfContent/index.js +1 -6
- package/molecules/Tabs/Tabs.cjs +54 -82
- package/molecules/Tabs/Tabs.d.ts +5 -4
- package/molecules/Tabs/Tabs.js +1 -126
- package/molecules/Tabs/Tabs.twig +20 -0
- package/molecules/index.cjs +13 -18
- package/molecules/index.d.ts +1 -0
- package/molecules/index.js +1 -18
- package/organisms/Frame/Frame.cjs +107 -99
- package/organisms/Frame/Frame.d.ts +37 -4
- package/organisms/Frame/Frame.js +1 -171
- package/organisms/Frame/FrameAnchor.cjs +8 -13
- package/organisms/Frame/FrameAnchor.js +1 -22
- package/organisms/Frame/FrameForm.cjs +8 -13
- package/organisms/Frame/FrameForm.js +1 -22
- package/organisms/Frame/FrameTarget.cjs +31 -73
- package/organisms/Frame/FrameTarget.js +1 -109
- package/organisms/Frame/index.cjs +9 -16
- package/organisms/Frame/index.js +1 -10
- package/organisms/ImageGrid/ImageGrid.twig +42 -0
- package/organisms/index.cjs +9 -13
- package/organisms/index.js +1 -1
- package/package.json +3 -4
- package/primitives/Draggable/Draggable.cjs +15 -28
- package/primitives/Draggable/Draggable.d.ts +0 -5
- package/primitives/Draggable/Draggable.js +1 -38
- package/primitives/Sentinel/Sentinel.cjs +8 -13
- package/primitives/Sentinel/Sentinel.js +1 -15
- package/primitives/Transition/Transition.cjs +12 -17
- package/primitives/Transition/Transition.d.ts +2 -4
- package/primitives/Transition/Transition.js +1 -45
- package/primitives/index.cjs +9 -16
- package/primitives/index.js +1 -8
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* Modal component.
|
|
5
|
+
*
|
|
6
|
+
* @param array $attr
|
|
7
|
+
* Use it to customize the root element attributes.
|
|
8
|
+
* @param array $modal_attr
|
|
9
|
+
* Use it to customize the modal element attributes.
|
|
10
|
+
* @param array $overlay_attr
|
|
11
|
+
* Use it to customize the overlay element attributes.
|
|
12
|
+
* @param array $wrapper_attr
|
|
13
|
+
* Use it to customize the wrapper element attributes.
|
|
14
|
+
* @param array $container_atrr
|
|
15
|
+
* Use it to customize the container element attributes.
|
|
16
|
+
* @param array $content_atrr
|
|
17
|
+
* Use it to customize the content element attributes.
|
|
18
|
+
*
|
|
19
|
+
* @block $open
|
|
20
|
+
* Use this block to customize the open trigger button.
|
|
21
|
+
* @block $close
|
|
22
|
+
* Use this block to customize the close trigger button.
|
|
23
|
+
* @block $content
|
|
24
|
+
* Use this block to set the modal's content.
|
|
25
|
+
*/
|
|
26
|
+
#}
|
|
27
|
+
|
|
28
|
+
{# Root attributes #}
|
|
29
|
+
{% set attributes = merge_html_attributes(attr ?? null, { data_component: 'Modal' }) %}
|
|
30
|
+
|
|
31
|
+
{# Modal attributes #}
|
|
32
|
+
{% set modal_attributes =
|
|
33
|
+
merge_html_attributes(
|
|
34
|
+
modal_attr ?? null,
|
|
35
|
+
{ class: 'z-goku fixed inset-0' },
|
|
36
|
+
{
|
|
37
|
+
data_ref: 'modal',
|
|
38
|
+
role: 'dialog',
|
|
39
|
+
aria_modal: true,
|
|
40
|
+
aria_hidden: true,
|
|
41
|
+
style: { opacity: '0', pointer_events: 'none', visibility: 'hidden' }
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
%}
|
|
45
|
+
|
|
46
|
+
{# Overlay attributes #}
|
|
47
|
+
{% set overlay_attributes =
|
|
48
|
+
merge_html_attributes(
|
|
49
|
+
overlay_attr ?? null,
|
|
50
|
+
{ class: 'z-under absolute inset-0 bg-black bg-opacity-75' },
|
|
51
|
+
{ data_ref: 'overlay', tabindex: '-1' }
|
|
52
|
+
)
|
|
53
|
+
%}
|
|
54
|
+
|
|
55
|
+
{% set wrapper_attributes =
|
|
56
|
+
merge_html_attributes(
|
|
57
|
+
wrapper_attr ?? null,
|
|
58
|
+
{ class: 'absolute inset-0 flex items-center justify-center' },
|
|
59
|
+
{ class: 'pointer-events-none' }
|
|
60
|
+
)
|
|
61
|
+
%}
|
|
62
|
+
|
|
63
|
+
{# Container attributes #}
|
|
64
|
+
{% set container_attributes =
|
|
65
|
+
merge_html_attributes(
|
|
66
|
+
container_attr ?? null,
|
|
67
|
+
{ class: 'bg-white rounded shadow-l' },
|
|
68
|
+
{
|
|
69
|
+
data_ref: 'container',
|
|
70
|
+
class: 'z-above relative max-h-full overflow-x-hidden overflow-y-auto pointer-events-auto'
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
%}
|
|
74
|
+
|
|
75
|
+
{# Content attributes #}
|
|
76
|
+
{% set content_attributes =
|
|
77
|
+
merge_html_attributes(
|
|
78
|
+
content_attr ?? null,
|
|
79
|
+
{ class: 'max-w-3xl p-16 pt-20' },
|
|
80
|
+
{ data_ref: 'content' }
|
|
81
|
+
)
|
|
82
|
+
%}
|
|
83
|
+
|
|
84
|
+
<div {{ html_attributes(attributes) }}>
|
|
85
|
+
{% block open %}
|
|
86
|
+
{% include '@ui/atoms/Button/Button.twig' with { label: 'Open', attr: { data_ref: 'open' } } %}
|
|
87
|
+
{% endblock %}
|
|
88
|
+
<div {{ html_attributes(modal_attributes) }}>
|
|
89
|
+
<div {{ html_attributes(overlay_attributes) }}></div>
|
|
90
|
+
<div {{ html_attributes(wrapper_attributes) }}>
|
|
91
|
+
<div {{ html_attributes(container_attributes) }}>
|
|
92
|
+
{% block close %}
|
|
93
|
+
<div class="absolute top-0 right-0 m-2">
|
|
94
|
+
{% include '@ui/atoms/Button/Button.twig' with {
|
|
95
|
+
label: 'Close',
|
|
96
|
+
attr: { data_ref: 'close' }
|
|
97
|
+
} %}
|
|
98
|
+
</div>
|
|
99
|
+
{% endblock %}
|
|
100
|
+
<div {{ html_attributes(content_attributes) }}>
|
|
101
|
+
{% block content %}
|
|
102
|
+
No content.
|
|
103
|
+
{% endblock %}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
@@ -5,70 +5,41 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
8
|
var __export = (target, all) => {
|
|
10
9
|
for (var name in all)
|
|
11
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
11
|
};
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
15
|
-
for (let key of __getOwnPropNames(
|
|
16
|
-
if (!__hasOwnProp.call(
|
|
17
|
-
__defProp(
|
|
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 });
|
|
18
17
|
}
|
|
19
|
-
return
|
|
18
|
+
return to;
|
|
20
19
|
};
|
|
21
|
-
var __toESM = (
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
25
|
-
return (module2, temp) => {
|
|
26
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
27
|
-
};
|
|
28
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
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);
|
|
29
22
|
var __publicField = (obj, key, value) => {
|
|
30
23
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
24
|
return value;
|
|
32
25
|
};
|
|
33
|
-
var __async = (__this, __arguments, generator) => {
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
var fulfilled = (value) => {
|
|
36
|
-
try {
|
|
37
|
-
step(generator.next(value));
|
|
38
|
-
} catch (e) {
|
|
39
|
-
reject(e);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var rejected = (value) => {
|
|
43
|
-
try {
|
|
44
|
-
step(generator.throw(value));
|
|
45
|
-
} catch (e) {
|
|
46
|
-
reject(e);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
26
|
|
|
54
27
|
// packages/ui/molecules/Modal/ModalWithTransition.js
|
|
55
28
|
var ModalWithTransition_exports = {};
|
|
56
29
|
__export(ModalWithTransition_exports, {
|
|
57
30
|
default: () => ModalWithTransition
|
|
58
31
|
});
|
|
32
|
+
module.exports = __toCommonJS(ModalWithTransition_exports);
|
|
59
33
|
var import_Modal = __toESM(require("./Modal.cjs"), 1);
|
|
60
34
|
var ModalWithTransition = class extends import_Modal.default {
|
|
61
35
|
open() {
|
|
62
36
|
this.$refs.modal.style.visibility = "";
|
|
63
37
|
return super.open();
|
|
64
38
|
}
|
|
65
|
-
close() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.$refs.modal.style.visibility = "hidden";
|
|
70
|
-
return Promise.resolve();
|
|
71
|
-
});
|
|
39
|
+
async close() {
|
|
40
|
+
await super.close();
|
|
41
|
+
this.$refs.modal.style.visibility = "hidden";
|
|
42
|
+
return Promise.resolve();
|
|
72
43
|
}
|
|
73
44
|
};
|
|
74
45
|
__publicField(ModalWithTransition, "config", {
|
|
@@ -96,5 +67,4 @@ __publicField(ModalWithTransition, "config", {
|
|
|
96
67
|
}
|
|
97
68
|
}
|
|
98
69
|
});
|
|
99
|
-
module.exports = __toCommonJS(ModalWithTransition_exports);
|
|
100
70
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
|
|
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
|
-
var __async = (__this, __arguments, generator) => {
|
|
8
|
-
return new Promise((resolve, reject) => {
|
|
9
|
-
var fulfilled = (value) => {
|
|
10
|
-
try {
|
|
11
|
-
step(generator.next(value));
|
|
12
|
-
} catch (e) {
|
|
13
|
-
reject(e);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var rejected = (value) => {
|
|
17
|
-
try {
|
|
18
|
-
step(generator.throw(value));
|
|
19
|
-
} catch (e) {
|
|
20
|
-
reject(e);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
24
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
import Modal from "./Modal.js";
|
|
28
|
-
class ModalWithTransition extends Modal {
|
|
29
|
-
open() {
|
|
30
|
-
this.$refs.modal.style.visibility = "";
|
|
31
|
-
return super.open();
|
|
32
|
-
}
|
|
33
|
-
close() {
|
|
34
|
-
var __superGet = (key) => super[key];
|
|
35
|
-
return __async(this, null, function* () {
|
|
36
|
-
yield __superGet("close").call(this);
|
|
37
|
-
this.$refs.modal.style.visibility = "hidden";
|
|
38
|
-
return Promise.resolve();
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
__publicField(ModalWithTransition, "config", {
|
|
43
|
-
name: "ModalWithTransition",
|
|
44
|
-
options: {
|
|
45
|
-
styles: {
|
|
46
|
-
type: Object,
|
|
47
|
-
default: () => ({
|
|
48
|
-
modal: {
|
|
49
|
-
closed: {
|
|
50
|
-
opacity: "0",
|
|
51
|
-
pointerEvents: "none"
|
|
52
|
-
},
|
|
53
|
-
active: "transition duration-500 ease-out-expo"
|
|
54
|
-
},
|
|
55
|
-
overlay: {
|
|
56
|
-
closed: "opacity-0",
|
|
57
|
-
active: "transition duration-500 ease-out-expo"
|
|
58
|
-
},
|
|
59
|
-
container: {
|
|
60
|
-
closed: "transform scale-95 opacity-0",
|
|
61
|
-
active: "transition duration-500 ease-out-expo"
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
export {
|
|
68
|
-
ModalWithTransition as default
|
|
69
|
-
};
|
|
1
|
+
import e from"./Modal.js";class t extends e{static config={name:"ModalWithTransition",options:{styles:{type:Object,default:()=>({modal:{closed:{opacity:"0",pointerEvents:"none"},active:"transition duration-500 ease-out-expo"},overlay:{closed:"opacity-0",active:"transition duration-500 ease-out-expo"},container:{closed:"transform scale-95 opacity-0",active:"transition duration-500 ease-out-expo"}})}}};open(){return this.$refs.modal.style.visibility="",super.open()}async close(){return await super.close(),this.$refs.modal.style.visibility="hidden",Promise.resolve()}}export{t as default};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* Modal component.
|
|
5
|
+
*
|
|
6
|
+
* @param array $attr
|
|
7
|
+
* Use it to customize the root element attributes.
|
|
8
|
+
* @param array $modal_attr
|
|
9
|
+
* Use it to customize the modal element attributes.
|
|
10
|
+
* @param array $overlay_attr
|
|
11
|
+
* Use it to customize the overlay element attributes.
|
|
12
|
+
* @param array $container_atrr
|
|
13
|
+
* Use it to customize the container element attributes.
|
|
14
|
+
* @param array $content_atrr
|
|
15
|
+
* Use it to customize the content element attributes.
|
|
16
|
+
*
|
|
17
|
+
* @block $open
|
|
18
|
+
* Use this block to customize the open trigger button.
|
|
19
|
+
* @block $close
|
|
20
|
+
* Use this block to customize the close trigger button.
|
|
21
|
+
* @block $content
|
|
22
|
+
* Use this block to set the modal's content.
|
|
23
|
+
*/
|
|
24
|
+
#}
|
|
25
|
+
|
|
26
|
+
{% extends '@ui/molecules/Modal/Modal.twig' %}
|
|
27
|
+
|
|
28
|
+
{% block open %}
|
|
29
|
+
{% include '@ui/atoms/Button/StyledButton.twig' with { label: 'Open', attr: { data_ref: 'open' } } %}
|
|
30
|
+
{% endblock %}
|
|
31
|
+
|
|
32
|
+
{% block close %}
|
|
33
|
+
<div class="absolute top-0 right-0 m-2">
|
|
34
|
+
{% include '@ui/atoms/Button/StyledButton.twig' with {
|
|
35
|
+
label: 'Close',
|
|
36
|
+
attr: { data_ref: 'close' }
|
|
37
|
+
} %}
|
|
38
|
+
</div>
|
|
39
|
+
{% endblock %}
|
|
@@ -5,63 +5,36 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
8
|
var __export = (target, all) => {
|
|
10
9
|
for (var name in all)
|
|
11
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
11
|
};
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
15
|
-
for (let key of __getOwnPropNames(
|
|
16
|
-
if (!__hasOwnProp.call(
|
|
17
|
-
__defProp(
|
|
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 });
|
|
18
17
|
}
|
|
19
|
-
return
|
|
18
|
+
return to;
|
|
20
19
|
};
|
|
21
|
-
var __toESM = (
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
25
|
-
return (module2, temp) => {
|
|
26
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
27
|
-
};
|
|
28
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
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);
|
|
29
22
|
var __publicField = (obj, key, value) => {
|
|
30
23
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
24
|
return value;
|
|
32
25
|
};
|
|
33
|
-
var __async = (__this, __arguments, generator) => {
|
|
34
|
-
return new Promise((resolve, reject) => {
|
|
35
|
-
var fulfilled = (value) => {
|
|
36
|
-
try {
|
|
37
|
-
step(generator.next(value));
|
|
38
|
-
} catch (e) {
|
|
39
|
-
reject(e);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var rejected = (value) => {
|
|
43
|
-
try {
|
|
44
|
-
step(generator.throw(value));
|
|
45
|
-
} catch (e) {
|
|
46
|
-
reject(e);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
26
|
|
|
54
27
|
// packages/ui/molecules/Panel/Panel.js
|
|
55
28
|
var Panel_exports = {};
|
|
56
29
|
__export(Panel_exports, {
|
|
57
30
|
default: () => Panel
|
|
58
31
|
});
|
|
32
|
+
module.exports = __toCommonJS(Panel_exports);
|
|
59
33
|
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
60
34
|
var import_Modal = __toESM(require("../Modal/Modal.cjs"), 1);
|
|
61
35
|
var _Panel = class extends import_Modal.default {
|
|
62
36
|
get translateClass() {
|
|
63
|
-
|
|
64
|
-
return (_a = _Panel.translateClasses[this.$options.position]) != null ? _a : _Panel.translateClasses[_Panel.config.options.position.default];
|
|
37
|
+
return _Panel.translateClasses[this.$options.position] ?? _Panel.translateClasses[_Panel.config.options.position.default];
|
|
65
38
|
}
|
|
66
39
|
get containerOffset() {
|
|
67
40
|
const { offsetTop, offsetLeft, offsetWidth, offsetHeight } = this.$refs.container;
|
|
@@ -81,51 +54,45 @@ var _Panel = class extends import_Modal.default {
|
|
|
81
54
|
};
|
|
82
55
|
return (0, import_utils.matrix)(store[this.$options.position]);
|
|
83
56
|
}
|
|
84
|
-
open() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
57
|
+
async open() {
|
|
58
|
+
if (this.isOpen) {
|
|
59
|
+
return Promise.resolve();
|
|
60
|
+
}
|
|
61
|
+
this.$refs.modal.classList.remove("pointer-events-none");
|
|
62
|
+
(0, import_utils.transition)(this.$refs.container, {
|
|
63
|
+
from: {
|
|
64
|
+
transform: this.containerOffset
|
|
65
|
+
},
|
|
66
|
+
to: {
|
|
67
|
+
transform: "none"
|
|
89
68
|
}
|
|
90
|
-
|
|
69
|
+
}, "keep");
|
|
70
|
+
(0, import_utils.transition)(this.$refs.overlay, {
|
|
71
|
+
from: "opacity-0"
|
|
72
|
+
});
|
|
73
|
+
return super.open();
|
|
74
|
+
}
|
|
75
|
+
async close() {
|
|
76
|
+
if (!this.isOpen || this.isClosing) {
|
|
77
|
+
return Promise.resolve();
|
|
78
|
+
}
|
|
79
|
+
this.isClosing = true;
|
|
80
|
+
this.$refs.modal.classList.add("pointer-events-none");
|
|
81
|
+
await Promise.all([
|
|
91
82
|
(0, import_utils.transition)(this.$refs.container, {
|
|
92
83
|
from: {
|
|
93
|
-
transform:
|
|
84
|
+
transform: "none"
|
|
94
85
|
},
|
|
95
86
|
to: {
|
|
96
|
-
transform:
|
|
87
|
+
transform: this.containerOffset
|
|
97
88
|
}
|
|
98
|
-
}, "keep")
|
|
89
|
+
}, "keep"),
|
|
99
90
|
(0, import_utils.transition)(this.$refs.overlay, {
|
|
100
|
-
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
close() {
|
|
106
|
-
var __superGet = (key) => super[key];
|
|
107
|
-
return __async(this, null, function* () {
|
|
108
|
-
if (!this.isOpen || this.isClosing) {
|
|
109
|
-
return Promise.resolve();
|
|
110
|
-
}
|
|
111
|
-
this.isClosing = true;
|
|
112
|
-
this.$refs.modal.classList.add("pointer-events-none");
|
|
113
|
-
yield Promise.all([
|
|
114
|
-
(0, import_utils.transition)(this.$refs.container, {
|
|
115
|
-
from: {
|
|
116
|
-
transform: "none"
|
|
117
|
-
},
|
|
118
|
-
to: {
|
|
119
|
-
transform: this.containerOffset
|
|
120
|
-
}
|
|
121
|
-
}, "keep"),
|
|
122
|
-
(0, import_utils.transition)(this.$refs.overlay, {
|
|
123
|
-
to: "opacity-0"
|
|
124
|
-
}, "keep")
|
|
125
|
-
]);
|
|
126
|
-
this.isClosing = false;
|
|
127
|
-
return __superGet("close").call(this);
|
|
128
|
-
});
|
|
91
|
+
to: "opacity-0"
|
|
92
|
+
}, "keep")
|
|
93
|
+
]);
|
|
94
|
+
this.isClosing = false;
|
|
95
|
+
return super.close();
|
|
129
96
|
}
|
|
130
97
|
};
|
|
131
98
|
var Panel = _Panel;
|
|
@@ -144,5 +111,4 @@ __publicField(Panel, "translateClasses", {
|
|
|
144
111
|
bottom: "translate-y-full",
|
|
145
112
|
left: "-translate-x-full"
|
|
146
113
|
});
|
|
147
|
-
module.exports = __toCommonJS(Panel_exports);
|
|
148
114
|
if (module.exports.default) module.exports = module.exports.default;
|
package/molecules/Panel/Panel.js
CHANGED
|
@@ -1,117 +1 @@
|
|
|
1
|
-
|
|
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
|
-
var __async = (__this, __arguments, generator) => {
|
|
8
|
-
return new Promise((resolve, reject) => {
|
|
9
|
-
var fulfilled = (value) => {
|
|
10
|
-
try {
|
|
11
|
-
step(generator.next(value));
|
|
12
|
-
} catch (e) {
|
|
13
|
-
reject(e);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var rejected = (value) => {
|
|
17
|
-
try {
|
|
18
|
-
step(generator.throw(value));
|
|
19
|
-
} catch (e) {
|
|
20
|
-
reject(e);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
24
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
import { transition, matrix } from "@studiometa/js-toolkit/utils";
|
|
28
|
-
import Modal from "../Modal/Modal.js";
|
|
29
|
-
const _Panel = class extends Modal {
|
|
30
|
-
get translateClass() {
|
|
31
|
-
var _a;
|
|
32
|
-
return (_a = _Panel.translateClasses[this.$options.position]) != null ? _a : _Panel.translateClasses[_Panel.config.options.position.default];
|
|
33
|
-
}
|
|
34
|
-
get containerOffset() {
|
|
35
|
-
const { offsetTop, offsetLeft, offsetWidth, offsetHeight } = this.$refs.container;
|
|
36
|
-
const store = {
|
|
37
|
-
top: {
|
|
38
|
-
translateY: (offsetTop + offsetHeight) * -1
|
|
39
|
-
},
|
|
40
|
-
right: {
|
|
41
|
-
translateX: window.innerWidth - offsetLeft + offsetWidth * 2
|
|
42
|
-
},
|
|
43
|
-
bottom: {
|
|
44
|
-
translateY: window.innerHeight - offsetTop + offsetHeight * 2
|
|
45
|
-
},
|
|
46
|
-
left: {
|
|
47
|
-
translateX: (offsetLeft + offsetWidth) * -1
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
return matrix(store[this.$options.position]);
|
|
51
|
-
}
|
|
52
|
-
open() {
|
|
53
|
-
var __superGet = (key) => super[key];
|
|
54
|
-
return __async(this, null, function* () {
|
|
55
|
-
if (this.isOpen) {
|
|
56
|
-
return Promise.resolve();
|
|
57
|
-
}
|
|
58
|
-
this.$refs.modal.classList.remove("pointer-events-none");
|
|
59
|
-
transition(this.$refs.container, {
|
|
60
|
-
from: {
|
|
61
|
-
transform: this.containerOffset
|
|
62
|
-
},
|
|
63
|
-
to: {
|
|
64
|
-
transform: "none"
|
|
65
|
-
}
|
|
66
|
-
}, "keep");
|
|
67
|
-
transition(this.$refs.overlay, {
|
|
68
|
-
from: "opacity-0"
|
|
69
|
-
});
|
|
70
|
-
return __superGet("open").call(this);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
close() {
|
|
74
|
-
var __superGet = (key) => super[key];
|
|
75
|
-
return __async(this, null, function* () {
|
|
76
|
-
if (!this.isOpen || this.isClosing) {
|
|
77
|
-
return Promise.resolve();
|
|
78
|
-
}
|
|
79
|
-
this.isClosing = true;
|
|
80
|
-
this.$refs.modal.classList.add("pointer-events-none");
|
|
81
|
-
yield Promise.all([
|
|
82
|
-
transition(this.$refs.container, {
|
|
83
|
-
from: {
|
|
84
|
-
transform: "none"
|
|
85
|
-
},
|
|
86
|
-
to: {
|
|
87
|
-
transform: this.containerOffset
|
|
88
|
-
}
|
|
89
|
-
}, "keep"),
|
|
90
|
-
transition(this.$refs.overlay, {
|
|
91
|
-
to: "opacity-0"
|
|
92
|
-
}, "keep")
|
|
93
|
-
]);
|
|
94
|
-
this.isClosing = false;
|
|
95
|
-
return __superGet("close").call(this);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
let Panel = _Panel;
|
|
100
|
-
__publicField(Panel, "config", {
|
|
101
|
-
name: "Panel",
|
|
102
|
-
options: {
|
|
103
|
-
position: {
|
|
104
|
-
type: String,
|
|
105
|
-
default: "left"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
__publicField(Panel, "translateClasses", {
|
|
110
|
-
top: "-translate-y-full",
|
|
111
|
-
right: "translate-x-full",
|
|
112
|
-
bottom: "translate-y-full",
|
|
113
|
-
left: "-translate-x-full"
|
|
114
|
-
});
|
|
115
|
-
export {
|
|
116
|
-
Panel as default
|
|
117
|
-
};
|
|
1
|
+
import{transition as s,matrix as a}from"@studiometa/js-toolkit/utils";import l from"../Modal/Modal.js";class t extends l{static config={name:"Panel",options:{position:{type:String,default:"left"}}};static translateClasses={top:"-translate-y-full",right:"translate-x-full",bottom:"translate-y-full",left:"-translate-x-full"};get translateClass(){return t.translateClasses[this.$options.position]??t.translateClasses[t.config.options.position.default]}get containerOffset(){const{offsetTop:e,offsetLeft:o,offsetWidth:n,offsetHeight:i}=this.$refs.container,r={top:{translateY:(e+i)*-1},right:{translateX:window.innerWidth-o+n*2},bottom:{translateY:window.innerHeight-e+i*2},left:{translateX:(o+n)*-1}};return a(r[this.$options.position])}async open(){return this.isOpen?Promise.resolve():(this.$refs.modal.classList.remove("pointer-events-none"),s(this.$refs.container,{from:{transform:this.containerOffset},to:{transform:"none"}},"keep"),s(this.$refs.overlay,{from:"opacity-0"}),super.open())}async close(){return!this.isOpen||this.isClosing?Promise.resolve():(this.isClosing=!0,this.$refs.modal.classList.add("pointer-events-none"),await Promise.all([s(this.$refs.container,{from:{transform:"none"},to:{transform:this.containerOffset}},"keep"),s(this.$refs.overlay,{to:"opacity-0"},"keep")]),this.isClosing=!1,super.close())}}export{t as default};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* Panel component.
|
|
5
|
+
*
|
|
6
|
+
* @param 'top'|'right'|'bottom'|'left' $position
|
|
7
|
+
* Position of the panel.
|
|
8
|
+
* @param array $wrapper_attr
|
|
9
|
+
* Custom attributes for the wrapper element.
|
|
10
|
+
*/
|
|
11
|
+
#}
|
|
12
|
+
|
|
13
|
+
{% extends '@ui/molecules/Modal/Modal.twig' %}
|
|
14
|
+
|
|
15
|
+
{% set position = position ?? 'left' %}
|
|
16
|
+
|
|
17
|
+
{% set attr =
|
|
18
|
+
merge_html_attributes(attr ?? null, { data_component: 'Panel', data_option_position: position })
|
|
19
|
+
%}
|
|
20
|
+
|
|
21
|
+
{% set overlay_attr =
|
|
22
|
+
merge_html_attributes(
|
|
23
|
+
overlay_attr ?? null,
|
|
24
|
+
{ class: 'z-under absolute inset-0 bg-black bg-opacity-75' },
|
|
25
|
+
{ class: 'transition duration-500 opacity-0' }
|
|
26
|
+
)
|
|
27
|
+
%}
|
|
28
|
+
|
|
29
|
+
{% set wrapper_attr =
|
|
30
|
+
merge_html_attributes(
|
|
31
|
+
wrapper_attr ?? null,
|
|
32
|
+
{},
|
|
33
|
+
{
|
|
34
|
+
class: [
|
|
35
|
+
'z-above absolute top-0 w-full h-full flex pointer-events-none',
|
|
36
|
+
{
|
|
37
|
+
'top-0 left-0 items-start justify-center': position == 'top',
|
|
38
|
+
'top-0 right-0 items-center justify-end': position == 'right',
|
|
39
|
+
'bottom-0 left-0 items-end justify-center': position == 'bottom',
|
|
40
|
+
'top-0 left-0 items-center justify-start': position == 'left'
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
%}
|
|
46
|
+
|
|
47
|
+
{% set container_attr =
|
|
48
|
+
merge_html_attributes(
|
|
49
|
+
container_attr ?? null,
|
|
50
|
+
{
|
|
51
|
+
class: [
|
|
52
|
+
'max-w-2xl',
|
|
53
|
+
{
|
|
54
|
+
'w-full': position == 'top',
|
|
55
|
+
'h-full': position == 'right',
|
|
56
|
+
'w-full': position == 'bottom',
|
|
57
|
+
'h-full': position == 'left'
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
class: [
|
|
63
|
+
'transform transition duration-500',
|
|
64
|
+
{
|
|
65
|
+
'-translate-y-full': position == 'top',
|
|
66
|
+
'translate-x-full': position == 'right',
|
|
67
|
+
'translate-y-full': position == 'bottom',
|
|
68
|
+
'-translate-x-full': position == 'left'
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
%}
|