-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create store locator template (#27)
* feat: create store locator template * style: remove first line * style: add missing ; * fix: use square_business_hours * fix: update breaking changes * fix: update link type * refactor: remove unused data prop * refactor: remove href * fix: remove escape
- Loading branch information
Showing
16 changed files
with
751 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"props": { | ||
"locations": { | ||
"filters": [] | ||
} | ||
}, | ||
"template": "templates/store/locations", | ||
"route": "s/store-locator" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
.store-locator-page__heading { | ||
margin-bottom: var(--space-x2); | ||
} | ||
|
||
.store-locator-input__wrapper { | ||
margin-bottom: var(--space-x3); | ||
} | ||
|
||
.store-locator-list__item { | ||
padding-top: var(--space-x2); | ||
padding-bottom: var(--space-x2); | ||
border-bottom: 1px solid var(--theme-border-color); | ||
transition: border-color 0.1s ease; | ||
} | ||
|
||
.store-locator-list .store-locator-list__item:focus-visible { | ||
outline: none; | ||
} | ||
|
||
.store-locator-list__item.is-active::before, | ||
.store-locator-list__item:focus-visible::before { | ||
opacity: 1; | ||
} | ||
|
||
.store-locator-list__item-icon { | ||
opacity: 0.4; | ||
} | ||
|
||
.store-locator-map { | ||
position: sticky; | ||
top: var(--header-height, 0); | ||
align-self: start; | ||
margin-bottom: 0; | ||
} | ||
|
||
.store-locator-list-async { | ||
position: relative; | ||
min-height: 30vh; | ||
} | ||
|
||
/* store locator dialog */ | ||
|
||
.store-locator-dialog { | ||
display: flex; | ||
flex-flow: column; | ||
gap: var(--space-x3); | ||
padding-bottom: var(--space-x3); | ||
} | ||
|
||
.store-locator-dialog p { | ||
font-size: var(--theme-font-size-minus-1); | ||
line-height: var(--theme-font-size-minus-1-line-height); | ||
color: var(--theme-body-text-color-subtle); | ||
} | ||
|
||
.store-locator-dialog__heading { | ||
font-weight: var(--theme-font-weight-normal); | ||
} | ||
|
||
.store-locator-dialog__detail { | ||
margin-top: var(--space-x2); | ||
} | ||
|
||
.store-locator-dialog__buttons { | ||
display: flex; | ||
gap: var(--space-x2); | ||
padding-top: var(--space-x2); | ||
margin-top: var(--space-x2); | ||
border-top: 1px solid var(--theme-border-color); | ||
} | ||
|
||
.store-locator-dialog__hours-row { | ||
row-gap: var(--space-half); | ||
margin-top: var(--space); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ui-google-map { | ||
border-radius: var(--theme-border-radius); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
window.onStoreLocatorListReady = () => { | ||
const createStoreLocatorItemData = (locationId) => ({ | ||
isActive: false, | ||
init() { | ||
this.$watch('$store.storeLocator.locationId', (id) => { | ||
this.isActive = locationId === id; | ||
}); | ||
}, | ||
/** | ||
* Opens location details on item click | ||
* @param {String} id | ||
*/ | ||
onStoreLocatorItemClick(id) { | ||
if (Alpine.store('global').isMobile) { | ||
this.openLocationDetails(id); | ||
} | ||
Alpine.store('storeLocator').onStoreLocatorItemClick(id); | ||
}, | ||
/** | ||
* Opens location details on item focus | ||
* @param {String} id | ||
*/ | ||
onStoreLocatorItemFocus(id) { | ||
Alpine.store('storeLocator').updateLocationId(id); | ||
}, | ||
/** | ||
* Opens location details on item enter | ||
* @param {String} id | ||
*/ | ||
onStoreLocatorKeyEnter(id) { | ||
if (Alpine.store('global').isMobile) { | ||
this.openLocationDetails(id); | ||
} else { | ||
this.onStoreLocatorItemClick(id); | ||
} | ||
}, | ||
/** | ||
* Opens location details | ||
* @param {String} id | ||
*/ | ||
openLocationDetails(id) { | ||
Alpine.store('storeLocator').openLocationDetails(id); | ||
}, | ||
}); | ||
|
||
Alpine.data('storeLocatorItem', createStoreLocatorItemData); | ||
}; | ||
|
||
document.addEventListener('alpine:init', window.onStoreLocatorListReady); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.