@wikicasa-dev/components 2.6.7-alpha.8 → 2.6.9-alpha.0

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.
@@ -1,26 +1,27 @@
1
1
  import { Optional } from '@wikicasa-dev/types';
2
- type __VLS_Props = {
2
+ import { SwitchRootProps as _SwitchRootProps } from 'reka-ui';
3
+ export type BaseToggleProps = Omit<_SwitchRootProps, "modelValue">;
4
+ declare const _default: typeof __VLS_export;
5
+ export default _default;
6
+ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
3
7
  label?: string;
4
8
  dataCy?: string;
5
- };
6
- type __VLS_ModelProps = {
9
+ } & BaseToggleProps & {
7
10
  modelValue?: Optional<boolean>;
8
- };
9
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
- declare var __VLS_1: {}, __VLS_14: {};
11
- type __VLS_Slots = {} & {
12
- leftLabel?: (props: typeof __VLS_1) => any;
13
- } & {
14
- rightLabel?: (props: typeof __VLS_14) => any;
15
- };
16
- declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
12
  "update:modelValue": (value: Optional<boolean>) => any;
18
- }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ }, string, import('vue').PublicProps, Readonly<{
14
+ label?: string;
15
+ dataCy?: string;
16
+ } & BaseToggleProps & {
17
+ modelValue?: Optional<boolean>;
18
+ }> & Readonly<{
19
19
  "onUpdate:modelValue"?: ((value: Optional<boolean>) => any) | undefined;
20
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
- declare const _default: typeof __VLS_export;
23
- export default _default;
20
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
21
+ leftLabel?: (props: {}) => any;
22
+ } & {
23
+ rightLabel?: (props: {}) => any;
24
+ }>;
24
25
  type __VLS_WithSlots<T, S> = T & {
25
26
  new (): {
26
27
  $slots: S;
@@ -1,32 +1,42 @@
1
- import { defineComponent as d, useModel as s, openBlock as n, createElementBlock as k, renderSlot as a, createVNode as u, unref as o, withCtx as c, createElementVNode as m, createCommentVNode as f, mergeModels as p } from "vue";
2
- import { SwitchRoot as b, SwitchThumb as h } from "reka-ui";
3
- const g = { class: "uikit-flex uikit-items-center uikit-gap-[8px]" }, w = ["innerHTML"], V = /* @__PURE__ */ d({
1
+ import { defineComponent as d, useModel as n, createPropsRestProxy as k, openBlock as c, createElementBlock as m, renderSlot as l, createVNode as u, unref as o, mergeProps as f, withCtx as p, createElementVNode as b, createCommentVNode as h, mergeModels as g } from "vue";
2
+ import { SwitchRoot as y, SwitchThumb as x } from "reka-ui";
3
+ const V = { class: "uikit-flex uikit-items-center uikit-gap-[8px]" }, w = ["innerHTML"], v = /* @__PURE__ */ d({
4
4
  __name: "BaseToggle",
5
- props: /* @__PURE__ */ p({
5
+ props: /* @__PURE__ */ g({
6
6
  label: {},
7
- dataCy: {}
7
+ dataCy: {},
8
+ defaultValue: {},
9
+ disabled: { type: Boolean },
10
+ id: {},
11
+ value: {},
12
+ trueValue: {},
13
+ falseValue: {},
14
+ asChild: { type: Boolean },
15
+ as: {},
16
+ name: {},
17
+ required: { type: Boolean }
8
18
  }, {
9
19
  modelValue: { type: Boolean, default: !1 },
10
20
  modelModifiers: {}
11
21
  }),
12
22
  emits: ["update:modelValue"],
13
23
  setup(e) {
14
- const i = s(e, "modelValue");
15
- return (t, l) => (n(), k("div", g, [
16
- a(t.$slots, "leftLabel"),
17
- u(o(b), {
24
+ const i = n(e, "modelValue"), r = k(e, ["label", "dataCy"]);
25
+ return (t, a) => (c(), m("div", V, [
26
+ l(t.$slots, "leftLabel"),
27
+ u(o(y), f({
18
28
  modelValue: i.value,
19
- "onUpdate:modelValue": l[0] || (l[0] = (r) => i.value = r),
29
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => i.value = s),
20
30
  "data-cy": e.dataCy,
21
31
  class: "uikit-flex uikit-h-[20px] uikit-w-[40px] uikit-cursor-pointer uikit-rounded-full uikit-p-0 uikit-transition-[background] uikit-will-change-[background] focus-visible:uikit-outline-w-primary data-[state=checked]:uikit-bg-w-primary data-[state=unchecked]:uikit-bg-w-cultured"
22
- }, {
23
- default: c(() => [
24
- u(o(h), { class: "uikit-box-border uikit-flex uikit-size-[20px] uikit-translate-x-0 uikit-items-center uikit-justify-center uikit-rounded-full uikit-border uikit-border-solid uikit-border-w-lightgray uikit-bg-white uikit-shadow-xl uikit-transition-transform uikit-will-change-transform data-[state=checked]:uikit-translate-x-full" })
32
+ }, r), {
33
+ default: p(() => [
34
+ u(o(x), { class: "uikit-box-border uikit-flex uikit-size-[20px] uikit-translate-x-0 uikit-items-center uikit-justify-center uikit-rounded-full uikit-border uikit-border-solid uikit-border-w-lightgray uikit-bg-white uikit-shadow-xl uikit-transition-transform uikit-will-change-transform data-[state=checked]:uikit-translate-x-full" })
25
35
  ]),
26
36
  _: 1
27
- }, 8, ["modelValue", "data-cy"]),
28
- t.$slots.leftLabel ? f("", !0) : a(t.$slots, "rightLabel", { key: 0 }, () => [
29
- m("span", {
37
+ }, 16, ["modelValue", "data-cy"]),
38
+ t.$slots.leftLabel ? h("", !0) : l(t.$slots, "rightLabel", { key: 0 }, () => [
39
+ b("span", {
30
40
  class: "uikit-ml-[10px]",
31
41
  innerHTML: e.label
32
42
  }, null, 8, w)
@@ -35,5 +45,5 @@ const g = { class: "uikit-flex uikit-items-center uikit-gap-[8px]" }, w = ["inne
35
45
  }
36
46
  });
37
47
  export {
38
- V as default
48
+ v as default
39
49
  };
@@ -31,3 +31,4 @@ export type { SwiperSlideImagePrimitiveProps } from '../components/carousel/Prim
31
31
  export type { IntersectionObserverProviderProps } from '../components/IntersectionObserver/v2/IntersectionObserverProvider';
32
32
  export type { BaseCardRootProps, CardRootTypes, } from '../UIKit/Card/CardRootPrimitive';
33
33
  export type { CardTypes } from '../UIKit/Card/type';
34
+ export type { BaseToggleProps } from '../UIKit/BaseToggle';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.6.7-alpha.8",
3
+ "version": "2.6.9-alpha.0",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -103,6 +103,7 @@
103
103
  "story:build": "histoire build",
104
104
  "story:preview": "histoire preview",
105
105
  "release:alpha": "pnpm version prerelease --preid=alpha && pnpm publish --tag alpha --no-git-checks",
106
+ "tsc": "vue-tsc --p ./tsconfig-build.json",
106
107
  "lint": "run-s lint:*",
107
108
  "lint:oxlint": "oxlint . --fix",
108
109
  "lint:eslint": "eslint . --fix --cache",