@piveau/piveau-hub-ui-modules 80.0.0-alpha.7 → 80.0.0-alpha.8
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/dist/data-provider-interface/HappyFlowComponents/DPIHome.vue.d.ts +13 -3
- package/dist/data-provider-interface/HappyFlowComponents/DPIHome.vue.mjs +390 -420
- package/dist/data-provider-interface/HappyFlowComponents/DPIHome.vue.mjs.map +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/Chip.vue.mjs +27 -27
- package/dist/data-provider-interface/HappyFlowComponents/ui/Chip.vue.mjs.map +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/CrossOutButton.vue.d.ts +12 -2
- package/dist/data-provider-interface/HappyFlowComponents/ui/CrossOutButton.vue.mjs +13 -13
- package/dist/data-provider-interface/HappyFlowComponents/ui/CrossOutButton.vue.mjs.map +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/CrossOutButton.vue2.mjs +10 -4
- package/dist/data-provider-interface/HappyFlowComponents/ui/CrossOutButton.vue2.mjs.map +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/CrossOutButton.vue3.mjs +2 -2
- package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.mjs +56 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue.mjs.map +1 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue2.mjs +5 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue2.mjs.map +1 -0
- package/dist/data-provider-interface/HappyFlowComponents/ui/StateTag.vue.mjs +7 -5
- package/dist/data-provider-interface/HappyFlowComponents/ui/StateTag.vue.mjs.map +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/SwitchV3.vue.mjs +16 -16
- package/dist/data-provider-interface/HappyFlowComponents/ui/SwitchV3.vue.mjs.map +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/SwitchV3.vue2.mjs +2 -2
- package/dist/data-provider-interface/HappyFlowComponents/ui/Toast.vue.mjs +11 -8
- package/dist/data-provider-interface/HappyFlowComponents/ui/Toast.vue.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/Accordion.vue.mjs +0 -68
- package/dist/data-provider-interface/HappyFlowComponents/ui/Accordion.vue.mjs.map +0 -1
- package/dist/data-provider-interface/HappyFlowComponents/ui/Accordion.vue2.mjs +0 -5
- package/dist/data-provider-interface/HappyFlowComponents/ui/Accordion.vue2.mjs.map +0 -1
- /package/dist/data-provider-interface/HappyFlowComponents/ui/{Accordion.vue.d.ts → Dropdown.vue.d.ts} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ref as d, openBlock as t, createElementBlock as r, createBlock as f, isRef as _, unref as s, createCommentVNode as a, createTextVNode as k, createElementVNode as u, Fragment as v, renderList as y, toDisplayString as x } from "vue";
|
|
2
|
+
import { onClickOutside as w } from "../../../external/@vueuse/core/index";
|
|
3
|
+
import g from "./TextButtonSmall.vue.mjs";
|
|
4
|
+
import "./Dropdown.vue2.mjs";
|
|
5
|
+
import C from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
6
|
+
const D = { class: "dropdownV3" }, B = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "dropdownWrapper"
|
|
9
|
+
}, S = { class: "dropdown" }, b = ["onClick"], V = {
|
|
10
|
+
__name: "Dropdown",
|
|
11
|
+
props: {
|
|
12
|
+
text: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: !0
|
|
15
|
+
},
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
data: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: !0
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(c) {
|
|
26
|
+
const i = d();
|
|
27
|
+
d("#0172AD");
|
|
28
|
+
let e = d(!1);
|
|
29
|
+
const p = c, m = (n) => n;
|
|
30
|
+
return w(i, (n) => {
|
|
31
|
+
e.value = !1;
|
|
32
|
+
}), (n, o) => (t(), r("div", D, [
|
|
33
|
+
p.type === "textButtonSmall" ? (t(), f(g, {
|
|
34
|
+
key: 0,
|
|
35
|
+
buttonText: "Dropdown",
|
|
36
|
+
onClick: o[0] || (o[0] = (l) => _(e) ? e.value = !s(e) : e = !s(e)),
|
|
37
|
+
ref_key: "accActive",
|
|
38
|
+
ref: i
|
|
39
|
+
}, null, 512)) : a("", !0),
|
|
40
|
+
o[1] || (o[1] = k()),
|
|
41
|
+
s(e) ? (t(), r("div", B, [
|
|
42
|
+
u("ul", S, [
|
|
43
|
+
(t(!0), r(v, null, y(c.data, (l, q) => (t(), r("li", {
|
|
44
|
+
onClick: (A) => m(l)
|
|
45
|
+
}, [
|
|
46
|
+
u("button", null, x(l["@value"]), 1)
|
|
47
|
+
], 8, b))), 256))
|
|
48
|
+
])
|
|
49
|
+
])) : a("", !0)
|
|
50
|
+
]));
|
|
51
|
+
}
|
|
52
|
+
}, $ = /* @__PURE__ */ C(V, [["__scopeId", "data-v-5182bd6a"]]);
|
|
53
|
+
export {
|
|
54
|
+
$ as default
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=Dropdown.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/Dropdown.vue"],"sourcesContent":["<template>\n <div class=\"dropdownV3\">\n <TextButtonSmall v-if=\"props.type === 'textButtonSmall'\" buttonText=\"Dropdown\" @click=\"toggleDropdown = !toggleDropdown\" ref=\"accActive\"></TextButtonSmall>\n <div class=\"dropdownWrapper\" v-if=\"toggleDropdown\">\n <ul class=\"dropdown\">\n <li v-for=\"item, i in data\" @click=\"handleClick(item)\"><button>{{ item['@value'] }}</button></li>\n </ul>\n </div>\n </div>\n \n</template>\n<script setup>\nimport { ref } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport TextButtonSmall from \"./TextButtonSmall.vue\";\n\nconst accActive = ref()\nlet fill = ref('#0172AD')\nlet toggleDropdown = ref(false)\n\nconst props = defineProps({\n text: {\n type: String,\n required: true\n },\n type: {\n type: String,\n required: true\n },\n data: {\n type: Object,\n required: true\n }\n});\nconst handleClick = (item) => {\n return item\n}\n\nonClickOutside(accActive, event => {\n toggleDropdown.value = false\n})\n</script>\n<style scoped>\nbutton {\n all: unset\n}\n\n.dropdownWrapper {\n position: absolute;\n top: 2.5rem;\n}\n\n.active {\n rotate: 180deg;\n}\n\n.dropdown {\n display: flex;\n width: 192px;\n padding: var(--Spacing-2, 8px) 0px;\n flex-direction: column;\n align-items: flex-start;\n z-index: 999;\n\n border-radius: var(--Border-Radius, 8px);\n background: var(--Colour-neutral-Neutral5, #FAFAFB);\n\n /* Elevation light/1 */\n box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.30), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n\n list-style: none;\n\n &:focus {\n border: 2px solid var(--Focused, #0196D8);\n }\n\n li {\n display: flex;\n padding: var(--Spacing-2, 8px) var(--Spacing-4, 24px);\n align-items: flex-start;\n gap: var(--Spacing-3, 16px);\n align-self: stretch;\n\n button {\n width: 100%;\n }\n\n\n &:hover {\n background: var(--Colour-neutral-Neutral20, #E6E7E9);\n }\n\n &:active {\n background: var(--neutral-10, #F1F1F3);\n }\n\n &:focus {\n border: 2px solid var(--Focused, #0196D8);\n }\n }\n}\n\n.dropdownV3 {\n\n position: relative;\n display: inline-flex;\n padding: var(--Spacing-1, 4px) var(--Spacing-2, 8px);\n align-items: center;\n gap: var(--Spacing-2, 8px);\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n\n &:focus {\n border-radius: 4px;\n border: 2px solid var(--Focused, #0196D8);\n }\n\n span {\n color: var(--blue-80, #0172AD);\n text-align: center;\n \n font-family:var(--font-family-secondary);\n font-size: var(--copy-large-regular-font-size);\n font-style: normal;\n font-weight: var(--copy-large-regular-font-weight);\n line-height: var(--copy-large-regular-line-height);\n\n /* 24px */\n &:hover {\n color: var(--blue-100, #003F6F);\n }\n\n &:active {\n color: var(--Colour-blue-Blue60, #009FE3);\n }\n\n\n }\n}\n</style>"],"names":["accActive","ref","toggleDropdown","props","__props","handleClick","item","onClickOutside","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,UAAMA,IAAYC,EAAI;AACX,IAAAA,EAAI,SAAS;AACxB,QAAIC,IAAiBD,EAAI,EAAK;AAE9B,UAAME,IAAQC,GAcRC,IAAc,CAACC,MACVA;AAGX,WAAAC,EAAeP,GAAW,CAAAQ,MAAS;AAC/B,MAAAN,EAAe,QAAQ;AAAA,IAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.vue2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import "../../config/styles/variables.css.mjs";
|
|
2
|
+
import "../../config/styles/typography.css.mjs";
|
|
1
3
|
import { openBlock as s, createElementBlock as r, normalizeClass as l, createCommentVNode as a, createTextVNode as o, createElementVNode as m, toDisplayString as n } from "vue";
|
|
2
4
|
import d from "../img/Ellipse2Published.svg.mjs";
|
|
3
|
-
import
|
|
5
|
+
import p from "../img/Ellipse2Warning.svg.mjs";
|
|
4
6
|
import _ from "../img/Ellipse2Error.svg.mjs";
|
|
5
7
|
import "./StateTag.vue2.mjs";
|
|
6
|
-
import
|
|
8
|
+
import c from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
7
9
|
const u = {
|
|
8
10
|
name: "StateTag",
|
|
9
11
|
props: {
|
|
@@ -38,7 +40,7 @@ const u = {
|
|
|
38
40
|
}, g = {
|
|
39
41
|
key: 1,
|
|
40
42
|
class: "dot",
|
|
41
|
-
src:
|
|
43
|
+
src: p,
|
|
42
44
|
alt: ""
|
|
43
45
|
}, y = {
|
|
44
46
|
key: 2,
|
|
@@ -59,8 +61,8 @@ function S(b, t, e, k, z, i) {
|
|
|
59
61
|
m("span", C, n(e.label), 1)
|
|
60
62
|
], 2);
|
|
61
63
|
}
|
|
62
|
-
const
|
|
64
|
+
const E = /* @__PURE__ */ c(u, [["render", S], ["__scopeId", "data-v-a14672a0"]]);
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
E as default
|
|
65
67
|
};
|
|
66
68
|
//# sourceMappingURL=StateTag.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTag.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/StateTag.vue"],"sourcesContent":["<template>\n <div class=\"state-tag\" :class=\"[stateClass, sizeClass]\">\n <img\n v-if=\"state === 'published'\"\n class=\"dot\"\n src=\"../img/Ellipse2Published.svg\"\n alt=\"\"\n />\n <img\n v-if=\"state === 'draft'\"\n class=\"dot\"\n src=\"../img/Ellipse2Warning.svg\"\n alt=\"\"\n />\n <img\n v-if=\"state === 'error'\"\n class=\"dot\"\n src=\"../img/Ellipse2Error.svg\"\n alt=\"\"\n />\n\n <span class=\"label\">{{ label }}</span>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"StateTag\",\n props: {\n label: {\n type: String,\n required: true,\n },\n state: {\n type: String,\n required: true, // \"published\", \"draft\", \"error\", \"hvd\", \"geopolitical\"\n },\n size: {\n type: String,\n default: \"table\", // \"table\", \"page\", or other custom sizes\n },\n },\n computed: {\n stateClass() {\n return `state-tag--${this.state}`;\n },\n sizeClass() {\n return `state-tag--${this.size}`;\n },\n },\n};\n</script>\n\n<style scoped>\n.state-tag {\n font-size: 14px;\n font-weight: 500;\n display: inline-flex;\n padding: var(--Spacing-1, 4px) var(--Spacing-2, 8px);\n align-items: center;\n gap: var(--Spacing-1, 4px);\n border-radius:
|
|
1
|
+
{"version":3,"file":"StateTag.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/StateTag.vue"],"sourcesContent":["<template>\n <div class=\"state-tag\" :class=\"[stateClass, sizeClass]\">\n <img\n v-if=\"state === 'published'\"\n class=\"dot\"\n src=\"../img/Ellipse2Published.svg\"\n alt=\"\"\n />\n <img\n v-if=\"state === 'draft'\"\n class=\"dot\"\n src=\"../img/Ellipse2Warning.svg\"\n alt=\"\"\n />\n <img\n v-if=\"state === 'error'\"\n class=\"dot\"\n src=\"../img/Ellipse2Error.svg\"\n alt=\"\"\n />\n\n <span class=\"label\">{{ label }}</span>\n </div>\n</template>\n\n<script>\nimport \"../../config/styles/variables.css\";\nimport \"../../config/styles/typography.css\";\n\nexport default {\n name: \"StateTag\",\n props: {\n label: {\n type: String,\n required: true,\n },\n state: {\n type: String,\n required: true, // \"published\", \"draft\", \"error\", \"hvd\", \"geopolitical\"\n },\n size: {\n type: String,\n default: \"table\", // \"table\", \"page\", or other custom sizes\n },\n },\n computed: {\n stateClass() {\n return `state-tag--${this.state}`;\n },\n sizeClass() {\n return `state-tag--${this.size}`;\n },\n },\n};\n</script>\n\n<style scoped>\n.state-tag {\n font-size: 14px;\n font-weight: 500;\n display: inline-flex;\n padding: var(--Spacing-1, 4px) var(--Spacing-2, 8px);\n align-items: center;\n gap: var(--Spacing-1, 4px);\n border-radius: var(--Button-Radius, 24px);;\n background: var(--background-success, #c2eaaf);\n color: var(--text-success, #3d6e26);\n}\n\n.state-tag--published {\n background: var(--background-success, #c2eaaf);\n color: var(--text-success, #3d6e26);\n\n font-family: var(--font-family-secondary);\n font-size: var(--copy-mini-semi-bold-font-size);\n font-style: normal;\n font-weight: var(--copy-mini-semi-bold-font-weight);\n line-height: var(--copy-mini-semi-bold-line-height);\n}\n\n.state-tag--draft {\n border-radius: var(--Button-Radius, 24px);;\n background: var(--background-warning, #ffd7a7);\n\n font-family: var(--font-family-secondary);\n font-size: var(--copy-mini-semi-bold-font-size);\n font-style: normal;\n font-weight: var(--copy-mini-semi-bold-font-weight);\n line-height: var(--copy-mini-semi-bold-line-height);\n color: var(--text-warning, #7c501c);\n}\n\n.state-tag--error {\n border-radius: var(--Button-Radius, 24px);;\n background: var(--background-error, #ffc7cb);\n font-family: var(--font-family-secondary);\n font-size: var(--copy-mini-semi-bold-font-size);\n font-style: normal;\n font-weight: var(--copy-mini-semi-bold-font-weight);\n line-height: var(--copy-mini-semi-bold-line-height);\n color: var(--text-error, #a9242c);\n}\n\n.dot {\n display: inline-block;\n width: 6px;\n height: 6px;\n}\n\n.state-tag--page {\n padding: var(--Spacing-1, 4px) var(--Spacing-3, 16px);\n align-items: center;\n gap: var(--Spacing-1, 4px);\n font-family: var(--font-family-secondary);;\n font-size: var(--copy-small-semi-bold-font-size);\n font-style: normal;\n font-weight: var(--copy-small-semi-bold-font-weight, 600);\n line-height: var(--copy-small-semi-bold-line-height);\n}\n\n.state-tag--hvd {\n font-family: var(--font-family-secondary);\n display: inline-flex;\n padding: var(--Spacing-1, 4px) var(--Spacing-2, 8px);\n align-items: center;\n background: var(--hvd-background);\n font-style: normal;\n color: var(--hvd-text);\n font-size: var(--caption-font-size, 0.75rem);\n line-height: var(--caption-line-height, 1.125rem);\n font-weight: var(--caption-font-weight, 700);\n border-radius: var(--Border-Radius, 8px);\n text-transform: uppercase;\n}\n\n.state-tag--geopolitical {\n display: inline-flex;\n padding: var(--Spacing-1, 4px) var(--Spacing-2, 8px);\n align-items: center;\n background: var(--blue-20, #D4EDFC);\n font-style: normal;\n color: var(--Colour-blue-Blue90, #015184);\n font-size: var(--caption-font-size, 0.75rem);\n line-height: var(--caption-line-height, 1.125rem);\n font-weight: var(--caption-font-weight, 700);\n border-radius: var(--Border-Radius, 8px);\n}\n</style>\n"],"names":["_sfc_main","_imports_0","_imports_1","_imports_2","_hoisted_4","_createElementBlock","_normalizeClass","$options","$props","_openBlock","_hoisted_1","_createCommentVNode","_cache","_createTextVNode","_hoisted_2","_hoisted_3","_createElementVNode","_to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EAAfT,EAAK,KAAA,GAAA,CAAA;AAAA;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../config/styles/variables.css.mjs";
|
|
2
|
-
import { openBlock as s, createElementBlock as t, withDirectives as f, createElementVNode as
|
|
2
|
+
import { openBlock as s, createElementBlock as t, withDirectives as f, createElementVNode as a, vModelCheckbox as u, createTextVNode as d, normalizeStyle as n, createCommentVNode as c, normalizeClass as C } from "vue";
|
|
3
3
|
import v from "../img/CheckBoldBlue60.svg.mjs";
|
|
4
4
|
import p from "../img/CrossoutNeutral10.svg.mjs";
|
|
5
5
|
import k from "../img/CrossoutNeutral30.svg.mjs";
|
|
@@ -45,27 +45,27 @@ const x = {
|
|
|
45
45
|
},
|
|
46
46
|
handleMouseUp() {
|
|
47
47
|
this.disabled || this.stateLock || (this.stateLock = !0, this.sliderPadding = "0 var(--Spacing-1, 4px)", this.circlePadding = "12px", setTimeout(() => {
|
|
48
|
-
this.stateLock = !1, this.isChecked || (this.circlePadding = "8px", this.hasIcon && (this.circlePadding = "12px", this.sliderPadding = "0 2px")), this.handleStyleOnHover();
|
|
48
|
+
this.stateLock = !1, this.isChecked || (this.circlePadding = "8px", this.hasIcon && (this.circlePadding = "12px", this.sliderPadding = "0 2px")), this.showHoverCircle && this.handleStyleOnHover();
|
|
49
49
|
}, 10));
|
|
50
50
|
},
|
|
51
51
|
onHover() {
|
|
52
52
|
this.stateLock || this.disabled || this.handleStyleOnHover();
|
|
53
53
|
},
|
|
54
54
|
onLeave() {
|
|
55
|
-
this.stateLock || this.disabled || (this.showHoverCircle = !1, this.isChecked ? (this.circleColor = "var(--neutral-0, #ffffff)", this.sliderBackgroundColor = "var(--blue-60, #009fe3)") : (this.circleColor = "var(--neutral-60, #687178)", this.sliderBackgroundColor = "var(--neutral-20, #e6e7e9)"));
|
|
55
|
+
this.stateLock || this.disabled || (this.showHoverCircle = !1, this.isChecked ? (this.circleColor = "var(--neutral-0, #ffffff)", this.sliderBackgroundColor = "var(--blue-60, #009fe3)") : (this.circleColor = "var(--neutral-60, #687178)", this.sliderBackgroundColor = "var(--neutral-20, #e6e7e9)"), this.handleMouseUp());
|
|
56
56
|
},
|
|
57
57
|
handleStyleOnHover() {
|
|
58
|
-
this.showHoverCircle = !0, this.isChecked ? (this.circleColor = "var(--blue-20, rgba(0, 159, 227, 0.2))", this.hoverCircleColor = "var(--state-layer-primary-opacity-8, rgba(0, 159, 227, 0.08))", this.leftHoverCircle = "16px", this.topHoverCircle = "-4px", this.sliderBackgroundColor = "var(--blue-60, #009fe3)", this.zHoverCircle = "-1") : (this.circleColor = "var(--neutral-60, #687178)", this.hoverCircleColor = "var(--state-layer-
|
|
58
|
+
this.showHoverCircle = !0, this.isChecked ? (this.circleColor = "var(--blue-20, rgba(0, 159, 227, 0.2))", this.hoverCircleColor = "var(--state-layer-primary-opacity-8, rgba(0, 159, 227, 0.08))", this.leftHoverCircle = "16px", this.topHoverCircle = "-4px", this.sliderBackgroundColor = "var(--blue-60, #009fe3)", this.zHoverCircle = "-1") : (this.circleColor = "var(--neutral-60, #687178)", this.hoverCircleColor = "var(--state-layer-on-surface-opacity-8, rgba(11, 26, 37, 0.08))", this.leftHoverCircle = "-8px", this.topHoverCircle = "-6px", this.sliderBackgroundColor = "var(--neutral-0, #ffffff)", this.circleColor = "var(--neutral-80)", this.zHoverCircle = "100", this.hasIcon && (this.leftHoverCircle = "-6px", this.topHoverCircle = "-6px"));
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
mounted() {
|
|
62
62
|
this.defaultChecked ? (this.isChecked = !0, this.circleColor = "var(--neutral-0, #ffffff)", this.sliderBackgroundColor = "var(--blue-60, #009fe3)") : (this.isChecked = !1, this.circleColor = "var(--neutral-60, #687178)", this.sliderBackgroundColor = "var(--neutral-20, #e6e7e9)", this.circlePadding = "8px", this.hasIcon && (this.circlePadding = "12px", this.sliderPadding = "0 2px")), this.disabled && (this.circleColor = "var(--neutral-5, #d9d9d9)", this.sliderBackgroundColor = "var(--neutral-30, #f0f0f0)", this.sliderBorder = "var(--neutral-30)", this.isChecked || (this.circleColor = "var(--neutral-60, #d9d9d9)", this.sliderBackgroundColor = "var(--neutral-10)", this.sliderBorder = "2px solid var(--neutral-30, #D5D7DA)", this.circleOpacity = "0.38"));
|
|
63
63
|
}
|
|
64
|
-
}, b = ["disabled"],
|
|
64
|
+
}, b = ["disabled"], H = {
|
|
65
65
|
key: 0,
|
|
66
66
|
src: v,
|
|
67
67
|
alt: "On Icon"
|
|
68
|
-
},
|
|
68
|
+
}, y = {
|
|
69
69
|
key: 1,
|
|
70
70
|
src: p,
|
|
71
71
|
alt: "Off Icon"
|
|
@@ -78,7 +78,7 @@ const x = {
|
|
|
78
78
|
src: g,
|
|
79
79
|
alt: "Off Icon"
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function w(h, e, i, P, r, o) {
|
|
82
82
|
return s(), t("label", {
|
|
83
83
|
class: "switch",
|
|
84
84
|
onMousedown: e[1] || (e[1] = (...l) => o.handleMouseDown && o.handleMouseDown(...l)),
|
|
@@ -86,7 +86,7 @@ function P(h, e, i, w, r, o) {
|
|
|
86
86
|
onMouseover: e[3] || (e[3] = (...l) => o.onHover && o.onHover(...l)),
|
|
87
87
|
onMouseleave: e[4] || (e[4] = (...l) => o.onLeave && o.onLeave(...l))
|
|
88
88
|
}, [
|
|
89
|
-
f(
|
|
89
|
+
f(a("input", {
|
|
90
90
|
type: "checkbox",
|
|
91
91
|
"onUpdate:modelValue": e[0] || (e[0] = (l) => r.isChecked = l),
|
|
92
92
|
disabled: i.disabled
|
|
@@ -94,7 +94,7 @@ function P(h, e, i, w, r, o) {
|
|
|
94
94
|
[u, r.isChecked]
|
|
95
95
|
]),
|
|
96
96
|
e[9] || (e[9] = d()),
|
|
97
|
-
|
|
97
|
+
a("span", {
|
|
98
98
|
class: "slider",
|
|
99
99
|
style: n({
|
|
100
100
|
backgroundColor: r.sliderBackgroundColor,
|
|
@@ -111,9 +111,9 @@ function P(h, e, i, w, r, o) {
|
|
|
111
111
|
top: r.topHoverCircle,
|
|
112
112
|
"z-index": r.zHoverCircle
|
|
113
113
|
})
|
|
114
|
-
}, null, 4)) :
|
|
114
|
+
}, null, 4)) : c("", !0),
|
|
115
115
|
e[8] || (e[8] = d()),
|
|
116
|
-
|
|
116
|
+
a("span", {
|
|
117
117
|
class: C(["icon-wrapper", {
|
|
118
118
|
"icon-present": i.hasIcon,
|
|
119
119
|
"icon-absent": !i.hasIcon,
|
|
@@ -127,18 +127,18 @@ function P(h, e, i, w, r, o) {
|
|
|
127
127
|
opacity: h.circleOpacity
|
|
128
128
|
})
|
|
129
129
|
}, [
|
|
130
|
-
r.isChecked && i.hasIcon && !i.disabled ? (s(), t("img",
|
|
130
|
+
r.isChecked && i.hasIcon && !i.disabled ? (s(), t("img", H)) : c("", !0),
|
|
131
131
|
e[5] || (e[5] = d()),
|
|
132
|
-
!r.isChecked && i.hasIcon && !i.disabled ? (s(), t("img",
|
|
132
|
+
!r.isChecked && i.hasIcon && !i.disabled ? (s(), t("img", y)) : c("", !0),
|
|
133
133
|
e[6] || (e[6] = d()),
|
|
134
|
-
!r.isChecked && i.hasIcon && i.disabled ? (s(), t("img", B)) :
|
|
134
|
+
!r.isChecked && i.hasIcon && i.disabled ? (s(), t("img", B)) : c("", !0),
|
|
135
135
|
e[7] || (e[7] = d()),
|
|
136
|
-
r.isChecked && i.hasIcon && i.disabled ? (s(), t("img", I)) :
|
|
136
|
+
r.isChecked && i.hasIcon && i.disabled ? (s(), t("img", I)) : c("", !0)
|
|
137
137
|
], 6)
|
|
138
138
|
], 4)
|
|
139
139
|
], 32);
|
|
140
140
|
}
|
|
141
|
-
const U = /* @__PURE__ */ m(x, [["render",
|
|
141
|
+
const U = /* @__PURE__ */ m(x, [["render", w], ["__scopeId", "data-v-35e96719"]]);
|
|
142
142
|
export {
|
|
143
143
|
U as default
|
|
144
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchV3.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/SwitchV3.vue"],"sourcesContent":["<template>\n <label\n class=\"switch\"\n @mousedown=\"handleMouseDown\"\n @mouseup=\"handleMouseUp\"\n @mouseover=\"onHover\"\n @mouseleave=\"onLeave\"\n >\n <input type=\"checkbox\" v-model=\"isChecked\" :disabled=\"disabled\" />\n <span\n class=\"slider\"\n :style=\"{\n backgroundColor: sliderBackgroundColor,\n padding: sliderPadding,\n border: sliderBorder,\n }\"\n >\n <!-- Hover Circle -->\n <span\n v-if=\"!disabled && showHoverCircle\"\n class=\"hover-circle\"\n :style=\"{\n backgroundColor: hoverCircleColor,\n left: leftHoverCircle,\n top: topHoverCircle,\n 'z-index': zHoverCircle,\n }\"\n ></span>\n\n <span\n class=\"icon-wrapper\"\n :class=\"{\n 'icon-present': hasIcon,\n 'icon-absent': !hasIcon,\n active: isChecked,\n }\"\n :style=\"{\n backgroundColor: circleColor,\n padding: circlePadding,\n height: circleHeight,\n width: circleWidth,\n opacity: circleOpacity\n }\"\n >\n <img\n v-if=\"isChecked && hasIcon && !disabled\"\n src=\"../img/CheckBoldBlue60.svg\"\n alt=\"On Icon\"\n />\n <img\n v-if=\"!isChecked && hasIcon && !disabled\"\n src=\"../img/CrossoutNeutral10.svg\"\n alt=\"Off Icon\"\n />\n <img\n v-if=\"!isChecked && hasIcon && disabled\"\n src=\"../img/CrossoutNeutral30.svg\"\n alt=\"Off Icon\"\n />\n <img\n v-if=\"isChecked && hasIcon && disabled\"\n src=\"../img/CheckBoldNeutral30.svg\"\n alt=\"Off Icon\"\n />\n </span>\n </span>\n </label>\n</template>\n\n<script>\nimport \"../../config/styles/variables.css\";\n\nexport default {\n name: \"SwitchV3\",\n data() {\n return {\n isChecked: this.defaultChecked,\n circleColor: \"var(--neutral-0, #ffffff)\",\n sliderBackgroundColor: \"var(--neutral-20, #e6e7e9)\",\n hoverCircleColor: \"\",\n showHoverCircle: false,\n leftHoverCircle: \"16px\",\n topHoverCircle: \"-4px\",\n zHoverCircle: \"-1\",\n stateLock: false,\n sliderPadding: \"0 var(--Spacing-1, 4px)\",\n circlePadding: \"12px\",\n circleHeight: \"2px\",\n circleWidth: \"2px\",\n };\n },\n props: {\n defaultChecked: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n hasIcon: {\n type: Boolean,\n default: false,\n },\n },\n methods: {\n handleMouseDown() {\n if (this.disabled || this.stateLock) return;\n\n this.circlePadding = \"14px\";\n this.hoverCircleColor =\n \"var( --state-layer-primary-opacity-12, rgba(0, 159, 227, 0.12))\";\n \n if (this.isChecked) {\n this.sliderPadding = \"0px 2px\";\n } else {\n this.sliderPadding = \"0px 10px 0px 0px\";\n\n if (!this.hasIcon) {\n this.leftHoverCircle = \"-6px\";\n }\n }\n },\n handleMouseUp() {\n if (this.disabled || this.stateLock) return;\n\n this.stateLock = true;\n this.sliderPadding = \"0 var(--Spacing-1, 4px)\";\n\n this.circlePadding = \"12px\";\n\n setTimeout(() => {\n this.stateLock = false;\n\n if (!this.isChecked) {\n this.circlePadding = \"8px\";\n\n //OFF with icon\n if (this.hasIcon) {\n this.circlePadding = \"12px\";\n this.sliderPadding = \"0 2px\";\n }\n }\n\n this.handleStyleOnHover();\n }, 10);\n },\n onHover() {\n if (this.stateLock || this.disabled) return;\n\n this.handleStyleOnHover();\n },\n onLeave() {\n if (this.stateLock || this.disabled) return;\n\n this.showHoverCircle = false;\n\n if (this.isChecked) {\n this.circleColor = \"var(--neutral-0, #ffffff)\";\n this.sliderBackgroundColor = \"var(--blue-60, #009fe3)\";\n } else {\n this.circleColor = \"var(--neutral-60, #687178)\";\n this.sliderBackgroundColor = \"var(--neutral-20, #e6e7e9)\";\n }\n },\n handleStyleOnHover() {\n this.showHoverCircle = true;\n\n // switch ON\n if (this.isChecked) {\n this.circleColor = \"var(--blue-20, rgba(0, 159, 227, 0.2))\";\n this.hoverCircleColor = \"var(--state-layer-primary-opacity-8, rgba(0, 159, 227, 0.08))\";\n this.leftHoverCircle = \"16px\";\n this.topHoverCircle = \"-4px\";\n this.sliderBackgroundColor = \"var(--blue-60, #009fe3)\";\n this.zHoverCircle = \"-1\";\n }\n // switch OFF\n else {\n this.circleColor = \"var(--neutral-60, #687178)\";\n this.hoverCircleColor =\n \"var(--state-layer-primary-opacity-8, rgba(0, 159, 227, 0.08))\";\n this.leftHoverCircle = \"-8px\";\n this.topHoverCircle = \"-6px\";\n this.sliderBackgroundColor = \"var(--neutral-0, #ffffff)\";\n this.circleColor = \"var(--neutral-80)\";\n this.zHoverCircle = \"100\";\n\n if (this.hasIcon) {\n this.leftHoverCircle = \"-6px\";\n this.topHoverCircle = \"-6px\";\n }\n }\n },\n },\n mounted() {\n // switch ON\n if (this.defaultChecked) {\n this.isChecked = true;\n this.circleColor = \"var(--neutral-0, #ffffff)\";\n this.sliderBackgroundColor = \"var(--blue-60, #009fe3)\";\n } else {\n /** switch OFF */\n this.isChecked = false;\n this.circleColor = \"var(--neutral-60, #687178)\";\n this.sliderBackgroundColor = \"var(--neutral-20, #e6e7e9)\";\n this.circlePadding = \"8px\";\n\n // OFF and has icon\n if (this.hasIcon) {\n this.circlePadding = \"12px\";\n this.sliderPadding = \"0 2px\";\n }\n }\n\n if (this.disabled) {\n this.circleColor = \"var(--neutral-5, #d9d9d9)\";\n this.sliderBackgroundColor = \"var(--neutral-30, #f0f0f0)\";\n this.sliderBorder = \"var(--neutral-30)\";\n if (!this.isChecked) {\n this.circleColor = \"var(--neutral-60, #d9d9d9)\";\n this.sliderBackgroundColor = \"var(--neutral-10)\";\n this.sliderBorder = \"2px solid var(--neutral-30, #D5D7DA)\";\n this.circleOpacity = \"0.38\"\n }\n }\n },\n};\n</script>\n\n<style scoped>\n.switch {\n position: relative;\n display: inline-block;\n width: 52px;\n height: 32px;\n z-index: 1;\n}\n\n.switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n\n.slider {\n position: relative;\n cursor: pointer;\n width: 52px;\n height: 32px;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 0 var(--Spacing-1, 4px);\n background: var(--blue-60, #009fe3);\n border-radius: var(--Button-Radius, 24px);\n transition: background-color 0.2s ease, justify-content 0.2s ease,\n padding 0.2s ease;\n}\n\n/* Hover Circle */\n.hover-circle {\n position: absolute;\n top: -4px;\n left: 16px;\n width: 40px;\n height: 40px;\n background-color: var(--blue-20, rgba(0, 159, 227, 0.2));\n border-radius: 50%;\n pointer-events: none;\n z-index: -1;\n}\n\n/* Circle (inside the slider) */\n.icon-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n background-color: var(--neutral-0, #ffffff);\n border-radius: var(--Button-Radius, 24px);\n z-index: 2;\n transition: transform 0.2s ease, padding 0.1s ease;\n}\n\n/** Circle, icon present, not active */\n.icon-wrapper.icon-present {\n height: 2px;\n width: 2px;\n padding: 12px;\n background-color: var(--neutral-60, #687178);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n/** Circle: icon present active */\n.icon-wrapper.icon-present.active {\n height: 2px;\n width: 2px;\n padding: 12px;\n background-color: var(--neutral-0, #ffffff);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n/* circle, icon not present */\n.icon-wrapper.icon-absent {\n padding: 12px;\n background-color: var(--neutral-60, #687178);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n/* circle, icon not present but active */\n.icon-wrapper.icon-absent.active {\n padding: 12px;\n background-color: var(--neutral-0, #ffffff);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n.icon-wrapper img {\n height: 14px;\n width: 14px;\n pointer-events: none;\n}\n\n/* checked followed by class slider */\ninput:checked + .slider {\n justify-content: flex-end;\n position: relative;\n border: none;\n transition: box-shadow 0.2s ease, background-color 0.2s ease,\n justify-content 0.2s ease, padding 0.2s ease;\n}\n\n/** needed to keep border when sliding */\ninput:checked + .slider::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n box-shadow: inset 0 0 0 2px var(--blue-60, #009fe3);\n pointer-events: none;\n transition: box-shadow 0.4s ease, padding 0.2s ease;\n}\n\n/* Prevent ::before styles when disabled */\ninput:disabled + .slider::before {\n content: none;\n box-shadow: none;\n}\n\n/* not \"checked\", must be followed by class slider */\ninput:not(:checked) + .slider {\n background: var(--neutral-20, #e6e7e9);\n border-radius: var(--Button-Radius, 24px);\n border: 2px solid var(--neutral-60, #687178);\n}\n\n/* focus styles */\ninput:focus + .slider {\n outline: none;\n position: relative;\n}\n\ninput:not(:checked):focus-visible + .slider::after {\n content: \"\";\n position: absolute;\n width: 60px;\n height: 40px;\n top: -6px; \n left: -6px;\n border-radius: inherit; \n border: 2px solid var(--Focused, rgba(0, 159, 227, 0.3)); \n background-color: transparent; \n pointer-events: none; \n z-index: 1; \n}\n\n/* Focus ring for the checked state */\ninput:checked:focus-visible + .slider::after {\n content: \"\";\n position: absolute;\n width: 60px; \n height: 40px; \n top: -4px; \n left: -4px;\n border-radius: inherit; \n border: 2px solid var(--Focused, rgba(0, 159, 227, 0.3)); \n background-color: transparent;\n pointer-events: none;\n z-index: 1;\n transition: all 0.2s ease;\n}\n</style>\n"],"names":["_sfc_main","_hoisted_1","_imports_0","_imports_1","_imports_2","_imports_3","_createElementBlock","$options","args","_createElementVNode","_cache","$event","$data","$props","_createTextVNode","_normalizeStyle","_ctx","_createCommentVNode","_normalizeClass","_openBlock","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5"],"mappings":";;;;;;;;AAwEA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AACL,WAAO;AAAA,MACL,WAAW,KAAK;AAAA,MAChB,aAAa;AAAA,MACb,uBAAuB;AAAA,MACvB,kBAAkB;AAAA,MAClB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,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AuDiBF,EAAS,aAAIC,EAAO,WAAIA,EAAQ,YADzCM,KAAAb,EAIE,OAJFgB,CAIE,KA1DVL,EAAA,IAAA,EAAA;AAAA,QAAAP,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAI,EAAA;AAAA,QA4DgBF,EAAS,aAAIC,EAAO,WAAIA,EAAQ,YADxCM,KAAAb,EAIE,OAJFiB,CAIE,KA/DVN,EAAA,IAAA,EAAA;AAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"SwitchV3.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/SwitchV3.vue"],"sourcesContent":["<template>\n <label\n class=\"switch\"\n @mousedown=\"handleMouseDown\"\n @mouseup=\"handleMouseUp\"\n @mouseover=\"onHover\"\n @mouseleave=\"onLeave\"\n >\n <input type=\"checkbox\" v-model=\"isChecked\" :disabled=\"disabled\" />\n <span\n class=\"slider\"\n :style=\"{\n backgroundColor: sliderBackgroundColor,\n padding: sliderPadding,\n border: sliderBorder,\n }\"\n >\n <!-- Hover Circle -->\n <span\n v-if=\"!disabled && showHoverCircle\"\n class=\"hover-circle\"\n :style=\"{\n backgroundColor: hoverCircleColor,\n left: leftHoverCircle,\n top: topHoverCircle,\n 'z-index': zHoverCircle,\n }\"\n ></span>\n\n <span\n class=\"icon-wrapper\"\n :class=\"{\n 'icon-present': hasIcon,\n 'icon-absent': !hasIcon,\n active: isChecked,\n }\"\n :style=\"{\n backgroundColor: circleColor,\n padding: circlePadding,\n height: circleHeight,\n width: circleWidth,\n opacity: circleOpacity\n }\"\n >\n <img\n v-if=\"isChecked && hasIcon && !disabled\"\n src=\"../img/CheckBoldBlue60.svg\"\n alt=\"On Icon\"\n />\n <img\n v-if=\"!isChecked && hasIcon && !disabled\"\n src=\"../img/CrossoutNeutral10.svg\"\n alt=\"Off Icon\"\n />\n <img\n v-if=\"!isChecked && hasIcon && disabled\"\n src=\"../img/CrossoutNeutral30.svg\"\n alt=\"Off Icon\"\n />\n <img\n v-if=\"isChecked && hasIcon && disabled\"\n src=\"../img/CheckBoldNeutral30.svg\"\n alt=\"Off Icon\"\n />\n </span>\n </span>\n </label>\n</template>\n\n<script>\nimport \"../../config/styles/variables.css\";\n\nexport default {\n name: \"SwitchV3\",\n data() {\n return {\n isChecked: this.defaultChecked,\n circleColor: \"var(--neutral-0, #ffffff)\",\n sliderBackgroundColor: \"var(--neutral-20, #e6e7e9)\",\n hoverCircleColor: \"\",\n showHoverCircle: false,\n leftHoverCircle: \"16px\",\n topHoverCircle: \"-4px\",\n zHoverCircle: \"-1\",\n stateLock: false,\n sliderPadding: \"0 var(--Spacing-1, 4px)\",\n circlePadding: \"12px\",\n circleHeight: \"2px\",\n circleWidth: \"2px\",\n };\n },\n props: {\n defaultChecked: {\n type: Boolean,\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n hasIcon: {\n type: Boolean,\n default: false,\n },\n },\n methods: {\n handleMouseDown() {\n if (this.disabled || this.stateLock) return;\n\n this.circlePadding = \"14px\";\n this.hoverCircleColor =\n \"var( --state-layer-primary-opacity-12, rgba(0, 159, 227, 0.12))\";\n \n if (this.isChecked) {\n this.sliderPadding = \"0px 2px\";\n } else {\n this.sliderPadding = \"0px 10px 0px 0px\";\n\n if (!this.hasIcon) {\n this.leftHoverCircle = \"-6px\";\n }\n }\n },\n handleMouseUp() {\n if (this.disabled || this.stateLock) return;\n\n this.stateLock = true;\n this.sliderPadding = \"0 var(--Spacing-1, 4px)\";\n\n this.circlePadding = \"12px\";\n\n setTimeout(() => {\n this.stateLock = false;\n\n if (!this.isChecked) {\n this.circlePadding = \"8px\";\n\n //OFF with icon\n if (this.hasIcon) {\n this.circlePadding = \"12px\";\n this.sliderPadding = \"0 2px\";\n }\n }\n if(this.showHoverCircle)\n this.handleStyleOnHover();\n }, 10);\n },\n onHover() {\n if (this.stateLock || this.disabled) return;\n\n this.handleStyleOnHover();\n },\n onLeave() {\n if (this.stateLock || this.disabled) return;\n\n this.showHoverCircle = false;\n\n if (this.isChecked) {\n this.circleColor = \"var(--neutral-0, #ffffff)\";\n this.sliderBackgroundColor = \"var(--blue-60, #009fe3)\";\n } else {\n this.circleColor = \"var(--neutral-60, #687178)\";\n this.sliderBackgroundColor = \"var(--neutral-20, #e6e7e9)\";\n }\n\n // BE AWARE THAT AN EVENT HAS TO BE FIRED WHEN MOUSEDOWN!!\n this.handleMouseUp()\n },\n handleStyleOnHover() {\n this.showHoverCircle = true;\n\n // switch ON\n if (this.isChecked) {\n this.circleColor = \"var(--blue-20, rgba(0, 159, 227, 0.2))\";\n this.hoverCircleColor = \"var(--state-layer-primary-opacity-8, rgba(0, 159, 227, 0.08))\";\n this.leftHoverCircle = \"16px\";\n this.topHoverCircle = \"-4px\";\n this.sliderBackgroundColor = \"var(--blue-60, #009fe3)\";\n this.zHoverCircle = \"-1\";\n }\n // switch OFF\n else {\n this.circleColor = \"var(--neutral-60, #687178)\";\n this.hoverCircleColor =\n \"var(--state-layer-on-surface-opacity-8, rgba(11, 26, 37, 0.08))\";\n this.leftHoverCircle = \"-8px\";\n this.topHoverCircle = \"-6px\";\n this.sliderBackgroundColor = \"var(--neutral-0, #ffffff)\";\n this.circleColor = \"var(--neutral-80)\";\n this.zHoverCircle = \"100\";\n\n if (this.hasIcon) {\n this.leftHoverCircle = \"-6px\";\n this.topHoverCircle = \"-6px\";\n }\n }\n },\n },\n mounted() {\n // switch ON\n if (this.defaultChecked) {\n this.isChecked = true;\n this.circleColor = \"var(--neutral-0, #ffffff)\";\n this.sliderBackgroundColor = \"var(--blue-60, #009fe3)\";\n } else {\n /** switch OFF */\n this.isChecked = false;\n this.circleColor = \"var(--neutral-60, #687178)\";\n this.sliderBackgroundColor = \"var(--neutral-20, #e6e7e9)\";\n this.circlePadding = \"8px\";\n\n // OFF and has icon\n if (this.hasIcon) {\n this.circlePadding = \"12px\";\n this.sliderPadding = \"0 2px\";\n }\n }\n\n if (this.disabled) {\n this.circleColor = \"var(--neutral-5, #d9d9d9)\";\n this.sliderBackgroundColor = \"var(--neutral-30, #f0f0f0)\";\n this.sliderBorder = \"var(--neutral-30)\";\n if (!this.isChecked) {\n this.circleColor = \"var(--neutral-60, #d9d9d9)\";\n this.sliderBackgroundColor = \"var(--neutral-10)\";\n this.sliderBorder = \"2px solid var(--neutral-30, #D5D7DA)\";\n this.circleOpacity = \"0.38\"\n }\n }\n },\n};\n</script>\n\n<style scoped>\n.switch {\n position: relative;\n display: inline-block;\n width: 52px;\n height: 32px;\n z-index: 1;\n}\n\n.switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n\n.slider {\n position: relative;\n cursor: pointer;\n width: 52px;\n height: 32px;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 0 var(--Spacing-1, 4px);\n background: var(--blue-60, #009fe3);\n border-radius: var(--Button-Radius, 24px);\n transition: background-color 0.2s ease, justify-content 0.2s ease,\n padding 0.2s ease;\n}\n\n/* Hover Circle */\n.hover-circle {\n position: absolute;\n top: -4px;\n left: 16px;\n width: 40px;\n height: 40px;\n background-color: var(--blue-20, rgba(0, 159, 227, 0.2));\n border-radius: 50%;\n pointer-events: none;\n z-index: -1;\n}\n\n/* Circle (inside the slider) */\n.icon-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n background-color: var(--neutral-0, #ffffff);\n border-radius: var(--Button-Radius, 24px);\n z-index: 2;\n transition: transform 0.2s ease, padding 0.1s ease;\n}\n\n/** Circle, icon present, not active */\n.icon-wrapper.icon-present {\n height: 2px;\n width: 2px;\n padding: 12px;\n background-color: var(--neutral-60, #687178);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n/** Circle: icon present active */\n.icon-wrapper.icon-present.active {\n height: 2px;\n width: 2px;\n padding: 12px;\n background-color: var(--neutral-0, #ffffff);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n/* circle, icon not present */\n.icon-wrapper.icon-absent {\n padding: 12px;\n background-color: var(--neutral-60, #687178);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n/* circle, icon not present but active */\n.icon-wrapper.icon-absent.active {\n padding: 12px;\n background-color: var(--neutral-0, #ffffff);\n transition: background-color 0.2s ease, padding 0.2s ease;\n}\n\n.icon-wrapper img {\n height: 16px;\n width: 16px;\n pointer-events: none;\n}\n\n/* checked followed by class slider */\ninput:checked + .slider {\n justify-content: flex-end;\n position: relative;\n border: none;\n transition: box-shadow 0.2s ease, background-color 0.2s ease,\n justify-content 0.2s ease, padding 0.2s ease;\n}\n\n/** needed to keep border when sliding */\ninput:checked + .slider::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n box-shadow: inset 0 0 0 2px var(--blue-60, #009fe3);\n pointer-events: none;\n transition: box-shadow 0.4s ease, padding 0.2s ease;\n}\n\n/* Prevent ::before styles when disabled */\ninput:disabled + .slider::before {\n content: none;\n box-shadow: none;\n}\n\n/* not \"checked\", must be followed by class slider */\ninput:not(:checked) + .slider {\n background: var(--neutral-20, #e6e7e9);\n border-radius: var(--Button-Radius, 24px);\n border: 2px solid var(--neutral-60, #687178);\n}\n\n/* focus styles */\ninput:focus + .slider {\n outline: none;\n position: relative;\n}\n\ninput:not(:checked):focus-visible + .slider::after {\n content: \"\";\n position: absolute;\n width: 60px;\n height: 40px;\n top: -6px; \n left: -6px;\n border-radius: inherit; \n border: 2px solid var(--Focused, rgba(0, 159, 227, 0.3)); \n background-color: transparent; \n pointer-events: none; \n z-index: 1; \n}\n\n/* Focus ring for the checked state */\ninput:checked:focus-visible + .slider::after {\n content: \"\";\n position: absolute;\n width: 60px; \n height: 40px; \n top: -4px; \n left: -4px;\n border-radius: inherit; \n border: 2px solid var(--Focused, rgba(0, 159, 227, 0.3)); \n background-color: transparent;\n pointer-events: none;\n z-index: 1;\n transition: all 0.2s ease;\n}\n</style>\n"],"names":["_sfc_main","_hoisted_1","_imports_0","_imports_1","_imports_2","_imports_3","_createElementBlock","$options","args","_createElementVNode","_cache","$event","$data","$props","_createTextVNode","_normalizeStyle","_ctx","_createCommentVNode","_normalizeClass","_openBlock","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5"],"mappings":";;;;;;;;AAwEA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AACL,WAAO;AAAA,MACL,WAAW,KAAK;AAAA,MAChB,aAAa;AAAA,MACb,uBAAuB;AAAA,MACvB,kBAAkB;AAAA,MAClB,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,aAAa;AAAA;EAEhB;AAAA,EACD,OAAO;AAAA,IACL,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACF;AAAA,EACD,SAAS;AAAA,IACP,kBAAkB;AAChB,MAAI,KAAK,YAAY,KAAK,cAE1B,KAAK,gBAAgB,QACrB,KAAK,mBACL,mEAEI,KAAK,YACP,KAAK,gBAAgB,aAErB,KAAK,gBAAgB,oBAEhB,KAAK,YACR,KAAK,kBAAkB;AAAA,IAG5B;AAAA,IACD,gBAAgB;AACd,MAAI,KAAK,YAAY,KAAK,cAE1B,KAAK,YAAY,IACjB,KAAK,gBAAgB,2BAErB,KAAK,gBAAgB,QAErB,WAAW,MAAM;AACf,aAAK,YAAY,IAEZ,KAAK,cACR,KAAK,gBAAgB,OAGjB,KAAK,YACP,KAAK,gBAAgB,QACrB,KAAK,gBAAgB,WAGtB,KAAK,mBACN,KAAK,mBAAkB;AAAA,MAC1B,GAAE,EAAE;AAAA,IACN;AAAA,IACD,UAAU;AACR,MAAI,KAAK,aAAa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mBAAqBA,EAAa;AAAA,kBAAoBA,EAAY;AAAA,iBAAmBA,EAAW;AAAA,mBAAqBI,EAAa;AAAA;;QAS1KJ,EAAS,aAAIC,EAAO,WAAA,CAAKA,EAAQ,YADzCM,KAAAb,EAIE,OAJFc,CAIE,KAhDVH,EAAA,IAAA,EAAA;AAAA,QAAAP,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAI,EAAA;AAAA,SAkDiBF,EAAS,aAAIC,EAAO,WAAA,CAAKA,EAAQ,YAD1CM,KAAAb,EAIE,OAJFe,CAIE,KArDVJ,EAAA,IAAA,EAAA;AAAA,QAAAP,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAI,EAAA;AAAA,SAuDiBF,EAAS,aAAIC,EAAO,WAAIA,EAAQ,YADzCM,KAAAb,EAIE,OAJFgB,CAIE,KA1DVL,EAAA,IAAA,EAAA;AAAA,QAAAP,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAAI,EAAA;AAAA,QA4DgBF,EAAS,aAAIC,EAAO,WAAIA,EAAQ,YADxCM,KAAAb,EAIE,OAJFiB,CAIE,KA/DVN,EAAA,IAAA,EAAA;AAAA;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ref as p, openBlock as a, createElementBlock as l, normalizeClass as u, createElementVNode as o, createTextVNode as s, toDisplayString as m, createVNode as n } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import c from "../img/x-circleFill.svg.mjs";
|
|
3
|
+
import f from "../img/InfoFill.svg.mjs";
|
|
4
4
|
import d from "../img/CheckCircleFill.svg.mjs";
|
|
5
5
|
import y from "../img/WarningFill.svg.mjs";
|
|
6
6
|
import g from "./TextButtonSmall.vue.mjs";
|
|
7
7
|
import v from "./CrossOutButton.vue.mjs";
|
|
8
8
|
import "./Toast.vue2.mjs";
|
|
9
|
-
const x = { class: "imgTextWrap" },
|
|
9
|
+
const x = { class: "imgTextWrap" }, T = ["src"], _ = { class: "d-flex" }, W = {
|
|
10
10
|
__name: "Toast",
|
|
11
11
|
props: {
|
|
12
12
|
text: {
|
|
@@ -20,7 +20,7 @@ const x = { class: "imgTextWrap" }, _ = ["src"], B = { class: "d-flex" }, W = {
|
|
|
20
20
|
},
|
|
21
21
|
setup(i) {
|
|
22
22
|
const r = p(), t = i;
|
|
23
|
-
return t.type === "info" && (r.value =
|
|
23
|
+
return t.type === "info" && (r.value = f), t.type === "success" && (r.value = d), t.type === "warning" && (r.value = y), t.type === "error" && (r.value = c), (B, e) => (a(), l("div", {
|
|
24
24
|
class: u(["toastBody", {
|
|
25
25
|
error: t.type === "error",
|
|
26
26
|
warning: t.type === "warning",
|
|
@@ -32,15 +32,18 @@ const x = { class: "imgTextWrap" }, _ = ["src"], B = { class: "d-flex" }, W = {
|
|
|
32
32
|
o("img", {
|
|
33
33
|
src: r.value,
|
|
34
34
|
alt: ""
|
|
35
|
-
}, null, 8,
|
|
35
|
+
}, null, 8, T),
|
|
36
36
|
e[0] || (e[0] = s()),
|
|
37
37
|
o("span", null, m(t.text.value), 1)
|
|
38
38
|
]),
|
|
39
39
|
e[2] || (e[2] = s()),
|
|
40
|
-
o("div",
|
|
41
|
-
n(g, {
|
|
40
|
+
o("div", _, [
|
|
41
|
+
n(g, {
|
|
42
|
+
buttonText: "Aktionen",
|
|
43
|
+
class: "m-auto"
|
|
44
|
+
}),
|
|
42
45
|
e[1] || (e[1] = s()),
|
|
43
|
-
n(v)
|
|
46
|
+
n(v, { type: "inToast" })
|
|
44
47
|
])
|
|
45
48
|
], 2));
|
|
46
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/Toast.vue"],"sourcesContent":["<template>\n <div class=\"toastBody\" :class=\"{\n 'error': props.type === 'error',\n 'warning': props.type === 'warning',\n 'info': props.type === 'info',\n 'success': props.type === 'success',\n }\">\n <div class=\"imgTextWrap\">\n <img :src=\"src\" alt=\"\">\n <span>{{ props.text.value }}</span>\n </div>\n <div class=\"d-flex\">\n <TextButtonSmall buttonText=\"Aktionen\" />\n <CrossOutButton />\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, computed } from 'vue';\nimport Error from '../img/x-circleFill.svg'\nimport Info from '../img/InfoFill.svg'\nimport Success from '../img/CheckCircleFill.svg'\nimport Warning from '../img/WarningFill.svg'\nimport TextButtonSmall from \"./TextButtonSmall.vue\";\nimport CrossOutButton from \"./CrossOutButton.vue\";\n\nconst src = ref()\nconst props = defineProps({\n text: {\n type: String,\n required: true\n },\n type: {\n type: String,\n required: true\n\n }\n});\nconst fillSrc = (() => {\n if (props.type === \"info\") {\n src.value = Info\n }\n if (props.type === \"success\") {\n src.value = Success\n }\n if (props.type === \"warning\") {\n src.value = Warning\n }\n if (props.type === \"error\") {\n src.value = Error\n }\n\n})();\n</script>\n<style>\n.imgTextWrap {\n display: flex;\n align-items: center;\n gap: var(--Spacing-2, 8px);\n}\n\n.actionWrap {\n display: flex;\n align-items: center;\n gap: var(--Spacing-3, 16px);\n}\n\n.toastBody {\n display: flex;\n width: 772px;\n height: 72px;\n padding: var(--Spacing-3, 16px);\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n\n color: var(--Colour-neutral-Neutral80, #3D4952);\n\n /* Copy/Copy-Large-SemiBold */\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 26px;\n\n /* 162.5% */\n div {\n display: flex;\n align-items: center;\n }\n}\n\n.error {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--fill-error, #E53B46);\n background: var(--Colour-red-Red20, #FFEFF0);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n\n.warning {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--fill-warning, #FFA741);\n background: var(--Colour-orange-Orange20, #FFEEDB);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n\n.info {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--Colour-blue-Blue50, #2BAFE9);\n background: var(--Colour-blue-Blue20, #D4EDFC);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n\n.success {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--fill-success, #70CC44);\n background: var(--Colour-green-Green20, #E8F8E1);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n</style>"],"names":["src","ref","props","__props","Info","Success","Warning","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAMC,EAAI,GACVC,IAAQC;AAWE,WACRD,EAAM,SAAS,WACfF,EAAI,QAAQI,IAEZF,EAAM,SAAS,cACfF,EAAI,QAAQK,IAEZH,EAAM,SAAS,cACfF,EAAI,QAAQM,IAEZJ,EAAM,SAAS,YACfF,EAAI,QAAQO
|
|
1
|
+
{"version":3,"file":"Toast.vue.mjs","sources":["../../../../lib/data-provider-interface/HappyFlowComponents/ui/Toast.vue"],"sourcesContent":["<template>\n <div class=\"toastBody\" :class=\"{\n 'error': props.type === 'error',\n 'warning': props.type === 'warning',\n 'info': props.type === 'info',\n 'success': props.type === 'success',\n }\">\n <div class=\"imgTextWrap\">\n <img :src=\"src\" alt=\"\">\n <span>{{ props.text.value }}</span>\n </div>\n <div class=\"d-flex\">\n <TextButtonSmall buttonText=\"Aktionen\" class=\"m-auto\" />\n <CrossOutButton :type=\"'inToast'\" />\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, computed } from 'vue';\nimport Error from '../img/x-circleFill.svg'\nimport Info from '../img/InfoFill.svg'\nimport Success from '../img/CheckCircleFill.svg'\nimport Warning from '../img/WarningFill.svg'\nimport TextButtonSmall from \"./TextButtonSmall.vue\";\nimport CrossOutButton from \"./CrossOutButton.vue\";\n\nconst src = ref()\nconst props = defineProps({\n text: {\n type: String,\n required: true\n },\n type: {\n type: String,\n required: true\n\n }\n});\nconst fillSrc = (() => {\n if (props.type === \"info\") {\n src.value = Info\n }\n if (props.type === \"success\") {\n src.value = Success\n }\n if (props.type === \"warning\") {\n src.value = Warning\n }\n if (props.type === \"error\") {\n src.value = Error\n }\n\n})();\n</script>\n<style>\n.imgTextWrap {\n display: flex;\n align-items: center;\n gap: var(--Spacing-2, 8px);\n}\n\n.actionWrap {\n display: flex;\n align-items: center;\n gap: var(--Spacing-3, 16px);\n}\n\n.toastBody {\n display: flex;\n width: 772px;\n height: 72px;\n padding: var(--Spacing-3, 16px);\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n\n color: var(--Colour-neutral-Neutral80, #3D4952);\n\n /* Copy/Copy-Large-SemiBold */\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 26px;\n\n /* 162.5% */\n div {\n display: flex;\n align-items: center;\n }\n}\n\n.error {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--fill-error, #E53B46);\n background: var(--Colour-red-Red20, #FFEFF0);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n\n.warning {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--fill-warning, #FFA741);\n background: var(--Colour-orange-Orange20, #FFEEDB);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n\n.info {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--Colour-blue-Blue50, #2BAFE9);\n background: var(--Colour-blue-Blue20, #D4EDFC);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n\n.success {\n border-radius: var(--Border-Radius, 8px);\n border: 1px solid var(--fill-success, #70CC44);\n background: var(--Colour-green-Green20, #E8F8E1);\n\n /* Elevation light/3 */\n box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.30);\n}\n</style>"],"names":["src","ref","props","__props","Info","Success","Warning","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAMC,EAAI,GACVC,IAAQC;AAWE,WACRD,EAAM,SAAS,WACfF,EAAI,QAAQI,IAEZF,EAAM,SAAS,cACfF,EAAI,QAAQK,IAEZH,EAAM,SAAS,cACfF,EAAI,QAAQM,IAEZJ,EAAM,SAAS,YACfF,EAAI,QAAQO;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|