@brightspace-ui/core 3.46.1 → 3.47.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,13 +42,6 @@
42
42
  </template>
43
43
  </d2l-demo-snippet>
44
44
 
45
- <h2>Placeholder</h2>
46
- <d2l-demo-snippet>
47
- <template>
48
- <d2l-input-number label="Age" label-hidden placeholder="Age"></d2l-input-number>
49
- </template>
50
- </d2l-demo-snippet>
51
-
52
45
  <h2>Min and Max Values</h2>
53
46
  <d2l-demo-snippet>
54
47
  <template>
@@ -40,13 +40,6 @@
40
40
  </template>
41
41
  </d2l-demo-snippet>
42
42
 
43
- <h2>Placeholder</h2>
44
- <d2l-demo-snippet>
45
- <template>
46
- <d2l-input-percent label="Grade" label-hidden placeholder="Grade"></d2l-input-percent>
47
- </template>
48
- </d2l-demo-snippet>
49
-
50
43
  <h2>Min and Max Fraction Digits</h2>
51
44
  <d2l-demo-snippet>
52
45
  <template>
@@ -15,7 +15,7 @@
15
15
  <h2>Search Input</h2>
16
16
  <d2l-demo-snippet>
17
17
  <template>
18
- <d2l-input-search label="Search" value="apples" placeholder="Search for some stuff">
18
+ <d2l-input-search label="Search" value="apples" placeholder="Search...">
19
19
  </d2l-input-search>
20
20
  </template>
21
21
  </d2l-demo-snippet>
@@ -23,7 +23,7 @@
23
23
  <h2>Search Input (No Clear)</h2>
24
24
  <d2l-demo-snippet>
25
25
  <template>
26
- <d2l-input-search label="Search" value="Clear button will never appear" placeholder="Search for some stuff" no-clear>
26
+ <d2l-input-search label="Search" value="Clear button will never appear" placeholder="Search..." no-clear>
27
27
  </d2l-input-search>
28
28
  </template>
29
29
  </d2l-demo-snippet>
@@ -31,7 +31,7 @@
31
31
  <h2>Search Input (Search on Input)</h2>
32
32
  <d2l-demo-snippet>
33
33
  <template>
34
- <d2l-input-search label="Search" value="Will dispatch search after every input" placeholder="Search for some stuff" search-on-input>
34
+ <d2l-input-search label="Search" value="Will dispatch search after every input" placeholder="Search..." search-on-input>
35
35
  </d2l-input-search>
36
36
  </template>
37
37
  </d2l-demo-snippet>
@@ -39,7 +39,7 @@
39
39
  <h2>Search Input with Inline Help</h2>
40
40
  <d2l-demo-snippet>
41
41
  <template>
42
- <d2l-input-search label="Search" value="apples" placeholder="Search for some stuff">
42
+ <d2l-input-search label="Search" value="apples" placeholder="Search...">
43
43
  <div slot="inline-help">
44
44
  Help text <b>right here</b>!
45
45
  </div>
@@ -50,7 +50,7 @@
50
50
  <h2>Search Input with Inline Help (multiline)</h2>
51
51
  <d2l-demo-snippet>
52
52
  <template>
53
- <d2l-input-search label="Search" value="apples" placeholder="Search for some stuff">
53
+ <d2l-input-search label="Search" value="apples" placeholder="Search...">
54
54
  <div slot="inline-help">
55
55
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
56
56
  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
@@ -62,13 +62,6 @@
62
62
  </template>
63
63
  </d2l-demo-snippet>
64
64
 
65
- <h2>Placeholder</h2>
66
- <d2l-demo-snippet>
67
- <template>
68
- <d2l-input-text label="Name" label-hidden placeholder="Enter a name..."></d2l-input-text>
69
- </template>
70
- </d2l-demo-snippet>
71
-
72
65
  <h2>Instructions</h2>
73
66
  <d2l-demo-snippet>
74
67
  <template>
@@ -47,10 +47,10 @@
47
47
  </template>
48
48
  </d2l-demo-snippet>
49
49
 
50
- <h2>Placeholder</h2>
50
+ <h2>Long Label</h2>
51
51
  <d2l-demo-snippet>
52
52
  <template>
53
- <d2l-input-textarea label="Description" placeholder="Enter a description of your favorite cartoon character. It must be between 30 and 60 characters in length. Good luck!"></d2l-input-textarea>
53
+ <d2l-input-textarea label="Enter a description of your favorite cartoon character. It must be between 30 and 60 characters in length."></d2l-input-textarea>
54
54
  </template>
55
55
  </d2l-demo-snippet>
56
56
 
@@ -54,7 +54,6 @@ The `<d2l-input-number>` element is similar to `<d2l-input-text>`, except it's i
54
54
  | `min` | Number | Minimum value allowed. |
55
55
  | `min-exclusive` | Boolean, default: `false` | Indicates whether the min value is exclusive. |
56
56
  | `min-fraction-digits` | Number, default: `0` | Minimum number of digits allowed after the decimal place. Must be between 0 and 20 and less than or equal to `maxFractionDigits` |
57
- | `placeholder` | String | Placeholder text. |
58
57
  | `required` | Boolean, default: `false` | Indicates that a value is required. |
59
58
  | `unit` | String | Unit associated with the input value, displayed next to input and announced as part of the label |
60
59
  | `value` | Number | Value of the input. |
@@ -128,7 +127,6 @@ The `<d2l-input-percent>` element is similar to `<d2l-input-number>`, except it
128
127
  | `label-hidden` | Boolean, default: `false` | Hides the label visually (moves it to the input's `aria-label` attribute). |
129
128
  | `max-fraction-digits` | Number | Maximum number of digits allowed after the decimal place. |
130
129
  | `min-fraction-digits` | Number | Minimum number of digits allowed after the decimal place. |
131
- | `placeholder` | String | Placeholder text. |
132
130
  | `required` | Boolean, default: `false` | Indicates that a value is required. |
133
131
  | `value` | Number | Value of the input. |
134
132
 
@@ -86,7 +86,6 @@ When the input is cleared, the same event will be fired with an empty value.
86
86
 
87
87
  - While the component does not have a visible label, the search icon clearly indicates its purpose
88
88
  - While not required to meet WCAG, this [pattern](https://www.w3.org/WAI/WCAG2/supplemental/patterns/o1p07-icons-used/) is a great way to help individuals with cognitive accessibility needs
89
- - The contrast ratio of the placeholder text can be safely ignored since the search icon serves the same purpose, and meets that criteria
90
89
  - It is important to note that `placeholder` is not a suitable replacement for `label` or `description`, since it only applies when the input is empty, and not all users will be able to read it in the first place
91
90
  - Search results should be announced to screen reader users using a live region around the result summary or by using the [`announce`](https://github.com/BrightspaceUI/core/blob/main/helpers/announce.js) helper
92
91
  - It can also be used to help confirm what exactly was searched, along with how many results were found
@@ -28,23 +28,14 @@ Text inputs allow users to input, edit, and select text.
28
28
  * Make sure you include an obvious indication of what the field is for. Usually this means a label.
29
29
  * Design the length of the text input to give the user a scent of how long the expected data should be.
30
30
  * Ensure the label remains visible when a user focuses on the input using their mobile device. Often this means using a top-aligned label, but a left-aligned label with a very short text input can work also.
31
- * Placeholder text is inaccessible so only use it for decorative or supporting text.
32
31
  <!-- docs: end dos -->
33
32
 
34
33
  <!-- docs: start donts -->
35
- * Don’t use placeholder text as the label.
36
- * Don’t use placeholder text if it is redundant (ie: “Click to start typing”)
37
- * Don’t use placeholder text to communicate the required format of the input (ie: “YY/MM/DD”). Use help or label text for this.
34
+ * Don’t use placeholder text - support for this property is being removed. Find an alternative method of communicating text input instructions.
38
35
  * Don’t use different font sizes. Text should always be Compact.
39
36
  <!-- docs: end donts -->
40
37
  <!-- docs: end best practices -->
41
38
 
42
- ## Accessibility
43
-
44
- Due to widespread popularity, users have a strong association that placeholder text in text inputs should appear “light gray” compared to active text colour. This has been confirmed in our own usability tests; any text that appears dark enough to pass WCAG AA colour contrast tests is also interpreted as “editable” by users.
45
-
46
- Therefore in text inputs, placeholder text is a light colour (Mica), which fails colour contrast. Because of this, placeholder text should be used sparingly, and never be used to communicate crucial information unless that information is also made available to screen readers via an equivalent experience (hidden label, etc). Text which is decorative or supplemental is okay, as is using a hidden label which provides the same information.
47
-
48
39
  ## Text Input [d2l-input-text]
49
40
 
50
41
  The `<d2l-input-text>` element is a simple wrapper around the native `<input type="text">` tag. It's intended primarily for inputting generic text, email addresses and URLs.
@@ -90,7 +81,6 @@ The `<d2l-input-text>` element is a simple wrapper around the native `<input typ
90
81
  | `name` | String | Name of the input |
91
82
  | `novalidate` | Boolean | Disables the built-in validation |
92
83
  | `pattern` | String | Regular expression pattern to validate the value |
93
- | `placeholder` | String | Placeholder text |
94
84
  | `prevent-submit` | Boolean | Prevents pressing ENTER from submitting forms |
95
85
  | `readonly` | Boolean | Makes the input read-only |
96
86
  | `required` | Boolean | Indicates that a value is required |
@@ -207,7 +197,6 @@ The `<d2l-input-textarea>` is a wrapper around the native `<textarea>` element t
207
197
  | `minlength` | Number | Imposes a lower character limit |
208
198
  | `no-border` | Boolean | Hides the border |
209
199
  | `no-padding` | Boolean | Removes left/right padding |
210
- | `placeholder` | String | Placeholder text |
211
200
  | `required` | Boolean | Indicates that a value is required |
212
201
  | `rows` | Number, default: 5 | Minimum number of rows. If `rows` and `max-rows` are equal then auto-grow will be disabled. |
213
202
  | `value` | String, default: `''` | Value of the `textarea` |
@@ -142,8 +142,7 @@ class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixi
142
142
  */
143
143
  minFractionDigits: { type: Number, attribute: 'min-fraction-digits' },
144
144
  /**
145
- * Placeholder text
146
- * @type {string}
145
+ * @ignore
147
146
  */
148
147
  placeholder: { type: String },
149
148
  /**
@@ -49,8 +49,7 @@ class InputPercent extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMix
49
49
  */
50
50
  minFractionDigits: { type: Number, attribute: 'min-fraction-digits' },
51
51
  /**
52
- * Placeholder text
53
- * @type {string}
52
+ * @ignore
54
53
  */
55
54
  placeholder: { type: String },
56
55
  /**
@@ -33,13 +33,13 @@ export const inputStyles = css`
33
33
  padding: var(--d2l-input-padding, 0.4rem 0.75rem);
34
34
  }
35
35
  .d2l-input::placeholder {
36
- color: var(--d2l-color-mica);
36
+ color: var(--d2l-color-galena);
37
37
  font-size: 0.8rem;
38
38
  font-weight: 400;
39
39
  opacity: 1; /* Firefox has non-1 default */
40
40
  }
41
41
  .d2l-input::-ms-input-placeholder {
42
- color: var(--d2l-color-mica);
42
+ color: var(--d2l-color-galena);
43
43
  font-size: 0.8rem;
44
44
  font-weight: 400;
45
45
  }
@@ -107,8 +107,7 @@ class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(La
107
107
  */
108
108
  pattern: { type: String },
109
109
  /**
110
- * Placeholder text
111
- * @type {string}
110
+ * @ignore
112
111
  */
113
112
  placeholder: { type: String },
114
113
  /**
@@ -71,8 +71,7 @@ class InputTextArea extends InputInlineHelpMixin(FocusMixin(LabelledMixin(FormEl
71
71
  */
72
72
  noPadding: { type: Boolean, attribute: 'no-padding' },
73
73
  /**
74
- * Placeholder text
75
- * @type {string}
74
+ * @ignore
76
75
  */
77
76
  placeholder: { type: String },
78
77
  /**
@@ -27,7 +27,7 @@
27
27
  width: 100%;
28
28
  &::placeholder,
29
29
  &::-ms-input-placeholder {
30
- color: $d2l-color-mica;
30
+ color: $d2l-color-galena;
31
31
  font-size: 0.8rem;
32
32
  font-weight: 400;
33
33
  opacity: 1; /* Firefox has non-1 default */
@@ -90,7 +90,7 @@ The `d2l-tooltip` component is used to display additional information when users
90
90
  });
91
91
  </script>
92
92
  <!-- docs: end hidden content -->
93
- <d2l-input-text placeholder="Hover for Error" id="tooltip-error" aria-invalid="true" label="Text Input" label-hidden style="max-width:250px;"></d2l-input-text>
93
+ <d2l-input-text id="tooltip-error" aria-invalid="true" label="Text Input (hover for error)" label-hidden style="max-width:250px;"></d2l-input-text>
94
94
  <d2l-tooltip for="tooltip-error" state="error">
95
95
  Your error message will display here
96
96
  </d2l-tooltip>
@@ -6185,11 +6185,6 @@
6185
6185
  "description": "Minimum value allowed",
6186
6186
  "type": "number"
6187
6187
  },
6188
- {
6189
- "name": "placeholder",
6190
- "description": "Placeholder text",
6191
- "type": "string"
6192
- },
6193
6188
  {
6194
6189
  "name": "unit",
6195
6190
  "description": "Unit associated with the input value, displayed next to input and announced as part of the label",
@@ -6303,12 +6298,6 @@
6303
6298
  "description": "Minimum value allowed",
6304
6299
  "type": "number"
6305
6300
  },
6306
- {
6307
- "name": "placeholder",
6308
- "attribute": "placeholder",
6309
- "description": "Placeholder text",
6310
- "type": "string"
6311
- },
6312
6301
  {
6313
6302
  "name": "unit",
6314
6303
  "attribute": "unit",
@@ -6476,11 +6465,6 @@
6476
6465
  "description": "Minimum number of decimal values to show.",
6477
6466
  "type": "number"
6478
6467
  },
6479
- {
6480
- "name": "placeholder",
6481
- "description": "Placeholder text",
6482
- "type": "string"
6483
- },
6484
6468
  {
6485
6469
  "name": "value",
6486
6470
  "description": "Value of the input",
@@ -6544,12 +6528,6 @@
6544
6528
  "description": "Minimum number of decimal values to show.",
6545
6529
  "type": "number"
6546
6530
  },
6547
- {
6548
- "name": "placeholder",
6549
- "attribute": "placeholder",
6550
- "description": "Placeholder text",
6551
- "type": "string"
6552
- },
6553
6531
  {
6554
6532
  "name": "value",
6555
6533
  "attribute": "value",
@@ -6821,11 +6799,6 @@
6821
6799
  "description": "Regular expression pattern to validate the value",
6822
6800
  "type": "string"
6823
6801
  },
6824
- {
6825
- "name": "placeholder",
6826
- "description": "Placeholder text",
6827
- "type": "string"
6828
- },
6829
6802
  {
6830
6803
  "name": "size",
6831
6804
  "description": "Size of the input",
@@ -6987,12 +6960,6 @@
6987
6960
  "description": "Regular expression pattern to validate the value",
6988
6961
  "type": "string"
6989
6962
  },
6990
- {
6991
- "name": "placeholder",
6992
- "attribute": "placeholder",
6993
- "description": "Placeholder text",
6994
- "type": "string"
6995
- },
6996
6963
  {
6997
6964
  "name": "size",
6998
6965
  "attribute": "size",
@@ -7178,11 +7145,6 @@
7178
7145
  "description": "Removes default left/right padding",
7179
7146
  "type": "boolean"
7180
7147
  },
7181
- {
7182
- "name": "placeholder",
7183
- "description": "Placeholder text",
7184
- "type": "string"
7185
- },
7186
7148
  {
7187
7149
  "name": "disabled",
7188
7150
  "description": "Disables the input",
@@ -7277,12 +7239,6 @@
7277
7239
  "description": "Removes default left/right padding",
7278
7240
  "type": "boolean"
7279
7241
  },
7280
- {
7281
- "name": "placeholder",
7282
- "attribute": "placeholder",
7283
- "description": "Placeholder text",
7284
- "type": "string"
7285
- },
7286
7242
  {
7287
7243
  "name": "disabled",
7288
7244
  "attribute": "disabled",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.46.1",
3
+ "version": "3.47.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",