codexly-ui 0.19.4 → 0.19.6

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, InjectionToken, inject, PLATFORM_ID, signal, effect, Injectable, ElementRef, HostAttributeToken, output, Directive, forwardRef, contentChild, model, ApplicationRef, EnvironmentInjector, RendererFactory2, createComponent, DestroyRef, untracked, ViewChildren, HostListener, viewChild, ViewChild, Injector, ChangeDetectorRef, NgZone, contentChildren, ContentChildren, numberAttribute, booleanAttribute, Input } from '@angular/core';
3
3
  import { DomSanitizer } from '@angular/platform-browser';
4
- import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgStyle, CurrencyPipe, DecimalPipe } from '@angular/common';
4
+ import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgStyle, NgOptimizedImage, CurrencyPipe, DecimalPipe } from '@angular/common';
5
5
  import * as i1$1 from '@angular/forms';
6
6
  import { NG_VALUE_ACCESSOR, FormControl, NgControl, TouchedChangeEvent, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
7
7
  import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -1247,17 +1247,24 @@ class ClxButtonGroupComponent {
1247
1247
  _groupClass = computed(() => {
1248
1248
  const isVertical = this.orientation() === 'vertical';
1249
1249
  const dir = isVertical ? 'flex-col' : 'flex-row';
1250
- const gap = this.attached() ? 'gap-0' : 'gap-2';
1251
- return `inline-flex items-center ${dir} ${gap}`;
1250
+ if (!this.attached())
1251
+ return `inline-flex items-center ${dir} gap-2`;
1252
+ // Attached = one segmented control: only the outer corners stay rounded and neighbouring
1253
+ // borders overlap (no double line). The hovered/focused button is raised so its full border
1254
+ // and focus ring are never hidden under the next one.
1255
+ const joined = isVertical
1256
+ ? '[&>*:not(:first-child)]:!rounded-t-none [&>*:not(:last-child)]:!rounded-b-none [&>*:not(:first-child)]:-mt-0.5'
1257
+ : '[&>*:not(:first-child)]:!rounded-l-none [&>*:not(:last-child)]:!rounded-r-none [&>*:not(:first-child)]:-ml-0.5';
1258
+ return `inline-flex items-stretch ${dir} gap-0 ${joined} [&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10`;
1252
1259
  }, ...(ngDevMode ? [{ debugName: "_groupClass" }] : /* istanbul ignore next */ []));
1253
1260
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1254
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxButtonGroupComponent, isStandalone: true, selector: "clx-button-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, attached: { classPropertyName: "attached", publicName: "attached", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex flex-col gap-1.5" }, ngImport: i0, template: `
1255
- @if (label()) {
1256
- <span class="text-sm font-medium text-clx-text-label leading-none">{{ label() }}</span>
1257
- }
1258
- <div [class]="_groupClass()">
1259
- <ng-content />
1260
- </div>
1261
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxButtonGroupComponent, isStandalone: true, selector: "clx-button-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, attached: { classPropertyName: "attached", publicName: "attached", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex flex-col gap-1.5" }, ngImport: i0, template: `
1262
+ @if (label()) {
1263
+ <span class="text-sm font-medium text-clx-text-label leading-none">{{ label() }}</span>
1264
+ }
1265
+ <div [class]="_groupClass()">
1266
+ <ng-content />
1267
+ </div>
1261
1268
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1262
1269
  }
1263
1270
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxButtonGroupComponent, decorators: [{
@@ -1265,13 +1272,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
1265
1272
  args: [{
1266
1273
  selector: 'clx-button-group',
1267
1274
  standalone: true,
1268
- template: `
1269
- @if (label()) {
1270
- <span class="text-sm font-medium text-clx-text-label leading-none">{{ label() }}</span>
1271
- }
1272
- <div [class]="_groupClass()">
1273
- <ng-content />
1274
- </div>
1275
+ template: `
1276
+ @if (label()) {
1277
+ <span class="text-sm font-medium text-clx-text-label leading-none">{{ label() }}</span>
1278
+ }
1279
+ <div [class]="_groupClass()">
1280
+ <ng-content />
1281
+ </div>
1275
1282
  `,
1276
1283
  encapsulation: ViewEncapsulation.None,
1277
1284
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -17126,12 +17133,13 @@ class ClxProductComponent {
17126
17133
 
17127
17134
  <!-- Image Container -->
17128
17135
  <div [class]="_imageContainerClass()">
17129
- @if (product()?.main_image) {
17136
+ @if (product()?.main_image; as mainImage) {
17130
17137
  <img
17131
- [src]="product()!.main_image"
17138
+ [ngSrc]="mainImage"
17132
17139
  [alt]="product()!.name"
17133
17140
  [class]="_imageClass()"
17134
- [loading]="priority() ? 'eager' : 'lazy'"
17141
+ [priority]="priority()"
17142
+ fill
17135
17143
  />
17136
17144
  } @else {
17137
17145
  <div class="w-full h-full flex items-center justify-center bg-clx-surface-2">
@@ -17220,14 +17228,14 @@ class ClxProductComponent {
17220
17228
  </div>
17221
17229
  </article>
17222
17230
  }
17223
- `, isInline: true, dependencies: [{ kind: "component", type: ClxBadgeComponent, selector: "span[clx-badge]", inputs: ["variant", "color", "size", "shape", "positioned"] }, { kind: "component", type: ClxButtonComponent, selector: "button[clx-button], a[clx-button]", inputs: ["variant", "color", "emphasis", "textColor", "size", "shape", "loading", "disabled", "block", "icon", "iconPosition", "iconOnly", "badge", "badgeColor"] }, { kind: "component", type: ClxSkeletonComponent, selector: "clx-skeleton", inputs: ["variant", "size", "width", "height"] }, { kind: "directive", type: ClxTooltipDirective, selector: "[clxTooltip]", inputs: ["clxTooltip", "clxTooltipPosition", "clxTooltipColor", "clxTooltipSize", "clxTooltipDelay"] }, { kind: "pipe", type: CurrencyPipe, name: "currency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
17231
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "component", type: ClxBadgeComponent, selector: "span[clx-badge]", inputs: ["variant", "color", "size", "shape", "positioned"] }, { kind: "component", type: ClxButtonComponent, selector: "button[clx-button], a[clx-button]", inputs: ["variant", "color", "emphasis", "textColor", "size", "shape", "loading", "disabled", "block", "icon", "iconPosition", "iconOnly", "badge", "badgeColor"] }, { kind: "component", type: ClxSkeletonComponent, selector: "clx-skeleton", inputs: ["variant", "size", "width", "height"] }, { kind: "directive", type: ClxTooltipDirective, selector: "[clxTooltip]", inputs: ["clxTooltip", "clxTooltipPosition", "clxTooltipColor", "clxTooltipSize", "clxTooltipDelay"] }, { kind: "pipe", type: CurrencyPipe, name: "currency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
17224
17232
  }
17225
17233
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxProductComponent, decorators: [{
17226
17234
  type: Component,
17227
17235
  args: [{
17228
17236
  selector: 'clx-product',
17229
17237
  standalone: true,
17230
- imports: [CurrencyPipe, ClxBadgeComponent, ClxButtonComponent, ClxSkeletonComponent, ClxTooltipDirective],
17238
+ imports: [CurrencyPipe, NgOptimizedImage, ClxBadgeComponent, ClxButtonComponent, ClxSkeletonComponent, ClxTooltipDirective],
17231
17239
  template: `
17232
17240
  @if (loading()) {
17233
17241
  @if (_h()) {
@@ -17263,12 +17271,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
17263
17271
 
17264
17272
  <!-- Image Container -->
17265
17273
  <div [class]="_imageContainerClass()">
17266
- @if (product()?.main_image) {
17274
+ @if (product()?.main_image; as mainImage) {
17267
17275
  <img
17268
- [src]="product()!.main_image"
17276
+ [ngSrc]="mainImage"
17269
17277
  [alt]="product()!.name"
17270
17278
  [class]="_imageClass()"
17271
- [loading]="priority() ? 'eager' : 'lazy'"
17279
+ [priority]="priority()"
17280
+ fill
17272
17281
  />
17273
17282
  } @else {
17274
17283
  <div class="w-full h-full flex items-center justify-center bg-clx-surface-2">