@sky.ui/core 0.0.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 (320) hide show
  1. package/LICENSE.md +139 -0
  2. package/README.md +113 -0
  3. package/auto-import-loader.js +60 -0
  4. package/auto-import.js +93 -0
  5. package/dist/custom-elements.json +27051 -0
  6. package/dist/helper/controllers/animation-controller.d.ts +120 -0
  7. package/dist/helper/controllers/animation-controller.js +2 -0
  8. package/dist/helper/controllers/animation-controller.js.map +1 -0
  9. package/dist/helper/controllers/index.d.ts +2 -0
  10. package/dist/helper/controllers/popover-controller.d.ts +162 -0
  11. package/dist/helper/controllers/popover-controller.js +2 -0
  12. package/dist/helper/controllers/popover-controller.js.map +1 -0
  13. package/dist/helper/form-control-base.d.ts +1 -0
  14. package/dist/helper/iconify-offline.d.ts +73 -0
  15. package/dist/helper/iconify-offline.js +2 -0
  16. package/dist/helper/iconify-offline.js.map +1 -0
  17. package/dist/helper/index.d.ts +5 -0
  18. package/dist/helper/internals/form-control-base.d.ts +81 -0
  19. package/dist/helper/internals/form-control-base.js +2 -0
  20. package/dist/helper/internals/form-control-base.js.map +1 -0
  21. package/dist/helper/internals/index.d.ts +1 -0
  22. package/dist/helper/utils/color-resolver.d.ts +139 -0
  23. package/dist/helper/utils/color-resolver.js +2 -0
  24. package/dist/helper/utils/color-resolver.js.map +1 -0
  25. package/dist/helper/utils/index.d.ts +2 -0
  26. package/dist/helper/utils/size-resolver.d.ts +6 -0
  27. package/dist/helper/utils/size-resolver.js +2 -0
  28. package/dist/helper/utils/size-resolver.js.map +1 -0
  29. package/dist/index.d.ts +58 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/sky-accordion/index.d.ts +1 -0
  33. package/dist/sky-accordion/index.js +1 -0
  34. package/dist/sky-accordion/sky-accordion.d.ts +201 -0
  35. package/dist/sky-accordion/sky-accordion.js +85 -0
  36. package/dist/sky-accordion/sky-accordion.js.map +1 -0
  37. package/dist/sky-accordion-item/index.d.ts +1 -0
  38. package/dist/sky-accordion-item/index.js +1 -0
  39. package/dist/sky-accordion-item/sky-accordion-item.d.ts +161 -0
  40. package/dist/sky-accordion-item/sky-accordion-item.js +191 -0
  41. package/dist/sky-accordion-item/sky-accordion-item.js.map +1 -0
  42. package/dist/sky-alert/index.d.ts +1 -0
  43. package/dist/sky-alert/index.js +1 -0
  44. package/dist/sky-alert/sky-alert.d.ts +136 -0
  45. package/dist/sky-alert/sky-alert.js +292 -0
  46. package/dist/sky-alert/sky-alert.js.map +1 -0
  47. package/dist/sky-appbar/index.d.ts +1 -0
  48. package/dist/sky-appbar/index.js +1 -0
  49. package/dist/sky-appbar/sky-appbar.d.ts +84 -0
  50. package/dist/sky-appbar/sky-appbar.js +173 -0
  51. package/dist/sky-appbar/sky-appbar.js.map +1 -0
  52. package/dist/sky-avatar/index.d.ts +1 -0
  53. package/dist/sky-avatar/index.js +1 -0
  54. package/dist/sky-avatar/sky-avatar.d.ts +104 -0
  55. package/dist/sky-avatar/sky-avatar.js +152 -0
  56. package/dist/sky-avatar/sky-avatar.js.map +1 -0
  57. package/dist/sky-badge/index.d.ts +1 -0
  58. package/dist/sky-badge/index.js +1 -0
  59. package/dist/sky-badge/sky-badge.d.ts +154 -0
  60. package/dist/sky-badge/sky-badge.js +148 -0
  61. package/dist/sky-badge/sky-badge.js.map +1 -0
  62. package/dist/sky-breadcrumb/index.d.ts +1 -0
  63. package/dist/sky-breadcrumb/index.js +1 -0
  64. package/dist/sky-breadcrumb/sky-breadcrumb.d.ts +111 -0
  65. package/dist/sky-breadcrumb/sky-breadcrumb.js +230 -0
  66. package/dist/sky-breadcrumb/sky-breadcrumb.js.map +1 -0
  67. package/dist/sky-button/index.d.ts +1 -0
  68. package/dist/sky-button/index.js +1 -0
  69. package/dist/sky-button/sky-button.d.ts +118 -0
  70. package/dist/sky-button/sky-button.js +172 -0
  71. package/dist/sky-button/sky-button.js.map +1 -0
  72. package/dist/sky-button-group/index.d.ts +1 -0
  73. package/dist/sky-button-group/index.js +1 -0
  74. package/dist/sky-button-group/sky-button-group.d.ts +93 -0
  75. package/dist/sky-button-group/sky-button-group.js +281 -0
  76. package/dist/sky-button-group/sky-button-group.js.map +1 -0
  77. package/dist/sky-card/index.d.ts +1 -0
  78. package/dist/sky-card/index.js +1 -0
  79. package/dist/sky-card/sky-card.d.ts +143 -0
  80. package/dist/sky-card/sky-card.js +186 -0
  81. package/dist/sky-card/sky-card.js.map +1 -0
  82. package/dist/sky-carousel/index.d.ts +1 -0
  83. package/dist/sky-carousel/index.js +1 -0
  84. package/dist/sky-carousel/sky-carousel.d.ts +265 -0
  85. package/dist/sky-carousel/sky-carousel.js +211 -0
  86. package/dist/sky-carousel/sky-carousel.js.map +1 -0
  87. package/dist/sky-checkbox/index.d.ts +1 -0
  88. package/dist/sky-checkbox/index.js +1 -0
  89. package/dist/sky-checkbox/sky-checkbox.d.ts +165 -0
  90. package/dist/sky-checkbox/sky-checkbox.js +276 -0
  91. package/dist/sky-checkbox/sky-checkbox.js.map +1 -0
  92. package/dist/sky-chip/index.d.ts +1 -0
  93. package/dist/sky-chip/index.js +1 -0
  94. package/dist/sky-chip/sky-chip.d.ts +95 -0
  95. package/dist/sky-chip/sky-chip.js +210 -0
  96. package/dist/sky-chip/sky-chip.js.map +1 -0
  97. package/dist/sky-col/index.d.ts +1 -0
  98. package/dist/sky-col/index.js +1 -0
  99. package/dist/sky-col/sky-col.d.ts +84 -0
  100. package/dist/sky-col/sky-col.js +46 -0
  101. package/dist/sky-col/sky-col.js.map +1 -0
  102. package/dist/sky-combobox/index.d.ts +1 -0
  103. package/dist/sky-combobox/index.js +1 -0
  104. package/dist/sky-combobox/sky-combobox.d.ts +313 -0
  105. package/dist/sky-combobox/sky-combobox.js +1146 -0
  106. package/dist/sky-combobox/sky-combobox.js.map +1 -0
  107. package/dist/sky-counter/index.d.ts +1 -0
  108. package/dist/sky-counter/index.js +1 -0
  109. package/dist/sky-counter/sky-counter.d.ts +130 -0
  110. package/dist/sky-counter/sky-counter.js +101 -0
  111. package/dist/sky-counter/sky-counter.js.map +1 -0
  112. package/dist/sky-dialog/index.d.ts +1 -0
  113. package/dist/sky-dialog/index.js +1 -0
  114. package/dist/sky-dialog/sky-dialog.d.ts +237 -0
  115. package/dist/sky-dialog/sky-dialog.js +265 -0
  116. package/dist/sky-dialog/sky-dialog.js.map +1 -0
  117. package/dist/sky-divider/index.d.ts +1 -0
  118. package/dist/sky-divider/index.js +1 -0
  119. package/dist/sky-divider/sky-divider.d.ts +120 -0
  120. package/dist/sky-divider/sky-divider.js +42 -0
  121. package/dist/sky-divider/sky-divider.js.map +1 -0
  122. package/dist/sky-drawer/index.d.ts +1 -0
  123. package/dist/sky-drawer/index.js +1 -0
  124. package/dist/sky-drawer/sky-drawer.d.ts +161 -0
  125. package/dist/sky-drawer/sky-drawer.js +177 -0
  126. package/dist/sky-drawer/sky-drawer.js.map +1 -0
  127. package/dist/sky-dropdown/index.d.ts +1 -0
  128. package/dist/sky-dropdown/index.js +1 -0
  129. package/dist/sky-dropdown/sky-dropdown.d.ts +252 -0
  130. package/dist/sky-dropdown/sky-dropdown.js +58 -0
  131. package/dist/sky-dropdown/sky-dropdown.js.map +1 -0
  132. package/dist/sky-dropdown-item/index.d.ts +1 -0
  133. package/dist/sky-dropdown-item/index.js +1 -0
  134. package/dist/sky-dropdown-item/sky-dropdown-item.d.ts +207 -0
  135. package/dist/sky-dropdown-item/sky-dropdown-item.js +341 -0
  136. package/dist/sky-dropdown-item/sky-dropdown-item.js.map +1 -0
  137. package/dist/sky-flexbar/index.d.ts +1 -0
  138. package/dist/sky-flexbar/index.js +1 -0
  139. package/dist/sky-flexbar/sky-flexbar.d.ts +189 -0
  140. package/dist/sky-flexbar/sky-flexbar.js +148 -0
  141. package/dist/sky-flexbar/sky-flexbar.js.map +1 -0
  142. package/dist/sky-flexbox/index.d.ts +1 -0
  143. package/dist/sky-flexbox/index.js +1 -0
  144. package/dist/sky-flexbox/sky-flexbox.d.ts +156 -0
  145. package/dist/sky-flexbox/sky-flexbox.js +40 -0
  146. package/dist/sky-flexbox/sky-flexbox.js.map +1 -0
  147. package/dist/sky-flexcol/index.d.ts +1 -0
  148. package/dist/sky-flexcol/index.js +1 -0
  149. package/dist/sky-flexcol/sky-flexcol.d.ts +154 -0
  150. package/dist/sky-flexcol/sky-flexcol.js +14 -0
  151. package/dist/sky-flexcol/sky-flexcol.js.map +1 -0
  152. package/dist/sky-flexitem/index.d.ts +1 -0
  153. package/dist/sky-flexitem/index.js +1 -0
  154. package/dist/sky-flexitem/sky-flexitem.d.ts +114 -0
  155. package/dist/sky-flexitem/sky-flexitem.js +45 -0
  156. package/dist/sky-flexitem/sky-flexitem.js.map +1 -0
  157. package/dist/sky-form/index.d.ts +1 -0
  158. package/dist/sky-form/index.js +1 -0
  159. package/dist/sky-form/sky-form.d.ts +286 -0
  160. package/dist/sky-form/sky-form.js +66 -0
  161. package/dist/sky-form/sky-form.js.map +1 -0
  162. package/dist/sky-grid/index.d.ts +1 -0
  163. package/dist/sky-grid/index.js +1 -0
  164. package/dist/sky-grid/sky-grid.d.ts +78 -0
  165. package/dist/sky-grid/sky-grid.js +40 -0
  166. package/dist/sky-grid/sky-grid.js.map +1 -0
  167. package/dist/sky-icon/index.d.ts +1 -0
  168. package/dist/sky-icon/index.js +1 -0
  169. package/dist/sky-icon/ion-local.json.js +2 -0
  170. package/dist/sky-icon/ion-local.json.js.map +1 -0
  171. package/dist/sky-icon/sky-icon.d.ts +123 -0
  172. package/dist/sky-icon/sky-icon.js +40 -0
  173. package/dist/sky-icon/sky-icon.js.map +1 -0
  174. package/dist/sky-image/index.d.ts +1 -0
  175. package/dist/sky-image/index.js +1 -0
  176. package/dist/sky-image/sky-image.d.ts +102 -0
  177. package/dist/sky-image/sky-image.js +29 -0
  178. package/dist/sky-image/sky-image.js.map +1 -0
  179. package/dist/sky-input/index.d.ts +1 -0
  180. package/dist/sky-input/index.js +1 -0
  181. package/dist/sky-input/sky-input.d.ts +345 -0
  182. package/dist/sky-input/sky-input.js +820 -0
  183. package/dist/sky-input/sky-input.js.map +1 -0
  184. package/dist/sky-list/index.d.ts +1 -0
  185. package/dist/sky-list/index.js +1 -0
  186. package/dist/sky-list/sky-list.d.ts +85 -0
  187. package/dist/sky-list/sky-list.js +41 -0
  188. package/dist/sky-list/sky-list.js.map +1 -0
  189. package/dist/sky-listitem/index.d.ts +1 -0
  190. package/dist/sky-listitem/index.js +1 -0
  191. package/dist/sky-listitem/sky-listitem.d.ts +76 -0
  192. package/dist/sky-listitem/sky-listitem.js +104 -0
  193. package/dist/sky-listitem/sky-listitem.js.map +1 -0
  194. package/dist/sky-navbar/index.d.ts +1 -0
  195. package/dist/sky-navbar/index.js +1 -0
  196. package/dist/sky-navbar/sky-navbar.d.ts +207 -0
  197. package/dist/sky-navbar/sky-navbar.js +521 -0
  198. package/dist/sky-navbar/sky-navbar.js.map +1 -0
  199. package/dist/sky-navpanel/index.d.ts +1 -0
  200. package/dist/sky-navpanel/index.js +1 -0
  201. package/dist/sky-navpanel/sky-navpanel.d.ts +186 -0
  202. package/dist/sky-navpanel/sky-navpanel.js +404 -0
  203. package/dist/sky-navpanel/sky-navpanel.js.map +1 -0
  204. package/dist/sky-notification/index.d.ts +1 -0
  205. package/dist/sky-notification/index.js +1 -0
  206. package/dist/sky-notification/sky-notification.d.ts +152 -0
  207. package/dist/sky-notification/sky-notification.js +456 -0
  208. package/dist/sky-notification/sky-notification.js.map +1 -0
  209. package/dist/sky-otp/index.d.ts +1 -0
  210. package/dist/sky-otp/index.js +1 -0
  211. package/dist/sky-otp/sky-otp.d.ts +101 -0
  212. package/dist/sky-otp/sky-otp.js +96 -0
  213. package/dist/sky-otp/sky-otp.js.map +1 -0
  214. package/dist/sky-overlay/index.d.ts +1 -0
  215. package/dist/sky-overlay/index.js +1 -0
  216. package/dist/sky-overlay/sky-overlay.d.ts +71 -0
  217. package/dist/sky-overlay/sky-overlay.js +26 -0
  218. package/dist/sky-overlay/sky-overlay.js.map +1 -0
  219. package/dist/sky-pagination/index.d.ts +1 -0
  220. package/dist/sky-pagination/index.js +1 -0
  221. package/dist/sky-pagination/sky-pagination.d.ts +167 -0
  222. package/dist/sky-pagination/sky-pagination.js +453 -0
  223. package/dist/sky-pagination/sky-pagination.js.map +1 -0
  224. package/dist/sky-progress/index.d.ts +1 -0
  225. package/dist/sky-progress/index.js +1 -0
  226. package/dist/sky-progress/sky-progress.d.ts +70 -0
  227. package/dist/sky-progress/sky-progress.js +87 -0
  228. package/dist/sky-progress/sky-progress.js.map +1 -0
  229. package/dist/sky-radio/index.d.ts +1 -0
  230. package/dist/sky-radio/index.js +1 -0
  231. package/dist/sky-radio/sky-radio.d.ts +118 -0
  232. package/dist/sky-radio/sky-radio.js +109 -0
  233. package/dist/sky-radio/sky-radio.js.map +1 -0
  234. package/dist/sky-radio-group/index.d.ts +1 -0
  235. package/dist/sky-radio-group/index.js +1 -0
  236. package/dist/sky-radio-group/sky-radio-group.d.ts +186 -0
  237. package/dist/sky-radio-group/sky-radio-group.js +239 -0
  238. package/dist/sky-radio-group/sky-radio-group.js.map +1 -0
  239. package/dist/sky-range/index.d.ts +1 -0
  240. package/dist/sky-range/index.js +1 -0
  241. package/dist/sky-range/sky-range.d.ts +110 -0
  242. package/dist/sky-range/sky-range.js +196 -0
  243. package/dist/sky-range/sky-range.js.map +1 -0
  244. package/dist/sky-row/index.d.ts +1 -0
  245. package/dist/sky-row/index.js +1 -0
  246. package/dist/sky-row/sky-row.d.ts +57 -0
  247. package/dist/sky-row/sky-row.js +6 -0
  248. package/dist/sky-row/sky-row.js.map +1 -0
  249. package/dist/sky-serial/index.d.ts +1 -0
  250. package/dist/sky-serial/index.js +1 -0
  251. package/dist/sky-serial/sky-serial.d.ts +127 -0
  252. package/dist/sky-serial/sky-serial.js +133 -0
  253. package/dist/sky-serial/sky-serial.js.map +1 -0
  254. package/dist/sky-sheet/index.d.ts +1 -0
  255. package/dist/sky-sheet/index.js +1 -0
  256. package/dist/sky-sheet/sky-sheet.d.ts +70 -0
  257. package/dist/sky-sheet/sky-sheet.js +47 -0
  258. package/dist/sky-sheet/sky-sheet.js.map +1 -0
  259. package/dist/sky-skeleton/index.d.ts +1 -0
  260. package/dist/sky-skeleton/index.js +1 -0
  261. package/dist/sky-skeleton/sky-skeleton.d.ts +80 -0
  262. package/dist/sky-skeleton/sky-skeleton.js +233 -0
  263. package/dist/sky-skeleton/sky-skeleton.js.map +1 -0
  264. package/dist/sky-slider/index.d.ts +1 -0
  265. package/dist/sky-slider/index.js +1 -0
  266. package/dist/sky-slider/sky-slider.d.ts +96 -0
  267. package/dist/sky-slider/sky-slider.js +139 -0
  268. package/dist/sky-slider/sky-slider.js.map +1 -0
  269. package/dist/sky-speeddial/index.d.ts +1 -0
  270. package/dist/sky-speeddial/index.js +1 -0
  271. package/dist/sky-speeddial/sky-speeddial.d.ts +86 -0
  272. package/dist/sky-speeddial/sky-speeddial.js +154 -0
  273. package/dist/sky-speeddial/sky-speeddial.js.map +1 -0
  274. package/dist/sky-spinner/index.d.ts +1 -0
  275. package/dist/sky-spinner/index.js +1 -0
  276. package/dist/sky-spinner/sky-spinner.d.ts +87 -0
  277. package/dist/sky-spinner/sky-spinner.js +334 -0
  278. package/dist/sky-spinner/sky-spinner.js.map +1 -0
  279. package/dist/sky-steps/index.d.ts +1 -0
  280. package/dist/sky-steps/index.js +1 -0
  281. package/dist/sky-steps/sky-steps.d.ts +170 -0
  282. package/dist/sky-steps/sky-steps.js +455 -0
  283. package/dist/sky-steps/sky-steps.js.map +1 -0
  284. package/dist/sky-switch/index.d.ts +1 -0
  285. package/dist/sky-switch/index.js +1 -0
  286. package/dist/sky-switch/sky-switch.d.ts +116 -0
  287. package/dist/sky-switch/sky-switch.js +191 -0
  288. package/dist/sky-switch/sky-switch.js.map +1 -0
  289. package/dist/sky-tab/index.d.ts +1 -0
  290. package/dist/sky-tab/index.js +1 -0
  291. package/dist/sky-tab/sky-tab.d.ts +188 -0
  292. package/dist/sky-tab/sky-tab.js +390 -0
  293. package/dist/sky-tab/sky-tab.js.map +1 -0
  294. package/dist/sky-tab-button/index.d.ts +1 -0
  295. package/dist/sky-tab-button/index.js +1 -0
  296. package/dist/sky-tab-button/sky-tab-button.d.ts +114 -0
  297. package/dist/sky-tab-button/sky-tab-button.js +167 -0
  298. package/dist/sky-tab-button/sky-tab-button.js.map +1 -0
  299. package/dist/sky-theme-provider/index.d.ts +1 -0
  300. package/dist/sky-theme-provider/index.js +1 -0
  301. package/dist/sky-theme-provider/sky-theme-provider.d.ts +169 -0
  302. package/dist/sky-theme-provider/sky-theme-provider.js +12 -0
  303. package/dist/sky-theme-provider/sky-theme-provider.js.map +1 -0
  304. package/dist/sky-theme-switcher/index.d.ts +1 -0
  305. package/dist/sky-theme-switcher/index.js +1 -0
  306. package/dist/sky-theme-switcher/sky-theme-switcher.d.ts +92 -0
  307. package/dist/sky-theme-switcher/sky-theme-switcher.js +43 -0
  308. package/dist/sky-theme-switcher/sky-theme-switcher.js.map +1 -0
  309. package/dist/sky-tooltip/index.d.ts +1 -0
  310. package/dist/sky-tooltip/index.js +1 -0
  311. package/dist/sky-tooltip/sky-tooltip.d.ts +156 -0
  312. package/dist/sky-tooltip/sky-tooltip.js +242 -0
  313. package/dist/sky-tooltip/sky-tooltip.js.map +1 -0
  314. package/package.json +475 -0
  315. package/plugins/rollup-plugin.d.ts +19 -0
  316. package/plugins/rollup-plugin.js +129 -0
  317. package/plugins/vite-plugin.d.ts +22 -0
  318. package/plugins/vite-plugin.js +116 -0
  319. package/plugins/webpack-plugin.d.ts +12 -0
  320. package/plugins/webpack-plugin.js +46 -0
@@ -0,0 +1,820 @@
1
+ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as r,html as s}from"lit";import{ifDefined as o}from"lit/directives/if-defined.js";import{property as a,state as n,query as l,customElement as p}from"lit/decorators.js";import{resolveColor as d}from"../helper/utils/color-resolver.js";import{live as h}from"lit/directives/live.js";import{FormControlBase as c}from"../helper/internals/form-control-base.js";import{SkyIcon as u}from"../sky-icon/sky-icon.js";let y=class extends c{constructor(){super(...arguments),this.value="",this.placeholder="",this.label="",this.type="text",this.suffix="",this.prefix="",this.prefixColor="",this.suffixColor="",this.color="primary",this.validations=[],this.compact=!1,this.loading=!1,this.showErrors=!1,this.clearable=!1,this.errorDisplayMode="single",this.required=!1,this.step=null,this.min=null,this.max=null,this.autocapitalize="off",this.autocomplete="off",this.spellcheck=!1,this.dir="ltr",this.rows=6,this.resizable="none",this.accept="",this.multiple=!1,this.inputmode=null,this.enterkeyhint=null,this.pattern=null,this.minlength=null,this.maxlength=null,this.list=null,this.size=null,this.cols=null,this.autofocus=!1,this.capture=!1,this.inputRole=null,this.ariaLabel=null,this.ariaLabelledby=null,this.ariaDescribedby=null,this.showNumberButtons=!1,this.showPasswordToggle=!0,this.passwordVisibleIcon="material-symbols:visibility-off",this.passwordHiddenIcon="material-symbols:visibility",this.validationActive=!1,this.invalid=!1,this.variant="default",this.selectedFileName="",this.selectedFiles=[],this.focused=!1,this.validationStatus=[],this.validationErrors=[],this.typingStarted=!1,this.autofillIconSlot="left",this.showPassword=!1,this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null,this.keepInputFocused=t=>{t.preventDefault(),t.stopPropagation(),this.refocusInput()}}static{this.dependencies={"sky-icon":u}}static{this.styles=i`
2
+ :host {
3
+ display: block;
4
+ font-family: var(--sky-font);
5
+ width: 100%;
6
+ }
7
+
8
+ :host([disabled]) .input-container {
9
+ opacity: 0.6;
10
+ }
11
+ :host([disabled]) * {
12
+ pointer-events: none;
13
+ }
14
+
15
+ :host([variant="highlight"]){
16
+ .label{
17
+ color: var(--sky-input-color);
18
+ }
19
+ }
20
+
21
+ .input-container {
22
+ position: relative;
23
+ display: flex;
24
+ flex-direction: column;
25
+ width: inherit;
26
+ cursor: text;
27
+ }
28
+
29
+ sky-icon {
30
+ display: inline-block;
31
+ width: 1em;
32
+ height: 1em;
33
+ }
34
+
35
+ .input-container:focus-within .label {
36
+ color: var(--sky-input-color);
37
+ font-size: var(--sky-font-size-sm);
38
+ transition: all 0.3s ease;
39
+ }
40
+ .label {
41
+ font-size: var(--sky-font-size-sm);
42
+ margin-bottom: 5px;
43
+ text-align: start;
44
+ white-space: nowrap;
45
+ overflow: hidden;
46
+ text-overflow: ellipsis;
47
+ font-family: var(--sky-font);
48
+ }
49
+
50
+ .input-container:focus-within[compact] .label {
51
+ font-size: var(--sky-font-size-xs);
52
+ color: var(--sky-input-color);
53
+ }
54
+
55
+ .input-wrapper {
56
+ position: relative;
57
+ display: flex;
58
+ width: 100%;
59
+ align-items: center;
60
+ background: transparent;
61
+ border-radius: var(--sky-radius-secondary);
62
+ background: var(--sky-glass-primary);
63
+ box-sizing: border-box;
64
+ height: 38px;
65
+ pointer-events: auto;
66
+ border: var(--sky-border-primary);
67
+ transition: border 0.3s ease;
68
+ box-shadow: var(--sky-box-shadow-primary);
69
+
70
+ }
71
+
72
+ .input-wrapper::before {
73
+ content: "";
74
+ position: absolute;
75
+ inset: 0px;
76
+ backdrop-filter: var(--sky-blur-primary) var(--sky-brightness-primary)
77
+ var(--sky-saturation-primary);
78
+ -webkit-backdrop-filter: var(--sky-blur-primary)
79
+ var(--sky-brightness-primary) var(--sky-saturation-primary);
80
+ z-index: -1;
81
+
82
+ border-radius: inherit;
83
+ }
84
+
85
+ .input-wrapper::after {
86
+ content: "";
87
+ position: absolute;
88
+ top: -1px;
89
+ left: -1px;
90
+ right: -1px;
91
+ bottom: -1px;
92
+ border-radius: inherit;
93
+ border: 1px solid transparent;
94
+ border-bottom-color: transparent;
95
+ opacity: 0;
96
+ transition:
97
+ opacity 0.3s ease,
98
+ border-color 0.3s ease;
99
+ pointer-events: none;
100
+ }
101
+
102
+ .input-wrapper:has(input:focus)::after,
103
+ .input-wrapper:has(textarea:focus)::after {
104
+ opacity: 1;
105
+ border-bottom-color: var(--sky-input-color);
106
+ }
107
+
108
+ :host([validationActive]:invalid) .input-wrapper::after {
109
+ opacity: 1;
110
+ border-bottom-color: var(--sky-danger-primary);
111
+ }
112
+ :host([validationActive]:invalid) .label {
113
+ color: var(--sky-danger-primary);
114
+ }
115
+
116
+ :host([validationActive]:invalid) .icon-slot {
117
+ color: var(--sky-danger-primary);
118
+ }
119
+
120
+ .input-wrapper[compact] {
121
+ height: 30px;
122
+ border: var(--sky-border-primary);
123
+ }
124
+
125
+ input[type="date"],
126
+ input[type="time"],
127
+ input[type="week"],
128
+ input[type="month"],
129
+ input[type="datetime-local"] {
130
+ -webkit-appearance: none;
131
+ -moz-appearance: none;
132
+ appearance: none;
133
+ background: none;
134
+ border: none;
135
+ padding-right: 40px;
136
+ font-family: inherit;
137
+ }
138
+
139
+ input[type="date"]::-webkit-calendar-picker-indicator,
140
+ input[type="time"]::-webkit-calendar-picker-indicator,
141
+ input[type="week"]::-webkit-calendar-picker-indicator,
142
+ input[type="month"]::-webkit-calendar-picker-indicator,
143
+ input[type="datetime-local"]::-webkit-calendar-picker-indicator {
144
+ display: none;
145
+ }
146
+
147
+ .input-wrapper {
148
+ transition: all 0.3s ease;
149
+ }
150
+
151
+ .input-wrapper:has(input:focus)[compact]::after {
152
+ border: 1px solid var(--sky-input-color);
153
+ }
154
+
155
+ input {
156
+ font-family: var(--sky-font);
157
+ font-size: var(--sky-font-size-md);
158
+ text-align: left;
159
+ transition: transform 0.3s ease;
160
+ }
161
+
162
+ input:-webkit-autofill {
163
+ -webkit-text-fill-color: var(--sky-text-secondary, inherit) !important;
164
+ transition: background-color 9999s ease-in-out 0s !important;
165
+ }
166
+
167
+ :dir(rtl) input {
168
+ text-align: right;
169
+ }
170
+
171
+ input[type="number"] {
172
+ appearance: textfield;
173
+ -moz-appearance: textfield;
174
+ }
175
+
176
+ input[type="number"]::-webkit-inner-spin-button,
177
+ input[type="number"]::-webkit-outer-spin-button {
178
+ -webkit-appearance: none;
179
+ margin: 0;
180
+ }
181
+ .number-btn {
182
+ display: flex;
183
+ margin-right: 5px;
184
+ gap: 5px;
185
+ }
186
+
187
+ :dir(rtl).number-btn {
188
+ margin-left: 5px;
189
+ margin-right: unset;
190
+ }
191
+
192
+ .file-info {
193
+ display: flex;
194
+ justify-content: flex-end;
195
+ font-size: var(--sky-font-size-xs);
196
+ color: var(--sky-text-secondary);
197
+ font-family: var(--sky-font);
198
+ }
199
+
200
+ :dir(rtl).file-info {
201
+ flex-direction: row-reverse;
202
+ }
203
+
204
+ .increment-btn,
205
+ .decrement-btn {
206
+ background: var(--sky-glass-primary);
207
+ color: var(--sky-text-primary);
208
+ border: var(--sky-border-primary);
209
+ border-radius: var(--sky-radius-primary);
210
+ box-shadow: var(--sky-box-shadow-primary);
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: center;
214
+ padding: 2px 6px;
215
+ font-size: var(--sky-font-size-sm);
216
+ cursor: pointer;
217
+ transition: all 0.3s ease;
218
+ font-family: var(--sky-font);
219
+ }
220
+
221
+ .increment-btn:hover,
222
+ .decrement-btn:hover {
223
+ color: var(--sky-input-color);
224
+ }
225
+
226
+ .toggle-password {
227
+ position: absolute;
228
+ right: 10px;
229
+ font-size: var(--sky-font-size-lg);
230
+ color: var(--sky-text-tertiary);
231
+ cursor: pointer;
232
+ }
233
+
234
+ :dir(rtl) .toggle-password {
235
+ right: unset;
236
+ left: 10px;
237
+ }
238
+
239
+ .input-wrapper:has(.icon-slot[filled].right) .toggle-password {
240
+ right: 45px;
241
+ }
242
+ .input-wrapper:has(.icon-slot[filled].right) .clear-button {
243
+ right: 40px;
244
+ }
245
+
246
+ :dir(rtl).input-wrapper:has(.icon-slot[filled].right) .toggle-password {
247
+ right: unset;
248
+ left: 45px;
249
+ }
250
+
251
+ .toggle-password:hover {
252
+ color: var(--sky-input-color);
253
+ }
254
+
255
+ input {
256
+ flex: 1;
257
+ min-width: 50px;
258
+ border: none;
259
+ outline: none;
260
+ background: transparent;
261
+ box-sizing: border-box;
262
+ color: var(--sky-text-primary);
263
+ padding: 0 15px;
264
+ }
265
+
266
+ input::placeholder {
267
+ color: var(--sky-text-tertiary);
268
+ }
269
+
270
+ .icon-slot {
271
+ display: none;
272
+ justify-content: center;
273
+ font-size: var(--sky-font-size-xl);
274
+ align-items: center;
275
+ color: var(--sky-text-primary);
276
+ border-radius: var(--sky-radius-secondary);
277
+ height: inherit;
278
+ max-height: 100%;
279
+ box-sizing: border-box;
280
+ min-width: 36px;
281
+ background: var(--sky-glass-primary);
282
+ backdrop-filter: var(--sky-blur-primary) var(--sky-brightness-primary)
283
+ var(--sky-saturation-primary);
284
+ -webkit-backdrop-filter: var(--sky-blur-primary)
285
+ var(--sky-brightness-primary) var(--sky-saturation-primary);
286
+ box-shadow: var(--sky-box-shadow-primary);
287
+ transition:
288
+ transform 0.3s ease,
289
+ color 0.3s ease;
290
+
291
+ }
292
+
293
+ .input-wrapper:has(textarea) .icon-slot {
294
+ max-height: 38px;
295
+ border-bottom: var(--sky-border-primary);
296
+ }
297
+
298
+ .icon-slot[filled] {
299
+ display: flex;
300
+ cursor: pointer;
301
+ }
302
+ .icon-slot[filled]:hover {
303
+ transform: translate(-5px, -5px);
304
+ color: var(--sky-input-color);
305
+ }
306
+ .icon-slot.right[filled]:hover {
307
+ transform: translate(5px, -5px);
308
+ color: var(--sky-input-color);
309
+ }
310
+
311
+ .icon-slot.focused {
312
+ transform: translate(-5px, -5px);
313
+ color: var(--sky-input-color);
314
+ border: var(--sky-border-primary) !important;
315
+ }
316
+
317
+ :dir(rtl) .icon-slot[filled]:hover {
318
+ transform: translate(5px, -5px);
319
+ }
320
+
321
+ :dir(rtl) .icon-slot.right[filled]:hover {
322
+ transform: translate(-5px, -5px);
323
+ }
324
+
325
+ :dir(rtl) .icon-slot.focused {
326
+ transform: translate(5px, -5px);
327
+ }
328
+
329
+ .icon-slot.right {
330
+ border-left: var(--sky-border-primary);
331
+ }
332
+ .icon-slot.left {
333
+ border-right: var(--sky-border-primary);
334
+ }
335
+
336
+ :dir(rtl) .icon-slot.right {
337
+ border-left: unset;
338
+ border-right: var(--sky-border-primary);
339
+ }
340
+ :dir(rtl) .icon-slot.left {
341
+ border-right: unset;
342
+ border-left: var(--sky-border-primary);
343
+ }
344
+
345
+ .icon-slot.right.focused {
346
+ transform: translate(5px, -5px);
347
+ }
348
+
349
+ :dir(rtl) .icon-slot.right.focused {
350
+ transform: translate(-5px, -5px);
351
+ }
352
+
353
+ .input-wrapper:has(.icon-slot[filled].right) input {
354
+ padding: 0px 0 0 15px;
355
+ }
356
+
357
+ .input-wrapper:has(.icon-slot[filled].left) input {
358
+ padding: 0px 10px 0 5px;
359
+ }
360
+
361
+ :dir(rtl) .input-wrapper:has(.icon-slot[filled].right) input {
362
+ padding: 0px 15px 0 0px;
363
+ }
364
+
365
+ :dir(rtl) .input-wrapper:has(.icon-slot[filled].left) input {
366
+ padding: 0px 5px 0 10px;
367
+ }
368
+
369
+ .progress-message {
370
+ pointer-events: none;
371
+ width: 100%;
372
+ overflow: hidden;
373
+ white-space: nowrap;
374
+ text-overflow: ellipsis;
375
+ font-size: var(--sky-font-size-sm);
376
+ margin-left: 5px;
377
+ font-family: var(--sky-font);
378
+ }
379
+
380
+ :dir(rtl) .progress-message {
381
+ margin-left: unset;
382
+ margin-right: 5px;
383
+ }
384
+
385
+ .error-list {
386
+ list-style: none;
387
+ margin: 0;
388
+ padding: 0;
389
+ width: 100%;
390
+ }
391
+
392
+ .error {
393
+ font-size: var(--sky-font-size-xs);
394
+ color: var(--sky-danger-primary);
395
+ text-align: start;
396
+ white-space: nowrap;
397
+ overflow: hidden;
398
+ text-overflow: ellipsis;
399
+ font-family: var(--sky-font);
400
+ }
401
+
402
+ ::slotted(.icon-slot) {
403
+ display: block;
404
+ }
405
+
406
+ .input-wrapper:has(.icon-slot[filled].right) .loading-indicator {
407
+ right: 45px;
408
+ }
409
+
410
+ :dir(rtl).input-wrapper:has(.icon-slot[filled].right) .loading-indicator {
411
+ left: 45px;
412
+ right: unset;
413
+ }
414
+
415
+ .input-wrapper[loading] input {
416
+ cursor: wait;
417
+ }
418
+
419
+ .loading-indicator {
420
+ display: block;
421
+ position: absolute;
422
+ width: 16px;
423
+ height: 16px;
424
+ border: 2px solid var(--sky-hover-primary);
425
+ border-top: 2px solid var(--sky-input-color);
426
+ border-radius: 50%;
427
+ animation: spin 1s linear infinite;
428
+ }
429
+
430
+ .loading-indicator[compact] {
431
+ width: 10px;
432
+ height: 10px;
433
+ }
434
+
435
+ .input-wrapper[loading] .loading-indicator.right {
436
+ right: 15px;
437
+ }
438
+ :dir(rtl).input-wrapper[loading] .loading-indicator.right {
439
+ left: 15px;
440
+ right: unset;
441
+ }
442
+
443
+ .input-wrapper[loading] .icon-slot.right {
444
+ display: none;
445
+ }
446
+
447
+ @keyframes spin {
448
+ 0% {
449
+ transform: rotate(0deg);
450
+ }
451
+ 100% {
452
+ transform: rotate(360deg);
453
+ }
454
+ }
455
+
456
+ .clear-button {
457
+ position: absolute;
458
+ right: 10px;
459
+ border: none;
460
+ font-size: var(--sky-font-size-xl);
461
+ color: var(--sky-input-color);
462
+ background-color: var(--sky-hover-primary);
463
+ border-radius: 50%;
464
+ backdrop-filter: var(--sky-blur-primary) var(--sky-brightness-primary)
465
+ var(--sky-saturation-primary);
466
+ -webkit-backdrop-filter: var(--sky-blur-primary)
467
+ var(--sky-brightness-primary) var(--sky-saturation-primary);
468
+ cursor: pointer;
469
+ transition: color 0.3s ease;
470
+
471
+ }
472
+
473
+ :dir(rtl) .clear-button {
474
+ left: 10px;
475
+ right: unset;
476
+ }
477
+ .clear-button[compact] {
478
+ font-size: var(--sky-font-size-md);
479
+ }
480
+
481
+ .clear-button[loading] {
482
+ right: 40px;
483
+ }
484
+ .input-wrapper:has(input[type="password"]) .clear-button {
485
+ right: 30px;
486
+ }
487
+
488
+ :dir(rtl) .clear-button[loading] {
489
+ right: unset;
490
+ left: 40px;
491
+ }
492
+ :dir(rtl) .input-wrapper:has(input[type="password"]) .clear-button {
493
+ right: unset;
494
+ left: 30px;
495
+ }
496
+
497
+ input[type="file"] {
498
+ position: absolute;
499
+ width: 100%;
500
+ height: 100%;
501
+ opacity: 0;
502
+ pointer-events: auto;
503
+ z-index: -1;
504
+ }
505
+
506
+ .custom-file-label {
507
+ position: relative;
508
+ flex: 1;
509
+ display: flex;
510
+ text-align: left;
511
+ padding: 0px 15px;
512
+ color: var(--sky-input-color);
513
+ border-radius: var(--sky-radius-secondary);
514
+ overflow: hidden;
515
+ white-space: nowrap;
516
+ text-overflow: ellipsis;
517
+ cursor: pointer;
518
+ transition:
519
+ background 0.3s ease,
520
+ padding 0.3s ease;
521
+ font-family: var(--sky-font);
522
+ }
523
+
524
+ .custom-file-label:hover {
525
+ padding-left: 12px;
526
+ }
527
+
528
+ :dir(rtl) .custom-file-label:hover {
529
+ padding-left: unset;
530
+ padding-right: 12px;
531
+ }
532
+
533
+ .custom-file-label:empty::after {
534
+ content: "Choose file";
535
+ color: var(--sky-input-color);
536
+ }
537
+
538
+ .clear-button:hover {
539
+ color: var(--sky-danger-primary);
540
+ }
541
+
542
+ .input-wrapper:has(.clear-button) input {
543
+ padding-right: 40px;
544
+ }
545
+
546
+ :dir(rtl).input-wrapper:has(.clear-button) input {
547
+ padding-left: 40px;
548
+ padding-right: unset;
549
+ }
550
+
551
+ textarea {
552
+ flex: 1;
553
+ min-width: 50px;
554
+ border: none;
555
+ outline: none;
556
+ background: transparent;
557
+ box-sizing: border-box;
558
+ color: var(--sky-text-primary);
559
+ padding: 10px 15px;
560
+ resize: none;
561
+ overflow: auto;
562
+ font-family: var(--sky-font);
563
+ }
564
+
565
+ textarea[resizable="vertical"] {
566
+ resize: vertical;
567
+ }
568
+
569
+ textarea[resizable="both"] {
570
+ resize: both;
571
+ }
572
+
573
+ textarea::-webkit-scrollbar {
574
+ width: 2px;
575
+ }
576
+
577
+ textarea::-webkit-scrollbar-track {
578
+ background: transparent;
579
+ }
580
+
581
+ textarea::-webkit-scrollbar {
582
+ width: 6px;
583
+ height: 6px;
584
+ }
585
+
586
+ textarea::-webkit-scrollbar-thumb {
587
+ background-color: var(--sky-text-tertiary);
588
+ border-radius: 4px;
589
+ transition: background-color 0.3s ease-in-out;
590
+ cursor: grab;
591
+ }
592
+
593
+ textarea::-webkit-scrollbar-thumb:hover {
594
+ background-color: var(--sky-text-secondary);
595
+ transition: background-color 0.3s ease-in-out;
596
+ }
597
+
598
+ textarea::-webkit-scrollbar-track {
599
+ background-color: var(--sky-border-light);
600
+ border-radius: 4px;
601
+ }
602
+
603
+ textarea::-webkit-scrollbar-button {
604
+ display: none;
605
+ }
606
+
607
+ textarea::placeholder {
608
+ color: var(--sky-text-tertiary);
609
+ }
610
+
611
+ .input-wrapper:has(textarea) {
612
+ height: calc((var(--rows)) * 23px);
613
+ }
614
+ textarea {
615
+ height: calc((var(--rows)) * 23px);
616
+ }
617
+
618
+ .input-wrapper:has(textarea) {
619
+ align-items: flex-start;
620
+ }
621
+ `}static{this.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0}}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||(this.tabIndex=this.disabled?-1:0)}firstUpdated(t){super.firstUpdated(t),this.captureDefaultValue(this.value),this.syncFormValue(),this.syncValidity();const e=this.shadowRoot?.querySelector('slot[name="icon-left"]'),i=this.shadowRoot?.querySelector('slot[name="icon-right"]'),r=(t,e)=>{e&&e.addEventListener("slotchange",()=>{e.assignedNodes({flatten:!0}).forEach(e=>{e instanceof HTMLElement&&e.addEventListener("click",()=>this.handleIconClick(t))})})};r("left",e),r("right",i)}willUpdate(t){t.has("validations")&&Array.isArray(this.validations)&&(this.validationStatus=this.validations.map(()=>!1)),t.has("value")&&"file"===this.type&&(null==this.value||""===String(this.value).trim()?(this.selectedFileName="",this.selectedFiles=[],this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null):this.selectedFileName||(this.selectedFileName=this.value))}updated(t){if(super.updated(t),t.has("color")&&this.color&&this.style.setProperty("--sky-input-color",d(this.color)),t.has("rows")){const t=this.inputWrapperEl;t&&t.style.setProperty("--rows",String(this.rows))}(t.has("value")||t.has("selectedFiles")||t.has("selectedFileName")||t.has("type")||t.has("multiple")||t.has("name")||t.has("disabled"))&&this.syncFormValue(),(t.has("value")||t.has("selectedFiles")||t.has("selectedFileName")||t.has("validationErrors")||t.has("required")||t.has("disabled")||t.has("readonly"))&&this.syncValidity()}getFormValue(){if(!this.name)return null;if("file"===this.type){if(!this.selectedFiles||0===this.selectedFiles.length)return null;if(this.multiple){const t=new FormData;for(const e of this.selectedFiles)t.append(this.name,e);return t}return this.selectedFiles[0]}return this.value??""}setValueFromFormState(t){"string"!=typeof t?(this.value="",this.selectedFileName="",this.selectedFiles=[],this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null):this.value=t}getValidityAnchor(){return this}isEmpty(){return"file"===this.type?!this.selectedFiles||0===this.selectedFiles.length:!this.value||""===this.value.toString().trim()}getCustomErrorMessage(){return this.validationErrors?.length?"all"===this.errorDisplayMode?this.validationErrors.join("\n"):this.validationErrors[0]:""}getNativeControl(){return"textarea"===this.type?this.shadowRoot?.querySelector("textarea"):this.shadowRoot?.querySelector("input")}onNativeValueMutated(t){"file"!==this.type&&(this.value=t?.value??""),this.validateInput()}reset(){this.value="",this.selectedFileName="",this.filePreview=null,this.selectedFiles=[],this.selectedFileCount=0,this.validationErrors=[],this.typingStarted=!1,this.validationActive=!1,this.selectedFileCount=0,this.totalFileSize=0}get nativeRequiredMessage(){return this.validationActive?this.disabled?"":this.required&&this.isEmpty()?this.requiredMessage||"This field is required.":"":""}getEmittedValue(){if("number"!==this.type)return this.value;if(""===this.value||null==this.value)return"";const t=Number(this.value);return Number.isFinite(t)?t:this.value}handleClear(){this.disabled||this.readonly||(this.reset(),this.validationActive=!0,this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-cleared",{detail:{value:this.getEmittedValue()},bubbles:!0,composed:!0})))}handleFileChange(t){if(this.disabled||this.readonly)return;const e=t.target.files;if(e&&e.length){const i=Array.from(e);this.selectedFiles=i,this.selectedFileName=i.map(t=>t.name).join(", "),this.value=this.selectedFileName,this.syncFormValue(),this.syncValidity();const r=i.reduce((t,e)=>t+e.size,0);if(this.totalFileSize=r,this.selectedFileCount=i.length,i[0].type.startsWith("image/")){const t=new FileReader;t.onload=t=>{t.target&&(this.filePreview=t.target.result)},t.readAsDataURL(i[0])}else this.filePreview=null;this.reemitNativeEvent("change",t),this.reemitNativeEvent("input",t),this.dispatchEvent(new CustomEvent("file-selected",{detail:{files:i,fileName:this.selectedFileName,totalSize:r,fileCount:this.selectedFileCount},bubbles:!0,composed:!0})),this.validateInput()}else this.value="",this.filePreview=null,this.totalFileSize=0,this.selectedFileCount=0,this.selectedFiles=[],this.validateInput()}handleKeydown(t){this.disabled||this.readonly||"Enter"===t.key&&"file"===this.type&&(t.preventDefault(),t.stopPropagation(),this.triggerNativeDropdown())}get preview(){return this.filePreview}handleInput(t){t.stopPropagation(),this.disabled||this.readonly?t.preventDefault():(this.value=t.target.value,this.syncFormValue(),this.syncValidity(),this.typingStarted||(this.typingStarted=!0),this.validateInput(),this.reemitNativeEvent("input",t),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()},bubbles:!0,composed:!0})))}handleFocus(t){t.stopPropagation(),this.focused=!0,this.reemitNativeEvent("focus",t)}onFormReset(){this.setValueFromFormState(this.defaultValue),this.validationActive=!1,this.invalid=!1,this.typingStarted=!1,this.validationErrors=[],this.validationStatus=[],"file"===this.type&&(this.selectedFiles=[],this.selectedFileName="",this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null)}handleBlur(t){t.stopPropagation(),this.validationActive=!0,this.focused=!1,this.reemitNativeEvent("blur",t)}validateForForm(){const t="file"===this.type?this.selectedFiles??[]:this.value??"";for(const e of this.validations??[]){const i=e(t);if(!0!==i)return"string"==typeof i?i:"Invalid value."}return""}validateInput(){this.validationErrors=[],this.validationStatus=[];const t="file"===this.type,e=t?!this.selectedFiles||0===this.selectedFiles.length:!this.value||""===this.value.toString().trim();if(this.required&&e&&this.syncValidity(),Array.isArray(this.validations)&&this.validations.length){const e=t?this.selectedFiles??[]:this.value??"";this.validationStatus=this.validations.map((t,i)=>{try{if("function"!=typeof t)throw new Error(`Validation at index ${i} must be a function.`);const r=t(e);return!0===r||(this.validationErrors.push("string"==typeof r?r:`Validation ${i} failed.`),!1)}catch(t){const e="object"==typeof t&&null!==t&&"message"in t?String(t.message):"string"==typeof t?t:"Unknown error";return this.validationErrors.push(`Error in validation ${i}: ${e}`),!1}})}this.dispatchEvent(new CustomEvent("validation-error",{detail:{errors:this.validationErrors},bubbles:!0,composed:!0})),this.syncValidity();const i=0===this.validationErrors.length;return this.invalid=!i,i}getErrorMessages(){switch(this.errorDisplayMode){case"single":return this.validationErrors.slice(0,1);case"all":return this.validationErrors;default:return[]}}handleIconClick(t,e=null){this.dispatchEvent(new CustomEvent(`${t}-icon-click`,{detail:{position:t,eventType:e?e.type:null,eventData:e},bubbles:!0,composed:!0}))}formatFileSize(t){if(0===t)return"0 Bytes";const e=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/Math.pow(1024,e)).toFixed(2))} ${["Bytes","KB","MB","GB","TB"][e]}`}incrementValue(){if(this.disabled||this.readonly)return;const t=parseFloat(this.value)||0,e=parseFloat(this.step??"")||1;t+e<=(this.max?parseFloat(this.max):1/0)&&(this.value=(t+e).toString(),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()}}))),this.refocusInput()}decrementValue(){if(this.disabled||this.readonly)return;const t=parseFloat(this.value)||0,e=parseFloat(this.step??"")||1;t-e>=(this.min?parseFloat(this.min):-1/0)&&(this.value=(t-e).toString(),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()}}))),this.refocusInput()}renderValidationErrors(){if(!this.showErrors||!this.validationActive)return null;const t=this.nativeRequiredMessage,e=this.getErrorMessages();let i=[];if("single"===this.errorDisplayMode?t?i=[t]:e.length&&(i=[e[0]]):i=t?[t,...e]:e,!i.length)return null;const r=`${this.id||"sky-input"}-errors`;return s`
622
+ <div class="progress-message">
623
+ <ul id=${r} class="error-list" part="error-list">
624
+ ${i.map(t=>s`<li class="error" part="error">${t}</li>`)}
625
+ </ul>
626
+ </div>
627
+ `}togglePasswordVisibility(){this.showPassword=!this.showPassword}focusInput(){const t=this.nativeInputEl;t&&"function"==typeof t.focus&&t.focus()}handleWrapperClick(t){if(t.stopPropagation(),this.disabled)return;const e=this.nativeInputEl;e&&"function"==typeof e.focus&&e.focus()}get isInvalid(){return this.matches(":invalid")||this.validationActive&&this.validationErrors.length>0}get describedById(){return this.ariaDescribedby??(this.showErrors?`${this.id||"sky-input"}-errors`:void 0)}refocusInput(){const t=this.shadowRoot?.querySelector("input");t?.focus({preventScroll:!0})}triggerNativeDropdown(){if(this.disabled||this.readonly)return;const t=this.shadowRoot?.querySelector('input[type="date"], input[type="time"], input[type="week"], input[type="month"], input[type="datetime-local"], input[type="file"]');t&&("file"===this.type?t.click():this.showPicker())}render(){const t="file"===this.type,e="textarea"===this.type,i="number"===this.type,r="password"===this.type,a=!!this.querySelector('[slot="icon-left"]'),n=!!this.querySelector('[slot="icon-right"]');let l=null;"date"===this.type?l=s`<sky-icon icon="ion:calendar"></sky-icon>`:"time"===this.type?l=s`<sky-icon icon="ion:time"></sky-icon>`:"week"===this.type||"month"===this.type?l=s`<sky-icon icon="ion:calendar"></sky-icon>`:"datetime-local"===this.type&&(l=s`<sky-icon icon="ion:time"></sky-icon>`);const p=this.filePreview&&(a||n),d="left"===this.autofillIconSlot&&l,c="right"===this.autofillIconSlot&&l,u=()=>s`
628
+ <img
629
+ src=${o("string"==typeof this.filePreview?this.filePreview:void 0)}
630
+ alt="Preview"
631
+ style="width:100%;height:100%;object-fit:cover;border-radius:12px;"
632
+ />
633
+ `,y=()=>s`
634
+ <label
635
+ class="custom-file-label"
636
+ part="custom-file-label"
637
+ for="fileInput"
638
+ ?disabled=${this.disabled}
639
+ >
640
+ <span style="color:${this.prefixColor}">${this.prefix}</span>
641
+ ${this.selectedFileName||this.placeholder||"Choose file"}
642
+ <span style="color:${this.suffixColor}">${this.suffix}</span>
643
+ </label>
644
+
645
+ <input
646
+ id="fileInput"
647
+ type="file"
648
+ @change=${this.handleFileChange}
649
+ ?disabled=${this.disabled}
650
+ accept=${this.accept||""}
651
+ ?multiple=${this.multiple}
652
+ .required=${this.required}
653
+ @keydown=${this.handleKeydown}
654
+ .dir=${this.dir}
655
+ .autocomplete=${this.autocomplete}
656
+ .autocapitalize=${this.autocapitalize}
657
+ spellcheck=${this.spellcheck}
658
+ ?autofocus=${this.autofocus}
659
+ inputmode=${o(this.inputmode||void 0)}
660
+ enterkeyhint=${o(this.enterkeyhint)}
661
+ list=${o(this.list||void 0)}
662
+ capture=${o(this.capture?"environment":void 0)}
663
+ .aria-invalid=${String(this.isInvalid)}
664
+ .aria-required=${String(this.required)}
665
+ aria-label=${o(this.ariaLabel||void 0)}
666
+ aria-labelledby=${o(this.ariaLabelledby||void 0)}
667
+ aria-describedby=${o(this.describedById)}
668
+ />
669
+ `,v=()=>s`
670
+ <textarea
671
+ .value=${h(this.value)}
672
+ @input=${this.handleInput}
673
+ @focus=${this.handleFocus}
674
+ @blur=${this.handleBlur}
675
+ ?compact=${this.compact}
676
+ ?disabled=${this.disabled}
677
+ .required=${this.required}
678
+ .rows=${this.rows}
679
+ placeholder=${this.placeholder}
680
+ resizable=${this.resizable||"none"}
681
+ style="width:100%;border:none;outline:none;padding:10px;"
682
+ .autocapitalize=${this.autocapitalize}
683
+ ?spellcheck=${this.spellcheck}
684
+ .autocomplete=${this.autocomplete}
685
+ inputmode=${o(this.inputmode||void 0)}
686
+ enterkeyhint=${o(this.enterkeyhint)}
687
+ minlength=${o(this.minlength??void 0)}
688
+ maxlength=${o(this.maxlength??void 0)}
689
+ ?autofocus=${this.autofocus}
690
+ .aria-invalid=${String(this.isInvalid)}
691
+ .aria-required=${String(this.required)}
692
+ aria-label=${o(this.ariaLabel||void 0)}
693
+ aria-labelledby=${o(this.ariaLabelledby||void 0)}
694
+ aria-describedby=${o(this.describedById)}
695
+ role=${o(this.inputRole)}
696
+ ></textarea>
697
+ `,g=()=>s`
698
+ <input
699
+ .type=${r&&this.showPassword?"text":this.type}
700
+ .value=${h(this.value)}
701
+ @input=${this.handleInput}
702
+ @focus=${this.handleFocus}
703
+ @blur=${this.handleBlur}
704
+ ?compact=${this.compact}
705
+ ?disabled=${this.disabled}
706
+ .required=${this.required}
707
+ .readOnly=${this.readonly}
708
+ style="appearance:none;pointer-events:auto;"
709
+ placeholder=${this.placeholder}
710
+ .autocomplete=${this.autocomplete}
711
+ .autocapitalize=${this.autocapitalize}
712
+ spellcheck=${this.spellcheck}
713
+ inputmode=${o(this.inputmode||void 0)}
714
+ enterkeyhint=${o(this.enterkeyhint)}
715
+ list=${o(this.list||void 0)}
716
+ pattern=${o(this.pattern||void 0)}
717
+ minlength=${o(this.minlength??void 0)}
718
+ maxlength=${o(this.maxlength??void 0)}
719
+ size=${o(this.size??void 0)}
720
+ step=${o(null!==this.step?Number(this.step):void 0)}
721
+ min=${o(this.min??void 0)}
722
+ max=${o(this.max??void 0)}
723
+ ?autofocus=${this.autofocus}
724
+ .aria-invalid=${String(this.isInvalid)}
725
+ .aria-required=${String(this.required)}
726
+ aria-label=${o(this.ariaLabel||void 0)}
727
+ aria-labelledby=${o(this.ariaLabelledby||void 0)}
728
+ aria-describedby=${o(this.describedById)}
729
+ role=${o(this.inputRole)}
730
+ />
731
+ `;return s`
732
+ <div
733
+ class="input-container"
734
+ @click=${this.handleWrapperClick}
735
+ part="input-container"
736
+ >
737
+ ${this.label?s`<div class="label" part="label">${this.label}</div>`:null}
738
+ <div
739
+ class="input-wrapper"
740
+ part="input-wrapper"
741
+ ?compact=${this.compact}
742
+ ?loading=${this.loading}
743
+ >
744
+ ${(()=>s`
745
+ <div
746
+ class="icon-slot left ${this.focused?"focused":""}"
747
+ part="icon-slot icon-slot-left"
748
+ ?filled=${Boolean(p&&a)||Boolean(d)||a}
749
+ @click=${()=>{(t||d)&&this.triggerNativeDropdown()}}
750
+ >
751
+ ${p&&a?u():d?l:s`<slot name="icon-left"></slot>`}
752
+ </div>
753
+ `)()} ${t?y():e?v():g()} ${(()=>i&&this.showNumberButtons?s`
754
+ <div class="number-btn">
755
+ <button
756
+ class="decrement-btn"
757
+ type="button"
758
+ tabindex="-1"
759
+ @mousedown=${this.keepInputFocused}
760
+ @pointerdown=${this.keepInputFocused}
761
+ @click=${t=>{t.stopPropagation(),this.decrementValue()}}
762
+ aria-label="Decrease value"
763
+ >
764
+ <sky-icon icon="ion:minus"></sky-icon>
765
+ </button>
766
+ <button
767
+ class="increment-btn"
768
+ type="button"
769
+ tabindex="-1"
770
+ @mousedown=${this.keepInputFocused}
771
+ @pointerdown=${this.keepInputFocused}
772
+ @click=${t=>{t.stopPropagation(),this.incrementValue()}}
773
+ aria-label="Increase value"
774
+ >
775
+ <sky-icon icon="ion:add"></sky-icon>
776
+ </button>
777
+ </div>
778
+ `:null)()} ${(()=>r&&this.showPasswordToggle?s`
779
+ <sky-icon
780
+ class="toggle-password"
781
+ part="toggle-password"
782
+ icon=${this.showPassword?this.passwordVisibleIcon:this.passwordHiddenIcon}
783
+ @click=${this.togglePasswordVisibility}
784
+ ></sky-icon>
785
+ `:null)()}
786
+ ${(()=>this.clearable&&(this.value||this.selectedFileName||this.selectedFileCount>0)?s`
787
+ <sky-icon
788
+ class="clear-button"
789
+ part="clear-button"
790
+ @click=${this.handleClear}
791
+ ?loading=${this.loading}
792
+ icon="ion:close"
793
+ ></sky-icon>
794
+ `:null)()} ${(()=>this.loading?s`<div
795
+ class="loading-indicator right"
796
+ part="loading-indicator"
797
+ ></div>`:s`
798
+ <div
799
+ class="icon-slot right ${this.focused?"focused":""}"
800
+ part="icon-slot icon-slot-right"
801
+ ?filled=${Boolean(p&&n)||Boolean(c)||n}
802
+ @click=${()=>{(t||c)&&this.triggerNativeDropdown()}}
803
+ >
804
+ ${p&&n?u():c?l:s`<slot name="icon-right"></slot>`}
805
+ </div>
806
+ `)()}
807
+ </div>
808
+
809
+ ${(()=>t&&this.totalFileSize?s`
810
+ <div class="file-info" part="file-info">
811
+ <span>
812
+ ${this.selectedFileCount}
813
+ file${1!==this.selectedFileCount?"s selected":" selected"} </span
814
+ >,
815
+ <span>${this.formatFileSize(this.totalFileSize)}</span>
816
+ </div>
817
+ `:null)()} ${this.renderValidationErrors()}
818
+ </div>
819
+ `}};t([a({type:String}),e("design:type",Object)],y.prototype,"value",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"placeholder",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"label",void 0),t([a({type:String}),e("design:type",String)],y.prototype,"type",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"suffix",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"prefix",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"prefixColor",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"suffixColor",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"color",void 0),t([a({type:Array}),e("design:type",Array)],y.prototype,"validations",void 0),t([a({type:Boolean,reflect:!0}),e("design:type",Object)],y.prototype,"compact",void 0),t([a({type:Boolean,reflect:!0}),e("design:type",Object)],y.prototype,"loading",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"showErrors",void 0),t([a({type:Boolean,reflect:!0}),e("design:type",Object)],y.prototype,"clearable",void 0),t([a({type:String}),e("design:type",String)],y.prototype,"errorDisplayMode",void 0),t([a({type:Boolean,reflect:!0}),e("design:type",Object)],y.prototype,"required",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"step",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"min",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"max",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"autocapitalize",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"autocomplete",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"spellcheck",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"dir",void 0),t([a({type:Number}),e("design:type",Object)],y.prototype,"rows",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"resizable",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"accept",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"multiple",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"inputmode",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"enterkeyhint",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"pattern",void 0),t([a({type:Number}),e("design:type",Object)],y.prototype,"minlength",void 0),t([a({type:Number}),e("design:type",Object)],y.prototype,"maxlength",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"list",void 0),t([a({type:Number}),e("design:type",Object)],y.prototype,"size",void 0),t([a({type:Number}),e("design:type",Object)],y.prototype,"cols",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"autofocus",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"capture",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"inputRole",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"ariaLabel",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"ariaLabelledby",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"ariaDescribedby",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"showNumberButtons",void 0),t([a({type:Boolean}),e("design:type",Object)],y.prototype,"showPasswordToggle",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"passwordVisibleIcon",void 0),t([a({type:String}),e("design:type",Object)],y.prototype,"passwordHiddenIcon",void 0),t([a({type:Boolean,reflect:!0}),e("design:type",Object)],y.prototype,"validationActive",void 0),t([a({type:Boolean,reflect:!0}),e("design:type",Object)],y.prototype,"invalid",void 0),t([a({type:String,reflect:!0}),e("design:type",Object)],y.prototype,"variant",void 0),t([n(),e("design:type",Object)],y.prototype,"selectedFileName",void 0),t([n(),e("design:type",Array)],y.prototype,"selectedFiles",void 0),t([n(),e("design:type",Object)],y.prototype,"focused",void 0),t([n(),e("design:type",Array)],y.prototype,"validationStatus",void 0),t([n(),e("design:type",Array)],y.prototype,"validationErrors",void 0),t([n(),e("design:type",Object)],y.prototype,"typingStarted",void 0),t([n(),e("design:type",Object)],y.prototype,"autofillIconSlot",void 0),t([n(),e("design:type",Object)],y.prototype,"showPassword",void 0),t([n(),e("design:type",Object)],y.prototype,"totalFileSize",void 0),t([n(),e("design:type",Object)],y.prototype,"selectedFileCount",void 0),t([n(),e("design:type",Object)],y.prototype,"filePreview",void 0),t([l(".input-wrapper"),e("design:type",HTMLElement)],y.prototype,"inputWrapperEl",void 0),t([l("input, textarea"),e("design:type",Object)],y.prototype,"nativeInputEl",void 0),y=t([p("sky-input")],y);export{y as SkyInput};
820
+ //# sourceMappingURL=sky-input.js.map