@lilydesignsystem/web-components-picker-bar 0.2.0 → 0.4.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 +64 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +61 -2
- package/index.md +2 -0
- package/package.json +14 -4
package/LICENSE.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!-- Synced from the canonical repository by bin/sync-special-files.
|
|
2
|
+
Do not edit here; edit the root copy and re-run the script.
|
|
3
|
+
Canonical: https://github.com/LilyDesignSystem/lily-design-system/blob/main/LICENSE.md -->
|
|
4
|
+
|
|
5
|
+
# License
|
|
6
|
+
|
|
7
|
+
Lily Design System™ is free open source software.
|
|
8
|
+
|
|
9
|
+
License is any of these, at your option, or contact us for custom license options.
|
|
10
|
+
|
|
11
|
+
* [MIT](https://opensource.org/license/mit) ([SPDX: MIT](https://spdx.org/licenses/MIT.html))
|
|
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))
|
|
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))
|
|
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))
|
|
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))
|
|
20
|
+
|
|
21
|
+
## SPDX
|
|
22
|
+
|
|
23
|
+
The machine-readable expression for the choice above is:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
SPDX-License-Identifier: MIT OR Apache-2.0 OR GPL-2.0-only OR GPL-3.0-only OR BSD-3-Clause
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Every package manifest in this repository should carry that expression, or a
|
|
30
|
+
single identifier from the list where the packaging format does not accept a
|
|
31
|
+
disjunction. You do not need permission to pick one: choose whichever member of
|
|
32
|
+
the list suits your project and comply with that one.
|
|
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.
|
|
37
|
+
|
|
38
|
+
## Scope note
|
|
39
|
+
|
|
40
|
+
This file supersedes an earlier `CC BY-NC-SA` notice. That notice was a content
|
|
41
|
+
license with a non-commercial clause, it was not an open-source license, and it
|
|
42
|
+
contradicted both the specification and the published packages. It should not be
|
|
43
|
+
relied on. If you obtained Lily under it and that raises a question for you,
|
|
44
|
+
contact <joel@joelparkerhenderson.com>.
|
|
45
|
+
|
|
46
|
+
## Trademarks
|
|
47
|
+
|
|
48
|
+
Lily™ and Lily Design System™ are trademarks. The trademarks are distinct from
|
|
49
|
+
the software license: a trademark claim (™) asserts use of the marks and is
|
|
50
|
+
independent of the licenses above. A license to the software is not a license to
|
|
51
|
+
the marks.
|
|
52
|
+
|
|
53
|
+
You may say your project uses Lily, is built with Lily, or is compatible with
|
|
54
|
+
Lily. Please do not use the marks as the name of your fork or product, or in a
|
|
55
|
+
way that suggests affiliation or endorsement. For any use beyond that, contact
|
|
56
|
+
<joel@joelparkerhenderson.com>.
|
|
57
|
+
|
|
58
|
+
## Third-party references
|
|
59
|
+
|
|
60
|
+
Lily's example applications and `themes/` stylesheets take visual reference from
|
|
61
|
+
public-sector design systems including NHS UK, GOV.UK, and USWDS. Lily is not
|
|
62
|
+
affiliated with, endorsed by, or connected to any of those organisations. Their
|
|
63
|
+
names and marks belong to them, and this license grants nothing in respect of
|
|
64
|
+
them.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LinkItem, LinkPickerProps, LinkPicker } from '@lilydesignsystem/web-components-link-picker';
|
|
1
2
|
import { SearchPickerProps } from '@lilydesignsystem/web-components-search-picker';
|
|
2
3
|
import { ThemePickerProps } from '@lilydesignsystem/web-components-theme-picker';
|
|
3
4
|
import { LocalePickerProps } from '@lilydesignsystem/web-components-locale-picker';
|
|
@@ -21,7 +22,7 @@ import { ShareTarget, SharePickerProps } from '@lilydesignsystem/web-components-
|
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
* All
|
|
25
|
+
* All 57 Lily reference theme slugs (see `themes/` at the repo root),
|
|
25
26
|
* sorted alphabetically except the United Kingdom and United States
|
|
26
27
|
* government/public-sector themes, which sort last as one alphabetical
|
|
27
28
|
* group of their own. Mirrors `<lily-theme-picker>`'s own title-casing
|
|
@@ -37,6 +38,11 @@ declare const DEFAULT_THEMES: string[];
|
|
|
37
38
|
declare const DEFAULT_SIZES: string[];
|
|
38
39
|
/** Accessible names for the four pickers. Required — no English default. */
|
|
39
40
|
type PickerBarLabels = {
|
|
41
|
+
/**
|
|
42
|
+
* Accessible name for the link picker's button and list. Needed only when `links` is
|
|
43
|
+
* supplied; the link picker renders only when both are present.
|
|
44
|
+
*/
|
|
45
|
+
link?: string;
|
|
40
46
|
/** Accessible name for the search picker's button and search landmark. */
|
|
41
47
|
search: string;
|
|
42
48
|
/** Accessible name for the search picker's text field. */
|
|
@@ -58,6 +64,10 @@ type PickerBarProps = {
|
|
|
58
64
|
labels: PickerBarLabels;
|
|
59
65
|
/** Property-only extra `<lily-search-picker>` config (`action`, `navigate`, `placeholder`, `onSearch`, …), applied after the bar's own. */
|
|
60
66
|
searchProps?: Partial<Omit<SearchPickerProps, "label" | "inputLabel" | "submitLabel">>;
|
|
67
|
+
/** Page links for the link picker, which renders FIRST (leftmost). Omitted or empty: no link picker. */
|
|
68
|
+
links?: LinkItem[];
|
|
69
|
+
/** Property-only extra `<lily-link-picker>` config (`onNavigate`, …), applied after this bar's own. */
|
|
70
|
+
linkProps?: Partial<Omit<LinkPickerProps, "label" | "links">>;
|
|
61
71
|
themesUrl: string;
|
|
62
72
|
themes?: string[];
|
|
63
73
|
/** Property-only extra `<lily-theme-picker>` config, applied after the bar's own. */
|
|
@@ -92,6 +102,13 @@ declare class PickerBar extends HTMLElement {
|
|
|
92
102
|
/** Property-only — `ShareTarget.href` is a function. */
|
|
93
103
|
get shareTargets(): ShareTarget[];
|
|
94
104
|
set shareTargets(v: ShareTarget[]);
|
|
105
|
+
/** Page links for the link picker (leftmost). Property-only. */
|
|
106
|
+
get links(): LinkItem[];
|
|
107
|
+
set links(v: LinkItem[]);
|
|
108
|
+
get linkProps(): Partial<LinkPickerProps>;
|
|
109
|
+
set linkProps(v: Partial<LinkPickerProps>);
|
|
110
|
+
/** The rendered `<lily-link-picker>` instance (null when no links). */
|
|
111
|
+
get linkPicker(): LinkPicker | null;
|
|
95
112
|
get searchProps(): Partial<SearchPickerProps>;
|
|
96
113
|
set searchProps(v: Partial<SearchPickerProps>);
|
|
97
114
|
get themeProps(): Partial<ThemePickerProps>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
//
|
|
1
|
+
// picker-bar.ts
|
|
2
|
+
import "@lilydesignsystem/web-components-link-picker";
|
|
2
3
|
import "@lilydesignsystem/web-components-search-picker";
|
|
3
4
|
import "@lilydesignsystem/web-components-theme-picker";
|
|
4
5
|
import "@lilydesignsystem/web-components-locale-picker";
|
|
@@ -8,11 +9,14 @@ var DEFAULT_THEMES = [
|
|
|
8
9
|
"abyss",
|
|
9
10
|
"acid",
|
|
10
11
|
"adobe-spectrum",
|
|
12
|
+
"ant-design",
|
|
11
13
|
"aqua",
|
|
14
|
+
"atlassian",
|
|
12
15
|
"autumn",
|
|
13
16
|
"black",
|
|
14
17
|
"bumblebee",
|
|
15
18
|
"business",
|
|
19
|
+
"cappuccino",
|
|
16
20
|
"caramellatte",
|
|
17
21
|
"cmyk",
|
|
18
22
|
"coffee",
|
|
@@ -23,23 +27,32 @@ var DEFAULT_THEMES = [
|
|
|
23
27
|
"dim",
|
|
24
28
|
"dracula",
|
|
25
29
|
"emerald",
|
|
30
|
+
"excel",
|
|
26
31
|
"fantasy",
|
|
32
|
+
"fluent",
|
|
27
33
|
"forest",
|
|
28
34
|
"garden",
|
|
35
|
+
"github-primer",
|
|
29
36
|
"halloween",
|
|
37
|
+
"ibm-carbon",
|
|
30
38
|
"lemonade",
|
|
31
39
|
"light",
|
|
40
|
+
"linear",
|
|
32
41
|
"lofi",
|
|
33
42
|
"luxury",
|
|
34
43
|
"mozilla-protocol",
|
|
35
44
|
"night",
|
|
36
45
|
"nord",
|
|
46
|
+
"notion",
|
|
37
47
|
"pastel",
|
|
38
48
|
"retro",
|
|
49
|
+
"salesforce",
|
|
50
|
+
"sap-fiori",
|
|
39
51
|
"silk",
|
|
40
52
|
"sunset",
|
|
41
53
|
"synthwave",
|
|
42
54
|
"valentine",
|
|
55
|
+
"vercel",
|
|
43
56
|
"winter",
|
|
44
57
|
"wireframe",
|
|
45
58
|
"united-kingdom-government-digital-service",
|
|
@@ -81,6 +94,8 @@ var PickerBar = class extends HTMLElement {
|
|
|
81
94
|
#sizes = [...DEFAULT_SIZES];
|
|
82
95
|
#labels = { ...DEFAULT_LABELS };
|
|
83
96
|
#shareTargets = [];
|
|
97
|
+
#links = [];
|
|
98
|
+
#linkProps = {};
|
|
84
99
|
#searchProps = {};
|
|
85
100
|
#themeProps = {};
|
|
86
101
|
#localeProps = {};
|
|
@@ -88,6 +103,7 @@ var PickerBar = class extends HTMLElement {
|
|
|
88
103
|
#shareProps = {};
|
|
89
104
|
#built = false;
|
|
90
105
|
#rootEl = null;
|
|
106
|
+
#linkEl = null;
|
|
91
107
|
#searchEl = null;
|
|
92
108
|
#themeEl = null;
|
|
93
109
|
#localeEl = null;
|
|
@@ -142,6 +158,7 @@ var PickerBar = class extends HTMLElement {
|
|
|
142
158
|
}
|
|
143
159
|
set labels(v) {
|
|
144
160
|
this.#labels = v ?? { ...DEFAULT_LABELS };
|
|
161
|
+
this.#syncLink();
|
|
145
162
|
if (this.#searchEl) {
|
|
146
163
|
this.#searchEl.label = this.#labels.search;
|
|
147
164
|
this.#searchEl.inputLabel = this.#labels.searchInput;
|
|
@@ -160,6 +177,46 @@ var PickerBar = class extends HTMLElement {
|
|
|
160
177
|
this.#shareTargets = Array.isArray(v) ? v.slice() : [];
|
|
161
178
|
if (this.#shareEl) this.#shareEl.targets = this.#shareTargets;
|
|
162
179
|
}
|
|
180
|
+
/** Page links for the link picker (leftmost). Property-only. */
|
|
181
|
+
get links() {
|
|
182
|
+
return [...this.#links];
|
|
183
|
+
}
|
|
184
|
+
set links(v) {
|
|
185
|
+
this.#links = Array.isArray(v) ? v.slice() : [];
|
|
186
|
+
this.#syncLink();
|
|
187
|
+
}
|
|
188
|
+
get linkProps() {
|
|
189
|
+
return { ...this.#linkProps };
|
|
190
|
+
}
|
|
191
|
+
set linkProps(v) {
|
|
192
|
+
this.#linkProps = v ?? {};
|
|
193
|
+
if (this.#linkEl) Object.assign(this.#linkEl, this.#linkProps);
|
|
194
|
+
}
|
|
195
|
+
/** The rendered `<lily-link-picker>` instance (null when no links). */
|
|
196
|
+
get linkPicker() {
|
|
197
|
+
return this.#linkEl;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Create, update or remove the link picker so it is the root's first child exactly when
|
|
201
|
+
* `links` is non-empty and `labels.link` is set. The picker is optional, so unlike the
|
|
202
|
+
* other five it can appear and disappear after the bar is rendered.
|
|
203
|
+
*/
|
|
204
|
+
#syncLink() {
|
|
205
|
+
if (!this.#rootEl) return;
|
|
206
|
+
const wanted = this.#links.length > 0 && !!this.#labels.link;
|
|
207
|
+
if (!wanted) {
|
|
208
|
+
this.#linkEl?.remove();
|
|
209
|
+
this.#linkEl = null;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (!this.#linkEl) {
|
|
213
|
+
this.#linkEl = document.createElement("lily-link-picker");
|
|
214
|
+
this.#rootEl.insertBefore(this.#linkEl, this.#rootEl.firstChild);
|
|
215
|
+
}
|
|
216
|
+
this.#linkEl.label = this.#labels.link;
|
|
217
|
+
this.#linkEl.links = this.#links;
|
|
218
|
+
Object.assign(this.#linkEl, this.#linkProps);
|
|
219
|
+
}
|
|
163
220
|
get searchProps() {
|
|
164
221
|
return { ...this.#searchProps };
|
|
165
222
|
}
|
|
@@ -275,10 +332,12 @@ var PickerBar = class extends HTMLElement {
|
|
|
275
332
|
this.#localeEl = localeEl;
|
|
276
333
|
this.#textSizeEl = textSizeEl;
|
|
277
334
|
this.#shareEl = shareEl;
|
|
335
|
+
this.#linkEl = null;
|
|
336
|
+
this.#syncLink();
|
|
278
337
|
}
|
|
279
338
|
};
|
|
280
339
|
|
|
281
|
-
//
|
|
340
|
+
// index.ts
|
|
282
341
|
if (typeof customElements !== "undefined" && !customElements.get("lily-picker-bar")) {
|
|
283
342
|
customElements.define("lily-picker-bar", PickerBar);
|
|
284
343
|
}
|
package/index.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Lily Design System™ — `<lily-picker-bar>`
|
|
2
2
|
|
|
3
|
+
> **Link picker (0.3.0).** Pass `links` (and `labels.link`) to add a `link-picker` — a home icon opening the page links your app defines — as the leftmost icon. It renders only when both are given.
|
|
4
|
+
|
|
3
5
|
A single page-header row that composes five of the Lily
|
|
4
6
|
[`*-picker` helpers](../index.md) — search, theme, locale, text size,
|
|
5
7
|
and share, in that order — with two catalog-wide defaults pre-wired,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lilydesignsystem/web-components-picker-bar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": "=26"
|
|
6
6
|
},
|
|
7
|
-
"description": "Lily Design System
|
|
7
|
+
"description": "Lily Design System Web Components picker bar: composes lily-link-picker (optional), lily-search-picker, lily-theme-picker, lily-locale-picker, lily-text-size-picker, and lily-share-picker into one page-header row.",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"module": "./dist/index.js",
|
|
@@ -21,15 +21,25 @@
|
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"
|
|
24
|
+
"build": "node build.js",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest",
|
|
27
|
+
"prepublishOnly": "npm run build"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
30
|
+
"@lilydesignsystem/web-components-link-picker": "^0.1.0",
|
|
27
31
|
"@lilydesignsystem/web-components-search-picker": "^0.1.0",
|
|
28
32
|
"@lilydesignsystem/web-components-theme-picker": "^0.2.0",
|
|
29
33
|
"@lilydesignsystem/web-components-locale-picker": "^0.2.0",
|
|
30
34
|
"@lilydesignsystem/web-components-text-size-picker": "^0.2.0",
|
|
31
35
|
"@lilydesignsystem/web-components-share-picker": "^0.2.0"
|
|
32
36
|
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"jsdom": "^30.1.1",
|
|
39
|
+
"tsup": "^8.5.1",
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
|
+
"vitest": "^4.1.11"
|
|
42
|
+
},
|
|
33
43
|
"keywords": [
|
|
34
44
|
"lily",
|
|
35
45
|
"design",
|
|
@@ -47,7 +57,7 @@
|
|
|
47
57
|
"license": "MIT OR Apache-2.0 OR GPL-2.0-only OR GPL-3.0-only OR BSD-3-Clause",
|
|
48
58
|
"repository": {
|
|
49
59
|
"type": "git",
|
|
50
|
-
"url": "git+https://github.com/LilyDesignSystem/lily-design-system
|
|
60
|
+
"url": "git+https://github.com/LilyDesignSystem/lily-design-system.git",
|
|
51
61
|
"directory": "lily-design-system-web-components-picker-bar"
|
|
52
62
|
},
|
|
53
63
|
"homepage": "https://lilydesignsystem.com/",
|