@human-kit/svelte-components 1.0.0-alpha.6 → 1.0.0-alpha.8
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/button/README.md +48 -0
- package/dist/button/TODO.md +13 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +4 -0
- package/dist/button/index.parts.d.ts +1 -0
- package/dist/button/index.parts.js +1 -0
- package/dist/button/root/README.md +43 -0
- package/dist/button/root/button-root.svelte +362 -0
- package/dist/button/root/button-root.svelte.d.ts +21 -0
- package/dist/button/root/button-test.svelte +76 -0
- package/dist/button/root/button-test.svelte.d.ts +11 -0
- package/dist/calendar/trigger-next/calendar-trigger-next.svelte +9 -4
- package/dist/calendar/trigger-next/calendar-trigger-next.svelte.d.ts +2 -1
- package/dist/calendar/trigger-previous/calendar-trigger-previous.svelte +9 -4
- package/dist/calendar/trigger-previous/calendar-trigger-previous.svelte.d.ts +2 -1
- package/dist/combobox/button/combobox-button.svelte +5 -4
- package/dist/combobox/list/combobox-listbox.svelte.d.ts +1 -1
- package/dist/combobox/popover/combobox-popover.svelte +34 -4
- package/dist/combobox/root/combobox.svelte +8 -0
- package/dist/combobox/tag-remove/combobox-tag-remove.svelte +3 -2
- package/dist/datepicker/trigger/date-picker-trigger.svelte +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/input/README.md +36 -0
- package/dist/input/TODO.md +12 -0
- package/dist/input/input-test.svelte +38 -0
- package/dist/input/input-test.svelte.d.ts +11 -0
- package/dist/input/input.svelte +142 -7
- package/dist/input/input.svelte.d.ts +7 -2
- package/dist/listbox/item/README.md +2 -1
- package/dist/listbox/item/listbox-item.svelte +129 -1
- package/dist/listbox/item/listbox-item.svelte.d.ts +2 -0
- package/dist/listbox/root/listbox-test.svelte +14 -2
- package/dist/listbox/root/listbox-test.svelte.d.ts +1 -0
- package/dist/listbox/root/listbox.svelte.d.ts +2 -2
- package/dist/popover/trigger/popover-trigger-button.svelte +4 -3
- package/dist/table/root/table-root.svelte.d.ts +1 -1
- package/dist/timepicker/trigger/time-picker-trigger.svelte +5 -5
- package/package.json +6 -1
|
@@ -28,6 +28,8 @@ type ListBoxItemProps = Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'children'>
|
|
|
28
28
|
scrollOnFocus?: boolean;
|
|
29
29
|
/** Additional disabled state from parent. */
|
|
30
30
|
isParentDisabled?: boolean;
|
|
31
|
+
/** Override the visual pressed state. When provided, this value is used instead of internal press tracking. */
|
|
32
|
+
pressed?: boolean;
|
|
31
33
|
};
|
|
32
34
|
declare const ListboxItem: import("svelte").Component<ListBoxItemProps, {}, "">;
|
|
33
35
|
type ListboxItem = ReturnType<typeof ListboxItem>;
|
|
@@ -5,9 +5,17 @@
|
|
|
5
5
|
selectionMode?: 'single' | 'multiple';
|
|
6
6
|
selectionBehavior?: 'toggle' | 'replace';
|
|
7
7
|
disabledIds?: Iterable<string | number>;
|
|
8
|
+
pressedIds?: Iterable<string | number>;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
let {
|
|
11
|
+
let {
|
|
12
|
+
selectionMode = 'single',
|
|
13
|
+
selectionBehavior = 'toggle',
|
|
14
|
+
disabledIds,
|
|
15
|
+
pressedIds
|
|
16
|
+
}: Props = $props();
|
|
17
|
+
|
|
18
|
+
const pressedIdSet = $derived(new Set(pressedIds ?? []));
|
|
11
19
|
|
|
12
20
|
const fruits = [
|
|
13
21
|
{ id: 'apple', name: 'Apple' },
|
|
@@ -20,7 +28,11 @@
|
|
|
20
28
|
|
|
21
29
|
<ListBox.Root {selectionMode} {selectionBehavior} {disabledIds} aria-label="Fruits list">
|
|
22
30
|
{#each fruits as fruit (fruit.id)}
|
|
23
|
-
<ListBox.Item
|
|
31
|
+
<ListBox.Item
|
|
32
|
+
id={fruit.id}
|
|
33
|
+
textValue={fruit.name}
|
|
34
|
+
pressed={pressedIdSet.has(fruit.id) ? true : undefined}
|
|
35
|
+
>
|
|
24
36
|
{fruit.name}
|
|
25
37
|
</ListBox.Item>
|
|
26
38
|
{/each}
|
|
@@ -2,6 +2,7 @@ type Props = {
|
|
|
2
2
|
selectionMode?: 'single' | 'multiple';
|
|
3
3
|
selectionBehavior?: 'toggle' | 'replace';
|
|
4
4
|
disabledIds?: Iterable<string | number>;
|
|
5
|
+
pressedIds?: Iterable<string | number>;
|
|
5
6
|
};
|
|
6
7
|
declare const ListboxTest: import("svelte").Component<Props, {}, "">;
|
|
7
8
|
type ListboxTest = ReturnType<typeof ListboxTest>;
|
|
@@ -31,7 +31,7 @@ declare function $$render<T extends object = object>(): {
|
|
|
31
31
|
element?: HTMLElement;
|
|
32
32
|
};
|
|
33
33
|
exports: {};
|
|
34
|
-
bindings: "value" | "
|
|
34
|
+
bindings: "value" | "element" | "context";
|
|
35
35
|
slots: {};
|
|
36
36
|
events: {};
|
|
37
37
|
};
|
|
@@ -39,7 +39,7 @@ declare class __sveltets_Render<T extends object = object> {
|
|
|
39
39
|
props(): ReturnType<typeof $$render<T>>['props'];
|
|
40
40
|
events(): ReturnType<typeof $$render<T>>['events'];
|
|
41
41
|
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
42
|
-
bindings(): "value" | "
|
|
42
|
+
bindings(): "value" | "element" | "context";
|
|
43
43
|
exports(): {};
|
|
44
44
|
}
|
|
45
45
|
interface $$IsomorphicComponent {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
4
|
+
import { ButtonRoot } from '../../button/index.js';
|
|
4
5
|
import { getPopoverContext } from '../root/context';
|
|
5
6
|
|
|
6
7
|
type PopoverTriggerButtonProps = Omit<
|
|
@@ -30,8 +31,8 @@
|
|
|
30
31
|
}
|
|
31
32
|
</script>
|
|
32
33
|
|
|
33
|
-
<
|
|
34
|
-
bind:
|
|
34
|
+
<ButtonRoot
|
|
35
|
+
bind:element={buttonRef}
|
|
35
36
|
class={className}
|
|
36
37
|
type="button"
|
|
37
38
|
aria-expanded={ctx?.isOpen ?? false}
|
|
@@ -42,4 +43,4 @@
|
|
|
42
43
|
{#if children}
|
|
43
44
|
{@render children()}
|
|
44
45
|
{/if}
|
|
45
|
-
</
|
|
46
|
+
</ButtonRoot>
|
|
@@ -24,6 +24,6 @@ type TableRootProps = Omit<HTMLAttributes<HTMLTableElement>, 'children'> & {
|
|
|
24
24
|
context?: TableContext;
|
|
25
25
|
element?: HTMLTableElement;
|
|
26
26
|
};
|
|
27
|
-
declare const TableRoot: import("svelte").Component<TableRootProps, {}, "
|
|
27
|
+
declare const TableRoot: import("svelte").Component<TableRootProps, {}, "element" | "context" | "hiddenColumns" | "selectedKeys" | "sortDescriptor" | "columnWidths">;
|
|
28
28
|
type TableRoot = ReturnType<typeof TableRoot>;
|
|
29
29
|
export default TableRoot;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
4
|
+
import { ButtonRoot } from '../../button/index.js';
|
|
4
5
|
import { useTimePickerContext } from '../root/context';
|
|
5
6
|
import {
|
|
6
7
|
shouldShowFocusVisible,
|
|
@@ -94,14 +95,13 @@
|
|
|
94
95
|
</script>
|
|
95
96
|
|
|
96
97
|
{#if !timePicker.isReadOnly}
|
|
97
|
-
<
|
|
98
|
-
bind:
|
|
98
|
+
<ButtonRoot
|
|
99
|
+
bind:element={buttonRef}
|
|
99
100
|
type="button"
|
|
100
|
-
|
|
101
|
+
isDisabled={timePicker.isDisabled}
|
|
101
102
|
class={className}
|
|
102
103
|
aria-haspopup="dialog"
|
|
103
104
|
aria-expanded={timePicker.open}
|
|
104
|
-
data-disabled={timePicker.isDisabled || undefined}
|
|
105
105
|
data-focused={isFocused || undefined}
|
|
106
106
|
data-focus-visible={isFocused && timePicker.focusVisible ? 'true' : undefined}
|
|
107
107
|
{...restProps}
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
{#if children}
|
|
119
119
|
{@render children()}
|
|
120
120
|
{/if}
|
|
121
|
-
</
|
|
121
|
+
</ButtonRoot>
|
|
122
122
|
{/if}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@human-kit/svelte-components",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"svelte": "./dist/index.js",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./button": {
|
|
15
|
+
"types": "./dist/button/index.d.ts",
|
|
16
|
+
"svelte": "./dist/button/index.js",
|
|
17
|
+
"default": "./dist/button/index.js"
|
|
18
|
+
},
|
|
14
19
|
"./checkbox": {
|
|
15
20
|
"types": "./dist/checkbox/index.d.ts",
|
|
16
21
|
"svelte": "./dist/checkbox/index.js",
|