Skip to content

Commit b15502a

Browse files
authored
Use with- and without- consistently (#977)
* use with- and without- consistently * fix test * cleanup * remove console
1 parent 73f6eea commit b15502a

File tree

25 files changed

+64
-56
lines changed

25 files changed

+64
-56
lines changed

docs/_includes/search.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
type="search"
99
appearance="filled"
1010
size="large"
11-
clearable
11+
with-clear
1212
placeholder="Search"
1313
autofocus
1414
autocomplete="off"

docs/_layouts/overview.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layout: page-outline
77
{% endif %}
88

99
<div id="block-filter">
10-
<wa-input type="search" placeholder="Search {{ title }}" clearable autofocus>
10+
<wa-input type="search" placeholder="Search {{ title }}" with-clear autofocus>
1111
<wa-icon slot="prefix" name="search"></wa-icon>
1212
</wa-input>
1313
</div>

docs/_layouts/palette.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<wa-icon name="sliders-simple" slot="icon" variant="regular"></wa-icon>
6969
This palette has been tweaked.
7070
<div class="wa-cluster wa-gap-xs">
71-
<wa-tag v-for="tweakHumanReadable, param in tweaksHumanReadable" removable @wa-remove="reset(param)" v-content="tweakHumanReadable"></wa-tag>
71+
<wa-tag v-for="tweakHumanReadable, param in tweaksHumanReadable" with-remove @wa-remove="reset(param)" v-content="tweakHumanReadable"></wa-tag>
7272
</div>
7373

7474
<wa-button @click="reset()" appearance="outlined" variant="danger">

docs/_layouts/theme.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (location.pathname.endsWith('/custom/') && !location.search) {
2828
<wa-tooltip for="what-is-remixing">Customize this theme by changing its colors and/or remixing it with design elements from other themes!</wa-tooltip>
2929
</h4>
3030

31-
<wa-select name="palette" label="Color palette" clearable v-model="theme.palette">
31+
<wa-select name="palette" label="Color palette" with-clear v-model="theme.palette">
3232
<wa-icon name="swatchbook" slot="prefix" variant="regular"></wa-icon>
3333
<wa-option v-for="(palette, paletteId) in palettes" :label="palette.title" :value="paletteId === baseTheme.palette ? '' : paletteId">
3434
<palette-card :palette="paletteId" size="small">
@@ -42,7 +42,7 @@ if (location.pathname.endsWith('/custom/') && !location.search) {
4242
<color-select :model-value="computed.brand" @update:model-value="value => theme.brand = value" label="Brand color"
4343
:values="hues"></color-select>
4444

45-
<wa-select name="colors" class="theme-colors-select" label="Color contrast from…" value="" clearable v-model="theme.colors">
45+
<wa-select name="colors" class="theme-colors-select" label="Color contrast from…" value="" with-clear v-model="theme.colors">
4646
<wa-icon name="palette" slot="prefix" variant="regular"></wa-icon>
4747
<template v-for="(themeMeta, themeId) in themes">
4848
<wa-option v-if="themeId !== 'custom'" :label="themeMeta.title" :value="themeId === computed.colors ? '' : themeId">
@@ -55,7 +55,7 @@ if (location.pathname.endsWith('/custom/') && !location.search) {
5555
</template>
5656
</wa-select>
5757

58-
<wa-select name="typography" label="Typography from…" clearable v-model="theme.typography">
58+
<wa-select name="typography" label="Typography from…" with-clear v-model="theme.typography">
5959
<wa-icon name="font-case" slot="prefix"></wa-icon>
6060

6161
<wa-option v-for="(themeMeta, themeId) in themes" :label="themeMeta.title" :value="themeId === theme.base ? '' : themeId">

docs/docs/components/cheatsheet/index.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ table code {
1717

1818
<fieldset id="name_search_group">
1919
<legend>Filter by name</legend>
20-
<wa-input type=search clearable id="name_search"></wa-input>
20+
<wa-input type="search" with-clear id="name_search"></wa-input>
2121
<wa-checkbox id="name_search_i" checked>Case sensitive</wa-checkbox>
2222
<wa-checkbox id="name_search_regexp">Regular expression</wa-checkbox>
2323
</fieldset>

docs/docs/components/color-picker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Use the `opacity` attribute to enable the opacity slider. When this is enabled,
3636

3737
Set the color picker's format with the `format` attribute. Valid options include `hex`, `rgb`, `hsl`, and `hsv`. Note that the color picker's input will accept any parsable format (including CSS color names) regardless of this option.
3838

39-
To prevent users from toggling the format themselves, add the `no-format-toggle` attribute.
39+
To prevent users from toggling the format themselves, add the `without-format-toggle` attribute.
4040

4141
```html {.example}
4242
<div class="wa-grid" style="--min-column-size: 12ch;">

docs/docs/components/input.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ Use the `placeholder` attribute to add a placeholder.
4343

4444
### Clearable
4545

46-
Add the `clearable` attribute to add a clear button when the input has content.
46+
Add the `with-clear` attribute to add a clear button when the input has content.
4747

4848
```html {.example}
49-
<wa-input placeholder="Clearable" clearable></wa-input>
49+
<wa-input placeholder="Clearable" with-clear></wa-input>
5050
```
5151

5252
### Toggle Password

docs/docs/components/qr-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ QR codes are useful for providing small pieces of information to users who can q
1212
<wa-qr-code value="https://shoelace.style/" label="Scan this code to visit Web Awesome on the web!"></wa-qr-code>
1313
<br />
1414

15-
<wa-input maxlength="255" clearable label="Value">
15+
<wa-input maxlength="255" with-clear label="Value">
1616
<wa-icon slot="prefix" name="link"></wa-icon>
1717
</wa-input>
1818
</div>

docs/docs/components/select.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ Use the `placeholder` attribute to add a placeholder.
6161

6262
### Clearable
6363

64-
Use the `clearable` attribute to make the control clearable. The clear button only appears when an option is selected.
64+
Use the `with-clear` attribute to make the control clearable. The clear button only appears when an option is selected.
6565

6666
```html {.example}
67-
<wa-select clearable value="option-1">
67+
<wa-select with-clear value="option-1">
6868
<wa-option value="option-1">Option 1</wa-option>
6969
<wa-option value="option-2">Option 2</wa-option>
7070
<wa-option value="option-3">Option 3</wa-option>
@@ -109,10 +109,10 @@ Use the `disabled` attribute to disable a select.
109109

110110
### Multiple
111111

112-
To allow multiple options to be selected, use the `multiple` attribute. It's a good practice to use `clearable` when this option is enabled. To set multiple values at once, set `value` to a space-delimited list of values.
112+
To allow multiple options to be selected, use the `multiple` attribute. It's a good practice to use `with-clear` when this option is enabled. To set multiple values at once, set `value` to a space-delimited list of values.
113113

114114
```html {.example}
115-
<wa-select label="Select a Few" value="option-1 option-2 option-3" multiple clearable>
115+
<wa-select label="Select a Few" value="option-1 option-2 option-3" multiple with-clear>
116116
<wa-option value="option-1">Option 1</wa-option>
117117
<wa-option value="option-2">Option 2</wa-option>
118118
<wa-option value="option-3">Option 3</wa-option>
@@ -142,7 +142,7 @@ Use the `value` attribute to set the initial selection.
142142
When using `multiple`, the `value` _attribute_ uses space-delimited values to select more than one option. Because of this, `<wa-option>` values cannot contain spaces. If you're accessing the `value` _property_ through Javascript, it will be an array.
143143

144144
```html {.example}
145-
<wa-select value="option-1 option-2" multiple clearable>
145+
<wa-select value="option-1 option-2" multiple with-clear>
146146
<wa-option value="option-1">Option 1</wa-option>
147147
<wa-option value="option-2">Option 2</wa-option>
148148
<wa-option value="option-3">Option 3</wa-option>
@@ -213,21 +213,21 @@ The preferred placement of the select's listbox can be set with the `placement`
213213
Use the `prefix` slot to prepend an icon to the control.
214214

215215
```html {.example}
216-
<wa-select placeholder="Small" size="small" clearable>
216+
<wa-select placeholder="Small" size="small" with-clear>
217217
<wa-icon slot="prefix" name="house" variant="solid"></wa-icon>
218218
<wa-option value="option-1">Option 1</wa-option>
219219
<wa-option value="option-2">Option 2</wa-option>
220220
<wa-option value="option-3">Option 3</wa-option>
221221
</wa-select>
222222
<br />
223-
<wa-select placeholder="Medium" size="medium" clearable>
223+
<wa-select placeholder="Medium" size="medium" with-clear>
224224
<wa-icon slot="prefix" name="house" variant="solid"></wa-icon>
225225
<wa-option value="option-1">Option 1</wa-option>
226226
<wa-option value="option-2">Option 2</wa-option>
227227
<wa-option value="option-3">Option 3</wa-option>
228228
</wa-select>
229229
<br />
230-
<wa-select placeholder="Large" size="large" clearable>
230+
<wa-select placeholder="Large" size="large" with-clear>
231231
<wa-icon slot="prefix" name="house" variant="solid"></wa-icon>
232232
<wa-option value="option-1">Option 1</wa-option>
233233
<wa-option value="option-2">Option 2</wa-option>
@@ -240,21 +240,21 @@ Use the `prefix` slot to prepend an icon to the control.
240240
Use the `suffix` slot to append an icon to the control.
241241

242242
```html {.example}
243-
<wa-select placeholder="Small" size="small" clearable>
243+
<wa-select placeholder="Small" size="small" with-clear>
244244
<wa-icon name="house" slot="suffix"></wa-icon>
245245
<wa-option value="option-1">Option 1</wa-option>
246246
<wa-option value="option-2">Option 2</wa-option>
247247
<wa-option value="option-3">Option 3</wa-option>
248248
</wa-select>
249249
<br />
250-
<wa-select placeholder="Medium" size="medium" clearable>
250+
<wa-select placeholder="Medium" size="medium" with-clear>
251251
<wa-icon name="house" slot="suffix"></wa-icon>
252252
<wa-option value="option-1">Option 1</wa-option>
253253
<wa-option value="option-2">Option 2</wa-option>
254254
<wa-option value="option-3">Option 3</wa-option>
255255
</wa-select>
256256
<br />
257-
<wa-select placeholder="Large" size="large" clearable>
257+
<wa-select placeholder="Large" size="large" with-clear>
258258
<wa-icon name="house" slot="suffix"></wa-icon>
259259
<wa-option value="option-1">Option 1</wa-option>
260260
<wa-option value="option-2">Option 2</wa-option>
@@ -273,7 +273,7 @@ Remember that custom tags are rendered in a shadow root. To style them, you can
273273
placeholder="Select one"
274274
value="email phone"
275275
multiple
276-
clearable
276+
with-clear
277277
class="custom-tag"
278278
>
279279
<wa-option value="email">
@@ -301,7 +301,7 @@ Remember that custom tags are rendered in a shadow root. To style them, you can
301301
302302
// You can return a string, a Lit Template, or an HTMLElement here
303303
return `
304-
<wa-tag removable>
304+
<wa-tag with-remove>
305305
<wa-icon name="${name}" style="padding-inline-end: .5rem;"></wa-icon>
306306
${option.label}
307307
</wa-tag>

docs/docs/components/tag.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ Use the `pill` attribute to give tabs rounded edges.
7878

7979
### Removable
8080

81-
Use the `removable` attribute to add a remove button to the tag.
81+
Use the `with-remove` attribute to add a remove button to the tag.
8282

8383
```html {.example}
8484
<div class="tags-removable">
85-
<wa-tag size="small" removable>Small</wa-tag>
86-
<wa-tag size="medium" removable>Medium</wa-tag>
87-
<wa-tag size="large" removable>Large</wa-tag>
85+
<wa-tag size="small" with-remove>Small</wa-tag>
86+
<wa-tag size="medium" with-remove>Medium</wa-tag>
87+
<wa-tag size="large" with-remove>Large</wa-tag>
8888
</div>
8989

9090
<script>

0 commit comments

Comments
 (0)