@raxium/vue 0.2.5 → 0.2.7

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.
@@ -2,8 +2,8 @@ import type { ButtonVariants } from '@raxium/themes/default';
2
2
  import type { ThemeCrafts } from '../../providers';
3
3
  import type { HTMLAttributes } from 'vue';
4
4
  export interface ButtonProps extends ThemeCrafts<'tvButton'> {
5
- variant?: ButtonVariants['variant'] | string;
6
- color?: ButtonVariants['color'] | string;
5
+ variant?: ButtonVariants['variant'];
6
+ color?: ButtonVariants['color'];
7
7
  class?: HTMLAttributes['class'];
8
8
  disabled?: boolean;
9
9
  tooltip?: string;
@@ -148,9 +148,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
148
148
  "class",
149
149
  "as-child"
150
150
  ])) : createCommentVNode("", true),
151
- createVNode(unref(Checkbox).HiddenInput, {
152
- class: "hidden"
153
- })
151
+ createVNode(unref(Checkbox).HiddenInput)
154
152
  ]),
155
153
  _: 3
156
154
  }, 8, [
@@ -1,5 +1,6 @@
1
1
  import { createBlock, createPropsRestProxy, createVNode, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
2
2
  import { DatePicker, useDatePicker, useForwardExpose, useForwardProps } from "@ark-ui/vue";
3
+ import { useConfig } from "../../composables/useConfig.js";
3
4
  import { useTheme } from "../../composables/useTheme.js";
4
5
  import { ThemeProvider } from "../../providers/theme/index.js";
5
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -98,17 +99,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
98
99
  ],
99
100
  setup (__props, { expose: __expose, emit: __emit }) {
100
101
  const props = createPropsRestProxy(__props, [
101
- "theme"
102
+ "theme",
103
+ "lazyMount",
104
+ "unmountOnExit"
102
105
  ]);
103
106
  const emit = __emit;
104
- const datePicker = useDatePicker(useForwardProps(props), emit);
107
+ const forwarded = useForwardProps(props);
108
+ const datePicker = useDatePicker(forwarded, emit);
109
+ const datePickerOptions = useConfig("date-picker", ()=>({
110
+ unmountOnExit: __props.unmountOnExit,
111
+ lazyMount: __props.lazyMount
112
+ }));
105
113
  const theme = useTheme(()=>__props.theme);
106
114
  __expose({
107
115
  $api: datePicker
108
116
  });
109
117
  useForwardExpose();
110
118
  return (_ctx, _cache)=>(openBlock(), createBlock(unref(DatePicker).RootProvider, {
111
- value: unref(datePicker)
119
+ value: unref(datePicker),
120
+ "lazy-mount": unref(datePickerOptions)?.lazyMount,
121
+ "unmount-on-exit": unref(datePickerOptions)?.unmountOnExit
112
122
  }, {
113
123
  default: withCtx(()=>[
114
124
  createVNode(unref(ThemeProvider), {
@@ -124,7 +134,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
124
134
  ]),
125
135
  _: 3
126
136
  }, 8, [
127
- "value"
137
+ "value",
138
+ "lazy-mount",
139
+ "unmount-on-exit"
128
140
  ]));
129
141
  }
130
142
  });
@@ -46,7 +46,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
46
  }, {
47
47
  default: withCtx(()=>[
48
48
  createVNode(unref(Button), mergeProps({
49
- variant: "text"
49
+ variant: "text",
50
+ color: "default"
50
51
  }, __props.widget?.cancel, {
51
52
  class: unref(clsx)(__props.ui?.cancel),
52
53
  theme: unref(theme),
@@ -66,6 +66,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
66
  const emits = __emit;
67
67
  const inputId = useId();
68
68
  const innerValue = ref(__props.modelValue ?? __props.defaultValue ?? "");
69
+ watch(()=>__props.modelValue, (newVal)=>{
70
+ innerValue.value = newVal ?? "";
71
+ });
69
72
  watch(innerValue, (newVal)=>{
70
73
  emits("update:modelValue", newVal);
71
74
  }, {
@@ -118,9 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
118
118
  "class"
119
119
  ])) : createCommentVNode("", true)
120
120
  ]),
121
- createVNode(unref(RadioGroup).ItemHiddenInput, {
122
- class: "hidden"
123
- })
121
+ createVNode(unref(RadioGroup).ItemHiddenInput)
124
122
  ]),
125
123
  _: 3
126
124
  })
@@ -38,9 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  "data-theme-size": unref(theme).size
39
39
  }), {
40
40
  default: withCtx(()=>[
41
- createVNode(unref(Slider).HiddenInput, {
42
- class: "hidden"
43
- })
41
+ createVNode(unref(Slider).HiddenInput)
44
42
  ]),
45
43
  _: 1
46
44
  }, 16, [
@@ -117,9 +117,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
117
117
  name: __props.name
118
118
  }, {
119
119
  default: withCtx(()=>[
120
- createVNode(unref(Slider).HiddenInput, {
121
- class: "hidden"
122
- })
120
+ createVNode(unref(Slider).HiddenInput)
123
121
  ]),
124
122
  _: 1
125
123
  }, 8, [
@@ -95,9 +95,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
95
95
  }, 8, [
96
96
  "class"
97
97
  ]),
98
- createVNode(unref(Switch).HiddenInput, {
99
- class: "hidden"
100
- }),
98
+ createVNode(unref(Switch).HiddenInput),
101
99
  renderSlot(_ctx.$slots, "default")
102
100
  ]),
103
101
  _: 3
@@ -190,9 +190,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
190
190
  }, 8, [
191
191
  "value"
192
192
  ]),
193
- createVNode(unref(TagsInput).HiddenInput, {
194
- class: "hidden"
195
- })
193
+ createVNode(unref(TagsInput).HiddenInput)
196
194
  ]),
197
195
  _: 3
198
196
  }, 8, [
@@ -11,6 +11,10 @@ export interface RUIConfigContext {
11
11
  lazyMount?: boolean;
12
12
  unmountOnExit?: boolean;
13
13
  };
14
+ 'date-picker'?: {
15
+ lazyMount?: boolean;
16
+ unmountOnExit?: boolean;
17
+ };
14
18
  'hover-card'?: {
15
19
  closeDelay?: number;
16
20
  openDelay?: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@raxium/vue",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "description": "Vue core components for Raxium, based on Ark UI",
6
6
  "author": {
7
7
  "name": "Hwacc",
@@ -68,7 +68,7 @@
68
68
  "lucide-vue-next": "^1.0.0",
69
69
  "vue-component-type-helpers": "^3.2.1",
70
70
  "@raxium/shared": "0.1.1",
71
- "@raxium/themes": "0.1.7"
71
+ "@raxium/themes": "0.1.8"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@ark-ui/vue": "5.35.0",
@@ -88,8 +88,8 @@
88
88
  "tsc-alias": "^1.8.16",
89
89
  "vitest": "^4.1.1",
90
90
  "vue-tsc": "^3.2.4",
91
- "@raxium/themes": "0.1.7",
92
- "@raxium/shared": "0.1.1"
91
+ "@raxium/shared": "0.1.1",
92
+ "@raxium/themes": "0.1.8"
93
93
  },
94
94
  "publishConfig": {
95
95
  "access": "public"