@reshape-biotech/design-system 2.6.1 → 2.6.3
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/card/Card.svelte +12 -3
- package/dist/components/card/Card.svelte.d.ts +1 -0
- package/dist/components/card/CardWrapper.svelte +96 -0
- package/dist/components/card/CardWrapper.svelte.d.ts +11 -0
- package/dist/components/collapsible/components/collapsible-trigger.svelte +1 -1
- package/dist/components/icons/index.d.ts +2 -2
- package/dist/components/icons/index.js +3 -0
- package/dist/components/select/components/Group.svelte +10 -2
- package/dist/components/select/components/Group.svelte.d.ts +1 -0
- package/dist/components/stat-card/StatCard.svelte +5 -1
- package/dist/components/stat-card/StatCard.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,12 +6,21 @@
|
|
|
6
6
|
children: Snippet;
|
|
7
7
|
headerBorder?: boolean;
|
|
8
8
|
class?: string;
|
|
9
|
+
variant?: 'full-width' | 'content-width';
|
|
9
10
|
};
|
|
10
11
|
|
|
11
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
Header,
|
|
14
|
+
children,
|
|
15
|
+
headerBorder = false,
|
|
16
|
+
class: additionalClasses = '',
|
|
17
|
+
variant = 'content-width',
|
|
18
|
+
}: Props = $props();
|
|
12
19
|
</script>
|
|
13
20
|
|
|
14
|
-
<div
|
|
21
|
+
<div
|
|
22
|
+
class="overflow-hidden rounded-xl border border-static bg-surface shadow-container {additionalClasses}"
|
|
23
|
+
>
|
|
15
24
|
{#if Header}
|
|
16
25
|
<header
|
|
17
26
|
class="flex h-12 items-center px-4"
|
|
@@ -22,7 +31,7 @@
|
|
|
22
31
|
</header>
|
|
23
32
|
{/if}
|
|
24
33
|
{#if children}
|
|
25
|
-
<div class=
|
|
34
|
+
<div class={variant === 'full-width' ? '' : 'p-4 pb-5'}>
|
|
26
35
|
{@render children()}
|
|
27
36
|
</div>
|
|
28
37
|
{/if}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
Header?: Snippet;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
Footer?: Snippet;
|
|
8
|
+
class?: string;
|
|
9
|
+
variant?: 'default' | 'compact';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
Header,
|
|
14
|
+
children,
|
|
15
|
+
Footer,
|
|
16
|
+
class: additionalClasses = '',
|
|
17
|
+
variant = 'default',
|
|
18
|
+
}: Props = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class="wrapper {variant} {additionalClasses}">
|
|
22
|
+
{#if Header}
|
|
23
|
+
<header class="wrapper-header">
|
|
24
|
+
{@render Header()}
|
|
25
|
+
</header>
|
|
26
|
+
{/if}
|
|
27
|
+
<div class="flex w-full !overflow-hidden [&>*]:w-full [&>*]:rounded-xl">
|
|
28
|
+
{@render children()}
|
|
29
|
+
</div>
|
|
30
|
+
{#if Footer}
|
|
31
|
+
<footer class="wrapper-footer">
|
|
32
|
+
{@render Footer()}
|
|
33
|
+
</footer>
|
|
34
|
+
{/if}
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
.wrapper {
|
|
39
|
+
|
|
40
|
+
display: flex;
|
|
41
|
+
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
|
|
44
|
+
border-radius: 1rem;
|
|
45
|
+
|
|
46
|
+
--tw-bg-opacity: 1;
|
|
47
|
+
|
|
48
|
+
background-color: rgb(251 251 251 / var(--tw-bg-opacity, 1))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.wrapper.default {
|
|
52
|
+
|
|
53
|
+
gap: 0.25rem;
|
|
54
|
+
|
|
55
|
+
padding: 0.25rem
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.wrapper.compact {
|
|
59
|
+
|
|
60
|
+
gap: 0.125rem;
|
|
61
|
+
|
|
62
|
+
padding: 0.125rem
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.wrapper-header {
|
|
66
|
+
|
|
67
|
+
display: flex;
|
|
68
|
+
|
|
69
|
+
min-height: 2rem;
|
|
70
|
+
|
|
71
|
+
width: 100%;
|
|
72
|
+
|
|
73
|
+
align-items: center;
|
|
74
|
+
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
|
|
77
|
+
padding-left: 1rem;
|
|
78
|
+
|
|
79
|
+
padding-right: 1rem
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.wrapper-footer {
|
|
83
|
+
|
|
84
|
+
display: flex;
|
|
85
|
+
|
|
86
|
+
min-height: 2.5rem;
|
|
87
|
+
|
|
88
|
+
width: 100%;
|
|
89
|
+
|
|
90
|
+
align-items: center;
|
|
91
|
+
|
|
92
|
+
padding-left: 1rem;
|
|
93
|
+
|
|
94
|
+
padding-right: 1rem
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Props = {
|
|
3
|
+
Header?: Snippet;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
Footer?: Snippet;
|
|
6
|
+
class?: string;
|
|
7
|
+
variant?: 'default' | 'compact';
|
|
8
|
+
};
|
|
9
|
+
declare const CardWrapper: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type CardWrapper = ReturnType<typeof CardWrapper>;
|
|
11
|
+
export default CardWrapper;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IconComponentProps } from 'phosphor-svelte';
|
|
2
2
|
import type { Component } from 'svelte';
|
|
3
3
|
import type { textColor, backgroundColor } from './../../tokens';
|
|
4
4
|
export * from './custom';
|
|
5
5
|
import type { CustomIconName } from './custom';
|
|
6
6
|
export type PhosphorIconProps = Component<IconComponentProps, object, ''>;
|
|
7
|
-
export type IconName = 'Aperture' | 'Archive' | 'ArrowFatLineRight' | 'ArrowCounterClockwise' | 'ArrowRight' | 'ArrowUpRight' | 'ArrowUpLeft' | 'ArrowUUpLeft' | 'Barcode' | 'Bell' | 'BookOpen' | 'BookOpenText' | 'BowlingBall' | 'BugBeetle' | 'Calendar' | 'CalendarBlank' | 'Camera' | 'CameraSlash' | 'CaretDown' | 'CaretLeft' | 'CaretRight' | 'CaretUp' | 'CaretUpDown' | 'ChatTeardropDots' | 'Check' | 'CheckCircle' | 'CheckFat' | 'Circle' | 'CircleDashed' | 'CircleHalf' | 'CirclesFour' | 'CirclesThreePlus' | 'Clock' | 'ClockCountdown' | 'Copy' | 'Crop' | 'Cube' | 'CursorClick' | 'CraneTower' | 'Database' | 'Dna' | 'DotsThree' | 'DotsThreeOutlineVertical' | 'DownloadSimple' | 'Drop' | 'EnvelopeSimple' | 'Eye' | 'Eyedropper' | 'EyeSlash' | 'FileCsv' | 'Flag' | 'Flask' | 'Folder' | 'FolderDashed' | 'FolderSimplePlus' | 'FunnelSimple' | 'Gear' | 'GlobeSimple' | 'GlobeSimpleX' | 'GridFour' | 'Hash' | 'House' | 'ImageSquare' | 'ImagesSquare' | 'Info' | 'Lock' | 'LineSegments' | 'List' | 'Link' | 'ListMagnifyingGlass' | 'MagnifyingGlass' | 'MegaphoneSimple' | 'MicrosoftExcelLogo' | 'Moon' | 'Minus' | 'Palette' | 'Pause' | 'Pencil' | 'PencilSimple' | 'Percent' | 'Phone' | 'Plant' | 'Play' | 'Plus' | 'PlusMinus' | 'Ruler' | 'Question' | 'SealCheck' | 'RadioButton' | 'SealQuestion' | 'SealWarning' | 'SelectionAll' | 'Share' | 'SidebarSimple' | 'SkipBack' | 'SkipForward' | 'SignIn' | 'SignOut' | 'SortAscending' | 'Sparkle' | 'SpinnerGap' | 'SquaresFour' | 'Star' | 'Stop' | 'StopCircle' | 'Sun' | 'Table' | 'Tag' | 'Target' | 'TestTube' | 'Trash' | 'TrashSimple' | 'TreeStructure' | 'UserCircle' | 'UserPlus' | 'Video' | 'Warning' | 'WarningCircle' | 'WifiSlash' | 'X' | 'XCircle';
|
|
7
|
+
export type IconName = 'Aperture' | 'Archive' | 'ArrowFatLineRight' | 'ArrowCounterClockwise' | 'ArrowRight' | 'ArrowUpRight' | 'ArrowUpLeft' | 'ArrowUUpLeft' | 'Barcode' | 'Bell' | 'BookOpen' | 'BookOpenText' | 'BowlingBall' | 'BugBeetle' | 'Calendar' | 'CalendarBlank' | 'Camera' | 'CameraSlash' | 'CaretDown' | 'CaretLeft' | 'CaretRight' | 'CaretUp' | 'CaretUpDown' | 'ChatTeardropDots' | 'Check' | 'CheckCircle' | 'CheckFat' | 'Circle' | 'CircleDashed' | 'CircleHalf' | 'CirclesFour' | 'CirclesThreePlus' | 'Clock' | 'ClockCountdown' | 'Copy' | 'Crop' | 'Cube' | 'CursorClick' | 'CraneTower' | 'Database' | 'Dna' | 'DotsThree' | 'DotsThreeOutlineVertical' | 'DownloadSimple' | 'Drop' | 'EnvelopeSimple' | 'Eye' | 'Eyedropper' | 'EyeSlash' | 'FileCsv' | 'Flag' | 'Flask' | 'Folder' | 'FolderDashed' | 'FolderSimplePlus' | 'FunnelSimple' | 'Gear' | 'GlobeSimple' | 'GlobeSimpleX' | 'GridFour' | 'Hash' | 'House' | 'ImageSquare' | 'ImagesSquare' | 'Info' | 'IntersectThree' | 'Lock' | 'LineSegments' | 'List' | 'Link' | 'ListMagnifyingGlass' | 'MagnifyingGlass' | 'MegaphoneSimple' | 'MicrosoftExcelLogo' | 'Moon' | 'Minus' | 'Palette' | 'Pause' | 'Pencil' | 'PencilSimple' | 'Percent' | 'Phone' | 'Plant' | 'Play' | 'Plus' | 'PlusMinus' | 'Ruler' | 'Question' | 'SealCheck' | 'RadioButton' | 'SealQuestion' | 'SealWarning' | 'SelectionAll' | 'Share' | 'SidebarSimple' | 'SkipBack' | 'SkipForward' | 'SignIn' | 'SignOut' | 'SortAscending' | 'Sparkle' | 'SpinnerGap' | 'SquaresFour' | 'Star' | 'Stop' | 'StopCircle' | 'Sun' | 'Table' | 'Tag' | 'Target' | 'TestTube' | 'Trash' | 'TrashSimple' | 'TreeStructure' | 'UserCircle' | 'UserPlus' | 'Video' | 'Warning' | 'WarningCircle' | 'WifiSlash' | 'X' | 'XCircle';
|
|
8
8
|
export type AllIconName = IconName | CustomIconName;
|
|
9
9
|
export declare const iconMap: Record<IconName, PhosphorIconProps>;
|
|
10
10
|
export declare function renderIcon(iconName: keyof typeof iconMap): PhosphorIconProps;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {} from 'phosphor-svelte';
|
|
1
2
|
import Aperture from 'phosphor-svelte/lib/Aperture';
|
|
2
3
|
import Archive from 'phosphor-svelte/lib/Archive';
|
|
3
4
|
import ArrowFatLineRight from 'phosphor-svelte/lib/ArrowFatLineRight';
|
|
@@ -63,6 +64,7 @@ import House from 'phosphor-svelte/lib/House';
|
|
|
63
64
|
import ImageSquare from 'phosphor-svelte/lib/ImageSquare';
|
|
64
65
|
import ImagesSquare from 'phosphor-svelte/lib/ImagesSquare';
|
|
65
66
|
import Info from 'phosphor-svelte/lib/Info';
|
|
67
|
+
import IntersectThree from 'phosphor-svelte/lib/IntersectThree';
|
|
66
68
|
import Lock from 'phosphor-svelte/lib/Lock';
|
|
67
69
|
import LineSegments from 'phosphor-svelte/lib/LineSegments';
|
|
68
70
|
import List from 'phosphor-svelte/lib/List';
|
|
@@ -187,6 +189,7 @@ export const iconMap = {
|
|
|
187
189
|
ImageSquare,
|
|
188
190
|
ImagesSquare,
|
|
189
191
|
Info,
|
|
192
|
+
IntersectThree,
|
|
190
193
|
Lock,
|
|
191
194
|
LineSegments,
|
|
192
195
|
List,
|
|
@@ -9,14 +9,22 @@
|
|
|
9
9
|
children: Snippet;
|
|
10
10
|
class?: string;
|
|
11
11
|
contentClass?: string;
|
|
12
|
+
headerClass?: string;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
let {
|
|
15
|
+
let {
|
|
16
|
+
label,
|
|
17
|
+
children,
|
|
18
|
+
class: className,
|
|
19
|
+
contentClass,
|
|
20
|
+
headerClass,
|
|
21
|
+
...restProps
|
|
22
|
+
}: Props = $props();
|
|
15
23
|
</script>
|
|
16
24
|
|
|
17
25
|
<SelectPrimitive.Group class={className} {...restProps}>
|
|
18
26
|
{#if label}
|
|
19
|
-
<GroupHeading>{label}</GroupHeading>
|
|
27
|
+
<GroupHeading class={headerClass}>{label}</GroupHeading>
|
|
20
28
|
{/if}
|
|
21
29
|
<div class={contentClass}>
|
|
22
30
|
{@render children()}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
editable?: boolean;
|
|
16
16
|
onsubmit?: (value: string | number) => void;
|
|
17
17
|
inputType?: 'text' | 'number';
|
|
18
|
+
variant?: 'default' | 'light';
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
let {
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
showTitleTooltip = false,
|
|
26
27
|
editable = false,
|
|
27
28
|
inputType = 'text',
|
|
29
|
+
variant = 'default',
|
|
28
30
|
onsubmit,
|
|
29
31
|
}: Props = $props();
|
|
30
32
|
const formattedValue = $derived(typeof value === 'number' ? value.toLocaleString() : value);
|
|
@@ -92,7 +94,9 @@
|
|
|
92
94
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
93
95
|
<div
|
|
94
96
|
data-testid="stat-card-body"
|
|
95
|
-
class="flex w-full flex-shrink-0 flex-grow basis-0 flex-col items-start gap-2 overflow-clip rounded-lg
|
|
97
|
+
class="flex w-full flex-shrink-0 flex-grow basis-0 flex-col items-start gap-2 overflow-clip rounded-lg p-4 text-left transition-colors"
|
|
98
|
+
class:bg-neutral={variant === 'default'}
|
|
99
|
+
class:bg-surface={variant === 'light'}
|
|
96
100
|
class:hover:bg-neutral-hover={editable && !isEditing && value !== null}
|
|
97
101
|
class:cursor-pointer={editable && !isEditing && value !== null}
|
|
98
102
|
onclick={handleCardClick}
|
|
@@ -7,6 +7,7 @@ interface Props {
|
|
|
7
7
|
editable?: boolean;
|
|
8
8
|
onsubmit?: (value: string | number) => void;
|
|
9
9
|
inputType?: 'text' | 'number';
|
|
10
|
+
variant?: 'default' | 'light';
|
|
10
11
|
}
|
|
11
12
|
declare const StatCard: import("svelte").Component<Props, {}, "">;
|
|
12
13
|
type StatCard = ReturnType<typeof StatCard>;
|