Skip to content

Commit d87848d

Browse files
committed
input url implementation
1 parent 4dcbb34 commit d87848d

File tree

22 files changed

+840
-748
lines changed

22 files changed

+840
-748
lines changed

astro-docs/src/_data/componentsDetails.json

Lines changed: 554 additions & 481 deletions
Large diffs are not rendered by default.

astro-docs/src/layouts/Base.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const isProd = import.meta.env.PROD;
1414
let envProps;
1515
1616
if (isProd) {
17-
envProps = site['prod'];
17+
envProps = true;//site['prod'];
1818
} else {
1919
envProps = site['dev'];
2020
}

astro-docs/src/layouts/Component.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const {nextComponent, previousComponent} = getNextAndPrevious(componentDetails.t
2121

2222
<Layout title={title} description={description} classes='layer-01'>
2323

24-
<div class='sidenav m-hide layer-background'>
24+
<div class='sidenav m-hide layer-background' id="component-page">
2525

2626
<div class='sidenav-components'>
2727

astro-docs/src/layouts/Default.astro

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const searchItems = componentsDetails.components.map(component => ({
2727
<goat-header-brand logo='/assets/img/logo.svg' href='/#' name={site.title}></goat-header-brand>
2828

2929

30-
<goat-header-action
30+
<!--goat-header-action
3131
class='hide-tablet-portrait-below'
3232
href='/components#'>
3333
Docs
34-
</goat-header-action>
34+
</goat-header-action-->
3535

3636
<goat-header-action
3737
class='hide-tablet-portrait-below'
@@ -153,13 +153,10 @@ const searchItems = componentsDetails.components.map(component => ({
153153
const search = document.querySelector('#site-search');
154154

155155
searchBtn.addEventListener('click', function() {
156-
const searchContainer = document.querySelector('#search-header-container');
157-
searchContainer.toggleAttribute('open');
158-
setTimeout(() => {
159-
search.openSelectList();
160-
}, 300);
156+
openSearchContainer();
161157
});
162158

159+
163160

164161
searchContainerOverlay.addEventListener('click', function() {
165162
const searchContainer = document.querySelector('#search-header-container');
@@ -185,18 +182,25 @@ const searchItems = componentsDetails.components.map(component => ({
185182
if (e.key === '/') {
186183
const path = e.composedPath();
187184
for (const elm of path) {
188-
if (elm.tagName === 'GOAT-INPUT' || elm.tagName === 'GOAT-CODE-EDITOR' || elm.tagName === 'GOAT-TEXTAREA') {
185+
if (elm.tagName === 'GOAT-INPUT' || elm.tagName === 'GOAT-CODE-EDITOR' || elm.tagName === 'GOAT-TEXTAREA' || elm.tagName === 'INPUT') {
189186
return;
190187
}
191188
}
192189
e.preventDefault();
193-
search.open = true;
194-
setTimeout(() => {
195-
search.setFocus();
196-
}, 300);
190+
openSearchContainer();
197191
}
198192
});
199193
}
194+
195+
196+
function openSearchContainer() {
197+
const searchContainer = document.querySelector('#search-header-container');
198+
searchContainer.toggleAttribute('open');
199+
setTimeout(() => {
200+
search.openSelectList();
201+
}, 300);
202+
}
203+
200204
});
201205
</script>
202206
</Layout>
File renamed without changes.

astro-docs/src/pages/components/url-input/_sections/sizes.astro renamed to astro-docs/src/pages/components/input-url/_sections/sizes.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import HighlighterCard from '../../../../components/HighlighterCard.astro';
33
---
44
<goat-text type='body'>Fancy larger or smaller input? Add size attribute for additional sizes.</goat-text>
55
<HighlighterCard lang={'html'}>
6-
<goat-input size='lg' placeholder='Large'></goat-input>
7-
<goat-input placeholder='Medium'></goat-input>
8-
<goat-input size='sm' placeholder='Small'></goat-input>
6+
<goat-input-url size='lg' placeholder='Large'></goat-input-url>
7+
<goat-input-url placeholder='Medium'></goat-input-url>
8+
<goat-input-url size='sm' placeholder='Small'></goat-input-url>
99
</HighlighterCard>

astro-docs/src/pages/components/url-input/_sections/usage.astro renamed to astro-docs/src/pages/components/input-url/_sections/usage.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import HighlighterCard from '../../../../components/HighlighterCard.astro';
44
<goat-text type='body'>Here are different types of inputs.</goat-text>
55

66
<HighlighterCard lang={'html'} cssClasses='demo-input'>
7-
<goat-url-input
7+
<goat-input-url
88
required
99
clearable
10+
value="https://shivajivarma.com"
1011
label='Text input label'
1112
helper-text='Optional help text'
1213
placeholder='Optional placeholder text'
13-
></goat-url-input>
14+
></goat-input-url>
1415

1516
</HighlighterCard>

astro-docs/src/pages/components/url-input/index.astro renamed to astro-docs/src/pages/components/input-url/index.astro

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import Layout from '../../../layouts/Component.astro';
33
import { getComponentDetails } from '../../../_data/getComponentDetails.ts';
44
import ApiPanel from '../../../components/ApiPanel.astro';
55
import OverviewPanel from '../../../components/OverviewPanel.astro';
6-
const componentDetails = getComponentDetails('goat-url-input');
6+
const componentDetails = getComponentDetails('goat-input-url');
77
88
import UsageSection from './_sections/usage.astro';
9-
import SlotsSection from './_sections/slots.astro';
109
import SizesSection from './_sections/sizes.astro';
1110
import StatesSection from './_sections/states.astro';
1211
import EventsSection from './_sections/events.astro';
@@ -15,18 +14,9 @@ const sections = [
1514
{
1615
'title': 'Usage',
1716
'Component': UsageSection,
18-
}, {
19-
'title': 'Slots',
20-
'Component': SlotsSection,
2117
}, {
2218
'title': 'Sizes',
2319
'Component': SizesSection,
24-
}, {
25-
'title': 'States',
26-
'Component': StatesSection,
27-
}, {
28-
'title': 'Events',
29-
'Component': EventsSection,
3020
}];
3121
---
3222
<Layout componentDetails={componentDetails}>

astro-docs/src/pages/components/url-input/_sections/slots.astro

Lines changed: 0 additions & 17 deletions
This file was deleted.

astro-docs/src/pages/components/url-input/_sections/states.astro

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)