@for-the-people-initiative/design-system 1.3.1

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 (342) hide show
  1. package/README.md +80 -0
  2. package/dist/css/theme-dark.css +7 -0
  3. package/dist/css/tokens.css +2315 -0
  4. package/dist/scss/_tokens.scss +2521 -0
  5. package/dist/ts/tokens.ts +2441 -0
  6. package/package.json +80 -0
  7. package/src/components/Accordion/Accordion.scss +118 -0
  8. package/src/components/Accordion/Accordion.vue +105 -0
  9. package/src/components/Accordion/AccordionTab.vue +79 -0
  10. package/src/components/Alert/Alert.scss +109 -0
  11. package/src/components/Alert/Alert.vue +79 -0
  12. package/src/components/AppBar/AppBar.scss +73 -0
  13. package/src/components/AppBar/AppBar.vue +49 -0
  14. package/src/components/AtmosphericBackground/AtmosphericBackground.vue +198 -0
  15. package/src/components/AutoComplete/AutoComplete.scss +282 -0
  16. package/src/components/AutoComplete/AutoComplete.vue +398 -0
  17. package/src/components/Avatar/Avatar.scss +191 -0
  18. package/src/components/Avatar/Avatar.vue +44 -0
  19. package/src/components/Badge/Badge.scss +84 -0
  20. package/src/components/Badge/Badge.vue +41 -0
  21. package/src/components/BlockUI/BlockUI.scss +85 -0
  22. package/src/components/BlockUI/BlockUI.vue +90 -0
  23. package/src/components/Breadcrumb/Breadcrumb.scss +84 -0
  24. package/src/components/Breadcrumb/Breadcrumb.vue +141 -0
  25. package/src/components/Button/Button.scss +254 -0
  26. package/src/components/Button/Button.vue +68 -0
  27. package/src/components/CTA/CTA.scss +92 -0
  28. package/src/components/CTA/CTA.vue +33 -0
  29. package/src/components/Calendar/Calendar.scss +330 -0
  30. package/src/components/Calendar/Calendar.vue +455 -0
  31. package/src/components/Card/Card.scss +66 -0
  32. package/src/components/Card/Card.vue +48 -0
  33. package/src/components/Carousel/Carousel.scss +121 -0
  34. package/src/components/Carousel/Carousel.vue +191 -0
  35. package/src/components/Chart/Chart.scss +109 -0
  36. package/src/components/Chart/Chart.vue +209 -0
  37. package/src/components/Checkbox/Checkbox.scss +148 -0
  38. package/src/components/Checkbox/Checkbox.vue +75 -0
  39. package/src/components/Chip/Chip.scss +83 -0
  40. package/src/components/Chip/Chip.vue +73 -0
  41. package/src/components/ColorPicker/ColorPicker.scss +244 -0
  42. package/src/components/ColorPicker/ColorPicker.vue +411 -0
  43. package/src/components/Column/Column.scss +87 -0
  44. package/src/components/Column/Column.vue +45 -0
  45. package/src/components/ColumnGroup/ColumnGroup.scss +41 -0
  46. package/src/components/ColumnGroup/ColumnGroup.vue +27 -0
  47. package/src/components/ColumnGroup/ColumnGroupRow.vue +18 -0
  48. package/src/components/CommandPalette/CommandPalette.scss +143 -0
  49. package/src/components/CommandPalette/CommandPalette.vue +165 -0
  50. package/src/components/ConfirmDialog/ConfirmDialog.scss +177 -0
  51. package/src/components/ConfirmDialog/ConfirmDialog.vue +162 -0
  52. package/src/components/ConfirmPopup/ConfirmPopup.scss +180 -0
  53. package/src/components/ConfirmPopup/ConfirmPopup.vue +185 -0
  54. package/src/components/ContextMenu/ContextMenu.scss +171 -0
  55. package/src/components/ContextMenu/ContextMenu.vue +383 -0
  56. package/src/components/DataTable/DataTable.scss +162 -0
  57. package/src/components/DataTable/DataTable.vue +225 -0
  58. package/src/components/DataView/DataView.scss +149 -0
  59. package/src/components/DataView/DataView.vue +172 -0
  60. package/src/components/DatePicker/DatePicker.scss +71 -0
  61. package/src/components/DatePicker/DatePicker.vue +121 -0
  62. package/src/components/Dialog/Dialog.scss +161 -0
  63. package/src/components/Dialog/Dialog.vue +245 -0
  64. package/src/components/Divider/Divider.scss +147 -0
  65. package/src/components/Divider/Divider.vue +49 -0
  66. package/src/components/Dock/Dock.scss +221 -0
  67. package/src/components/Dock/Dock.vue +107 -0
  68. package/src/components/Drawer/Drawer.scss +220 -0
  69. package/src/components/Drawer/Drawer.vue +137 -0
  70. package/src/components/Dropdown/Dropdown.scss +218 -0
  71. package/src/components/Dropdown/Dropdown.vue +313 -0
  72. package/src/components/Editor/Editor.scss +156 -0
  73. package/src/components/Editor/Editor.vue +253 -0
  74. package/src/components/FAQ/FAQ.scss +24 -0
  75. package/src/components/FAQ/FAQ.vue +28 -0
  76. package/src/components/FeatureGrid/FeatureGrid.scss +92 -0
  77. package/src/components/FeatureGrid/FeatureGrid.vue +39 -0
  78. package/src/components/FieldSet/FieldSet.scss +97 -0
  79. package/src/components/FieldSet/FieldSet.vue +70 -0
  80. package/src/components/FileUpload/FileUpload.scss +137 -0
  81. package/src/components/FileUpload/FileUpload.vue +183 -0
  82. package/src/components/Footer/Footer.scss +95 -0
  83. package/src/components/Footer/Footer.vue +59 -0
  84. package/src/components/Form/Form.scss +72 -0
  85. package/src/components/Form/Form.vue +30 -0
  86. package/src/components/Form/FormField.vue +42 -0
  87. package/src/components/Galleria/Galleria.scss +295 -0
  88. package/src/components/Galleria/Galleria.vue +274 -0
  89. package/src/components/Hero/Hero.scss +116 -0
  90. package/src/components/Hero/Hero.vue +57 -0
  91. package/src/components/Image/Image.scss +129 -0
  92. package/src/components/Image/Image.vue +117 -0
  93. package/src/components/ImageCompare/ImageCompare.scss +97 -0
  94. package/src/components/ImageCompare/ImageCompare.vue +66 -0
  95. package/src/components/InPlace/InPlace.scss +97 -0
  96. package/src/components/InPlace/InPlace.vue +107 -0
  97. package/src/components/InlineMessage/InlineMessage.scss +69 -0
  98. package/src/components/InlineMessage/InlineMessage.vue +47 -0
  99. package/src/components/InputChips/InputChips.scss +165 -0
  100. package/src/components/InputChips/InputChips.vue +169 -0
  101. package/src/components/InputGroup/InputGroup.scss +57 -0
  102. package/src/components/InputGroup/InputGroup.vue +22 -0
  103. package/src/components/InputGroupAddon/InputGroupAddon.scss +28 -0
  104. package/src/components/InputGroupAddon/InputGroupAddon.vue +22 -0
  105. package/src/components/InputIcon/InputIcon.scss +58 -0
  106. package/src/components/InputIcon/InputIcon.vue +28 -0
  107. package/src/components/InputMask/InputMask.scss +65 -0
  108. package/src/components/InputMask/InputMask.vue +268 -0
  109. package/src/components/InputNumber/InputNumber.scss +122 -0
  110. package/src/components/InputNumber/InputNumber.vue +150 -0
  111. package/src/components/InputOtp/InputOtp.scss +88 -0
  112. package/src/components/InputOtp/InputOtp.vue +230 -0
  113. package/src/components/InputSwitch/InputSwitch.scss +131 -0
  114. package/src/components/InputSwitch/InputSwitch.vue +49 -0
  115. package/src/components/InputText/InputText.scss +61 -0
  116. package/src/components/InputText/InputText.vue +71 -0
  117. package/src/components/Knob/Knob.scss +92 -0
  118. package/src/components/Knob/Knob.vue +252 -0
  119. package/src/components/ListBox/ListBox.scss +152 -0
  120. package/src/components/ListBox/ListBox.vue +198 -0
  121. package/src/components/LogoCloud/LogoCloud.scss +64 -0
  122. package/src/components/LogoCloud/LogoCloud.vue +35 -0
  123. package/src/components/MegaMenu/MegaMenu.scss +280 -0
  124. package/src/components/MegaMenu/MegaMenu.vue +218 -0
  125. package/src/components/Menu/Menu.scss +102 -0
  126. package/src/components/Menu/Menu.vue +221 -0
  127. package/src/components/MenuBar/MenuBar.scss +208 -0
  128. package/src/components/MenuBar/MenuBar.vue +306 -0
  129. package/src/components/Message/Message.scss +126 -0
  130. package/src/components/Message/Message.vue +99 -0
  131. package/src/components/MeterGroup/MeterGroup.scss +105 -0
  132. package/src/components/MeterGroup/MeterGroup.vue +73 -0
  133. package/src/components/MultiSelect/MultiSelect.scss +239 -0
  134. package/src/components/MultiSelect/MultiSelect.vue +296 -0
  135. package/src/components/OrderList/OrderList.scss +133 -0
  136. package/src/components/OrderList/OrderList.vue +267 -0
  137. package/src/components/OrganizationChart/OrganizationChart.scss +145 -0
  138. package/src/components/OrganizationChart/OrganizationChart.vue +220 -0
  139. package/src/components/OverlayPanel/OverlayPanel.scss +69 -0
  140. package/src/components/OverlayPanel/OverlayPanel.vue +180 -0
  141. package/src/components/Paginator/Paginator.scss +130 -0
  142. package/src/components/Paginator/Paginator.vue +212 -0
  143. package/src/components/Panel/Panel.scss +113 -0
  144. package/src/components/Panel/Panel.vue +89 -0
  145. package/src/components/PanelMenu/PanelMenu.scss +211 -0
  146. package/src/components/PanelMenu/PanelMenu.vue +295 -0
  147. package/src/components/ParticleBackground/ParticleBackground.vue +310 -0
  148. package/src/components/PickList/PickList.scss +126 -0
  149. package/src/components/PickList/PickList.vue +249 -0
  150. package/src/components/PopOver/PopOver.scss +112 -0
  151. package/src/components/PopOver/PopOver.vue +254 -0
  152. package/src/components/PricingTable/PricingCard.vue +33 -0
  153. package/src/components/PricingTable/PricingTable.scss +133 -0
  154. package/src/components/PricingTable/PricingTable.vue +21 -0
  155. package/src/components/ProgressBar/ProgressBar.scss +58 -0
  156. package/src/components/ProgressBar/ProgressBar.vue +48 -0
  157. package/src/components/ProgressSpinner/ProgressSpinner.scss +48 -0
  158. package/src/components/ProgressSpinner/ProgressSpinner.vue +53 -0
  159. package/src/components/RadioButton/RadioButton.scss +148 -0
  160. package/src/components/RadioButton/RadioButton.vue +52 -0
  161. package/src/components/Rating/Rating.scss +109 -0
  162. package/src/components/Rating/Rating.vue +136 -0
  163. package/src/components/Row/Row.scss +38 -0
  164. package/src/components/Row/Row.vue +30 -0
  165. package/src/components/ScrollPanel/ScrollPanel.scss +90 -0
  166. package/src/components/ScrollPanel/ScrollPanel.vue +284 -0
  167. package/src/components/ScrollTop/ScrollTop.scss +59 -0
  168. package/src/components/ScrollTop/ScrollTop.vue +99 -0
  169. package/src/components/Section/Section.scss +58 -0
  170. package/src/components/Section/Section.vue +39 -0
  171. package/src/components/Select/Select.scss +98 -0
  172. package/src/components/Select/Select.vue +92 -0
  173. package/src/components/SelectButton/SelectButton.scss +65 -0
  174. package/src/components/SelectButton/SelectButton.vue +144 -0
  175. package/src/components/Sidebar/Sidebar.scss +170 -0
  176. package/src/components/Sidebar/Sidebar.vue +137 -0
  177. package/src/components/Skeleton/Skeleton.scss +43 -0
  178. package/src/components/Skeleton/Skeleton.vue +57 -0
  179. package/src/components/Slider/Slider.scss +103 -0
  180. package/src/components/Slider/Slider.vue +65 -0
  181. package/src/components/SpeedDial/SpeedDial.scss +217 -0
  182. package/src/components/SpeedDial/SpeedDial.vue +196 -0
  183. package/src/components/SplitButton/SplitButton.scss +264 -0
  184. package/src/components/SplitButton/SplitButton.vue +172 -0
  185. package/src/components/Splitter/Splitter.scss +95 -0
  186. package/src/components/Splitter/Splitter.vue +191 -0
  187. package/src/components/Splitter/SplitterPanel.vue +125 -0
  188. package/src/components/Stats/Stats.scss +54 -0
  189. package/src/components/Stats/Stats.vue +28 -0
  190. package/src/components/Steps/Steps.scss +164 -0
  191. package/src/components/Steps/Steps.vue +100 -0
  192. package/src/components/TabMenu/TabMenu.scss +106 -0
  193. package/src/components/TabMenu/TabMenu.vue +174 -0
  194. package/src/components/Tabs/TabPanel.vue +41 -0
  195. package/src/components/Tabs/Tabs.scss +82 -0
  196. package/src/components/Tabs/Tabs.vue +162 -0
  197. package/src/components/Tag/Tag.scss +73 -0
  198. package/src/components/Tag/Tag.vue +37 -0
  199. package/src/components/Terminal/Terminal.scss +80 -0
  200. package/src/components/Terminal/Terminal.vue +113 -0
  201. package/src/components/Testimonial/Testimonial.scss +80 -0
  202. package/src/components/Testimonial/Testimonial.vue +29 -0
  203. package/src/components/Textarea/Textarea.scss +65 -0
  204. package/src/components/Textarea/Textarea.vue +101 -0
  205. package/src/components/TieredMenu/TieredMenu.scss +146 -0
  206. package/src/components/TieredMenu/TieredMenu.vue +270 -0
  207. package/src/components/TieredMenu/TieredMenuSub.vue +132 -0
  208. package/src/components/Timeline/Timeline.scss +190 -0
  209. package/src/components/Timeline/Timeline.vue +79 -0
  210. package/src/components/Toast/Toast.scss +284 -0
  211. package/src/components/Toast/Toast.vue +162 -0
  212. package/src/components/ToggleButton/ToggleButton.scss +99 -0
  213. package/src/components/ToggleButton/ToggleButton.vue +65 -0
  214. package/src/components/ToggleSwitch/ToggleSwitch.scss +68 -0
  215. package/src/components/ToggleSwitch/ToggleSwitch.vue +44 -0
  216. package/src/components/Toolbar/Toolbar.scss +37 -0
  217. package/src/components/Toolbar/Toolbar.vue +23 -0
  218. package/src/components/Tooltip/Tooltip.scss +114 -0
  219. package/src/components/Tooltip/Tooltip.vue +169 -0
  220. package/src/components/Tree/Tree.scss +164 -0
  221. package/src/components/Tree/Tree.vue +273 -0
  222. package/src/components/TreeSelect/TreeSelect.scss +238 -0
  223. package/src/components/TreeSelect/TreeSelect.vue +401 -0
  224. package/src/components/TreeTable/TreeTable.scss +172 -0
  225. package/src/components/TreeTable/TreeTable.vue +285 -0
  226. package/src/components/VirtualScroller/VirtualScroller.scss +107 -0
  227. package/src/components/VirtualScroller/VirtualScroller.vue +234 -0
  228. package/src/scss/fonts.scss +63 -0
  229. package/src/scss/mixins/accent-gradient.scss +43 -0
  230. package/src/scss/mixins/border.scss +28 -0
  231. package/src/scss/mixins/breakpoint.scss +80 -0
  232. package/src/scss/mixins/container.scss +33 -0
  233. package/src/scss/mixins/elevation.scss +43 -0
  234. package/src/scss/mixins/grid.scss +23 -0
  235. package/src/scss/mixins/levitation.scss +15 -0
  236. package/src/scss/mixins/list.scss +5 -0
  237. package/src/scss/mixins/surface-atmospheric.scss +93 -0
  238. package/src/scss/mixins/surface.scss +19 -0
  239. package/src/scss/mixins/typography.scss +91 -0
  240. package/src/scss/utility-classes/utility-classes-spacing.scss +34 -0
  241. package/src/scss/utility-classes/utility-classes-typography.scss +114 -0
  242. package/tokens/components/accordion.json +127 -0
  243. package/tokens/components/autocomplete.json +238 -0
  244. package/tokens/components/avatar.json +220 -0
  245. package/tokens/components/badge.json +119 -0
  246. package/tokens/components/block-ui.json +40 -0
  247. package/tokens/components/breadcrumb.json +57 -0
  248. package/tokens/components/button.json +395 -0
  249. package/tokens/components/calendar.json +260 -0
  250. package/tokens/components/card.json +157 -0
  251. package/tokens/components/carousel.json +154 -0
  252. package/tokens/components/chart.json +132 -0
  253. package/tokens/components/checkbox.json +130 -0
  254. package/tokens/components/chip.json +100 -0
  255. package/tokens/components/color-picker.json +196 -0
  256. package/tokens/components/column-group.json +45 -0
  257. package/tokens/components/column.json +109 -0
  258. package/tokens/components/confirm-dialog.json +141 -0
  259. package/tokens/components/confirm-popup.json +101 -0
  260. package/tokens/components/context-menu.json +168 -0
  261. package/tokens/components/data-table.json +157 -0
  262. package/tokens/components/data-view.json +172 -0
  263. package/tokens/components/dialog.json +151 -0
  264. package/tokens/components/divider.json +45 -0
  265. package/tokens/components/dock.json +173 -0
  266. package/tokens/components/drawer.json +163 -0
  267. package/tokens/components/dropdown.json +230 -0
  268. package/tokens/components/editor.json +170 -0
  269. package/tokens/components/field-set.json +115 -0
  270. package/tokens/components/file-upload.json +193 -0
  271. package/tokens/components/galleria.json +235 -0
  272. package/tokens/components/image-compare.json +74 -0
  273. package/tokens/components/image.json +71 -0
  274. package/tokens/components/in-place.json +100 -0
  275. package/tokens/components/inline-message.json +107 -0
  276. package/tokens/components/input-chips.json +187 -0
  277. package/tokens/components/input-group-addon.json +47 -0
  278. package/tokens/components/input-group.json +21 -0
  279. package/tokens/components/input-icon.json +38 -0
  280. package/tokens/components/input-mask.json +136 -0
  281. package/tokens/components/input-number.json +144 -0
  282. package/tokens/components/input-otp.json +138 -0
  283. package/tokens/components/input-switch.json +108 -0
  284. package/tokens/components/input-text.json +136 -0
  285. package/tokens/components/knob.json +119 -0
  286. package/tokens/components/listbox.json +166 -0
  287. package/tokens/components/mega-menu.json +283 -0
  288. package/tokens/components/menu.json +145 -0
  289. package/tokens/components/menubar.json +152 -0
  290. package/tokens/components/message.json +151 -0
  291. package/tokens/components/meter-group.json +108 -0
  292. package/tokens/components/multi-select.json +244 -0
  293. package/tokens/components/order-list.json +193 -0
  294. package/tokens/components/organization-chart.json +188 -0
  295. package/tokens/components/overlay-panel.json +94 -0
  296. package/tokens/components/paginator.json +186 -0
  297. package/tokens/components/panel.json +120 -0
  298. package/tokens/components/panelmenu.json +190 -0
  299. package/tokens/components/picklist.json +187 -0
  300. package/tokens/components/popover.json +65 -0
  301. package/tokens/components/progress-bar.json +33 -0
  302. package/tokens/components/progress-spinner.json +38 -0
  303. package/tokens/components/radio.json +125 -0
  304. package/tokens/components/rating.json +76 -0
  305. package/tokens/components/row.json +62 -0
  306. package/tokens/components/scroll-panel.json +69 -0
  307. package/tokens/components/scroll-top.json +84 -0
  308. package/tokens/components/select-button.json +145 -0
  309. package/tokens/components/select.json +190 -0
  310. package/tokens/components/sidebar.json +146 -0
  311. package/tokens/components/skeleton.json +26 -0
  312. package/tokens/components/slider.json +82 -0
  313. package/tokens/components/speed-dial.json +144 -0
  314. package/tokens/components/split-button.json +316 -0
  315. package/tokens/components/splitter.json +88 -0
  316. package/tokens/components/steps.json +154 -0
  317. package/tokens/components/tabmenu.json +103 -0
  318. package/tokens/components/tabs.json +97 -0
  319. package/tokens/components/tag.json +122 -0
  320. package/tokens/components/terminal.json +100 -0
  321. package/tokens/components/textarea.json +96 -0
  322. package/tokens/components/tieredmenu.json +142 -0
  323. package/tokens/components/timeline.json +129 -0
  324. package/tokens/components/toast.json +281 -0
  325. package/tokens/components/toggle-button.json +220 -0
  326. package/tokens/components/toggle-switch.json +95 -0
  327. package/tokens/components/toolbar.json +41 -0
  328. package/tokens/components/tooltip.json +60 -0
  329. package/tokens/components/tree-select.json +224 -0
  330. package/tokens/components/tree.json +153 -0
  331. package/tokens/components/treetable.json +155 -0
  332. package/tokens/components/virtualscroller.json +95 -0
  333. package/tokens/primitives/color.json +137 -0
  334. package/tokens/primitives/radius.json +12 -0
  335. package/tokens/primitives/shadow.json +29 -0
  336. package/tokens/primitives/spacing.json +15 -0
  337. package/tokens/semantics/color.json +81 -0
  338. package/tokens/semantics/radius.json +10 -0
  339. package/tokens/semantics/shadow.json +9 -0
  340. package/tokens/semantics/spacing.json +24 -0
  341. package/tokens/themes/dark.json +7 -0
  342. package/tokens/themes/light.json +7 -0
@@ -0,0 +1,295 @@
1
+ <template>
2
+ <div class="panelmenu">
3
+ <div
4
+ v-for="(panel, panelIndex) in model"
5
+ :key="panel.key || panelIndex"
6
+ class="panelmenu__panel"
7
+ :class="{
8
+ 'panelmenu__panel--expanded': isExpanded(panelIndex),
9
+ 'panelmenu__panel--disabled': panel.disabled
10
+ }"
11
+ >
12
+ <!-- Panel Header -->
13
+ <button
14
+ type="button"
15
+ class="panelmenu__header"
16
+ :disabled="panel.disabled"
17
+ :aria-expanded="isExpanded(panelIndex)"
18
+ :aria-controls="`panelmenu-content-${panelIndex}`"
19
+ @click="togglePanel(panelIndex, panel)"
20
+ @keydown="onHeaderKeydown($event, panelIndex)"
21
+ >
22
+ <i v-if="panel.icon" :class="panel.icon" class="panelmenu__header-icon"></i>
23
+ <span class="panelmenu__header-text">{{ panel.label }}</span>
24
+ <svg
25
+ class="panelmenu__chevron"
26
+ viewBox="0 0 16 16"
27
+ fill="none"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ aria-hidden="true"
30
+ >
31
+ <path
32
+ d="M6 4L10 8L6 12"
33
+ stroke="currentColor"
34
+ stroke-width="1.5"
35
+ stroke-linecap="round"
36
+ stroke-linejoin="round"
37
+ />
38
+ </svg>
39
+ </button>
40
+
41
+ <!-- Panel Content -->
42
+ <div
43
+ :id="`panelmenu-content-${panelIndex}`"
44
+ class="panelmenu__content-wrapper"
45
+ role="region"
46
+ :aria-labelledby="`panelmenu-header-${panelIndex}`"
47
+ >
48
+ <div class="panelmenu__content">
49
+ <ul class="panelmenu__list" role="menu">
50
+ <template v-for="(item, itemIndex) in panel.items" :key="item.key || itemIndex">
51
+ <!-- Separator -->
52
+ <li v-if="item.separator" class="panelmenu__separator" role="separator"></li>
53
+
54
+ <!-- Menu Item -->
55
+ <li
56
+ v-else
57
+ class="panelmenu__item"
58
+ :class="{
59
+ 'panelmenu__item--active': item.active,
60
+ 'panelmenu__item--disabled': item.disabled,
61
+ 'panelmenu__item--has-submenu': item.items && item.items.length > 0,
62
+ 'panelmenu__item--expanded': isSubmenuExpanded(panelIndex, itemIndex)
63
+ }"
64
+ role="none"
65
+ >
66
+ <a
67
+ v-if="item.url"
68
+ :href="item.url"
69
+ :target="item.target"
70
+ class="panelmenu__link"
71
+ role="menuitem"
72
+ :tabindex="item.disabled ? -1 : 0"
73
+ :aria-disabled="item.disabled || undefined"
74
+ @click="onItemClick($event, item, panelIndex, itemIndex)"
75
+ >
76
+ <i v-if="item.icon" :class="item.icon" class="panelmenu__icon"></i>
77
+ <span class="panelmenu__label">{{ item.label }}</span>
78
+ </a>
79
+ <button
80
+ v-else
81
+ type="button"
82
+ class="panelmenu__link"
83
+ role="menuitem"
84
+ :tabindex="item.disabled ? -1 : 0"
85
+ :disabled="item.disabled"
86
+ :aria-expanded="item.items && item.items.length > 0 ? isSubmenuExpanded(panelIndex, itemIndex) : undefined"
87
+ @click="onItemClick($event, item, panelIndex, itemIndex)"
88
+ >
89
+ <i v-if="item.icon" :class="item.icon" class="panelmenu__icon"></i>
90
+ <span class="panelmenu__label">{{ item.label }}</span>
91
+ <svg
92
+ v-if="item.items && item.items.length > 0"
93
+ class="panelmenu__submenu-chevron"
94
+ viewBox="0 0 16 16"
95
+ fill="none"
96
+ xmlns="http://www.w3.org/2000/svg"
97
+ aria-hidden="true"
98
+ >
99
+ <path
100
+ d="M6 4L10 8L6 12"
101
+ stroke="currentColor"
102
+ stroke-width="1.5"
103
+ stroke-linecap="round"
104
+ stroke-linejoin="round"
105
+ />
106
+ </svg>
107
+ </button>
108
+
109
+ <!-- Nested Submenu -->
110
+ <ul
111
+ v-if="item.items && item.items.length > 0"
112
+ class="panelmenu__submenu"
113
+ role="menu"
114
+ >
115
+ <template v-for="(subitem, subitemIndex) in item.items" :key="subitem.key || subitemIndex">
116
+ <li v-if="subitem.separator" class="panelmenu__separator" role="separator"></li>
117
+ <li
118
+ v-else
119
+ class="panelmenu__item panelmenu__item--nested"
120
+ :class="{
121
+ 'panelmenu__item--active': subitem.active,
122
+ 'panelmenu__item--disabled': subitem.disabled
123
+ }"
124
+ role="none"
125
+ >
126
+ <a
127
+ v-if="subitem.url"
128
+ :href="subitem.url"
129
+ :target="subitem.target"
130
+ class="panelmenu__link"
131
+ role="menuitem"
132
+ :tabindex="subitem.disabled ? -1 : 0"
133
+ :aria-disabled="subitem.disabled || undefined"
134
+ @click="onSubitemClick($event, subitem)"
135
+ >
136
+ <i v-if="subitem.icon" :class="subitem.icon" class="panelmenu__icon"></i>
137
+ <span class="panelmenu__label">{{ subitem.label }}</span>
138
+ </a>
139
+ <button
140
+ v-else
141
+ type="button"
142
+ class="panelmenu__link"
143
+ role="menuitem"
144
+ :tabindex="subitem.disabled ? -1 : 0"
145
+ :disabled="subitem.disabled"
146
+ @click="onSubitemClick($event, subitem)"
147
+ >
148
+ <i v-if="subitem.icon" :class="subitem.icon" class="panelmenu__icon"></i>
149
+ <span class="panelmenu__label">{{ subitem.label }}</span>
150
+ </button>
151
+ </li>
152
+ </template>
153
+ </ul>
154
+ </li>
155
+ </template>
156
+ </ul>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ </template>
162
+
163
+ <style src="./PanelMenu.scss"></style>
164
+
165
+ <script setup lang="ts">
166
+ import type { PanelMenuProps, PanelMenuEmits } from '../../types';
167
+ import { ref, computed, watch } from "vue";
168
+
169
+ defineOptions({ name: 'FtpPanelMenu' });
170
+
171
+ const props = withDefaults(defineProps<PanelMenuProps>(), {
172
+ model: () => [],
173
+ expandedKeys: () => ({}),
174
+ multiple: false,
175
+ });
176
+
177
+ const emit = defineEmits(["update:expandedKeys", "panel-open", "panel-close", "item-click"]);
178
+
179
+ // Internal state
180
+ const internalExpandedKeys = ref<Record<string, boolean>>({ ...props.expandedKeys });
181
+ const expandedSubmenus = ref<Record<string, boolean>>({});
182
+
183
+ // Watch for external changes
184
+ watch(
185
+ () => props.expandedKeys,
186
+ (newVal) => {
187
+ internalExpandedKeys.value = { ...newVal };
188
+ },
189
+ { deep: true }
190
+ );
191
+
192
+ const isExpanded = (panelIndex: any) => {
193
+ return internalExpandedKeys.value[panelIndex] === true;
194
+ };
195
+
196
+ const isSubmenuExpanded = (panelIndex: any, itemIndex: any) => {
197
+ const key = `${panelIndex}-${itemIndex}`;
198
+ return expandedSubmenus.value[key] === true;
199
+ };
200
+
201
+ const togglePanel = (panelIndex: any, panel: any) => {
202
+ if (panel.disabled) return;
203
+
204
+ const wasExpanded = isExpanded(panelIndex);
205
+
206
+ if (props.multiple) {
207
+ internalExpandedKeys.value = {
208
+ ...internalExpandedKeys.value,
209
+ [panelIndex]: !wasExpanded,
210
+ };
211
+ } else {
212
+ // Close all panels except the clicked one
213
+ const newKeys: Record<string, boolean> = {};
214
+ if (!wasExpanded) {
215
+ newKeys[panelIndex] = true;
216
+ }
217
+ internalExpandedKeys.value = newKeys;
218
+ }
219
+
220
+ emit("update:expandedKeys", { ...internalExpandedKeys.value });
221
+
222
+ if (wasExpanded) {
223
+ emit("panel-close", { index: panelIndex, panel });
224
+ } else {
225
+ emit("panel-open", { index: panelIndex, panel });
226
+ }
227
+ };
228
+
229
+ const toggleSubmenu = (panelIndex: any, itemIndex: any) => {
230
+ const key = `${panelIndex}-${itemIndex}`;
231
+ expandedSubmenus.value = {
232
+ ...expandedSubmenus.value,
233
+ [key]: !expandedSubmenus.value[key],
234
+ };
235
+ };
236
+
237
+ const onItemClick = (event: MouseEvent, item: any, panelIndex: any, itemIndex: any) => {
238
+ if (item.disabled) {
239
+ event.preventDefault();
240
+ return;
241
+ }
242
+
243
+ // Toggle submenu if item has children
244
+ if (item.items && item.items.length > 0) {
245
+ event.preventDefault();
246
+ toggleSubmenu(panelIndex, itemIndex);
247
+ return;
248
+ }
249
+
250
+ if (item.command) {
251
+ item.command({ originalEvent: event, item });
252
+ }
253
+
254
+ emit("item-click", { originalEvent: event, item });
255
+ };
256
+
257
+ const onSubitemClick = (event: MouseEvent, item: any) => {
258
+ if (item.disabled) {
259
+ event.preventDefault();
260
+ return;
261
+ }
262
+
263
+ if (item.command) {
264
+ item.command({ originalEvent: event, item });
265
+ }
266
+
267
+ emit("item-click", { originalEvent: event, item });
268
+ };
269
+
270
+ const onHeaderKeydown = (event: KeyboardEvent, panelIndex: any) => {
271
+ switch (event.key) {
272
+ case "ArrowDown":
273
+ event.preventDefault();
274
+ // Focus next panel header or first item
275
+ break;
276
+ case "ArrowUp":
277
+ event.preventDefault();
278
+ // Focus previous panel header
279
+ break;
280
+ case "Home":
281
+ event.preventDefault();
282
+ // Focus first panel header
283
+ break;
284
+ case "End":
285
+ event.preventDefault();
286
+ // Focus last panel header
287
+ break;
288
+ case "Enter":
289
+ case " ":
290
+ event.preventDefault();
291
+ togglePanel(panelIndex, props.model[panelIndex]);
292
+ break;
293
+ }
294
+ };
295
+ </script>
@@ -0,0 +1,310 @@
1
+ <template>
2
+ <canvas
3
+ ref="canvasRef"
4
+ class="particle-background"
5
+ :class="{ 'particle-background--fixed': fixed }"
6
+ />
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import type { ParticleBackgroundProps } from '../../types';
11
+ import { ref, onMounted, onUnmounted, watch, nextTick } from "vue";
12
+
13
+ defineOptions({ name: 'FtpParticleBackground' });
14
+
15
+ const props = withDefaults(defineProps<ParticleBackgroundProps>(), {
16
+ particleCount: 150,
17
+ staticStarCount: 300,
18
+ clusterCount: 8,
19
+ starsPerCluster: 15,
20
+ particleColor: "rgba(255, 255, 255, 0.8)",
21
+ minSize: 0.5,
22
+ maxSize: 2,
23
+ speed: 0.2,
24
+ twinkle: true,
25
+ parallax: false,
26
+ fixed: false,
27
+ });
28
+
29
+ const canvasRef = ref<HTMLCanvasElement | null>(null);
30
+ let ctx: CanvasRenderingContext2D | null = null;
31
+ let particles: Particle[] = [];
32
+ let staticStars: StaticStar[] = [];
33
+ let animationId: number | null = null;
34
+ let mouseX = 0;
35
+ let mouseY = 0;
36
+
37
+ // Static star - doesn't move, only ~10% twinkle
38
+ class StaticStar {
39
+ canvas: any; x: number; y: number; size: number; opacity: number;
40
+ doesTwinkle: boolean; twinkleSpeed: number; twinklePhase: number; currentOpacity: number;
41
+ constructor(canvas: any, x: number | null = null, y: number | null = null, sizeMultiplier = 1) {
42
+ this.canvas = canvas;
43
+ // Allow preset position for clusters
44
+ this.x = x !== null ? x : Math.random() * canvas.width;
45
+ this.y = y !== null ? y : Math.random() * canvas.height;
46
+ // Static stars are generally smaller
47
+ const baseSize = props.minSize + Math.random() * (props.maxSize - props.minSize) * 0.7;
48
+ this.size = baseSize * sizeMultiplier;
49
+ this.opacity = 0.2 + Math.random() * 0.6;
50
+ // Only ~10% of stars twinkle
51
+ this.doesTwinkle = Math.random() < 0.1;
52
+ this.twinkleSpeed = 0.003 + Math.random() * 0.006;
53
+ this.twinklePhase = Math.random() * Math.PI * 2;
54
+ this.currentOpacity = this.opacity;
55
+ }
56
+
57
+ update(deltaTime: any) {
58
+ if (this.doesTwinkle && props.twinkle) {
59
+ this.twinklePhase += this.twinkleSpeed * deltaTime;
60
+ this.currentOpacity = this.opacity * (0.6 + 0.4 * Math.sin(this.twinklePhase));
61
+ }
62
+ }
63
+
64
+ draw(ctx: any) {
65
+ ctx.beginPath();
66
+ ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
67
+ ctx!.fillStyle = props.particleColor.replace(
68
+ /[\d.]+\)$/,
69
+ `${this.currentOpacity})`
70
+ );
71
+ ctx.fill();
72
+ }
73
+ }
74
+
75
+ // Moving particle
76
+ class Particle {
77
+ canvas: any; x: number = 0; y: number = 0; size: number = 0; speedX: number = 0; speedY: number = 0;
78
+ opacity: number = 0; twinkleSpeed: number = 0; twinklePhase: number = 0; depth: number = 0; currentOpacity: number = 0;
79
+ constructor(canvas: any) {
80
+ this.canvas = canvas;
81
+ this.reset();
82
+ }
83
+
84
+ reset() {
85
+ this.x = Math.random() * this.canvas.width;
86
+ this.y = Math.random() * this.canvas.height;
87
+ this.size = props.minSize + Math.random() * (props.maxSize - props.minSize);
88
+ this.speedX = (Math.random() - 0.5) * props.speed;
89
+ this.speedY = (Math.random() - 0.5) * props.speed;
90
+ this.opacity = 0.3 + Math.random() * 0.7;
91
+ this.twinkleSpeed = 0.005 + Math.random() * 0.01;
92
+ this.twinklePhase = Math.random() * Math.PI * 2;
93
+ // Depth for parallax (0 = far, 1 = close)
94
+ this.depth = Math.random();
95
+ }
96
+
97
+ update(deltaTime: any) {
98
+ // Movement
99
+ this.x += this.speedX * deltaTime;
100
+ this.y += this.speedY * deltaTime;
101
+
102
+ // Wrap around edges
103
+ if (this.x < 0) this.x = this.canvas.width;
104
+ if (this.x > this.canvas.width) this.x = 0;
105
+ if (this.y < 0) this.y = this.canvas.height;
106
+ if (this.y > this.canvas.height) this.y = 0;
107
+
108
+ // Twinkle effect
109
+ if (props.twinkle) {
110
+ this.twinklePhase += this.twinkleSpeed * deltaTime;
111
+ this.currentOpacity = this.opacity * (0.5 + 0.5 * Math.sin(this.twinklePhase));
112
+ } else {
113
+ this.currentOpacity = this.opacity;
114
+ }
115
+ }
116
+
117
+ draw(ctx: any, offsetX = 0, offsetY = 0) {
118
+ const parallaxMultiplier = props.parallax ? this.depth * 0.02 : 0;
119
+ const drawX = this.x + offsetX * parallaxMultiplier;
120
+ const drawY = this.y + offsetY * parallaxMultiplier;
121
+
122
+ ctx.beginPath();
123
+ ctx.arc(drawX, drawY, this.size, 0, Math.PI * 2);
124
+ ctx.fillStyle = props.particleColor.replace(
125
+ /[\d.]+\)$/,
126
+ `${this.currentOpacity})`
127
+ );
128
+ ctx.fill();
129
+
130
+ // Add subtle glow for larger particles
131
+ if (this.size > 1.2) {
132
+ ctx.beginPath();
133
+ ctx.arc(drawX, drawY, this.size * 2, 0, Math.PI * 2);
134
+ const gradient = ctx.createRadialGradient(
135
+ drawX, drawY, 0,
136
+ drawX, drawY, this.size * 2
137
+ );
138
+ gradient.addColorStop(0, props.particleColor.replace(/[\d.]+\)$/, `${this.currentOpacity * 0.3})`));
139
+ gradient.addColorStop(1, "transparent");
140
+ ctx.fillStyle = gradient;
141
+ ctx.fill();
142
+ }
143
+ }
144
+ }
145
+
146
+ function initParticles() {
147
+ const canvas = canvasRef.value;
148
+ if (!canvas) return;
149
+
150
+ // Initialize moving particles
151
+ particles = [];
152
+ for (let i = 0; i < props.particleCount; i++) {
153
+ particles.push(new Particle(canvas));
154
+ }
155
+
156
+ // Initialize static stars
157
+ staticStars = [];
158
+
159
+ // Random scattered static stars
160
+ for (let i = 0; i < props.staticStarCount; i++) {
161
+ staticStars.push(new StaticStar(canvas));
162
+ }
163
+
164
+ // Create star clusters
165
+ for (let c = 0; c < props.clusterCount; c++) {
166
+ // Random cluster center
167
+ const clusterX = Math.random() * canvas.width;
168
+ const clusterY = Math.random() * canvas.height;
169
+ // Cluster radius varies
170
+ const clusterRadius = 30 + Math.random() * 80;
171
+ // Number of stars in this cluster
172
+ const starCount = Math.floor(props.starsPerCluster * (0.5 + Math.random()));
173
+
174
+ for (let i = 0; i < starCount; i++) {
175
+ // Gaussian-like distribution for more stars near center
176
+ const angle = Math.random() * Math.PI * 2;
177
+ const distance = Math.random() * Math.random() * clusterRadius; // Squared for density toward center
178
+ const x = clusterX + Math.cos(angle) * distance;
179
+ const y = clusterY + Math.sin(angle) * distance;
180
+
181
+ // Stars near cluster center can be slightly larger
182
+ const sizeMultiplier = 0.6 + (1 - distance / clusterRadius) * 0.6;
183
+
184
+ staticStars.push(new StaticStar(canvas, x, y, sizeMultiplier));
185
+ }
186
+ }
187
+ }
188
+
189
+ function resizeCanvas() {
190
+ const canvas = canvasRef.value;
191
+ if (!canvas) return;
192
+
193
+ const rect = canvas.getBoundingClientRect();
194
+
195
+ // If canvas has no dimensions yet, retry after a frame
196
+ if (rect.width === 0 || rect.height === 0) {
197
+ requestAnimationFrame(resizeCanvas);
198
+ return;
199
+ }
200
+
201
+ const dpr = window.devicePixelRatio || 1;
202
+
203
+ canvas.width = rect.width * dpr;
204
+ canvas.height = rect.height * dpr;
205
+
206
+ ctx = canvas.getContext("2d");
207
+ ctx!.scale(dpr, dpr);
208
+
209
+ // Reinitialize particles with new dimensions
210
+ initParticles();
211
+ }
212
+
213
+ let lastTime = 0;
214
+ function animate(currentTime: any) {
215
+ const deltaTime = lastTime ? (currentTime - lastTime) / 16.67 : 1; // Normalize to ~60fps
216
+ lastTime = currentTime;
217
+
218
+ const canvas = canvasRef.value;
219
+ if (!canvas || !ctx) return;
220
+
221
+ const rect = canvas.getBoundingClientRect();
222
+
223
+ // Clear canvas
224
+ ctx!.clearRect(0, 0, rect.width, rect.height);
225
+
226
+ // Calculate parallax offset
227
+ const offsetX = props.parallax ? (mouseX - rect.width / 2) : 0;
228
+ const offsetY = props.parallax ? (mouseY - rect.height / 2) : 0;
229
+
230
+ // Draw static stars first (background layer)
231
+ for (const star of staticStars) {
232
+ star.update(deltaTime);
233
+ star.draw(ctx);
234
+ }
235
+
236
+ // Update and draw moving particles (foreground layer)
237
+ for (const particle of particles) {
238
+ particle.update(deltaTime);
239
+ particle.draw(ctx, offsetX, offsetY);
240
+ }
241
+
242
+ animationId = requestAnimationFrame(animate);
243
+ }
244
+
245
+ function handleMouseMove(e: MouseEvent) {
246
+ if (!props.parallax) return;
247
+ const canvas = canvasRef.value;
248
+ if (!canvas) return;
249
+
250
+ const rect = canvas.getBoundingClientRect();
251
+ mouseX = e.clientX - rect.left;
252
+ mouseY = e.clientY - rect.top;
253
+ }
254
+
255
+ function handleResize() {
256
+ resizeCanvas();
257
+ }
258
+
259
+ onMounted(async () => {
260
+ // Wait for layout to complete before measuring canvas
261
+ await nextTick();
262
+
263
+ // Additional delay to ensure CSS has been applied
264
+ requestAnimationFrame(() => {
265
+ resizeCanvas();
266
+ animationId = requestAnimationFrame(animate);
267
+ });
268
+
269
+ window.addEventListener("resize", handleResize);
270
+ if (props.parallax) {
271
+ window.addEventListener("mousemove", handleMouseMove);
272
+ }
273
+ });
274
+
275
+ onUnmounted(() => {
276
+ if (animationId) {
277
+ cancelAnimationFrame(animationId);
278
+ }
279
+ window.removeEventListener("resize", handleResize);
280
+ window.removeEventListener("mousemove", handleMouseMove);
281
+ });
282
+
283
+ // Watch for prop changes
284
+ watch(() => props.particleCount, initParticles);
285
+ watch(() => props.parallax, (newVal) => {
286
+ if (newVal) {
287
+ window.addEventListener("mousemove", handleMouseMove);
288
+ } else {
289
+ window.removeEventListener("mousemove", handleMouseMove);
290
+ }
291
+ });
292
+ </script>
293
+
294
+ <style>
295
+ .particle-background {
296
+ display: block;
297
+ position: absolute;
298
+ top: 0;
299
+ left: 0;
300
+ width: 100%;
301
+ height: 100%;
302
+ pointer-events: none;
303
+ }
304
+
305
+ .particle-background--fixed {
306
+ position: fixed;
307
+ inset: 0;
308
+ z-index: 0;
309
+ }
310
+ </style>