@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,30 @@
1
+ import type { Tone } from './options.types';
2
+ /** How a cell shows its value: as it is, a localised number or date, a badge, or code. */
3
+ export type TableCellFormat = 'text' | 'number' | 'date' | 'badge' | 'code';
4
+ export type TableAlign = 'left' | 'center' | 'right';
5
+ /** The order of a sorted column; `none` keeps the rows as they came. */
6
+ export type TableSortDirection = 'asc' | 'desc' | 'none';
7
+ export type TableColumn = {
8
+ /** The row's field shown in this column. */
9
+ key: string;
10
+ label: string;
11
+ /** Numbers are right-aligned when absent; the rest left. */
12
+ align?: TableAlign;
13
+ sortable?: boolean;
14
+ /** A CSS width: `120px`, `20%`; a number is pixels. */
15
+ width?: string | number;
16
+ format?: TableCellFormat;
17
+ /** For badges: the tone of each value (`{ "Active": "ok" }`); neutral otherwise. */
18
+ tones?: Record<string, Tone>;
19
+ };
20
+ export type TableRow = Record<string, unknown>;
21
+ /** A row's identity, the value of its `row-key` field. */
22
+ export type TableRowKey = string | number;
23
+ export type TableSort = {
24
+ key: string;
25
+ direction: TableSortDirection;
26
+ };
27
+ /** Draws a cell of a column in place of its formatted value. */
28
+ export type TableCellRenderer = (row: TableRow) => Node;
29
+ /** What the select-all box shows: no row selected, some, or all of them. */
30
+ export type TableSelectionState = 'none' | 'some' | 'all';
@@ -0,0 +1,2 @@
1
+ /** How the tabs mark the open one: an underline under a row of labels, or a soft pill behind the label. */
2
+ export type TabsVariant = 'line' | 'pill';
@@ -0,0 +1,10 @@
1
+ import type { Tone } from './options.types';
2
+ export type TimelineItem = {
3
+ title: string;
4
+ /** When it happened, as text: `2 min ago`, `09:41`, `Mar 3`. */
5
+ time?: string;
6
+ description?: string;
7
+ tone?: Tone;
8
+ /** An icon in a circle instead of the dot. */
9
+ icon?: string;
10
+ };
@@ -0,0 +1,2 @@
1
+ /** The colour of a notification: neutral ink, or a semantic colour. */
2
+ export type ToastTone = 'neutral' | 'ok' | 'warn' | 'danger' | 'info';
@@ -0,0 +1,23 @@
1
+ import type { ToastTone } from './jl-toast.types';
2
+ /** The corner or edge of the window where the toaster stacks its notifications. */
3
+ export type ToasterPlacement = 'top-right' | 'top-center' | 'bottom-right' | 'bottom-center' | 'bottom-left';
4
+ /** What `toast()` and `JlToaster.notify()` show. */
5
+ export type ToastOptions = {
6
+ heading?: string;
7
+ text?: string;
8
+ tone?: ToastTone;
9
+ /** An icon name; the tone's icon when absent. */
10
+ icon?: string;
11
+ /** How long it stays, in milliseconds; 0 keeps it until closed. */
12
+ duration?: number;
13
+ /** Shows a close button; on by default. */
14
+ closable?: boolean;
15
+ /** The text of a button in the toast, such as "Undo". */
16
+ actionLabel?: string;
17
+ /** Called when that button is pressed; the toast then closes. */
18
+ onAction?: () => void;
19
+ };
20
+ /** What `toast()` returns: a way to close the notification before its time. */
21
+ export type ToastHandle = {
22
+ dismiss(): void;
23
+ };
@@ -0,0 +1,26 @@
1
+ export type TreeItem = {
2
+ id: string;
3
+ label: string;
4
+ /** An icon name; folders get a folder and the rest a file when absent. */
5
+ icon?: string;
6
+ /** Present, even empty, the item is a folder that opens. */
7
+ children?: TreeItem[];
8
+ };
9
+ /** An item as listed: its depth from 1 at the roots, and its parent's id. */
10
+ export type VisibleTreeItem = {
11
+ item: TreeItem;
12
+ level: number;
13
+ parent: string | null;
14
+ };
15
+ /** What a key does in the tree: move the focus, open or close a folder, or select an item. */
16
+ export type TreeAction = {
17
+ kind: 'focus';
18
+ id: string;
19
+ } | {
20
+ kind: 'toggle';
21
+ id: string;
22
+ open: boolean;
23
+ } | {
24
+ kind: 'select';
25
+ id: string;
26
+ };
@@ -0,0 +1,9 @@
1
+ /** A keyboard shortcut read from text such as "/" or "mod+k": `mod` is ⌘ on a Mac and Ctrl elsewhere. */
2
+ export type KeyShortcut = {
3
+ key: string;
4
+ mod: boolean;
5
+ ctrl: boolean;
6
+ meta: boolean;
7
+ alt: boolean;
8
+ shift: boolean;
9
+ };
@@ -0,0 +1,7 @@
1
+ /** How a platform writes modifier keys: Apple's symbols (⌘ ⇧ ⌥) or the names of other systems (Ctrl, Shift). */
2
+ export type KeyPlatform = 'apple' | 'other';
3
+ /** One key as a keycap draws it (`label`: ⌘) and as a screen reader says it (`name`: Command). */
4
+ export type Keycap = {
5
+ label: string;
6
+ name: string;
7
+ };
@@ -0,0 +1,10 @@
1
+ /** Where a search was found in a text: from `start` (included) to `end` (excluded), in UTF-16 indexes. */
2
+ export type TextMatch = {
3
+ start: number;
4
+ end: number;
5
+ };
6
+ /** A piece of a text, matched by the search or not: the text drawn with its match highlighted. */
7
+ export type TextMatchPart = {
8
+ text: string;
9
+ matched: boolean;
10
+ };
@@ -0,0 +1,4 @@
1
+ /** The colour of a status: neutral ink, the accent blue, or a semantic colour. */
2
+ export type Tone = 'neutral' | 'accent' | 'ok' | 'warn' | 'danger' | 'info';
3
+ /** The three heights of controls: sm in dense panels, md by default, lg where a thumb presses it. */
4
+ export type ControlSize = 'sm' | 'md' | 'lg';
@@ -0,0 +1,8 @@
1
+ /** One entry of a pagination's list: a page to go to, or a gap standing for the pages left out. */
2
+ export type PageItem = {
3
+ type: 'page';
4
+ page: number;
5
+ } | {
6
+ type: 'gap';
7
+ side: 'start' | 'end';
8
+ };
@@ -0,0 +1,2 @@
1
+ /** Where the arrow keys of a list or a radio group move the focus: forward, backward, or to an end. */
2
+ export type RovingMove = 'next' | 'previous' | 'first' | 'last';
@@ -0,0 +1,11 @@
1
+ /** A point of a sparkline, in the coordinates of its SVG `viewBox`. */
2
+ export type SparkPoint = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ /** The drawing box of a sparkline: its `viewBox` size, and the room kept on each side for the stroke. */
7
+ export type SparkBox = {
8
+ width: number;
9
+ height: number;
10
+ inset: number;
11
+ };
package/package.json CHANGED
@@ -1,6 +1,98 @@
1
1
  {
2
2
  "name": "@syware/jlib",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "A tree-shakeable component library on Jadis and native Web Components, organised in atomic design",
5
+ "keywords": [
6
+ "web-components",
7
+ "custom-elements",
8
+ "jadis",
9
+ "components",
10
+ "design-system",
11
+ "ui",
12
+ "atomic-design",
13
+ "tree-shakeable"
14
+ ],
15
+ "type": "module",
16
+ "license": "MIT",
17
+ "author": "SyWare",
18
+ "homepage": "https://bioleyl.github.io/jlib/",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/bioleyl/jlib.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/bioleyl/jlib/issues"
25
+ },
26
+ "files": ["dist"],
27
+ "main": "./dist/index.js",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js"
34
+ },
35
+ "./all": {
36
+ "types": "./dist/all.d.ts",
37
+ "import": "./dist/all.js"
38
+ },
39
+ "./atoms/*": {
40
+ "types": "./dist/atoms/*.d.ts",
41
+ "import": "./dist/atoms/*.js"
42
+ },
43
+ "./molecules/*": {
44
+ "types": "./dist/molecules/*.d.ts",
45
+ "import": "./dist/molecules/*.js"
46
+ },
47
+ "./organisms/*": {
48
+ "types": "./dist/organisms/*.d.ts",
49
+ "import": "./dist/organisms/*.js"
50
+ },
51
+ "./templates/*": {
52
+ "types": "./dist/templates/*.d.ts",
53
+ "import": "./dist/templates/*.js"
54
+ },
55
+ "./tokens.css": "./dist/tokens.css",
56
+ "./package.json": "./package.json"
57
+ },
58
+ "sideEffects": ["./dist/all.js", "./dist/*.css", "./src/all.ts"],
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "scripts": {
63
+ "dev": "vite --config site/vite.config.ts",
64
+ "build": "npm run build:lib && npm run size:report && npm run build:site",
65
+ "build:lib": "node scripts/build-lib.mjs",
66
+ "build:site": "vite build --config site/vite.config.ts",
67
+ "preview": "vite preview --config site/vite.config.ts",
68
+ "generate": "node scripts/generate-index.mjs",
69
+ "size": "npm run build:lib && npm run size:report",
70
+ "size:report": "node scripts/size-report.mjs",
71
+ "test": "vitest run",
72
+ "test:watch": "vitest",
73
+ "test:e2e": "npm run build:site && vitest run --config vitest.e2e.config.ts",
74
+ "typecheck": "tsc --noEmit -p tsconfig.json",
75
+ "lint": "biome check .",
76
+ "format": "biome check --write .",
77
+ "check": "npm run generate -- --check && npm run lint && npm run typecheck && npm run test",
78
+ "prepack": "npm run build:lib",
79
+ "prepublishOnly": "npm run check"
80
+ },
81
+ "peerDependencies": {
82
+ "@jadis/core": "^1.3.0"
83
+ },
84
+ "dependencies": {
85
+ "lucide": "^1.61.0"
86
+ },
87
+ "devDependencies": {
88
+ "@biomejs/biome": "^2.6.3",
89
+ "@fontsource-variable/jetbrains-mono": "^5.3.0",
90
+ "@fontsource-variable/manrope": "^5.3.0",
91
+ "@jadis/core": "^1.3.0",
92
+ "@types/node": "^24.13.3",
93
+ "playwright-core": "^1.64.1",
94
+ "typescript": "^7.0.2",
95
+ "vite": "^8.3.5",
96
+ "vitest": "^5.0.5"
97
+ }
98
+ }