@syware/jlib 0.3.0 → 0.5.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 (56) hide show
  1. package/dist/all.js +10 -3
  2. package/dist/atoms/jl-badge.d.ts +12 -1
  3. package/dist/atoms/jl-badge.js +15 -1
  4. package/dist/atoms/jl-button.css_raw.js +1 -1
  5. package/dist/atoms/jl-button.d.ts +19 -0
  6. package/dist/atoms/jl-button.js +75 -23
  7. package/dist/atoms/jl-chip.css_raw.js +1 -1
  8. package/dist/atoms/jl-input.d.ts +5 -0
  9. package/dist/atoms/jl-input.js +2 -0
  10. package/dist/index.d.ts +12 -0
  11. package/dist/index.js +9 -2
  12. package/dist/lib/attributes.d.ts +5 -0
  13. package/dist/lib/attributes.js +13 -1
  14. package/dist/lib/time.d.ts +10 -0
  15. package/dist/lib/time.js +64 -0
  16. package/dist/lib/tokens.d.ts +2 -1
  17. package/dist/lib/tokens.js +13 -4
  18. package/dist/molecules/jl-account-button.css_raw.js +3 -0
  19. package/dist/molecules/jl-account-button.d.ts +46 -0
  20. package/dist/molecules/jl-account-button.js +97 -0
  21. package/dist/molecules/jl-alert.d.ts +10 -3
  22. package/dist/molecules/jl-alert.js +23 -6
  23. package/dist/molecules/jl-chip-group.css_raw.js +3 -0
  24. package/dist/molecules/jl-chip-group.d.ts +81 -0
  25. package/dist/molecules/jl-chip-group.js +259 -0
  26. package/dist/molecules/jl-load-state.css_raw.js +3 -0
  27. package/dist/molecules/jl-load-state.d.ts +61 -0
  28. package/dist/molecules/jl-load-state.js +200 -0
  29. package/dist/molecules/jl-search-button.css_raw.js +3 -0
  30. package/dist/molecules/jl-search-button.d.ts +34 -0
  31. package/dist/molecules/jl-search-button.js +80 -0
  32. package/dist/molecules/jl-tag-input.css_raw.js +1 -1
  33. package/dist/organisms/jl-confirm.d.ts +7 -1
  34. package/dist/organisms/jl-confirm.js +22 -1
  35. package/dist/organisms/jl-tab-bar.css_raw.js +3 -0
  36. package/dist/organisms/jl-tab-bar.d.ts +43 -0
  37. package/dist/organisms/jl-tab-bar.js +123 -0
  38. package/dist/organisms/jl-toaster.d.ts +4 -1
  39. package/dist/organisms/jl-toaster.js +9 -2
  40. package/dist/styles/control.css_raw.js +1 -1
  41. package/dist/styles/tokens.css_raw.js +1 -1
  42. package/dist/templates/jl-app-shell.css_raw.js +1 -1
  43. package/dist/templates/jl-app-shell.d.ts +8 -2
  44. package/dist/templates/jl-app-shell.js +32 -5
  45. package/dist/templates/jl-page.css_raw.js +3 -0
  46. package/dist/templates/jl-page.d.ts +49 -0
  47. package/dist/templates/jl-page.js +102 -0
  48. package/dist/tokens.css +22 -0
  49. package/dist/types/jl-badge.types.d.ts +11 -0
  50. package/dist/types/jl-chip-group.types.d.ts +10 -0
  51. package/dist/types/jl-confirm.types.d.ts +15 -0
  52. package/dist/types/jl-load-state.types.d.ts +10 -0
  53. package/dist/types/jl-page.types.d.ts +2 -0
  54. package/dist/types/jl-tab-bar.types.d.ts +11 -0
  55. package/dist/types/jl-toaster.types.d.ts +1 -1
  56. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ /** One choice of a chip group. */
2
+ export type ChipGroupOption = {
3
+ value: string;
4
+ label: string;
5
+ /** An icon name before the label; a chosen chip without one shows a check. */
6
+ icon?: string;
7
+ /** A count or a short word after the label: how many things the choice holds. */
8
+ badge?: string | number;
9
+ disabled?: boolean;
10
+ };
@@ -8,3 +8,18 @@ export type ConfirmOptions = {
8
8
  cancelLabel?: string;
9
9
  tone?: ConfirmTone;
10
10
  };
11
+ /** What `guardLeave()` watches, and what it asks, in the app's words. */
12
+ export type LeaveGuardOptions = {
13
+ /** Whether leaving now would lose changes. */
14
+ isDirty: () => boolean;
15
+ /** Ends the guard, such as the killSignal of the page it guards. */
16
+ signal: AbortSignal;
17
+ /** "Leave without saving?" */
18
+ heading?: string;
19
+ /** "Your changes are lost." */
20
+ text?: string;
21
+ /** "Leave" */
22
+ leaveLabel?: string;
23
+ /** "Keep editing" */
24
+ stayLabel?: string;
25
+ };
@@ -0,0 +1,10 @@
1
+ /** Where the data of a list or a page is: on its way, shown, there but empty, or failed to come. */
2
+ export type LoadState = 'loading' | 'ready' | 'empty' | 'error';
3
+ /** The shape the skeleton takes while the data comes: rows of a list, cards of a grid, or lines of text. */
4
+ export type LoadSkeleton = 'rows' | 'cards' | 'lines';
5
+ /** What `load()` needs: how to fetch the data, how to draw it, and whether it holds nothing to show. */
6
+ export type LoadTask<Value> = {
7
+ fetch: () => Promise<Value>;
8
+ draw: (value: Value) => void;
9
+ isEmpty?: (value: Value) => boolean;
10
+ };
@@ -0,0 +1,2 @@
1
+ /** How wide a page gets: one column of fields, most pages, tables and grids, or the whole main area. */
2
+ export type PageWidth = 'standard' | 'form' | 'wide' | 'full';
@@ -0,0 +1,11 @@
1
+ /** One place in a bottom tab bar: an icon over a short label. */
2
+ export type TabBarItem = {
3
+ id: string;
4
+ label: string;
5
+ /** An icon name: the tab bar draws one over every label. */
6
+ icon: string;
7
+ /** A link to follow; without it the item is a button that only fires `select`. */
8
+ href?: string;
9
+ /** A count or a short word over the icon: `3`, `New`. Counts above 99 show as `99+`. */
10
+ badge?: string | number;
11
+ };
@@ -8,7 +8,7 @@ export type ToastOptions = {
8
8
  tone?: ToastTone;
9
9
  /** An icon name; the tone's icon when absent. */
10
10
  icon?: string;
11
- /** How long it stays, in milliseconds; 0 keeps it until closed. */
11
+ /** How long it stays, in milliseconds: 5000, or 8000 for an error or with an action; 0 keeps it until closed. */
12
12
  duration?: number;
13
13
  /** Shows a close button; on by default. */
14
14
  closable?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syware/jlib",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "A tree-shakeable component library on Jadis and native Web Components, organised in atomic design",
5
5
  "keywords": [
6
6
  "web-components",