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