bromcom-ui-next 0.1.2 → 0.1.3

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.
Files changed (111) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/bromcom-ui.esm.js.map +1 -1
  4. package/dist/bromcom-ui/p-047e562f.entry.js +2 -0
  5. package/dist/bromcom-ui/p-047e562f.entry.js.map +1 -0
  6. package/dist/bromcom-ui/p-3805363a.entry.js +2 -0
  7. package/dist/bromcom-ui/{p-2d836917.entry.js.map → p-3805363a.entry.js.map} +1 -1
  8. package/dist/bromcom-ui/p-61c030c5.js +3 -0
  9. package/dist/bromcom-ui/p-61c030c5.js.map +1 -0
  10. package/dist/bromcom-ui/p-6430a887.entry.js +2 -0
  11. package/dist/bromcom-ui/p-6430a887.entry.js.map +1 -0
  12. package/dist/bromcom-ui/p-9e94d920.entry.js +2 -0
  13. package/dist/bromcom-ui/p-9e94d920.entry.js.map +1 -0
  14. package/dist/bromcom-ui/p-bde58312.entry.js +2 -0
  15. package/dist/bromcom-ui/p-bde58312.entry.js.map +1 -0
  16. package/dist/bromcom-ui/p-dcc13a55.entry.js +2 -0
  17. package/dist/bromcom-ui/{p-0a74cf15.entry.js.map → p-dcc13a55.entry.js.map} +1 -1
  18. package/dist/bromcom-ui/p-e7732b0c.entry.js +2 -0
  19. package/dist/bromcom-ui/{p-f0c61f8c.entry.js.map → p-e7732b0c.entry.js.map} +1 -1
  20. package/dist/cjs/bcm-accordion-group.cjs.entry.js +92 -0
  21. package/dist/cjs/bcm-accordion-group.cjs.entry.js.map +1 -0
  22. package/dist/cjs/bcm-accordion.cjs.entry.js +128 -0
  23. package/dist/cjs/bcm-accordion.cjs.entry.js.map +1 -0
  24. package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
  25. package/dist/cjs/bcm-alert.cjs.entry.js.map +1 -1
  26. package/dist/cjs/bcm-avatar.cjs.entry.js +2 -2
  27. package/dist/cjs/bcm-avatar.cjs.entry.js.map +1 -1
  28. package/dist/cjs/bcm-button_2.cjs.entry.js +549 -0
  29. package/dist/cjs/bcm-button_2.cjs.entry.js.map +1 -0
  30. package/dist/cjs/bcm-chip.cjs.entry.js +130 -0
  31. package/dist/cjs/bcm-chip.cjs.entry.js.map +1 -0
  32. package/dist/cjs/bcm-text.cjs.entry.js +3 -3
  33. package/dist/cjs/bcm-text.cjs.entry.js.map +1 -1
  34. package/dist/cjs/bromcom-ui.cjs.js +2 -2
  35. package/dist/cjs/{index-638f2d15.js → index-c36002ae.js} +32 -3
  36. package/dist/cjs/index-c36002ae.js.map +1 -0
  37. package/dist/cjs/loader.cjs.js +2 -2
  38. package/dist/collection/collection-manifest.json +1 -0
  39. package/dist/collection/components/accordion/accordion.css +1 -1
  40. package/dist/collection/components/accordion-group/accordion-group.css +1 -1
  41. package/dist/collection/components/alert/alert.css +1 -1
  42. package/dist/collection/components/avatar/avatar.css +1 -1
  43. package/dist/collection/components/button/button.component.js +3 -3
  44. package/dist/collection/components/button/button.component.js.map +1 -1
  45. package/dist/collection/components/button/button.css +1 -1
  46. package/dist/collection/components/chip/chip.css +1 -1
  47. package/dist/collection/components/input/input.component.js +865 -0
  48. package/dist/collection/components/input/input.component.js.map +1 -0
  49. package/dist/collection/components/input/input.css +2 -0
  50. package/dist/collection/components/input/types.js +2 -0
  51. package/dist/collection/components/input/types.js.map +1 -0
  52. package/dist/collection/components/text/text.component.js +1 -1
  53. package/dist/collection/components/text/text.css +1 -1
  54. package/dist/collection/utils/id/generate-id.js +16 -0
  55. package/dist/collection/utils/id/generate-id.js.map +1 -0
  56. package/dist/components/bcm-accordion-group.js +2 -2
  57. package/dist/components/bcm-accordion-group.js.map +1 -1
  58. package/dist/components/bcm-accordion.js +2 -2
  59. package/dist/components/bcm-accordion.js.map +1 -1
  60. package/dist/components/bcm-alert.js +2 -2
  61. package/dist/components/bcm-alert.js.map +1 -1
  62. package/dist/components/bcm-avatar.js +2 -2
  63. package/dist/components/bcm-avatar.js.map +1 -1
  64. package/dist/components/bcm-button.js +5 -5
  65. package/dist/components/bcm-button.js.map +1 -1
  66. package/dist/components/bcm-chip.js +2 -2
  67. package/dist/components/bcm-chip.js.map +1 -1
  68. package/dist/components/bcm-input.d.ts +11 -0
  69. package/dist/components/bcm-input.js +306 -0
  70. package/dist/components/bcm-input.js.map +1 -0
  71. package/dist/components/bcm-text.js +3 -3
  72. package/dist/components/bcm-text.js.map +1 -1
  73. package/dist/components/index.js +1 -1
  74. package/dist/components/{p-0adcc84f.js → p-8ded2c73.js} +26 -3
  75. package/dist/{cjs/index-638f2d15.js.map → components/p-8ded2c73.js.map} +1 -1
  76. package/dist/esm/bcm-accordion-group.entry.js +88 -0
  77. package/dist/esm/bcm-accordion-group.entry.js.map +1 -0
  78. package/dist/esm/bcm-accordion.entry.js +124 -0
  79. package/dist/esm/bcm-accordion.entry.js.map +1 -0
  80. package/dist/esm/bcm-alert.entry.js +2 -2
  81. package/dist/esm/bcm-alert.entry.js.map +1 -1
  82. package/dist/esm/bcm-avatar.entry.js +2 -2
  83. package/dist/esm/bcm-avatar.entry.js.map +1 -1
  84. package/dist/esm/bcm-button_2.entry.js +544 -0
  85. package/dist/esm/bcm-button_2.entry.js.map +1 -0
  86. package/dist/esm/bcm-chip.entry.js +126 -0
  87. package/dist/esm/bcm-chip.entry.js.map +1 -0
  88. package/dist/esm/bcm-text.entry.js +3 -3
  89. package/dist/esm/bcm-text.entry.js.map +1 -1
  90. package/dist/esm/bromcom-ui.js +3 -3
  91. package/dist/esm/{index-ce2fac11.js → index-e23ee9b0.js} +32 -3
  92. package/dist/esm/index-e23ee9b0.js.map +1 -0
  93. package/dist/esm/loader.js +3 -3
  94. package/dist/types/components/input/input.component.d.ts +74 -0
  95. package/dist/types/components/input/types.d.ts +3 -0
  96. package/dist/types/components.d.ts +246 -0
  97. package/dist/types/utils/id/generate-id.d.ts +9 -0
  98. package/package.json +3 -2
  99. package/dist/bromcom-ui/p-0a74cf15.entry.js +0 -2
  100. package/dist/bromcom-ui/p-27c997d8.js +0 -3
  101. package/dist/bromcom-ui/p-27c997d8.js.map +0 -1
  102. package/dist/bromcom-ui/p-2d836917.entry.js +0 -2
  103. package/dist/bromcom-ui/p-84a5dcdb.entry.js +0 -2
  104. package/dist/bromcom-ui/p-84a5dcdb.entry.js.map +0 -1
  105. package/dist/bromcom-ui/p-f0c61f8c.entry.js +0 -2
  106. package/dist/cjs/bcm-accordion_4.cjs.entry.js +0 -623
  107. package/dist/cjs/bcm-accordion_4.cjs.entry.js.map +0 -1
  108. package/dist/components/p-0adcc84f.js.map +0 -1
  109. package/dist/esm/bcm-accordion_4.entry.js +0 -616
  110. package/dist/esm/bcm-accordion_4.entry.js.map +0 -1
  111. package/dist/esm/index-ce2fac11.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["accordionCss","BcmAccordionStyle0","BcmAccordion","constructor","hostRef","this","expanded","group","hasFooterContent","handleFooterSlotChange","e","slot","target","assignedNodes","length","accordionClass","tv","slots","container","header","content","footer","icon","rightSection","variants","false","true","twMerge","toggle","updateAccordion","expand","collapse","contentEl","style","maxHeight","scrollHeight","bcmAccordionChange","emit","source","host","render","hintText","h","key","class","role","tabindex","toString","onKeyDown","preventDefault","onClick","name","headerTitle","stopPropagation","ref","el","onSlotchange"],"sources":["src/components/accordion/accordion.css?tag=bcm-accordion&encapsulation=shadow","src/components/accordion/accordion.component.tsx"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n --bcm-accordion-bg: var(--bcm-ui-color-background-basic-panel);\n --bcm-accordion-content-bg: var(--bcm-ui-color-background-basic-base);\n --bcm-accordion-text: var(--bcm-ui-color-text-header);\n --bcm-accordion-border: var(--bcm-ui-color-border-default);\n --bcm-accordion-radius: 6px;\n --bcm-accordion-footer-bg: var(--bcm-ui-color-background-default-default);\n}\n\n:host(:not([group])) .accordion-container {\n border: 1px solid var(--bcm-accordion-border);\n border-radius: var(--bcm-accordion-radius);\n}\n\n:host([group]) .accordion-container {\n border-bottom: 1px solid var(--bcm-accordion-border);\n border-radius: 0;\n}\n\n:host([group]:last-of-type) .accordion-container {\n border-bottom: none;\n}\n\n:host([group]:first-of-type) .accordion-container {\n border-top-left-radius: var(--bcm-accordion-radius);\n border-top-right-radius: var(--bcm-accordion-radius);\n}\n\n:host([group]:last-of-type) .accordion-footer {\n border-bottom-left-radius: var(--bcm-accordion-radius);\n border-bottom-right-radius: var(--bcm-accordion-radius);\n}\n\n:host(:not([group])) .accordion-footer {\n border-bottom-left-radius: var(--bcm-accordion-radius);\n border-bottom-right-radius: var(--bcm-accordion-radius);\n}\n\n::slotted([slot='title']) {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 10px;\n}\n::slotted([slot='actions']) {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n}\n","import { Component, ComponentInterface, EventEmitter, h, Method, Prop, Event, State, Element } from '@stencil/core';\nimport { tv } from 'tailwind-variants';\nimport { AccordionChangeEventType } from './types';\n\n/**\n * @component BcmAccordion\n * @description A collapsible accordion component that provides expandable/collapsible content sections with keyboard navigation\n * and accessibility features. Offers customizable header, content, and footer areas through slots.\n *\n * @example Basic usage\n * <bcm-accordion>\n * <div slot=\"title\">Accordion Title</div>\n * <div>Content goes here</div>\n * </bcm-accordion>\n *\n * @example With all slots and hint text\n * <bcm-accordion hint-text=\"Additional information\">\n * <div slot=\"title\">Title</div>\n * <div slot=\"actions\">\n * <button>Action</button>\n * </div>\n * <div>Main content</div>\n * <div slot=\"footer\">Footer content</div>\n * </bcm-accordion>\n *\n * @example Event handling\n * // Listen to accordion state changes\n * const accordion = document.querySelector('bcm-accordion');\n * accordion.addEventListener('bcmAccordionChange', (event) => {\n * const { expanded, source } = event.detail;\n * console.log('Accordion expanded:', expanded);\n * console.log('Changed accordion:', source);\n * });\n *\n * // Programmatically control accordion\n * await accordion.toggle(); // Toggle state\n * await accordion.expand(); // Expand accordion\n * await accordion.collapse(); // Collapse accordion\n *\n * @prop {boolean} expanded - Controls the expanded state of the accordion (default: false)\n * @prop {boolean} group - Indicates if the accordion is part of an accordion group (default: false)\n * @prop {string} hintText - Optional hint text to display in the footer when no footer content is provided\n *\n * @slot title - Primary title content for the accordion header (required)\n * @slot actions - Additional actions to be displayed in the header (optional)\n * @slot default - Main content area of the accordion\n * @slot footer - Optional footer content (overrides hint-text if provided)\n *\n * @event {EventEmitter<AccordionChangeEventType>} bcmAccordionChange - Emitted when the accordion's expanded state changes\n * @eventProperty {boolean} expanded - Current expanded state\n * @eventProperty {HTMLBcmAccordionElement} source - Reference to the accordion element that changed\n *\n * @csspart container - The root container element\n * @csspart header - The header section with title and actions\n * @csspart content - The collapsible content section\n * @csspart footer - The footer section with hint text or footer slot\n * @csspart section - Container for header content sections\n * @csspart icon - The expand/collapse chevron icon\n *\n * @css {string} --bcm-accordion-radius - Border radius of the accordion header (default: 4px)\n * @css {string} --bcm-accordion-bg - Background color of the accordion header\n * @css {string} --bcm-accordion-text - Text color of the accordion\n * @css {string} --bcm-accordion-footer-bg - Background color of the footer section\n *\n * @methods\n * toggle() - Toggles the accordion's expanded state\n * expand() - Expands the accordion if collapsed\n * collapse() - Collapses the accordion if expanded\n */\n@Component({\n tag: 'bcm-accordion',\n styleUrl: 'accordion.css',\n shadow: true,\n})\nexport class BcmAccordion implements ComponentInterface {\n /** Reference to the host element */\n @Element() host: HTMLElement;\n\n /**\n * Controls whether the accordion is expanded or collapsed.\n * @prop\n * @defaultValue false\n */\n @Prop({ reflect: true, mutable: true })\n expanded: boolean = false;\n\n /**\n * Optional title text to display in the header.\n * @prop\n * @defaultValue undefined\n */\n @Prop()\n headerTitle?: string;\n\n /**\n * Indicates if the accordion is part of a group.\n * Used for group behavior coordination.\n * @prop\n * @defaultValue false\n */\n\n @Prop({ reflect: true })\n group: boolean = false;\n\n /**\n * Optional text to display in the footer when no footer slot content is provided.\n * @prop\n */\n @Prop({ attribute: 'hint-text' })\n hintText?: string;\n\n /**\n * Tracks whether footer content is present.\n * @state\n */\n @State()\n hasFooterContent: boolean = false;\n\n /**\n * Emitted when the accordion's expanded state changes.\n * @event\n */\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n eventName: 'bcmAccordionChange',\n })\n bcmAccordionChange: EventEmitter<AccordionChangeEventType>;\n\n private contentEl?: HTMLElement;\n\n /**\n * Toggles the accordion's expanded state.\n * @method\n * @returns Promise<void>\n */\n @Method()\n async toggle(): Promise<void> {\n this.expanded = !this.expanded;\n this.updateAccordion();\n }\n\n /**\n * Expands the accordion if it's not already expanded.\n * @method\n * @returns Promise<void>\n */\n @Method()\n async expand(): Promise<void> {\n if (!this.expanded) {\n this.expanded = true;\n this.updateAccordion();\n }\n }\n\n /**\n * Collapses the accordion if it's currently expanded.\n * @method\n * @returns Promise<void>\n */\n @Method()\n async collapse(): Promise<void> {\n if (this.expanded) {\n this.expanded = false;\n this.updateAccordion();\n }\n }\n\n /**\n * Updates the accordion's content height and emits change event.\n * @private\n */\n private updateAccordion(): void {\n if (this.contentEl) {\n this.contentEl.style.maxHeight = this.expanded ? `${this.contentEl.scrollHeight}px` : '0px';\n }\n this.bcmAccordionChange.emit({ expanded: this.expanded, source: this.host as HTMLBcmAccordionElement });\n }\n\n /**\n * Handles changes to the footer slot content.\n * @private\n * @param e - Slot change event\n */\n private handleFooterSlotChange = (e: Event) => {\n const slot = e.target as HTMLSlotElement;\n const assignedNodes = slot.assignedNodes();\n this.hasFooterContent = assignedNodes.length > 0;\n };\n\n private accordionClass = tv(\n {\n slots: {\n container: 'accordion-container flex flex-col bcm-ui-element w-full ',\n header:\n 'accordion-header flex flex-row justify-between gap-2 p-4 w-full flex-nowrap rounded-[--bcm-accordion-radius] bg-[--bcm-accordion-bg] text-[--bcm-accordion-text] font-semibold text-size-6 cursor-pointer',\n content: 'accordion-content overflow-hidden transition-all duration-300 ease-in-out bg-color-basic-base',\n footer: 'accordion-footer flex flex-row w-full flex-nowrap bg-[--bcm-accordion-footer-bg] text-[--bcm-accordion-text] px-4 py-2 gap-2 text-size-4 font-normal',\n icon: 'accordion-icon cursor-pointer transform transition-transform duration-300',\n rightSection: 'accordion-right-section flex flex-row gap-2.5 items-center',\n },\n variants: {\n hasFooterContent: {\n false: { footer: 'hidden' },\n true: { footer: 'flex' },\n },\n expanded: {\n true: { icon: 'rotate-180' },\n false: {\n icon: 'rotate-0',\n content: '',\n },\n },\n },\n },\n {\n twMerge: false,\n },\n );\n\n render() {\n const { container, header, content, footer, icon, rightSection } = this.accordionClass({\n hasFooterContent: this.hasFooterContent || !!this.hintText,\n expanded: this.expanded,\n });\n\n return (\n <div class={container()}>\n {/* Header */}\n <header\n class={header()}\n role=\"button\"\n tabindex=\"0\"\n aria-expanded={this.expanded.toString()}\n aria-controls=\"accordion-content\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.toggle();\n }\n }}\n onClick={() => this.toggle()}\n >\n <slot name=\"title\">{this.headerTitle}</slot>\n {/* Actions */}\n <div class={rightSection()}>\n <span onClick={e => e.stopPropagation()}>\n <slot name=\"actions\"></slot>\n </span>\n <bcm-icon name=\"fa-regular fa-chevron-down\" class={icon()}></bcm-icon>\n </div>\n </header>\n {/* Content */}\n <div class={content()} style={{ maxHeight: this.expanded ? 'auto' : '0px' }} ref={el => (this.contentEl = el as HTMLElement)}>\n <div class=\"px-4 py-2\">\n <slot></slot>\n </div>\n <footer class={footer()}>\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange}>\n {this.hintText}\n </slot>\n </footer>\n </div>\n </div>\n );\n }\n}\n"],"mappings":"6FAAA,MAAMA,EAAe,qzHACrB,MAAAC,EAAeD,E,MCyEFE,EAAY,MALzB,WAAAC,CAAAC,G,iEAeEC,KAAAC,SAAoB,MAkBpBD,KAAAE,MAAiB,MAcjBF,KAAAG,iBAA4B,MAqEpBH,KAAAI,uBAA0BC,IAChC,MAAMC,EAAOD,EAAEE,OACf,MAAM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K,CACtCjC,EAAEuC,iBACF5C,KAAKuB,Q,GAGTsB,QAAS,IAAM7C,KAAKuB,UAEpBc,EAAA,QAAAC,IAAA,2CAAMQ,KAAK,SAAS9C,KAAK+C,aAEzBV,EAAA,OAAAC,IAAA,2CAAKC,MAAOrB,KACVmB,EAAA,QAAAC,IAAA,2CAAMO,QAASxC,GAAKA,EAAE2C,mBACpBX,EAAA,QAAAC,IAAA,2CAAMQ,KAAK,aAEbT,EAAA,YAAAC,IAAA,2CAAUQ,KAAK,6BAA6BP,MAAOtB,QAIvDoB,EAAA,OAAAC,IAAA,2CAAKC,MAAOxB,IAAWa,MAAO,CAAEC,UAAW7B,KAAKC,SAAW,OAAS,OAASgD,IAAKC,GAAOlD,KAAK2B,UAAYuB,GACxGb,EAAA,OAAAC,IAAA,2CAAKC,MAAM,aACTF,EAAA,QAAAC,IAAA,8CAEFD,EAAA,UAAAC,IAAA,2CAAQC,MAAOvB,KACbqB,EAAA,QAAAC,IAAA,2CAAMQ,KAAK,SAASK,aAAcnD,KAAKI,wBACpCJ,KAAKoC,Y","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,h as t}from"./p-61c030c5.js";import{c as o}from"./p-b36f4f44.js";const l={display:"h1",heading1:"h2",heading2:"h3",title1:"h4",title2:"h5",title3:"h6",body:"p",bodyAccent:"p",helper:"p",caption:"p",label:"label",placeholder:"p",link:"a",info:"p",infoAccent:"p"};const i=".static{position:static}.m-0{margin:0}.appearance-none{appearance:none}.p-0{padding:0}.text-size-12{font-size:var(--bcm-ui-font-size-12,60px);line-height:var(--bcm-ui-line-height-12,72px)}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.text-size-7{font-size:var(--bcm-ui-font-size-7,20px);line-height:var(--bcm-ui-line-height-7,28px)}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-color-caption{color:var(--bcm-ui-color-text-caption)}.text-color-disabled{color:var(--bcm-ui-color-text-disabled)}.text-color-header{color:var(--bcm-ui-color-text-header)}.text-color-helper{color:var(--bcm-ui-color-text-helper)}.text-color-label{color:var(--bcm-ui-color-text-label)}.text-color-placeholder{color:var(--bcm-ui-color-text-placeholder)}.text-color-primary{color:var(--bcm-ui-color-text-primary)}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";const r=i;const a=class{constructor(t){e(this,t);this.variant="body";this.size="medium";this.variantClassMap={display:"font-semibold text-size-12 text-color-header",heading1:"font-semibold text-size-7 text-color-header",heading2:"font-semibold text-size-6 text-color-header",title1:{small:"font-semibold text-size-5 text-color-header",medium:"font-semibold text-size-6 text-color-header",large:"font-semibold text-size-7 text-color-header"},title2:{small:"font-semibold text-size-4 text-color-default",medium:"font-semibold text-size-5 text-color-default",large:"font-semibold text-size-6 text-color-default"},title3:{small:"font-semibold text-size-3 text-color-disabled",medium:"font-semibold text-size-4 text-color-disabled",large:"font-semibold text-size-5 text-color-disabled"},body:{small:"font-regular text-size-4 text-color-default",medium:"font-regular text-size-5 text-color-default",large:"font-regular text-size-6 text-color-default"},bodyAccent:{small:"font-medium text-size-4 text-color-default",medium:"font-medium text-size-5 text-color-default",large:"font-medium text-size-6 text-color-default"},helper:{small:"font-regular text-size-4 text-color-helper",medium:"font-regular text-size-5 text-color-helper",large:"font-regular text-size-6 text-color-helper"},caption:{small:"font-regular text-size-3 text-color-caption",medium:"font-regular text-size-4 text-color-caption",large:"font-regular text-size-5 text-color-caption"},link:{small:"font-medium text-size-4 underline text-color-primary",medium:"font-medium text-size-5 underline text-color-primary",large:"font-medium text-size-6 underline text-color-primary"},label:{small:"font-medium text-size-3 text-color-label",medium:"font-medium text-size-4 text-color-label",large:"font-medium text-size-5 text-color-label"},placeholder:{small:"font-regular text-size-4 text-color-placeholder",medium:"font-regular text-size-5 text-color-placeholder",large:"font-regular text-size-6 text-color-placeholder"},info:{small:"font-regular text-size-3 text-color-default",medium:"font-regular text-size-4 text-color-default",large:"font-regular text-size-5 text-color-default"},infoAccent:{small:"font-medium text-size-3 text-color-header",medium:"font-medium text-size-4 text-color-header",large:"font-medium text-size-5 text-color-header"}};this.getTextClass=(e,t)=>{const o=this.variantClassMap[e];if(typeof o==="string"){return o}return o[t]}}render(){const e=l[this.variant];const i=this.getTextClass(this.variant,this.size);return t(e,{key:"be80ea42fcc903f96694e7e8a12f360e1e209a3a",class:o("bcm-text appearance-none m-0 p-0",i),part:"text"},t("slot",{key:"eeada28b9aad802ed2c88bb76cb297bac7c3464b"},this.text))}};a.style=r;export{a as bcm_text};
2
+ //# sourceMappingURL=p-dcc13a55.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["variantTagMap","display","heading1","heading2","title1","title2","title3","body","bodyAccent","helper","caption","label","placeholder","link","info","infoAccent","textCss","BcmTextStyle0","BcmText","constructor","hostRef","this","variant","size","variantClassMap","small","medium","large","getTextClass","variantClasses","render","Tag","variantClass","h","key","class","cs","part","text"],"sources":["src/components/text/text.utils.ts","src/components/text/text.scss?tag=bcm-text&encapsulation=shadow","src/components/text/text.component.tsx"],"sourcesContent":["import { TextVariant, TextTag } from './text.types';\n\nexport const variantTagMap: Record<TextVariant, TextTag> = {\n display: 'h1',\n heading1: 'h2',\n heading2: 'h3',\n title1: 'h4',\n title2: 'h5',\n title3: 'h6',\n body: 'p',\n bodyAccent: 'p',\n helper: 'p',\n caption: 'p',\n label: 'label',\n placeholder: 'p',\n link: 'a',\n info: 'p',\n infoAccent: 'p',\n};\n",null,"import { Component, h, Prop } from '@stencil/core';\nimport cs from 'classnames';\nimport { TextVariant, TextSize } from './text.types';\nimport { variantTagMap } from './text.utils';\n\n@Component({\n tag: 'bcm-text',\n styleUrl: 'text.scss',\n shadow: true,\n})\nexport class BcmText {\n /** Text content */\n @Prop()\n text: string;\n\n /** Text variant */\n @Prop()\n variant: TextVariant = 'body';\n\n /** Text size */\n @Prop()\n size: TextSize = 'medium';\n\n private readonly variantClassMap = {\n display: 'font-semibold text-size-12 text-color-header',\n heading1: 'font-semibold text-size-7 text-color-header',\n heading2: 'font-semibold text-size-6 text-color-header',\n title1: {\n small: 'font-semibold text-size-5 text-color-header',\n medium: 'font-semibold text-size-6 text-color-header',\n large: 'font-semibold text-size-7 text-color-header',\n },\n title2: {\n small: 'font-semibold text-size-4 text-color-default',\n medium: 'font-semibold text-size-5 text-color-default',\n large: 'font-semibold text-size-6 text-color-default',\n },\n title3: {\n small: 'font-semibold text-size-3 text-color-disabled',\n medium: 'font-semibold text-size-4 text-color-disabled',\n large: 'font-semibold text-size-5 text-color-disabled',\n },\n body: {\n small: 'font-regular text-size-4 text-color-default',\n medium: 'font-regular text-size-5 text-color-default',\n large: 'font-regular text-size-6 text-color-default',\n },\n bodyAccent: {\n small: 'font-medium text-size-4 text-color-default',\n medium: 'font-medium text-size-5 text-color-default',\n large: 'font-medium text-size-6 text-color-default',\n },\n helper: {\n small: 'font-regular text-size-4 text-color-helper',\n medium: 'font-regular text-size-5 text-color-helper',\n large: 'font-regular text-size-6 text-color-helper',\n },\n caption: {\n small: 'font-regular text-size-3 text-color-caption',\n medium: 'font-regular text-size-4 text-color-caption',\n large: 'font-regular text-size-5 text-color-caption',\n },\n link: {\n small: 'font-medium text-size-4 underline text-color-primary',\n medium: 'font-medium text-size-5 underline text-color-primary',\n large: 'font-medium text-size-6 underline text-color-primary',\n },\n label: {\n small: 'font-medium text-size-3 text-color-label',\n medium: 'font-medium text-size-4 text-color-label',\n large: 'font-medium text-size-5 text-color-label',\n },\n placeholder: {\n small: 'font-regular text-size-4 text-color-placeholder',\n medium: 'font-regular text-size-5 text-color-placeholder',\n large: 'font-regular text-size-6 text-color-placeholder',\n },\n info: {\n small: 'font-regular text-size-3 text-color-default',\n medium: 'font-regular text-size-4 text-color-default',\n large: 'font-regular text-size-5 text-color-default',\n },\n infoAccent: {\n small: 'font-medium text-size-3 text-color-header',\n medium: 'font-medium text-size-4 text-color-header',\n large: 'font-medium text-size-5 text-color-header',\n },\n } as const;\n\n private getTextClass = (variant: TextVariant, size: TextSize): string => {\n const variantClasses = this.variantClassMap[variant];\n\n if (typeof variantClasses === 'string') {\n return variantClasses;\n }\n\n return variantClasses[size];\n };\n\n render() {\n const Tag = variantTagMap[this.variant];\n const variantClass = this.getTextClass(this.variant, this.size);\n\n return (\n <Tag class={cs('bcm-text appearance-none m-0 p-0', variantClass)} part=\"text\">\n <slot>{this.text}</slot>\n </Tag>\n );\n }\n}\n"],"mappings":"+EAEO,MAAMA,EAA8C,CACzDC,QAAS,KACTC,SAAU,KACVC,SAAU,KACVC,OAAQ,KACRC,OAAQ,KACRC,OAAQ,KACRC,KAAM,IACNC,WAAY,IACZC,OAAQ,IACRC,QAAS,IACTC,MAAO,QACPC,YAAa,IACbC,KAAM,IACNC,KAAM,IACNC,WAAY,KCjBd,MAAMC,EAAU,mmJAChB,MAAAC,EAAeD,E,MCSFE,EAAO,MALpB,WAAAC,CAAAC,G,UAYEC,KAAAC,QAAuB,OAIvBD,KAAAE,KAAiB,SAEAF,KAAAG,gBAAkB,CACjCvB,QAAS,+CACTC,SAAU,8CACVC,SAAU,8CACVC,OAAQ,CACNqB,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETtB,OAAQ,CACNoB,MAAO,+CACPC,OAAQ,+CACRC,MAAO,gDAETrB,OAAQ,CACNmB,MAAO,gDACPC,OAAQ,gDACRC,MAAO,iDAETpB,KAAM,CACJkB,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETnB,WAAY,CACViB,MAAO,6CACPC,OAAQ,6CACRC,MAAO,8CAETlB,OAAQ,CACNgB,MAAO,6CACPC,OAAQ,6CACRC,MAAO,8CAETjB,QAAS,CACPe,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETd,KAAM,CACJY,MAAO,uDACPC,OAAQ,uDACRC,MAAO,wDAEThB,MAAO,CACLc,MAAO,2CACPC,OAAQ,2CACRC,MAAO,4CAETf,YAAa,CACXa,MAAO,kDACPC,OAAQ,kDACRC,MAAO,mDAETb,KAAM,CACJW,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETZ,WAAY,CACVU,MAAO,4CACPC,OAAQ,4CACRC,MAAO,8CAIHN,KAAAO,aAAe,CAACN,EAAsBC,KAC5C,MAAMM,EAAiBR,KAAKG,gBAAgBF,GAE5C,UAAWO,IAAmB,SAAU,CACtC,OAAOA,C,CAGT,OAAOA,EAAeN,EAAK,C,CAG7B,MAAAO,GACE,MAAMC,EAAM/B,EAAcqB,KAAKC,SAC/B,MAAMU,EAAeX,KAAKO,aAAaP,KAAKC,QAASD,KAAKE,MAE1D,OACEU,EAACF,EAAG,CAAAG,IAAA,2CAACC,MAAOC,EAAG,mCAAoCJ,GAAeK,KAAK,QACrEJ,EAAA,QAAAC,IAAA,4CAAOb,KAAKiB,M","ignoreList":[]}
1
+ {"version":3,"names":["variantTagMap","display","heading1","heading2","title1","title2","title3","body","bodyAccent","helper","caption","label","placeholder","link","info","infoAccent","textCss","BcmTextStyle0","BcmText","constructor","hostRef","this","variant","size","variantClassMap","small","medium","large","getTextClass","variantClasses","render","Tag","variantClass","h","key","class","cs","part","text"],"sources":["src/components/text/text.utils.ts","src/components/text/text.scss?tag=bcm-text&encapsulation=shadow","src/components/text/text.component.tsx"],"sourcesContent":["import { TextVariant, TextTag } from './text.types';\n\nexport const variantTagMap: Record<TextVariant, TextTag> = {\n display: 'h1',\n heading1: 'h2',\n heading2: 'h3',\n title1: 'h4',\n title2: 'h5',\n title3: 'h6',\n body: 'p',\n bodyAccent: 'p',\n helper: 'p',\n caption: 'p',\n label: 'label',\n placeholder: 'p',\n link: 'a',\n info: 'p',\n infoAccent: 'p',\n};\n",null,"import { Component, h, Prop } from '@stencil/core';\nimport cs from 'classnames';\nimport { TextVariant, TextSize } from './text.types';\nimport { variantTagMap } from './text.utils';\n\n@Component({\n tag: 'bcm-text',\n styleUrl: 'text.scss',\n shadow: true,\n})\nexport class BcmText {\n /** Text content */\n @Prop()\n text: string;\n\n /** Text variant */\n @Prop()\n variant: TextVariant = 'body';\n\n /** Text size */\n @Prop()\n size: TextSize = 'medium';\n\n private readonly variantClassMap = {\n display: 'font-semibold text-size-12 text-color-header',\n heading1: 'font-semibold text-size-7 text-color-header',\n heading2: 'font-semibold text-size-6 text-color-header',\n title1: {\n small: 'font-semibold text-size-5 text-color-header',\n medium: 'font-semibold text-size-6 text-color-header',\n large: 'font-semibold text-size-7 text-color-header',\n },\n title2: {\n small: 'font-semibold text-size-4 text-color-default',\n medium: 'font-semibold text-size-5 text-color-default',\n large: 'font-semibold text-size-6 text-color-default',\n },\n title3: {\n small: 'font-semibold text-size-3 text-color-disabled',\n medium: 'font-semibold text-size-4 text-color-disabled',\n large: 'font-semibold text-size-5 text-color-disabled',\n },\n body: {\n small: 'font-regular text-size-4 text-color-default',\n medium: 'font-regular text-size-5 text-color-default',\n large: 'font-regular text-size-6 text-color-default',\n },\n bodyAccent: {\n small: 'font-medium text-size-4 text-color-default',\n medium: 'font-medium text-size-5 text-color-default',\n large: 'font-medium text-size-6 text-color-default',\n },\n helper: {\n small: 'font-regular text-size-4 text-color-helper',\n medium: 'font-regular text-size-5 text-color-helper',\n large: 'font-regular text-size-6 text-color-helper',\n },\n caption: {\n small: 'font-regular text-size-3 text-color-caption',\n medium: 'font-regular text-size-4 text-color-caption',\n large: 'font-regular text-size-5 text-color-caption',\n },\n link: {\n small: 'font-medium text-size-4 underline text-color-primary',\n medium: 'font-medium text-size-5 underline text-color-primary',\n large: 'font-medium text-size-6 underline text-color-primary',\n },\n label: {\n small: 'font-medium text-size-3 text-color-label',\n medium: 'font-medium text-size-4 text-color-label',\n large: 'font-medium text-size-5 text-color-label',\n },\n placeholder: {\n small: 'font-regular text-size-4 text-color-placeholder',\n medium: 'font-regular text-size-5 text-color-placeholder',\n large: 'font-regular text-size-6 text-color-placeholder',\n },\n info: {\n small: 'font-regular text-size-3 text-color-default',\n medium: 'font-regular text-size-4 text-color-default',\n large: 'font-regular text-size-5 text-color-default',\n },\n infoAccent: {\n small: 'font-medium text-size-3 text-color-header',\n medium: 'font-medium text-size-4 text-color-header',\n large: 'font-medium text-size-5 text-color-header',\n },\n } as const;\n\n private getTextClass = (variant: TextVariant, size: TextSize): string => {\n const variantClasses = this.variantClassMap[variant];\n\n if (typeof variantClasses === 'string') {\n return variantClasses;\n }\n\n return variantClasses[size];\n };\n\n render() {\n const Tag = variantTagMap[this.variant];\n const variantClass = this.getTextClass(this.variant, this.size);\n\n return (\n <Tag class={cs('bcm-text appearance-none m-0 p-0', variantClass)} part=\"text\">\n <slot>{this.text}</slot>\n </Tag>\n );\n }\n}\n"],"mappings":"+EAEO,MAAMA,EAA8C,CACzDC,QAAS,KACTC,SAAU,KACVC,SAAU,KACVC,OAAQ,KACRC,OAAQ,KACRC,OAAQ,KACRC,KAAM,IACNC,WAAY,IACZC,OAAQ,IACRC,QAAS,IACTC,MAAO,QACPC,YAAa,IACbC,KAAM,IACNC,KAAM,IACNC,WAAY,KCjBd,MAAMC,EAAU,g8CAChB,MAAAC,EAAeD,E,MCSFE,EAAO,MALpB,WAAAC,CAAAC,G,UAYEC,KAAAC,QAAuB,OAIvBD,KAAAE,KAAiB,SAEAF,KAAAG,gBAAkB,CACjCvB,QAAS,+CACTC,SAAU,8CACVC,SAAU,8CACVC,OAAQ,CACNqB,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETtB,OAAQ,CACNoB,MAAO,+CACPC,OAAQ,+CACRC,MAAO,gDAETrB,OAAQ,CACNmB,MAAO,gDACPC,OAAQ,gDACRC,MAAO,iDAETpB,KAAM,CACJkB,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETnB,WAAY,CACViB,MAAO,6CACPC,OAAQ,6CACRC,MAAO,8CAETlB,OAAQ,CACNgB,MAAO,6CACPC,OAAQ,6CACRC,MAAO,8CAETjB,QAAS,CACPe,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETd,KAAM,CACJY,MAAO,uDACPC,OAAQ,uDACRC,MAAO,wDAEThB,MAAO,CACLc,MAAO,2CACPC,OAAQ,2CACRC,MAAO,4CAETf,YAAa,CACXa,MAAO,kDACPC,OAAQ,kDACRC,MAAO,mDAETb,KAAM,CACJW,MAAO,8CACPC,OAAQ,8CACRC,MAAO,+CAETZ,WAAY,CACVU,MAAO,4CACPC,OAAQ,4CACRC,MAAO,8CAIHN,KAAAO,aAAe,CAACN,EAAsBC,KAC5C,MAAMM,EAAiBR,KAAKG,gBAAgBF,GAE5C,UAAWO,IAAmB,SAAU,CACtC,OAAOA,C,CAGT,OAAOA,EAAeN,EAAK,C,CAG7B,MAAAO,GACE,MAAMC,EAAM/B,EAAcqB,KAAKC,SAC/B,MAAMU,EAAeX,KAAKO,aAAaP,KAAKC,QAASD,KAAKE,MAE1D,OACEU,EAACF,EAAG,CAAAG,IAAA,2CAACC,MAAOC,EAAG,mCAAoCJ,GAAeK,KAAK,QACrEJ,EAAA,QAAAC,IAAA,4CAAOb,KAAKiB,M","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e}from"./p-61c030c5.js";import{c as i}from"./p-b36f4f44.js";const s=":host{--bcm-avatar-bg:var(--bcm-ui-color-background-default-default);--bcm-avatar-text:var(--bcm-ui-color-text-default);--bcm-avatar-radius:50%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.right-0{right:0}.top-0{top:0}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.w-10{width:2.5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-\\[--bcm-ui-radius\\]{border-radius:var(--bcm-ui-radius)}.rounded-full{border-radius:9999px}.bg-\\[--bcm-avatar-bg\\]{background-color:var(--bcm-avatar-bg)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.text-\\[--bcm-avatar-text\\]{color:var(--bcm-avatar-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";const a=s;const r=class{constructor(e){t(this,e);this.shape="ellipse";this.size="medium";this.icon="fas fa-user";this.blink=false;this.isFallback=false}getFirstLetters(t){const e=t.split(" ");const i=e.map((t=>t.charAt(0).toUpperCase())).join("");return i.substring(0,2)}render(){const t=i("bcm-avatar bcm-ui-element bcm-ui-content-display","uppercase font-medium","inline-flex items-center justify-center","bg-[--bcm-avatar-bg] text-[--bcm-avatar-text]",{"shape-ellipse rounded-full":this.shape==="ellipse","shape-square rounded-[--bcm-ui-radius]":this.shape==="square","size-small text-size-4 w-6 h-6":this.size==="small","size-medium text-size-5 w-8 h-8":this.size==="medium","size-large text-size-6 w-10 h-10":this.size==="large"});const s=i("badge",{"top-0 right-0":this.shape==="ellipse","-top-0.5 -right-0.5":this.shape==="square"});const a=i("image w-full h-full",{"rounded-full":this.shape==="ellipse","rounded-[--bcm-ui-radius]":this.shape==="square"});let r={};if(this.color){const t=this.color.includes("-");const e=t?this.color.split("-")[0]:this.color;const i=`var(--bcm-ui-color-background-palette-${e}-default)`;const s=`var(--bcm-ui-color-text-palette-${e}`;r={"--bcm-avatar-bg":i,"--bcm-avatar-text":s}}const h=!Object.keys(["small","medium","large"]).includes(this.size)?{width:`${this.size}px`,height:`${this.size}px`,fontSize:`${+this.size/2}px`}:{};const l=()=>{if(this.isFallback){if(this.name){return this.getFirstLetters(this.name)}else{return e("i",{class:this.icon})}}else if(this.image){return e("img",{class:a,onError:()=>this.isFallback=true,src:this.image,alt:this.alt,"aria-label":this.alt||this.name||"Avatar"})}else if(this.name){return this.getFirstLetters(this.name)}else{return e("i",{class:this.icon})}};return e("div",{role:"img","aria-label":this.alt||this.name||"Avatar",class:t,style:Object.assign(Object.assign({},r),h)},e(l,null),this.status&&e("bcm-badge",{class:s,status:this.status,blink:this.blink,"aria-hidden":"true"}),e("slot",null))}};r.style=a;export{r as bcm_avatar};
2
+ //# sourceMappingURL=p-e7732b0c.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["avatarCss","BcmAvatarStyle0","BcmAvatar","constructor","hostRef","this","shape","size","icon","blink","isFallback","getFirstLetters","name","words","split","initials","map","word","charAt","toUpperCase","join","substring","render","baseClass","cs","badgeClass","imageClass","style","color","isColorTone","includes","_color","bgColor","textColor","customSize","Object","keys","width","height","fontSize","RenderContent","h","class","image","onError","src","alt","role","assign","status"],"sources":["src/components/avatar/avatar.css?tag=bcm-avatar&encapsulation=shadow","src/components/avatar/avatar.component.tsx"],"sourcesContent":[":host {\n --bcm-avatar-bg: var(--bcm-ui-color-background-default-default);\n --bcm-avatar-text: var(--bcm-ui-color-text-default);\n --bcm-avatar-radius: 50%;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport cs from 'classnames';\nimport { AvatarShape, AvatarSize, AvatarStatus } from './types';\n\n@Component({\n tag: 'bcm-avatar',\n styleUrl: 'avatar.css',\n shadow: true,\n})\nexport class BcmAvatar {\n /** Source URL for avatar image */\n @Prop()\n image: string;\n\n /** Alternative text for image */\n @Prop()\n alt: string;\n\n /** Shape of the avatar (ellipse/square) */\n @Prop()\n shape: AvatarShape = 'ellipse';\n\n /** Size of the avatar */\n @Prop()\n size: AvatarSize = 'medium';\n\n /** Custom background color */\n @Prop()\n color: string;\n\n /** Fallback icon class */\n @Prop()\n icon: string = 'fas fa-user';\n\n /** Status indicator type */\n @Prop()\n status: AvatarStatus;\n\n /** Status indicator animation */\n @Prop()\n blink = false;\n\n /** Display name (used for initials) */\n @Prop()\n name: string;\n\n @State() isFallback: boolean = false;\n\n private getFirstLetters(name: string): string {\n const words = name.split(' ');\n const initials = words.map(word => word.charAt(0).toUpperCase()).join('');\n return initials.substring(0, 2);\n }\n\n render() {\n const baseClass = cs(\n 'bcm-avatar bcm-ui-element bcm-ui-content-display',\n 'uppercase font-medium',\n 'inline-flex items-center justify-center',\n 'bg-[--bcm-avatar-bg] text-[--bcm-avatar-text]',\n {\n 'shape-ellipse rounded-full': this.shape === 'ellipse',\n 'shape-square rounded-[--bcm-ui-radius]': this.shape === 'square',\n 'size-small text-size-4 w-6 h-6': this.size === 'small',\n 'size-medium text-size-5 w-8 h-8': this.size === 'medium',\n 'size-large text-size-6 w-10 h-10': this.size === 'large',\n },\n );\n\n const badgeClass = cs('badge', {\n 'top-0 right-0': this.shape === 'ellipse',\n '-top-0.5 -right-0.5': this.shape === 'square',\n });\n\n const imageClass = cs('image w-full h-full', {\n 'rounded-full': this.shape === 'ellipse',\n 'rounded-[--bcm-ui-radius]': this.shape === 'square',\n });\n\n let style = {};\n\n if (this.color) {\n const isColorTone = this.color.includes('-');\n const _color = isColorTone ? this.color.split('-')[0] : this.color;\n\n const bgColor = `var(--bcm-ui-color-background-palette-${_color}-default)`;\n const textColor = `var(--bcm-ui-color-text-palette-${_color}`;\n style = {\n '--bcm-avatar-bg': bgColor,\n '--bcm-avatar-text': textColor,\n };\n }\n\n const customSize = !Object.keys(['small', 'medium', 'large']).includes(this.size)\n ? {\n width: `${this.size}px`,\n height: `${this.size}px`,\n fontSize: `${+this.size / 2}px`,\n }\n : {};\n\n const RenderContent = () => {\n if (this.isFallback) {\n if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n } else if (this.image) {\n return <img class={imageClass} onError={() => (this.isFallback = true)} src={this.image} alt={this.alt} aria-label={this.alt || this.name || 'Avatar'} />;\n } else if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n };\n\n return (\n <div role=\"img\" aria-label={this.alt || this.name || 'Avatar'} class={baseClass} style={{ ...style, ...customSize }}>\n <RenderContent />\n {this.status && <bcm-badge class={badgeClass} status={this.status} blink={this.blink} aria-hidden=\"true\"></bcm-badge>}\n <slot></slot>\n </div>\n );\n }\n}\n"],"mappings":"+EAAA,MAAMA,EAAY,4rJAClB,MAAAC,EAAeD,E,MCQFE,EAAS,MALtB,WAAAC,CAAAC,G,UAgBEC,KAAAC,MAAqB,UAIrBD,KAAAE,KAAmB,SAQnBF,KAAAG,KAAe,cAQfH,KAAAI,MAAQ,MAMCJ,KAAAK,WAAsB,K,CAEvB,eAAAC,CAAgBC,GACtB,MAAMC,EAAQD,EAAKE,MAAM,KACzB,MAAMC,EAAWF,EAAMG,KAAIC,GAAQA,EAAKC,OAAO,GAAGC,gBAAeC,KAAK,IACtE,OAAOL,EAASM,UAAU,EAAG,E,CAG/B,MAAAC,GACE,MAAMC,EAAYC,EAChB,mDACA,wBACA,0CACA,gDACA,CACE,6BAA8BnB,KAAKC,QAAU,UAC7C,yCAA0CD,KAAKC,QAAU,SACzD,iCAAkCD,KAAKE,OAAS,QAChD,kCAAmCF,KAAKE,OAAS,SACjD,mCAAoCF,KAAKE,OAAS,UAItD,MAAMkB,EAAaD,EAAG,QAAS,CA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rB,GAAUO,IACrGO,EAACD,EAAa,MACbnC,KAAK4C,QAAUR,EAAA,aAAWC,MAAOjB,EAAYwB,OAAQ5C,KAAK4C,OAAQxC,MAAOJ,KAAKI,MAAK,cAAc,SAClGgC,EAAA,a","ignoreList":[]}
1
+ {"version":3,"names":["avatarCss","BcmAvatarStyle0","BcmAvatar","constructor","hostRef","this","shape","size","icon","blink","isFallback","getFirstLetters","name","words","split","initials","map","word","charAt","toUpperCase","join","substring","render","baseClass","cs","badgeClass","imageClass","style","color","isColorTone","includes","_color","bgColor","textColor","customSize","Object","keys","width","height","fontSize","RenderContent","h","class","image","onError","src","alt","role","assign","status"],"sources":["src/components/avatar/avatar.css?tag=bcm-avatar&encapsulation=shadow","src/components/avatar/avatar.component.tsx"],"sourcesContent":[":host {\n --bcm-avatar-bg: var(--bcm-ui-color-background-default-default);\n --bcm-avatar-text: var(--bcm-ui-color-text-default);\n --bcm-avatar-radius: 50%;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport cs from 'classnames';\nimport { AvatarShape, AvatarSize, AvatarStatus } from './types';\n\n@Component({\n tag: 'bcm-avatar',\n styleUrl: 'avatar.css',\n shadow: true,\n})\nexport class BcmAvatar {\n /** Source URL for avatar image */\n @Prop()\n image: string;\n\n /** Alternative text for image */\n @Prop()\n alt: string;\n\n /** Shape of the avatar (ellipse/square) */\n @Prop()\n shape: AvatarShape = 'ellipse';\n\n /** Size of the avatar */\n @Prop()\n size: AvatarSize = 'medium';\n\n /** Custom background color */\n @Prop()\n color: string;\n\n /** Fallback icon class */\n @Prop()\n icon: string = 'fas fa-user';\n\n /** Status indicator type */\n @Prop()\n status: AvatarStatus;\n\n /** Status indicator animation */\n @Prop()\n blink = false;\n\n /** Display name (used for initials) */\n @Prop()\n name: string;\n\n @State() isFallback: boolean = false;\n\n private getFirstLetters(name: string): string {\n const words = name.split(' ');\n const initials = words.map(word => word.charAt(0).toUpperCase()).join('');\n return initials.substring(0, 2);\n }\n\n render() {\n const baseClass = cs(\n 'bcm-avatar bcm-ui-element bcm-ui-content-display',\n 'uppercase font-medium',\n 'inline-flex items-center justify-center',\n 'bg-[--bcm-avatar-bg] text-[--bcm-avatar-text]',\n {\n 'shape-ellipse rounded-full': this.shape === 'ellipse',\n 'shape-square rounded-[--bcm-ui-radius]': this.shape === 'square',\n 'size-small text-size-4 w-6 h-6': this.size === 'small',\n 'size-medium text-size-5 w-8 h-8': this.size === 'medium',\n 'size-large text-size-6 w-10 h-10': this.size === 'large',\n },\n );\n\n const badgeClass = cs('badge', {\n 'top-0 right-0': this.shape === 'ellipse',\n '-top-0.5 -right-0.5': this.shape === 'square',\n });\n\n const imageClass = cs('image w-full h-full', {\n 'rounded-full': this.shape === 'ellipse',\n 'rounded-[--bcm-ui-radius]': this.shape === 'square',\n });\n\n let style = {};\n\n if (this.color) {\n const isColorTone = this.color.includes('-');\n const _color = isColorTone ? this.color.split('-')[0] : this.color;\n\n const bgColor = `var(--bcm-ui-color-background-palette-${_color}-default)`;\n const textColor = `var(--bcm-ui-color-text-palette-${_color}`;\n style = {\n '--bcm-avatar-bg': bgColor,\n '--bcm-avatar-text': textColor,\n };\n }\n\n const customSize = !Object.keys(['small', 'medium', 'large']).includes(this.size)\n ? {\n width: `${this.size}px`,\n height: `${this.size}px`,\n fontSize: `${+this.size / 2}px`,\n }\n : {};\n\n const RenderContent = () => {\n if (this.isFallback) {\n if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n } else if (this.image) {\n return <img class={imageClass} onError={() => (this.isFallback = true)} src={this.image} alt={this.alt} aria-label={this.alt || this.name || 'Avatar'} />;\n } else if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n };\n\n return (\n <div role=\"img\" aria-label={this.alt || this.name || 'Avatar'} class={baseClass} style={{ ...style, ...customSize }}>\n <RenderContent />\n {this.status && <bcm-badge class={badgeClass} status={this.status} blink={this.blink} aria-hidden=\"true\"></bcm-badge>}\n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KAAKE,KAAO,OAE5B,GAEJ,MAAMiC,EAAgB,KACpB,GAAInC,KAAKK,WAAY,CACnB,GAAIL,KAAKO,KAAM,CACb,OAAOP,KAAKM,gBAAgBN,KAAKO,K,KAC5B,CACL,OAAO6B,EAAA,KAAGC,MAAOrC,KAAKG,M,OAEnB,GAAIH,KAAKsC,MAAO,CACrB,OAAOF,EAAA,OAAKC,MAAOhB,EAAYkB,QAAS,IAAOvC,KAAKK,WAAa,KAAOmC,IAAKxC,KAAKsC,MAAOG,IAAKzC,KAAKyC,IAAG,aAAczC,KAAKyC,KAAOzC,KAAKO,MAAQ,U,MACxI,GAAIP,KAAKO,KAAM,CACpB,OAAOP,KAAKM,gBAAgBN,KAAKO,K,KAC5B,CACL,OAAO6B,EAAA,KAAGC,MAAOrC,KAAKG,M,GAI1B,OACEiC,EAAA,OAAKM,KAAK,MAAK,aAAa1C,KAAKyC,KAAOzC,KAAKO,MAAQ,SAAU8B,MAAOnB,EAAWI,MAAKQ,OAAAa,OAAAb,OAAAa,OAAA,GAAOrB,GAAUO,IACrGO,EAACD,EAAa,MACbnC,KAAK4C,QAAUR,EAAA,aAAWC,MAAOjB,EAAYwB,OAAQ5C,KAAK4C,OAAQxC,MAAOJ,KAAKI,MAAK,cAAc,SAClGgC,EAAA,a","ignoreList":[]}
@@ -0,0 +1,92 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-c36002ae.js');
6
+
7
+ const accordionGroupCss = ".block{display:block}:host{--bcm-accordion-border:var(--bcm-ui-color-border-default);--bcm-accordion-radius:6px;display:block;width:100%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.collapse{visibility:collapse}.static{position:static}.flex{display:flex}.w-full{width:100%}.flex-col{flex-direction:column}.rounded-\\[--bcm-accordion-radius\\]{border-radius:var(--bcm-accordion-radius)}.border{border-width:1px}.border-\\[--bcm-accordion-border\\]{border-color:var(--bcm-accordion-border)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}";
8
+ const BcmAccordionGroupStyle0 = accordionGroupCss;
9
+
10
+ const BcmAccordionGroup = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.bcmAccordionGroupChange = index.createEvent(this, "bcmAccordionGroupChange", 1);
14
+ /** Controls whether multiple accordions can be expanded simultaneously */
15
+ this.multi = false;
16
+ /** Array of accordion elements within the group */
17
+ this.accordionItems = [];
18
+ /**
19
+ * Updates the accordion items array when slot content changes
20
+ */
21
+ this.handleSlotChange = () => {
22
+ this.accordionItems = Array.from(this.host.querySelectorAll('bcm-accordion'));
23
+ this.setGroupBehavior();
24
+ // Validate accordion items
25
+ if (this.accordionItems.length === 0) {
26
+ console.warn('No accordion items found in accordion group');
27
+ }
28
+ };
29
+ }
30
+ /**
31
+ * Expands all accordions in the group
32
+ * Only available when multi=true
33
+ */
34
+ async expandAll() {
35
+ if (!this.multi) {
36
+ console.warn('expandAll is only available when multi=true');
37
+ return;
38
+ }
39
+ await Promise.all(this.accordionItems.map(item => item.expand()));
40
+ }
41
+ /**
42
+ * Collapses all accordions in the group
43
+ */
44
+ async collapseAll() {
45
+ await Promise.all(this.accordionItems.map(item => item.collapse()));
46
+ }
47
+ /**
48
+ * Returns an array of currently expanded accordion elements
49
+ */
50
+ async getExpandedItems() {
51
+ return this.accordionItems.filter(item => item.expanded);
52
+ }
53
+ componentWillLoad() {
54
+ this.handleSlotChange();
55
+ }
56
+ setGroupBehavior() {
57
+ this.accordionItems.forEach(item => {
58
+ item.group = true;
59
+ });
60
+ }
61
+ /**
62
+ * Handles state changes of individual accordions
63
+ */
64
+ handleAccordionChange(event) {
65
+ this.handleSlotChange();
66
+ const { expanded, source } = event === null || event === void 0 ? void 0 : event.detail;
67
+ if (!this.multi) {
68
+ this.accordionItems.forEach(item => {
69
+ if (item !== source) {
70
+ item.collapse();
71
+ }
72
+ item.expanded = item === source ? expanded : false;
73
+ });
74
+ }
75
+ const expandedItems = this.accordionItems.filter(item => item.expanded);
76
+ this.bcmAccordionGroupChange.emit({
77
+ expanded,
78
+ changed: source,
79
+ expandedItems,
80
+ expandedCount: expandedItems.length,
81
+ });
82
+ }
83
+ render() {
84
+ return (index.h("div", { key: '0f246414941ec5215aa36b0a7c063e8782d0db2a', class: "flex flex-col bcm-ui-element w-full border border-[--bcm-accordion-border] rounded-[--bcm-accordion-radius]", role: "group", "aria-label": "Accordion group" }, index.h("slot", { key: 'b4ea13c00603855d4629fc9cfc0d85c64ef5bce7', onSlotchange: this.handleSlotChange })));
85
+ }
86
+ get host() { return index.getElement(this); }
87
+ };
88
+ BcmAccordionGroup.style = BcmAccordionGroupStyle0;
89
+
90
+ exports.bcm_accordion_group = BcmAccordionGroup;
91
+
92
+ //# sourceMappingURL=bcm-accordion-group.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"bcm-accordion-group.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,s/BAAs/B,CAAC;AACjhC,gCAAe,iBAAiB;;MCmEnB,iBAAiB;IAL9B;;;;QAUY,UAAK,GAAY,KAAK,CAAC;;QAGtB,mBAAc,GAA8B,EAAE,CAAC;;;;QAoDhD,qBAAgB,GAAG;YACvB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;YAC9E,IAAI,CAAC,gBAAgB,EA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CAAC,QAAQ,GAAG,IAAI,KAAK,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;aACtD,CAAC,CAAC;SACN;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC;YAC9B,QAAQ;YACR,OAAO,EAAE,MAAM;YACf,aAAa;YACb,aAAa,EAAE,aAAa,CAAC,MAAM;SACtC,CAAC,CAAC;KACN;IAED,MAAM;QACF,QACIA,kEACI,KAAK,EAAC,6GAA6G,EACnH,IAAI,EAAC,OAAO,gBACD,iBAAiB,IAE5BA,mEAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAS,CAChD,EACR;KACL;;;;;;;","names":["h"],"sources":["src/components/accordion-group/accordion-group.css?tag=bcm-accordion-group&encapsulation=shadow","src/components/accordion-group/accordion-group.component.tsx"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n --bcm-accordion-border: var(--bcm-ui-color-border-default);\n --bcm-accordion-radius: 6px;\n}\n","\nimport { Component, ComponentInterface, h, Element, Prop, Listen, State, Event, EventEmitter, Method } from '@stencil/core';\nimport { AccordionChangeEventType } from '../accordion/types';\nimport { AccordionGroupChangeEventType } from './types';\n\n/**\n* @component BcmAccordionGroup\n* @description A container component that manages a group of accordions. Provides single/multiple expansion \n* modes and methods for controlling all accordions simultaneously. Uses shadow DOM for style encapsulation.\n*\n* @example Basic usage - Single expansion mode\n* <bcm-accordion-group>\n* <bcm-accordion>\n* <div slot=\"title\">Section 1</div>\n* <div>Content 1</div>\n* </bcm-accordion>\n* <bcm-accordion>\n* <div slot=\"title\">Section 2</div>\n* <div>Content 2</div>\n* </bcm-accordion>\n* </bcm-accordion-group>\n*\n* @example Multiple expansion mode\n* <bcm-accordion-group multi={true}>\n* <bcm-accordion>...</bcm-accordion>\n* <bcm-accordion>...</bcm-accordion>\n* </bcm-accordion-group>\n* \n* @example Event handling\n* // Listen to accordion group changes\n* const accordionGroup = document.querySelector('bcm-accordion-group');\n* accordionGroup.addEventListener('bcmAccordionGroupChange', (event) => {\n* const { expanded, changed, expandedItems, expandedCount } = event.detail;\n* console.log('Accordion expanded state:', expanded);\n* console.log('Changed accordion:', changed);\n* console.log('Currently expanded accordions:', expandedItems);\n* console.log('Number of expanded accordions:', expandedCount);\n* });\n* \n* // Using methods\n* await accordionGroup.expandAll(); // Expands all accordions (only in multi mode)\n* await accordionGroup.collapseAll(); // Collapses all accordions\n* const expanded = await accordionGroup.getExpandedItems(); // Gets expanded accordions\n*\n* @prop {boolean} multi - Controls whether multiple accordions can be expanded simultaneously (default: false)\n*\n* @slot default - Container slot for bcm-accordion components\n*\n* @event {EventEmitter<AccordionGroupChangeEventType>} bcmAccordionGroupChange - Emitted when any accordion's state changes\n* @eventProperty {boolean} expanded - Current expanded state of the changed accordion\n* @eventProperty {HTMLElement} changed - The accordion element that triggered the change\n* @eventProperty {HTMLElement[]} expandedItems - Array of currently expanded accordion elements\n* @eventProperty {number} expandedCount - Number of currently expanded accordions\n*\n* @method expandAll() - Expands all accordions (only available in multi mode)\n* @method collapseAll() - Collapses all accordions\n* @method getExpandedItems() - Returns array of currently expanded accordions\n*\n* @csspart container - The accordion group container element\n*\n* @css {string} --bcm-accordion-border - Border color of the accordion group\n* @css {string} --bcm-accordion-radius - Border radius of the accordion group\n*/\n@Component({\n tag: 'bcm-accordion-group',\n styleUrl: 'accordion-group.css',\n shadow: true,\n})\nexport class BcmAccordionGroup implements ComponentInterface {\n /** Reference to the host element */\n @Element() host: HTMLElement;\n\n /** Controls whether multiple accordions can be expanded simultaneously */\n @Prop() multi: boolean = false;\n\n /** Array of accordion elements within the group */\n @State() accordionItems: HTMLBcmAccordionElement[] = [];\n\n /** Event emitted when any accordion's expanded state changes */\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n }) bcmAccordionGroupChange: EventEmitter<AccordionGroupChangeEventType>;\n\n /**\n * Expands all accordions in the group\n * Only available when multi=true\n */\n @Method()\n async expandAll(): Promise<void> {\n if (!this.multi) {\n console.warn('expandAll is only available when multi=true');\n return;\n }\n await Promise.all(this.accordionItems.map(item => item.expand()));\n }\n\n /**\n * Collapses all accordions in the group\n */\n @Method()\n async collapseAll(): Promise<void> {\n await Promise.all(this.accordionItems.map(item => item.collapse()));\n }\n\n /**\n * Returns an array of currently expanded accordion elements\n */\n @Method()\n async getExpandedItems(): Promise<HTMLBcmAccordionElement[]> {\n return this.accordionItems.filter(item => item.expanded);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n\n private setGroupBehavior(): void {\n this.accordionItems.forEach(item => {\n item.group = true;\n });\n }\n\n /**\n * Updates the accordion items array when slot content changes\n */\n private handleSlotChange = () => {\n this.accordionItems = Array.from(this.host.querySelectorAll('bcm-accordion'));\n this.setGroupBehavior();\n // Validate accordion items\n if (this.accordionItems.length === 0) {\n console.warn('No accordion items found in accordion group');\n }\n };\n\n /**\n * Handles state changes of individual accordions\n */\n @Listen('bcmAccordionChange', { capture: true })\n handleAccordionChange(event: CustomEvent<AccordionChangeEventType>) {\n this.handleSlotChange();\n const { expanded, source } = event?.detail;\n\n if (!this.multi) {\n this.accordionItems.forEach(item => {\n if (item !== source) {\n item.collapse();\n }\n item.expanded = item === source ? expanded : false;\n });\n }\n\n const expandedItems = this.accordionItems.filter(item => item.expanded);\n this.bcmAccordionGroupChange.emit({\n expanded,\n changed: source,\n expandedItems,\n expandedCount: expandedItems.length,\n });\n }\n\n render() {\n return (\n <div\n class=\"flex flex-col bcm-ui-element w-full border border-[--bcm-accordion-border] rounded-[--bcm-accordion-radius]\"\n role=\"group\"\n aria-label=\"Accordion group\"\n >\n <slot onSlotchange={this.handleSlotChange}></slot>\n </div>\n );\n }\n}"],"version":3}
@@ -0,0 +1,128 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-c36002ae.js');
6
+ const index$1 = require('./index-310db2a6.js');
7
+
8
+ const accordionCss = ".block{display:block}.flex{display:flex}.border{border-width:1px}:host{--bcm-accordion-bg:var(--bcm-ui-color-background-basic-panel);--bcm-accordion-content-bg:var(--bcm-ui-color-background-basic-base);--bcm-accordion-text:var(--bcm-ui-color-text-header);--bcm-accordion-border:var(--bcm-ui-color-border-default);--bcm-accordion-radius:6px;--bcm-accordion-footer-bg:var(--bcm-ui-color-background-default-default);display:block;width:100%}:host(:not([group])) .accordion-container{border:1px solid var(--bcm-accordion-border);border-radius:var(--bcm-accordion-radius)}:host([group]) .accordion-container{border-bottom:1px solid var(--bcm-accordion-border);border-radius:0}:host([group]:last-of-type) .accordion-container{border-bottom:none}:host([group]:first-of-type) .accordion-container{border-top-left-radius:var(--bcm-accordion-radius);border-top-right-radius:var(--bcm-accordion-radius)}:host([group]:last-of-type) .accordion-footer{border-bottom-left-radius:var(--bcm-accordion-radius);border-bottom-right-radius:var(--bcm-accordion-radius)}:host(:not([group])) .accordion-footer{border-bottom-left-radius:var(--bcm-accordion-radius);border-bottom-right-radius:var(--bcm-accordion-radius)}::slotted([slot=title]){align-items:center;display:flex;flex-direction:row;gap:10px}::slotted([slot=actions]){align-items:center;display:flex;flex-direction:row;gap:12px}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.collapse{visibility:collapse}.static{position:static}.hidden{display:none}.w-full{width:100%}.rotate-0{--tw-rotate:0deg}.rotate-0,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.overflow-hidden{overflow:hidden}.rounded-\\[--bcm-accordion-radius\\]{border-radius:var(--bcm-accordion-radius)}.bg-\\[--bcm-accordion-bg\\]{background-color:var(--bcm-accordion-bg)}.bg-\\[--bcm-accordion-footer-bg\\]{background-color:var(--bcm-accordion-footer-bg)}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-normal{font-weight:400}.font-semibold{font-weight:600}.text-\\[--bcm-accordion-text\\]{color:var(--bcm-accordion-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}";
9
+ const BcmAccordionStyle0 = accordionCss;
10
+
11
+ const BcmAccordion = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.bcmAccordionChange = index.createEvent(this, "bcmAccordionChange", 1);
15
+ /**
16
+ * Controls whether the accordion is expanded or collapsed.
17
+ * @prop
18
+ * @defaultValue false
19
+ */
20
+ this.expanded = false;
21
+ /**
22
+ * Indicates if the accordion is part of a group.
23
+ * Used for group behavior coordination.
24
+ * @prop
25
+ * @defaultValue false
26
+ */
27
+ this.group = false;
28
+ /**
29
+ * Tracks whether footer content is present.
30
+ * @state
31
+ */
32
+ this.hasFooterContent = false;
33
+ /**
34
+ * Handles changes to the footer slot content.
35
+ * @private
36
+ * @param e - Slot change event
37
+ */
38
+ this.handleFooterSlotChange = (e) => {
39
+ const slot = e.target;
40
+ const assignedNodes = slot.assignedNodes();
41
+ this.hasFooterContent = assignedNodes.length > 0;
42
+ };
43
+ this.accordionClass = index$1.ce({
44
+ slots: {
45
+ container: 'accordion-container flex flex-col bcm-ui-element w-full ',
46
+ header: 'accordion-header flex flex-row justify-between gap-2 p-4 w-full flex-nowrap rounded-[--bcm-accordion-radius] bg-[--bcm-accordion-bg] text-[--bcm-accordion-text] font-semibold text-size-6 cursor-pointer',
47
+ content: 'accordion-content overflow-hidden transition-all duration-300 ease-in-out bg-color-basic-base',
48
+ footer: 'accordion-footer flex flex-row w-full flex-nowrap bg-[--bcm-accordion-footer-bg] text-[--bcm-accordion-text] px-4 py-2 gap-2 text-size-4 font-normal',
49
+ icon: 'accordion-icon cursor-pointer transform transition-transform duration-300',
50
+ rightSection: 'accordion-right-section flex flex-row gap-2.5 items-center',
51
+ },
52
+ variants: {
53
+ hasFooterContent: {
54
+ false: { footer: 'hidden' },
55
+ true: { footer: 'flex' },
56
+ },
57
+ expanded: {
58
+ true: { icon: 'rotate-180' },
59
+ false: {
60
+ icon: 'rotate-0',
61
+ content: '',
62
+ },
63
+ },
64
+ },
65
+ }, {
66
+ twMerge: false,
67
+ });
68
+ }
69
+ /**
70
+ * Toggles the accordion's expanded state.
71
+ * @method
72
+ * @returns Promise<void>
73
+ */
74
+ async toggle() {
75
+ this.expanded = !this.expanded;
76
+ this.updateAccordion();
77
+ }
78
+ /**
79
+ * Expands the accordion if it's not already expanded.
80
+ * @method
81
+ * @returns Promise<void>
82
+ */
83
+ async expand() {
84
+ if (!this.expanded) {
85
+ this.expanded = true;
86
+ this.updateAccordion();
87
+ }
88
+ }
89
+ /**
90
+ * Collapses the accordion if it's currently expanded.
91
+ * @method
92
+ * @returns Promise<void>
93
+ */
94
+ async collapse() {
95
+ if (this.expanded) {
96
+ this.expanded = false;
97
+ this.updateAccordion();
98
+ }
99
+ }
100
+ /**
101
+ * Updates the accordion's content height and emits change event.
102
+ * @private
103
+ */
104
+ updateAccordion() {
105
+ if (this.contentEl) {
106
+ this.contentEl.style.maxHeight = this.expanded ? `${this.contentEl.scrollHeight}px` : '0px';
107
+ }
108
+ this.bcmAccordionChange.emit({ expanded: this.expanded, source: this.host });
109
+ }
110
+ render() {
111
+ const { container, header, content, footer, icon, rightSection } = this.accordionClass({
112
+ hasFooterContent: this.hasFooterContent || !!this.hintText,
113
+ expanded: this.expanded,
114
+ });
115
+ return (index.h("div", { key: '922ea5d855cd5f258b818f88eb84816f70f86c7b', class: container() }, index.h("header", { key: 'fba4262f2f89b844ddad4281adb5afe1c1259098', class: header(), role: "button", tabindex: "0", "aria-expanded": this.expanded.toString(), "aria-controls": "accordion-content", onKeyDown: e => {
116
+ if (e.key === 'Enter' || e.key === ' ') {
117
+ e.preventDefault();
118
+ this.toggle();
119
+ }
120
+ }, onClick: () => this.toggle() }, index.h("slot", { key: '6fcc3e3a53a72d5c75cea2fba06492d8f37a0acb', name: "title" }, this.headerTitle), index.h("div", { key: '8081368dfd97ee1dea78e5321afce756d0ea50b8', class: rightSection() }, index.h("span", { key: 'e0812c8a241eb68013235903361fb686569404f6', onClick: e => e.stopPropagation() }, index.h("slot", { key: '1297931978197bde53b3440f21b44390f6c1ea9f', name: "actions" })), index.h("bcm-icon", { key: '68c98f6de7971a133353fc0d2e32cff6ab7fbf21', name: "fa-regular fa-chevron-down", class: icon() }))), index.h("div", { key: 'a4b4af57da514152f5f70629d4eb1da6e03e7d0e', class: content(), style: { maxHeight: this.expanded ? 'auto' : '0px' }, ref: el => (this.contentEl = el) }, index.h("div", { key: '95ccdde513bfe397fb877b86f53d27c1746c1aba', class: "px-4 py-2" }, index.h("slot", { key: '30ed3ced7b157bb46b8aaae37811f3decbc878cf' })), index.h("footer", { key: '1a9fe8f54b1969518bb9096ee7366188bbde05e0', class: footer() }, index.h("slot", { key: 'cf95b6191c48ec329098e4de21ae16c1fcb048ba', name: "footer", onSlotchange: this.handleFooterSlotChange }, this.hintText)))));
121
+ }
122
+ get host() { return index.getElement(this); }
123
+ };
124
+ BcmAccordion.style = BcmAccordionStyle0;
125
+
126
+ exports.bcm_accordion = BcmAccordion;
127
+
128
+ //# sourceMappingURL=bcm-accordion.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"bcm-accordion.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,ozHAAozH,CAAC;AAC10H,2BAAe,YAAY;;MCyEd,YAAY;IALzB;;;;;;;;QAeE,aAAQ,GAAY,KAAK,CAAC;;;;;;;QAkB1B,UAAK,GAAY,KAAK,CAAC;;;;;QAcvB,qBAAgB,GAAY,KAAK,CAAC;;;;;;QAqE1B,2BAAsB,GAAG,CAAC,CAAQ;YACxC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAyB,CAAC;YACzC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3C,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;SAClD,CAAC;QAEM,mBAAc,GAAGA,UAAE,CACzB;YACE,KAAK,EAAE;gBACL,SAAS,EAAE,0DAA0D;gBACrE,MAAM,EACJ,2MAA2M;gBAC7M,OAAO,EAAE,+FAA+F;gBACxG,MAAM,EAAE,sJAAsJ;gBAC9J,IAAI,EAAE,2EAA2E;gBACjF,YAAY,EAAE,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AAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,IAC1D,IAAI,CAAC,QAAQ,CACT,CACA,CACL,CACF,EACN;KACH;;;;;;;","names":["tv","h"],"sources":["src/components/accordion/accordion.css?tag=bcm-accordion&encapsulation=shadow","src/components/accordion/accordion.component.tsx"],"sourcesContent":[":host {\n display: block;\n width: 100%;\n --bcm-accordion-bg: var(--bcm-ui-color-background-basic-panel);\n --bcm-accordion-content-bg: var(--bcm-ui-color-background-basic-base);\n --bcm-accordion-text: var(--bcm-ui-color-text-header);\n --bcm-accordion-border: var(--bcm-ui-color-border-default);\n --bcm-accordion-radius: 6px;\n --bcm-accordion-footer-bg: var(--bcm-ui-color-background-default-default);\n}\n\n:host(:not([group])) .accordion-container {\n border: 1px solid var(--bcm-accordion-border);\n border-radius: var(--bcm-accordion-radius);\n}\n\n:host([group]) .accordion-container {\n border-bottom: 1px solid var(--bcm-accordion-border);\n border-radius: 0;\n}\n\n:host([group]:last-of-type) .accordion-container {\n border-bottom: none;\n}\n\n:host([group]:first-of-type) .accordion-container {\n border-top-left-radius: var(--bcm-accordion-radius);\n border-top-right-radius: var(--bcm-accordion-radius);\n}\n\n:host([group]:last-of-type) .accordion-footer {\n border-bottom-left-radius: var(--bcm-accordion-radius);\n border-bottom-right-radius: var(--bcm-accordion-radius);\n}\n\n:host(:not([group])) .accordion-footer {\n border-bottom-left-radius: var(--bcm-accordion-radius);\n border-bottom-right-radius: var(--bcm-accordion-radius);\n}\n\n::slotted([slot='title']) {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 10px;\n}\n::slotted([slot='actions']) {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n}\n","import { Component, ComponentInterface, EventEmitter, h, Method, Prop, Event, State, Element } from '@stencil/core';\nimport { tv } from 'tailwind-variants';\nimport { AccordionChangeEventType } from './types';\n\n/**\n * @component BcmAccordion\n * @description A collapsible accordion component that provides expandable/collapsible content sections with keyboard navigation\n * and accessibility features. Offers customizable header, content, and footer areas through slots.\n *\n * @example Basic usage\n * <bcm-accordion>\n * <div slot=\"title\">Accordion Title</div>\n * <div>Content goes here</div>\n * </bcm-accordion>\n *\n * @example With all slots and hint text\n * <bcm-accordion hint-text=\"Additional information\">\n * <div slot=\"title\">Title</div>\n * <div slot=\"actions\">\n * <button>Action</button>\n * </div>\n * <div>Main content</div>\n * <div slot=\"footer\">Footer content</div>\n * </bcm-accordion>\n *\n * @example Event handling\n * // Listen to accordion state changes\n * const accordion = document.querySelector('bcm-accordion');\n * accordion.addEventListener('bcmAccordionChange', (event) => {\n * const { expanded, source } = event.detail;\n * console.log('Accordion expanded:', expanded);\n * console.log('Changed accordion:', source);\n * });\n *\n * // Programmatically control accordion\n * await accordion.toggle(); // Toggle state\n * await accordion.expand(); // Expand accordion\n * await accordion.collapse(); // Collapse accordion\n *\n * @prop {boolean} expanded - Controls the expanded state of the accordion (default: false)\n * @prop {boolean} group - Indicates if the accordion is part of an accordion group (default: false)\n * @prop {string} hintText - Optional hint text to display in the footer when no footer content is provided\n *\n * @slot title - Primary title content for the accordion header (required)\n * @slot actions - Additional actions to be displayed in the header (optional)\n * @slot default - Main content area of the accordion\n * @slot footer - Optional footer content (overrides hint-text if provided)\n *\n * @event {EventEmitter<AccordionChangeEventType>} bcmAccordionChange - Emitted when the accordion's expanded state changes\n * @eventProperty {boolean} expanded - Current expanded state\n * @eventProperty {HTMLBcmAccordionElement} source - Reference to the accordion element that changed\n *\n * @csspart container - The root container element\n * @csspart header - The header section with title and actions\n * @csspart content - The collapsible content section\n * @csspart footer - The footer section with hint text or footer slot\n * @csspart section - Container for header content sections\n * @csspart icon - The expand/collapse chevron icon\n *\n * @css {string} --bcm-accordion-radius - Border radius of the accordion header (default: 4px)\n * @css {string} --bcm-accordion-bg - Background color of the accordion header\n * @css {string} --bcm-accordion-text - Text color of the accordion\n * @css {string} --bcm-accordion-footer-bg - Background color of the footer section\n *\n * @methods\n * toggle() - Toggles the accordion's expanded state\n * expand() - Expands the accordion if collapsed\n * collapse() - Collapses the accordion if expanded\n */\n@Component({\n tag: 'bcm-accordion',\n styleUrl: 'accordion.css',\n shadow: true,\n})\nexport class BcmAccordion implements ComponentInterface {\n /** Reference to the host element */\n @Element() host: HTMLElement;\n\n /**\n * Controls whether the accordion is expanded or collapsed.\n * @prop\n * @defaultValue false\n */\n @Prop({ reflect: true, mutable: true })\n expanded: boolean = false;\n\n /**\n * Optional title text to display in the header.\n * @prop\n * @defaultValue undefined\n */\n @Prop()\n headerTitle?: string;\n\n /**\n * Indicates if the accordion is part of a group.\n * Used for group behavior coordination.\n * @prop\n * @defaultValue false\n */\n\n @Prop({ reflect: true })\n group: boolean = false;\n\n /**\n * Optional text to display in the footer when no footer slot content is provided.\n * @prop\n */\n @Prop({ attribute: 'hint-text' })\n hintText?: string;\n\n /**\n * Tracks whether footer content is present.\n * @state\n */\n @State()\n hasFooterContent: boolean = false;\n\n /**\n * Emitted when the accordion's expanded state changes.\n * @event\n */\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n eventName: 'bcmAccordionChange',\n })\n bcmAccordionChange: EventEmitter<AccordionChangeEventType>;\n\n private contentEl?: HTMLElement;\n\n /**\n * Toggles the accordion's expanded state.\n * @method\n * @returns Promise<void>\n */\n @Method()\n async toggle(): Promise<void> {\n this.expanded = !this.expanded;\n this.updateAccordion();\n }\n\n /**\n * Expands the accordion if it's not already expanded.\n * @method\n * @returns Promise<void>\n */\n @Method()\n async expand(): Promise<void> {\n if (!this.expanded) {\n this.expanded = true;\n this.updateAccordion();\n }\n }\n\n /**\n * Collapses the accordion if it's currently expanded.\n * @method\n * @returns Promise<void>\n */\n @Method()\n async collapse(): Promise<void> {\n if (this.expanded) {\n this.expanded = false;\n this.updateAccordion();\n }\n }\n\n /**\n * Updates the accordion's content height and emits change event.\n * @private\n */\n private updateAccordion(): void {\n if (this.contentEl) {\n this.contentEl.style.maxHeight = this.expanded ? `${this.contentEl.scrollHeight}px` : '0px';\n }\n this.bcmAccordionChange.emit({ expanded: this.expanded, source: this.host as HTMLBcmAccordionElement });\n }\n\n /**\n * Handles changes to the footer slot content.\n * @private\n * @param e - Slot change event\n */\n private handleFooterSlotChange = (e: Event) => {\n const slot = e.target as HTMLSlotElement;\n const assignedNodes = slot.assignedNodes();\n this.hasFooterContent = assignedNodes.length > 0;\n };\n\n private accordionClass = tv(\n {\n slots: {\n container: 'accordion-container flex flex-col bcm-ui-element w-full ',\n header:\n 'accordion-header flex flex-row justify-between gap-2 p-4 w-full flex-nowrap rounded-[--bcm-accordion-radius] bg-[--bcm-accordion-bg] text-[--bcm-accordion-text] font-semibold text-size-6 cursor-pointer',\n content: 'accordion-content overflow-hidden transition-all duration-300 ease-in-out bg-color-basic-base',\n footer: 'accordion-footer flex flex-row w-full flex-nowrap bg-[--bcm-accordion-footer-bg] text-[--bcm-accordion-text] px-4 py-2 gap-2 text-size-4 font-normal',\n icon: 'accordion-icon cursor-pointer transform transition-transform duration-300',\n rightSection: 'accordion-right-section flex flex-row gap-2.5 items-center',\n },\n variants: {\n hasFooterContent: {\n false: { footer: 'hidden' },\n true: { footer: 'flex' },\n },\n expanded: {\n true: { icon: 'rotate-180' },\n false: {\n icon: 'rotate-0',\n content: '',\n },\n },\n },\n },\n {\n twMerge: false,\n },\n );\n\n render() {\n const { container, header, content, footer, icon, rightSection } = this.accordionClass({\n hasFooterContent: this.hasFooterContent || !!this.hintText,\n expanded: this.expanded,\n });\n\n return (\n <div class={container()}>\n {/* Header */}\n <header\n class={header()}\n role=\"button\"\n tabindex=\"0\"\n aria-expanded={this.expanded.toString()}\n aria-controls=\"accordion-content\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.toggle();\n }\n }}\n onClick={() => this.toggle()}\n >\n <slot name=\"title\">{this.headerTitle}</slot>\n {/* Actions */}\n <div class={rightSection()}>\n <span onClick={e => e.stopPropagation()}>\n <slot name=\"actions\"></slot>\n </span>\n <bcm-icon name=\"fa-regular fa-chevron-down\" class={icon()}></bcm-icon>\n </div>\n </header>\n {/* Content */}\n <div class={content()} style={{ maxHeight: this.expanded ? 'auto' : '0px' }} ref={el => (this.contentEl = el as HTMLElement)}>\n <div class=\"px-4 py-2\">\n <slot></slot>\n </div>\n <footer class={footer()}>\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange}>\n {this.hintText}\n </slot>\n </footer>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-638f2d15.js');
5
+ const index = require('./index-c36002ae.js');
6
6
  const index$1 = require('./index-310db2a6.js');
7
7
 
8
- const alertCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{--bcm-alert-bg:var(--bcm-ui-color-background-default-default);--bcm-alert-text:var(--bcm-ui-color-text-default);--bcm-alert-radius:6px;display:inline-block;width:100%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.static{position:static}.flex{display:flex}.w-full{width:100%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.rounded-\\[--bcm-alert-radius\\]{border-radius:var(--bcm-alert-radius)}.bg-\\[--bcm-alert-bg\\]{background-color:var(--bcm-alert-bg)}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-2\\.5{padding-bottom:.625rem;padding-top:.625rem}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.text-\\[--bcm-alert-text\\]{color:var(--bcm-alert-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
8
+ const alertCss = ":host{--bcm-alert-bg:var(--bcm-ui-color-background-default-default);--bcm-alert-text:var(--bcm-ui-color-text-default);--bcm-alert-radius:6px;display:inline-block;width:100%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.flex{display:flex}.w-full{width:100%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.rounded-\\[--bcm-alert-radius\\]{border-radius:var(--bcm-alert-radius)}.bg-\\[--bcm-alert-bg\\]{background-color:var(--bcm-alert-bg)}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-2\\.5{padding-bottom:.625rem;padding-top:.625rem}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.text-\\[--bcm-alert-text\\]{color:var(--bcm-alert-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
9
9
  const BcmAlertStyle0 = alertCss;
10
10
 
11
11
  const BcmAlert = class {
@@ -1 +1 @@
1
- {"file":"bcm-alert.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,QAAQ,GAAG,ksJAAksJ,CAAC;AACptJ,uBAAe,QAAQ;;MCaV,QAAQ;IALrB;;;;QAQI,WAAM,GAAiB,SAAS,CAAC;;QAIjC,SAAI,GAAe,QAAQ,CAAC;;QAI5B,SAAI,GAAe,QAAQ,CAAC;;QAI5B,gBAAW,GAAa,IAAI,CAAC;;QAI7B,mBAAc,GAAa,IAAI,CAAC;KAiGnC;;;;;IAxFW,SAAS;QACb,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;KAC1B;IAEO,aAAa;QACjB,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IAAI,KAAK,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;KAC1D;IAED,MAAM;QACF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/D,QACIC,kEAAK,IAAI,EAAC,OAAO,eAAW,WAAW,iBAAa,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,IAC7FA,kEAAK,KAAK,EAAE,OAAO,EAAE,IAChB,IAAI,CAAC,cAAc,IAAIA,oFAAqB,IAAI,CAAC,aAAa,EAAE,GAAa,EAC9EA,oEAAa,CACX,EACNA,kEAAK,KAAK,EAAE,OAAO,EAAE,IACjBA,kEAAK,IAAI,EAAC,QAAQ,IACdA,mEAAM,IAAI,EAAC,QAAQ,GAAQ,CACzB,EACNA,mEAAM,IAAI,EAAC,MAAM,IAAE,IAAI,CAAC,WAAW,IAAIA,uEAAU,OAAO,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAC,gBAAgB,eAAW,qBAAqB,GAAY,CAAQ,CAC1J,CACJ,EACR;KACL;;;;;;","names":["tv","h"],"sources":["src/components/alert/alert.css?tag=bcm-alert&encapsulation=shadow","src/components/alert/alert.component.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n --bcm-alert-bg: var(--bcm-ui-color-background-default-default);\n --bcm-alert-text: var(--bcm-ui-color-text-default);\n --bcm-alert-radius: 6px;\n}\n","import { Component, ComponentInterface, h, Prop, Event, EventEmitter } from '@stencil/core';\nimport { AlertKind, AlertSize, AlertStatus } from './types';\nimport { tv } from 'tailwind-variants';\n\n\n/**\n * Alert component that displays messages with different statuses and styles\n * @class BcmAlert\n */\n@Component({\n tag: 'bcm-alert',\n styleUrl: 'alert.css',\n shadow: true,\n})\nexport class BcmAlert implements ComponentInterface {\n /** Alert status type */\n @Prop()\n status?: AlertStatus = 'default';\n\n /** Alert size variant */\n @Prop()\n size?: AlertSize = 'medium';\n\n /** Alert style variant */\n @Prop()\n kind?: AlertKind = 'filled';\n\n /** Whether alert can be dismissed */\n @Prop()\n dismissible?: boolean = true;\n\n /** Whether to show status icon */\n @Prop()\n showStatusIcon?: boolean = true;\n\n @Event() bcmDismiss: EventEmitter<void>;\n\n\n /**\n * Handles alert dismissal\n * @private\n */\n private onDismiss() {\n this.bcmDismiss.emit();\n }\n\n private getStatusIcon() {\n const statusIcon = {\n info: 'fa-regular fa-info-circle',\n error: 'fa-regular fa-exclamation-circle',\n warning: 'fa-regular fa-exclamation-triangle',\n success: 'fa-regular fa-check-circle',\n };\n return statusIcon[this.status];\n }\n\n private get alertClass() {\n return tv(\n {\n slots: {\n base: 'alert bcm-ui-element font-medium flex items-center justify-between bg-[--bcm-alert-bg] text-[--bcm-alert-text] rounded-[--bcm-alert-radius] px-3 gap-3 w-full',\n section: 'flex items-center gap-2',\n },\n variants: {\n size: {\n small: {\n base: 'py-1.5 text-size-4',\n },\n medium: {\n base: 'py-2 text-size-5',\n },\n large: {\n base: 'py-2.5 text-size-6',\n },\n },\n },\n },\n {\n twMerge: false,\n },\n );\n }\n\n private get alertStyles() {\n let colorStatus = {\n info: 'var(--bcm-ui-color-background-palette-blue-default)',\n error: 'var(--bcm-ui-color-background-palette-red-default)',\n warning: 'var(--bcm-ui-color-background-palette-yellow-default)',\n success: 'var(--bcm-ui-color-background-palette-green-default)',\n default: 'var(--bcm-ui-color-background-palette-gray-default)',\n };\n\n let textStatusColor = {\n info: 'var(--bcm-ui-color-text-info)',\n error: 'var(--bcm-ui-color-text-error)',\n warning: 'var(--bcm-ui-color-text-warning)',\n success: 'var(--bcm-ui-color-text-success)',\n default: 'var(--bcm-ui-color-text-default)',\n };\n\n let filleStyle = {\n '--bcm-alert-bg': colorStatus[this.status],\n '--bcm-alert-text': textStatusColor[this.status],\n };\n\n let textStyle = {\n '--bcm-alert-bg': 'transparent',\n '--bcm-alert-text': textStatusColor[this.status],\n };\n\n return this.kind === 'filled' ? filleStyle : textStyle;\n }\n\n render() {\n const { base, section } = this.alertClass({ size: this.size });\n return (\n <div role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class={base()} style={this.alertStyles}>\n <div class={section()}>\n {this.showStatusIcon && <bcm-icon icon-name={this.getStatusIcon()}></bcm-icon>}\n <slot></slot>\n </div>\n <div class={section()}>\n <div part=\"action\">\n <slot name=\"action\"></slot>\n </div>\n <span part=\"icon\">{this.dismissible && <bcm-icon onClick={() => this.onDismiss()} class=\"cursor-pointer\" icon-name=\"fa-regular fa-xmark\"></bcm-icon>}</span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bcm-alert.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,QAAQ,GAAG,y8CAAy8C,CAAC;AAC39C,uBAAe,QAAQ;;MCaV,QAAQ;IALrB;;;;QAQI,WAAM,GAAiB,SAAS,CAAC;;QAIjC,SAAI,GAAe,QAAQ,CAAC;;QAI5B,SAAI,GAAe,QAAQ,CAAC;;QAI5B,gBAAW,GAAa,IAAI,CAAC;;QAI7B,mBAAc,GAAa,IAAI,CAAC;KAiGnC;;;;;IAxFW,SAAS;QACb,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;KAC1B;IAEO,aAAa;QACjB,MAAM,UAAU,GAAG;YACf,IAAI,EAAE,2BAA2B;YACjC,KAAK,EAAE,kCAAkC;YACzC,OAAO,EAAE,oCAAoC;YAC7C,OAAO,EAAE,4BAA4B;SACxC,CAAC;QACF,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAClC;IAED,IAAY,UAAU;QAClB,OAAOA,UAAE,CACL;YACI,KAAK,EAAE;gBACH,IAAI,EAAE,+JAA+J;gBACrK,OAAO,EAAE,yBAAyB;aACrC;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE;oBACF,KAAK,EAAE;wBACH,IAAI,EAAE,oBAAoB;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oFAAqB,IAAI,CAAC,aAAa,EAAE,GAAa,EAC9EA,oEAAa,CACX,EACNA,kEAAK,KAAK,EAAE,OAAO,EAAE,IACjBA,kEAAK,IAAI,EAAC,QAAQ,IACdA,mEAAM,IAAI,EAAC,QAAQ,GAAQ,CACzB,EACNA,mEAAM,IAAI,EAAC,MAAM,IAAE,IAAI,CAAC,WAAW,IAAIA,uEAAU,OAAO,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAC,gBAAgB,eAAW,qBAAqB,GAAY,CAAQ,CAC1J,CACJ,EACR;KACL;;;;;;","names":["tv","h"],"sources":["src/components/alert/alert.css?tag=bcm-alert&encapsulation=shadow","src/components/alert/alert.component.tsx"],"sourcesContent":[":host {\n display: inline-block;\n width: 100%;\n --bcm-alert-bg: var(--bcm-ui-color-background-default-default);\n --bcm-alert-text: var(--bcm-ui-color-text-default);\n --bcm-alert-radius: 6px;\n}\n","import { Component, ComponentInterface, h, Prop, Event, EventEmitter } from '@stencil/core';\nimport { AlertKind, AlertSize, AlertStatus } from './types';\nimport { tv } from 'tailwind-variants';\n\n\n/**\n * Alert component that displays messages with different statuses and styles\n * @class BcmAlert\n */\n@Component({\n tag: 'bcm-alert',\n styleUrl: 'alert.css',\n shadow: true,\n})\nexport class BcmAlert implements ComponentInterface {\n /** Alert status type */\n @Prop()\n status?: AlertStatus = 'default';\n\n /** Alert size variant */\n @Prop()\n size?: AlertSize = 'medium';\n\n /** Alert style variant */\n @Prop()\n kind?: AlertKind = 'filled';\n\n /** Whether alert can be dismissed */\n @Prop()\n dismissible?: boolean = true;\n\n /** Whether to show status icon */\n @Prop()\n showStatusIcon?: boolean = true;\n\n @Event() bcmDismiss: EventEmitter<void>;\n\n\n /**\n * Handles alert dismissal\n * @private\n */\n private onDismiss() {\n this.bcmDismiss.emit();\n }\n\n private getStatusIcon() {\n const statusIcon = {\n info: 'fa-regular fa-info-circle',\n error: 'fa-regular fa-exclamation-circle',\n warning: 'fa-regular fa-exclamation-triangle',\n success: 'fa-regular fa-check-circle',\n };\n return statusIcon[this.status];\n }\n\n private get alertClass() {\n return tv(\n {\n slots: {\n base: 'alert bcm-ui-element font-medium flex items-center justify-between bg-[--bcm-alert-bg] text-[--bcm-alert-text] rounded-[--bcm-alert-radius] px-3 gap-3 w-full',\n section: 'flex items-center gap-2',\n },\n variants: {\n size: {\n small: {\n base: 'py-1.5 text-size-4',\n },\n medium: {\n base: 'py-2 text-size-5',\n },\n large: {\n base: 'py-2.5 text-size-6',\n },\n },\n },\n },\n {\n twMerge: false,\n },\n );\n }\n\n private get alertStyles() {\n let colorStatus = {\n info: 'var(--bcm-ui-color-background-palette-blue-default)',\n error: 'var(--bcm-ui-color-background-palette-red-default)',\n warning: 'var(--bcm-ui-color-background-palette-yellow-default)',\n success: 'var(--bcm-ui-color-background-palette-green-default)',\n default: 'var(--bcm-ui-color-background-palette-gray-default)',\n };\n\n let textStatusColor = {\n info: 'var(--bcm-ui-color-text-info)',\n error: 'var(--bcm-ui-color-text-error)',\n warning: 'var(--bcm-ui-color-text-warning)',\n success: 'var(--bcm-ui-color-text-success)',\n default: 'var(--bcm-ui-color-text-default)',\n };\n\n let filleStyle = {\n '--bcm-alert-bg': colorStatus[this.status],\n '--bcm-alert-text': textStatusColor[this.status],\n };\n\n let textStyle = {\n '--bcm-alert-bg': 'transparent',\n '--bcm-alert-text': textStatusColor[this.status],\n };\n\n return this.kind === 'filled' ? filleStyle : textStyle;\n }\n\n render() {\n const { base, section } = this.alertClass({ size: this.size });\n return (\n <div role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class={base()} style={this.alertStyles}>\n <div class={section()}>\n {this.showStatusIcon && <bcm-icon icon-name={this.getStatusIcon()}></bcm-icon>}\n <slot></slot>\n </div>\n <div class={section()}>\n <div part=\"action\">\n <slot name=\"action\"></slot>\n </div>\n <span part=\"icon\">{this.dismissible && <bcm-icon onClick={() => this.onDismiss()} class=\"cursor-pointer\" icon-name=\"fa-regular fa-xmark\"></bcm-icon>}</span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-638f2d15.js');
5
+ const index = require('./index-c36002ae.js');
6
6
  const index$1 = require('./index-a4eea4bb.js');
7
7
 
8
- const avatarCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{--bcm-avatar-bg:var(--bcm-ui-color-background-default-default);--bcm-avatar-text:var(--bcm-ui-color-text-default);--bcm-avatar-radius:50%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.static{position:static}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.right-0{right:0}.top-0{top:0}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.w-10{width:2.5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-\\[--bcm-ui-radius\\]{border-radius:var(--bcm-ui-radius)}.rounded-full{border-radius:9999px}.bg-\\[--bcm-avatar-bg\\]{background-color:var(--bcm-avatar-bg)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.text-\\[--bcm-avatar-text\\]{color:var(--bcm-avatar-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
8
+ const avatarCss = ":host{--bcm-avatar-bg:var(--bcm-ui-color-background-default-default);--bcm-avatar-text:var(--bcm-ui-color-text-default);--bcm-avatar-radius:50%}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.right-0{right:0}.top-0{top:0}.inline-flex{display:inline-flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.w-10{width:2.5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-\\[--bcm-ui-radius\\]{border-radius:var(--bcm-ui-radius)}.rounded-full{border-radius:9999px}.bg-\\[--bcm-avatar-bg\\]{background-color:var(--bcm-avatar-bg)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.text-\\[--bcm-avatar-text\\]{color:var(--bcm-avatar-text)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
9
9
  const BcmAvatarStyle0 = avatarCss;
10
10
 
11
11
  const BcmAvatar = class {
@@ -1 +1 @@
1
- {"file":"bcm-avatar.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,SAAS,GAAG,6rJAA6rJ,CAAC;AAChtJ,wBAAe,SAAS;;MCQX,SAAS;IALtB;;;QAgBE,UAAK,GAAgB,SAAS,CAAC;;QAI/B,SAAI,GAAe,QAAQ,CAAC;;QAQ5B,SAAI,GAAW,aAAa,CAAC;;QAQ7B,UAAK,GAAG,KAAK,CAAC;QAML,eAAU,GAAY,KAAK,CAAC;KA+EtC;IA7ES,eAAe,CAAC,IAAY;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,SAAS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O,KAAK,GAAK,UAAU,KAC/GA,QAAC,aAAa,OAAG,EAChB,IAAI,CAAC,MAAM,IAAIA,uBAAW,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,iBAAc,MAAM,GAAa,EACrHA,qBAAa,CACT,EACN;KACH;;;;;;","names":["cs","h"],"sources":["src/components/avatar/avatar.css?tag=bcm-avatar&encapsulation=shadow","src/components/avatar/avatar.component.tsx"],"sourcesContent":[":host {\n --bcm-avatar-bg: var(--bcm-ui-color-background-default-default);\n --bcm-avatar-text: var(--bcm-ui-color-text-default);\n --bcm-avatar-radius: 50%;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport cs from 'classnames';\nimport { AvatarShape, AvatarSize, AvatarStatus } from './types';\n\n@Component({\n tag: 'bcm-avatar',\n styleUrl: 'avatar.css',\n shadow: true,\n})\nexport class BcmAvatar {\n /** Source URL for avatar image */\n @Prop()\n image: string;\n\n /** Alternative text for image */\n @Prop()\n alt: string;\n\n /** Shape of the avatar (ellipse/square) */\n @Prop()\n shape: AvatarShape = 'ellipse';\n\n /** Size of the avatar */\n @Prop()\n size: AvatarSize = 'medium';\n\n /** Custom background color */\n @Prop()\n color: string;\n\n /** Fallback icon class */\n @Prop()\n icon: string = 'fas fa-user';\n\n /** Status indicator type */\n @Prop()\n status: AvatarStatus;\n\n /** Status indicator animation */\n @Prop()\n blink = false;\n\n /** Display name (used for initials) */\n @Prop()\n name: string;\n\n @State() isFallback: boolean = false;\n\n private getFirstLetters(name: string): string {\n const words = name.split(' ');\n const initials = words.map(word => word.charAt(0).toUpperCase()).join('');\n return initials.substring(0, 2);\n }\n\n render() {\n const baseClass = cs(\n 'bcm-avatar bcm-ui-element bcm-ui-content-display',\n 'uppercase font-medium',\n 'inline-flex items-center justify-center',\n 'bg-[--bcm-avatar-bg] text-[--bcm-avatar-text]',\n {\n 'shape-ellipse rounded-full': this.shape === 'ellipse',\n 'shape-square rounded-[--bcm-ui-radius]': this.shape === 'square',\n 'size-small text-size-4 w-6 h-6': this.size === 'small',\n 'size-medium text-size-5 w-8 h-8': this.size === 'medium',\n 'size-large text-size-6 w-10 h-10': this.size === 'large',\n },\n );\n\n const badgeClass = cs('badge', {\n 'top-0 right-0': this.shape === 'ellipse',\n '-top-0.5 -right-0.5': this.shape === 'square',\n });\n\n const imageClass = cs('image w-full h-full', {\n 'rounded-full': this.shape === 'ellipse',\n 'rounded-[--bcm-ui-radius]': this.shape === 'square',\n });\n\n let style = {};\n\n if (this.color) {\n const isColorTone = this.color.includes('-');\n const _color = isColorTone ? this.color.split('-')[0] : this.color;\n\n const bgColor = `var(--bcm-ui-color-background-palette-${_color}-default)`;\n const textColor = `var(--bcm-ui-color-text-palette-${_color}`;\n style = {\n '--bcm-avatar-bg': bgColor,\n '--bcm-avatar-text': textColor,\n };\n }\n\n const customSize = !Object.keys(['small', 'medium', 'large']).includes(this.size)\n ? {\n width: `${this.size}px`,\n height: `${this.size}px`,\n fontSize: `${+this.size / 2}px`,\n }\n : {};\n\n const RenderContent = () => {\n if (this.isFallback) {\n if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n } else if (this.image) {\n return <img class={imageClass} onError={() => (this.isFallback = true)} src={this.image} alt={this.alt} aria-label={this.alt || this.name || 'Avatar'} />;\n } else if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n };\n\n return (\n <div role=\"img\" aria-label={this.alt || this.name || 'Avatar'} class={baseClass} style={{ ...style, ...customSize }}>\n <RenderContent />\n {this.status && <bcm-badge class={badgeClass} status={this.status} blink={this.blink} aria-hidden=\"true\"></bcm-badge>}\n <slot></slot>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bcm-avatar.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,SAAS,GAAG,46CAA46C,CAAC;AAC/7C,wBAAe,SAAS;;MCQX,SAAS;IALtB;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EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,gBAAc,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,QAAQ,GAAI,CAAC;aAC3J;iBAAM,IAAI,IAAI,CAAC,IAAI,EAAE;gBACpB,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxC;iBAAM;gBACL,OAAOA,eAAG,KAAK,EAAE,IAAI,CAAC,IAAI,GAAM,CAAC;aAClC;SACF,CAAC;QAEF,QACEA,iBAAK,IAAI,EAAC,KAAK,gBAAa,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,kCAAO,KAAK,GAAK,UAAU,KAC/GA,QAAC,aAAa,OAAG,EAChB,IAAI,CAAC,MAAM,IAAIA,uBAAW,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,iBAAc,MAAM,GAAa,EACrHA,qBAAa,CACT,EACN;KACH;;;;;;","names":["cs","h"],"sources":["src/components/avatar/avatar.css?tag=bcm-avatar&encapsulation=shadow","src/components/avatar/avatar.component.tsx"],"sourcesContent":[":host {\n --bcm-avatar-bg: var(--bcm-ui-color-background-default-default);\n --bcm-avatar-text: var(--bcm-ui-color-text-default);\n --bcm-avatar-radius: 50%;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport cs from 'classnames';\nimport { AvatarShape, AvatarSize, AvatarStatus } from './types';\n\n@Component({\n tag: 'bcm-avatar',\n styleUrl: 'avatar.css',\n shadow: true,\n})\nexport class BcmAvatar {\n /** Source URL for avatar image */\n @Prop()\n image: string;\n\n /** Alternative text for image */\n @Prop()\n alt: string;\n\n /** Shape of the avatar (ellipse/square) */\n @Prop()\n shape: AvatarShape = 'ellipse';\n\n /** Size of the avatar */\n @Prop()\n size: AvatarSize = 'medium';\n\n /** Custom background color */\n @Prop()\n color: string;\n\n /** Fallback icon class */\n @Prop()\n icon: string = 'fas fa-user';\n\n /** Status indicator type */\n @Prop()\n status: AvatarStatus;\n\n /** Status indicator animation */\n @Prop()\n blink = false;\n\n /** Display name (used for initials) */\n @Prop()\n name: string;\n\n @State() isFallback: boolean = false;\n\n private getFirstLetters(name: string): string {\n const words = name.split(' ');\n const initials = words.map(word => word.charAt(0).toUpperCase()).join('');\n return initials.substring(0, 2);\n }\n\n render() {\n const baseClass = cs(\n 'bcm-avatar bcm-ui-element bcm-ui-content-display',\n 'uppercase font-medium',\n 'inline-flex items-center justify-center',\n 'bg-[--bcm-avatar-bg] text-[--bcm-avatar-text]',\n {\n 'shape-ellipse rounded-full': this.shape === 'ellipse',\n 'shape-square rounded-[--bcm-ui-radius]': this.shape === 'square',\n 'size-small text-size-4 w-6 h-6': this.size === 'small',\n 'size-medium text-size-5 w-8 h-8': this.size === 'medium',\n 'size-large text-size-6 w-10 h-10': this.size === 'large',\n },\n );\n\n const badgeClass = cs('badge', {\n 'top-0 right-0': this.shape === 'ellipse',\n '-top-0.5 -right-0.5': this.shape === 'square',\n });\n\n const imageClass = cs('image w-full h-full', {\n 'rounded-full': this.shape === 'ellipse',\n 'rounded-[--bcm-ui-radius]': this.shape === 'square',\n });\n\n let style = {};\n\n if (this.color) {\n const isColorTone = this.color.includes('-');\n const _color = isColorTone ? this.color.split('-')[0] : this.color;\n\n const bgColor = `var(--bcm-ui-color-background-palette-${_color}-default)`;\n const textColor = `var(--bcm-ui-color-text-palette-${_color}`;\n style = {\n '--bcm-avatar-bg': bgColor,\n '--bcm-avatar-text': textColor,\n };\n }\n\n const customSize = !Object.keys(['small', 'medium', 'large']).includes(this.size)\n ? {\n width: `${this.size}px`,\n height: `${this.size}px`,\n fontSize: `${+this.size / 2}px`,\n }\n : {};\n\n const RenderContent = () => {\n if (this.isFallback) {\n if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n } else if (this.image) {\n return <img class={imageClass} onError={() => (this.isFallback = true)} src={this.image} alt={this.alt} aria-label={this.alt || this.name || 'Avatar'} />;\n } else if (this.name) {\n return this.getFirstLetters(this.name);\n } else {\n return <i class={this.icon}></i>;\n }\n };\n\n return (\n <div role=\"img\" aria-label={this.alt || this.name || 'Avatar'} class={baseClass} style={{ ...style, ...customSize }}>\n <RenderContent />\n {this.status && <bcm-badge class={badgeClass} status={this.status} blink={this.blink} aria-hidden=\"true\"></bcm-badge>}\n <slot></slot>\n </div>\n );\n }\n}\n"],"version":3}