@invopop/popui 0.1.2 → 0.1.3-6.beta.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/dist/AlertDialog.svelte +10 -11
- package/dist/BaseButton.svelte +25 -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 +46 -18
- 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 +200 -24
- package/dist/button/button.svelte.d.ts +51 -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 +40 -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 +144 -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 +66 -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 +303 -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 +48 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.js +3 -0
- package/dist/index.d.ts +15 -7
- package/dist/index.js +31 -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 +71 -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 -142
- package/dist/tw.theme.js +0 -158
package/dist/FeedEvents.svelte
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import SeparatorHorizontal from './SeparatorHorizontal.svelte'
|
|
2
3
|
import TagStatus from './TagStatus.svelte'
|
|
3
4
|
import type { FeedEventsProps } from './types.js'
|
|
4
5
|
|
|
5
6
|
let { events = [] }: FeedEventsProps = $props()
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
|
-
<div class="border border-
|
|
9
|
+
<div class="border border-border bg-background-default-secondary rounded">
|
|
9
10
|
{#each events as event, i (i)}
|
|
10
|
-
|
|
11
|
+
{#if i > 0}
|
|
12
|
+
<SeparatorHorizontal />
|
|
13
|
+
{/if}
|
|
14
|
+
<div class="py-2 px-3">
|
|
11
15
|
<div class="flex items-center justify-between">
|
|
12
16
|
<div class="flex items-center space-x-2">
|
|
13
17
|
<TagStatus status={event.status.type} label={event.status.label} />
|
|
14
18
|
{#if event.code}
|
|
15
|
-
<p class="text-sm text-
|
|
19
|
+
<p class="text-sm text-foreground-default-secondary font-mono">
|
|
16
20
|
{event.code}
|
|
17
21
|
</p>
|
|
18
22
|
{/if}
|
|
19
23
|
</div>
|
|
20
|
-
<p class="text-sm text-
|
|
24
|
+
<p class="text-sm text-foreground-default-secondary font-mono">
|
|
21
25
|
{event.date.toISOString()}
|
|
22
26
|
</p>
|
|
23
27
|
</div>
|
|
24
28
|
{#if event.message}
|
|
25
|
-
<p class="text-
|
|
29
|
+
<p class="text-foreground text-sm pt-2 break-words">{event.message}</p>
|
|
26
30
|
{/if}
|
|
27
31
|
</div>
|
|
28
32
|
{/each}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
let { icon = undefined, iconTheme = 'default' }: FeedIconEventProps = $props()
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<div class="relative py-0.5 mt-2">
|
|
8
|
+
<div class="relative py-0.5 mt-2 bg-background">
|
|
9
9
|
{#if icon}
|
|
10
|
-
<Icon src={icon} theme={iconTheme} class="
|
|
10
|
+
<Icon src={icon} theme={iconTheme} class="size-4 text-icon-default-bold" />
|
|
11
11
|
{/if}
|
|
12
12
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Icon } from '@steeze-ui/svelte-icon'
|
|
3
3
|
import type { FeddIconStatusProps, FeedItemStatus } from './types.ts'
|
|
4
|
-
import {
|
|
4
|
+
import { Warning, Failure, Queue, Running, Success, CheckBadge, Skip } from '@invopop/ui-icons'
|
|
5
5
|
import type { IconSource } from '@steeze-ui/heroicons'
|
|
6
6
|
|
|
7
7
|
let { status }: FeddIconStatusProps = $props()
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
success: Success,
|
|
13
13
|
run: Running,
|
|
14
14
|
queued: Queue,
|
|
15
|
-
alert:
|
|
15
|
+
alert: Warning,
|
|
16
16
|
skip: Skip,
|
|
17
17
|
signed: CheckBadge
|
|
18
18
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
{#if iconStatus}
|
|
26
26
|
<div title={status}>
|
|
27
|
-
<Icon src={iconStatus} class="h-4 w-4
|
|
27
|
+
<Icon src={iconStatus} class="h-4 w-4 shrink-0 text-icon" />
|
|
28
28
|
</div>
|
|
29
29
|
{:else}
|
|
30
|
-
<div class="w-4 h-4
|
|
30
|
+
<div class="w-4 h-4 shrink-0 bg-background-default-secondary rounded-full"></div>
|
|
31
31
|
{/if}
|
package/dist/FeedItem.svelte
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
viewable = false,
|
|
16
16
|
viewableText = 'View',
|
|
17
17
|
user = undefined,
|
|
18
|
-
type = '',
|
|
19
18
|
extraText = '',
|
|
20
19
|
onView
|
|
21
20
|
}: FeedItemProps = $props()
|
|
@@ -32,25 +31,23 @@
|
|
|
32
31
|
|
|
33
32
|
<div id={`feed-item-${slug}`} class="relative text-left w-full min-w-[344px]">
|
|
34
33
|
{#if hasNext && icon}
|
|
35
|
-
<span class="absolute bottom-[-20px] left-2 border-l border-
|
|
34
|
+
<span class="absolute bottom-[-20px] left-2 border-l border-border w-px h-[58px]"></span>
|
|
36
35
|
{/if}
|
|
37
|
-
<div class="flex items-start justify-between space-x-2
|
|
36
|
+
<div class="flex items-start justify-between space-x-2">
|
|
38
37
|
<div class="relative">
|
|
39
38
|
{#if icon}
|
|
40
39
|
<FeedIconEvent {icon} />
|
|
41
40
|
{/if}
|
|
42
41
|
</div>
|
|
43
|
-
<div
|
|
44
|
-
class="flex-1 items-center justify-start pl-2.5 py-2 pr-2 rounded-lg border border-neutral-100"
|
|
45
|
-
>
|
|
42
|
+
<div class="flex-1 items-center justify-start pl-2.5 py-2 pr-2 rounded-lg">
|
|
46
43
|
<div
|
|
47
|
-
class="text-base text-
|
|
44
|
+
class="text-base text-foreground whitespace-nowrap tracking-normal font-medium flex items-center gap-1 {viewable
|
|
48
45
|
? 'max-w-[260px]'
|
|
49
46
|
: 'max-w-[320px]'}"
|
|
50
47
|
>
|
|
51
48
|
{#if user}
|
|
52
49
|
<div class="mr-0.5">
|
|
53
|
-
<ProfileAvatar
|
|
50
|
+
<ProfileAvatar variant="sm" {...user} />
|
|
54
51
|
</div>
|
|
55
52
|
{/if}
|
|
56
53
|
<p class="truncate" {title}>{title}</p>
|
|
@@ -60,7 +57,9 @@
|
|
|
60
57
|
{/if}
|
|
61
58
|
</div>
|
|
62
59
|
<p
|
|
63
|
-
class="mt-0.5 flex items-center space-x-2 text-sm text-
|
|
60
|
+
class="mt-0.5 flex items-center space-x-2 text-sm text-foreground-default-secondary whitespace-nowrap tabular-nums slashed-zero lining-nums tracking-normal {user
|
|
61
|
+
? 'ml-[26px]'
|
|
62
|
+
: ''}"
|
|
64
63
|
>
|
|
65
64
|
{#if date}
|
|
66
65
|
<span>
|
|
@@ -79,10 +78,10 @@
|
|
|
79
78
|
{#if viewable}
|
|
80
79
|
<span class="absolute top-5 right-2">
|
|
81
80
|
<BaseButton
|
|
82
|
-
|
|
81
|
+
size="sm"
|
|
83
82
|
variant="secondary"
|
|
84
83
|
onclick={() => {
|
|
85
|
-
onView?.(
|
|
84
|
+
onView?.(slug)
|
|
86
85
|
}}
|
|
87
86
|
>
|
|
88
87
|
{viewableText}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx'
|
|
2
3
|
import type { FeedItemDetailProps } from './types.ts'
|
|
3
4
|
import FeedIconStatus from './FeedIconStatus.svelte'
|
|
4
5
|
import UuidCopy from './UuidCopy.svelte'
|
|
5
6
|
import FeedEvents from './FeedEvents.svelte'
|
|
6
7
|
import { slide } from 'svelte/transition'
|
|
7
8
|
import SeparatorHorizontal from './SeparatorHorizontal.svelte'
|
|
9
|
+
import BaseButton from './BaseButton.svelte'
|
|
10
|
+
import { Close } from '@invopop/ui-icons'
|
|
8
11
|
|
|
9
12
|
let {
|
|
10
13
|
status = undefined,
|
|
@@ -12,31 +15,54 @@
|
|
|
12
15
|
uuid = '',
|
|
13
16
|
events = [],
|
|
14
17
|
idLabel = 'ID:',
|
|
15
|
-
|
|
18
|
+
cancelable = false,
|
|
19
|
+
onCopied,
|
|
20
|
+
onCancel
|
|
16
21
|
}: FeedItemDetailProps = $props()
|
|
17
22
|
|
|
18
23
|
let open = $state(false)
|
|
24
|
+
let styles = $derived(
|
|
25
|
+
clsx('pl-3 flex items-center space-x-1.5', {
|
|
26
|
+
'pr-3 py-2.5': !cancelable,
|
|
27
|
+
'py-2 pr-2': cancelable
|
|
28
|
+
})
|
|
29
|
+
)
|
|
19
30
|
</script>
|
|
20
31
|
|
|
21
|
-
<div class="w-full rounded-lg border border-
|
|
22
|
-
<div class=
|
|
32
|
+
<div class="w-full rounded-lg border border-border">
|
|
33
|
+
<div class={styles}>
|
|
23
34
|
{#if status}
|
|
24
35
|
<FeedIconStatus {status} />
|
|
25
36
|
{/if}
|
|
26
|
-
<span class="truncate font-medium text-
|
|
37
|
+
<span class="flex-1 truncate font-medium text-foreground text-base">{title}</span>
|
|
38
|
+
{#if cancelable}
|
|
39
|
+
<BaseButton
|
|
40
|
+
size="sm"
|
|
41
|
+
icon={Close}
|
|
42
|
+
variant="secondary"
|
|
43
|
+
onclick={() => {
|
|
44
|
+
onCancel?.()
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
Cancel
|
|
48
|
+
</BaseButton>
|
|
49
|
+
{/if}
|
|
27
50
|
</div>
|
|
28
51
|
<SeparatorHorizontal />
|
|
29
52
|
<div class="pl-3 py-1 pr-2.5 flex items-center space-x-0.5">
|
|
30
|
-
<span class="text-sm text-
|
|
53
|
+
<span class="text-sm text-foreground-default-secondary whitespace-nowrap">{idLabel}</span>
|
|
31
54
|
{#if uuid}
|
|
32
55
|
<UuidCopy {uuid} full small {onCopied} />
|
|
33
56
|
{/if}
|
|
34
57
|
</div>
|
|
35
58
|
{#if events.length}
|
|
36
59
|
<SeparatorHorizontal />
|
|
37
|
-
<div
|
|
60
|
+
<div
|
|
61
|
+
class="px-3 py-2 text-sm text-foreground-default-secondary flex items-center justify-between"
|
|
62
|
+
>
|
|
38
63
|
<span>Logs</span>
|
|
39
64
|
<button
|
|
65
|
+
class="cursor-pointer"
|
|
40
66
|
aria-label="Toggle details"
|
|
41
67
|
onclick={() => {
|
|
42
68
|
open = !open
|
package/dist/FeedViewer.svelte
CHANGED
package/dist/GlobalSearch.svelte
CHANGED
|
@@ -10,10 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
let { collapsed = false, onOpen }: GlobalSearchProps = $props()
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
clsx(
|
|
15
|
-
'
|
|
16
|
-
|
|
13
|
+
const styles = $derived(
|
|
14
|
+
clsx(
|
|
15
|
+
'cursor-pointer flex items-center border border-border-inverse-default rounded-lg box-border',
|
|
16
|
+
{
|
|
17
|
+
'gap-1 px-2 py-1.5 w-full hover:bg-background-selected-inverse h-8': !collapsed,
|
|
18
|
+
'p-2 size-8': collapsed
|
|
19
|
+
}
|
|
20
|
+
)
|
|
17
21
|
)
|
|
18
22
|
|
|
19
23
|
function onKeyDown(event: KeyboardEvent) {
|
|
@@ -38,15 +42,12 @@
|
|
|
38
42
|
})
|
|
39
43
|
</script>
|
|
40
44
|
|
|
41
|
-
<button
|
|
42
|
-
|
|
43
|
-
onclick={() => onOpen?.()}
|
|
44
|
-
>
|
|
45
|
-
<Icon src={Search} class="w-4 h-4 text-white-70" />
|
|
45
|
+
<button class={styles} onclick={() => onOpen?.()}>
|
|
46
|
+
<Icon src={Search} class="size-4 text-foreground-inverse shrink-0" />
|
|
46
47
|
{#if !collapsed}
|
|
47
|
-
<span class="text-
|
|
48
|
-
<ShortcutWrapper>
|
|
49
|
-
<Icon src={Slash} class="
|
|
48
|
+
<span class="text-foreground-inverse-secondary text-base flex-1 text-left">Search</span>
|
|
49
|
+
<ShortcutWrapper theme="navigation">
|
|
50
|
+
<Icon src={Slash} class="size-3" />
|
|
50
51
|
</ShortcutWrapper>
|
|
51
52
|
{/if}
|
|
52
53
|
</button>
|
|
@@ -20,16 +20,13 @@
|
|
|
20
20
|
}
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
|
-
<label
|
|
24
|
-
for={id}
|
|
25
|
-
class="inline-flex items-center space-x-2 cursor-pointer group text-base text-neutral-800"
|
|
26
|
-
>
|
|
23
|
+
<label for={id} class="inline-flex items-center gap-2 cursor-pointer text-base text-foreground">
|
|
27
24
|
<input
|
|
28
25
|
{id}
|
|
29
26
|
type="checkbox"
|
|
30
27
|
{checked}
|
|
31
28
|
{indeterminate}
|
|
32
|
-
class="form-checkbox
|
|
29
|
+
class="form-checkbox size-4 text-background-accent rounded border border-border-default-secondary hover:border-border-default-primary focus:ring-0 focus:ring-offset-0 bg-background"
|
|
33
30
|
{...rest}
|
|
34
31
|
onchange={updateInput}
|
|
35
32
|
{onclick}
|
package/dist/InputError.svelte
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
3
|
+
import { Alert } from '@invopop/ui-icons'
|
|
2
4
|
import type { InputErrorProps } from './types'
|
|
3
5
|
|
|
4
6
|
let { errorText = '' }: InputErrorProps = $props()
|
|
5
7
|
</script>
|
|
6
8
|
|
|
7
|
-
<p class="
|
|
8
|
-
<
|
|
9
|
-
<path
|
|
10
|
-
fill-rule="evenodd"
|
|
11
|
-
clip-rule="evenodd"
|
|
12
|
-
d="M8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5ZM7.99999 9.35C7.66862 9.35 7.39999 9.08137 7.39999 8.75V4.75C7.39999 4.41863 7.66862 4.15 7.99999 4.15C8.33137 4.15 8.59999 4.41863 8.59999 4.75L8.59999 8.75C8.59999 9.08137 8.33136 9.35 7.99999 9.35ZM8.75 11C8.75 11.4142 8.41421 11.75 8 11.75C7.58579 11.75 7.25 11.4142 7.25 11C7.25 10.5858 7.58579 10.25 8 10.25C8.41421 10.25 8.75 10.5858 8.75 11Z"
|
|
13
|
-
fill="currentColor"
|
|
14
|
-
/>
|
|
15
|
-
</svg>
|
|
9
|
+
<p class="flex items-center gap-1 text-sm text-foreground-critical">
|
|
10
|
+
<Icon src={Alert} class="size-3 shrink-0" />
|
|
16
11
|
<span>{errorText}</span>
|
|
17
12
|
</p>
|
package/dist/InputLabel.svelte
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
let { id = '', label = '', ...rest }: InputLabelProps = $props()
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<label for={id} class="text-sm font-medium text-
|
|
7
|
+
<label for={id} class="text-sm font-medium text-foreground-default-secondary" {...rest}>
|
|
8
|
+
{label}
|
|
9
|
+
</label>
|
package/dist/InputRadio.svelte
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import type { InputRadioProps } from './types'
|
|
3
3
|
|
|
4
4
|
let {
|
|
5
|
-
checked = false,
|
|
5
|
+
checked = $bindable(false),
|
|
6
|
+
disabled = false,
|
|
6
7
|
id = Math.random().toString(36).slice(2, 7),
|
|
7
8
|
name = '',
|
|
9
|
+
label,
|
|
8
10
|
onchange,
|
|
9
11
|
...rest
|
|
10
12
|
}: InputRadioProps = $props()
|
|
@@ -19,18 +21,32 @@
|
|
|
19
21
|
|
|
20
22
|
function updateInput(event: Event) {
|
|
21
23
|
const target = event.target as HTMLInputElement
|
|
22
|
-
|
|
23
|
-
onchange?.(
|
|
24
|
+
checked = target.checked
|
|
25
|
+
onchange?.(checked)
|
|
24
26
|
}
|
|
25
27
|
</script>
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
{#snippet radioInput()}
|
|
30
|
+
<input
|
|
31
|
+
bind:this={el}
|
|
32
|
+
type="radio"
|
|
33
|
+
{id}
|
|
34
|
+
{name}
|
|
35
|
+
{checked}
|
|
36
|
+
{disabled}
|
|
37
|
+
class="appearance-none size-4 rounded-full border checked:border-0 checked:bg-background-accent cursor-pointer focus:outline-none focus:ring-0 shrink-0 disabled:cursor-not-allowed border-border-default-secondary disabled:checked:bg-border-default-secondary disabled:checked:border bg-background"
|
|
38
|
+
{...rest}
|
|
39
|
+
onchange={updateInput}
|
|
40
|
+
/>
|
|
41
|
+
{/snippet}
|
|
42
|
+
|
|
43
|
+
{#if label}
|
|
44
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
45
|
+
{@render radioInput()}
|
|
46
|
+
<span class="text-base text-foreground whitespace-nowrap">
|
|
47
|
+
{label}
|
|
48
|
+
</span>
|
|
49
|
+
</label>
|
|
50
|
+
{:else}
|
|
51
|
+
{@render radioInput()}
|
|
52
|
+
{/if}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InputRadioProps } from './types';
|
|
2
|
-
declare const InputRadio: import("svelte").Component<InputRadioProps, {}, "">;
|
|
2
|
+
declare const InputRadio: import("svelte").Component<InputRadioProps, {}, "checked">;
|
|
3
3
|
type InputRadio = ReturnType<typeof InputRadio>;
|
|
4
4
|
export default InputRadio;
|
package/dist/InputSearch.svelte
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { onMount } from 'svelte'
|
|
3
3
|
import { Icon } from '@steeze-ui/svelte-icon'
|
|
4
4
|
import { Search } from '@invopop/ui-icons'
|
|
5
|
+
import ShortcutWrapper from './ShortcutWrapper.svelte'
|
|
5
6
|
import type { InputSearchProps } from './types.js'
|
|
6
7
|
|
|
7
8
|
const debounce = (target: HTMLInputElement) => {
|
|
@@ -66,8 +67,8 @@
|
|
|
66
67
|
bind:this={input}
|
|
67
68
|
bind:value
|
|
68
69
|
type="search"
|
|
69
|
-
class="py-
|
|
70
|
-
style:padding-right={`${shortcutKeys.length *
|
|
70
|
+
class="flex items-center gap-1 h-8 w-full px-2 py-1.5 pl-7 rounded-lg border bg-background-default-default text-base text-foreground-default-default placeholder:text-foreground-default-tertiary outline-none caret-foreground-accent focus:ring-0 border-border-default-secondary hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active"
|
|
71
|
+
style:padding-right={shortcut ? `${shortcutKeys.length * 20 + 12}px` : undefined}
|
|
71
72
|
{placeholder}
|
|
72
73
|
{...rest}
|
|
73
74
|
oninput={handleInput}
|
|
@@ -75,15 +76,14 @@
|
|
|
75
76
|
{onblur}
|
|
76
77
|
{onclick}
|
|
77
78
|
/>
|
|
78
|
-
<Icon src={icon} class="absolute
|
|
79
|
+
<Icon src={icon} class="absolute left-2 size-4 text-foreground-default-tertiary" />
|
|
79
80
|
|
|
80
81
|
{#if shortcut}
|
|
81
|
-
<div class="absolute
|
|
82
|
+
<div class="absolute right-2 flex items-center gap-1">
|
|
82
83
|
{#each shortcutKeys as key}
|
|
83
|
-
<
|
|
84
|
-
class="
|
|
85
|
-
|
|
86
|
-
>
|
|
84
|
+
<ShortcutWrapper>
|
|
85
|
+
<span class="text-sm font-semibold">{key}</span>
|
|
86
|
+
</ShortcutWrapper>
|
|
87
87
|
{/each}
|
|
88
88
|
</div>
|
|
89
89
|
{/if}
|
package/dist/InputSelect.svelte
CHANGED
|
@@ -29,43 +29,44 @@
|
|
|
29
29
|
|
|
30
30
|
function handleChange(event: Event) {
|
|
31
31
|
const target = (event as PointerEvent).target as HTMLSelectElement
|
|
32
|
-
|
|
33
32
|
onchange?.(target.value)
|
|
34
33
|
}
|
|
35
34
|
</script>
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
<div class="relative">
|
|
41
|
-
<select
|
|
42
|
-
{id}
|
|
43
|
-
{name}
|
|
44
|
-
bind:value
|
|
45
|
-
{disabled}
|
|
46
|
-
class:pl-7={icon}
|
|
47
|
-
class:pl-2={!icon}
|
|
48
|
-
class="py-1.5 border border-neutral-200 hover:border-neutral-300 w-full rounded-md text-neutral-800 text-base pr-9 outline-none tracking-tight ui-select focus:border-workspace-accent focus:shadow-active"
|
|
49
|
-
{...rest}
|
|
50
|
-
onchange={handleChange}
|
|
51
|
-
>
|
|
52
|
-
<option value="" disabled={disablePlaceholder}>{placeholder}</option>
|
|
53
|
-
{#each options as option}
|
|
54
|
-
<option value={option.value}>{option.label}</option>
|
|
55
|
-
{/each}
|
|
56
|
-
</select>
|
|
57
|
-
{#if resolvedIcon}
|
|
58
|
-
<Icon
|
|
59
|
-
src={resolvedIcon}
|
|
60
|
-
theme={iconTheme}
|
|
61
|
-
class="h-4 w-4 absolute top-2 left-2 text-neutral-500"
|
|
62
|
-
/>
|
|
36
|
+
<div class="flex flex-col gap-2">
|
|
37
|
+
{#if label}
|
|
38
|
+
<InputLabel {id} {label} />
|
|
63
39
|
{/if}
|
|
64
|
-
|
|
40
|
+
<div class="relative">
|
|
41
|
+
<select
|
|
42
|
+
{id}
|
|
43
|
+
{name}
|
|
44
|
+
bind:value
|
|
45
|
+
{disabled}
|
|
46
|
+
class="h-8 w-full px-2 py-1.5 rounded-lg border bg-background text-base outline-none focus:ring-0 border-border hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active text-foreground ui-select"
|
|
47
|
+
class:pl-7={resolvedIcon}
|
|
48
|
+
class:text-foreground-default-secondary={!value}
|
|
49
|
+
{...rest}
|
|
50
|
+
onchange={handleChange}
|
|
51
|
+
>
|
|
52
|
+
<option value="" disabled={disablePlaceholder}>{placeholder}</option>
|
|
53
|
+
{#each options as option}
|
|
54
|
+
<option value={option.value}>{option.label}</option>
|
|
55
|
+
{/each}
|
|
56
|
+
</select>
|
|
57
|
+
{#if resolvedIcon}
|
|
58
|
+
<Icon
|
|
59
|
+
src={resolvedIcon}
|
|
60
|
+
theme={iconTheme}
|
|
61
|
+
class="absolute left-2 top-2 size-4 text-icon pointer-events-none"
|
|
62
|
+
/>
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
65
|
|
|
66
|
-
{#if errorText}
|
|
67
|
-
|
|
68
|
-
{/if}
|
|
66
|
+
{#if errorText}
|
|
67
|
+
<InputError {errorText} />
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
69
70
|
|
|
70
71
|
<style>
|
|
71
72
|
.ui-select {
|
package/dist/InputText.svelte
CHANGED
|
@@ -32,13 +32,19 @@
|
|
|
32
32
|
|
|
33
33
|
let inputStyles = $derived(
|
|
34
34
|
clsx(
|
|
35
|
-
|
|
35
|
+
'h-8 w-full rounded-lg border px-2 py-1 text-base tracking-tight bg-background-default-default backdrop-blur-[2px] caret-foreground-accent',
|
|
36
|
+
'placeholder:text-foreground-default-tertiary',
|
|
37
|
+
'outline-none focus:ring-0',
|
|
36
38
|
{
|
|
37
|
-
'
|
|
39
|
+
'pointer-events-none bg-background-default-secondary border-border-default-default':
|
|
40
|
+
disabled
|
|
38
41
|
},
|
|
39
42
|
{
|
|
40
|
-
'
|
|
41
|
-
|
|
43
|
+
'text-foreground-critical border-border-critical-bold caret-foreground-critical': errorText
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
'text-foreground border-border-default-secondary hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active':
|
|
47
|
+
!errorText && !disabled
|
|
42
48
|
}
|
|
43
49
|
)
|
|
44
50
|
)
|
|
@@ -59,23 +65,25 @@
|
|
|
59
65
|
})
|
|
60
66
|
</script>
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
68
|
+
<div class="flex flex-col gap-2">
|
|
69
|
+
{#if label}
|
|
70
|
+
<InputLabel {id} {label} />
|
|
71
|
+
{/if}
|
|
72
|
+
<input
|
|
73
|
+
{id}
|
|
74
|
+
bind:this={inputEl}
|
|
75
|
+
bind:value
|
|
76
|
+
type="text"
|
|
77
|
+
class={inputStyles}
|
|
78
|
+
{placeholder}
|
|
79
|
+
readonly={disabled}
|
|
80
|
+
{...rest}
|
|
81
|
+
oninput={handleInput}
|
|
82
|
+
{onfocus}
|
|
83
|
+
{onblur}
|
|
84
|
+
{onkeydown}
|
|
85
|
+
/>
|
|
86
|
+
{#if errorText}
|
|
87
|
+
<InputError {errorText} />
|
|
88
|
+
{/if}
|
|
89
|
+
</div>
|
|
@@ -18,13 +18,16 @@
|
|
|
18
18
|
|
|
19
19
|
let inputStyles = $derived(
|
|
20
20
|
clsx(
|
|
21
|
-
|
|
21
|
+
'w-full rounded-lg border px-2 py-1.5 text-base tracking-tight bg-background backdrop-blur-[2px] placeholder:text-foreground-default-tertiary outline-none focus:ring-0 caret-foreground-accent',
|
|
22
22
|
{
|
|
23
|
-
'
|
|
23
|
+
'pointer-events-none bg-background-default-secondary border-border': disabled
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
'
|
|
27
|
-
|
|
26
|
+
'text-foreground-critical border-border-critical-bold caret-foreground-critical': errorText
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
'text-foreground border-border hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active':
|
|
30
|
+
!errorText && !disabled
|
|
28
31
|
}
|
|
29
32
|
)
|
|
30
33
|
)
|
|
@@ -35,18 +38,21 @@
|
|
|
35
38
|
}
|
|
36
39
|
</script>
|
|
37
40
|
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
{
|
|
41
|
+
<div class="flex flex-col gap-2">
|
|
42
|
+
{#if label}
|
|
43
|
+
<InputLabel {id} {label} />
|
|
44
|
+
{/if}
|
|
45
|
+
<textarea
|
|
46
|
+
{id}
|
|
47
|
+
{placeholder}
|
|
48
|
+
{value}
|
|
49
|
+
class={inputStyles}
|
|
50
|
+
{disabled}
|
|
51
|
+
{rows}
|
|
52
|
+
{...rest}
|
|
53
|
+
oninput={handleInput}
|
|
54
|
+
></textarea>
|
|
55
|
+
{#if errorText}
|
|
56
|
+
<InputError {errorText} />
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|