@adriansyah/heroui-svelte 0.0.3 → 0.0.4
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/autocomplete/autocomplete.svelte +1 -1
- package/dist/components/autocomplete/index.svelte.d.ts +1 -1
- package/dist/components/autocomplete/index.svelte.js +1 -1
- package/dist/components/avatar/context.svelte.d.ts +1 -1
- package/dist/components/avatar/context.svelte.js +1 -1
- package/dist/components/button/button.svelte +1 -1
- package/dist/components/button/index.svelte.d.ts +1 -1
- package/dist/components/button/index.svelte.js +1 -1
- package/dist/components/button-group/context.svelte.d.ts +1 -1
- package/dist/components/button-group/context.svelte.js +1 -1
- package/dist/components/card/context.svelte.d.ts +1 -1
- package/dist/components/card/context.svelte.js +1 -1
- package/dist/components/checkbox/checkbox.svelte +1 -1
- package/dist/components/collection/collection.svelte +1 -1
- package/dist/components/collection/collection.svelte.d.ts +1 -1
- package/dist/components/filter/filter-provider.svelte +1 -1
- package/dist/components/filter/index.svelte.d.ts +3 -3
- package/dist/components/filter/index.svelte.js +3 -3
- package/dist/components/input/index.svelte.d.ts +1 -1
- package/dist/components/input/index.svelte.js +3 -3
- package/dist/components/input/input.svelte +1 -1
- package/dist/components/input-group/input-group-input.svelte +1 -1
- package/dist/components/input-group/input-group-textarea.svelte +1 -1
- package/dist/components/input-group/input-group.svelte +1 -1
- package/dist/components/list-box/index.svelte.d.ts +1 -1
- package/dist/components/list-box/index.svelte.js +3 -3
- package/dist/components/list-box/list-box-item.svelte +1 -1
- package/dist/components/list-box/list-box.svelte +1 -1
- package/dist/components/modal/index.svelte.d.ts +1 -1
- package/dist/components/modal/index.svelte.js +1 -1
- package/dist/components/modal/modal-content.svelte +1 -1
- package/dist/components/pagination/index.svelte.d.ts +1 -1
- package/dist/components/pagination/index.svelte.js +1 -1
- package/dist/components/pagination/pagination.svelte +1 -1
- package/dist/components/popover/popover-trigger.svelte +1 -1
- package/dist/components/popover/popover-trigger.svelte.d.ts +1 -1
- package/dist/components/popover/popover.svelte +1 -1
- package/dist/components/search-input/search-input.svelte +1 -1
- package/dist/components/table/index.svelte.d.ts +1 -1
- package/dist/components/table/index.svelte.js +1 -1
- package/dist/components/text-field/text-field.svelte +1 -1
- package/dist/components/textarea/textarea.svelte +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
import { Popover, AutocompleteContext, type AutocompleteOpts } from "../../index.js";
|
|
4
|
-
import { box } from "svelte-utils";
|
|
4
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
5
5
|
import { autocompleteVariants } from "@heroui/styles";
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<HTMLElement> &
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AutocompleteVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Box, type Getter, PopoverState } from "svelte-utils";
|
|
2
|
+
import { Context, type Box, type Getter, PopoverState } from "@adriansyah/svelte-utils";
|
|
3
3
|
import { ListBoxContext, type ListBoxOpts, type PopoverContextOpts } from "../../index.js";
|
|
4
4
|
export type AutocompleteOpts = ListBoxOpts & AutocompleteVariants & PopoverContextOpts & {
|
|
5
5
|
invalid?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, isEventTargetInAny, watch, PopoverState } from "svelte-utils";
|
|
1
|
+
import { Context, isEventTargetInAny, watch, PopoverState } from "@adriansyah/svelte-utils";
|
|
2
2
|
import { ListBoxContext } from "../../index.js";
|
|
3
3
|
export class AutocompleteContext extends Context {
|
|
4
4
|
opts;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export type AvatarOpts = AvatarVariants;
|
|
4
4
|
export declare class AvatarContext extends Context {
|
|
5
5
|
readonly opts: AvatarOpts;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { buttonVariants } from "@heroui/styles";
|
|
3
3
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
4
4
|
import { type ButtonOpts, ButtonContext, Spinner } from "../../index.js";
|
|
5
|
-
import { useRipples } from "svelte-utils";
|
|
5
|
+
import { useRipples } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
const {
|
|
8
8
|
focused,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ButtonVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export type ButtonGroupOpts = ButtonVariants;
|
|
4
4
|
export declare class ButtonGroupContext extends Context {
|
|
5
5
|
readonly opts: ButtonGroupOpts;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CardVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export declare class CardContext extends Context {
|
|
4
4
|
opts: CardVariants;
|
|
5
5
|
constructor(opts: Getter<CardVariants>);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { checkboxVariants } from "@heroui/styles";
|
|
3
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
4
4
|
import { type InputOpts, InputContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
import CheckboxContent from "./checkbox-content.svelte";
|
|
7
7
|
|
|
8
8
|
type Props = InputOpts &
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
-
import { type Fn, type MaybePromise } from "svelte-utils";
|
|
2
|
+
import { type Fn, type MaybePromise } from "@adriansyah/svelte-utils";
|
|
3
3
|
import type { Attachment } from "svelte/attachments";
|
|
4
4
|
declare function $$render<T>(): {
|
|
5
5
|
props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Context, type Box, type Fn, type Getter } from "svelte-utils";
|
|
1
|
+
import { Context, type Box, type Fn, type Getter } from "@adriansyah/svelte-utils";
|
|
2
2
|
export type FilterOpts = {
|
|
3
3
|
caseSensitive?: boolean;
|
|
4
|
-
filter?: Fn<
|
|
4
|
+
filter?: Fn<[string, string], boolean>;
|
|
5
5
|
};
|
|
6
6
|
export declare class FilterContext extends Context {
|
|
7
7
|
#private;
|
|
@@ -13,5 +13,5 @@ export declare class FilterContext extends Context {
|
|
|
13
13
|
matches: (text: string) => boolean;
|
|
14
14
|
filter: (query: string, text: string) => boolean;
|
|
15
15
|
constructor(opts: Getter<FilterOpts>, query?: Box<string>);
|
|
16
|
-
sync(
|
|
16
|
+
sync(value: Box<string>): void;
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack } from "svelte";
|
|
2
|
-
import { box,
|
|
2
|
+
import { box, Context } from "@adriansyah/svelte-utils";
|
|
3
3
|
export class FilterContext extends Context {
|
|
4
4
|
#opts;
|
|
5
5
|
#query;
|
|
@@ -31,7 +31,7 @@ export class FilterContext extends Context {
|
|
|
31
31
|
this.#opts = $derived.by(opts);
|
|
32
32
|
this.#query = query;
|
|
33
33
|
}
|
|
34
|
-
sync(
|
|
35
|
-
|
|
34
|
+
sync(value) {
|
|
35
|
+
box.link(value, this.#query);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Box, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, type Box, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export type InputValue = string | number | undefined;
|
|
4
4
|
export type InputOpts = InputVariants & {
|
|
5
5
|
disabled?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { box,
|
|
1
|
+
import { box, coalesce, Context } from "@adriansyah/svelte-utils";
|
|
2
2
|
export class InputContext extends Context {
|
|
3
3
|
opts;
|
|
4
4
|
#value;
|
|
@@ -23,8 +23,8 @@ export class InputContext extends Context {
|
|
|
23
23
|
this.#checked = checked;
|
|
24
24
|
if (!parent)
|
|
25
25
|
return;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
box.link(parent.#value, value);
|
|
27
|
+
box.link(parent.#checked, checked);
|
|
28
28
|
}
|
|
29
29
|
get props() {
|
|
30
30
|
return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { inputVariants } from "@heroui/styles";
|
|
3
3
|
import type { HTMLInputAttributes } from "svelte/elements";
|
|
4
4
|
import { type InputOpts, InputContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
headless?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { inputGroupVariants } from "@heroui/styles";
|
|
3
3
|
import type { ComponentProps } from "svelte";
|
|
4
4
|
import { Input, InputContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
value = $bindable(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { inputGroupVariants } from "@heroui/styles";
|
|
3
3
|
import { InputContext, type InputOpts } from "../../index.js";
|
|
4
|
-
import { box, coalesce } from "svelte-utils";
|
|
4
|
+
import { box, coalesce } from "@adriansyah/svelte-utils";
|
|
5
5
|
import type { HTMLAttributes } from "svelte/elements";
|
|
6
6
|
|
|
7
7
|
let {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { inputGroupVariants } from "@heroui/styles";
|
|
3
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
4
4
|
import { type InputOpts, type InputValue, InputContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
type Props = InputOpts &
|
|
8
8
|
HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { box,
|
|
1
|
+
import { box, Context } from "@adriansyah/svelte-utils";
|
|
2
2
|
import { FilterContext } from "../filter";
|
|
3
3
|
import { onDestroy } from "svelte";
|
|
4
4
|
export class ListBoxContext extends Context {
|
|
5
5
|
#opts;
|
|
6
6
|
get opts() { return this.#opts; }
|
|
7
7
|
#selected;
|
|
8
|
-
get selected() { return
|
|
8
|
+
get selected() { return box.array(this.#selected); }
|
|
9
9
|
set selected(values) { this.#selected.current = values; }
|
|
10
10
|
get noSelected() { return this.selected.length === 0; }
|
|
11
11
|
isSelected(value) {
|
|
@@ -43,7 +43,7 @@ export class ListBoxItemContext extends Context {
|
|
|
43
43
|
onDestroy(() => {
|
|
44
44
|
this.listbox.setSelected(this.value, false);
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
box.link(box(() => this.listbox.isSelected(this.value), v => this.listbox.setSelected(this.value, v)), selected);
|
|
47
47
|
}
|
|
48
48
|
toggle = () => {
|
|
49
49
|
this.selected = !this.selected;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
import { listboxItemVariants } from "@heroui/styles";
|
|
4
4
|
import { ListBoxItemContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
import type { Snippet } from "svelte";
|
|
7
7
|
|
|
8
8
|
let {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
import { listboxVariants } from "@heroui/styles";
|
|
4
4
|
import { type ListBoxOpts, ListBoxContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
type Props = HTMLAttributes<HTMLDivElement> &
|
|
8
8
|
Partial<ListBoxOpts> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModalVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, DialogState, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, DialogState, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export type ModalOpts = ModalVariants & {
|
|
4
4
|
placement?: "top" | "bottom" | "center" | "auto";
|
|
5
5
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { HTMLDialogAttributes } from "svelte/elements";
|
|
3
3
|
import { modalVariants } from "@heroui/styles";
|
|
4
4
|
import { ModalContext } from "../../index.js";
|
|
5
|
-
import { getViewport } from "svelte-utils";
|
|
5
|
+
import { getViewport } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
type Props = HTMLDialogAttributes;
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PaginationVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Box, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, type Box, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export type PaginationProps = {
|
|
4
4
|
total?: number;
|
|
5
5
|
pageSize?: number;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { PaginationProps } from "./index.svelte";
|
|
4
4
|
import type { HTMLAttributes } from "svelte/elements";
|
|
5
5
|
import PaginationState from "./index.svelte";
|
|
6
|
-
import { box } from "svelte-utils";
|
|
6
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
7
7
|
import PaginationSummary from "./pagination-summary.svelte";
|
|
8
8
|
import PaginationContent from "./pagination-content.svelte";
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ComponentProps, Snippet } from "svelte";
|
|
3
3
|
import Button from "../button/button.svelte";
|
|
4
4
|
import { PopoverContext } from "./index.svelte";
|
|
5
|
-
import type { PopoverState } from "@adriansyah/svelte-utils";
|
|
5
|
+
import type { PopoverState } from "@adriansyah/@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
type Props = ComponentProps<typeof Button> & {
|
|
8
8
|
child?: Snippet<
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps, Snippet } from "svelte";
|
|
2
2
|
import Button from "../button/button.svelte";
|
|
3
|
-
import type { PopoverState } from "@adriansyah/svelte-utils";
|
|
3
|
+
import type { PopoverState } from "@adriansyah/@adriansyah/svelte-utils";
|
|
4
4
|
type Props = ComponentProps<typeof Button> & {
|
|
5
5
|
child?: Snippet<[
|
|
6
6
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { PopoverContext, type PopoverContextOpts } from "./index.svelte";
|
|
3
|
-
import { box } from "svelte-utils";
|
|
3
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
4
4
|
import type { Snippet } from "svelte";
|
|
5
5
|
|
|
6
6
|
type Props = Omit<PopoverContextOpts, "open" | "fallbackAnchor"> & {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
InputContext,
|
|
10
10
|
} from "../../index.js";
|
|
11
11
|
import type { ComponentProps } from "svelte";
|
|
12
|
-
import { box, watch } from "svelte-utils";
|
|
12
|
+
import { box, watch } from "@adriansyah/svelte-utils";
|
|
13
13
|
import { FilterContext } from "../filter/index.svelte";
|
|
14
14
|
|
|
15
15
|
type Props = ComponentProps<typeof InputGroup> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableVariants } from "@heroui/styles";
|
|
2
|
-
import { Context, type Getter } from "svelte-utils";
|
|
2
|
+
import { Context, type Getter } from "@adriansyah/svelte-utils";
|
|
3
3
|
export type TableOpts = TableVariants;
|
|
4
4
|
export default class TableContext extends Context {
|
|
5
5
|
readonly opts: TableOpts;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
import { textFieldVariants } from "@heroui/styles";
|
|
4
4
|
import { type InputOpts, type InputValue, InputContext } from "../../index.js";
|
|
5
|
-
import { box } from "svelte-utils";
|
|
5
|
+
import { box } from "@adriansyah/svelte-utils";
|
|
6
6
|
|
|
7
7
|
type Props = InputOpts &
|
|
8
8
|
HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
import { InputContext, type InputOpts } from "../input";
|
|
4
|
-
import { box, coalesce } from "svelte-utils";
|
|
4
|
+
import { box, coalesce } from "@adriansyah/svelte-utils";
|
|
5
5
|
import { textAreaVariants } from "@heroui/styles";
|
|
6
6
|
|
|
7
7
|
type Props = InputOpts &
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adriansyah/heroui-svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@chromatic-com/storybook": "latest",
|
|
6
6
|
"@heroui/styles": "^3.2.6",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"type": "module",
|
|
67
67
|
"types": "./dist/index.d.ts",
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@adriansyah/svelte-utils": "^0.0.
|
|
69
|
+
"@adriansyah/svelte-utils": "^0.0.2"
|
|
70
70
|
}
|
|
71
71
|
}
|