@nanahoshi/mona-ui 0.29.0 → 0.31.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/docs/api/button-group.md +1 -0
- package/docs/api/color-gradient.md +1 -0
- package/docs/api/color-palette.md +1 -0
- package/docs/api/color-picker.md +1 -0
- package/docs/api/form-field.md +88 -0
- package/docs/api/i18n.md +44 -0
- package/docs/api/locales.md +14 -14
- package/docs/api/qr-code.md +287 -0
- package/docs/api/segmented.md +1 -0
- package/docs/api/switch.md +1 -0
- package/docs/dropdown-list.md +1 -1
- package/docs/form-field.md +425 -0
- package/docs/forms.md +12 -4
- package/docs/label.md +4 -5
- package/docs/numeric-textbox.md +1 -1
- package/docs/qr-code.md +377 -0
- package/docs/radio-button.md +2 -1
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +15 -4
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +5 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +29 -3
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +31 -3
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +15 -4
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +15 -4
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +15 -4
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +19 -7
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +24 -4
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -0
- package/fesm2022/nanahoshi-mona-ui-form-field.mjs +666 -0
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +32 -0
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +27 -2
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +28 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +24 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +24 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +14 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +19 -7
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +14 -5
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +6 -3
- package/fesm2022/nanahoshi-mona-ui-qr-code.mjs +1671 -0
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +15 -9
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +6 -3
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +8 -5
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +25 -1
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +6 -3
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +15 -4
- package/form-field/package.json +4 -0
- package/i18n/catalogs/en-US.messages.json +16 -0
- package/llms.txt +5 -1
- package/locales/ar-sa/ar-sa.messages.json +16 -0
- package/locales/de-de/de-de.messages.json +16 -0
- package/locales/es-es/es-es.messages.json +16 -0
- package/locales/fr-fr/fr-fr.messages.json +16 -0
- package/locales/id-id/id-id.messages.json +16 -0
- package/locales/it-it/it-it.messages.json +16 -0
- package/locales/ja-jp/ja-jp.messages.json +16 -0
- package/locales/ko-kr/ko-kr.messages.json +16 -0
- package/locales/pl-pl/pl-pl.messages.json +16 -0
- package/locales/pt-br/pt-br.messages.json +16 -0
- package/locales/ru-ru/ru-ru.messages.json +16 -0
- package/locales/tr-tr/tr-tr.messages.json +16 -0
- package/locales/zh-cn/zh-cn.messages.json +16 -0
- package/locales/zh-tw/zh-tw.messages.json +16 -0
- package/package.json +9 -1
- package/qr-code/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +2 -0
- package/types/nanahoshi-mona-ui-button-group.d.ts +11 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +11 -0
- package/types/nanahoshi-mona-ui-color-palette.d.ts +11 -0
- package/types/nanahoshi-mona-ui-color-picker.d.ts +11 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +2 -0
- package/types/nanahoshi-mona-ui-form-field.d.ts +173 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +33 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +39 -4
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +16 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +16 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +2 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
- package/types/nanahoshi-mona-ui-qr-code.d.ts +322 -0
- package/types/nanahoshi-mona-ui-radio-button.d.ts +2 -0
- package/types/nanahoshi-mona-ui-rating.d.ts +1 -0
- package/types/nanahoshi-mona-ui-segmented.d.ts +11 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +1 -0
- package/types/nanahoshi-mona-ui-switch.d.ts +11 -0
- package/types/nanahoshi-mona-ui-text-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/qr-code`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/qr-code` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [QR Code](../qr-code.md)
|
|
6
|
+
|
|
7
|
+
## `QrCodeComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
Draws a value as a QR code in SVG, and exports it as a PNG, SVG or PDF file.
|
|
12
|
+
|
|
13
|
+
**Selector:** `mona-qr-code`
|
|
14
|
+
**Exported as:** `monaQrCode`
|
|
15
|
+
|
|
16
|
+
### Inputs
|
|
17
|
+
|
|
18
|
+
| Name | Type | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| `aria-label` | `string` | `""` | Accessible name of the code. Say what scanning it does, such as "QR code for the event page". When empty, falls back to the localized "QR code". The host has `role="img"` while there's a code to show. |
|
|
21
|
+
| `background` | `string` | `"#ffffff"` | Color of the light modules and the quiet zone, as any CSS color. `"transparent"` lets the page show through, which only scans on a light page. |
|
|
22
|
+
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
|
23
|
+
| `color` | `string` | `"#000000"` | Color of the dark modules, as any CSS color. Readers need it much darker than `background`. |
|
|
24
|
+
| `encoding` | `QrCodeEncoding` | `"utf-8"` | Character set the text is stored in. `"utf-8"` stores any text; `"iso-8859-1"` stores Latin-1 only, without the ECI header some older readers don't support. |
|
|
25
|
+
| `errorCorrection` | `QrCodeErrorCorrection` | `"M"` | How much of the code can be damaged or hidden and still read. Use `"H"` with an image overlay. A higher level needs more modules for the same value. |
|
|
26
|
+
| `overlay` | `QrCodeOverlay \| null` | `null` | An image or the Swiss cross to draw over the center. The modules beneath it are cleared, so raise `errorCorrection` to keep the code readable; a warning is logged in development when it hides too much. With an overlay, the code is version 2 at least, since version 1 has no room for one. |
|
|
27
|
+
| `quietZone` | `number` | `4` | Width of the light border around the code, in modules. Readers expect 4; a smaller one only scans when the surroundings are light. |
|
|
28
|
+
| `size` | `number \| string` | `200` | Width and height, quiet zone included. A number is pixels; a string can be any CSS length, such as `"100%"`. The code never grows wider than its container. |
|
|
29
|
+
| `value` | `string \| number` | `""` | Text to encode, such as a URL. A number is encoded as its digits. An empty value draws nothing. |
|
|
30
|
+
|
|
31
|
+
### Properties
|
|
32
|
+
|
|
33
|
+
| Name | Type | Description |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `error` (read-only) | `Signal<QrCodeValueError \| null>` | Why the value can't be encoded, or `null` when it can or is empty. While it's set, nothing is drawn. Use `validateQrCodeValue` to check a value before it reaches the component, such as in a form. |
|
|
36
|
+
|
|
37
|
+
### Methods
|
|
38
|
+
|
|
39
|
+
| Signature | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `downloadQrCode(options: QrCodeDownloadOptions): Promise<QrCodeExportResult>` | Exports the code and saves it as a file. PDF export needs the `jspdf` package, which isn't installed with Mona UI. |
|
|
42
|
+
| `exportQrCode(options: QrCodeExportOptions): Promise<QrCodeExportResult>` | Exports the code as a PNG image, an SVG document or a PDF page, drawn the same way it's shown, with the colors resolved to what they paint. Rejects with a `QrCodeExportError`. PDF export needs the `jspdf` package, which isn't installed with Mona UI. |
|
|
43
|
+
|
|
44
|
+
## `QrCodeExportError`
|
|
45
|
+
|
|
46
|
+
Class.
|
|
47
|
+
|
|
48
|
+
The error a QR code export rejects with.
|
|
49
|
+
|
|
50
|
+
### Properties
|
|
51
|
+
|
|
52
|
+
| Name | Type |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `code` (read-only) | `QrCodeExportErrorCode` |
|
|
55
|
+
|
|
56
|
+
## `validateQrCodeValue`
|
|
57
|
+
|
|
58
|
+
Function.
|
|
59
|
+
|
|
60
|
+
Checks whether a QR code can hold a value with the given settings, without drawing it: every character has to fit the
|
|
61
|
+
encoding, and the whole value the largest code. An empty value is valid, since the component draws nothing for it.
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
function validateQrCodeValue(value: string | number, options?: QrCodeValidationOptions): QrCodeValueError | null;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## `QR_CODE_DEFAULT_MESSAGES`
|
|
68
|
+
|
|
69
|
+
Constant.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
const QR_CODE_DEFAULT_MESSAGES: MonaQrCodeMessages;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## `QrCodeDownloadOptions`
|
|
76
|
+
|
|
77
|
+
Interface.
|
|
78
|
+
|
|
79
|
+
What to export a QR code as, and the name of the file to save.
|
|
80
|
+
|
|
81
|
+
**Extends:** `QrCodeExportOptions`
|
|
82
|
+
|
|
83
|
+
### Properties
|
|
84
|
+
|
|
85
|
+
| Name | Type | Description |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `fileName?` (read-only) | `string` | The file's name. The format's extension is added when it's missing. Defaults to `qr-code`. |
|
|
88
|
+
|
|
89
|
+
### Inherited from `QrCodeExportOptions`
|
|
90
|
+
|
|
91
|
+
| Name | Type | Description |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| `format` (read-only) | `QrCodeExportFormat` | |
|
|
94
|
+
| `size?` (read-only) | `number` | The width and height, quiet zone included, in CSS pixels: the image's pixels for PNG, its `width` and `height` for SVG, and the page for PDF, at 96 pixels to the inch. Defaults to the rendered size. A PNG has at least one pixel per module, and its modules are whole pixels, with what's left over added to the quiet zone. |
|
|
95
|
+
|
|
96
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent)
|
|
97
|
+
|
|
98
|
+
## `QrCodeExportOptions`
|
|
99
|
+
|
|
100
|
+
Interface.
|
|
101
|
+
|
|
102
|
+
What to export a QR code as.
|
|
103
|
+
|
|
104
|
+
### Properties
|
|
105
|
+
|
|
106
|
+
| Name | Type | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `format` (read-only) | `QrCodeExportFormat` | |
|
|
109
|
+
| `size?` (read-only) | `number` | The width and height, quiet zone included, in CSS pixels: the image's pixels for PNG, its `width` and `height` for SVG, and the page for PDF, at 96 pixels to the inch. Defaults to the rendered size. A PNG has at least one pixel per module, and its modules are whole pixels, with what's left over added to the quiet zone. |
|
|
110
|
+
|
|
111
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent), [`QrCodeDownloadOptions`](qr-code.md#qrcodedownloadoptions)
|
|
112
|
+
|
|
113
|
+
## `QrCodeExportResult`
|
|
114
|
+
|
|
115
|
+
Interface.
|
|
116
|
+
|
|
117
|
+
An exported QR code.
|
|
118
|
+
|
|
119
|
+
### Properties
|
|
120
|
+
|
|
121
|
+
| Name | Type | Description |
|
|
122
|
+
| --- | --- | --- |
|
|
123
|
+
| `blob` (read-only) | `Blob` | |
|
|
124
|
+
| `format` (read-only) | `QrCodeExportFormat` | |
|
|
125
|
+
| `mimeType` (read-only) | `string` | The blob's type: `image/png`, `image/svg+xml` or `application/pdf`. |
|
|
126
|
+
| `size` (read-only) | `number` | The width and height in CSS pixels. |
|
|
127
|
+
|
|
128
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent)
|
|
129
|
+
|
|
130
|
+
## `QrCodeImageOverlay`
|
|
131
|
+
|
|
132
|
+
Interface.
|
|
133
|
+
|
|
134
|
+
An image, such as a logo, drawn over the center of the code.
|
|
135
|
+
|
|
136
|
+
### Properties
|
|
137
|
+
|
|
138
|
+
| Name | Type | Description |
|
|
139
|
+
| --- | --- | --- |
|
|
140
|
+
| `size?` (read-only) | `number` | The image's width and height as a share of the code's, without the quiet zone. The image keeps its aspect ratio inside that square. Defaults to `0.2`. |
|
|
141
|
+
| `src` (read-only) | `string` | The image's URL. Exporting reads it into the file, so an image from another origin has to allow it with CORS. |
|
|
142
|
+
| `type` (read-only) | `"image"` | |
|
|
143
|
+
|
|
144
|
+
**Used by:** [`QrCodeOverlay`](qr-code.md#qrcodeoverlay)
|
|
145
|
+
|
|
146
|
+
## `QrCodeSwissOverlay`
|
|
147
|
+
|
|
148
|
+
Interface.
|
|
149
|
+
|
|
150
|
+
The Swiss cross of a Swiss QR code, the code on a Swiss QR-bill, drawn over the center at the size the standard sets.
|
|
151
|
+
|
|
152
|
+
### Properties
|
|
153
|
+
|
|
154
|
+
| Name | Type |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| `type` (read-only) | `"swiss"` |
|
|
157
|
+
|
|
158
|
+
**Used by:** [`QrCodeOverlay`](qr-code.md#qrcodeoverlay)
|
|
159
|
+
|
|
160
|
+
## `QrCodeTooLongError`
|
|
161
|
+
|
|
162
|
+
Interface.
|
|
163
|
+
|
|
164
|
+
A value too long for the largest QR code (version 40) at the chosen error correction level.
|
|
165
|
+
|
|
166
|
+
### Properties
|
|
167
|
+
|
|
168
|
+
| Name | Type | Description |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `availableBits` (read-only) | `number` | The most bits a version 40 code holds at the chosen error correction level. |
|
|
171
|
+
| `code` (read-only) | `"too-long"` | |
|
|
172
|
+
| `requiredBits` (read-only) | `number` | The bits the value needs. |
|
|
173
|
+
|
|
174
|
+
**Used by:** [`QrCodeValueError`](qr-code.md#qrcodevalueerror)
|
|
175
|
+
|
|
176
|
+
## `QrCodeUnsupportedCharacterError`
|
|
177
|
+
|
|
178
|
+
Interface.
|
|
179
|
+
|
|
180
|
+
A character the chosen encoding can't store, such as `€` in `"iso-8859-1"`.
|
|
181
|
+
|
|
182
|
+
### Properties
|
|
183
|
+
|
|
184
|
+
| Name | Type | Description |
|
|
185
|
+
| --- | --- | --- |
|
|
186
|
+
| `character` (read-only) | `string` | The first character that can't be stored. |
|
|
187
|
+
| `code` (read-only) | `"unsupported-character"` | |
|
|
188
|
+
| `index` (read-only) | `number` | Where that character starts in the value, in UTF-16 code units. |
|
|
189
|
+
|
|
190
|
+
**Used by:** [`QrCodeValueError`](qr-code.md#qrcodevalueerror)
|
|
191
|
+
|
|
192
|
+
## `QrCodeValidationOptions`
|
|
193
|
+
|
|
194
|
+
Interface.
|
|
195
|
+
|
|
196
|
+
The settings a value is checked against, matching the component's inputs of the same names.
|
|
197
|
+
|
|
198
|
+
### Properties
|
|
199
|
+
|
|
200
|
+
| Name | Type | Description |
|
|
201
|
+
| --- | --- | --- |
|
|
202
|
+
| `encoding?` (read-only) | `QrCodeEncoding` | Defaults to `"utf-8"`, as on the component. |
|
|
203
|
+
| `errorCorrection?` (read-only) | `QrCodeErrorCorrection` | Defaults to `"M"`, as on the component. |
|
|
204
|
+
|
|
205
|
+
**Used by:** [`validateQrCodeValue`](qr-code.md#validateqrcodevalue)
|
|
206
|
+
|
|
207
|
+
## `QrCodeEncoding`
|
|
208
|
+
|
|
209
|
+
Type alias.
|
|
210
|
+
|
|
211
|
+
The character set a QR code stores text in.
|
|
212
|
+
- `"utf-8"`: any text. A value with characters outside ASCII starts with an ECI header that tells readers it's UTF-8.
|
|
213
|
+
- `"iso-8859-1"`: Latin-1 only, which every reader assumes when there's no header. Other characters are an error.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
type QrCodeEncoding = "utf-8" | "iso-8859-1";
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent), [`QrCodeValidationOptions`](qr-code.md#qrcodevalidationoptions)
|
|
220
|
+
|
|
221
|
+
## `QrCodeErrorCorrection`
|
|
222
|
+
|
|
223
|
+
Type alias.
|
|
224
|
+
|
|
225
|
+
How much of the code can be damaged or hidden and still read: about 7% at `"L"`, 15% at `"M"`, 25% at `"Q"` and 30%
|
|
226
|
+
at `"H"`. A higher level holds less data at the same size.
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
type QrCodeErrorCorrection = "L" | "M" | "Q" | "H";
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent), [`QrCodeValidationOptions`](qr-code.md#qrcodevalidationoptions)
|
|
233
|
+
|
|
234
|
+
## `QrCodeExportErrorCode`
|
|
235
|
+
|
|
236
|
+
Type alias.
|
|
237
|
+
|
|
238
|
+
Why a QR code export failed.
|
|
239
|
+
- `"not-ready"`: there's no code to export, because the value is empty or can't be encoded.
|
|
240
|
+
- `"unsupported-environment"`: the export ran outside a browser, such as during server-side rendering.
|
|
241
|
+
- `"invalid-size"`: the size isn't a positive number, or a PNG of that size can't give each module a pixel.
|
|
242
|
+
- `"resource-load-failed"`: the overlay image didn't load, or another origin didn't allow reading it.
|
|
243
|
+
- `"png-rasterization-failed"`: the browser couldn't draw the PNG.
|
|
244
|
+
- `"pdf-generation-failed"`: `jspdf` isn't installed, or failed to write the page.
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
type QrCodeExportErrorCode = | "not-ready" | "unsupported-environment" | "invalid-size" | "resource-load-failed" | "png-rasterization-failed" | "pdf-generation-failed";
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Used by:** [`QrCodeExportError`](qr-code.md#qrcodeexporterror)
|
|
251
|
+
|
|
252
|
+
## `QrCodeExportFormat`
|
|
253
|
+
|
|
254
|
+
Type alias.
|
|
255
|
+
|
|
256
|
+
The file a QR code exports to: a `"png"` image, an `"svg"` document or a `"pdf"` page.
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
type QrCodeExportFormat = "png" | "svg" | "pdf";
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Used by:** [`QrCodeExportOptions`](qr-code.md#qrcodeexportoptions), [`QrCodeExportResult`](qr-code.md#qrcodeexportresult)
|
|
263
|
+
|
|
264
|
+
## `QrCodeOverlay`
|
|
265
|
+
|
|
266
|
+
Type alias.
|
|
267
|
+
|
|
268
|
+
What to draw over the center of the code. The modules beneath it are cleared, so the overlay relies on error
|
|
269
|
+
correction to read.
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
type QrCodeOverlay = QrCodeImageOverlay | QrCodeSwissOverlay;
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent)
|
|
276
|
+
|
|
277
|
+
## `QrCodeValueError`
|
|
278
|
+
|
|
279
|
+
Type alias.
|
|
280
|
+
|
|
281
|
+
Why a value can't be stored in a QR code.
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
type QrCodeValueError = QrCodeUnsupportedCharacterError | QrCodeTooLongError;
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Used by:** [`QrCodeComponent`](qr-code.md#qrcodecomponent), [`validateQrCodeValue`](qr-code.md#validateqrcodevalue)
|
package/docs/api/segmented.md
CHANGED
|
@@ -18,6 +18,7 @@ Component.
|
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| `alignment` | `"center" \| "end" \| "start" \| "stretch"` | `"stretch"` | Controls the alignment of the items inside the segmented component. |
|
|
20
20
|
| `animate` | `boolean` | `true` | Controls whether the selection indicator animates between selected options. When false, selection changes are applied immediately without transition. |
|
|
21
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the segmented control, such as a hint or an error message. |
|
|
21
22
|
| `aria-label` | `string \| null` | `null` | Accessible name for the radio group. Provide either `aria-label` or `aria-labelledby`. |
|
|
22
23
|
| `aria-labelledby` | `string \| null` | `null` | ID of an external element that provides the accessible name for the radio group. |
|
|
23
24
|
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
|
package/docs/api/switch.md
CHANGED
|
@@ -15,6 +15,7 @@ Component.
|
|
|
15
15
|
|
|
16
16
|
| Name | Type | Default | Description |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
+
| `aria-describedby` | `string` | `""` | Id of an element that describes the switch, such as a hint or an error message. |
|
|
18
19
|
| `aria-label` | `string \| null` | `null` | Accessible name for the host element. Describe what the component represents. When empty, assistive technology announces the role without a label. |
|
|
19
20
|
| `aria-labelledby` | `string \| null` | `null` | ID of an external element that provides the accessible name for the host element. |
|
|
20
21
|
| `checked` (two-way) | `boolean` | `false` | Whether the control is checked. |
|
package/docs/dropdown-list.md
CHANGED
|
@@ -421,7 +421,7 @@ The host element is the only Tab stop; DOM focus does not move into the popup's
|
|
|
421
421
|
| `aria-invalid` | `invalid` is `true`, or `required` is `true` and the control is `touched` with no value selected | `"true"` |
|
|
422
422
|
| `aria-busy` | `loading` is `true` | `"true"` |
|
|
423
423
|
|
|
424
|
-
Name the dropdown list with `aria-labelledby` pointing at a visible label's `id`, or with `aria-label`. The `placeholder` only supplies a fallback name, and it disappears from view once a value is selected.
|
|
424
|
+
Name the dropdown list by wrapping it in `<mona-label text="...">` or `<mona-form-field label="...">`, with `aria-labelledby` pointing at a visible label's `id`, or with `aria-label`. The `placeholder` only supplies a fallback name, and it disappears from view once a value is selected. The host is a `role="combobox"` element, not a native input, so a string `for` has nothing to point at, and `[for]` bound to its template reference makes a click on the label focus it, but doesn't name it. That's why the examples that keep the label apart use both:
|
|
425
425
|
|
|
426
426
|
```html
|
|
427
427
|
<label id="shipping-label" monaLabel [for]="shippingList">Shipping method</label>
|