@kirana-ui/vue 0.1.1 → 0.2.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/llms.txt +1619 -241
- package/package.json +14 -2
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.d.ts +42 -75
- package/src/accordion.js +4 -2
- package/src/accordion.js.map +1 -1
- package/src/agent.d.ts +1 -0
- package/src/agent.js +1 -0
- package/src/alert-dialog.d.ts +3 -2
- package/src/autocomplete.d.ts +4 -2
- package/src/autosize.d.ts +9 -9
- package/src/autosize.js.map +1 -1
- package/src/avatar.d.ts +10 -13
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +4 -21
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +65 -99
- package/src/calendar.js +6 -1
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +36 -58
- package/src/carousel.js.map +1 -1
- package/src/checkbox.d.ts +28 -50
- package/src/checkbox.js +2 -2
- package/src/checkbox.js.map +1 -1
- package/src/collapsible.d.ts +26 -36
- package/src/collapsible.js.map +1 -1
- package/src/combobox.d.ts +139 -290
- package/src/combobox.js +11 -1
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +43 -86
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +4 -2
- package/src/date-field.d.ts +31 -61
- package/src/date-field.js +7 -3
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +83 -139
- package/src/date-picker.js.map +1 -1
- package/src/dialog.d.ts +74 -145
- package/src/dialog.js +3 -1
- package/src/dialog.js.map +1 -1
- package/src/direction.d.ts +5 -8
- package/src/direction.js.map +1 -1
- package/src/drawer.d.ts +3 -2
- package/src/element.d.ts +23 -0
- package/src/element.js +90 -0
- package/src/element.js.map +1 -0
- package/src/field.d.ts +63 -45
- package/src/field.js +3 -2
- package/src/field.js.map +1 -1
- package/src/fieldset.d.ts +12 -13
- package/src/fieldset.js.map +1 -1
- package/src/form.d.ts +5 -15
- package/src/form.js.map +1 -1
- package/src/hover-card.d.ts +29 -43
- package/src/hover-card.js.map +1 -1
- package/src/hover-popup.d.ts +27 -46
- package/src/hover-popup.js +4 -1
- package/src/hover-popup.js.map +1 -1
- package/src/index.d.ts +13 -3
- package/src/input.d.ts +12 -14
- package/src/input.js.map +1 -1
- package/src/label.d.ts +3 -3
- package/src/label.js.map +1 -1
- package/src/listbox.d.ts +34 -89
- package/src/listbox.js.map +1 -1
- package/src/menu.d.ts +170 -533
- package/src/menu.js.map +1 -1
- package/src/menubar.d.ts +6 -24
- package/src/menubar.js.map +1 -1
- package/src/message-scroller.d.ts +23 -17
- package/src/message-scroller.js.map +1 -1
- package/src/meter.d.ts +10 -31
- package/src/meter.js.map +1 -1
- package/src/navigation-menu.d.ts +77 -88
- package/src/navigation-menu.js +13 -12
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +72 -68
- package/src/number-field.js +2 -2
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +33 -54
- package/src/otp.js +2 -2
- package/src/otp.js.map +1 -1
- package/src/pagination.d.ts +31 -58
- package/src/pagination.js.map +1 -1
- package/src/popover.d.ts +60 -36
- package/src/popover.js +33 -5
- package/src/popover.js.map +1 -1
- package/src/primitive.d.ts +21 -0
- package/src/primitive.js +27 -0
- package/src/primitive.js.map +1 -0
- package/src/progress.d.ts +28 -31
- package/src/progress.js.map +1 -1
- package/src/qr-code.d.ts +12 -21
- package/src/qr-code.js.map +1 -1
- package/src/radio-group.d.ts +37 -75
- package/src/radio-group.js +2 -2
- package/src/radio-group.js.map +1 -1
- package/src/resizable.d.ts +26 -45
- package/src/resizable.js.map +1 -1
- package/src/runtime.d.ts +93 -21
- package/src/runtime.js +24 -25
- package/src/runtime.js.map +1 -1
- package/src/scroll-area.d.ts +33 -28
- package/src/scroll-area.js.map +1 -1
- package/src/select.d.ts +87 -147
- package/src/select.js +31 -6
- package/src/select.js.map +1 -1
- package/src/separator.d.ts +4 -9
- package/src/separator.js.map +1 -1
- package/src/slider.d.ts +61 -80
- package/src/slider.js +10 -10
- package/src/slider.js.map +1 -1
- package/src/switch.d.ts +21 -39
- package/src/switch.js +2 -2
- package/src/switch.js.map +1 -1
- package/src/tabs.d.ts +44 -98
- package/src/tabs.js.map +1 -1
- package/src/testing.d.ts +1 -0
- package/src/testing.js +1 -0
- package/src/toast.d.ts +58 -45
- package/src/toast.js +46 -17
- package/src/toast.js.map +1 -1
- package/src/toggle-group.d.ts +8 -39
- package/src/toggle-group.js.map +1 -1
- package/src/toggle.d.ts +5 -34
- package/src/toggle.js.map +1 -1
- package/src/toolbar.d.ts +31 -69
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +29 -43
- package/src/tooltip.js.map +1 -1
- package/src/value-bar.d.ts +26 -35
- package/src/value-bar.js +10 -3
- package/src/value-bar.js.map +1 -1
package/src/testing.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@kirana-ui/core/testing";
|
package/src/testing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@kirana-ui/core/testing";
|
package/src/toast.d.ts
CHANGED
|
@@ -1,48 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PartComponent, PartComponentProps, PlainComponent } from "./runtime.js";
|
|
2
|
+
import { VNodeChild } from "vue";
|
|
3
|
+
import * as Core from "@kirana-ui/core/toast";
|
|
4
|
+
import { ToasterOptions } from "@kirana-ui/core/toast";
|
|
5
|
+
/**
|
|
6
|
+
* What a toast's title, description and action's label may be here: what a render function
|
|
7
|
+
* returns (a string, `h("b", "Saved")`, several of them).
|
|
8
|
+
*/
|
|
9
|
+
export type ToastContent = VNodeChild;
|
|
10
|
+
export type ToastActionOptions<Content = VNodeChild> = Core.ToastActionOptions<Content>;
|
|
11
|
+
export type ToastOptions<Content = VNodeChild> = Core.ToastOptions<Content>;
|
|
12
|
+
export type ToastRecord<Content = VNodeChild> = Core.ToastRecord<Content>;
|
|
13
|
+
export type ToastState<Content = VNodeChild> = Core.ToastState<Content>;
|
|
14
|
+
export type Toaster<Content = VNodeChild> = Core.Toaster<Content>;
|
|
15
|
+
/**
|
|
16
|
+
* The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A
|
|
17
|
+
* title, a description and an action's label are what a render function returns, unless
|
|
18
|
+
* `Content` says otherwise.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createToaster: <Content = VNodeChild>(options?: Core.ToasterOptions) => Toaster<Content>;
|
|
21
|
+
type ToastProps = Core.ToastProps<VNodeChild>;
|
|
22
|
+
export type ViewportProps = Omit<ToastProps, "id"> & {
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
} & PartComponentProps;
|
|
25
|
+
export type ListProps = Record<never, never>;
|
|
26
|
+
export interface RootProps extends PartComponentProps {
|
|
27
|
+
/** The toast it draws, as `Toast.List` gives it. */
|
|
28
|
+
toast: ToastRecord;
|
|
29
|
+
}
|
|
30
|
+
export type ContentProps = PartComponentProps;
|
|
31
|
+
export type TitleProps = PartComponentProps;
|
|
32
|
+
export type DescriptionProps = PartComponentProps;
|
|
33
|
+
export type CloseProps = PartComponentProps;
|
|
34
|
+
export type ActionProps = PartComponentProps;
|
|
3
35
|
export declare const Toast: {
|
|
4
|
-
Viewport:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
-
Root: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
29
|
-
toast: {
|
|
30
|
-
type: PropType<ToastRecord$1>;
|
|
31
|
-
required: true;
|
|
32
|
-
};
|
|
33
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
-
toast: {
|
|
37
|
-
type: PropType<ToastRecord$1>;
|
|
38
|
-
required: true;
|
|
39
|
-
};
|
|
40
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
41
|
-
Content: import("vue").Component;
|
|
42
|
-
Title: import("vue").Component;
|
|
43
|
-
Description: import("vue").Component;
|
|
44
|
-
Close: import("vue").Component;
|
|
45
|
-
Action: import("vue").Component;
|
|
36
|
+
Viewport: PartComponent<"div", {
|
|
37
|
+
readonly expanded?: true | undefined;
|
|
38
|
+
}, ViewportProps>;
|
|
39
|
+
List: PlainComponent<ListProps, {}, {
|
|
40
|
+
toast: ToastRecord;
|
|
41
|
+
}>;
|
|
42
|
+
Root: PartComponent<"div", {
|
|
43
|
+
readonly startingStyle?: true | undefined;
|
|
44
|
+
readonly endingStyle?: true | undefined;
|
|
45
|
+
readonly expanded?: true | undefined;
|
|
46
|
+
readonly type?: true | undefined;
|
|
47
|
+
readonly limited?: true | undefined;
|
|
48
|
+
readonly swiping?: true | undefined;
|
|
49
|
+
readonly swipeDirection?: "down" | "left" | "right" | "up" | undefined;
|
|
50
|
+
}, RootProps>;
|
|
51
|
+
Content: PartComponent<"div", {
|
|
52
|
+
readonly behind?: true | undefined;
|
|
53
|
+
readonly expanded?: true | undefined;
|
|
54
|
+
}, PartComponentProps, {}, unknown>;
|
|
55
|
+
Title: PartComponent<"div", Record<never, never>>;
|
|
56
|
+
Description: PartComponent<"div", Record<never, never>>;
|
|
57
|
+
Close: PartComponent<"button", Record<never, never>, PartComponentProps, {}, unknown>;
|
|
58
|
+
Action: PartComponent<"button", Record<never, never>>;
|
|
46
59
|
};
|
|
47
|
-
export
|
|
60
|
+
export type { ToasterOptions };
|
|
48
61
|
//# sourceMappingURL=toast.d.ts.map
|
package/src/toast.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { written } from "./element.js";
|
|
1
2
|
import { context, controller, fromSignal, partComponent } from "./runtime.js";
|
|
2
3
|
import { Fragment, defineComponent, h, useId } from "vue";
|
|
3
|
-
import { createToast, createToaster } from "@kirana-ui/core/toast";
|
|
4
|
+
import { createToast, createToaster as createToaster$1 } from "@kirana-ui/core/toast";
|
|
4
5
|
// src/toast.ts
|
|
6
|
+
/**
|
|
7
|
+
* The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A
|
|
8
|
+
* title, a description and an action's label are what a render function returns, unless
|
|
9
|
+
* `Content` says otherwise.
|
|
10
|
+
*/
|
|
11
|
+
const createToaster = createToaster$1;
|
|
5
12
|
const scope = context("Toast");
|
|
6
13
|
const toastScope = context("Toast.Root");
|
|
7
14
|
const ViewportElement = partComponent("ToastViewportElement", "div", () => scope.use().viewport);
|
|
@@ -40,26 +47,48 @@ const List = defineComponent({
|
|
|
40
47
|
}
|
|
41
48
|
});
|
|
42
49
|
const RootElement = partComponent("ToastRootElement", "div", () => toastScope.use().root);
|
|
50
|
+
const Root = defineComponent({
|
|
51
|
+
name: "ToastRoot",
|
|
52
|
+
inheritAttrs: false,
|
|
53
|
+
props: { toast: {
|
|
54
|
+
type: Object,
|
|
55
|
+
required: true
|
|
56
|
+
} },
|
|
57
|
+
setup(props, { attrs, slots }) {
|
|
58
|
+
toastScope.provide(scope.use().toast(props.toast.id));
|
|
59
|
+
return () => h(RootElement, attrs, slots);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const Content = partComponent("ToastContent", "div", () => toastScope.use().content);
|
|
63
|
+
/**
|
|
64
|
+
* A part that says something of the toast's: the caller's slot when it has one, what the
|
|
65
|
+
* toast was added with otherwise, and nothing in the page when there is neither.
|
|
66
|
+
*/
|
|
67
|
+
function said(name, tag, part) {
|
|
68
|
+
return defineComponent({
|
|
69
|
+
name,
|
|
70
|
+
inheritAttrs: false,
|
|
71
|
+
setup(_, { attrs, slots }) {
|
|
72
|
+
const toast = fromSignal(toastScope.use().record);
|
|
73
|
+
const given = () => part === "action" ? toast.value?.action?.label : toast.value?.[part];
|
|
74
|
+
const Element = partComponent(`${name}Element`, tag, () => toastScope.use()[part], written(given));
|
|
75
|
+
return () => {
|
|
76
|
+
if (slots.default) return h(Element, attrs, slots);
|
|
77
|
+
const words = given();
|
|
78
|
+
return words == null ? null : h(Element, attrs, () => words);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
43
83
|
const Toast = {
|
|
44
84
|
Viewport,
|
|
45
85
|
List,
|
|
46
|
-
Root
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type: Object,
|
|
51
|
-
required: true
|
|
52
|
-
} },
|
|
53
|
-
setup(props, { attrs, slots }) {
|
|
54
|
-
toastScope.provide(scope.use().toast(props.toast.id));
|
|
55
|
-
return () => h(RootElement, attrs, slots);
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
Content: partComponent("ToastContent", "div", () => toastScope.use().content),
|
|
59
|
-
Title: partComponent("ToastTitle", "div", () => toastScope.use().title),
|
|
60
|
-
Description: partComponent("ToastDescription", "div", () => toastScope.use().description),
|
|
86
|
+
Root,
|
|
87
|
+
Content,
|
|
88
|
+
Title: said("ToastTitle", "div", "title"),
|
|
89
|
+
Description: said("ToastDescription", "div", "description"),
|
|
61
90
|
Close: partComponent("ToastClose", "button", () => toastScope.use().close),
|
|
62
|
-
Action:
|
|
91
|
+
Action: said("ToastAction", "button", "action")
|
|
63
92
|
};
|
|
64
93
|
export { Toast, createToaster };
|
|
65
94
|
|
package/src/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","names":[],"sources":["../../../../packages/vue/src/toast.ts"],"sourcesContent":["import { createToast } from \"@kirana-ui/core/toast\"\nimport type
|
|
1
|
+
{"version":3,"file":"toast.js","names":["createCoreToaster"],"sources":["../../../../packages/vue/src/toast.ts"],"sourcesContent":["import { createToast, createToaster as createCoreToaster } from \"@kirana-ui/core/toast\"\nimport type * as Core from \"@kirana-ui/core/toast\"\nimport { Fragment, defineComponent, h, useId } from \"vue\"\nimport type { PropType, VNodeChild } from \"vue\"\n\nimport { written } from \"./element.ts\"\nimport { context, controller, fromSignal, partComponent } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, PlainComponent, StatesOf } from \"./runtime.ts\"\n\ntype State = StatesOf<\"toast\">\n\n/**\n * What a toast's title, description and action's label may be here: what a render function\n * returns (a string, `h(\"b\", \"Saved\")`, several of them).\n */\nexport type ToastContent = VNodeChild\nexport type ToastActionOptions<Content = VNodeChild> = Core.ToastActionOptions<Content>\nexport type ToastOptions<Content = VNodeChild> = Core.ToastOptions<Content>\nexport type ToastRecord<Content = VNodeChild> = Core.ToastRecord<Content>\nexport type ToastState<Content = VNodeChild> = Core.ToastState<Content>\nexport type Toaster<Content = VNodeChild> = Core.Toaster<Content>\nexport type { ToasterOptions } from \"@kirana-ui/core/toast\"\n\n/**\n * The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A\n * title, a description and an action's label are what a render function returns, unless\n * `Content` says otherwise.\n */\nexport const createToaster: <Content = VNodeChild>(\n options?: Core.ToasterOptions\n) => Toaster<Content> = createCoreToaster\n\ntype Controller = Core.Toast<VNodeChild>\ntype ToastParts = Core.ToastParts<VNodeChild>\ntype ToastProps = Core.ToastProps<VNodeChild>\n\nconst scope = context<Controller>(\"Toast\")\nconst toastScope = context<ToastParts>(\"Toast.Root\")\n\nconst ViewportElement = partComponent(\"ToastViewportElement\", \"div\", () => scope.use().viewport)\n\nexport type ViewportProps = Omit<ToastProps, \"id\"> & {\n id?: string | undefined\n} & PartComponentProps\n\n/** Where a toaster's toasts are drawn. Always in the page: put it once, near the root. */\nconst Viewport = defineComponent({\n name: \"ToastViewport\",\n inheritAttrs: false,\n props: {\n toaster: { type: Object as PropType<Toaster>, required: true },\n label: String,\n hotkey: String,\n swipeDirection: String as PropType<ToastProps[\"swipeDirection\"]>,\n id: String,\n },\n setup(props, { attrs, slots }) {\n const generated = useId()\n scope.provide(\n controller(createToast, () => ({\n id: props.id ?? generated,\n toaster: props.toaster,\n label: props.label,\n hotkey: props.hotkey,\n swipeDirection: props.swipeDirection,\n }))\n )\n return () => h(ViewportElement, attrs, slots)\n },\n}) as unknown as PartComponent<\"div\", State[\"viewport\"], ViewportProps>\n\nexport type ListProps = Record<never, never>\n\n/** Draws its slot once for each toast, the newest first: `v-slot=\"{ toast }\"`. */\nconst List = defineComponent({\n name: \"ToastList\",\n setup(_, { slots }) {\n const toasts = fromSignal(scope.use().toasts)\n return () =>\n toasts.value.map((toast) => h(Fragment, { key: toast.id }, slots.default?.({ toast })))\n },\n}) as unknown as PlainComponent<ListProps, {}, { toast: ToastRecord }>\n\nconst RootElement = partComponent(\"ToastRootElement\", \"div\", () => toastScope.use().root)\n\nexport interface RootProps extends PartComponentProps {\n /** The toast it draws, as `Toast.List` gives it. */\n toast: ToastRecord\n}\n\nconst Root = defineComponent({\n name: \"ToastRoot\",\n inheritAttrs: false,\n props: { toast: { type: Object as PropType<ToastRecord>, required: true } },\n setup(props, { attrs, slots }) {\n toastScope.provide(scope.use().toast(props.toast.id))\n return () => h(RootElement, attrs, slots)\n },\n}) as unknown as PartComponent<\"div\", State[\"root\"], RootProps>\n\nconst Content = partComponent<\"div\", State[\"content\"]>(\n \"ToastContent\",\n \"div\",\n () => toastScope.use().content\n)\n\n/**\n * A part that says something of the toast's: the caller's slot when it has one, what the\n * toast was added with otherwise, and nothing in the page when there is neither.\n */\nfunction said<Tag extends string, Said extends \"title\" | \"description\" | \"action\">(\n name: string,\n tag: Tag,\n part: Said\n) {\n return defineComponent({\n name,\n inheritAttrs: false,\n setup(_, { attrs, slots }) {\n const toast = fromSignal(toastScope.use().record)\n const given = () => (part === \"action\" ? toast.value?.action?.label : toast.value?.[part])\n // With `as-child` the caller's element holds what the toast says, unless it writes its own.\n const Element = partComponent<string>(\n `${name}Element`,\n tag,\n () => toastScope.use()[part],\n written(given)\n )\n return () => {\n if (slots.default) return h(Element, attrs, slots)\n const words = given()\n return words == null ? null : h(Element, attrs, () => words)\n }\n },\n }) as unknown as PartComponent<Tag, State[Said]>\n}\n\nexport type ContentProps = PartComponentProps\nexport type TitleProps = PartComponentProps\nexport type DescriptionProps = PartComponentProps\nexport type CloseProps = PartComponentProps\nexport type ActionProps = PartComponentProps\n\n/** The toast's title, unless it is given a slot of its own. */\nconst Title = said(\"ToastTitle\", \"div\", \"title\")\n/** The toast's description, unless it is given a slot of its own. */\nconst Description = said(\"ToastDescription\", \"div\", \"description\")\nconst Close = partComponent<\"button\", State[\"close\"]>(\n \"ToastClose\",\n \"button\",\n () => toastScope.use().close\n)\n/**\n * The toast's action, its label unless it is given a slot of its own. A press tells the\n * action (`onAction`), then closes the toast unless the action called `details.cancel()`.\n */\nconst Action = said(\"ToastAction\", \"button\", \"action\")\n\nexport const Toast = { Viewport, List, Root, Content, Title, Description, Close, Action }\n"],"mappings":";;;;;;;;;;AA4BA,MAAa,gBAEWA;AAMxB,MAAM,QAAQ,QAAoB,OAAO;AACzC,MAAM,aAAa,QAAoB,YAAY;AAEnD,MAAM,kBAAkB,cAAc,wBAAwB,aAAa,MAAM,IAAI,CAAC,CAAC,QAAQ;;AAO/F,MAAM,WAAW,gBAAgB;CAC/B,MAAM;CACN,cAAc;CACd,OAAO;EACL,SAAS;GAAE,MAAM;GAA6B,UAAU;EAAK;EAC7D,OAAO;EACP,QAAQ;EACR,gBAAgB;EAChB,IAAI;CACN;CACA,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,MAAM,YAAY,MAAM;EACxB,MAAM,QACJ,WAAW,oBAAoB;GAC7B,IAAI,MAAM,MAAM;GAChB,SAAS,MAAM;GACf,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,gBAAgB,MAAM;EACxB,EAAE,CACJ;EACA,aAAa,EAAE,iBAAiB,OAAO,KAAK;CAC9C;AACF,CAAC;;AAKD,MAAM,OAAO,gBAAgB;CAC3B,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,SAAS,WAAW,MAAM,IAAI,CAAC,CAAC,MAAM;EAC5C,aACE,OAAO,MAAM,KAAK,UAAU,EAAE,UAAU,EAAE,KAAK,MAAM,GAAG,GAAG,MAAM,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1F;AACF,CAAC;AAED,MAAM,cAAc,cAAc,oBAAoB,aAAa,WAAW,IAAI,CAAC,CAAC,IAAI;AAOxF,MAAM,OAAO,gBAAgB;CAC3B,MAAM;CACN,cAAc;CACd,OAAO,EAAE,OAAO;EAAE,MAAM;EAAiC,UAAU;CAAK,EAAE;CAC1E,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,WAAW,QAAQ,MAAM,IAAI,CAAC,CAAC,MAAM,MAAM,MAAM,EAAE,CAAC;EACpD,aAAa,EAAE,aAAa,OAAO,KAAK;CAC1C;AACF,CAAC;AAED,MAAM,UAAU,cACd,gBACA,aACM,WAAW,IAAI,CAAC,CAAC,OACzB;;;;;AAMA,SAAS,KACP,MACA,KACA,MACA;CACA,OAAO,gBAAgB;EACrB;EACA,cAAc;EACd,MAAM,GAAG,EAAE,OAAO,SAAS;GACzB,MAAM,QAAQ,WAAW,WAAW,IAAI,CAAC,CAAC,MAAM;GAChD,MAAM,cAAe,SAAS,WAAW,MAAM,OAAO,QAAQ,QAAQ,MAAM,QAAQ;GAEpF,MAAM,UAAU,cACd,GAAG,KAAK,UACR,WACM,WAAW,IAAI,CAAC,CAAC,OACvB,QAAQ,KAAK,CACf;GACA,aAAa;IACX,IAAI,MAAM,SAAS,OAAO,EAAE,SAAS,OAAO,KAAK;IACjD,MAAM,QAAQ,MAAM;IACpB,OAAO,SAAS,OAAO,OAAO,EAAE,SAAS,aAAa,KAAK;GAC7D;EACF;CACF,CAAC;AACH;AAuBA,MAAa,QAAQ;CAAE;CAAU;CAAM;CAAM;CAAS,OAdxC,KAAK,cAAc,OAAO,OAcc;CAAO,aAZzC,KAAK,oBAAoB,OAAO,aAYS;CAAa,OAX5D,cACZ,cACA,gBACM,WAAW,IAAI,CAAC,CAAC,KAQiD;CAAO,QAFlE,KAAK,eAAe,UAAU,QAEoC;AAAO"}
|
package/src/toggle-group.d.ts
CHANGED
|
@@ -1,41 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Changes, PartComponentProps, PartGiven, PartInstance, StatesOf } from "./runtime.js";
|
|
2
|
+
import { PublicProps } from "vue";
|
|
3
|
+
import { ToggleGroupProps as ToggleGroupProps$1 } from "@kirana-ui/core/toggle-group";
|
|
4
|
+
export type ToggleGroupProps<Value = unknown> = Omit<ToggleGroupProps$1<Value>, "onValueChange"> & PartComponentProps;
|
|
5
|
+
export type ToggleGroupEmits<Value = unknown> = Changes<"value", Value[]>;
|
|
3
6
|
/** `v-model:value` (a list). Each `Toggle` with a `value` inside it is one of its toggles. */
|
|
4
|
-
export declare const ToggleGroup:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
default: undefined;
|
|
8
|
-
};
|
|
9
|
-
defaultValue: PropType<readonly unknown[]>;
|
|
10
|
-
multiple: BooleanConstructor;
|
|
11
|
-
disabled: BooleanConstructor;
|
|
12
|
-
orientation: PropType<Orientation>;
|
|
13
|
-
loop: {
|
|
14
|
-
type: BooleanConstructor;
|
|
15
|
-
default: undefined;
|
|
16
|
-
};
|
|
17
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "valueChange")[], "update:value" | "valueChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
-
value: {
|
|
21
|
-
type: PropType<readonly unknown[]>;
|
|
22
|
-
default: undefined;
|
|
23
|
-
};
|
|
24
|
-
defaultValue: PropType<readonly unknown[]>;
|
|
25
|
-
multiple: BooleanConstructor;
|
|
26
|
-
disabled: BooleanConstructor;
|
|
27
|
-
orientation: PropType<Orientation>;
|
|
28
|
-
loop: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
default: undefined;
|
|
31
|
-
};
|
|
32
|
-
}>> & Readonly<{
|
|
33
|
-
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
34
|
-
onValueChange?: ((...args: any[]) => any) | undefined;
|
|
35
|
-
}>, {
|
|
36
|
-
value: readonly unknown[];
|
|
37
|
-
multiple: boolean;
|
|
38
|
-
disabled: boolean;
|
|
39
|
-
loop: boolean;
|
|
40
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export declare const ToggleGroup: new <Value = unknown, As extends string = "div">(props: PartGiven<As, ToggleGroupProps<Value>, ToggleGroupEmits<Value>> & PublicProps) => PartInstance<As, ToggleGroupProps<Value>, ToggleGroupEmits<Value>, {
|
|
8
|
+
state: StatesOf<"toggleGroup">["root"];
|
|
9
|
+
}>;
|
|
41
10
|
//# sourceMappingURL=toggle-group.d.ts.map
|
package/src/toggle-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.js","names":[],"sources":["../../../../packages/vue/src/toggle-group.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { ChangeDetails, Orientation } from \"@kirana-ui/core\"\nimport { createToggleGroup } from \"@kirana-ui/core/toggle-group\"\nimport { defineComponent, h, inject, provide } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport { useDirectionAround } from \"./direction-context.ts\"\nimport { controller, optional, partComponent } from \"./runtime.ts\"\nimport { TOGGLE_GROUP, TOOLBAR } from \"./toolbar-context.ts\"\n\n/** `v-model:value` (a list). Each `Toggle` with a `value` inside it is one of its toggles. */\nexport const ToggleGroup = defineComponent({\n name: \"ToggleGroup\",\n inheritAttrs: false,\n props: {\n value: optional(Array as PropType<readonly unknown[]>),\n defaultValue: Array as PropType<readonly unknown[]>,\n multiple: Boolean,\n disabled: Boolean,\n orientation: String as PropType<Orientation>,\n loop: optional(Boolean),\n },\n emits: [\"update:value\", \"valueChange\"],\n setup(props, { attrs, slots, emit }) {\n const direction = useDirectionAround()\n const toolbar = inject(TOOLBAR, null) ?? undefined\n const made = controller(within(createToggleGroup, { direction, toolbar }), () => ({\n value: props.value,\n defaultValue: props.defaultValue,\n multiple: props.multiple,\n disabled: props.disabled,\n orientation: props.orientation,\n loop: props.loop,\n onValueChange(value: unknown[], details: ChangeDetails) {\n emit(\"valueChange\", value, details)\n if (!details.canceled) emit(\"update:value\", value)\n },\n }))\n provide(TOGGLE_GROUP, made)\n const Element = partComponent(\"ToggleGroupElement\", \"div\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n})\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"toggle-group.js","names":[],"sources":["../../../../packages/vue/src/toggle-group.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { ChangeDetails, Orientation } from \"@kirana-ui/core\"\nimport { createToggleGroup } from \"@kirana-ui/core/toggle-group\"\nimport type { ToggleGroupProps as CoreProps } from \"@kirana-ui/core/toggle-group\"\nimport { defineComponent, h, inject, provide } from \"vue\"\nimport type { PropType, PublicProps } from \"vue\"\n\nimport { useDirectionAround } from \"./direction-context.ts\"\nimport { controller, optional, partComponent } from \"./runtime.ts\"\nimport type { Changes, PartComponentProps, PartGiven, PartInstance, StatesOf } from \"./runtime.ts\"\nimport { TOGGLE_GROUP, TOOLBAR } from \"./toolbar-context.ts\"\n\nexport type ToggleGroupProps<Value = unknown> = Omit<CoreProps<Value>, \"onValueChange\"> &\n PartComponentProps\n\nexport type ToggleGroupEmits<Value = unknown> = Changes<\"value\", Value[]>\n\n/** `v-model:value` (a list). Each `Toggle` with a `value` inside it is one of its toggles. */\nexport const ToggleGroup = defineComponent({\n name: \"ToggleGroup\",\n inheritAttrs: false,\n props: {\n value: optional(Array as PropType<readonly unknown[]>),\n defaultValue: Array as PropType<readonly unknown[]>,\n multiple: Boolean,\n disabled: Boolean,\n orientation: String as PropType<Orientation>,\n loop: optional(Boolean),\n },\n emits: [\"update:value\", \"valueChange\"],\n setup(props, { attrs, slots, emit }) {\n const direction = useDirectionAround()\n const toolbar = inject(TOOLBAR, null) ?? undefined\n const made = controller(within(createToggleGroup, { direction, toolbar }), () => ({\n value: props.value,\n defaultValue: props.defaultValue,\n multiple: props.multiple,\n disabled: props.disabled,\n orientation: props.orientation,\n loop: props.loop,\n onValueChange(value: unknown[], details: ChangeDetails) {\n emit(\"valueChange\", value, details)\n if (!details.canceled) emit(\"update:value\", value)\n },\n }))\n provide(TOGGLE_GROUP, made)\n const Element = partComponent(\"ToggleGroupElement\", \"div\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as new <Value = unknown, As extends string = \"div\">(\n props: PartGiven<As, ToggleGroupProps<Value>, ToggleGroupEmits<Value>> & PublicProps\n) => PartInstance<\n As,\n ToggleGroupProps<Value>,\n ToggleGroupEmits<Value>,\n { state: StatesOf<\"toggleGroup\">[\"root\"] }\n>\n"],"mappings":";;;;;;;;AAkBA,MAAa,cAAc,gBAAgB;CACzC,MAAM;CACN,cAAc;CACd,OAAO;EACL,OAAO,SAAS,KAAqC;EACrD,cAAc;EACd,UAAU;EACV,UAAU;EACV,aAAa;EACb,MAAM,SAAS,OAAO;CACxB;CACA,OAAO,CAAC,gBAAgB,aAAa;CACrC,MAAM,OAAO,EAAE,OAAO,OAAO,QAAQ;EACnC,MAAM,YAAY,mBAAmB;EACrC,MAAM,UAAU,OAAO,SAAS,IAAI,KAAK,KAAA;EACzC,MAAM,OAAO,WAAW,OAAO,mBAAmB;GAAE;GAAW;EAAQ,CAAC,UAAU;GAChF,OAAO,MAAM;GACb,cAAc,MAAM;GACpB,UAAU,MAAM;GAChB,UAAU,MAAM;GAChB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,cAAc,OAAkB,SAAwB;IACtD,KAAK,eAAe,OAAO,OAAO;IAClC,IAAI,CAAC,QAAQ,UAAU,KAAK,gBAAgB,KAAK;GACnD;EACF,EAAE;EACF,QAAQ,cAAc,IAAI;EAC1B,MAAM,UAAU,cAAc,sBAAsB,aAAa,KAAK,IAAI;EAC1E,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC"}
|
package/src/toggle.d.ts
CHANGED
|
@@ -1,39 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Changes, PartComponent, PartComponentProps, StatesOf } from "./runtime.js";
|
|
2
|
+
import { ToggleProps as ToggleProps$1 } from "@kirana-ui/core/toggle";
|
|
3
|
+
export type ToggleProps = Omit<ToggleProps$1, "onPressedChange"> & PartComponentProps;
|
|
4
|
+
export type ToggleEmits = Changes<"pressed", boolean>;
|
|
2
5
|
/**
|
|
3
6
|
* `v-model:pressed`, or `pressed` with `@pressed-change="(pressed, details) => …"`. Inside a
|
|
4
7
|
* `ToggleGroup`, `value` makes it one of the group's toggles.
|
|
5
8
|
*/
|
|
6
|
-
export declare const Toggle:
|
|
7
|
-
pressed: {
|
|
8
|
-
type: BooleanConstructor;
|
|
9
|
-
default: undefined;
|
|
10
|
-
};
|
|
11
|
-
defaultPressed: BooleanConstructor;
|
|
12
|
-
disabled: BooleanConstructor;
|
|
13
|
-
value: {
|
|
14
|
-
type: PropType<unknown>;
|
|
15
|
-
default: unknown;
|
|
16
|
-
};
|
|
17
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("pressedChange" | "update:pressed")[], "pressedChange" | "update:pressed", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
-
pressed: {
|
|
21
|
-
type: BooleanConstructor;
|
|
22
|
-
default: undefined;
|
|
23
|
-
};
|
|
24
|
-
defaultPressed: BooleanConstructor;
|
|
25
|
-
disabled: BooleanConstructor;
|
|
26
|
-
value: {
|
|
27
|
-
type: PropType<unknown>;
|
|
28
|
-
default: unknown;
|
|
29
|
-
};
|
|
30
|
-
}>> & Readonly<{
|
|
31
|
-
onPressedChange?: ((...args: any[]) => any) | undefined;
|
|
32
|
-
"onUpdate:pressed"?: ((...args: any[]) => any) | undefined;
|
|
33
|
-
}>, {
|
|
34
|
-
pressed: boolean;
|
|
35
|
-
defaultPressed: boolean;
|
|
36
|
-
disabled: boolean;
|
|
37
|
-
value: unknown;
|
|
38
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export declare const Toggle: PartComponent<"button", StatesOf<"toggle">["root"], ToggleProps, ToggleEmits>;
|
|
39
10
|
//# sourceMappingURL=toggle.d.ts.map
|
package/src/toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","names":[],"sources":["../../../../packages/vue/src/toggle.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createToggle } from \"@kirana-ui/core/toggle\"\nimport { defineComponent, h, inject } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport { controller, optional, partComponent } from \"./runtime.ts\"\nimport { TOGGLE_GROUP, TOOLBAR } from \"./toolbar-context.ts\"\n\n/**\n * `v-model:pressed`, or `pressed` with `@pressed-change=\"(pressed, details) => …\"`. Inside a\n * `ToggleGroup`, `value` makes it one of the group's toggles.\n */\nexport const Toggle = defineComponent({\n name: \"Toggle\",\n inheritAttrs: false,\n props: {\n pressed: optional(Boolean),\n defaultPressed: Boolean,\n disabled: Boolean,\n value: { type: null as unknown as PropType<unknown>, default: undefined as unknown },\n },\n emits: [\"update:pressed\", \"pressedChange\"],\n setup(props, { attrs, slots, emit }) {\n const group = inject(TOGGLE_GROUP, null) ?? undefined\n const toolbar = inject(TOOLBAR, null) ?? undefined\n const made = controller(within(createToggle, { group, toolbar }), () => ({\n pressed: props.pressed,\n defaultPressed: props.defaultPressed,\n disabled: props.disabled,\n value: props.value,\n onPressedChange(pressed: boolean, details: ChangeDetails) {\n emit(\"pressedChange\", pressed, details)\n if (!details.canceled) emit(\"update:pressed\", pressed)\n },\n }))\n const Element = partComponent(\"ToggleElement\", \"button\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n})\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toggle.js","names":[],"sources":["../../../../packages/vue/src/toggle.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createToggle } from \"@kirana-ui/core/toggle\"\nimport type { ToggleProps as CoreProps } from \"@kirana-ui/core/toggle\"\nimport { defineComponent, h, inject } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport { controller, optional, partComponent } from \"./runtime.ts\"\nimport type { Changes, PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\nimport { TOGGLE_GROUP, TOOLBAR } from \"./toolbar-context.ts\"\n\nexport type ToggleProps = Omit<CoreProps, \"onPressedChange\"> & PartComponentProps\n\nexport type ToggleEmits = Changes<\"pressed\", boolean>\n\n/**\n * `v-model:pressed`, or `pressed` with `@pressed-change=\"(pressed, details) => …\"`. Inside a\n * `ToggleGroup`, `value` makes it one of the group's toggles.\n */\nexport const Toggle = defineComponent({\n name: \"Toggle\",\n inheritAttrs: false,\n props: {\n pressed: optional(Boolean),\n defaultPressed: Boolean,\n disabled: Boolean,\n value: { type: null as unknown as PropType<unknown>, default: undefined as unknown },\n },\n emits: [\"update:pressed\", \"pressedChange\"],\n setup(props, { attrs, slots, emit }) {\n const group = inject(TOGGLE_GROUP, null) ?? undefined\n const toolbar = inject(TOOLBAR, null) ?? undefined\n const made = controller(within(createToggle, { group, toolbar }), () => ({\n pressed: props.pressed,\n defaultPressed: props.defaultPressed,\n disabled: props.disabled,\n value: props.value,\n onPressedChange(pressed: boolean, details: ChangeDetails) {\n emit(\"pressedChange\", pressed, details)\n if (!details.canceled) emit(\"update:pressed\", pressed)\n },\n }))\n const Element = partComponent(\"ToggleElement\", \"button\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"button\", StatesOf<\"toggle\">[\"root\"], ToggleProps, ToggleEmits>\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,SAAS,gBAAgB;CACpC,MAAM;CACN,cAAc;CACd,OAAO;EACL,SAAS,SAAS,OAAO;EACzB,gBAAgB;EAChB,UAAU;EACV,OAAO;GAAE,MAAM;GAAsC,SAAS,KAAA;EAAqB;CACrF;CACA,OAAO,CAAC,kBAAkB,eAAe;CACzC,MAAM,OAAO,EAAE,OAAO,OAAO,QAAQ;EACnC,MAAM,QAAQ,OAAO,cAAc,IAAI,KAAK,KAAA;EAC5C,MAAM,UAAU,OAAO,SAAS,IAAI,KAAK,KAAA;EACzC,MAAM,OAAO,WAAW,OAAO,cAAc;GAAE;GAAO;EAAQ,CAAC,UAAU;GACvE,SAAS,MAAM;GACf,gBAAgB,MAAM;GACtB,UAAU,MAAM;GAChB,OAAO,MAAM;GACb,gBAAgB,SAAkB,SAAwB;IACxD,KAAK,iBAAiB,SAAS,OAAO;IACtC,IAAI,CAAC,QAAQ,UAAU,KAAK,kBAAkB,OAAO;GACvD;EACF,EAAE;EACF,MAAM,UAAU,cAAc,iBAAiB,gBAAgB,KAAK,IAAI;EACxE,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC"}
|
package/src/toolbar.d.ts
CHANGED
|
@@ -1,72 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PartComponent, PartComponentProps } from "./runtime.js";
|
|
2
|
+
import { ToolbarItemOptions, ToolbarProps } from "@kirana-ui/core/toolbar";
|
|
3
|
+
export interface RootProps extends ToolbarProps, PartComponentProps {}
|
|
4
|
+
export interface ButtonProps extends ToolbarItemOptions, PartComponentProps {}
|
|
5
|
+
export type InputProps = ButtonProps;
|
|
6
|
+
export type GroupProps = ButtonProps;
|
|
7
|
+
export type LinkProps = PartComponentProps;
|
|
8
|
+
export type SeparatorProps = PartComponentProps;
|
|
3
9
|
export declare const Toolbar: {
|
|
4
|
-
Root:
|
|
5
|
-
orientation
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
disabled
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
disabled
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
default: undefined;
|
|
28
|
-
};
|
|
29
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
|
-
disabled: {
|
|
33
|
-
type: BooleanConstructor;
|
|
34
|
-
default: undefined;
|
|
35
|
-
};
|
|
36
|
-
}>> & Readonly<{}>, {
|
|
37
|
-
disabled: boolean;
|
|
38
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
|
-
Link: import("vue").Component;
|
|
40
|
-
Input: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
41
|
-
disabled: {
|
|
42
|
-
type: BooleanConstructor;
|
|
43
|
-
default: undefined;
|
|
44
|
-
};
|
|
45
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
|
-
disabled: {
|
|
49
|
-
type: BooleanConstructor;
|
|
50
|
-
default: undefined;
|
|
51
|
-
};
|
|
52
|
-
}>> & Readonly<{}>, {
|
|
53
|
-
disabled: boolean;
|
|
54
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
55
|
-
Group: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
56
|
-
disabled: {
|
|
57
|
-
type: BooleanConstructor;
|
|
58
|
-
default: undefined;
|
|
59
|
-
};
|
|
60
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
|
-
disabled: {
|
|
64
|
-
type: BooleanConstructor;
|
|
65
|
-
default: undefined;
|
|
66
|
-
};
|
|
67
|
-
}>> & Readonly<{}>, {
|
|
68
|
-
disabled: boolean;
|
|
69
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
70
|
-
Separator: import("vue").Component;
|
|
10
|
+
Root: PartComponent<"div", {
|
|
11
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
12
|
+
readonly disabled?: true | undefined;
|
|
13
|
+
}, RootProps>;
|
|
14
|
+
Button: PartComponent<"button", {
|
|
15
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
16
|
+
readonly disabled?: true | undefined;
|
|
17
|
+
}, ButtonProps>;
|
|
18
|
+
Link: PartComponent<"a", {
|
|
19
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
20
|
+
readonly disabled?: true | undefined;
|
|
21
|
+
}, PartComponentProps, {}, unknown>;
|
|
22
|
+
Input: PartComponent<"input", {
|
|
23
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
24
|
+
readonly disabled?: true | undefined;
|
|
25
|
+
}, ButtonProps>;
|
|
26
|
+
Group: PartComponent<"div", {
|
|
27
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
28
|
+
readonly disabled?: true | undefined;
|
|
29
|
+
}, ButtonProps>;
|
|
30
|
+
Separator: PartComponent<"div", {
|
|
31
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
32
|
+
}, PartComponentProps, {}, unknown>;
|
|
71
33
|
};
|
|
72
34
|
//# sourceMappingURL=toolbar.d.ts.map
|
package/src/toolbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","names":[],"sources":["../../../../packages/vue/src/toolbar.ts"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport type { Orientation } from \"@kirana-ui/core\"\nimport { createToolbar } from \"@kirana-ui/core/toolbar\"\nimport type {
|
|
1
|
+
{"version":3,"file":"toolbar.js","names":[],"sources":["../../../../packages/vue/src/toolbar.ts"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport type { Orientation } from \"@kirana-ui/core\"\nimport { createToolbar } from \"@kirana-ui/core/toolbar\"\nimport type {\n Toolbar as Controller,\n ToolbarItemOptions,\n ToolbarProps,\n} from \"@kirana-ui/core/toolbar\"\nimport { defineComponent, h, inject, provide } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport { useDirectionAround } from \"./direction-context.ts\"\nimport { controller, optional, partComponent, toSignal } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\nimport { TOGGLE_GROUP, TOOLBAR } from \"./toolbar-context.ts\"\n\ntype State = StatesOf<\"toolbar\">\n\nfunction useToolbar(): Controller {\n const made = inject(TOOLBAR, null)\n if (!made) throw new Error(\"A Toolbar part must be inside <Toolbar.Root>\")\n return made\n}\n\nexport interface RootProps extends ToolbarProps, PartComponentProps {}\n\nconst Root = defineComponent({\n name: \"ToolbarRoot\",\n inheritAttrs: false,\n props: {\n orientation: String as PropType<Orientation>,\n loop: optional(Boolean),\n disabled: Boolean,\n },\n setup(props, { attrs, slots }) {\n const direction = useDirectionAround()\n const made = controller(within(createToolbar, { direction }), () => ({\n orientation: props.orientation,\n loop: props.loop,\n disabled: props.disabled,\n }))\n provide(TOOLBAR, made)\n // A toggle group around the toolbar is not the group of the toolbar's toggles.\n provide(TOGGLE_GROUP, null)\n const Element = partComponent(\"ToolbarRootElement\", \"div\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"div\", State[\"root\"], RootProps>\n\nexport interface ButtonProps extends ToolbarItemOptions, PartComponentProps {}\nexport type InputProps = ButtonProps\nexport type GroupProps = ButtonProps\nexport type LinkProps = PartComponentProps\nexport type SeparatorProps = PartComponentProps\n\nconst item = <Item extends \"button\" | \"input\" | \"group\", Tag extends string>(\n name: Item,\n label: string,\n tag: Tag\n) =>\n defineComponent({\n name: `Toolbar${label}`,\n inheritAttrs: false,\n props: { disabled: optional(Boolean) },\n setup(props, { attrs, slots }) {\n const options = toSignal(() => ({ disabled: props.disabled }))\n const part = useToolbar()[name](() => defined(options.get()))\n const Element = partComponent<string>(`Toolbar${label}Element`, tag, () => part)\n return () => h(Element, attrs, slots)\n },\n }) as unknown as PartComponent<Tag, State[Item], ButtonProps>\n\nexport const Toolbar = {\n Root,\n Button: item(\"button\", \"Button\", \"button\"),\n Link: partComponent<\"a\", State[\"link\"]>(\"ToolbarLink\", \"a\", () => useToolbar().link()),\n Input: item(\"input\", \"Input\", \"input\"),\n Group: item(\"group\", \"Group\", \"div\"),\n Separator: partComponent<\"div\", State[\"separator\"]>(\n \"ToolbarSeparator\",\n \"div\",\n () => useToolbar().separator\n ),\n}\n"],"mappings":";;;;;;;AAkBA,SAAS,aAAyB;CAChC,MAAM,OAAO,OAAO,SAAS,IAAI;CACjC,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,8CAA8C;CACzE,OAAO;AACT;AAIA,MAAM,OAAO,gBAAgB;CAC3B,MAAM;CACN,cAAc;CACd,OAAO;EACL,aAAa;EACb,MAAM,SAAS,OAAO;EACtB,UAAU;CACZ;CACA,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,MAAM,YAAY,mBAAmB;EACrC,MAAM,OAAO,WAAW,OAAO,eAAe,EAAE,UAAU,CAAC,UAAU;GACnE,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,UAAU,MAAM;EAClB,EAAE;EACF,QAAQ,SAAS,IAAI;EAErB,QAAQ,cAAc,IAAI;EAC1B,MAAM,UAAU,cAAc,sBAAsB,aAAa,KAAK,IAAI;EAC1E,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC;AAQD,MAAM,QACJ,MACA,OACA,QAEA,gBAAgB;CACd,MAAM,UAAU;CAChB,cAAc;CACd,OAAO,EAAE,UAAU,SAAS,OAAO,EAAE;CACrC,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,MAAM,UAAU,gBAAgB,EAAE,UAAU,MAAM,SAAS,EAAE;EAC7D,MAAM,OAAO,WAAW,CAAC,CAAC,KAAK,OAAO,QAAQ,QAAQ,IAAI,CAAC,CAAC;EAC5D,MAAM,UAAU,cAAsB,UAAU,MAAM,UAAU,WAAW,IAAI;EAC/E,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC;AAEH,MAAa,UAAU;CACrB;CACA,QAAQ,KAAK,UAAU,UAAU,QAAQ;CACzC,MAAM,cAAkC,eAAe,WAAW,WAAW,CAAC,CAAC,KAAK,CAAC;CACrF,OAAO,KAAK,SAAS,SAAS,OAAO;CACrC,OAAO,KAAK,SAAS,SAAS,KAAK;CACnC,WAAW,cACT,oBACA,aACM,WAAW,CAAC,CAAC,SACrB;AACF"}
|
package/src/tooltip.d.ts
CHANGED
|
@@ -1,46 +1,32 @@
|
|
|
1
|
+
import { ArrowProps, PopupProps, RootEmits, RootProps, TriggerProps, hoverPopup } from "./hover-popup.js";
|
|
2
|
+
import { PartComponent, PartComponentProps, PlainComponent, PortalProps } from "./runtime.js";
|
|
3
|
+
import { PositionerProps } from "./popover.js";
|
|
1
4
|
export declare const Tooltip: {
|
|
2
|
-
Root:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
delay
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}>, {
|
|
28
|
-
open: boolean;
|
|
29
|
-
defaultOpen: boolean;
|
|
30
|
-
disabled: boolean;
|
|
31
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
32
|
-
Trigger: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
33
|
-
delay: NumberConstructor;
|
|
34
|
-
closeDelay: NumberConstructor;
|
|
35
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
-
delay: NumberConstructor;
|
|
39
|
-
closeDelay: NumberConstructor;
|
|
40
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
41
|
-
Portal: import("vue").Component;
|
|
42
|
-
Positioner: import("vue").Component;
|
|
43
|
-
Popup: import("vue").Component;
|
|
44
|
-
Arrow: import("vue").Component;
|
|
5
|
+
Root: PlainComponent<RootProps, RootEmits>;
|
|
6
|
+
Trigger: PartComponent<"button", {
|
|
7
|
+
readonly popupOpen?: true | undefined;
|
|
8
|
+
}, TriggerProps>;
|
|
9
|
+
Portal: PlainComponent<PortalProps, {}, {}>;
|
|
10
|
+
Positioner: PartComponent<"div", {
|
|
11
|
+
readonly open?: true | undefined;
|
|
12
|
+
readonly closed?: true | undefined;
|
|
13
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "right" | "top" | undefined;
|
|
14
|
+
readonly align?: "center" | "end" | "start" | undefined;
|
|
15
|
+
}, PositionerProps>;
|
|
16
|
+
Popup: PartComponent<"div", {
|
|
17
|
+
readonly open?: true | undefined;
|
|
18
|
+
readonly closed?: true | undefined;
|
|
19
|
+
readonly startingStyle?: true | undefined;
|
|
20
|
+
readonly endingStyle?: true | undefined;
|
|
21
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "right" | "top" | undefined;
|
|
22
|
+
readonly align?: "center" | "end" | "start" | undefined;
|
|
23
|
+
readonly instant?: "delay" | "dismiss" | "focus" | undefined;
|
|
24
|
+
}, PartComponentProps, {}, unknown>;
|
|
25
|
+
Arrow: PartComponent<"div", {
|
|
26
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "right" | "top" | undefined;
|
|
27
|
+
readonly align?: "center" | "end" | "start" | undefined;
|
|
28
|
+
readonly uncentered?: true | undefined;
|
|
29
|
+
}, PartComponentProps, {}, unknown>;
|
|
45
30
|
};
|
|
31
|
+
export type { ArrowProps, PopupProps, PortalProps, PositionerProps, RootEmits, RootProps, TriggerProps, hoverPopup };
|
|
46
32
|
//# sourceMappingURL=tooltip.d.ts.map
|
package/src/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../../packages/vue/src/tooltip.ts"],"sourcesContent":["import { createTooltip } from \"@kirana-ui/core/tooltip\"\n\nimport { hoverPopup } from \"./hover-popup.ts\"\n\nexport const Tooltip = hoverPopup(\"Tooltip\", createTooltip, \"button\")\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../../packages/vue/src/tooltip.ts"],"sourcesContent":["import { createTooltip } from \"@kirana-ui/core/tooltip\"\n\nimport { hoverPopup } from \"./hover-popup.ts\"\nimport type { StatesOf } from \"./runtime.ts\"\n\nexport type * from \"./hover-popup.ts\"\n\nexport const Tooltip = hoverPopup<StatesOf<\"tooltip\">, \"button\">(\"Tooltip\", createTooltip, \"button\")\n"],"mappings":";;;AAOA,MAAa,UAAU,WAA0C,WAAW,eAAe,QAAQ"}
|