@voidable/ui 0.9.0 → 0.11.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 (114) hide show
  1. package/dist/base-entry.d.ts +1 -0
  2. package/dist/base.d.ts +8 -1
  3. package/dist/base.js +5 -1
  4. package/dist/chunks/base-BGrS4eIl.js +307 -0
  5. package/dist/chunks/data-BpiiNapL.js +95 -0
  6. package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
  7. package/dist/chunks/{modal-hivQ4YoU.js → modal-DWGkNdNG.js} +3 -3
  8. package/dist/chunks/{overlay-BywGMcDW.js → overlay-CH7L4N-h.js} +2 -2
  9. package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
  10. package/dist/chunks/{base-CMruMbxC.js → projection-oPe6ipjL.js} +105 -389
  11. package/dist/components/accordion.js +2 -2
  12. package/dist/components/action-input.d.ts +2 -2
  13. package/dist/components/action-input.js +56 -54
  14. package/dist/components/alert.d.ts +11 -0
  15. package/dist/components/alert.js +11 -4
  16. package/dist/components/avatar.js +13 -11
  17. package/dist/components/badge.d.ts +8 -2
  18. package/dist/components/badge.js +1 -4
  19. package/dist/components/banner.d.ts +9 -0
  20. package/dist/components/banner.js +11 -4
  21. package/dist/components/bar-chart.d.ts +21 -7
  22. package/dist/components/bar-chart.js +67 -43
  23. package/dist/components/breadcrumbs.js +2 -2
  24. package/dist/components/button.js +1 -1
  25. package/dist/components/calendar.d.ts +40 -2
  26. package/dist/components/calendar.js +170 -79
  27. package/dist/components/card.js +1 -1
  28. package/dist/components/carousel.js +20 -19
  29. package/dist/components/charts/data.d.ts +72 -0
  30. package/dist/components/checkbox-group.js +13 -12
  31. package/dist/components/checkbox.js +17 -16
  32. package/dist/components/collapsible.js +2 -2
  33. package/dist/components/color-picker.js +26 -24
  34. package/dist/components/combobox.js +17 -16
  35. package/dist/components/compose-input.js +13 -11
  36. package/dist/components/dialog.js +1 -1
  37. package/dist/components/divider.js +11 -9
  38. package/dist/components/donut-chart.d.ts +22 -6
  39. package/dist/components/donut-chart.js +96 -68
  40. package/dist/components/drawer.d.ts +2 -2
  41. package/dist/components/drawer.js +1 -1
  42. package/dist/components/dropdown-menu.js +4 -4
  43. package/dist/components/editable.js +13 -12
  44. package/dist/components/error-fallback.js +2 -2
  45. package/dist/components/field.js +10 -9
  46. package/dist/components/file-upload.d.ts +20 -5
  47. package/dist/components/file-upload.js +52 -20
  48. package/dist/components/gauge.d.ts +32 -8
  49. package/dist/components/gauge.js +209 -135
  50. package/dist/components/hamburger.d.ts +12 -1
  51. package/dist/components/hamburger.js +33 -20
  52. package/dist/components/hover-card.js +3 -3
  53. package/dist/components/indicator.js +14 -12
  54. package/dist/components/input.js +41 -39
  55. package/dist/components/line-chart.d.ts +22 -7
  56. package/dist/components/line-chart.js +80 -56
  57. package/dist/components/list.js +1 -1
  58. package/dist/components/menu.js +3 -3
  59. package/dist/components/multiselect.js +30 -29
  60. package/dist/components/nav-bar.d.ts +9 -0
  61. package/dist/components/nav-bar.js +16 -3
  62. package/dist/components/nav-menu.js +20 -19
  63. package/dist/components/number-input.js +17 -15
  64. package/dist/components/pagination.js +22 -20
  65. package/dist/components/panel.js +2 -2
  66. package/dist/components/pin-input.js +32 -30
  67. package/dist/components/popover.js +3 -3
  68. package/dist/components/progress.js +14 -12
  69. package/dist/components/radio-group.js +13 -11
  70. package/dist/components/radio.d.ts +25 -0
  71. package/dist/components/radio.js +78 -29
  72. package/dist/components/scroll-area.js +8 -7
  73. package/dist/components/segmented-control.js +21 -21
  74. package/dist/components/select.js +49 -47
  75. package/dist/components/sidebar.d.ts +2 -2
  76. package/dist/components/sidebar.js +2 -2
  77. package/dist/components/skeleton.js +1 -1
  78. package/dist/components/slider.js +16 -14
  79. package/dist/components/spinner.js +11 -9
  80. package/dist/components/stat.d.ts +13 -1
  81. package/dist/components/stat.js +29 -19
  82. package/dist/components/status-dot.js +1 -1
  83. package/dist/components/stepper.js +15 -13
  84. package/dist/components/switch.js +14 -12
  85. package/dist/components/table.d.ts +4 -0
  86. package/dist/components/table.js +42 -29
  87. package/dist/components/tabs.js +29 -29
  88. package/dist/components/tag.js +9 -8
  89. package/dist/components/tags-input.js +24 -22
  90. package/dist/components/textarea.js +34 -32
  91. package/dist/components/toast.d.ts +19 -2
  92. package/dist/components/toast.js +43 -10
  93. package/dist/components/toggle-group.js +16 -15
  94. package/dist/components/toggle.js +1 -1
  95. package/dist/components/tooltip.js +3 -3
  96. package/dist/components.json +15 -13
  97. package/dist/custom-elements.json +320 -88
  98. package/dist/dev/types.d.ts +3 -1
  99. package/dist/dev.js +85 -16
  100. package/dist/index.js +1 -1
  101. package/dist/keyboard.d.ts +10 -0
  102. package/dist/llms.txt +1 -1
  103. package/dist/parts.d.ts +5 -0
  104. package/dist/projection-api.d.ts +23 -0
  105. package/dist/projection.d.ts +8 -2
  106. package/dist/reference.md +84 -59
  107. package/dist/types/elements.d.ts +13 -13
  108. package/dist/types/react.d.ts +2 -2
  109. package/dist/types/solid.d.ts +2 -2
  110. package/dist/types/svelte.d.ts +2 -2
  111. package/dist/types/vue.d.ts +2 -2
  112. package/dist/vscode.html-custom-data.json +108 -28
  113. package/dist/web-types.json +189 -60
  114. package/package.json +1 -1
@@ -97,7 +97,9 @@ export type WarningKind = 'unknown-attribute' | 'invalid-value' | 'boolean-false
97
97
  /** The element needs an accessible name and nothing gives it one. */
98
98
  | 'missing-name'
99
99
  /** A page script keeps removing an attribute a component manages on itself; the component stopped restoring it. */
100
- | 'attribute-fight';
100
+ | 'attribute-fight'
101
+ /** A chart's `data` or `zones` attribute is not valid JSON of the expected shape; the chart draws nothing. */
102
+ | 'invalid-data';
101
103
  /** One reported problem. */
102
104
  export interface DevWarning {
103
105
  kind: WarningKind;
package/dist/dev.js CHANGED
@@ -417,7 +417,7 @@ var k = {
417
417
  ],
418
418
  icon: 0,
419
419
  "action-label": 0,
420
- "icon-side": ["left", "right"],
420
+ "icon-side": ["start", "end"],
421
421
  "tooltip-side": [
422
422
  "top",
423
423
  "bottom",
@@ -441,10 +441,22 @@ var k = {
441
441
  h: "wrap it in <void-field label=\"...\"> or give it aria-label",
442
442
  p: [["void-field", "label"], ["label"]]
443
443
  },
444
- l: { a: {
445
- position: { to: "icon-side" },
446
- "tooltip-position": { to: "tooltip-side" }
447
- } }
444
+ l: {
445
+ a: {
446
+ position: {
447
+ to: "icon-side",
448
+ values: {
449
+ left: "icon-side=\"start\"",
450
+ right: "icon-side=\"end\""
451
+ }
452
+ },
453
+ "tooltip-position": { to: "tooltip-side" }
454
+ },
455
+ v: { "icon-side": {
456
+ left: "start",
457
+ right: "end"
458
+ } }
459
+ }
448
460
  },
449
461
  "void-alert": {
450
462
  m: "alert",
@@ -641,7 +653,9 @@ var k = {
641
653
  "wireframe"
642
654
  ],
643
655
  "aria-label": 0,
644
- stagger: 2
656
+ "show-table": 1,
657
+ stagger: 2,
658
+ data: 0
645
659
  },
646
660
  e: [],
647
661
  l: {
@@ -853,6 +867,14 @@ var k = {
853
867
  controls: "write <void-carousel-previous aria-label=\"Previous slide\"></void-carousel-previous> and <void-carousel-next aria-label=\"Next slide\"></void-carousel-next> after the content; leave them out for no arrows",
854
868
  indicators: "write an empty <void-carousel-indicators></void-carousel-indicators> after the content; leave it out for no dots"
855
869
  },
870
+ n: {
871
+ a: [
872
+ "aria-label",
873
+ "aria-labelledby",
874
+ "title"
875
+ ],
876
+ h: "say what it shows: aria-label=\"Product photos\""
877
+ },
856
878
  l: { a: {
857
879
  controls: { fix: "write <void-carousel-previous aria-label=\"Previous slide\"></void-carousel-previous> and <void-carousel-next aria-label=\"Next slide\"></void-carousel-next> after the content; leave them out for no arrows" },
858
880
  indicators: { fix: "write an empty <void-carousel-indicators></void-carousel-indicators> after the content; leave it out for no dots" },
@@ -860,7 +882,7 @@ var k = {
860
882
  } },
861
883
  q: {
862
884
  k: "parts",
863
- s: "<void-carousel><void-carousel-content><void-carousel-item>One</void-carousel-item><void-carousel-item>Two</void-carousel-item></void-carousel-content><void-carousel-previous aria-label=\"Previous slide\"></void-carousel-previous><void-carousel-next aria-label=\"Next slide\"></void-carousel-next><void-carousel-indicators></void-carousel-indicators></void-carousel>",
885
+ s: "<void-carousel aria-label=\"Slides\"><void-carousel-content><void-carousel-item>One</void-carousel-item><void-carousel-item>Two</void-carousel-item></void-carousel-content><void-carousel-previous aria-label=\"Previous slide\"></void-carousel-previous><void-carousel-next aria-label=\"Next slide\"></void-carousel-next><void-carousel-indicators></void-carousel-indicators></void-carousel>",
864
886
  n: [
865
887
  {
866
888
  t: "void-carousel-content",
@@ -892,7 +914,7 @@ var k = {
892
914
  c: 1,
893
915
  q: {
894
916
  k: "parts",
895
- s: "<void-carousel><void-carousel-content><void-carousel-item>One</void-carousel-item><void-carousel-item>Two</void-carousel-item></void-carousel-content><void-carousel-previous aria-label=\"Previous slide\"></void-carousel-previous><void-carousel-next aria-label=\"Next slide\"></void-carousel-next><void-carousel-indicators></void-carousel-indicators></void-carousel>",
917
+ s: "<void-carousel aria-label=\"Slides\"><void-carousel-content><void-carousel-item>One</void-carousel-item><void-carousel-item>Two</void-carousel-item></void-carousel-content><void-carousel-previous aria-label=\"Previous slide\"></void-carousel-previous><void-carousel-next aria-label=\"Next slide\"></void-carousel-next><void-carousel-indicators></void-carousel-indicators></void-carousel>",
896
918
  n: [{
897
919
  t: "void-carousel-item",
898
920
  r: 1
@@ -1184,6 +1206,7 @@ var k = {
1184
1206
  "notice",
1185
1207
  "highlight"
1186
1208
  ],
1209
+ error: 0,
1187
1210
  required: 1,
1188
1211
  name: 0
1189
1212
  },
@@ -1311,7 +1334,9 @@ var k = {
1311
1334
  ],
1312
1335
  "show-value": 1,
1313
1336
  "show-total": 1,
1314
- "aria-label": 0
1337
+ "aria-label": 0,
1338
+ "show-table": 1,
1339
+ data: 0
1315
1340
  },
1316
1341
  e: [],
1317
1342
  l: { a: { "show-values": { to: "show-value" } } }
@@ -1323,6 +1348,8 @@ var k = {
1323
1348
  side: [
1324
1349
  "left",
1325
1350
  "right",
1351
+ "start",
1352
+ "end",
1326
1353
  "top",
1327
1354
  "bottom"
1328
1355
  ],
@@ -1612,7 +1639,7 @@ var k = {
1612
1639
  required: 1,
1613
1640
  name: 0
1614
1641
  },
1615
- e: ["void-change"],
1642
+ e: ["void-change", "void-reject"],
1616
1643
  h: ["dragging"],
1617
1644
  n: {
1618
1645
  a: [
@@ -1651,7 +1678,10 @@ var k = {
1651
1678
  "hide-tick-max": 1,
1652
1679
  "segments-sort": ["value", "manual"],
1653
1680
  gaps: 0,
1654
- "aria-label": 0
1681
+ "aria-label": 0,
1682
+ "show-table": 1,
1683
+ zones: 0,
1684
+ data: 0
1655
1685
  },
1656
1686
  e: [],
1657
1687
  l: { a: {
@@ -1689,6 +1719,14 @@ var k = {
1689
1719
  ]
1690
1720
  },
1691
1721
  e: ["void-close", "void-open"],
1722
+ n: {
1723
+ a: [
1724
+ "aria-label",
1725
+ "aria-labelledby",
1726
+ "title"
1727
+ ],
1728
+ h: "say what it opens: aria-label=\"Main navigation\""
1729
+ },
1692
1730
  l: {
1693
1731
  a: { active: { to: "open" } },
1694
1732
  e: { "void-toggle": "listen for void-open and void-close on the element itself (they do not bubble; detail.reason says why)" }
@@ -1880,7 +1918,9 @@ var k = {
1880
1918
  "wireframe"
1881
1919
  ],
1882
1920
  interpolation: ["linear", "step"],
1883
- "aria-label": 0
1921
+ "aria-label": 0,
1922
+ "show-table": 1,
1923
+ data: 0
1884
1924
  },
1885
1925
  e: [],
1886
1926
  l: { a: { "show-values": { to: "show-value" } } }
@@ -2247,6 +2287,15 @@ var k = {
2247
2287
  ] },
2248
2288
  e: [],
2249
2289
  x: { label: "write <void-panel-header><void-panel-title>...</void-panel-title></void-panel-header> as the first child; the title names the panel" },
2290
+ n: {
2291
+ a: [
2292
+ "aria-label",
2293
+ "aria-labelledby",
2294
+ "title"
2295
+ ],
2296
+ h: "write its title as <void-panel-header><void-panel-title>, or give it an aria-label",
2297
+ t: ["void-panel-title"]
2298
+ },
2250
2299
  l: { a: { label: { fix: "write <void-panel-header><void-panel-title>...</void-panel-title></void-panel-header> as the first child; the title names the panel" } } },
2251
2300
  q: {
2252
2301
  k: "parts",
@@ -2440,7 +2489,7 @@ var k = {
2440
2489
  "aria-labelledby",
2441
2490
  "title"
2442
2491
  ],
2443
- h: "wrap it in <void-field label=\"...\"> or give it aria-label",
2492
+ h: "say what is progressing: aria-label=\"Uploading photo\"",
2444
2493
  p: [["void-field", "label"], ["label"]]
2445
2494
  }
2446
2495
  },
@@ -2593,11 +2642,21 @@ var k = {
2593
2642
  collapsed: 1,
2594
2643
  width: 0,
2595
2644
  "collapsed-width": 0,
2596
- side: ["left", "right"]
2645
+ side: ["start", "end"]
2597
2646
  },
2598
2647
  e: ["void-collapse", "void-expand"],
2599
2648
  l: {
2600
- a: { position: { to: "side" } },
2649
+ a: { position: {
2650
+ to: "side",
2651
+ values: {
2652
+ left: "side=\"start\"",
2653
+ right: "side=\"end\""
2654
+ }
2655
+ } },
2656
+ v: { side: {
2657
+ left: "start",
2658
+ right: "end"
2659
+ } },
2601
2660
  e: { "void-toggle": "listen for void-collapse and void-expand on the sidebar (they do not bubble)" }
2602
2661
  }
2603
2662
  },
@@ -2768,7 +2827,17 @@ var k = {
2768
2827
  "data-overflowing",
2769
2828
  "data-stack-select",
2770
2829
  "data-stack-title"
2771
- ]
2830
+ ],
2831
+ n: {
2832
+ a: [
2833
+ "aria-label",
2834
+ "aria-labelledby",
2835
+ "title",
2836
+ "label"
2837
+ ],
2838
+ h: "write a <caption> in the table, or give the void-table an aria-label",
2839
+ t: ["caption"]
2840
+ }
2772
2841
  },
2773
2842
  "void-tabs": {
2774
2843
  m: "tabs",
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/base-CMruMbxC.js";
1
+ import { t as e } from "./chunks/base-BGrS4eIl.js";
2
2
  import { VoidBadge as t } from "./components/badge.js";
3
3
  import { VoidButton as n } from "./components/button.js";
4
4
  import { VoidDivider as r } from "./components/divider.js";
@@ -28,5 +28,15 @@ export declare class Typeahead {
28
28
  match(char: string, labels: readonly string[], disabled: readonly boolean[], current: number): number;
29
29
  reset(): void;
30
30
  }
31
+ /** True when `el` renders right-to-left (`dir`, `lang`-derived direction or CSS `direction`). */
32
+ export declare function isRtl(el: Element): boolean;
33
+ /**
34
+ * The keys that move along the inline axis for `el`: `next` is ArrowRight in
35
+ * left-to-right and ArrowLeft in right-to-left; `prev` is the opposite.
36
+ */
37
+ export declare function inlineKeys(el: Element): {
38
+ next: 'ArrowLeft' | 'ArrowRight';
39
+ prev: 'ArrowLeft' | 'ArrowRight';
40
+ };
31
41
  /** A document-unique id for ARIA relationships. */
32
42
  export declare function uid(prefix: string): string;
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # Voidable UI (@voidable/ui 0.9.0)
1
+ # Voidable UI (@voidable/ui 0.11.0)
2
2
 
3
3
  > Lit 3 web components in the light DOM, `<void-*>` tags with no visual CSS of their own: `@voidable/theme` supplies every look through `--void-*` custom properties. They work in plain HTML, React, Vue, Svelte, Solid, Angular, Rails/Hotwire, Phoenix LiveView and Laravel/Livewire.
4
4
 
package/dist/parts.d.ts CHANGED
@@ -82,6 +82,10 @@ export declare class PartsController implements ReactiveController, MorphPartici
82
82
  /** Attribute names the observer watches: every name ever owned. */
83
83
  private readonly _names;
84
84
  private _syncing;
85
+ /** The observer is registered on the host (it is after the first sync of a connection). */
86
+ private _observing;
87
+ /** A sync owned a name the registered filter does not list yet. */
88
+ private _namesDirty;
85
89
  /** Counts sync passes, so a pass can sweep what the previous one wrote and this one did not. */
86
90
  private _pass;
87
91
  constructor(host: ReactiveControllerHost & HTMLElement, options: PartsOptions);
@@ -121,6 +125,7 @@ export declare class PartsController implements ReactiveController, MorphPartici
121
125
  sync(): void;
122
126
  /** Re-wires in a microtask (several requests in one task make one call). */
123
127
  requestSync(): void;
128
+ /** `echo`: called at the end of a sync, where what is pending is only the echo of its own writes. */
124
129
  private _observe;
125
130
  private _tokenNames;
126
131
  private _onMutations;
@@ -0,0 +1,23 @@
1
+ import { LitElement } from 'lit';
2
+ /** @internal Instance key under which a host's controller is stored (read by VoidElement's DOM overrides). */
3
+ export declare const PROJECTION_KEY = "__voidProjection";
4
+ /**
5
+ * @internal What `VoidElement` needs from projection.ts (about 19 kB minified, of which a button, a badge or any
6
+ * component with explicit parts needs none). projection.ts registers itself here when it is loaded, so a
7
+ * component pays for it only if it, or what it extends, imports it: the components that render or host children
8
+ * through a `ProjectionController` do (`useProjection()`), and so does the public `@voidable/ui/base` entry.
9
+ */
10
+ export interface ProjectionApi {
11
+ /** Gives a rendering component with no controller of its own the region-less default one. */
12
+ create(host: LitElement): void;
13
+ /** Drops the chrome of a serialised copy of a rendered element; true when it was one. */
14
+ strip(host: Element): boolean;
15
+ /** Focus inside `host` is parked by a morph. */
16
+ isFocusParked(host: Element): boolean;
17
+ /** Puts back focus a morph is still holding. */
18
+ restoreParkedFocus(doc: Document): void;
19
+ }
20
+ /** Set by projection.ts when it loads; undefined until then. */
21
+ export declare const projectionApi: {
22
+ current?: ProjectionApi;
23
+ };
@@ -1,4 +1,6 @@
1
1
  import { LitElement, ReactiveController } from 'lit';
2
+ import { PROJECTION_KEY } from './projection-api.js';
3
+ export { PROJECTION_KEY };
2
4
  /**
3
5
  * Where a projection region puts its nodes.
4
6
  *
@@ -77,8 +79,12 @@ export interface ProjectionOptions {
77
79
  */
78
80
  onChange?: () => void;
79
81
  }
80
- /** @internal Instance key under which a host's controller is stored (read by VoidElement's DOM overrides). */
81
- export declare const PROJECTION_KEY = "__voidProjection";
82
+ /**
83
+ * @internal Makes projection available to `VoidElement` (see projection-api.ts). Every `ProjectionController`
84
+ * does it when it is built; a component that renders without a controller of its own calls it at the top level
85
+ * of its module, so that the default controller exists for it.
86
+ */
87
+ export declare function useProjection(): void;
82
88
  /**
83
89
  * @internal True while a morph holds the focus of
84
90
  * an element inside `host` (from just before it is moved out until it is