@brightspace-ui/core 3.43.0 → 3.44.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,13 +54,13 @@ The `<d2l-input-checkbox>` element can be used to get a checkbox and optional vi
54
54
 
55
55
  | Property | Type | Description |
56
56
  |---|---|---|
57
- | `aria-label` | String | Set instead of placing label inside to hide the visible label |
57
+ | `aria-label` | String | Overrides the text in the `Default` slot for screenreader users |
58
58
  | `checked` | Boolean | Checked state |
59
- | `description` | String | A description to be added to the `input` for accessibility |
59
+ | `description` | String | Additional information communicated to screenreader users when focusing on the input |
60
60
  | `disabled` | Boolean | Disables the input |
61
61
  | `indeterminate` | Boolean | Sets checkbox to an indeterminate state |
62
62
  | `name` | String | Name of the input |
63
- | `not-tabbable` | Boolean | Sets `tabindex="-1"` on the checkbox |
63
+ | `not-tabbable` | Boolean | Sets `tabindex="-1"` on the checkbox. Note that an alternative method of focusing is necessary to implement if using this property. |
64
64
  | `value` | String | Value of the input |
65
65
 
66
66
  ### Events
@@ -75,18 +75,10 @@ checkbox.addEventListener('change', (e) => {
75
75
 
76
76
  ### Slots
77
77
 
78
+ * `default`: Primary text that will appear next to the input box and function as the label for the checkbox.
78
79
  * `inline-help`: Help text that will appear below the input. Use this only when other helpful cues are not sufficient, such as a carefully-worded label.
79
80
  <!-- docs: end hidden content -->
80
81
 
81
- ### Accessibility Properties
82
-
83
- To make your usage of `d2l-input-checkbox` accessible, use the following properties when applicable:
84
-
85
- | Attribute | Description |
86
- |---|---|
87
- | `aria-label` | Use when text on checkbox does not provide enough context |
88
- | `description` | Use when label on input does not provide enough context. |
89
-
90
82
  ### Methods
91
83
 
92
84
  - `simulateClick()`: useful for testing, it simulates the user clicking on the checkbox, which toggles the state of the checkbox and fires the `change` event
@@ -135,3 +127,9 @@ As an alternative to using the `<d2l-input-checkbox>` custom element, you can st
135
127
  </script>
136
128
  <d2l-my-checkbox-elem></d2l-my-checkbox-elem>
137
129
  ```
130
+
131
+ ## Accessibility
132
+
133
+ The `d2l-input-checkbox` component follows W3C's best practice recommendations for a [checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/). This means that the component works in the following way:
134
+ - The `Space` key is used to select a focused checkbox (not the `Enter` key)
135
+ - The `aria-checked` state is set to `true`, `false` or `mixed` to represent if it's selected, unselected, or partially selected
@@ -69,7 +69,7 @@ class InputCheckbox extends InputInlineHelpMixin(FocusMixin(SkeletonMixin(RtlMix
69
69
  static get properties() {
70
70
  return {
71
71
  /**
72
- * Use when text on checkbox does not provide enough context
72
+ * ACCESSIBILITY: Overrides the text in the `Default` slot for screenreader users
73
73
  * @type {string}
74
74
  */
75
75
  ariaLabel: { type: String, attribute: 'aria-label' },
@@ -79,7 +79,7 @@ class InputCheckbox extends InputInlineHelpMixin(FocusMixin(SkeletonMixin(RtlMix
79
79
  */
80
80
  checked: { type: Boolean },
81
81
  /**
82
- * Additional information communicated in the aria-describedby on the input
82
+ * ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input
83
83
  * @type {string}
84
84
  */
85
85
  description: { type: String },
@@ -99,7 +99,7 @@ class InputCheckbox extends InputInlineHelpMixin(FocusMixin(SkeletonMixin(RtlMix
99
99
  */
100
100
  name: { type: String },
101
101
  /**
102
- * Sets "tabindex="-1"" on the checkbox
102
+ * ACCESSIBILITY: ADVANCED: Sets "tabindex="-1"" on the checkbox. Note that an alternative method of focusing is necessary to implement if using this property.
103
103
  * @type {boolean}
104
104
  */
105
105
  notTabbable: { type: Boolean, attribute: 'not-tabbable' },
@@ -4934,12 +4934,12 @@
4934
4934
  "attributes": [
4935
4935
  {
4936
4936
  "name": "aria-label",
4937
- "description": "Use when text on checkbox does not provide enough context",
4937
+ "description": "ACCESSIBILITY: Overrides the text in the `Default` slot for screenreader users",
4938
4938
  "type": "string"
4939
4939
  },
4940
4940
  {
4941
4941
  "name": "description",
4942
- "description": "Additional information communicated in the aria-describedby on the input",
4942
+ "description": "ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input",
4943
4943
  "type": "string"
4944
4944
  },
4945
4945
  {
@@ -4968,7 +4968,7 @@
4968
4968
  },
4969
4969
  {
4970
4970
  "name": "not-tabbable",
4971
- "description": "Sets \"tabindex=\"-1\"\" on the checkbox",
4971
+ "description": "ACCESSIBILITY: ADVANCED: Sets \"tabindex=\"-1\"\" on the checkbox. Note that an alternative method of focusing is necessary to implement if using this property.",
4972
4972
  "type": "boolean",
4973
4973
  "default": "false"
4974
4974
  },
@@ -4988,13 +4988,13 @@
4988
4988
  {
4989
4989
  "name": "ariaLabel",
4990
4990
  "attribute": "aria-label",
4991
- "description": "Use when text on checkbox does not provide enough context",
4991
+ "description": "ACCESSIBILITY: Overrides the text in the `Default` slot for screenreader users",
4992
4992
  "type": "string"
4993
4993
  },
4994
4994
  {
4995
4995
  "name": "description",
4996
4996
  "attribute": "description",
4997
- "description": "Additional information communicated in the aria-describedby on the input",
4997
+ "description": "ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input",
4998
4998
  "type": "string"
4999
4999
  },
5000
5000
  {
@@ -5028,7 +5028,7 @@
5028
5028
  {
5029
5029
  "name": "notTabbable",
5030
5030
  "attribute": "not-tabbable",
5031
- "description": "Sets \"tabindex=\"-1\"\" on the checkbox",
5031
+ "description": "ACCESSIBILITY: ADVANCED: Sets \"tabindex=\"-1\"\" on the checkbox. Note that an alternative method of focusing is necessary to implement if using this property.",
5032
5032
  "type": "boolean",
5033
5033
  "default": "false"
5034
5034
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.43.0",
3
+ "version": "3.44.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",