@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,57 @@
1
+ <template>
2
+ <section
3
+ class="hero"
4
+ :class="additionalClasses"
5
+ :style="backgroundStyles"
6
+ :aria-labelledby="title ? heroTitleId : undefined"
7
+ >
8
+ <div v-if="overlay" class="hero__overlay" />
9
+ <div class="hero__container">
10
+ <div class="hero__content">
11
+ <h1 v-if="title" :id="heroTitleId" class="hero__title">{{ title }}</h1>
12
+ <p v-if="subtitle" class="hero__subtitle">{{ subtitle }}</p>
13
+ <div v-if="$slots.default" class="hero__body">
14
+ <slot />
15
+ </div>
16
+ <div v-if="$slots.actions" class="hero__actions">
17
+ <slot name="actions" />
18
+ </div>
19
+ </div>
20
+ <div v-if="$slots.media" class="hero__media">
21
+ <slot name="media" />
22
+ </div>
23
+ </div>
24
+ </section>
25
+ </template>
26
+
27
+ <style src="./Hero.scss"></style>
28
+
29
+ <script setup lang="ts">
30
+ import type { HeroProps } from '../../types';
31
+ import { computed } from 'vue';
32
+
33
+ defineOptions({ name: 'FtpHero' });
34
+
35
+ const heroTitleId = `hero-title-${Math.random().toString(36).substring(2, 9)}`;
36
+
37
+ const props = withDefaults(defineProps<HeroProps>(), {
38
+ alignment: 'center',
39
+ overlay: false,
40
+ fullHeight: false,
41
+ });
42
+
43
+ const additionalClasses = computed(() =>
44
+ [
45
+ `hero--align-${props.alignment}`,
46
+ props.fullHeight && 'hero--full-height',
47
+ props.backgroundImage && 'hero--has-bg',
48
+ ]
49
+ .filter(Boolean)
50
+ .join(' ')
51
+ );
52
+
53
+ const backgroundStyles = computed(() => {
54
+ if (!props.backgroundImage) return {};
55
+ return { backgroundImage: `url(${props.backgroundImage})` };
56
+ });
57
+ </script>
@@ -0,0 +1,129 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: image;
4
+
5
+ .#{$c} {
6
+ display: inline-block;
7
+ position: relative;
8
+ line-height: 0;
9
+ }
10
+
11
+ .#{$c}__img {
12
+ display: block;
13
+ max-width: 100%;
14
+ height: auto;
15
+ border-radius: var(--image-radius, $image-radius);
16
+ transition: opacity var(--image-transition-duration, $image-transition-duration) ease;
17
+ }
18
+
19
+ // Preview enabled state
20
+ .#{$c}--preview {
21
+ cursor: pointer;
22
+
23
+ .#{$c}__img {
24
+ transition: transform var(--image-transition-duration, $image-transition-duration) ease,
25
+ opacity var(--image-transition-duration, $image-transition-duration) ease;
26
+ }
27
+
28
+ &:hover {
29
+ .#{$c}__img {
30
+ transform: scale(1.02);
31
+ }
32
+
33
+ .#{$c}__preview-indicator {
34
+ opacity: 1;
35
+ }
36
+ }
37
+ }
38
+
39
+ .#{$c}__preview-indicator {
40
+ position: absolute;
41
+ top: 50%;
42
+ left: 50%;
43
+ transform: translate(-50%, -50%);
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ width: calc(var(--image-preview-icon-size, $image-preview-icon-size) * 2);
48
+ height: calc(var(--image-preview-icon-size, $image-preview-icon-size) * 2);
49
+ background: var(--image-preview-icon-background, $image-preview-icon-background);
50
+ border-radius: 50%;
51
+ opacity: 0;
52
+ transition: opacity var(--image-transition-duration, $image-transition-duration) ease;
53
+ pointer-events: none;
54
+
55
+ svg {
56
+ width: var(--image-preview-icon-size, $image-preview-icon-size);
57
+ height: var(--image-preview-icon-size, $image-preview-icon-size);
58
+ color: var(--image-preview-icon-color, $image-preview-icon-color);
59
+ }
60
+ }
61
+
62
+ // Overlay for preview lightbox
63
+ .#{$c}__overlay {
64
+ position: fixed;
65
+ inset: 0;
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ background: var(--image-preview-overlay-background, $image-preview-overlay-background);
70
+ z-index: var(--image-preview-overlay-zIndex, $image-preview-overlay-zIndex);
71
+ padding: 40px;
72
+ }
73
+
74
+ .#{$c}__preview-img {
75
+ max-width: 100%;
76
+ max-height: 100%;
77
+ object-fit: contain;
78
+ border-radius: var(--image-radius, $image-radius);
79
+ }
80
+
81
+ .#{$c}__close {
82
+ position: absolute;
83
+ top: 16px;
84
+ right: 16px;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ width: var(--image-preview-closeButton-size, $image-preview-closeButton-size);
89
+ height: var(--image-preview-closeButton-size, $image-preview-closeButton-size);
90
+ padding: 0;
91
+ border: none;
92
+ background: transparent;
93
+ border-radius: 50%;
94
+ color: var(--image-preview-closeButton-color, $image-preview-closeButton-color);
95
+ cursor: pointer;
96
+ transition: background-color 0.15s ease;
97
+
98
+ &:hover {
99
+ background: var(--image-preview-closeButton-hoverBackground, $image-preview-closeButton-hoverBackground);
100
+ }
101
+
102
+ &:focus-visible {
103
+ outline: 2px solid currentColor;
104
+ outline-offset: 2px;
105
+ }
106
+
107
+ svg {
108
+ width: 24px;
109
+ height: 24px;
110
+ }
111
+ }
112
+
113
+ // Error state
114
+ .#{$c}--error {
115
+ .#{$c}__img {
116
+ opacity: 0.5;
117
+ }
118
+ }
119
+
120
+ // Transition animations
121
+ .image-preview-enter-active,
122
+ .image-preview-leave-active {
123
+ transition: opacity 0.2s ease;
124
+ }
125
+
126
+ .image-preview-enter-from,
127
+ .image-preview-leave-to {
128
+ opacity: 0;
129
+ }
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <span class="image" :class="additionalClasses">
3
+ <img
4
+ :src="src"
5
+ :alt="alt"
6
+ :width="width"
7
+ :height="height"
8
+ class="image__img"
9
+ @click="onImageClick"
10
+ @load="onLoad"
11
+ @error="onError"
12
+ />
13
+ <span v-if="preview" class="image__preview-indicator">
14
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
15
+ <path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" fill="currentColor"/>
16
+ <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z" fill="currentColor"/>
17
+ </svg>
18
+ </span>
19
+
20
+ <!-- Preview lightbox -->
21
+ <Teleport to="body">
22
+ <Transition name="image-preview">
23
+ <div
24
+ v-if="previewVisible"
25
+ class="image__overlay"
26
+ @click="closePreview"
27
+ @keydown.escape="closePreview"
28
+ >
29
+ <button
30
+ type="button"
31
+ class="image__close"
32
+ aria-label="Close preview"
33
+ @click.stop="closePreview"
34
+ >
35
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
36
+ <line x1="18" y1="6" x2="6" y2="18" />
37
+ <line x1="6" y1="6" x2="18" y2="18" />
38
+ </svg>
39
+ </button>
40
+ <img
41
+ :src="src"
42
+ :alt="alt"
43
+ class="image__preview-img"
44
+ @click.stop
45
+ />
46
+ </div>
47
+ </Transition>
48
+ </Teleport>
49
+ </span>
50
+ </template>
51
+
52
+ <style src="./Image.scss"></style>
53
+
54
+ <script setup lang="ts">
55
+ import type { ImageProps, ImageEmits } from '../../types';
56
+ import { computed, ref, watch, onUnmounted } from "vue";
57
+
58
+ defineOptions({ name: 'FtpImage' });
59
+
60
+ const props = withDefaults(defineProps<ImageProps>(), {
61
+ alt: "",
62
+ width: undefined,
63
+ height: undefined,
64
+ preview: false,
65
+ });
66
+
67
+ const emit = defineEmits(["show", "hide", "error", "load"]);
68
+
69
+ const previewVisible = ref(false);
70
+ const hasError = ref(false);
71
+ const isLoaded = ref(false);
72
+
73
+ const additionalClasses = computed(() =>
74
+ [
75
+ props.preview && "image--preview",
76
+ hasError.value && "image--error",
77
+ isLoaded.value && "image--loaded",
78
+ ]
79
+ .filter(Boolean)
80
+ .join(" ")
81
+ );
82
+
83
+ const onImageClick = () => {
84
+ if (props.preview) {
85
+ openPreview();
86
+ }
87
+ };
88
+
89
+ const openPreview = () => {
90
+ previewVisible.value = true;
91
+ document.body.style.overflow = "hidden";
92
+ emit("show");
93
+ };
94
+
95
+ const closePreview = () => {
96
+ previewVisible.value = false;
97
+ document.body.style.overflow = "";
98
+ emit("hide");
99
+ };
100
+
101
+ const onLoad = (event: Event) => {
102
+ isLoaded.value = true;
103
+ emit("load", event);
104
+ };
105
+
106
+ const onError = (event: Event) => {
107
+ hasError.value = true;
108
+ emit("error", event);
109
+ };
110
+
111
+ // Cleanup on unmount
112
+ onUnmounted(() => {
113
+ if (previewVisible.value) {
114
+ document.body.style.overflow = "";
115
+ }
116
+ });
117
+ </script>
@@ -0,0 +1,97 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: image-compare;
4
+
5
+ .#{$c} {
6
+ position: relative;
7
+ overflow: hidden;
8
+ border-radius: var(--image-compare-border-radius, $image-compare-border-radius);
9
+ border: var(--image-compare-border-width, $image-compare-border-width) solid var(--image-compare-border-color, $image-compare-border-color);
10
+ background-color: var(--image-compare-background, $image-compare-background);
11
+ user-select: none;
12
+ }
13
+
14
+ .#{$c}__before,
15
+ .#{$c}__after {
16
+ position: absolute;
17
+ inset: 0;
18
+ overflow: hidden;
19
+
20
+ img,
21
+ picture,
22
+ video {
23
+ width: 100%;
24
+ height: 100%;
25
+ object-fit: cover;
26
+ display: block;
27
+ }
28
+ }
29
+
30
+ .#{$c}__after {
31
+ z-index: 1;
32
+ }
33
+
34
+ .#{$c}__before {
35
+ z-index: 2;
36
+ }
37
+
38
+ .#{$c}__handle {
39
+ position: absolute;
40
+ top: 0;
41
+ bottom: 0;
42
+ z-index: 3;
43
+ transform: translateX(-50%);
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ pointer-events: none;
48
+ }
49
+
50
+ .#{$c}__handle-line {
51
+ position: absolute;
52
+ top: 0;
53
+ bottom: 0;
54
+ width: var(--image-compare-handle-width, $image-compare-handle-width);
55
+ background-color: var(--image-compare-handle-color-default, $image-compare-handle-color-default);
56
+ box-shadow: var(--image-compare-handle-shadow, $image-compare-handle-shadow);
57
+ transition: background-color var(--image-compare-transition-duration, $image-compare-transition-duration) ease;
58
+ }
59
+
60
+ .#{$c}__handle-icon {
61
+ position: relative;
62
+ width: var(--image-compare-icon-size, $image-compare-icon-size);
63
+ height: var(--image-compare-icon-size, $image-compare-icon-size);
64
+ border-radius: 9999px;
65
+ background-color: var(--image-compare-icon-background, $image-compare-icon-background);
66
+ color: var(--image-compare-icon-color, $image-compare-icon-color);
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ box-shadow: var(--image-compare-handle-shadow, $image-compare-handle-shadow);
71
+ transition: transform var(--image-compare-transition-duration, $image-compare-transition-duration) ease;
72
+ }
73
+
74
+ .#{$c}__slider {
75
+ position: absolute;
76
+ inset: 0;
77
+ width: 100%;
78
+ height: 100%;
79
+ margin: 0;
80
+ opacity: 0;
81
+ cursor: ew-resize;
82
+ z-index: 4;
83
+
84
+ &:focus-visible + .#{$c}__handle .#{$c}__handle-line {
85
+ background-color: var(--image-compare-handle-color-hover, $image-compare-handle-color-hover);
86
+ }
87
+ }
88
+
89
+ .#{$c}:hover {
90
+ .#{$c}__handle-line {
91
+ background-color: var(--image-compare-handle-color-hover, $image-compare-handle-color-hover);
92
+ }
93
+
94
+ .#{$c}__handle-icon {
95
+ transform: scale(1.1);
96
+ }
97
+ }
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div
3
+ class="image-compare"
4
+ :class="additionalClasses"
5
+ :aria-label="ariaLabel"
6
+ :aria-labelledby="ariaLabelledBy"
7
+ >
8
+ <div class="image-compare__before" :style="beforeStyle">
9
+ <slot name="before" />
10
+ </div>
11
+ <div class="image-compare__after">
12
+ <slot name="after" />
13
+ </div>
14
+ <div class="image-compare__handle" :style="handleStyle">
15
+ <div class="image-compare__handle-line"></div>
16
+ <div class="image-compare__handle-icon">
17
+ <svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
18
+ <path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/>
19
+ <path d="M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" transform="rotate(180 12 12)"/>
20
+ </svg>
21
+ </div>
22
+ </div>
23
+ <input
24
+ type="range"
25
+ class="image-compare__slider"
26
+ min="0"
27
+ max="100"
28
+ :value="position"
29
+ @input="onSlide"
30
+ />
31
+ </div>
32
+ </template>
33
+
34
+ <style src="./ImageCompare.scss"></style>
35
+
36
+ <script setup lang="ts">
37
+ import type { ImageCompareProps, ImageCompareEmits } from '../../types';
38
+ import { ref, computed } from "vue";
39
+
40
+ defineOptions({ name: 'FtpImageCompare' });
41
+
42
+ const props = withDefaults(defineProps<ImageCompareProps>(), {
43
+ initialPosition: 50,
44
+ ariaLabel: "Image comparison slider",
45
+ ariaLabelledBy: undefined,
46
+ });
47
+
48
+ const emit = defineEmits(["change"]);
49
+
50
+ const position = ref(props.initialPosition);
51
+
52
+ const onSlide = (event: Event) => {
53
+ position.value = Number((event.target as HTMLInputElement).value);
54
+ emit("change", position.value);
55
+ };
56
+
57
+ const beforeStyle = computed(() => ({
58
+ clipPath: `inset(0 ${100 - position.value}% 0 0)`
59
+ }));
60
+
61
+ const handleStyle = computed(() => ({
62
+ left: `${position.value}%`
63
+ }));
64
+
65
+ const additionalClasses = computed(() => [].filter(Boolean).join(" "));
66
+ </script>
@@ -0,0 +1,97 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: in-place;
4
+
5
+ .#{$c} {
6
+ display: inline-block;
7
+ }
8
+
9
+ // Display mode
10
+ .#{$c}__display {
11
+ display: inline-flex;
12
+ align-items: center;
13
+ padding: var(--in-place-display-paddingY, $in-place-display-paddingY) var(--in-place-display-paddingX, $in-place-display-paddingX);
14
+ background-color: var(--in-place-display-background-default, $in-place-display-background-default);
15
+ color: var(--in-place-display-color-default, $in-place-display-color-default);
16
+ border-radius: var(--in-place-display-border-radius, $in-place-display-border-radius);
17
+ cursor: pointer;
18
+ transition: background-color var(--in-place-transition-duration, $in-place-transition-duration) ease,
19
+ color var(--in-place-transition-duration, $in-place-transition-duration) ease;
20
+
21
+ &:hover {
22
+ background-color: var(--in-place-display-background-hover, $in-place-display-background-hover);
23
+ color: var(--in-place-display-color-hover, $in-place-display-color-hover);
24
+ }
25
+
26
+ &:focus-visible {
27
+ outline: 2px solid var(--focus-ring, $focus-ring);
28
+ outline-offset: 2px;
29
+ }
30
+
31
+ &[data-disabled] {
32
+ cursor: not-allowed;
33
+ color: var(--in-place-display-color-disabled, $in-place-display-color-disabled);
34
+
35
+ &:hover {
36
+ background-color: var(--in-place-display-background-default, $in-place-display-background-default);
37
+ }
38
+ }
39
+ }
40
+
41
+ .#{$c}__display-text {
42
+ opacity: 0.7;
43
+ font-style: italic;
44
+ }
45
+
46
+ // Content mode
47
+ .#{$c}__content {
48
+ display: inline-flex;
49
+ align-items: center;
50
+ gap: var(--in-place-closeButton-gap, $in-place-closeButton-gap);
51
+ }
52
+
53
+ // Close button
54
+ .#{$c}__close {
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ width: var(--in-place-closeButton-size, $in-place-closeButton-size);
59
+ height: var(--in-place-closeButton-size, $in-place-closeButton-size);
60
+ padding: 0;
61
+ margin: 0;
62
+ border: none;
63
+ background: transparent;
64
+ border-radius: var(--in-place-closeButton-radius, $in-place-closeButton-radius);
65
+ color: var(--in-place-closeButton-color-default, $in-place-closeButton-color-default);
66
+ cursor: pointer;
67
+ transition: background-color var(--in-place-transition-duration, $in-place-transition-duration) ease,
68
+ color var(--in-place-transition-duration, $in-place-transition-duration) ease;
69
+ flex-shrink: 0;
70
+
71
+ &:hover {
72
+ background-color: var(--in-place-closeButton-background-hover, $in-place-closeButton-background-hover);
73
+ color: var(--in-place-closeButton-color-hover, $in-place-closeButton-color-hover);
74
+ }
75
+
76
+ &:focus-visible {
77
+ outline: 2px solid var(--focus-ring, $focus-ring);
78
+ outline-offset: 2px;
79
+ }
80
+ }
81
+
82
+ .#{$c}__close-icon {
83
+ width: var(--in-place-closeButton-iconSize, $in-place-closeButton-iconSize);
84
+ height: var(--in-place-closeButton-iconSize, $in-place-closeButton-iconSize);
85
+ }
86
+
87
+ // Disabled state
88
+ .#{$c}--disabled {
89
+ .#{$c}__display {
90
+ cursor: not-allowed;
91
+ color: var(--in-place-display-color-disabled, $in-place-display-color-disabled);
92
+
93
+ &:hover {
94
+ background-color: var(--in-place-display-background-default, $in-place-display-background-default);
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <div
3
+ class="in-place"
4
+ :class="additionalClasses"
5
+ aria-live="polite"
6
+ >
7
+ <!-- Display mode -->
8
+ <div
9
+ v-if="!isActive"
10
+ class="in-place__display"
11
+ role="button"
12
+ :tabindex="disabled ? -1 : 0"
13
+ :data-disabled="disabled || undefined"
14
+ @click="onDisplayClick"
15
+ @keydown.enter="onDisplayClick"
16
+ >
17
+ <slot name="display">
18
+ <span class="in-place__display-text">Click to edit</span>
19
+ </slot>
20
+ </div>
21
+
22
+ <!-- Content mode -->
23
+ <div
24
+ v-else
25
+ class="in-place__content"
26
+ >
27
+ <slot name="content" :close="close">
28
+ <slot></slot>
29
+ </slot>
30
+ <button
31
+ v-if="closable"
32
+ type="button"
33
+ class="in-place__close"
34
+ aria-label="Close"
35
+ @click="close"
36
+ >
37
+ <svg
38
+ class="in-place__close-icon"
39
+ viewBox="0 0 24 24"
40
+ fill="none"
41
+ stroke="currentColor"
42
+ stroke-width="2"
43
+ stroke-linecap="round"
44
+ stroke-linejoin="round"
45
+ >
46
+ <line x1="18" y1="6" x2="6" y2="18" />
47
+ <line x1="6" y1="6" x2="18" y2="18" />
48
+ </svg>
49
+ </button>
50
+ </div>
51
+ </div>
52
+ </template>
53
+
54
+ <style src="./InPlace.scss"></style>
55
+
56
+ <script setup lang="ts">
57
+ import type { InPlaceProps, InPlaceEmits } from '../../types';
58
+ import { computed, ref, watch, nextTick } from "vue";
59
+
60
+ defineOptions({ name: 'FtpInPlace' });
61
+
62
+ const props = withDefaults(defineProps<InPlaceProps>(), {
63
+ active: false,
64
+ disabled: false,
65
+ closable: true,
66
+ });
67
+
68
+ const emit = defineEmits(["update:active", "open", "close"]);
69
+
70
+ const displayRef = ref(null);
71
+
72
+ // Internal active state that syncs with prop
73
+ const isActive = computed({
74
+ get: () => props.active,
75
+ set: (value) => emit("update:active", value),
76
+ });
77
+
78
+ const additionalClasses = computed(() => [
79
+ isActive.value && "in-place--active",
80
+ props.disabled && "in-place--disabled",
81
+ ].filter(Boolean).join(" "));
82
+
83
+ const onDisplayClick = () => {
84
+ if (props.disabled) return;
85
+
86
+ isActive.value = true;
87
+ emit("open");
88
+ };
89
+
90
+ const close = () => {
91
+ isActive.value = false;
92
+ emit("close");
93
+
94
+ // Return focus to display element after closing
95
+ nextTick(() => {
96
+ const displayElement = document.querySelector(".in-place__display");
97
+ if (displayElement) {
98
+ (displayElement as HTMLElement).focus();
99
+ }
100
+ });
101
+ };
102
+
103
+ // Expose close method for parent components
104
+ defineExpose({
105
+ close,
106
+ });
107
+ </script>