@invopop/popui 0.1.14 → 0.1.15
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/BaseButton.svelte +25 -103
- package/dist/BaseCard.svelte +35 -30
- package/dist/BaseCounter.svelte +11 -8
- package/dist/BaseTable.svelte +6 -8
- package/dist/BaseTableActions.svelte +2 -2
- package/dist/BaseTableCellContent.svelte +2 -2
- package/dist/BaseTableHeaderContent.svelte +2 -2
- package/dist/Breadcrumb.svelte +40 -0
- package/dist/Breadcrumb.svelte.d.ts +4 -0
- package/dist/Breadcrumbs.svelte +5 -30
- package/dist/ButtonFile.svelte +35 -30
- package/dist/ButtonUuidCopy.svelte +2 -2
- package/dist/CardCheckbox.svelte +25 -21
- package/dist/CardRelation.svelte +12 -16
- package/dist/CompanySelector.svelte +35 -7
- package/dist/DataListItem.svelte +14 -10
- package/dist/DatePicker.svelte +9 -9
- package/dist/DrawerContext.svelte +112 -10
- package/dist/DrawerContextItem.svelte +19 -29
- package/dist/DrawerContextSeparator.svelte +1 -1
- package/dist/DrawerContextWorkspace.svelte +7 -7
- package/dist/DropdownSelect.svelte +40 -14
- package/dist/EmptyState.svelte +40 -0
- package/dist/EmptyState.svelte.d.ts +4 -0
- package/dist/EmptyStateIllustration.svelte.d.ts +0 -1
- package/dist/FeedEvents.svelte +9 -5
- package/dist/FeedIconEvent.svelte +1 -1
- package/dist/FeedItem.svelte +8 -8
- package/dist/FeedItemDetail.svelte +7 -5
- package/dist/GlobalSearch.svelte +13 -12
- package/dist/InputCheckbox.svelte +2 -5
- package/dist/InputError.svelte +4 -9
- package/dist/InputLabel.svelte +3 -1
- package/dist/InputRadio.svelte +26 -11
- package/dist/InputSearch.svelte +8 -8
- package/dist/InputSelect.svelte +32 -31
- package/dist/InputText.svelte +32 -24
- package/dist/InputTextarea.svelte +25 -19
- package/dist/InputToggle.svelte +24 -18
- package/dist/Notification.svelte +55 -24
- package/dist/ProfileAvatar.svelte +41 -14
- package/dist/SeparatorHorizontal.svelte +2 -2
- package/dist/ShortcutWrapper.svelte +14 -5
- package/dist/StatusLabel.svelte +4 -5
- package/dist/StepIconList.svelte +7 -9
- package/dist/TagBeta.svelte +26 -14
- package/dist/TagStatus.svelte +33 -48
- package/dist/TitleMain.svelte +1 -1
- package/dist/TitleSection.svelte +1 -1
- package/dist/UuidCopy.svelte +4 -4
- package/dist/alert-dialog/alert-dialog-action.svelte +5 -3
- package/dist/alert-dialog/alert-dialog-cancel.svelte +4 -2
- package/dist/alert-dialog/alert-dialog-content.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-description.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-footer.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-header.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-title.svelte +1 -1
- package/dist/button/button.svelte +183 -24
- package/dist/button/button.svelte.d.ts +48 -26
- package/dist/index.d.ts +2 -7
- package/dist/index.js +2 -12
- package/dist/range-calendar/range-calendar-cell.svelte +1 -1
- package/dist/range-calendar/range-calendar-day.svelte +10 -8
- package/dist/range-calendar/range-calendar-head-cell.svelte +1 -1
- package/dist/range-calendar/range-calendar-next-button.svelte +3 -3
- package/dist/range-calendar/range-calendar-prev-button.svelte +3 -3
- package/dist/range-calendar/range-calendar.svelte +1 -1
- package/dist/svg/CheckBadge.svelte +18 -0
- package/dist/svg/CheckBadge.svelte.d.ts +26 -0
- package/dist/svg/IconEmpty.svelte +78 -106
- package/dist/table/table-body.svelte +1 -1
- package/dist/table/table-cell.svelte +1 -1
- package/dist/table/table-footer.svelte +1 -1
- package/dist/table/table-head.svelte +1 -1
- package/dist/table/table-header.svelte +1 -1
- package/dist/table/table-row.svelte +1 -1
- package/dist/tabs/tabs-list.svelte +1 -1
- package/dist/tailwind.theme.css +969 -0
- package/dist/tooltip/tooltip-content.svelte +2 -2
- package/dist/types.d.ts +36 -42
- package/package.json +2 -2
- package/dist/CounterWorkflow.svelte +0 -19
- package/dist/CounterWorkflow.svelte.d.ts +0 -4
- package/dist/EmptyStateIcon.svelte +0 -52
- package/dist/EmptyStateIcon.svelte.d.ts +0 -4
- package/dist/FormLayoutModal.svelte +0 -14
- package/dist/FormLayoutModal.svelte.d.ts +0 -4
- package/dist/ProfileSelector.svelte +0 -41
- package/dist/ProfileSelector.svelte.d.ts +0 -4
- package/dist/SectionLayout.svelte +0 -13
- package/dist/SectionLayout.svelte.d.ts +0 -4
- package/dist/tw.theme.d.ts +0 -171
- package/dist/tw.theme.js +0 -188
package/dist/BaseButton.svelte
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import clsx from 'clsx'
|
|
3
2
|
import type { BaseButtonProps } from './types.ts'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import Button from './button/button.svelte'
|
|
4
|
+
import type { ButtonSize } from './button/button.svelte'
|
|
6
5
|
|
|
7
6
|
let {
|
|
8
7
|
icon,
|
|
@@ -11,114 +10,37 @@
|
|
|
11
10
|
type = 'button',
|
|
12
11
|
variant = 'default',
|
|
13
12
|
disabled = false,
|
|
14
|
-
|
|
15
|
-
big = false,
|
|
13
|
+
size = 'md',
|
|
16
14
|
dangerIcon = false,
|
|
17
15
|
shortcut = false,
|
|
18
16
|
fullwidth = false,
|
|
19
17
|
notification = false,
|
|
20
18
|
children,
|
|
21
19
|
onclick,
|
|
20
|
+
class: className,
|
|
22
21
|
...rest
|
|
23
22
|
}: BaseButtonProps = $props()
|
|
24
23
|
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{ 'p-2': big && !children },
|
|
40
|
-
{ 'px-3': big && children && !icon },
|
|
41
|
-
{ 'px-2': !big && children && !icon },
|
|
42
|
-
{ 'pl-2 pr-2.5': big && children && icon && iconPosition === 'left' },
|
|
43
|
-
{ 'pl-2.5 pr-2': big && children && icon && iconPosition === 'right' },
|
|
44
|
-
{ 'pl-1.5 pr-2': !big && children && icon && iconPosition === 'left' },
|
|
45
|
-
{ 'pl-2 pr-1.5': !big && children && icon && iconPosition === 'right' },
|
|
46
|
-
{ 'py-1.5': big && children },
|
|
47
|
-
{ 'py-1': !big && children },
|
|
48
|
-
{ 'text-white': ['primary', 'danger', 'dark', 'warning'].includes(variant) },
|
|
49
|
-
{ 'text-neutral-800': ['default', 'secondary', 'outline'].includes(variant) },
|
|
50
|
-
{ 'border border-white-10 hover:border-white-20 active:border-white-40': variant === 'dark' },
|
|
51
|
-
{
|
|
52
|
-
'border border-neutral-200 hover:bg-neutral-100 active:border-neutral-300 active:bg-neutral-200':
|
|
53
|
-
variant === 'default'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
'border border-neutral-800/10 hover:bg-neutral-800/5 active:border-neutral-800/20 active:bg-neutral-800/10':
|
|
57
|
-
variant === 'outline'
|
|
58
|
-
},
|
|
59
|
-
{ 'gap-1': icon && children }
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
let iconStyles = $derived(
|
|
64
|
-
clsx(
|
|
65
|
-
{
|
|
66
|
-
'text-neutral-500': ['default', 'secondary'].includes(variant) && children && !dangerIcon
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
'text-neutral-800': ['default', 'secondary'].includes(variant) && !children && !dangerIcon
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
'text-white-70': !['default', 'secondary'].includes(variant) && children && !dangerIcon
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
'text-white': !['default', 'secondary'].includes(variant) && !children && !dangerIcon
|
|
76
|
-
},
|
|
77
|
-
{ 'text-danger-500': dangerIcon }
|
|
78
|
-
)
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
let overlayClasses = $derived(
|
|
82
|
-
clsx({
|
|
83
|
-
'rounded-md': !small,
|
|
84
|
-
rounded: small,
|
|
85
|
-
'group-hover:bg-black/[.16] group-active:bg-black/[.32]': [
|
|
86
|
-
'primary',
|
|
87
|
-
'danger',
|
|
88
|
-
'warning'
|
|
89
|
-
].includes(variant)
|
|
90
|
-
})
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
function handleClick(event: MouseEvent) {
|
|
94
|
-
event.stopPropagation()
|
|
95
|
-
onclick?.(event)
|
|
96
|
-
}
|
|
24
|
+
let iconClass = $derived(dangerIcon ? 'text-icon-critical' : '')
|
|
25
|
+
let fullWidthClass = $derived(fullwidth ? 'w-full' : '')
|
|
26
|
+
let buttonProps = $derived({
|
|
27
|
+
variant,
|
|
28
|
+
size,
|
|
29
|
+
icon,
|
|
30
|
+
iconPosition,
|
|
31
|
+
iconClass,
|
|
32
|
+
type,
|
|
33
|
+
disabled,
|
|
34
|
+
onclick,
|
|
35
|
+
class: `${fullWidthClass} ${className || ''}`,
|
|
36
|
+
...rest
|
|
37
|
+
})
|
|
97
38
|
</script>
|
|
98
39
|
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<span class="{overlayClasses} absolute inset-0"></span>
|
|
107
|
-
{#if icon}
|
|
108
|
-
<div class="relative">
|
|
109
|
-
{#if shortcut}
|
|
110
|
-
<ShortcutWrapper>
|
|
111
|
-
<Icon src={icon} theme={iconTheme} class="{iconStyles} h-3 w-3 z-10" />
|
|
112
|
-
</ShortcutWrapper>
|
|
113
|
-
{:else}
|
|
114
|
-
<Icon src={icon} theme={iconTheme} class="{iconStyles} h-4 w-4 z-10" />
|
|
115
|
-
{/if}
|
|
116
|
-
{#if notification}
|
|
117
|
-
<span class="absolute top-0 right-0 w-1.5 h-1.5 bg-danger-500 rounded-full z-20"></span>
|
|
118
|
-
{/if}
|
|
119
|
-
</div>
|
|
120
|
-
{/if}
|
|
121
|
-
{#if children}
|
|
122
|
-
<span class="z-10">{@render children?.()}</span>
|
|
123
|
-
{/if}
|
|
124
|
-
</button>
|
|
40
|
+
{#if children}
|
|
41
|
+
<Button {...buttonProps}>
|
|
42
|
+
{@render children()}
|
|
43
|
+
</Button>
|
|
44
|
+
{:else}
|
|
45
|
+
<Button {...buttonProps} />
|
|
46
|
+
{/if}
|
package/dist/BaseCard.svelte
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
title = '',
|
|
9
9
|
description = '',
|
|
10
10
|
type = 'default',
|
|
11
|
-
enabled = false,
|
|
12
11
|
footer,
|
|
13
12
|
onclick,
|
|
14
13
|
...rest
|
|
@@ -16,43 +15,49 @@
|
|
|
16
15
|
</script>
|
|
17
16
|
|
|
18
17
|
<button
|
|
19
|
-
class="
|
|
18
|
+
class="flex flex-col gap-4 p-3 w-[298px] bg-background border border-border rounded-xl cursor-pointer text-left transition-colors hover:border-border-default-secondary disabled:bg-background-default-secondary disabled:cursor-not-allowed disabled:pointer-events-none"
|
|
20
19
|
disabled={type === 'soon'}
|
|
21
20
|
{...rest}
|
|
22
21
|
{onclick}
|
|
23
22
|
>
|
|
24
|
-
<div class="flex flex-col
|
|
25
|
-
<div class="flex items-
|
|
26
|
-
<div
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{#if enabled}
|
|
31
|
-
<div
|
|
32
|
-
class="flex items-center space-x-1 rounded bg-neutral-50 border border-neutral-100 py-0.5 pl-1.5 pr-[5px] text-sm text-neutral-500 font-medium"
|
|
33
|
-
>
|
|
34
|
-
<div class="bg-positive-500 h-2 w-2 rounded-full"></div>
|
|
35
|
-
<span>Enabled</span>
|
|
36
|
-
</div>
|
|
37
|
-
{/if}
|
|
38
|
-
{#if type === 'beta'}
|
|
39
|
-
<TagBeta />
|
|
40
|
-
{:else if type === 'soon'}
|
|
41
|
-
<div
|
|
42
|
-
class="flex items-center space-x-1 rounded bg-neutral-50 border border-neutral-200 py-0.5 pl-1.5 pr-[5px] text-sm text-neutral-400 font-medium"
|
|
43
|
-
>
|
|
44
|
-
<span>Soon</span>
|
|
45
|
-
</div>
|
|
46
|
-
{/if}
|
|
23
|
+
<div class="flex flex-col gap-2 w-full">
|
|
24
|
+
<div class="flex items-start justify-between w-full">
|
|
25
|
+
<div
|
|
26
|
+
class="size-8 border border-border rounded-lg overflow-hidden flex items-center justify-center shrink-0"
|
|
27
|
+
>
|
|
28
|
+
<img class="size-5 shrink-0" src={imageUrl} alt={imageAlt} />
|
|
47
29
|
</div>
|
|
30
|
+
{#if type === 'beta' || type === 'soon'}
|
|
31
|
+
<div class="flex gap-2 items-start">
|
|
32
|
+
{#if type === 'beta'}
|
|
33
|
+
<TagBeta />
|
|
34
|
+
{:else if type === 'soon'}
|
|
35
|
+
<div
|
|
36
|
+
class="flex items-center gap-2 px-[5px] py-0.5 rounded bg-background-default-secondary border border-border"
|
|
37
|
+
>
|
|
38
|
+
<span
|
|
39
|
+
class="font-medium text-xs leading-4 text-foreground-default-tertiary whitespace-nowrap"
|
|
40
|
+
>
|
|
41
|
+
Soon
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
{/if}
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
<div class="flex flex-col gap-0.5 w-full">
|
|
49
|
+
<h3 class="font-medium text-sm leading-5 tracking-[-0.07px] text-foreground w-full">
|
|
50
|
+
{title}
|
|
51
|
+
</h3>
|
|
52
|
+
<p
|
|
53
|
+
class="font-normal text-sm leading-5 tracking-[-0.07px] text-foreground-default-secondary w-full"
|
|
54
|
+
>
|
|
55
|
+
{description}
|
|
56
|
+
</p>
|
|
48
57
|
</div>
|
|
49
|
-
<h3 class="truncate text-base font-medium text-neutral-800 tracking-tight">{title}</h3>
|
|
50
58
|
</div>
|
|
51
|
-
<p class="flex mt-0.5 text-base text-neutral-500 tracking-normal flex-1">
|
|
52
|
-
{description}
|
|
53
|
-
</p>
|
|
54
59
|
{#if footer}
|
|
55
|
-
<div class="
|
|
60
|
+
<div class="shrink-0">
|
|
56
61
|
{@render footer?.()}
|
|
57
62
|
</div>
|
|
58
63
|
{/if}
|
package/dist/BaseCounter.svelte
CHANGED
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import type { BaseCounterProps } from './types'
|
|
4
4
|
|
|
5
|
-
let {
|
|
5
|
+
let { value, theme = 'light' }: BaseCounterProps = $props()
|
|
6
6
|
|
|
7
7
|
let styles = $derived(
|
|
8
8
|
clsx(
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
|
|
9
|
+
'inline-flex items-center justify-center rounded px-[3px] pb-[1.5px] pt-[2.5px] font-mono font-medium text-xs leading-none',
|
|
10
|
+
{
|
|
11
|
+
'bg-background-default-tertiary text-foreground': theme === 'light',
|
|
12
|
+
'bg-background-accent text-foreground-inverse': theme === 'accent',
|
|
13
|
+
'bg-background-selected-inverse text-foreground-inverse': theme === 'navigation'
|
|
14
|
+
}
|
|
12
15
|
)
|
|
13
16
|
)
|
|
14
17
|
</script>
|
|
15
18
|
|
|
16
|
-
<div
|
|
17
|
-
class=
|
|
18
|
-
>
|
|
19
|
-
|
|
19
|
+
<div class="p-0.5">
|
|
20
|
+
<div class={styles}>
|
|
21
|
+
<p class="flex items-center justify-center min-w-2.5">{value}</p>
|
|
22
|
+
</div>
|
|
20
23
|
</div>
|
package/dist/BaseTable.svelte
CHANGED
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
}}
|
|
242
242
|
/>
|
|
243
243
|
|
|
244
|
-
<div class="h-full w-full font-sans border rounded-md border-
|
|
244
|
+
<div class="h-full w-full font-sans border rounded-md border-border overflow-auto">
|
|
245
245
|
<Table class="hidden md:table" {...rest}>
|
|
246
246
|
<colgroup>
|
|
247
247
|
{#if selectable}
|
|
@@ -282,9 +282,7 @@
|
|
|
282
282
|
{/each}
|
|
283
283
|
{#if addExtraCell}
|
|
284
284
|
<!-- if table has actions cell we need to add an extra header -->
|
|
285
|
-
<th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md">
|
|
286
|
-
<div class="border-b border-neutral-100 h-9"></div>
|
|
287
|
-
</th>
|
|
285
|
+
<th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md"> </th>
|
|
288
286
|
{/if}
|
|
289
287
|
</TableRow>
|
|
290
288
|
</TableHeader>
|
|
@@ -295,17 +293,17 @@
|
|
|
295
293
|
<th
|
|
296
294
|
scope="colgroup"
|
|
297
295
|
colspan={fields.length + (selectable ? 2 : 1)}
|
|
298
|
-
class="bg-white text-left text-sm font-medium text-
|
|
296
|
+
class="bg-white text-left text-sm font-medium text-foreground-default-secondary sticky top-9 tracking-normal h-8 z-10"
|
|
299
297
|
>
|
|
300
298
|
<span
|
|
301
299
|
class:border-t={i > 0}
|
|
302
300
|
class:pl-12={selectable}
|
|
303
301
|
class:pl-3={!selectable}
|
|
304
|
-
class="flex items-center space-x-1 box-border border-b border-
|
|
302
|
+
class="flex items-center space-x-1 box-border border-b border-border h-8"
|
|
305
303
|
>
|
|
306
304
|
<span>{group.label}</span>
|
|
307
305
|
{#if !hideCounter}
|
|
308
|
-
<BaseCounter
|
|
306
|
+
<BaseCounter value={group.rows.length} />
|
|
309
307
|
{/if}
|
|
310
308
|
</span>
|
|
311
309
|
</th>
|
|
@@ -364,7 +362,7 @@
|
|
|
364
362
|
{#each group.rows as row}
|
|
365
363
|
<button
|
|
366
364
|
class:cursor-default={disableRowClick}
|
|
367
|
-
class="w-full text-left border border-neutral-
|
|
365
|
+
class="w-full text-left border border-neutral-20 rounded"
|
|
368
366
|
onclick={() => {
|
|
369
367
|
if (disableRowClick) return
|
|
370
368
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<div class="flex flex-col">
|
|
21
|
-
<span class="md:hidden text-sm text-neutral-
|
|
21
|
+
<span class="md:hidden text-sm text-neutral-60 font-normal">
|
|
22
22
|
{field.headerLabel}
|
|
23
23
|
</span>
|
|
24
24
|
<span class="flex items-center" class:justify-end={field.rightAlign}>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
{#if icons}
|
|
47
47
|
<span class:ml-2={!!data} class="flex items-center gap-1 shrink-0">
|
|
48
48
|
{#each icons as icon}
|
|
49
|
-
<div class="border border-neutral-
|
|
49
|
+
<div class="border border-neutral-20 rounded-md p-px">
|
|
50
50
|
{#if typeof icon === 'string'}
|
|
51
51
|
<img alt="icon" src={icon} class="h-4 w-4" />
|
|
52
52
|
{:else}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
let headerStyles = $derived(
|
|
17
17
|
clsx({
|
|
18
|
-
'hover:bg-neutral-
|
|
18
|
+
'hover:bg-neutral-5 focus:bg-neutral-10': field.sortable
|
|
19
19
|
})
|
|
20
20
|
)
|
|
21
21
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
fill="none"
|
|
39
39
|
xmlns="http://www.w3.org/2000/svg"
|
|
40
40
|
class:rotate-180={sortDirection === 'asc'}
|
|
41
|
-
class="mt-px text-neutral-
|
|
41
|
+
class="mt-px text-neutral-40 h-3 w-3"
|
|
42
42
|
>
|
|
43
43
|
<path
|
|
44
44
|
fill-rule="evenodd"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { BreadcrumbProps } from './types.js'
|
|
3
|
+
import BaseFlag from './BaseFlag.svelte'
|
|
4
|
+
import clsx from 'clsx'
|
|
5
|
+
|
|
6
|
+
let { breadcrumb, isLast, oncopied }: BreadcrumbProps = $props()
|
|
7
|
+
|
|
8
|
+
let textStyles = $derived(
|
|
9
|
+
clsx('font-sans text-base leading-6 tracking-[-0.16px] whitespace-nowrap', {
|
|
10
|
+
'text-foreground-default-secondary font-normal': !isLast,
|
|
11
|
+
'text-foreground font-medium': isLast,
|
|
12
|
+
'cursor-pointer': breadcrumb.copiable
|
|
13
|
+
})
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
async function handleClick(event: MouseEvent) {
|
|
17
|
+
event.stopPropagation()
|
|
18
|
+
await navigator.clipboard.writeText(breadcrumb.label)
|
|
19
|
+
oncopied?.(breadcrumb.label)
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<li class="flex items-center gap-1">
|
|
24
|
+
{#if breadcrumb.url}
|
|
25
|
+
<a href={breadcrumb.url} class={textStyles}>
|
|
26
|
+
{breadcrumb.label}
|
|
27
|
+
</a>
|
|
28
|
+
{:else if breadcrumb.copiable}
|
|
29
|
+
<button class={textStyles} onclick={handleClick}>
|
|
30
|
+
{breadcrumb.label}
|
|
31
|
+
</button>
|
|
32
|
+
{:else}
|
|
33
|
+
<span class={textStyles}>
|
|
34
|
+
{breadcrumb.label}
|
|
35
|
+
</span>
|
|
36
|
+
{/if}
|
|
37
|
+
{#if breadcrumb.country}
|
|
38
|
+
<BaseFlag country={breadcrumb.country} width={14} />
|
|
39
|
+
{/if}
|
|
40
|
+
</li>
|
package/dist/Breadcrumbs.svelte
CHANGED
|
@@ -1,43 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { BreadcrumbsProps } from './types.js'
|
|
3
3
|
import { Slash } from '@invopop/ui-icons'
|
|
4
|
-
import
|
|
4
|
+
import Breadcrumb from './Breadcrumb.svelte'
|
|
5
5
|
import { Icon } from '@steeze-ui/svelte-icon'
|
|
6
6
|
|
|
7
7
|
let { breadcrumbs = [], oncopied }: BreadcrumbsProps = $props()
|
|
8
|
-
|
|
9
|
-
async function handleClick(event: MouseEvent, label: string) {
|
|
10
|
-
event.stopPropagation()
|
|
11
|
-
await navigator.clipboard.writeText(label)
|
|
12
|
-
oncopied?.(label)
|
|
13
|
-
}
|
|
14
8
|
</script>
|
|
15
9
|
|
|
16
|
-
<ul class="flex items-center
|
|
10
|
+
<ul class="flex items-center gap-1">
|
|
17
11
|
{#each breadcrumbs as breadcrumb, i}
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
<a href={breadcrumb.url}>
|
|
21
|
-
<span class:text-neutral-400={i < breadcrumbs.length - 1}>{breadcrumb.label}</span>
|
|
22
|
-
</a>
|
|
23
|
-
{:else if breadcrumb.copiable}
|
|
24
|
-
<button
|
|
25
|
-
class="cursor-pointer {i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}"
|
|
26
|
-
onclick={(e) => handleClick(e, breadcrumb.label)}
|
|
27
|
-
>
|
|
28
|
-
{breadcrumb.label}
|
|
29
|
-
</button>
|
|
30
|
-
{:else}
|
|
31
|
-
<span class={i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}>
|
|
32
|
-
{breadcrumb.label}
|
|
33
|
-
</span>
|
|
34
|
-
{/if}
|
|
35
|
-
{#if breadcrumb.country}
|
|
36
|
-
<BaseFlag country={breadcrumb.country} width={14} />
|
|
37
|
-
{/if}
|
|
38
|
-
</li>
|
|
12
|
+
<Breadcrumb {breadcrumb} isLast={i === breadcrumbs.length - 1} {oncopied} />
|
|
13
|
+
|
|
39
14
|
{#if i < breadcrumbs.length - 1}
|
|
40
|
-
<Icon src={Slash} class="
|
|
15
|
+
<Icon src={Slash} class="size-4 text-icon-default-secondary" />
|
|
41
16
|
{/if}
|
|
42
17
|
{/each}
|
|
43
18
|
</ul>
|
package/dist/ButtonFile.svelte
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import BaseButton from './BaseButton.svelte'
|
|
2
|
+
import { Download } from '@invopop/ui-icons'
|
|
3
|
+
import Button from './button/button.svelte'
|
|
5
4
|
import type { ButtonFileProps } from './types.js'
|
|
6
|
-
import
|
|
5
|
+
import { cn } from './utils.js'
|
|
7
6
|
|
|
8
7
|
let {
|
|
9
|
-
icon = Invoice,
|
|
10
8
|
name = '',
|
|
11
9
|
disabled = false,
|
|
12
10
|
date = '',
|
|
13
|
-
|
|
11
|
+
fileType = 'pdf',
|
|
14
12
|
onPreview,
|
|
15
13
|
onDownload,
|
|
14
|
+
class: className,
|
|
16
15
|
...rest
|
|
17
16
|
}: ButtonFileProps = $props()
|
|
18
17
|
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'border-neutral-100 bg-neutral-50 text-neutral-500': iconColor === 'grey'
|
|
29
|
-
})
|
|
18
|
+
let fileAvatarStyles = $derived(
|
|
19
|
+
cn(
|
|
20
|
+
'size-8 rounded-md border border-border flex items-center justify-center text-xs font-black font-mono leading-4 uppercase',
|
|
21
|
+
{
|
|
22
|
+
'text-foreground-document-pdf': fileType === 'pdf',
|
|
23
|
+
'text-foreground-document-xml': fileType === 'xml',
|
|
24
|
+
'text-foreground-document-png': fileType === 'png'
|
|
25
|
+
}
|
|
26
|
+
)
|
|
30
27
|
)
|
|
31
28
|
|
|
32
29
|
function handleClick(event: MouseEvent) {
|
|
@@ -36,27 +33,35 @@
|
|
|
36
33
|
</script>
|
|
37
34
|
|
|
38
35
|
<button
|
|
39
|
-
class
|
|
40
|
-
|
|
36
|
+
class={cn(
|
|
37
|
+
'flex items-center gap-3 px-2 py-1.5 rounded-[10px] w-full hover:bg-background-default-secondary',
|
|
38
|
+
disabled && 'opacity-30 pointer-events-none',
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
41
|
{disabled}
|
|
42
42
|
{...rest}
|
|
43
43
|
onclick={handleClick}
|
|
44
44
|
>
|
|
45
|
-
<
|
|
46
|
-
<div class=
|
|
47
|
-
|
|
45
|
+
<div class="flex items-center gap-[10px] flex-1 min-w-0">
|
|
46
|
+
<div class={fileAvatarStyles}>
|
|
47
|
+
{fileType}
|
|
48
48
|
</div>
|
|
49
|
-
<div class="flex flex-col
|
|
50
|
-
<
|
|
49
|
+
<div class="flex flex-col text-start min-w-0 flex-1">
|
|
50
|
+
<div class="text-sm font-medium text-foreground truncate w-full">
|
|
51
51
|
{name}
|
|
52
|
-
</
|
|
53
|
-
<
|
|
52
|
+
</div>
|
|
53
|
+
<div class="text-xs text-foreground-default-secondary truncate w-full">
|
|
54
|
+
{date}
|
|
55
|
+
</div>
|
|
54
56
|
</div>
|
|
55
|
-
</
|
|
56
|
-
<
|
|
57
|
-
|
|
57
|
+
</div>
|
|
58
|
+
<Button
|
|
59
|
+
variant="secondary"
|
|
60
|
+
size="md"
|
|
58
61
|
icon={Download}
|
|
59
|
-
|
|
62
|
+
{disabled}
|
|
63
|
+
onclick={(e) => {
|
|
64
|
+
e.stopPropagation()
|
|
60
65
|
onDownload?.()
|
|
61
66
|
}}
|
|
62
67
|
/>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
<BaseButton
|
|
30
30
|
{disabled}
|
|
31
|
-
|
|
31
|
+
size="lg"
|
|
32
32
|
icon={Duplicate}
|
|
33
33
|
iconPosition="right"
|
|
34
34
|
onclick={async () => {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
oncopied?.(uuid)
|
|
37
37
|
}}
|
|
38
38
|
>
|
|
39
|
-
<span class="font-mono
|
|
39
|
+
<span class="font-mono">{formattedUuid}</span>
|
|
40
40
|
</BaseButton>
|
package/dist/CardCheckbox.svelte
CHANGED
|
@@ -11,47 +11,51 @@
|
|
|
11
11
|
description = '',
|
|
12
12
|
accentText = '',
|
|
13
13
|
checked = false,
|
|
14
|
+
disabled = false,
|
|
14
15
|
icon = undefined,
|
|
15
16
|
hideRadio = false,
|
|
16
17
|
footer,
|
|
17
18
|
onchange
|
|
18
19
|
}: CardCheckboxProps = $props()
|
|
19
20
|
|
|
20
|
-
let
|
|
21
|
-
clsx(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
let containerStyles = $derived(
|
|
22
|
+
clsx('border gap-3 py-2 pr-2 pl-3 flex items-start rounded-xl', {
|
|
23
|
+
'border-foreground-selected': checked,
|
|
24
|
+
'border-border': !checked,
|
|
25
|
+
'bg-background-default-secondary': disabled
|
|
26
|
+
})
|
|
25
27
|
)
|
|
26
28
|
</script>
|
|
27
29
|
|
|
28
|
-
<label for={id} class="
|
|
29
|
-
<div class=
|
|
30
|
-
<div class="flex
|
|
30
|
+
<label for={id} class="cursor-pointer">
|
|
31
|
+
<div class={containerStyles}>
|
|
32
|
+
<div class="flex grow items-start gap-1 min-w-0">
|
|
31
33
|
{#if icon}
|
|
32
|
-
<Icon src={icon} class="
|
|
34
|
+
<Icon src={icon} class="size-5 text-icon shrink-0" />
|
|
33
35
|
{/if}
|
|
34
|
-
<div class="flex flex-col
|
|
35
|
-
<span class="text-base
|
|
36
|
+
<div class="flex flex-col gap-1 min-w-0">
|
|
37
|
+
<span class="text-base font-medium text-foreground">
|
|
38
|
+
{title}
|
|
39
|
+
</span>
|
|
36
40
|
{#if description}
|
|
37
|
-
<span class="
|
|
41
|
+
<span class="text-sm text-foreground-default-secondary">
|
|
38
42
|
{#if accentText}
|
|
39
|
-
<
|
|
43
|
+
<span class="font-medium text-foreground-accent">{accentText}</span>
|
|
44
|
+
{' · '}
|
|
40
45
|
{/if}
|
|
41
|
-
|
|
42
|
-
{description}
|
|
43
|
-
</p>
|
|
46
|
+
{description}
|
|
44
47
|
</span>
|
|
45
48
|
{/if}
|
|
46
49
|
</div>
|
|
47
50
|
</div>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
{#if !hideRadio}
|
|
52
|
+
<div class="flex items-center p-px">
|
|
53
|
+
<InputRadio {id} {name} {checked} {disabled} {onchange} />
|
|
54
|
+
</div>
|
|
55
|
+
{/if}
|
|
52
56
|
</div>
|
|
53
57
|
{#if footer}
|
|
54
|
-
<div class="bg-
|
|
58
|
+
<div class="border-t border-border bg-background-default-secondary rounded-b-xl px-3 pb-3 pt-2">
|
|
55
59
|
{@render footer?.()}
|
|
56
60
|
</div>
|
|
57
61
|
{/if}
|