@porsche-design-system/components-react 4.7.0 → 4.8.0-rc.1
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/CHANGELOG.md +94 -1
- package/cjs/hooks.cjs +1 -5
- package/cjs/lib/components/checkbox.wrapper.cjs +3 -3
- package/cjs/lib/components/input-date.wrapper.cjs +3 -3
- package/cjs/lib/components/input-email.wrapper.cjs +3 -3
- package/cjs/lib/components/input-month.wrapper.cjs +3 -3
- package/cjs/lib/components/input-number.wrapper.cjs +3 -3
- package/cjs/lib/components/input-password.wrapper.cjs +3 -3
- package/cjs/lib/components/input-tel.wrapper.cjs +3 -3
- package/cjs/lib/components/input-text.wrapper.cjs +3 -3
- package/cjs/lib/components/input-time.wrapper.cjs +3 -3
- package/cjs/lib/components/input-url.wrapper.cjs +3 -3
- package/cjs/lib/components/input-week.wrapper.cjs +3 -3
- package/cjs/lib/components/multi-select.wrapper.cjs +3 -3
- package/cjs/lib/components/select.wrapper.cjs +3 -3
- package/cjs/lib/components/switch.wrapper.cjs +3 -3
- package/cjs/lib/components/textarea.wrapper.cjs +3 -3
- package/esm/hooks.d.ts +0 -3
- package/esm/hooks.mjs +2 -5
- package/esm/lib/components/checkbox.wrapper.d.ts +9 -1
- package/esm/lib/components/checkbox.wrapper.mjs +3 -3
- package/esm/lib/components/input-date.wrapper.d.ts +9 -1
- package/esm/lib/components/input-date.wrapper.mjs +3 -3
- package/esm/lib/components/input-email.wrapper.d.ts +9 -1
- package/esm/lib/components/input-email.wrapper.mjs +3 -3
- package/esm/lib/components/input-month.wrapper.d.ts +9 -1
- package/esm/lib/components/input-month.wrapper.mjs +3 -3
- package/esm/lib/components/input-number.wrapper.d.ts +9 -1
- package/esm/lib/components/input-number.wrapper.mjs +3 -3
- package/esm/lib/components/input-password.wrapper.d.ts +9 -1
- package/esm/lib/components/input-password.wrapper.mjs +3 -3
- package/esm/lib/components/input-search.wrapper.d.ts +2 -2
- package/esm/lib/components/input-tel.wrapper.d.ts +9 -1
- package/esm/lib/components/input-tel.wrapper.mjs +3 -3
- package/esm/lib/components/input-text.wrapper.d.ts +9 -1
- package/esm/lib/components/input-text.wrapper.mjs +3 -3
- package/esm/lib/components/input-time.wrapper.d.ts +9 -1
- package/esm/lib/components/input-time.wrapper.mjs +3 -3
- package/esm/lib/components/input-url.wrapper.d.ts +9 -1
- package/esm/lib/components/input-url.wrapper.mjs +3 -3
- package/esm/lib/components/input-week.wrapper.d.ts +9 -1
- package/esm/lib/components/input-week.wrapper.mjs +3 -3
- package/esm/lib/components/link-pure.wrapper.d.ts +2 -2
- package/esm/lib/components/link-tile-product.wrapper.d.ts +2 -2
- package/esm/lib/components/link.wrapper.d.ts +2 -2
- package/esm/lib/components/multi-select.wrapper.d.ts +9 -1
- package/esm/lib/components/multi-select.wrapper.mjs +3 -3
- package/esm/lib/components/select.wrapper.d.ts +9 -1
- package/esm/lib/components/select.wrapper.mjs +3 -3
- package/esm/lib/components/switch.wrapper.d.ts +9 -1
- package/esm/lib/components/switch.wrapper.mjs +3 -3
- package/esm/lib/components/textarea.wrapper.d.ts +9 -1
- package/esm/lib/components/textarea.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +22 -1
- package/package.json +2 -2
- package/skills/pds-audit-deprecations-react/SKILL.md +2 -2
- package/skills/pds-knowledge-react/SKILL.md +14 -5
- package/skills/pds-knowledge-react/references/components/p-carousel/examples/DynamicSlides.tsx +1 -0
- package/skills/pds-knowledge-react/references/components/p-carousel/examples/FocusOnCenterSlide.tsx +1 -0
- package/skills/pds-knowledge-react/references/components/p-carousel/examples/JumpToSlide.tsx +1 -0
- package/skills/pds-knowledge-react/references/components/p-checkbox/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-checkbox/p-checkbox.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-date/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-date/p-input-date.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-email/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-email/p-input-email.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-month/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-month/p-input-month.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-number/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-number/p-input-number.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-password/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-password/p-input-password.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-search/p-input-search.md +2 -1
- package/skills/pds-knowledge-react/references/components/p-input-tel/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-tel/p-input-tel.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-text/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-text/p-input-text.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-time/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-time/p-input-time.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-url/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-url/p-input-url.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-input-week/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-input-week/p-input-week.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-link/p-link.md +2 -2
- package/skills/pds-knowledge-react/references/components/p-link-pure/p-link-pure.md +2 -2
- package/skills/pds-knowledge-react/references/components/p-link-tile-product/p-link-tile-product.md +2 -2
- package/skills/pds-knowledge-react/references/components/p-multi-select/accessibility.md +22 -0
- package/skills/pds-knowledge-react/references/components/p-multi-select/p-multi-select.md +14 -2
- package/skills/pds-knowledge-react/references/components/p-pin-code/p-pin-code.md +11 -3
- package/skills/pds-knowledge-react/references/components/p-select/accessibility.md +22 -0
- package/skills/pds-knowledge-react/references/components/p-select/p-select.md +14 -2
- package/skills/pds-knowledge-react/references/components/p-switch/accessibility.md +18 -0
- package/skills/pds-knowledge-react/references/components/p-switch/p-switch.md +12 -0
- package/skills/pds-knowledge-react/references/components/p-textarea/accessibility.md +14 -0
- package/skills/pds-knowledge-react/references/components/p-textarea/p-textarea.md +12 -0
- package/skills/pds-knowledge-react/references/deprecations.md +4 -4
- package/skills/pds-knowledge-react/references/examples/patterns/feedback/dialog.md +230 -0
- package/skills/pds-knowledge-react/references/examples/patterns/feedback/inline.md +193 -0
- package/skills/pds-knowledge-react/references/examples/patterns/footer.md +250 -0
- package/skills/pds-knowledge-react/references/examples/patterns/header/overlay.md +152 -0
- package/skills/pds-knowledge-react/references/examples/patterns/header/stacked.md +122 -0
- package/skills/pds-knowledge-react/references/examples/patterns/popover/feature-tour.md +243 -0
- package/skills/pds-knowledge-react/references/examples/patterns/popover/local-market-switch.md +323 -0
- package/skills/pds-knowledge-react/references/examples/patterns/popover/priority-navigation.md +191 -0
- package/skills/pds-knowledge-react/references/examples/templates/admin-panel.md +397 -0
- package/skills/pds-knowledge-react/references/examples/templates/landing-page.md +529 -0
- package/skills/pds-knowledge-react/references/examples.md +48 -0
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +18 -105
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +78 -156
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/hooks.cjs +1 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/checkbox.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-date.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-email.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-month.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-password.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-tel.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-text.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-time.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-url.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-week.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/multi-select.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/switch.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.cjs +2 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-email.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-tel.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-url.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile-product.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +2 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.cjs +0 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.cjs +0 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +1 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.cjs +0 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.cjs +0 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.cjs +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +18 -105
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +78 -150
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/hooks.mjs +2 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/checkbox.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-date.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-email.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-month.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-password.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-tel.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-text.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-time.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-url.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-week.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/multi-select.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/switch.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.mjs +3 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-date.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-email.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-month.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-tel.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-time.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-url.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-week.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/label.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile-product.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +3 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.mjs +0 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.mjs +0 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +1 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.mjs +0 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.mjs +0 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.mjs +2 -2
- package/ssr/esm/hooks.d.ts +0 -3
- package/ssr/esm/lib/components/checkbox.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-date.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-email.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-month.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-number.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-password.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-search.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/input-tel.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-text.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-time.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-url.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/input-week.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/link-pure.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/link-tile-product.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/link.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/multi-select.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/select.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/switch.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/textarea.wrapper.d.ts +9 -1
- package/ssr/esm/lib/dsr-components/label.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/link-pure.d.ts +1 -1
- package/ssr/esm/lib/dsr-components/link-tile-product.d.ts +1 -1
- package/ssr/esm/lib/dsr-components/link.d.ts +1 -1
- package/ssr/esm/lib/dsr-components/stepper-horizontal.d.ts +0 -1
- package/ssr/esm/lib/dsr-components/tabs-bar.d.ts +0 -1
- package/ssr/esm/lib/dsr-components/tabs.d.ts +0 -1
- package/ssr/esm/lib/types.d.ts +22 -1
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PInputPassword name="password" label="Password" aria-label="Accessible name" aria-description="Additional context"></PInputPassword>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### ✅ Recommended
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<PInputPassword name="password" label="Password" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}></PInputPassword>
|
|
17
|
+
```
|
|
18
|
+
|
|
5
19
|
### Placeholder used as the only label
|
|
6
20
|
|
|
7
21
|
#### ❌ Anti-pattern
|
package/skills/pds-knowledge-react/references/components/p-input-password/p-input-password.md
CHANGED
|
@@ -50,6 +50,15 @@ While a `placeholder` is optional but recommended to be set whenever bits of exa
|
|
|
50
50
|
|
|
51
51
|
### ARIA enhancements
|
|
52
52
|
|
|
53
|
+
#### External **ARIA** provided by the `aria` property:
|
|
54
|
+
|
|
55
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or insufficient, and `aria-description` for extra context that should not replace the name.
|
|
56
|
+
|
|
57
|
+
| ARIA | Usage |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
60
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
61
|
+
|
|
53
62
|
#### Internal **ARIA** that is managed by the component:
|
|
54
63
|
|
|
55
64
|
| ARIA | Usage |
|
|
@@ -69,11 +78,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
69
78
|
|
|
70
79
|
### Common do's and don'ts
|
|
71
80
|
|
|
81
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
72
82
|
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
73
83
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
74
84
|
- **Do** use clear error wording that helps users recover.
|
|
75
85
|
- **Don't** rely on placeholder text as the only label.
|
|
76
86
|
- **Don't** use `hide-label` without an accessible name.
|
|
87
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
77
88
|
|
|
78
89
|
## Limitations
|
|
79
90
|
|
|
@@ -94,6 +105,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
94
105
|
|
|
95
106
|
| Property | Type | Default | Description |
|
|
96
107
|
| --- | --- | --- | --- |
|
|
108
|
+
| `aria` | `InputPasswordAriaAttribute` | `undefined` | Sets additional ARIA attributes on the native input to improve accessibility for screen readers. |
|
|
97
109
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a password autofill hint (e.g. `autocomplete='current-password'` or `autocomplete='new-password'`). |
|
|
98
110
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
99
111
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
@@ -67,6 +67,7 @@ Use the `aria` property to pass supported attributes to the **native `<input>` i
|
|
|
67
67
|
| `aria-expanded` | Indicates whether the suggestion popup or related surface is expanded or collapsed. |
|
|
68
68
|
| `aria-haspopup` | Indicates that activating the input triggers a popup (e.g. `listbox`, `dialog`). |
|
|
69
69
|
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
70
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
70
71
|
|
|
71
72
|
You can pass a JSON object on the element (vanilla JS) or use your framework’s prop binding, for example `aria={{ role: 'combobox', 'aria-expanded': isOpen, 'aria-haspopup': 'listbox' }}`.
|
|
72
73
|
|
|
@@ -129,7 +130,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
129
130
|
|
|
130
131
|
| Property | Type | Default | Description |
|
|
131
132
|
| --- | --- | --- | --- |
|
|
132
|
-
| `aria` | `InputSearchAriaAttribute` | `undefined` | Sets additional ARIA attributes on the search input, useful for combobox patterns (e.g. `role="combobox"`, `aria-expanded`). |
|
|
133
|
+
| `aria` | `InputSearchAriaAttribute` | `undefined` | Sets additional ARIA attributes on the search input, useful for combobox patterns (e.g. `role="combobox"`, `aria-expanded`) and extra labelling (`aria-label`, `aria-description`). |
|
|
133
134
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a data type hint to enable relevant autofill suggestions. |
|
|
134
135
|
| `clear` | `boolean` | `false` | Shows a clear button (×) inside the field that resets the value to empty when clicked. |
|
|
135
136
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PInputTel name="phone" label="Phone number" aria-label="Accessible name" aria-description="Additional context"></PInputTel>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### ✅ Recommended
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<PInputTel name="phone" label="Phone number" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}></PInputTel>
|
|
17
|
+
```
|
|
18
|
+
|
|
5
19
|
### Placeholder used as the only label
|
|
6
20
|
|
|
7
21
|
#### ❌ Anti-pattern
|
|
@@ -51,6 +51,15 @@ The `p-input-tel` component is specifically designed for collecting telephone nu
|
|
|
51
51
|
|
|
52
52
|
### ARIA enhancements
|
|
53
53
|
|
|
54
|
+
#### External **ARIA** provided by the `aria` property:
|
|
55
|
+
|
|
56
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or insufficient, and `aria-description` for extra context that should not replace the name.
|
|
57
|
+
|
|
58
|
+
| ARIA | Usage |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
61
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
62
|
+
|
|
54
63
|
#### Internal **ARIA** that is managed by the component:
|
|
55
64
|
|
|
56
65
|
| ARIA | Usage |
|
|
@@ -69,11 +78,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
69
78
|
|
|
70
79
|
### Common do's and don'ts
|
|
71
80
|
|
|
81
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
72
82
|
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
73
83
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
74
84
|
- **Do** use clear error wording that helps users recover.
|
|
75
85
|
- **Don't** rely on placeholder text as the only label.
|
|
76
86
|
- **Don't** use `hide-label` without an accessible name.
|
|
87
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
77
88
|
|
|
78
89
|
## Limitations
|
|
79
90
|
|
|
@@ -94,6 +105,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
94
105
|
|
|
95
106
|
| Property | Type | Default | Description |
|
|
96
107
|
| --- | --- | --- | --- |
|
|
108
|
+
| `aria` | `InputTelAriaAttribute` | `undefined` | Sets additional ARIA attributes on the native input to improve accessibility for screen readers. |
|
|
97
109
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a phone number autofill hint (e.g. `autocomplete='tel'`). |
|
|
98
110
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
99
111
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PInputText name="email" label="Email address" aria-label="Accessible name" aria-description="Additional context"></PInputText>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### ✅ Recommended
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<PInputText name="email" label="Email address" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}></PInputText>
|
|
17
|
+
```
|
|
18
|
+
|
|
5
19
|
### Placeholder used as the only label
|
|
6
20
|
|
|
7
21
|
#### ❌ Anti-pattern
|
|
@@ -51,6 +51,15 @@ While a `placeholder` is optional but recommended to be set whenever bits of exa
|
|
|
51
51
|
|
|
52
52
|
### ARIA enhancements
|
|
53
53
|
|
|
54
|
+
#### External **ARIA** provided by the `aria` property:
|
|
55
|
+
|
|
56
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or insufficient, and `aria-description` for extra context that should not replace the name.
|
|
57
|
+
|
|
58
|
+
| ARIA | Usage |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
61
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
62
|
+
|
|
54
63
|
#### Internal **ARIA** that is managed by the component:
|
|
55
64
|
|
|
56
65
|
| ARIA | Usage |
|
|
@@ -73,11 +82,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
73
82
|
|
|
74
83
|
### Common do's and don'ts
|
|
75
84
|
|
|
85
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
76
86
|
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
77
87
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
78
88
|
- **Do** use clear error wording that helps users recover.
|
|
79
89
|
- **Don't** rely on placeholder text as the only label.
|
|
80
90
|
- **Don't** use `hide-label` without an accessible name.
|
|
91
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
81
92
|
|
|
82
93
|
## Limitations
|
|
83
94
|
|
|
@@ -98,6 +109,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
98
109
|
|
|
99
110
|
| Property | Type | Default | Description |
|
|
100
111
|
| --- | --- | --- | --- |
|
|
112
|
+
| `aria` | `InputTextAriaAttribute` | `undefined` | Sets additional ARIA attributes on the native input to improve accessibility for screen readers. |
|
|
101
113
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a data type hint to enable relevant autofill suggestions (e.g. `autocomplete='name'`). |
|
|
102
114
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
103
115
|
| `counter` | `boolean` | `false` | Shows a live character counter below the field indicating how many characters have been entered relative to `maxLength`. |
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PInputTime name="time" label="Appointment time" aria-label="Accessible name" aria-description="Additional context"></PInputTime>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### ✅ Recommended
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<PInputTime name="time" label="Appointment time" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}></PInputTime>
|
|
17
|
+
```
|
|
18
|
+
|
|
5
19
|
### Placeholder used as the only label
|
|
6
20
|
|
|
7
21
|
#### ❌ Anti-pattern
|
|
@@ -52,6 +52,15 @@ While a `placeholder` is optional but recommended to be set whenever bits of exa
|
|
|
52
52
|
|
|
53
53
|
### ARIA enhancements
|
|
54
54
|
|
|
55
|
+
#### External **ARIA** provided by the `aria` property:
|
|
56
|
+
|
|
57
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or insufficient, and `aria-description` for extra context that should not replace the name.
|
|
58
|
+
|
|
59
|
+
| ARIA | Usage |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
62
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
63
|
+
|
|
55
64
|
#### Internal **ARIA** that is managed by the component:
|
|
56
65
|
|
|
57
66
|
| ARIA | Usage |
|
|
@@ -70,11 +79,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
70
79
|
|
|
71
80
|
### Common do's and don'ts
|
|
72
81
|
|
|
82
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
73
83
|
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
74
84
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
75
85
|
- **Do** use clear error wording that helps users recover.
|
|
76
86
|
- **Don't** rely on placeholder text as the only label.
|
|
77
87
|
- **Don't** use `hide-label` without an accessible name.
|
|
88
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
78
89
|
|
|
79
90
|
## Limitations
|
|
80
91
|
|
|
@@ -95,6 +106,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
95
106
|
|
|
96
107
|
| Property | Type | Default | Description |
|
|
97
108
|
| --- | --- | --- | --- |
|
|
109
|
+
| `aria` | `InputTimeAriaAttribute` | `undefined` | Sets additional ARIA attributes on the native input to improve accessibility for screen readers. |
|
|
98
110
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a time autofill hint. |
|
|
99
111
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
100
112
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PInputUrl name="website" label="Website" aria-label="Accessible name" aria-description="Additional context"></PInputUrl>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### ✅ Recommended
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<PInputUrl name="website" label="Website" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}></PInputUrl>
|
|
17
|
+
```
|
|
18
|
+
|
|
5
19
|
### Placeholder used as the only label
|
|
6
20
|
|
|
7
21
|
#### ❌ Anti-pattern
|
|
@@ -51,6 +51,15 @@ The `p-input-url` component is specifically designed for collecting website URLs
|
|
|
51
51
|
|
|
52
52
|
### ARIA enhancements
|
|
53
53
|
|
|
54
|
+
#### External **ARIA** provided by the `aria` property:
|
|
55
|
+
|
|
56
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or insufficient, and `aria-description` for extra context that should not replace the name.
|
|
57
|
+
|
|
58
|
+
| ARIA | Usage |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
61
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
62
|
+
|
|
54
63
|
#### Internal **ARIA** that is managed by the component:
|
|
55
64
|
|
|
56
65
|
| ARIA | Usage |
|
|
@@ -69,11 +78,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
69
78
|
|
|
70
79
|
### Common do's and don'ts
|
|
71
80
|
|
|
81
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
72
82
|
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
73
83
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
74
84
|
- **Do** use clear error wording that helps users recover.
|
|
75
85
|
- **Don't** rely on placeholder text as the only label.
|
|
76
86
|
- **Don't** use `hide-label` without an accessible name.
|
|
87
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
77
88
|
|
|
78
89
|
## Limitations
|
|
79
90
|
|
|
@@ -94,6 +105,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
94
105
|
|
|
95
106
|
| Property | Type | Default | Description |
|
|
96
107
|
| --- | --- | --- | --- |
|
|
108
|
+
| `aria` | `InputUrlAriaAttribute` | `undefined` | Sets additional ARIA attributes on the native input to improve accessibility for screen readers. |
|
|
97
109
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a URL autofill hint (e.g. `autocomplete='url'`). |
|
|
98
110
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
99
111
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PInputWeek name="week" label="Calendar week" aria-label="Accessible name" aria-description="Additional context"></PInputWeek>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### ✅ Recommended
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<PInputWeek name="week" label="Calendar week" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}></PInputWeek>
|
|
17
|
+
```
|
|
18
|
+
|
|
5
19
|
### Placeholder used as the only label
|
|
6
20
|
|
|
7
21
|
#### ❌ Anti-pattern
|
|
@@ -50,6 +50,15 @@ A `label` is a caption which informs the user what information a particular form
|
|
|
50
50
|
|
|
51
51
|
### ARIA enhancements
|
|
52
52
|
|
|
53
|
+
#### External **ARIA** provided by the `aria` property:
|
|
54
|
+
|
|
55
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or insufficient, and `aria-description` for extra context that should not replace the name.
|
|
56
|
+
|
|
57
|
+
| ARIA | Usage |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
60
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
61
|
+
|
|
53
62
|
#### Internal **ARIA** that is managed by the component:
|
|
54
63
|
|
|
55
64
|
| ARIA | Usage |
|
|
@@ -68,11 +77,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
68
77
|
|
|
69
78
|
### Common do's and don'ts
|
|
70
79
|
|
|
80
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
71
81
|
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
72
82
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
73
83
|
- **Do** use clear error wording that helps users recover.
|
|
74
84
|
- **Don't** rely on placeholder text as the only label.
|
|
75
85
|
- **Don't** use `hide-label` without an accessible name.
|
|
86
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
76
87
|
|
|
77
88
|
## Limitations
|
|
78
89
|
|
|
@@ -93,6 +104,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
93
104
|
|
|
94
105
|
| Property | Type | Default | Description |
|
|
95
106
|
| --- | --- | --- | --- |
|
|
107
|
+
| `aria` | `InputWeekAriaAttribute` | `undefined` | Sets additional ARIA attributes on the native input to improve accessibility for screen readers. |
|
|
96
108
|
| `autoComplete` | `string` | `undefined` | Provides the browser with a week/year autofill hint. |
|
|
97
109
|
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
98
110
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
@@ -83,7 +83,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
83
83
|
| `compact` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Reduces the link's padding and height for denser layouts. Supports responsive breakpoint values. |
|
|
84
84
|
| `download` | `string` | `undefined` | Sets the native `download` attribute to trigger a file download. Only applies when `href` is set. |
|
|
85
85
|
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
86
|
-
| `href` | `string` | `undefined` | When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element. |
|
|
86
|
+
| `href` | `string` | `undefined` | When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element, but not both. Without either, it renders as plain text. |
|
|
87
87
|
| `icon` | `'none'`<br>one of 294 icon names — see [icon names](references/icons.md) | `'none'` | Sets the icon displayed next to the link label. Use `none` to show no icon. |
|
|
88
88
|
| `iconSource` | `string` | `undefined` | Sets a path to a custom SVG icon, used instead of the built-in icon set. |
|
|
89
89
|
| `rel` | `string` | `undefined` | Sets the `rel` attribute on the link (e.g. `noopener`). Only applies when `href` is set. |
|
|
@@ -94,7 +94,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
94
94
|
|
|
95
95
|
| Slot | Required | Allowed tag names | Description |
|
|
96
96
|
| --- | --- | --- | --- |
|
|
97
|
-
| _(default)_ | no | — | Default slot to render the link label. This slot can be used to slot an anchor tag instead of using the href prop. |
|
|
97
|
+
| _(default)_ | no | — | Default slot to render the link label. This slot can be used to slot an anchor tag instead of using the `href` prop, but not in combination with it. |
|
|
98
98
|
|
|
99
99
|
### CSS Variables
|
|
100
100
|
|
|
@@ -88,7 +88,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
88
88
|
| `color` | `'primary'` `'contrast-higher'` `'contrast-high'` `'contrast-medium'` `'inherit'` | `'primary'` | Sets the foreground color of the link's icon and label text. |
|
|
89
89
|
| `download` | `string` | `undefined` | Sets the native `download` attribute to trigger a file download. Only applies when `href` is set. |
|
|
90
90
|
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
91
|
-
| `href` | `string` | `undefined` | When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element. |
|
|
91
|
+
| `href` | `string` | `undefined` | When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element, but not both. Without either, it renders as plain text. |
|
|
92
92
|
| `icon` | `''`<br>one of 294 icon names — see [icon names](references/icons.md) | `'arrow-right'` | Sets the icon displayed next to the label. |
|
|
93
93
|
| `iconSource` | `string` | `undefined` | Sets a path to a custom SVG icon, used instead of the built-in icon set. |
|
|
94
94
|
| `rel` | `string` | `undefined` | Sets the `rel` attribute on the link (e.g. `noopener`). Only applies when `href` is set. |
|
|
@@ -101,7 +101,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
101
101
|
|
|
102
102
|
| Slot | Required | Allowed tag names | Description |
|
|
103
103
|
| --- | --- | --- | --- |
|
|
104
|
-
| _(default)_ | no | — | Default slot to render the link label. |
|
|
104
|
+
| _(default)_ | no | — | Default slot to render the link label. This slot can be used to slot an anchor tag instead of using the `href` prop, but not in combination with it. |
|
|
105
105
|
|
|
106
106
|
## Examples
|
|
107
107
|
|
package/skills/pds-knowledge-react/references/components/p-link-tile-product/p-link-tile-product.md
CHANGED
|
@@ -59,7 +59,7 @@ Not yet considered due to experimental state.
|
|
|
59
59
|
| `aspectRatio` | `'3/4'` `'9/16'`<br>`BreakpointCustomizable<LinkTileProductAspectRatio>` | `'3/4'` | Sets the width-to-height ratio of the tile media area. Supports responsive breakpoint values. |
|
|
60
60
|
| `description` | `string` | `undefined` | Sets an optional short description providing additional product details below the price. |
|
|
61
61
|
| `heading` _(required)_ | `string` | `undefined` | Sets the product name displayed prominently at the top of the tile. |
|
|
62
|
-
| `href` | `string` | `undefined` | Sets the URL the tile navigates to when clicked. Alternatively, provide a slotted anchor element. |
|
|
62
|
+
| `href` | `string` | `undefined` | Sets the URL the tile navigates to when clicked. Alternatively, provide a slotted anchor element, which is not rendered when `href` is set. |
|
|
63
63
|
| `likeButton` | `boolean` | `true` | Shows a like/bookmark button so users can save the product. |
|
|
64
64
|
| `liked` | `boolean` | `false` | Reflects whether the product is currently liked — controls the filled state of the like button. |
|
|
65
65
|
| `price` _(required)_ | `string` | `undefined` | Sets the current retail price of the product, displayed with or without a discount. |
|
|
@@ -81,7 +81,7 @@ Not yet considered due to experimental state.
|
|
|
81
81
|
|
|
82
82
|
| Slot | Required | Allowed tag names | Description |
|
|
83
83
|
| --- | --- | --- | --- |
|
|
84
|
-
| `anchor` | no | — | Slotted anchor link which can be used instead of the `href` prop. Ensure the named slot is directly on the anchor element, without nesting. |
|
|
84
|
+
| `anchor` | no | — | Slotted anchor link which can be used instead of the `href` prop. It is not rendered when `href` is set. Ensure the named slot is directly on the anchor element, without nesting. |
|
|
85
85
|
| `header` | no | — | Shows special features about the product like novelty or exclusivity. Although you can pass in anything, it is recommended to use the `p-tag` component. |
|
|
86
86
|
| _(default)_ | no | — | Default slot for the img or picture tag. |
|
|
87
87
|
|
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PMultiSelect name="options" label="Optional extras" aria-label="Accessible name" aria-description="Additional context">
|
|
11
|
+
<PMultiSelectOption value="option-a">
|
|
12
|
+
Option A
|
|
13
|
+
</PMultiSelectOption>
|
|
14
|
+
</PMultiSelect>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### ✅ Recommended
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<PMultiSelect name="options" label="Optional extras" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}>
|
|
21
|
+
<PMultiSelectOption value="option-a">
|
|
22
|
+
Option A
|
|
23
|
+
</PMultiSelectOption>
|
|
24
|
+
</PMultiSelect>
|
|
25
|
+
```
|
|
26
|
+
|
|
5
27
|
### Prompt option used instead of a label
|
|
6
28
|
|
|
7
29
|
#### ❌ Anti-pattern
|
|
@@ -55,13 +55,22 @@ Options are slotted using the `p-multi-select-option` component. Each option nee
|
|
|
55
55
|
|
|
56
56
|
### ARIA enhancements
|
|
57
57
|
|
|
58
|
+
#### External **ARIA** provided by the `aria` property:
|
|
59
|
+
|
|
60
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or missing, and `aria-description` for extra context that should not replace the name. Do not use `aria-label` to replace a different visible label (WCAG 2.5.3).
|
|
61
|
+
|
|
62
|
+
| ARIA | Usage |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
65
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
66
|
+
|
|
58
67
|
#### Internal **ARIA** that is managed by the component:
|
|
59
68
|
|
|
60
69
|
| ARIA | Usage |
|
|
61
70
|
| --- | --- |
|
|
62
|
-
| `aria-labelledby="IDREF"` |
|
|
71
|
+
| `aria-labelledby="IDREF"` | On the listbox: references the field label as the accessible name. |
|
|
63
72
|
| `aria-describedby="IDREF"` | References the accessible description and status messages of the combobox. |
|
|
64
|
-
| `aria-label="STRING"` |
|
|
73
|
+
| `aria-label="STRING"` | On options without a value: fallback accessible name (`Empty value`). |
|
|
65
74
|
| `role="status"`, `role="alert"` | When `message` and `state` prop change, the status message is announced. |
|
|
66
75
|
| `aria-expanded="BOOLEAN"` | Indicates that the listbox element is displayed/hidden. |
|
|
67
76
|
| `aria-controls="IDREF"` | Identifies the element that serves as the listbox. |
|
|
@@ -79,11 +88,13 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
79
88
|
|
|
80
89
|
### Common do's and don'ts
|
|
81
90
|
|
|
91
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
82
92
|
- **Do** provide a clear, persistent label for what the selection controls.
|
|
83
93
|
- **Do** use meaningful option text so choices are understandable out of context.
|
|
84
94
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
85
95
|
- **Don't** use a prompt option or adjacent text as a substitute for a field label.
|
|
86
96
|
- **Don't** use `hide-label` without an accessible name.
|
|
97
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
87
98
|
|
|
88
99
|
## Integration examples
|
|
89
100
|
|
|
@@ -95,6 +106,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
95
106
|
|
|
96
107
|
| Property | Type | Default | Description |
|
|
97
108
|
| --- | --- | --- | --- |
|
|
109
|
+
| `aria` | `MultiSelectAriaAttribute` | `undefined` | Sets additional ARIA attributes on the combobox to improve accessibility for screen readers. |
|
|
98
110
|
| `compact` | `boolean` | `false` | Reduces the control height and padding for a more compact layout. |
|
|
99
111
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
100
112
|
| `disabled` | `boolean` | `false` | Disables the multi-select, preventing all interaction. Selected values are not submitted with the form. |
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# p-pin-code
|
|
2
2
|
|
|
3
|
-
The `p-pin-code` component is optimized for entering sequences of digits. The most common use case is for entering one-time-passwords (OTP) or pin codes. The input fields allow only one digit at a time. When a digit is entered, the focus shifts automatically to the next input, until every input is filled.
|
|
3
|
+
The `p-pin-code` component is optimized for entering sequences of digits. The most common use case is for entering one-time-passwords (OTP) or pin codes. The input fields allow only one digit at a time. When a digit is entered, the focus shifts automatically to the next input, until every input is filled. Typing a digit into a filled input replaces that digit and moves focus forward.
|
|
4
4
|
|
|
5
5
|
A few things to note:
|
|
6
6
|
|
|
7
7
|
- Only digits can be entered.
|
|
8
8
|
- Only one digit can be entered per input.
|
|
9
|
+
- Pressing a digit in a filled input overwrites the current value.
|
|
10
|
+
- `ArrowLeft` / `ArrowRight` move focus between inputs. `Home` / `End` jump to the first or last input.
|
|
9
11
|
- Pressing `Delete` or `Backspace`: If the focussed input is blank and `Delete`/`Backspace` is pressed the focus transfers to the next/previous input, and clears the value of the next/previous input (if any). This avoids the need to explicitly `Shift+Tab & Delete`/ `Tab & Backspace`.
|
|
10
12
|
|
|
11
13
|
A `label` is a caption which informs the user what information a particular form field is asking for. The `p-pin-code` component can be used with or without a label, but it's recommended to keep the label visible for better accessibility whenever possible. When used without a label, it's best practice to provide a descriptive label text for screen readers.
|
|
@@ -34,6 +36,12 @@ A `label` is a caption which informs the user what information a particular form
|
|
|
34
36
|
| Key / state | Function |
|
|
35
37
|
| --- | --- |
|
|
36
38
|
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
39
|
+
| `0`–`9` | Enters a digit in the focused input, replacing any existing digit, then moves focus to the next input. |
|
|
40
|
+
| `Backspace` | Clears the focused input. If it is already empty, clears the previous input and moves focus there. |
|
|
41
|
+
| `Delete` | Clears the focused input. If it is already empty, clears the next input and moves focus there. |
|
|
42
|
+
| `ArrowLeft`, `ArrowRight` | Moves focus to the previous or next input. Does not wrap. |
|
|
43
|
+
| `Home`, `End` | Moves focus to the first or last input. |
|
|
44
|
+
| `Enter` | Submits the surrounding form when native submit rules allow it. |
|
|
37
45
|
|
|
38
46
|
### ARIA enhancements
|
|
39
47
|
|
|
@@ -41,8 +49,8 @@ A `label` is a caption which informs the user what information a particular form
|
|
|
41
49
|
|
|
42
50
|
| ARIA | Usage |
|
|
43
51
|
| --- | --- |
|
|
44
|
-
| `aria-label="STRING"` |
|
|
45
|
-
| `aria-describedby="IDREF"` | References the
|
|
52
|
+
| `aria-label="STRING"` | Names each input by its position in the group, for example `1 of 4`. |
|
|
53
|
+
| `aria-describedby="IDREF"` | References the status message when `state` and `message` are set. |
|
|
46
54
|
| `role="status"`, `role="alert"` | When `message` and `state` or `loading` prop change, the status message is announced. |
|
|
47
55
|
|
|
48
56
|
## Development considerations
|
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## Integration examples
|
|
4
4
|
|
|
5
|
+
### ARIA on component host vs aria prop
|
|
6
|
+
|
|
7
|
+
#### ❌ Anti-pattern
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<PSelect name="model" label="Porsche model" aria-label="Accessible name" aria-description="Additional context">
|
|
11
|
+
<PSelectOption value="option-a">
|
|
12
|
+
Option A
|
|
13
|
+
</PSelectOption>
|
|
14
|
+
</PSelect>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### ✅ Recommended
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<PSelect name="model" label="Porsche model" aria={{'aria-label': 'Accessible name', 'aria-description': 'Additional context'}}>
|
|
21
|
+
<PSelectOption value="option-a">
|
|
22
|
+
Option A
|
|
23
|
+
</PSelectOption>
|
|
24
|
+
</PSelect>
|
|
25
|
+
```
|
|
26
|
+
|
|
5
27
|
### Prompt option used instead of a label
|
|
6
28
|
|
|
7
29
|
#### ❌ Anti-pattern
|
|
@@ -49,13 +49,22 @@ Options are slotted using the `p-select-option` component. Each option needs to
|
|
|
49
49
|
|
|
50
50
|
### ARIA enhancements
|
|
51
51
|
|
|
52
|
+
#### External **ARIA** provided by the `aria` property:
|
|
53
|
+
|
|
54
|
+
Use the `aria` property to pass supported attributes to the **native control inside the shadow DOM**. Prefer a visible `label` for the accessible name. Use `aria-label` when the label is hidden or missing, and `aria-description` for extra context that should not replace the name. Do not use `aria-label` to replace a different visible label (WCAG 2.5.3).
|
|
55
|
+
|
|
56
|
+
| ARIA | Usage |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
59
|
+
| `aria-description` | Provides additional context for assistive technologies without replacing the accessible name. |
|
|
60
|
+
|
|
52
61
|
#### Internal **ARIA** that is managed by the component:
|
|
53
62
|
|
|
54
63
|
| ARIA | Usage |
|
|
55
64
|
| --- | --- |
|
|
56
|
-
| `aria-labelledby="IDREF"` |
|
|
65
|
+
| `aria-labelledby="IDREF"` | On the listbox: references the field label as the accessible name. |
|
|
57
66
|
| `aria-describedby="IDREF"` | References the accessible description and status messages of the combobox. |
|
|
58
|
-
| `aria-label="STRING"` |
|
|
67
|
+
| `aria-label="STRING"` | On options without a value: fallback accessible name (`Empty value`). |
|
|
59
68
|
| `role="status"`, `role="alert"` | When `message` and `state` prop change, the status message is announced. |
|
|
60
69
|
| `aria-expanded="BOOLEAN"` | Indicates that the listbox element is displayed/hidden. |
|
|
61
70
|
| `aria-controls="IDREF"` | Identifies the element that serves as the listbox. |
|
|
@@ -71,6 +80,7 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
71
80
|
|
|
72
81
|
### Common do's and don'ts
|
|
73
82
|
|
|
83
|
+
- **Do** pass extra labelling through the `aria` prop (`aria-label`, `aria-description`).
|
|
74
84
|
- **Do** provide a clear, persistent label for what the selection controls.
|
|
75
85
|
- **Do** use meaningful option text so choices are understandable out of context.
|
|
76
86
|
- **Do** use the component state/message API so validation and status changes are announced.
|
|
@@ -78,6 +88,7 @@ In general, avoid using the `disabled` state. Disabled elements are no longer fo
|
|
|
78
88
|
- **Don't** use a prompt option or adjacent text as a substitute for a field label.
|
|
79
89
|
- **Don't** use very short or ambiguous option labels when context is important.
|
|
80
90
|
- **Don't** use `hide-label` without an accessible name.
|
|
91
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
81
92
|
|
|
82
93
|
## Integration examples
|
|
83
94
|
|
|
@@ -89,6 +100,7 @@ See [accessibility integration examples](./accessibility.md) for paired anti-pat
|
|
|
89
100
|
|
|
90
101
|
| Property | Type | Default | Description |
|
|
91
102
|
| --- | --- | --- | --- |
|
|
103
|
+
| `aria` | `SelectAriaAttribute` | `undefined` | Sets additional ARIA attributes on the combobox to improve accessibility for screen readers. |
|
|
92
104
|
| `compact` | `boolean` | `false` | Reduces the control height and padding for use in dense layouts where vertical space is limited. |
|
|
93
105
|
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to give users additional guidance about the select. |
|
|
94
106
|
| `disabled` | `boolean` | `false` | Prevents user interaction with the select and excludes its value from form submissions. |
|