@bridge-ui/vue 0.12.0 → 0.13.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 (54) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/dist/Adapters/Examples/date-moment.js +31 -31
  3. package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
  4. package/dist/Adapters/Examples/icon-fontawesome.js +23 -22
  5. package/dist/Adapters/Examples/icon-heroicons.js +46 -45
  6. package/dist/Adapters/Examples/icon-lucide.js +12 -11
  7. package/dist/Adapters/Examples/icon-phosphor.js +48 -47
  8. package/dist/Adapters/Examples/icon-tabler.js +12 -11
  9. package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
  10. package/dist/Components/BaseField/composables/useBaseField.js +7 -7
  11. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +8 -8
  12. package/dist/Components/Carousel/Carousel.js +5 -0
  13. package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
  14. package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
  15. package/dist/Components/Carousel/carousel.types.d.ts +236 -0
  16. package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
  17. package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
  18. package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
  19. package/dist/Components/Carousel/composables/useCarousel.js +331 -0
  20. package/dist/Components/Carousel/index.d.ts +4 -0
  21. package/dist/Components/Carousel/index.js +4 -0
  22. package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
  23. package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
  24. package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
  25. package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
  26. package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
  27. package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
  28. package/dist/Components/CarouselSlide/index.d.ts +3 -0
  29. package/dist/Components/CarouselSlide/index.js +3 -0
  30. package/dist/Components/FileUpload/FileUpload.vue.d.ts +22 -24
  31. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +101 -92
  32. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +66 -16
  33. package/dist/Components/FileUpload/composables/useFileUpload.js +182 -157
  34. package/dist/Components/FileUpload/fileUpload.types.d.ts +113 -23
  35. package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
  36. package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
  37. package/dist/Components/FileUpload/index.d.ts +1 -1
  38. package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
  39. package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
  40. package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
  41. package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
  42. package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
  43. package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
  44. package/dist/Components/FileUploadItem/index.d.ts +3 -0
  45. package/dist/Components/FileUploadItem/index.js +3 -0
  46. package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
  47. package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
  48. package/dist/augments.d.ts +10 -1
  49. package/dist/index.d.ts +7 -1
  50. package/dist/index.js +115 -109
  51. package/docs/README.md +1 -0
  52. package/docs/components/Carousel.md +113 -0
  53. package/docs/components/FileUpload.md +83 -8
  54. package/package.json +2 -2
@@ -26,10 +26,10 @@ function _(_, v = {
26
26
  error: !1,
27
27
  hideErrorMessage: !1
28
28
  }, y = {}) {
29
- let b = s(), x = l(), S = c(), C = a(() => h({
29
+ let b = c(), x = s(), S = l(), C = a(() => h({
30
30
  bridgeKeys: g,
31
31
  props: {
32
- ...b,
32
+ ...x,
33
33
  ...o(_)
34
34
  }
35
35
  })), w = y.componentName ?? "BaseField", { merged: T, entry: E, chromeEntry: D } = r({
@@ -40,10 +40,10 @@ function _(_, v = {
40
40
  entry: E,
41
41
  chromeEntry: D,
42
42
  props: () => C.value.componentProps
43
- }), k = a(() => T.value.customProps), A = a(() => T.value.error === !0), j = a(() => !!T.value.disabled), M = a(() => !!T.value.readonly), N = a(() => T.value.controlId ?? C.value.inheritedAttrs.id ?? S), P = a(() => {
43
+ }), k = a(() => T.value.customProps), A = a(() => T.value.error === !0), j = a(() => !!T.value.disabled), M = a(() => !!T.value.readonly), N = a(() => T.value.controlId ?? C.value.inheritedAttrs.id ?? b), P = a(() => {
44
44
  let e = w !== "BaseField", t = m(f, u(D.value, ["tokens", "size"]), e ? void 0 : u(E.value, ["tokens", "size"]));
45
45
  return u(t, T.value.size ?? "md");
46
- }), F = a(() => !T.value.hideErrorMessage && !e(x, "description", T.value.description)), I = a(() => A.value && !T.value.hideErrorMessage && e(x, "errorMessage", T.value.errorMessage)), L = a(() => e(x, "description", T.value.description) ? !I.value || T.value.showDescriptionOnError === !0 : !1), R = a(() => I.value || F.value), z = a(() => {
46
+ }), F = a(() => !T.value.hideErrorMessage && !e(S, "description", T.value.description)), I = a(() => A.value && !T.value.hideErrorMessage && e(S, "errorMessage", T.value.errorMessage)), L = a(() => e(S, "description", T.value.description) ? !I.value || T.value.showDescriptionOnError === !0 : !1), R = a(() => I.value || F.value), z = a(() => {
47
47
  let e = [];
48
48
  return L.value && e.push(`${N.value}-description`), I.value && e.push(`${N.value}-error`), e.length > 0 ? e.join(" ") : void 0;
49
49
  }), B = a(() => n(k.value?.root, {
@@ -56,8 +56,8 @@ function _(_, v = {
56
56
  [O.value.root ?? ""]: !0
57
57
  }))), V = a(() => n(k.value?.header, {}, p({
58
58
  "flex w-full gap-x-2 mb-1.5": !0,
59
- "justify-between items-end": e(x, "label", T.value.label),
60
- "justify-end": !e(x, "label", T.value.label),
59
+ "justify-between items-end": e(S, "label", T.value.label),
60
+ "justify-end": !e(S, "label", T.value.label),
61
61
  [O.value.header ?? ""]: !0
62
62
  }))), H = a(() => {
63
63
  let e = y.labelHtmlFor ?? ((e) => e);
@@ -88,7 +88,7 @@ function _(_, v = {
88
88
  [O.value.description ?? ""]: !0
89
89
  })));
90
90
  return {
91
- slots: x,
91
+ slots: S,
92
92
  merged: T,
93
93
  rootBind: B,
94
94
  errorBind: a(() => n(k.value?.errorMessage, {}, p({
@@ -50,12 +50,12 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
50
50
  "viewDateChange"
51
51
  ],
52
52
  setup(d, { emit: w }) {
53
- let T = d, E = w, { view: D, value: O, merged: k, shared: A, showNav: j, rootBind: M, viewDate: N, viewYear: P, bodyBind: F, viewMonth: I, yearLabel: L, monthLabel: R, headerBind: z, navIconBind: B, setViewDate: V, granularity: H, handleChange: U, yearPageSize: W, yearPageStart: G, nextButtonBind: K, todayButtonBind: q, yearSelectorBind: J, handleYearSelect: Y, showYearSelector: X, monthSelectorBind: Z, handleMonthSelect: Q, showMonthSelector: te, previousButtonBind: ne } = t(T, {
53
+ let T = w, E = d, { view: D, value: O, merged: k, shared: A, showNav: j, rootBind: M, viewDate: N, viewYear: P, bodyBind: F, viewMonth: I, yearLabel: L, monthLabel: R, headerBind: z, navIconBind: B, setViewDate: V, granularity: H, handleChange: U, yearPageSize: W, yearPageStart: G, nextButtonBind: K, todayButtonBind: q, yearSelectorBind: J, handleYearSelect: Y, showYearSelector: X, monthSelectorBind: Z, handleMonthSelect: Q, showMonthSelector: te, previousButtonBind: ne } = t(E, {
54
54
  rounded: "md",
55
55
  startOfWeek: 0,
56
56
  color: "primary",
57
57
  defaultView: "date"
58
- }, E);
58
+ }, T);
59
59
  function $(e) {
60
60
  let t = _(B)?.class;
61
61
  return x({
@@ -86,7 +86,7 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
86
86
  "view-date": v(N),
87
87
  onChange: v(U),
88
88
  multiple: v(k).multiple,
89
- "preview-date": T.previewDate,
89
+ "preview-date": E.previewDate,
90
90
  onViewDateChange: v(V),
91
91
  "start-of-week": v(k).startOfWeek,
92
92
  "disable-dates": v(k).disableDates,
@@ -94,7 +94,7 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
94
94
  "hide-weekdays": v(k).hideWeekdays,
95
95
  "disable-months": v(k).disableMonths,
96
96
  "hide-outside-days": v(k).hideOutsideDays,
97
- onPreviewDateChange: d[0] ||= (e) => E("previewDateChange", e)
97
+ onPreviewDateChange: d[0] ||= (e) => T("previewDateChange", e)
98
98
  }), {
99
99
  day: y((e) => [ee(t.$slots, "day", m(f(e)), () => [l(g(e.label), 1)])]),
100
100
  _: 3
@@ -118,12 +118,12 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
118
118
  range: v(k).range,
119
119
  multiple: v(k).multiple,
120
120
  onChange: v(Q),
121
- "preview-date": T.previewDate,
121
+ "preview-date": E.previewDate,
122
122
  "disable-dates": v(k).disableDates,
123
123
  "disable-years": v(k).disableYears,
124
124
  "disable-months": v(k).disableMonths,
125
125
  selection: v(H) === "month" ? v(O) : void 0,
126
- onPreviewDateChange: d[1] ||= (e) => E("previewDateChange", e)
126
+ onPreviewDateChange: d[1] ||= (e) => T("previewDateChange", e)
127
127
  }), null, 16, [
128
128
  "year",
129
129
  "value",
@@ -142,11 +142,11 @@ var S = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
142
142
  "start-year": v(G),
143
143
  multiple: v(k).multiple,
144
144
  onChange: v(Y),
145
- "preview-date": T.previewDate,
145
+ "preview-date": E.previewDate,
146
146
  "disable-dates": v(k).disableDates,
147
147
  "disable-years": v(k).disableYears,
148
148
  selection: v(H) === "year" ? v(O) : void 0,
149
- onPreviewDateChange: d[2] ||= (e) => E("previewDateChange", e)
149
+ onPreviewDateChange: d[2] ||= (e) => T("previewDateChange", e)
150
150
  }), null, 16, [
151
151
  "value",
152
152
  "range",
@@ -0,0 +1,5 @@
1
+ import e from "./Carousel.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/Carousel/Carousel.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,22 @@
1
+ import { CarouselOwnProps, CarouselSlots } from './carousel.types';
2
+ type __VLS_Slots = CarouselSlots;
3
+ type __VLS_Props = CarouselOwnProps;
4
+ type __VLS_ModelProps = {
5
+ "index"?: number;
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:index": (value: number | undefined) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ "onUpdate:index"?: ((value: number | undefined) => any) | undefined;
12
+ }>, {
13
+ indicators: boolean;
14
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,49 @@
1
+ import e from "../Icon/Icon.js";
2
+ import { useCarousel as t } from "./composables/useCarousel.js";
3
+ import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeProps as f, openBlock as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, useModel as v } from "vue";
4
+ //#region src/Components/Carousel/Carousel.vue?vue&type=script&setup=true&lang.ts
5
+ var y = /*@__PURE__*/ s({
6
+ inheritAttrs: !1,
7
+ __name: "Carousel",
8
+ props: /*@__PURE__*/ l({
9
+ autoPlay: { type: [Number, Boolean] },
10
+ classes: {},
11
+ customProps: {},
12
+ defaultIndex: {},
13
+ gap: {},
14
+ indicators: {
15
+ type: Boolean,
16
+ default: !0
17
+ },
18
+ loop: { type: Boolean },
19
+ orientation: {},
20
+ size: {},
21
+ slidesPerView: {}
22
+ }, {
23
+ index: {},
24
+ indexModifiers: {}
25
+ }),
26
+ emits: ["update:index"],
27
+ setup(s) {
28
+ let l = s, y = v(s, "index"), { liveBind: b, nextBind: x, prevBind: S, rootBind: C, nextIcon: w, prevIcon: T, trackBind: E, activeIndex: D, controlsBind: O, nextIconBind: k, prevIconBind: A, showControls: j, viewportBind: M, announcement: N, frameClassName: P, indicatorsBind: F, showIndicators: I, getIndicatorBind: L, indicatorIndexes: R } = t(l, {
29
+ gap: 0,
30
+ size: "md",
31
+ loop: !1,
32
+ autoPlay: !1,
33
+ defaultIndex: 0,
34
+ indicators: !0,
35
+ slidesPerView: 1,
36
+ orientation: "horizontal"
37
+ }, y);
38
+ return (t, s) => (p(), i("section", f(c(_(C))), [
39
+ a("div", { class: d(_(P)) }, [a("div", f(c(_(M))), [a("div", f(c(_(E))), [h(t.$slots, "default")], 16)], 16), _(j) ? (p(), i("div", f(u({ key: 0 }, _(O))), [a("button", f(c(_(S))), [h(t.$slots, "prev", {}, () => [o(_(e), u({ icon: _(T) }, _(A)), null, 16, ["icon"])])], 16), a("button", f(c(_(x))), [h(t.$slots, "next", {}, () => [o(_(e), u({ icon: _(w) }, _(k)), null, 16, ["icon"])])], 16)], 16)) : r("", !0)], 2),
40
+ _(I) ? (p(), i("div", f(u({ key: 0 }, _(F))), [(p(!0), i(n, null, m(_(R), (e) => (p(), i("button", u({ key: e }, { ref_for: !0 }, _(L)(e)), [h(t.$slots, "indicator", {
41
+ index: e,
42
+ selected: e === _(D)
43
+ })], 16))), 128))], 16)) : r("", !0),
44
+ a("div", f(c(_(b))), g(_(N)), 17)
45
+ ], 16));
46
+ }
47
+ });
48
+ //#endregion
49
+ export { y as default };
@@ -0,0 +1,236 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, Slot } from 'vue';
2
+ import { CarouselOrientation } from '@bridge-ui/core/Domain';
3
+ import { CarouselSize } from '@bridge-ui/core/Tokens';
4
+ import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
5
+ import { IconProps } from '../Icon';
6
+ export interface CarouselSizeOverrides {}
7
+ export interface CarouselClasses {
8
+ /**
9
+ * Classes merged onto previous/next buttons.
10
+ */
11
+ control?: string;
12
+ /**
13
+ * Classes merged onto the previous and next control group.
14
+ */
15
+ controls?: string;
16
+ /**
17
+ * Classes merged onto each indicator button.
18
+ */
19
+ indicator?: string;
20
+ /**
21
+ * Classes merged onto the indicator group.
22
+ */
23
+ indicators?: string;
24
+ /**
25
+ * Classes merged onto the live region.
26
+ */
27
+ live?: string;
28
+ /**
29
+ * Classes merged onto the next button.
30
+ */
31
+ next?: string;
32
+ /**
33
+ * Classes merged onto the previous button.
34
+ */
35
+ prev?: string;
36
+ /**
37
+ * Classes merged onto the region root.
38
+ */
39
+ root?: string;
40
+ /**
41
+ * Classes merged onto each slide.
42
+ */
43
+ slide?: string;
44
+ /**
45
+ * Classes merged onto the track.
46
+ */
47
+ track?: string;
48
+ /**
49
+ * Classes merged onto the viewport.
50
+ */
51
+ viewport?: string;
52
+ }
53
+ export interface CarouselCustomProps {
54
+ /**
55
+ * Props forwarded to the previous and next control group.
56
+ *
57
+ * @default undefined
58
+ */
59
+ controls?: HTMLAttributes;
60
+ /**
61
+ * Props forwarded to each indicator button.
62
+ *
63
+ * @default undefined
64
+ */
65
+ indicator?: ButtonHTMLAttributes;
66
+ /**
67
+ * Props forwarded to the indicator group.
68
+ *
69
+ * @default undefined
70
+ */
71
+ indicators?: HTMLAttributes;
72
+ /**
73
+ * Props forwarded to the live region.
74
+ *
75
+ * @default undefined
76
+ */
77
+ live?: HTMLAttributes;
78
+ /**
79
+ * Props forwarded to the next button.
80
+ *
81
+ * @default undefined
82
+ */
83
+ next?: ButtonHTMLAttributes;
84
+ /**
85
+ * Props forwarded to the next `Icon`.
86
+ *
87
+ * @default undefined
88
+ */
89
+ nextIcon?: Partial<Omit<IconProps, "icon">>;
90
+ /**
91
+ * Props forwarded to the previous button.
92
+ *
93
+ * @default undefined
94
+ */
95
+ prev?: ButtonHTMLAttributes;
96
+ /**
97
+ * Props forwarded to the previous `Icon`.
98
+ *
99
+ * @default undefined
100
+ */
101
+ prevIcon?: Partial<Omit<IconProps, "icon">>;
102
+ /**
103
+ * Props forwarded to the region root.
104
+ *
105
+ * @default undefined
106
+ */
107
+ root?: HTMLAttributes;
108
+ /**
109
+ * Props forwarded to each `CarouselSlide`.
110
+ *
111
+ * @default undefined
112
+ */
113
+ slide?: HTMLAttributes;
114
+ /**
115
+ * Props forwarded to the track.
116
+ *
117
+ * @default undefined
118
+ */
119
+ track?: HTMLAttributes;
120
+ /**
121
+ * Props forwarded to the viewport.
122
+ *
123
+ * @default undefined
124
+ */
125
+ viewport?: HTMLAttributes;
126
+ }
127
+ export interface CarouselEmits {
128
+ /**
129
+ * Emitted when the active slide changes (`v-model:index`).
130
+ */
131
+ "update:index": [index: number];
132
+ }
133
+ /**
134
+ * State passed to the indicator slot.
135
+ */
136
+ export interface CarouselIndicatorState {
137
+ /**
138
+ * 0-based snap index.
139
+ */
140
+ index: number;
141
+ /**
142
+ * Whether this indicator is the active snap.
143
+ */
144
+ selected: boolean;
145
+ }
146
+ /**
147
+ * Slideshow region. Compose with `CarouselSlide`.
148
+ */
149
+ export interface CarouselOwnProps {
150
+ /**
151
+ * Auto-advance. `true` uses a 5s interval; a number is the interval in ms.
152
+ *
153
+ * @default false
154
+ */
155
+ autoPlay?: number | boolean;
156
+ /**
157
+ * Classes for carousel parts.
158
+ *
159
+ * @default undefined
160
+ */
161
+ classes?: CarouselClasses;
162
+ /**
163
+ * Extra props for internal parts.
164
+ *
165
+ * @default undefined
166
+ */
167
+ customProps?: CarouselCustomProps;
168
+ /**
169
+ * Initial slide when uncontrolled.
170
+ *
171
+ * @default 0
172
+ */
173
+ defaultIndex?: number;
174
+ /**
175
+ * Space between slides, in px. Padding sits on the slide so the snap
176
+ * distance stays even.
177
+ *
178
+ * @default 0
179
+ */
180
+ gap?: number;
181
+ /**
182
+ * Show dot indicators.
183
+ *
184
+ * @default true
185
+ */
186
+ indicators?: boolean;
187
+ /**
188
+ * Wrap from the last slide to the first and back.
189
+ *
190
+ * @default false
191
+ */
192
+ loop?: boolean;
193
+ /**
194
+ * Scroll axis. Vertical carousels use up/down keys and a vertical swipe.
195
+ *
196
+ * @default "horizontal"
197
+ */
198
+ orientation?: CarouselOrientation;
199
+ /**
200
+ * Control and indicator scale.
201
+ *
202
+ * @default "md"
203
+ */
204
+ size?: MergeProps<CarouselSize, CarouselSizeOverrides>;
205
+ /**
206
+ * How many slides fit in the viewport. `1` shows one slide. A larger
207
+ * number, including fractions, reveals the next slide.
208
+ *
209
+ * @default 1
210
+ */
211
+ slidesPerView?: number;
212
+ }
213
+ export interface CarouselSlots {
214
+ /**
215
+ * Slide elements (`CarouselSlide`).
216
+ */
217
+ default?: Slot<undefined>;
218
+ /**
219
+ * Custom indicator content. The button chrome stays in place.
220
+ */
221
+ indicator?: Slot<CarouselIndicatorState>;
222
+ /**
223
+ * Custom next control content (default chevron icon).
224
+ */
225
+ next?: Slot<undefined>;
226
+ /**
227
+ * Custom previous control content (default chevron icon).
228
+ */
229
+ prev?: Slot<undefined>;
230
+ }
231
+ export type CarouselProps = MergeHtmlProps<CarouselOwnProps, HTMLAttributes> & {
232
+ /**
233
+ * Bound with `v-model:index`.
234
+ */
235
+ index?: number;
236
+ };
@@ -0,0 +1,48 @@
1
+ import { ComputedRef, HTMLAttributes, InjectionKey } from 'vue';
2
+ import { CarouselSizeItem } from '@bridge-ui/core/Tokens';
3
+ /**
4
+ * Shared carousel state for `CarouselSlide` descendants.
5
+ */
6
+ export type CarouselContextValue = {
7
+ /**
8
+ * Bound 0-based active index.
9
+ */
10
+ activeIndex: number;
11
+ /**
12
+ * Resolves a registered slide's 0-based index.
13
+ */
14
+ getIndex: (id: string) => number;
15
+ /**
16
+ * Stable id prefix for slide elements.
17
+ */
18
+ id: string;
19
+ /**
20
+ * Registers a slide id and returns unregister.
21
+ */
22
+ registerSlide: (id: string) => () => void;
23
+ /**
24
+ * Size class map.
25
+ */
26
+ sizeItem: undefined | CarouselSizeItem;
27
+ /**
28
+ * Classes from the carousel `classes.slide` part.
29
+ */
30
+ slideClassName: string;
31
+ /**
32
+ * Number of registered slides.
33
+ */
34
+ slideCount: number;
35
+ /**
36
+ * Props forwarded from `customProps.slide`.
37
+ */
38
+ slidePartProps: undefined | HTMLAttributes;
39
+ /**
40
+ * How many slides fit in the viewport.
41
+ */
42
+ slidesPerView: number;
43
+ /**
44
+ * Inline size for each slide (basis and gap padding).
45
+ */
46
+ slideStyle: Record<string, string>;
47
+ };
48
+ export declare const CAROUSEL_INJECTION_KEY: InjectionKey<ComputedRef<CarouselContextValue>>;
@@ -0,0 +1,4 @@
1
+ //#region src/Components/Carousel/carouselInjectionKey.ts
2
+ var e = Symbol("bridge-carousel");
3
+ //#endregion
4
+ export { e as CAROUSEL_INJECTION_KEY };
@@ -0,0 +1,91 @@
1
+ import { Ref } from 'vue';
2
+ import { IconSize } from '@bridge-ui/core/Tokens';
3
+ import { LibDefaultsShape } from '@bridge-ui/core/Utils';
4
+ import { CarouselOwnProps, CarouselProps } from '../carousel.types';
5
+ type CarouselLibDefaults = LibDefaultsShape<CarouselOwnProps, "gap" | "loop" | "size" | "autoPlay" | "indicators" | "orientation" | "defaultIndex" | "slidesPerView">;
6
+ export declare function useCarousel(props: CarouselOwnProps, libDefaults: CarouselLibDefaults, model: Ref<number | undefined>): {
7
+ go: (direction: 1 | -1) => void;
8
+ liveBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
9
+ "aria-atomic": boolean;
10
+ "data-part": string;
11
+ "aria-live": "polite";
12
+ class: string;
13
+ }, "class", import('vue').HTMLAttributes | undefined, {}>>;
14
+ nextBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
15
+ "data-part": string;
16
+ type: "button";
17
+ disabled: boolean;
18
+ "aria-label": string;
19
+ onClick: () => void;
20
+ class: string;
21
+ }, "class", import('vue').ButtonHTMLAttributes | undefined, {}>>;
22
+ nextIcon: import('vue').ComputedRef<"chevronDown" | "chevronRight">;
23
+ prevBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
24
+ "data-part": string;
25
+ type: "button";
26
+ disabled: boolean;
27
+ onClick: () => void;
28
+ "aria-label": string;
29
+ class: string;
30
+ }, "class", import('vue').ButtonHTMLAttributes | undefined, {}>>;
31
+ prevIcon: import('vue').ComputedRef<"chevronUp" | "chevronLeft">;
32
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
33
+ role: string;
34
+ "aria-roledescription": string;
35
+ "data-orientation": NonNullable<import('@bridge-ui/core/Domain').CarouselOrientation | undefined>;
36
+ onFocus: (event: FocusEvent) => void;
37
+ onMouseenter: (event: MouseEvent) => void;
38
+ onMouseleave: (event: MouseEvent) => void;
39
+ "aria-label": string;
40
+ class: string;
41
+ onBlur: (event: FocusEvent) => void;
42
+ onKeydown: (event: KeyboardEvent) => void;
43
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<CarouselProps, "orientation" | "size" | "classes" | "customProps" | "autoPlay" | "defaultIndex" | "gap" | "indicators" | "loop" | "slidesPerView">, "onFocus" | "onBlur" | "onKeydown" | "onMouseenter" | "onMouseleave">>>;
44
+ trackBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
45
+ "data-part": string;
46
+ class: string;
47
+ style: Record<string, string>;
48
+ }, "class", import('vue').HTMLAttributes | undefined, {}>>;
49
+ activeIndex: import('vue').ComputedRef<number>;
50
+ controlsBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
51
+ "data-part": string;
52
+ class: string;
53
+ }, "class", import('vue').HTMLAttributes | undefined, {}>>;
54
+ nextIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
55
+ "aria-hidden": boolean;
56
+ size: keyof IconSize;
57
+ class: string | undefined;
58
+ }, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
59
+ prevIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
60
+ "aria-hidden": boolean;
61
+ size: keyof IconSize;
62
+ class: string | undefined;
63
+ }, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
64
+ showControls: import('vue').ComputedRef<boolean>;
65
+ viewportBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
66
+ "data-part": string;
67
+ onPointercancel: (event: PointerEvent) => void;
68
+ class: string;
69
+ onPointerdown: (event: PointerEvent) => void;
70
+ onPointerup: (event: PointerEvent) => void;
71
+ }, "class", Omit<import('vue').HTMLAttributes, "onPointerdown" | "onPointerup" | "onPointercancel">, {}>>;
72
+ announcement: Ref<string, string>;
73
+ frameClassName: import('vue').ComputedRef<string>;
74
+ indicatorsBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
75
+ role: string;
76
+ "data-part": string;
77
+ "aria-label": string;
78
+ class: string;
79
+ }, "class", import('vue').HTMLAttributes | undefined, {}>>;
80
+ showIndicators: import('vue').ComputedRef<boolean>;
81
+ getIndicatorBind: (index: number) => import('@bridge-ui/core/Utils').MergePartBind<{
82
+ type: "button";
83
+ "data-part": string;
84
+ "aria-current": "true" | undefined;
85
+ onClick: () => void;
86
+ "aria-label": string;
87
+ class: string;
88
+ }, "class", import('vue').ButtonHTMLAttributes | undefined, {}>;
89
+ indicatorIndexes: import('vue').ComputedRef<number[]>;
90
+ };
91
+ export {};