@egose/shadcn-theme-ng 0.0.28 → 0.2.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.
- package/README.md +130 -13
- package/accordion/README.md +376 -34
- package/accordion/fesm2022/accordion.mjs +27 -39
- package/alert/README.md +343 -34
- package/alert/fesm2022/alert.mjs +47 -47
- package/alert-dialog/README.md +471 -5
- package/alert-dialog/fesm2022/alert-dialog.mjs +47 -47
- package/aspect-ratio/README.md +272 -5
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +9 -9
- package/autocomplete/README.md +473 -34
- package/autocomplete/fesm2022/autocomplete.mjs +53 -71
- package/avatar/README.md +357 -5
- package/avatar/fesm2022/avatar.mjs +32 -32
- package/badge/README.md +289 -34
- package/badge/fesm2022/badge.mjs +57 -57
- package/basic-alert/README.md +324 -34
- package/basic-alert/fesm2022/basic-alert.mjs +6 -18
- package/breadcrumb/README.md +406 -5
- package/breadcrumb/fesm2022/breadcrumb.mjs +33 -39
- package/button/README.md +453 -34
- package/button/fesm2022/button.mjs +147 -219
- package/button/types/button.d.ts +7 -10
- package/button-group/README.md +318 -5
- package/button-group/fesm2022/button-group.mjs +20 -20
- package/calendar/README.md +328 -34
- package/calendar/fesm2022/calendar.mjs +29 -743
- package/card/README.md +331 -5
- package/card/fesm2022/card.mjs +33 -33
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +39 -78
- package/checkbox/README.md +291 -34
- package/checkbox/fesm2022/checkbox.mjs +20 -58
- package/checkbox/types/checkbox.d.ts +5 -4
- package/collapsible/README.md +332 -5
- package/collapsible/fesm2022/collapsible.mjs +15 -15
- package/combobox/README.md +507 -5
- package/combobox/fesm2022/combobox.mjs +91 -224
- package/command/README.md +435 -5
- package/command/fesm2022/command.mjs +49 -109
- package/confirmation-dialog/README.md +272 -34
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +15 -40
- package/confirmation-dialog/types/confirmation-dialog.d.ts +8 -4
- package/context-menu/README.md +366 -5
- package/context-menu/fesm2022/context-menu.mjs +9 -9
- package/date-picker/README.md +436 -34
- package/date-picker/fesm2022/date-picker.mjs +64 -267
- package/date-picker/types/date-picker.d.ts +7 -3
- package/dialog/README.md +419 -34
- package/dialog/fesm2022/dialog.mjs +45 -71
- package/drawer/README.md +395 -5
- package/drawer/fesm2022/drawer.mjs +44 -54
- package/dropdown-menu/README.md +417 -5
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +82 -70
- package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
- package/empty/README.md +329 -5
- package/empty/fesm2022/empty.mjs +30 -30
- package/field/README.md +385 -5
- package/field/fesm2022/field.mjs +56 -72
- package/form-checkbox/README.md +283 -34
- package/form-checkbox/fesm2022/form-checkbox.mjs +25 -85
- package/form-checkbox/types/form-checkbox.d.ts +7 -1
- package/form-date-picker/README.md +293 -34
- package/form-date-picker/fesm2022/form-date-picker.mjs +31 -84
- package/form-date-picker/types/form-date-picker.d.ts +7 -1
- package/form-field/README.md +327 -34
- package/form-field/fesm2022/form-field.mjs +33 -19
- package/form-field/types/form-field.d.ts +28 -20
- package/form-field-simple/README.md +311 -34
- package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
- package/form-searchable-multiselect/README.md +332 -34
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +31 -91
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +7 -1
- package/form-select/README.md +321 -34
- package/form-select/fesm2022/form-select.mjs +32 -149
- package/form-select/types/form-select.d.ts +7 -1
- package/form-text-input/README.md +342 -34
- package/form-text-input/fesm2022/form-text-input.mjs +35 -149
- package/form-text-input/types/form-text-input.d.ts +9 -12
- package/form-textarea/README.md +318 -34
- package/form-textarea/fesm2022/form-textarea.mjs +34 -109
- package/form-textarea/types/form-textarea.d.ts +8 -1
- package/hover-card/README.md +256 -5
- package/hover-card/fesm2022/hover-card.mjs +19 -19
- package/icon/README.md +210 -34
- package/icon/fesm2022/icon.mjs +8 -8
- package/input/README.md +240 -34
- package/input/fesm2022/input.mjs +17 -12
- package/input/types/input.d.ts +2 -1
- package/input-group/README.md +335 -5
- package/input-group/fesm2022/input-group.mjs +34 -34
- package/input-otp/README.md +375 -5
- package/input-otp/fesm2022/input-otp.mjs +26 -26
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +53 -53
- package/kbd/README.md +291 -5
- package/kbd/fesm2022/kbd.mjs +12 -12
- package/label/README.md +243 -34
- package/label/fesm2022/label.mjs +10 -10
- package/label/types/label.d.ts +1 -1
- package/layout-simple/README.md +174 -44
- package/layout-simple/fesm2022/layout-simple.mjs +508 -603
- package/layout-simple/types/layout-simple.d.ts +179 -128
- package/menu/README.md +418 -0
- package/menu/fesm2022/menu.mjs +455 -0
- package/menu/package.json +24 -0
- package/menu/types/menu.d.ts +137 -0
- package/menubar/README.md +343 -5
- package/menubar/fesm2022/menubar.mjs +13 -13
- package/native-select/README.md +323 -5
- package/native-select/fesm2022/native-select.mjs +19 -19
- package/navigation-menu/README.md +369 -5
- package/navigation-menu/fesm2022/navigation-menu.mjs +35 -47
- package/package.json +183 -154
- package/pagination/README.md +388 -5
- package/pagination/fesm2022/pagination.mjs +45 -331
- package/popover/README.md +302 -34
- package/popover/fesm2022/popover.mjs +30 -30
- package/progress/README.md +311 -5
- package/progress/fesm2022/progress.mjs +13 -13
- package/radio-group/README.md +335 -34
- package/radio-group/fesm2022/radio-group.mjs +26 -19
- package/radio-group/types/radio-group.d.ts +1 -1
- package/resizable/README.md +269 -5
- package/resizable/fesm2022/resizable.mjs +18 -26
- package/scroll-area/README.md +233 -5
- package/scroll-area/fesm2022/scroll-area.mjs +9 -9
- package/searchable-multiselect/README.md +294 -34
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +28 -117
- package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
- package/select/README.md +408 -34
- package/select/fesm2022/select.mjs +71 -111
- package/select/types/select.d.ts +3 -1
- package/separator/README.md +193 -34
- package/separator/fesm2022/separator.mjs +9 -9
- package/separator/types/separator.d.ts +1 -1
- package/sheet/README.md +282 -34
- package/sheet/fesm2022/sheet.mjs +41 -53
- package/sidebar/README.md +457 -5
- package/sidebar/fesm2022/sidebar.mjs +125 -227
- package/skeleton/README.md +217 -5
- package/skeleton/fesm2022/skeleton.mjs +9 -9
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +10 -80
- package/sonner/README.md +317 -34
- package/sonner/fesm2022/sonner.mjs +13 -13
- package/spinner/README.md +255 -34
- package/spinner/fesm2022/spinner.mjs +11 -11
- package/switch/README.md +281 -34
- package/switch/fesm2022/switch.mjs +13 -15
- package/table/README.md +423 -5
- package/table/fesm2022/table.mjs +41 -41
- package/tabs/README.md +382 -34
- package/tabs/fesm2022/tabs.mjs +35 -111
- package/textarea/README.md +282 -5
- package/textarea/fesm2022/textarea.mjs +9 -9
- package/toggle/README.md +270 -5
- package/toggle/fesm2022/toggle.mjs +13 -13
- package/toggle-group/README.md +340 -5
- package/toggle-group/fesm2022/toggle-group.mjs +13 -13
- package/toggle-group/types/toggle-group.d.ts +13 -7
- package/tooltip/README.md +240 -34
- package/tooltip/fesm2022/tooltip.mjs +14 -14
- package/typography/README.md +271 -5
- package/typography/fesm2022/typography.mjs +53 -53
- package/typography/types/typography.d.ts +19 -19
- package/utils/README.md +274 -34
- package/utils/fesm2022/utils.mjs +68 -44
- package/accordion/fesm2022/accordion.mjs.map +0 -1
- package/alert/fesm2022/alert.mjs.map +0 -1
- package/alert-dialog/fesm2022/alert-dialog.mjs.map +0 -1
- package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +0 -1
- package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
- package/avatar/fesm2022/avatar.mjs.map +0 -1
- package/badge/fesm2022/badge.mjs.map +0 -1
- package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
- package/breadcrumb/fesm2022/breadcrumb.mjs.map +0 -1
- package/button/fesm2022/button.mjs.map +0 -1
- package/button-group/fesm2022/button-group.mjs.map +0 -1
- package/calendar/fesm2022/calendar.mjs.map +0 -1
- package/card/fesm2022/card.mjs.map +0 -1
- package/carousel/fesm2022/carousel.mjs.map +0 -1
- package/checkbox/fesm2022/checkbox.mjs.map +0 -1
- package/collapsible/fesm2022/collapsible.mjs.map +0 -1
- package/combobox/fesm2022/combobox.mjs.map +0 -1
- package/command/fesm2022/command.mjs.map +0 -1
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
- package/context-menu/fesm2022/context-menu.mjs.map +0 -1
- package/date-picker/fesm2022/date-picker.mjs.map +0 -1
- package/dialog/fesm2022/dialog.mjs.map +0 -1
- package/drawer/fesm2022/drawer.mjs.map +0 -1
- package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +0 -1
- package/empty/fesm2022/empty.mjs.map +0 -1
- package/field/fesm2022/field.mjs.map +0 -1
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
- package/form-field/fesm2022/form-field.mjs.map +0 -1
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
- package/form-select/fesm2022/form-select.mjs.map +0 -1
- package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
- package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
- package/hover-card/fesm2022/hover-card.mjs.map +0 -1
- package/icon/fesm2022/icon.mjs.map +0 -1
- package/input/fesm2022/input.mjs.map +0 -1
- package/input-group/fesm2022/input-group.mjs.map +0 -1
- package/input-otp/fesm2022/input-otp.mjs.map +0 -1
- package/item/fesm2022/item.mjs.map +0 -1
- package/kbd/fesm2022/kbd.mjs.map +0 -1
- package/label/fesm2022/label.mjs.map +0 -1
- package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
- package/menubar/fesm2022/menubar.mjs.map +0 -1
- package/native-select/fesm2022/native-select.mjs.map +0 -1
- package/navigation-menu/fesm2022/navigation-menu.mjs.map +0 -1
- package/pagination/fesm2022/pagination.mjs.map +0 -1
- package/popover/fesm2022/popover.mjs.map +0 -1
- package/progress/fesm2022/progress.mjs.map +0 -1
- package/radio-group/fesm2022/radio-group.mjs.map +0 -1
- package/resizable/fesm2022/resizable.mjs.map +0 -1
- package/scroll-area/fesm2022/scroll-area.mjs.map +0 -1
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
- package/select/fesm2022/select.mjs.map +0 -1
- package/separator/fesm2022/separator.mjs.map +0 -1
- package/sheet/fesm2022/sheet.mjs.map +0 -1
- package/sidebar/fesm2022/sidebar.mjs.map +0 -1
- package/skeleton/fesm2022/skeleton.mjs.map +0 -1
- package/slider/fesm2022/slider.mjs.map +0 -1
- package/sonner/fesm2022/sonner.mjs.map +0 -1
- package/spinner/fesm2022/spinner.mjs.map +0 -1
- package/switch/fesm2022/switch.mjs.map +0 -1
- package/table/fesm2022/table.mjs.map +0 -1
- package/tabs/fesm2022/tabs.mjs.map +0 -1
- package/textarea/fesm2022/textarea.mjs.map +0 -1
- package/toggle/fesm2022/toggle.mjs.map +0 -1
- package/toggle-group/fesm2022/toggle-group.mjs.map +0 -1
- package/tooltip/fesm2022/tooltip.mjs.map +0 -1
- package/typography/fesm2022/typography.mjs.map +0 -1
- package/utils/fesm2022/utils.mjs.map +0 -1
package/carousel/README.md
CHANGED
|
@@ -1,11 +1,339 @@
|
|
|
1
|
-
# Carousel
|
|
1
|
+
# Carousel (`@egose/shadcn-theme-ng/carousel`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An Embla-powered content carousel — the Angular port of shadcn/ui `Carousel`. `hlm-carousel` wraps `embla-carousel-angular` (`EmblaCarouselDirective`) with an `orientation`-aware shell (`horizontal | vertical`, RTL-aware via CDK `Directionality`), exposes Embla state as read-only signals (`canScrollPrev/Next`, `currentSlide`, `slideCount`), and ships `hlm-carousel-content` / `hlm-carousel-item` layout directives, `button[hlm-carousel-previous]` / `button[hlm-carousel-next]` controls, and an `hlm-carousel-slide-display` counter. No spartan-ng brain primitive is used; scrolling, snapping, and plugins are pure Embla.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ships as `@egose/shadcn-theme-ng/carousel` and `@egose/shadcn-theme-ng-tw/carousel` (the `tw:`-prefixed variant). See the [package README](../../README.md) for install, peer dependencies, and Tailwind setup. Do not publish this project directory independently — it is consumed via the published subpath only.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
# Plain Tailwind (no prefix):
|
|
11
|
+
npm install @egose/shadcn-theme-ng
|
|
12
|
+
|
|
13
|
+
# Or the tw:-prefixed variant:
|
|
14
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Peers are listed in the [package README](../../README.md). This subpath declares `@angular/common`, `@angular/core`, and `@spartan-ng/brain` as peers (see `projects/carousel/package.json`); at runtime it also needs `embla-carousel`, `embla-carousel-angular` (transitive implementation deps — do not install directly unless you import them), plus `@egose/shadcn-theme-ng/button` styles for the nav buttons.
|
|
18
|
+
|
|
19
|
+
## Imports
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
HlmCarousel,
|
|
24
|
+
HlmCarouselContent,
|
|
25
|
+
HlmCarouselItem,
|
|
26
|
+
HlmCarouselPrevious,
|
|
27
|
+
HlmCarouselNext,
|
|
28
|
+
HlmCarouselSlideDisplay,
|
|
29
|
+
HlmCarouselImports,
|
|
30
|
+
HlmCarouselModule,
|
|
31
|
+
} from '@egose/shadcn-theme-ng/carousel';
|
|
32
|
+
// tw variant:
|
|
33
|
+
// import { ... } from '@egose/shadcn-theme-ng-tw/carousel';
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Standalone:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { Component } from '@angular/core';
|
|
40
|
+
import { HlmCarouselImports } from '@egose/shadcn-theme-ng/carousel';
|
|
41
|
+
|
|
42
|
+
@Component({
|
|
43
|
+
selector: 'app-demo',
|
|
44
|
+
standalone: true,
|
|
45
|
+
imports: [...HlmCarouselImports],
|
|
46
|
+
template: `...`,
|
|
47
|
+
})
|
|
48
|
+
export class DemoComponent {}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
NgModule:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { NgModule } from '@angular/core';
|
|
55
|
+
import { HlmCarouselModule } from '@egose/shadcn-theme-ng/carousel';
|
|
56
|
+
|
|
57
|
+
@NgModule({ imports: [HlmCarouselModule] })
|
|
58
|
+
export class DemoModule {}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Anatomy / Structure
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<hlm-carousel orientation="horizontal" [options]="{ loop: true }" [plugins]="plugins">
|
|
65
|
+
<hlm-carousel-content>
|
|
66
|
+
<hlm-carousel-item>Slide 1</hlm-carousel-item>
|
|
67
|
+
<hlm-carousel-item>Slide 2</hlm-carousel-item>
|
|
68
|
+
<hlm-carousel-item>Slide 3</hlm-carousel-item>
|
|
69
|
+
</hlm-carousel-content>
|
|
70
|
+
|
|
71
|
+
<button hlm-carousel-previous></button>
|
|
72
|
+
<button hlm-carousel-next></button>
|
|
73
|
+
<hlm-carousel-slide-display />
|
|
74
|
+
</hlm-carousel>
|
|
11
75
|
```
|
|
76
|
+
|
|
77
|
+
Real selectors:
|
|
78
|
+
|
|
79
|
+
| Class | Selector | Notes |
|
|
80
|
+
| ------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
81
|
+
| `HlmCarousel` | `hlm-carousel` | `role="region"`, `aria-roledescription="carousel"`. Projects `[hlmCarouselContent]` into the Embla viewport; everything else into the outer shell (position nav buttons here). |
|
|
82
|
+
| `HlmCarouselContent` | `[hlmCarouselContent]`, `hlm-carousel-content` | Flex track (`-ml-4` / `-mt-4 flex-col` by orientation). Must be inside `hlm-carousel` (injects it). |
|
|
83
|
+
| `HlmCarouselItem` | `[hlmCarouselItem]`, `hlm-carousel-item` | `basis-full`, `role="group"`, `aria-roledescription="slide"`. |
|
|
84
|
+
| `HlmCarouselPrevious` | `button[hlm-carousel-previous]`, `button[hlmCarouselPrevious]` | Outline icon-sm button; auto-disabled at start; `(click)` → `scrollPrev()`. |
|
|
85
|
+
| `HlmCarouselNext` | `button[hlm-carousel-next]`, `button[hlmCarouselNext]` | Same, wired to `scrollNext()`. |
|
|
86
|
+
| `HlmCarouselSlideDisplay` | `hlm-carousel-slide-display` | `N / total` counter + sr-only label. |
|
|
87
|
+
|
|
88
|
+
## API reference
|
|
89
|
+
|
|
90
|
+
### `HlmCarousel` (`hlm-carousel`)
|
|
91
|
+
|
|
92
|
+
| Input | Type | Default | Description |
|
|
93
|
+
| ------------- | --------------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
94
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Embla `axis` (`x`/`y`), track layout, and nav-button placement. |
|
|
95
|
+
| `options` | `Omit<EmblaOptionsType, 'axis'> \| undefined` | `undefined` | Raw Embla options (`loop`, `align`, `slidesToScroll`, `direction`, …). `direction` defaults to the ambient CDK `Directionality`; explicit `direction` wins. |
|
|
96
|
+
| `plugins` | `EmblaPluginType[]` | `[]` | Embla plugins (e.g. Autoplay). Passed straight to the directive. |
|
|
97
|
+
|
|
98
|
+
| Signal (read-only) | Type | Description |
|
|
99
|
+
| ------------------ | ----------------- | ----------------------------------------------------------------------------------- |
|
|
100
|
+
| `canScrollPrev` | `Signal<boolean>` | Updated on Embla `init`/`select`/`reInit`. Drives the previous button's `disabled`. |
|
|
101
|
+
| `canScrollNext` | `Signal<boolean>` | Same for next. |
|
|
102
|
+
| `currentSlide` | `Signal<number>` | Zero-based `selectedScrollSnap()`. |
|
|
103
|
+
| `slideCount` | `Signal<number>` | `scrollSnapList().length`. |
|
|
104
|
+
|
|
105
|
+
| Method | Description |
|
|
106
|
+
| -------------- | --------------------------------------------------- |
|
|
107
|
+
| `scrollPrev()` | Delegates to `EmblaCarouselDirective.scrollPrev()`. |
|
|
108
|
+
| `scrollNext()` | Delegates to `EmblaCarouselDirective.scrollNext()`. |
|
|
109
|
+
|
|
110
|
+
Host `(keydown)`: `ArrowLeft` → `scrollPrev()`, `ArrowRight` → `scrollNext()` (with `preventDefault`).
|
|
111
|
+
|
|
112
|
+
### Nav buttons
|
|
113
|
+
|
|
114
|
+
Both are `HlmBtn` host-directive components (`inputs: ['variant', 'size']`, defaulted via `provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })`). Position classes are computed from the parent orientation (absolute `-start-12`/`-end-12` horizontal, `-top-12`/`-bottom-12` rotated vertical). Overriding `variant`/`size` is supported but replaces the outline icon look.
|
|
115
|
+
|
|
116
|
+
### `HlmCarouselSlideDisplay` (`hlm-carousel-slide-display`)
|
|
117
|
+
|
|
118
|
+
| Input | Type | Default | Description |
|
|
119
|
+
| ------------ | ------------ | --------------------------------- | ------------------------------------------------------------------ |
|
|
120
|
+
| `slideClass` | `ClassValue` | `'text-muted-foreground text-sm'` | Class for the visible `N / total` div (`aria-hidden`). |
|
|
121
|
+
| `label` | `string` | `'Slide'` | Prefix for the sr-only `"{{label}} N of total is displayed"` text. |
|
|
122
|
+
|
|
123
|
+
## Examples
|
|
124
|
+
|
|
125
|
+
### 1. Basic horizontal carousel
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { Component } from '@angular/core';
|
|
129
|
+
import { HlmCarouselImports } from '@egose/shadcn-theme-ng/carousel';
|
|
130
|
+
import { HlmCardImports } from '@egose/shadcn-theme-ng/card';
|
|
131
|
+
|
|
132
|
+
@Component({
|
|
133
|
+
selector: 'app-basic-carousel',
|
|
134
|
+
standalone: true,
|
|
135
|
+
imports: [...HlmCarouselImports, ...HlmCardImports],
|
|
136
|
+
template: `
|
|
137
|
+
<hlm-carousel class="mx-12 max-w-xl">
|
|
138
|
+
<hlm-carousel-content>
|
|
139
|
+
@for (n of [1, 2, 3, 4]; track n) {
|
|
140
|
+
<hlm-carousel-item>
|
|
141
|
+
<div hlmCard class="m-1">
|
|
142
|
+
<div hlmCardContent class="flex aspect-video items-center justify-center text-3xl font-semibold">
|
|
143
|
+
{{ n }}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</hlm-carousel-item>
|
|
147
|
+
}
|
|
148
|
+
</hlm-carousel-content>
|
|
149
|
+
<button hlm-carousel-previous></button>
|
|
150
|
+
<button hlm-carousel-next></button>
|
|
151
|
+
</hlm-carousel>
|
|
152
|
+
`,
|
|
153
|
+
})
|
|
154
|
+
export class BasicCarouselComponent {}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
> Nav buttons are absolutely positioned outside the viewport (`-start-12`/`-end-12`) — leave horizontal margin on the carousel or wrap it in padded layout.
|
|
158
|
+
|
|
159
|
+
### 2. Vertical carousel
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import { Component } from '@angular/core';
|
|
163
|
+
import { HlmCarouselImports } from '@egose/shadcn-theme-ng/carousel';
|
|
164
|
+
|
|
165
|
+
@Component({
|
|
166
|
+
selector: 'app-vertical-carousel',
|
|
167
|
+
standalone: true,
|
|
168
|
+
imports: [...HlmCarouselImports],
|
|
169
|
+
template: `
|
|
170
|
+
<hlm-carousel orientation="vertical" class="my-12 h-96 w-64">
|
|
171
|
+
<hlm-carousel-content class="h-96">
|
|
172
|
+
@for (n of [1, 2, 3]; track n) {
|
|
173
|
+
<hlm-carousel-item>
|
|
174
|
+
<div class="bg-muted flex h-full items-center justify-center rounded-lg text-2xl">
|
|
175
|
+
{{ n }}
|
|
176
|
+
</div>
|
|
177
|
+
</hlm-carousel-item>
|
|
178
|
+
}
|
|
179
|
+
</hlm-carousel-content>
|
|
180
|
+
<button hlm-carousel-previous></button>
|
|
181
|
+
<button hlm-carousel-next></button>
|
|
182
|
+
</hlm-carousel>
|
|
183
|
+
`,
|
|
184
|
+
})
|
|
185
|
+
export class VerticalCarouselComponent {}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 3. Looping + aligned + multi-slide options
|
|
189
|
+
|
|
190
|
+
Any Embla option except `axis` (owned by `orientation`) passes through.
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import { Component } from '@angular/core';
|
|
194
|
+
import { HlmCarouselImports } from '@egose/shadcn-theme-ng/carousel';
|
|
195
|
+
|
|
196
|
+
@Component({
|
|
197
|
+
selector: 'app-loop-carousel',
|
|
198
|
+
standalone: true,
|
|
199
|
+
imports: [...HlmCarouselImports],
|
|
200
|
+
template: `
|
|
201
|
+
<hlm-carousel [options]="{ loop: true, align: 'start', slidesToScroll: 1 }" class="mx-12 max-w-2xl">
|
|
202
|
+
<hlm-carousel-content>
|
|
203
|
+
@for (n of [1, 2, 3, 4, 5, 6]; track n) {
|
|
204
|
+
<hlm-carousel-item class="md:basis-1/2 lg:basis-1/3">
|
|
205
|
+
<div class="bg-card m-1 rounded-lg p-6 text-center ring-1">Card {{ n }}</div>
|
|
206
|
+
</hlm-carousel-item>
|
|
207
|
+
}
|
|
208
|
+
</hlm-carousel-content>
|
|
209
|
+
<button hlm-carousel-previous></button>
|
|
210
|
+
<button hlm-carousel-next></button>
|
|
211
|
+
</hlm-carousel>
|
|
212
|
+
`,
|
|
213
|
+
})
|
|
214
|
+
export class LoopCarouselComponent {}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
> Override item basis per breakpoint with your own `class` — the directive merges it with `min-w-0 shrink-0 grow-0 basis-full`.
|
|
218
|
+
|
|
219
|
+
### 4. Slide counter display
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
import { Component } from '@angular/core';
|
|
223
|
+
import { HlmCarouselImports } from '@egose/shadcn-theme-ng/carousel';
|
|
224
|
+
|
|
225
|
+
@Component({
|
|
226
|
+
selector: 'app-counter-carousel',
|
|
227
|
+
standalone: true,
|
|
228
|
+
imports: [...HlmCarouselImports],
|
|
229
|
+
template: `
|
|
230
|
+
<hlm-carousel class="mx-12 max-w-xl">
|
|
231
|
+
<hlm-carousel-content>
|
|
232
|
+
@for (src of images; track src) {
|
|
233
|
+
<hlm-carousel-item>
|
|
234
|
+
<img [src]="src" alt="Carousel image" class="aspect-video w-full rounded-lg object-cover" />
|
|
235
|
+
</hlm-carousel-item>
|
|
236
|
+
}
|
|
237
|
+
</hlm-carousel-content>
|
|
238
|
+
<div class="mt-2 flex items-center justify-between">
|
|
239
|
+
<div class="flex gap-2">
|
|
240
|
+
<button hlm-carousel-previous class="static! translate-none! rotate-0!"></button>
|
|
241
|
+
<button hlm-carousel-next class="static! translate-none! rotate-0!"></button>
|
|
242
|
+
</div>
|
|
243
|
+
<hlm-carousel-slide-display label="Photo" slideClass="text-sm font-medium" />
|
|
244
|
+
</div>
|
|
245
|
+
</hlm-carousel>
|
|
246
|
+
`,
|
|
247
|
+
})
|
|
248
|
+
export class CounterCarouselComponent {
|
|
249
|
+
readonly images = [
|
|
250
|
+
'https://picsum.photos/800/450?1',
|
|
251
|
+
'https://picsum.photos/800/450?2',
|
|
252
|
+
'https://picsum.photos/800/450?3',
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### 5. Programmatic control via template ref
|
|
258
|
+
|
|
259
|
+
`scrollPrev/scrollNext` plus the state signals are public — wire custom dots or external buttons.
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
import { Component } from '@angular/core';
|
|
263
|
+
import { HlmCarouselImports, HlmCarousel } from '@egose/shadcn-theme-ng/carousel';
|
|
264
|
+
import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
|
|
265
|
+
|
|
266
|
+
@Component({
|
|
267
|
+
selector: 'app-controlled-carousel',
|
|
268
|
+
standalone: true,
|
|
269
|
+
imports: [...HlmCarouselImports, ...HlmButtonImports],
|
|
270
|
+
template: `
|
|
271
|
+
<hlm-carousel #car class="mx-12 max-w-xl">
|
|
272
|
+
<hlm-carousel-content>
|
|
273
|
+
@for (n of [1, 2, 3, 4]; track n) {
|
|
274
|
+
<hlm-carousel-item>
|
|
275
|
+
<div class="bg-muted m-1 flex aspect-video items-center justify-center rounded-lg">Slide {{ n }}</div>
|
|
276
|
+
</hlm-carousel-item>
|
|
277
|
+
}
|
|
278
|
+
</hlm-carousel-content>
|
|
279
|
+
</hlm-carousel>
|
|
280
|
+
|
|
281
|
+
<div class="mt-3 flex items-center gap-2">
|
|
282
|
+
<button hlmBtn variant="outline" (click)="car.scrollPrev()" [disabled]="!car.canScrollPrev()">Prev</button>
|
|
283
|
+
<button hlmBtn variant="outline" (click)="car.scrollNext()" [disabled]="!car.canScrollNext()">Next</button>
|
|
284
|
+
<span class="text-sm">Slide {{ car.currentSlide() + 1 }} / {{ car.slideCount() }}</span>
|
|
285
|
+
</div>
|
|
286
|
+
`,
|
|
287
|
+
})
|
|
288
|
+
export class ControlledCarouselComponent {}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### 6. Autoplay plugin (advanced)
|
|
292
|
+
|
|
293
|
+
```ts
|
|
294
|
+
import { Component } from '@angular/core';
|
|
295
|
+
import Autoplay from 'embla-carousel-autoplay';
|
|
296
|
+
import { HlmCarouselImports } from '@egose/shadcn-theme-ng/carousel';
|
|
297
|
+
|
|
298
|
+
@Component({
|
|
299
|
+
selector: 'app-autoplay-carousel',
|
|
300
|
+
standalone: true,
|
|
301
|
+
imports: [...HlmCarouselImports],
|
|
302
|
+
template: `
|
|
303
|
+
<hlm-carousel [plugins]="plugins" [options]="{ loop: true }" class="mx-12 max-w-xl">
|
|
304
|
+
<hlm-carousel-content>
|
|
305
|
+
@for (n of [1, 2, 3]; track n) {
|
|
306
|
+
<hlm-carousel-item>
|
|
307
|
+
<div class="bg-muted m-1 flex aspect-video items-center justify-center rounded-lg text-2xl">
|
|
308
|
+
{{ n }}
|
|
309
|
+
</div>
|
|
310
|
+
</hlm-carousel-item>
|
|
311
|
+
}
|
|
312
|
+
</hlm-carousel-content>
|
|
313
|
+
<button hlm-carousel-previous></button>
|
|
314
|
+
<button hlm-carousel-next></button>
|
|
315
|
+
</hlm-carousel>
|
|
316
|
+
`,
|
|
317
|
+
})
|
|
318
|
+
export class AutoplayCarouselComponent {
|
|
319
|
+
readonly plugins = [Autoplay({ delay: 3000, stopOnInteraction: true })];
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Accessibility notes
|
|
324
|
+
|
|
325
|
+
- The shell is `role="region"` / `aria-roledescription="carousel"` and each item is `role="group"` / `aria-roledescription="slide"` — give the carousel an `aria-label` (e.g. `aria-label="Product photos"`) so regions are distinguishable.
|
|
326
|
+
- Nav buttons include sr-only `"Previous slide"` / `"Next slide"` text and auto-disable at the ends; keep the `disabled` binding intact.
|
|
327
|
+
- `hlm-carousel-slide-display` renders both a visible `aria-hidden` counter and an sr-only `"Slide N of T is displayed"` live-region-friendly label.
|
|
328
|
+
- Arrow-key handling is on the host (`ArrowLeft/Right` → prev/next). For vertical carousels, consider adding your own Up/Down handling — the built-in handler only maps Left/Right.
|
|
329
|
+
|
|
330
|
+
## Theming / CSS variables
|
|
331
|
+
|
|
332
|
+
No component-specific CSS variables. Track/item geometry comes from Tailwind (`basis-full`, `-ml-4`/`pl-4` gutters, `rounded-full` nav buttons). RTL flips automatically via CDK `Directionality` (chevron icons use `rtl:rotate-180`).
|
|
333
|
+
|
|
334
|
+
## Related subpaths
|
|
335
|
+
|
|
336
|
+
- `@egose/shadcn-theme-ng/button` — `HlmBtn` powers the prev/next buttons (`variant`/`size` host inputs).
|
|
337
|
+
- `@egose/shadcn-theme-ng/card` — typical slide content wrapper.
|
|
338
|
+
- `@egose/shadcn-theme-ng/icon` — `ng-icon` chevrons inside nav buttons (provide your own icons for custom controls).
|
|
339
|
+
- `@egose/shadcn-theme-ng/utils` — `hlm` class merging used by the nav-button positioning.
|
|
@@ -39,7 +39,7 @@ class HlmCarousel {
|
|
|
39
39
|
...(ngDevMode ? [{ debugName: "_slideCount" }] : /* istanbul ignore next */ []));
|
|
40
40
|
slideCount = this._slideCount.asReadonly();
|
|
41
41
|
constructor() {
|
|
42
|
-
classes(() =>
|
|
42
|
+
classes(() => "relative");
|
|
43
43
|
}
|
|
44
44
|
onEmblaEvent(event) {
|
|
45
45
|
const emblaApi = this._emblaCarousel().emblaApi;
|
|
@@ -69,22 +69,10 @@ class HlmCarousel {
|
|
|
69
69
|
scrollNext() {
|
|
70
70
|
this._emblaCarousel().scrollNext();
|
|
71
71
|
}
|
|
72
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
73
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.
|
|
74
|
-
<div
|
|
75
|
-
emblaCarousel
|
|
76
|
-
class="overflow-hidden"
|
|
77
|
-
[plugins]="plugins()"
|
|
78
|
-
[options]="_emblaOptions()"
|
|
79
|
-
[subscribeToEvents]="['init', 'select', 'reInit']"
|
|
80
|
-
(emblaChange)="onEmblaEvent($event)"
|
|
81
|
-
>
|
|
82
|
-
<ng-content select="[hlmCarouselContent],hlm-carousel-content" />
|
|
83
|
-
</div>
|
|
84
|
-
<ng-content />
|
|
85
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: EmblaCarouselDirective, selector: "[emblaCarousel]", inputs: ["options", "plugins", "subscribeToEvents", "eventsThrottleTime"], outputs: ["emblaChange"], exportAs: ["emblaCarousel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarousel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.3", type: HlmCarousel, isStandalone: true, selector: "hlm-carousel", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "carousel", "role": "region", "aria-roledescription": "carousel" }, listeners: { "keydown": "onKeydown($event)" } }, viewQueries: [{ propertyName: "_emblaCarousel", first: true, predicate: EmblaCarouselDirective, descendants: true, isSignal: true }], ngImport: i0, template: "\n <div\n emblaCarousel\n class=\"overflow-hidden\"\n [plugins]=\"plugins()\"\n [options]=\"_emblaOptions()\"\n [subscribeToEvents]=\"['init', 'select', 'reInit']\"\n (emblaChange)=\"onEmblaEvent($event)\"\n >\n <ng-content select=\"[hlmCarouselContent],hlm-carousel-content\" />\n </div>\n <ng-content />\n ", isInline: true, dependencies: [{ kind: "directive", type: EmblaCarouselDirective, selector: "[emblaCarousel]", inputs: ["options", "plugins", "subscribeToEvents", "eventsThrottleTime"], outputs: ["emblaChange"], exportAs: ["emblaCarousel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
86
74
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarousel, decorators: [{
|
|
88
76
|
type: Component,
|
|
89
77
|
args: [{
|
|
90
78
|
selector: 'hlm-carousel',
|
|
@@ -96,31 +84,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
96
84
|
'aria-roledescription': 'carousel',
|
|
97
85
|
'(keydown)': 'onKeydown($event)',
|
|
98
86
|
},
|
|
99
|
-
template:
|
|
100
|
-
<div
|
|
101
|
-
emblaCarousel
|
|
102
|
-
class="overflow-hidden"
|
|
103
|
-
[plugins]="plugins()"
|
|
104
|
-
[options]="_emblaOptions()"
|
|
105
|
-
[subscribeToEvents]="['init', 'select', 'reInit']"
|
|
106
|
-
(emblaChange)="onEmblaEvent($event)"
|
|
107
|
-
>
|
|
108
|
-
<ng-content select="[hlmCarouselContent],hlm-carousel-content" />
|
|
109
|
-
</div>
|
|
110
|
-
<ng-content />
|
|
111
|
-
`,
|
|
87
|
+
template: "\n <div\n emblaCarousel\n class=\"overflow-hidden\"\n [plugins]=\"plugins()\"\n [options]=\"_emblaOptions()\"\n [subscribeToEvents]=\"['init', 'select', 'reInit']\"\n (emblaChange)=\"onEmblaEvent($event)\"\n >\n <ng-content select=\"[hlmCarouselContent],hlm-carousel-content\" />\n </div>\n <ng-content />\n ",
|
|
112
88
|
}]
|
|
113
89
|
}], ctorParameters: () => [], propDecorators: { _emblaCarousel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EmblaCarouselDirective), { isSignal: true }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], plugins: [{ type: i0.Input, args: [{ isSignal: true, alias: "plugins", required: false }] }] } });
|
|
114
90
|
|
|
115
91
|
class HlmCarouselContent {
|
|
116
92
|
_orientation = inject(HlmCarousel).orientation;
|
|
117
93
|
constructor() {
|
|
118
|
-
classes(() => [
|
|
94
|
+
classes(() => ["flex", this._orientation() === 'horizontal' ? "-ml-4" : "-mt-4 flex-col"]);
|
|
119
95
|
}
|
|
120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
121
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
97
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselContent, isStandalone: true, selector: "[hlmCarouselContent],hlm-carousel-content", host: { attributes: { "data-slot": "carousel-content" } }, ngImport: i0 });
|
|
122
98
|
}
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselContent, decorators: [{
|
|
124
100
|
type: Directive,
|
|
125
101
|
args: [{
|
|
126
102
|
selector: '[hlmCarouselContent],hlm-carousel-content',
|
|
@@ -133,12 +109,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
133
109
|
class HlmCarouselItem {
|
|
134
110
|
_orientation = inject(HlmCarousel).orientation;
|
|
135
111
|
constructor() {
|
|
136
|
-
classes(() => [
|
|
112
|
+
classes(() => [
|
|
113
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
114
|
+
this._orientation() === 'horizontal' ? "pl-4" : "pt-4",
|
|
115
|
+
]);
|
|
137
116
|
}
|
|
138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
139
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
117
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
118
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselItem, isStandalone: true, selector: "[hlmCarouselItem],hlm-carousel-item", host: { attributes: { "data-slot": "carousel-item", "role": "group", "aria-roledescription": "slide" } }, ngImport: i0 });
|
|
140
119
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselItem, decorators: [{
|
|
142
121
|
type: Directive,
|
|
143
122
|
args: [{
|
|
144
123
|
selector: '[hlmCarouselItem],hlm-carousel-item',
|
|
@@ -153,9 +132,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
153
132
|
class HlmCarouselNext {
|
|
154
133
|
_button = inject(HlmBtn);
|
|
155
134
|
_carousel = inject(HlmCarousel);
|
|
156
|
-
_computedClass = computed(() => hlm(
|
|
157
|
-
?
|
|
158
|
-
:
|
|
135
|
+
_computedClass = computed(() => hlm("rounded-full absolute h-8 w-8", this._carousel.orientation() === 'horizontal'
|
|
136
|
+
? "-end-12 top-1/2 -translate-y-1/2"
|
|
137
|
+
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90"), /* @ts-ignore */
|
|
159
138
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
160
139
|
isDisabled = () => !this._carousel.canScrollNext();
|
|
161
140
|
constructor() {
|
|
@@ -164,13 +143,10 @@ class HlmCarouselNext {
|
|
|
164
143
|
untracked(() => this._button.setClass(computedClass));
|
|
165
144
|
});
|
|
166
145
|
}
|
|
167
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
168
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.
|
|
169
|
-
<ng-icon name="lucideArrowRight" class="rtl:rotate-180" />
|
|
170
|
-
<span class="sr-only">Next slide</span>
|
|
171
|
-
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
146
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselNext, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
147
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselNext, isStandalone: true, selector: "button[hlm-carousel-next], button[hlmCarouselNext]", host: { attributes: { "data-slot": "carousel-next" }, listeners: { "click": "_carousel.scrollNext()" }, properties: { "disabled": "isDisabled()" } }, providers: [provideIcons({ lucideArrowRight }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })], hostDirectives: [{ directive: i1.HlmBtn, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0, template: "\n <ng-icon name=\"lucideArrowRight\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Next slide</span>\n ", isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
172
148
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselNext, decorators: [{
|
|
174
150
|
type: Component,
|
|
175
151
|
args: [{
|
|
176
152
|
selector: 'button[hlm-carousel-next], button[hlmCarouselNext]',
|
|
@@ -183,19 +159,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
183
159
|
'[disabled]': 'isDisabled()',
|
|
184
160
|
'(click)': '_carousel.scrollNext()',
|
|
185
161
|
},
|
|
186
|
-
template:
|
|
187
|
-
<ng-icon name="lucideArrowRight" class="rtl:rotate-180" />
|
|
188
|
-
<span class="sr-only">Next slide</span>
|
|
189
|
-
`,
|
|
162
|
+
template: "\n <ng-icon name=\"lucideArrowRight\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Next slide</span>\n ",
|
|
190
163
|
}]
|
|
191
164
|
}], ctorParameters: () => [] });
|
|
192
165
|
|
|
193
166
|
class HlmCarouselPrevious {
|
|
194
167
|
_button = inject(HlmBtn);
|
|
195
168
|
_carousel = inject(HlmCarousel);
|
|
196
|
-
_computedClass = computed(() => hlm(
|
|
197
|
-
?
|
|
198
|
-
:
|
|
169
|
+
_computedClass = computed(() => hlm("rounded-full absolute h-8 w-8", this._carousel.orientation() === 'horizontal'
|
|
170
|
+
? "-start-12 top-1/2 -translate-y-1/2"
|
|
171
|
+
: "-top-12 left-1/2 -translate-x-1/2 rotate-90"), /* @ts-ignore */
|
|
199
172
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
200
173
|
isDisabled = () => !this._carousel.canScrollPrev();
|
|
201
174
|
constructor() {
|
|
@@ -204,13 +177,10 @@ class HlmCarouselPrevious {
|
|
|
204
177
|
untracked(() => this._button.setClass(computedClass));
|
|
205
178
|
});
|
|
206
179
|
}
|
|
207
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
208
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.
|
|
209
|
-
<ng-icon name="lucideArrowLeft" class="rtl:rotate-180" />
|
|
210
|
-
<span class="sr-only">Previous slide</span>
|
|
211
|
-
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselPrevious, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: HlmCarouselPrevious, isStandalone: true, selector: "button[hlm-carousel-previous], button[hlmCarouselPrevious]", host: { attributes: { "data-slot": "carousel-previous" }, listeners: { "click": "_carousel.scrollPrev()" }, properties: { "disabled": "isDisabled()" } }, providers: [provideIcons({ lucideArrowLeft }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })], hostDirectives: [{ directive: i1.HlmBtn, inputs: ["variant", "variant", "size", "size"] }], ngImport: i0, template: "\n <ng-icon name=\"lucideArrowLeft\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Previous slide</span>\n ", isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
212
182
|
}
|
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselPrevious, decorators: [{
|
|
214
184
|
type: Component,
|
|
215
185
|
args: [{
|
|
216
186
|
selector: 'button[hlm-carousel-previous], button[hlmCarouselPrevious]',
|
|
@@ -223,10 +193,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
223
193
|
'[disabled]': 'isDisabled()',
|
|
224
194
|
'(click)': '_carousel.scrollPrev()',
|
|
225
195
|
},
|
|
226
|
-
template:
|
|
227
|
-
<ng-icon name="lucideArrowLeft" class="rtl:rotate-180" />
|
|
228
|
-
<span class="sr-only">Previous slide</span>
|
|
229
|
-
`,
|
|
196
|
+
template: "\n <ng-icon name=\"lucideArrowLeft\" class=\"rtl:rotate-180\" />\n <span class=\"sr-only\">Previous slide</span>\n ",
|
|
230
197
|
}]
|
|
231
198
|
}], ctorParameters: () => [] });
|
|
232
199
|
|
|
@@ -245,13 +212,10 @@ class HlmCarouselSlideDisplay {
|
|
|
245
212
|
return `${this.label()} ${currentSlide} of ${slideCount} is displayed`;
|
|
246
213
|
}, /* @ts-ignore */
|
|
247
214
|
...(ngDevMode ? [{ debugName: "_labelContent" }] : /* istanbul ignore next */ []));
|
|
248
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
249
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
250
|
-
<span class="sr-only">{{ _labelContent() }}</span>
|
|
251
|
-
<div aria-hidden="true" [class]="slideClass()">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>
|
|
252
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
215
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselSlideDisplay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
216
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmCarouselSlideDisplay, isStandalone: true, selector: "hlm-carousel-slide-display", inputs: { slideClass: { classPropertyName: "slideClass", publicName: "slideClass", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "carousel-slide-display" } }, ngImport: i0, template: "\n <span class=\"sr-only\">{{ _labelContent() }}</span>\n <div aria-hidden=\"true\" [class]=\"slideClass()\">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>\n ", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
253
217
|
}
|
|
254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselSlideDisplay, decorators: [{
|
|
255
219
|
type: Component,
|
|
256
220
|
args: [{
|
|
257
221
|
selector: 'hlm-carousel-slide-display',
|
|
@@ -259,10 +223,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
259
223
|
host: {
|
|
260
224
|
'data-slot': 'carousel-slide-display',
|
|
261
225
|
},
|
|
262
|
-
template:
|
|
263
|
-
<span class="sr-only">{{ _labelContent() }}</span>
|
|
264
|
-
<div aria-hidden="true" [class]="slideClass()">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>
|
|
265
|
-
`,
|
|
226
|
+
template: "\n <span class=\"sr-only\">{{ _labelContent() }}</span>\n <div aria-hidden=\"true\" [class]=\"slideClass()\">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>\n ",
|
|
266
227
|
}]
|
|
267
228
|
}], propDecorators: { slideClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "slideClass", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }] } });
|
|
268
229
|
|
|
@@ -278,8 +239,8 @@ const HlmCarouselImports = [
|
|
|
278
239
|
HlmCarouselSlideDisplay,
|
|
279
240
|
];
|
|
280
241
|
class HlmCarouselModule {
|
|
281
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
282
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
243
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, imports: [HlmCarousel,
|
|
283
244
|
HlmCarouselContent,
|
|
284
245
|
HlmCarouselItem,
|
|
285
246
|
HlmCarouselPrevious,
|
|
@@ -290,10 +251,10 @@ class HlmCarouselModule {
|
|
|
290
251
|
HlmCarouselPrevious,
|
|
291
252
|
HlmCarouselNext,
|
|
292
253
|
HlmCarouselSlideDisplay] });
|
|
293
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
254
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, imports: [HlmCarouselPrevious,
|
|
294
255
|
HlmCarouselNext] });
|
|
295
256
|
}
|
|
296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, decorators: [{
|
|
297
258
|
type: NgModule,
|
|
298
259
|
args: [{
|
|
299
260
|
imports: [...HlmCarouselImports],
|
|
@@ -306,4 +267,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
306
267
|
*/
|
|
307
268
|
|
|
308
269
|
export { HlmCarousel, HlmCarouselContent, HlmCarouselImports, HlmCarouselItem, HlmCarouselModule, HlmCarouselNext, HlmCarouselPrevious, HlmCarouselSlideDisplay };
|
|
309
|
-
|
|
270
|
+
|