@swiftwc/ui 0.0.0-dev.1 → 0.0.0-dev.101

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 (360) hide show
  1. package/README.md +15 -0
  2. package/generated/buses/alert-dialog.d.ts +2 -0
  3. package/generated/buses/alert-dialog.js +1 -0
  4. package/generated/buses/confirmation-dialog.d.ts +2 -0
  5. package/generated/buses/confirmation-dialog.js +1 -0
  6. package/generated/buses/index.d.ts +6 -0
  7. package/generated/buses/index.js +6 -0
  8. package/generated/buses/lifecycle-observer.d.ts +2 -0
  9. package/generated/buses/lifecycle-observer.js +1 -0
  10. package/generated/client/index.d.ts +30 -2
  11. package/generated/client/index.js +279 -8
  12. package/generated/components/alert-dialog.d.ts +11 -0
  13. package/generated/components/alert-dialog.js +102 -0
  14. package/generated/components/body-view.d.ts +13 -0
  15. package/generated/components/body-view.js +17 -0
  16. package/generated/components/bordered-button.d.ts +17 -0
  17. package/generated/components/bordered-button.js +56 -0
  18. package/generated/components/bordered-prominent-button.d.ts +17 -0
  19. package/generated/components/bordered-prominent-button.js +56 -0
  20. package/generated/components/borderless-button.d.ts +17 -0
  21. package/generated/components/borderless-button.js +56 -0
  22. package/generated/components/color-scheme.d.ts +12 -0
  23. package/generated/components/color-scheme.js +54 -0
  24. package/generated/components/confirmation-dialog.d.ts +12 -0
  25. package/generated/components/confirmation-dialog.js +116 -0
  26. package/generated/components/content-unavailable.d.ts +30 -0
  27. package/generated/components/content-unavailable.js +82 -0
  28. package/generated/components/date-picker.d.ts +52 -0
  29. package/generated/components/date-picker.js +480 -0
  30. package/generated/components/detail-placeholder.d.ts +11 -0
  31. package/generated/components/detail-placeholder.js +19 -0
  32. package/generated/components/disclosure-group.d.ts +17 -0
  33. package/generated/components/disclosure-group.js +66 -0
  34. package/generated/components/fine-tooltip.d.ts +15 -0
  35. package/generated/components/fine-tooltip.js +111 -0
  36. package/generated/components/form-view.d.ts +16 -0
  37. package/generated/components/form-view.js +65 -0
  38. package/generated/components/glass-button.d.ts +16 -0
  39. package/generated/components/glass-button.js +53 -0
  40. package/generated/components/glass-prominent-button.d.ts +16 -0
  41. package/generated/components/glass-prominent-button.js +53 -0
  42. package/generated/components/h-stack.d.ts +22 -0
  43. package/generated/components/h-stack.js +26 -0
  44. package/generated/components/image-view.d.ts +18 -0
  45. package/generated/components/image-view.js +68 -0
  46. package/generated/components/index.d.ts +49 -1
  47. package/generated/components/index.js +49 -6
  48. package/generated/components/label-view.d.ts +27 -0
  49. package/generated/components/label-view.js +87 -0
  50. package/generated/components/labeled-content.d.ts +33 -0
  51. package/generated/components/labeled-content.js +163 -0
  52. package/generated/components/list-view.d.ts +18 -0
  53. package/generated/components/list-view.js +25 -0
  54. package/generated/components/menu-view.d.ts +20 -0
  55. package/generated/components/menu-view.js +140 -0
  56. package/generated/components/navigation-large-title.d.ts +18 -0
  57. package/generated/components/navigation-large-title.js +188 -0
  58. package/generated/components/navigation-split-view.d.ts +15 -0
  59. package/generated/components/navigation-split-view.js +25 -0
  60. package/generated/components/navigation-stack.d.ts +15 -0
  61. package/generated/components/navigation-stack.js +29 -0
  62. package/generated/components/navigation-title.d.ts +18 -0
  63. package/generated/components/navigation-title.js +72 -0
  64. package/generated/components/picker-view.d.ts +68 -0
  65. package/generated/components/picker-view.js +1153 -0
  66. package/generated/components/plain-button.d.ts +7 -0
  67. package/generated/components/plain-button.js +22 -0
  68. package/generated/components/progress-view.d.ts +20 -0
  69. package/generated/components/progress-view.js +125 -0
  70. package/generated/components/screen-view.d.ts +5 -0
  71. package/generated/components/screen-view.js +11 -0
  72. package/generated/components/scroll-view-proxy.d.ts +13 -0
  73. package/generated/components/scroll-view-proxy.js +17 -0
  74. package/generated/components/scroll-view.d.ts +22 -0
  75. package/generated/components/scroll-view.js +237 -0
  76. package/generated/components/search-view.d.ts +12 -0
  77. package/generated/components/search-view.js +27 -0
  78. package/generated/components/section-view.d.ts +21 -0
  79. package/generated/components/section-view.js +64 -0
  80. package/generated/components/sheet-view.d.ts +11 -0
  81. package/generated/components/sheet-view.js +45 -0
  82. package/generated/components/sidebar-toggle.d.ts +15 -0
  83. package/generated/components/sidebar-toggle.js +88 -0
  84. package/generated/components/sidebar-view.d.ts +10 -0
  85. package/generated/components/sidebar-view.js +37 -0
  86. package/generated/components/sticky-container.d.ts +11 -0
  87. package/generated/components/sticky-container.js +26 -0
  88. package/generated/components/tab-bar.d.ts +10 -0
  89. package/generated/components/tab-bar.js +40 -0
  90. package/generated/components/tab-item.d.ts +10 -0
  91. package/generated/components/tab-item.js +134 -0
  92. package/generated/components/tab-view.d.ts +31 -0
  93. package/generated/components/tab-view.js +198 -0
  94. package/generated/components/table-view.d.ts +26 -0
  95. package/generated/components/table-view.js +161 -0
  96. package/generated/components/text-field.d.ts +42 -0
  97. package/generated/components/text-field.js +526 -0
  98. package/generated/components/text-view.d.ts +11 -0
  99. package/generated/components/text-view.js +19 -0
  100. package/generated/components/toggle-view.d.ts +43 -0
  101. package/generated/components/toggle-view.js +371 -0
  102. package/generated/components/tool-bar-item-group.d.ts +13 -0
  103. package/generated/components/tool-bar-item-group.js +31 -0
  104. package/generated/components/tool-bar-item.d.ts +16 -0
  105. package/generated/components/tool-bar-item.js +69 -0
  106. package/generated/components/tool-bar.d.ts +26 -0
  107. package/generated/components/tool-bar.js +95 -0
  108. package/generated/components/v-keyboard.d.ts +18 -0
  109. package/generated/components/v-keyboard.js +87 -0
  110. package/generated/components/v-stack.d.ts +25 -0
  111. package/generated/components/v-stack.js +29 -0
  112. package/generated/css/index.css +10732 -0
  113. package/generated/events/alert-dialog.d.ts +13 -0
  114. package/generated/events/alert-dialog.js +1 -0
  115. package/generated/events/confirmation-dialog.d.ts +14 -0
  116. package/generated/events/confirmation-dialog.js +1 -0
  117. package/generated/events/date-picker.d.ts +13 -0
  118. package/generated/events/date-picker.js +1 -0
  119. package/generated/events/index.d.ts +9 -0
  120. package/generated/events/index.js +9 -0
  121. package/generated/events/lifecycle-observer.d.ts +18 -0
  122. package/generated/events/lifecycle-observer.js +1 -0
  123. package/generated/events/picker-view.d.ts +29 -0
  124. package/generated/events/picker-view.js +1 -0
  125. package/generated/events/scroll-view.d.ts +18 -0
  126. package/generated/events/scroll-view.js +1 -0
  127. package/generated/events/tab-view.d.ts +54 -0
  128. package/generated/events/tab-view.js +1 -0
  129. package/generated/events/text-field.d.ts +13 -0
  130. package/generated/events/text-field.js +1 -0
  131. package/generated/events/toggle-view.d.ts +14 -0
  132. package/generated/events/toggle-view.js +1 -0
  133. package/generated/i18n/index.d.ts +33 -0
  134. package/generated/i18n/index.js +164 -0
  135. package/generated/i18n/locales/el.d.ts +16 -0
  136. package/generated/i18n/locales/el.js +16 -0
  137. package/generated/i18n/locales/en.d.ts +16 -0
  138. package/generated/i18n/locales/en.js +16 -0
  139. package/generated/i18n/locales/index.d.ts +4 -0
  140. package/generated/i18n/locales/index.js +4 -0
  141. package/generated/index.js +1 -1
  142. package/generated/internal/class/cleanup-registry.d.ts +5 -0
  143. package/generated/internal/class/cleanup-registry.js +38 -0
  144. package/generated/internal/class/css-style-observer.d.ts +8 -0
  145. package/generated/internal/class/css-style-observer.js +26 -0
  146. package/generated/internal/class/form-associated-base.d.ts +16 -0
  147. package/generated/internal/class/form-associated-base.js +78 -0
  148. package/generated/internal/class/mutation-observer-set.d.ts +9 -0
  149. package/generated/internal/class/mutation-observer-set.js +42 -0
  150. package/generated/internal/class/mutation-observer-singleton.d.ts +10 -0
  151. package/generated/internal/class/mutation-observer-singleton.js +64 -0
  152. package/generated/internal/class/navigation-path.d.ts +15 -0
  153. package/generated/internal/class/navigation-path.js +84 -0
  154. package/generated/internal/class/navigation-view.d.ts +8 -0
  155. package/generated/internal/class/navigation-view.js +72 -0
  156. package/generated/internal/class/resize-observer-singleton.d.ts +7 -0
  157. package/generated/internal/class/resize-observer-singleton.js +22 -0
  158. package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
  159. package/generated/internal/decorators/adaptive-slot.js +50 -0
  160. package/generated/internal/decorators/custom-element.d.ts +5 -0
  161. package/generated/internal/decorators/custom-element.js +5 -0
  162. package/generated/internal/decorators/index.d.ts +6 -0
  163. package/generated/internal/decorators/index.js +6 -0
  164. package/generated/internal/decorators/microtask-on-connected.d.ts +39 -0
  165. package/generated/internal/decorators/microtask-on-connected.js +67 -0
  166. package/generated/internal/privateNamespace.d.ts +14 -0
  167. package/generated/internal/privateNamespace.js +168 -0
  168. package/generated/internal/utils/add.d.ts +1 -0
  169. package/generated/internal/utils/add.js +7 -0
  170. package/generated/internal/utils/cash/ancestors.d.ts +1 -0
  171. package/generated/internal/utils/cash/ancestors.js +27 -0
  172. package/generated/internal/utils/cash/index.d.ts +24 -0
  173. package/generated/internal/utils/cash/index.js +27 -0
  174. package/generated/internal/utils/cash/next-all.d.ts +1 -0
  175. package/generated/internal/utils/cash/next-all.js +10 -0
  176. package/generated/internal/utils/cash/next.d.ts +1 -0
  177. package/generated/internal/utils/cash/next.js +9 -0
  178. package/generated/internal/utils/cash/prev-all.d.ts +1 -0
  179. package/generated/internal/utils/cash/prev-all.js +10 -0
  180. package/generated/internal/utils/cash/prev.d.ts +1 -0
  181. package/generated/internal/utils/cash/prev.js +9 -0
  182. package/generated/internal/utils/cash/prop.d.ts +18 -0
  183. package/generated/internal/utils/cash/prop.js +30 -0
  184. package/generated/internal/utils/cash/siblings.d.ts +1 -0
  185. package/generated/internal/utils/cash/siblings.js +10 -0
  186. package/generated/internal/utils/clamp.d.ts +1 -0
  187. package/generated/internal/utils/clamp.js +4 -0
  188. package/generated/internal/utils/compare-big-decimals.d.ts +1 -0
  189. package/generated/internal/utils/compare-big-decimals.js +80 -0
  190. package/generated/internal/utils/css-time.d.ts +1 -0
  191. package/generated/internal/utils/css-time.js +3 -0
  192. package/generated/internal/utils/debounce.d.ts +1 -0
  193. package/generated/internal/utils/debounce.js +13 -0
  194. package/generated/internal/utils/define-translations.d.ts +1 -0
  195. package/generated/internal/utils/define-translations.js +3 -0
  196. package/generated/internal/utils/dev-flags.d.ts +3 -0
  197. package/generated/internal/utils/dev-flags.js +5 -0
  198. package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
  199. package/generated/internal/utils/ensure-placeholder.js +41 -0
  200. package/generated/internal/utils/frame.d.ts +1 -0
  201. package/generated/internal/utils/frame.js +6 -0
  202. package/generated/internal/utils/index.d.ts +20 -1
  203. package/generated/internal/utils/index.js +23 -1
  204. package/generated/internal/utils/is-inside.d.ts +1 -0
  205. package/generated/internal/utils/is-inside.js +4 -0
  206. package/generated/internal/utils/kebab-case.d.ts +1 -1
  207. package/generated/internal/utils/kebab-case.js +6 -9
  208. package/generated/internal/utils/list-active.d.ts +7 -0
  209. package/generated/internal/utils/list-active.js +83 -0
  210. package/generated/internal/utils/microtask.d.ts +1 -0
  211. package/generated/internal/utils/microtask.js +3 -0
  212. package/generated/internal/utils/onoff.d.ts +45 -0
  213. package/generated/internal/utils/onoff.js +31 -0
  214. package/generated/internal/utils/set.d.ts +1 -0
  215. package/generated/internal/utils/set.js +7 -0
  216. package/generated/internal/utils/sleep.d.ts +1 -0
  217. package/generated/internal/utils/sleep.js +3 -0
  218. package/generated/internal/utils/slow-hide-show.d.ts +1 -0
  219. package/generated/internal/utils/slow-hide-show.js +16 -0
  220. package/generated/internal/utils/timeout.d.ts +5 -0
  221. package/generated/internal/utils/timeout.js +16 -0
  222. package/generated/internal/utils/touch-glass.d.ts +7 -0
  223. package/generated/internal/utils/touch-glass.js +19 -0
  224. package/generated/internal/vendor/morphdom.d.ts +6 -0
  225. package/generated/internal/vendor/morphdom.js +720 -0
  226. package/generated/morphdom/index.d.ts +8 -0
  227. package/generated/morphdom/index.js +8 -0
  228. package/generated/morphdom/morph.d.ts +4 -0
  229. package/generated/morphdom/morph.js +10 -0
  230. package/generated/morphdom/query-morph.d.ts +5 -0
  231. package/generated/morphdom/query-morph.js +12 -0
  232. package/generated/morphdom/render-to-string.d.ts +12 -0
  233. package/generated/morphdom/render-to-string.js +48 -0
  234. package/generated/morphdom/unsafe-html.d.ts +2 -0
  235. package/generated/morphdom/unsafe-html.js +4 -0
  236. package/generated/namespace-browser/base.d.ts +45 -0
  237. package/generated/namespace-browser/base.js +115 -0
  238. package/generated/namespace-browser/event.d.ts +10 -0
  239. package/generated/namespace-browser/event.js +1 -0
  240. package/generated/namespace-browser/index.d.ts +7 -0
  241. package/generated/namespace-browser/index.js +1 -0
  242. package/generated/snapshot/index.d.ts +9 -0
  243. package/generated/snapshot/index.js +60 -0
  244. package/generated/tpl/html.d.ts +5 -0
  245. package/generated/tpl/html.js +7 -0
  246. package/generated/tpl/index.d.ts +6 -0
  247. package/generated/tpl/index.js +6 -0
  248. package/generated/tpl/is-template-result.d.ts +3 -0
  249. package/generated/tpl/is-template-result.js +1 -0
  250. package/generated/tpl/render.d.ts +2 -0
  251. package/generated/tpl/render.js +132 -0
  252. package/package.json +49 -8
  253. package/scss/_base.scss +5 -0
  254. package/scss/_components.scss +90 -0
  255. package/scss/_final.scss +1 -0
  256. package/scss/_functions.scss +31 -0
  257. package/scss/_maps.scss +293 -0
  258. package/scss/_mixins.scss +7 -0
  259. package/scss/_placeholders.scss +3 -0
  260. package/scss/_transitions.scss +32 -0
  261. package/scss/_utils.scss +9 -0
  262. package/scss/_vars.scss +68 -0
  263. package/scss/base/_layout.scss +66 -0
  264. package/scss/base/_reboot.scss +191 -0
  265. package/scss/base/_root.scss +415 -0
  266. package/scss/colors/_index.scss +881 -0
  267. package/scss/components/_alert-dialog.scss +111 -0
  268. package/scss/components/_body-view.scss +17 -0
  269. package/scss/components/_bordered-button.scss +59 -0
  270. package/scss/components/_bordered-prominent-button.scss +65 -0
  271. package/scss/components/_borderless-button.scss +45 -0
  272. package/scss/components/_confirmation-dialog.scss +102 -0
  273. package/scss/components/_content-unavailable.scss +57 -0
  274. package/scss/components/_date-picker.scss +30 -0
  275. package/scss/components/_detail-placeholder.scss +153 -0
  276. package/scss/components/_disclosure-group.scss +179 -0
  277. package/scss/components/_fine-tooltip.scss +84 -0
  278. package/scss/components/_form-view.scss +234 -0
  279. package/scss/components/_full-screen.scss +15 -0
  280. package/scss/components/_glass-button.scss +61 -0
  281. package/scss/components/_glass-prominent-button.scss +71 -0
  282. package/scss/components/_group-box.scss +27 -0
  283. package/scss/components/_h-divider.scss +13 -0
  284. package/scss/components/_h-flex-stack.scss +23 -0
  285. package/scss/components/_h-stack.scss +28 -0
  286. package/scss/components/_image-view.scss +20 -0
  287. package/scss/components/_index.scss +272 -0
  288. package/scss/components/_label-view copy.scss.txt +420 -0
  289. package/scss/components/_label-view.scss +371 -0
  290. package/scss/components/_label-view.scss.txt +536 -0
  291. package/scss/components/_labeled-content.scss +75 -0
  292. package/scss/components/_list-view.scss +270 -0
  293. package/scss/components/_menu-view.scss +223 -0
  294. package/scss/components/_navigation-large-title.scss +44 -0
  295. package/scss/components/_navigation-split-view.scss +424 -0
  296. package/scss/components/_navigation-stack.scss +11 -0
  297. package/scss/components/_navigation-title.scss +10 -0
  298. package/scss/components/_picker-view.scss +329 -0
  299. package/scss/components/_plain-button.scss +19 -0
  300. package/scss/components/_progress-view.scss +98 -0
  301. package/scss/components/_scroll-view-proxy.scss +81 -0
  302. package/scss/components/_scroll-view-toolbars.scss +132 -0
  303. package/scss/components/_scroll-view.scss +134 -0
  304. package/scss/components/_search-view.scss +23 -0
  305. package/scss/components/_section-view.scss +120 -0
  306. package/scss/components/_sheet-view.scss +103 -0
  307. package/scss/components/_sidebar-toggle.scss +121 -0
  308. package/scss/components/_sidebar-view.scss +53 -0
  309. package/scss/components/_sticky-container.scss +42 -0
  310. package/scss/components/_tab-bar.scss +268 -0
  311. package/scss/components/_tab-item.scss +25 -0
  312. package/scss/components/_tab-view.scss +320 -0
  313. package/scss/components/_table-column.scss +54 -0
  314. package/scss/components/_table-row.scss +240 -0
  315. package/scss/components/_table-view.scss +232 -0
  316. package/scss/components/_text-field.scss +57 -0
  317. package/scss/components/_text-view.scss +57 -0
  318. package/scss/components/_toggle-view.scss +161 -0
  319. package/scss/components/_tool-bar-item-group.scss +48 -0
  320. package/scss/components/_tool-bar-item.scss +97 -0
  321. package/scss/components/_tool-bar.scss +153 -0
  322. package/scss/components/_v-divider.scss +13 -0
  323. package/scss/components/_v-flex-stack.scss +29 -0
  324. package/scss/components/_v-keyboard.scss +14 -0
  325. package/scss/components/_v-stack.scss +24 -0
  326. package/scss/final/_touch-glass.scss +98 -0
  327. package/scss/index.scss +18 -1
  328. package/scss/mixins/_button.scss +44 -0
  329. package/scss/mixins/_color.scss +16 -0
  330. package/scss/mixins/_dialog.scss +89 -0
  331. package/scss/mixins/_index.scss +473 -0
  332. package/scss/placeholders/_buttons.scss +118 -0
  333. package/scss/placeholders/_lists.scss +622 -0
  334. package/scss/transitions/_alert-dialog.scss +18 -0
  335. package/scss/transitions/_bwd.navbar.scss +19 -0
  336. package/scss/transitions/_bwd.scss +39 -0
  337. package/scss/transitions/_confirmation-dialog.scss +27 -0
  338. package/scss/transitions/_disclosure-group.scss +35 -0
  339. package/scss/transitions/_fine-tooltip.scss +21 -0
  340. package/scss/transitions/_fwd.navbar.scss +41 -0
  341. package/scss/transitions/_fwd.scss +24 -0
  342. package/scss/transitions/_glass-button.scss +12 -0
  343. package/scss/transitions/_glass-prominent-button.scss +12 -0
  344. package/scss/transitions/_index.scss +74 -0
  345. package/scss/transitions/_menu-view.scss +28 -0
  346. package/scss/transitions/_navigation-split-view.scss +23 -0
  347. package/scss/transitions/_progress-view.scss +23 -0
  348. package/scss/transitions/_sheet-view.scss +30 -0
  349. package/scss/transitions/_sidebar-view.scss +36 -0
  350. package/scss/transitions/_tab-bar.scss +20 -0
  351. package/scss/utils/_frame.scss +103 -0
  352. package/scss/utils/_index.scss +54 -0
  353. package/scss/utils/_scroll-view.scss +14 -0
  354. package/scss/utils/_spacing.scss +25 -0
  355. package/scss/utils/_stacks.scss +112 -0
  356. package/web-components.css-data/en.json +28 -0
  357. package/web-components.html-data/en.json +2612 -0
  358. package/generated/internal/snapshot.d.ts +0 -5
  359. package/generated/internal/snapshot.js +0 -23
  360. package/generated/styles.css +0 -1
@@ -0,0 +1,56 @@
1
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @summary A control that starts an action. Styled with a prominent border, adapting to the button’s surroundings.
7
+ *
8
+ * @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent bordered button
9
+ *
10
+ * @slot overlay
11
+ *
12
+ */
13
+ export class BorderedProminentButton extends ButtonBase {
14
+ static get observedAttributes() {
15
+ return [
16
+ /**
17
+ * A value that describes the purpose of a button
18
+ * @type {destructive|confirm}
19
+ */
20
+ 'role',
21
+ 'title-key',
22
+ ];
23
+ }
24
+ constructor() {
25
+ super();
26
+ }
27
+ static polyfillDisconnectedCallback(el) {
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
30
+ CleanupRegistry.unregister(el);
31
+ }
32
+ static polyfillConnectedCallback(el) {
33
+ if (devFlags.debug)
34
+ console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
35
+ el.tabIndex = 0;
36
+ CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
37
+ }
38
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
+ if (devFlags.debug)
40
+ console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
+ const node = target instanceof HTMLButtonElement;
42
+ if (!node)
43
+ return;
44
+ switch (attributeName) {
45
+ case 'title-key':
46
+ case 'role':
47
+ Snapshot.waitReady.then(() => {
48
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
49
+ });
50
+ break;
51
+ }
52
+ }
53
+ static #handleClick = async (evt) => {
54
+ //
55
+ };
56
+ }
@@ -0,0 +1,17 @@
1
+ import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @summary A control that starts an action. Styled without any borders.
4
+ *
5
+ * @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Use the `is` attribute to style a `button` as a `borderless-button`
6
+ *
7
+ * @slot overlay
8
+ *
9
+ */
10
+ export declare class BorderlessButton extends ButtonBase {
11
+ #private;
12
+ static get observedAttributes(): string[];
13
+ constructor();
14
+ static polyfillDisconnectedCallback(el: BorderlessButton): void;
15
+ static polyfillConnectedCallback(el: BorderlessButton): void;
16
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
17
+ }
@@ -0,0 +1,56 @@
1
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @summary A control that starts an action. Styled without any borders.
7
+ *
8
+ * @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Use the `is` attribute to style a `button` as a `borderless-button`
9
+ *
10
+ * @slot overlay
11
+ *
12
+ */
13
+ export class BorderlessButton extends ButtonBase {
14
+ static get observedAttributes() {
15
+ return [
16
+ /**
17
+ * A value that describes the purpose of a button
18
+ * @type {destructive|confirm}
19
+ */
20
+ 'role',
21
+ 'title-key',
22
+ ];
23
+ }
24
+ constructor() {
25
+ super();
26
+ }
27
+ static polyfillDisconnectedCallback(el) {
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
30
+ CleanupRegistry.unregister(el);
31
+ }
32
+ static polyfillConnectedCallback(el) {
33
+ if (devFlags.debug)
34
+ console.debug(`${BorderlessButton.name} ⚡️ connect`);
35
+ el.tabIndex = 0;
36
+ CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
37
+ }
38
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
+ if (devFlags.debug)
40
+ console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
+ const node = target instanceof HTMLButtonElement;
42
+ if (!node)
43
+ return;
44
+ switch (attributeName) {
45
+ case 'title-key':
46
+ case 'role':
47
+ Snapshot.waitReady.then(() => {
48
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
49
+ });
50
+ break;
51
+ }
52
+ }
53
+ static #handleClick = async (evt) => {
54
+ // alert(99)
55
+ };
56
+ }
@@ -0,0 +1,12 @@
1
+ export declare class ColorScheme extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ constructor();
4
+ connectedCallback(): void;
5
+ disconnectedCallback(): void;
6
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
7
+ }
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'color-scheme': ColorScheme;
11
+ }
12
+ }
@@ -0,0 +1,54 @@
1
+ import { devFlags } from '../internal/utils';
2
+ export class ColorScheme extends HTMLElement {
3
+ static get observedAttributes() {
4
+ return ['dark'];
5
+ }
6
+ constructor() {
7
+ super();
8
+ }
9
+ connectedCallback() {
10
+ if (devFlags.debug)
11
+ console.debug(`${ColorScheme.name} ⚡️ connect`);
12
+ this.hidden = true;
13
+ this.inert = true;
14
+ }
15
+ disconnectedCallback() {
16
+ if (devFlags.debug)
17
+ console.debug(`${ColorScheme.name} ⚡️ disconnect`);
18
+ }
19
+ attributeChangedCallback(name, oldValue, newValue) {
20
+ if (devFlags.debug)
21
+ console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
22
+ // self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
23
+ if (newValue)
24
+ self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
25
+ // @property --canvas {
26
+ // syntax: "<color>";
27
+ // initial-value: oklch(100% 0 0deg);
28
+ // inherits: false;
29
+ // }
30
+ // @media (prefers-color-scheme: dark) {
31
+ // @property --canvas {
32
+ // syntax: "<color>";
33
+ // initial-value: oklch(0% 0 0deg);
34
+ // inherits: false;
35
+ // }
36
+ // }
37
+ // @property --canvastext {
38
+ // syntax: "<color>";
39
+ // initial-value: oklch(0% 0 0deg);
40
+ // inherits: false;
41
+ // }
42
+ // @media (prefers-color-scheme: dark) {
43
+ // @property --canvastext {
44
+ // syntax: "<color>";
45
+ // initial-value: oklch(100% 0 0deg);
46
+ // inherits: false;
47
+ // }
48
+ // }
49
+ // if (CSS.supports('interpolate-size', 'allow-keywords')) {
50
+ // self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
51
+ if (null !== newValue)
52
+ self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
53
+ }
54
+ }
@@ -0,0 +1,12 @@
1
+ import { DialogBase } from '../namespace-browser/base';
2
+ /**
3
+ * @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
4
+ */
5
+ export declare class ConfirmationDialog extends DialogBase {
6
+ #private;
7
+ static get observedAttributes(): string[];
8
+ constructor();
9
+ static polyfillDisconnectedCallback(el: ConfirmationDialog): void;
10
+ static polyfillConnectedCallback(el: ConfirmationDialog): void;
11
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
12
+ }
@@ -0,0 +1,116 @@
1
+ import { confirmationDialog } from '../buses';
2
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
+ import { devFlags, isInside, onoff, touchGlass } from '../internal/utils';
4
+ import { DialogBase } from '../namespace-browser/base';
5
+ /**
6
+ * @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
7
+ */
8
+ export class ConfirmationDialog extends DialogBase {
9
+ static get observedAttributes() {
10
+ return ['anchor'];
11
+ }
12
+ constructor() {
13
+ super();
14
+ }
15
+ static polyfillDisconnectedCallback(el) {
16
+ if (devFlags.debug)
17
+ console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
18
+ const positionAnchor = el.style.getPropertyValue('position-anchor');
19
+ document.querySelector(`[style*="${positionAnchor}"]`)?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, document.querySelector<HTMLElement>(`[style*="${positionAnchor}"]`))
20
+ el.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, el)
21
+ CleanupRegistry.unregister(el);
22
+ confirmationDialog.dispatchEvent(new CustomEvent('confirmation:return', {
23
+ detail: { returnValue: el.returnValue, positionAnchor },
24
+ bubbles: true,
25
+ composed: true,
26
+ }));
27
+ }
28
+ static polyfillConnectedCallback(el) {
29
+ if (devFlags.debug)
30
+ console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
31
+ CleanupRegistry.register(el, onoff([
32
+ { types: 'click', listener: this.#handleDialogClick },
33
+ { types: 'close', listener: this.#handleDialogClose },
34
+ { types: 'cancel', listener: this.#handleDialogCancel },
35
+ ], el).on());
36
+ CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
37
+ if (!(target instanceof HTMLElement))
38
+ return true;
39
+ if (target.matches('[is=confirmation-dialog]'))
40
+ return false;
41
+ // if (!(event.target as HTMLElement).closest('menu-view[open]')) return false
42
+ return true;
43
+ }), el).on());
44
+ if (devFlags.debug)
45
+ console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
46
+ el.removeAttribute('closing');
47
+ el.scrollTop = 0;
48
+ el.returnValue = '';
49
+ el.autofocus = true;
50
+ el.showModal();
51
+ }
52
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
53
+ if (devFlags.debug)
54
+ console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
55
+ // const newValue = (target as HTMLElement).getAttribute(attributeName ?? '')
56
+ switch (attributeName) {
57
+ case 'label':
58
+ // let label = this.querySelector(':scope>[slot=label]')
59
+ // if (newValue) {
60
+ // label ??= this.appendChild($(`<label-view slot="label"></label-view>`))
61
+ // label.setAttribute('title', newValue)
62
+ // } else label?.remove()
63
+ break;
64
+ }
65
+ }
66
+ static #handleDialogClick = (evt) => {
67
+ if (devFlags.debug)
68
+ console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
69
+ const { target, currentTarget: dialog } = evt;
70
+ if (!(dialog instanceof HTMLDialogElement))
71
+ return;
72
+ if (!(target instanceof HTMLElement))
73
+ return;
74
+ if (target.matches('dialog') && !isInside(evt.clientX, evt.clientY, dialog.getBoundingClientRect()))
75
+ return dialog.requestClose(); // click outside
76
+ const button = target.closest('button');
77
+ if (!button)
78
+ return;
79
+ button.scrollIntoView({
80
+ behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant',
81
+ block: 'nearest',
82
+ inline: 'nearest',
83
+ });
84
+ dialog.returnValue = button.value;
85
+ dialog.requestClose(button.value);
86
+ evt.stopPropagation();
87
+ evt.stopImmediatePropagation();
88
+ };
89
+ static #handleDialogCancel = (evt) => {
90
+ if (devFlags.debug)
91
+ console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
92
+ if (!evt.cancelable)
93
+ return;
94
+ const { target } = evt;
95
+ if (!(target instanceof HTMLDialogElement))
96
+ return;
97
+ evt.preventDefault();
98
+ target.inert = true;
99
+ if (devFlags.debug)
100
+ console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
101
+ target.setAttribute('closing', '');
102
+ Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
103
+ if (!target.hasAttribute('closing'))
104
+ return;
105
+ target?.close(target?.returnValue);
106
+ target.removeAttribute('closing');
107
+ });
108
+ };
109
+ static #handleDialogClose = ({ type, target }) => {
110
+ if (devFlags.debug)
111
+ console.debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
112
+ if (!(target instanceof HTMLDialogElement))
113
+ return;
114
+ target.remove();
115
+ };
116
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @summary A message with a title and extra information that you show when part of your app can’t be used.
3
+ *
4
+ * @example <content-unavailable search></content-unavailable>
5
+ *
6
+ * @example <content-unavailable search="foo"></content-unavailable>
7
+ *
8
+ * @example <content-unavailable padding><label-view title="No Mail"><i class="ph ph-tray" slot="icon" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
9
+ *
10
+ * @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
11
+ *
12
+ * @slot — The default slot.
13
+ * @slot description
14
+ * @slot actions
15
+ *
16
+ */
17
+ export declare class ContentUnavailable extends HTMLElement {
18
+ #private;
19
+ static get observedAttributes(): string[];
20
+ static get template(): DocumentFragment;
21
+ constructor();
22
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
23
+ disconnectedCallback(): void;
24
+ connectedCallback(): void;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ 'content-unavailable': ContentUnavailable;
29
+ }
30
+ }
@@ -0,0 +1,82 @@
1
+ import { I18n } from '../i18n';
2
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
+ import { $, devFlags, onoff } from '../internal/utils';
4
+ import { html } from '../tpl';
5
+ /**
6
+ * @summary A message with a title and extra information that you show when part of your app can’t be used.
7
+ *
8
+ * @example <content-unavailable search></content-unavailable>
9
+ *
10
+ * @example <content-unavailable search="foo"></content-unavailable>
11
+ *
12
+ * @example <content-unavailable padding><label-view title="No Mail"><i class="ph ph-tray" slot="icon" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
13
+ *
14
+ * @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
15
+ *
16
+ * @slot — The default slot.
17
+ * @slot description
18
+ * @slot actions
19
+ *
20
+ */
21
+ export class ContentUnavailable extends HTMLElement {
22
+ static get observedAttributes() {
23
+ return ['search'];
24
+ }
25
+ static #template;
26
+ static get template() {
27
+ return (this.#template ??= $(html `<div part="root content-unavailable-title-stack">
28
+ <slot></slot>
29
+ </div>
30
+ <div part="root content-unavailable-description-stack">
31
+ <slot name="description"></slot>
32
+ </div>
33
+ <div part="root content-unavailable-actions-stack">
34
+ <slot name="actions"></slot>
35
+ </div>`));
36
+ }
37
+ #shadowRoot;
38
+ #slots;
39
+ constructor() {
40
+ super();
41
+ this.#shadowRoot = this.attachShadow({ mode: 'closed' });
42
+ this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
43
+ this.#slots = {
44
+ '': this.#shadowRoot.querySelector('slot:not([name])') ?? undefined,
45
+ description: this.#shadowRoot.querySelector('slot[name="description"]') ?? undefined,
46
+ actions: this.#shadowRoot.querySelector('slot[name="actions"]') ?? undefined,
47
+ };
48
+ }
49
+ attributeChangedCallback(name, oldValue, newValue) {
50
+ if (devFlags.debug)
51
+ console.debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
52
+ switch (name) {
53
+ case 'search':
54
+ if (oldValue === newValue)
55
+ break;
56
+ this.#renderSearch(newValue);
57
+ CleanupRegistry.unregister(this, 'i18n');
58
+ CleanupRegistry.register(this, onoff('localechange', () => {
59
+ this.#renderSearch(this.getAttribute('search'));
60
+ }, I18n.on).on(), 'i18n');
61
+ break;
62
+ }
63
+ }
64
+ disconnectedCallback() {
65
+ if (devFlags.debug)
66
+ console.debug(`${ContentUnavailable.name} ⚡️ disconnect`);
67
+ }
68
+ connectedCallback() {
69
+ if (devFlags.debug)
70
+ console.debug(`${ContentUnavailable.name} ⚡️ connect`);
71
+ }
72
+ #renderSearch = (search) => {
73
+ const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(html `<label-view><i class="ph ph-magnifying-glass" slot="icon" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(html `<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
74
+ if (search) {
75
+ const interpolate = (text, vars) => text.replaceAll(/\{(\w+)\}/g, (_, key) => vars[key] ?? '');
76
+ titleLabel.setAttribute('title', interpolate(I18n.t('SearchUnavailableContent').Label, { search }));
77
+ }
78
+ else
79
+ titleLabel?.setAttribute('title', I18n.t('SearchUnavailableContent').NoLabel);
80
+ descText.setAttribute('title', I18n.t('SearchUnavailableContent').Description);
81
+ };
82
+ }
@@ -0,0 +1,52 @@
1
+ import { FormAssociatedBase } from '../internal/class/form-associated-base';
2
+ declare const datePickerStyles: readonly ["graphical", "field", "automatic"];
3
+ export type DatePickerStyle = (typeof datePickerStyles)[number];
4
+ /**
5
+ * @summary A control that selects an absolute date.
6
+ */
7
+ export declare class DatePicker extends FormAssociatedBase {
8
+ #private;
9
+ static get observedAttributes(): string[];
10
+ get template(): DocumentFragment;
11
+ constructor();
12
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
13
+ disconnectedCallback(): void;
14
+ connectedCallback(): void;
15
+ get datePickerStyle(): DatePickerStyle;
16
+ /**
17
+ * Form participation property
18
+ */
19
+ get name(): string;
20
+ get value(): {
21
+ year: string;
22
+ month: string;
23
+ day: string;
24
+ };
25
+ /**
26
+ * Returns the value as a Date object.
27
+ * @type {Date|null}
28
+ */
29
+ get valueAsDate(): Date | null;
30
+ get minimum(): {
31
+ year: string;
32
+ month: string;
33
+ day: string;
34
+ } | null;
35
+ get maximum(): {
36
+ year: string;
37
+ month: string;
38
+ day: string;
39
+ } | null;
40
+ setValidity: (flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement) => void;
41
+ setCustomValidity: (message: string) => void;
42
+ formStateRestoreCallback(state: string, reason: string): void;
43
+ formAssociatedCallback(form: HTMLFormElement): void;
44
+ formDisabledCallback(disabled: boolean): void;
45
+ formResetCallback(): void;
46
+ }
47
+ declare global {
48
+ interface HTMLElementTagNameMap {
49
+ 'date-picker': DatePicker;
50
+ }
51
+ }
52
+ export {};