compote-ui 0.75.4 → 0.77.0
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/components/carousel/carousel-next-trigger.svelte +1 -1
- package/dist/components/carousel/carousel-prev-trigger.svelte +1 -1
- package/dist/components/checkbox/checkbox.svelte +1 -1
- package/dist/components/combobox/combobox.svelte +1 -1
- package/dist/components/combobox/types.d.ts +1 -1
- package/dist/components/data-table-v9/data-table-cell-content.svelte +1 -1
- package/dist/components/data-table-v9/data-table-head.svelte +1 -1
- package/dist/components/data-table-v9/index.d.ts +1 -0
- package/dist/components/data-table-v9/index.js +1 -0
- package/dist/components/data-table-v9/toolbar/data-table-column-filter.svelte +41 -11
- package/dist/components/data-table-v9/toolbar/data-table-column-filter.svelte.d.ts +1 -0
- package/dist/components/data-table-v9/toolbar/data-table-column-visibility.svelte +27 -7
- package/dist/components/data-table-v9/toolbar/data-table-column-visibility.svelte.d.ts +1 -0
- package/dist/components/data-table-v9/toolbar/data-table-refresh.svelte +46 -0
- package/dist/components/data-table-v9/toolbar/data-table-refresh.svelte.d.ts +11 -0
- package/dist/components/data-table-v9/toolbar/data-table-search.svelte +1 -1
- package/dist/components/data-table-v9/virtual/index.d.ts +1 -1
- package/dist/components/data-table-v9/virtual/index.js +1 -1
- package/dist/components/date-field/date-field.svelte +3 -3
- package/dist/components/date-input/date-input.svelte +2 -2
- package/dist/components/date-picker/date-picker-calendar.svelte +1 -1
- package/dist/components/date-picker/date-picker.svelte +3 -3
- package/dist/components/date-range-field/date-range-field.svelte +3 -3
- package/dist/components/dialog/alert-dialog.svelte +1 -1
- package/dist/components/dialog/dialog-close-trigger.svelte +2 -2
- package/dist/components/dialog/dialog-close-trigger.svelte.d.ts +1 -1
- package/dist/components/drawer/drawer-body.svelte +1 -1
- package/dist/components/drawer/drawer-close-trigger.svelte +1 -1
- package/dist/components/file-upload/file-upload-dropzone.svelte +1 -1
- package/dist/components/file-upload/file-upload.svelte +1 -1
- package/dist/components/file-upload/icons.js +1 -1
- package/dist/components/image-crop-dialog/image-crop-dialog.svelte +2 -2
- package/dist/components/image-crop-dialog/types.d.ts +1 -1
- package/dist/components/image-cropper/image-cropper.svelte +4 -4
- package/dist/components/image-cropper/types.d.ts +1 -1
- package/dist/components/image-upload/image-upload.svelte +2 -2
- package/dist/components/image-upload/types.d.ts +1 -1
- package/dist/components/json-tree-view/json-tree-view.svelte +1 -1
- package/dist/components/listbox/listbox-content.svelte +1 -1
- package/dist/components/listbox/listbox-content.svelte.d.ts +1 -1
- package/dist/components/listbox/listbox-context.d.ts +1 -1
- package/dist/components/listbox/listbox-item-indicator.svelte +1 -1
- package/dist/components/listbox/listbox-root.svelte +1 -1
- package/dist/components/listbox/listbox-root.svelte.d.ts +1 -1
- package/dist/components/menu/menu-checkbox-item.svelte +1 -1
- package/dist/components/menu/menu-indicator.svelte +1 -1
- package/dist/components/number-input/number-input.svelte +1 -1
- package/dist/components/password-input/password-input.svelte +1 -1
- package/dist/components/phone-input/phone-input.svelte +1 -1
- package/dist/components/popover/popover-close-trigger.svelte +1 -1
- package/dist/components/popover/popover-trigger.svelte +2 -2
- package/dist/components/popover/popover-trigger.svelte.d.ts +2 -2
- package/dist/components/select/select.svelte +2 -2
- package/dist/components/select/select.svelte.d.ts +1 -1
- package/dist/components/select/types.d.ts +1 -1
- package/dist/components/tags-input/tags-input.svelte +1 -1
- package/dist/components/toast/toast.js +11 -3
- package/dist/components/toast/toaster.svelte +6 -6
- package/dist/components/tree-view/tree-view.svelte +2 -2
- package/dist/components/tree-view/types.d.ts +1 -1
- package/dist/icons/PhColumns.svelte +19 -0
- package/dist/icons/PhColumns.svelte.d.ts +5 -0
- package/dist/icons/PhFunnel.svelte +19 -0
- package/dist/icons/PhFunnel.svelte.d.ts +5 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +2 -0
- package/package.json +15 -6
- package/skills/data-table/SKILL.md +37 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PhArrowRight } from '../../icons';
|
|
2
|
+
import { PhArrowRight } from '../../index.ts/icons';
|
|
3
3
|
import { Carousel } from '@ark-ui/svelte/carousel';
|
|
4
4
|
import type { CarouselNextTriggerProps } from '@ark-ui/svelte/carousel';
|
|
5
5
|
import { cn } from 'tailwind-variants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PhArrowLeft } from '../../icons';
|
|
2
|
+
import { PhArrowLeft } from '../../index.ts/icons';
|
|
3
3
|
import { Carousel } from '@ark-ui/svelte/carousel';
|
|
4
4
|
import type { CarouselPrevTriggerProps } from '@ark-ui/svelte/carousel';
|
|
5
5
|
import { cn } from 'tailwind-variants';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Checkbox } from '@ark-ui/svelte/checkbox';
|
|
3
3
|
import { cn } from 'tailwind-variants';
|
|
4
4
|
import type { CheckboxProps as Props } from './checkbox.types.js';
|
|
5
|
-
import { PhCheck, PhMinus } from '../../icons';
|
|
5
|
+
import { PhCheck, PhMinus } from '../../index.ts/icons';
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
checked = $bindable(),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import type { ComboboxProps } from './types';
|
|
9
9
|
import { createListCollection, type ListItem } from '../../utils/collections';
|
|
10
10
|
import { cn } from 'tailwind-variants';
|
|
11
|
-
import { PhCaretDown, PhCheck, PhX } from '../../icons';
|
|
11
|
+
import { PhCaretDown, PhCheck, PhX } from '../../index.ts/icons';
|
|
12
12
|
|
|
13
13
|
let {
|
|
14
14
|
value = $bindable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComboboxRootBaseProps } from '@ark-ui/svelte/combobox';
|
|
2
|
-
import type { ListItem } from '../../utils/collections';
|
|
2
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
3
3
|
export interface ComboboxProps<T extends ListItem> extends Omit<ComboboxRootBaseProps<T>, 'value' | 'collection'> {
|
|
4
4
|
value?: number | string | null | (number | string)[];
|
|
5
5
|
items: T[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Cell, RowData } from '@tanstack/svelte-table';
|
|
3
3
|
import { FlexRender } from '@tanstack/svelte-table';
|
|
4
4
|
import { cn } from 'tailwind-variants';
|
|
5
|
-
import { PhArrowSquareOut, PhCheck, PhPhone, PhX } from '../../icons';
|
|
5
|
+
import { PhArrowSquareOut, PhCheck, PhPhone, PhX } from '../../index.ts/icons';
|
|
6
6
|
import type { DataTableFeatures } from './features';
|
|
7
7
|
import {
|
|
8
8
|
getBooleanCellValue,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { HeaderGroup, RowData } from '@tanstack/svelte-table';
|
|
3
3
|
import { FlexRender } from '@tanstack/svelte-table';
|
|
4
4
|
import { cn } from 'tailwind-variants';
|
|
5
|
-
import { PhCaretDown, PhCaretUp } from '../../icons';
|
|
5
|
+
import { PhCaretDown, PhCaretUp } from '../../index.ts/icons';
|
|
6
6
|
import type { DataTableInstance } from './data-table-utils';
|
|
7
7
|
import type { DataTableViewState } from './table-view-state.svelte';
|
|
8
8
|
import type { DataTableFeatures } from './features';
|
|
@@ -7,5 +7,6 @@ export { default as Toolbar } from './toolbar/data-table-toolbar.svelte';
|
|
|
7
7
|
export { default as ColumnFilter } from './toolbar/data-table-column-filter.svelte';
|
|
8
8
|
export { default as ColumnVisibility } from './toolbar/data-table-column-visibility.svelte';
|
|
9
9
|
export { default as Search } from './toolbar/data-table-search.svelte';
|
|
10
|
+
export { default as Refresh } from './toolbar/data-table-refresh.svelte';
|
|
10
11
|
export type { CreateDataTableOptions, DataTableInstance } from './create-table.svelte';
|
|
11
12
|
export type { DataTableAlign, DataTableAccessorFnColumn, DataTableAccessorKeyColumn, DataTableColumn, DataTableColumnBase, DataTableColumnOptions, DataTableColumnType, DataTableCellPropsResolver, DataTableCellRenderProps, DataTableGroupColumn, DataTableLeafColumnBase, DataTableLeafColumn } from './types';
|
|
@@ -7,3 +7,4 @@ export { default as Toolbar } from './toolbar/data-table-toolbar.svelte';
|
|
|
7
7
|
export { default as ColumnFilter } from './toolbar/data-table-column-filter.svelte';
|
|
8
8
|
export { default as ColumnVisibility } from './toolbar/data-table-column-visibility.svelte';
|
|
9
9
|
export { default as Search } from './toolbar/data-table-search.svelte';
|
|
10
|
+
export { default as Refresh } from './toolbar/data-table-refresh.svelte';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import type { Column, RowData } from '@tanstack/svelte-table';
|
|
4
4
|
import * as Popover from '../../popover';
|
|
5
|
+
import * as Tooltip from '../../tooltip';
|
|
5
6
|
import * as ScrollArea from '../../scroll-area';
|
|
6
7
|
import Checkbox from '../../checkbox/checkbox.svelte';
|
|
7
8
|
import { cn } from 'tailwind-variants';
|
|
@@ -9,14 +10,20 @@
|
|
|
9
10
|
import type { DataTableFeatures } from '../features';
|
|
10
11
|
import NumberInput from '../../number-input/number-input.svelte';
|
|
11
12
|
import * as Field from '../../field';
|
|
12
|
-
import
|
|
13
|
+
import Badge from '../../badge/badge.svelte';
|
|
14
|
+
import { button } from '../../button/button.variants';
|
|
15
|
+
import { PhX, PhMagnifyingGlass, PhFunnel } from '../../../index.ts/icons';
|
|
13
16
|
|
|
14
17
|
type Props = {
|
|
15
18
|
table: DataTableInstance<T>;
|
|
19
|
+
/** Text label for the trigger. When omitted, a funnel icon is shown instead. */
|
|
16
20
|
triggerLabel?: string;
|
|
17
21
|
};
|
|
18
22
|
|
|
19
|
-
let { table, triggerLabel
|
|
23
|
+
let { table, triggerLabel }: Props = $props();
|
|
24
|
+
|
|
25
|
+
// Popover and tooltip share one trigger element, so both must agree on its id.
|
|
26
|
+
const triggerId = $props.id();
|
|
20
27
|
|
|
21
28
|
let localText: Record<string, string> = $state({});
|
|
22
29
|
let localNumMin: Record<string, number> = $state({});
|
|
@@ -165,15 +172,38 @@
|
|
|
165
172
|
}
|
|
166
173
|
</script>
|
|
167
174
|
|
|
168
|
-
<Popover.Root positioning={{ placement: 'bottom-end' }}>
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
<Popover.Root ids={{ trigger: triggerId }} positioning={{ placement: 'bottom-end' }}>
|
|
176
|
+
<Tooltip.Root ids={{ trigger: triggerId }} disabled={!!triggerLabel}>
|
|
177
|
+
<Tooltip.Trigger>
|
|
178
|
+
{#snippet asChild(tooltipProps)}
|
|
179
|
+
<Popover.Trigger
|
|
180
|
+
{...tooltipProps()}
|
|
181
|
+
aria-label={triggerLabel ? undefined : 'Filters'}
|
|
182
|
+
class={button({
|
|
183
|
+
variant: 'outline',
|
|
184
|
+
size: triggerLabel ? 'default' : 'icon',
|
|
185
|
+
class: 'relative'
|
|
186
|
+
})}
|
|
187
|
+
>
|
|
188
|
+
{#if triggerLabel}
|
|
189
|
+
{triggerLabel}
|
|
190
|
+
{:else}
|
|
191
|
+
<PhFunnel />
|
|
192
|
+
{/if}
|
|
193
|
+
{#if activeCount > 0}
|
|
194
|
+
<Badge
|
|
195
|
+
variant="solid"
|
|
196
|
+
color="primary"
|
|
197
|
+
class="absolute top-0 right-0 size-4 translate-x-1/3 -translate-y-1/3 justify-center px-1 text-xs"
|
|
198
|
+
>
|
|
199
|
+
{activeCount > 99 ? '99+' : activeCount}
|
|
200
|
+
</Badge>
|
|
201
|
+
{/if}
|
|
202
|
+
</Popover.Trigger>
|
|
203
|
+
{/snippet}
|
|
204
|
+
</Tooltip.Trigger>
|
|
205
|
+
<Tooltip.Content>Filters</Tooltip.Content>
|
|
206
|
+
</Tooltip.Root>
|
|
177
207
|
|
|
178
208
|
<Popover.Content class="flex w-70 flex-col gap-3 p-3" showArrow={false}>
|
|
179
209
|
<div class="mr-1 flex items-center justify-between py-2.5">
|
|
@@ -3,6 +3,7 @@ import type { DataTableInstance } from '../data-table-utils';
|
|
|
3
3
|
declare function $$render<T extends RowData>(): {
|
|
4
4
|
props: {
|
|
5
5
|
table: DataTableInstance<T>;
|
|
6
|
+
/** Text label for the trigger. When omitted, a funnel icon is shown instead. */
|
|
6
7
|
triggerLabel?: string;
|
|
7
8
|
};
|
|
8
9
|
exports: {};
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends RowData">
|
|
2
2
|
import type { RowData } from '@tanstack/svelte-table';
|
|
3
3
|
import * as Popover from '../../popover';
|
|
4
|
+
import * as Tooltip from '../../tooltip';
|
|
4
5
|
import * as ScrollArea from '../../scroll-area';
|
|
5
6
|
import Checkbox from '../../checkbox/checkbox.svelte';
|
|
6
7
|
import type { DataTableInstance } from '../data-table-utils';
|
|
8
|
+
import { button } from '../../button/button.variants';
|
|
9
|
+
import { PhColumns } from '../../../index.ts/icons';
|
|
7
10
|
|
|
8
11
|
type Props = {
|
|
9
12
|
table: DataTableInstance<T>;
|
|
13
|
+
/** Text label for the trigger. When omitted, a columns icon is shown instead. */
|
|
10
14
|
triggerLabel?: string;
|
|
11
15
|
};
|
|
12
16
|
|
|
13
|
-
let { table, triggerLabel
|
|
17
|
+
let { table, triggerLabel }: Props = $props();
|
|
18
|
+
|
|
19
|
+
// Popover and tooltip share one trigger element, so both must agree on its id.
|
|
20
|
+
const triggerId = $props.id();
|
|
14
21
|
|
|
15
22
|
const columnVisibility = $derived.by(() => table.atoms.columnVisibility.get());
|
|
16
23
|
const allLeafColumns = $derived.by(() => {
|
|
@@ -32,12 +39,25 @@
|
|
|
32
39
|
}
|
|
33
40
|
</script>
|
|
34
41
|
|
|
35
|
-
<Popover.Root positioning={{ placement: 'bottom-end' }}>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
<Popover.Root ids={{ trigger: triggerId }} positioning={{ placement: 'bottom-end' }}>
|
|
43
|
+
<Tooltip.Root ids={{ trigger: triggerId }} disabled={!!triggerLabel}>
|
|
44
|
+
<Tooltip.Trigger>
|
|
45
|
+
{#snippet asChild(tooltipProps)}
|
|
46
|
+
<Popover.Trigger
|
|
47
|
+
{...tooltipProps()}
|
|
48
|
+
aria-label={triggerLabel ? undefined : 'Columns'}
|
|
49
|
+
class={button({ variant: 'outline', size: triggerLabel ? 'default' : 'icon' })}
|
|
50
|
+
>
|
|
51
|
+
{#if triggerLabel}
|
|
52
|
+
{triggerLabel}
|
|
53
|
+
{:else}
|
|
54
|
+
<PhColumns />
|
|
55
|
+
{/if}
|
|
56
|
+
</Popover.Trigger>
|
|
57
|
+
{/snippet}
|
|
58
|
+
</Tooltip.Trigger>
|
|
59
|
+
<Tooltip.Content>Columns</Tooltip.Content>
|
|
60
|
+
</Tooltip.Root>
|
|
41
61
|
|
|
42
62
|
<Popover.Content class="w-56 p-2" showArrow={false}>
|
|
43
63
|
<div class="border-b border-surface-3 px-2 pb-2">
|
|
@@ -3,6 +3,7 @@ import type { DataTableInstance } from '../data-table-utils';
|
|
|
3
3
|
declare function $$render<T extends RowData>(): {
|
|
4
4
|
props: {
|
|
5
5
|
table: DataTableInstance<T>;
|
|
6
|
+
/** Text label for the trigger. When omitted, a columns icon is shown instead. */
|
|
6
7
|
triggerLabel?: string;
|
|
7
8
|
};
|
|
8
9
|
exports: {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as Tooltip from '../../tooltip';
|
|
3
|
+
import { PhArrowClockwise } from '../../../index.ts/icons';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
/** Called on click. If it returns a promise, the button shows a busy state until it settles. */
|
|
7
|
+
onRefresh: () => void | Promise<unknown>;
|
|
8
|
+
/** Force the busy state, e.g. when a refresh is triggered elsewhere. */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/** Text label for the trigger. When omitted, a refresh icon is shown instead. */
|
|
11
|
+
triggerLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
let { onRefresh, loading = false, triggerLabel }: Props = $props();
|
|
15
|
+
|
|
16
|
+
let pending = $state(false);
|
|
17
|
+
const busy = $derived(loading || pending);
|
|
18
|
+
|
|
19
|
+
async function handleClick() {
|
|
20
|
+
if (busy) return;
|
|
21
|
+
pending = true;
|
|
22
|
+
try {
|
|
23
|
+
await onRefresh();
|
|
24
|
+
} finally {
|
|
25
|
+
pending = false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Tooltip.Root disabled={!!triggerLabel}>
|
|
31
|
+
<!-- aria-disabled instead of disabled so keyboard focus isn't lost mid-refresh -->
|
|
32
|
+
<Tooltip.Trigger
|
|
33
|
+
type="button"
|
|
34
|
+
variant="outline"
|
|
35
|
+
size={triggerLabel ? 'default' : 'icon'}
|
|
36
|
+
class="aria-disabled:cursor-default"
|
|
37
|
+
aria-label={triggerLabel ? undefined : 'Refresh'}
|
|
38
|
+
aria-busy={busy}
|
|
39
|
+
aria-disabled={busy}
|
|
40
|
+
onclick={handleClick}
|
|
41
|
+
>
|
|
42
|
+
<PhArrowClockwise class={busy ? 'animate-spin motion-reduce:animate-none' : undefined} />
|
|
43
|
+
{triggerLabel}
|
|
44
|
+
</Tooltip.Trigger>
|
|
45
|
+
<Tooltip.Content>Refresh</Tooltip.Content>
|
|
46
|
+
</Tooltip.Root>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/** Called on click. If it returns a promise, the button shows a busy state until it settles. */
|
|
3
|
+
onRefresh: () => void | Promise<unknown>;
|
|
4
|
+
/** Force the busy state, e.g. when a refresh is triggered elsewhere. */
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
/** Text label for the trigger. When omitted, a refresh icon is shown instead. */
|
|
7
|
+
triggerLabel?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const DataTableRefresh: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type DataTableRefresh = ReturnType<typeof DataTableRefresh>;
|
|
11
|
+
export default DataTableRefresh;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import type { RowData } from '@tanstack/svelte-table';
|
|
4
4
|
import { cn, type ClassValue } from 'tailwind-variants';
|
|
5
|
-
import { PhMagnifyingGlass, PhX } from '../../../icons';
|
|
5
|
+
import { PhMagnifyingGlass, PhX } from '../../../index.ts/icons';
|
|
6
6
|
import * as Field from '../../field';
|
|
7
7
|
import type { DataTableInstance } from '../data-table-utils';
|
|
8
8
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as Root } from './data-table-virtualized.svelte';
|
|
2
|
-
export { ColumnFilter, ColumnVisibility, FlexRender, Search, Title, Toolbar, createDataTableColumnHelper, createTable, renderComponent, renderSnippet } from '../index';
|
|
2
|
+
export { ColumnFilter, ColumnVisibility, FlexRender, Refresh, Search, Title, Toolbar, createDataTableColumnHelper, createTable, renderComponent, renderSnippet } from '../index';
|
|
3
3
|
export type { CreateDataTableOptions, DataTableAccessorFnColumn, DataTableAccessorKeyColumn, DataTableAlign, DataTableCellPropsResolver, DataTableCellRenderProps, DataTableColumn, DataTableColumnBase, DataTableColumnOptions, DataTableColumnType, DataTableGroupColumn, DataTableInstance, DataTableLeafColumn, DataTableLeafColumnBase } from '../index';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Root } from './data-table-virtualized.svelte';
|
|
2
|
-
export { ColumnFilter, ColumnVisibility, FlexRender, Search, Title, Toolbar, createDataTableColumnHelper, createTable, renderComponent, renderSnippet } from '../index';
|
|
2
|
+
export { ColumnFilter, ColumnVisibility, FlexRender, Refresh, Search, Title, Toolbar, createDataTableColumnHelper, createTable, renderComponent, renderSnippet } from '../index';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { Field } from '@ark-ui/svelte/field';
|
|
5
5
|
import { useLocaleContext } from '@ark-ui/svelte/locale';
|
|
6
6
|
import { CalendarDateTime, getLocalTimeZone } from '@internationalized/date';
|
|
7
|
-
import { toDateValue, fromDateValue, dateValueShape, dateValueToString } from '../../utils/date';
|
|
8
|
-
import type { DateValueShape } from '../../utils/date';
|
|
9
|
-
import { PhCalendarBlank } from '../../icons';
|
|
7
|
+
import { toDateValue, fromDateValue, dateValueShape, dateValueToString } from '../../index.ts/utils/date';
|
|
8
|
+
import type { DateValueShape } from '../../index.ts/utils/date';
|
|
9
|
+
import { PhCalendarBlank } from '../../index.ts/icons';
|
|
10
10
|
import type { DateFieldProps } from './types';
|
|
11
11
|
import DatePickerCalendar from '../date-picker/date-picker-calendar.svelte';
|
|
12
12
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { DateInput } from '@ark-ui/svelte/date-input';
|
|
3
3
|
import { Field, useFieldContext } from '@ark-ui/svelte/field';
|
|
4
|
-
import { toDateValue, fromDateValue, dateValueShape, dateValueToString } from '../../utils/date';
|
|
4
|
+
import { toDateValue, fromDateValue, dateValueShape, dateValueToString } from '../../index.ts/utils/date';
|
|
5
5
|
import { getLocalTimeZone } from '@internationalized/date';
|
|
6
|
-
import type { DateValue, DateValueShape } from '../../utils/date';
|
|
6
|
+
import type { DateValue, DateValueShape } from '../../index.ts/utils/date';
|
|
7
7
|
import type { DateInputProps } from './types';
|
|
8
8
|
|
|
9
9
|
let {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DatePicker } from '@ark-ui/svelte/date-picker';
|
|
3
3
|
import { Portal } from '@ark-ui/svelte/portal';
|
|
4
4
|
import { CalendarDateTime } from '@internationalized/date';
|
|
5
|
-
import { PhArrowLeft, PhArrowRight } from '../../icons';
|
|
5
|
+
import { PhArrowLeft, PhArrowRight } from '../../index.ts/icons';
|
|
6
6
|
import type { DateValue } from '@ark-ui/svelte/date-picker';
|
|
7
7
|
import Select from '../select/select.svelte';
|
|
8
8
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { Field } from '@ark-ui/svelte/field';
|
|
4
4
|
import { useLocaleContext } from '@ark-ui/svelte/locale';
|
|
5
5
|
import { CalendarDateTime, getLocalTimeZone } from '@internationalized/date';
|
|
6
|
-
import { toDateValue, fromDateValue, dateValueShape } from '../../utils/date';
|
|
7
|
-
import type { DateValueShape } from '../../utils/date';
|
|
8
|
-
import { PhCalendarBlank, PhX } from '../../icons';
|
|
6
|
+
import { toDateValue, fromDateValue, dateValueShape } from '../../index.ts/utils/date';
|
|
7
|
+
import type { DateValueShape } from '../../index.ts/utils/date';
|
|
8
|
+
import { PhCalendarBlank, PhX } from '../../index.ts/icons';
|
|
9
9
|
import type { DatePickerProps } from './types';
|
|
10
10
|
import DatePickerCalendar from './date-picker-calendar.svelte';
|
|
11
11
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { Field } from '@ark-ui/svelte/field';
|
|
5
5
|
import { useLocaleContext } from '@ark-ui/svelte/locale';
|
|
6
6
|
import { getLocalTimeZone } from '@internationalized/date';
|
|
7
|
-
import { toDateValue, fromDateValue, dateValueShape, dateValueToString } from '../../utils/date';
|
|
8
|
-
import type { DateValueShape } from '../../utils/date';
|
|
9
|
-
import { PhCalendarBlank } from '../../icons';
|
|
7
|
+
import { toDateValue, fromDateValue, dateValueShape, dateValueToString } from '../../index.ts/utils/date';
|
|
8
|
+
import type { DateValueShape } from '../../index.ts/utils/date';
|
|
9
|
+
import { PhCalendarBlank } from '../../index.ts/icons';
|
|
10
10
|
import type { DateRangeFieldProps } from './types';
|
|
11
11
|
import DatePickerCalendar from '../date-picker/date-picker-calendar.svelte';
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog } from '@ark-ui/svelte/dialog';
|
|
3
3
|
import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
|
|
4
|
-
import { PhX } from '../../icons';
|
|
4
|
+
import { PhX } from '../../index.ts/icons';
|
|
5
5
|
import {
|
|
6
6
|
button,
|
|
7
7
|
type ButtonVariant,
|
|
8
8
|
type ButtonSize
|
|
9
|
-
} from '
|
|
9
|
+
} from '../../index.ts/components/button/button.variants';
|
|
10
10
|
import type { ClassValue } from 'tailwind-variants';
|
|
11
11
|
|
|
12
12
|
interface Props extends DialogCloseTriggerBaseProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DialogCloseTriggerBaseProps } from '@ark-ui/svelte/dialog';
|
|
2
|
-
import { type ButtonVariant, type ButtonSize } from '
|
|
2
|
+
import { type ButtonVariant, type ButtonSize } from '../../index.ts/components/button/button.variants';
|
|
3
3
|
import type { ClassValue } from 'tailwind-variants';
|
|
4
4
|
interface Props extends DialogCloseTriggerBaseProps {
|
|
5
5
|
variant?: ButtonVariant;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Drawer } from '@ark-ui/svelte/drawer';
|
|
3
3
|
import type { DrawerCloseTriggerBaseProps } from '@ark-ui/svelte/drawer';
|
|
4
4
|
import type { ClassValue } from 'svelte/elements';
|
|
5
|
-
import PhX from '../../icons/PhX.svelte';
|
|
5
|
+
import PhX from '../../index.ts/icons/PhX.svelte';
|
|
6
6
|
|
|
7
7
|
interface Props extends DrawerCloseTriggerBaseProps {
|
|
8
8
|
class?: ClassValue;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FileUpload } from '@ark-ui/svelte/file-upload';
|
|
3
3
|
import { getAcceptAttribute } from './utils';
|
|
4
4
|
import type { FileUploadDropzoneProps } from './types';
|
|
5
|
-
import { PhUploadSimple } from '../../icons';
|
|
5
|
+
import { PhUploadSimple } from '../../index.ts/icons';
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
fileType,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { FileUpload, type FileUploadFileError } from '@ark-ui/svelte/file-upload';
|
|
3
|
-
import { PhX } from '../../icons';
|
|
3
|
+
import { PhX } from '../../index.ts/icons';
|
|
4
4
|
import type { FileUploadProps } from './types';
|
|
5
5
|
import { getAcceptAttribute } from './utils';
|
|
6
6
|
import { getFileIcon } from './icons';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PhFile, PhFileArchive, PhFileText, PhHeadphones, PhImage, PhMicrosoftExcelLogo, PhVideoCamera } from '../../icons';
|
|
1
|
+
import { PhFile, PhFileArchive, PhFileText, PhHeadphones, PhImage, PhMicrosoftExcelLogo, PhVideoCamera } from '../../index.ts/icons';
|
|
2
2
|
export const getFileIcon = (file) => {
|
|
3
3
|
const fileType = file.type;
|
|
4
4
|
const fileName = file.name;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as Dialog from '../dialog';
|
|
3
3
|
import ImageCropper from '../image-cropper/image-cropper.svelte';
|
|
4
|
-
import { Button } from '
|
|
5
|
-
import { cropImage, processImage } from '../../utils/image-processing';
|
|
4
|
+
import { Button } from '../../index.js';
|
|
5
|
+
import { cropImage, processImage } from '../../index.ts/utils/image-processing';
|
|
6
6
|
import type { ImageCropperCropData } from '../image-cropper/types';
|
|
7
7
|
import type { ImageCropDialogProps } from './types';
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ImageCropper, useImageCropper } from '@ark-ui/svelte/image-cropper';
|
|
3
3
|
import type { ImageCropperProps } from './types';
|
|
4
|
-
import { Button } from '
|
|
5
|
-
import { cropImage } from '../../utils/image-processing';
|
|
6
|
-
import type { ProcessImageOptions } from '../../utils/image-processing';
|
|
7
|
-
import { PhArrowClockwise, PhArrowCounterClockwise } from '../../icons';
|
|
4
|
+
import { Button } from '../../index.js';
|
|
5
|
+
import { cropImage } from '../../index.ts/utils/image-processing';
|
|
6
|
+
import type { ProcessImageOptions } from '../../index.ts/utils/image-processing';
|
|
7
|
+
import { PhArrowClockwise, PhArrowCounterClockwise } from '../../index.ts/icons';
|
|
8
8
|
|
|
9
9
|
let {
|
|
10
10
|
src = $bindable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UseImageCropperProps, UseImageCropperReturn } from '@ark-ui/svelte/image-cropper';
|
|
2
|
-
import type { ProcessImageOptions } from '../../utils/image-processing';
|
|
2
|
+
import type { ProcessImageOptions } from '../../index.ts/utils/image-processing';
|
|
3
3
|
export type ImageCropperCropData = ReturnType<ReturnType<UseImageCropperReturn>['getCropData']>;
|
|
4
4
|
export interface ImageCropperProps extends UseImageCropperProps {
|
|
5
5
|
src: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from 'tailwind-variants';
|
|
3
3
|
import * as Menu from '../menu';
|
|
4
4
|
import ImageCropDialog from '../image-crop-dialog/image-crop-dialog.svelte';
|
|
5
|
-
import { fileToDataUrl } from '../../utils/image-processing';
|
|
6
|
-
import { PhUploadSimple, PhImage, PhX } from '../../icons';
|
|
5
|
+
import { fileToDataUrl } from '../../index.ts/utils/image-processing';
|
|
6
|
+
import { PhUploadSimple, PhImage, PhX } from '../../index.ts/icons';
|
|
7
7
|
import type { ImageUploadProps } from './types';
|
|
8
8
|
|
|
9
9
|
let {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
-
import type { ProcessImageOptions } from '../../utils/image-processing';
|
|
2
|
+
import type { ProcessImageOptions } from '../../index.ts/utils/image-processing';
|
|
3
3
|
export type ImageUploadShape = 'circle' | 'square';
|
|
4
4
|
export interface ImageUploadProps {
|
|
5
5
|
/** Current image src (data URL, blob URL, or remote URL). Bindable. */
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
} from '@ark-ui/svelte/json-tree-view';
|
|
7
7
|
import type { ClassValue } from 'svelte/elements';
|
|
8
8
|
import { cn } from 'tailwind-variants';
|
|
9
|
-
import { PhCaretRight } from '../../icons';
|
|
9
|
+
import { PhCaretRight } from '../../index.ts/icons';
|
|
10
10
|
|
|
11
11
|
interface Props extends JsonTreeViewRootBaseProps {
|
|
12
12
|
class?: ClassValue;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Listbox } from '@ark-ui/svelte/listbox';
|
|
3
3
|
import type { ListboxContentBaseProps } from '@ark-ui/svelte/listbox';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
|
-
import type { ListItem } from '../../utils/collections';
|
|
5
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
6
6
|
import { cn } from 'tailwind-variants';
|
|
7
7
|
import { getListboxContext } from './listbox-context';
|
|
8
8
|
import type { ClassValue } from 'svelte/elements';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ListboxContentBaseProps } from '@ark-ui/svelte/listbox';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { ListItem } from '../../utils/collections';
|
|
3
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
4
4
|
import type { ClassValue } from 'svelte/elements';
|
|
5
5
|
type Props = ListboxContentBaseProps & {
|
|
6
6
|
class?: ClassValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ListCollection } from '@ark-ui/svelte/collection';
|
|
2
|
-
import type { ListItem } from '../../utils/collections';
|
|
2
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
3
3
|
export declare const getListboxContext: () => {
|
|
4
4
|
readonly collection: ListCollection<ListItem>;
|
|
5
5
|
filter: (text: string) => void;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { ListboxItemIndicatorBaseProps } from '@ark-ui/svelte/listbox';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import { cn } from 'tailwind-variants';
|
|
6
|
-
import { PhCheck } from '../../icons';
|
|
6
|
+
import { PhCheck } from '../../index.ts/icons';
|
|
7
7
|
import type { ClassValue } from 'svelte/elements';
|
|
8
8
|
|
|
9
9
|
type Props = ListboxItemIndicatorBaseProps & {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { useFilter } from '@ark-ui/svelte/locale';
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
6
|
import type { ListCollection } from '@ark-ui/svelte/collection';
|
|
7
|
-
import type { ListItem } from '../../utils/collections';
|
|
7
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
8
8
|
import { cn } from 'tailwind-variants';
|
|
9
9
|
import { setListboxContext } from './listbox-context';
|
|
10
10
|
import type { ClassValue } from 'svelte/elements';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Listbox } from '@ark-ui/svelte/listbox';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { ListItem } from '../../utils/collections';
|
|
3
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
4
4
|
import type { ClassValue } from 'svelte/elements';
|
|
5
5
|
declare function $$render<T extends string | number = string>(): {
|
|
6
6
|
props: Omit<Listbox.RootBaseProps<ListItem<T>>, "value" | "onValueChange" | "collection"> & {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import { cn } from 'tailwind-variants';
|
|
6
6
|
import MenuItemIndicator from './menu-item-indicator.svelte';
|
|
7
|
-
import { PhCheck } from '../../icons';
|
|
7
|
+
import { PhCheck } from '../../index.ts/icons';
|
|
8
8
|
|
|
9
9
|
type IndicatorSnippet = { indicator?: Snippet };
|
|
10
10
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { MenuIndicatorBaseProps } from '@ark-ui/svelte/menu';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import { cn } from 'tailwind-variants';
|
|
6
|
-
import { PhCaretDown } from '../../icons';
|
|
6
|
+
import { PhCaretDown } from '../../index.ts/icons';
|
|
7
7
|
|
|
8
8
|
type Props = MenuIndicatorBaseProps & { class?: string; children?: Snippet };
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Field } from '@ark-ui/svelte/field';
|
|
3
3
|
import { NumberInput } from '@ark-ui/svelte/number-input';
|
|
4
4
|
import type { NumberInputProps } from './types';
|
|
5
|
-
import { PhCaretDown, PhCaretUp } from '../../icons';
|
|
5
|
+
import { PhCaretDown, PhCaretUp } from '../../index.ts/icons';
|
|
6
6
|
import { useLocaleContext } from '@ark-ui/svelte/locale';
|
|
7
7
|
|
|
8
8
|
let {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Field } from '@ark-ui/svelte/field';
|
|
3
3
|
import { PasswordInput } from '@ark-ui/svelte/password-input';
|
|
4
4
|
import type { PasswordInputProps } from './types';
|
|
5
|
-
import { PhEye, PhEyeSlash } from '../../icons';
|
|
5
|
+
import { PhEye, PhEyeSlash } from '../../index.ts/icons';
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
value = $bindable(),
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { PhoneInputProps } from './types';
|
|
8
8
|
import { createListCollection } from '../../utils/collections';
|
|
9
9
|
import { cn } from 'tailwind-variants';
|
|
10
|
-
import { PhCaretDown, PhCheck } from '../../icons';
|
|
10
|
+
import { PhCaretDown, PhCheck } from '../../index.ts/icons';
|
|
11
11
|
import 'svelte-tel-input/styles/flags.css';
|
|
12
12
|
|
|
13
13
|
interface CountryItem {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Popover } from '@ark-ui/svelte/popover';
|
|
3
3
|
import type { PopoverCloseTriggerBaseProps } from '@ark-ui/svelte/popover';
|
|
4
|
-
import { PhX } from '../../icons';
|
|
4
|
+
import { PhX } from '../../index.ts/icons';
|
|
5
5
|
import type { ClassValue } from 'svelte/elements';
|
|
6
6
|
|
|
7
7
|
interface Props extends PopoverCloseTriggerBaseProps {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Popover } from '@ark-ui/svelte/popover';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PopoverTriggerProps } from '@ark-ui/svelte/popover';
|
|
4
4
|
import type { ClassValue } from 'svelte/elements';
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
|
-
interface Props extends
|
|
7
|
+
interface Props extends Omit<PopoverTriggerProps, 'class' | 'children'> {
|
|
8
8
|
class?: ClassValue;
|
|
9
9
|
children: Snippet;
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopoverTriggerProps } from '@ark-ui/svelte/popover';
|
|
2
2
|
import type { ClassValue } from 'svelte/elements';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
-
interface Props extends
|
|
4
|
+
interface Props extends Omit<PopoverTriggerProps, 'class' | 'children'> {
|
|
5
5
|
class?: ClassValue;
|
|
6
6
|
children: Snippet;
|
|
7
7
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { Portal } from '@ark-ui/svelte/portal';
|
|
4
4
|
import { Select } from '@ark-ui/svelte/select';
|
|
5
5
|
import type { SelectProps } from './types';
|
|
6
|
-
import { createListCollection, type ListItem } from '../../utils/collections';
|
|
6
|
+
import { createListCollection, type ListItem } from '../../index.ts/utils/collections';
|
|
7
7
|
import { cn } from 'tailwind-variants';
|
|
8
|
-
import { PhCaretDown, PhCheck } from '../../icons';
|
|
8
|
+
import { PhCaretDown, PhCheck } from '../../index.ts/icons';
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
value = $bindable(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Select } from '@ark-ui/svelte/select';
|
|
2
2
|
import type { SelectProps } from './types';
|
|
3
|
-
import { type ListItem } from '../../utils/collections';
|
|
3
|
+
import { type ListItem } from '../../index.ts/utils/collections';
|
|
4
4
|
declare function $$render<T extends ListItem>(): {
|
|
5
5
|
props: SelectProps<T>;
|
|
6
6
|
exports: {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SelectRootBaseProps } from '@ark-ui/svelte/select';
|
|
2
|
-
import type { ListItem } from '../../utils/collections';
|
|
2
|
+
import type { ListItem } from '../../index.ts/utils/collections';
|
|
3
3
|
export interface SelectProps<T extends ListItem> extends Omit<SelectRootBaseProps<T>, 'value' | 'collection'> {
|
|
4
4
|
value?: T['value'] | null;
|
|
5
5
|
items: T[];
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { createToaster } from '@ark-ui/svelte/toast';
|
|
2
|
-
const toaster = createToaster({
|
|
2
|
+
const toaster = createToaster({
|
|
3
|
+
placement: 'bottom-end',
|
|
4
|
+
pauseOnPageIdle: true,
|
|
5
|
+
duration: 5000
|
|
6
|
+
});
|
|
7
|
+
const typeDurations = { success: 4000, error: 10000 };
|
|
3
8
|
function shorthand(type) {
|
|
9
|
+
const duration = typeDurations[type];
|
|
10
|
+
// Only set when defined: an explicit `duration: undefined` would override the global default.
|
|
11
|
+
const defaults = duration === undefined ? {} : { duration };
|
|
4
12
|
return (title, options) => typeof title === 'string'
|
|
5
|
-
? toaster.create({ ...options, title, type })
|
|
6
|
-
: toaster.create({ ...title, type });
|
|
13
|
+
? toaster.create({ ...defaults, ...options, title, type })
|
|
14
|
+
: toaster.create({ ...defaults, ...title, type });
|
|
7
15
|
}
|
|
8
16
|
export const toast = Object.assign(toaster, {
|
|
9
17
|
info: shorthand('info'),
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import { cn } from 'tailwind-variants';
|
|
6
6
|
import type { ClassValue } from 'tailwind-variants';
|
|
7
7
|
import { toast } from './toast.js';
|
|
8
|
-
import PhX from '../../icons/PhX.svelte';
|
|
9
|
-
import PhCheckCircle from '../../icons/PhCheckCircle.svelte';
|
|
10
|
-
import PhXCircle from '../../icons/PhXCircle.svelte';
|
|
11
|
-
import PhWarning from '../../icons/PhWarning.svelte';
|
|
12
|
-
import PhInfo from '../../icons/PhInfo.svelte';
|
|
13
|
-
import PhCircleNotch from '../../icons/PhCircleNotch.svelte';
|
|
8
|
+
import PhX from '../../index.ts/icons/PhX.svelte';
|
|
9
|
+
import PhCheckCircle from '../../index.ts/icons/PhCheckCircle.svelte';
|
|
10
|
+
import PhXCircle from '../../index.ts/icons/PhXCircle.svelte';
|
|
11
|
+
import PhWarning from '../../index.ts/icons/PhWarning.svelte';
|
|
12
|
+
import PhInfo from '../../index.ts/icons/PhInfo.svelte';
|
|
13
|
+
import PhCircleNotch from '../../index.ts/icons/PhCircleNotch.svelte';
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
class?: ClassValue;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
PhMagnifyingGlass,
|
|
12
12
|
PhMinus,
|
|
13
13
|
PhX
|
|
14
|
-
} from '../../icons';
|
|
15
|
-
import { Button, Field, ScrollArea } from '
|
|
14
|
+
} from '../../index.ts/icons';
|
|
15
|
+
import { Button, Field, ScrollArea } from '../../index.js';
|
|
16
16
|
import { SvelteSet } from 'svelte/reactivity';
|
|
17
17
|
|
|
18
18
|
let {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UseTreeViewProps } from '@ark-ui/svelte/tree-view';
|
|
2
|
-
import type { TreeItem } from '../../utils/collections';
|
|
2
|
+
import type { TreeItem } from '../../index.ts/utils/collections';
|
|
3
3
|
export interface TreeViewProps<T extends TreeItem> extends Omit<UseTreeViewProps<T>, 'collection'> {
|
|
4
4
|
items?: T[];
|
|
5
5
|
label?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
|
|
19
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
|
|
19
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -9,11 +9,13 @@ export { default as PhCaretDown } from './PhCaretDown.svelte';
|
|
|
9
9
|
export { default as PhCaretRight } from './PhCaretRight.svelte';
|
|
10
10
|
export { default as PhCaretUp } from './PhCaretUp.svelte';
|
|
11
11
|
export { default as PhCheck } from './PhCheck.svelte';
|
|
12
|
+
export { default as PhColumns } from './PhColumns.svelte';
|
|
12
13
|
export { default as PhEye } from './PhEye.svelte';
|
|
13
14
|
export { default as PhEyeSlash } from './PhEyeSlash.svelte';
|
|
14
15
|
export { default as PhFile } from './PhFile.svelte';
|
|
15
16
|
export { default as PhFileArchive } from './PhFileArchive.svelte';
|
|
16
17
|
export { default as PhFileText } from './PhFileText.svelte';
|
|
18
|
+
export { default as PhFunnel } from './PhFunnel.svelte';
|
|
17
19
|
export { default as PhHeadphones } from './PhHeadphones.svelte';
|
|
18
20
|
export { default as PhImage } from './PhImage.svelte';
|
|
19
21
|
export { default as PhListMagnifyingGlass } from './PhListMagnifyingGlass.svelte';
|
package/dist/icons/index.js
CHANGED
|
@@ -9,11 +9,13 @@ export { default as PhCaretDown } from './PhCaretDown.svelte';
|
|
|
9
9
|
export { default as PhCaretRight } from './PhCaretRight.svelte';
|
|
10
10
|
export { default as PhCaretUp } from './PhCaretUp.svelte';
|
|
11
11
|
export { default as PhCheck } from './PhCheck.svelte';
|
|
12
|
+
export { default as PhColumns } from './PhColumns.svelte';
|
|
12
13
|
export { default as PhEye } from './PhEye.svelte';
|
|
13
14
|
export { default as PhEyeSlash } from './PhEyeSlash.svelte';
|
|
14
15
|
export { default as PhFile } from './PhFile.svelte';
|
|
15
16
|
export { default as PhFileArchive } from './PhFileArchive.svelte';
|
|
16
17
|
export { default as PhFileText } from './PhFileText.svelte';
|
|
18
|
+
export { default as PhFunnel } from './PhFunnel.svelte';
|
|
17
19
|
export { default as PhHeadphones } from './PhHeadphones.svelte';
|
|
18
20
|
export { default as PhImage } from './PhImage.svelte';
|
|
19
21
|
export { default as PhListMagnifyingGlass } from './PhListMagnifyingGlass.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compote-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,6 +22,15 @@
|
|
|
22
22
|
"patch": "npm version patch && npm publish",
|
|
23
23
|
"minor": "npm version minor && npm publish"
|
|
24
24
|
},
|
|
25
|
+
"imports": {
|
|
26
|
+
"#lib": "./src/lib/index.ts",
|
|
27
|
+
"#lib/*": [
|
|
28
|
+
"./src/lib/*",
|
|
29
|
+
"./src/lib/*.ts",
|
|
30
|
+
"./src/lib/*.js",
|
|
31
|
+
"./src/lib/*/index.ts"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
25
34
|
"files": [
|
|
26
35
|
"dist",
|
|
27
36
|
"!dist/**/*.test.*",
|
|
@@ -63,10 +72,10 @@
|
|
|
63
72
|
"@eslint/js": "^10.0.1",
|
|
64
73
|
"@faker-js/faker": "^10.6.0",
|
|
65
74
|
"@iconify-json/ph": "^1.2.2",
|
|
66
|
-
"@sveltejs/adapter-auto": "^
|
|
67
|
-
"@sveltejs/adapter-cloudflare": "^
|
|
68
|
-
"@sveltejs/kit": "^
|
|
69
|
-
"@sveltejs/package": "^
|
|
75
|
+
"@sveltejs/adapter-auto": "^8.0.0",
|
|
76
|
+
"@sveltejs/adapter-cloudflare": "^8.0.0",
|
|
77
|
+
"@sveltejs/kit": "^3.0.1",
|
|
78
|
+
"@sveltejs/package": "^3.0.0",
|
|
70
79
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
71
80
|
"@tailwindcss/vite": "^4.3.3",
|
|
72
81
|
"@tanstack/intent": "^0.4.0",
|
|
@@ -80,7 +89,7 @@
|
|
|
80
89
|
"prettier-plugin-svelte": "^4.1.1",
|
|
81
90
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
82
91
|
"publint": "^0.3.24",
|
|
83
|
-
"svelte": "^5.57.
|
|
92
|
+
"svelte": "^5.57.1",
|
|
84
93
|
"svelte-check": "^4.7.6",
|
|
85
94
|
"tailwindcss": "^4.3.3",
|
|
86
95
|
"tw-animate-css": "^1.4.0",
|
|
@@ -8,7 +8,7 @@ description: >
|
|
|
8
8
|
metadata:
|
|
9
9
|
type: composition
|
|
10
10
|
library: compote-ui
|
|
11
|
-
library_version: '0.
|
|
11
|
+
library_version: '0.75.5'
|
|
12
12
|
requires:
|
|
13
13
|
- component-usage
|
|
14
14
|
- theming
|
|
@@ -151,6 +151,42 @@ bun add @tanstack/svelte-virtual
|
|
|
151
151
|
</div>
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
### Label toolbar triggers
|
|
155
|
+
|
|
156
|
+
`ColumnFilter` and `ColumnVisibility` render icon-only outline buttons by default (funnel and
|
|
157
|
+
columns icons, with `aria-label` and a hover tooltip). Pass `triggerLabel` to show text instead. `ColumnFilter`
|
|
158
|
+
shows the active filter count as a badge in the corner either way.
|
|
159
|
+
|
|
160
|
+
```svelte
|
|
161
|
+
<DataTable.ColumnFilter {table} triggerLabel="Filters" />
|
|
162
|
+
<DataTable.ColumnVisibility {table} triggerLabel="Columns" />
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Add a refresh button
|
|
166
|
+
|
|
167
|
+
`DataTable.Refresh` is data-source agnostic: it calls `onRefresh` and, if that returns a promise,
|
|
168
|
+
spins its icon and sets `aria-busy` until the promise settles. Clicks while busy are ignored. Pass
|
|
169
|
+
`loading` to force the busy state when a refresh starts elsewhere (polling, another control).
|
|
170
|
+
|
|
171
|
+
```svelte
|
|
172
|
+
<script lang="ts">
|
|
173
|
+
import { getInvoices } from './invoices.remote';
|
|
174
|
+
|
|
175
|
+
const invoices = getInvoices();
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<DataTable.Toolbar>
|
|
179
|
+
{#snippet right()}
|
|
180
|
+
<DataTable.Refresh onRefresh={() => invoices.refresh()} />
|
|
181
|
+
<DataTable.ColumnFilter {table} />
|
|
182
|
+
<DataTable.ColumnVisibility {table} />
|
|
183
|
+
{/snippet}
|
|
184
|
+
</DataTable.Toolbar>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Props: `onRefresh: () => void | Promise<unknown>`, `loading?: boolean`, `triggerLabel?: string`
|
|
188
|
+
(icon-only with `aria-label="Refresh"` and a tooltip when omitted). Errors thrown by `onRefresh` are not caught.
|
|
189
|
+
|
|
154
190
|
## Common Mistakes
|
|
155
191
|
|
|
156
192
|
### CRITICAL Missing id for accessorFn column
|