@adia-ai/web-components 0.6.35 → 0.6.37

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/components/badge/badge.a2ui.json +10 -0
  3. package/components/badge/badge.css +70 -0
  4. package/components/badge/badge.yaml +20 -0
  5. package/components/blockquote/blockquote.a2ui.json +121 -0
  6. package/components/blockquote/blockquote.class.js +68 -0
  7. package/components/blockquote/blockquote.css +46 -0
  8. package/components/blockquote/blockquote.d.ts +31 -0
  9. package/components/blockquote/blockquote.js +17 -0
  10. package/components/blockquote/blockquote.yaml +124 -0
  11. package/components/button/button.css +11 -3
  12. package/components/calendar-picker/calendar-picker.a2ui.json +15 -0
  13. package/components/calendar-picker/calendar-picker.class.js +7 -1
  14. package/components/calendar-picker/calendar-picker.yaml +14 -0
  15. package/components/color-input/color-input.a2ui.json +2 -2
  16. package/components/color-input/color-input.class.js +9 -2
  17. package/components/color-input/color-input.yaml +2 -2
  18. package/components/combobox/combobox.class.js +4 -0
  19. package/components/combobox/combobox.css +12 -0
  20. package/components/context-menu/context-menu.a2ui.json +159 -0
  21. package/components/context-menu/context-menu.class.js +275 -0
  22. package/components/context-menu/context-menu.css +56 -0
  23. package/components/context-menu/context-menu.d.ts +70 -0
  24. package/components/context-menu/context-menu.js +17 -0
  25. package/components/context-menu/context-menu.yaml +136 -0
  26. package/components/date-range-picker/date-range-picker.a2ui.json +15 -0
  27. package/components/date-range-picker/date-range-picker.class.js +3 -1
  28. package/components/date-range-picker/date-range-picker.css +4 -1
  29. package/components/date-range-picker/date-range-picker.yaml +14 -0
  30. package/components/datetime-picker/datetime-picker.a2ui.json +15 -0
  31. package/components/datetime-picker/datetime-picker.class.js +3 -1
  32. package/components/datetime-picker/datetime-picker.css +7 -1
  33. package/components/datetime-picker/datetime-picker.d.ts +2 -0
  34. package/components/datetime-picker/datetime-picker.yaml +14 -0
  35. package/components/empty-state/empty-state.class.js +2 -0
  36. package/components/feed/feed.class.js +13 -5
  37. package/components/feed/feed.css +14 -0
  38. package/components/index.js +9 -0
  39. package/components/input/input.css +15 -1
  40. package/components/input/input.test.js +40 -0
  41. package/components/integration-card/integration-card.class.js +9 -0
  42. package/components/integration-card/integration-card.test.js +4 -3
  43. package/components/nav-group/nav-group.css +7 -1
  44. package/components/number-format/number-format.a2ui.json +180 -0
  45. package/components/number-format/number-format.class.js +96 -0
  46. package/components/number-format/number-format.css +18 -0
  47. package/components/number-format/number-format.d.ts +68 -0
  48. package/components/number-format/number-format.js +17 -0
  49. package/components/number-format/number-format.yaml +204 -0
  50. package/components/pagination/pagination.a2ui.json +19 -2
  51. package/components/pagination/pagination.class.js +90 -37
  52. package/components/pagination/pagination.css +32 -127
  53. package/components/pagination/pagination.d.ts +8 -2
  54. package/components/pagination/pagination.test.js +195 -0
  55. package/components/pagination/pagination.yaml +22 -1
  56. package/components/password-strength/password-strength.a2ui.json +152 -0
  57. package/components/password-strength/password-strength.class.js +157 -0
  58. package/components/password-strength/password-strength.css +80 -0
  59. package/components/password-strength/password-strength.d.ts +59 -0
  60. package/components/password-strength/password-strength.js +17 -0
  61. package/components/password-strength/password-strength.yaml +153 -0
  62. package/components/popover/popover.css +43 -23
  63. package/components/popover/popover.yaml +8 -4
  64. package/components/qr-code/QR-TEST.svg +4 -0
  65. package/components/qr-code/qr-code.a2ui.json +154 -0
  66. package/components/qr-code/qr-code.class.js +129 -0
  67. package/components/qr-code/qr-code.css +41 -0
  68. package/components/qr-code/qr-code.d.ts +83 -0
  69. package/components/qr-code/qr-code.js +17 -0
  70. package/components/qr-code/qr-code.yaml +203 -0
  71. package/components/qr-code/qr-encoder.js +633 -0
  72. package/components/relative-time/relative-time.a2ui.json +120 -0
  73. package/components/relative-time/relative-time.class.js +136 -0
  74. package/components/relative-time/relative-time.css +22 -0
  75. package/components/relative-time/relative-time.d.ts +51 -0
  76. package/components/relative-time/relative-time.js +17 -0
  77. package/components/relative-time/relative-time.yaml +133 -0
  78. package/components/search/search.class.js +2 -0
  79. package/components/segmented/segmented.class.js +5 -1
  80. package/components/select/select.class.js +4 -0
  81. package/components/skip-nav/skip-nav.a2ui.json +92 -0
  82. package/components/skip-nav/skip-nav.class.js +45 -0
  83. package/components/skip-nav/skip-nav.css +54 -0
  84. package/components/skip-nav/skip-nav.d.ts +27 -0
  85. package/components/skip-nav/skip-nav.js +12 -0
  86. package/components/skip-nav/skip-nav.yaml +68 -0
  87. package/components/slider/slider.a2ui.json +16 -1
  88. package/components/slider/slider.class.js +264 -122
  89. package/components/slider/slider.css +82 -2
  90. package/components/slider/slider.d.ts +19 -3
  91. package/components/slider/slider.test.js +55 -0
  92. package/components/slider/slider.yaml +28 -6
  93. package/components/table/table.class.js +29 -6
  94. package/components/table/table.css +31 -4
  95. package/components/table-toolbar/table-toolbar.class.js +4 -1
  96. package/components/tag/tag.a2ui.json +10 -0
  97. package/components/tag/tag.class.js +8 -1
  98. package/components/tag/tag.css +108 -20
  99. package/components/tag/tag.d.ts +14 -0
  100. package/components/tag/tag.test.js +99 -1
  101. package/components/tag/tag.yaml +20 -0
  102. package/components/tags-input/tags-input.class.js +10 -3
  103. package/components/tags-input/tags-input.css +12 -3
  104. package/components/textarea/textarea.css +10 -1
  105. package/components/toast/toast.class.js +12 -4
  106. package/components/toc/toc.a2ui.json +159 -0
  107. package/components/toc/toc.class.js +222 -0
  108. package/components/toc/toc.css +92 -0
  109. package/components/toc/toc.d.ts +61 -0
  110. package/components/toc/toc.js +17 -0
  111. package/components/toc/toc.yaml +180 -0
  112. package/components/toolbar/toolbar.class.js +3 -0
  113. package/components/visually-hidden/visually-hidden.a2ui.json +71 -0
  114. package/components/visually-hidden/visually-hidden.class.js +14 -0
  115. package/components/visually-hidden/visually-hidden.css +25 -0
  116. package/components/visually-hidden/visually-hidden.d.ts +26 -0
  117. package/components/visually-hidden/visually-hidden.js +12 -0
  118. package/components/visually-hidden/visually-hidden.yaml +54 -0
  119. package/core/anchor.js +19 -3
  120. package/core/provider.js +19 -2
  121. package/dist/web-components.min.css +1 -1
  122. package/dist/web-components.min.js +101 -89
  123. package/package.json +1 -1
  124. package/styles/colors/semantics.css +11 -2
  125. package/styles/components.css +9 -0
  126. package/styles/resets.css +10 -0
@@ -0,0 +1,203 @@
1
+ $schema: ../../../../scripts/schemas/component.yaml.schema.json
2
+ name: UIQRCode
3
+ tag: qr-code-ui
4
+ status: stable
5
+ component: QRCode
6
+ category: display
7
+ version: 1
8
+ description: |
9
+ Inline QR code generator — renders a scannable code as inline SVG.
10
+ Two modes:
11
+
12
+ **A. Auto-encode (default).** Set `[value]` to a string (URL, plain
13
+ text, share link, 2FA secret). The component encodes the data with
14
+ the built-in zero-deps QR encoder (byte mode, ECC level configurable,
15
+ versions 1–10 up to ~150 byte chars) and renders an SVG.
16
+
17
+ **B. Bring-your-own matrix.** Set `[matrix]` to a JSON string of a
18
+ 2-D 0/1 array (`[[1,0,1,...],[...],...]`). The component renders the
19
+ supplied matrix directly without invoking its own encoder. Use this
20
+ when you need versions 11–40, kanji/alphanumeric mode, or any
21
+ encoder feature beyond the built-in. When both `[value]` and
22
+ `[matrix]` are set, the matrix wins (BYO override).
23
+
24
+ Output is a single `<svg>` with `viewBox="0 0 N N"`. Crisp-edges
25
+ rendering preserves the scannable cell boundaries at any size.
26
+ Sizing is controlled by the `[size]` prop (host CSS-pixel dimension);
27
+ internal cell size is computed from `size / (matrix-size + 2 ·
28
+ margin)`. ARIA: `role="img"` with `aria-label` (default "QR code"
29
+ or the `[label]` prop).
30
+ props:
31
+ value:
32
+ description: |
33
+ The string to encode (URL / text / share link / 2FA seed). When
34
+ [matrix] is also set, the matrix wins. Empty value + empty matrix
35
+ renders nothing.
36
+ type: string
37
+ default: ""
38
+ reflect: true
39
+ matrix:
40
+ description: |
41
+ BYO precomputed bit matrix as JSON — a 2-D array of 0/1
42
+ (`[[1,0,...],[0,1,...],...]`). When set, the built-in encoder is
43
+ bypassed and this matrix renders directly. Useful for QR variants
44
+ the built-in doesn't support (versions 11–40, alphanumeric mode,
45
+ kanji, etc.) — bring your own encoder, pass the matrix here.
46
+ type: string
47
+ default: ""
48
+ reflect: true
49
+ size:
50
+ description: |
51
+ Host display size in CSS pixels (width and height; the SVG is
52
+ always square). Default 200. Internal cell size is computed from
53
+ this divided by `matrix-size + 2·margin`.
54
+ type: number
55
+ default: 200
56
+ reflect: true
57
+ errorCorrection:
58
+ description: |
59
+ Error-correction level (auto-encode mode only). `L` (7% recovery),
60
+ `M` (15%, default), `Q` (25%), `H` (30%). Higher levels recover
61
+ from more damage at the cost of QR-version size growth.
62
+ type: string
63
+ default: M
64
+ enum: [L, M, Q, H]
65
+ reflect: true
66
+ attribute: error-correction
67
+ margin:
68
+ description: |
69
+ Quiet zone in cells around the QR pattern. QR spec requires a
70
+ minimum 4-cell margin for reliable scanning; smaller values may
71
+ not scan on some devices. Default `4`.
72
+ type: number
73
+ default: 4
74
+ reflect: true
75
+ color:
76
+ description: |
77
+ Foreground (dark-cell) color. Any CSS color string (hex, rgb,
78
+ token reference). **Empty defaults to `#000000` — hardcoded black
79
+ for guaranteed scanability** (theme-aware `currentColor` would
80
+ produce light-on-dark in dark mode, which most phone scanners
81
+ refuse to decode). Override for branded QRs only when you've
82
+ verified the chosen color/background pair scans on the target
83
+ devices.
84
+ type: string
85
+ default: ""
86
+ reflect: true
87
+ background:
88
+ description: |
89
+ Background (light-cell) color. **Empty defaults to `#ffffff` —
90
+ hardcoded white** alongside the black foreground, for guaranteed
91
+ scanability. Override only when paired with an explicit
92
+ [color] (the contrast pair must scan).
93
+ type: string
94
+ default: ""
95
+ reflect: true
96
+ label:
97
+ description: |
98
+ `aria-label` for the SVG. Defaults to "QR code". Customize for
99
+ better AT context (e.g. "Share link QR code", "2FA setup QR").
100
+ type: string
101
+ default: "QR code"
102
+ reflect: true
103
+ events: {}
104
+ slots: {}
105
+ states:
106
+ - name: idle
107
+ description: Default — QR rendered (or empty if no value/matrix).
108
+ - name: error
109
+ description: Auto-encode failed (data too long for v1–10 at requested ECC). Renders an empty placeholder; logs a console warning. Switch to a BYO matrix from an external encoder, or downgrade the ECC level.
110
+ attribute: data-error
111
+ traits: []
112
+ tokens:
113
+ --qr-code-fg:
114
+ description: Foreground (dark) color when [color] is empty.
115
+ default: currentColor
116
+ --qr-code-bg:
117
+ description: Background (light) color when [background] is empty.
118
+ default: transparent
119
+ requiredIcons: []
120
+ a2ui:
121
+ rules:
122
+ - rule: "Set [value] for URLs / share links / plain text. The built-in encoder covers byte-mode UTF-8 up to QR version 10 (~150 chars at ECC-M, more at lower ECC levels)."
123
+ reason: "Default mode for the 95% case."
124
+ - rule: "For data that exceeds version 10, switch to a higher ECC level downgrade ([error-correction=L]) OR use a BYO encoder and pass the precomputed [matrix]."
125
+ reason: "Encoder capacity contract."
126
+ - rule: "When QR sits over a non-white surface, set [background] to a solid color. White-on-image QR backgrounds are unreliable for scanners — quiet-zone contrast against the dark cells is the load-bearing visual."
127
+ reason: "Scannability constraint."
128
+ - rule: "The [margin] (quiet zone) defaults to 4 cells per QR spec. Smaller margins may scan on some devices but not others; do not go below 2."
129
+ reason: "Quiet-zone requirement."
130
+ anti_patterns:
131
+ - wrong: |
132
+ <qr-code-ui value="https://very.long.url.that.exceeds.150.bytes.of.utf8.encoded.length..."></qr-code-ui>
133
+ why: |
134
+ Built-in encoder covers versions 1–10. Data beyond v10 capacity
135
+ throws + renders empty + sets [data-error]. Console warns with
136
+ the byte length so consumers can diagnose.
137
+ fix: |
138
+ Drop the ECC level (lower L gives more capacity for the same
139
+ version), OR shorten the URL (use a URL shortener), OR encode
140
+ with a BYO encoder library + pass the [matrix]:
141
+ `<qr-code-ui matrix="[[1,0,1,...],...]"></qr-code-ui>`
142
+ - wrong: |
143
+ <qr-code-ui value="..." margin="0"></qr-code-ui>
144
+ why: |
145
+ Zero margin breaks scanning. QR spec requires a 4-cell quiet
146
+ zone for reliable detection.
147
+ fix: |
148
+ <qr-code-ui value="..." margin="4"></qr-code-ui>
149
+ examples:
150
+ - name: default
151
+ description: Plain URL encoding at default size + ECC-M.
152
+ a2ui: |
153
+ [
154
+ {
155
+ "id": "q",
156
+ "component": "QRCode",
157
+ "value": "https://example.com"
158
+ }
159
+ ]
160
+ - name: branded
161
+ description: Custom colors matching brand chrome.
162
+ a2ui: |
163
+ [
164
+ {
165
+ "id": "q",
166
+ "component": "QRCode",
167
+ "value": "https://adia.health/share/abc123",
168
+ "size": 280,
169
+ "color": "#1e293b",
170
+ "background": "#ffffff",
171
+ "errorCorrection": "Q"
172
+ }
173
+ ]
174
+ - name: byo-matrix
175
+ description: BYO precomputed matrix from an external encoder.
176
+ a2ui: |
177
+ [
178
+ {
179
+ "id": "q",
180
+ "component": "QRCode",
181
+ "matrix": "[[1,1,1,1,1,1,1,0,1,...]...]",
182
+ "size": 200,
183
+ "label": "Boarding pass QR"
184
+ }
185
+ ]
186
+ keywords:
187
+ - qr-code
188
+ - qr
189
+ - barcode
190
+ - scan
191
+ - share
192
+ - 2fa
193
+ - share-link
194
+ synonyms:
195
+ qr:
196
+ - qr-code
197
+ - barcode
198
+ scan:
199
+ - qr-code
200
+ - barcode
201
+ related:
202
+ - link
203
+ - share