@ironsource/shared-ui 2.0.0-test.6 → 2.0.0-test.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.
@@ -0,0 +1,7 @@
1
+ import o from "./SwitchV4.vue2.js";
2
+ /* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../../SwitchV4.vue_vue_type_style_index_0_scoped_afb0d2d7_lang.css"; //*');
4
+ const c = /* @__PURE__ */ _(o, [["__scopeId", "data-v-afb0d2d7"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -0,0 +1,69 @@
1
+ import "../../../SwitchV4.vue_vue_type_style_index_0_scoped_afb0d2d7_lang.css"; import { defineComponent as $, ref as d, computed as b, onMounted as k, openBlock as r, createElementBlock as c, normalizeClass as u, unref as l, createElementVNode as z, normalizeStyle as g, Fragment as T, renderList as C, renderSlot as I, createVNode as y, withCtx as S, createTextVNode as E, toDisplayString as N } from "vue";
2
+ import { useVModel as R } from "@vueuse/core";
3
+ import B from "../../typography/Text.vue.js";
4
+ import { SwitchTestIdModifiers as f } from "../../../testids/index.js";
5
+ const M = ["data-testid"], P = ["aria-label", "data-testid", "onClick"], D = /* @__PURE__ */ $({
6
+ __name: "SwitchV4",
7
+ props: {
8
+ options: null,
9
+ modelValue: null,
10
+ size: { default: "lg" },
11
+ testId: { default: "" }
12
+ },
13
+ emits: ["update:modelValue"],
14
+ setup(e, { emit: v }) {
15
+ const n = e, w = d(null), p = R(n, "modelValue", v), i = d([]), x = { optionsRefs: i }, t = d(), m = b(() => ({
16
+ left: i.value[t.value]?.offsetLeft,
17
+ width: i.value[t.value]?.offsetWidth
18
+ }));
19
+ k(() => {
20
+ t.value = n.options.findIndex(
21
+ (s) => s === n.modelValue
22
+ );
23
+ });
24
+ const V = (s, h) => {
25
+ t.value = h, p.value = s;
26
+ };
27
+ return (s, h) => (r(), c("div", {
28
+ class: u(["switch", { "switch--lg": e.size === "lg", "switch--sm": e.size === "sm" }]),
29
+ "data-testid": `${e.testId}-${l(f).WRAPPER}`
30
+ }, [
31
+ z("span", {
32
+ ref_key: "box",
33
+ ref: w,
34
+ class: u(["box", { "box--lg": e.size === "lg", "box--sm": e.size === "sm" }]),
35
+ style: g({
36
+ transform: `translateX(${l(m)?.left}px)`,
37
+ width: l(m)?.width + "px"
38
+ })
39
+ }, null, 6),
40
+ (r(!0), c(T, null, C(e.options, (o, a) => (r(), c("button", {
41
+ ref_for: !0,
42
+ ref: x.optionsRefs,
43
+ key: a,
44
+ "aria-label": o,
45
+ class: u([{ "option--selected": t.value === a }, "option"]),
46
+ "data-testid": `${e.testId}-${l(f).BUTTON}`,
47
+ onClick: (L) => V(o, a)
48
+ }, [
49
+ I(s.$slots, "default", {
50
+ option: o,
51
+ selected: t.value === a
52
+ }, () => [
53
+ y(B, {
54
+ size: "caption",
55
+ "data-testid": `${e.testId}-${l(f).TEXT}`
56
+ }, {
57
+ default: S(() => [
58
+ E(N(o), 1)
59
+ ]),
60
+ _: 2
61
+ }, 1032, ["data-testid"])
62
+ ], !0)
63
+ ], 10, P))), 128))
64
+ ], 10, M));
65
+ }
66
+ });
67
+ export {
68
+ D as default
69
+ };
@@ -1,3 +1,3 @@
1
- import '../../style/v4/colors.css';
1
+ import '../../style/v4/colors.scss';
2
2
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
3
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.0.0-test.6",
3
+ "version": "2.0.0-test.8",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -192,7 +192,7 @@
192
192
  "./percentageInput": "./components/input/v3/PercentageInput.vue.js",
193
193
  "./textArea": "./components/textArea/TextArea.vue.js",
194
194
  "./styleguide": "./styleguide.scss",
195
- "./commonCssVariables": "./commonCssVariables.scss",
195
+ "./styleguideV4": "./style/styleguideV4.scss",
196
196
  "./banner": "./components/banner/Banner.vue.js",
197
197
  "./typography": "./components/typography/v4/Typography.vue.js"
198
198
  },
@@ -1,4 +0,0 @@
1
- @import './v4/colors.scss';
2
- @import './v4/border-radius.scss';
3
- @import './v4/elevations.scss';
4
- @import './v4/spacings.scss';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes