@bridge-ui/vue 0.12.0 → 0.14.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 (153) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/ai/skills/bridge-ui-forms/SKILL.md +3 -3
  3. package/dist/Adapters/Examples/date-moment.js +31 -31
  4. package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
  5. package/dist/Adapters/Examples/icon-fontawesome.js +24 -22
  6. package/dist/Adapters/Examples/icon-heroicons.js +47 -45
  7. package/dist/Adapters/Examples/icon-lucide.js +13 -11
  8. package/dist/Adapters/Examples/icon-phosphor.js +49 -47
  9. package/dist/Adapters/Examples/icon-tabler.js +13 -11
  10. package/dist/Adapters/Examples/rich-text-tiptap.js +34 -41
  11. package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
  12. package/dist/Components/BaseField/composables/useBaseField.js +7 -7
  13. package/dist/Components/Calendar/Calendar.vue.d.ts +14 -6
  14. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +78 -74
  15. package/dist/Components/Calendar/calendar.types.d.ts +12 -7
  16. package/dist/Components/Calendar/composables/useCalendar.d.ts +5 -9
  17. package/dist/Components/Calendar/composables/useCalendar.js +144 -143
  18. package/dist/Components/CalendarDate/CalendarDate.vue.d.ts +14 -6
  19. package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +20 -16
  20. package/dist/Components/CalendarDate/calendarDate.types.d.ts +13 -8
  21. package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +4 -8
  22. package/dist/Components/CalendarDate/composables/useCalendarDate.js +105 -105
  23. package/dist/Components/CalendarMonth/CalendarMonth.vue.d.ts +9 -2
  24. package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +19 -12
  25. package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +14 -8
  26. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +4 -7
  27. package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +92 -89
  28. package/dist/Components/CalendarRange/CalendarRange.vue.d.ts +14 -6
  29. package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +109 -105
  30. package/dist/Components/CalendarRange/calendarRange.types.d.ts +12 -7
  31. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -9
  32. package/dist/Components/CalendarRange/composables/useCalendarRange.js +181 -154
  33. package/dist/Components/CalendarYear/CalendarYear.vue.d.ts +9 -2
  34. package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +20 -13
  35. package/dist/Components/CalendarYear/calendarYear.types.d.ts +12 -6
  36. package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +4 -7
  37. package/dist/Components/CalendarYear/composables/useCalendarYear.js +91 -88
  38. package/dist/Components/Carousel/Carousel.js +5 -0
  39. package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
  40. package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
  41. package/dist/Components/Carousel/carousel.types.d.ts +236 -0
  42. package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
  43. package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
  44. package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
  45. package/dist/Components/Carousel/composables/useCarousel.js +331 -0
  46. package/dist/Components/Carousel/index.d.ts +4 -0
  47. package/dist/Components/Carousel/index.js +4 -0
  48. package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
  49. package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
  50. package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
  51. package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
  52. package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
  53. package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
  54. package/dist/Components/CarouselSlide/index.d.ts +3 -0
  55. package/dist/Components/CarouselSlide/index.js +3 -0
  56. package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -2
  57. package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +9 -2
  58. package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +48 -44
  59. package/dist/Components/ColorPicker/colorPicker.types.d.ts +12 -7
  60. package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +3 -3
  61. package/dist/Components/ColorPicker/composables/useColorPicker.js +150 -150
  62. package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +2 -2
  63. package/dist/Components/DatePicker/DatePicker.vue.d.ts +12 -4
  64. package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +55 -51
  65. package/dist/Components/DatePicker/composables/useDatePicker.d.ts +3 -3
  66. package/dist/Components/DatePicker/composables/useDatePicker.js +52 -25
  67. package/dist/Components/DatePicker/datePicker.types.d.ts +12 -7
  68. package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
  69. package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +12 -4
  70. package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +54 -50
  71. package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +3 -3
  72. package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +26 -26
  73. package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +12 -7
  74. package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +2 -2
  75. package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +9 -2
  76. package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +82 -78
  77. package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +3 -3
  78. package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +64 -63
  79. package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +12 -7
  80. package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
  81. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +12 -4
  82. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +110 -106
  83. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +3 -3
  84. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +71 -70
  85. package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +12 -7
  86. package/dist/Components/FileUpload/FileUpload.vue.d.ts +22 -24
  87. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +101 -92
  88. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +66 -16
  89. package/dist/Components/FileUpload/composables/useFileUpload.js +182 -157
  90. package/dist/Components/FileUpload/fileUpload.types.d.ts +113 -23
  91. package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
  92. package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
  93. package/dist/Components/FileUpload/index.d.ts +1 -1
  94. package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
  95. package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
  96. package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
  97. package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
  98. package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
  99. package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
  100. package/dist/Components/FileUploadItem/index.d.ts +3 -0
  101. package/dist/Components/FileUploadItem/index.js +3 -0
  102. package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
  103. package/dist/Components/Rating/Rating.js +5 -0
  104. package/dist/Components/Rating/Rating.vue.d.ts +20 -0
  105. package/dist/Components/Rating/Rating.vue_vue_type_script_setup_true_lang.js +62 -0
  106. package/dist/Components/Rating/composables/useRating.d.ts +112 -0
  107. package/dist/Components/Rating/composables/useRating.js +190 -0
  108. package/dist/Components/Rating/index.d.ts +4 -0
  109. package/dist/Components/Rating/index.js +3 -0
  110. package/dist/Components/Rating/rating.types.d.ts +107 -0
  111. package/dist/Components/Sidebar/composables/useSidebar.js +1 -1
  112. package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
  113. package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
  114. package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +2 -2
  115. package/dist/Components/TimePanel/TimePanel.vue.d.ts +10 -2
  116. package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +37 -34
  117. package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -5
  118. package/dist/Components/TimePanel/composables/useTimePanel.js +108 -109
  119. package/dist/Components/TimePanel/timePanel.types.d.ts +10 -4
  120. package/dist/Components/TimePicker/TimePicker.vue.d.ts +10 -2
  121. package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +46 -42
  122. package/dist/Components/TimePicker/composables/useTimePicker.d.ts +3 -3
  123. package/dist/Components/TimePicker/composables/useTimePicker.js +36 -36
  124. package/dist/Components/TimePicker/timePicker.types.d.ts +12 -7
  125. package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +2 -2
  126. package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +12 -4
  127. package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +72 -68
  128. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -4
  129. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +87 -87
  130. package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +12 -7
  131. package/dist/augments.d.ts +10 -1
  132. package/dist/index.d.ts +9 -1
  133. package/dist/index.js +117 -109
  134. package/docs/README.md +2 -0
  135. package/docs/components/BaseField.md +3 -3
  136. package/docs/components/Calendar.md +0 -1
  137. package/docs/components/CalendarDate.md +0 -1
  138. package/docs/components/CalendarMonth.md +0 -1
  139. package/docs/components/CalendarRange.md +0 -1
  140. package/docs/components/CalendarYear.md +0 -1
  141. package/docs/components/Carousel.md +113 -0
  142. package/docs/components/ColorPicker.md +13 -14
  143. package/docs/components/DatePicker.md +0 -1
  144. package/docs/components/DateRangePicker.md +0 -1
  145. package/docs/components/DateTimePicker.md +0 -1
  146. package/docs/components/DateTimeRangePicker.md +0 -1
  147. package/docs/components/FileUpload.md +83 -8
  148. package/docs/components/Rating.md +86 -0
  149. package/docs/components/RichTextEditor.md +3 -3
  150. package/docs/components/TimePanel.md +0 -1
  151. package/docs/components/TimePicker.md +0 -1
  152. package/docs/components/TimeRangePicker.md +0 -1
  153. package/package.json +2 -12
@@ -0,0 +1,94 @@
1
+ import { FILE_UPLOAD_KEY as e } from "../../FileUpload/fileUploadInjectionKey.js";
2
+ import { computed as t, inject as n, useAttrs as r } from "vue";
3
+ import { get as i, isNil as a } from "es-toolkit/compat";
4
+ import { formatFileUploadStatusLabel as o, getFileUploadItemState as s, resolveFileUploadItemMedia as c, shouldShowFileUploadDescription as l } from "@bridge-ui/core/Domain";
5
+ import { cn as u, splitComponentProps as d } from "@bridge-ui/core/Utils";
6
+ //#region src/Components/FileUploadItem/composables/useFileUploadItem.ts
7
+ var f = [
8
+ "index",
9
+ "retry",
10
+ "value",
11
+ "remove",
12
+ "isImage",
13
+ "metaLabel",
14
+ "sizeLabel",
15
+ "previewUrl",
16
+ "description",
17
+ "orientation"
18
+ ];
19
+ function p(p) {
20
+ let m = r(), h = n(e);
21
+ if (!h) throw Error("FileUploadItem must be used within FileUpload");
22
+ let g = t(() => d({
23
+ bridgeKeys: f,
24
+ props: {
25
+ ...m,
26
+ ...p
27
+ }
28
+ })), _ = t(() => g.value.componentProps.orientation ?? h.value.orientation), v = t(() => i(h.value.orientationItems, _.value)), y = t(() => s(g.value.componentProps.value)), b = t(() => {
29
+ let e = y.value;
30
+ return e ? i(h.value.stateItems, e) : void 0;
31
+ }), x = t(() => c(g.value.componentProps.value, g.value.componentProps.previewUrl)), S = t(() => g.value.componentProps.description || o(g.value.componentProps.value)), C = t(() => {
32
+ let e = g.value.componentProps.description;
33
+ return e === null || e === "" ? !1 : e ? !0 : l(g.value.componentProps.value, h.value.size);
34
+ }), w = t(() => y.value === "error" && !a(g.value.componentProps.retry)), T = t(() => {
35
+ let e = h.value.getItemBind(g.value.componentProps.index), t = g.value.inheritedAttrs, n = _.value !== h.value.orientation;
36
+ return {
37
+ ...e,
38
+ ...t,
39
+ "data-orientation": _.value,
40
+ ...y.value ? { "data-state": y.value } : {},
41
+ class: u(e.class, n ? i(v.value, "item") : void 0, t.class)
42
+ };
43
+ }), E = t(() => {
44
+ let e = h.value.mediaBind, t = _.value !== h.value.orientation;
45
+ return {
46
+ ...e,
47
+ class: u(e.class, t ? i(v.value, "media") : void 0, b.value ? i(b.value, "media") : void 0)
48
+ };
49
+ }), D = t(() => {
50
+ let e = h.value.contentBind, t = _.value !== h.value.orientation;
51
+ return {
52
+ ...e,
53
+ class: u(e.class, t ? i(v.value, "content") : void 0)
54
+ };
55
+ }), O = t(() => {
56
+ let e = h.value.titleBind;
57
+ return {
58
+ ...e,
59
+ class: u(e.class, b.value ? i(b.value, "title") : void 0)
60
+ };
61
+ }), k = t(() => {
62
+ let e = h.value.descriptionBind;
63
+ return {
64
+ ...e,
65
+ class: u(e.class, b.value ? i(b.value, "description") : void 0)
66
+ };
67
+ });
68
+ return {
69
+ media: x,
70
+ rootBind: T,
71
+ showRetry: w,
72
+ titleBind: O,
73
+ mediaBind: E,
74
+ contentBind: D,
75
+ actionsBind: t(() => {
76
+ let e = h.value.actionsBind, t = _.value !== h.value.orientation;
77
+ return {
78
+ ...e,
79
+ class: u(e.class, t ? i(v.value, "actions") : void 0)
80
+ };
81
+ }),
82
+ statusLabel: S,
83
+ descriptionBind: k,
84
+ showDescription: C,
85
+ color: t(() => h.value.color),
86
+ rounded: t(() => h.value.rounded),
87
+ disabled: t(() => h.value.disabled),
88
+ retry: t(() => g.value.componentProps.retry),
89
+ remove: t(() => g.value.componentProps.remove),
90
+ name: t(() => g.value.componentProps.value.name)
91
+ };
92
+ }
93
+ //#endregion
94
+ export { p as useFileUploadItem };
@@ -0,0 +1,20 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { FileUploadOrientation } from '@bridge-ui/core/Tokens';
3
+ import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
4
+ import { FileUploadItemSlotProps, FileUploadOrientationOverrides } from '../FileUpload/fileUpload.types';
5
+ export interface FileUploadItemOwnProps extends FileUploadItemSlotProps {
6
+ /**
7
+ * Replaces the meta line, including upload-state copy.
8
+ * `null` or `""` hides the line.
9
+ *
10
+ * @default the attachment `description`, or the type · size / state label
11
+ */
12
+ description?: null | string;
13
+ /**
14
+ * Card layout. Overrides the `FileUpload` orientation for this card.
15
+ *
16
+ * @default inherited from FileUpload
17
+ */
18
+ orientation?: MergeProps<FileUploadOrientation, FileUploadOrientationOverrides>;
19
+ }
20
+ export type FileUploadItemProps = MergeHtmlProps<FileUploadItemOwnProps, HTMLAttributes>;
@@ -0,0 +1,3 @@
1
+ export { useFileUploadItem } from './composables/useFileUploadItem';
2
+ export type { FileUploadItemOwnProps, FileUploadItemProps, } from './fileUploadItem.types';
3
+ export { default as FileUploadItem } from './FileUploadItem.vue';
@@ -0,0 +1,3 @@
1
+ import { useFileUploadItem as e } from "./composables/useFileUploadItem.js";
2
+ import t from "./FileUploadItem.js";
3
+ export { t as FileUploadItem, e as useFileUploadItem };
@@ -17,7 +17,7 @@ export declare function usePagination(props: PaginationOwnProps, libDefaults: Pa
17
17
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
18
18
  "aria-label": string;
19
19
  class: string;
20
- }, "class", import('vue').HTMLAttributes | undefined, Omit<PaginationProps, "color" | "mode" | "size" | "classes" | "customProps" | "disabled" | "rounded" | "variant" | "modelValue" | "boundaryCount" | "count" | "hasNext" | "hasPrevious" | "hideNextButton" | "hidePrevButton" | "siblingCount">>>;
20
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<PaginationProps, "color" | "mode" | "size" | "classes" | "customProps" | "disabled" | "rounded" | "variant" | "modelValue" | "count" | "boundaryCount" | "hasNext" | "hasPrevious" | "hideNextButton" | "hidePrevButton" | "siblingCount">>>;
21
21
  listBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
22
22
  class: string;
23
23
  }, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -0,0 +1,5 @@
1
+ import e from "./Rating.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/Rating/Rating.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,20 @@
1
+ import { RatingOwnProps, RatingSlots } from './rating.types';
2
+ type __VLS_Slots = RatingSlots;
3
+ type __VLS_Props = RatingOwnProps;
4
+ type __VLS_ModelProps = {
5
+ modelValue?: null | number | undefined;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ "update:modelValue": (value: number | null | undefined) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ "onUpdate:modelValue"?: ((value: number | null | undefined) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,62 @@
1
+ import { presentSlotNames as e } from "../../Utils/slotOrProp.js";
2
+ import t from "../Icon/Icon.js";
3
+ import { BASE_FIELD_CHROME_SLOT_NAMES as n } from "../BaseField/baseField.types.js";
4
+ import r from "../BaseField/BaseField.js";
5
+ import { useRating as i } from "./composables/useRating.js";
6
+ import { Fragment as a, createBlock as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeModels as p, mergeProps as m, normalizeProps as h, normalizeStyle as g, openBlock as _, renderList as v, renderSlot as y, unref as b, useModel as x, withCtx as S } from "vue";
7
+ //#region src/Components/Rating/Rating.vue?vue&type=script&setup=true&lang.ts
8
+ var C = {
9
+ key: 0,
10
+ class: "relative inline-flex"
11
+ }, w = /*@__PURE__*/ d({
12
+ inheritAttrs: !1,
13
+ __name: "Rating",
14
+ props: /*@__PURE__*/ p({
15
+ classes: {},
16
+ color: {},
17
+ customProps: {},
18
+ defaultValue: {},
19
+ icon: {},
20
+ max: {},
21
+ name: {},
22
+ size: {},
23
+ slots: {},
24
+ step: {},
25
+ controlId: {},
26
+ corner: {},
27
+ description: {},
28
+ disabled: { type: Boolean },
29
+ error: { type: Boolean },
30
+ errorMessage: {},
31
+ hideErrorMessage: { type: Boolean },
32
+ label: {},
33
+ readonly: { type: Boolean },
34
+ required: { type: Boolean },
35
+ showDescriptionOnError: { type: Boolean }
36
+ }, {
37
+ modelValue: {},
38
+ modelModifiers: {}
39
+ }),
40
+ emits: ["update:modelValue"],
41
+ setup(d) {
42
+ let p = d, w = x(d, "modelValue"), { icon: T, items: E, inputBind: D, groupBind: O, baseField: k, setItemRef: A } = i(p, w);
43
+ return (i, d) => (_(), o(r, { field: b(k) }, l({
44
+ default: S(() => [c("div", h(f(b(O))), [(_(!0), s(a, null, v(b(E), (e) => (_(), s("button", m({ key: e.value }, { ref_for: !0 }, e.itemBind, {
45
+ ref_for: !0,
46
+ ref: (t) => b(A)(e.value, t)
47
+ }), [e.fill > 0 && e.fill < 1 ? (_(), s("span", C, [u(b(t), m({ ref_for: !0 }, e.emptyIconBind, { icon: b(T) }), null, 16, ["icon"]), c("span", {
48
+ style: g({ width: `${e.fill * 100}%` }),
49
+ class: "absolute inset-y-0 inset-s-0 overflow-hidden"
50
+ }, [u(b(t), m({ ref_for: !0 }, e.filledIconBind, { icon: b(T) }), null, 16, ["icon"])], 4)])) : (_(), o(b(t), m({
51
+ key: 1,
52
+ ref_for: !0
53
+ }, e.iconBind, { icon: b(T) }), null, 16, ["icon"]))], 16))), 128)), c("input", h(f(b(D))), null, 16)], 16)]),
54
+ _: 2
55
+ }, [v(b(e)(b(n), i.$slots), (e) => ({
56
+ name: e,
57
+ fn: S((t) => [y(i.$slots, e, h(f(t || {})))])
58
+ }))]), 1032, ["field"]));
59
+ }
60
+ });
61
+ //#endregion
62
+ export { w as default };
@@ -0,0 +1,112 @@
1
+ import { MaybeRefOrGetter, Ref } from 'vue';
2
+ import { RatingValue } from '@bridge-ui/core/Domain';
3
+ import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
4
+ import { RatingOwnProps } from '../rating.types';
5
+ import { mergePartBind } from '../../../Utils';
6
+ export declare const ratingBridgeKeys: readonly ["max", "icon", "name", "step", "color", "defaultValue", "size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage", "showDescriptionOnError"];
7
+ type RatingLibDefaults = LibDefaultsShape<RatingOwnProps, "max" | "icon" | "size" | "step" | "color">;
8
+ type RatingMerged = MergeLibDefaults<RatingOwnProps, RatingLibDefaults>;
9
+ /**
10
+ * One rating item with the binds for its button and icon.
11
+ */
12
+ export type RatingItemState = {
13
+ emptyIconBind: ReturnType<typeof mergePartBind>;
14
+ fill: number;
15
+ filledIconBind: ReturnType<typeof mergePartBind>;
16
+ iconBind: ReturnType<typeof mergePartBind>;
17
+ itemBind: ReturnType<typeof mergePartBind>;
18
+ value: number;
19
+ };
20
+ /**
21
+ * Composes rating state, field chrome via {@link useBaseField}, and item handlers.
22
+ */
23
+ export declare function useRating(props: MaybeRefOrGetter<RatingOwnProps>, model: Ref<null | number | undefined>, libDefaults?: RatingLibDefaults): {
24
+ icon: import('vue').ComputedRef<NonNullable<import('../../..').IconSource | undefined>>;
25
+ items: import('vue').ComputedRef<{
26
+ fill: number;
27
+ iconBind: import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {
28
+ readonly "aria-hidden": true;
29
+ }>;
30
+ itemBind: import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').ButtonHTMLAttributes | undefined, {
31
+ role: string;
32
+ type: "button";
33
+ onKeydown: (event: KeyboardEvent) => void;
34
+ id: string;
35
+ disabled: true | undefined;
36
+ tabIndex: 0 | -1;
37
+ "aria-checked": boolean;
38
+ onClick: (event: MouseEvent) => void;
39
+ onMousemove: (event: MouseEvent) => void;
40
+ onMouseenter: (event: MouseEvent) => void;
41
+ "aria-label": string;
42
+ }>;
43
+ value: number;
44
+ emptyIconBind: import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {
45
+ readonly "aria-hidden": true;
46
+ }>;
47
+ filledIconBind: import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {
48
+ readonly "aria-hidden": true;
49
+ }>;
50
+ }[]>;
51
+ value: import('vue').ComputedRef<RatingValue>;
52
+ merged: import('vue').ComputedRef<RatingMerged>;
53
+ inputBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').InputHTMLAttributes | undefined, {
54
+ tabIndex: number;
55
+ type: string;
56
+ "aria-hidden": boolean;
57
+ name: string | undefined;
58
+ value: string | number;
59
+ disabled: true | undefined;
60
+ }>>;
61
+ groupBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {
62
+ role: string;
63
+ "aria-label": string | undefined;
64
+ "aria-describedby": string | undefined;
65
+ "aria-disabled": true | undefined;
66
+ "aria-readonly": true | undefined;
67
+ "aria-invalid": true | undefined;
68
+ onMouseleave: () => void;
69
+ "aria-required": true | undefined;
70
+ }>>;
71
+ baseField: {
72
+ slots: Readonly<{
73
+ [name: string]: import('vue').Slot<any> | undefined;
74
+ }>;
75
+ merged: import('vue').ComputedRef<Omit<Omit<import('../../BaseField').BaseFieldOwnProps, "field">, "error" | "size" | "hideErrorMessage"> & {
76
+ error: NonNullable<boolean | undefined>;
77
+ size: NonNullable<keyof import('@bridge-ui/core/Tokens').BaseFieldSize | undefined>;
78
+ hideErrorMessage: NonNullable<boolean | undefined>;
79
+ }>;
80
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
81
+ slots?: import('../../BaseField').BaseFieldSlots | undefined;
82
+ class: string;
83
+ }>>;
84
+ errorBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
85
+ groupBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
86
+ role: string;
87
+ id: string;
88
+ "aria-describedby": string | undefined;
89
+ "aria-disabled": true | undefined;
90
+ "aria-invalid": true | undefined;
91
+ }>>;
92
+ controlId: import('vue').ComputedRef<string>;
93
+ headerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
94
+ isDisabled: import('vue').ComputedRef<boolean>;
95
+ isReadonly: import('vue').ComputedRef<boolean>;
96
+ sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').BaseFieldSizeItem | undefined>;
97
+ endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
98
+ invalidated: import('vue').ComputedRef<boolean>;
99
+ startSlotBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
100
+ mergedClasses: import('vue').ComputedRef<Partial<import('../../BaseField').BaseFieldClasses>>;
101
+ ariaDescribedBy: import('vue').ComputedRef<string | undefined>;
102
+ fieldLabelProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
103
+ descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
104
+ fieldCornerProps: import('vue').ComputedRef<import('../../Label').LabelProps>;
105
+ showErrorMessageRow: import('vue').ComputedRef<boolean>;
106
+ showDescriptionContent: import('vue').ComputedRef<boolean>;
107
+ showErrorMessageContent: import('vue').ComputedRef<boolean>;
108
+ };
109
+ setItemRef: (item: number, node: unknown) => void;
110
+ };
111
+ export type UseRatingReturn = ReturnType<typeof useRating>;
112
+ export {};
@@ -0,0 +1,190 @@
1
+ import { useBridgeUI as e } from "../../../Provider/useBridgeUI.js";
2
+ import { useResolveMessage as t } from "../../../Adapters/I18n/useI18nAdapter.js";
3
+ import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
4
+ import { baseFieldBridgeKeys as a, useBaseField as o } from "../../BaseField/composables/useBaseField.js";
5
+ import { computed as s, ref as c, toValue as l, useAttrs as u } from "vue";
6
+ import { get as d, isString as f, isUndefined as p, omit as ee, pick as te } from "es-toolkit/compat";
7
+ import { clampRatingValue as m, getRatingCurrentItem as h, getRatingItemFill as g, getRatingItems as _, getRatingTabIndex as v, getRatingValueFromKey as y, getRatingValueFromPointer as b, normalizeRatingMax as x, normalizeRatingStep as ne, resolveRatingSelection as re } from "@bridge-ui/core/Domain";
8
+ import { ratingColorProps as ie, ratingSizeProps as ae } from "@bridge-ui/core/Tokens";
9
+ import { cn as S, getColorToken as oe, mergeBridgeUILayeredClasses as C, splitComponentProps as se } from "@bridge-ui/core/Utils";
10
+ //#region src/Components/Rating/composables/useRating.ts
11
+ var w = [
12
+ "max",
13
+ "icon",
14
+ "name",
15
+ "step",
16
+ "color",
17
+ "defaultValue",
18
+ ...a
19
+ ];
20
+ function T(e) {
21
+ if (!e) return;
22
+ let { icon: t, item: n, input: r, ...i } = e;
23
+ return i;
24
+ }
25
+ function E(E, D, O = {
26
+ max: 5,
27
+ step: 1,
28
+ size: "md",
29
+ icon: "star",
30
+ color: "primary"
31
+ }) {
32
+ let ce = u(), le = e(), ue = t(), k = c(null), A = c([]), j = s(() => se({
33
+ bridgeKeys: w,
34
+ props: {
35
+ ...ce,
36
+ ...l(E)
37
+ }
38
+ })), { merged: M, entry: N } = r({
39
+ libDefaults: O,
40
+ componentName: "Rating",
41
+ props: () => j.value.componentProps
42
+ }), P = i({
43
+ entry: N,
44
+ props: () => j.value.componentProps
45
+ }), F = s(() => M.value.customProps), I = s(() => T(M.value.customProps)), L = s(() => ({
46
+ ...te(j.value.componentProps, a),
47
+ customProps: I.value,
48
+ id: j.value.inheritedAttrs.id,
49
+ class: j.value.inheritedAttrs.class,
50
+ ...ee(j.value.inheritedAttrs, ["class", "id"])
51
+ })), R = o(() => L.value, {
52
+ size: "md",
53
+ hideErrorMessage: !1
54
+ }, {
55
+ componentName: "Rating",
56
+ labelHtmlFor: (e) => `${e}-0`
57
+ }), { controlId: z, isDisabled: B, isReadonly: V, invalidated: H, ariaDescribedBy: de } = R, U = s(() => x(M.value.max)), W = s(() => ne(M.value.step)), G = s(() => !p(D.value)), K = c(m(l(E).defaultValue ?? null, x(l(E).max ?? O.max))), q = s(() => {
58
+ let e = G.value ? D.value : K.value;
59
+ return m(e, U.value);
60
+ }), J = s(() => le?.global.value.direction === "rtl"), fe = s(() => B.value || V.value || k.value == null ? q.value : k.value);
61
+ function Y(e) {
62
+ let t = m(e, U.value);
63
+ G.value || (K.value = t), D.value = t;
64
+ }
65
+ function X(e, t) {
66
+ let n = t?.currentTarget;
67
+ if (!t || !(n instanceof HTMLElement)) return e;
68
+ let r = n.getBoundingClientRect();
69
+ if (!(r.width > 0)) return e;
70
+ let i = (t.clientX - r.left) / r.width;
71
+ return b({
72
+ item: e,
73
+ step: W.value,
74
+ ratio: J.value ? 1 - i : i
75
+ });
76
+ }
77
+ function pe(e) {
78
+ if (B.value || V.value) return;
79
+ let t = re(q.value, e);
80
+ t ?? (k.value = null), Y(t);
81
+ }
82
+ function Z(e) {
83
+ B.value || V.value || (k.value = e);
84
+ }
85
+ function Q(e) {
86
+ let t = h(e) ?? 1;
87
+ A.value[t - 1]?.focus();
88
+ }
89
+ function me(e) {
90
+ if (B.value) return;
91
+ let t = y({
92
+ max: U.value,
93
+ key: e.key,
94
+ step: W.value,
95
+ value: q.value,
96
+ direction: J.value ? "rtl" : "ltr"
97
+ });
98
+ if (t !== void 0) {
99
+ if (e.preventDefault(), V.value) {
100
+ Q(t);
101
+ return;
102
+ }
103
+ t !== q.value && (t ?? (k.value = null), Y(t)), Q(t);
104
+ }
105
+ }
106
+ let he = s(() => {
107
+ let e = C(ae, N.value?.tokens?.size);
108
+ return d(e, M.value.size ?? "md");
109
+ }), $ = s(() => {
110
+ let e = C(ie, N.value?.tokens?.color);
111
+ return oe({
112
+ tokens: e,
113
+ color: M.value.color,
114
+ invalid: H.value
115
+ });
116
+ }), ge = s(() => {
117
+ let e = R.merged.value.label, t = f(e) && e.length > 0 ? e : void 0;
118
+ return n({}, {
119
+ role: "radiogroup",
120
+ "aria-label": t,
121
+ "aria-describedby": de.value,
122
+ "aria-disabled": B.value || void 0,
123
+ "aria-readonly": V.value || void 0,
124
+ "aria-invalid": H.value || void 0,
125
+ onMouseleave: () => {
126
+ k.value = null;
127
+ },
128
+ "aria-required": R.merged.value.required || void 0
129
+ }, S({ "inline-flex items-center gap-0.5": !0 }));
130
+ }), _e = s(() => n(F.value?.input, {
131
+ tabIndex: -1,
132
+ type: "hidden",
133
+ "aria-hidden": !0,
134
+ name: M.value.name,
135
+ value: q.value ?? "",
136
+ disabled: B.value || void 0
137
+ }, S({ [P.value.input ?? ""]: !0 }))), ve = s(() => _(U.value).map((e) => {
138
+ let t = g(e, fe.value), r = n(F.value?.item, {
139
+ role: "radio",
140
+ type: "button",
141
+ onKeydown: me,
142
+ id: `${z.value}-${e - 1}`,
143
+ disabled: B.value || void 0,
144
+ tabIndex: v(e, q.value),
145
+ "aria-checked": h(q.value) === e,
146
+ onClick: (t) => {
147
+ pe(X(e, t));
148
+ },
149
+ onMousemove: (t) => {
150
+ Z(X(e, t));
151
+ },
152
+ onMouseenter: (t) => {
153
+ Z(X(e, t));
154
+ },
155
+ "aria-label": ue("{{count}} star | {{count}} stars", e, { count: e })
156
+ }, S({
157
+ "inline-flex items-center justify-center p-0.5 outline-none transition focus-visible:ring-2 focus-visible:ring-offset-1": !0,
158
+ "cursor-pointer": !B.value && !V.value,
159
+ [$.value?.focus ?? ""]: !0,
160
+ [P.value.item ?? ""]: !0
161
+ })), i = { "aria-hidden": !0 }, a = (e) => S({
162
+ "fill-current transition-colors": !0,
163
+ [he.value ?? ""]: !0,
164
+ [e ? $.value?.filled ?? "" : $.value?.empty ?? ""]: !0,
165
+ [P.value.icon ?? ""]: !0
166
+ });
167
+ return {
168
+ fill: t,
169
+ iconBind: n(F.value?.icon, i, a(t === 1)),
170
+ itemBind: r,
171
+ value: e,
172
+ emptyIconBind: n(F.value?.icon, i, a(!1)),
173
+ filledIconBind: n(F.value?.icon, i, S(a(!0), "max-w-none"))
174
+ };
175
+ }));
176
+ return {
177
+ icon: s(() => M.value.icon),
178
+ items: ve,
179
+ value: q,
180
+ merged: M,
181
+ inputBind: _e,
182
+ groupBind: ge,
183
+ baseField: R,
184
+ setItemRef: (e, t) => {
185
+ A.value[e - 1] = t instanceof HTMLButtonElement ? t : null;
186
+ }
187
+ };
188
+ }
189
+ //#endregion
190
+ export { w as ratingBridgeKeys, E as useRating };
@@ -0,0 +1,4 @@
1
+ export { useRating } from './composables/useRating';
2
+ export type { RatingItemState } from './composables/useRating';
3
+ export type { RatingClasses, RatingColorOverrides, RatingCustomProps, RatingEmits, RatingOwnProps, RatingProps, RatingSizeOverrides, RatingSlots, } from './rating.types';
4
+ export { default as Rating } from './Rating.vue';
@@ -0,0 +1,3 @@
1
+ import { useRating as e } from "./composables/useRating.js";
2
+ import t from "./Rating.js";
3
+ export { t as Rating, e as useRating };
@@ -0,0 +1,107 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes } from 'vue';
2
+ import { RatingColor, RatingSize } from '@bridge-ui/core/Tokens';
3
+ import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
4
+ import { IconSource } from '../../Adapters/Icon';
5
+ import { BaseFieldClasses, BaseFieldCustomProps, BaseFieldOwnProps, BaseFieldSlots } from '../BaseField/baseField.types';
6
+ import { IconProps } from '../Icon';
7
+ export interface RatingSizeOverrides {}
8
+ export interface RatingColorOverrides {}
9
+ export interface RatingClasses extends BaseFieldClasses {
10
+ /**
11
+ * Classes merged onto each icon.
12
+ */
13
+ icon?: string;
14
+ /**
15
+ * Classes merged onto the hidden input.
16
+ */
17
+ input?: string;
18
+ /**
19
+ * Classes merged onto each rating item.
20
+ */
21
+ item?: string;
22
+ }
23
+ export interface RatingCustomProps extends BaseFieldCustomProps {
24
+ /**
25
+ * Props forwarded to each `Icon`. The icon source stays on `icon`.
26
+ */
27
+ icon?: Partial<Omit<IconProps, "icon">>;
28
+ /**
29
+ * Props forwarded to the hidden input.
30
+ */
31
+ input?: InputHTMLAttributes;
32
+ /**
33
+ * Props forwarded to each rating item.
34
+ */
35
+ item?: ButtonHTMLAttributes;
36
+ }
37
+ export interface RatingEmits {
38
+ /**
39
+ * Emitted when `v-model` should update. `null` clears the rating.
40
+ */
41
+ "update:modelValue": [value: null | number];
42
+ }
43
+ export interface RatingOwnProps extends Omit<BaseFieldOwnProps, "field" | "slots" | "classes" | "children" | "customProps"> {
44
+ /**
45
+ * Classes for the field chrome and the rating parts.
46
+ *
47
+ * @default undefined
48
+ */
49
+ classes?: RatingClasses;
50
+ /**
51
+ * The color applied to selected icons.
52
+ *
53
+ * @default "primary"
54
+ */
55
+ color?: MergeProps<RatingColor, RatingColorOverrides>;
56
+ /**
57
+ * Extra props for internal parts.
58
+ *
59
+ * @default undefined
60
+ */
61
+ customProps?: RatingCustomProps;
62
+ /**
63
+ * Initial value for uncontrolled usage. Fractions are kept.
64
+ *
65
+ * @default undefined
66
+ */
67
+ defaultValue?: null | number;
68
+ /**
69
+ * Icon used for every item. Semantic name `star` is the default.
70
+ *
71
+ * @default "star"
72
+ */
73
+ icon?: IconSource;
74
+ /**
75
+ * Number of items. The value runs from above 0 through `max`.
76
+ *
77
+ * @default 5
78
+ */
79
+ max?: number;
80
+ /**
81
+ * The `name` of the hidden input submitted with the form.
82
+ *
83
+ * @default undefined
84
+ */
85
+ name?: string;
86
+ /**
87
+ * Size of the icons and of the field label (`2xs` … `2xl`).
88
+ *
89
+ * @default "md"
90
+ */
91
+ size?: MergeProps<RatingSize, RatingSizeOverrides>;
92
+ /**
93
+ * Chrome slots.
94
+ *
95
+ * @default undefined
96
+ */
97
+ slots?: RatingSlots;
98
+ /**
99
+ * Increment for pointer and keyboard selection.
100
+ * `1` selects a whole item. `0.5` selects each half.
101
+ *
102
+ * @default 1
103
+ */
104
+ step?: number;
105
+ }
106
+ export interface RatingSlots extends BaseFieldSlots {}
107
+ export type RatingProps = MergeHtmlProps<RatingOwnProps, Omit<HTMLAttributes, "color" | "defaultValue">>;
@@ -2,7 +2,7 @@ import { SIDEBAR_INJECTION_KEY as e } from "../sidebarInjectionKey.js";
2
2
  import { inject as t } from "vue";
3
3
  //#region src/Components/Sidebar/composables/useSidebar.ts
4
4
  function n() {
5
- let n = t(e);
5
+ let n = t(e, null);
6
6
  if (!n) throw Error("useSidebar must be used within a SidebarProvider");
7
7
  return n;
8
8
  }
@@ -3,7 +3,7 @@ import { IconSource } from '../../../Adapters/Icon';
3
3
  export declare function useSidebarTrigger(slots: ReturnType<typeof useSlots>): {
4
4
  icon: import('vue').ComputedRef<IconSource | undefined>;
5
5
  expanded: import('vue').ComputedRef<boolean>;
6
- iconClass: import('vue').ComputedRef<"rotate-180 rtl:rotate-0" | "rtl:rotate-180">;
6
+ iconClass: import('vue').ComputedRef<"rtl:rotate-180" | "rotate-180 rtl:rotate-0">;
7
7
  ariaLabel: import('vue').ComputedRef<string>;
8
8
  handleClick: (event: MouseEvent) => void;
9
9
  hasDefaultSlot: import('vue').ComputedRef<boolean>;