@reshape-biotech/design-system 2.2.0 → 2.2.2
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/components/button/Button.svelte +5 -4
- package/dist/components/button/Button.svelte.d.ts +2 -1
- package/dist/components/combobox/components/combobox-content.svelte +35 -20
- package/dist/components/combobox/types.d.ts +2 -0
- package/dist/components/icon-button/IconButton.svelte +17 -16
- package/dist/components/icons/index.d.ts +5 -0
- package/dist/components/icons/index.js +1 -1
- package/dist/components/input/Input.svelte +39 -21
- package/dist/components/input/Input.svelte.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
| 'secondary-inverse'
|
|
9
9
|
| 'transparent-inverse';
|
|
10
10
|
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
11
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
<script lang="ts">
|
|
14
15
|
import Spinner from '../spinner/Spinner.svelte';
|
|
15
16
|
import type { Snippet } from 'svelte';
|
|
16
17
|
|
|
17
|
-
interface Props {
|
|
18
|
+
interface Props extends HTMLButtonAttributes {
|
|
18
19
|
class?: string;
|
|
19
20
|
onClick?: (event?: MouseEvent) => void;
|
|
20
21
|
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
children,
|
|
45
46
|
dataTestId = undefined,
|
|
46
47
|
rounded = false,
|
|
48
|
+
...rest
|
|
47
49
|
}: Props = $props();
|
|
48
50
|
|
|
49
51
|
let variantClass = $derived(`btn-${variant}`);
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
data-testid={dataTestId}
|
|
69
71
|
class:rounded
|
|
70
72
|
class:disabled
|
|
73
|
+
{...rest}
|
|
71
74
|
>
|
|
72
75
|
{#if loading}
|
|
73
76
|
<Spinner />
|
|
@@ -225,9 +228,7 @@
|
|
|
225
228
|
|
|
226
229
|
background-color: transparent;
|
|
227
230
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
color: rgb(18 25 42 / var(--tw-text-opacity, 1))
|
|
231
|
+
color: inherit
|
|
231
232
|
}
|
|
232
233
|
.btn-transparent:hover {
|
|
233
234
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type ButtonVariant = 'primary' | 'secondary' | 'transparent' | 'danger' | 'outline' | 'secondary-inverse' | 'transparent-inverse';
|
|
2
2
|
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
|
-
interface Props {
|
|
5
|
+
interface Props extends HTMLButtonAttributes {
|
|
5
6
|
class?: string;
|
|
6
7
|
onClick?: (event?: MouseEvent) => void;
|
|
7
8
|
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Combobox } from 'bits-ui';
|
|
3
3
|
import type { ComboboxContentProps } from '../types';
|
|
4
4
|
import { Icon } from '../../icons';
|
|
5
|
+
import { fade } from 'svelte/transition';
|
|
5
6
|
|
|
6
7
|
let {
|
|
7
8
|
children,
|
|
@@ -10,27 +11,41 @@
|
|
|
10
11
|
portalled = true,
|
|
11
12
|
header,
|
|
12
13
|
footer,
|
|
14
|
+
paddedContent = true,
|
|
15
|
+
fadeDuration = 0,
|
|
13
16
|
...props
|
|
14
17
|
}: ComboboxContentProps = $props();
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
20
|
{#snippet content()}
|
|
18
|
-
<Combobox.Content {...props} class={className}>
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
<Combobox.Content {...props} class={className} forceMount>
|
|
22
|
+
{#snippet child({ wrapperProps, props, open })}
|
|
23
|
+
{#snippet content()}
|
|
24
|
+
{@render header?.()}
|
|
25
|
+
{#if showScroll}
|
|
26
|
+
<Combobox.ScrollUpButton class="flex justify-center">
|
|
27
|
+
<Icon iconName="CaretUp" />
|
|
28
|
+
</Combobox.ScrollUpButton>
|
|
29
|
+
<Combobox.Viewport class={paddedContent ? 'p-1' : ''}>
|
|
30
|
+
{@render children()}
|
|
31
|
+
</Combobox.Viewport>
|
|
32
|
+
<Combobox.ScrollDownButton class="flex justify-center">
|
|
33
|
+
<Icon iconName="CaretDown" />
|
|
34
|
+
</Combobox.ScrollDownButton>
|
|
35
|
+
{:else}
|
|
36
|
+
{@render children()}
|
|
37
|
+
{/if}
|
|
38
|
+
{@render footer?.()}
|
|
39
|
+
{/snippet}
|
|
40
|
+
|
|
41
|
+
{#if open}
|
|
42
|
+
<div {...wrapperProps}>
|
|
43
|
+
<div {...props} transition:fade={{ duration: fadeDuration }}>
|
|
44
|
+
{@render content()}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
{/if}
|
|
48
|
+
{/snippet}
|
|
34
49
|
</Combobox.Content>
|
|
35
50
|
{/snippet}
|
|
36
51
|
|
|
@@ -45,19 +60,19 @@
|
|
|
45
60
|
<style>
|
|
46
61
|
:global([data-combobox-content]) {
|
|
47
62
|
|
|
63
|
+
z-index: 1;
|
|
64
|
+
|
|
48
65
|
width: 100%;
|
|
49
66
|
|
|
50
67
|
border-radius: 0.75rem;
|
|
51
68
|
|
|
52
|
-
border-width: 1px;
|
|
53
|
-
|
|
54
69
|
--tw-bg-opacity: 1;
|
|
55
70
|
|
|
56
71
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
57
72
|
|
|
58
|
-
--tw-shadow: 0 4px
|
|
73
|
+
--tw-shadow: 0 4px 20px 0 rgba(18, 25, 42, 0.06), 0 0 0 1px rgba(18, 25, 42, 0.08);
|
|
59
74
|
|
|
60
|
-
--tw-shadow-colored: 0 4px
|
|
75
|
+
--tw-shadow-colored: 0 4px 20px 0 var(--tw-shadow-color), 0 0 0 1px var(--tw-shadow-color);
|
|
61
76
|
|
|
62
77
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
63
78
|
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
<style>
|
|
76
76
|
button {
|
|
77
77
|
display: flex;
|
|
78
|
+
flex-shrink: 0;
|
|
78
79
|
cursor: pointer;
|
|
79
80
|
align-items: center;
|
|
80
81
|
justify-content: center;
|
|
@@ -94,39 +95,39 @@
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
.size-xs {
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
width: 1.5rem;
|
|
99
|
+
height: 1.5rem
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
.size-xs :global(svg) {
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
width: 1rem;
|
|
104
|
+
height: 1rem
|
|
104
105
|
}
|
|
105
106
|
.size-sm {
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
width: 2rem;
|
|
108
|
+
height: 2rem
|
|
108
109
|
}
|
|
109
110
|
.size-sm :global(svg) {
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
width: 1rem;
|
|
112
|
+
height: 1rem
|
|
112
113
|
}
|
|
113
114
|
.size-md {
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
width: 2.5rem;
|
|
116
|
+
height: 2.5rem
|
|
116
117
|
}
|
|
117
118
|
.size-md :global(svg) {
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
width: 1.25rem;
|
|
120
|
+
height: 1.25rem
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
.size-lg {
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
width: 3rem;
|
|
125
|
+
height: 3rem
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
.size-lg :global(svg) {
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
width: 1.5rem;
|
|
130
|
+
height: 1.5rem
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
.color-primary {
|
|
@@ -9,6 +9,11 @@ export type BackgroundClass = `bg-${keyof typeof backgroundColor}`;
|
|
|
9
9
|
export type IconColor = keyof typeof textColor;
|
|
10
10
|
export type SupportedAnalysisModelIcons = 'pipeline_halos' | 'pipeline_large_colonies' | 'pipeline_microbial_colonies' | 'pipeline_small_colonies' | 'sgs_enteros' | 'general_germination_rate_with_tracking' | 'general_germination_rate_without_tracking' | 'pipeline_insects' | 'pipeline_colony_formation' | 'pipeline_radial_growth' | 'syngenta_health_score_crw' | 'pipeline_seed_germination' | 'syngenta_health_score_faw' | 'syngenta_health_score_sbl' | 'unilever_cfu_count_lowres';
|
|
11
11
|
export type SupportedPrincipalIcons = 'user' | 'group' | 'organization';
|
|
12
|
+
export interface IconComponentProps {
|
|
13
|
+
size?: number | string;
|
|
14
|
+
color?: string;
|
|
15
|
+
weight?: 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
|
|
16
|
+
}
|
|
12
17
|
export { default as Icon } from './Icon.svelte';
|
|
13
18
|
export type IconProps = {
|
|
14
19
|
iconName: IconName;
|
|
@@ -60,7 +60,6 @@ import House from 'phosphor-svelte/lib/House';
|
|
|
60
60
|
import ImageSquare from 'phosphor-svelte/lib/ImageSquare';
|
|
61
61
|
import ImagesSquare from 'phosphor-svelte/lib/ImagesSquare';
|
|
62
62
|
import Info from 'phosphor-svelte/lib/Info';
|
|
63
|
-
import Link from 'phosphor-svelte/lib/Link';
|
|
64
63
|
import Lock from 'phosphor-svelte/lib/Lock';
|
|
65
64
|
import LineSegments from 'phosphor-svelte/lib/LineSegments';
|
|
66
65
|
import List from 'phosphor-svelte/lib/List';
|
|
@@ -102,6 +101,7 @@ import Stop from 'phosphor-svelte/lib/Stop';
|
|
|
102
101
|
import StopCircle from 'phosphor-svelte/lib/StopCircle';
|
|
103
102
|
import Sun from 'phosphor-svelte/lib/Sun';
|
|
104
103
|
import Table from 'phosphor-svelte/lib/Table';
|
|
104
|
+
import Link from 'phosphor-svelte/lib/Link';
|
|
105
105
|
import Tag from 'phosphor-svelte/lib/Tag';
|
|
106
106
|
import Target from 'phosphor-svelte/lib/Target';
|
|
107
107
|
import TestTube from 'phosphor-svelte/lib/TestTube';
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
interface InputProps extends Omit<HTMLInputAttributes, 'size' | 'prefix' | 'suffix'> {
|
|
8
8
|
label?: string | null;
|
|
9
9
|
id?: string | undefined;
|
|
10
|
+
variant?: 'default' | 'transparent' | 'borderless';
|
|
10
11
|
validator?: (a: string | number) => boolean;
|
|
11
12
|
prefix?: Snippet<[any]>;
|
|
12
13
|
suffix?: Snippet;
|
|
13
14
|
error?: Snippet;
|
|
14
15
|
input?: HTMLInputElement;
|
|
15
16
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'dynamic';
|
|
16
|
-
transparent?: boolean;
|
|
17
17
|
clearable?: boolean;
|
|
18
18
|
onclear?: () => void;
|
|
19
19
|
class?: string;
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
let {
|
|
25
25
|
label = null,
|
|
26
|
+
variant = 'default',
|
|
26
27
|
value = $bindable(),
|
|
27
28
|
type = 'text',
|
|
28
29
|
validator = (_) => {
|
|
@@ -33,7 +34,6 @@
|
|
|
33
34
|
error,
|
|
34
35
|
input = $bindable(),
|
|
35
36
|
size = 'md',
|
|
36
|
-
transparent = false,
|
|
37
37
|
clearable = false,
|
|
38
38
|
onclear = () => {},
|
|
39
39
|
class: className,
|
|
@@ -75,9 +75,10 @@
|
|
|
75
75
|
|
|
76
76
|
<div
|
|
77
77
|
class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface shadow-input size-{size}"
|
|
78
|
-
class:border-transparent={transparent}
|
|
79
|
-
class:shadow-input={!transparent}
|
|
78
|
+
class:border-transparent={variant === 'transparent'}
|
|
79
|
+
class:shadow-input={!(variant === 'transparent')}
|
|
80
80
|
class:!border-error={!valid}
|
|
81
|
+
class:borderless={variant === 'borderless'}
|
|
81
82
|
>
|
|
82
83
|
<div class="whitespace-nowrap text-secondary">
|
|
83
84
|
{@render prefix?.({ valid })}
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
{#if clearable && value}
|
|
103
104
|
<IconButton
|
|
104
105
|
variant="transparent"
|
|
106
|
+
rounded={false}
|
|
105
107
|
size="xs"
|
|
106
108
|
onclick={() => {
|
|
107
109
|
value = '';
|
|
@@ -124,6 +126,8 @@
|
|
|
124
126
|
|
|
125
127
|
resize: none;
|
|
126
128
|
|
|
129
|
+
padding: 0.25rem;
|
|
130
|
+
|
|
127
131
|
outline: 2px solid transparent;
|
|
128
132
|
|
|
129
133
|
outline-offset: 2px
|
|
@@ -141,11 +145,37 @@
|
|
|
141
145
|
border-color: rgb(87 80 238 / var(--tw-border-opacity, 1))
|
|
142
146
|
}
|
|
143
147
|
|
|
148
|
+
.borderless {
|
|
149
|
+
|
|
150
|
+
border-style: none;
|
|
151
|
+
|
|
152
|
+
--tw-shadow: 0 0 #0000;
|
|
153
|
+
|
|
154
|
+
--tw-shadow-colored: 0 0 #0000;
|
|
155
|
+
|
|
156
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.borderless input {
|
|
160
|
+
|
|
161
|
+
border-style: none;
|
|
162
|
+
|
|
163
|
+
outline: 2px solid transparent;
|
|
164
|
+
|
|
165
|
+
outline-offset: 2px;
|
|
166
|
+
|
|
167
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
168
|
+
|
|
169
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
170
|
+
|
|
171
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)
|
|
172
|
+
}
|
|
173
|
+
|
|
144
174
|
.size-xs {
|
|
145
175
|
|
|
146
176
|
height: 1.5rem;
|
|
147
177
|
|
|
148
|
-
padding: 0.
|
|
178
|
+
padding: 0.25rem;
|
|
149
179
|
|
|
150
180
|
font-size: 0.75rem;
|
|
151
181
|
|
|
@@ -156,35 +186,23 @@
|
|
|
156
186
|
|
|
157
187
|
height: 2rem;
|
|
158
188
|
|
|
159
|
-
padding
|
|
160
|
-
|
|
161
|
-
padding-right: 0.75rem;
|
|
162
|
-
|
|
163
|
-
padding-top: 0.5rem;
|
|
164
|
-
|
|
165
|
-
padding-bottom: 0.5rem
|
|
189
|
+
padding: 0.25rem
|
|
166
190
|
}
|
|
167
191
|
|
|
168
192
|
.size-md {
|
|
169
193
|
|
|
170
194
|
height: 2.5rem;
|
|
171
195
|
|
|
172
|
-
padding
|
|
173
|
-
|
|
174
|
-
padding-right: 0.75rem;
|
|
175
|
-
|
|
176
|
-
padding-top: 0.5rem;
|
|
177
|
-
|
|
178
|
-
padding-bottom: 0.5rem
|
|
196
|
+
padding: 0.5rem
|
|
179
197
|
}
|
|
180
198
|
|
|
181
199
|
.size-lg {
|
|
182
200
|
|
|
183
201
|
height: 3rem;
|
|
184
202
|
|
|
185
|
-
padding-left: 0.
|
|
203
|
+
padding-left: 0.5rem;
|
|
186
204
|
|
|
187
|
-
padding-right: 0.
|
|
205
|
+
padding-right: 0.5rem;
|
|
188
206
|
|
|
189
207
|
padding-top: 0.75rem;
|
|
190
208
|
|
|
@@ -3,13 +3,13 @@ import type { HTMLInputAttributes } from 'svelte/elements';
|
|
|
3
3
|
interface InputProps extends Omit<HTMLInputAttributes, 'size' | 'prefix' | 'suffix'> {
|
|
4
4
|
label?: string | null;
|
|
5
5
|
id?: string | undefined;
|
|
6
|
+
variant?: 'default' | 'transparent' | 'borderless';
|
|
6
7
|
validator?: (a: string | number) => boolean;
|
|
7
8
|
prefix?: Snippet<[any]>;
|
|
8
9
|
suffix?: Snippet;
|
|
9
10
|
error?: Snippet;
|
|
10
11
|
input?: HTMLInputElement;
|
|
11
12
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'dynamic';
|
|
12
|
-
transparent?: boolean;
|
|
13
13
|
clearable?: boolean;
|
|
14
14
|
onclear?: () => void;
|
|
15
15
|
class?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export * from './components/pill/';
|
|
|
27
27
|
export * from './components/progress-circle/';
|
|
28
28
|
export * from './components/required-status-indicator/';
|
|
29
29
|
export * from './components/segmented-control-buttons/';
|
|
30
|
-
export * from './components/select/';
|
|
30
|
+
export * as Select from './components/select/';
|
|
31
31
|
export * from './components/skeleton-loader/';
|
|
32
32
|
export * from './components/slider/';
|
|
33
33
|
export * from './components/spinner/';
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export * from './components/pill/';
|
|
|
28
28
|
export * from './components/progress-circle/';
|
|
29
29
|
export * from './components/required-status-indicator/';
|
|
30
30
|
export * from './components/segmented-control-buttons/';
|
|
31
|
-
export * from './components/select/';
|
|
31
|
+
export * as Select from './components/select/';
|
|
32
32
|
export * from './components/skeleton-loader/';
|
|
33
33
|
export * from './components/slider/';
|
|
34
34
|
export * from './components/spinner/';
|