@egose/shadcn-theme-ng-tw 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 +20 -20
- package/alert/README.md +343 -34
- package/alert/fesm2022/alert.mjs +18 -18
- package/alert-dialog/README.md +471 -5
- package/alert-dialog/fesm2022/alert-dialog.mjs +48 -48
- package/alert-dialog/types/alert-dialog.d.ts +1 -1
- 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 +54 -54
- package/autocomplete/types/autocomplete.d.ts +1 -1
- package/avatar/README.md +357 -5
- package/avatar/fesm2022/avatar.mjs +32 -32
- package/badge/README.md +289 -34
- package/badge/fesm2022/badge.mjs +4 -4
- package/basic-alert/README.md +324 -34
- package/basic-alert/fesm2022/basic-alert.mjs +4 -4
- package/basic-alert/types/basic-alert.d.ts +1 -1
- package/breadcrumb/README.md +406 -5
- package/breadcrumb/fesm2022/breadcrumb.mjs +34 -34
- package/button/README.md +453 -34
- package/button/fesm2022/button.mjs +96 -118
- 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 +154 -154
- package/card/README.md +331 -5
- package/card/fesm2022/card.mjs +33 -33
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +47 -44
- package/carousel/types/carousel.d.ts +1 -1
- package/checkbox/README.md +291 -34
- package/checkbox/fesm2022/checkbox.mjs +22 -20
- 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 +95 -92
- package/combobox/types/combobox.d.ts +1 -1
- package/command/README.md +435 -5
- package/command/fesm2022/command.mjs +56 -56
- package/confirmation-dialog/README.md +272 -34
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +13 -12
- package/confirmation-dialog/types/confirmation-dialog.d.ts +9 -5
- 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 +79 -68
- package/date-picker/types/date-picker.d.ts +8 -4
- package/dialog/README.md +419 -34
- package/dialog/fesm2022/dialog.mjs +48 -48
- package/drawer/README.md +395 -5
- package/drawer/fesm2022/drawer.mjs +45 -45
- package/dropdown-menu/README.md +417 -5
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +85 -73
- package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
- package/empty/README.md +329 -5
- package/empty/fesm2022/empty.mjs +31 -31
- package/field/README.md +385 -5
- package/field/fesm2022/field.mjs +59 -59
- package/field/types/field.d.ts +1 -1
- package/form-checkbox/README.md +283 -34
- package/form-checkbox/fesm2022/form-checkbox.mjs +37 -19
- 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 +59 -24
- 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 +30 -16
- 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 +41 -21
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +8 -2
- package/form-select/README.md +321 -34
- package/form-select/fesm2022/form-select.mjs +62 -29
- 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 +43 -55
- 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 +42 -23
- 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 +37 -37
- package/input-group/types/input-group.d.ts +3 -3
- package/input-otp/README.md +375 -5
- package/input-otp/fesm2022/input-otp.mjs +27 -27
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +54 -54
- package/kbd/README.md +291 -5
- package/kbd/fesm2022/kbd.mjs +13 -13
- package/label/README.md +243 -34
- package/label/fesm2022/label.mjs +9 -9
- package/label/types/label.d.ts +1 -1
- package/layout-simple/README.md +174 -44
- package/layout-simple/fesm2022/layout-simple.mjs +917 -398
- package/layout-simple/types/layout-simple.d.ts +180 -129
- package/menu/README.md +418 -0
- package/menu/fesm2022/menu.mjs +461 -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 +37 -37
- package/package.json +183 -154
- package/pagination/README.md +388 -5
- package/pagination/fesm2022/pagination.mjs +63 -63
- 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/resizable/README.md +269 -5
- package/resizable/fesm2022/resizable.mjs +19 -19
- 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 +63 -16
- package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
- package/select/README.md +408 -34
- package/select/fesm2022/select.mjs +80 -72
- 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 +30 -30
- package/sidebar/README.md +457 -5
- package/sidebar/fesm2022/sidebar.mjs +136 -134
- package/sidebar/types/sidebar.d.ts +3 -3
- package/skeleton/README.md +217 -5
- package/skeleton/fesm2022/skeleton.mjs +9 -9
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +29 -25
- package/sonner/README.md +317 -34
- package/sonner/fesm2022/sonner.mjs +9 -9
- package/spinner/README.md +255 -34
- package/spinner/fesm2022/spinner.mjs +8 -8
- package/switch/README.md +281 -34
- package/switch/fesm2022/switch.mjs +12 -14
- package/table/README.md +423 -5
- package/table/fesm2022/table.mjs +41 -41
- package/tabs/README.md +382 -34
- package/tabs/fesm2022/tabs.mjs +48 -38
- package/textarea/README.md +282 -5
- package/textarea/fesm2022/textarea.mjs +9 -9
- package/toggle/README.md +270 -5
- package/toggle/fesm2022/toggle.mjs +14 -14
- 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 +12 -12
- 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(() => 'relative');
|
|
42
|
+
classes(() => 'tw:relative');
|
|
43
43
|
}
|
|
44
44
|
onEmblaEvent(event) {
|
|
45
45
|
const emblaApi = this._emblaCarousel().emblaApi;
|
|
@@ -69,11 +69,11 @@ 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.
|
|
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: `
|
|
74
74
|
<div
|
|
75
75
|
emblaCarousel
|
|
76
|
-
class="overflow-hidden"
|
|
76
|
+
class="tw:overflow-hidden"
|
|
77
77
|
[plugins]="plugins()"
|
|
78
78
|
[options]="_emblaOptions()"
|
|
79
79
|
[subscribeToEvents]="['init', 'select', 'reInit']"
|
|
@@ -84,7 +84,7 @@ class HlmCarousel {
|
|
|
84
84
|
<ng-content />
|
|
85
85
|
`, isInline: true, dependencies: [{ kind: "directive", type: EmblaCarouselDirective, selector: "[emblaCarousel]", inputs: ["options", "plugins", "subscribeToEvents", "eventsThrottleTime"], outputs: ["emblaChange"], exportAs: ["emblaCarousel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
86
86
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarousel, decorators: [{
|
|
88
88
|
type: Component,
|
|
89
89
|
args: [{
|
|
90
90
|
selector: 'hlm-carousel',
|
|
@@ -99,7 +99,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
99
99
|
template: `
|
|
100
100
|
<div
|
|
101
101
|
emblaCarousel
|
|
102
|
-
class="overflow-hidden"
|
|
102
|
+
class="tw:overflow-hidden"
|
|
103
103
|
[plugins]="plugins()"
|
|
104
104
|
[options]="_emblaOptions()"
|
|
105
105
|
[subscribeToEvents]="['init', 'select', 'reInit']"
|
|
@@ -115,12 +115,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
115
115
|
class HlmCarouselContent {
|
|
116
116
|
_orientation = inject(HlmCarousel).orientation;
|
|
117
117
|
constructor() {
|
|
118
|
-
classes(() => ['flex', this._orientation() === 'horizontal' ? '
|
|
118
|
+
classes(() => ['tw:flex', this._orientation() === 'horizontal' ? 'tw:-ml-4' : 'tw:-mt-4 tw:flex-col']);
|
|
119
119
|
}
|
|
120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
121
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
121
|
+
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
122
|
}
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselContent, decorators: [{
|
|
124
124
|
type: Directive,
|
|
125
125
|
args: [{
|
|
126
126
|
selector: '[hlmCarouselContent],hlm-carousel-content',
|
|
@@ -133,12 +133,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
133
133
|
class HlmCarouselItem {
|
|
134
134
|
_orientation = inject(HlmCarousel).orientation;
|
|
135
135
|
constructor() {
|
|
136
|
-
classes(() => [
|
|
136
|
+
classes(() => [
|
|
137
|
+
'tw:min-w-0 tw:shrink-0 tw:grow-0 tw:basis-full',
|
|
138
|
+
this._orientation() === 'horizontal' ? 'tw:pl-4' : 'tw:pt-4',
|
|
139
|
+
]);
|
|
137
140
|
}
|
|
138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
139
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
142
|
+
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
143
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselItem, decorators: [{
|
|
142
145
|
type: Directive,
|
|
143
146
|
args: [{
|
|
144
147
|
selector: '[hlmCarouselItem],hlm-carousel-item',
|
|
@@ -153,9 +156,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
153
156
|
class HlmCarouselNext {
|
|
154
157
|
_button = inject(HlmBtn);
|
|
155
158
|
_carousel = inject(HlmCarousel);
|
|
156
|
-
_computedClass = computed(() => hlm('rounded-full absolute h-8 w-8', this._carousel.orientation() === 'horizontal'
|
|
157
|
-
? '
|
|
158
|
-
: '
|
|
159
|
+
_computedClass = computed(() => hlm('tw:rounded-full tw:absolute tw:h-8 tw:w-8', this._carousel.orientation() === 'horizontal'
|
|
160
|
+
? 'tw:-end-12 tw:top-1/2 tw:-translate-y-1/2'
|
|
161
|
+
: 'tw:-bottom-12 tw:left-1/2 tw:-translate-x-1/2 tw:rotate-90'), /* @ts-ignore */
|
|
159
162
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
160
163
|
isDisabled = () => !this._carousel.canScrollNext();
|
|
161
164
|
constructor() {
|
|
@@ -164,13 +167,13 @@ class HlmCarouselNext {
|
|
|
164
167
|
untracked(() => this._button.setClass(computedClass));
|
|
165
168
|
});
|
|
166
169
|
}
|
|
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>
|
|
170
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselNext, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
171
|
+
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: `
|
|
172
|
+
<ng-icon name="lucideArrowRight" class="tw:rtl:rotate-180" />
|
|
173
|
+
<span class="tw:sr-only">Next slide</span>
|
|
171
174
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
172
175
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselNext, decorators: [{
|
|
174
177
|
type: Component,
|
|
175
178
|
args: [{
|
|
176
179
|
selector: 'button[hlm-carousel-next], button[hlmCarouselNext]',
|
|
@@ -184,8 +187,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
184
187
|
'(click)': '_carousel.scrollNext()',
|
|
185
188
|
},
|
|
186
189
|
template: `
|
|
187
|
-
<ng-icon name="lucideArrowRight" class="rtl:rotate-180" />
|
|
188
|
-
<span class="sr-only">Next slide</span>
|
|
190
|
+
<ng-icon name="lucideArrowRight" class="tw:rtl:rotate-180" />
|
|
191
|
+
<span class="tw:sr-only">Next slide</span>
|
|
189
192
|
`,
|
|
190
193
|
}]
|
|
191
194
|
}], ctorParameters: () => [] });
|
|
@@ -193,9 +196,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
193
196
|
class HlmCarouselPrevious {
|
|
194
197
|
_button = inject(HlmBtn);
|
|
195
198
|
_carousel = inject(HlmCarousel);
|
|
196
|
-
_computedClass = computed(() => hlm('rounded-full absolute h-8 w-8', this._carousel.orientation() === 'horizontal'
|
|
197
|
-
? '
|
|
198
|
-
: '
|
|
199
|
+
_computedClass = computed(() => hlm('tw:rounded-full tw:absolute tw:h-8 tw:w-8', this._carousel.orientation() === 'horizontal'
|
|
200
|
+
? 'tw:-start-12 tw:top-1/2 tw:-translate-y-1/2'
|
|
201
|
+
: 'tw:-top-12 tw:left-1/2 tw:-translate-x-1/2 tw:rotate-90'), /* @ts-ignore */
|
|
199
202
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
200
203
|
isDisabled = () => !this._carousel.canScrollPrev();
|
|
201
204
|
constructor() {
|
|
@@ -204,13 +207,13 @@ class HlmCarouselPrevious {
|
|
|
204
207
|
untracked(() => this._button.setClass(computedClass));
|
|
205
208
|
});
|
|
206
209
|
}
|
|
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>
|
|
210
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselPrevious, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
211
|
+
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: `
|
|
212
|
+
<ng-icon name="lucideArrowLeft" class="tw:rtl:rotate-180" />
|
|
213
|
+
<span class="tw:sr-only">Previous slide</span>
|
|
211
214
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
212
215
|
}
|
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselPrevious, decorators: [{
|
|
214
217
|
type: Component,
|
|
215
218
|
args: [{
|
|
216
219
|
selector: 'button[hlm-carousel-previous], button[hlmCarouselPrevious]',
|
|
@@ -224,8 +227,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
224
227
|
'(click)': '_carousel.scrollPrev()',
|
|
225
228
|
},
|
|
226
229
|
template: `
|
|
227
|
-
<ng-icon name="lucideArrowLeft" class="rtl:rotate-180" />
|
|
228
|
-
<span class="sr-only">Previous slide</span>
|
|
230
|
+
<ng-icon name="lucideArrowLeft" class="tw:rtl:rotate-180" />
|
|
231
|
+
<span class="tw:sr-only">Previous slide</span>
|
|
229
232
|
`,
|
|
230
233
|
}]
|
|
231
234
|
}], ctorParameters: () => [] });
|
|
@@ -245,13 +248,13 @@ class HlmCarouselSlideDisplay {
|
|
|
245
248
|
return `${this.label()} ${currentSlide} of ${slideCount} is displayed`;
|
|
246
249
|
}, /* @ts-ignore */
|
|
247
250
|
...(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
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselSlideDisplay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
252
|
+
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: `
|
|
253
|
+
<span class="tw:sr-only">{{ _labelContent() }}</span>
|
|
251
254
|
<div aria-hidden="true" [class]="slideClass()">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>
|
|
252
255
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
253
256
|
}
|
|
254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselSlideDisplay, decorators: [{
|
|
255
258
|
type: Component,
|
|
256
259
|
args: [{
|
|
257
260
|
selector: 'hlm-carousel-slide-display',
|
|
@@ -260,7 +263,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
260
263
|
'data-slot': 'carousel-slide-display',
|
|
261
264
|
},
|
|
262
265
|
template: `
|
|
263
|
-
<span class="sr-only">{{ _labelContent() }}</span>
|
|
266
|
+
<span class="tw:sr-only">{{ _labelContent() }}</span>
|
|
264
267
|
<div aria-hidden="true" [class]="slideClass()">{{ _currentSlide() }} / {{ _carousel.slideCount() }}</div>
|
|
265
268
|
`,
|
|
266
269
|
}]
|
|
@@ -278,8 +281,8 @@ const HlmCarouselImports = [
|
|
|
278
281
|
HlmCarouselSlideDisplay,
|
|
279
282
|
];
|
|
280
283
|
class HlmCarouselModule {
|
|
281
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
282
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
284
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
285
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, imports: [HlmCarousel,
|
|
283
286
|
HlmCarouselContent,
|
|
284
287
|
HlmCarouselItem,
|
|
285
288
|
HlmCarouselPrevious,
|
|
@@ -290,10 +293,10 @@ class HlmCarouselModule {
|
|
|
290
293
|
HlmCarouselPrevious,
|
|
291
294
|
HlmCarouselNext,
|
|
292
295
|
HlmCarouselSlideDisplay] });
|
|
293
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
296
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, imports: [HlmCarouselPrevious,
|
|
294
297
|
HlmCarouselNext] });
|
|
295
298
|
}
|
|
296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
299
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCarouselModule, decorators: [{
|
|
297
300
|
type: NgModule,
|
|
298
301
|
args: [{
|
|
299
302
|
imports: [...HlmCarouselImports],
|
|
@@ -306,4 +309,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
306
309
|
*/
|
|
307
310
|
|
|
308
311
|
export { HlmCarousel, HlmCarouselContent, HlmCarouselImports, HlmCarouselItem, HlmCarouselModule, HlmCarouselNext, HlmCarouselPrevious, HlmCarouselSlideDisplay };
|
|
309
|
-
|
|
312
|
+
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Signal, InputSignal } from '@angular/core';
|
|
3
3
|
import { EmblaOptionsType, EmblaPluginType, EmblaEventType } from 'embla-carousel';
|
|
4
4
|
import { EmblaCarouselDirective } from 'embla-carousel-angular';
|
|
5
|
-
import * as i1 from '@egose/shadcn-theme-ng/button';
|
|
5
|
+
import * as i1 from '@egose/shadcn-theme-ng-tw/button';
|
|
6
6
|
import { ClassValue } from 'clsx';
|
|
7
7
|
|
|
8
8
|
declare class HlmCarousel {
|