codexly-ui 0.10.86 → 0.10.88

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,5 +1,6 @@
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, ApplicationRef, EnvironmentInjector, RendererFactory2, createComponent, DestroyRef, untracked, HostListener, viewChild, ViewChild, Injector, ChangeDetectorRef, NgZone, model, contentChildren, ContentChildren, ViewChildren, numberAttribute, booleanAttribute, Input } from '@angular/core';
3
+ import { DomSanitizer } from '@angular/platform-browser';
3
4
  import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgStyle, CurrencyPipe, DecimalPipe } from '@angular/common';
4
5
  import * as i1$1 from '@angular/forms';
5
6
  import { NG_VALUE_ACCESSOR, FormControl, NgControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
@@ -209,24 +210,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
209
210
  }]
210
211
  }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }] } });
211
212
 
212
- const BUTTON_BASE_CLASS = 'relative overflow-hidden inline-flex items-center justify-center font-medium select-none transition-[color,background-color,border-color,box-shadow] duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2';
213
- const BUTTON_SIZE_MAP = {
214
- xxs: 'text-xs px-1.5 py-0.5 gap-0.5',
215
- xs: 'text-xs px-2 py-1 gap-1',
216
- sm: 'text-xs px-3 py-1.5 gap-1.5',
217
- md: 'text-sm px-4 py-2 gap-2',
218
- lg: 'text-base px-5 py-2.5 gap-2.5',
219
- };
220
- const BUTTON_SHAPE_FIXED = {
221
- pill: 'rounded-full',
222
- circle: 'rounded-full',
213
+ const SOCIAL_ICON_DEFS = {
214
+ instagram: {
215
+ viewBox: '0 0 24 24',
216
+ markup: `<rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
217
+ <circle cx="12" cy="12" r="4.3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
218
+ <circle cx="17.4" cy="6.6" r="1.1" fill="currentColor" stroke="none"/>`,
219
+ },
220
+ facebook: {
221
+ viewBox: '0 0 24 24',
222
+ markup: `<path d="M14.5 21v-8h2.7l.4-3.1h-3.1V7.9c0-.9.25-1.5 1.55-1.5h1.65V3.6C17.4 3.5 16.5 3.4 15.5 3.4c-2.4 0-4 1.45-4 4.1v2.4H8.8v3.1h2.7v8h3z" fill="currentColor"/>`,
223
+ },
224
+ tiktok: {
225
+ viewBox: '0 0 24 24',
226
+ markup: `<path d="M16.6 3c.4 2.2 1.9 3.7 4.1 3.9v2.9c-1.5.1-2.9-.4-4.1-1.2v6.6c0 3.2-2.6 5.6-5.7 5.6C7.7 20.8 5 18.4 5 15.2c0-3.1 2.5-5.6 5.6-5.7.3 0 .6 0 .9.1v3c-.3-.1-.6-.1-.9-.1-1.5 0-2.7 1.2-2.7 2.7s1.2 2.7 2.7 2.7 2.8-1.1 2.8-2.6V3h3.2z" fill="currentColor"/>`,
227
+ },
223
228
  };
224
- const BUTTON_ICON_ONLY_SIZE_MAP = {
225
- xxs: 'w-5 h-5 p-0 text-xs',
226
- xs: 'w-7 h-7 p-0 text-xs',
227
- sm: 'w-8 h-8 p-0 text-sm',
228
- md: 'w-10 h-10 p-0 text-sm',
229
- lg: 'w-11 h-11 p-0 text-sm',
229
+ const SOCIAL_ICON_SIZE_MAP = {
230
+ xxs: 'w-5 h-5 p-0.5',
231
+ xs: 'w-7 h-7 p-1',
232
+ sm: 'w-8 h-8 p-1.5',
233
+ md: 'w-10 h-10 p-2',
234
+ lg: 'w-11 h-11 p-2.5',
230
235
  };
231
236
 
232
237
  const CLX_FONT_CATALOG = [
@@ -686,6 +691,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
686
691
  args: [{ providedIn: 'root' }]
687
692
  }], ctorParameters: () => [] });
688
693
 
694
+ class ClxSocialIconComponent {
695
+ _sanitizer = inject(DomSanitizer);
696
+ _themeSvc = inject(ClxThemeService);
697
+ platform = input.required(...(ngDevMode ? [{ debugName: "platform" }] : /* istanbul ignore next */ []));
698
+ variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
699
+ color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
700
+ size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
701
+ _color = computed(() => this.color() ?? this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
702
+ _size = computed(() => this.size() ?? this._themeSvc.config().defaultSize, ...(ngDevMode ? [{ debugName: "_size" }] : /* istanbul ignore next */ []));
703
+ _markup = computed(() => {
704
+ const def = SOCIAL_ICON_DEFS[this.platform()];
705
+ return this._sanitizer.bypassSecurityTrustHtml(`<svg viewBox="${def.viewBox}" class="w-full h-full">${def.markup}</svg>`);
706
+ }, ...(ngDevMode ? [{ debugName: "_markup" }] : /* istanbul ignore next */ []));
707
+ _hostClass = computed(() => {
708
+ const { color, shade } = parseColorInput(this._color());
709
+ const base = resolveColor(this._color());
710
+ const variant = this.variant();
711
+ let cls;
712
+ if (variant === 'solid')
713
+ cls = `${base.bg} text-white ${base.hoverBg}`;
714
+ else if (variant === 'light')
715
+ cls = `${base.bgSubtle} text-${color}-${shade} hover:${base.bgMuted.replace('/10', '/20')}`;
716
+ else if (variant === 'outline')
717
+ cls = `border-2 ${base.border} text-${color}-${shade} ${base.hoverBgBase} hover:text-white`;
718
+ else if (variant === 'ghost')
719
+ cls = `bg-black/10 ${base.textSubtle} ${base.hoverBgMuted}`;
720
+ else
721
+ cls = `${base.textSubtle} hover:underline`;
722
+ const sizeClass = SOCIAL_ICON_SIZE_MAP[this._size()];
723
+ return `inline-flex items-center justify-center rounded-xl transition-colors duration-200 cursor-pointer ${sizeClass} ${cls}`;
724
+ }, ...(ngDevMode ? [{ debugName: "_hostClass" }] : /* istanbul ignore next */ []));
725
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxSocialIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
726
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.15", type: ClxSocialIconComponent, isStandalone: true, selector: "a[clx-social-icon], button[clx-social-icon]", inputs: { platform: { classPropertyName: "platform", publicName: "platform", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_hostClass()", "attr.aria-label": "platform()" } }, ngImport: i0, template: `<span class="w-full h-full [&>svg]:w-full [&>svg]:h-full" [innerHTML]="_markup()"></span>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
727
+ }
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxSocialIconComponent, decorators: [{
729
+ type: Component,
730
+ args: [{
731
+ selector: 'a[clx-social-icon], button[clx-social-icon]',
732
+ standalone: true,
733
+ template: `<span class="w-full h-full [&>svg]:w-full [&>svg]:h-full" [innerHTML]="_markup()"></span>`,
734
+ encapsulation: ViewEncapsulation.None,
735
+ changeDetection: ChangeDetectionStrategy.OnPush,
736
+ host: {
737
+ '[class]': '_hostClass()',
738
+ '[attr.aria-label]': 'platform()',
739
+ },
740
+ }]
741
+ }], propDecorators: { platform: [{ type: i0.Input, args: [{ isSignal: true, alias: "platform", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
742
+
743
+ const BUTTON_BASE_CLASS = 'relative overflow-hidden inline-flex items-center justify-center font-medium select-none transition-[color,background-color,border-color,box-shadow] duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2';
744
+ const BUTTON_SIZE_MAP = {
745
+ xxs: 'text-xs px-1.5 py-0.5 gap-0.5',
746
+ xs: 'text-xs px-2 py-1 gap-1',
747
+ sm: 'text-xs px-3 py-1.5 gap-1.5',
748
+ md: 'text-sm px-4 py-2 gap-2',
749
+ lg: 'text-base px-5 py-2.5 gap-2.5',
750
+ };
751
+ const BUTTON_SHAPE_FIXED = {
752
+ pill: 'rounded-full',
753
+ circle: 'rounded-full',
754
+ };
755
+ const BUTTON_ICON_ONLY_SIZE_MAP = {
756
+ xxs: 'w-5 h-5 p-0 text-xs',
757
+ xs: 'w-7 h-7 p-0 text-xs',
758
+ sm: 'w-8 h-8 p-0 text-sm',
759
+ md: 'w-10 h-10 p-0 text-sm',
760
+ lg: 'w-11 h-11 p-0 text-sm',
761
+ };
762
+
689
763
  const BADGE_SIZE_MAP = {
690
764
  xs: 'text-[10px] px-1.5 py-0.5',
691
765
  sm: 'text-xs px-2 py-1',
@@ -16422,5 +16496,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
16422
16496
  * Generated bundle index. Do not edit.
16423
16497
  */
16424
16498
 
16425
- export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxMenuItemTrailingDirective, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProductQuickViewComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSearchComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
16499
+ export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxMenuItemTrailingDirective, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProductQuickViewComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSearchComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSocialIconComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
16426
16500
  //# sourceMappingURL=codexly-ui.mjs.map