@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,398 @@
1
+ <template>
2
+ <div
3
+ ref="containerRef"
4
+ class="autocomplete"
5
+ :class="additionalClasses"
6
+ >
7
+ <div class="autocomplete__input-wrapper" @click="focusInput">
8
+ <!-- Multiple mode chips -->
9
+ <span
10
+ v-for="(item, index) in selectedItems"
11
+ :key="`chip-${index}`"
12
+ class="autocomplete__chip"
13
+ >
14
+ <span class="autocomplete__chip-label">{{ getOptionLabel(item) }}</span>
15
+ <button
16
+ v-if="!isDisabled"
17
+ type="button"
18
+ class="autocomplete__chip-remove"
19
+ aria-label="Remove"
20
+ @click.stop="removeItem(index)"
21
+ >
22
+ <svg
23
+ class="autocomplete__chip-remove-icon"
24
+ viewBox="0 0 14 14"
25
+ fill="none"
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ >
28
+ <path
29
+ d="M4.5 4.5L9.5 9.5M9.5 4.5L4.5 9.5"
30
+ stroke="currentColor"
31
+ stroke-width="1.5"
32
+ stroke-linecap="round"
33
+ stroke-linejoin="round"
34
+ />
35
+ </svg>
36
+ </button>
37
+ </span>
38
+
39
+ <input
40
+ ref="inputRef"
41
+ v-model="query"
42
+ class="autocomplete__input"
43
+ type="text"
44
+ :placeholder="showPlaceholder ? placeholder : ''"
45
+ :disabled="isDisabled"
46
+ :aria-invalid="isInvalid || undefined"
47
+ :aria-expanded="isOpen"
48
+ :aria-describedby="ariaDescribedby || undefined"
49
+ :aria-activedescendant="highlightedIndex >= 0 ? `${autocompleteId}-option-${highlightedIndex}` : undefined"
50
+ aria-autocomplete="list"
51
+ :aria-controls="`${autocompleteId}-listbox`"
52
+ role="combobox"
53
+ @input="onInput"
54
+ @focus="onFocus"
55
+ @blur="onBlur"
56
+ @keydown="onKeydown"
57
+ />
58
+
59
+ <span v-if="isLoading" class="autocomplete__loader">
60
+ <svg
61
+ class="autocomplete__loader-icon"
62
+ viewBox="0 0 24 24"
63
+ fill="none"
64
+ xmlns="http://www.w3.org/2000/svg"
65
+ >
66
+ <circle
67
+ cx="12"
68
+ cy="12"
69
+ r="10"
70
+ stroke="currentColor"
71
+ stroke-width="2"
72
+ stroke-linecap="round"
73
+ stroke-dasharray="31.4 31.4"
74
+ />
75
+ </svg>
76
+ </span>
77
+
78
+ <span v-else-if="!multiple && modelValue && !isDisabled" class="autocomplete__clear" @click.stop="clearValue">
79
+ <svg
80
+ viewBox="0 0 14 14"
81
+ fill="none"
82
+ xmlns="http://www.w3.org/2000/svg"
83
+ >
84
+ <path
85
+ d="M4.5 4.5L9.5 9.5M9.5 4.5L4.5 9.5"
86
+ stroke="currentColor"
87
+ stroke-width="1.5"
88
+ stroke-linecap="round"
89
+ stroke-linejoin="round"
90
+ />
91
+ </svg>
92
+ </span>
93
+
94
+ <span class="autocomplete__icon">
95
+ <svg
96
+ width="16"
97
+ height="16"
98
+ viewBox="0 0 16 16"
99
+ fill="none"
100
+ xmlns="http://www.w3.org/2000/svg"
101
+ >
102
+ <path
103
+ d="M4 6L8 10L12 6"
104
+ stroke="currentColor"
105
+ stroke-width="1.5"
106
+ stroke-linecap="round"
107
+ stroke-linejoin="round"
108
+ />
109
+ </svg>
110
+ </span>
111
+ </div>
112
+
113
+ <!-- Dropdown -->
114
+ <Teleport to="body">
115
+ <div
116
+ v-if="isOpen && filteredSuggestions.length > 0"
117
+ ref="dropdownRef"
118
+ class="autocomplete__dropdown"
119
+ :style="dropdownStyle"
120
+ role="listbox"
121
+ :id="`${autocompleteId}-listbox`"
122
+ >
123
+ <div
124
+ v-for="(suggestion, index) in filteredSuggestions"
125
+ :key="`suggestion-${index}`"
126
+ :id="`${autocompleteId}-option-${index}`"
127
+ class="autocomplete__option"
128
+ :class="{
129
+ 'autocomplete__option--highlighted': index === highlightedIndex,
130
+ 'autocomplete__option--selected': isSelected(suggestion)
131
+ }"
132
+ role="option"
133
+ :aria-selected="isSelected(suggestion)"
134
+ @mousedown.prevent="selectSuggestion(suggestion)"
135
+ @mouseenter="highlightedIndex = index"
136
+ >
137
+ <slot name="option" :option="suggestion">
138
+ {{ getOptionLabel(suggestion) }}
139
+ </slot>
140
+ </div>
141
+ </div>
142
+ </Teleport>
143
+ </div>
144
+ </template>
145
+
146
+ <style src="./AutoComplete.scss"></style>
147
+
148
+ <script setup lang="ts">
149
+ import type { AutoCompleteProps, AutoCompleteEmits } from '../../types';
150
+ import { computed, ref, watch, nextTick, onMounted, onUnmounted } from "vue";
151
+
152
+ defineOptions({ name: 'FtpAutoComplete' });
153
+
154
+ const props = withDefaults(defineProps<AutoCompleteProps>(), {
155
+ modelValue: null,
156
+ suggestions: () => [],
157
+ optionLabel: "label",
158
+ optionValue: "value",
159
+ placeholder: "",
160
+ multiple: false,
161
+ minLength: 1,
162
+ delay: 300,
163
+ size: "md",
164
+ isDisabled: false,
165
+ isInvalid: false,
166
+ isLoading: false,
167
+ dropdown: false,
168
+ completeOnFocus: false,
169
+ });
170
+
171
+ const emit = defineEmits([
172
+ "update:modelValue",
173
+ "complete",
174
+ "select",
175
+ "unselect",
176
+ "focus",
177
+ "blur",
178
+ "clear",
179
+ ]);
180
+
181
+ const autocompleteId = `autocomplete-${Math.random().toString(36).substring(2, 9)}`;
182
+ const containerRef = ref<HTMLElement | null>(null);
183
+ const inputRef = ref<HTMLInputElement | null>(null);
184
+ const dropdownRef = ref(null);
185
+ const query = ref("");
186
+ const isOpen = ref(false);
187
+ const isFocused = ref(false);
188
+ const highlightedIndex = ref(-1);
189
+ const dropdownStyle = ref({});
190
+ let debounceTimer: ReturnType<typeof setTimeout> | null = null;
191
+
192
+ const selectedItems = computed(() => {
193
+ if (!props.multiple) return [];
194
+ return Array.isArray(props.modelValue) ? props.modelValue : [];
195
+ });
196
+
197
+ const showPlaceholder = computed(() => {
198
+ if (props.multiple) {
199
+ return selectedItems.value.length === 0 && !query.value;
200
+ }
201
+ return !props.modelValue && !query.value;
202
+ });
203
+
204
+ const filteredSuggestions = computed(() => {
205
+ if (props.multiple) {
206
+ return props.suggestions.filter((s) => {
207
+ const value = getOptionValue(s);
208
+ return !selectedItems.value.some((item) => getOptionValue(item) === value);
209
+ });
210
+ }
211
+ return props.suggestions;
212
+ });
213
+
214
+ const getOptionLabel = (option: any) => {
215
+ if (option === null || option === undefined) return "";
216
+ if (typeof option === "string" || typeof option === "number") return option;
217
+ return option[props.optionLabel] || "";
218
+ };
219
+
220
+ const getOptionValue = (option: any) => {
221
+ if (option === null || option === undefined) return option;
222
+ if (typeof option === "string" || typeof option === "number") return option;
223
+ return option[props.optionValue] ?? option;
224
+ };
225
+
226
+ const isSelected = (suggestion: any) => {
227
+ if (props.multiple) {
228
+ return selectedItems.value.some(
229
+ (item) => getOptionValue(item) === getOptionValue(suggestion)
230
+ );
231
+ }
232
+ return getOptionValue(props.modelValue) === getOptionValue(suggestion);
233
+ };
234
+
235
+ const updateDropdownPosition = () => {
236
+ if (!containerRef.value) return;
237
+ const rect = containerRef.value.getBoundingClientRect();
238
+ dropdownStyle.value = {
239
+ position: "fixed",
240
+ top: `${rect.bottom + 4}px`,
241
+ left: `${rect.left}px`,
242
+ width: `${rect.width}px`,
243
+ zIndex: 1000,
244
+ };
245
+ };
246
+
247
+ const openDropdown = () => {
248
+ if (props.isDisabled) return;
249
+ isOpen.value = true;
250
+ highlightedIndex.value = -1;
251
+ nextTick(updateDropdownPosition);
252
+ };
253
+
254
+ const closeDropdown = () => {
255
+ isOpen.value = false;
256
+ highlightedIndex.value = -1;
257
+ };
258
+
259
+ const focusInput = () => {
260
+ inputRef.value?.focus();
261
+ };
262
+
263
+ const onInput = () => {
264
+ if (debounceTimer) clearTimeout(debounceTimer);
265
+
266
+ if (query.value.length >= props.minLength) {
267
+ debounceTimer = setTimeout(() => {
268
+ emit("complete", { query: query.value });
269
+ openDropdown();
270
+ }, props.delay);
271
+ } else {
272
+ closeDropdown();
273
+ }
274
+ };
275
+
276
+ const onFocus = (event: FocusEvent) => {
277
+ isFocused.value = true;
278
+ emit("focus", { originalEvent: event });
279
+
280
+ if (props.completeOnFocus || props.dropdown) {
281
+ emit("complete", { query: query.value });
282
+ openDropdown();
283
+ }
284
+ };
285
+
286
+ const onBlur = (event: FocusEvent) => {
287
+ isFocused.value = false;
288
+ closeDropdown();
289
+ emit("blur", { originalEvent: event });
290
+ };
291
+
292
+ const onKeydown = (event: KeyboardEvent) => {
293
+ switch (event.key) {
294
+ case "ArrowDown":
295
+ event.preventDefault();
296
+ if (!isOpen.value) {
297
+ openDropdown();
298
+ emit("complete", { query: query.value });
299
+ } else if (highlightedIndex.value < filteredSuggestions.value.length - 1) {
300
+ highlightedIndex.value++;
301
+ }
302
+ break;
303
+ case "ArrowUp":
304
+ event.preventDefault();
305
+ if (highlightedIndex.value > 0) {
306
+ highlightedIndex.value--;
307
+ }
308
+ break;
309
+ case "Enter":
310
+ event.preventDefault();
311
+ if (isOpen.value && highlightedIndex.value >= 0) {
312
+ selectSuggestion(filteredSuggestions.value[highlightedIndex.value]);
313
+ }
314
+ break;
315
+ case "Escape":
316
+ closeDropdown();
317
+ break;
318
+ case "Backspace":
319
+ if (props.multiple && !query.value && selectedItems.value.length > 0) {
320
+ removeItem(selectedItems.value.length - 1);
321
+ }
322
+ break;
323
+ }
324
+ };
325
+
326
+ const selectSuggestion = (suggestion: any) => {
327
+ if (props.multiple) {
328
+ const newValue = [...selectedItems.value, suggestion];
329
+ emit("update:modelValue", newValue);
330
+ emit("select", { value: suggestion });
331
+ query.value = "";
332
+ } else {
333
+ emit("update:modelValue", suggestion);
334
+ emit("select", { value: suggestion });
335
+ query.value = getOptionLabel(suggestion);
336
+ closeDropdown();
337
+ }
338
+ };
339
+
340
+ const removeItem = (index: any) => {
341
+ const removed = selectedItems.value[index];
342
+ const newValue = selectedItems.value.filter((_, i) => i !== index);
343
+ emit("update:modelValue", newValue);
344
+ emit("unselect", { value: removed });
345
+ };
346
+
347
+ const clearValue = () => {
348
+ emit("update:modelValue", null);
349
+ emit("clear");
350
+ query.value = "";
351
+ focusInput();
352
+ };
353
+
354
+ // Sync query with single selection
355
+ watch(
356
+ () => props.modelValue,
357
+ (newValue) => {
358
+ if (!props.multiple && newValue && !isFocused.value) {
359
+ query.value = getOptionLabel(newValue);
360
+ }
361
+ },
362
+ { immediate: true }
363
+ );
364
+
365
+ // Handle scroll and resize
366
+ const handleScroll = () => {
367
+ if (isOpen.value) updateDropdownPosition();
368
+ };
369
+
370
+ onMounted(() => {
371
+ window.addEventListener("scroll", handleScroll, true);
372
+ window.addEventListener("resize", handleScroll);
373
+ });
374
+
375
+ onUnmounted(() => {
376
+ window.removeEventListener("scroll", handleScroll, true);
377
+ window.removeEventListener("resize", handleScroll);
378
+ if (debounceTimer) clearTimeout(debounceTimer);
379
+ });
380
+
381
+ const additionalClasses = computed(() =>
382
+ [
383
+ `autocomplete--size-${props.size}`,
384
+ props.multiple && "autocomplete--multiple",
385
+ isFocused.value && "autocomplete--focused",
386
+ props.isDisabled && "autocomplete--disabled",
387
+ props.isInvalid && "autocomplete--invalid",
388
+ ]
389
+ .filter(Boolean)
390
+ .join(" ")
391
+ );
392
+
393
+ defineExpose({
394
+ focus: () => inputRef.value?.focus(),
395
+ blur: () => inputRef.value?.blur(),
396
+ el: inputRef,
397
+ });
398
+ </script>
@@ -0,0 +1,191 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: avatar;
4
+
5
+ .#{$c} {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ background-color: var(--avatar-background-default, $avatar-background-default);
10
+ color: var(--avatar-text-default, $avatar-text-default);
11
+ overflow: hidden;
12
+ user-select: none;
13
+ position: relative;
14
+ }
15
+
16
+ .#{$c}__image {
17
+ width: 100%;
18
+ height: 100%;
19
+ object-fit: cover;
20
+ }
21
+
22
+ .#{$c}__label {
23
+ text-transform: uppercase;
24
+ font-weight: 500;
25
+ }
26
+
27
+ .#{$c}__icon {
28
+ display: block;
29
+ color: inherit;
30
+ }
31
+
32
+ // Status indicator
33
+ .#{$c}::after {
34
+ content: '';
35
+ position: absolute;
36
+ bottom: 0;
37
+ right: 0;
38
+ width: var(--avatar-status-size-md, $avatar-status-size-md);
39
+ height: var(--avatar-status-size-md, $avatar-status-size-md);
40
+ border-radius: 50%;
41
+ border: 2px solid white;
42
+ display: none;
43
+ }
44
+
45
+ .#{$c}--status-online::after {
46
+ display: block;
47
+ background-color: var(--avatar-status-online, $avatar-status-online);
48
+ }
49
+
50
+ .#{$c}--status-offline::after {
51
+ display: block;
52
+ background-color: var(--avatar-status-offline, $avatar-status-offline);
53
+ }
54
+
55
+ .#{$c}--status-busy::after {
56
+ display: block;
57
+ background-color: var(--avatar-status-busy, $avatar-status-busy);
58
+ }
59
+
60
+ .#{$c}--status-away::after {
61
+ display: block;
62
+ background-color: var(--avatar-status-away, $avatar-status-away);
63
+ }
64
+
65
+ // Sizes
66
+ .#{$c}--size-xs {
67
+ width: var(--avatar-size-xs, $avatar-size-xs);
68
+ height: var(--avatar-size-xs, $avatar-size-xs);
69
+
70
+ .#{$c}__label {
71
+ font-size: var(--avatar-fontSize-xs, $avatar-fontSize-xs);
72
+ }
73
+
74
+ .#{$c}__icon {
75
+ font-size: var(--avatar-iconSize-xs, $avatar-iconSize-xs);
76
+ }
77
+ }
78
+
79
+ .#{$c}--size-sm,
80
+ .#{$c}--size-small {
81
+ width: var(--avatar-size-sm, $avatar-size-sm);
82
+ height: var(--avatar-size-sm, $avatar-size-sm);
83
+
84
+ .#{$c}__label {
85
+ font-size: var(--avatar-fontSize-sm, $avatar-fontSize-sm);
86
+ }
87
+
88
+ .#{$c}__icon {
89
+ font-size: var(--avatar-iconSize-sm, $avatar-iconSize-sm);
90
+ }
91
+ }
92
+
93
+ .#{$c}--size-md,
94
+ .#{$c}--size-medium {
95
+ width: var(--avatar-size-md, $avatar-size-md);
96
+ height: var(--avatar-size-md, $avatar-size-md);
97
+
98
+ .#{$c}__label {
99
+ font-size: var(--avatar-fontSize-md, $avatar-fontSize-md);
100
+ }
101
+
102
+ .#{$c}__icon {
103
+ font-size: var(--avatar-iconSize-md, $avatar-iconSize-md);
104
+ }
105
+ }
106
+
107
+ .#{$c}--size-lg,
108
+ .#{$c}--size-large {
109
+ width: var(--avatar-size-lg, $avatar-size-lg);
110
+ height: var(--avatar-size-lg, $avatar-size-lg);
111
+
112
+ .#{$c}__label {
113
+ font-size: var(--avatar-fontSize-lg, $avatar-fontSize-lg);
114
+ }
115
+
116
+ .#{$c}__icon {
117
+ font-size: var(--avatar-iconSize-lg, $avatar-iconSize-lg);
118
+ }
119
+ }
120
+
121
+ .#{$c}--size-xl,
122
+ .#{$c}--size-xlarge {
123
+ width: var(--avatar-size-xl, $avatar-size-xl);
124
+ height: var(--avatar-size-xl, $avatar-size-xl);
125
+
126
+ .#{$c}__label {
127
+ font-size: var(--avatar-fontSize-xl, $avatar-fontSize-xl);
128
+ }
129
+
130
+ .#{$c}__icon {
131
+ font-size: var(--avatar-iconSize-xl, $avatar-iconSize-xl);
132
+ }
133
+ }
134
+
135
+ .#{$c}--size-2xl {
136
+ width: var(--avatar-size-2xl, $avatar-size-2xl);
137
+ height: var(--avatar-size-2xl, $avatar-size-2xl);
138
+
139
+ .#{$c}__label {
140
+ font-size: var(--avatar-fontSize-2xl, $avatar-fontSize-2xl);
141
+ }
142
+
143
+ .#{$c}__icon {
144
+ font-size: var(--avatar-iconSize-2xl, $avatar-iconSize-2xl);
145
+ }
146
+ }
147
+
148
+ // Shapes
149
+ .#{$c}--shape-square {
150
+ border-radius: var(--avatar-radius-square, $avatar-radius-square);
151
+ }
152
+
153
+ .#{$c}--shape-circle {
154
+ border-radius: var(--avatar-radius-circle, $avatar-radius-circle);
155
+ }
156
+
157
+ // Color variants
158
+ .#{$c}--variant-default {
159
+ background-color: var(--avatar-background-default, $avatar-background-default);
160
+ color: var(--avatar-text-default, $avatar-text-default);
161
+ }
162
+
163
+ .#{$c}--variant-muted {
164
+ background-color: var(--avatar-background-muted, $avatar-background-muted);
165
+ color: var(--avatar-text-default, $avatar-text-default);
166
+ }
167
+
168
+ .#{$c}--variant-brand {
169
+ background-color: var(--avatar-background-brand, $avatar-background-brand);
170
+ color: var(--avatar-text-inverse, $avatar-text-inverse);
171
+ }
172
+
173
+ .#{$c}--variant-accent {
174
+ background-color: var(--avatar-background-accent, $avatar-background-accent);
175
+ color: var(--avatar-text-default, $avatar-text-default);
176
+ }
177
+
178
+ .#{$c}--variant-success {
179
+ background-color: var(--avatar-background-success, $avatar-background-success);
180
+ color: var(--avatar-text-inverse, $avatar-text-inverse);
181
+ }
182
+
183
+ .#{$c}--variant-warning {
184
+ background-color: var(--avatar-background-warning, $avatar-background-warning);
185
+ color: var(--avatar-text-default, $avatar-text-default);
186
+ }
187
+
188
+ .#{$c}--variant-error {
189
+ background-color: var(--avatar-background-error, $avatar-background-error);
190
+ color: var(--avatar-text-inverse, $avatar-text-inverse);
191
+ }
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div class="avatar" :class="additionalClasses" role="img" :aria-label="ariaLabel || label || 'Avatar'">
3
+ <img
4
+ v-if="image && !imageError"
5
+ :src="image"
6
+ :alt="ariaLabel || label || 'avatar'"
7
+ class="avatar__image"
8
+ @error="onImageError"
9
+ />
10
+ <span v-else-if="label" class="avatar__label">{{ label }}</span>
11
+ <i v-else-if="icon" :class="icon" class="avatar__icon"></i>
12
+ <slot v-else />
13
+ </div>
14
+ </template>
15
+
16
+ <style src="./Avatar.scss"></style>
17
+
18
+ <script setup lang="ts">
19
+ import type { AvatarProps, AvatarEmits } from '../../types';
20
+ import { computed, ref } from "vue";
21
+
22
+ defineOptions({ name: 'FtpAvatar' });
23
+
24
+ const props = withDefaults(defineProps<AvatarProps>(), {
25
+ size: "medium",
26
+ shape: "square",
27
+ });
28
+
29
+ const emit = defineEmits(["error"]);
30
+
31
+ const imageError = ref(false);
32
+
33
+ const onImageError = (event: Event) => {
34
+ imageError.value = true;
35
+ emit("error", event);
36
+ };
37
+
38
+ const additionalClasses = computed(() =>
39
+ [
40
+ `avatar--size-${props.size}`,
41
+ `avatar--shape-${props.shape}`,
42
+ ].join(" ")
43
+ );
44
+ </script>
@@ -0,0 +1,84 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+ @use "../../scss/mixins/accent-gradient.scss" as *;
3
+
4
+ $c: badge;
5
+
6
+ .#{$c} {
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ font-weight: var(--badge-fontWeight, $badge-fontWeight);
11
+ border-radius: var(--badge-radius, $badge-radius);
12
+ white-space: nowrap;
13
+ vertical-align: baseline;
14
+ line-height: 1;
15
+ }
16
+
17
+ // Sizes
18
+ .#{$c}--size-sm {
19
+ min-height: var(--badge-size-sm, $badge-size-sm);
20
+ min-width: var(--badge-size-sm, $badge-size-sm);
21
+ padding: 0 var(--badge-padding-sm, $badge-padding-sm);
22
+ font-size: var(--badge-fontSize-sm, $badge-fontSize-sm);
23
+ }
24
+
25
+ .#{$c}--size-md {
26
+ min-height: var(--badge-size-md, $badge-size-md);
27
+ min-width: var(--badge-size-md, $badge-size-md);
28
+ padding: 0 var(--badge-padding-md, $badge-padding-md);
29
+ font-size: var(--badge-fontSize-md, $badge-fontSize-md);
30
+ }
31
+
32
+ .#{$c}--size-lg {
33
+ min-height: var(--badge-size-lg, $badge-size-lg);
34
+ min-width: var(--badge-size-lg, $badge-size-lg);
35
+ padding: 0 var(--badge-padding-lg, $badge-padding-lg);
36
+ font-size: var(--badge-fontSize-lg, $badge-fontSize-lg);
37
+ }
38
+
39
+ // Circle modifier for single characters
40
+ .#{$c}--circle {
41
+ padding: 0;
42
+
43
+ &.#{$c}--size-sm {
44
+ width: var(--badge-size-sm, $badge-size-sm);
45
+ height: var(--badge-size-sm, $badge-size-sm);
46
+ }
47
+
48
+ &.#{$c}--size-md {
49
+ width: var(--badge-size-md, $badge-size-md);
50
+ height: var(--badge-size-md, $badge-size-md);
51
+ }
52
+
53
+ &.#{$c}--size-lg {
54
+ width: var(--badge-size-lg, $badge-size-lg);
55
+ height: var(--badge-size-lg, $badge-size-lg);
56
+ }
57
+ }
58
+
59
+ // Severities
60
+ .#{$c}--severity-primary {
61
+ @include accent-gradient();
62
+ color: var(--badge-text-primary, $badge-text-primary);
63
+ text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
64
+ }
65
+
66
+ .#{$c}--severity-success {
67
+ background-color: var(--badge-background-success, $badge-background-success);
68
+ color: var(--badge-text-success, $badge-text-success);
69
+ }
70
+
71
+ .#{$c}--severity-warning {
72
+ background-color: var(--badge-background-warning, $badge-background-warning);
73
+ color: var(--badge-text-warning, $badge-text-warning);
74
+ }
75
+
76
+ .#{$c}--severity-danger {
77
+ background-color: var(--badge-background-danger, $badge-background-danger);
78
+ color: var(--badge-text-danger, $badge-text-danger);
79
+ }
80
+
81
+ .#{$c}--severity-info {
82
+ background-color: var(--badge-background-info, $badge-background-info);
83
+ color: var(--badge-text-info, $badge-text-info);
84
+ }