@tb-dev/vue 0.3.22 → 0.3.23

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,7 +1,12 @@
1
1
  import { CheckboxProps } from './types';
2
- declare const _default: import('vue').DefineComponent<CheckboxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
- "update:modelValue": (value: boolean) => any;
4
- }, string, import('vue').PublicProps, Readonly<CheckboxProps> & Readonly<{
5
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
2
+ import { CheckboxRootProps } from 'reka-ui';
3
+ type __VLS_Props = CheckboxProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: CheckboxRootProps['modelValue'];
6
+ } & __VLS_Props;
7
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ "update:modelValue": (value: boolean | "indeterminate" | null | undefined) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
10
+ "onUpdate:modelValue"?: ((value: boolean | "indeterminate" | null | undefined) => any) | undefined;
6
11
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
12
  export default _default;
@@ -1,10 +1,7 @@
1
- import { Option } from '@tb-dev/utils';
1
+ import { CheckboxRootProps } from 'reka-ui';
2
2
  export interface CheckboxProps {
3
- class?: string;
4
- defaultValue?: boolean;
5
- disabled?: boolean;
3
+ defaultValue?: CheckboxRootProps['defaultValue'];
4
+ disabled?: CheckboxRootProps['disabled'];
6
5
  label?: string;
7
6
  labelClass?: string;
8
- modelValue?: Option<boolean>;
9
- required?: boolean;
10
7
  }
@@ -2,7 +2,6 @@ import { InputHTMLAttributes } from 'vue';
2
2
  export interface InputTextProps {
3
3
  autocomplete?: InputHTMLAttributes['autocomplete'];
4
4
  autofocus?: InputHTMLAttributes['autofocus'];
5
- class?: string;
6
5
  disabled?: InputHTMLAttributes['disabled'];
7
6
  label?: string;
8
7
  labelClass?: string;
@@ -3,7 +3,6 @@ import { SelectHTMLAttributes } from 'vue';
3
3
  export interface SelectProps {
4
4
  autocomplete?: SelectHTMLAttributes['autocomplete'];
5
5
  autofocus?: SelectHTMLAttributes['autofocus'];
6
- class?: string;
7
6
  contentClass?: string;
8
7
  disabled?: boolean;
9
8
  label?: string;
@@ -1,5 +1,4 @@
1
1
  export interface SwitchProps {
2
- class?: string;
3
2
  disabled?: boolean;
4
3
  label?: string;
5
4
  labelClass?: string;
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */
2
2
  :root {
3
3
  --background: oklch(1 0 0);
4
4
  --foreground: oklch(.141 .005 285.823);
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { cva } from 'class-variance-authority';
2
- import { inject as inject$1, toValue, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, normalizeClass, createElementBlock, Fragment, createVNode, toDisplayString, resolveDynamicComponent, createCommentVNode, normalizeStyle, createElementVNode, createTextVNode, withDirectives, isRef, vModelText, mergeModels, useModel, normalizeProps, guardReactiveProps, useTemplateRef, ref, createSlots, toRef, effectScope } from 'vue';
2
+ import { inject as inject$1, toValue, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, normalizeClass, createElementBlock, Fragment, createVNode, toDisplayString, resolveDynamicComponent, createCommentVNode, normalizeStyle, mergeModels, useModel, createElementVNode, createTextVNode, withDirectives, isRef, vModelText, normalizeProps, guardReactiveProps, useTemplateRef, ref, createSlots, toRef, effectScope } from 'vue';
3
3
  import { twMerge } from 'tailwind-merge';
4
4
  import { clsx } from 'clsx';
5
5
  import { unwrap, isNil, toPixel } from '@tb-dev/utils';
@@ -631,23 +631,18 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
631
631
  const _hoisted_1$h = { class: "w-full" };
632
632
  const _sfc_main$2C = /* @__PURE__ */ defineComponent({
633
633
  __name: "Checkbox",
634
- props: {
635
- class: {},
636
- defaultValue: { type: Boolean },
634
+ props: /* @__PURE__ */ mergeModels({
635
+ defaultValue: { type: [Boolean, String] },
637
636
  disabled: { type: Boolean },
638
637
  label: {},
639
- labelClass: {},
640
- modelValue: {},
641
- required: { type: Boolean }
642
- },
638
+ labelClass: {}
639
+ }, {
640
+ "modelValue": { type: [Boolean, String, null], ...{ required: false } },
641
+ "modelModifiers": {}
642
+ }),
643
643
  emits: ["update:modelValue"],
644
- setup(__props, { emit: __emit }) {
645
- const props = __props;
646
- const emit = __emit;
647
- const value = computed({
648
- get: () => props.modelValue ?? false,
649
- set: (it) => emit("update:modelValue", it)
650
- });
644
+ setup(__props) {
645
+ const value = useModel(__props, "modelValue");
651
646
  const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
652
647
  return (_ctx, _cache) => {
653
648
  return openBlock(), createElementBlock(Fragment, null, [
@@ -657,10 +652,8 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
657
652
  modelValue: value.value,
658
653
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
659
654
  "default-value": _ctx.defaultValue,
660
- disabled: _ctx.disabled,
661
- required: _ctx.required,
662
- class: props.class
663
- }), null, 16, ["modelValue", "default-value", "disabled", "required", "class"])
655
+ disabled: _ctx.disabled
656
+ }), null, 16, ["modelValue", "default-value", "disabled"])
664
657
  ]),
665
658
  _: 1
666
659
  }),
@@ -2251,6 +2244,7 @@ const _sfc_main$1Q = /* @__PURE__ */ defineComponent({
2251
2244
  createVNode(unref(_sfc_main$1R), mergeProps(_ctx.$attrs, {
2252
2245
  modelValue: value.value,
2253
2246
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
2247
+ modelModifiers: { trim: true },
2254
2248
  type: _ctx.type,
2255
2249
  autocomplete: _ctx.autocomplete,
2256
2250
  autofocus: _ctx.autofocus,
@@ -2519,7 +2513,6 @@ const _sfc_main$1J = /* @__PURE__ */ defineComponent({
2519
2513
  props: /* @__PURE__ */ mergeModels({
2520
2514
  autocomplete: {},
2521
2515
  autofocus: {},
2522
- class: {},
2523
2516
  disabled: {},
2524
2517
  label: {},
2525
2518
  labelClass: {},
@@ -2537,14 +2530,12 @@ const _sfc_main$1J = /* @__PURE__ */ defineComponent({
2537
2530
  }),
2538
2531
  emits: ["update:modelValue"],
2539
2532
  setup(__props) {
2540
- const props = __props;
2541
2533
  const value = useModel(__props, "modelValue");
2542
2534
  return (_ctx, _cache) => {
2543
- return openBlock(), createBlock(unref(_sfc_main$1Q), mergeProps(_ctx.$attrs, {
2535
+ return openBlock(), createBlock(unref(_sfc_main$1Q), {
2544
2536
  modelValue: value.value,
2545
2537
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
2546
2538
  type: "text",
2547
- class: props.class,
2548
2539
  autocomplete: _ctx.autocomplete,
2549
2540
  autofocus: _ctx.autofocus,
2550
2541
  disabled: _ctx.disabled,
@@ -2558,7 +2549,7 @@ const _sfc_main$1J = /* @__PURE__ */ defineComponent({
2558
2549
  required: _ctx.required,
2559
2550
  size: _ctx.size,
2560
2551
  spellcheck: _ctx.spellcheck
2561
- }), null, 16, ["modelValue", "class", "autocomplete", "autofocus", "disabled", "label", "label-class", "max", "min", "on-blur", "placeholder", "readonly", "required", "size", "spellcheck"]);
2552
+ }, null, 8, ["modelValue", "autocomplete", "autofocus", "disabled", "label", "label-class", "max", "min", "on-blur", "placeholder", "readonly", "required", "size", "spellcheck"]);
2562
2553
  };
2563
2554
  }
2564
2555
  });
@@ -3917,7 +3908,6 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
3917
3908
  props: {
3918
3909
  autocomplete: {},
3919
3910
  autofocus: {},
3920
- class: {},
3921
3911
  contentClass: {},
3922
3912
  disabled: { type: Boolean },
3923
3913
  label: {},
@@ -3948,8 +3938,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
3948
3938
  autocomplete: _ctx.autocomplete,
3949
3939
  autofocus: _ctx.autofocus,
3950
3940
  disabled: _ctx.disabled,
3951
- required: _ctx.required,
3952
- class: props.class
3941
+ required: _ctx.required
3953
3942
  }), {
3954
3943
  default: withCtx(() => [
3955
3944
  createVNode(unref(_sfc_main$14), {
@@ -3970,7 +3959,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
3970
3959
  }, 8, ["class"])
3971
3960
  ]),
3972
3961
  _: 3
3973
- }, 16, ["modelValue", "autocomplete", "autofocus", "disabled", "required", "class"]),
3962
+ }, 16, ["modelValue", "autocomplete", "autofocus", "disabled", "required"]),
3974
3963
  renderSlot(_ctx.$slots, "action")
3975
3964
  ])
3976
3965
  ]),
@@ -5328,7 +5317,6 @@ const _hoisted_1$3 = {
5328
5317
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
5329
5318
  __name: "Switch",
5330
5319
  props: /* @__PURE__ */ mergeModels({
5331
- class: {},
5332
5320
  disabled: { type: Boolean },
5333
5321
  label: {},
5334
5322
  labelClass: {},
@@ -5339,7 +5327,6 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
5339
5327
  }),
5340
5328
  emits: ["update:modelValue"],
5341
5329
  setup(__props) {
5342
- const props = __props;
5343
5330
  const toggled = useModel(__props, "modelValue");
5344
5331
  const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
5345
5332
  return (_ctx, _cache) => {
@@ -5349,8 +5336,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
5349
5336
  createVNode(unref(_sfc_main$p), mergeProps(_ctx.$attrs, {
5350
5337
  modelValue: toggled.value,
5351
5338
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => toggled.value = $event),
5352
- disabled: _ctx.disabled,
5353
- class: props.class
5339
+ disabled: _ctx.disabled
5354
5340
  }), createSlots({ _: 2 }, [
5355
5341
  _ctx.$slots.thumb ? {
5356
5342
  name: "thumb",
@@ -5359,7 +5345,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
5359
5345
  ]),
5360
5346
  key: "0"
5361
5347
  } : void 0
5362
- ]), 1040, ["modelValue", "disabled", "class"])
5348
+ ]), 1040, ["modelValue", "disabled"])
5363
5349
  ]),
5364
5350
  _: 3
5365
5351
  }),
@@ -6006,6 +5992,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6006
5992
  createVNode(unref(_sfc_main$3), mergeProps(_ctx.$attrs, {
6007
5993
  modelValue: value.value,
6008
5994
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
5995
+ modelModifiers: { trim: true },
6009
5996
  autocapitalize: _ctx.autocapitalize,
6010
5997
  autocomplete: _ctx.autocomplete,
6011
5998
  autocorrect: _ctx.autocorrect,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/vue",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "description": "Vue utilities",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "vue-sonner": "^1.3.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@tailwindcss/vite": "^4.1.3",
42
+ "@tailwindcss/vite": "^4.1.4",
43
43
  "@tb-dev/eslint-config": "^7.0.0",
44
44
  "@types/node": "^22.14.1",
45
45
  "@vitejs/plugin-vue": "^5.2.3",
@@ -47,7 +47,7 @@
47
47
  "prettier": "^3.5.3",
48
48
  "prettier-plugin-css-order": "^2.1.2",
49
49
  "prettier-plugin-tailwindcss": "^0.6.11",
50
- "tailwindcss": "^4.1.3",
50
+ "tailwindcss": "^4.1.4",
51
51
  "tslib": "^2.8.1",
52
52
  "typescript": "~5.8.3",
53
53
  "vite": "^6.2.6",