Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(date-textbox): added docs and story for disabled state #2329

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-bobcats-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/skin": minor
---

docs(date-textbox): added docs and story for disabled state
37 changes: 37 additions & 0 deletions docs/_includes/date-textbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,43 @@ <h3>September 2023</h3>
</span>
{% endhighlight %}

<h3 id="date-textbox-disabled">Disabled Date Textbox</h3>
<p>The disabled date textbox is a disabled textbox input with a calendar icon button that's also disabled. Use the <span class="highlight">disabled</span> attribute on the <span class="highlight">input</span> as well as <span class="highlight">button</span>.</p>

<div class="demo">
<div class="demo__inner">
<span class="date-textbox">
<span class="textbox textbox--icon-end">
<input aria-label="Date Textbox demo" class="textbox__control" placeholder="YYYY-MM-DD" type="text" disabled />
<button class="icon-btn icon-btn--transparent" type="button" aria-label="Calendar"
onclick="this.parentElement.nextElementSibling.toggleAttribute('hidden')" disabled>
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
{% include symbol.html name="calendar-24" %}
</svg>
</button>
</span>
</span>
</div>
</div>

{% highlight html %}
<span class="date-textbox">
<span class="textbox textbox--icon-end">
<input class="textbox__control" placeholder="YYYY-MM-DD" type="text" disabled />
<button class="icon-btn icon-btn--transparent" type="button" aria-label="Calendar" disabled>
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
<use href="#icon-calendar-24"></use>
</svg>
</button>
</span>
<div class="date-textbox__popover">
<div class="calendar">
<!-- see calendar module -->
</div>
</div>
</span>
{% endhighlight %}

<h3 id="date-textbox-single">Date Range Textbox</h3>
<p>Selecting a date range requires two textboxes; one for the start date and one for the end date.</p>
<div class="demo">
Expand Down
25 changes: 19 additions & 6 deletions src/less/date-textbox/stories/date-textbox.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@ export const base = () => `
<span class="textbox textbox--icon-end">
<input class="textbox__control" placeholder="YYYY-MM-DD" type="text" />
<button class="icon-btn icon-btn--transparent" type="button" aria-label="Calendar">
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
<use href="#icon-calendar-24"></use>
</svg>
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
<use href="#icon-calendar-24"></use>
</svg>
</button>
</span>
</span>
`;

export const disabled = () => `
<span class="date-textbox">
<span class="textbox textbox--icon-end">
<input class="textbox__control" placeholder="YYYY-MM-DD" type="text" disabled />
<button class="icon-btn icon-btn--transparent" type="button" aria-label="Calendar" disabled>
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
<use href="#icon-calendar-24"></use>
</svg>
</button>
</span>
</span>
Expand All @@ -18,9 +31,9 @@ export const textSpacing = () => `
<span class="textbox textbox--icon-end">
<input class="textbox__control" placeholder="YYYY-MM-DD" type="text" />
<button class="icon-btn icon-btn--transparent" type="button" aria-label="Calendar">
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
<use href="#icon-calendar-24"></use>
</svg>
<svg aria-hidden="true" class="icon icon--calendar-24" width="16" height="16">
<use href="#icon-calendar-24"></use>
</svg>
</button>
</span>
</span>
Expand Down
Loading