@lilydesignsystem/html-picker-bar 0.5.1 → 0.6.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.
package/LICENSE.md CHANGED
@@ -8,15 +8,15 @@ Lily Design System™ is free open source software.
8
8
 
9
9
  License is any of these, at your option, or contact us for custom license options.
10
10
 
11
- * [MIT](https://opensource.org/license/mit) ([SPDX: MIT](https://spdx.org/licenses/MIT.html))
11
+ - [MIT](https://opensource.org/license/mit) ([SPDX: MIT](https://spdx.org/licenses/MIT.html))
12
12
 
13
- * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([SPDX: Apache-2.0](https://spdx.org/licenses/Apache-2.0.html))
13
+ - [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([SPDX: Apache-2.0](https://spdx.org/licenses/Apache-2.0.html))
14
14
 
15
- * [GNU General Public License v2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html) ([SPDX: GPL-2.0-only](https://spdx.org/licenses/GPL-2.0-only.html))
15
+ - [GNU General Public License v2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html) ([SPDX: GPL-2.0-only](https://spdx.org/licenses/GPL-2.0-only.html))
16
16
 
17
- * [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0-standalone.html) ([SPDX: GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html))
17
+ - [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0-standalone.html) ([SPDX: GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html))
18
18
 
19
- * [BSD 3-Clause License](https://opensource.org/license/bsd-3-clause) ([SPDX: BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html))
19
+ - [BSD 3-Clause License](https://opensource.org/license/bsd-3-clause) ([SPDX: BSD-3-Clause](https://spdx.org/licenses/BSD-3-Clause.html))
20
20
 
21
21
  ## SPDX
22
22
 
@@ -31,9 +31,9 @@ single identifier from the list where the packaging format does not accept a
31
31
  disjunction. You do not need permission to pick one: choose whichever member of
32
32
  the list suits your project and comply with that one.
33
33
 
34
- This applies to the whole repository — the component catalog, the seven headless
35
- libraries, the seven example applications, the seven helper catalogs, the
36
- `themes/` stylesheets, the `bin/` tooling, and the documentation.
34
+ This applies to the whole repository — the component catalog, the headless
35
+ libraries, the example applications, the helper packages, the `themes/`
36
+ stylesheets, the `bin/` tooling, and the documentation.
37
37
 
38
38
  ## Scope note
39
39
 
package/README.md CHANGED
@@ -55,8 +55,14 @@ document.querySelector("header").appendChild(bar);
55
55
  Or in markup, for the parts that fit plain attributes:
56
56
 
57
57
  ```html
58
- <script type="module" src="/node_modules/lily-design-system-html-picker-bar/dist/index.js"></script>
59
- <picker-bar themes-url="/assets/themes/" locales="en,cy,gd,ga"></picker-bar>
58
+ <script
59
+ type="module"
60
+ src="/node_modules/lily-design-system-html-picker-bar/dist/index.js"
61
+ ></script>
62
+ <picker-bar
63
+ themes-url="/assets/themes/"
64
+ locales="en,cy,gd,ga"
65
+ ></picker-bar>
60
66
  <script type="module">
61
67
  document.querySelector("picker-bar").labels = {
62
68
  search: "Search this site",
@@ -82,7 +88,7 @@ same pattern elsewhere in this catalog.
82
88
 
83
89
  ## Defaults
84
90
 
85
- - **`themes`** defaults to `DEFAULT_THEMES` — all 45 Lily reference
91
+ - **`themes`** defaults to `DEFAULT_THEMES` — all 63 Lily reference
86
92
  theme slugs, alphabetical, with the 8 United Kingdom / United States
87
93
  government themes moved to their own alphabetical group at the
88
94
  bottom. Set your own `themes` attribute (comma-separated) or
@@ -106,7 +112,11 @@ attribute — for anything beyond what `<picker-bar>` lifts to the top
106
112
  level: persistence, initial value, detection, a `*Labels` override map.
107
113
 
108
114
  ```js
109
- bar.searchProps = { action: "/search", placeholder: "Search…", navigate: (href) => router.push(href) };
115
+ bar.searchProps = {
116
+ action: "/search",
117
+ placeholder: "Search…",
118
+ navigate: (href) => router.push(href),
119
+ };
110
120
  bar.themeProps = { storageKey: "lily-theme", detectFromSystem: true };
111
121
  bar.localeProps = { storageKey: "lily-locale", detectFromNavigator: true };
112
122
  bar.textSizeProps = { storageKey: "lily-text-size" };
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export { ShareTarget } from '@lilydesignsystem/html-share-picker';
23
23
  */
24
24
 
25
25
  /**
26
- * All 57 Lily reference theme slugs (see `themes/` at the repo root),
26
+ * All 63 Lily reference theme slugs (see `themes/` at the repo root),
27
27
  * sorted alphabetically except the United Kingdom and United States
28
28
  * government/public-sector themes, which sort last as one alphabetical
29
29
  * group of their own. Mirrors `theme-picker`'s own title-casing of each
@@ -44,12 +44,16 @@ type PickerBarLabels = {
44
44
  * supplied; the link picker renders only when both are present.
45
45
  */
46
46
  link?: string;
47
- /** Accessible name for the search picker's button and search landmark. */
48
- search: string;
47
+ /**
48
+ * Accessible name for the search picker's button and search landmark. Optional: omitted or empty, the bar has no search
49
+ * picker (a client-side app whose search would navigate away from its state can leave it out). When given, `searchInput`
50
+ * and `searchSubmit` are needed too.
51
+ */
52
+ search?: string;
49
53
  /** Accessible name for the search picker's text field. */
50
- searchInput: string;
54
+ searchInput?: string;
51
55
  /** Accessible name for the search picker's ⏎ submit button. */
52
- searchSubmit: string;
56
+ searchSubmit?: string;
53
57
  /** Accessible name for the theme picker's button and listbox. */
54
58
  theme: string;
55
59
  /** Accessible name for the locale picker's button and listbox. */
package/dist/index.js CHANGED
@@ -13,10 +13,13 @@ var DEFAULT_THEMES = [
13
13
  "ant-design",
14
14
  "aqua",
15
15
  "atlassian",
16
+ "australia-agriculture-design-system",
16
17
  "autumn",
17
18
  "black",
19
+ "brazil-padrao-digital-de-governo",
18
20
  "bumblebee",
19
21
  "business",
22
+ "canada-government-of-canada-design-system",
20
23
  "cappuccino",
21
24
  "caramellatte",
22
25
  "cmyk",
@@ -28,6 +31,7 @@ var DEFAULT_THEMES = [
28
31
  "dim",
29
32
  "dracula",
30
33
  "emerald",
34
+ "european-union-europa-component-library",
31
35
  "excel",
32
36
  "fantasy",
33
37
  "fluent",
@@ -36,6 +40,7 @@ var DEFAULT_THEMES = [
36
40
  "github-primer",
37
41
  "halloween",
38
42
  "ibm-carbon",
43
+ "japan-digital-agency-design-system",
39
44
  "lemonade",
40
45
  "light",
41
46
  "linear",
@@ -50,6 +55,7 @@ var DEFAULT_THEMES = [
50
55
  "salesforce",
51
56
  "sap-fiori",
52
57
  "silk",
58
+ "singapore-government-design-system",
53
59
  "sunset",
54
60
  "synthwave",
55
61
  "valentine",
@@ -301,12 +307,15 @@ var PickerBar = class extends HTMLElement {
301
307
  root.appendChild(linkEl);
302
308
  this.#linkPickerEl = linkEl;
303
309
  }
304
- const searchEl = document.createElement("search-picker");
305
- searchEl.label = this.#labels.search;
306
- searchEl.inputLabel = this.#labels.searchInput;
307
- searchEl.submitLabel = this.#labels.searchSubmit;
308
- Object.assign(searchEl, this.#searchProps);
309
- root.appendChild(searchEl);
310
+ let searchEl = null;
311
+ if (this.#labels.search) {
312
+ searchEl = document.createElement("search-picker");
313
+ searchEl.label = this.#labels.search;
314
+ searchEl.inputLabel = this.#labels.searchInput ?? "";
315
+ searchEl.submitLabel = this.#labels.searchSubmit ?? "";
316
+ Object.assign(searchEl, this.#searchProps);
317
+ root.appendChild(searchEl);
318
+ }
310
319
  const themeEl = document.createElement("theme-picker");
311
320
  themeEl.label = this.#labels.theme;
312
321
  themeEl.themesUrl = this.themesUrl;
@@ -326,9 +335,7 @@ var PickerBar = class extends HTMLElement {
326
335
  timeZoneEl.label = this.#labels.timeZone;
327
336
  root.appendChild(timeZoneEl);
328
337
  }
329
- const textSizeEl = document.createElement(
330
- "text-size-picker"
331
- );
338
+ const textSizeEl = document.createElement("text-size-picker");
332
339
  textSizeEl.label = this.#labels.textSize;
333
340
  textSizeEl.sizes = this.#sizes;
334
341
  textSizeEl.defaultValue = "normal";
package/index.md CHANGED
@@ -55,8 +55,14 @@ document.querySelector("header").appendChild(bar);
55
55
  Or in markup, for the parts that fit plain attributes:
56
56
 
57
57
  ```html
58
- <script type="module" src="/node_modules/lily-design-system-html-picker-bar/dist/index.js"></script>
59
- <picker-bar themes-url="/assets/themes/" locales="en,cy,gd,ga"></picker-bar>
58
+ <script
59
+ type="module"
60
+ src="/node_modules/lily-design-system-html-picker-bar/dist/index.js"
61
+ ></script>
62
+ <picker-bar
63
+ themes-url="/assets/themes/"
64
+ locales="en,cy,gd,ga"
65
+ ></picker-bar>
60
66
  <script type="module">
61
67
  document.querySelector("picker-bar").labels = {
62
68
  search: "Search this site",
@@ -82,7 +88,7 @@ same pattern elsewhere in this catalog.
82
88
 
83
89
  ## Defaults
84
90
 
85
- - **`themes`** defaults to `DEFAULT_THEMES` — all 45 Lily reference
91
+ - **`themes`** defaults to `DEFAULT_THEMES` — all 63 Lily reference
86
92
  theme slugs, alphabetical, with the 8 United Kingdom / United States
87
93
  government themes moved to their own alphabetical group at the
88
94
  bottom. Set your own `themes` attribute (comma-separated) or
@@ -106,7 +112,11 @@ attribute — for anything beyond what `<picker-bar>` lifts to the top
106
112
  level: persistence, initial value, detection, a `*Labels` override map.
107
113
 
108
114
  ```js
109
- bar.searchProps = { action: "/search", placeholder: "Search…", navigate: (href) => router.push(href) };
115
+ bar.searchProps = {
116
+ action: "/search",
117
+ placeholder: "Search…",
118
+ navigate: (href) => router.push(href),
119
+ };
110
120
  bar.themeProps = { storageKey: "lily-theme", detectFromSystem: true };
111
121
  bar.localeProps = { storageKey: "lily-locale", detectFromNavigator: true };
112
122
  bar.textSizeProps = { storageKey: "lily-text-size" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lilydesignsystem/html-picker-bar",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "engines": {
5
5
  "node": ">=26"
6
6
  },
@@ -23,6 +23,7 @@
23
23
  "scripts": {
24
24
  "build": "node build.js",
25
25
  "test": "vitest run",
26
+ "check": "tsc --noEmit",
26
27
  "test:watch": "vitest",
27
28
  "prepublishOnly": "npm run build"
28
29
  },