@invopop/popui 0.1.14 → 0.1.16
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/BaseDropdown.svelte +3 -3
- package/dist/BaseTable.svelte +8 -12
- package/dist/BaseTableActions.svelte +4 -6
- package/dist/BaseTableCellContent.svelte +4 -6
- package/dist/BaseTableCheckbox.svelte +8 -10
- package/dist/BaseTableHeaderContent.svelte +4 -4
- package/dist/BaseTableRow.svelte +12 -10
- 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 +3 -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 +14 -12
- package/dist/DrawerContext.svelte +111 -8
- package/dist/DrawerContextItem.svelte +18 -30
- package/dist/DrawerContextSeparator.svelte +1 -1
- package/dist/DrawerContextWorkspace.svelte +7 -7
- package/dist/DropdownSelect.svelte +38 -16
- package/dist/EmptyState.svelte +42 -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/FeedIconStatus.svelte +1 -1
- package/dist/FeedItem.svelte +8 -8
- package/dist/FeedItemDetail.svelte +15 -6
- 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/MenuItem.svelte +9 -8
- package/dist/MenuItemCollapsible.svelte +4 -4
- package/dist/Notification.svelte +59 -24
- package/dist/ProfileAvatar.svelte +43 -14
- package/dist/SeparatorHorizontal.svelte +2 -2
- package/dist/ShortcutWrapper.svelte +14 -5
- package/dist/StatusLabel.svelte +4 -5
- package/dist/StepIconList.svelte +11 -9
- package/dist/TagBeta.svelte +26 -14
- package/dist/TagStatus.svelte +37 -49
- 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 +198 -24
- package/dist/button/button.svelte.d.ts +48 -26
- package/dist/index.d.ts +5 -10
- package/dist/index.js +3 -13
- 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/sonner/sonner.svelte +7 -9
- 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 +8 -2
- package/dist/tabs/tabs-list.svelte.d.ts +4 -1
- package/dist/tabs/tabs-trigger.svelte +5 -3
- package/dist/tabs/tabs-trigger.svelte.d.ts +4 -1
- package/dist/tailwind.theme.css +981 -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/BaseDropdown.svelte
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
fullWidth = false,
|
|
11
11
|
placement = 'bottom-end',
|
|
12
12
|
matchParentWidth = false,
|
|
13
|
+
class: className = '',
|
|
13
14
|
trigger,
|
|
14
15
|
children,
|
|
15
16
|
...rest
|
|
@@ -49,10 +50,9 @@
|
|
|
49
50
|
}
|
|
50
51
|
</script>
|
|
51
52
|
|
|
52
|
-
<div class="
|
|
53
|
+
<div class="flex {className}" class:w-full={fullWidth} role="menu">
|
|
53
54
|
<button
|
|
54
|
-
class="cursor-pointer text-left"
|
|
55
|
-
class:w-full={fullWidth}
|
|
55
|
+
class="cursor-pointer text-left w-full min-w-0"
|
|
56
56
|
use:floatingRef
|
|
57
57
|
{...rest}
|
|
58
58
|
onclick={handleClick}
|
package/dist/BaseTable.svelte
CHANGED
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
}}
|
|
242
242
|
/>
|
|
243
243
|
|
|
244
|
-
<div class="h-full w-full font-sans
|
|
244
|
+
<div class="h-full w-full font-sans rounded-md overflow-auto">
|
|
245
245
|
<Table class="hidden md:table" {...rest}>
|
|
246
246
|
<colgroup>
|
|
247
247
|
{#if selectable}
|
|
@@ -261,7 +261,6 @@
|
|
|
261
261
|
<TableHead class="bg-white sticky top-0 z-10 p-0 h-9">
|
|
262
262
|
{#if !hideSelectAll}
|
|
263
263
|
<BaseTableCheckbox
|
|
264
|
-
hidden={!selectedRows.length}
|
|
265
264
|
{indeterminate}
|
|
266
265
|
checked={allChecked}
|
|
267
266
|
onChecked={() => {
|
|
@@ -282,9 +281,7 @@
|
|
|
282
281
|
{/each}
|
|
283
282
|
{#if addExtraCell}
|
|
284
283
|
<!-- 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>
|
|
284
|
+
<th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md"> </th>
|
|
288
285
|
{/if}
|
|
289
286
|
</TableRow>
|
|
290
287
|
</TableHeader>
|
|
@@ -295,17 +292,16 @@
|
|
|
295
292
|
<th
|
|
296
293
|
scope="colgroup"
|
|
297
294
|
colspan={fields.length + (selectable ? 2 : 1)}
|
|
298
|
-
class="bg-white text-left text-
|
|
295
|
+
class="bg-white text-left text-base font-normal text-foreground-default-secondary sticky top-9 tracking-normal h-8 z-10"
|
|
299
296
|
>
|
|
300
297
|
<span
|
|
301
|
-
class:
|
|
302
|
-
class:pl-
|
|
303
|
-
class
|
|
304
|
-
class="flex items-center space-x-1 box-border border-b border-neutral-100 h-8"
|
|
298
|
+
class:pl-13={selectable}
|
|
299
|
+
class:pl-6={!selectable}
|
|
300
|
+
class="flex items-center space-x-1 box-border border-b border-border h-9"
|
|
305
301
|
>
|
|
306
302
|
<span>{group.label}</span>
|
|
307
303
|
{#if !hideCounter}
|
|
308
|
-
<BaseCounter
|
|
304
|
+
<BaseCounter value={group.rows.length} />
|
|
309
305
|
{/if}
|
|
310
306
|
</span>
|
|
311
307
|
</th>
|
|
@@ -364,7 +360,7 @@
|
|
|
364
360
|
{#each group.rows as row}
|
|
365
361
|
<button
|
|
366
362
|
class:cursor-default={disableRowClick}
|
|
367
|
-
class="w-full text-left border border-neutral-
|
|
363
|
+
class="w-full text-left border border-neutral-20 rounded"
|
|
368
364
|
onclick={() => {
|
|
369
365
|
if (disableRowClick) return
|
|
370
366
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import DrawerContext from './DrawerContext.svelte'
|
|
6
6
|
import { Options } from '@invopop/ui-icons'
|
|
7
7
|
import clsx from 'clsx'
|
|
8
|
+
import BaseButton from './BaseButton.svelte'
|
|
8
9
|
|
|
9
10
|
let { actions, onclick }: BaseTableActionsProps = $props()
|
|
10
11
|
|
|
@@ -23,8 +24,8 @@
|
|
|
23
24
|
|
|
24
25
|
let overlayClasses = $derived(
|
|
25
26
|
clsx({
|
|
26
|
-
'group-hover:bg-
|
|
27
|
-
'bg-
|
|
27
|
+
'group-hover:bg-foreground/[.05]': !isOpen,
|
|
28
|
+
'bg-foreground/[.1]': isOpen
|
|
28
29
|
})
|
|
29
30
|
)
|
|
30
31
|
|
|
@@ -34,10 +35,7 @@
|
|
|
34
35
|
</script>
|
|
35
36
|
|
|
36
37
|
{#snippet trigger()}
|
|
37
|
-
<
|
|
38
|
-
<span class="{overlayClasses} absolute inset-0 rounded"></span>
|
|
39
|
-
<Icon src={Options} class="w-4 text-neutral-500" />
|
|
40
|
-
</div>
|
|
38
|
+
<BaseButton variant="ghost" aria-label="Row actions" icon={Options} />
|
|
41
39
|
{/snippet}
|
|
42
40
|
|
|
43
41
|
<BaseDropdown bind:isOpen bind:this={actionDropdown} {trigger}>
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<div class="flex flex-col">
|
|
21
|
-
<span class="md:hidden text-sm
|
|
21
|
+
<span class="md:hidden text-sm font-normal">
|
|
22
22
|
{field.headerLabel}
|
|
23
23
|
</span>
|
|
24
|
-
<span class="flex items-center" class:justify-end={field.rightAlign}>
|
|
24
|
+
<span class="flex items-center gap-2" class:justify-end={field.rightAlign}>
|
|
25
25
|
{#if field.isCountry && data}
|
|
26
26
|
<span class="flex items-center space-x-1">
|
|
27
27
|
<BaseFlag country={String(data)} width={16} />
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
<span class="md:hidden">{data ? data : badge || status ? '' : '-'}</span>
|
|
35
35
|
{/if}
|
|
36
36
|
{#if badge}
|
|
37
|
-
<
|
|
38
|
-
<TagStatus label={badge.label} status={badge.status} dot={Boolean(badge.dot)} />
|
|
39
|
-
</span>
|
|
37
|
+
<TagStatus label={badge.label} status={badge.status} dot={Boolean(badge.dot)} />
|
|
40
38
|
{/if}
|
|
41
39
|
{#if status}
|
|
42
40
|
<span class:ml-2={!!data}>
|
|
@@ -46,7 +44,7 @@
|
|
|
46
44
|
{#if icons}
|
|
47
45
|
<span class:ml-2={!!data} class="flex items-center gap-1 shrink-0">
|
|
48
46
|
{#each icons as icon}
|
|
49
|
-
<div class="border border-neutral-
|
|
47
|
+
<div class="border border-neutral-20 rounded-md p-px">
|
|
50
48
|
{#if typeof icon === 'string'}
|
|
51
49
|
<img alt="icon" src={icon} class="h-4 w-4" />
|
|
52
50
|
{:else}
|
|
@@ -20,16 +20,14 @@
|
|
|
20
20
|
role="checkbox"
|
|
21
21
|
aria-checked={checked}
|
|
22
22
|
bind:this={checkboxButton}
|
|
23
|
-
class="
|
|
23
|
+
class="h-full w-full flex items-center justify-center outline-none group cursor-default"
|
|
24
24
|
onclick={handleClick}
|
|
25
25
|
>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
26
|
+
<InputCheckbox
|
|
27
|
+
{checked}
|
|
28
|
+
{indeterminate}
|
|
29
|
+
onchange={(changed) => {
|
|
30
|
+
onChecked?.(changed)
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
35
33
|
</button>
|
|
@@ -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
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
{#if field.sortable}
|
|
30
30
|
{#snippet trigger()}
|
|
31
31
|
<span
|
|
32
|
-
class="{headerStyles} w-full
|
|
32
|
+
class="{headerStyles} w-full px-3 py-2.5 flex items-center justify-start space-x-1 text-left text-base tracking-normal whitespace-nowrap font-normal"
|
|
33
33
|
>
|
|
34
34
|
<span class="w-full" class:text-right={field.rightAlign}>{field.headerLabel}</span>
|
|
35
35
|
{#if sortBy === field.slug}
|
|
@@ -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"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</BaseDropdown>
|
|
60
60
|
{:else}
|
|
61
61
|
<div
|
|
62
|
-
class="{headerStyles}
|
|
62
|
+
class="{headerStyles} px-3 py-2.5 text-left text-base font-normal tracking-normal whitespace-nowrap"
|
|
63
63
|
>
|
|
64
64
|
<div class="h-5">{field.headerLabel}</div>
|
|
65
65
|
</div>
|
package/dist/BaseTableRow.svelte
CHANGED
|
@@ -87,19 +87,21 @@
|
|
|
87
87
|
>
|
|
88
88
|
{#if selectable}
|
|
89
89
|
<TableCell>
|
|
90
|
-
<BaseTableCheckbox
|
|
91
|
-
bind:checkboxButton
|
|
92
|
-
{checked}
|
|
93
|
-
hidden={selectedRows.length === 0}
|
|
94
|
-
{onChecked}
|
|
95
|
-
/>
|
|
90
|
+
<BaseTableCheckbox bind:checkboxButton {checked} {onChecked} />
|
|
96
91
|
</TableCell>
|
|
97
92
|
{/if}
|
|
98
93
|
{#each fields as field, i (i)}
|
|
94
|
+
{@const extraPaddingLeft = i === 0 && !selectable}
|
|
95
|
+
{@const extraPaddingRight = i === fields.length - 1 && !actions.length}
|
|
99
96
|
<TableCell
|
|
100
|
-
class=
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
class={clsx({
|
|
98
|
+
'font-medium': i === 0,
|
|
99
|
+
'pl-6': extraPaddingLeft,
|
|
100
|
+
'pl-3': !extraPaddingLeft,
|
|
101
|
+
'pr-6': extraPaddingRight,
|
|
102
|
+
'pr-3': !extraPaddingRight,
|
|
103
|
+
'py-2': field.copy
|
|
104
|
+
})}
|
|
103
105
|
>
|
|
104
106
|
<BaseTableCellContent
|
|
105
107
|
{field}
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
</TableCell>
|
|
113
115
|
{/each}
|
|
114
116
|
{#if actions.length}
|
|
115
|
-
<TableCell>
|
|
117
|
+
<TableCell class="py-2">
|
|
116
118
|
<BaseTableActions
|
|
117
119
|
bind:this={actionsDropdown}
|
|
118
120
|
{actions}
|
|
@@ -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>
|