Skip to content

Commit

Permalink
Button titles (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulioRandall authored Nov 15, 2023
1 parent d65aea5 commit 71bb3e8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/button-tippy-titles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ldn-viz/ui': minor
---

ADDED - `title` property to `Button` component so that quick accessible tooltips can be added.
25 changes: 12 additions & 13 deletions packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'turbo', 'prettier'],
plugins: ['svelte', '@typescript-eslint'],
plugins: ['svelte', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
],
settings: {
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
],
settings: {},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
Expand Down
16 changes: 8 additions & 8 deletions packages/ui/src/lib/button/Button.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,23 @@
</Story>

<Story name="Square">
<Button variant="square"
><Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6" aria-hidden="true" /></Button
>
<Button variant="square" emphasis="secondary">
<Button variant="square" title="Down">
<Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6" aria-hidden="true" />
</Button>
<Button variant="square" emphasis="secondary" title="Down">
<Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6" aria-hidden="true" />
</Button>
<Button variant="square" disabled>
<Button variant="square" disabled title="Down">
<Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6" aria-hidden="true" />
</Button>

<Button variant="square" size="sm">
<Button variant="square" size="sm" title="Down">
<Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6" aria-hidden="true" />
</Button>
<Button variant="square" size="md">
<Button variant="square" size="md" title="Down">
<Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6" aria-hidden="true" />
</Button>
<Button variant="square" size="lg">
<Button variant="square" size="lg" title="Down">
<Icon src={ArrowDownCircle} theme="solid" class="w-6 h-6 mb-1" aria-hidden="true" />
Large
</Button>
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/lib/button/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
export let disabled = false;
export let href = '';
export let type: 'button' | 'submit' = 'button';
export let title: undefined | string = undefined;
import { classNames } from '../utils/classNames';
const styleClasses: ButtonStyle = {
Expand Down Expand Up @@ -147,6 +148,7 @@
type={href ? undefined : type}
{href}
{disabled}
{title}
class={buttonClass}
on:click
on:change
Expand Down

0 comments on commit 71bb3e8

Please sign in to comment.