@reshape-biotech/design-system 2.4.1 → 2.5.1
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/README.md +3 -0
- package/dist/app.css +2 -2
- package/dist/components/graphs/chart/Chart.svelte +5 -1
- package/dist/components/graphs/matrix/Matrix.svelte +2 -2
- package/dist/components/icons/AnalysisIcon.svelte +1 -2
- package/dist/components/icons/custom/Halo.svelte +3 -2
- package/dist/components/icons/custom/Halo.svelte.d.ts +1 -1
- package/dist/components/icons/custom/LightBottomHighIcon.svelte +26 -0
- package/dist/components/icons/custom/LightBottomHighIcon.svelte.d.ts +8 -0
- package/dist/components/icons/custom/LightBottomLowIcon.svelte +23 -0
- package/dist/components/icons/custom/LightBottomLowIcon.svelte.d.ts +8 -0
- package/dist/components/icons/custom/LightBottomMediumIcon.svelte +26 -0
- package/dist/components/icons/custom/LightBottomMediumIcon.svelte.d.ts +8 -0
- package/dist/components/icons/custom/LightTopHighIcon.svelte +26 -0
- package/dist/components/icons/custom/LightTopHighIcon.svelte.d.ts +8 -0
- package/dist/components/icons/custom/LightTopLowIcon.svelte +26 -0
- package/dist/components/icons/custom/LightTopLowIcon.svelte.d.ts +8 -0
- package/dist/components/icons/custom/LightTopMediumIcon.svelte +26 -0
- package/dist/components/icons/custom/LightTopMediumIcon.svelte.d.ts +8 -0
- package/dist/components/icons/custom/Well.svelte +3 -2
- package/dist/components/icons/custom/Well.svelte.d.ts +1 -1
- package/dist/components/icons/custom/index.d.ts +9 -0
- package/dist/components/icons/custom/index.js +8 -0
- package/dist/components/icons/index.d.ts +8 -0
- package/dist/components/icons/index.js +2 -1
- package/dist/components/legend/Legend.stories.svelte +108 -0
- package/dist/components/{button/Button.test.svelte.d.ts → legend/Legend.stories.svelte.d.ts} +4 -4
- package/dist/components/legend/components/legend-item.svelte +28 -0
- package/dist/components/legend/components/legend-item.svelte.d.ts +9 -0
- package/dist/components/legend/components/legend-root.svelte +24 -0
- package/dist/components/legend/components/legend-root.svelte.d.ts +8 -0
- package/dist/components/legend/index.d.ts +11 -0
- package/dist/components/legend/index.js +2 -0
- package/dist/components/segmented-control-buttons/ControlButton.svelte +3 -1
- package/dist/components/select/components/MultiSelectTrigger.svelte +5 -4
- package/dist/components/select/components/SelectContent.svelte +1 -1
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/SjsfSelectWidgetWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +1 -1
- package/dist/components/tag/Tag.svelte +1 -1
- package/dist/components/tooltip/Tooltip.svelte +3 -0
- package/dist/components/tooltip/Tooltip.svelte.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/notifications.d.ts +2 -5
- package/dist/tailwind.preset.js +1 -1
- package/package.json +195 -189
- package/dist/components/activity/Activity.test.d.ts +0 -1
- package/dist/components/activity/Activity.test.js +0 -89
- package/dist/components/avatar/Avatar.test.d.ts +0 -1
- package/dist/components/avatar/Avatar.test.js +0 -55
- package/dist/components/button/Button.test.d.ts +0 -1
- package/dist/components/button/Button.test.js +0 -117
- package/dist/components/button/Button.test.svelte +0 -5
- package/dist/components/checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/checkbox/Checkbox.test.js +0 -51
- package/dist/components/graphs/matrix/Matrix.test.d.ts +0 -1
- package/dist/components/graphs/matrix/Matrix.test.js +0 -256
- package/dist/components/graphs/matrix/Matrix.test.svelte +0 -49
- package/dist/components/graphs/matrix/Matrix.test.svelte.d.ts +0 -4
- package/dist/components/input/Input.test.d.ts +0 -1
- package/dist/components/input/Input.test.js +0 -35
- package/dist/components/label/Label.test.d.ts +0 -1
- package/dist/components/label/Label.test.js +0 -29
- package/dist/components/manual-cfu-counter/test/ManualCFUCounter.test.d.ts +0 -1
- package/dist/components/manual-cfu-counter/test/ManualCFUCounter.test.js +0 -319
- package/dist/components/multi-cfu-counter/test/MultiCFUCounter.test.d.ts +0 -1
- package/dist/components/multi-cfu-counter/test/MultiCFUCounter.test.js +0 -320
- package/dist/components/stat-card/StatCard.test.d.ts +0 -1
- package/dist/components/stat-card/StatCard.test.js +0 -54
- package/dist/components/table/Table.test.d.ts +0 -1
- package/dist/components/table/Table.test.js +0 -97
- package/dist/components/table/Table.test.svelte +0 -37
- package/dist/components/table/Table.test.svelte.d.ts +0 -12
- package/dist/components/textarea/Textarea.test.d.ts +0 -1
- package/dist/components/textarea/Textarea.test.js +0 -90
- package/dist/components/toggle-icon-button/ToggleIconButton.test.d.ts +0 -1
- package/dist/components/toggle-icon-button/ToggleIconButton.test.js +0 -100
- package/dist/components/tooltip/Tooltip.test.d.ts +0 -1
- package/dist/components/tooltip/Tooltip.test.js +0 -81
package/README.md
CHANGED
|
@@ -22,16 +22,19 @@ This package contains the core design system for Reshape Biotech frontend projec
|
|
|
22
22
|
### Contents
|
|
23
23
|
|
|
24
24
|
1. **Component Library**
|
|
25
|
+
|
|
25
26
|
- A collection of shared, reusable Svelte components
|
|
26
27
|
- Standardized UI elements following Reshape Biotech's design guidelines
|
|
27
28
|
- Fully typed components with TypeScript support
|
|
28
29
|
|
|
29
30
|
2. **Tailwind Configuration**
|
|
31
|
+
|
|
30
32
|
- Pre-configured Tailwind CSS setup
|
|
31
33
|
- Custom theme extensions
|
|
32
34
|
- Shared utility classes
|
|
33
35
|
|
|
34
36
|
3. **DaisyUI**
|
|
37
|
+
|
|
35
38
|
- Pre-configured DaisyUI setup
|
|
36
39
|
- Custom theme extensions
|
|
37
40
|
- Shared utility classes
|
package/dist/app.css
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
@layer base {
|
|
6
6
|
@font-face {
|
|
7
|
-
font-family: '
|
|
7
|
+
font-family: 'Geist Mono';
|
|
8
8
|
font-style: normal;
|
|
9
9
|
font-weight: 400;
|
|
10
|
-
src: url('/fonts/
|
|
10
|
+
src: url('/fonts/GeistMono-VariableFont_wght.ttf') format('ttf');
|
|
11
11
|
}
|
|
12
12
|
@font-face {
|
|
13
13
|
font-family: 'af Another Sans';
|
|
@@ -210,7 +210,11 @@
|
|
|
210
210
|
});
|
|
211
211
|
</script>
|
|
212
212
|
|
|
213
|
-
<div
|
|
213
|
+
<div
|
|
214
|
+
bind:this={container}
|
|
215
|
+
style="width: {width}; height: {height};"
|
|
216
|
+
class="chart-container bg-surface"
|
|
217
|
+
>
|
|
214
218
|
{@render children?.()}
|
|
215
219
|
</div>
|
|
216
220
|
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
<div class="flex h-full flex-1 flex-row overflow-hidden">
|
|
94
94
|
{#if yAxisName && !hideAxisNames}
|
|
95
95
|
<!-- 26px is the height of the xAxisName -->
|
|
96
|
-
<div class="mr-2 flex h-[calc(100%-26px)] w-
|
|
96
|
+
<div class="mr-2 flex h-[calc(100%-26px)] w-10 items-center self-end border-r">
|
|
97
97
|
<div class="-rotate-90 transform whitespace-nowrap text-sm font-normal text-secondary">
|
|
98
98
|
{yAxisName}
|
|
99
99
|
</div>
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
</div>
|
|
111
111
|
|
|
112
112
|
<div class="flex flex-1">
|
|
113
|
-
<div class="flex w-
|
|
113
|
+
<div class="flex w-24 flex-col">
|
|
114
114
|
{#each displayRowLabels as label}
|
|
115
115
|
<div class="flex flex-1 items-center justify-end pr-2 text-sm text-secondary">
|
|
116
116
|
{label}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Icon from './Icon.svelte';
|
|
3
|
-
import Well from './custom
|
|
4
|
-
import Halo from './custom/Halo.svelte';
|
|
3
|
+
import { Well, Halo } from './custom';
|
|
5
4
|
import type { IconColor, SupportedAnalysisModelIcons } from '.';
|
|
6
5
|
|
|
7
6
|
type Props = {
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import type { IconColor } from '..';
|
|
3
3
|
import { textColor } from '../../../tokens';
|
|
4
4
|
|
|
5
|
-
let { size = '16', color = '
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<svg
|
|
9
10
|
width={size}
|
|
10
11
|
height={size}
|
|
11
12
|
viewBox="0 0 16 16"
|
|
12
|
-
fill={textColor[color]}
|
|
13
|
+
fill={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
13
14
|
xmlns="http://www.w3.org/2000/svg"
|
|
14
15
|
>
|
|
15
16
|
<path
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconColor } from '..';
|
|
3
|
+
import { textColor } from '../../../tokens';
|
|
4
|
+
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
width={size}
|
|
11
|
+
height={size}
|
|
12
|
+
viewBox="0 0 25 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
stroke={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M15.5 16V15C15.5 13.3431 14.1569 12 12.5 12C10.8431 12 9.5 13.3431 9.5 15V16"
|
|
19
|
+
stroke-width="1.5"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M4.25736 7.17142L8.5 11.4141" stroke-width="1.5" />
|
|
22
|
+
<path d="M20.7426 7.17142L16.5 11.4141" stroke-width="1.5" />
|
|
23
|
+
<path d="M1.5 15L7.5 15" stroke-width="1.5" />
|
|
24
|
+
<path d="M23.5 15L17.5 15" stroke-width="1.5" />
|
|
25
|
+
<path d="M12.5 3L12.5 10" stroke-width="1.5" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconColor } from '..';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
size?: string;
|
|
4
|
+
color?: IconColor | 'inherit';
|
|
5
|
+
};
|
|
6
|
+
declare const LightBottomHighIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type LightBottomHighIcon = ReturnType<typeof LightBottomHighIcon>;
|
|
8
|
+
export default LightBottomHighIcon;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconColor } from '..';
|
|
3
|
+
import { textColor } from '../../../tokens';
|
|
4
|
+
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
width={size}
|
|
11
|
+
height={size}
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
stroke={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
16
|
+
>
|
|
17
|
+
<path d="M15 16V15C15 13.3431 13.6569 12 12 12C10.3431 12 9 13.3431 9 15V16" stroke-width="1.5" />
|
|
18
|
+
<path d="M6.58579 10L8 11.4142" stroke-width="1.5" />
|
|
19
|
+
<path d="M17.4142 10L16 11.4142" stroke-width="1.5" />
|
|
20
|
+
<path d="M5 15L7 15" stroke-width="1.5" />
|
|
21
|
+
<path d="M19 15L17 15" stroke-width="1.5" />
|
|
22
|
+
<path d="M12 8L12 10" stroke-width="1.5" />
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconColor } from '..';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
size?: string;
|
|
4
|
+
color?: IconColor | 'inherit';
|
|
5
|
+
};
|
|
6
|
+
declare const LightBottomLowIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type LightBottomLowIcon = ReturnType<typeof LightBottomLowIcon>;
|
|
8
|
+
export default LightBottomLowIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconColor } from '..';
|
|
3
|
+
import { textColor } from '../../../tokens';
|
|
4
|
+
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
width={size}
|
|
11
|
+
height={size}
|
|
12
|
+
viewBox="0 0 25 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
stroke={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M15.5 16V15C15.5 13.3431 14.1569 12 12.5 12C10.8431 12 9.5 13.3431 9.5 15V16"
|
|
19
|
+
stroke-width="1.5"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M5.67157 8.58564L8.5 11.4141" stroke-width="1.5" />
|
|
22
|
+
<path d="M19.3284 8.58564L16.5 11.4141" stroke-width="1.5" />
|
|
23
|
+
<path d="M3.5 15L7.5 15" stroke-width="1.5" />
|
|
24
|
+
<path d="M21.5 15L17.5 15" stroke-width="1.5" />
|
|
25
|
+
<path d="M12.5 6L12.5 10" stroke-width="1.5" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconColor } from '..';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
size?: string;
|
|
4
|
+
color?: IconColor | 'inherit';
|
|
5
|
+
};
|
|
6
|
+
declare const LightBottomMediumIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type LightBottomMediumIcon = ReturnType<typeof LightBottomMediumIcon>;
|
|
8
|
+
export default LightBottomMediumIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconColor } from '..';
|
|
3
|
+
import { textColor } from '../../../tokens';
|
|
4
|
+
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
width={size}
|
|
11
|
+
height={size}
|
|
12
|
+
viewBox="0 0 25 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
stroke={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M9.5 8L9.5 9C9.5 10.6569 10.8431 12 12.5 12C14.1569 12 15.5 10.6569 15.5 9L15.5 8"
|
|
19
|
+
stroke-width="1.5"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M20.7426 16.8286L16.5 12.5859" stroke-width="1.5" />
|
|
22
|
+
<path d="M4.25736 16.8286L8.5 12.5859" stroke-width="1.5" />
|
|
23
|
+
<path d="M23.5 9L17.5 9" stroke-width="1.5" />
|
|
24
|
+
<path d="M1.5 9L7.5 9" stroke-width="1.5" />
|
|
25
|
+
<path d="M12.5 21L12.5 14" stroke-width="1.5" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconColor } from '..';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
size?: string;
|
|
4
|
+
color?: IconColor | 'inherit';
|
|
5
|
+
};
|
|
6
|
+
declare const LightTopHighIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type LightTopHighIcon = ReturnType<typeof LightTopHighIcon>;
|
|
8
|
+
export default LightTopHighIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconColor } from '..';
|
|
3
|
+
import { textColor } from '../../../tokens';
|
|
4
|
+
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
width={size}
|
|
11
|
+
height={size}
|
|
12
|
+
viewBox="0 0 25 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
stroke={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M9.5 8L9.5 9C9.5 10.6569 10.8431 12 12.5 12C14.1569 12 15.5 10.6569 15.5 9L15.5 8"
|
|
19
|
+
stroke-width="1.5"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M17.9142 14.0002L16.5 12.5859" stroke-width="1.5" />
|
|
22
|
+
<path d="M7.08579 14.0002L8.5 12.5859" stroke-width="1.5" />
|
|
23
|
+
<path d="M19.5 9L17.5 9" stroke-width="1.5" />
|
|
24
|
+
<path d="M5.5 9L7.5 9" stroke-width="1.5" />
|
|
25
|
+
<path d="M12.5 16L12.5 14" stroke-width="1.5" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconColor } from '..';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
size?: string;
|
|
4
|
+
color?: IconColor | 'inherit';
|
|
5
|
+
};
|
|
6
|
+
declare const LightTopLowIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type LightTopLowIcon = ReturnType<typeof LightTopLowIcon>;
|
|
8
|
+
export default LightTopLowIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconColor } from '..';
|
|
3
|
+
import { textColor } from '../../../tokens';
|
|
4
|
+
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
width={size}
|
|
11
|
+
height={size}
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
stroke={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M9.5 8L9.5 9C9.5 10.6569 10.8431 12 12.5 12C14.1569 12 15.5 10.6569 15.5 9L15.5 8"
|
|
19
|
+
stroke-width="1.5"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M19.3284 15.4144L16.5 12.5859" stroke-width="1.5" />
|
|
22
|
+
<path d="M5.67157 15.4144L8.5 12.5859" stroke-width="1.5" />
|
|
23
|
+
<path d="M21.5 9L17.5 9" stroke-width="1.5" />
|
|
24
|
+
<path d="M3.5 9L7.5 9" stroke-width="1.5" />
|
|
25
|
+
<path d="M12.5 18L12.5 14" stroke-width="1.5" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconColor } from '..';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
size?: string;
|
|
4
|
+
color?: IconColor | 'inherit';
|
|
5
|
+
};
|
|
6
|
+
declare const LightTopMediumIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type LightTopMediumIcon = ReturnType<typeof LightTopMediumIcon>;
|
|
8
|
+
export default LightTopMediumIcon;
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import type { IconColor } from '..';
|
|
3
3
|
import { textColor } from '../../../tokens';
|
|
4
4
|
|
|
5
|
-
let { size = '16', color = '
|
|
5
|
+
let { size = '16', color = 'inherit' }: { size?: string; color?: IconColor | 'inherit' } =
|
|
6
|
+
$props();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<svg
|
|
9
10
|
width={size}
|
|
10
11
|
height={size}
|
|
11
12
|
viewBox="0 0 16 16"
|
|
12
|
-
fill={textColor[color]}
|
|
13
|
+
fill={color === 'inherit' ? 'currentColor' : textColor[color]}
|
|
13
14
|
xmlns="http://www.w3.org/2000/svg"
|
|
14
15
|
>
|
|
15
16
|
<path
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Halo } from './Halo.svelte';
|
|
2
|
+
export { default as Well } from './Well.svelte';
|
|
3
|
+
export { default as LightBottomHighIcon } from './LightBottomHighIcon.svelte';
|
|
4
|
+
export { default as LightBottomLowIcon } from './LightBottomLowIcon.svelte';
|
|
5
|
+
export { default as LightBottomMediumIcon } from './LightBottomMediumIcon.svelte';
|
|
6
|
+
export { default as LightTopHighIcon } from './LightTopHighIcon.svelte';
|
|
7
|
+
export { default as LightTopLowIcon } from './LightTopLowIcon.svelte';
|
|
8
|
+
export { default as LightTopMediumIcon } from './LightTopMediumIcon.svelte';
|
|
9
|
+
export type CustomIconName = 'Halo' | 'Well' | 'LightBottomHighIcon' | 'LightBottomLowIcon' | 'LightBottomMediumIcon' | 'LightTopHighIcon' | 'LightTopLowIcon' | 'LightTopMediumIcon';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Halo } from './Halo.svelte';
|
|
2
|
+
export { default as Well } from './Well.svelte';
|
|
3
|
+
export { default as LightBottomHighIcon } from './LightBottomHighIcon.svelte';
|
|
4
|
+
export { default as LightBottomLowIcon } from './LightBottomLowIcon.svelte';
|
|
5
|
+
export { default as LightBottomMediumIcon } from './LightBottomMediumIcon.svelte';
|
|
6
|
+
export { default as LightTopHighIcon } from './LightTopHighIcon.svelte';
|
|
7
|
+
export { default as LightTopLowIcon } from './LightTopLowIcon.svelte';
|
|
8
|
+
export { default as LightTopMediumIcon } from './LightTopMediumIcon.svelte';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { IconComponentProps } from 'phosphor-svelte';
|
|
2
2
|
import type { Component } from 'svelte';
|
|
3
3
|
import type { textColor, backgroundColor } from './../../tokens';
|
|
4
|
+
export * from './custom';
|
|
5
|
+
import type { CustomIconName } from './custom';
|
|
4
6
|
export type PhosphorIconProps = Component<IconComponentProps, object, ''>;
|
|
5
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';
|
|
8
|
+
export type AllIconName = IconName | CustomIconName;
|
|
6
9
|
export declare const iconMap: Record<IconName, PhosphorIconProps>;
|
|
7
10
|
export declare function renderIcon(iconName: keyof typeof iconMap): PhosphorIconProps;
|
|
8
11
|
export type BackgroundClass = `bg-${keyof typeof backgroundColor}`;
|
|
@@ -19,3 +22,8 @@ export type IconProps = {
|
|
|
19
22
|
height?: number;
|
|
20
23
|
class?: string;
|
|
21
24
|
};
|
|
25
|
+
export type CustomIconProps = {
|
|
26
|
+
size?: string;
|
|
27
|
+
color?: IconColor | 'inherit';
|
|
28
|
+
class?: string;
|
|
29
|
+
};
|
|
@@ -113,12 +113,13 @@ import TrashSimple from 'phosphor-svelte/lib/TrashSimple';
|
|
|
113
113
|
import TreeStructure from 'phosphor-svelte/lib/TreeStructure';
|
|
114
114
|
import UserCircle from 'phosphor-svelte/lib/UserCircle';
|
|
115
115
|
import UserPlus from 'phosphor-svelte/lib/UserPlus';
|
|
116
|
-
import User from 'phosphor-svelte/lib/User';
|
|
117
116
|
import Video from 'phosphor-svelte/lib/Video';
|
|
118
117
|
import Warning from 'phosphor-svelte/lib/Warning';
|
|
119
118
|
import WarningCircle from 'phosphor-svelte/lib/WarningCircle';
|
|
120
119
|
import WifiSlash from 'phosphor-svelte/lib/WifiSlash';
|
|
121
120
|
import X from 'phosphor-svelte/lib/X';
|
|
121
|
+
// Custom Icons
|
|
122
|
+
export * from './custom';
|
|
122
123
|
export const iconMap = {
|
|
123
124
|
Aperture,
|
|
124
125
|
Archive,
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import * as Legend from './index';
|
|
4
|
+
import { tokens } from '../../tokens';
|
|
5
|
+
import { Tooltip } from '../tooltip';
|
|
6
|
+
import Icon from '../icons/Icon.svelte';
|
|
7
|
+
import Tag from '../tag/Tag.svelte';
|
|
8
|
+
|
|
9
|
+
const { Story } = defineMeta({
|
|
10
|
+
title: 'Design System/Legend',
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#snippet tooltip(
|
|
16
|
+
name: string,
|
|
17
|
+
description: string,
|
|
18
|
+
parameters: { name: string; gte?: number; lte?: number; eq?: string | number }[]
|
|
19
|
+
)}
|
|
20
|
+
<div class="min-w-42 flex flex-col gap-3 p-3">
|
|
21
|
+
<div class="flex flex-row items-center gap-2">
|
|
22
|
+
<Icon iconName="Hash" class="text-secondary-inverse"></Icon>{name}
|
|
23
|
+
</div>
|
|
24
|
+
<div class="flex flex-col gap-1">
|
|
25
|
+
<p class="text-secondary-inverse">Description</p>
|
|
26
|
+
<p>{description}</p>
|
|
27
|
+
</div>
|
|
28
|
+
{#if parameters.length > 0}
|
|
29
|
+
<div class="flex flex-col gap-1">
|
|
30
|
+
<p class="text-secondary-inverse">Parameters</p>
|
|
31
|
+
<div class="flex flex-row flex-wrap gap-2">
|
|
32
|
+
{#each parameters as parameter}
|
|
33
|
+
<Tag variant="default-inverse">
|
|
34
|
+
<Icon iconName="CraneTower"></Icon>
|
|
35
|
+
<div class="flex grow flex-row gap-1">
|
|
36
|
+
{parameter.name}
|
|
37
|
+
{#if parameter.gte && parameter.lte}{parameter.gte} - {parameter.lte}{/if}
|
|
38
|
+
{#if parameter.gte && parameter.lte === undefined}{'≥'} {parameter.gte}{/if}
|
|
39
|
+
{#if parameter.lte && parameter.gte === undefined}{'≤'} {parameter.lte}{/if}
|
|
40
|
+
{#if parameter.eq}{'='} {parameter.eq}{/if}
|
|
41
|
+
</div>
|
|
42
|
+
</Tag>
|
|
43
|
+
{/each}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
{/snippet}
|
|
49
|
+
|
|
50
|
+
<Story name="Root">
|
|
51
|
+
<Legend.Root>
|
|
52
|
+
<div
|
|
53
|
+
class="flex h-[200px] w-full bg-gradient-to-tr from-green-500 to-green-100 text-primary-inverse"
|
|
54
|
+
>
|
|
55
|
+
<code>I'm a child</code>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
{#snippet items()}
|
|
59
|
+
<Tooltip placement="bottom">
|
|
60
|
+
{#snippet trigger()}
|
|
61
|
+
<Legend.Item color={tokens.colors.red[5].default} name="Green large spots" />
|
|
62
|
+
{/snippet}
|
|
63
|
+
{#snippet content()}
|
|
64
|
+
{@render tooltip(
|
|
65
|
+
'Green large spots',
|
|
66
|
+
'Counts yeast really really really super duper well!',
|
|
67
|
+
[
|
|
68
|
+
{ name: 'Red', gte: 22, lte: 122 },
|
|
69
|
+
{ name: 'Class Name', eq: 'yeast' },
|
|
70
|
+
]
|
|
71
|
+
)}
|
|
72
|
+
{/snippet}
|
|
73
|
+
</Tooltip>
|
|
74
|
+
<Tooltip placement="bottom">
|
|
75
|
+
{#snippet trigger()}
|
|
76
|
+
<Legend.Item color={tokens.colors.blue[5].default} name="Red hueish spots" />
|
|
77
|
+
{/snippet}
|
|
78
|
+
{#snippet content()}
|
|
79
|
+
{@render tooltip(
|
|
80
|
+
'Red hueish spots',
|
|
81
|
+
'Counts mold really really really super duper well!',
|
|
82
|
+
[
|
|
83
|
+
{ name: 'Red', gte: 22, lte: 122 },
|
|
84
|
+
{ name: 'Blue', gte: 42 },
|
|
85
|
+
{ name: 'Class Name', eq: 'mold' },
|
|
86
|
+
]
|
|
87
|
+
)}
|
|
88
|
+
{/snippet}
|
|
89
|
+
</Tooltip>
|
|
90
|
+
<Tooltip placement="bottom">
|
|
91
|
+
{#snippet trigger()}
|
|
92
|
+
<Legend.Item color={tokens.colors.green[5].default} name="Small halos" />
|
|
93
|
+
{/snippet}
|
|
94
|
+
{#snippet content()}
|
|
95
|
+
{@render tooltip(
|
|
96
|
+
'Small halos',
|
|
97
|
+
'Counts bacteria really really really super duper well!',
|
|
98
|
+
[
|
|
99
|
+
{ name: 'Blue', gte: 42 },
|
|
100
|
+
{ name: 'Green', lte: 142 },
|
|
101
|
+
{ name: 'Class Name', eq: 'bacteria' },
|
|
102
|
+
]
|
|
103
|
+
)}
|
|
104
|
+
{/snippet}
|
|
105
|
+
</Tooltip>
|
|
106
|
+
{/snippet}
|
|
107
|
+
</Legend.Root>
|
|
108
|
+
</Story>
|
package/dist/components/{button/Button.test.svelte.d.ts → legend/Legend.stories.svelte.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Legend from './index';
|
|
2
2
|
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> {
|
|
3
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
4
|
$$bindings?: Bindings;
|
|
@@ -12,8 +12,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
12
12
|
};
|
|
13
13
|
z_$$bindings?: Bindings;
|
|
14
14
|
}
|
|
15
|
-
declare const
|
|
15
|
+
declare const Legend: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
}, {}, {}, string>;
|
|
18
|
-
type
|
|
19
|
-
export default
|
|
18
|
+
type Legend = InstanceType<typeof Legend>;
|
|
19
|
+
export default Legend;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string;
|
|
4
|
+
color: string;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
onclick?: ((name: string) => void) | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { color, name, selected = $bindable(), onclick }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<button
|
|
13
|
+
onclick={(e) => {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
onclick?.(name);
|
|
16
|
+
}}
|
|
17
|
+
class:bg-neutral={selected}
|
|
18
|
+
class="group flex flex-row items-center gap-2 rounded-lg px-2 py-1 hover:bg-neutral"
|
|
19
|
+
>
|
|
20
|
+
<div class="flex h-2 w-2 flex-shrink-0 rounded-sm" style="background-color: {color}"></div>
|
|
21
|
+
<div
|
|
22
|
+
class="flex max-w-24 select-none truncate text-xs"
|
|
23
|
+
class:text-secondary={!selected}
|
|
24
|
+
class:text-primary={selected}
|
|
25
|
+
>
|
|
26
|
+
<div class="truncate">{name}</div>
|
|
27
|
+
</div>
|
|
28
|
+
</button>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
name: string;
|
|
3
|
+
color: string;
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
onclick?: ((name: string) => void) | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const LegendItem: import("svelte").Component<Props, {}, "selected">;
|
|
8
|
+
type LegendItem = ReturnType<typeof LegendItem>;
|
|
9
|
+
export default LegendItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
items?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { children, items }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="inline-flex w-full flex-col items-center rounded-[10px] bg-neutral">
|
|
13
|
+
<div
|
|
14
|
+
class="flex w-full px-0.5 pt-0.5 [&>*]:rounded-lg [&>*]:border [&>*]:border-static [&>*]:p-1"
|
|
15
|
+
>
|
|
16
|
+
{@render children()}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="flex flex-wrap items-center justify-center gap-x-4 gap-y-1 overflow-clip py-1">
|
|
20
|
+
{#if items}
|
|
21
|
+
{@render items()}
|
|
22
|
+
{/if}
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export { default as Root } from './components/legend-root.svelte';
|
|
3
|
+
export { default as Item } from './components/legend-item.svelte';
|
|
4
|
+
export interface LegendRootProps {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
items?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
export interface LegendItemProps {
|
|
9
|
+
color: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}
|