Skip to content

Commit

Permalink
Merge pull request #176 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 8.0.1
  • Loading branch information
hobbitronics authored Dec 3, 2022
2 parents 41b9060 + 83a8649 commit fce79b8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/mdc/Card/Card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export let color = 'white'
export let isClickable = false
export let noPadding = false
$: tabindex = isClickable ? '0' : undefined
$: tabindex = isClickable ? 0 : undefined
</script>

<style>
Expand Down
2 changes: 1 addition & 1 deletion components/mdc/Datatable/DatatableCheckbox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ onMount(() => dispatch('mounted'))
const dispatch = createEventDispatcher()
</script>

<td class="mdc-data-table__cell mdc-data-table__cell--checkbox" on:click>
<td class="mdc-data-table__cell mdc-data-table__cell--checkbox" on:click on:keypress on:keyup on:keydown>
<div class="mdc-checkbox mdc-data-table__row-checkbox">
<input type="checkbox" class="mdc-checkbox__native-control" aria-labelledby={rowId} {disabled} />
<div class="mdc-checkbox__background">
Expand Down
18 changes: 14 additions & 4 deletions components/mdc/Drawer/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ const showAppropriateDrawer = () => {
}
const onListClick = (e) => {
modal && closeDrawer()
dismissible && mainContentEl.querySelector('input, button').focus()
if (e.type === 'click' || e.key === 'Enter' || e.key === ' ') {
modal && closeDrawer()
dismissible && mainContentEl.querySelector('input, button').focus()
}
}
const showAppropriateSizeMenu = () => (isNotMini = isAboveMobile() || !miniMenu)
Expand Down Expand Up @@ -124,7 +126,13 @@ main {
<slot name="drawer-content-top" />
<!-- override built-in padding so height 100 works correctly without creating a vertical scroller -->
<!-- changing the list to flex causes the margins to not collapse -->
<nav class="mdc-deprecated-list flex column p-0" class:h-100={isFullHeightMenu} on:click={onListClick} bind:this={listElement}>
<nav
class="mdc-deprecated-list flex column p-0"
class:h-100={isFullHeightMenu}
on:click={onListClick}
on:keyup={onListClick}
bind:this={listElement}
>
{#each menuItems as { icon, label, url, urlPattern, hide, button, tooltip }, i}
{#if label === '--break--'}
<span class="grow-1" />
Expand Down Expand Up @@ -152,7 +160,9 @@ main {
{/if}
</a>
{:else}
<hr class="mdc-deprecated-list-divider mdc-deprecated-list-divider--inset-leading mdc-deprecated-list-divider--inset-trailing" />
<hr
class="mdc-deprecated-list-divider mdc-deprecated-list-divider--inset-leading mdc-deprecated-list-divider--inset-trailing"
/>
{/if}
</Tooltip.Wrapper>
{#if tooltip}
Expand Down
3 changes: 3 additions & 0 deletions components/mdc/List/Item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ img {
class:mdc-deprecated-list-item--disabled={nonInteractive}
data-mdc-dialog-action={$$props['data-mdc-dialog-action']}
on:click
on:keydown
on:keypress
on:keyup
{tabindex}
>
{#if graphicURL}
Expand Down
4 changes: 3 additions & 1 deletion components/mdc/Select/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ $: if (options && mdcSelect.layoutOptions) mdcSelect.layoutOptions()
const recordSelectedID = (event) => (selectedID = event.detail.value)
const isOptionSelected = (option) => option.id === selectedID
onMount(() => {
mdcSelect = new MDCSelect(element)
mdcSelect.listen('MDCSelect:change', recordSelectedID)
Expand Down Expand Up @@ -77,7 +79,7 @@ afterUpdate(() => {
<div class="mdc-select__menu mdc-menu mdc-menu-surface" style="width: {width}" role="listbox">
<ul class="mdc-deprecated-list">
{#each options as { id, name } (id)}
<li class="mdc-deprecated-list-item" data-value={id} role="option">
<li class="mdc-deprecated-list-item" data-value={id} role="option" aria-selected={isOptionSelected(id)}>
<span class="mdc-deprecated-list-item__text">{name}</span>
</li>
{/each}
Expand Down
9 changes: 6 additions & 3 deletions stories/Button.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Meta, Template, Story } from '@storybook/addon-svelte-csf'
import { Button } from '../components/mdc'
import { copyAndModifyArgs } from './helpers.js'
let content = 'Button slot'
const args = {
raised: true,
class: '',
Expand All @@ -15,7 +13,7 @@ const args = {
<Meta title="Atoms/Button" component={Button} />

<Template let:args>
<Button {...args} on:click={args['on:click']}>{content}</Button>
<Button {...args} on:click={args['on:click']}>Button slot</Button>
</Template>

<Story name="Primary" {args} />
Expand All @@ -27,3 +25,8 @@ const args = {
<Story name="Icon After" args={copyAndModifyArgs(args, { appendIcon: 'arrow_forward' })} />

<Story name="Icon Before" args={copyAndModifyArgs(args, { prependIcon: 'work' })} />

<Story
name="Url"
args={copyAndModifyArgs(args, { url: 'https://github.com/silinternational', raised: false, 'on:click': () => {} })}
/>

0 comments on commit fce79b8

Please sign in to comment.