@neuravision/ng-construct 0.3.6 → 0.4.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.
@@ -2964,6 +2964,104 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2964
2964
  `, styles: [":host{display:block}\n"] }]
2965
2965
  }], propDecorators: { activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: false }] }, { type: i0.Output, args: ["activeTabChange"] }], panels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AfTabPanelComponent), { isSignal: true }] }], tabButtons: [{ type: i0.ViewChildren, args: ['tabButton', { isSignal: true }] }] } });
2966
2966
 
2967
+ /**
2968
+ * Router-based tab navigation component.
2969
+ *
2970
+ * Uses the `ct-tabs` CSS classes from the Construct Design System but renders
2971
+ * `<a routerLink>` elements for navigation. Active state is determined
2972
+ * automatically via `routerLinkActive`.
2973
+ *
2974
+ * For content-panel tabs (show/hide content without routing), use `<af-tabs>` instead.
2975
+ *
2976
+ * @example
2977
+ * <af-nav-tabs
2978
+ * [tabs]="[
2979
+ * { id: 'my', label: 'My Documents', routerLink: '/documents/my' },
2980
+ * { id: 'all', label: 'All Documents', routerLink: '/documents/all' }
2981
+ * ]">
2982
+ * </af-nav-tabs>
2983
+ */
2984
+ class AfNavTabsComponent {
2985
+ /** Tab items to render. */
2986
+ tabs = input.required(...(ngDevMode ? [{ debugName: "tabs" }] : []));
2987
+ /** Visual variant. `'pill'` renders pill-shaped tabs with background. */
2988
+ variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
2989
+ /** Size variant. */
2990
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
2991
+ /** Accessible label for the tab navigation. */
2992
+ ariaLabel = input('Sub navigation', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
2993
+ containerClasses = computed(() => {
2994
+ const classes = ['ct-tabs'];
2995
+ const v = this.variant();
2996
+ if (v === 'pill')
2997
+ classes.push('ct-tabs--pill');
2998
+ const s = this.size();
2999
+ if (s !== 'md')
3000
+ classes.push(`ct-tabs--${s}`);
3001
+ return classes.join(' ');
3002
+ }, ...(ngDevMode ? [{ debugName: "containerClasses" }] : []));
3003
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AfNavTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3004
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: AfNavTabsComponent, isStandalone: true, selector: "af-nav-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
3005
+ <nav [class]="containerClasses()" [attr.aria-label]="ariaLabel()">
3006
+ <ul class="ct-tabs__list">
3007
+ @for (tab of tabs(); track tab.id) {
3008
+ <li>
3009
+ @if (tab.disabled) {
3010
+ <span
3011
+ class="ct-tabs__trigger"
3012
+ aria-disabled="true"
3013
+ [attr.id]="'nav-tab-' + tab.id">
3014
+ {{ tab.label }}
3015
+ </span>
3016
+ } @else {
3017
+ <a
3018
+ class="ct-tabs__trigger"
3019
+ [routerLink]="tab.routerLink"
3020
+ routerLinkActive="ct-tabs__trigger--active"
3021
+ #rla="routerLinkActive"
3022
+ [attr.aria-current]="rla.isActive ? 'page' : null"
3023
+ [attr.id]="'nav-tab-' + tab.id">
3024
+ {{ tab.label }}
3025
+ </a>
3026
+ }
3027
+ </li>
3028
+ }
3029
+ </ul>
3030
+ </nav>
3031
+ `, isInline: true, styles: [":host{display:block}ul{list-style:none;margin:0;padding:0}li{display:contents}.ct-tabs__trigger--active{color:var(--color-text-primary)}.ct-tabs__trigger--active:after{background:var(--ct-tabs-indicator-color, var(--color-brand-primary))}.ct-tabs--pill .ct-tabs__trigger--active{background:var(--color-bg-elevated);box-shadow:var(--shadow-sm)}.ct-tabs--pill .ct-tabs__trigger--active:after{display:none}.ct-tabs__trigger[aria-disabled=true]{color:var(--color-text-muted);opacity:var(--opacity-disabled, .5);cursor:not-allowed;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3032
+ }
3033
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AfNavTabsComponent, decorators: [{
3034
+ type: Component,
3035
+ args: [{ selector: 'af-nav-tabs', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink, RouterLinkActive], template: `
3036
+ <nav [class]="containerClasses()" [attr.aria-label]="ariaLabel()">
3037
+ <ul class="ct-tabs__list">
3038
+ @for (tab of tabs(); track tab.id) {
3039
+ <li>
3040
+ @if (tab.disabled) {
3041
+ <span
3042
+ class="ct-tabs__trigger"
3043
+ aria-disabled="true"
3044
+ [attr.id]="'nav-tab-' + tab.id">
3045
+ {{ tab.label }}
3046
+ </span>
3047
+ } @else {
3048
+ <a
3049
+ class="ct-tabs__trigger"
3050
+ [routerLink]="tab.routerLink"
3051
+ routerLinkActive="ct-tabs__trigger--active"
3052
+ #rla="routerLinkActive"
3053
+ [attr.aria-current]="rla.isActive ? 'page' : null"
3054
+ [attr.id]="'nav-tab-' + tab.id">
3055
+ {{ tab.label }}
3056
+ </a>
3057
+ }
3058
+ </li>
3059
+ }
3060
+ </ul>
3061
+ </nav>
3062
+ `, styles: [":host{display:block}ul{list-style:none;margin:0;padding:0}li{display:contents}.ct-tabs__trigger--active{color:var(--color-text-primary)}.ct-tabs__trigger--active:after{background:var(--ct-tabs-indicator-color, var(--color-brand-primary))}.ct-tabs--pill .ct-tabs__trigger--active{background:var(--color-bg-elevated);box-shadow:var(--shadow-sm)}.ct-tabs--pill .ct-tabs__trigger--active:after{display:none}.ct-tabs__trigger[aria-disabled=true]{color:var(--color-text-muted);opacity:var(--opacity-disabled, .5);cursor:not-allowed;pointer-events:none}\n"] }]
3063
+ }], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
3064
+
2967
3065
  /**
2968
3066
  * Dropdown menu component implementing the WAI-ARIA Menu Pattern.
2969
3067
  *
@@ -3407,10 +3505,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
3407
3505
  }], propDecorators: { currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: false }] }], previousLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousLabel", required: false }] }], nextLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nextLabel", required: false }] }], maxVisiblePages: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisiblePages", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
3408
3506
 
3409
3507
  /**
3410
- * Breadcrumbs navigation component
3508
+ * Breadcrumbs navigation component with Angular Router support.
3509
+ *
3510
+ * Items with `routerLink` navigate via the Angular Router (no page reload).
3511
+ * Items with `url` render a plain `<a href>` (for external links).
3512
+ * The last item is always rendered as static text (current page).
3411
3513
  *
3412
3514
  * @example
3413
- * <af-breadcrumbs [items]="breadcrumbs"></af-breadcrumbs>
3515
+ * <af-breadcrumbs [items]="[
3516
+ * { label: 'Home', routerLink: '/' },
3517
+ * { label: 'Documents', routerLink: '/documents' },
3518
+ * { label: 'My Documents' }
3519
+ * ]"></af-breadcrumbs>
3414
3520
  */
3415
3521
  class AfBreadcrumbsComponent {
3416
3522
  /** Breadcrumb items */
@@ -3421,34 +3527,50 @@ class AfBreadcrumbsComponent {
3421
3527
  <ol class="ct-breadcrumbs__list">
3422
3528
  @for (item of items(); track $index; let isLast = $last) {
3423
3529
  <li class="ct-breadcrumbs__item">
3424
- @if (!isLast && item.url) {
3530
+ @if (isLast) {
3531
+ <span class="ct-breadcrumbs__current" aria-current="page">{{ item.label }}</span>
3532
+ } @else if (item.routerLink) {
3533
+ <a class="ct-breadcrumbs__link" [routerLink]="item.routerLink">
3534
+ {{ item.label }}
3535
+ </a>
3536
+ <span class="ct-breadcrumbs__separator" aria-hidden="true">/</span>
3537
+ } @else if (item.url) {
3425
3538
  <a class="ct-breadcrumbs__link" [href]="item.url">
3426
3539
  {{ item.label }}
3427
3540
  </a>
3428
- <span class="ct-breadcrumbs__separator">/</span>
3541
+ <span class="ct-breadcrumbs__separator" aria-hidden="true">/</span>
3429
3542
  } @else {
3430
- <span class="ct-breadcrumbs__current">{{ item.label }}</span>
3543
+ <span class="ct-breadcrumbs__text">{{ item.label }}</span>
3544
+ <span class="ct-breadcrumbs__separator" aria-hidden="true">/</span>
3431
3545
  }
3432
3546
  </li>
3433
3547
  }
3434
3548
  </ol>
3435
3549
  </nav>
3436
- `, isInline: true, styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3550
+ `, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3437
3551
  }
3438
3552
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: AfBreadcrumbsComponent, decorators: [{
3439
3553
  type: Component,
3440
- args: [{ selector: 'af-breadcrumbs', changeDetection: ChangeDetectionStrategy.OnPush, template: `
3554
+ args: [{ selector: 'af-breadcrumbs', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink], template: `
3441
3555
  <nav class="ct-breadcrumbs" aria-label="Breadcrumb">
3442
3556
  <ol class="ct-breadcrumbs__list">
3443
3557
  @for (item of items(); track $index; let isLast = $last) {
3444
3558
  <li class="ct-breadcrumbs__item">
3445
- @if (!isLast && item.url) {
3559
+ @if (isLast) {
3560
+ <span class="ct-breadcrumbs__current" aria-current="page">{{ item.label }}</span>
3561
+ } @else if (item.routerLink) {
3562
+ <a class="ct-breadcrumbs__link" [routerLink]="item.routerLink">
3563
+ {{ item.label }}
3564
+ </a>
3565
+ <span class="ct-breadcrumbs__separator" aria-hidden="true">/</span>
3566
+ } @else if (item.url) {
3446
3567
  <a class="ct-breadcrumbs__link" [href]="item.url">
3447
3568
  {{ item.label }}
3448
3569
  </a>
3449
- <span class="ct-breadcrumbs__separator">/</span>
3570
+ <span class="ct-breadcrumbs__separator" aria-hidden="true">/</span>
3450
3571
  } @else {
3451
- <span class="ct-breadcrumbs__current">{{ item.label }}</span>
3572
+ <span class="ct-breadcrumbs__text">{{ item.label }}</span>
3573
+ <span class="ct-breadcrumbs__separator" aria-hidden="true">/</span>
3452
3574
  }
3453
3575
  </li>
3454
3576
  }
@@ -8153,5 +8275,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
8153
8275
  * Generated bundle index. Do not edit.
8154
8276
  */
8155
8277
 
8156
- export { AfAccordionComponent, AfAccordionItemComponent, AfAlertComponent, AfAppShellComponent, AfAppShellPageHeaderComponent, AfAppShellV2Component, AfAppShellV2ToolbarComponent, AfAvatarComponent, AfBadgeComponent, AfBannerComponent, AfBreadcrumbsComponent, AfButtonComponent, AfCardComponent, AfCellDefDirective, AfCheckboxComponent, AfChipInputComponent, AfComboboxComponent, AfDataTableComponent, AfDatepickerComponent, AfDividerComponent, AfDrawerComponent, AfDropdownComponent, AfEmptyStateComponent, AfFieldComponent, AfFileUploadComponent, AfFormatLabelPipe, AfIconComponent, AfInputComponent, AfModalComponent, AfNavItemComponent, AfNavbarComponent, AfPaginationComponent, AfPopoverComponent, AfPopoverTriggerDirective, AfProgressBarComponent, AfRadioComponent, AfRadioGroupComponent, AfSelectComponent, AfSelectMenuComponent, AfSidebarComponent, AfSkeletonComponent, AfSkipLinkComponent, AfSliderComponent, AfSpinnerComponent, AfSwitchComponent, AfTabPanelComponent, AfTableBodyComponent, AfTableCellComponent, AfTableComponent, AfTableHeaderCellComponent, AfTableHeaderComponent, AfTableRowComponent, AfTabsComponent, AfTextareaComponent, AfToastContainerComponent, AfToastService, AfToggleGroupComponent, AfToolbarComponent, AfTooltipDirective };
8278
+ export { AfAccordionComponent, AfAccordionItemComponent, AfAlertComponent, AfAppShellComponent, AfAppShellPageHeaderComponent, AfAppShellV2Component, AfAppShellV2ToolbarComponent, AfAvatarComponent, AfBadgeComponent, AfBannerComponent, AfBreadcrumbsComponent, AfButtonComponent, AfCardComponent, AfCellDefDirective, AfCheckboxComponent, AfChipInputComponent, AfComboboxComponent, AfDataTableComponent, AfDatepickerComponent, AfDividerComponent, AfDrawerComponent, AfDropdownComponent, AfEmptyStateComponent, AfFieldComponent, AfFileUploadComponent, AfFormatLabelPipe, AfIconComponent, AfInputComponent, AfModalComponent, AfNavItemComponent, AfNavTabsComponent, AfNavbarComponent, AfPaginationComponent, AfPopoverComponent, AfPopoverTriggerDirective, AfProgressBarComponent, AfRadioComponent, AfRadioGroupComponent, AfSelectComponent, AfSelectMenuComponent, AfSidebarComponent, AfSkeletonComponent, AfSkipLinkComponent, AfSliderComponent, AfSpinnerComponent, AfSwitchComponent, AfTabPanelComponent, AfTableBodyComponent, AfTableCellComponent, AfTableComponent, AfTableHeaderCellComponent, AfTableHeaderComponent, AfTableRowComponent, AfTabsComponent, AfTextareaComponent, AfToastContainerComponent, AfToastService, AfToggleGroupComponent, AfToolbarComponent, AfTooltipDirective };
8157
8279
  //# sourceMappingURL=neuravision-ng-construct.mjs.map