@invopop/popui 0.0.108 → 0.1.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 +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 -25
- 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 +69 -56
- 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 -32
- 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 +32 -41
- 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
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
footer: {};
|
|
11
|
-
}> {
|
|
12
|
-
}
|
|
13
|
-
export type FormLayoutModalProps = typeof __propDef.props;
|
|
14
|
-
export type FormLayoutModalEvents = typeof __propDef.events;
|
|
15
|
-
export type FormLayoutModalSlots = typeof __propDef.slots;
|
|
16
|
-
import { SvelteComponent } from "svelte";
|
|
17
|
-
declare const __propDef: {
|
|
18
|
-
props: {
|
|
19
|
-
[x: string]: never;
|
|
20
|
-
};
|
|
21
|
-
events: {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
};
|
|
24
|
-
slots: {
|
|
25
|
-
default: {};
|
|
26
|
-
footer: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export {};
|
|
1
|
+
import type { FormLayoutModalProps } from './types';
|
|
2
|
+
declare const FormLayoutModal: import("svelte").Component<FormLayoutModalProps, {}, "">;
|
|
3
|
+
type FormLayoutModal = ReturnType<typeof FormLayoutModal>;
|
|
4
|
+
export default FormLayoutModal;
|
package/dist/GlobalSearch.svelte
CHANGED
|
@@ -1,39 +1,46 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
3
|
+
import { Search, Slash } from '@invopop/ui-icons'
|
|
4
|
+
import { onDestroy, onMount } from 'svelte'
|
|
5
|
+
import clsx from 'clsx'
|
|
6
|
+
import ShortcutWrapper from './ShortcutWrapper.svelte'
|
|
7
|
+
import { GLOBAL_SEARCH_KEY } from './constants.js'
|
|
8
|
+
import { isInputFocused } from './helpers.js'
|
|
9
|
+
import type { GlobalSearchProps } from './types'
|
|
10
|
+
|
|
11
|
+
let { collapsed = false, onOpen }: GlobalSearchProps = $props()
|
|
12
|
+
|
|
13
|
+
let styles = $derived(
|
|
14
|
+
clsx({
|
|
15
|
+
'space-x-1 w-full': !collapsed
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
20
|
+
if (event.key !== GLOBAL_SEARCH_KEY) {
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// We allow to type the GLOBAL SEARCH KEY on text fields
|
|
25
|
+
if (isInputFocused()) {
|
|
26
|
+
return
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
onOpen?.()
|
|
20
30
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
onDestroy(() => {
|
|
30
|
-
window.removeEventListener("keydown", onKeyDown);
|
|
31
|
-
});
|
|
31
|
+
|
|
32
|
+
onMount(() => {
|
|
33
|
+
window.addEventListener('keydown', onKeyDown)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
onDestroy(() => {
|
|
37
|
+
window.removeEventListener('keydown', onKeyDown)
|
|
38
|
+
})
|
|
32
39
|
</script>
|
|
33
40
|
|
|
34
41
|
<button
|
|
35
42
|
class="{styles} flex items-center border pl-1.5 py-1.5 pr-2 border-white-10 bg-neutral-800/10 rounded-md"
|
|
36
|
-
|
|
43
|
+
onclick={() => onOpen?.()}
|
|
37
44
|
>
|
|
38
45
|
<Icon src={Search} class="w-4 h-4 text-white-70" />
|
|
39
46
|
{#if !collapsed}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
open: CustomEvent<any>;
|
|
8
|
-
} & {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type GlobalSearchProps = typeof __propDef.props;
|
|
14
|
-
export type GlobalSearchEvents = typeof __propDef.events;
|
|
15
|
-
export type GlobalSearchSlots = typeof __propDef.slots;
|
|
16
|
-
export default class GlobalSearch extends SvelteComponent<GlobalSearchProps, GlobalSearchEvents, GlobalSearchSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
1
|
+
import type { GlobalSearchProps } from './types';
|
|
2
|
+
declare const GlobalSearch: import("svelte").Component<GlobalSearchProps, {}, "">;
|
|
3
|
+
type GlobalSearch = ReturnType<typeof GlobalSearch>;
|
|
4
|
+
export default GlobalSearch;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { InputCheckboxProps } from './types'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
id = Math.random().toString(36).slice(2, 7),
|
|
6
|
+
checked = $bindable(false),
|
|
7
|
+
indeterminate = false,
|
|
8
|
+
label = '',
|
|
9
|
+
onchange,
|
|
10
|
+
onclick,
|
|
11
|
+
...rest
|
|
12
|
+
}: InputCheckboxProps = $props()
|
|
13
|
+
|
|
14
|
+
function updateInput(event: Event) {
|
|
15
|
+
const target = event.target as HTMLInputElement
|
|
16
|
+
|
|
17
|
+
checked = target.checked
|
|
18
|
+
|
|
19
|
+
onchange?.(checked)
|
|
20
|
+
}
|
|
12
21
|
</script>
|
|
13
22
|
|
|
14
23
|
<label
|
|
@@ -21,9 +30,9 @@ function updateInput(event) {
|
|
|
21
30
|
{checked}
|
|
22
31
|
{indeterminate}
|
|
23
32
|
class="form-checkbox w-4 h-4 text-workspace-accent focus:text-workspace-accent rounded border border-neutral-200 hover:border-neutral-300 group-hover:border-neutral-300 focus:ring-0 focus:ring-offset-0"
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
{...rest}
|
|
34
|
+
onchange={updateInput}
|
|
35
|
+
{onclick}
|
|
27
36
|
/>
|
|
28
37
|
{#if label}
|
|
29
38
|
<span>{label}</span>
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id?: string | undefined;
|
|
6
|
-
checked?: boolean | undefined;
|
|
7
|
-
indeterminate?: boolean | undefined;
|
|
8
|
-
label?: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
click: MouseEvent;
|
|
12
|
-
change: CustomEvent<any>;
|
|
13
|
-
} & {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {};
|
|
17
|
-
};
|
|
18
|
-
export type InputCheckboxProps = typeof __propDef.props;
|
|
19
|
-
export type InputCheckboxEvents = typeof __propDef.events;
|
|
20
|
-
export type InputCheckboxSlots = typeof __propDef.slots;
|
|
21
|
-
export default class InputCheckbox extends SvelteComponent<InputCheckboxProps, InputCheckboxEvents, InputCheckboxSlots> {
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
1
|
+
import type { InputCheckboxProps } from './types';
|
|
2
|
+
declare const InputCheckbox: import("svelte").Component<InputCheckboxProps, {}, "checked">;
|
|
3
|
+
type InputCheckbox = ReturnType<typeof InputCheckbox>;
|
|
4
|
+
export default InputCheckbox;
|
package/dist/InputError.svelte
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type InputErrorProps = typeof __propDef.props;
|
|
12
|
-
export type InputErrorEvents = typeof __propDef.events;
|
|
13
|
-
export type InputErrorSlots = typeof __propDef.slots;
|
|
14
|
-
export default class InputError extends SvelteComponent<InputErrorProps, InputErrorEvents, InputErrorSlots> {
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
1
|
+
import type { InputErrorProps } from './types';
|
|
2
|
+
declare const InputError: import("svelte").Component<InputErrorProps, {}, "">;
|
|
3
|
+
type InputError = ReturnType<typeof InputError>;
|
|
4
|
+
export default InputError;
|
package/dist/InputLabel.svelte
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { InputLabelProps } from './types'
|
|
3
|
+
|
|
4
|
+
let { id = '', label = '', ...rest }: InputLabelProps = $props()
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
|
-
<label for={id} class="text-sm font-medium text-neutral-500 mb-2" {
|
|
7
|
+
<label for={id} class="text-sm font-medium text-neutral-500 mb-2" {...rest}>{label}</label>
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id?: string | undefined;
|
|
6
|
-
label?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type InputLabelProps = typeof __propDef.props;
|
|
14
|
-
export type InputLabelEvents = typeof __propDef.events;
|
|
15
|
-
export type InputLabelSlots = typeof __propDef.slots;
|
|
16
|
-
export default class InputLabel extends SvelteComponent<InputLabelProps, InputLabelEvents, InputLabelSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
1
|
+
import type { InputLabelProps } from './types';
|
|
2
|
+
declare const InputLabel: import("svelte").Component<InputLabelProps, {}, "">;
|
|
3
|
+
type InputLabel = ReturnType<typeof InputLabel>;
|
|
4
|
+
export default InputLabel;
|
package/dist/InputRadio.svelte
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { InputRadioProps } from './types'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
checked = false,
|
|
6
|
+
id = Math.random().toString(36).slice(2, 7),
|
|
7
|
+
name = '',
|
|
8
|
+
onchange,
|
|
9
|
+
...rest
|
|
10
|
+
}: InputRadioProps = $props()
|
|
11
|
+
|
|
12
|
+
let el: HTMLInputElement | undefined = $state()
|
|
13
|
+
|
|
14
|
+
$effect(() => {
|
|
15
|
+
if (el && checked) {
|
|
16
|
+
el.focus()
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
function updateInput(event: Event) {
|
|
21
|
+
const target = event.target as HTMLInputElement
|
|
22
|
+
|
|
23
|
+
onchange?.(target.checked)
|
|
11
24
|
}
|
|
12
|
-
function updateInput(event) {
|
|
13
|
-
if (event instanceof CustomEvent)
|
|
14
|
-
return;
|
|
15
|
-
const target = event.target;
|
|
16
|
-
dispatch("change", target.checked);
|
|
17
|
-
dispatchWcEvent(target, "change", target.checked);
|
|
18
|
-
}
|
|
19
25
|
</script>
|
|
20
26
|
|
|
21
27
|
<input
|
|
@@ -25,6 +31,6 @@ function updateInput(event) {
|
|
|
25
31
|
{name}
|
|
26
32
|
{checked}
|
|
27
33
|
class="form-radio h-5 w-5 border-neutral-200 text-workspace-accent focus:ring-0 focus:ring-offset-0 cursor-pointer"
|
|
28
|
-
{
|
|
29
|
-
|
|
34
|
+
{...rest}
|
|
35
|
+
onchange={updateInput}
|
|
30
36
|
/>
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
checked?: boolean | undefined;
|
|
6
|
-
id?: string | undefined;
|
|
7
|
-
name?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
change: CustomEvent<any>;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
15
|
-
};
|
|
16
|
-
export type InputRadioProps = typeof __propDef.props;
|
|
17
|
-
export type InputRadioEvents = typeof __propDef.events;
|
|
18
|
-
export type InputRadioSlots = typeof __propDef.slots;
|
|
19
|
-
export default class InputRadio extends SvelteComponent<InputRadioProps, InputRadioEvents, InputRadioSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
1
|
+
import type { InputRadioProps } from './types';
|
|
2
|
+
declare const InputRadio: import("svelte").Component<InputRadioProps, {}, "">;
|
|
3
|
+
type InputRadio = ReturnType<typeof InputRadio>;
|
|
4
|
+
export default InputRadio;
|
package/dist/InputSearch.svelte
CHANGED
|
@@ -1,44 +1,64 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import { Icon } from
|
|
4
|
-
import { Search } from
|
|
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
|
-
const
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
import { Icon } from '@steeze-ui/svelte-icon'
|
|
4
|
+
import { Search } from '@invopop/ui-icons'
|
|
5
|
+
import type { InputSearchProps } from './types.js'
|
|
6
|
+
|
|
7
|
+
const debounce = (target: HTMLInputElement) => {
|
|
8
|
+
clearTimeout(timer)
|
|
9
|
+
timer = setTimeout(() => {
|
|
10
|
+
oninput?.(target.value)
|
|
11
|
+
}, 750)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
value = $bindable(''),
|
|
16
|
+
shortcut = '',
|
|
17
|
+
placeholder = '',
|
|
18
|
+
icon = Search,
|
|
19
|
+
focusOnLoad = false,
|
|
20
|
+
oninput,
|
|
21
|
+
onclick,
|
|
22
|
+
onfocus,
|
|
23
|
+
onblur,
|
|
24
|
+
...rest
|
|
25
|
+
}: InputSearchProps = $props()
|
|
26
|
+
|
|
27
|
+
let input: HTMLInputElement | undefined = $state()
|
|
28
|
+
let timer: ReturnType<typeof setTimeout>
|
|
29
|
+
|
|
30
|
+
export const focus = () => {
|
|
31
|
+
input?.focus()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const blur = () => {
|
|
35
|
+
input?.blur()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const toggle = () => {
|
|
39
|
+
input === document.activeElement ? blur() : focus()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const clear = () => {
|
|
43
|
+
value = ''
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let shortcutKeys = $derived(shortcut.split(''))
|
|
47
|
+
|
|
48
|
+
function handleInput(event: unknown) {
|
|
49
|
+
// If event is not a native event we skip the dispatch to avoid infinite loop
|
|
50
|
+
if (event instanceof CustomEvent) return
|
|
51
|
+
|
|
52
|
+
const target = (event as PointerEvent).target as HTMLInputElement
|
|
53
|
+
|
|
54
|
+
debounce(target)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
onMount(() => {
|
|
58
|
+
if (!focusOnLoad) return
|
|
59
|
+
|
|
60
|
+
focus()
|
|
61
|
+
})
|
|
42
62
|
</script>
|
|
43
63
|
|
|
44
64
|
<div class="relative flex items-center">
|
|
@@ -49,11 +69,11 @@ onMount(() => {
|
|
|
49
69
|
class="py-[5px] pl-7 border border-neutral-200 hover:border-neutral-300 w-full rounded-md text-neutral-800 placeholder-neutral-500 text-base outline-none tracking-tight caret-workspace-accent focus:border-workspace-accent focus:shadow-active"
|
|
50
70
|
style:padding-right={`${shortcutKeys.length * 15 + 12}px`}
|
|
51
71
|
{placeholder}
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
{...rest}
|
|
73
|
+
oninput={handleInput}
|
|
74
|
+
{onfocus}
|
|
75
|
+
{onblur}
|
|
76
|
+
{onclick}
|
|
57
77
|
/>
|
|
58
78
|
<Icon src={icon} class="absolute text-neutral-500 w-4 h-4 left-2" />
|
|
59
79
|
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
focus?: (() => void) | undefined;
|
|
11
|
-
toggle?: (() => void) | undefined;
|
|
12
|
-
clear?: (() => void) | undefined;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
click: MouseEvent;
|
|
16
|
-
focus: CustomEvent<any>;
|
|
17
|
-
blur: CustomEvent<any>;
|
|
18
|
-
input: CustomEvent<any>;
|
|
19
|
-
} & {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
};
|
|
22
|
-
slots: {};
|
|
23
|
-
};
|
|
24
|
-
export type InputSearchProps = typeof __propDef.props;
|
|
25
|
-
export type InputSearchEvents = typeof __propDef.events;
|
|
26
|
-
export type InputSearchSlots = typeof __propDef.slots;
|
|
27
|
-
export default class InputSearch extends SvelteComponent<InputSearchProps, InputSearchEvents, InputSearchSlots> {
|
|
28
|
-
get focus(): () => void;
|
|
29
|
-
get toggle(): () => void;
|
|
30
|
-
get clear(): () => void;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
1
|
+
import type { InputSearchProps } from './types.js';
|
|
2
|
+
declare const InputSearch: import("svelte").Component<InputSearchProps, {
|
|
3
|
+
focus: () => void;
|
|
4
|
+
blur: () => void;
|
|
5
|
+
toggle: () => void;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
}, "value">;
|
|
8
|
+
type InputSearch = ReturnType<typeof InputSearch>;
|
|
9
|
+
export default InputSearch;
|
package/dist/InputSelect.svelte
CHANGED
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import InputError from
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { InputSelectProps } from './types.ts'
|
|
3
|
+
import { Icon, type IconSource } from '@steeze-ui/svelte-icon'
|
|
4
|
+
import InputLabel from './InputLabel.svelte'
|
|
5
|
+
import { resolveIcon } from './helpers.js'
|
|
6
|
+
import InputError from './InputError.svelte'
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
id = Math.random().toString(36).slice(2, 7),
|
|
10
|
+
name = '',
|
|
11
|
+
label = '',
|
|
12
|
+
disabled = false,
|
|
13
|
+
value = $bindable(''),
|
|
14
|
+
icon = undefined,
|
|
15
|
+
iconTheme = 'default',
|
|
16
|
+
options = [],
|
|
17
|
+
placeholder = 'Select one...',
|
|
18
|
+
disablePlaceholder = true,
|
|
19
|
+
errorText = '',
|
|
20
|
+
onchange,
|
|
21
|
+
...rest
|
|
22
|
+
}: InputSelectProps = $props()
|
|
23
|
+
|
|
24
|
+
let resolvedIcon: IconSource | undefined = $state()
|
|
25
|
+
|
|
26
|
+
$effect(() => {
|
|
27
|
+
resolveIcon(icon).then((res) => (resolvedIcon = res))
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
function handleChange(event: Event) {
|
|
31
|
+
const target = (event as PointerEvent).target as HTMLSelectElement
|
|
32
|
+
|
|
33
|
+
onchange?.(target.value)
|
|
34
|
+
}
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
37
|
{#if label}
|
|
@@ -43,8 +46,8 @@ function handleChange(event) {
|
|
|
43
46
|
class:pl-7={icon}
|
|
44
47
|
class:pl-2={!icon}
|
|
45
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"
|
|
46
|
-
{
|
|
47
|
-
|
|
49
|
+
{...rest}
|
|
50
|
+
onchange={handleChange}
|
|
48
51
|
>
|
|
49
52
|
<option value="" disabled={disablePlaceholder}>{placeholder}</option>
|
|
50
53
|
{#each options as option}
|
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props: {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
id?: string | undefined;
|
|
8
|
-
name?: string | undefined;
|
|
9
|
-
label?: string | undefined;
|
|
10
|
-
disabled?: boolean | undefined;
|
|
11
|
-
value?: string | undefined;
|
|
12
|
-
icon?: IconSource | string | undefined;
|
|
13
|
-
iconTheme?: IconTheme | undefined;
|
|
14
|
-
options?: SelectOption[] | undefined;
|
|
15
|
-
placeholder?: string | undefined;
|
|
16
|
-
disablePlaceholder?: boolean | undefined;
|
|
17
|
-
errorText?: string | undefined;
|
|
18
|
-
};
|
|
19
|
-
events: {
|
|
20
|
-
change: CustomEvent<any>;
|
|
21
|
-
} & {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
};
|
|
24
|
-
slots: {};
|
|
25
|
-
};
|
|
26
|
-
export type InputSelectProps = typeof __propDef.props;
|
|
27
|
-
export type InputSelectEvents = typeof __propDef.events;
|
|
28
|
-
export type InputSelectSlots = typeof __propDef.slots;
|
|
29
|
-
export default class InputSelect extends SvelteComponent<InputSelectProps, InputSelectEvents, InputSelectSlots> {
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
1
|
+
import type { InputSelectProps } from './types.ts';
|
|
2
|
+
declare const InputSelect: import("svelte").Component<InputSelectProps, {}, "value">;
|
|
3
|
+
type InputSelect = ReturnType<typeof InputSelect>;
|
|
4
|
+
export default InputSelect;
|