@invopop/popui 0.1.3 → 0.1.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog.svelte +10 -11
- package/dist/BaseButton.svelte +29 -104
- package/dist/BaseCard.svelte +35 -30
- package/dist/BaseCounter.svelte +11 -8
- package/dist/BaseDropdown.svelte +5 -5
- package/dist/BaseFlag.svelte +5 -3
- package/dist/BaseFlag.svelte.d.ts +1 -0
- package/dist/BaseTable.svelte +16 -16
- package/dist/BaseTable.svelte.d.ts +1 -1
- package/dist/BaseTableActions.svelte +4 -6
- package/dist/BaseTableCellContent.svelte +9 -21
- package/dist/BaseTableCheckbox.svelte +9 -11
- package/dist/BaseTableHeaderContent.svelte +4 -4
- package/dist/BaseTableHeaderOrderBy.svelte +23 -12
- 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 +40 -30
- package/dist/ButtonUuidCopy.svelte +6 -3
- package/dist/CardCheckbox.svelte +45 -32
- package/dist/CardCheckbox.svelte.d.ts +1 -1
- package/dist/CardRelation.svelte +12 -13
- package/dist/CompanySelector.svelte +35 -7
- package/dist/CounterWidget.svelte +52 -0
- package/dist/CounterWidget.svelte.d.ts +4 -0
- package/dist/DataListItem.svelte +14 -10
- package/dist/DatePicker.svelte +20 -17
- package/dist/DrawerContext.svelte +207 -15
- package/dist/DrawerContextItem.svelte +50 -50
- package/dist/DrawerContextSeparator.svelte +1 -1
- package/dist/DropdownSelect.svelte +81 -22
- package/dist/DropdownSelectGroup.svelte +15 -0
- package/dist/DropdownSelectGroup.svelte.d.ts +7 -0
- package/dist/EmptyState.svelte +42 -0
- package/dist/EmptyState.svelte.d.ts +4 -0
- package/dist/FeedEvents.svelte +9 -5
- package/dist/FeedIconEvent.svelte +2 -2
- package/dist/FeedIconStatus.svelte +4 -4
- package/dist/FeedItem.svelte +10 -11
- package/dist/FeedItemDetail.svelte +32 -6
- package/dist/FeedViewer.svelte +1 -1
- 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 +29 -13
- package/dist/InputRadio.svelte.d.ts +1 -1
- 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 +16 -11
- package/dist/MenuItemCollapsible.svelte +7 -7
- package/dist/Notification.svelte +60 -25
- package/dist/ProfileAvatar.svelte +43 -14
- package/dist/ProgressBar.svelte +42 -0
- package/dist/ProgressBar.svelte.d.ts +4 -0
- package/dist/ProgressBarCircle.svelte +46 -0
- package/dist/ProgressBarCircle.svelte.d.ts +4 -0
- 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/TagProgress.svelte +28 -0
- package/dist/TagProgress.svelte.d.ts +4 -0
- package/dist/TagSearch.svelte +4 -4
- package/dist/TagStatus.svelte +32 -34
- 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 +8 -4
- package/dist/alert-dialog/alert-dialog-cancel.svelte +7 -3
- 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-overlay.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-title.svelte +1 -1
- package/dist/alert-dialog/alert-dialog-trigger.svelte +4 -2
- package/dist/button/button.svelte +224 -24
- package/dist/button/button.svelte.d.ts +77 -26
- package/dist/clickOutside.d.ts +5 -2
- package/dist/clickOutside.js +9 -3
- package/dist/data-table/cells/boolean-cell.svelte +16 -0
- package/dist/data-table/cells/boolean-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/currency-cell.svelte +10 -0
- package/dist/data-table/cells/currency-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/date-cell.svelte +10 -0
- package/dist/data-table/cells/date-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/tag-cell.svelte +12 -0
- package/dist/data-table/cells/tag-cell.svelte.d.ts +8 -0
- package/dist/data-table/cells/text-cell.svelte +10 -0
- package/dist/data-table/cells/text-cell.svelte.d.ts +8 -0
- package/dist/data-table/column-definitions.d.ts +12 -0
- package/dist/data-table/column-definitions.js +42 -0
- package/dist/data-table/column-sizing-helpers.d.ts +6 -0
- package/dist/data-table/column-sizing-helpers.js +24 -0
- package/dist/data-table/create-columns.d.ts +3 -0
- package/dist/data-table/create-columns.js +50 -0
- package/dist/data-table/data-table-pagination.svelte +173 -0
- package/dist/data-table/data-table-pagination.svelte.d.ts +4 -0
- package/dist/data-table/data-table-svelte.svelte.d.ts +40 -0
- package/dist/data-table/data-table-svelte.svelte.js +111 -0
- package/dist/data-table/data-table-toolbar.svelte +16 -0
- package/dist/data-table/data-table-toolbar.svelte.d.ts +29 -0
- package/dist/data-table/data-table-types.d.ts +75 -0
- package/dist/data-table/data-table-types.js +1 -0
- package/dist/data-table/data-table-view-options.svelte +88 -0
- package/dist/data-table/data-table-view-options.svelte.d.ts +27 -0
- package/dist/data-table/data-table.svelte +323 -0
- package/dist/data-table/data-table.svelte.d.ts +25 -0
- package/dist/data-table/flex-render.svelte +40 -0
- package/dist/data-table/flex-render.svelte.d.ts +33 -0
- package/dist/data-table/index.d.ts +13 -0
- package/dist/data-table/index.js +13 -0
- package/dist/data-table/render-helpers.d.ts +90 -0
- package/dist/data-table/render-helpers.js +99 -0
- package/dist/data-table/table-setup.d.ts +36 -0
- package/dist/data-table/table-setup.js +130 -0
- package/dist/data-table/table-styles.d.ts +17 -0
- package/dist/data-table/table-styles.js +49 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.js +3 -0
- package/dist/index.d.ts +16 -7
- package/dist/index.js +33 -14
- package/dist/range-calendar/range-calendar-cell.svelte +1 -1
- package/dist/range-calendar/range-calendar-day.svelte +11 -12
- package/dist/range-calendar/range-calendar-head-cell.svelte +1 -1
- package/dist/range-calendar/range-calendar-header.svelte +1 -1
- package/dist/range-calendar/range-calendar-month-select.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/index.d.ts +1 -0
- package/dist/sonner/index.js +1 -0
- package/dist/sonner/sonner.svelte +44 -0
- package/dist/sonner/sonner.svelte.d.ts +4 -0
- package/dist/svg/CheckBadge.svelte +18 -0
- package/dist/svg/CheckBadge.svelte.d.ts +26 -0
- package/dist/svg/IconDelivery.svelte +86 -0
- package/dist/svg/IconDelivery.svelte.d.ts +20 -0
- package/dist/svg/IconEmpty.svelte +113 -121
- package/dist/svg/IconOrder.svelte +81 -0
- package/dist/svg/IconOrder.svelte.d.ts +20 -0
- package/dist/svg/IconPayment.svelte +86 -0
- package/dist/svg/IconPayment.svelte.d.ts +20 -0
- package/dist/table/table-body.svelte +5 -1
- package/dist/table/table-cell.svelte +4 -2
- package/dist/table/table-footer.svelte +1 -1
- package/dist/table/table-head.svelte +4 -2
- package/dist/table/table-header.svelte +1 -1
- package/dist/table/table-row.svelte +4 -2
- package/dist/table/table.svelte +2 -2
- 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 +998 -0
- package/dist/tooltip/tooltip-content.svelte +2 -2
- package/dist/types.d.ts +76 -50
- package/package.json +20 -10
- package/dist/CounterWorkflow.svelte +0 -19
- package/dist/CounterWorkflow.svelte.d.ts +0 -4
- package/dist/DrawerContextWorkspace.svelte +0 -126
- package/dist/DrawerContextWorkspace.svelte.d.ts +0 -4
- package/dist/EmptyStateIcon.svelte +0 -52
- package/dist/EmptyStateIcon.svelte.d.ts +0 -4
- package/dist/EmptyStateIllustration.svelte +0 -66
- package/dist/EmptyStateIllustration.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
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { SortAscending, SortDescending } from '@invopop/ui-icons'
|
|
2
|
+
import { SortAscending, SortDescending, Preview } from '@invopop/ui-icons'
|
|
3
3
|
import type { TableSortBy, DrawerOption, BaseTableHeaderOrderByProps } from './types.js'
|
|
4
4
|
import DrawerContext from './DrawerContext.svelte'
|
|
5
5
|
|
|
6
|
-
let { isActive = false, sortDirection, onOrderBy }: BaseTableHeaderOrderByProps = $props()
|
|
6
|
+
let { isActive = false, sortDirection, onOrderBy, onHide }: BaseTableHeaderOrderByProps = $props()
|
|
7
7
|
|
|
8
|
-
let items = $derived(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
let items = $derived([
|
|
9
|
+
{
|
|
10
|
+
icon: SortAscending,
|
|
11
|
+
label: 'Sort Ascending',
|
|
12
|
+
value: 'asc',
|
|
13
|
+
selected: isActive && sortDirection === 'asc'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
icon: SortDescending,
|
|
17
|
+
label: 'Sort Descending',
|
|
18
|
+
value: 'desc',
|
|
19
|
+
selected: isActive && sortDirection === 'desc'
|
|
20
|
+
},
|
|
21
|
+
{ label: '', value: '', separator: true },
|
|
22
|
+
{ icon: Preview, label: 'Hide', value: 'hide' }
|
|
23
|
+
] as DrawerOption[])
|
|
17
24
|
</script>
|
|
18
25
|
|
|
19
26
|
<DrawerContext
|
|
20
27
|
{items}
|
|
21
28
|
onclick={(e) => {
|
|
22
|
-
|
|
29
|
+
if (e === 'hide') {
|
|
30
|
+
onHide?.()
|
|
31
|
+
} else {
|
|
32
|
+
onOrderBy?.(e as TableSortBy)
|
|
33
|
+
}
|
|
23
34
|
}}
|
|
24
35
|
/>
|
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-lg 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} />
|
|
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={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,30 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import BaseButton from './BaseButton.svelte'
|
|
2
|
+
import { Download, Invoice } 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'
|
|
6
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
|
-
icon = Invoice,
|
|
10
9
|
name = '',
|
|
11
10
|
disabled = false,
|
|
12
11
|
date = '',
|
|
13
|
-
|
|
12
|
+
fileType = 'pdf',
|
|
14
13
|
onPreview,
|
|
15
14
|
onDownload,
|
|
15
|
+
class: className,
|
|
16
16
|
...rest
|
|
17
17
|
}: ButtonFileProps = $props()
|
|
18
18
|
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'border-neutral-100 bg-neutral-50 text-neutral-500': iconColor === 'grey'
|
|
29
|
-
})
|
|
19
|
+
let fileAvatarStyles = $derived(
|
|
20
|
+
cn(
|
|
21
|
+
'size-8 rounded-md border border-border flex items-center justify-center text-sm font-black font-mono leading-4 uppercase',
|
|
22
|
+
{
|
|
23
|
+
'text-foreground-document-pdf': fileType === 'pdf',
|
|
24
|
+
'text-foreground-document-xml': fileType === 'xml',
|
|
25
|
+
'text-foreground-document-png': fileType === 'png'
|
|
26
|
+
}
|
|
27
|
+
)
|
|
30
28
|
)
|
|
31
29
|
|
|
32
30
|
function handleClick(event: MouseEvent) {
|
|
@@ -36,27 +34,39 @@
|
|
|
36
34
|
</script>
|
|
37
35
|
|
|
38
36
|
<button
|
|
39
|
-
class
|
|
40
|
-
|
|
37
|
+
class={cn(
|
|
38
|
+
'flex items-center gap-3 p-2 rounded-[10px] w-full hover:bg-background-default-secondary cursor-pointer',
|
|
39
|
+
disabled && 'opacity-30 pointer-events-none',
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
41
42
|
{disabled}
|
|
42
43
|
{...rest}
|
|
43
44
|
onclick={handleClick}
|
|
44
45
|
>
|
|
45
|
-
<
|
|
46
|
-
<div class=
|
|
47
|
-
|
|
46
|
+
<div class="flex items-center gap-[10px] flex-1 min-w-0">
|
|
47
|
+
<div class={fileAvatarStyles}>
|
|
48
|
+
{#if fileType === 'generic'}
|
|
49
|
+
<Icon src={Invoice} class="size-4 text-icon" />
|
|
50
|
+
{:else}
|
|
51
|
+
{fileType}
|
|
52
|
+
{/if}
|
|
48
53
|
</div>
|
|
49
|
-
<div class="flex flex-col
|
|
50
|
-
<
|
|
54
|
+
<div class="flex flex-col text-start min-w-0 flex-1">
|
|
55
|
+
<div class="text-sm font-medium text-foreground truncate w-full">
|
|
51
56
|
{name}
|
|
52
|
-
</
|
|
53
|
-
<
|
|
57
|
+
</div>
|
|
58
|
+
<div class="text-sm text-foreground-default-secondary truncate w-full">
|
|
59
|
+
{date}
|
|
60
|
+
</div>
|
|
54
61
|
</div>
|
|
55
|
-
</
|
|
56
|
-
<
|
|
57
|
-
|
|
62
|
+
</div>
|
|
63
|
+
<Button
|
|
64
|
+
variant="secondary"
|
|
65
|
+
size="md"
|
|
58
66
|
icon={Download}
|
|
59
|
-
|
|
67
|
+
{disabled}
|
|
68
|
+
onclick={(e) => {
|
|
69
|
+
e.stopPropagation()
|
|
60
70
|
onDownload?.()
|
|
61
71
|
}}
|
|
62
72
|
/>
|
|
@@ -28,13 +28,16 @@
|
|
|
28
28
|
|
|
29
29
|
<BaseButton
|
|
30
30
|
{disabled}
|
|
31
|
-
|
|
31
|
+
size="sm"
|
|
32
32
|
icon={Duplicate}
|
|
33
33
|
iconPosition="right"
|
|
34
|
-
|
|
34
|
+
variant="ghost"
|
|
35
|
+
data-uuid-copy
|
|
36
|
+
onclick={async (e) => {
|
|
37
|
+
e.stopPropagation()
|
|
35
38
|
await navigator.clipboard.writeText(uuid)
|
|
36
39
|
oncopied?.(uuid)
|
|
37
40
|
}}
|
|
38
41
|
>
|
|
39
|
-
<span class="font-mono
|
|
42
|
+
<span class="font-mono">{formattedUuid}</span>
|
|
40
43
|
</BaseButton>
|
package/dist/CardCheckbox.svelte
CHANGED
|
@@ -10,49 +10,62 @@
|
|
|
10
10
|
title = '',
|
|
11
11
|
description = '',
|
|
12
12
|
accentText = '',
|
|
13
|
-
checked = false,
|
|
13
|
+
checked = $bindable(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', {
|
|
23
|
+
'border-foreground-selected': checked,
|
|
24
|
+
'border-border': !checked,
|
|
25
|
+
'bg-background-default-secondary': disabled,
|
|
26
|
+
'rounded-lg': hideRadio,
|
|
27
|
+
'rounded-xl': !hideRadio
|
|
28
|
+
})
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
let headerStyles = $derived(
|
|
32
|
+
clsx('flex items-start', {
|
|
33
|
+
'px-2 py-1.5': hideRadio,
|
|
34
|
+
'py-2 pr-2 pl-3': !hideRadio
|
|
35
|
+
})
|
|
25
36
|
)
|
|
26
37
|
</script>
|
|
27
38
|
|
|
28
|
-
<label for={id} class="
|
|
29
|
-
<div class=
|
|
30
|
-
<div class=
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<div class="flex flex-col space-y-0.5">
|
|
35
|
-
<span class="text-base text-neutral-800 font-medium">{title}</span>
|
|
36
|
-
{#if description}
|
|
37
|
-
<span class="flex items-center space-x-1">
|
|
38
|
-
{#if accentText}
|
|
39
|
-
<p class="text-workspace-accent text-sm font-bold">{accentText}</p>
|
|
40
|
-
{/if}
|
|
41
|
-
<p class="text-sm text-neutral-500" class:first-letter:uppercase={!accentText}>
|
|
42
|
-
{description}
|
|
43
|
-
</p>
|
|
44
|
-
</span>
|
|
39
|
+
<label for={id} class="cursor-pointer">
|
|
40
|
+
<div class={containerStyles}>
|
|
41
|
+
<div class={headerStyles}>
|
|
42
|
+
<div class="flex grow items-start gap-1 min-w-0">
|
|
43
|
+
{#if icon}
|
|
44
|
+
<Icon src={icon} class="size-4 text-icon shrink-0 mt-0.5" />
|
|
45
45
|
{/if}
|
|
46
|
+
<div class="flex flex-col gap-1 min-w-0">
|
|
47
|
+
<span class="text-base font-medium text-foreground">
|
|
48
|
+
{title}
|
|
49
|
+
</span>
|
|
50
|
+
{#if description}
|
|
51
|
+
<span class="text-sm text-foreground-default-secondary">
|
|
52
|
+
{#if accentText}
|
|
53
|
+
<span class="font-medium text-foreground-accent">{accentText}</span>
|
|
54
|
+
{' · '}
|
|
55
|
+
{/if}
|
|
56
|
+
{description}
|
|
57
|
+
</span>
|
|
58
|
+
{/if}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div class={clsx('flex items-center p-px', { 'sr-only': hideRadio })}>
|
|
62
|
+
<InputRadio {id} {name} bind:checked {disabled} {onchange} />
|
|
46
63
|
</div>
|
|
47
64
|
</div>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
65
|
+
{#if footer}
|
|
66
|
+
<div class="pl-3 pr-2 pb-3 pt-2">
|
|
67
|
+
{@render footer?.()}
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
52
70
|
</div>
|
|
53
|
-
{#if footer}
|
|
54
|
-
<div class="bg-neutral-50 rounded-b-lg px-3 py-2.5 border-t border-neutral-100">
|
|
55
|
-
{@render footer?.()}
|
|
56
|
-
</div>
|
|
57
|
-
{/if}
|
|
58
71
|
</label>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CardCheckboxProps } from './types';
|
|
2
|
-
declare const CardCheckbox: import("svelte").Component<CardCheckboxProps, {}, "">;
|
|
2
|
+
declare const CardCheckbox: import("svelte").Component<CardCheckboxProps, {}, "checked">;
|
|
3
3
|
type CardCheckbox = ReturnType<typeof CardCheckbox>;
|
|
4
4
|
export default CardCheckbox;
|
package/dist/CardRelation.svelte
CHANGED
|
@@ -2,28 +2,27 @@
|
|
|
2
2
|
import { Icon } from '@steeze-ui/svelte-icon'
|
|
3
3
|
import type { CardRelationProps } from './types.js'
|
|
4
4
|
import { ChevronRight } from '@invopop/ui-icons'
|
|
5
|
-
import SeparatorHorizontal from './SeparatorHorizontal.svelte'
|
|
6
5
|
|
|
7
6
|
let { title = '', icon = undefined, items = [], onclick }: CardRelationProps = $props()
|
|
8
7
|
</script>
|
|
9
8
|
|
|
10
|
-
<div class="border border-
|
|
11
|
-
<button class="
|
|
12
|
-
<div class="flex items-center
|
|
9
|
+
<div class="border border-border-default-secondary rounded-2xl overflow-hidden">
|
|
10
|
+
<button class="flex items-center gap-3 px-3 py-2 w-full cursor-pointer" {onclick}>
|
|
11
|
+
<div class="flex grow items-center gap-1.5 min-w-0">
|
|
13
12
|
{#if icon}
|
|
14
|
-
<Icon src={icon} class="
|
|
13
|
+
<Icon src={icon} class="size-4 text-icon shrink-0" />
|
|
15
14
|
{/if}
|
|
16
|
-
<span class="text-base font-medium text-
|
|
15
|
+
<span class="text-base font-medium text-foreground whitespace-nowrap">
|
|
16
|
+
{title}
|
|
17
|
+
</span>
|
|
17
18
|
</div>
|
|
18
|
-
|
|
19
|
-
<Icon src={ChevronRight} class="h-4 w-4 text-neutral-500" />
|
|
19
|
+
<Icon src={ChevronRight} class="size-3 text-icon shrink-0" />
|
|
20
20
|
</button>
|
|
21
|
-
<
|
|
22
|
-
<div class="py-1.5 text-sm">
|
|
21
|
+
<div class="flex flex-col gap-2 px-3 pb-3 pt-2">
|
|
23
22
|
{#each items as item}
|
|
24
|
-
<div class="
|
|
25
|
-
<div class="min-w-[88px] text-
|
|
26
|
-
<div class="text-
|
|
23
|
+
<div class="flex items-center gap-3 text-sm">
|
|
24
|
+
<div class="min-w-[88px] text-foreground-default-secondary shrink-0">{item.label}</div>
|
|
25
|
+
<div class="grow text-foreground min-w-0">{item.value}</div>
|
|
27
26
|
</div>
|
|
28
27
|
{/each}
|
|
29
28
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import ProfileAvatar from './ProfileAvatar.svelte'
|
|
3
|
-
import type { AnyProp, CompanySelectorProps, DrawerOption } from './types.js'
|
|
3
|
+
import type { AnyProp, CompanySelectorProps, DrawerOption, DrawerGroup } from './types.js'
|
|
4
4
|
import BaseDropdown from './BaseDropdown.svelte'
|
|
5
|
-
import
|
|
6
|
-
import { DoubleArrow } from '@invopop/ui-icons'
|
|
5
|
+
import DrawerContext from './DrawerContext.svelte'
|
|
6
|
+
import { DoubleArrow, Workspace, AddCircle, ExternalLink } from '@invopop/ui-icons'
|
|
7
7
|
import MenuItemCollapsible from './MenuItemCollapsible.svelte'
|
|
8
8
|
|
|
9
9
|
let companyDropdown: BaseDropdown | undefined = $state()
|
|
@@ -21,6 +21,24 @@
|
|
|
21
21
|
let country = $derived(selectedCompany?.country || '')
|
|
22
22
|
let picture = $derived(selectedCompany?.logo_url || '')
|
|
23
23
|
let isSandbox = $derived(selectedCompany?.sandbox)
|
|
24
|
+
|
|
25
|
+
let groups: DrawerGroup[] = [
|
|
26
|
+
{
|
|
27
|
+
label: 'Live',
|
|
28
|
+
slug: 'live',
|
|
29
|
+
emptyIcon: Workspace,
|
|
30
|
+
emptyTitle: 'No workspaces here',
|
|
31
|
+
emptyDescription: 'Create a workspace to start'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'Sandbox',
|
|
35
|
+
slug: 'sandbox',
|
|
36
|
+
emptyIcon: Workspace,
|
|
37
|
+
emptyTitle: 'No workspaces here',
|
|
38
|
+
emptyDescription: 'Create a workspace to start'
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
|
|
24
42
|
let items = $derived([
|
|
25
43
|
...companies.map((c) => ({
|
|
26
44
|
value: c.id,
|
|
@@ -28,8 +46,18 @@
|
|
|
28
46
|
selected: c.slug === selectedCompany?.slug && !!c.sandbox === !!selectedCompany?.sandbox,
|
|
29
47
|
country: c.country,
|
|
30
48
|
picture: c.logo_url,
|
|
31
|
-
sandbox: c.sandbox
|
|
32
|
-
|
|
49
|
+
sandbox: c.sandbox,
|
|
50
|
+
groupBy: c.sandbox ? 'sandbox' : 'live'
|
|
51
|
+
})),
|
|
52
|
+
{
|
|
53
|
+
separator: true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: 'add',
|
|
57
|
+
label: 'Create workspace',
|
|
58
|
+
icon: AddCircle,
|
|
59
|
+
rightIcon: ExternalLink
|
|
60
|
+
}
|
|
33
61
|
] as DrawerOption[])
|
|
34
62
|
|
|
35
63
|
function selectCompany(value: AnyProp) {
|
|
@@ -60,8 +88,8 @@
|
|
|
60
88
|
active={isOpen}
|
|
61
89
|
bold
|
|
62
90
|
>
|
|
63
|
-
<ProfileAvatar {name} {picture} {country} dark
|
|
91
|
+
<ProfileAvatar {name} {picture} {country} dark variant="lg" />
|
|
64
92
|
</MenuItemCollapsible>
|
|
65
93
|
{/snippet}
|
|
66
|
-
<
|
|
94
|
+
<DrawerContext {items} {groups} onclick={selectCompany} widthClass="w-[300px]" />
|
|
67
95
|
</BaseDropdown>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CounterWidgetProps } from './types'
|
|
3
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
4
|
+
import { Warning, Failure } from '@invopop/ui-icons'
|
|
5
|
+
import ProgressBar from './ProgressBar.svelte'
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
label,
|
|
9
|
+
current,
|
|
10
|
+
total,
|
|
11
|
+
resetDate = '',
|
|
12
|
+
icon,
|
|
13
|
+
allowOverage = true
|
|
14
|
+
}: CounterWidgetProps = $props()
|
|
15
|
+
|
|
16
|
+
let percentage = $derived(total > 0 ? (current / total) * 100 : 0)
|
|
17
|
+
let isOverage = $derived(current > total && allowOverage)
|
|
18
|
+
let isCritical = $derived(percentage >= 100 || (current > total && !allowOverage))
|
|
19
|
+
let isWarning = $derived(percentage >= 80 && percentage < 100)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div class="border border-border-inverse rounded-xl w-full py-[5px] pl-2 pr-1.5 flex flex-col">
|
|
23
|
+
<div class="flex items-center justify-between text-base font-medium">
|
|
24
|
+
<div class="flex items-center gap-1.5">
|
|
25
|
+
{#if icon}
|
|
26
|
+
<Icon src={icon} class="size-3 text-icon-inverse rounded-xs" />
|
|
27
|
+
{/if}
|
|
28
|
+
<span class="font-medium text-foreground-inverse">
|
|
29
|
+
{label}
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="flex items-center gap-1.5">
|
|
33
|
+
{#if isCritical && !isOverage}
|
|
34
|
+
<Icon src={Failure} class="size-4 text-icon-critical-inverse" />
|
|
35
|
+
{:else if isWarning && !isOverage}
|
|
36
|
+
<Icon src={Warning} class="size-4 text-icon-warning-inverse" />
|
|
37
|
+
{/if}
|
|
38
|
+
<span class="font-mono text-foreground-inverse">
|
|
39
|
+
{current}<span class="text-white/70">/{total}</span>
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="py-2">
|
|
44
|
+
<ProgressBar {percentage} {current} {total} {allowOverage} />
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
{#if resetDate}
|
|
48
|
+
<span class="text-sm font-normal text-foreground-inverse-secondary">
|
|
49
|
+
{label} reset {resetDate}
|
|
50
|
+
</span>
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
package/dist/DataListItem.svelte
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
children
|
|
12
12
|
}: DataListItemProps = $props()
|
|
13
13
|
|
|
14
|
-
let
|
|
15
|
-
clsx({
|
|
14
|
+
let valueStyles = $derived(
|
|
15
|
+
clsx('text-foreground font-medium text-base', {
|
|
16
16
|
'font-mono': monospaced,
|
|
17
17
|
'slashed-zero tabular-nums lining-nums': monospacedNums,
|
|
18
18
|
'w-full': fullWidth
|
|
@@ -20,13 +20,17 @@
|
|
|
20
20
|
)
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
|
-
<div class="flex
|
|
24
|
-
<div class="text-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
{
|
|
30
|
-
|
|
23
|
+
<div class="flex gap-6 items-center px-3 py-1 rounded-lg hover:bg-background-default-secondary">
|
|
24
|
+
<div class="text-foreground-default-secondary text-base min-w-[125px]">
|
|
25
|
+
{label}
|
|
26
|
+
</div>
|
|
27
|
+
<div class="flex gap-1 items-center">
|
|
28
|
+
<div class={valueStyles}>
|
|
29
|
+
{#if children}
|
|
30
|
+
{@render children()}
|
|
31
|
+
{:else}
|
|
32
|
+
{value}
|
|
33
|
+
{/if}
|
|
34
|
+
</div>
|
|
31
35
|
</div>
|
|
32
36
|
</div>
|