UNPKG

@sixbell-telco/sdk

Version:

A collection of reusable components designed for use in Sixbell Telco Angular projects

59 lines (54 loc) 4.41 kB
import * as i0 from '@angular/core'; import { input, Component, computed, Host } from '@angular/core'; import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography'; import { cn } from '@sixbell-telco/sdk/utils/cn'; import { cva } from 'class-variance-authority'; class AccordionComponent { name = input('accordion'); type = input('default'); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.0", type: AccordionComponent, isStandalone: true, selector: "st-accordion", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"join join-vertical w-full\">\n\t<ng-content></ng-content>\n</div>\n" }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: AccordionComponent, decorators: [{ type: Component, args: [{ selector: 'st-accordion', imports: [], template: "<div class=\"join join-vertical w-full\">\n\t<ng-content></ng-content>\n</div>\n" }] }] }); const accordionItemComponent = cva(['collapse join-item border border-neutral'], { variants: { variant: { default: [], arrow: ['collapse-arrow'], plus: ['collapse-plus'], }, }, defaultVariants: { variant: 'default', }, }); class AccordionItemComponent { accordion; header = input(''); opened = input(false); variant = input(); name; type; constructor(accordion) { this.accordion = accordion; this.name = this.accordion.name(); this.type = this.accordion.type() === 'single' ? 'radio' : 'checkbox'; } componentClass = computed(() => cn(accordionItemComponent({ variant: this.variant() }))); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: AccordionItemComponent, deps: [{ token: AccordionComponent, host: true }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.0", type: AccordionItemComponent, isStandalone: true, selector: "st-accordion-item", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"componentClass()\">\n\t<input [type]=\"type\" [name]=\"name\" [checked]=\"opened()\" />\n\t<div class=\"collapse-title\">\n\t\t<div typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t\t{{ header() }}\n\t\t</div>\n\t</div>\n\t<div class=\"collapse-content\">\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: AccordionItemComponent, decorators: [{ type: Component, args: [{ selector: 'st-accordion-item', imports: [TypographyDirective], template: "<div [class]=\"componentClass()\">\n\t<input [type]=\"type\" [name]=\"name\" [checked]=\"opened()\" />\n\t<div class=\"collapse-title\">\n\t\t<div typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t\t{{ header() }}\n\t\t</div>\n\t</div>\n\t<div class=\"collapse-content\">\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n" }] }], ctorParameters: () => [{ type: AccordionComponent, decorators: [{ type: Host }] }] }); /** * Generated bundle index. Do not edit. */ export { AccordionComponent, AccordionItemComponent, accordionItemComponent }; //# sourceMappingURL=sixbell-telco-sdk-components-accordion.mjs.map