@insymetri/styleguide 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IIAlert/IIAlert.svelte +2 -2
- package/dist/IIAuditTrail/IIAuditTrail.svelte +1 -1
- package/dist/IIButton/IIButton.svelte +31 -32
- package/dist/IIButton/IIButton.svelte.d.ts +2 -1
- package/dist/IIButton/IIButtonStories.svelte +8 -39
- package/dist/IICheckbox/IICheckbox.svelte +1 -1
- package/dist/IICombobox/IICombobox.svelte +2 -2
- package/dist/IIDatePicker/IIDatePicker.svelte +1 -1
- package/dist/IIDropdownInput/IIDropdownInput.svelte +2 -2
- package/dist/IIDropdownMenu/IIDropdownMenu.svelte +1 -1
- package/dist/IIEditableBadges/IIEditableBadges.svelte +1 -1
- package/dist/IIFilterChip/IIFilterChip.svelte +1 -1
- package/dist/IIIcon/IIIcon.svelte +3 -3
- package/dist/IIIcon/IIIcon.svelte.d.ts +1 -1
- package/dist/IIIconButton/IIIconButton.svelte +73 -0
- package/dist/IIIconButton/IIIconButton.svelte.d.ts +14 -0
- package/dist/IIIconButton/IIIconButtonStories.svelte +71 -0
- package/dist/IIIconButton/IIIconButtonStories.svelte.d.ts +18 -0
- package/dist/IIIconButton/index.d.ts +1 -0
- package/dist/IIIconButton/index.js +1 -0
- package/dist/IIModal/IIModal.svelte +1 -1
- package/dist/IIOverflowActions/IIOverflowActions.svelte +1 -1
- package/dist/IIStepper/IIStepper.svelte +1 -1
- package/dist/IITabs/IITabs.svelte +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/style/colors.css +41 -2
- package/dist/style/tailwind/colors.d.ts +29 -0
- package/dist/style/tailwind/colors.js +32 -1
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
)}
|
|
52
52
|
role="alert"
|
|
53
53
|
>
|
|
54
|
-
<IIIcon
|
|
54
|
+
<IIIcon iconName={config.icon} class={cn('size-20 shrink-0 mt-1', config.text)} />
|
|
55
55
|
<div class="flex-auto min-w-0">
|
|
56
56
|
{#if title}
|
|
57
57
|
<p class={cn('text-small-emphasis m-0', config.text)}>{title}</p>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
onclick={handleDismiss}
|
|
68
68
|
aria-label="Dismiss"
|
|
69
69
|
>
|
|
70
|
-
<IIIcon
|
|
70
|
+
<IIIcon iconName="x" class="size-16" />
|
|
71
71
|
</button>
|
|
72
72
|
{/if}
|
|
73
73
|
</div>
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
<div class="flex justify-between items-start mb-4">
|
|
127
127
|
<div class="flex gap-8 items-start">
|
|
128
128
|
<span class="text-secondary flex">
|
|
129
|
-
<IIIcon
|
|
129
|
+
<IIIcon iconName={iconName} class="w-20 h-20" />
|
|
130
130
|
</span>
|
|
131
131
|
<div class="flex-1">
|
|
132
132
|
<div class="text-small-emphasis text-body mb-4">{event.description}</div>
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type {Snippet} from 'svelte'
|
|
3
3
|
import type {HTMLButtonAttributes, HTMLAnchorAttributes} from 'svelte/elements'
|
|
4
|
+
import type {IconName} from '../icons'
|
|
5
|
+
import IIIcon from '../IIIcon/IIIcon.svelte'
|
|
4
6
|
import {cn} from '../utils/cn'
|
|
5
7
|
|
|
6
8
|
type BaseProps = {
|
|
7
9
|
variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'success' | 'accent'
|
|
8
10
|
size?: 'sm' | 'md' | 'lg'
|
|
9
|
-
|
|
11
|
+
iconName?: IconName
|
|
10
12
|
loading?: boolean
|
|
11
13
|
disabled?: boolean
|
|
12
14
|
children?: Snippet
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
let {
|
|
23
25
|
variant = 'primary',
|
|
24
26
|
size = 'md',
|
|
25
|
-
|
|
27
|
+
iconName,
|
|
26
28
|
loading = false,
|
|
27
29
|
disabled = false,
|
|
28
30
|
children,
|
|
@@ -34,20 +36,16 @@
|
|
|
34
36
|
|
|
35
37
|
const isDisabled = $derived(disabled || loading)
|
|
36
38
|
|
|
37
|
-
const baseClasses =
|
|
38
|
-
|
|
39
|
-
'inline-flex items-center justify-center rounded-6 cursor-default transition-colors duration-base ease-in-out no-underline disabled:cursor-not-allowed',
|
|
40
|
-
!iconOnly && 'gap-8 whitespace-nowrap'
|
|
41
|
-
)
|
|
42
|
-
)
|
|
39
|
+
const baseClasses =
|
|
40
|
+
'inline-flex items-center justify-center gap-8 whitespace-nowrap rounded-6 cursor-default transition-colors duration-base ease-in-out no-underline disabled:cursor-not-allowed'
|
|
43
41
|
|
|
44
42
|
const variantClasses = {
|
|
45
|
-
primary: 'bg-primary text-
|
|
46
|
-
secondary: 'bg-
|
|
47
|
-
ghost: 'text-
|
|
48
|
-
danger: 'bg-
|
|
49
|
-
success: 'bg-success text-
|
|
50
|
-
accent: 'bg-accent text-
|
|
43
|
+
primary: 'bg-button-primary text-button-primary border-0 hover:bg-button-primary-hover disabled:bg-button-primary-disabled',
|
|
44
|
+
secondary: 'bg-button-secondary text-button-secondary border border-button-secondary hover:text-button-secondary-hover hover:border-button-secondary-hover disabled:opacity-50',
|
|
45
|
+
ghost: 'text-button-ghost border-0 hover:bg-button-ghost-hover hover:text-button-ghost-hover disabled:opacity-50',
|
|
46
|
+
danger: 'bg-button-danger text-button-danger border-0 hover:bg-button-danger-hover disabled:bg-button-danger-disabled',
|
|
47
|
+
success: 'bg-button-success text-button-success border-0 hover:bg-button-success-hover disabled:bg-button-success-disabled',
|
|
48
|
+
accent: 'bg-button-accent text-button-accent border-0 hover:bg-button-accent-hover disabled:bg-button-accent-disabled',
|
|
51
49
|
} as const
|
|
52
50
|
|
|
53
51
|
const sizeClasses = {
|
|
@@ -56,13 +54,24 @@
|
|
|
56
54
|
lg: 'py-10 px-16 text-large h-32',
|
|
57
55
|
} as const
|
|
58
56
|
|
|
59
|
-
const
|
|
60
|
-
sm: 'w-
|
|
61
|
-
md: 'w-
|
|
62
|
-
lg: 'w-
|
|
57
|
+
const iconSizeClasses = {
|
|
58
|
+
sm: 'w-12 h-12',
|
|
59
|
+
md: 'w-14 h-14',
|
|
60
|
+
lg: 'w-16 h-16',
|
|
63
61
|
} as const
|
|
64
62
|
</script>
|
|
65
63
|
|
|
64
|
+
{#snippet iconContent()}
|
|
65
|
+
{#if loading}
|
|
66
|
+
<span
|
|
67
|
+
class={cn('border-2 border-current border-r-transparent rounded-full animate-spin', iconSizeClasses[size])}
|
|
68
|
+
></span>
|
|
69
|
+
{:else if iconName}
|
|
70
|
+
<IIIcon iconName={iconName} class={iconSizeClasses[size]} />
|
|
71
|
+
{/if}
|
|
72
|
+
{@render children?.()}
|
|
73
|
+
{/snippet}
|
|
74
|
+
|
|
66
75
|
{#if href}
|
|
67
76
|
<a
|
|
68
77
|
bind:this={ref}
|
|
@@ -70,17 +79,12 @@
|
|
|
70
79
|
class={cn(
|
|
71
80
|
baseClasses,
|
|
72
81
|
variantClasses[variant],
|
|
73
|
-
|
|
82
|
+
sizeClasses[size],
|
|
74
83
|
className
|
|
75
84
|
)}
|
|
76
85
|
{...restProps as HTMLAnchorAttributes}
|
|
77
86
|
>
|
|
78
|
-
{
|
|
79
|
-
<span
|
|
80
|
-
class="w-[1em] h-[1em] border-2 border-current border-r-transparent rounded-full animate-spin motion-reduce:animate-none"
|
|
81
|
-
></span>
|
|
82
|
-
{/if}
|
|
83
|
-
{@render children?.()}
|
|
87
|
+
{@render iconContent()}
|
|
84
88
|
</a>
|
|
85
89
|
{:else}
|
|
86
90
|
<button
|
|
@@ -89,16 +93,11 @@
|
|
|
89
93
|
class={cn(
|
|
90
94
|
baseClasses,
|
|
91
95
|
variantClasses[variant],
|
|
92
|
-
|
|
96
|
+
sizeClasses[size],
|
|
93
97
|
className
|
|
94
98
|
)}
|
|
95
99
|
{...restProps as HTMLButtonAttributes}
|
|
96
100
|
>
|
|
97
|
-
{
|
|
98
|
-
<span
|
|
99
|
-
class="w-[1em] h-[1em] border-2 border-current border-r-transparent rounded-full animate-spin motion-reduce:animate-none"
|
|
100
|
-
></span>
|
|
101
|
-
{/if}
|
|
102
|
-
{@render children?.()}
|
|
101
|
+
{@render iconContent()}
|
|
103
102
|
</button>
|
|
104
103
|
{/if}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLButtonAttributes, HTMLAnchorAttributes } from 'svelte/elements';
|
|
3
|
+
import type { IconName } from '../icons';
|
|
3
4
|
type BaseProps = {
|
|
4
5
|
variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'success' | 'accent';
|
|
5
6
|
size?: 'sm' | 'md' | 'lg';
|
|
6
|
-
|
|
7
|
+
iconName?: IconName;
|
|
7
8
|
loading?: boolean;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
children?: Snippet;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import IIButton from './IIButton.svelte'
|
|
3
|
-
import IIIcon from '../IIIcon/IIIcon.svelte'
|
|
4
3
|
|
|
5
4
|
const variants = ['primary', 'secondary', 'ghost', 'danger', 'success', 'accent'] as const
|
|
6
5
|
const sizes = ['sm', 'md', 'lg'] as const
|
|
@@ -39,52 +38,22 @@
|
|
|
39
38
|
<h2 class="text-default-emphasis text-primary mb-8">With Icon</h2>
|
|
40
39
|
<div class="flex items-center gap-8 flex-wrap">
|
|
41
40
|
{#each variants as variant}
|
|
42
|
-
<IIButton {variant}>
|
|
43
|
-
<IIIcon icon="plus" />
|
|
44
|
-
{variant}
|
|
45
|
-
</IIButton>
|
|
41
|
+
<IIButton {variant} iconName="plus">{variant}</IIButton>
|
|
46
42
|
{/each}
|
|
47
43
|
</div>
|
|
48
44
|
<div class="flex items-center gap-8 flex-wrap mt-8">
|
|
49
|
-
<IIButton variant="primary" size="sm"
|
|
50
|
-
<IIButton variant="primary" size="md"
|
|
51
|
-
<IIButton variant="primary" size="lg"
|
|
45
|
+
<IIButton variant="primary" size="sm" iconName="magnifying-glass">Search</IIButton>
|
|
46
|
+
<IIButton variant="primary" size="md" iconName="upload-simple">Upload</IIButton>
|
|
47
|
+
<IIButton variant="primary" size="lg" iconName="paper-plane-tilt">Send</IIButton>
|
|
52
48
|
</div>
|
|
53
49
|
<div class="flex items-center gap-8 flex-wrap mt-8">
|
|
54
|
-
<IIButton variant="danger"
|
|
55
|
-
<IIButton variant="success"
|
|
56
|
-
<IIButton variant="secondary"
|
|
57
|
-
<IIButton variant="ghost"
|
|
50
|
+
<IIButton variant="danger" iconName="trash">Delete</IIButton>
|
|
51
|
+
<IIButton variant="success" iconName="check">Confirm</IIButton>
|
|
52
|
+
<IIButton variant="secondary" iconName="pencil-simple">Edit</IIButton>
|
|
53
|
+
<IIButton variant="ghost" iconName="gear">Settings</IIButton>
|
|
58
54
|
</div>
|
|
59
55
|
</section>
|
|
60
56
|
|
|
61
|
-
<!-- Icon Only -->
|
|
62
|
-
<section>
|
|
63
|
-
<h2 class="text-default-emphasis text-primary mb-8">Icon Only</h2>
|
|
64
|
-
<table class="border-collapse">
|
|
65
|
-
<thead>
|
|
66
|
-
<tr>
|
|
67
|
-
<th class="text-left text-tiny text-secondary pr-16 pb-8"></th>
|
|
68
|
-
{#each sizes as size}
|
|
69
|
-
<th class="text-left text-tiny text-secondary px-8 pb-8">{size}</th>
|
|
70
|
-
{/each}
|
|
71
|
-
</tr>
|
|
72
|
-
</thead>
|
|
73
|
-
<tbody>
|
|
74
|
-
{#each variants as variant}
|
|
75
|
-
<tr>
|
|
76
|
-
<td class="text-tiny text-secondary pr-16 py-8 align-middle">{variant}</td>
|
|
77
|
-
{#each sizes as size}
|
|
78
|
-
<td class="px-8 py-8">
|
|
79
|
-
<IIButton {variant} {size} iconOnly><IIIcon icon="plus" /></IIButton>
|
|
80
|
-
</td>
|
|
81
|
-
{/each}
|
|
82
|
-
</tr>
|
|
83
|
-
{/each}
|
|
84
|
-
</tbody>
|
|
85
|
-
</table>
|
|
86
|
-
</section>
|
|
87
|
-
|
|
88
57
|
<!-- Disabled -->
|
|
89
58
|
<section>
|
|
90
59
|
<h2 class="text-default-emphasis text-primary mb-8">Disabled</h2>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
)}
|
|
51
51
|
>
|
|
52
52
|
{#if checked}
|
|
53
|
-
<IIIcon
|
|
53
|
+
<IIIcon iconName="check" class={size === 'sm' ? 'w-12 h-12 text-white' : 'w-14 h-14 text-white'} />
|
|
54
54
|
{/if}
|
|
55
55
|
</div>
|
|
56
56
|
</Checkbox.Root>
|
|
@@ -137,12 +137,12 @@
|
|
|
137
137
|
{:else if isSimpleItem(item)}
|
|
138
138
|
<span class="flex-1">{item.label}</span>
|
|
139
139
|
{#if selected}
|
|
140
|
-
<IIIcon
|
|
140
|
+
<IIIcon iconName="check" class="w-18 h-18 shrink-0 ml-auto" />
|
|
141
141
|
{/if}
|
|
142
142
|
{:else}
|
|
143
143
|
<span class="flex-1">{getItemValue(item)}</span>
|
|
144
144
|
{#if selected}
|
|
145
|
-
<IIIcon
|
|
145
|
+
<IIIcon iconName="check" class="w-18 h-18 shrink-0 ml-auto" />
|
|
146
146
|
{/if}
|
|
147
147
|
{/if}
|
|
148
148
|
{/snippet}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<DatePicker.Trigger
|
|
33
33
|
class="[all:unset] flex items-center justify-center p-4 ml-auto rounded-4 cursor-default text-secondary transition-all duration-fast hover:bg-gray-100 hover:text-body [&_svg]:w-11 [&_svg]:h-11 motion-reduce:transition-none"
|
|
34
34
|
>
|
|
35
|
-
<IIIcon
|
|
35
|
+
<IIIcon iconName="calendar" />
|
|
36
36
|
</DatePicker.Trigger>
|
|
37
37
|
{/snippet}
|
|
38
38
|
</DatePicker.Input>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<span class={cn('text-small', value !== undefined ? 'text-input-text' : 'text-input-placeholder')}
|
|
62
62
|
>{selectedLabel}</span
|
|
63
63
|
>
|
|
64
|
-
<IIIcon
|
|
64
|
+
<IIIcon iconName="caret-down" class="w-14 h-14 text-secondary shrink-0" />
|
|
65
65
|
</DropdownMenu.Trigger>
|
|
66
66
|
<DropdownMenu.Portal>
|
|
67
67
|
<DropdownMenu.Content
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
>
|
|
87
87
|
<span>{item.label}</span>
|
|
88
88
|
{#if value === item.value}
|
|
89
|
-
<IIIcon
|
|
89
|
+
<IIIcon iconName="check" class="w-14 h-14 text-accent shrink-0" />
|
|
90
90
|
{/if}
|
|
91
91
|
</DropdownMenu.Item>
|
|
92
92
|
{/each}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {icons, type IconName} from '../icons'
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
5
|
+
iconName: IconName
|
|
6
6
|
class?: string
|
|
7
7
|
[key: string]: unknown
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
let {
|
|
10
|
+
let {iconName, class: className = '', ...rest}: Props = $props()
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<svg
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
class={className}
|
|
20
20
|
{...rest}
|
|
21
21
|
>
|
|
22
|
-
{@html icons[
|
|
22
|
+
{@html icons[iconName]}
|
|
23
23
|
</svg>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type {HTMLButtonAttributes} from 'svelte/elements'
|
|
3
|
+
import type {IconName} from '../icons'
|
|
4
|
+
import IIIcon from '../IIIcon/IIIcon.svelte'
|
|
5
|
+
import {cn} from '../utils/cn'
|
|
6
|
+
|
|
7
|
+
type Props = Omit<HTMLButtonAttributes, 'disabled'> & {
|
|
8
|
+
iconName: IconName
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'success' | 'accent'
|
|
10
|
+
size?: 'sm' | 'md' | 'lg'
|
|
11
|
+
loading?: boolean
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
class?: string
|
|
14
|
+
ref?: HTMLButtonElement
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
iconName,
|
|
19
|
+
variant = 'ghost',
|
|
20
|
+
size = 'md',
|
|
21
|
+
loading = false,
|
|
22
|
+
disabled = false,
|
|
23
|
+
class: className,
|
|
24
|
+
ref = $bindable(),
|
|
25
|
+
...restProps
|
|
26
|
+
}: Props = $props()
|
|
27
|
+
|
|
28
|
+
const isDisabled = $derived(disabled || loading)
|
|
29
|
+
|
|
30
|
+
const baseClasses =
|
|
31
|
+
'inline-flex items-center justify-center rounded-6 cursor-default transition-colors duration-base ease-in-out disabled:cursor-not-allowed'
|
|
32
|
+
|
|
33
|
+
const variantClasses = {
|
|
34
|
+
primary:
|
|
35
|
+
'bg-button-primary text-button-primary border-0 hover:bg-button-primary-hover disabled:bg-button-primary-disabled',
|
|
36
|
+
secondary:
|
|
37
|
+
'bg-button-secondary text-button-secondary border border-button-secondary hover:text-button-secondary-hover hover:border-button-secondary-hover disabled:opacity-50',
|
|
38
|
+
ghost: 'text-button-ghost border-0 hover:bg-button-ghost-hover hover:text-button-ghost-hover disabled:opacity-50',
|
|
39
|
+
danger:
|
|
40
|
+
'bg-button-danger text-button-danger border-0 hover:bg-button-danger-hover disabled:bg-button-danger-disabled',
|
|
41
|
+
success:
|
|
42
|
+
'bg-button-success text-button-success border-0 hover:bg-button-success-hover disabled:bg-button-success-disabled',
|
|
43
|
+
accent:
|
|
44
|
+
'bg-button-accent text-button-accent border-0 hover:bg-button-accent-hover disabled:bg-button-accent-disabled',
|
|
45
|
+
} as const
|
|
46
|
+
|
|
47
|
+
const sizeClasses = {
|
|
48
|
+
sm: 'w-24 h-24 p-0',
|
|
49
|
+
md: 'w-28 h-28 p-0',
|
|
50
|
+
lg: 'w-32 h-32 p-0',
|
|
51
|
+
} as const
|
|
52
|
+
|
|
53
|
+
const iconSizeClasses = {
|
|
54
|
+
sm: 'w-12 h-12',
|
|
55
|
+
md: 'w-14 h-14',
|
|
56
|
+
lg: 'w-16 h-16',
|
|
57
|
+
} as const
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<button
|
|
61
|
+
bind:this={ref}
|
|
62
|
+
disabled={isDisabled}
|
|
63
|
+
class={cn(baseClasses, variantClasses[variant], sizeClasses[size], className)}
|
|
64
|
+
{...restProps}
|
|
65
|
+
>
|
|
66
|
+
{#if loading}
|
|
67
|
+
<span
|
|
68
|
+
class={cn('border-2 border-current border-r-transparent rounded-full animate-spin', iconSizeClasses[size])}
|
|
69
|
+
></span>
|
|
70
|
+
{:else}
|
|
71
|
+
<IIIcon {iconName} class={iconSizeClasses[size]} />
|
|
72
|
+
{/if}
|
|
73
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import type { IconName } from '../icons';
|
|
3
|
+
type Props = Omit<HTMLButtonAttributes, 'disabled'> & {
|
|
4
|
+
iconName: IconName;
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'success' | 'accent';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
class?: string;
|
|
10
|
+
ref?: HTMLButtonElement;
|
|
11
|
+
};
|
|
12
|
+
declare const IIIconButton: import("svelte").Component<Props, {}, "ref">;
|
|
13
|
+
type IIIconButton = ReturnType<typeof IIIconButton>;
|
|
14
|
+
export default IIIconButton;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import IIIconButton from './IIIconButton.svelte'
|
|
3
|
+
|
|
4
|
+
const variants = ['primary', 'secondary', 'ghost', 'danger', 'success', 'accent'] as const
|
|
5
|
+
const sizes = ['sm', 'md', 'lg'] as const
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class="flex flex-col gap-32">
|
|
9
|
+
<!-- Variants × Sizes matrix -->
|
|
10
|
+
<section>
|
|
11
|
+
<h2 class="text-default-emphasis text-primary mb-8">Variants × Sizes</h2>
|
|
12
|
+
<table class="border-collapse">
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
<th class="text-left text-tiny text-secondary pr-16 pb-8"></th>
|
|
16
|
+
{#each sizes as size}
|
|
17
|
+
<th class="text-left text-tiny text-secondary px-8 pb-8">{size}</th>
|
|
18
|
+
{/each}
|
|
19
|
+
</tr>
|
|
20
|
+
</thead>
|
|
21
|
+
<tbody>
|
|
22
|
+
{#each variants as variant}
|
|
23
|
+
<tr>
|
|
24
|
+
<td class="text-tiny text-secondary pr-16 py-8 align-middle">{variant}</td>
|
|
25
|
+
{#each sizes as size}
|
|
26
|
+
<td class="px-8 py-8">
|
|
27
|
+
<IIIconButton iconName="plus" {variant} {size} />
|
|
28
|
+
</td>
|
|
29
|
+
{/each}
|
|
30
|
+
</tr>
|
|
31
|
+
{/each}
|
|
32
|
+
</tbody>
|
|
33
|
+
</table>
|
|
34
|
+
</section>
|
|
35
|
+
|
|
36
|
+
<!-- Different Icons -->
|
|
37
|
+
<section>
|
|
38
|
+
<h2 class="text-default-emphasis text-primary mb-8">Common Icons</h2>
|
|
39
|
+
<div class="flex items-center gap-8">
|
|
40
|
+
<IIIconButton iconName="plus" variant="ghost" />
|
|
41
|
+
<IIIconButton iconName="x" variant="ghost" />
|
|
42
|
+
<IIIconButton iconName="pencil-simple" variant="ghost" />
|
|
43
|
+
<IIIconButton iconName="trash" variant="ghost" />
|
|
44
|
+
<IIIconButton iconName="magnifying-glass" variant="ghost" />
|
|
45
|
+
<IIIconButton iconName="gear" variant="ghost" />
|
|
46
|
+
<IIIconButton iconName="dots-three-vertical" variant="ghost" />
|
|
47
|
+
<IIIconButton iconName="funnel" variant="ghost" />
|
|
48
|
+
<IIIconButton iconName="sort-ascending" variant="ghost" />
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<!-- Disabled -->
|
|
53
|
+
<section>
|
|
54
|
+
<h2 class="text-default-emphasis text-primary mb-8">Disabled</h2>
|
|
55
|
+
<div class="flex items-center gap-8">
|
|
56
|
+
{#each variants as variant}
|
|
57
|
+
<IIIconButton iconName="plus" {variant} disabled />
|
|
58
|
+
{/each}
|
|
59
|
+
</div>
|
|
60
|
+
</section>
|
|
61
|
+
|
|
62
|
+
<!-- Loading -->
|
|
63
|
+
<section>
|
|
64
|
+
<h2 class="text-default-emphasis text-primary mb-8">Loading</h2>
|
|
65
|
+
<div class="flex items-center gap-8">
|
|
66
|
+
{#each variants as variant}
|
|
67
|
+
<IIIconButton iconName="plus" {variant} loading />
|
|
68
|
+
{/each}
|
|
69
|
+
</div>
|
|
70
|
+
</section>
|
|
71
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const IIIconButtonStories: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type IIIconButtonStories = InstanceType<typeof IIIconButtonStories>;
|
|
18
|
+
export default IIIconButtonStories;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IIIconButton } from './IIIconButton.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IIIconButton } from './IIIconButton.svelte';
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<Dialog.Close
|
|
60
60
|
class="[all:unset] cursor-default flex items-center justify-center p-4 rounded-4 text-secondary transition-all duration-fast hover:bg-background hover:text-body motion-reduce:transition-none"
|
|
61
61
|
>
|
|
62
|
-
<IIIcon
|
|
62
|
+
<IIIcon iconName="x" class="size-20" />
|
|
63
63
|
</Dialog.Close>
|
|
64
64
|
{/if}
|
|
65
65
|
</div>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<DropdownMenu.Trigger
|
|
70
70
|
class="[all:unset] cursor-default inline-flex items-center justify-center p-4 rounded-4 text-secondary text-h3 transition-all duration-fast hover:bg-background hover:text-body data-[state=open]:bg-background data-[state=open]:text-body motion-reduce:transition-none"
|
|
71
71
|
>
|
|
72
|
-
<IIIcon
|
|
72
|
+
<IIIcon iconName="dots-three-vertical" />
|
|
73
73
|
</DropdownMenu.Trigger>
|
|
74
74
|
<DropdownMenu.Content
|
|
75
75
|
class="min-w-100 bg-surface border border-primary rounded-10 shadow-dropdown p-4 z-12"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
class="[all:unset] inline-flex items-center gap-4 py-4 pr-8 pl-12 border border-primary rounded-10 bg-surface cursor-default transition-all duration-fast hover:border-strong motion-reduce:transition-none"
|
|
73
73
|
>
|
|
74
74
|
<span class="text-small-emphasis text-body">{activeLabel}</span>
|
|
75
|
-
<IIIcon
|
|
75
|
+
<IIIcon iconName="caret-down" class="w-14 h-14 text-secondary shrink-0" />
|
|
76
76
|
</DropdownMenu.Trigger>
|
|
77
77
|
<DropdownMenu.Content
|
|
78
78
|
class="min-w-100 bg-surface border border-primary rounded-10 shadow-dropdown p-4 z-12"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
>
|
|
91
91
|
<span>{tab.label}</span>
|
|
92
92
|
{#if value === tab.value}
|
|
93
|
-
<IIIcon
|
|
93
|
+
<IIIcon iconName="check" class="w-14 h-14 text-accent shrink-0" />
|
|
94
94
|
{/if}
|
|
95
95
|
</DropdownMenu.Item>
|
|
96
96
|
{/each}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { IIEmptyState } from './IIEmptyState';
|
|
|
17
17
|
export { IIFilterChip } from './IIFilterChip';
|
|
18
18
|
export { IIFormField } from './IIFormField';
|
|
19
19
|
export { IIIcon } from './IIIcon';
|
|
20
|
+
export { IIIconButton } from './IIIconButton';
|
|
20
21
|
export { IIInput } from './IIInput';
|
|
21
22
|
export { IIModal } from './IIModal';
|
|
22
23
|
export { IIOverflowActions } from './IIOverflowActions';
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { IIEmptyState } from './IIEmptyState';
|
|
|
19
19
|
export { IIFilterChip } from './IIFilterChip';
|
|
20
20
|
export { IIFormField } from './IIFormField';
|
|
21
21
|
export { IIIcon } from './IIIcon';
|
|
22
|
+
export { IIIconButton } from './IIIconButton';
|
|
22
23
|
export { IIInput } from './IIInput';
|
|
23
24
|
export { IIModal } from './IIModal';
|
|
24
25
|
export { IIOverflowActions } from './IIOverflowActions';
|
package/dist/style/colors.css
CHANGED
|
@@ -82,8 +82,47 @@
|
|
|
82
82
|
--color-dropdown-item-text: var(--ii-text-primary);
|
|
83
83
|
--color-dropdown-item-text-selected: var(--ii-text-primary);
|
|
84
84
|
|
|
85
|
-
/* Buttons */
|
|
86
|
-
--
|
|
85
|
+
/* Buttons — primary */
|
|
86
|
+
--color-button-primary-bg: var(--ii-primary);
|
|
87
|
+
--color-button-primary-bg-hover: var(--ii-primary-hover);
|
|
88
|
+
--color-button-primary-bg-disabled: var(--ii-border-strong);
|
|
89
|
+
--color-button-primary-text: var(--ii-text-inverse);
|
|
90
|
+
--color-button-primary-text-disabled: var(--ii-text-tertiary);
|
|
91
|
+
|
|
92
|
+
/* Buttons — secondary */
|
|
93
|
+
--color-button-secondary-bg: var(--ii-surface);
|
|
94
|
+
--color-button-secondary-text: #4b5563;
|
|
95
|
+
--color-button-secondary-text-hover: #1f2937;
|
|
96
|
+
--color-button-secondary-text-disabled: var(--ii-text-tertiary);
|
|
97
|
+
--color-button-secondary-border: var(--ii-border);
|
|
98
|
+
--color-button-secondary-border-hover: var(--ii-border-strong);
|
|
99
|
+
|
|
100
|
+
/* Buttons — ghost */
|
|
101
|
+
--color-button-ghost-bg-hover: #eef0f3;
|
|
102
|
+
--color-button-ghost-text: #6b7280;
|
|
103
|
+
--color-button-ghost-text-hover: #111827;
|
|
104
|
+
--color-button-ghost-text-disabled: var(--ii-text-tertiary);
|
|
105
|
+
|
|
106
|
+
/* Buttons — danger */
|
|
107
|
+
--color-button-danger-bg: var(--ii-error);
|
|
108
|
+
--color-button-danger-bg-hover: var(--ii-error-text);
|
|
109
|
+
--color-button-danger-bg-disabled: var(--ii-border-strong);
|
|
110
|
+
--color-button-danger-text: var(--ii-text-inverse);
|
|
111
|
+
--color-button-danger-text-disabled: var(--ii-text-tertiary);
|
|
112
|
+
|
|
113
|
+
/* Buttons — success */
|
|
114
|
+
--color-button-success-bg: var(--ii-success);
|
|
115
|
+
--color-button-success-bg-hover: var(--ii-success-text);
|
|
116
|
+
--color-button-success-bg-disabled: var(--ii-border-strong);
|
|
117
|
+
--color-button-success-text: var(--ii-text-inverse);
|
|
118
|
+
--color-button-success-text-disabled: var(--ii-text-tertiary);
|
|
119
|
+
|
|
120
|
+
/* Buttons — accent */
|
|
121
|
+
--color-button-accent-bg: var(--ii-accent);
|
|
122
|
+
--color-button-accent-bg-hover: var(--ii-accent-hover);
|
|
123
|
+
--color-button-accent-bg-disabled: var(--ii-border-strong);
|
|
124
|
+
--color-button-accent-text: var(--ii-text-on-accent);
|
|
125
|
+
--color-button-accent-text-disabled: var(--ii-text-tertiary);
|
|
87
126
|
|
|
88
127
|
/* Badge variants */
|
|
89
128
|
--ii-badge-grey-bg: rgba(107, 114, 128, 0.1);
|
|
@@ -60,7 +60,20 @@ export declare const backgroundColor: {
|
|
|
60
60
|
'dropdown-bg': string;
|
|
61
61
|
'dropdown-item-hover': string;
|
|
62
62
|
'dropdown-item-selected': string;
|
|
63
|
+
'button-primary': string;
|
|
64
|
+
'button-primary-hover': string;
|
|
65
|
+
'button-primary-disabled': string;
|
|
66
|
+
'button-secondary': string;
|
|
63
67
|
'button-ghost-hover': string;
|
|
68
|
+
'button-danger': string;
|
|
69
|
+
'button-danger-hover': string;
|
|
70
|
+
'button-danger-disabled': string;
|
|
71
|
+
'button-success': string;
|
|
72
|
+
'button-success-hover': string;
|
|
73
|
+
'button-success-disabled': string;
|
|
74
|
+
'button-accent': string;
|
|
75
|
+
'button-accent-hover': string;
|
|
76
|
+
'button-accent-disabled': string;
|
|
64
77
|
overlay: string;
|
|
65
78
|
'overlay-light': string;
|
|
66
79
|
'overlay-heavy': string;
|
|
@@ -117,6 +130,20 @@ export declare const textColor: {
|
|
|
117
130
|
'muted-strong': string;
|
|
118
131
|
accent: string;
|
|
119
132
|
'accent-hover': string;
|
|
133
|
+
'button-primary': string;
|
|
134
|
+
'button-primary-disabled': string;
|
|
135
|
+
'button-secondary': string;
|
|
136
|
+
'button-secondary-hover': string;
|
|
137
|
+
'button-secondary-disabled': string;
|
|
138
|
+
'button-ghost': string;
|
|
139
|
+
'button-ghost-hover': string;
|
|
140
|
+
'button-ghost-disabled': string;
|
|
141
|
+
'button-danger': string;
|
|
142
|
+
'button-danger-disabled': string;
|
|
143
|
+
'button-success': string;
|
|
144
|
+
'button-success-disabled': string;
|
|
145
|
+
'button-accent': string;
|
|
146
|
+
'button-accent-disabled': string;
|
|
120
147
|
success: string;
|
|
121
148
|
'success-dark': string;
|
|
122
149
|
'success-dark-alt': string;
|
|
@@ -165,6 +192,8 @@ export declare const borderColor: {
|
|
|
165
192
|
primary: string;
|
|
166
193
|
strong: string;
|
|
167
194
|
subtle: string;
|
|
195
|
+
'button-secondary': string;
|
|
196
|
+
'button-secondary-hover': string;
|
|
168
197
|
'input-border': string;
|
|
169
198
|
'input-border-hover': string;
|
|
170
199
|
'input-border-active': string;
|
|
@@ -90,7 +90,20 @@ export const backgroundColor = {
|
|
|
90
90
|
'dropdown-item-hover': 'var(--color-dropdown-item-bg-hover)',
|
|
91
91
|
'dropdown-item-selected': 'var(--color-dropdown-item-bg-selected)',
|
|
92
92
|
// Button
|
|
93
|
-
'button-
|
|
93
|
+
'button-primary': 'var(--color-button-primary-bg)',
|
|
94
|
+
'button-primary-hover': 'var(--color-button-primary-bg-hover)',
|
|
95
|
+
'button-primary-disabled': 'var(--color-button-primary-bg-disabled)',
|
|
96
|
+
'button-secondary': 'var(--color-button-secondary-bg)',
|
|
97
|
+
'button-ghost-hover': 'var(--color-button-ghost-bg-hover)',
|
|
98
|
+
'button-danger': 'var(--color-button-danger-bg)',
|
|
99
|
+
'button-danger-hover': 'var(--color-button-danger-bg-hover)',
|
|
100
|
+
'button-danger-disabled': 'var(--color-button-danger-bg-disabled)',
|
|
101
|
+
'button-success': 'var(--color-button-success-bg)',
|
|
102
|
+
'button-success-hover': 'var(--color-button-success-bg-hover)',
|
|
103
|
+
'button-success-disabled': 'var(--color-button-success-bg-disabled)',
|
|
104
|
+
'button-accent': 'var(--color-button-accent-bg)',
|
|
105
|
+
'button-accent-hover': 'var(--color-button-accent-bg-hover)',
|
|
106
|
+
'button-accent-disabled': 'var(--color-button-accent-bg-disabled)',
|
|
94
107
|
// Overlay
|
|
95
108
|
overlay: 'var(--ii-overlay)',
|
|
96
109
|
'overlay-light': 'var(--ii-overlay-light)',
|
|
@@ -146,6 +159,21 @@ export const textColor = {
|
|
|
146
159
|
// Brand on text (canonical names for new code)
|
|
147
160
|
accent: 'var(--ii-text-primary)',
|
|
148
161
|
'accent-hover': 'var(--ii-primary-hover)',
|
|
162
|
+
// Button
|
|
163
|
+
'button-primary': 'var(--color-button-primary-text)',
|
|
164
|
+
'button-primary-disabled': 'var(--color-button-primary-text-disabled)',
|
|
165
|
+
'button-secondary': 'var(--color-button-secondary-text)',
|
|
166
|
+
'button-secondary-hover': 'var(--color-button-secondary-text-hover)',
|
|
167
|
+
'button-secondary-disabled': 'var(--color-button-secondary-text-disabled)',
|
|
168
|
+
'button-ghost': 'var(--color-button-ghost-text)',
|
|
169
|
+
'button-ghost-hover': 'var(--color-button-ghost-text-hover)',
|
|
170
|
+
'button-ghost-disabled': 'var(--color-button-ghost-text-disabled)',
|
|
171
|
+
'button-danger': 'var(--color-button-danger-text)',
|
|
172
|
+
'button-danger-disabled': 'var(--color-button-danger-text-disabled)',
|
|
173
|
+
'button-success': 'var(--color-button-success-text)',
|
|
174
|
+
'button-success-disabled': 'var(--color-button-success-text-disabled)',
|
|
175
|
+
'button-accent': 'var(--color-button-accent-text)',
|
|
176
|
+
'button-accent-disabled': 'var(--color-button-accent-text-disabled)',
|
|
149
177
|
// Semantic
|
|
150
178
|
success: 'var(--ii-success-text)',
|
|
151
179
|
'success-dark': 'var(--ii-success-dark)',
|
|
@@ -189,6 +217,9 @@ export const borderColor = {
|
|
|
189
217
|
primary: 'var(--ii-border)',
|
|
190
218
|
strong: 'var(--ii-border-strong)',
|
|
191
219
|
subtle: 'var(--ii-border-subtle)',
|
|
220
|
+
// Button
|
|
221
|
+
'button-secondary': 'var(--color-button-secondary-border)',
|
|
222
|
+
'button-secondary-hover': 'var(--color-button-secondary-border-hover)',
|
|
192
223
|
// Input
|
|
193
224
|
'input-border': 'var(--color-input-border)',
|
|
194
225
|
'input-border-hover': 'var(--color-input-border-hover)',
|