@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,65 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: input-mask;
4
+
5
+ .#{$c} {
6
+ display: block;
7
+ width: 100%;
8
+ appearance: none;
9
+ background-color: var(--input-mask-background-default, $input-mask-background-default);
10
+ border: var(--input-mask-border-width, $input-mask-border-width) solid var(--input-mask-border-color-default, $input-mask-border-color-default);
11
+ border-radius: var(--input-mask-radius, $input-mask-radius);
12
+ padding: 0 var(--input-mask-padding-x, $input-mask-padding-x);
13
+ color: var(--input-mask-text-default, $input-mask-text-default);
14
+ font-family: monospace;
15
+ letter-spacing: 0.05em;
16
+ transition: all 0.15s ease;
17
+
18
+ &::placeholder {
19
+ color: var(--input-mask-text-placeholder, $input-mask-text-placeholder);
20
+ font-family: inherit;
21
+ letter-spacing: normal;
22
+ }
23
+
24
+ &:hover:not(:disabled) {
25
+ border-color: var(--input-mask-border-color-hover, $input-mask-border-color-hover);
26
+ }
27
+
28
+ &:focus {
29
+ outline: var(--input-mask-focus-ringWidth, $input-mask-focus-ringWidth) solid var(--input-mask-focus-ringColor, $input-mask-focus-ringColor);
30
+ outline-offset: var(--input-mask-focus-ringOffset, $input-mask-focus-ringOffset);
31
+ border-color: var(--input-mask-border-color-focus, $input-mask-border-color-focus);
32
+ }
33
+
34
+ &:disabled {
35
+ cursor: not-allowed;
36
+ background-color: var(--input-mask-background-disabled, $input-mask-background-disabled);
37
+ border-color: var(--input-mask-border-color-disabled, $input-mask-border-color-disabled);
38
+ color: var(--input-mask-text-disabled, $input-mask-text-disabled);
39
+ }
40
+ }
41
+
42
+ // Invalid state
43
+ .#{$c}--invalid {
44
+ border-color: var(--input-mask-border-color-error, $input-mask-border-color-error);
45
+
46
+ &:focus {
47
+ border-color: var(--input-mask-border-color-error, $input-mask-border-color-error);
48
+ }
49
+ }
50
+
51
+ // Sizes
52
+ .#{$c}--size-sm {
53
+ height: var(--input-mask-height-sm, $input-mask-height-sm);
54
+ font-size: var(--input-mask-fontSize-sm, $input-mask-fontSize-sm);
55
+ }
56
+
57
+ .#{$c}--size-md {
58
+ height: var(--input-mask-height-md, $input-mask-height-md);
59
+ font-size: var(--input-mask-fontSize-md, $input-mask-fontSize-md);
60
+ }
61
+
62
+ .#{$c}--size-lg {
63
+ height: var(--input-mask-height-lg, $input-mask-height-lg);
64
+ font-size: var(--input-mask-fontSize-lg, $input-mask-fontSize-lg);
65
+ }
@@ -0,0 +1,268 @@
1
+ <template>
2
+ <input
3
+ ref="inputRef"
4
+ class="input-mask"
5
+ :class="additionalClasses"
6
+ type="text"
7
+ :value="displayValue"
8
+ :placeholder="placeholder"
9
+ :disabled="isDisabled"
10
+ :name="name"
11
+ :aria-invalid="isInvalid || undefined"
12
+ @input="onInput"
13
+ @keydown="onKeydown"
14
+ @focus="onFocus"
15
+ @blur="onBlur"
16
+ />
17
+ </template>
18
+
19
+ <style src="./InputMask.scss"></style>
20
+
21
+ <script setup lang="ts">
22
+ import type { InputMaskProps, InputMaskEmits } from '../../types';
23
+ import { computed, ref, watch, onMounted } from "vue";
24
+
25
+ defineOptions({ name: 'FtpInputMask' });
26
+
27
+ const props = withDefaults(defineProps<InputMaskProps>(), {
28
+ modelValue: "",
29
+ slotChar: "_",
30
+ autoClear: true,
31
+ size: "md",
32
+ isDisabled: false,
33
+ isInvalid: false,
34
+ });
35
+
36
+ const emit = defineEmits(["update:modelValue", "complete", "focus", "blur"]);
37
+
38
+ const inputRef = ref<HTMLInputElement | null>(null);
39
+ const buffer = ref<string[]>([]);
40
+ const focusPosition = ref(0);
41
+
42
+ // Mask definitions: 9 = digit, a = letter, * = alphanumeric
43
+ const maskDefinitions: Record<string, RegExp> = {
44
+ "9": /\d/,
45
+ "a": /[a-zA-Z]/,
46
+ "*": /[a-zA-Z0-9]/,
47
+ };
48
+
49
+ const getMaskArray = () => props.mask.split("");
50
+
51
+ const isEditablePosition = (pos: any) => {
52
+ const maskArray = getMaskArray();
53
+ if (pos < 0 || pos >= maskArray.length) return false;
54
+ return Object.keys(maskDefinitions).includes(maskArray[pos]);
55
+ };
56
+
57
+ const getNextEditablePosition = (pos: any) => {
58
+ const maskArray = getMaskArray();
59
+ for (let i = pos; i < maskArray.length; i++) {
60
+ if (isEditablePosition(i)) return i;
61
+ }
62
+ return -1;
63
+ };
64
+
65
+ const getPrevEditablePosition = (pos: any) => {
66
+ for (let i = pos - 1; i >= 0; i--) {
67
+ if (isEditablePosition(i)) return i;
68
+ }
69
+ return -1;
70
+ };
71
+
72
+ const getFirstEditablePosition = () => getNextEditablePosition(0);
73
+
74
+ const initBuffer = () => {
75
+ const maskArray = getMaskArray();
76
+ buffer.value = maskArray.map((char, index) => {
77
+ if (isEditablePosition(index)) {
78
+ return props.slotChar;
79
+ }
80
+ return char;
81
+ });
82
+ };
83
+
84
+ const setValueFromModel = () => {
85
+ if (!props.modelValue) {
86
+ initBuffer();
87
+ return;
88
+ }
89
+
90
+ const maskArray = getMaskArray();
91
+ const rawValue = props.modelValue.replace(/[^a-zA-Z0-9]/g, "");
92
+ let valueIndex = 0;
93
+
94
+ buffer.value = maskArray.map((maskChar, index) => {
95
+ if (isEditablePosition(index) && valueIndex < rawValue.length) {
96
+ const regex = maskDefinitions[maskChar];
97
+ const char = rawValue[valueIndex];
98
+ if (regex && regex.test(char)) {
99
+ valueIndex++;
100
+ return char;
101
+ }
102
+ valueIndex++;
103
+ return props.slotChar;
104
+ } else if (!isEditablePosition(index)) {
105
+ return maskChar;
106
+ }
107
+ return props.slotChar;
108
+ });
109
+ };
110
+
111
+ const displayValue = computed(() => buffer.value.join(""));
112
+
113
+ const getRawValue = () => {
114
+ const maskArray = getMaskArray();
115
+ return buffer.value
116
+ .filter((char, index) => isEditablePosition(index) && char !== props.slotChar)
117
+ .join("");
118
+ };
119
+
120
+ const isComplete = () => {
121
+ return buffer.value.every((char, index) => {
122
+ if (isEditablePosition(index)) {
123
+ return char !== props.slotChar;
124
+ }
125
+ return true;
126
+ });
127
+ };
128
+
129
+ const validateChar = (char: any, pos: any) => {
130
+ const maskArray = getMaskArray();
131
+ const maskChar = maskArray[pos];
132
+ const regex = maskDefinitions[maskChar];
133
+ return regex ? regex.test(char) : false;
134
+ };
135
+
136
+ const onInput = (event: Event) => {
137
+ // Prevent default input handling - we manage it ourselves
138
+ event.preventDefault();
139
+ };
140
+
141
+ const onKeydown = (event: KeyboardEvent) => {
142
+ const input = inputRef.value;
143
+ if (!input) return;
144
+
145
+ const pos = input.selectionStart;
146
+
147
+ if (event.key.length === 1 && !event.ctrlKey && !event.metaKey) {
148
+ event.preventDefault();
149
+ const nextPos = getNextEditablePosition(pos);
150
+ if (nextPos !== -1 && validateChar(event.key, nextPos)) {
151
+ buffer.value[nextPos] = event.key;
152
+ const newPos = getNextEditablePosition(nextPos + 1);
153
+ focusPosition.value = newPos !== -1 ? newPos : nextPos + 1;
154
+
155
+ requestAnimationFrame(() => {
156
+ input.setSelectionRange(focusPosition.value, focusPosition.value);
157
+ });
158
+
159
+ emitValue();
160
+ }
161
+ } else if (event.key === "Backspace") {
162
+ event.preventDefault();
163
+ let deletePos = pos;
164
+
165
+ if (!isEditablePosition(pos) || buffer.value[pos!] === props.slotChar) {
166
+ deletePos = getPrevEditablePosition(pos!);
167
+ } else {
168
+ deletePos = pos!;
169
+ }
170
+
171
+ if (deletePos !== -1 && deletePos >= 0) {
172
+ buffer.value[deletePos] = props.slotChar;
173
+ const newPos = deletePos;
174
+ focusPosition.value = newPos;
175
+
176
+ requestAnimationFrame(() => {
177
+ input.setSelectionRange(newPos, newPos);
178
+ });
179
+
180
+ emitValue();
181
+ }
182
+ } else if (event.key === "Delete") {
183
+ event.preventDefault();
184
+ const deletePos = isEditablePosition(pos) ? pos : getNextEditablePosition(pos);
185
+ if (deletePos !== -1) {
186
+ buffer.value[deletePos!] = props.slotChar;
187
+ emitValue();
188
+ }
189
+ } else if (event.key === "ArrowLeft") {
190
+ event.preventDefault();
191
+ const newPos = getPrevEditablePosition(pos);
192
+ if (newPos !== -1) {
193
+ input.setSelectionRange(newPos, newPos);
194
+ }
195
+ } else if (event.key === "ArrowRight") {
196
+ event.preventDefault();
197
+ const newPos = getNextEditablePosition(pos! + 1);
198
+ if (newPos !== -1) {
199
+ input.setSelectionRange(newPos, newPos);
200
+ }
201
+ }
202
+ };
203
+
204
+ const emitValue = () => {
205
+ const rawValue = getRawValue();
206
+ emit("update:modelValue", rawValue);
207
+
208
+ if (isComplete()) {
209
+ emit("complete", { value: rawValue, maskedValue: displayValue.value });
210
+ }
211
+ };
212
+
213
+ const onFocus = (event: FocusEvent) => {
214
+ const input = inputRef.value;
215
+ if (!input) return;
216
+
217
+ const firstEditable = getFirstEditablePosition();
218
+ if (firstEditable !== -1) {
219
+ requestAnimationFrame(() => {
220
+ input.setSelectionRange(firstEditable, firstEditable);
221
+ });
222
+ }
223
+
224
+ emit("focus", { originalEvent: event });
225
+ };
226
+
227
+ const onBlur = (event: FocusEvent) => {
228
+ if (props.autoClear && !isComplete()) {
229
+ initBuffer();
230
+ emit("update:modelValue", "");
231
+ }
232
+ emit("blur", { originalEvent: event });
233
+ };
234
+
235
+ const additionalClasses = computed(() => [
236
+ `input-mask--size-${props.size}`,
237
+ props.isDisabled && "input-mask--disabled",
238
+ props.isInvalid && "input-mask--invalid",
239
+ ].filter(Boolean).join(" "));
240
+
241
+ // Initialize
242
+ onMounted(() => {
243
+ if (props.modelValue) {
244
+ setValueFromModel();
245
+ } else {
246
+ initBuffer();
247
+ }
248
+ });
249
+
250
+ // Watch for external value changes
251
+ watch(() => props.modelValue, (newValue) => {
252
+ if (newValue !== getRawValue()) {
253
+ setValueFromModel();
254
+ }
255
+ });
256
+
257
+ watch(() => props.mask, () => {
258
+ initBuffer();
259
+ setValueFromModel();
260
+ });
261
+
262
+ defineExpose({
263
+ focus: () => inputRef.value?.focus(),
264
+ blur: () => inputRef.value?.blur(),
265
+ select: () => inputRef.value?.select(),
266
+ el: inputRef,
267
+ });
268
+ </script>
@@ -0,0 +1,122 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: input-number;
4
+
5
+ .#{$c} {
6
+ display: inline-flex;
7
+ position: relative;
8
+ width: 100%;
9
+ }
10
+
11
+ .#{$c}__input {
12
+ width: 100%;
13
+ flex: 1;
14
+ background-color: var(--inputNumber-background-default, $inputNumber-background-default);
15
+ border: var(--inputNumber-border-width, $inputNumber-border-width) solid var(--inputNumber-border-color-default, $inputNumber-border-color-default);
16
+ border-radius: var(--inputNumber-radius, $inputNumber-radius);
17
+ padding: 0 var(--inputNumber-padding-x, $inputNumber-padding-x);
18
+ color: var(--inputNumber-text-default, $inputNumber-text-default);
19
+ text-align: center;
20
+ transition: all 0.15s ease;
21
+
22
+ &::placeholder {
23
+ color: var(--inputNumber-text-placeholder, $inputNumber-text-placeholder);
24
+ }
25
+
26
+ &:hover:not(:disabled) {
27
+ border-color: var(--inputNumber-border-color-hover, $inputNumber-border-color-hover);
28
+ }
29
+
30
+ &:focus {
31
+ outline: var(--inputNumber-focus-ringWidth, $inputNumber-focus-ringWidth) solid var(--inputNumber-focus-ringColor, $inputNumber-focus-ringColor);
32
+ outline-offset: var(--inputNumber-focus-ringOffset, $inputNumber-focus-ringOffset);
33
+ border-color: var(--inputNumber-border-color-focus, $inputNumber-border-color-focus);
34
+ }
35
+
36
+ &:disabled {
37
+ cursor: not-allowed;
38
+ background-color: var(--inputNumber-background-disabled, $inputNumber-background-disabled);
39
+ border-color: var(--inputNumber-border-color-disabled, $inputNumber-border-color-disabled);
40
+ color: var(--inputNumber-text-disabled, $inputNumber-text-disabled);
41
+ }
42
+ }
43
+
44
+ .#{$c}__button {
45
+ position: absolute;
46
+ top: 1px;
47
+ bottom: 1px;
48
+ width: var(--inputNumber-button-width, $inputNumber-button-width);
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ background-color: var(--inputNumber-button-background-default, $inputNumber-button-background-default);
53
+ border: none;
54
+ cursor: pointer;
55
+ color: var(--inputNumber-button-icon-color-default, $inputNumber-button-icon-color-default);
56
+ transition: all 0.15s ease;
57
+
58
+ &:hover:not(:disabled) {
59
+ background-color: var(--inputNumber-button-background-hover, $inputNumber-button-background-hover);
60
+ }
61
+
62
+ &:active:not(:disabled) {
63
+ background-color: var(--inputNumber-button-background-active, $inputNumber-button-background-active);
64
+ }
65
+
66
+ &:disabled {
67
+ cursor: not-allowed;
68
+ background-color: var(--inputNumber-button-background-disabled, $inputNumber-button-background-disabled);
69
+ color: var(--inputNumber-button-icon-color-disabled, $inputNumber-button-icon-color-disabled);
70
+ }
71
+
72
+ &--decrement {
73
+ left: 1px;
74
+ border-radius: calc(var(--inputNumber-radius, $inputNumber-radius) - 1px) 0 0 calc(var(--inputNumber-radius, $inputNumber-radius) - 1px);
75
+ }
76
+
77
+ &--increment {
78
+ right: 1px;
79
+ border-radius: 0 calc(var(--inputNumber-radius, $inputNumber-radius) - 1px) calc(var(--inputNumber-radius, $inputNumber-radius) - 1px) 0;
80
+ }
81
+ }
82
+
83
+ // With buttons
84
+ .#{$c}--with-buttons {
85
+ .#{$c}__input {
86
+ padding-left: calc(var(--inputNumber-button-width, $inputNumber-button-width) + var(--inputNumber-padding-x, $inputNumber-padding-x));
87
+ padding-right: calc(var(--inputNumber-button-width, $inputNumber-button-width) + var(--inputNumber-padding-x, $inputNumber-padding-x));
88
+ }
89
+ }
90
+
91
+ // Invalid state
92
+ .#{$c}--invalid {
93
+ .#{$c}__input {
94
+ border-color: var(--inputNumber-border-color-error, $inputNumber-border-color-error);
95
+
96
+ &:focus {
97
+ border-color: var(--inputNumber-border-color-error, $inputNumber-border-color-error);
98
+ }
99
+ }
100
+ }
101
+
102
+ // Sizes
103
+ .#{$c}--size-sm {
104
+ .#{$c}__input {
105
+ height: var(--inputNumber-height-sm, $inputNumber-height-sm);
106
+ font-size: var(--inputNumber-fontSize-sm, $inputNumber-fontSize-sm);
107
+ }
108
+ }
109
+
110
+ .#{$c}--size-md {
111
+ .#{$c}__input {
112
+ height: var(--inputNumber-height-md, $inputNumber-height-md);
113
+ font-size: var(--inputNumber-fontSize-md, $inputNumber-fontSize-md);
114
+ }
115
+ }
116
+
117
+ .#{$c}--size-lg {
118
+ .#{$c}__input {
119
+ height: var(--inputNumber-height-lg, $inputNumber-height-lg);
120
+ font-size: var(--inputNumber-fontSize-lg, $inputNumber-fontSize-lg);
121
+ }
122
+ }
@@ -0,0 +1,150 @@
1
+ <template>
2
+ <div class="input-number" :class="additionalClasses">
3
+ <button
4
+ v-if="showButtons"
5
+ type="button"
6
+ class="input-number__button input-number__button--decrement"
7
+ :disabled="isDisabled || isAtMin"
8
+ @click="decrement"
9
+ >
10
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none">
11
+ <path d="M2.5 6H9.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
12
+ </svg>
13
+ </button>
14
+ <input
15
+ ref="inputRef"
16
+ type="text"
17
+ inputmode="decimal"
18
+ class="input-number__input"
19
+ :value="displayValue"
20
+ :disabled="isDisabled"
21
+ :placeholder="placeholder"
22
+ :name="name"
23
+ :aria-invalid="isInvalid || undefined"
24
+ @input="onInput"
25
+ @blur="onBlur"
26
+ @keydown="onKeydown"
27
+ />
28
+ <button
29
+ v-if="showButtons"
30
+ type="button"
31
+ class="input-number__button input-number__button--increment"
32
+ :disabled="isDisabled || isAtMax"
33
+ @click="increment"
34
+ >
35
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none">
36
+ <path d="M6 2.5V9.5M2.5 6H9.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
37
+ </svg>
38
+ </button>
39
+ </div>
40
+ </template>
41
+
42
+ <style src="./InputNumber.scss"></style>
43
+
44
+ <script setup lang="ts">
45
+ import type { InputNumberProps, InputNumberEmits } from '../../types';
46
+ import { computed, ref } from "vue";
47
+
48
+ defineOptions({ name: 'FtpInputNumber' });
49
+
50
+ const props = withDefaults(defineProps<InputNumberProps>(), {
51
+ modelValue: null,
52
+ min: null,
53
+ max: null,
54
+ step: 1,
55
+ size: "md",
56
+ showButtons: true,
57
+ isDisabled: false,
58
+ isInvalid: false,
59
+ locale: "nl-NL",
60
+ minFractionDigits: 0,
61
+ maxFractionDigits: 2,
62
+ });
63
+
64
+ const emit = defineEmits(["update:modelValue", "change"]);
65
+
66
+ const inputRef = ref<HTMLInputElement | null>(null);
67
+
68
+ const displayValue = computed(() => {
69
+ if (props.modelValue === null || props.modelValue === undefined) {
70
+ return "";
71
+ }
72
+ return new Intl.NumberFormat(props.locale, {
73
+ minimumFractionDigits: props.minFractionDigits,
74
+ maximumFractionDigits: props.maxFractionDigits,
75
+ }).format(props.modelValue);
76
+ });
77
+
78
+ const isAtMin = computed(() => {
79
+ if (props.min === null) return false;
80
+ return props.modelValue !== null && props.modelValue <= props.min;
81
+ });
82
+
83
+ const isAtMax = computed(() => {
84
+ if (props.max === null) return false;
85
+ return props.modelValue !== null && props.modelValue >= props.max;
86
+ });
87
+
88
+ const parseValue = (value: any) => {
89
+ if (!value || value === "") return null;
90
+ // Handle locale-specific parsing
91
+ const cleanedValue = value
92
+ .replace(/[^\d,.-]/g, "")
93
+ .replace(",", ".");
94
+ const parsed = parseFloat(cleanedValue);
95
+ return isNaN(parsed) ? null : parsed;
96
+ };
97
+
98
+ const clampValue = (value: any) => {
99
+ if (value === null) return null;
100
+ let result = value;
101
+ if (props.min !== null && result < props.min) result = props.min;
102
+ if (props.max !== null && result > props.max) result = props.max;
103
+ return result;
104
+ };
105
+
106
+ const updateValue = (value: any) => {
107
+ const clamped = clampValue(value);
108
+ emit("update:modelValue", clamped);
109
+ emit("change", { value: clamped });
110
+ };
111
+
112
+ const onInput = (event: Event) => {
113
+ // Allow typing, don't update immediately
114
+ };
115
+
116
+ const onBlur = (event: FocusEvent) => {
117
+ const parsed = parseValue((event.target as HTMLInputElement).value);
118
+ updateValue(parsed);
119
+ };
120
+
121
+ const onKeydown = (event: KeyboardEvent) => {
122
+ if (event.key === "ArrowUp") {
123
+ event.preventDefault();
124
+ increment();
125
+ } else if (event.key === "ArrowDown") {
126
+ event.preventDefault();
127
+ decrement();
128
+ } else if (event.key === "Enter") {
129
+ const parsed = parseValue((event.target as HTMLInputElement).value);
130
+ updateValue(parsed);
131
+ }
132
+ };
133
+
134
+ const increment = () => {
135
+ const current = props.modelValue ?? 0;
136
+ updateValue(current + props.step);
137
+ };
138
+
139
+ const decrement = () => {
140
+ const current = props.modelValue ?? 0;
141
+ updateValue(current - props.step);
142
+ };
143
+
144
+ const additionalClasses = computed(() => [
145
+ `input-number--size-${props.size}`,
146
+ props.isDisabled && "input-number--disabled",
147
+ props.isInvalid && "input-number--invalid",
148
+ props.showButtons && "input-number--with-buttons",
149
+ ].filter(Boolean).join(" "));
150
+ </script>
@@ -0,0 +1,88 @@
1
+ @use "../../../dist/scss/tokens" as *;
2
+
3
+ $c: input-otp;
4
+
5
+ .#{$c} {
6
+ display: inline-block;
7
+ }
8
+
9
+ .#{$c}__container {
10
+ display: flex;
11
+ align-items: center;
12
+ gap: var(--input-otp-gap, $input-otp-gap);
13
+ }
14
+
15
+ .#{$c}__cell {
16
+ width: var(--input-otp-cell-size, $input-otp-cell-size);
17
+ height: var(--input-otp-cell-size, $input-otp-cell-size);
18
+ text-align: center;
19
+ font-size: var(--input-otp-cell-fontSize, $input-otp-cell-fontSize);
20
+ font-weight: var(--input-otp-cell-fontWeight, $input-otp-cell-fontWeight);
21
+ color: var(--input-otp-cell-text-default, $input-otp-cell-text-default);
22
+ background-color: var(--input-otp-cell-background-default, $input-otp-cell-background-default);
23
+ border: var(--input-otp-cell-border-width, $input-otp-cell-border-width) solid var(--input-otp-cell-border-color-default, $input-otp-cell-border-color-default);
24
+ border-radius: var(--input-otp-cell-radius, $input-otp-cell-radius);
25
+ appearance: none;
26
+ -moz-appearance: textfield;
27
+ transition:
28
+ border-color 150ms ease,
29
+ background-color 150ms ease,
30
+ box-shadow 150ms ease;
31
+
32
+ &::-webkit-outer-spin-button,
33
+ &::-webkit-inner-spin-button {
34
+ -webkit-appearance: none;
35
+ margin: 0;
36
+ }
37
+
38
+ &::placeholder {
39
+ color: transparent;
40
+ }
41
+
42
+ &:hover:not(:disabled):not(:focus) {
43
+ border-color: var(--input-otp-cell-border-color-hover, $input-otp-cell-border-color-hover);
44
+ }
45
+
46
+ &:focus {
47
+ outline: none;
48
+ border-color: var(--input-otp-cell-border-color-focus, $input-otp-cell-border-color-focus);
49
+ background-color: var(--input-otp-cell-background-focus, $input-otp-cell-background-focus);
50
+ box-shadow: 0 0 0 var(--input-otp-focus-ringWidth, $input-otp-focus-ringWidth) var(--input-otp-focus-ringColor, $input-otp-focus-ringColor);
51
+ }
52
+
53
+ &:disabled {
54
+ cursor: not-allowed;
55
+ background-color: var(--input-otp-cell-background-disabled, $input-otp-cell-background-disabled);
56
+ border-color: var(--input-otp-cell-border-color-disabled, $input-otp-cell-border-color-disabled);
57
+ color: var(--input-otp-cell-text-disabled, $input-otp-cell-text-disabled);
58
+ }
59
+ }
60
+
61
+ .#{$c}__cell--filled {
62
+ background-color: var(--input-otp-cell-background-filled, $input-otp-cell-background-filled);
63
+ border-color: var(--input-otp-cell-border-color-filled, $input-otp-cell-border-color-filled);
64
+ }
65
+
66
+ .#{$c}__separator {
67
+ display: block;
68
+ width: var(--input-otp-separator-width, $input-otp-separator-width);
69
+ height: 2px;
70
+ background-color: var(--input-otp-separator-color, $input-otp-separator-color);
71
+ border-radius: 1px;
72
+ }
73
+
74
+ // Invalid state
75
+ .#{$c}--invalid {
76
+ .#{$c}__cell {
77
+ border-color: var(--input-otp-cell-border-color-error, $input-otp-cell-border-color-error);
78
+
79
+ &:focus {
80
+ border-color: var(--input-otp-cell-border-color-error, $input-otp-cell-border-color-error);
81
+ }
82
+ }
83
+ }
84
+
85
+ // Disabled state
86
+ .#{$c}--disabled {
87
+ opacity: 0.6;
88
+ }