@bcc-code/component-library-vue 1.3.23 → 1.3.24

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.
package/dist/theme.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /* Layer order: Tailwind base/utilities first, then PrimeVue so component styles win */
2
- @layer theme, base, tailwind, primevue;
2
+ @layer theme, base, component, library-utilities, utilities, primevue;
3
3
  @import '@bcc-code/design-tokens/css';
4
4
 
5
5
  @import 'tailwindcss';
@@ -23,201 +23,36 @@
23
23
  --spacing-18: 4.5rem;
24
24
  }
25
25
 
26
- .ctx-default {
27
- @apply ctx-default;
28
- }
29
- .ctx-success {
30
- @apply ctx-success-subtlest;
31
- }
32
- .ctx-danger {
33
- @apply ctx-danger-subtlest;
34
- }
35
- .ctx-warning {
36
- @apply ctx-warning-subtlest;
37
- }
38
- .ctx-info {
39
- @apply ctx-info-subtlest;
40
- }
26
+ /*
27
+ * Force-emit ctx-* utilities that components construct dynamically (e.g.
28
+ * `:class="\`ctx-${context}\`"` in BccBadge, BccStepIndicator, BccCapacityIndicator).
29
+ * Tailwind cannot see those class names by scanning source, so without this list
30
+ * they would never be emitted into the utilities layer.
31
+ *
32
+ * Source of truth: the @utility ctx-* definitions in ./contexts.css (auto-generated
33
+ * by `pnpm run generate:context-css`). Keep this list in sync with that file.
34
+ */
35
+ @source inline("ctx-default ctx-{blue,brown,gray,green,magenta,orange,purple,red,teal,yellow}-{bolder,subtle,subtler,subtlest} ctx-{danger,info,success,warning}-{bolder,subtlest} ctx-brand-{bold,bolder,boldest,default,subtle,subtler,subtlest} ctx-neutral-{bold,bolder,boldest,subtle,subtler,subtlest}");
41
36
 
42
- .ctx-blue-bolder {
43
- @apply ctx-blue-bolder;
44
- }
45
- .ctx-blue-subtle {
46
- @apply ctx-blue-subtle;
47
- }
48
- .ctx-blue-subtler {
49
- @apply ctx-blue-subtler;
50
- }
51
- .ctx-blue-subtlest {
52
- @apply ctx-blue-subtlest;
53
- }
54
- .ctx-brand-boldest {
55
- @apply ctx-brand-boldest;
56
- }
57
- .ctx-brand-bolder {
58
- @apply ctx-brand-bolder;
59
- }
60
- .ctx-brand-bold {
61
- @apply ctx-brand-bold;
62
- }
63
- .ctx-brand-subtle {
64
- @apply ctx-brand-subtle;
65
- }
66
- .ctx-brand-subtler {
67
- @apply ctx-brand-subtler;
68
- }
69
- .ctx-brand-subtlest {
70
- @apply ctx-brand-subtlest;
71
- }
72
- .ctx-brown-bolder {
73
- @apply ctx-brown-bolder;
74
- }
75
- .ctx-brown-subtle {
76
- @apply ctx-brown-subtle;
77
- }
78
- .ctx-brown-subtler {
79
- @apply ctx-brown-subtler;
80
- }
81
- .ctx-brown-subtlest {
82
- @apply ctx-brown-subtlest;
83
- }
84
- .ctx-danger-subtlest {
85
- @apply ctx-danger;
86
- }
87
- .ctx-danger-bolder {
88
- @apply ctx-danger-bolder;
89
- }
90
- .ctx-gray-bolder {
91
- @apply ctx-gray-bolder;
92
- }
93
- .ctx-gray-subtle {
94
- @apply ctx-gray-subtle;
95
- }
96
- .ctx-gray-subtler {
97
- @apply ctx-gray-subtler;
98
- }
99
- .ctx-gray-subtlest {
100
- @apply ctx-gray-subtlest;
101
- }
102
- .ctx-green-bolder {
103
- @apply ctx-green-bolder;
104
- }
105
- .ctx-green-subtle {
106
- @apply ctx-green-subtle;
107
- }
108
- .ctx-green-subtler {
109
- @apply ctx-green-subtler;
110
- }
111
- .ctx-green-subtlest {
112
- @apply ctx-green-subtlest;
113
- }
114
- .ctx-info-subtlest {
115
- @apply ctx-info;
116
- }
117
- .ctx-info-bolder {
118
- @apply ctx-info-bolder;
119
- }
120
- .ctx-magenta-bolder {
121
- @apply ctx-magenta-bolder;
122
- }
123
- .ctx-magenta-subtle {
124
- @apply ctx-magenta-subtle;
125
- }
126
- .ctx-magenta-subtler {
127
- @apply ctx-magenta-subtler;
128
- }
129
- .ctx-magenta-subtlest {
130
- @apply ctx-magenta-subtlest;
131
- }
132
- .ctx-neutral-boldest {
133
- @apply ctx-neutral-boldest;
134
- }
135
- .ctx-neutral-bolder {
136
- @apply ctx-neutral-bolder;
137
- }
138
- .ctx-neutral-bold {
139
- @apply ctx-neutral-bold;
140
- }
141
- .ctx-neutral-subtle {
142
- @apply ctx-neutral-subtle;
143
- }
144
- .ctx-neutral-subtler {
145
- @apply ctx-neutral-subtler;
146
- }
147
- .ctx-neutral-subtlest {
148
- @apply ctx-neutral-subtlest;
149
- }
150
- .ctx-orange-bolder {
151
- @apply ctx-orange-bolder;
152
- }
153
- .ctx-orange-subtle {
154
- @apply ctx-orange-subtle;
155
- }
156
- .ctx-orange-subtler {
157
- @apply ctx-orange-subtler;
158
- }
159
- .ctx-orange-subtlest {
160
- @apply ctx-orange-subtlest;
161
- }
162
- .ctx-purple-bolder {
163
- @apply ctx-purple-bolder;
164
- }
165
- .ctx-purple-subtle {
166
- @apply ctx-purple-subtle;
167
- }
168
- .ctx-purple-subtler {
169
- @apply ctx-purple-subtler;
170
- }
171
- .ctx-purple-subtlest {
172
- @apply ctx-purple-subtlest;
173
- }
174
- .ctx-red-bolder {
175
- @apply ctx-red-bolder;
176
- }
177
- .ctx-red-subtle {
178
- @apply ctx-red-subtle;
179
- }
180
- .ctx-red-subtler {
181
- @apply ctx-red-subtler;
182
- }
183
- .ctx-red-subtlest {
184
- @apply ctx-red-subtlest;
185
- }
186
- .ctx-success-subtlest {
187
- @apply ctx-success;
188
- }
189
- .ctx-success-bolder {
190
- @apply ctx-success-bolder;
191
- }
192
- .ctx-teal-bolder {
193
- @apply ctx-teal-bolder;
194
- }
195
- .ctx-teal-subtle {
196
- @apply ctx-teal-subtle;
197
- }
198
- .ctx-teal-subtler {
199
- @apply ctx-teal-subtler;
200
- }
201
- .ctx-teal-subtlest {
202
- @apply ctx-teal-subtlest;
203
- }
204
- .ctx-warning-subtlest {
205
- @apply ctx-warning;
206
- }
207
- .ctx-warning-bolder {
208
- @apply ctx-warning-bolder;
209
- }
210
- .ctx-yellow-bolder {
211
- @apply ctx-yellow-bolder;
212
- }
213
- .ctx-yellow-subtle {
214
- @apply ctx-yellow-subtle;
215
- }
216
- .ctx-yellow-subtler {
217
- @apply ctx-yellow-subtler;
218
- }
219
- .ctx-yellow-subtlest {
220
- @apply ctx-yellow-subtlest;
37
+ /*
38
+ * Aliases for semantic context names. Plain @apply wrappers are kept because
39
+ * `.ctx-success` etc. are aliases (point at -subtlest variants), not standalone
40
+ * @utility definitions. Wrapped in @layer utilities so they participate in the
41
+ * cascade alongside other utilities.
42
+ */
43
+ @layer utilities {
44
+ .ctx-success {
45
+ @apply ctx-success-subtlest;
46
+ }
47
+ .ctx-danger {
48
+ @apply ctx-danger-subtlest;
49
+ }
50
+ .ctx-warning {
51
+ @apply ctx-warning-subtlest;
52
+ }
53
+ .ctx-info {
54
+ @apply ctx-info-subtlest;
55
+ }
221
56
  }
222
57
 
223
58
 
@@ -1963,6 +1798,84 @@
1963
1798
 
1964
1799
 
1965
1800
 
1801
+ /* === ./lightbox/BccLightbox.css === */
1802
+ @layer components {
1803
+ .bcc-lightbox {
1804
+ @apply fixed inset-0 z-9999 flex touch-none items-center justify-center;
1805
+ }
1806
+
1807
+ .bcc-lightbox__backdrop {
1808
+ @apply absolute inset-0 bg-black/75;
1809
+ }
1810
+
1811
+ .bcc-lightbox__header {
1812
+ @apply top-inset-top pointer-events-none absolute inset-x-0 z-20 flex items-center justify-end gap-3 p-3;
1813
+ }
1814
+
1815
+ .bcc-lightbox__counter {
1816
+ @apply body-sm pointer-events-none mr-auto rounded-md bg-black/50 px-2.5 py-1 text-white;
1817
+ }
1818
+
1819
+ .bcc-lightbox__control {
1820
+ @apply pointer-events-auto flex cursor-pointer items-center justify-center rounded-md border-0 bg-black/50 p-2 text-white transition-colors hover:bg-black/65;
1821
+ }
1822
+
1823
+ .bcc-lightbox__icon {
1824
+ @apply size-6 shrink-0;
1825
+ }
1826
+
1827
+ .bcc-lightbox__nav {
1828
+ @apply absolute top-1/2 z-20 -translate-y-1/2;
1829
+ }
1830
+
1831
+ .bcc-lightbox__nav--prev {
1832
+ @apply left-1 sm:left-3;
1833
+ }
1834
+
1835
+ .bcc-lightbox__nav--next {
1836
+ @apply right-1 sm:right-3;
1837
+ }
1838
+
1839
+ .bcc-lightbox__stage {
1840
+ @apply relative z-10 box-border flex h-full w-full max-w-6xl items-center justify-center px-2 py-14 sm:px-12;
1841
+ }
1842
+
1843
+ .bcc-lightbox__toolbar {
1844
+ @apply center bottom-inset-bottom-4 pointer-events-none absolute z-20 flex gap-1 rounded-md bg-black/50 p-1;
1845
+ }
1846
+
1847
+ .bcc-lightbox__toolbar-btn {
1848
+ @apply pointer-events-auto flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent px-3 py-2 text-white transition-colors hover:bg-white/12;
1849
+ }
1850
+
1851
+ .bcc-lightbox__media {
1852
+ @apply flex max-h-[calc(100vh-7rem)] w-full touch-none flex-col items-center justify-center;
1853
+ }
1854
+
1855
+ .bcc-lightbox__media--zoomable {
1856
+ @apply cursor-grab active:cursor-grabbing;
1857
+ }
1858
+
1859
+ .bcc-lightbox__transform {
1860
+ @apply flex origin-center items-center justify-center will-change-transform;
1861
+ }
1862
+
1863
+ .bcc-lightbox__image,
1864
+ .bcc-lightbox__video {
1865
+ @apply block h-auto max-h-[calc(100vh-8rem)] w-auto max-w-[min(92vw,68rem)] object-contain select-none;
1866
+ }
1867
+
1868
+ .bcc-lightbox__video {
1869
+ @apply bg-black;
1870
+ }
1871
+
1872
+ .bcc-lightbox__caption {
1873
+ @apply body-sm mt-3 max-w-[min(92vw,40rem)] text-center text-white;
1874
+ }
1875
+ }
1876
+
1877
+
1878
+
1966
1879
  /* === ./components/custom/styles.css === */
1967
1880
 
1968
1881
  /* from ./BccAppNavigation/BccAppNavigation.css */
@@ -2246,6 +2159,42 @@
2246
2159
 
2247
2160
 
2248
2161
 
2162
+ /* from ./BccImage/BccImage.css */
2163
+ @layer components {
2164
+ .bcc-image {
2165
+ @apply relative inline-block leading-none;
2166
+ }
2167
+
2168
+ .bcc-image__img {
2169
+ @apply block max-w-full align-middle;
2170
+ }
2171
+
2172
+ .bcc-image--preview {
2173
+ @apply cursor-zoom-in;
2174
+ }
2175
+
2176
+ .bcc-image__preview-mask {
2177
+ @apply absolute inset-0 m-0 flex cursor-pointer items-center justify-center border-0 bg-black/40 p-0 opacity-0 transition-opacity;
2178
+ }
2179
+
2180
+ .bcc-image--preview:hover .bcc-image__preview-mask,
2181
+ .bcc-image--preview:focus-within .bcc-image__preview-mask {
2182
+ @apply opacity-100;
2183
+ }
2184
+
2185
+ .bcc-image__preview-icon {
2186
+ @apply size-6 text-white;
2187
+ }
2188
+
2189
+ @media (width < 750px) {
2190
+ .bcc-image--preview .bcc-image__preview-mask {
2191
+ @apply opacity-100;
2192
+ }
2193
+ }
2194
+ }
2195
+
2196
+
2197
+
2249
2198
  /* from ./BccNpsResult/BccNpsResult.css */
2250
2199
  @layer components {
2251
2200
  .bcc-nps-result {
@@ -2608,22 +2557,24 @@
2608
2557
  font-kerning: normal;
2609
2558
  }
2610
2559
 
2611
- hr {
2612
- border-color: var(--color-border-default);
2613
- }
2560
+ @layer base {
2561
+ hr {
2562
+ border-color: var(--color-border-default);
2563
+ }
2614
2564
 
2615
- b,
2616
- strong,
2617
- .bold {
2618
- font-weight: bold;
2619
- --ctx-text: var(--ctx-text-bold);
2620
- }
2565
+ b,
2566
+ strong,
2567
+ .bold {
2568
+ font-weight: bold;
2569
+ --ctx-text: var(--ctx-text-bold);
2570
+ }
2621
2571
 
2622
- /* Disable state */
2623
- :disabled,
2624
- .disabled {
2625
- cursor: not-allowed;
2626
- pointer-events: none;
2572
+ /* Disable state */
2573
+ :disabled,
2574
+ .disabled {
2575
+ cursor: not-allowed;
2576
+ pointer-events: none;
2577
+ }
2627
2578
  }
2628
2579
 
2629
2580
 
@@ -0,0 +1,54 @@
1
+ import { type StyleValue } from 'vue';
2
+ import type { LightboxItemInput } from '../../../lightbox/types';
3
+ export type { LightboxItem, LightboxItemInput, LightboxMediaType } from '../../../lightbox/types';
4
+ export type ImageProps = {
5
+ /** Image URL for the thumbnail and lightbox (when `imgs` is not set). */
6
+ src?: string;
7
+ /** Enables click-to-preview in the global lightbox. */
8
+ preview?: boolean;
9
+ /** Inline style applied to the thumbnail `<img>`. */
10
+ imageStyle?: StyleValue;
11
+ /** Class applied to the thumbnail `<img>`. */
12
+ imageClass?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
13
+ /** Gallery items for the lightbox. Falls back to `src` when omitted. */
14
+ imgs?: LightboxItemInput[];
15
+ /** Index of the item shown when the lightbox opens. */
16
+ index?: number;
17
+ /** Allow looping when navigating a gallery. */
18
+ loop?: boolean;
19
+ /** Close the lightbox when clicking the backdrop. */
20
+ maskClosable?: boolean;
21
+ /** Accessible label for the preview trigger button. */
22
+ previewAriaLabel?: string;
23
+ };
24
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
25
+ type __VLS_Slots = {} & {
26
+ image?: (props: typeof __VLS_1) => any;
27
+ } & {
28
+ previewicon?: (props: typeof __VLS_3) => any;
29
+ } & {
30
+ indicatoricon?: (props: typeof __VLS_5) => any;
31
+ };
32
+ declare const __VLS_base: import("vue").DefineComponent<ImageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
+ error: (event: Event) => any;
34
+ show: () => any;
35
+ hide: () => any;
36
+ }, string, import("vue").PublicProps, Readonly<ImageProps> & Readonly<{
37
+ onError?: ((event: Event) => any) | undefined;
38
+ onShow?: (() => any) | undefined;
39
+ onHide?: (() => any) | undefined;
40
+ }>, {
41
+ index: number;
42
+ loop: boolean;
43
+ maskClosable: boolean;
44
+ preview: boolean;
45
+ previewAriaLabel: string;
46
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
48
+ declare const _default: typeof __VLS_export;
49
+ export default _default;
50
+ type __VLS_WithSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -25,12 +25,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
25
25
  "onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
26
26
  }>, {
27
27
  reverse: boolean;
28
+ disabled: boolean;
28
29
  min: number;
29
30
  max: number;
30
31
  leftLabel: string;
31
32
  rightLabel: string;
32
33
  labelPosition: "top" | "bottom";
33
- disabled: boolean;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;
36
36
  export default _default;
@@ -8,6 +8,7 @@ export { default as BccCapacityIndicator } from './BccCapacityIndicator/BccCapac
8
8
  export { default as BccDialKnob } from './BccDialKnob/BccDialKnob.vue';
9
9
  export { default as BccFrame } from './BccFrame/BccFrame.vue';
10
10
  export { default as BccGraphic } from './BccGraphic/BccGraphic.vue';
11
+ export { default as BccImage } from './BccImage/BccImage.vue';
11
12
  export { default as BccNpsResult } from './BccNpsResult/BccNpsResult.vue';
12
13
  export { default as BccNpsScore } from './BccNpsScore/BccNpsScore.vue';
13
14
  export { default as BccReact } from './BccReact/BccReact.vue';
@@ -21,6 +22,7 @@ export type { CapacityIndicatorProps } from './BccCapacityIndicator/BccCapacityI
21
22
  export type { KnobProps, KnobSlots } from './BccDialKnob/BccDialKnob.vue';
22
23
  export type { FrameProps } from './BccFrame/BccFrame.vue';
23
24
  export type { GraphicProps } from './BccGraphic/BccGraphic.vue';
25
+ export type { ImageProps } from './BccImage/BccImage.vue';
24
26
  export type { NpsResultProps } from './BccNpsResult/BccNpsResult.vue';
25
27
  export type { NpsScoreProps } from './BccNpsScore/BccNpsScore.vue';
26
28
  export type { ReactInfo, ReactProps } from './BccReact/types';
@@ -7,7 +7,6 @@ export { default as BccButton } from './BccButton.vue';
7
7
  export { default as BccCheckbox } from './BccCheckbox.vue';
8
8
  export { default as BccChip } from './BccChip/BccChip.vue';
9
9
  export { default as BccConfirmDialog } from './BccConfirmDialog/BccConfirmDialog.vue';
10
- export { default as BccImage } from './BccImage.vue';
11
10
  export { default as BccInput } from './BccInput.vue';
12
11
  export { default as BccMenu } from './BccMenu/BccMenu.vue';
13
12
  export { default as BccMessage } from './BccMessage.vue';
@@ -20,7 +19,6 @@ export type { AvatarProps } from './BccAvatar/BccAvatar.vue';
20
19
  export type { ButtonProps } from './BccButton.vue';
21
20
  export type { CheckboxProps } from './BccCheckbox.vue';
22
21
  export type { ChipProps } from './BccChip/BccChip.vue';
23
- export type { ImageProps } from './BccImage.vue';
24
22
  export type { InputProps } from './BccInput.vue';
25
23
  export type { BccMenuItem, MenuProps } from './BccMenu/BccMenu.vue';
26
24
  export type { MessageProps } from './BccMessage.vue';
@@ -23,6 +23,7 @@ export { BCC_CONTEXTS, type BCC_CONTEXT } from './contexts';
23
23
  export { default as BccComponentLibrary } from './setup';
24
24
  export * from './types';
25
25
  export * from './components/custom';
26
+ export * from './lightbox';
26
27
  export * from './components/wrapped';
27
28
  export { default as BccAccordion } from 'primevue/accordion';
28
29
  export { default as BccAccordionContent } from 'primevue/accordioncontent';
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import type { LightboxItem } from './types';
2
+ type __VLS_Props = {
3
+ item: LightboxItem;
4
+ zoomEnabled: boolean;
5
+ };
6
+ declare function rotateLeft(): void;
7
+ declare function rotateRight(): void;
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
9
+ isImage: import("vue").ComputedRef<boolean>;
10
+ rotateLeft: typeof rotateLeft;
11
+ rotateRight: typeof rotateRight;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ swipe: (direction: "left" | "right") => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onSwipe?: ((direction: "left" | "right") => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { type Ref } from 'vue';
2
+ import { openLightbox } from './state';
3
+ import { type LightboxApi } from './types';
4
+ export declare function useLightbox(): LightboxApi;
5
+ /** Open the global lightbox without using inject (e.g. imperative usage). */
6
+ export declare const openBccLightbox: typeof openLightbox;
7
+ /** Close the global lightbox without using inject. */
8
+ export declare const closeBccLightbox: LightboxApi['close'];
9
+ export declare function usePinchPan(zoomEnabled: Ref<boolean>, options?: {
10
+ swipeEnabled?: Ref<boolean>;
11
+ onSwipe?: (direction: 'left' | 'right') => void;
12
+ swipeThreshold?: number;
13
+ }): {
14
+ scale: Ref<number, number>;
15
+ transformStyle: import("vue").ComputedRef<{
16
+ transform: string;
17
+ }>;
18
+ reset: () => void;
19
+ onPointerDown: (event: PointerEvent) => void;
20
+ onPointerMove: (event: PointerEvent) => void;
21
+ onPointerUp: (event: PointerEvent) => void;
22
+ onWheel: (event: WheelEvent) => void;
23
+ };
@@ -0,0 +1,4 @@
1
+ import type { LightboxItem, LightboxItemInput, LightboxMediaType } from './types';
2
+ export declare function detectMediaType(src: string, type?: LightboxMediaType): LightboxMediaType;
3
+ export declare function normalizeLightboxItem(input: LightboxItemInput): LightboxItem;
4
+ export declare function normalizeLightboxItems(items: LightboxItemInput[]): LightboxItem[];
@@ -0,0 +1,7 @@
1
+ export { default as BccLightbox } from './BccLightbox.vue';
2
+ export { closeBccLightbox, openBccLightbox, useLightbox, usePinchPan } from './composables';
3
+ export { detectMediaType, normalizeLightboxItem, normalizeLightboxItems } from './detectMedia';
4
+ export { canGoNext, canGoPrevious, closeLightbox, goToNextItem, goToPreviousItem, installLightbox, lightboxState, openLightbox, setLightboxIndex, } from './state';
5
+ export type { LightboxState } from './state';
6
+ export { LIGHTBOX_KEY } from './types';
7
+ export type { LightboxApi, LightboxItem, LightboxItemInput, LightboxMediaType, LightboxOpenOptions } from './types';
@@ -0,0 +1,30 @@
1
+ import type { App } from 'vue';
2
+ import { type LightboxItem, type LightboxOpenOptions } from './types';
3
+ export type LightboxState = {
4
+ visible: boolean;
5
+ items: LightboxItem[];
6
+ index: number;
7
+ loop: boolean;
8
+ maskClosable: boolean;
9
+ };
10
+ export declare const lightboxState: {
11
+ readonly visible: boolean;
12
+ readonly items: readonly {
13
+ readonly src: string;
14
+ readonly type?: import("./types").LightboxMediaType | undefined;
15
+ readonly alt?: string | undefined;
16
+ readonly title?: string | undefined;
17
+ readonly poster?: string | undefined;
18
+ }[];
19
+ readonly index: number;
20
+ readonly loop: boolean;
21
+ readonly maskClosable: boolean;
22
+ };
23
+ export declare function openLightbox(options: LightboxOpenOptions): void;
24
+ export declare function closeLightbox(): void;
25
+ export declare function setLightboxIndex(index: number): void;
26
+ export declare function goToPreviousItem(): void;
27
+ export declare function goToNextItem(): void;
28
+ export declare function canGoPrevious(): boolean;
29
+ export declare function canGoNext(): boolean;
30
+ export declare function installLightbox(app: App): void;
@@ -0,0 +1,24 @@
1
+ import type { InjectionKey } from 'vue';
2
+ export type LightboxMediaType = 'image' | 'video';
3
+ export type LightboxItem = {
4
+ src: string;
5
+ type?: LightboxMediaType;
6
+ alt?: string;
7
+ title?: string;
8
+ /** Poster image for video items. */
9
+ poster?: string;
10
+ };
11
+ export type LightboxItemInput = string | LightboxItem;
12
+ export type LightboxOpenOptions = {
13
+ items: LightboxItemInput[];
14
+ index?: number;
15
+ loop?: boolean;
16
+ maskClosable?: boolean;
17
+ onShow?: () => void;
18
+ onHide?: () => void;
19
+ };
20
+ export type LightboxApi = {
21
+ open: (options: LightboxOpenOptions) => void;
22
+ close: () => void;
23
+ };
24
+ export declare const LIGHTBOX_KEY: InjectionKey<LightboxApi>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcc-code/component-library-vue",
3
- "version": "1.3.23",
3
+ "version": "1.3.24",
4
4
  "type": "module",
5
5
  "description": "Extended Vue component library based on PrimeVue and BCC design tokens",
6
6
  "repository": "https://github.com/bcc-code/bcc-design.git",
@@ -1,17 +0,0 @@
1
- import { type ImageProps as PrimeImageProps } from 'primevue/image';
2
- export type ImageProps = PrimeImageProps;
3
- declare var __VLS_9: {}, __VLS_17: {};
4
- type __VLS_Slots = {} & {
5
- refresh?: (props: typeof __VLS_9) => any;
6
- } & {
7
- undo?: (props: typeof __VLS_17) => any;
8
- };
9
- declare const __VLS_base: import("vue").DefineComponent<PrimeImageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PrimeImageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
- declare const _default: typeof __VLS_export;
12
- export default _default;
13
- type __VLS_WithSlots<T, S> = T & {
14
- new (): {
15
- $slots: S;
16
- };
17
- };