@shwfed/nuxt 0.7.8 → 0.7.9

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 (99) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/app.d.vue.ts +0 -2
  3. package/dist/runtime/components/app.vue +1 -7
  4. package/dist/runtime/components/app.vue.d.ts +0 -2
  5. package/dist/runtime/components/fields.d.vue.ts +155 -0
  6. package/dist/runtime/components/fields.vue +312 -0
  7. package/dist/runtime/components/fields.vue.d.ts +155 -0
  8. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +1 -1
  9. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +1 -1
  10. package/dist/runtime/components/ui/calendar/Calendar.d.vue.ts +5 -12
  11. package/dist/runtime/components/ui/calendar/Calendar.vue +77 -92
  12. package/dist/runtime/components/ui/calendar/Calendar.vue.d.ts +5 -12
  13. package/dist/runtime/components/ui/calendar/CalendarCellTrigger.vue +1 -1
  14. package/dist/runtime/components/ui/calendar/index.d.ts +1 -1
  15. package/dist/runtime/components/ui/command/CommandGroup.vue +4 -0
  16. package/dist/runtime/components/ui/dialog/DialogOverlay.vue +1 -1
  17. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  18. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  19. package/dist/runtime/components/ui/field/FieldDescription.vue +1 -1
  20. package/dist/runtime/components/ui/field/FieldError.vue +1 -1
  21. package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
  22. package/dist/runtime/components/ui/field/FieldSeparator.vue +1 -1
  23. package/dist/runtime/components/ui/field/index.js +7 -5
  24. package/dist/runtime/components/ui/input/Input.vue +1 -1
  25. package/dist/runtime/components/ui/input-group/InputGroup.vue +3 -0
  26. package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +4 -1
  27. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +10 -4
  28. package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +4 -1
  29. package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +3 -1
  30. package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
  31. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +1 -1
  32. package/dist/runtime/components/ui/input-group/InputGroupText.vue +1 -1
  33. package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
  34. package/dist/runtime/components/ui/input-group/index.js +1 -1
  35. package/dist/runtime/components/ui/label/Label.vue +1 -1
  36. package/dist/runtime/components/ui/native-select/NativeSelect.vue +3 -3
  37. package/dist/runtime/components/ui/navigation-menu/NavigationMenuLink.vue +1 -1
  38. package/dist/runtime/components/ui/navigation-menu/NavigationMenuViewport.vue +1 -1
  39. package/dist/runtime/components/ui/range-calendar/RangeCalendarCell.vue +1 -1
  40. package/dist/runtime/components/ui/range-calendar/RangeCalendarCellTrigger.vue +1 -1
  41. package/dist/runtime/components/ui/sheet/SheetOverlay.vue +1 -1
  42. package/dist/runtime/components/ui/switch/Switch.d.vue.ts +24 -0
  43. package/dist/runtime/components/ui/switch/Switch.vue +46 -0
  44. package/dist/runtime/components/ui/switch/Switch.vue.d.ts +24 -0
  45. package/dist/runtime/components/ui/switch/index.d.ts +1 -0
  46. package/dist/runtime/components/ui/switch/index.js +1 -0
  47. package/dist/runtime/components/ui/textarea/Textarea.vue +1 -1
  48. package/dist/runtime/plugins/cel/env.d.ts +2 -2
  49. package/dist/runtime/plugins/cel/env.js +5 -4
  50. package/dist/runtime/plugins/cel/index.d.ts +3 -3
  51. package/dist/runtime/plugins/cel/index.js +7 -3
  52. package/dist/runtime/plugins/markdown/index.d.ts +1 -1
  53. package/dist/runtime/utils/coders.d.ts +7 -0
  54. package/dist/runtime/utils/coders.js +39 -0
  55. package/dist/runtime/vendor/cel/index.d.ts +17 -0
  56. package/dist/runtime/vendor/cel/index.js +10 -0
  57. package/dist/runtime/vendor/cel-js/LICENSE +21 -0
  58. package/dist/runtime/vendor/cel-js/UPSTREAM.md +17 -0
  59. package/dist/runtime/vendor/cel-js/lib/errors.d.ts +21 -0
  60. package/dist/runtime/vendor/cel-js/lib/errors.js +97 -0
  61. package/dist/runtime/vendor/cel-js/lib/evaluator.d.ts +4 -0
  62. package/dist/runtime/vendor/cel-js/lib/evaluator.js +192 -0
  63. package/dist/runtime/vendor/cel-js/lib/functions.d.ts +53 -0
  64. package/dist/runtime/vendor/cel-js/lib/functions.js +513 -0
  65. package/dist/runtime/vendor/cel-js/lib/globals.d.ts +27 -0
  66. package/dist/runtime/vendor/cel-js/lib/globals.js +33 -0
  67. package/dist/runtime/vendor/cel-js/lib/index.d.ts +469 -0
  68. package/dist/runtime/vendor/cel-js/lib/index.js +18 -0
  69. package/dist/runtime/vendor/cel-js/lib/macros.d.ts +1 -0
  70. package/dist/runtime/vendor/cel-js/lib/macros.js +230 -0
  71. package/dist/runtime/vendor/cel-js/lib/operators.d.ts +117 -0
  72. package/dist/runtime/vendor/cel-js/lib/operators.js +739 -0
  73. package/dist/runtime/vendor/cel-js/lib/optional.d.ts +14 -0
  74. package/dist/runtime/vendor/cel-js/lib/optional.js +161 -0
  75. package/dist/runtime/vendor/cel-js/lib/options.d.ts +23 -0
  76. package/dist/runtime/vendor/cel-js/lib/options.js +47 -0
  77. package/dist/runtime/vendor/cel-js/lib/overloads.d.ts +1 -0
  78. package/dist/runtime/vendor/cel-js/lib/overloads.js +214 -0
  79. package/dist/runtime/vendor/cel-js/lib/parser.d.ts +56 -0
  80. package/dist/runtime/vendor/cel-js/lib/parser.js +827 -0
  81. package/dist/runtime/vendor/cel-js/lib/registry.d.ts +279 -0
  82. package/dist/runtime/vendor/cel-js/lib/registry.js +1596 -0
  83. package/dist/runtime/vendor/cel-js/lib/serialize.d.ts +1 -0
  84. package/dist/runtime/vendor/cel-js/lib/serialize.js +259 -0
  85. package/dist/runtime/vendor/cel-js/lib/type-checker.d.ts +26 -0
  86. package/dist/runtime/vendor/cel-js/lib/type-checker.js +81 -0
  87. package/package.json +7 -4
  88. package/dist/runtime/components/locale.d.vue.ts +0 -14
  89. package/dist/runtime/components/locale.vue +0 -89
  90. package/dist/runtime/components/locale.vue.d.ts +0 -14
  91. package/dist/runtime/components/query.d.vue.ts +0 -30
  92. package/dist/runtime/components/query.vue +0 -266
  93. package/dist/runtime/components/query.vue.d.ts +0 -30
  94. package/dist/runtime/utilities/query-config/global.d.ts +0 -4
  95. package/dist/runtime/utilities/query-config/global.js +0 -18
  96. package/dist/runtime/utilities/query-config/index.d.ts +0 -3
  97. package/dist/runtime/utilities/query-config/index.js +0 -14
  98. package/dist/runtime/utilities/query-config/schema.d.ts +0 -96
  99. package/dist/runtime/utilities/query-config/schema.js +0 -51
@@ -0,0 +1,155 @@
1
+ import z from 'zod';
2
+ import { Effect } from 'effect';
3
+ export declare const StringFieldC: z.ZodObject<{
4
+ type: z.ZodLiteral<"string">;
5
+ path: z.ZodString;
6
+ title: z.ZodArray<z.ZodObject<{
7
+ locale: z.ZodString;
8
+ message: z.ZodString;
9
+ }, z.core.$strip>>;
10
+ icon: z.ZodOptional<z.ZodString>;
11
+ style: z.ZodOptional<z.ZodString>;
12
+ discardEmptyString: z.ZodOptional<z.ZodBoolean>;
13
+ maxLength: z.ZodOptional<z.ZodString>;
14
+ hidden: z.ZodOptional<z.ZodString>;
15
+ disabled: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ export declare const NumberFieldC: z.ZodObject<{
18
+ type: z.ZodLiteral<"number">;
19
+ path: z.ZodString;
20
+ title: z.ZodArray<z.ZodObject<{
21
+ locale: z.ZodString;
22
+ message: z.ZodString;
23
+ }, z.core.$strip>>;
24
+ icon: z.ZodOptional<z.ZodString>;
25
+ style: z.ZodOptional<z.ZodString>;
26
+ min: z.ZodOptional<z.ZodString>;
27
+ max: z.ZodOptional<z.ZodString>;
28
+ step: z.ZodOptional<z.ZodString>;
29
+ hidden: z.ZodOptional<z.ZodString>;
30
+ disabled: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>;
32
+ export declare const SelectFieldC: z.ZodObject<{
33
+ type: z.ZodLiteral<"select">;
34
+ path: z.ZodString;
35
+ title: z.ZodArray<z.ZodObject<{
36
+ locale: z.ZodString;
37
+ message: z.ZodString;
38
+ }, z.core.$strip>>;
39
+ icon: z.ZodOptional<z.ZodString>;
40
+ options: z.ZodString;
41
+ label: z.ZodString;
42
+ value: z.ZodString;
43
+ key: z.ZodString;
44
+ style: z.ZodOptional<z.ZodString>;
45
+ hidden: z.ZodOptional<z.ZodString>;
46
+ disabled: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ export declare const CalendarFieldC: z.ZodObject<{
49
+ type: z.ZodLiteral<"calendar">;
50
+ path: z.ZodString;
51
+ title: z.ZodArray<z.ZodObject<{
52
+ locale: z.ZodString;
53
+ message: z.ZodString;
54
+ }, z.core.$strip>>;
55
+ icon: z.ZodOptional<z.ZodString>;
56
+ style: z.ZodOptional<z.ZodString>;
57
+ mode: z.ZodEnum<{
58
+ year: "year";
59
+ month: "month";
60
+ date: "date";
61
+ }>;
62
+ display: z.ZodOptional<z.ZodString>;
63
+ value: z.ZodString;
64
+ disableDate: z.ZodOptional<z.ZodString>;
65
+ hidden: z.ZodOptional<z.ZodString>;
66
+ disabled: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>;
68
+ export declare const FieldC: z.ZodUnion<readonly [z.ZodObject<{
69
+ type: z.ZodLiteral<"string">;
70
+ path: z.ZodString;
71
+ title: z.ZodArray<z.ZodObject<{
72
+ locale: z.ZodString;
73
+ message: z.ZodString;
74
+ }, z.core.$strip>>;
75
+ icon: z.ZodOptional<z.ZodString>;
76
+ style: z.ZodOptional<z.ZodString>;
77
+ discardEmptyString: z.ZodOptional<z.ZodBoolean>;
78
+ maxLength: z.ZodOptional<z.ZodString>;
79
+ hidden: z.ZodOptional<z.ZodString>;
80
+ disabled: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ type: z.ZodLiteral<"number">;
83
+ path: z.ZodString;
84
+ title: z.ZodArray<z.ZodObject<{
85
+ locale: z.ZodString;
86
+ message: z.ZodString;
87
+ }, z.core.$strip>>;
88
+ icon: z.ZodOptional<z.ZodString>;
89
+ style: z.ZodOptional<z.ZodString>;
90
+ min: z.ZodOptional<z.ZodString>;
91
+ max: z.ZodOptional<z.ZodString>;
92
+ step: z.ZodOptional<z.ZodString>;
93
+ hidden: z.ZodOptional<z.ZodString>;
94
+ disabled: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ type: z.ZodLiteral<"select">;
97
+ path: z.ZodString;
98
+ title: z.ZodArray<z.ZodObject<{
99
+ locale: z.ZodString;
100
+ message: z.ZodString;
101
+ }, z.core.$strip>>;
102
+ icon: z.ZodOptional<z.ZodString>;
103
+ options: z.ZodString;
104
+ label: z.ZodString;
105
+ value: z.ZodString;
106
+ key: z.ZodString;
107
+ style: z.ZodOptional<z.ZodString>;
108
+ hidden: z.ZodOptional<z.ZodString>;
109
+ disabled: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ type: z.ZodLiteral<"calendar">;
112
+ path: z.ZodString;
113
+ title: z.ZodArray<z.ZodObject<{
114
+ locale: z.ZodString;
115
+ message: z.ZodString;
116
+ }, z.core.$strip>>;
117
+ icon: z.ZodOptional<z.ZodString>;
118
+ style: z.ZodOptional<z.ZodString>;
119
+ mode: z.ZodEnum<{
120
+ year: "year";
121
+ month: "month";
122
+ date: "date";
123
+ }>;
124
+ display: z.ZodOptional<z.ZodString>;
125
+ value: z.ZodString;
126
+ disableDate: z.ZodOptional<z.ZodString>;
127
+ hidden: z.ZodOptional<z.ZodString>;
128
+ disabled: z.ZodOptional<z.ZodString>;
129
+ }, z.core.$strip>]>;
130
+ declare const _default: typeof __VLS_export;
131
+ export default _default;
132
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
133
+ orientation?: "horizontal" | "vertical" | "floating";
134
+ fields: Effect.Effect<ReadonlyArray<z.infer<typeof FieldC>>>;
135
+ } & {
136
+ modelValue?: Record<string, unknown>;
137
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
138
+ "update:modelValue": (value: Record<string, unknown>) => any;
139
+ }, string, import("vue").PublicProps, Readonly<{
140
+ orientation?: "horizontal" | "vertical" | "floating";
141
+ fields: Effect.Effect<ReadonlyArray<z.infer<typeof FieldC>>>;
142
+ } & {
143
+ modelValue?: Record<string, unknown>;
144
+ }> & Readonly<{
145
+ "onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
146
+ }>, {
147
+ orientation: "horizontal" | "vertical" | "floating";
148
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
149
+ default?: (props: {}) => any;
150
+ }>;
151
+ type __VLS_WithSlots<T, S> = T & {
152
+ new (): {
153
+ $slots: S;
154
+ };
155
+ };
@@ -18,7 +18,7 @@ const delegatedProps = reactiveOmit(props, "class");
18
18
  v-bind="delegatedProps"
19
19
  :orientation="props.orientation"
20
20
  :class="cn(
21
- 'bg-input relative m-0! self-stretch data-[orientation=vertical]:h-auto',
21
+ 'bg-zinc-200 relative m-0! self-stretch data-[orientation=vertical]:h-auto',
22
22
  props.class
23
23
  )"
24
24
  />
@@ -16,7 +16,7 @@ const props = defineProps({
16
16
  :data-orientation="props.orientation"
17
17
  :as="as"
18
18
  :as-child="asChild"
19
- :class="cn('bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
19
+ :class="cn('bg-zinc-100 flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
20
20
  >
21
21
  <slot />
22
22
  </Primitive>
@@ -4,23 +4,16 @@ import type { LayoutTypes } from '.';
4
4
  type __VLS_Props = CalendarRootProps & {
5
5
  class?: HTMLAttributes['class'];
6
6
  layout?: LayoutTypes;
7
- yearRange?: DateValue[];
8
7
  };
9
- declare var __VLS_59: {}, __VLS_67: {}, __VLS_69: {
8
+ declare var __VLS_20: {}, __VLS_28: {}, __VLS_30: {
10
9
  date: DateValue;
11
- month: import("@vueuse/core").ReuseTemplateComponent<{
12
- date: DateValue;
13
- }, Record<"default", undefined>>;
14
- year: import("@vueuse/core").ReuseTemplateComponent<{
15
- date: DateValue;
16
- }, Record<"default", undefined>>;
17
10
  };
18
11
  type __VLS_Slots = {} & {
19
- 'calendar-prev-icon'?: (props: typeof __VLS_59) => any;
12
+ 'calendar-prev-icon'?: (props: typeof __VLS_20) => any;
20
13
  } & {
21
- 'calendar-next-icon'?: (props: typeof __VLS_67) => any;
14
+ 'calendar-next-icon'?: (props: typeof __VLS_28) => any;
22
15
  } & {
23
- 'calendar-heading'?: (props: typeof __VLS_69) => any;
16
+ 'calendar-heading'?: (props: typeof __VLS_30) => any;
24
17
  };
25
18
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
19
  "update:modelValue": (date: DateValue | undefined) => any;
@@ -30,7 +23,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
30
23
  "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
31
24
  }>, {
32
25
  modelValue: DateValue | DateValue[];
33
- layout: "month-and-year" | "month-only" | "year-only";
26
+ layout: LayoutTypes;
34
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
36
29
  declare const _default: typeof __VLS_export;
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
- import { getLocalTimeZone, today } from "@internationalized/date";
3
- import { createReusableTemplate, reactiveOmit, useNavigatorLanguage, useVModel } from "@vueuse/core";
2
+ import { CalendarDate, getLocalTimeZone, today } from "@internationalized/date";
3
+ import { reactiveOmit, useNavigatorLanguage, useVModel } from "@vueuse/core";
4
4
  import { CalendarRoot, useDateFormatter, useForwardPropsEmits } from "reka-ui";
5
- import { createYear, createYearRange, toDate } from "reka-ui/date";
6
- import { computed, toRaw } from "vue";
5
+ import { toDate } from "reka-ui/date";
6
+ import { computed } from "vue";
7
7
  import { cn } from "../../../utils/cn";
8
- import { NativeSelect, NativeSelectOption } from "../native-select";
8
+ import { buttonVariants } from "../button";
9
9
  import { CalendarCell, CalendarCellTrigger, CalendarGrid, CalendarGridBody, CalendarGridHead, CalendarGridRow, CalendarHeadCell, CalendarHeader, CalendarHeading, CalendarNextButton, CalendarPrevButton } from ".";
10
10
  const props = defineProps({
11
11
  defaultValue: { type: null, required: false },
@@ -35,8 +35,7 @@ const props = defineProps({
35
35
  asChild: { type: Boolean, required: false },
36
36
  as: { type: null, required: false },
37
37
  class: { type: null, required: false },
38
- layout: { type: null, required: false, default: void 0 },
39
- yearRange: { type: Array, required: false }
38
+ layout: { type: String, required: false, default: void 0 }
40
39
  });
41
40
  const emits = defineEmits(["update:modelValue", "update:placeholder"]);
42
41
  const delegatedProps = reactiveOmit(props, "class", "layout", "placeholder");
@@ -45,14 +44,6 @@ const placeholder = useVModel(props, "placeholder", emits, {
45
44
  defaultValue: props.defaultPlaceholder ?? today(getLocalTimeZone())
46
45
  });
47
46
  const formatter = useDateFormatter(props.locale ?? "en");
48
- const yearRange = computed(() => {
49
- return props.yearRange ?? createYearRange({
50
- start: props?.minValue ?? (toRaw(props.placeholder) ?? props.defaultPlaceholder ?? today(getLocalTimeZone())).cycle("year", -100),
51
- end: props?.maxValue ?? (toRaw(props.placeholder) ?? props.defaultPlaceholder ?? today(getLocalTimeZone())).cycle("year", 10)
52
- });
53
- });
54
- const [DefineMonthTemplate, ReuseMonthTemplate] = createReusableTemplate();
55
- const [DefineYearTemplate, ReuseYearTemplate] = createReusableTemplate();
56
47
  const forwarded = useForwardPropsEmits(delegatedProps, emits);
57
48
  const locale = useNavigatorLanguage();
58
49
  const weekStartsOn = computed(() => {
@@ -63,77 +54,34 @@ const weekStartsOn = computed(() => {
63
54
  }
64
55
  return void 0;
65
56
  });
57
+ const yearGridStart = computed(() => Math.floor(placeholder.value.year / 12) * 12);
58
+ function isPickerDateDisabled(date) {
59
+ const fn = props.isDateDisabled;
60
+ if (typeof fn !== "function") return false;
61
+ return fn(date);
62
+ }
66
63
  </script>
67
64
 
68
65
  <template>
69
- <DefineMonthTemplate v-slot="{ date }">
70
- <div class="**:data-[slot=native-select-icon]:right-1">
71
- <div class="relative">
72
- <div class="absolute inset-0 flex h-full items-center text-sm pl-2 pointer-events-none">
73
- {{ formatter.custom(toDate(date), { month: "short" }) }}
74
- </div>
75
- <NativeSelect
76
- class="text-xs h-8 pr-6 pl-2 text-transparent relative"
77
- @change="(e) => {
78
- placeholder = placeholder.set({
79
- month: Number(e?.target?.value)
80
- });
81
- }"
82
- >
83
- <NativeSelectOption
84
- v-for="(month) in createYear({ dateObj: date })"
85
- :key="month.toString()"
86
- :value="month.month"
87
- :selected="date.month === month.month"
88
- >
89
- {{ formatter.custom(toDate(month), { month: "short" }) }}
90
- </NativeSelectOption>
91
- </NativeSelect>
92
- </div>
93
- </div>
94
- </DefineMonthTemplate>
95
-
96
- <DefineYearTemplate v-slot="{ date }">
97
- <div class="**:data-[slot=native-select-icon]:right-1">
98
- <div class="relative">
99
- <div class="absolute inset-0 flex h-full items-center text-sm pl-2 pointer-events-none">
100
- {{ formatter.custom(toDate(date), { year: "numeric" }) }}
101
- </div>
102
- <NativeSelect
103
- class="text-xs h-8 pr-6 pl-2 text-transparent relative"
104
- @change="(e) => {
105
- placeholder = placeholder.set({
106
- year: Number(e?.target?.value)
107
- });
108
- }"
109
- >
110
- <NativeSelectOption
111
- v-for="(year) in yearRange"
112
- :key="year.toString()"
113
- :value="year.year"
114
- :selected="date.year === year.year"
115
- >
116
- {{ formatter.custom(toDate(year), { year: "numeric" }) }}
117
- </NativeSelectOption>
118
- </NativeSelect>
119
- </div>
120
- </div>
121
- </DefineYearTemplate>
122
-
123
66
  <CalendarRoot
124
67
  v-slot="{ grid, weekDays, date }"
125
68
  v-bind="forwarded"
126
69
  v-model:placeholder="placeholder"
127
70
  data-slot="calendar"
128
71
  :week-starts-on="weekStartsOn"
72
+ fixed-weeks
129
73
  :class="cn('p-3', props.class)"
130
74
  >
131
- <CalendarHeader class="pt-0">
132
- <nav class="w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between">
133
- <CalendarPrevButton>
75
+ <CalendarHeader :class="layout === 'year' ? 'pt-2 pb-2' : 'pt-0'">
76
+ <nav class="w-full flex items-center gap-1 absolute top-1/2 -translate-y-1/2 transform-gpu inset-x-0 justify-between z-10">
77
+ <CalendarPrevButton
78
+ :prev-page="layout === 'year' ? (d) => d.subtract({ years: 12 }) : layout === 'month' ? (d) => d.subtract({ years: 1 }) : void 0"
79
+ >
134
80
  <slot name="calendar-prev-icon" />
135
81
  </CalendarPrevButton>
136
- <CalendarNextButton>
82
+ <CalendarNextButton
83
+ :next-page="layout === 'year' ? (d) => d.add({ years: 12 }) : layout === 'month' ? (d) => d.add({ years: 1 }) : void 0"
84
+ >
137
85
  <slot name="calendar-next-icon" />
138
86
  </CalendarNextButton>
139
87
  </nav>
@@ -141,34 +89,71 @@ const weekStartsOn = computed(() => {
141
89
  <slot
142
90
  name="calendar-heading"
143
91
  :date="date"
144
- :month="ReuseMonthTemplate"
145
- :year="ReuseYearTemplate"
146
92
  >
147
- <template v-if="layout === 'month-and-year'">
148
- <div class="flex items-center justify-center gap-1">
149
- <ReuseMonthTemplate :date="date" />
150
- <ReuseYearTemplate :date="date" />
151
- </div>
152
- </template>
153
- <template v-else-if="layout === 'month-only'">
154
- <div class="flex items-center justify-center gap-1">
155
- <ReuseMonthTemplate :date="date" />
93
+ <template v-if="layout === 'month'">
94
+ <span
95
+ class="text-sm font-medium"
96
+ style="text-autospace: normal"
97
+ >
156
98
  {{ formatter.custom(toDate(date), { year: "numeric" }) }}
157
- </div>
158
- </template>
159
- <template v-else-if="layout === 'year-only'">
160
- <div class="flex items-center justify-center gap-1">
161
- {{ formatter.custom(toDate(date), { month: "short" }) }}
162
- <ReuseYearTemplate :date="date" />
163
- </div>
99
+ </span>
164
100
  </template>
101
+ <template v-else-if="layout === 'year'" />
165
102
  <template v-else>
166
103
  <CalendarHeading />
167
104
  </template>
168
105
  </slot>
169
106
  </CalendarHeader>
170
107
 
171
- <div class="flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0">
108
+ <!-- Month picker grid (month-only / month-and-year) -->
109
+ <div
110
+ v-if="layout === 'month'"
111
+ class="grid grid-cols-4 gap-1 mt-4"
112
+ >
113
+ <button
114
+ v-for="m in 12"
115
+ :key="m"
116
+ type="button"
117
+ :disabled="isPickerDateDisabled(new CalendarDate(placeholder.year, m, 1))"
118
+ :class="cn(
119
+ buttonVariants({ variant: 'ghost' }),
120
+ 'h-9 w-full rounded-md font-normal',
121
+ modelValue && !Array.isArray(modelValue) && modelValue.year === placeholder.year && modelValue.month === m ? 'bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary)' : '',
122
+ isPickerDateDisabled(new CalendarDate(placeholder.year, m, 1)) ? 'text-zinc-500 opacity-50 cursor-default' : 'cursor-pointer'
123
+ )"
124
+ @click="emits('update:modelValue', new CalendarDate(placeholder.year, m, 1))"
125
+ >
126
+ {{ formatter.custom(toDate(new CalendarDate(placeholder.year, m, 1)), { month: "short" }) }}
127
+ </button>
128
+ </div>
129
+
130
+ <!-- Year picker grid -->
131
+ <div
132
+ v-else-if="layout === 'year'"
133
+ class="grid grid-cols-4 gap-1 mt-4"
134
+ >
135
+ <button
136
+ v-for="i in 12"
137
+ :key="i"
138
+ type="button"
139
+ :disabled="isPickerDateDisabled(new CalendarDate(yearGridStart + i - 1, 1, 1))"
140
+ :class="cn(
141
+ buttonVariants({ variant: 'ghost' }),
142
+ 'h-9 w-full rounded-md font-normal',
143
+ modelValue && !Array.isArray(modelValue) && modelValue.year === yearGridStart + i - 1 ? 'bg-[color-mix(in_srgb,var(--primary)_20%,white)] text-(--primary)' : '',
144
+ isPickerDateDisabled(new CalendarDate(yearGridStart + i - 1, 1, 1)) ? 'text-zinc-500 opacity-50 cursor-default' : 'cursor-pointer'
145
+ )"
146
+ @click="emits('update:modelValue', new CalendarDate(yearGridStart + i - 1, 1, 1))"
147
+ >
148
+ {{ yearGridStart + i - 1 }}
149
+ </button>
150
+ </div>
151
+
152
+ <!-- Default: day grid -->
153
+ <div
154
+ v-else
155
+ class="flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"
156
+ >
172
157
  <CalendarGrid
173
158
  v-for="month in grid"
174
159
  :key="month.value.toString()"
@@ -4,23 +4,16 @@ import type { LayoutTypes } from '.';
4
4
  type __VLS_Props = CalendarRootProps & {
5
5
  class?: HTMLAttributes['class'];
6
6
  layout?: LayoutTypes;
7
- yearRange?: DateValue[];
8
7
  };
9
- declare var __VLS_59: {}, __VLS_67: {}, __VLS_69: {
8
+ declare var __VLS_20: {}, __VLS_28: {}, __VLS_30: {
10
9
  date: DateValue;
11
- month: import("@vueuse/core").ReuseTemplateComponent<{
12
- date: DateValue;
13
- }, Record<"default", undefined>>;
14
- year: import("@vueuse/core").ReuseTemplateComponent<{
15
- date: DateValue;
16
- }, Record<"default", undefined>>;
17
10
  };
18
11
  type __VLS_Slots = {} & {
19
- 'calendar-prev-icon'?: (props: typeof __VLS_59) => any;
12
+ 'calendar-prev-icon'?: (props: typeof __VLS_20) => any;
20
13
  } & {
21
- 'calendar-next-icon'?: (props: typeof __VLS_67) => any;
14
+ 'calendar-next-icon'?: (props: typeof __VLS_28) => any;
22
15
  } & {
23
- 'calendar-heading'?: (props: typeof __VLS_69) => any;
16
+ 'calendar-heading'?: (props: typeof __VLS_30) => any;
24
17
  };
25
18
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
19
  "update:modelValue": (date: DateValue | undefined) => any;
@@ -30,7 +23,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
30
23
  "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined;
31
24
  }>, {
32
25
  modelValue: DateValue | DateValue[];
33
- layout: "month-and-year" | "month-only" | "year-only";
26
+ layout: LayoutTypes;
34
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
36
29
  declare const _default: typeof __VLS_export;
@@ -24,7 +24,7 @@ const forwardedProps = useForwardProps(delegatedProps);
24
24
  // Selected
25
25
  'data-selected:bg-[color-mix(in_srgb,var(--primary)_20%,white)] data-selected:opacity-100 data-selected:text-(--primary)',
26
26
  // Disabled
27
- 'data-disabled:text-zinc-500 data-disabled:opacity-50',
27
+ 'data-disabled:text-zinc-500 data-disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:hover:bg-transparent data-disabled:hover:text-zinc-500',
28
28
  // Unavailable
29
29
  'data-unavailable:text-zinc-300 data-unavailable:line-through',
30
30
  // Outside months
@@ -10,4 +10,4 @@ export { default as CalendarHeader } from './CalendarHeader.vue.js';
10
10
  export { default as CalendarHeading } from './CalendarHeading.vue.js';
11
11
  export { default as CalendarNextButton } from './CalendarNextButton.vue.js';
12
12
  export { default as CalendarPrevButton } from './CalendarPrevButton.vue.js';
13
- export type LayoutTypes = 'month-and-year' | 'month-only' | 'year-only' | undefined;
13
+ export type LayoutTypes = 'year' | 'month' | 'date';
@@ -39,6 +39,10 @@ onUnmounted(() => {
39
39
  >
40
40
  {{ heading }}
41
41
  </ListboxGroupLabel>
42
+ <div
43
+ v-else
44
+ class="h-1"
45
+ />
42
46
  <slot />
43
47
  </ListboxGroup>
44
48
  </template>
@@ -15,7 +15,7 @@ const delegatedProps = reactiveOmit(props, "class");
15
15
  <DialogOverlay
16
16
  data-slot="dialog-overlay"
17
17
  v-bind="delegatedProps"
18
- :class="cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/60', props.class)"
18
+ :class="cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-zinc-900/60', props.class)"
19
19
  >
20
20
  <slot />
21
21
  </DialogOverlay>
@@ -25,7 +25,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
25
25
  data-slot="dropdown-menu-checkbox-item"
26
26
  v-bind="forwarded"
27
27
  :class="cn(
28
- 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
28
+ 'focus:bg-zinc-100 focus:text-zinc-700 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
29
29
  props.class
30
30
  )"
31
31
  >
@@ -24,7 +24,7 @@ const forwardedProps = useForwardProps(delegatedProps);
24
24
  v-bind="forwardedProps"
25
25
  :data-inset="inset ? '' : void 0"
26
26
  :class="cn(
27
- 'focus:bg-zinc-100 focus:text-zinc-700 data-[state=open]:bg-zinc-100 data-[state=open]:text-zinc-700 relative flex cursor-pointer items-center gap-2 rounded-sm p-2 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive! [&_svg:not([class*=\'text-\'])]:text-muted-foreground',
27
+ 'focus:bg-zinc-100 focus:text-zinc-700 data-[state=open]:bg-zinc-100 data-[state=open]:text-zinc-700 relative flex cursor-pointer items-center gap-2 rounded-sm p-2 text-sm outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4 data-[variant=destructive]:*:[svg]:text-red-600! [&_svg:not([class*=\'text-\'])]:text-zinc-400',
28
28
  props.class
29
29
  )"
30
30
  >
@@ -9,7 +9,7 @@ const props = defineProps({
9
9
  <p
10
10
  data-slot="field-description"
11
11
  :class="cn(
12
- 'text-muted-foreground text-sm leading-normal font-normal group-has-data-[orientation=horizontal]/field:text-balance',
12
+ 'text-zinc-400 text-sm leading-normal font-normal group-has-data-[orientation=horizontal]/field:text-balance',
13
13
  'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',
14
14
  '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
15
15
  props.class
@@ -28,7 +28,7 @@ const content = computed(() => {
28
28
  v-if="$slots.default || content"
29
29
  role="alert"
30
30
  data-slot="field-error"
31
- :class="cn('text-destructive text-sm font-normal', props.class)"
31
+ :class="cn('text-red-600 text-sm font-normal', props.class)"
32
32
  >
33
33
  <slot v-if="$slots.default" />
34
34
 
@@ -10,7 +10,7 @@ const props = defineProps({
10
10
  <Label
11
11
  data-slot="field-label"
12
12
  :class="cn(
13
- 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',
13
+ 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:text-zinc-600 group-data-[disabled=true]/field:opacity-100',
14
14
  'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-4',
15
15
  'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',
16
16
  props.class
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  <Separator class="absolute inset-0 top-1/2" />
19
19
  <span
20
20
  v-if="$slots.default"
21
- class="bg-background text-muted-foreground relative mx-auto block w-fit px-2"
21
+ class="bg-zinc-50 text-zinc-400 relative mx-auto block w-fit px-2"
22
22
  data-slot="field-separator-content"
23
23
  >
24
24
  <slot />
@@ -1,13 +1,13 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  export const fieldVariants = cva(
3
- "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
3
+ "group/field flex w-full gap-3 data-[invalid=true]:text-red-400",
4
4
  {
5
5
  variants: {
6
6
  orientation: {
7
7
  vertical: ["flex-col *:w-full [&>.sr-only]:w-auto"],
8
8
  horizontal: [
9
9
  "flex-row items-center",
10
- "*:data-[slot=field-label]:flex-auto",
10
+ "*:data-[slot=field-label]:shrink-0 *:data-[slot=field-label]:whitespace-nowrap",
11
11
  "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
12
12
  ],
13
13
  responsive: [
@@ -16,11 +16,12 @@ export const fieldVariants = cva(
16
16
  "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
17
17
  ],
18
18
  floating: [
19
- "relative *:data-[slot=field-label]:absolute *:data-[slot=field-label]:text-zinc-500",
20
- "*:data-[slot=field-label]:top-1/2 *:data-[slot=field-label]:-translate-y-1/2 *:data-[slot=field-label]:transition-all *:data-[slot=field-label]:duration-180",
19
+ "relative *:data-[slot=field-label]:absolute *:data-[slot=field-label]:text-zinc-500 *:data-[slot=field-label]:z-20",
20
+ "*:data-[slot=field-label]:top-1/2 *:data-[slot=field-label]:-translate-y-1/2 *:data-[slot=field-label]:transition-[top,transform,color,font-size] *:data-[slot=field-label]:duration-180",
21
21
  "*:data-[slot=field-label]:pointer-events-none *:data-[slot=field-label]:select-none *:data-[slot=field-label]:cursor-text",
22
22
  "has-data-[value=true]:**:data-[slot=field-label]:top-0",
23
23
  "**:data-[slot=field-label]:bg-white",
24
+ "data-[disabled=true]:**:data-[slot=field-label]:bg-transparent",
24
25
  "**:data-[slot=field-label]:px-1",
25
26
  "has-data-[value=true]:**:data-[slot=field-label]:text-xs",
26
27
  "has-[[data-slot=input-group-control]:focus]:**:data-[slot=field-label]:top-0",
@@ -30,13 +31,14 @@ export const fieldVariants = cva(
30
31
  "has-[[data-slot=input-group-control]:focus]:**:data-[slot=field-label]:text-zinc-700",
31
32
  "has-data-[state=open]:**:data-[slot=field-label]:text-zinc-700",
32
33
  "has-data-[value=true]:**:data-[slot=field-label]:text-zinc-700",
34
+ "data-[disabled=true]:**:data-[slot=field-label]:text-zinc-400",
33
35
  "*:data-[slot=field-label]:left-3",
34
36
  "has-[[data-slot=input-group-addon][data-align=inline-start]]:**:data-[slot=field-label]:left-7"
35
37
  ]
36
38
  }
37
39
  },
38
40
  defaultVariants: {
39
- orientation: "floating"
41
+ orientation: "horizontal"
40
42
  }
41
43
  }
42
44
  );
@@ -20,7 +20,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
20
20
  data-slot="input"
21
21
  :data-value="!treatEmptyAsDifferentStateFromNull ? !!modelValue : modelValue !== void 0"
22
22
  :class="cn(
23
- 'file:text-zinc-700 placeholder:text-zinc-700 text-zinc-700 border-zinc-200 h-9 w-full min-w-0 rounded border bg-transparent px-3 py-1 text-base transition-colors ease-out duration-180 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
23
+ 'file:text-zinc-700 placeholder:text-zinc-300 text-zinc-700 border-zinc-200 h-9 w-full min-w-0 rounded border bg-transparent px-3 py-1 text-base transition-colors ease-out duration-180 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
24
24
  'aria-invalid:border-red-400 hover:border-zinc-300 focus-visible:border-(--primary)',
25
25
  props.class
26
26
  )"
@@ -15,6 +15,9 @@ setInputGroupReference(useTemplateRef("input-group"));
15
15
  role="group"
16
16
  :class="cn(
17
17
  'group/input-group border-zinc-200 relative flex w-full items-center rounded-md border transition-[color,box-shadow] outline-none',
18
+ 'data-[disabled=true]:border-zinc-100 data-[disabled=true]:bg-zinc-100',
19
+ 'data-[disabled=true]:[&_[data-slot=input-group-control]]:text-zinc-600',
20
+ 'data-[disabled=true]:[&_[data-slot=input-group-control]]:opacity-100',
18
21
  'h-9 min-w-0 has-[>textarea]:h-auto',
19
22
  // Variants based on alignment.
20
23
  'has-[>[data-align=inline-start]]:[&>input]:pl-2',