@syware/jlib 0.0.0-stage → 0.1.0

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 (331) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -2
  3. package/dist/all.d.ts +1 -0
  4. package/dist/all.js +75 -0
  5. package/dist/atoms/jl-avatar.css_raw.js +3 -0
  6. package/dist/atoms/jl-avatar.d.ts +52 -0
  7. package/dist/atoms/jl-avatar.js +167 -0
  8. package/dist/atoms/jl-badge.css_raw.js +3 -0
  9. package/dist/atoms/jl-badge.d.ts +32 -0
  10. package/dist/atoms/jl-badge.js +60 -0
  11. package/dist/atoms/jl-button.css_raw.js +3 -0
  12. package/dist/atoms/jl-button.d.ts +70 -0
  13. package/dist/atoms/jl-button.js +146 -0
  14. package/dist/atoms/jl-checkbox.css_raw.js +3 -0
  15. package/dist/atoms/jl-checkbox.d.ts +61 -0
  16. package/dist/atoms/jl-checkbox.js +149 -0
  17. package/dist/atoms/jl-chip.css_raw.js +3 -0
  18. package/dist/atoms/jl-chip.d.ts +59 -0
  19. package/dist/atoms/jl-chip.js +164 -0
  20. package/dist/atoms/jl-divider.css_raw.js +3 -0
  21. package/dist/atoms/jl-divider.d.ts +26 -0
  22. package/dist/atoms/jl-divider.js +59 -0
  23. package/dist/atoms/jl-icon.css_raw.js +3 -0
  24. package/dist/atoms/jl-icon.d.ts +25 -0
  25. package/dist/atoms/jl-icon.js +41 -0
  26. package/dist/atoms/jl-input.css_raw.js +3 -0
  27. package/dist/atoms/jl-input.d.ts +112 -0
  28. package/dist/atoms/jl-input.js +202 -0
  29. package/dist/atoms/jl-kbd.css_raw.js +3 -0
  30. package/dist/atoms/jl-kbd.d.ts +17 -0
  31. package/dist/atoms/jl-kbd.js +62 -0
  32. package/dist/atoms/jl-link.css_raw.js +3 -0
  33. package/dist/atoms/jl-link.d.ts +37 -0
  34. package/dist/atoms/jl-link.js +86 -0
  35. package/dist/atoms/jl-progress-ring.css_raw.js +3 -0
  36. package/dist/atoms/jl-progress-ring.d.ts +49 -0
  37. package/dist/atoms/jl-progress-ring.js +132 -0
  38. package/dist/atoms/jl-progress.css_raw.js +3 -0
  39. package/dist/atoms/jl-progress.d.ts +43 -0
  40. package/dist/atoms/jl-progress.js +109 -0
  41. package/dist/atoms/jl-rating.css_raw.js +3 -0
  42. package/dist/atoms/jl-rating.d.ts +73 -0
  43. package/dist/atoms/jl-rating.js +184 -0
  44. package/dist/atoms/jl-select.css_raw.js +3 -0
  45. package/dist/atoms/jl-select.d.ts +70 -0
  46. package/dist/atoms/jl-select.js +146 -0
  47. package/dist/atoms/jl-skeleton.css_raw.js +3 -0
  48. package/dist/atoms/jl-skeleton.d.ts +34 -0
  49. package/dist/atoms/jl-skeleton.js +63 -0
  50. package/dist/atoms/jl-slider.css_raw.js +3 -0
  51. package/dist/atoms/jl-slider.d.ts +65 -0
  52. package/dist/atoms/jl-slider.js +143 -0
  53. package/dist/atoms/jl-spinner.css_raw.js +3 -0
  54. package/dist/atoms/jl-spinner.d.ts +16 -0
  55. package/dist/atoms/jl-spinner.js +26 -0
  56. package/dist/atoms/jl-switch.css_raw.js +3 -0
  57. package/dist/atoms/jl-switch.d.ts +57 -0
  58. package/dist/atoms/jl-switch.js +125 -0
  59. package/dist/atoms/jl-textarea.css_raw.js +3 -0
  60. package/dist/atoms/jl-textarea.d.ts +81 -0
  61. package/dist/atoms/jl-textarea.js +148 -0
  62. package/dist/base/jl-element.d.ts +16 -0
  63. package/dist/base/jl-element.js +35 -0
  64. package/dist/base/jl-form-control.d.ts +29 -0
  65. package/dist/base/jl-form-control.js +44 -0
  66. package/dist/index.d.ts +119 -0
  67. package/dist/index.js +72 -0
  68. package/dist/lib/arrow.d.ts +6 -0
  69. package/dist/lib/arrow.js +15 -0
  70. package/dist/lib/attributes.d.ts +9 -0
  71. package/dist/lib/attributes.js +22 -0
  72. package/dist/lib/avatar.d.ts +11 -0
  73. package/dist/lib/avatar.js +37 -0
  74. package/dist/lib/calendar.d.ts +48 -0
  75. package/dist/lib/calendar.js +166 -0
  76. package/dist/lib/css-length.d.ts +2 -0
  77. package/dist/lib/css-length.js +8 -0
  78. package/dist/lib/define.d.ts +9 -0
  79. package/dist/lib/define.js +9 -0
  80. package/dist/lib/dom.d.ts +4 -0
  81. package/dist/lib/dom.js +16 -0
  82. package/dist/lib/files.d.ts +18 -0
  83. package/dist/lib/files.js +89 -0
  84. package/dist/lib/floating.d.ts +13 -0
  85. package/dist/lib/floating.js +127 -0
  86. package/dist/lib/fuzzy.d.ts +26 -0
  87. package/dist/lib/fuzzy.js +149 -0
  88. package/dist/lib/highlight.d.ts +5 -0
  89. package/dist/lib/highlight.js +267 -0
  90. package/dist/lib/hotkey.d.ts +9 -0
  91. package/dist/lib/hotkey.js +101 -0
  92. package/dist/lib/icon-set.d.ts +95 -0
  93. package/dist/lib/icon-set.js +97 -0
  94. package/dist/lib/icons.d.ts +12 -0
  95. package/dist/lib/icons.js +39 -0
  96. package/dist/lib/indicator.d.ts +6 -0
  97. package/dist/lib/indicator.js +18 -0
  98. package/dist/lib/keep-in-view.d.ts +5 -0
  99. package/dist/lib/keep-in-view.js +15 -0
  100. package/dist/lib/key-shortcut.d.ts +20 -0
  101. package/dist/lib/key-shortcut.js +100 -0
  102. package/dist/lib/keycaps.d.ts +8 -0
  103. package/dist/lib/keycaps.js +162 -0
  104. package/dist/lib/locale.d.ts +4 -0
  105. package/dist/lib/locale.js +13 -0
  106. package/dist/lib/nav-tree.d.ts +9 -0
  107. package/dist/lib/nav-tree.js +30 -0
  108. package/dist/lib/numeric.d.ts +20 -0
  109. package/dist/lib/numeric.js +50 -0
  110. package/dist/lib/option-filter.d.ts +29 -0
  111. package/dist/lib/option-filter.js +108 -0
  112. package/dist/lib/option-groups.d.ts +6 -0
  113. package/dist/lib/option-groups.js +26 -0
  114. package/dist/lib/options.d.ts +5 -0
  115. package/dist/lib/options.js +24 -0
  116. package/dist/lib/pagination.d.ts +9 -0
  117. package/dist/lib/pagination.js +52 -0
  118. package/dist/lib/palette.d.ts +8 -0
  119. package/dist/lib/palette.js +46 -0
  120. package/dist/lib/progress.d.ts +20 -0
  121. package/dist/lib/progress.js +33 -0
  122. package/dist/lib/rating.d.ts +7 -0
  123. package/dist/lib/rating.js +26 -0
  124. package/dist/lib/roving-index.d.ts +10 -0
  125. package/dist/lib/roving-index.js +32 -0
  126. package/dist/lib/roving.d.ts +11 -0
  127. package/dist/lib/roving.js +21 -0
  128. package/dist/lib/slots.d.ts +2 -0
  129. package/dist/lib/slots.js +6 -0
  130. package/dist/lib/sparkline.d.ts +11 -0
  131. package/dist/lib/sparkline.js +42 -0
  132. package/dist/lib/split.d.ts +12 -0
  133. package/dist/lib/split.js +37 -0
  134. package/dist/lib/surface.d.ts +7 -0
  135. package/dist/lib/surface.js +28 -0
  136. package/dist/lib/table.d.ts +30 -0
  137. package/dist/lib/table.js +110 -0
  138. package/dist/lib/tags.d.ts +14 -0
  139. package/dist/lib/tags.js +29 -0
  140. package/dist/lib/text.d.ts +5 -0
  141. package/dist/lib/text.js +13 -0
  142. package/dist/lib/tokens.d.ts +5 -0
  143. package/dist/lib/tokens.js +15 -0
  144. package/dist/lib/tree.d.ts +16 -0
  145. package/dist/lib/tree.js +89 -0
  146. package/dist/lib/trend.d.ts +3 -0
  147. package/dist/lib/trend.js +15 -0
  148. package/dist/lib/trigger.d.ts +11 -0
  149. package/dist/lib/trigger.js +34 -0
  150. package/dist/molecules/jl-accordion-item.css_raw.js +3 -0
  151. package/dist/molecules/jl-accordion-item.d.ts +34 -0
  152. package/dist/molecules/jl-accordion-item.js +82 -0
  153. package/dist/molecules/jl-accordion.css_raw.js +3 -0
  154. package/dist/molecules/jl-accordion.d.ts +27 -0
  155. package/dist/molecules/jl-accordion.js +61 -0
  156. package/dist/molecules/jl-alert.css_raw.js +3 -0
  157. package/dist/molecules/jl-alert.d.ts +38 -0
  158. package/dist/molecules/jl-alert.js +131 -0
  159. package/dist/molecules/jl-avatar-group.css_raw.js +3 -0
  160. package/dist/molecules/jl-avatar-group.d.ts +28 -0
  161. package/dist/molecules/jl-avatar-group.js +69 -0
  162. package/dist/molecules/jl-breadcrumb.css_raw.js +3 -0
  163. package/dist/molecules/jl-breadcrumb.d.ts +35 -0
  164. package/dist/molecules/jl-breadcrumb.js +126 -0
  165. package/dist/molecules/jl-calendar.css_raw.js +3 -0
  166. package/dist/molecules/jl-calendar.d.ts +101 -0
  167. package/dist/molecules/jl-calendar.js +314 -0
  168. package/dist/molecules/jl-card.css_raw.js +3 -0
  169. package/dist/molecules/jl-card.d.ts +46 -0
  170. package/dist/molecules/jl-card.js +172 -0
  171. package/dist/molecules/jl-code-block.css_raw.js +3 -0
  172. package/dist/molecules/jl-code-block.d.ts +44 -0
  173. package/dist/molecules/jl-code-block.js +106 -0
  174. package/dist/molecules/jl-combobox.css_raw.js +3 -0
  175. package/dist/molecules/jl-combobox.d.ts +120 -0
  176. package/dist/molecules/jl-combobox.js +450 -0
  177. package/dist/molecules/jl-copy-button.css_raw.js +3 -0
  178. package/dist/molecules/jl-copy-button.d.ts +31 -0
  179. package/dist/molecules/jl-copy-button.js +69 -0
  180. package/dist/molecules/jl-date-picker.css_raw.js +3 -0
  181. package/dist/molecules/jl-date-picker.d.ts +109 -0
  182. package/dist/molecules/jl-date-picker.js +322 -0
  183. package/dist/molecules/jl-empty.css_raw.js +3 -0
  184. package/dist/molecules/jl-empty.d.ts +32 -0
  185. package/dist/molecules/jl-empty.js +94 -0
  186. package/dist/molecules/jl-field.css_raw.js +3 -0
  187. package/dist/molecules/jl-field.d.ts +49 -0
  188. package/dist/molecules/jl-field.js +147 -0
  189. package/dist/molecules/jl-file-drop.css_raw.js +3 -0
  190. package/dist/molecules/jl-file-drop.d.ts +93 -0
  191. package/dist/molecules/jl-file-drop.js +366 -0
  192. package/dist/molecules/jl-list-item.css_raw.js +3 -0
  193. package/dist/molecules/jl-list-item.d.ts +56 -0
  194. package/dist/molecules/jl-list-item.js +176 -0
  195. package/dist/molecules/jl-menu.css_raw.js +3 -0
  196. package/dist/molecules/jl-menu.d.ts +62 -0
  197. package/dist/molecules/jl-menu.js +288 -0
  198. package/dist/molecules/jl-number-input.css_raw.js +3 -0
  199. package/dist/molecules/jl-number-input.d.ts +81 -0
  200. package/dist/molecules/jl-number-input.js +220 -0
  201. package/dist/molecules/jl-pagination.css_raw.js +3 -0
  202. package/dist/molecules/jl-pagination.d.ts +59 -0
  203. package/dist/molecules/jl-pagination.js +172 -0
  204. package/dist/molecules/jl-popover.css_raw.js +3 -0
  205. package/dist/molecules/jl-popover.d.ts +49 -0
  206. package/dist/molecules/jl-popover.js +152 -0
  207. package/dist/molecules/jl-radio-group.css_raw.js +3 -0
  208. package/dist/molecules/jl-radio-group.d.ts +71 -0
  209. package/dist/molecules/jl-radio-group.js +202 -0
  210. package/dist/molecules/jl-search.css_raw.js +3 -0
  211. package/dist/molecules/jl-search.d.ts +71 -0
  212. package/dist/molecules/jl-search.js +210 -0
  213. package/dist/molecules/jl-segmented.css_raw.js +3 -0
  214. package/dist/molecules/jl-segmented.d.ts +65 -0
  215. package/dist/molecules/jl-segmented.js +187 -0
  216. package/dist/molecules/jl-stat.css_raw.js +3 -0
  217. package/dist/molecules/jl-stat.d.ts +55 -0
  218. package/dist/molecules/jl-stat.js +169 -0
  219. package/dist/molecules/jl-steps.css_raw.js +3 -0
  220. package/dist/molecules/jl-steps.d.ts +44 -0
  221. package/dist/molecules/jl-steps.js +118 -0
  222. package/dist/molecules/jl-tab-panel.css_raw.js +3 -0
  223. package/dist/molecules/jl-tab-panel.d.ts +35 -0
  224. package/dist/molecules/jl-tab-panel.js +35 -0
  225. package/dist/molecules/jl-tabs.css_raw.js +3 -0
  226. package/dist/molecules/jl-tabs.d.ts +51 -0
  227. package/dist/molecules/jl-tabs.js +198 -0
  228. package/dist/molecules/jl-tag-input.css_raw.js +3 -0
  229. package/dist/molecules/jl-tag-input.d.ts +103 -0
  230. package/dist/molecules/jl-tag-input.js +429 -0
  231. package/dist/molecules/jl-timeline.css_raw.js +3 -0
  232. package/dist/molecules/jl-timeline.d.ts +28 -0
  233. package/dist/molecules/jl-timeline.js +81 -0
  234. package/dist/molecules/jl-toast.css_raw.js +3 -0
  235. package/dist/molecules/jl-toast.d.ts +75 -0
  236. package/dist/molecules/jl-toast.js +274 -0
  237. package/dist/molecules/jl-tooltip.css_raw.js +3 -0
  238. package/dist/molecules/jl-tooltip.d.ts +44 -0
  239. package/dist/molecules/jl-tooltip.js +160 -0
  240. package/dist/organisms/jl-command-palette.css_raw.js +3 -0
  241. package/dist/organisms/jl-command-palette.d.ts +60 -0
  242. package/dist/organisms/jl-command-palette.js +285 -0
  243. package/dist/organisms/jl-confirm.css_raw.js +3 -0
  244. package/dist/organisms/jl-confirm.d.ts +56 -0
  245. package/dist/organisms/jl-confirm.js +132 -0
  246. package/dist/organisms/jl-dialog.css_raw.js +3 -0
  247. package/dist/organisms/jl-dialog.d.ts +43 -0
  248. package/dist/organisms/jl-dialog.js +120 -0
  249. package/dist/organisms/jl-drawer.css_raw.js +3 -0
  250. package/dist/organisms/jl-drawer.d.ts +50 -0
  251. package/dist/organisms/jl-drawer.js +141 -0
  252. package/dist/organisms/jl-navbar.css_raw.js +3 -0
  253. package/dist/organisms/jl-navbar.d.ts +32 -0
  254. package/dist/organisms/jl-navbar.js +121 -0
  255. package/dist/organisms/jl-page-header.css_raw.js +3 -0
  256. package/dist/organisms/jl-page-header.d.ts +26 -0
  257. package/dist/organisms/jl-page-header.js +85 -0
  258. package/dist/organisms/jl-side-nav.css_raw.js +3 -0
  259. package/dist/organisms/jl-side-nav.d.ts +60 -0
  260. package/dist/organisms/jl-side-nav.js +269 -0
  261. package/dist/organisms/jl-table.css_raw.js +3 -0
  262. package/dist/organisms/jl-table.d.ts +109 -0
  263. package/dist/organisms/jl-table.js +318 -0
  264. package/dist/organisms/jl-toaster.css_raw.js +3 -0
  265. package/dist/organisms/jl-toaster.d.ts +48 -0
  266. package/dist/organisms/jl-toaster.js +142 -0
  267. package/dist/organisms/jl-tree.css_raw.js +3 -0
  268. package/dist/organisms/jl-tree.d.ts +59 -0
  269. package/dist/organisms/jl-tree.js +198 -0
  270. package/dist/styles/base.css_raw.js +3 -0
  271. package/dist/styles/control.css_raw.js +3 -0
  272. package/dist/styles/floating.css_raw.js +3 -0
  273. package/dist/styles/shared.d.ts +8 -0
  274. package/dist/styles/shared.js +14 -0
  275. package/dist/styles/tokens.css_raw.js +3 -0
  276. package/dist/templates/jl-app-shell.css_raw.js +3 -0
  277. package/dist/templates/jl-app-shell.d.ts +37 -0
  278. package/dist/templates/jl-app-shell.js +150 -0
  279. package/dist/templates/jl-split-view.css_raw.js +3 -0
  280. package/dist/templates/jl-split-view.d.ts +49 -0
  281. package/dist/templates/jl-split-view.js +149 -0
  282. package/dist/tokens.css +188 -0
  283. package/dist/types/calendar.types.d.ts +11 -0
  284. package/dist/types/files.types.d.ts +23 -0
  285. package/dist/types/floating.types.d.ts +13 -0
  286. package/dist/types/fuzzy.types.d.ts +10 -0
  287. package/dist/types/highlight.types.d.ts +6 -0
  288. package/dist/types/hotkey.types.d.ts +19 -0
  289. package/dist/types/jl-accordion.types.d.ts +2 -0
  290. package/dist/types/jl-avatar.types.d.ts +10 -0
  291. package/dist/types/jl-breadcrumb.types.d.ts +6 -0
  292. package/dist/types/jl-button.types.d.ts +3 -0
  293. package/dist/types/jl-card.types.d.ts +2 -0
  294. package/dist/types/jl-chip.types.d.ts +1 -0
  295. package/dist/types/jl-combobox.types.d.ts +8 -0
  296. package/dist/types/jl-command-palette.types.d.ts +22 -0
  297. package/dist/types/jl-confirm.types.d.ts +10 -0
  298. package/dist/types/jl-dialog.types.d.ts +1 -0
  299. package/dist/types/jl-divider.types.d.ts +2 -0
  300. package/dist/types/jl-drawer.types.d.ts +4 -0
  301. package/dist/types/jl-empty.types.d.ts +2 -0
  302. package/dist/types/jl-field.types.d.ts +2 -0
  303. package/dist/types/jl-input.types.d.ts +1 -0
  304. package/dist/types/jl-link.types.d.ts +2 -0
  305. package/dist/types/jl-menu.types.d.ts +22 -0
  306. package/dist/types/jl-navbar.types.d.ts +6 -0
  307. package/dist/types/jl-progress.types.d.ts +3 -0
  308. package/dist/types/jl-radio-group.types.d.ts +10 -0
  309. package/dist/types/jl-segmented.types.d.ts +7 -0
  310. package/dist/types/jl-select.types.d.ts +12 -0
  311. package/dist/types/jl-side-nav.types.d.ts +17 -0
  312. package/dist/types/jl-skeleton.types.d.ts +2 -0
  313. package/dist/types/jl-slider.types.d.ts +5 -0
  314. package/dist/types/jl-split-view.types.d.ts +2 -0
  315. package/dist/types/jl-stat.types.d.ts +2 -0
  316. package/dist/types/jl-steps.types.d.ts +8 -0
  317. package/dist/types/jl-switch.types.d.ts +1 -0
  318. package/dist/types/jl-table.types.d.ts +30 -0
  319. package/dist/types/jl-tabs.types.d.ts +2 -0
  320. package/dist/types/jl-timeline.types.d.ts +10 -0
  321. package/dist/types/jl-toast.types.d.ts +2 -0
  322. package/dist/types/jl-toaster.types.d.ts +23 -0
  323. package/dist/types/jl-tree.types.d.ts +26 -0
  324. package/dist/types/key-shortcut.types.d.ts +9 -0
  325. package/dist/types/keycaps.types.d.ts +7 -0
  326. package/dist/types/option-filter.types.d.ts +10 -0
  327. package/dist/types/options.types.d.ts +4 -0
  328. package/dist/types/pagination.types.d.ts +8 -0
  329. package/dist/types/roving-index.types.d.ts +2 -0
  330. package/dist/types/sparkline.types.d.ts +11 -0
  331. package/package.json +96 -4
@@ -0,0 +1,3 @@
1
+ // src/molecules/jl-tabs.css?raw
2
+ var jl_tabs_default = ":host {\n display: block;\n}\n\n.scroller {\n position: relative;\n overflow-x: auto;\n scrollbar-width: none;\n /* The row scrolls rather than widening what holds the tabs: its labels do not count in the page's layout. */\n contain: inline-size;\n}\n\n.list {\n display: flex;\n gap: 4px;\n width: max-content;\n min-width: 100%;\n}\n\n.tab {\n position: relative;\n z-index: 1;\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: 8px;\n height: 40px;\n padding: 0 12px;\n border: none;\n border-radius: var(--jl-radius-xs);\n background: none;\n color: var(--jl-muted);\n font-size: var(--jl-font-md);\n font-weight: 600;\n white-space: nowrap;\n cursor: pointer;\n transition: color var(--jl-fast) var(--jl-ease);\n}\n\n.tab:hover {\n color: var(--jl-text);\n}\n\n.tab[aria-selected=\"true\"] {\n color: var(--jl-text);\n}\n\n.tab[aria-disabled] {\n color: var(--jl-faint);\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.badge {\n min-width: 20px;\n padding: 1px 6px;\n border-radius: var(--jl-radius-pill);\n background: var(--jl-surface-3);\n color: var(--jl-text-2);\n font-size: 11px;\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n line-height: 16px;\n}\n\n.tab[aria-selected=\"true\"] .badge {\n background: var(--jl-accent-soft);\n color: var(--jl-accent);\n}\n\n.indicator {\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n\n.indicator[data-placed] {\n transition:\n transform var(--jl-slow) var(--jl-ease),\n width var(--jl-slow) var(--jl-ease);\n}\n\n/* Line: a row of labels over a rule; the open tab is underlined in the accent colour. */\n:host(:not([variant=\"pill\"])) .scroller {\n box-shadow: inset 0 -1px 0 var(--jl-line);\n}\n\n:host(:not([variant=\"pill\"])) .indicator {\n top: auto;\n bottom: 0;\n width: var(--w);\n height: 2px;\n border-radius: 2px 2px 0 0;\n background: var(--jl-accent);\n transform: translateX(var(--x));\n}\n\n/* Pill: the open tab sits on a soft accent pill. */\n:host([variant=\"pill\"]) .tab {\n height: 32px;\n padding: 0 14px;\n border-radius: var(--jl-radius-pill);\n}\n\n:host([variant=\"pill\"]) .tab:hover:not([aria-selected=\"true\"]) {\n background: var(--jl-surface-2);\n}\n\n:host([variant=\"pill\"]) .tab[aria-selected=\"true\"] {\n color: var(--jl-accent);\n}\n\n:host([variant=\"pill\"]) .indicator {\n width: var(--w);\n height: var(--h);\n border-radius: var(--jl-radius-pill);\n background: var(--jl-accent-soft);\n transform: translate(var(--x), var(--y));\n}\n\n:host([variant=\"pill\"]) .tab[aria-selected=\"true\"] .badge {\n background: var(--jl-surface);\n}\n\n:host([block]) .list {\n width: 100%;\n}\n\n:host([block]) .tab {\n flex: 1;\n}\n\n.panels {\n padding-top: 16px;\n}\n\n/* Inside the scrolling row, a ring drawn outside the tab would be cut: draw it inside. */\n.tab:focus-visible {\n box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--jl-brand) 60%, transparent);\n}\n";
3
+ export { jl_tabs_default as default };
@@ -0,0 +1,51 @@
1
+ import { JlElement } from '../base/jl-element';
2
+ import type { TabsVariant } from '../types/jl-tabs.types';
3
+ export declare const TAB_VARIANTS: readonly TabsVariant[];
4
+ /**
5
+ * Tabs over panels: the `jl-tab-panel` children make the tabs, and one panel shows at a time. `value` is the open
6
+ * panel's name (the first panel by default); `change` fires with the name when people pick another tab.
7
+ */
8
+ export declare class JlTabs extends JlElement {
9
+ static readonly selector = "jl-tabs";
10
+ readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
11
+ change: string;
12
+ }>>;
13
+ readonly value: Readonly<Readonly<{
14
+ get(): string;
15
+ set(setter: string | ((prevState: string) => string)): void;
16
+ }>>;
17
+ readonly variant: Readonly<Readonly<{
18
+ get(): TabsVariant;
19
+ set(setter: ((prevState: TabsVariant) => TabsVariant) | TabsVariant): void;
20
+ }>>;
21
+ /** The tabs share the whole width. */
22
+ readonly block: Readonly<Readonly<{
23
+ get(): boolean;
24
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
25
+ }>>;
26
+ /** The tab list's name for screen readers, when the page has no heading that says it. */
27
+ readonly label: Readonly<Readonly<{
28
+ get(): string;
29
+ set(setter: string | ((prevState: string) => string)): void;
30
+ }>>;
31
+ private readonly _observers;
32
+ private readonly _refs;
33
+ templateHtml(): Node;
34
+ templateCss(): string;
35
+ onConnect(): void;
36
+ onDisconnect(): void;
37
+ private panels;
38
+ private tabs;
39
+ /** Only the tabs' own panels matter, not the attributes of what the panels hold. */
40
+ private onMutations;
41
+ /** The index of the open panel: the one `value` names, or the first that can open. */
42
+ private selectedIndex;
43
+ private render;
44
+ /** Adds or removes tab buttons to match the panels; the buttons left keep their focus. */
45
+ private syncTabCount;
46
+ private renderTab;
47
+ private placeIndicator;
48
+ private onKeydown;
49
+ /** Opens the panel of a tab people picked, and says so. */
50
+ private choose;
51
+ }
@@ -0,0 +1,198 @@
1
+ import { BASE_STYLES } from "../styles/shared.js";
2
+ import { JlElement } from "../base/jl-element.js";
3
+ import { oneOf } from "../lib/attributes.js";
4
+ import { define } from "../lib/define.js";
5
+ import { setOrRemove, uniqueId } from "../lib/dom.js";
6
+ import { JlIcon } from "../atoms/jl-icon.js";
7
+ import { firstIndex, lastIndex, stepIndex } from "../lib/roving.js";
8
+ import { moveIndicator } from "../lib/indicator.js";
9
+ import { JlTabPanel } from "./jl-tab-panel.js";
10
+ import jl_tabs_default from "./jl-tabs.css_raw.js";
11
+ import { css } from "@jadis/core";
12
+ import { jsx, jsxs } from "@jadis/core/jsx-runtime";
13
+ // src/molecules/jl-tabs.tsx
14
+ var TAB_VARIANTS = ["line", "pill"];
15
+ define(JlTabPanel);
16
+ var ICON_SIZE = 16;
17
+ var PANEL_ATTRIBUTES = [
18
+ "name",
19
+ "label",
20
+ "icon",
21
+ "badge",
22
+ "disabled"
23
+ ];
24
+ var KEY_MOVES = /* @__PURE__ */ new Map([
25
+ ["ArrowLeft", (enabled, from) => stepIndex(enabled, from, -1)],
26
+ ["ArrowRight", (enabled, from) => stepIndex(enabled, from, 1)],
27
+ ["End", lastIndex],
28
+ ["Home", firstIndex]
29
+ ]);
30
+ var isPanel = (element) => element.localName === JlTabPanel.selector;
31
+ /** A panel's name for `value`: its `name`, or its position when it has none. */
32
+ var panelName = (panel, index) => panel.getAttribute("name") || String(index);
33
+ var isDisabled = (panel) => panel.hasAttribute("disabled");
34
+ /**
35
+ * Tabs over panels: the `jl-tab-panel` children make the tabs, and one panel shows at a time. `value` is the open
36
+ * panel's name (the first panel by default); `change` fires with the name when people pick another tab.
37
+ */
38
+ var JlTabs = class extends JlElement {
39
+ static selector = "jl-tabs";
40
+ events = this.useEvents();
41
+ value = this.useChange("", () => this.render(), { attribute: "value" });
42
+ variant = this.useChange("line", (value) => {
43
+ this.reflect("variant", value);
44
+ this.placeIndicator();
45
+ }, {
46
+ attribute: "variant",
47
+ parse: oneOf(TAB_VARIANTS, "line")
48
+ });
49
+ /** The tabs share the whole width. */
50
+ block = this.useChange(false, (value) => {
51
+ this.reflect("block", value);
52
+ this.placeIndicator();
53
+ }, { attribute: "block" });
54
+ /** The tab list's name for screen readers, when the page has no heading that says it. */
55
+ label = this.useChange("", (value) => setOrRemove(this._refs.list, "aria-label", value), { attribute: "label" });
56
+ _observers = {
57
+ mutations: new MutationObserver((records) => this.onMutations(records)),
58
+ resize: new ResizeObserver(() => this.placeIndicator())
59
+ };
60
+ _refs = this.useRefs((ref) => ({
61
+ indicator: ref(".indicator"),
62
+ list: ref(".list")
63
+ }));
64
+ templateHtml() {
65
+ return /* @__PURE__ */ jsxs("div", {
66
+ class: "tabs",
67
+ attrs: { part: "base" },
68
+ children: [/* @__PURE__ */ jsxs("div", {
69
+ class: "scroller",
70
+ children: [/* @__PURE__ */ jsx("div", {
71
+ class: "list",
72
+ role: "tablist"
73
+ }), /* @__PURE__ */ jsx("span", {
74
+ class: "indicator",
75
+ "aria-hidden": "true",
76
+ hidden: true
77
+ })]
78
+ }), /* @__PURE__ */ jsx("div", {
79
+ class: "panels",
80
+ children: /* @__PURE__ */ jsx("slot", {})
81
+ })]
82
+ });
83
+ }
84
+ templateCss() {
85
+ return css`${BASE_STYLES}${jl_tabs_default}`;
86
+ }
87
+ onConnect() {
88
+ this.render();
89
+ this._observers.mutations.observe(this, {
90
+ attributeFilter: PANEL_ATTRIBUTES,
91
+ attributes: true,
92
+ childList: true,
93
+ subtree: true
94
+ });
95
+ this._observers.resize.observe(this._refs.list);
96
+ this.on(this._refs.list, "click", (event) => {
97
+ const tab = event.target.closest("[role=\"tab\"]");
98
+ if (tab !== null) this.choose(this.tabs().indexOf(tab), false);
99
+ });
100
+ this.on(this._refs.list, "keydown", (event) => this.onKeydown(event));
101
+ }
102
+ onDisconnect() {
103
+ this._observers.mutations.disconnect();
104
+ this._observers.resize.disconnect();
105
+ }
106
+ panels() {
107
+ return [...this.children].filter(isPanel);
108
+ }
109
+ tabs() {
110
+ return [...this._refs.list.children];
111
+ }
112
+ /** Only the tabs' own panels matter, not the attributes of what the panels hold. */
113
+ onMutations(records) {
114
+ if (records.some((record) => record.target === this || record.target.parentElement === this)) this.render();
115
+ }
116
+ /** The index of the open panel: the one `value` names, or the first that can open. */
117
+ selectedIndex(panels) {
118
+ const value = this.value.get();
119
+ const named = panels.findIndex((panel, index) => panelName(panel, index) === value && !isDisabled(panel));
120
+ return named === -1 ? panels.findIndex((panel) => !isDisabled(panel)) : named;
121
+ }
122
+ render() {
123
+ const panels = this.panels();
124
+ this.syncTabCount(panels.length);
125
+ const selected = this.selectedIndex(panels);
126
+ const tabs = this.tabs();
127
+ panels.forEach((panel, index) => {
128
+ const tab = tabs[index];
129
+ if (tab !== void 0) this.renderTab(tab, panel, index === selected);
130
+ });
131
+ this.placeIndicator();
132
+ }
133
+ /** Adds or removes tab buttons to match the panels; the buttons left keep their focus. */
134
+ syncTabCount(count) {
135
+ const list = this._refs.list;
136
+ while (list.childElementCount > count) list.lastElementChild?.remove();
137
+ while (list.childElementCount < count) list.append(/* @__PURE__ */ jsx("button", {
138
+ type: "button",
139
+ role: "tab",
140
+ class: "tab",
141
+ id: uniqueId("jl-tab")
142
+ }));
143
+ }
144
+ renderTab(tab, panel, selected) {
145
+ const icon = panel.getAttribute("icon") ?? "";
146
+ const badge = panel.getAttribute("badge") ?? "";
147
+ tab.replaceChildren(icon === "" ? "" : /* @__PURE__ */ jsx(JlIcon, {
148
+ name: icon,
149
+ size: ICON_SIZE
150
+ }), /* @__PURE__ */ jsx("span", {
151
+ class: "label",
152
+ children: panel.getAttribute("label") ?? ""
153
+ }), badge === "" ? "" : /* @__PURE__ */ jsx("span", {
154
+ class: "badge",
155
+ children: badge
156
+ }));
157
+ tab.setAttribute("aria-selected", String(selected));
158
+ tab.tabIndex = selected ? 0 : -1;
159
+ tab.toggleAttribute("aria-disabled", isDisabled(panel));
160
+ if (panel.id === "") panel.id = uniqueId("jl-tab-panel");
161
+ tab.ariaControlsElements = [panel];
162
+ panel.toggleAttribute("selected", selected);
163
+ panel.tabIndex = 0;
164
+ }
165
+ placeIndicator() {
166
+ const selected = this.tabs().find((tab) => tab.getAttribute("aria-selected") === "true") ?? null;
167
+ moveIndicator(this._refs.indicator, selected);
168
+ }
169
+ onKeydown(event) {
170
+ const move = KEY_MOVES.get(event.key);
171
+ const tabs = this.tabs();
172
+ const from = tabs.indexOf(event.target);
173
+ if (move === void 0 || from === -1) return;
174
+ event.preventDefault();
175
+ const enabled = tabs.map((tab) => !tab.hasAttribute("aria-disabled"));
176
+ this.choose(move(enabled, from), true);
177
+ }
178
+ /** Opens the panel of a tab people picked, and says so. */
179
+ choose(index, focus) {
180
+ const panels = this.panels();
181
+ const panel = panels[index];
182
+ const tab = this.tabs()[index];
183
+ if (panel === void 0 || tab === void 0 || isDisabled(panel)) return;
184
+ if (focus) {
185
+ tab.focus();
186
+ tab.scrollIntoView({
187
+ block: "nearest",
188
+ inline: "nearest"
189
+ });
190
+ }
191
+ if (index === this.selectedIndex(panels)) return;
192
+ const name = panelName(panel, index);
193
+ this.value.set(name);
194
+ this.events.emit("change", name);
195
+ }
196
+ };
197
+ JlTabs.register();
198
+ export { JlTabs, TAB_VARIANTS };
@@ -0,0 +1,3 @@
1
+ // src/molecules/jl-tag-input.css?raw
2
+ var jl_tag_input_default = ":host {\n display: block;\n /* As a grid or flex item, the field may be narrower than its text field would like. */\n min-width: 0;\n --chip-height: calc(var(--height, var(--jl-control-md)) - 12px);\n}\n\n.control {\n flex-wrap: wrap;\n gap: 4px;\n padding: 4px 6px;\n cursor: text;\n}\n\n/* The chips are items of the frame's own flow, so the field follows the last one on its line. */\n.tags {\n display: contents;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.tag {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n max-width: 100%;\n height: var(--chip-height);\n padding: 0 3px 0 8px;\n border: 1px solid var(--jl-line);\n border-radius: var(--jl-radius-xs);\n background: var(--jl-surface-2);\n color: var(--jl-text);\n font-size: var(--jl-font-sm);\n line-height: 1;\n cursor: default;\n}\n\n:host([size=\"sm\"]) .tag {\n padding-left: 6px;\n font-size: var(--jl-font-xs);\n}\n\n.tag.flash {\n animation: flash 600ms var(--jl-ease);\n}\n\n.tag-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.tag-remove {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n padding: 0;\n border: none;\n border-radius: 4px;\n background: none;\n color: var(--jl-faint);\n cursor: pointer;\n}\n\n.tag-remove:hover,\n.tag-remove:focus-visible {\n background: var(--jl-surface-3);\n color: var(--jl-text);\n}\n\n.native {\n flex: 1 0 80px;\n height: calc(var(--height, var(--jl-control-md)) - 10px);\n padding-left: 6px;\n}\n\n:host([disabled]) .tag {\n padding-right: 8px;\n color: var(--jl-muted);\n}\n\n.popup {\n min-width: 180px;\n padding: 4px;\n}\n\n.listbox {\n position: relative;\n max-height: 240px;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style: none;\n}\n\n.option {\n padding: 6px 10px;\n border-radius: var(--jl-radius-xs);\n color: var(--jl-text);\n font-size: var(--jl-font-md);\n line-height: 1.4;\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n}\n\n.option.active,\n.option:hover {\n background: var(--jl-surface-3);\n}\n\nmark {\n background: none;\n color: var(--jl-accent);\n font-weight: 700;\n}\n\n@keyframes flash {\n 30% {\n border-color: var(--jl-accent-line);\n background: var(--jl-accent-soft);\n color: var(--jl-accent-strong);\n }\n}\n";
3
+ export { jl_tag_input_default as default };
@@ -0,0 +1,103 @@
1
+ import { JlFormControl } from '../base/jl-form-control';
2
+ import type { ControlSize } from '../types/options.types';
3
+ /**
4
+ * A field that collects short texts as chips: Enter or a comma adds what was typed, Backspace in the empty field
5
+ * removes the last chip, a pasted list adds each of its items. The form gets each tag under the field's name.
6
+ */
7
+ export declare class JlTagInput extends JlFormControl {
8
+ static readonly selector = "jl-tag-input";
9
+ readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
10
+ change: string[];
11
+ }>>;
12
+ readonly value: Readonly<Readonly<{
13
+ get(): string[];
14
+ set(setter: string[] | ((prevState: string[]) => string[])): void;
15
+ }>>;
16
+ readonly placeholder: Readonly<Readonly<{
17
+ get(): string;
18
+ set(setter: string | ((prevState: string) => string)): void;
19
+ }>>;
20
+ /** The field's name for screen readers, when no visible label names it. */
21
+ readonly label: Readonly<Readonly<{
22
+ get(): string;
23
+ set(setter: string | ((prevState: string) => string)): void;
24
+ }>>;
25
+ /** The most tags the field takes; 0 for no limit. */
26
+ readonly max: Readonly<Readonly<{
27
+ get(): number;
28
+ set(setter: number | ((prevState: number) => number)): void;
29
+ }>>;
30
+ /** Tags offered in a list while people type. */
31
+ readonly suggestions: Readonly<Readonly<{
32
+ get(): string[];
33
+ set(setter: string[] | ((prevState: string[]) => string[])): void;
34
+ }>>;
35
+ readonly required: Readonly<Readonly<{
36
+ get(): boolean;
37
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
38
+ }>>;
39
+ readonly disabled: Readonly<Readonly<{
40
+ get(): boolean;
41
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
42
+ }>>;
43
+ /** Draws the field in the danger colour, for an error the page found itself. */
44
+ readonly invalid: Readonly<Readonly<{
45
+ get(): boolean;
46
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
47
+ }>>;
48
+ readonly size: Readonly<Readonly<{
49
+ get(): ControlSize;
50
+ set(setter: ((prevState: ControlSize) => ControlSize) | ControlSize): void;
51
+ }>>;
52
+ private readonly _listId;
53
+ private readonly _state;
54
+ private readonly _nameWatch;
55
+ private readonly _refs;
56
+ focus(options?: FocusOptions): void;
57
+ templateHtml(): Node;
58
+ templateCss(): string;
59
+ onConnect(): void;
60
+ onDisconnect(): void;
61
+ protected resetValue(): void;
62
+ protected setDisabledByForm(disabled: boolean): void;
63
+ private onType;
64
+ private onFieldKey;
65
+ /** Enter adds the suggestion the arrows reached, or the typed text; in an empty field it submits the form. */
66
+ private onEnter;
67
+ /** A pasted list adds each of its items; a single word is pasted as text. */
68
+ private onPaste;
69
+ private onControlClick;
70
+ /** On a chip's remove button: arrows move between chips and back to the field, Backspace or Delete removes it. */
71
+ private onTagKey;
72
+ /** Adds the typed text as tags; true when there was text to add. */
73
+ private commitText;
74
+ private add;
75
+ private removeAt;
76
+ private removeAndFocus;
77
+ private removeLastIfEmpty;
78
+ private focusLastTag;
79
+ /** Focuses a chip's remove button; past the last chip, the field. */
80
+ private focusTag;
81
+ /** Points at the chips people tried to add again. */
82
+ private flash;
83
+ private announce;
84
+ private isOpen;
85
+ /** The suggestions that match the typed text and are not tags yet; the list opens while there are some. */
86
+ private renderMatches;
87
+ private openList;
88
+ /** Closes the suggestions; true when they were open, so Escape goes no further. */
89
+ private closeList;
90
+ private moveActive;
91
+ private renderActive;
92
+ private suggestionAt;
93
+ private pick;
94
+ /** The field is a combobox only when it offers suggestions. */
95
+ private renderSuggestionRole;
96
+ private renderTags;
97
+ /** The placeholder shows while there is no tag; chips take its place. */
98
+ private renderPlaceholder;
99
+ /** Each tag is its own entry under the field's name, as several checked boxes of one name would be. */
100
+ private renderFormValue;
101
+ private renderValidity;
102
+ private renderDisabled;
103
+ }