@paperless/core 2.0.1-beta.13 → 2.0.1-beta.2

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 (169) hide show
  1. package/CHANGELOG.md +0 -137
  2. package/dist/build/index.esm.js +1 -1
  3. package/dist/build/index.esm.js.map +1 -1
  4. package/dist/build/p-1fc0a8b4.entry.js +2 -0
  5. package/dist/build/p-1fc0a8b4.entry.js.map +1 -0
  6. package/dist/build/p-79cc09c0.entry.js +2 -0
  7. package/dist/build/p-79cc09c0.entry.js.map +1 -0
  8. package/dist/build/p-7d5f6497.entry.js +2 -0
  9. package/dist/build/p-7d5f6497.entry.js.map +1 -0
  10. package/dist/build/p-95eadadd.entry.js +2 -0
  11. package/dist/build/p-95eadadd.entry.js.map +1 -0
  12. package/dist/build/p-af4aedaf.entry.js +2 -0
  13. package/dist/build/p-af4aedaf.entry.js.map +1 -0
  14. package/dist/build/p-b5430fae.entry.js +2 -0
  15. package/dist/build/p-b5430fae.entry.js.map +1 -0
  16. package/dist/build/paperless.esm.js +1 -1
  17. package/dist/build/paperless.esm.js.map +1 -1
  18. package/dist/cjs/index-02e05522.js +2 -6
  19. package/dist/cjs/index.cjs.js +22 -5
  20. package/dist/cjs/index.cjs.js.map +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/p-avatar.cjs.entry.js +4 -5
  23. package/dist/cjs/p-avatar.cjs.entry.js.map +1 -1
  24. package/dist/cjs/p-button_3.cjs.entry.js +14 -50
  25. package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
  26. package/dist/cjs/p-dropdown_2.cjs.entry.js +2 -6
  27. package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -1
  28. package/dist/cjs/p-navbar.cjs.entry.js +3 -2
  29. package/dist/cjs/p-navbar.cjs.entry.js.map +1 -1
  30. package/dist/cjs/p-navigation-item.cjs.entry.js +4 -2819
  31. package/dist/cjs/p-navigation-item.cjs.entry.js.map +1 -1
  32. package/dist/cjs/p-profile.cjs.entry.js +16 -16
  33. package/dist/cjs/p-profile.cjs.entry.js.map +1 -1
  34. package/dist/cjs/paperless.cjs.js +1 -1
  35. package/dist/collection/collection-manifest.json +0 -1
  36. package/dist/collection/components/atoms/avatar/avatar.component.css +1 -1
  37. package/dist/collection/components/atoms/avatar/avatar.component.js +5 -5
  38. package/dist/collection/components/atoms/avatar/avatar.component.js.map +1 -1
  39. package/dist/collection/components/atoms/icon/icon.component.js +2 -2
  40. package/dist/collection/components/atoms/icon/icon.component.js.map +1 -1
  41. package/dist/collection/components/molecules/button/button.component.css +1 -1
  42. package/dist/collection/components/molecules/button/button.component.js +14 -85
  43. package/dist/collection/components/molecules/button/button.component.js.map +1 -1
  44. package/dist/collection/components/molecules/dropdown/dropdown.component.js +2 -6
  45. package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -1
  46. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +3 -24
  47. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js.map +1 -1
  48. package/dist/collection/components/molecules/profile/profile.component.css +1 -1
  49. package/dist/collection/components/molecules/profile/profile.component.js +34 -25
  50. package/dist/collection/components/molecules/profile/profile.component.js.map +1 -1
  51. package/dist/collection/components/organisms/navbar/navbar.component.css +1 -1
  52. package/dist/collection/components/organisms/navbar/navbar.component.js +24 -1
  53. package/dist/collection/components/organisms/navbar/navbar.component.js.map +1 -1
  54. package/dist/components/avatar.component.js +4 -5
  55. package/dist/components/avatar.component.js.map +1 -1
  56. package/dist/components/button.component.js +14 -52
  57. package/dist/components/button.component.js.map +1 -1
  58. package/dist/components/dropdown.component.js +2 -6
  59. package/dist/components/dropdown.component.js.map +1 -1
  60. package/dist/components/icon.component.js +1 -1
  61. package/dist/components/icon.component.js.map +1 -1
  62. package/dist/components/index.js +18 -1
  63. package/dist/components/index.js.map +1 -1
  64. package/dist/components/p-navbar.js +4 -2
  65. package/dist/components/p-navbar.js.map +1 -1
  66. package/dist/components/p-navigation-item.js +5 -2821
  67. package/dist/components/p-navigation-item.js.map +1 -1
  68. package/dist/components/p-navigation-title.js +27 -1
  69. package/dist/components/p-navigation-title.js.map +1 -1
  70. package/dist/components/p-profile.js +24 -35
  71. package/dist/components/p-profile.js.map +1 -1
  72. package/dist/esm/index-f99096d4.js +2 -6
  73. package/dist/esm/index.js +18 -1
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/esm/p-avatar.entry.js +4 -5
  77. package/dist/esm/p-avatar.entry.js.map +1 -1
  78. package/dist/esm/p-button_3.entry.js +14 -50
  79. package/dist/esm/p-button_3.entry.js.map +1 -1
  80. package/dist/esm/p-dropdown_2.entry.js +2 -6
  81. package/dist/esm/p-dropdown_2.entry.js.map +1 -1
  82. package/dist/esm/p-navbar.entry.js +3 -2
  83. package/dist/esm/p-navbar.entry.js.map +1 -1
  84. package/dist/esm/p-navigation-item.entry.js +4 -2819
  85. package/dist/esm/p-navigation-item.entry.js.map +1 -1
  86. package/dist/esm/p-profile.entry.js +16 -16
  87. package/dist/esm/p-profile.entry.js.map +1 -1
  88. package/dist/esm/paperless.js +1 -1
  89. package/dist/index.html +1 -1
  90. package/dist/paperless/index.esm.js +1 -1
  91. package/dist/paperless/index.esm.js.map +1 -1
  92. package/dist/paperless/p-1fc0a8b4.entry.js +2 -0
  93. package/dist/paperless/p-1fc0a8b4.entry.js.map +1 -0
  94. package/dist/paperless/p-79cc09c0.entry.js +2 -0
  95. package/dist/paperless/p-79cc09c0.entry.js.map +1 -0
  96. package/dist/paperless/p-7d5f6497.entry.js +2 -0
  97. package/dist/paperless/p-7d5f6497.entry.js.map +1 -0
  98. package/dist/paperless/p-95eadadd.entry.js +2 -0
  99. package/dist/paperless/p-95eadadd.entry.js.map +1 -0
  100. package/dist/paperless/p-af4aedaf.entry.js +2 -0
  101. package/dist/paperless/p-af4aedaf.entry.js.map +1 -0
  102. package/dist/paperless/p-b5430fae.entry.js +2 -0
  103. package/dist/paperless/p-b5430fae.entry.js.map +1 -0
  104. package/dist/paperless/paperless.esm.js +1 -1
  105. package/dist/paperless/paperless.esm.js.map +1 -1
  106. package/dist/sw.js +1 -1
  107. package/dist/sw.js.map +1 -1
  108. package/dist/types/components/molecules/button/button.component.d.ts +1 -9
  109. package/dist/types/components/molecules/navigation-item/navigation-item.component.d.ts +0 -4
  110. package/dist/types/components/molecules/profile/profile.component.d.ts +5 -2
  111. package/dist/types/components/organisms/navbar/navbar.component.d.ts +4 -0
  112. package/dist/types/components.d.ts +32 -55
  113. package/hydrate/index.js +48 -2942
  114. package/package.json +1 -1
  115. package/dist/build/p-190704d1.entry.js +0 -2
  116. package/dist/build/p-190704d1.entry.js.map +0 -1
  117. package/dist/build/p-5ab354bf.entry.js +0 -2
  118. package/dist/build/p-5ab354bf.entry.js.map +0 -1
  119. package/dist/build/p-60492c98.entry.js +0 -2
  120. package/dist/build/p-60492c98.entry.js.map +0 -1
  121. package/dist/build/p-64765a81.js +0 -2
  122. package/dist/build/p-64765a81.js.map +0 -1
  123. package/dist/build/p-aab1cda1.entry.js +0 -2
  124. package/dist/build/p-aab1cda1.entry.js.map +0 -1
  125. package/dist/build/p-cb8a454c.entry.js +0 -2
  126. package/dist/build/p-cb8a454c.entry.js.map +0 -1
  127. package/dist/build/p-d7dbd13e.entry.js +0 -2
  128. package/dist/build/p-d7dbd13e.entry.js.map +0 -1
  129. package/dist/build/p-ece8998b.entry.js +0 -2
  130. package/dist/build/p-ece8998b.entry.js.map +0 -1
  131. package/dist/cjs/_commonjsHelpers-4213291f.js +0 -24
  132. package/dist/cjs/_commonjsHelpers-4213291f.js.map +0 -1
  133. package/dist/cjs/p-navigation-section.cjs.entry.js +0 -23
  134. package/dist/cjs/p-navigation-section.cjs.entry.js.map +0 -1
  135. package/dist/collection/components/molecules/navigation-section/navigation-section.component.css +0 -1
  136. package/dist/collection/components/molecules/navigation-section/navigation-section.component.js +0 -43
  137. package/dist/collection/components/molecules/navigation-section/navigation-section.component.js.map +0 -1
  138. package/dist/collection/components/molecules/navigation-section/test/navigation-section.component.e2e.js +0 -26
  139. package/dist/collection/components/molecules/navigation-section/test/navigation-section.component.e2e.js.map +0 -1
  140. package/dist/collection/components/molecules/navigation-section/test/navigation-section.component.spec.js +0 -17
  141. package/dist/collection/components/molecules/navigation-section/test/navigation-section.component.spec.js.map +0 -1
  142. package/dist/components/_commonjsHelpers.js +0 -21
  143. package/dist/components/_commonjsHelpers.js.map +0 -1
  144. package/dist/components/navigation-title.component.js +0 -31
  145. package/dist/components/navigation-title.component.js.map +0 -1
  146. package/dist/components/p-navigation-section.d.ts +0 -11
  147. package/dist/components/p-navigation-section.js +0 -44
  148. package/dist/components/p-navigation-section.js.map +0 -1
  149. package/dist/esm/_commonjsHelpers-e9b9b14e.js +0 -21
  150. package/dist/esm/_commonjsHelpers-e9b9b14e.js.map +0 -1
  151. package/dist/esm/p-navigation-section.entry.js +0 -19
  152. package/dist/esm/p-navigation-section.entry.js.map +0 -1
  153. package/dist/paperless/p-190704d1.entry.js +0 -2
  154. package/dist/paperless/p-190704d1.entry.js.map +0 -1
  155. package/dist/paperless/p-5ab354bf.entry.js +0 -2
  156. package/dist/paperless/p-5ab354bf.entry.js.map +0 -1
  157. package/dist/paperless/p-60492c98.entry.js +0 -2
  158. package/dist/paperless/p-60492c98.entry.js.map +0 -1
  159. package/dist/paperless/p-64765a81.js +0 -2
  160. package/dist/paperless/p-64765a81.js.map +0 -1
  161. package/dist/paperless/p-aab1cda1.entry.js +0 -2
  162. package/dist/paperless/p-aab1cda1.entry.js.map +0 -1
  163. package/dist/paperless/p-cb8a454c.entry.js +0 -2
  164. package/dist/paperless/p-cb8a454c.entry.js.map +0 -1
  165. package/dist/paperless/p-d7dbd13e.entry.js +0 -2
  166. package/dist/paperless/p-d7dbd13e.entry.js.map +0 -1
  167. package/dist/paperless/p-ece8998b.entry.js +0 -2
  168. package/dist/paperless/p-ece8998b.entry.js.map +0 -1
  169. package/dist/types/components/molecules/navigation-section/navigation-section.component.d.ts +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/dropdown/dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EAEN,KAAK,GAEL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,MAAM,iBAAiB,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE;EAC7C,QAAQ,EAAE;IACT,QAAQ,EAAE;MACT,QAAQ,EAAE,UAAU;MACpB,KAAK,EAAE,OAAO;KACd;GACD;CACD,CAAC,CAAC;AAMH,MAAM,OAAO,QAAQ;;IAoFZ,YAAO,GAAG,KAAK,CAAC;qBAhFwB,cAAc;kBAKrC,CAAC;oBAKG,UAAU;gBAKf,KAAK;0BAKK,KAAK;yBAKN,IAAI;0BAKH,IAAI;yBAKL,KAAK;sBAKc,KAAK;uBAK1B,KAAK;+BAKG,KAAK;wBAKZ,IAAI;2BAKO,KAAK;;;EAyBhD,qBAAqB;IACpB,IAAI,CAAC,OAAO,EAAE,CAAC;EAChB,CAAC;EAED,gBAAgB;IACf,IAAI,CAAC,YAAY,EAAE,CAAC;EACrB,CAAC;EAED,oBAAoB;IACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;MAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;KACrB;EACF,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,qBAAqB;MAChC,WACC,KAAK,EAAC,oBA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AC,SAAS;MACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;MACvB,UAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;KAClD,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;MAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;MACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QAC/B,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,IAAI,EAAE,GAAG,CAAC,IAAI;OACd,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { childOf } from '../../../utils/child-of';\n\nconst dropdownContainer = cva(['z-dropdown'], {\n\tvariants: {\n\t\tstrategy: {\n\t\t\tabsolute: 'absolute',\n\t\t\tfixed: 'fixed',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The offset of the dropdown menu\n\t */\n\t@Prop() offset: number = 8;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow in the container\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._checkButton();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-dropdown relative'>\n\t\t\t\t<div\n\t\t\t\t\tclass='relative w-inherit'\n\t\t\t\t\tref={ref => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot name='trigger' />\n\t\t\t\t</div>\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\tclass={dropdownContainer({\n\t\t\t\t\t\tstrategy: this.strategy,\n\t\t\t\t\t})}\n\t\t\t\t\trole='popover'\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\tref={el => this._load(el)}\n\t\t\t\t\tdata-placement={this.placement}\n\t\t\t\t\tdata-strategy={this.strategy}\n\t\t\t\t\tonClick={() => this._containerClickHandler()}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t>\n\t\t\t\t\t<slot name='items' />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButton(active: boolean = false) {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttons = this._el.querySelectorAll<HTMLPButtonElement>('p-button');\n\t\tfor (let button of buttons) {\n\t\t\tbutton.chevronPosition = this.chevronPosition;\n\t\t\tbutton.chevron = this.chevronDirection\n\t\t\t\t? this.chevronDirection\n\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t\tbutton.disabled = this.disableTriggerClick;\n\t\t\tbutton.active = active;\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._menu.hasAttribute('data-show') || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis.isOpen.emit(true);\n\t\tthis._checkButton(true);\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis.isOpen.emit(false);\n\t\tthis._checkButton(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(this.offset), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/dropdown/dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EAEN,KAAK,GAEL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,MAAM,iBAAiB,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE;EAC7C,QAAQ,EAAE;IACT,QAAQ,EAAE;MACT,QAAQ,EAAE,UAAU;MACpB,KAAK,EAAE,OAAO;KACd;GACD;CACD,CAAC,CAAC;AAMH,MAAM,OAAO,QAAQ;;IAoFZ,YAAO,GAAG,KAAK,CAAC;qBAhFwB,cAAc;kBAKrC,CAAC;oBAKG,UAAU;gBAKf,KAAK;0BAKK,KAAK;yBAKN,IAAI;0BAKH,IAAI;yBAKL,KAAK;sBAKc,KAAK;uBAK1B,KAAK;+BAKG,KAAK;wBAKZ,IAAI;2BAKO,KAAK;;;EAyBhD,qBAAqB;IACpB,IAAI,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AK,EAAE;MAChB,OAAO;KACP;IAED,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;MACrC,SAAS,EAAE,IAAI,CAAC,SAAS;MACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;MACvB,UAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;KAClD,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;MAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;MACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QAC/B,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,IAAI,EAAE,GAAG,CAAC,IAAI;OACd,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { childOf } from '../../../utils/child-of';\n\nconst dropdownContainer = cva(['z-dropdown'], {\n\tvariants: {\n\t\tstrategy: {\n\t\t\tabsolute: 'absolute',\n\t\t\tfixed: 'fixed',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The offset of the dropdown menu\n\t */\n\t@Prop() offset: number = 8;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether to allow overflow in the container\n\t */\n\t@Prop() allowOverflow: boolean = false;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean | 'default' | 'large' = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._checkButton();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-dropdown relative w-inherit'>\n\t\t\t\t<div\n\t\t\t\t\tclass='relative w-inherit'\n\t\t\t\t\tref={ref => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot name='trigger' />\n\t\t\t\t</div>\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\tclass={dropdownContainer({\n\t\t\t\t\t\tstrategy: this.strategy,\n\t\t\t\t\t})}\n\t\t\t\t\trole='popover'\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tallowOverflow={this.allowOverflow}\n\t\t\t\t\tref={el => this._load(el)}\n\t\t\t\t\tdata-placement={this.placement}\n\t\t\t\t\tdata-strategy={this.strategy}\n\t\t\t\t\tonClick={() => this._containerClickHandler()}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t>\n\t\t\t\t\t<slot name='items' />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButton() {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttons = this._el.querySelectorAll<HTMLPButtonElement>('p-button');\n\t\tfor (let button of buttons) {\n\t\t\tbutton.chevronPosition = this.chevronPosition;\n\t\t\tbutton.chevron = this.chevronDirection\n\t\t\t\t? this.chevronDirection\n\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t? 'up'\n\t\t\t\t: 'down';\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._menu.hasAttribute('data-show') || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis.isOpen.emit(true);\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis.isOpen.emit(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(this.offset), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { cva } from "class-variance-authority";
3
- import { cn } from "../../../utils/cn";
4
3
  const navigationItem = cva([
5
4
  'h-8 w-[inherit]',
6
5
  'flex items-center gap-2',
@@ -37,16 +36,13 @@ export class NavigationItem {
37
36
  this.counter = undefined;
38
37
  this.href = undefined;
39
38
  this.target = undefined;
40
- this.class = undefined;
41
39
  }
42
40
  render() {
43
- var _a;
44
41
  const TagType = this.as;
45
- const active = this.active || ((_a = this.class) === null || _a === void 0 ? void 0 : _a.includes('active'));
46
- return (h(Host, { class: cn('p-navigation-item inline-block', this.class) }, h(TagType, { class: navigationItem({
42
+ return (h(Host, { class: 'p-navigation-item inline-block' }, h(TagType, { class: navigationItem({
43
+ active: this.active,
47
44
  icon: !!this.icon,
48
- active,
49
- }), href: this.href, target: this.target }, h("div", { class: navigationItemIconContainer({ active }) }, h("p-icon", { variant: this.icon })), h("span", { class: this.counter && 'has-counter' }, h("slot", null)), !!this.counter && this.counter !== '0' && (h("p-badge", null, this.counter)))));
45
+ }), href: this.href, target: this.target }, h("div", { class: navigationItemIconContainer({ active: this.active }) }, h("p-icon", { variant: this.icon })), h("span", { class: this.counter && 'has-counter' }, h("slot", null)), !!this.counter && this.counter !== '0' && (h("p-badge", null, this.counter)))));
50
46
  }
51
47
  static get is() { return "p-navigation-item"; }
52
48
  static get originalStyleUrls() {
@@ -170,23 +166,6 @@ export class NavigationItem {
170
166
  },
171
167
  "attribute": "target",
172
168
  "reflect": false
173
- },
174
- "class": {
175
- "type": "string",
176
- "mutable": false,
177
- "complexType": {
178
- "original": "string",
179
- "resolved": "string",
180
- "references": {}
181
- },
182
- "required": false,
183
- "optional": false,
184
- "docs": {
185
- "tags": [],
186
- "text": "The class of the container passed by parent"
187
- },
188
- "attribute": "class",
189
- "reflect": false
190
169
  }
191
170
  };
192
171
  }
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-item.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/navigation-item/navigation-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAEvC,MAAM,cAAc,GAAG,GAAG,CACzB;EACC,iBAAiB;EACjB,yBAAyB;EACzB,+CAA+C;EAC/C,YAAY;EACZ,WAAW;EACX,qBAAqB;EACrB,gBAAgB;CAChB,EACD;EACC,QAAQ,EAAE;IACT,MAAM,EAAE;MACP,KAAK,EAAE,CAAC,oBAAoB,CAAC;MAC7B,IAAI,EAAE,CAAC,oDAAoD,CAAC;KAC5D;IACD,IAAI,EAAE;MACL,KAAK,EAAE,KAAK;MACZ,IAAI,EAAE,CAAC,MAAM,CAAC;KACd;GACD;CACD,CACD,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAAG,CACtC,CAAC,mEAAmE,CAAC,EACrE;EACC,QAAQ,EAAE;IACT,MAAM,EAAE;MACP,KAAK,EAAE,KAAK;MACZ,IAAI,EAAE,CAAC,qBAAqB,CAAC;KAC7B;GACD;CACD,CACD,CAAC;AAOF,MAAM,OAAO,cAAc;;;kBASA,KAAK;cAKV,GAAG;;;;;;EAsBxB,MAAM;;IACL,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAExB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,KAAI,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA,CAAC;IAE7D,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,CAAC,gCAAgC,EAAE,IAAI,CAAC,KAAK,CAAC;MAC5D,EAAC,OAAO,IACP,KAAK,EAAE,cAAc,CAAC;UACrB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI;UACjB,MAAM;SACN,CAAC,EACF,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM;QAEnB,WAAK,KAAK,EAAE,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAC;UAClD,cAAQ,OAAO,EAAE,IAAI,CAAC,IAAI,GAAI,CACzB;QAEN,YAAM,KAAK,EAAE,IAAI,CAAC,OAAO,IAAI,aAAa;UACzC,eAAQ,CACF;QAEN,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAC1C,mBAAU,IAAI,CAAC,OAAO,CAAW,CACjC,CACQ,CACJ,CACP,CAAC;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { IconVariant } from '../../atoms/icon/icon.component';\nimport { cn } from '../../../utils/cn';\n\nconst navigationItem = cva(\n\t[\n\t\t'h-8 w-[inherit]',\n\t\t'flex items-center gap-2',\n\t\t'text-black-teal-400 hover:text-black-teal-500',\n\t\t'rounded-lg',\n\t\t'py-1 px-2',\n\t\t'text-sm font-medium',\n\t\t'cursor-pointer',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tactive: {\n\t\t\t\tfalse: ['hover:bg-off-white'],\n\t\t\t\ttrue: ['bg-off-white-600 text-black-teal-500 font-semibold'],\n\t\t\t},\n\t\t\ticon: {\n\t\t\t\tfalse: false,\n\t\t\t\ttrue: ['pl-1'],\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst navigationItemIconContainer = cva(\n\t['flex h-6 aspect-branding items-center justify-center rounded-full'],\n\t{\n\t\tvariants: {\n\t\t\tactive: {\n\t\t\t\tfalse: false,\n\t\t\t\ttrue: ['bg-supportive-lilac'],\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-navigation-item',\n\tstyleUrl: './navigation-item.component.scss',\n\tshadow: false,\n})\nexport class NavigationItem {\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon!: IconVariant;\n\n\t/**\n\t * Wether the navigation item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * The element to use for the navigation item\n\t */\n\t@Prop() as: string = 'a';\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() counter: number | string;\n\n\t/**\n\t * The href of the navigation item\n\t */\n\t@Prop() href: string;\n\n\t/**\n\t * The target of the navigation item\n\t */\n\t@Prop() target: string;\n\n\t/**\n\t * The class of the container passed by parent\n\t */\n\t@Prop() class: string;\n\n\trender() {\n\t\tconst TagType = this.as;\n\n\t\tconst active = this.active || this.class?.includes('active');\n\n\t\treturn (\n\t\t\t<Host class={cn('p-navigation-item inline-block', this.class)}>\n\t\t\t\t<TagType\n\t\t\t\t\tclass={navigationItem({\n\t\t\t\t\t\ticon: !!this.icon,\n\t\t\t\t\t\tactive,\n\t\t\t\t\t})}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t>\n\t\t\t\t\t<div class={navigationItemIconContainer({ active })}>\n\t\t\t\t\t\t<p-icon variant={this.icon} />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<span class={this.counter && 'has-counter'}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{!!this.counter && this.counter !== '0' && (\n\t\t\t\t\t\t<p-badge>{this.counter}</p-badge>\n\t\t\t\t\t)}\n\t\t\t\t</TagType>\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"navigation-item.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/navigation-item/navigation-item.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,MAAM,cAAc,GAAG,GAAG,CACzB;EACC,iBAAiB;EACjB,yBAAyB;EACzB,+CAA+C;EAC/C,YAAY;EACZ,WAAW;EACX,qBAAqB;EACrB,gBAAgB;CAChB,EACD;EACC,QAAQ,EAAE;IACT,MAAM,EAAE;MACP,KAAK,EAAE,CAAC,oBAAoB,CAAC;MAC7B,IAAI,EAAE,CAAC,oDAAoD,CAAC;KAC5D;IACD,IAAI,EAAE;MACL,KAAK,EAAE,KAAK;MACZ,IAAI,EAAE,CAAC,MAAM,CAAC;KACd;GACD;CACD,CACD,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAAG,CACtC,CAAC,mEAAmE,CAAC,EACrE;EACC,QAAQ,EAAE;IACT,MAAM,EAAE;MACP,KAAK,EAAE,KAAK;MACZ,IAAI,EAAE,CAAC,qBAAqB,CAAC;KAC7B;GACD;CACD,CACD,CAAC;AAOF,MAAM,OAAO,cAAc;;;kBASA,KAAK;cAKV,GAAG;;;;;EAiBxB,MAAM;IACL,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IACxB,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,gCAAgC;MAC3C,EAAC,OAAO,IACP,KAAK,EAAE,cAAc,CAAC;UACrB,MAAM,EAAE,IAAI,CAAC,MAAM;UACnB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI;SACjB,CAAC,EACF,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM;QAEnB,WAAK,KAAK,EAAE,2BAA2B,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;UAC/D,cAAQ,OAAO,EAAE,IAAI,CAAC,IAAI,GAAI,CACzB;QAEN,YAAM,KAAK,EAAE,IAAI,CAAC,OAAO,IAAI,aAAa;UACzC,eAAQ,CACF;QAEN,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAC1C,mBAAU,IAAI,CAAC,OAAO,CAAW,CACjC,CACQ,CACJ,CACP,CAAC;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\nconst navigationItem = cva(\n\t[\n\t\t'h-8 w-[inherit]',\n\t\t'flex items-center gap-2',\n\t\t'text-black-teal-400 hover:text-black-teal-500',\n\t\t'rounded-lg',\n\t\t'py-1 px-2',\n\t\t'text-sm font-medium',\n\t\t'cursor-pointer',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tactive: {\n\t\t\t\tfalse: ['hover:bg-off-white'],\n\t\t\t\ttrue: ['bg-off-white-600 text-black-teal-500 font-semibold'],\n\t\t\t},\n\t\t\ticon: {\n\t\t\t\tfalse: false,\n\t\t\t\ttrue: ['pl-1'],\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst navigationItemIconContainer = cva(\n\t['flex h-6 aspect-branding items-center justify-center rounded-full'],\n\t{\n\t\tvariants: {\n\t\t\tactive: {\n\t\t\t\tfalse: false,\n\t\t\t\ttrue: ['bg-supportive-lilac'],\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-navigation-item',\n\tstyleUrl: './navigation-item.component.scss',\n\tshadow: false,\n})\nexport class NavigationItem {\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() icon!: IconVariant;\n\n\t/**\n\t * Wether the navigation item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\t/**\n\t * The element to use for the navigation item\n\t */\n\t@Prop() as: string = 'a';\n\n\t/**\n\t * Icon of the navigation item\n\t */\n\t@Prop() counter: number | string;\n\n\t/**\n\t * The href of the navigation item\n\t */\n\t@Prop() href: string;\n\n\t/**\n\t * The target of the navigation item\n\t */\n\t@Prop() target: string;\n\n\trender() {\n\t\tconst TagType = this.as;\n\t\treturn (\n\t\t\t<Host class='p-navigation-item inline-block'>\n\t\t\t\t<TagType\n\t\t\t\t\tclass={navigationItem({\n\t\t\t\t\t\tactive: this.active,\n\t\t\t\t\t\ticon: !!this.icon,\n\t\t\t\t\t})}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t>\n\t\t\t\t\t<div class={navigationItemIconContainer({ active: this.active })}>\n\t\t\t\t\t\t<p-icon variant={this.icon} />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<span class={this.counter && 'has-counter'}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{!!this.counter && this.counter !== '0' && (\n\t\t\t\t\t\t<p-badge>{this.counter}</p-badge>\n\t\t\t\t\t)}\n\t\t\t\t</TagType>\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- *{box-sizing:border-box}.static{position:static!important}.absolute{position:absolute!important}.block{display:block!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.h-10{height:2.5rem!important}.w-auto{width:auto!important}.w-full{width:100%!important}.w-inherit{width:inherit!important}.min-w-0{min-width:0!important}.max-w-full{max-width:100%!important}.flex-1{flex:1 1 0%!important}.flex-col{flex-direction:column!important}.items-start{align-items:flex-start!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.py-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-medium{font-weight:500!important}.text-black-teal-300{--tw-text-opacity:1!important;color:rgb(104 127 124/var(--tw-text-opacity,1))!important}
1
+ *{box-sizing:border-box}.static{position:static!important}.absolute{position:absolute!important}.block{display:block!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.h-10{height:2.5rem!important}.w-full{width:100%!important}.flex-1{flex:1 1 0%!important}.cursor-pointer{cursor:pointer!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.rounded-lg{border-radius:.5rem!important}.border{border-width:1px!important}.border-black-teal-100{--tw-border-opacity:1!important;border-color:rgb(205 212 211/var(--tw-border-opacity,1))!important}.border-supportive-lilac-800{--tw-border-opacity:1!important;border-color:rgb(189 140 255/var(--tw-border-opacity,1))!important}.bg-white{--tw-bg-opacity:1!important;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.p-2{padding:.5rem!important}.py-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-medium{font-weight:500!important}.text-black-teal-300{--tw-text-opacity:1!important;color:rgb(104 127 124/var(--tw-text-opacity,1))!important}.shadow-1{--tw-shadow:0 1px 1px rgba(0,2,2,.08)!important;--tw-shadow-colored:0 1px 1px var(--tw-shadow-color)!important}.shadow-1,.shadow-2{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}.shadow-2{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04)!important;--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color)!important}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important}.ring,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important}.ring-supportive-lilac-100{--tw-ring-opacity:1!important;--tw-ring-color:rgb(246 239 255/var(--tw-ring-opacity,1))!important}.hover\:shadow-2:hover{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04)!important;--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}
@@ -1,42 +1,39 @@
1
- import { h, Host, } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import { cva } from "class-variance-authority";
3
- const profileContent = cva(['flex gap-2 items-center flex-1 min-w-0'], {
3
+ const profileContent = cva(['flex h-10 gap-2 items-center w-full'], {
4
4
  variants: {
5
5
  dropdown: {
6
- false: 'h-10 py-1',
7
- true: null,
6
+ false: 'py-1',
7
+ true: 'bg-white p-2 shadow-1 border rounded-lg hover:shadow-2 cursor-pointer',
8
+ },
9
+ dropdownOpen: {
10
+ false: 'border-black-teal-100',
11
+ true: 'shadow-2 border-supportive-lilac-800 ring ring-2 ring-supportive-lilac-100',
8
12
  },
9
13
  },
10
14
  });
11
15
  export class Profile {
12
16
  constructor() {
13
17
  this.dropdownLocation = 'bottom-end';
18
+ this.size = 'base';
14
19
  this._dropdownOpen = false;
15
20
  this._hasDropdownSlot = false;
16
21
  }
17
22
  componentWillLoad() {
18
- this._checkDropdownSlot();
23
+ this._hasDropdownSlot = !!this._el.querySelector(':scope > [slot="dropdown"]');
19
24
  }
20
25
  componentWillRender() {
21
26
  this._updateAvatar();
22
27
  }
23
28
  render() {
24
29
  const content = this._getContent();
25
- return (h(Host, { class: 'p-profile inline-block w-inherit' }, this._hasDropdownSlot ? (h("p-dropdown", { class: 'block', strategy: 'absolute', placement: this.dropdownLocation, applyFullWidth: true, applyMaxWidth: false, onIsOpen: ev => (this._dropdownOpen = ev.detail) }, h("p-button", { variant: 'dropdown', chevron: this._dropdownOpen ? 'up' : 'down', active: this._dropdownOpen, slot: 'trigger', size: 'lg', class: 'w-full' }, content), h("div", { slot: 'items' }, h("slot", { name: 'dropdown', onSlotchange: () => this._checkDropdownSlot() })))) : (content)));
26
- }
27
- slotchange() {
28
- this._checkDropdownSlot();
29
- }
30
- _checkDropdownSlot() {
31
- this._hasDropdownSlot = !!this._el.querySelector(':scope > [slot="dropdown"]');
32
- if (!this._hasDropdownSlot && this._dropdownOpen) {
33
- this._dropdownOpen = false;
34
- }
30
+ return (h(Host, { class: 'p-profile inline-block' }, this._hasDropdownSlot ? (h("p-dropdown", { class: 'block', strategy: 'absolute', placement: this.dropdownLocation, applyFullWidth: true, applyMaxWidth: false, onIsOpen: ev => (this._dropdownOpen = ev.detail) }, content, h("div", { slot: 'items' }, h("slot", { name: 'dropdown' })))) : (content)));
35
31
  }
36
32
  _getContent() {
37
33
  return (h("div", { class: profileContent({
38
34
  dropdown: this._hasDropdownSlot,
39
- }) }, h("slot", { name: 'avatar' }), h("div", { class: 'flex min-w-0 flex-1 flex-col items-start' }, h("p", { class: 'w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium' }, h("slot", { name: 'title' })), h("p", { class: 'w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs text-black-teal-300' }, h("slot", { name: 'subtitle' }))), h("slot", { name: 'post-title' })));
35
+ dropdownOpen: this._dropdownOpen,
36
+ }), slot: 'trigger' }, h("slot", { name: 'avatar' }), h("div", { class: 'flex flex-1 flex-col' }, h("p", { class: 'font-sm font-medium' }, h("slot", { name: 'title' })), h("p", { class: 'text-xs text-black-teal-300' }, h("slot", { name: 'subtitle' }))), h("slot", { name: 'post-title' }), this._hasDropdownSlot && this._getIcon()));
40
37
  }
41
38
  _updateAvatar() {
42
39
  const avatar = this._el.querySelector('p-avatar[slot="avatar"]');
@@ -45,6 +42,9 @@ export class Profile {
45
42
  }
46
43
  avatar.size = this._hasDropdownSlot ? 'sm' : avatar.size;
47
44
  }
45
+ _getIcon() {
46
+ return (h("p-icon", { variant: 'caret', flip: this._dropdownOpen ? 'vertical' : 'horizontal' }));
47
+ }
48
48
  static get is() { return "p-profile"; }
49
49
  static get originalStyleUrls() {
50
50
  return {
@@ -75,6 +75,24 @@ export class Profile {
75
75
  "attribute": "dropdown-location",
76
76
  "reflect": false,
77
77
  "defaultValue": "'bottom-end'"
78
+ },
79
+ "size": {
80
+ "type": "string",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "| 'xs'\n\t\t| 'sm'\n\t\t| 'base'\n\t\t| 'lg'\n\t\t| 'xl'\n\t\t| '2xl'\n\t\t| '3xl'\n\t\t| '4xl'",
84
+ "resolved": "\"2xl\" | \"3xl\" | \"4xl\" | \"base\" | \"lg\" | \"sm\" | \"xl\" | \"xs\"",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": "The size of the profile avatar"
92
+ },
93
+ "attribute": "size",
94
+ "reflect": true,
95
+ "defaultValue": "'base'"
78
96
  }
79
97
  };
80
98
  }
@@ -85,14 +103,5 @@ export class Profile {
85
103
  };
86
104
  }
87
105
  static get elementRef() { return "_el"; }
88
- static get listeners() {
89
- return [{
90
- "name": "slotchange",
91
- "method": "slotchange",
92
- "target": undefined,
93
- "capture": false,
94
- "passive": false
95
- }];
96
- }
97
106
  }
98
107
  //# sourceMappingURL=profile.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/profile/profile.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,cAAc,GAAG,GAAG,CAAC,CAAC,wCAAwC,CAAC,EAAE;EACtE,QAAQ,EAAE;IACT,QAAQ,EAAE;MACT,KAAK,EAAE,WAAW;MAClB,IAAI,EAAE,IAAI;KACV;GACD;CACD,CAAC,CAAC;AAMH,MAAM,OAAO,OAAO;;4BAIkC,YAAY;yBAOhC,KAAK;4BACF,KAAK;;EAEzC,iBAAiB;IAChB,IAAI,CAAC,kBAAkB,EAAE,CAAC;EAC3B,CAAC;EAED,mBAAmB;IAClB,IAAI,CAAC,aAAa,EAAE,CAAC;EACtB,CAAC;EAED,MAAM;IACL,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACnC,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,kCAAkC,IAC5C,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CACxB,kBACC,KAAK,EAAC,OAAO,EACb,QAAQ,EAAC,UAAU,EACnB,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAChC,cAAc,EAAE,IAAI,EACpB,aAAa,EAAE,KAAK,EACpB,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EACH,CAAC;EAEO,aAAa;IACpB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CACpC,yBAAyB,CACH,CAAC;IAExB,IAAI,CAAC,MAAM,EAAE;MACZ,OAAO;KACP;IAED,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;EAC1D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tElement,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst profileContent = cva(['flex gap-2 items-center flex-1 min-w-0'], {\n\tvariants: {\n\t\tdropdown: {\n\t\t\tfalse: 'h-10 py-1',\n\t\t\ttrue: null,\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-profile',\n\tstyleUrl: 'profile.component.scss',\n})\nexport class Profile {\n\t/**\n\t * The position of the dropdown\n\t */\n\t@Prop() dropdownLocation: 'top-end' | 'bottom-end' = 'bottom-end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _dropdownOpen = false;\n\t@State() private _hasDropdownSlot = false;\n\n\tcomponentWillLoad() {\n\t\tthis._checkDropdownSlot();\n\t}\n\n\tcomponentWillRender() {\n\t\tthis._updateAvatar();\n\t}\n\n\trender() {\n\t\tconst content = this._getContent();\n\t\treturn (\n\t\t\t<Host class='p-profile inline-block w-inherit'>\n\t\t\t\t{this._hasDropdownSlot ? (\n\t\t\t\t\t<p-dropdown\n\t\t\t\t\t\tclass='block'\n\t\t\t\t\t\tstrategy='absolute'\n\t\t\t\t\t\tplacement={this.dropdownLocation}\n\t\t\t\t\t\tapplyFullWidth={true}\n\t\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\t\tonIsOpen={ev => (this._dropdownOpen = ev.detail)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant='dropdown'\n\t\t\t\t\t\t\tchevron={this._dropdownOpen ? 'up' : 'down'}\n\t\t\t\t\t\t\tactive={this._dropdownOpen}\n\t\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\t\tsize='lg'\n\t\t\t\t\t\t\tclass='w-full'\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{content}\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t<div slot='items'>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\tname='dropdown'\n\t\t\t\t\t\t\t\tonSlotchange={() => this._checkDropdownSlot()}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</p-dropdown>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('slotchange')\n\tslotchange() {\n\t\tthis._checkDropdownSlot();\n\t}\n\n\tprivate _checkDropdownSlot() {\n\t\tthis._hasDropdownSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"dropdown\"]'\n\t\t);\n\n\t\tif (!this._hasDropdownSlot && this._dropdownOpen) {\n\t\t\tthis._dropdownOpen = false;\n\t\t}\n\t}\n\n\tprivate _getContent() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={profileContent({\n\t\t\t\t\tdropdown: this._hasDropdownSlot,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<slot name='avatar' />\n\t\t\t\t<div class='flex min-w-0 flex-1 flex-col items-start'>\n\t\t\t\t\t<p class='w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium'>\n\t\t\t\t\t\t<slot name='title' />\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class='w-auto max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs text-black-teal-300'>\n\t\t\t\t\t\t<slot name='subtitle' />\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\n\t\t\t\t<slot name='post-title' />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _updateAvatar() {\n\t\tconst avatar = this._el.querySelector(\n\t\t\t'p-avatar[slot=\"avatar\"]'\n\t\t) as HTMLPAvatarElement;\n\n\t\tif (!avatar) {\n\t\t\treturn;\n\t\t}\n\n\t\tavatar.size = this._hasDropdownSlot ? 'sm' : avatar.size;\n\t}\n}\n"]}
1
+ {"version":3,"file":"profile.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/profile/profile.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,cAAc,GAAG,GAAG,CAAC,CAAC,qCAAqC,CAAC,EAAE;EACnE,QAAQ,EAAE;IACT,QAAQ,EAAE;MACT,KAAK,EAAE,MAAM;MACb,IAAI,EAAE,uEAAuE;KAC7E;IACD,YAAY,EAAE;MACb,KAAK,EAAE,uBAAuB;MAC9B,IAAI,EAAE,4EAA4E;KAClF;GACD;CACD,CAAC,CAAC;AAMH,MAAM,OAAO,OAAO;;4BAIkC,YAAY;gBAatD,MAAM;yBAOgB,KAAK;4BACF,KAAK;;EAEzC,iBAAiB;IAChB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAC/C,4BAA4B,CAC5B,CAAC;EACH,CAAC;EAED,mBAAmB;IAClB,IAAI,CAAC,aAAa,EAAE,CAAC;EACtB,CAAC;EAED,MAAM;IACL,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACnC,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,wBAAwB,IAClC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CACxB,kBACC,KAAK,EA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AC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,GACnD,CACF,CAAC;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst profileContent = cva(['flex h-10 gap-2 items-center w-full'], {\n\tvariants: {\n\t\tdropdown: {\n\t\t\tfalse: 'py-1',\n\t\t\ttrue: 'bg-white p-2 shadow-1 border rounded-lg hover:shadow-2 cursor-pointer',\n\t\t},\n\t\tdropdownOpen: {\n\t\t\tfalse: 'border-black-teal-100',\n\t\t\ttrue: 'shadow-2 border-supportive-lilac-800 ring ring-2 ring-supportive-lilac-100',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-profile',\n\tstyleUrl: 'profile.component.scss',\n})\nexport class Profile {\n\t/**\n\t * The position of the dropdown\n\t */\n\t@Prop() dropdownLocation: 'top-end' | 'bottom-end' = 'bottom-end';\n\n\t/**\n\t * The size of the profile avatar\n\t */\n\t@Prop({ reflect: true }) size:\n\t\t| 'xs'\n\t\t| 'sm'\n\t\t| 'base'\n\t\t| 'lg'\n\t\t| 'xl'\n\t\t| '2xl'\n\t\t| '3xl'\n\t\t| '4xl' = 'base';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _dropdownOpen = false;\n\t@State() private _hasDropdownSlot = false;\n\n\tcomponentWillLoad() {\n\t\tthis._hasDropdownSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"dropdown\"]'\n\t\t);\n\t}\n\n\tcomponentWillRender() {\n\t\tthis._updateAvatar();\n\t}\n\n\trender() {\n\t\tconst content = this._getContent();\n\t\treturn (\n\t\t\t<Host class='p-profile inline-block'>\n\t\t\t\t{this._hasDropdownSlot ? (\n\t\t\t\t\t<p-dropdown\n\t\t\t\t\t\tclass='block'\n\t\t\t\t\t\tstrategy='absolute'\n\t\t\t\t\t\tplacement={this.dropdownLocation}\n\t\t\t\t\t\tapplyFullWidth={true}\n\t\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\t\tonIsOpen={ev => (this._dropdownOpen = ev.detail)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t<div slot='items'>\n\t\t\t\t\t\t\t<slot name='dropdown' />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</p-dropdown>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _getContent() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={profileContent({\n\t\t\t\t\tdropdown: this._hasDropdownSlot,\n\t\t\t\t\tdropdownOpen: this._dropdownOpen,\n\t\t\t\t})}\n\t\t\t\tslot='trigger'\n\t\t\t>\n\t\t\t\t<slot name='avatar' />\n\t\t\t\t<div class='flex flex-1 flex-col'>\n\t\t\t\t\t<p class='font-sm font-medium'>\n\t\t\t\t\t\t<slot name='title' />\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class='text-xs text-black-teal-300'>\n\t\t\t\t\t\t<slot name='subtitle' />\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\n\t\t\t\t<slot name='post-title' />\n\t\t\t\t{this._hasDropdownSlot && this._getIcon()}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _updateAvatar() {\n\t\tconst avatar = this._el.querySelector(\n\t\t\t'p-avatar[slot=\"avatar\"]'\n\t\t) as HTMLPAvatarElement;\n\n\t\tif (!avatar) {\n\t\t\treturn;\n\t\t}\n\n\t\tavatar.size = this._hasDropdownSlot ? 'sm' : avatar.size;\n\t}\n\n\tprivate _getIcon() {\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tvariant='caret'\n\t\t\t\tflip={this._dropdownOpen ? 'vertical' : 'horizontal'}\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- *{box-sizing:border-box}:host .safe-sidebar{padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important}:host .safe-sidebar.show{--tw-translate-x:env(safe-area-inset-left,0)!important}:host .safe-topbar{height:calc(env(safe-area-inset-top, 0) + 4rem);padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important}.pointer-events-none{pointer-events:none!important}.static{position:static!important}.fixed{position:fixed!important}.relative{position:relative!important}.left-0{left:0!important}.top-0{top:0!important}.z-navbar{z-index:300!important}.z-navbar-backdrop{z-index:290!important}.z-navbar-topbar{z-index:280!important}.mt-auto{margin-top:auto!important}.flex{display:flex!important}.hidden{display:none!important}.h-screen{height:100vh!important}.w-60{width:15rem!important}.w-full{width:100%!important}.max-w-\[16\.5rem\]{max-width:16.5rem!important}.-translate-x-full{--tw-translate-x:-100%!important;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))!important}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-between{justify-content:space-between!important}.gap-6{gap:1.5rem!important}.overflow-y-auto{overflow-y:auto!important}.border-0{border-width:0!important}.border-b{border-bottom-width:1px!important}.border-r{border-right-width:1px!important}.border-solid{border-style:solid!important}.border-off-white-700{--tw-border-opacity:1!important;border-color:rgb(222 219 213/var(--tw-border-opacity,1))!important}.bg-off-white-300{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.p-4{padding:1rem!important}.opacity-0{opacity:0!important}.opacity-100{opacity:1!important}.transition-all{transition-duration:.15s!important;transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.transition-opacity{transition-duration:.15s!important;transition-property:opacity!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.will-change-transform{will-change:transform!important}.max-h-screen-safe{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important}@media (min-width:80rem){.layout-1280\:relative{position:relative!important}.layout-1280\:z-0{z-index:0!important}.layout-1280\:flex{display:flex!important}.layout-1280\:hidden{display:none!important}.layout-1280\:h-full{height:100%!important}.layout-1280\:w-60{width:15rem!important}.layout-1280\:max-w-none{max-width:none!important}.layout-1280\:translate-x-0{--tw-translate-x:0px!important;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))!important}}@media (min-width:105rem){.layout-1680\:w-72{width:18rem!important}}
1
+ *{box-sizing:border-box}:host .safe-sidebar{padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important}:host .safe-sidebar.show{--tw-translate-x:env(safe-area-inset-left,0)!important}:host .safe-topbar{height:calc(env(safe-area-inset-top, 0) + 4rem);padding-top:calc(env(safe-area-inset-top, 0) + 1rem)!important}.pointer-events-none{pointer-events:none!important}.static{position:static!important}.fixed{position:fixed!important}.relative{position:relative!important}.left-0{left:0!important}.top-0{top:0!important}.z-navbar{z-index:300!important}.z-navbar-backdrop{z-index:290!important}.z-navbar-topbar{z-index:280!important}.m-0{margin:0!important}.mt-auto{margin-top:auto!important}.flex{display:flex!important}.hidden{display:none!important}.h-screen{height:100vh!important}.w-60{width:15rem!important}.w-full{width:100%!important}.max-w-\[16\.5rem\]{max-width:16.5rem!important}.-translate-x-full{--tw-translate-x:-100%!important;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))!important}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-between{justify-content:space-between!important}.gap-6{gap:1.5rem!important}.overflow-y-auto{overflow-y:auto!important}.border-0{border-width:0!important}.border-b{border-bottom-width:1px!important}.border-r{border-right-width:1px!important}.border-solid{border-style:solid!important}.border-off-white-700{--tw-border-opacity:1!important;border-color:rgb(222 219 213/var(--tw-border-opacity,1))!important}.bg-off-white-300{--tw-bg-opacity:1!important;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))!important}.p-4{padding:1rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.font-semibold{font-weight:600!important}.text-storm-dark{--tw-text-opacity:1!important;color:rgb(39 40 56/var(--tw-text-opacity,1))!important}.opacity-0{opacity:0!important}.opacity-100{opacity:1!important}.transition-all{transition-duration:.15s!important;transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.transition-opacity{transition-duration:.15s!important;transition-property:opacity!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.will-change-transform{will-change:transform!important}.max-h-screen-safe{max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important}@media (min-width:80rem){.layout-1280\:relative{position:relative!important}.layout-1280\:z-0{z-index:0!important}.layout-1280\:flex{display:flex!important}.layout-1280\:hidden{display:none!important}.layout-1280\:h-full{height:100%!important}.layout-1280\:w-60{width:15rem!important}.layout-1280\:max-w-none{max-width:none!important}.layout-1280\:translate-x-0{--tw-translate-x:0px!important;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))!important}}@media (min-width:105rem){.layout-1680\:w-72{width:18rem!important}}
@@ -41,10 +41,11 @@ const backdrop = cva(['z-navbar-backdrop layout-1280:hidden transition-opacity']
41
41
  });
42
42
  export class Navbar {
43
43
  constructor() {
44
+ this.menuText = 'Menu';
44
45
  this._show = false;
45
46
  }
46
47
  render() {
47
- return (h(Host, { class: 'p-navbar w-full max-h-screen-safe layout-1280:w-60 layout-1680:w-72' }, h("p-backdrop", { class: backdrop({ show: this._show }), scrollLock: this._show, onClicked: () => (this._show = false) }), h("div", { class: sidebar({ class: sidebarAndTopbar(), show: this._show }) }, h("div", { class: 'flex w-full items-center justify-between layout-1280:hidden' }, h("p-button", { variant: 'secondary', icon: 'menu-arrow', iconFlip: 'horizontal', iconOnly: true, size: 'sm', onClick: () => (this._show = false) })), h("div", { class: 'flex w-full flex-col items-stretch' }, h("slot", { name: 'company' })), h("div", { class: 'flex w-full flex-col gap-6 overflow-y-auto' }, h("slot", { name: 'content' })), h("div", { class: 'mt-auto hidden w-full flex-col layout-1280:flex' }, h("slot", { name: 'user' }))), h("div", { class: topbar({ class: sidebarAndTopbar() }) }, h("p-button", { variant: 'secondary', iconOnly: true, icon: 'menu-arrow', size: 'sm', onClick: () => (this._show = true) }), h("slot", { name: 'topbar' }))));
48
+ return (h(Host, { class: 'p-navbar w-full max-h-screen-safe layout-1280:w-60 layout-1680:w-72' }, h("p-backdrop", { class: backdrop({ show: this._show }), scrollLock: this._show, onClicked: () => (this._show = false) }), h("div", { class: sidebar({ class: sidebarAndTopbar(), show: this._show }) }, h("div", { class: 'flex w-full items-center justify-between layout-1280:hidden' }, h("p", { class: 'm-0 text-xl font-semibold text-storm-dark' }, this.menuText), h("p-button", { variant: 'secondary', icon: 'negative', iconPosition: 'end', iconOnly: true, size: 'sm', onClick: () => (this._show = false) })), h("div", { class: 'flex w-full flex-col items-stretch' }, h("slot", { name: 'company' })), h("div", { class: 'flex w-full flex-col gap-6 overflow-y-auto' }, h("slot", { name: 'content' })), h("div", { class: 'mt-auto hidden w-full flex-col layout-1280:flex' }, h("slot", { name: 'user' }))), h("div", { class: topbar({ class: sidebarAndTopbar() }) }, h("p-button", { variant: 'secondary', iconOnly: true, icon: 'menu', size: 'sm', onClick: () => (this._show = true) }), h("slot", { name: 'topbar' }))));
48
49
  }
49
50
  handleCloseNavbar() {
50
51
  this._show = false;
@@ -64,6 +65,28 @@ export class Navbar {
64
65
  "$": ["navbar.component.css"]
65
66
  };
66
67
  }
68
+ static get properties() {
69
+ return {
70
+ "menuText": {
71
+ "type": "string",
72
+ "mutable": false,
73
+ "complexType": {
74
+ "original": "string",
75
+ "resolved": "string",
76
+ "references": {}
77
+ },
78
+ "required": false,
79
+ "optional": false,
80
+ "docs": {
81
+ "tags": [],
82
+ "text": "The text to display for the menu button & sidebar title"
83
+ },
84
+ "attribute": "menu-text",
85
+ "reflect": false,
86
+ "defaultValue": "'Menu'"
87
+ }
88
+ };
89
+ }
67
90
  static get states() {
68
91
  return {
69
92
  "_show": {}
@@ -1 +1 @@
1
- {"version":3,"file":"navbar.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/navbar/navbar.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,gBAAgB,GAAG,GAAG,CAAC;EAC5B,kBAAkB;EAClB,4CAA4C;EAC5C,KAAK;CACL,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,GAAG,CAClB;EACC,eAAe;EAEf,2CAA2C;EAC3C,wBAAwB;EACxB,gFAAgF;EAChF,OAAO;EAEP,gBAAgB;EAChB,uBAAuB;EACvB,2DAA2D;EAE3D,UAAU;EAEV,cAAc;CACd,EACD;EACC,QAAQ,EAAE;IACT,IAAI,EAAE;MACL,KAAK,EAAE,IAAI;MACX,IAAI,EAAE,MAAM;KACZ;GACD;CACD,CACD,CAAC;AAEF,MAAM,MAAM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AE,gBAAgB,EAAE,EAAE,CAAC;QAChD,gBACC,OAAO,EAAC,WAAW,EACnB,QAAQ,EAAE,IAAI,EACd,IAAI,EAAC,YAAY,EACjB,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GACvB;QAEZ,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACA,CACP,CAAC;EACH,CAAC;EAGD,iBAAiB;IAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;EACpB,CAAC;EAGD,gBAAgB;IACf,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Listen, State } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst sidebarAndTopbar = cva([\n\t'bg-off-white-300',\n\t'border-0 border-solid border-off-white-700',\n\t'p-4',\n]);\n\nconst sidebar = cva(\n\t[\n\t\t'flex flex-col',\n\n\t\t'fixed left-0 top-0 z-navbar h-screen w-60',\n\t\t'w-full max-w-[16.5rem]',\n\t\t'layout-1280:relative layout-1280:z-0 layout-1280:max-w-none layout-1280:h-full',\n\t\t'gap-6',\n\n\t\t'transition-all',\n\t\t'will-change-transform',\n\t\t'-translate-x-full transform-gpu layout-1280:translate-x-0',\n\n\t\t'border-r',\n\n\t\t'safe-sidebar',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tshow: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'show',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst topbar = cva([\n\t'flex w-full justify-between items-center',\n\t'relative z-navbar-topbar',\n\t'border-b',\n\t'layout-1280:hidden',\n\t'safe-topbar',\n]);\n\nconst backdrop = cva(\n\t['z-navbar-backdrop layout-1280:hidden transition-opacity'],\n\t{\n\t\tvariants: {\n\t\t\tshow: {\n\t\t\t\tfalse: 'opacity-0 pointer-events-none',\n\t\t\t\ttrue: 'opacity-100',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-navbar',\n\tstyleUrl: 'navbar.component.scss',\n\tshadow: true,\n})\nexport class Navbar {\n\t@State() private _show = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-navbar w-full max-h-screen-safe layout-1280:w-60 layout-1680:w-72'>\n\t\t\t\t<p-backdrop\n\t\t\t\t\tclass={backdrop({ show: this._show })}\n\t\t\t\t\tscrollLock={this._show}\n\t\t\t\t\tonClicked={() => (this._show = false)}\n\t\t\t\t></p-backdrop>\n\t\t\t\t<div class={sidebar({ class: sidebarAndTopbar(), show: this._show })}>\n\t\t\t\t\t<div class='flex w-full items-center justify-between layout-1280:hidden'>\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\ticon='menu-arrow'\n\t\t\t\t\t\t\ticonFlip='horizontal'\n\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\tonClick={() => (this._show = false)}\n\t\t\t\t\t\t></p-button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='flex w-full flex-col items-stretch'>\n\t\t\t\t\t\t<slot name='company' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='flex w-full flex-col gap-6 overflow-y-auto'>\n\t\t\t\t\t\t<slot name='content' />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class='mt-auto hidden w-full flex-col layout-1280:flex'>\n\t\t\t\t\t\t<slot name='user' />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class={topbar({ class: sidebarAndTopbar() })}>\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\ticon='menu-arrow'\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => (this._show = true)}\n\t\t\t\t\t></p-button>\n\n\t\t\t\t\t<slot name='topbar' />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('closeNavbar', { target: 'window' })\n\thandleCloseNavbar() {\n\t\tthis._show = false;\n\t}\n\n\t@Listen('openNavbar', { target: 'window' })\n\thandleOpenNavbar() {\n\t\tthis._show = true;\n\t}\n}\n"]}
1
+ {"version":3,"file":"navbar.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/navbar/navbar.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,gBAAgB,GAAG,GAAG,CAAC;EAC5B,kBAAkB;EAClB,4CAA4C;EAC5C,KAAK;CACL,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,GAAG,CAClB;EACC,eAAe;EAEf,2CAA2C;EAC3C,wBAAwB;EACxB,gFAAgF;EAChF,OAAO;EAEP,gBAAgB;EAChB,uBAAuB;EACvB,2DAA2D;EAE3D,UAAU;EAEV,cAAc;CACd,EACD;EACC,QAAQ,EAAE;IACT,IAAI,EAAE;MACL,KAAK,EAAE,IAAI;MACX,IAAI,EAAE,MAAM;KACZ;GACD;CACD,CACD,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CAAC;EAClB,0CAA0C;EAC1C,0BAA0B;EAC1B,UAAU;EACV,oBAAoB;EACpB,aAAa;CACb,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,GAAG,CACnB,CAAC,yDAAyD,CAAC,EAC3D;EACC,QAAQ,EAAE;IACT,IAAI,EAAE;MACL,KAAK,EAAE,+BAA+B;MACtC,IAAI,EAAE,aAAa;KACnB;GACD;CACD,CACD,CAAC;AAOF,MAAM,OAAO,MAAM;;oBAIC,MAAM;iBAEA,KAAK;;EAE9B,MAAM;IACL,OAAO,CACN,EAAC,I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AAiB;IAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;EACpB,CAAC;EAGD,gBAAgB;IACf,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Listen, Prop, State } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst sidebarAndTopbar = cva([\n\t'bg-off-white-300',\n\t'border-0 border-solid border-off-white-700',\n\t'p-4',\n]);\n\nconst sidebar = cva(\n\t[\n\t\t'flex flex-col',\n\n\t\t'fixed left-0 top-0 z-navbar h-screen w-60',\n\t\t'w-full max-w-[16.5rem]',\n\t\t'layout-1280:relative layout-1280:z-0 layout-1280:max-w-none layout-1280:h-full',\n\t\t'gap-6',\n\n\t\t'transition-all',\n\t\t'will-change-transform',\n\t\t'-translate-x-full transform-gpu layout-1280:translate-x-0',\n\n\t\t'border-r',\n\n\t\t'safe-sidebar',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tshow: {\n\t\t\t\tfalse: null,\n\t\t\t\ttrue: 'show',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst topbar = cva([\n\t'flex w-full justify-between items-center',\n\t'relative z-navbar-topbar',\n\t'border-b',\n\t'layout-1280:hidden',\n\t'safe-topbar',\n]);\n\nconst backdrop = cva(\n\t['z-navbar-backdrop layout-1280:hidden transition-opacity'],\n\t{\n\t\tvariants: {\n\t\t\tshow: {\n\t\t\t\tfalse: 'opacity-0 pointer-events-none',\n\t\t\t\ttrue: 'opacity-100',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-navbar',\n\tstyleUrl: 'navbar.component.scss',\n\tshadow: true,\n})\nexport class Navbar {\n\t/**\n\t * The text to display for the menu button & sidebar title\n\t */\n\t@Prop() menuText = 'Menu';\n\n\t@State() private _show = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-navbar w-full max-h-screen-safe layout-1280:w-60 layout-1680:w-72'>\n\t\t\t\t<p-backdrop\n\t\t\t\t\tclass={backdrop({ show: this._show })}\n\t\t\t\t\tscrollLock={this._show}\n\t\t\t\t\tonClicked={() => (this._show = false)}\n\t\t\t\t></p-backdrop>\n\t\t\t\t<div class={sidebar({ class: sidebarAndTopbar(), show: this._show })}>\n\t\t\t\t\t<div class='flex w-full items-center justify-between layout-1280:hidden'>\n\t\t\t\t\t\t<p class='m-0 text-xl font-semibold text-storm-dark'>\n\t\t\t\t\t\t\t{this.menuText}\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\ticon='negative'\n\t\t\t\t\t\t\ticonPosition='end'\n\t\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\t\tonClick={() => (this._show = false)}\n\t\t\t\t\t\t></p-button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='flex w-full flex-col items-stretch'>\n\t\t\t\t\t\t<slot name='company' />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='flex w-full flex-col gap-6 overflow-y-auto'>\n\t\t\t\t\t\t<slot name='content' />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class='mt-auto hidden w-full flex-col layout-1280:flex'>\n\t\t\t\t\t\t<slot name='user' />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class={topbar({ class: sidebarAndTopbar() })}>\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\ticon='menu'\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tonClick={() => (this._show = true)}\n\t\t\t\t\t></p-button>\n\n\t\t\t\t\t<slot name='topbar' />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('closeNavbar', { target: 'window' })\n\thandleCloseNavbar() {\n\t\tthis._show = false;\n\t}\n\n\t@Listen('openNavbar', { target: 'window' })\n\thandleOpenNavbar() {\n\t\tthis._show = true;\n\t}\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { c as cva } from './index2.js';
3
3
 
4
- const avatarComponentCss = "*{box-sizing:border-box}.static{position:static!important}.z-0{z-index:0!important}.flex{display:flex!important}.aspect-branding{aspect-ratio:23/24!important}.h-10{height:2.5rem!important}.h-14{height:3.5rem!important}.h-20{height:5rem!important}.h-4{height:1rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-\\[6\\.5rem\\]{height:6.5rem!important}.h-\\[8\\.5rem\\]{height:8.5rem!important}.h-full{height:100%!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.rounded-full{border-radius:9999px!important}.bg-off-white{--tw-bg-opacity:1!important;background-color:rgb(243 241 237/var(--tw-bg-opacity,1))!important}.object-cover{object-fit:cover!important}.p-\\[1px\\]{padding:1px!important}.font-ambit{font-family:Ambit,sans-serif!important}.text-4xl{font-size:2.5rem!important;line-height:3rem!important}.text-\\[3\\.5rem\\]{font-size:3.5rem!important}.text-\\[4\\.5rem\\]{font-size:4.5rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important}.text-xs,.text-xxs{line-height:1rem!important}.text-xxs{font-size:.5rem!important}.leading-\\[4rem\\]{line-height:4rem!important}.leading-\\[5rem\\]{line-height:5rem!important}.leading-none{line-height:1!important}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-inset{--tw-ring-inset:inset!important}.ring-black-teal\\/20{--tw-ring-color:rgba(3,42,36,.2)!important}";
4
+ const avatarComponentCss = "*{box-sizing:border-box}.static{position:static!important}.z-0{z-index:0!important}.flex{display:flex!important}.aspect-branding{aspect-ratio:23/24!important}.h-10{height:2.5rem!important}.h-14{height:3.5rem!important}.h-20{height:5rem!important}.h-4{height:1rem!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-\\[6\\.5rem\\]{height:6.5rem!important}.h-\\[8\\.5rem\\]{height:8.5rem!important}.h-full{height:100%!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.rounded-full{border-radius:9999px!important}.bg-off-white{--tw-bg-opacity:1!important;background-color:rgb(243 241 237/var(--tw-bg-opacity,1))!important}.object-cover{object-fit:cover!important}.p-\\[1px\\]{padding:1px!important}.text-4xl{font-size:2.5rem!important;line-height:3rem!important}.text-\\[3\\.5rem\\]{font-size:3.5rem!important}.text-\\[4\\.5rem\\]{font-size:4.5rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important}.text-xs,.text-xxs{line-height:1rem!important}.text-xxs{font-size:.5rem!important}.leading-\\[4rem\\]{line-height:4rem!important}.leading-\\[5rem\\]{line-height:5rem!important}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-inset{--tw-ring-inset:inset!important}.ring-black-teal\\/20{--tw-ring-color:rgba(3,42,36,.2)!important}";
5
5
 
6
6
  const avatar = cva([
7
- 'p-avatar bg-off-white rounded-full aspect-branding ring-inset ring-1 ring-black-teal/20 p-[1px] flex items-center justify-center font-ambit leading-none',
7
+ 'p-avatar bg-off-white rounded-full aspect-branding ring-inset ring-1 ring-black-teal/20 p-[1px] flex items-center justify-center',
8
8
  ], {
9
9
  variants: {
10
10
  size: {
@@ -26,7 +26,7 @@ const Avatar = /*@__PURE__*/ proxyCustomElement(class Avatar extends HTMLElement
26
26
  this.size = 'base';
27
27
  this.defaultImage = undefined;
28
28
  this.src = undefined;
29
- this.letters = undefined;
29
+ this.letters = ' ';
30
30
  this._src = undefined;
31
31
  this._failed = false;
32
32
  }
@@ -41,10 +41,9 @@ const Avatar = /*@__PURE__*/ proxyCustomElement(class Avatar extends HTMLElement
41
41
  }
42
42
  }
43
43
  render() {
44
- var _a, _b;
45
44
  return (h(Host, { class: avatar({
46
45
  size: this.size,
47
- }) }, this._failed ? ((_b = (_a = this.letters) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ' ') : (h("img", { src: this._src, class: 'z-0 aspect-branding h-full rounded-full object-cover', onError: () => this._setFailed() }))));
46
+ }) }, this._failed ? (this.letters) : (h("img", { src: this._src, class: 'z-0 aspect-branding h-full rounded-full object-cover', onError: () => this._setFailed() }))));
48
47
  }
49
48
  _setFailed() {
50
49
  this._failed = true;
@@ -1 +1 @@
1
- {"file":"avatar.component.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,gxDAAgxD;;ACG3yD,MAAM,MAAM,GAAG,GAAG,CACjB;EACC,0JAA0J;CAC1J,EACD;EACC,QAAQ,EAAE;IACT,IAAI,EAAE;MACL,EAAE,EAAE,cAAc;MAClB,EAAE,EAAE,aAAa;MACjB,IAAI,EAAE,eAAe;MACrB,EAAE,EAAE,cAAc;MAClB,EAAE,EAAE,cAAc;MAClB,KAAK,EAAE,eAAe;MACtB,KAAK,EAAE,yCAAyC;MAChD,KAAK,EAAE,yCAAyC;KAChD;GACD;CACD,CACD,CAAC;MAOW,MAAM;;;;gBAYP,MAAM;;;;;mBAkBmB,KAAK;;EAGzC,YAAY,CAAC,GAAW;IACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;GAChB;EAED,iBAAiB;IAChB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;MACf,IAAI,CAAC,UAAU,EAAE,CAAC;KAClB;GACD;EAED,MAAM;;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;OACf,CAAC,IAED,IAAI,CAAC,OAAO,IACZ,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAG,CAAC,CAAC,mCAAI,GAAG,KAExB,WACC,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,KAAK,EAAC,sDAAsD,EAC5D,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,GAC/B,CACF,CACK,EACN;GACF;EAEO,UAAU;IACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/avatar/avatar.component.scss?tag=p-avatar","src/components/atoms/avatar/avatar.component.tsx"],"sourcesContent":["","import { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst avatar = cva(\n\t[\n\t\t'p-avatar bg-off-white rounded-full aspect-branding ring-inset ring-1 ring-black-teal/20 p-[1px] flex items-center justify-center font-ambit leading-none',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\txs: 'h-4 text-xxs',\n\t\t\t\tsm: 'h-6 text-xs',\n\t\t\t\tbase: 'h-8 text-base',\n\t\t\t\tlg: 'h-10 text-xl',\n\t\t\t\txl: 'h-14 text-xl',\n\t\t\t\t'2xl': 'h-20 text-4xl',\n\t\t\t\t'3xl': 'h-[6.5rem] text-[3.5rem] leading-[4rem]',\n\t\t\t\t'4xl': 'h-[8.5rem] text-[4.5rem] leading-[5rem]',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-avatar',\n\tstyleUrl: 'avatar.component.scss',\n\t// shadow: true,\n})\nexport class Avatar {\n\t/**\n\t * The size of the avatar\n\t */\n\t@Prop({ reflect: true }) size:\n\t\t| 'xs'\n\t\t| 'sm'\n\t\t| 'base'\n\t\t| 'lg'\n\t\t| 'xl'\n\t\t| '2xl'\n\t\t| '3xl'\n\t\t| '4xl' = 'base';\n\n\t/**\n\t * The default image to show on errors\n\t */\n\t@Prop() defaultImage: string;\n\n\t/**\n\t * The image used for the avatar\n\t */\n\t@Prop() src!: string;\n\n\t/**\n\t * The letters to show on the empty state variant\n\t */\n\t@Prop() letters: string;\n\n\t@State() private _src: string;\n\t@State() private _failed: boolean = false;\n\n\t@Watch('src')\n\tonSrchChange(src: string) {\n\t\tthis._failed = false;\n\t\tthis._src = src;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.onSrchChange(this.src);\n\t\tif (!this._src) {\n\t\t\tthis._setFailed();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={avatar({\n\t\t\t\t\tsize: this.size,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this._failed ? (\n\t\t\t\t\tthis.letters?.[0] ?? ' '\n\t\t\t\t) : (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={this._src}\n\t\t\t\t\t\tclass='z-0 aspect-branding h-full rounded-full object-cover'\n\t\t\t\t\t\tonError={() => this._setFailed()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _setFailed() {\n\t\tthis._failed = true;\n\t\tthis._src = undefined;\n\t}\n}\n"],"version":3}
1
+ {"file":"avatar.component.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,urDAAurD;;ACGltD,MAAM,MAAM,GAAG,GAAG,CACjB;EACC,kIAAkI;CAClI,EACD;EACC,QAAQ,EAAE;IACT,IAAI,EAAE;MACL,EAAE,EAAE,cAAc;MAClB,EAAE,EAAE,aAAa;MACjB,IAAI,EAAE,eAAe;MACrB,EAAE,EAAE,cAAc;MAClB,EAAE,EAAE,cAAc;MAClB,KAAK,EAAE,eAAe;MACtB,KAAK,EAAE,yCAAyC;MAChD,KAAK,EAAE,yCAAyC;KAChD;GACD;CACD,CACD,CAAC;MAOW,MAAM;;;;gBAYP,MAAM;;;mBAeS,GAAG;;mBAGO,KAAK;;EAGzC,YAAY,CAAC,GAAW;IACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;GAChB;EAED,iBAAiB;IAChB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;MACf,IAAI,CAAC,UAAU,EAAE,CAAC;KAClB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;OACf,CAAC,IAED,IAAI,CAAC,OAAO,IACZ,IAAI,CAAC,OAAO,KAEZ,WACC,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,KAAK,EAAC,sDAAsD,EAC5D,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,GAC/B,CACF,CACK,EACN;GACF;EAEO,UAAU;IACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/avatar/avatar.component.scss?tag=p-avatar","src/components/atoms/avatar/avatar.component.tsx"],"sourcesContent":["","import { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nconst avatar = cva(\n\t[\n\t\t'p-avatar bg-off-white rounded-full aspect-branding ring-inset ring-1 ring-black-teal/20 p-[1px] flex items-center justify-center',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\txs: 'h-4 text-xxs',\n\t\t\t\tsm: 'h-6 text-xs',\n\t\t\t\tbase: 'h-8 text-base',\n\t\t\t\tlg: 'h-10 text-xl',\n\t\t\t\txl: 'h-14 text-xl',\n\t\t\t\t'2xl': 'h-20 text-4xl',\n\t\t\t\t'3xl': 'h-[6.5rem] text-[3.5rem] leading-[4rem]',\n\t\t\t\t'4xl': 'h-[8.5rem] text-[4.5rem] leading-[5rem]',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-avatar',\n\tstyleUrl: 'avatar.component.scss',\n\t// shadow: true,\n})\nexport class Avatar {\n\t/**\n\t * The size of the avatar\n\t */\n\t@Prop({ reflect: true }) size:\n\t\t| 'xs'\n\t\t| 'sm'\n\t\t| 'base'\n\t\t| 'lg'\n\t\t| 'xl'\n\t\t| '2xl'\n\t\t| '3xl'\n\t\t| '4xl' = 'base';\n\n\t/**\n\t * The default image to show on errors\n\t */\n\t@Prop() defaultImage: string;\n\n\t/**\n\t * The image used for the avatar\n\t */\n\t@Prop() src!: string;\n\n\t/**\n\t * The letters to show on the empty state variant\n\t */\n\t@Prop() letters: string = ' ';\n\n\t@State() private _src: string;\n\t@State() private _failed: boolean = false;\n\n\t@Watch('src')\n\tonSrchChange(src: string) {\n\t\tthis._failed = false;\n\t\tthis._src = src;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.onSrchChange(this.src);\n\t\tif (!this._src) {\n\t\t\tthis._setFailed();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={avatar({\n\t\t\t\t\tsize: this.size,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this._failed ? (\n\t\t\t\t\tthis.letters\n\t\t\t\t) : (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={this._src}\n\t\t\t\t\t\tclass='z-0 aspect-branding h-full rounded-full object-cover'\n\t\t\t\t\t\tonError={() => this._setFailed()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _setFailed() {\n\t\tthis._failed = true;\n\t\tthis._src = undefined;\n\t}\n}\n"],"version":3}