@polymarbot/nuxt-layer-shadcn-ui 0.8.7 → 0.9.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.
Files changed (43) hide show
  1. package/app/components/ui/Checkbox/index.stories.ts +9 -0
  2. package/app/components/ui/Checkbox/index.vue +4 -1
  3. package/app/components/ui/Checkbox/types.ts +3 -1
  4. package/app/components/ui/DatePicker/index.stories.ts +9 -0
  5. package/app/components/ui/DatePicker/index.vue +3 -0
  6. package/app/components/ui/DatePicker/types.ts +2 -0
  7. package/app/components/ui/DateRangePicker/index.stories.ts +9 -0
  8. package/app/components/ui/DateRangePicker/index.vue +3 -0
  9. package/app/components/ui/DateRangePicker/types.ts +2 -0
  10. package/app/components/ui/Drawer/index.stories.ts +78 -1
  11. package/app/components/ui/Drawer/index.vue +31 -9
  12. package/app/components/ui/Drawer/types.ts +5 -0
  13. package/app/components/ui/FormItem/index.stories.ts +137 -10
  14. package/app/components/ui/FormItem/index.vue +10 -3
  15. package/app/components/ui/Input/index.vue +3 -1
  16. package/app/components/ui/InputCurrency/index.stories.ts +9 -0
  17. package/app/components/ui/InputCurrency/types.ts +3 -1
  18. package/app/components/ui/InputNumber/index.vue +10 -7
  19. package/app/components/ui/InputOtp/index.stories.ts +10 -0
  20. package/app/components/ui/InputOtp/index.vue +5 -1
  21. package/app/components/ui/InputOtp/types.ts +1 -0
  22. package/app/components/ui/InputPercent/index.stories.ts +11 -0
  23. package/app/components/ui/InputPercent/index.vue +6 -0
  24. package/app/components/ui/InputPercent/types.ts +3 -0
  25. package/app/components/ui/InputRange/index.stories.ts +11 -0
  26. package/app/components/ui/Modal/index.stories.ts +78 -0
  27. package/app/components/ui/Modal/index.vue +31 -9
  28. package/app/components/ui/Modal/types.ts +5 -0
  29. package/app/components/ui/RadioCardGroup/index.stories.ts +9 -0
  30. package/app/components/ui/RadioCardGroup/index.vue +4 -0
  31. package/app/components/ui/RadioCardGroup/types.ts +1 -0
  32. package/app/components/ui/RadioGroup/index.stories.ts +9 -0
  33. package/app/components/ui/RadioGroup/index.vue +4 -0
  34. package/app/components/ui/RadioGroup/types.ts +1 -0
  35. package/app/components/ui/SearchSelect/index.stories.ts +9 -0
  36. package/app/components/ui/SearchSelect/index.vue +2 -0
  37. package/app/components/ui/SearchSelect/types.ts +1 -0
  38. package/app/components/ui/Select/index.stories.ts +9 -0
  39. package/app/components/ui/Select/index.vue +6 -0
  40. package/app/components/ui/Select/types.ts +1 -0
  41. package/app/components/ui/Textarea/index.vue +3 -1
  42. package/app/composables/useFormItemInvalid.ts +16 -0
  43. package/package.json +2 -2
@@ -0,0 +1,16 @@
1
+ import type { InjectionKey, MaybeRefOrGetter, Ref } from 'vue'
2
+
3
+ const formItemInvalidKey: InjectionKey<Ref<boolean>> = Symbol('formItemInvalid')
4
+
5
+ /**
6
+ * Resolves the effective invalid state for an input-like component, combining
7
+ * its own `invalid` prop with any ancestor FormItem's error state. Re-provides
8
+ * the combined state so nested input-likes (e.g. Input inside DatePicker)
9
+ * inherit it without manual prop forwarding.
10
+ */
11
+ export function useFormItemInvalid (localInvalid?: MaybeRefOrGetter<boolean | undefined>) {
12
+ const ancestor = inject(formItemInvalidKey, ref(false))
13
+ const effective = computed(() => !!toValue(localInvalid) || ancestor.value)
14
+ provide(formItemInvalidKey, effective)
15
+ return effective
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.8.7",
3
+ "version": "0.9.0",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -42,5 +42,5 @@
42
42
  "vue-i18n": "^11",
43
43
  "vue-router": "^4 || ^5"
44
44
  },
45
- "gitHead": "1f8a4521c7e52de4063c33f47888be48cc99329b"
45
+ "gitHead": "aedca95dc524baad501d555838cae7ffefd4a853"
46
46
  }