@invopop/popui 0.0.103 → 0.1.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 +84 -59
- package/dist/AlertDialog.svelte.d.ts +5 -29
- package/dist/BaseButton.svelte +106 -101
- package/dist/BaseButton.svelte.d.ts +4 -34
- package/dist/BaseCard.svelte +20 -12
- package/dist/BaseCard.svelte.d.ts +4 -26
- package/dist/BaseCounter.svelte +13 -9
- package/dist/BaseCounter.svelte.d.ts +4 -17
- package/dist/BaseDropdown.svelte +54 -38
- package/dist/BaseDropdown.svelte.d.ts +6 -26
- package/dist/BaseFlag.svelte +6 -4
- package/dist/BaseFlag.svelte.d.ts +4 -17
- package/dist/BaseTable.svelte +226 -188
- package/dist/BaseTable.svelte.d.ts +4 -39
- package/dist/BaseTableActions.svelte +43 -33
- package/dist/BaseTableActions.svelte.d.ts +6 -21
- package/dist/BaseTableCellContent.svelte +19 -13
- package/dist/BaseTableCellContent.svelte.d.ts +4 -24
- package/dist/BaseTableCheckbox.svelte +19 -12
- package/dist/BaseTableCheckbox.svelte.d.ts +4 -21
- package/dist/BaseTableHeaderContent.svelte +30 -22
- package/dist/BaseTableHeaderContent.svelte.d.ts +4 -21
- package/dist/BaseTableHeaderOrderBy.svelte +24 -0
- package/dist/BaseTableHeaderOrderBy.svelte.d.ts +4 -0
- package/dist/BaseTableRow.svelte +78 -60
- package/dist/BaseTableRow.svelte.d.ts +4 -32
- package/dist/Breadcrumbs.svelte +14 -10
- package/dist/Breadcrumbs.svelte.d.ts +4 -19
- package/dist/ButtonFile.svelte +40 -29
- package/dist/ButtonFile.svelte.d.ts +4 -26
- package/dist/ButtonUuidCopy.svelte +27 -20
- package/dist/ButtonUuidCopy.svelte.d.ts +4 -22
- package/dist/CardCheckbox.svelte +28 -19
- package/dist/CardCheckbox.svelte.d.ts +4 -28
- package/dist/CardRelation.svelte +9 -8
- package/dist/CardRelation.svelte.d.ts +4 -22
- package/dist/CompanySelector.svelte +49 -43
- package/dist/CompanySelector.svelte.d.ts +4 -22
- package/dist/CounterWorkflow.svelte +12 -8
- package/dist/CounterWorkflow.svelte.d.ts +4 -17
- package/dist/DataListItem.svelte +24 -14
- package/dist/DataListItem.svelte.d.ts +4 -22
- package/dist/DatePicker.svelte +186 -386
- package/dist/DatePicker.svelte.d.ts +4 -22
- package/dist/DrawerContext.svelte +33 -22
- package/dist/DrawerContext.svelte.d.ts +4 -24
- package/dist/DrawerContextItem.svelte +67 -54
- package/dist/DrawerContextItem.svelte.d.ts +4 -23
- package/dist/DrawerContextSeparator.svelte +1 -1
- package/dist/DrawerContextSeparator.svelte.d.ts +22 -19
- package/dist/DrawerContextWorkspace.svelte +31 -32
- package/dist/DrawerContextWorkspace.svelte.d.ts +4 -20
- package/dist/DropdownSelect.svelte +93 -81
- package/dist/DropdownSelect.svelte.d.ts +4 -27
- package/dist/EmptyStateIcon.svelte +13 -7
- package/dist/EmptyStateIcon.svelte.d.ts +4 -22
- package/dist/EmptyStateIllustration.svelte +41 -33
- package/dist/EmptyStateIllustration.svelte.d.ts +4 -21
- package/dist/FeedEvents.svelte +5 -2
- package/dist/FeedEvents.svelte.d.ts +4 -17
- package/dist/FeedIconEvent.svelte +5 -3
- package/dist/FeedIconEvent.svelte.d.ts +4 -19
- package/dist/FeedIconStatus.svelte +23 -18
- package/dist/FeedIconStatus.svelte.d.ts +4 -17
- package/dist/FeedItem.svelte +33 -28
- package/dist/FeedItem.svelte.d.ts +4 -30
- package/dist/FeedItemDetail.svelte +21 -13
- package/dist/FeedItemDetail.svelte.d.ts +4 -23
- package/dist/FeedViewer.svelte +6 -13
- package/dist/FeedViewer.svelte.d.ts +4 -21
- package/dist/FormLayoutModal.svelte +9 -3
- package/dist/FormLayoutModal.svelte.d.ts +4 -29
- package/dist/GlobalSearch.svelte +38 -31
- package/dist/GlobalSearch.svelte.d.ts +4 -18
- package/dist/InputCheckbox.svelte +23 -14
- package/dist/InputCheckbox.svelte.d.ts +4 -23
- package/dist/InputError.svelte +4 -1
- package/dist/InputError.svelte.d.ts +4 -16
- package/dist/InputLabel.svelte +5 -3
- package/dist/InputLabel.svelte.d.ts +4 -18
- package/dist/InputRadio.svelte +25 -19
- package/dist/InputRadio.svelte.d.ts +4 -21
- package/dist/InputSearch.svelte +66 -46
- package/dist/InputSearch.svelte.d.ts +9 -33
- package/dist/InputSelect.svelte +36 -33
- package/dist/InputSelect.svelte.d.ts +4 -31
- package/dist/InputText.svelte +64 -48
- package/dist/InputText.svelte.d.ts +4 -28
- package/dist/InputTextarea.svelte +38 -29
- package/dist/InputTextarea.svelte.d.ts +4 -25
- package/dist/InputToggle.svelte +29 -22
- package/dist/InputToggle.svelte.d.ts +4 -20
- package/dist/MenuItem.svelte +99 -87
- package/dist/MenuItem.svelte.d.ts +5 -29
- package/dist/MenuItemCollapsible.svelte +26 -18
- package/dist/MenuItemCollapsible.svelte.d.ts +4 -24
- package/dist/Notification.svelte +35 -31
- package/dist/Notification.svelte.d.ts +4 -20
- package/dist/ProfileAvatar.svelte +26 -19
- package/dist/ProfileAvatar.svelte.d.ts +4 -21
- package/dist/ProfileSelector.svelte +25 -17
- package/dist/ProfileSelector.svelte.d.ts +4 -22
- package/dist/SectionLayout.svelte +6 -3
- package/dist/SectionLayout.svelte.d.ts +4 -18
- package/dist/SeparatorHorizontal.svelte +1 -1
- package/dist/SeparatorHorizontal.svelte.d.ts +22 -19
- package/dist/ShortcutWrapper.svelte +7 -1
- package/dist/ShortcutWrapper.svelte.d.ts +4 -27
- package/dist/StatusLabel.svelte +16 -12
- package/dist/StatusLabel.svelte.d.ts +4 -18
- package/dist/StepIconList.svelte +44 -41
- package/dist/StepIconList.svelte.d.ts +4 -17
- package/dist/TagBeta.svelte.d.ts +22 -19
- package/dist/TagSearch.svelte +19 -20
- package/dist/TagSearch.svelte.d.ts +4 -22
- package/dist/TagStatus.svelte +42 -37
- package/dist/TagStatus.svelte.d.ts +4 -19
- package/dist/TitleMain.svelte +9 -2
- package/dist/TitleMain.svelte.d.ts +4 -18
- package/dist/TitleSection.svelte +9 -2
- package/dist/TitleSection.svelte.d.ts +4 -18
- package/dist/UuidCopy.svelte +61 -48
- package/dist/UuidCopy.svelte.d.ts +4 -26
- package/dist/alert-dialog/alert-dialog-action.svelte +15 -15
- package/dist/alert-dialog/alert-dialog-action.svelte.d.ts +5 -26
- package/dist/alert-dialog/alert-dialog-cancel.svelte +13 -10
- package/dist/alert-dialog/alert-dialog-cancel.svelte.d.ts +3 -22
- package/dist/alert-dialog/alert-dialog-content.svelte +19 -15
- package/dist/alert-dialog/alert-dialog-content.svelte.d.ts +6 -15
- package/dist/alert-dialog/alert-dialog-description.svelte +11 -6
- package/dist/alert-dialog/alert-dialog-description.svelte.d.ts +3 -16
- package/dist/alert-dialog/alert-dialog-footer.svelte +11 -5
- package/dist/alert-dialog/alert-dialog-footer.svelte.d.ts +4 -16
- package/dist/alert-dialog/alert-dialog-header.svelte +14 -5
- package/dist/alert-dialog/alert-dialog-header.svelte.d.ts +4 -16
- package/dist/alert-dialog/alert-dialog-overlay.svelte +10 -13
- package/dist/alert-dialog/alert-dialog-overlay.svelte.d.ts +3 -14
- package/dist/alert-dialog/alert-dialog-title.svelte +11 -8
- package/dist/alert-dialog/alert-dialog-title.svelte.d.ts +3 -16
- package/dist/alert-dialog/alert-dialog-trigger.svelte +6 -0
- package/dist/alert-dialog/alert-dialog-trigger.svelte.d.ts +4 -0
- package/dist/alert-dialog/index.d.ts +3 -4
- package/dist/alert-dialog/index.js +2 -2
- package/dist/button/button.svelte +76 -18
- package/dist/button/button.svelte.d.ts +62 -14
- package/dist/button/index.d.ts +2 -60
- package/dist/button/index.js +1 -26
- package/dist/helpers.d.ts +4 -1
- package/dist/helpers.js +35 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +0 -4
- package/dist/range-calendar/index.d.ts +20 -0
- package/dist/range-calendar/index.js +22 -0
- package/dist/range-calendar/range-calendar-caption.svelte +71 -0
- package/dist/range-calendar/range-calendar-caption.svelte.d.ts +19 -0
- package/dist/range-calendar/range-calendar-cell.svelte +18 -0
- package/dist/range-calendar/range-calendar-cell.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-day.svelte +41 -0
- package/dist/range-calendar/range-calendar-day.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-grid-row.svelte +11 -0
- package/dist/range-calendar/range-calendar-grid-row.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-grid.svelte +15 -0
- package/dist/range-calendar/range-calendar-grid.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-head-cell.svelte +18 -0
- package/dist/range-calendar/range-calendar-head-cell.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-header.svelte +18 -0
- package/dist/range-calendar/range-calendar-header.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-heading.svelte +15 -0
- package/dist/range-calendar/range-calendar-heading.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-month-select.svelte +44 -0
- package/dist/range-calendar/range-calendar-month-select.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar-month.svelte +14 -0
- package/dist/range-calendar/range-calendar-month.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-months.svelte +18 -0
- package/dist/range-calendar/range-calendar-months.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-nav.svelte +18 -0
- package/dist/range-calendar/range-calendar-nav.svelte.d.ts +5 -0
- package/dist/range-calendar/range-calendar-next-button.svelte +30 -0
- package/dist/range-calendar/range-calendar-next-button.svelte.d.ts +8 -0
- package/dist/range-calendar/range-calendar-prev-button.svelte +30 -0
- package/dist/range-calendar/range-calendar-prev-button.svelte.d.ts +8 -0
- package/dist/range-calendar/range-calendar-year-select.svelte +43 -0
- package/dist/range-calendar/range-calendar-year-select.svelte.d.ts +4 -0
- package/dist/range-calendar/range-calendar.svelte +109 -0
- package/dist/range-calendar/range-calendar.svelte.d.ts +21 -0
- package/dist/svg/BgPattern.svelte.d.ts +22 -19
- package/dist/svg/IconContact.svelte +6 -1
- package/dist/svg/IconContact.svelte.d.ts +5 -15
- package/dist/svg/IconEmpty.svelte.d.ts +22 -19
- package/dist/svg/IconFile.svelte +6 -1
- package/dist/svg/IconFile.svelte.d.ts +5 -15
- package/dist/svg/IconInvoice.svelte +6 -1
- package/dist/svg/IconInvoice.svelte.d.ts +5 -15
- package/dist/svg/IconNoResults.svelte +6 -1
- package/dist/svg/IconNoResults.svelte.d.ts +5 -15
- package/dist/svg/IconPdf.svelte +6 -1
- package/dist/svg/IconPdf.svelte.d.ts +5 -15
- package/dist/svg/IconProduct.svelte +6 -1
- package/dist/svg/IconProduct.svelte.d.ts +5 -15
- package/dist/table/table-body.svelte +10 -5
- package/dist/table/table-body.svelte.d.ts +4 -16
- package/dist/table/table-caption.svelte +14 -5
- package/dist/table/table-caption.svelte.d.ts +4 -16
- package/dist/table/table-cell.svelte +16 -7
- package/dist/table/table-cell.svelte.d.ts +4 -19
- package/dist/table/table-footer.svelte +14 -5
- package/dist/table/table-footer.svelte.d.ts +4 -16
- package/dist/table/table-head.svelte +11 -5
- package/dist/table/table-head.svelte.d.ts +4 -16
- package/dist/table/table-header.svelte +17 -8
- package/dist/table/table-header.svelte.d.ts +4 -19
- package/dist/table/table-row.svelte +22 -8
- package/dist/table/table-row.svelte.d.ts +4 -22
- package/dist/table/table.svelte +11 -6
- package/dist/table/table.svelte.d.ts +4 -16
- package/dist/tabs/tabs-content.svelte +13 -8
- package/dist/tabs/tabs-content.svelte.d.ts +3 -16
- package/dist/tabs/tabs-list.svelte +7 -6
- package/dist/tabs/tabs-list.svelte.d.ts +3 -16
- package/dist/tabs/tabs-trigger.svelte +13 -9
- package/dist/tabs/tabs-trigger.svelte.d.ts +3 -14
- package/dist/tabs/tabs.svelte +12 -7
- package/dist/tabs/tabs.svelte.d.ts +3 -16
- package/dist/tooltip/index.d.ts +5 -3
- package/dist/tooltip/index.js +5 -3
- package/dist/tooltip/tooltip-content.svelte +42 -23
- package/dist/tooltip/tooltip-content.svelte.d.ts +5 -15
- package/dist/tooltip/tooltip-trigger.svelte +8 -0
- package/dist/tooltip/tooltip-trigger.svelte.d.ts +4 -0
- package/dist/tw.theme.d.ts +2 -9
- package/dist/tw.theme.js +0 -5
- package/dist/types.d.ts +484 -25
- package/dist/utils.d.ts +10 -1
- package/package.json +30 -39
- package/README.md +0 -234
- package/dist/BaseTableHeaderSortBy.svelte +0 -22
- package/dist/BaseTableHeaderSortBy.svelte.d.ts +0 -20
- package/dist/ComboBox.svelte +0 -12
- package/dist/ComboBox.svelte.d.ts +0 -21
- package/dist/ComboBoxContent.svelte +0 -33
- package/dist/ComboBoxContent.svelte.d.ts +0 -20
- package/dist/ProgressBar.svelte +0 -6
- package/dist/ProgressBar.svelte.d.ts +0 -16
- package/dist/alert-dialog/alert-dialog-portal.svelte +0 -6
- package/dist/alert-dialog/alert-dialog-portal.svelte.d.ts +0 -17
- package/dist/popui.css +0 -1
- package/dist/wcdispatch.d.ts +0 -1
- package/dist/wcdispatch.js +0 -9
package/dist/AlertDialog.svelte
CHANGED
|
@@ -1,84 +1,109 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
AlertDialog,
|
|
4
|
+
AlertDialogTrigger,
|
|
5
|
+
AlertDialogContent,
|
|
6
|
+
AlertDialogHeader,
|
|
7
|
+
AlertDialogTitle,
|
|
8
|
+
AlertDialogDescription,
|
|
9
|
+
AlertDialogFooter,
|
|
10
|
+
AlertDialogCancel,
|
|
11
|
+
AlertDialogAction
|
|
12
|
+
} from './alert-dialog'
|
|
13
|
+
import type { AlertDialogProps } from './types'
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
open = $bindable(false),
|
|
17
|
+
destructive = false,
|
|
18
|
+
title = '',
|
|
19
|
+
descriptionText = '',
|
|
20
|
+
cancelText = 'Cancel',
|
|
21
|
+
actionText = 'OK',
|
|
22
|
+
cancelActionEl = $bindable(null),
|
|
23
|
+
okActionEl = $bindable(null),
|
|
24
|
+
oncancel,
|
|
25
|
+
onconfirm,
|
|
26
|
+
description,
|
|
27
|
+
children
|
|
28
|
+
}: AlertDialogProps = $props()
|
|
29
|
+
|
|
30
|
+
let recentAction = $state(false)
|
|
31
|
+
|
|
32
|
+
function cancel() {
|
|
33
|
+
recentAction = true
|
|
34
|
+
oncancel?.()
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
recentAction = false
|
|
37
|
+
}, 10)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function confirm() {
|
|
41
|
+
recentAction = true
|
|
42
|
+
onconfirm?.()
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
recentAction = false
|
|
45
|
+
}, 10)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
$effect(() => {
|
|
49
|
+
if (!open) {
|
|
50
|
+
cancelByEsc()
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
function cancelByEsc() {
|
|
55
|
+
if (recentAction) return
|
|
56
|
+
|
|
57
|
+
oncancel?.()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function handleOpen(value: boolean) {
|
|
61
|
+
if (value) {
|
|
62
|
+
const focusEl = document.querySelector(
|
|
63
|
+
'[data-alert-dialog-action]:nth-of-type(2)'
|
|
64
|
+
) as HTMLElement
|
|
65
|
+
focusEl?.focus()
|
|
66
|
+
}
|
|
40
67
|
}
|
|
41
|
-
function cancelByEsc() {
|
|
42
|
-
if (recentAction)
|
|
43
|
-
return;
|
|
44
|
-
dispatch("cancel");
|
|
45
|
-
}
|
|
46
68
|
</script>
|
|
47
69
|
|
|
48
|
-
<AlertDialog
|
|
49
|
-
<AlertDialogTrigger class={
|
|
50
|
-
|
|
70
|
+
<AlertDialog onOpenChange={handleOpen} bind:open>
|
|
71
|
+
<AlertDialogTrigger class={children ? '' : 'hidden'}>
|
|
72
|
+
{@render children?.()}
|
|
51
73
|
</AlertDialogTrigger>
|
|
52
74
|
<AlertDialogContent>
|
|
53
75
|
<AlertDialogHeader>
|
|
54
76
|
<AlertDialogTitle>{title}</AlertDialogTitle>
|
|
55
77
|
<AlertDialogDescription>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
{#if description}
|
|
79
|
+
{@render description()}
|
|
80
|
+
{:else}
|
|
81
|
+
{descriptionText}
|
|
59
82
|
{/if}
|
|
60
83
|
</AlertDialogDescription>
|
|
61
84
|
</AlertDialogHeader>
|
|
62
85
|
<AlertDialogFooter>
|
|
63
86
|
<AlertDialogCancel
|
|
64
|
-
bind:
|
|
65
|
-
|
|
87
|
+
bind:ref={cancelActionEl}
|
|
88
|
+
onclick={() => {
|
|
66
89
|
cancel()
|
|
67
90
|
}}
|
|
68
|
-
|
|
69
|
-
if (e.
|
|
91
|
+
onkeydown={(e) => {
|
|
92
|
+
if (e.key === 'Enter') {
|
|
70
93
|
cancel()
|
|
71
94
|
}
|
|
72
|
-
}}
|
|
95
|
+
}}
|
|
73
96
|
>
|
|
97
|
+
{cancelText}
|
|
98
|
+
</AlertDialogCancel>
|
|
74
99
|
<AlertDialogAction
|
|
75
|
-
bind:
|
|
100
|
+
bind:ref={okActionEl}
|
|
76
101
|
{destructive}
|
|
77
|
-
|
|
102
|
+
onclick={() => {
|
|
78
103
|
confirm()
|
|
79
104
|
}}
|
|
80
|
-
|
|
81
|
-
if (e.
|
|
105
|
+
onkeydown={(e) => {
|
|
106
|
+
if (e.key === 'Enter') {
|
|
82
107
|
confirm()
|
|
83
108
|
}
|
|
84
109
|
}}
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
title?: string | undefined;
|
|
7
|
-
description?: string | undefined;
|
|
8
|
-
cancelText?: string | undefined;
|
|
9
|
-
actionText?: string | undefined;
|
|
10
|
-
cancelActionEl?: HTMLButtonElement | undefined;
|
|
11
|
-
okActionEl?: HTMLButtonElement | undefined;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
cancel: CustomEvent<any>;
|
|
15
|
-
confirm: CustomEvent<any>;
|
|
16
|
-
} & {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {
|
|
20
|
-
default: {};
|
|
21
|
-
description: {};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export type AlertDialogProps = typeof __propDef.props;
|
|
25
|
-
export type AlertDialogEvents = typeof __propDef.events;
|
|
26
|
-
export type AlertDialogSlots = typeof __propDef.slots;
|
|
27
|
-
export default class AlertDialog extends SvelteComponent<AlertDialogProps, AlertDialogEvents, AlertDialogSlots> {
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
1
|
+
import { AlertDialog } from './alert-dialog';
|
|
2
|
+
import type { AlertDialogProps } from './types';
|
|
3
|
+
declare const AlertDialog: import("svelte").Component<AlertDialogProps, {}, "open" | "cancelActionEl" | "okActionEl">;
|
|
4
|
+
type AlertDialog = ReturnType<typeof AlertDialog>;
|
|
5
|
+
export default AlertDialog;
|
package/dist/BaseButton.svelte
CHANGED
|
@@ -1,119 +1,124 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import type { BaseButtonProps } from './types.ts'
|
|
4
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
5
|
+
import ShortcutWrapper from './ShortcutWrapper.svelte'
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
icon,
|
|
9
|
+
iconTheme = 'default',
|
|
10
|
+
iconPosition = 'left',
|
|
11
|
+
type = 'button',
|
|
12
|
+
variant = 'default',
|
|
13
|
+
disabled = false,
|
|
14
|
+
small = false,
|
|
15
|
+
big = false,
|
|
16
|
+
dangerIcon = false,
|
|
17
|
+
shortcut = false,
|
|
18
|
+
fullwidth = false,
|
|
19
|
+
notification = false,
|
|
20
|
+
children,
|
|
21
|
+
onclick,
|
|
22
|
+
...rest
|
|
23
|
+
}: BaseButtonProps = $props()
|
|
24
|
+
|
|
25
|
+
let buttonStyles = $derived(
|
|
26
|
+
clsx(
|
|
27
|
+
{ 'w-full': fullwidth },
|
|
28
|
+
{ 'opacity-30 pointer-events-none': disabled },
|
|
29
|
+
{ 'flex-row-reverse space-x-reverse': iconPosition === 'right' },
|
|
30
|
+
{ 'bg-white': variant === 'default' },
|
|
31
|
+
{ 'bg-workspace-accent': variant === 'primary' },
|
|
32
|
+
{ 'bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300': variant === 'secondary' },
|
|
33
|
+
{ 'bg-danger-500': variant === 'danger' },
|
|
34
|
+
{ 'bg-warning-500': variant === 'warning' },
|
|
35
|
+
{ 'text-sm rounded': small },
|
|
36
|
+
{ 'text-base rounded-md': !small },
|
|
37
|
+
{ 'p-1': small && !children },
|
|
38
|
+
{ 'p-1.5': !small && !big && !children },
|
|
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': !small && !big && children && icon && iconPosition === 'left' },
|
|
45
|
+
{ 'pl-2 pr-1.5': !small && !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
|
+
}
|
|
92
97
|
</script>
|
|
93
98
|
|
|
94
99
|
<button
|
|
95
100
|
{type}
|
|
96
101
|
{disabled}
|
|
97
|
-
class="{buttonStyles} flex items-center justify-center font-medium font-sans relative group tracking-tight"
|
|
98
|
-
{
|
|
99
|
-
|
|
102
|
+
class="{buttonStyles} flex items-center justify-center font-medium font-sans relative group tracking-tight cursor-pointer"
|
|
103
|
+
{...rest}
|
|
104
|
+
onclick={handleClick}
|
|
100
105
|
>
|
|
101
|
-
<span class="{overlayClasses} absolute inset-0"
|
|
102
|
-
{#if
|
|
106
|
+
<span class="{overlayClasses} absolute inset-0"></span>
|
|
107
|
+
{#if icon}
|
|
103
108
|
<div class="relative">
|
|
104
109
|
{#if shortcut}
|
|
105
110
|
<ShortcutWrapper>
|
|
106
|
-
<Icon src={
|
|
111
|
+
<Icon src={icon} theme={iconTheme} class="{iconStyles} h-3 w-3 z-10" />
|
|
107
112
|
</ShortcutWrapper>
|
|
108
113
|
{:else}
|
|
109
|
-
<Icon src={
|
|
114
|
+
<Icon src={icon} theme={iconTheme} class="{iconStyles} h-4 w-4 z-10" />
|
|
110
115
|
{/if}
|
|
111
116
|
{#if notification}
|
|
112
|
-
<span class="absolute top-0 right-0 w-1.5 h-1.5 bg-danger-500 rounded-full z-20"
|
|
117
|
+
<span class="absolute top-0 right-0 w-1.5 h-1.5 bg-danger-500 rounded-full z-20"></span>
|
|
113
118
|
{/if}
|
|
114
119
|
</div>
|
|
115
120
|
{/if}
|
|
116
|
-
{#if
|
|
117
|
-
<span class="z-10"
|
|
121
|
+
{#if children}
|
|
122
|
+
<span class="z-10">{@render children?.()}</span>
|
|
118
123
|
{/if}
|
|
119
124
|
</button>
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props: {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
icon?: IconSource | string | undefined;
|
|
8
|
-
iconTheme?: IconTheme | undefined;
|
|
9
|
-
iconPosition?: IconPosition | undefined;
|
|
10
|
-
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
11
|
-
variant?: ButtonVariant | undefined;
|
|
12
|
-
disabled?: boolean | undefined;
|
|
13
|
-
small?: boolean | undefined;
|
|
14
|
-
big?: boolean | undefined;
|
|
15
|
-
dangerIcon?: boolean | undefined;
|
|
16
|
-
shortcut?: boolean | undefined;
|
|
17
|
-
fullwidth?: boolean | undefined;
|
|
18
|
-
notification?: boolean | undefined;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
click: CustomEvent<any>;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type BaseButtonProps = typeof __propDef.props;
|
|
30
|
-
export type BaseButtonEvents = typeof __propDef.events;
|
|
31
|
-
export type BaseButtonSlots = typeof __propDef.slots;
|
|
32
|
-
export default class BaseButton extends SvelteComponent<BaseButtonProps, BaseButtonEvents, BaseButtonSlots> {
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
1
|
+
import type { BaseButtonProps } from './types.ts';
|
|
2
|
+
declare const BaseButton: import("svelte").Component<BaseButtonProps, {}, "">;
|
|
3
|
+
type BaseButton = ReturnType<typeof BaseButton>;
|
|
4
|
+
export default BaseButton;
|
package/dist/BaseCard.svelte
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import TagBeta from './TagBeta.svelte'
|
|
3
|
+
import type { BaseCardProps } from './types'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
imageUrl = '',
|
|
7
|
+
imageAlt = '',
|
|
8
|
+
title = '',
|
|
9
|
+
description = '',
|
|
10
|
+
type = 'default',
|
|
11
|
+
enabled = false,
|
|
12
|
+
footer,
|
|
13
|
+
onclick,
|
|
14
|
+
...rest
|
|
15
|
+
}: BaseCardProps = $props()
|
|
8
16
|
</script>
|
|
9
17
|
|
|
10
18
|
<button
|
|
11
19
|
class="rounded-lg bg-white hover:bg-neutral-100 focus:bg-neutral-200 disabled:bg-neutral-50 disabled:pointer-events-none border border-neutral-100 p-3 flex flex-col min-w-[298px] min-h-[126px] text-left"
|
|
12
20
|
disabled={type === 'soon'}
|
|
13
|
-
{
|
|
14
|
-
|
|
21
|
+
{...rest}
|
|
22
|
+
{onclick}
|
|
15
23
|
>
|
|
16
24
|
<div class="flex flex-col items-start justify-center space-y-2 w-full">
|
|
17
25
|
<div class="flex items-center justify-between w-full">
|
|
@@ -23,7 +31,7 @@ export let enabled = false;
|
|
|
23
31
|
<div
|
|
24
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"
|
|
25
33
|
>
|
|
26
|
-
<div class="bg-positive-500 h-2 w-2 rounded-full"
|
|
34
|
+
<div class="bg-positive-500 h-2 w-2 rounded-full"></div>
|
|
27
35
|
<span>Enabled</span>
|
|
28
36
|
</div>
|
|
29
37
|
{/if}
|
|
@@ -43,9 +51,9 @@ export let enabled = false;
|
|
|
43
51
|
<p class="flex mt-0.5 text-base text-neutral-500 tracking-normal flex-1">
|
|
44
52
|
{description}
|
|
45
53
|
</p>
|
|
46
|
-
{#if
|
|
54
|
+
{#if footer}
|
|
47
55
|
<div class="mt-5">
|
|
48
|
-
|
|
56
|
+
{@render footer?.()}
|
|
49
57
|
</div>
|
|
50
58
|
{/if}
|
|
51
59
|
</button>
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
imageUrl?: string | undefined;
|
|
6
|
-
imageAlt?: string | undefined;
|
|
7
|
-
title?: string | undefined;
|
|
8
|
-
description?: string | undefined;
|
|
9
|
-
type?: "default" | "soon" | "beta" | undefined;
|
|
10
|
-
enabled?: boolean | undefined;
|
|
11
|
-
};
|
|
12
|
-
events: {
|
|
13
|
-
click: MouseEvent;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
footer: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type BaseCardProps = typeof __propDef.props;
|
|
22
|
-
export type BaseCardEvents = typeof __propDef.events;
|
|
23
|
-
export type BaseCardSlots = typeof __propDef.slots;
|
|
24
|
-
export default class BaseCard extends SvelteComponent<BaseCardProps, BaseCardEvents, BaseCardSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
1
|
+
import type { BaseCardProps } from './types';
|
|
2
|
+
declare const BaseCard: import("svelte").Component<BaseCardProps, {}, "">;
|
|
3
|
+
type BaseCard = ReturnType<typeof BaseCard>;
|
|
4
|
+
export default BaseCard;
|
package/dist/BaseCounter.svelte
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import type { BaseCounterProps } from './types'
|
|
4
|
+
|
|
5
|
+
let { content, variant = 'default' }: BaseCounterProps = $props()
|
|
6
|
+
|
|
7
|
+
let styles = $derived(
|
|
8
|
+
clsx(
|
|
9
|
+
{ 'bg-neutral-100': variant === 'light' },
|
|
10
|
+
{ 'bg-neutral-200': variant === 'default' },
|
|
11
|
+
{ 'bg-neutral-300': variant === 'dark' }
|
|
12
|
+
)
|
|
13
|
+
)
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
<div
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
variant?: "default" | "dark" | "light" | undefined;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type BaseCounterProps = typeof __propDef.props;
|
|
13
|
-
export type BaseCounterEvents = typeof __propDef.events;
|
|
14
|
-
export type BaseCounterSlots = typeof __propDef.slots;
|
|
15
|
-
export default class BaseCounter extends SvelteComponent<BaseCounterProps, BaseCounterEvents, BaseCounterSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
import type { BaseCounterProps } from './types';
|
|
2
|
+
declare const BaseCounter: import("svelte").Component<BaseCounterProps, {}, "">;
|
|
3
|
+
type BaseCounter = ReturnType<typeof BaseCounter>;
|
|
4
|
+
export default BaseCounter;
|