@lilydesignsystem/angular-picker-bar 0.1.0 → 0.2.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/README.md +32 -12
- package/fesm2022/lilydesignsystem-angular-picker-bar.mjs +898 -204
- package/fesm2022/lilydesignsystem-angular-picker-bar.mjs.map +1 -1
- package/package.json +8 -6
- package/types/lilydesignsystem-angular-picker-bar.d.ts +298 -79
- package/types/lilydesignsystem-angular-picker-bar.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# Lily Design System™ — Angular PickerBar
|
|
2
2
|
|
|
3
|
-
A single page-header row that composes
|
|
4
|
-
[`*-picker` helpers](../index.md) — theme, locale, text size,
|
|
5
|
-
share — with two catalog-wide defaults pre-wired, so
|
|
6
|
-
component into a header instead of assembling and
|
|
3
|
+
A single page-header row that composes five of the Lily
|
|
4
|
+
[`*-picker` helpers](../index.md) — search, theme, locale, text size,
|
|
5
|
+
and share, in that order — with two catalog-wide defaults pre-wired, so
|
|
6
|
+
you can drop one component into a header instead of assembling and
|
|
7
|
+
configuring five.
|
|
7
8
|
|
|
8
9
|
`motion-picker` and `date-time-picker` are not part of the bar: motion
|
|
9
10
|
has no natural spot next to the other three header preferences, and
|
|
@@ -15,8 +16,9 @@ has no natural spot next to the other three header preferences, and
|
|
|
15
16
|
npm install @lilydesignsystem/angular-picker-bar
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
`@lilydesignsystem/angular-
|
|
19
|
-
`-text-size-picker`, and `-share-picker` install
|
|
19
|
+
`@lilydesignsystem/angular-search-picker`, `-theme-picker`,
|
|
20
|
+
`-locale-picker`, `-text-size-picker`, and `-share-picker` install
|
|
21
|
+
automatically as
|
|
20
22
|
regular dependencies — `PickerBar` is a thin wrapper around them, not
|
|
21
23
|
a reimplementation.
|
|
22
24
|
|
|
@@ -32,7 +34,15 @@ import { PickerBar } from "@lilydesignsystem/angular-picker-bar";
|
|
|
32
34
|
imports: [PickerBar],
|
|
33
35
|
template: `
|
|
34
36
|
<lily-picker-bar
|
|
35
|
-
[labels]="{
|
|
37
|
+
[labels]="{
|
|
38
|
+
search: 'Search this site',
|
|
39
|
+
searchInput: 'Search terms',
|
|
40
|
+
searchSubmit: 'Search',
|
|
41
|
+
theme: 'Theme',
|
|
42
|
+
locale: 'Language',
|
|
43
|
+
textSize: 'Text size',
|
|
44
|
+
share: 'Share',
|
|
45
|
+
}"
|
|
36
46
|
themesUrl="/assets/themes/"
|
|
37
47
|
[locales]="['en', 'cy', 'gd', 'ga']"
|
|
38
48
|
[shareTargets]="[{ id: 'email', label: 'Email', href: (url, title) => 'mailto:?subject=' + title + '&body=' + url }]"
|
|
@@ -42,7 +52,8 @@ import { PickerBar } from "@lilydesignsystem/angular-picker-bar";
|
|
|
42
52
|
export class HeaderComponent {}
|
|
43
53
|
```
|
|
44
54
|
|
|
45
|
-
That's a complete, working header row:
|
|
55
|
+
That's a complete, working header row: site search (a search for
|
|
56
|
+
`foo` goes to `/?foo`), 45 themes, four locales, the
|
|
46
57
|
seven-step text-size scale, and one share destination plus copy-to-URL
|
|
47
58
|
if you add `[copyLabel]="'Copy link'"`.
|
|
48
59
|
|
|
@@ -81,11 +92,17 @@ extras onto its own inputs, prefixed by which picker they belong to:
|
|
|
81
92
|
localeStorageKey="lily-locale"
|
|
82
93
|
[localeDetectFromNavigator]="true"
|
|
83
94
|
textSizeStorageKey="lily-text-size"
|
|
95
|
+
searchAction="/search"
|
|
96
|
+
searchPlaceholder="Search…"
|
|
84
97
|
copyLabel="Copy link"
|
|
85
98
|
copiedLabel="Copied"
|
|
86
99
|
/>
|
|
87
100
|
```
|
|
88
101
|
|
|
102
|
+
In a single-page app, pass `[searchNavigate]="(href) => router.navigateByUrl(href)"`
|
|
103
|
+
(as a component field) to keep searches client-side; `(searched)`
|
|
104
|
+
re-emits the search picker's `{ query, href }` before navigating.
|
|
105
|
+
|
|
89
106
|
Two-way bind a picker's current value with the matching `model()`
|
|
90
107
|
input:
|
|
91
108
|
|
|
@@ -94,14 +111,15 @@ input:
|
|
|
94
111
|
```
|
|
95
112
|
|
|
96
113
|
For anything not flattened here (a custom icon template, for
|
|
97
|
-
instance), compose the
|
|
114
|
+
instance), compose the five wrapped pickers directly instead of using
|
|
98
115
|
`PickerBar` — see each picker's own `index.md`.
|
|
99
116
|
|
|
100
117
|
## Styling
|
|
101
118
|
|
|
102
119
|
`PickerBar` renders no CSS of its own beyond the `picker-bar` root
|
|
103
120
|
wrapper — style each child through its own package's class hooks
|
|
104
|
-
(`theme-picker`, `locale-picker`, `text-size-picker`,
|
|
121
|
+
(`search-picker`, `theme-picker`, `locale-picker`, `text-size-picker`,
|
|
122
|
+
`share-picker`;
|
|
105
123
|
see each package's own `index.md`). A typical header layout:
|
|
106
124
|
|
|
107
125
|
```css
|
|
@@ -114,8 +132,10 @@ see each package's own `index.md`). A typical header layout:
|
|
|
114
132
|
|
|
115
133
|
## Accessibility
|
|
116
134
|
|
|
117
|
-
Every accessible name comes from `labels` —
|
|
118
|
-
|
|
135
|
+
Every accessible name comes from `labels` — seven names, three of them
|
|
136
|
+
for the search picker (`search` for its button and search landmark,
|
|
137
|
+
`searchInput` for the field, `searchSubmit` for the `⏎` button). There
|
|
138
|
+
is no English default, because a set of names this catalog invented is exactly the
|
|
119
139
|
case the rest of Lily's i18n rule exists for. Each wrapped picker keeps
|
|
120
140
|
its own WAI-ARIA APG contract unchanged; see that picker's own `index.md`.
|
|
121
141
|
|