Skip to content

Commit

Permalink
Merge pull request #235 from adobe/westbrook/225/search
Browse files Browse the repository at this point in the history
[#225] Add `sp-search`
  • Loading branch information
Westbrook Johnson authored Oct 10, 2019
2 parents 46e1bdd + 46d8eda commit ec1d79c
Show file tree
Hide file tree
Showing 69 changed files with 1,963 additions and 56 deletions.
6 changes: 3 additions & 3 deletions __snapshots__/Dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Select a Country with a very long label, too long in fact
<slot></slot>
</div>
<sp-icon
class="dropdown icon"
class="chevron-down-medium dropdown icon"
name="ui:ChevronDownMedium"
size="s"
></sp-icon>
Expand Down Expand Up @@ -86,9 +86,9 @@ Select a Country with a very long label, too long in fact
<div class="placeholder" id="label">
<slot></slot>
</div>
<sp-icon class="icon" name="ui:AlertSmall" size="s"></sp-icon>
<sp-icon class="alert-small icon" name="ui:AlertSmall" size="s"></sp-icon>
<sp-icon
class="dropdown icon"
class="chevron-down-medium dropdown icon"
name="ui:ChevronDownMedium"
size="s"
></sp-icon>
Expand Down
1 change: 1 addition & 0 deletions __snapshots__/Menu item.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</div>
<sp-icons-medium style="display: none;"></sp-icons-medium>
<sp-icon
class="checkmark-medium"
id="selected"
name="ui:CheckmarkMedium"
size="s"
Expand Down
23 changes: 23 additions & 0 deletions __snapshots__/Search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# `Search`

#### `loads`

```html
<form>
<sp-icons-medium style="display: none;"></sp-icons-medium>
<input aria-label="Search" id="input" placeholder="Search" />
<sp-icon
class="icon magnifier"
id="icon"
name="ui:Magnifier"
size="s"
></sp-icon>
<button aria-label="Reset" id="button" type="reset">
<sp-icon
class="cross-medium icon"
name="ui:CrossLarge"
size="s"
></sp-icon>
</button>
</form>
```
2 changes: 1 addition & 1 deletion documentation/api-docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const ComponentApiDocs = new Map<string, TemplateResult>();

for (const key of componentApiDocs.keys()) {
const componentName = /([a-zA-Z-]+)\.html$/.exec(key)![1];
const templateString = toHtmlTemplateString(componentApiDocs(key));
const templateString = toHtmlTemplateString(componentApiDocs(key).default);

ComponentApiDocs.set(componentName, templateString);
}
3 changes: 3 additions & 0 deletions documentation/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ for (const key of componentDocs.keys()) {
if (!/node_modules/.test(key)) {
let componentName = key.split('/')[1];
const fileName = /([a-zA-Z-]+)\.md$/.exec(key)![0];
if (fileName === 'CHANGELOG.md') {
continue;
}
if (fileName !== 'README.md') {
componentName = fileName.replace('.md', '');
}
Expand Down
1 change: 1 addition & 0 deletions packages/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@spectrum-web-components/popover": "^0.1.3",
"@spectrum-web-components/radio": "^0.1.3",
"@spectrum-web-components/radio-group": "^0.1.3",
"@spectrum-web-components/search": "^0.0.1",
"@spectrum-web-components/sidenav": "^0.1.3",
"@spectrum-web-components/slider": "^0.1.3",
"@spectrum-web-components/switch": "^0.1.3",
Expand Down
1 change: 1 addition & 0 deletions packages/bundle/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export * from '@spectrum-web-components/overlay-trigger';
export * from '@spectrum-web-components/popover';
export * from '@spectrum-web-components/radio';
export * from '@spectrum-web-components/radio-group';
export * from '@spectrum-web-components/search';
export * from '@spectrum-web-components/sidenav';
export * from '@spectrum-web-components/slider';
export * from '@spectrum-web-components/switch';
Expand Down
1 change: 1 addition & 0 deletions packages/bundle/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
{ "path": "../overlay-trigger" },
{ "path": "../radio" },
{ "path": "../radio-group" },
{ "path": "../search" },
{ "path": "../sidenav" },
{ "path": "../slider" },
{ "path": "../switch" },
Expand Down
279 changes: 279 additions & 0 deletions packages/button/src/spectrum-clear-button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
/* stylelint-disable */ /*
Copyright 2019 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
THIS FILE IS MACHINE GENERATED. DO NOT EDIT */
#button {
/* .spectrum-Button,
* .spectrum-ActionButton,
* .spectrum-LogicButton,
* .spectrum-FieldButton,
* .spectrum-ClearButton,
* .spectrum-Tool */
display: -ms-inline-flexbox;
display: inline-flex;
box-sizing: border-box;

-ms-flex-align: center;

align-items: center;
-ms-flex-pack: center;
justify-content: center;
overflow: visible;
margin: 0;

border-style: solid;
text-transform: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-appearance: button;
vertical-align: top;

transition: background var(--spectrum-global-animation-duration-100, 130ms)
ease-out,
border-color var(--spectrum-global-animation-duration-100, 130ms)
ease-out,
color var(--spectrum-global-animation-duration-100, 130ms) ease-out,
box-shadow var(--spectrum-global-animation-duration-100, 130ms) ease-out;

text-decoration: none;
font-family: adobe-clean, 'Source Sans Pro', -apple-system,
BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

line-height: 1.3;

cursor: pointer;

/* .spectrum-ClearButton */

width: var(
--spectrum-clearbutton-medium-width,
var(--spectrum-global-dimension-size-400)
);
height: var(
--spectrum-clearbutton-medium-height,
var(--spectrum-global-dimension-size-400)
);

border-radius: 100%;

padding: 0;
margin: 0;

border: none;

/* .spectrum-ClearButton */
background-color: var(
--spectrum-clearbutton-medium-background-color,
rgba(0, 0, 0, 0)
);

color: var(
--spectrum-clearbutton-medium-icon-color,
var(--spectrum-global-color-gray-600)
);
}
#button:focus {
/* .spectrum-Button:focus,
* .spectrum-ActionButton:focus,
* .spectrum-LogicButton:focus,
* .spectrum-FieldButton:focus,
* .spectrum-ClearButton:focus,
* .spectrum-Tool:focus */
outline: none;
/* .spectrum-ClearButton.focus-ring */
background-color: var(
--spectrum-clearbutton-medium-background-color-key-focus,
rgba(0, 0, 0, 0)
);

color: var(
--spectrum-clearbutton-medium-icon-color-key-focus,
var(--spectrum-global-color-gray-900)
);
}
#button::-moz-focus-inner {
/* .spectrum-Button::-moz-focus-inner,
* .spectrum-ActionButton::-moz-focus-inner,
* .spectrum-LogicButton::-moz-focus-inner,
* .spectrum-FieldButton::-moz-focus-inner,
* .spectrum-ClearButton::-moz-focus-inner,
* .spectrum-Tool::-moz-focus-inner */
border: 0;
border-style: none;
padding: 0;
margin-top: -2px;
margin-bottom: -2px;
}
#button:-moz-focusring {
/* .spectrum-Button:-moz-focusring,
* .spectrum-ActionButton:-moz-focusring,
* .spectrum-LogicButton:-moz-focusring,
* .spectrum-FieldButton:-moz-focusring,
* .spectrum-ClearButton:-moz-focusring,
* .spectrum-Tool:-moz-focusring */
outline: 1px dotted ButtonText;
}
#button:disabled {
/* .spectrum-Button:disabled,
* .spectrum-ActionButton:disabled,
* .spectrum-LogicButton:disabled,
* .spectrum-FieldButton:disabled,
* .spectrum-ClearButton:disabled,
* .spectrum-Tool:disabled */
cursor: default;
}
.spectrum-Icon {
/* .spectrum-Button .spectrum-Icon,
* .spectrum-ActionButton .spectrum-Icon,
* .spectrum-LogicButton .spectrum-Icon,
* .spectrum-FieldButton .spectrum-Icon,
* .spectrum-ClearButton .spectrum-Icon,
* .spectrum-Tool .spectrum-Icon */
max-height: 100%;
-ms-flex-negative: 0;
flex-shrink: 0;
}
.spectrum-ClearButton--small {
/* .spectrum-ClearButton--small */
width: var(
--spectrum-clearbutton-small-width,
var(--spectrum-global-dimension-size-300)
);
height: var(
--spectrum-clearbutton-small-height,
var(--spectrum-global-dimension-size-300)
);
}
#button:hover {
/* .spectrum-ClearButton:hover */
background-color: var(
--spectrum-clearbutton-medium-background-color-hover,
rgba(0, 0, 0, 0)
);

color: var(
--spectrum-clearbutton-medium-icon-color-hover,
var(--spectrum-global-color-gray-900)
);
}
#button:active {
/* .spectrum-ClearButton:active */
background-color: var(
--spectrum-clearbutton-medium-background-color-down,
rgba(0, 0, 0, 0)
);

color: var(
--spectrum-clearbutton-medium-icon-color-down,
var(--spectrum-global-color-gray-900)
);
}
#button:disabled,
#button.is-disabled {
/* .spectrum-ClearButton:disabled,
* .spectrum-ClearButton.is-disabled */
background-color: var(
--spectrum-clearbutton-medium-background-color-disabled,
rgba(0, 0, 0, 0)
);

color: var(
--spectrum-clearbutton-medium-icon-color-disabled,
var(--spectrum-global-color-gray-500)
);
}
.spectrum-ClearButton--overBackground {
/* .spectrum-Button--overBackground.spectrum-Button--quiet,
* .spectrum-ClearButton--overBackground */
background-color: var(
--spectrum-button-quiet-over-background-background-color,
rgba(0, 0, 0, 0)
);
border-color: var(
--spectrum-button-quiet-over-background-border-color,
rgba(0, 0, 0, 0)
);
color: var(
--spectrum-button-quiet-over-background-text-color,
rgb(255, 255, 255)
);
}
.spectrum-ClearButton--overBackground:hover {
/* .spectrum-Button--overBackground.spectrum-Button--quiet:hover,
* .spectrum-ClearButton--overBackground:hover */
background-color: var(
--spectrum-button-quiet-over-background-background-color-hover,
rgba(255, 255, 255, 0.1)
);
border-color: var(
--spectrum-button-quiet-over-background-border-color-hover,
rgba(0, 0, 0, 0)
);
color: var(
--spectrum-button-quiet-over-background-text-color-hover,
rgb(255, 255, 255)
);
}
.spectrum-ClearButton--overBackground:focus {
/* .spectrum-Button--overBackground.spectrum-Button--quiet.focus-ring,
* .spectrum-ClearButton--overBackground.focus-ring */
background-color: var(
--spectrum-button-quiet-over-background-background-color-key-focus,
rgb(255, 255, 255)
);
border-color: var(
--spectrum-button-quiet-over-background-border-color-key-focus,
rgb(255, 255, 255)
);
color: inherit;
box-shadow: 0 0 0
var(--spectrum-button-primary-border-size-increase-key-focus, 1px)
var(
--spectrum-button-quiet-over-background-border-color-key-focus,
rgb(255, 255, 255)
);
}
.spectrum-ClearButton--overBackground:active {
/* .spectrum-Button--overBackground.spectrum-Button--quiet:active,
* .spectrum-ClearButton--overBackground:active */
background-color: var(
--spectrum-button-quiet-over-background-background-color-down,
rgba(255, 255, 255, 0.15)
);
border-color: var(
--spectrum-button-quiet-over-background-border-color-down,
rgba(0, 0, 0, 0)
);
color: var(
--spectrum-button-quiet-over-background-text-color-down,
rgb(255, 255, 255)
);
box-shadow: none;
}
.spectrum-ClearButton--overBackground:disabled,
.spectrum-ClearButton--overBackground.is-disabled {
/* .spectrum-Button--overBackground.spectrum-Button--quiet:disabled,
* .spectrum-Button--overBackground.spectrum-Button--quiet.is-disabled,
* .spectrum-ClearButton--overBackground:disabled,
* .spectrum-ClearButton--overBackground.is-disabled */
background-color: var(
--spectrum-button-quiet-over-background-background-color-disabled,
rgba(0, 0, 0, 0)
);
border-color: var(
--spectrum-button-quiet-over-background-border-color-disabled,
rgba(0, 0, 0, 0)
);
color: var(
--spectrum-button-quiet-over-background-text-color-disabled,
rgba(255, 255, 255, 0.15)
);
}
8 changes: 8 additions & 0 deletions packages/button/src/spectrum-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,13 @@ module.exports = {
],
exclude: [/\.is-disabled/],
},
{
name: 'clear-button',
host: {
selector: '.spectrum-ClearButton',
shadowSelector: '#button',
},
focus: '#button',
},
],
};
2 changes: 1 addition & 1 deletion packages/button/stories/button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ storiesOf('Button', module)
content: html`
<sp-icon
slot="icon"
size="m"
size="s"
name="ui:HelpMedium"
></sp-icon>
Help
Expand Down
Loading

0 comments on commit ec1d79c

Please sign in to comment.