staffa 0.4.2 → 0.4.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "staffa",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "An opinionated component library for the Aberdeen reactive UI library.",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -68,11 +68,11 @@ function normOption(o: AutocompleteOptionInput): AcOption {
68
68
  * S.autocomplete({ label: "Country", options: ["Belgium", "Netherlands"], bind: $sel });
69
69
  *
70
70
  * // Multi-select, disallowing custom items
71
- * const $tags = A.proxy([] as string[]);
71
+ * const $tags = A.proxy({value: [] as string[]});
72
72
  * S.autocomplete({
73
73
  * label: "Tags",
74
74
  * multi: true,
75
- * allowCustom: true,
75
+ * allowCustom: false,
76
76
  * options: ["Rust", "JS", "C++", "Klingon", "Go"],
77
77
  * bind: A.ref($tags)
78
78
  * });
@@ -87,7 +87,7 @@ const ROLE_CLASS = /\.(gradient|primary|secondary|neutral|danger|success|warning
87
87
  *
88
88
  * @example
89
89
  * ```ts
90
- * S.button({ content: "Save", click: save });
90
+ * S.button({ content: "Save", click: S.alert("Saved.") });
91
91
  * S.button({ content: "Delete", attrs: ".danger .outlined", click: del });
92
92
  * S.button("Cancel"); // shorthand for { content: "Cancel" }
93
93
  * S.button({ href: "/docs", content: "Docs" }); // renders an <a role=button>
@@ -246,12 +246,13 @@ mountPortal(() => {
246
246
  * @example
247
247
  * ```ts
248
248
  * // An @-mention picker: typing "@" in the input pops up a user menu.
249
+ * const users = ['Alice', 'Bob', 'Charlie', 'Dutley']
249
250
  * A("input placeholder=Comment…", () => {
250
251
  * A("keydown=", (e: KeyboardEvent) => {
251
252
  * if (e.key !== "@") return;
252
253
  * S.showFloatingMenu({
253
254
  * anchor: e.currentTarget as HTMLElement,
254
- * items: users.map((u) => ({ label: u.name, click: () => mention(u) })),
255
+ * items: users.map((u) => ({ label: u, click: () => S.alert(`Mentioned ${u}!`) })),
255
256
  * });
256
257
  * });
257
258
  * });
@@ -31,6 +31,7 @@ A.insertGlobalCss({
31
31
  *
32
32
  * @example
33
33
  * ```ts
34
+ * const $sel = A.proxy("Netherlands");
34
35
  * S.select({ label: "Country", options: ["Belgium", "Netherlands"], bind: $sel });
35
36
  * ```
36
37
  */
@@ -117,9 +117,11 @@ mountPortal(() => {
117
117
  * A("#Save");
118
118
  * S.addTooltip({ tip: "Saves your work to the cloud" });
119
119
  * });
120
+ *
121
+ * A(" ");
120
122
  *
121
123
  * S.button(() => {
122
- * A(".danger#Delete");
124
+ * A(".danger #Delete");
123
125
  * S.addTooltip({ tip: "Dangerous — cannot be undone", placement: "bottom" });
124
126
  * });
125
127
  * ```