@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/fieldset.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PartComponent, PartComponentProps } from "./runtime.js";
|
|
2
|
+
import { Fieldset as Fieldset$1, FieldsetProps } from "@kirana-ui/core/fieldset";
|
|
2
3
|
/** The fieldset a field is in, if it is in one. */
|
|
3
4
|
export declare const useFieldset: () => Fieldset$1 | undefined;
|
|
5
|
+
export type RootProps = Omit<FieldsetProps, "id"> & {
|
|
6
|
+
id?: string | undefined;
|
|
7
|
+
} & PartComponentProps;
|
|
8
|
+
export type LegendProps = PartComponentProps;
|
|
4
9
|
export declare const Fieldset: {
|
|
5
|
-
Root:
|
|
6
|
-
disabled
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
disabled: BooleanConstructor;
|
|
12
|
-
id: StringConstructor;
|
|
13
|
-
}>> & Readonly<{}>, {
|
|
14
|
-
disabled: boolean;
|
|
15
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
-
Legend: import("vue").Component;
|
|
10
|
+
Root: PartComponent<"fieldset", {
|
|
11
|
+
readonly disabled?: true | undefined;
|
|
12
|
+
}, RootProps>;
|
|
13
|
+
Legend: PartComponent<"div", {
|
|
14
|
+
readonly disabled?: true | undefined;
|
|
15
|
+
}, PartComponentProps, {}, unknown>;
|
|
17
16
|
};
|
|
18
17
|
//# sourceMappingURL=fieldset.d.ts.map
|
package/src/fieldset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldset.js","names":[],"sources":["../../../../packages/vue/src/fieldset.ts"],"sourcesContent":["import { createFieldset } from \"@kirana-ui/core/fieldset\"\nimport type { Fieldset as Controller } from \"@kirana-ui/core/fieldset\"\nimport { defineComponent, h, inject, provide, useId } from \"vue\"\nimport type { InjectionKey } from \"vue\"\n\nimport { controller, partComponent } from \"./runtime.ts\"\n\nconst KEY: InjectionKey<Controller> = Symbol(\"Fieldset\")\n\n/** The fieldset a field is in, if it is in one. */\nexport const useFieldset = (): Controller | undefined => inject(KEY, undefined)\n\nfunction use(): Controller {\n const made = useFieldset()\n if (!made) throw new Error(\"A Fieldset part must be inside <Fieldset.Root>\")\n return made\n}\n\nconst RootElement = partComponent(\"FieldsetRootElement\", \"fieldset\", () => use().root)\n\nconst Root = defineComponent({\n name: \"FieldsetRoot\",\n inheritAttrs: false,\n props: { disabled: Boolean, id: String },\n setup(props, { attrs, slots }) {\n const generated = useId()\n provide(\n KEY,\n controller(createFieldset, () => ({ id: props.id ?? generated, disabled: props.disabled }))\n )\n return () => h(RootElement, attrs, slots)\n },\n})\n\nexport const Fieldset = {\n Root,\n Legend: partComponent(\"FieldsetLegend\", \"div\", () => use().legend),\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"fieldset.js","names":[],"sources":["../../../../packages/vue/src/fieldset.ts"],"sourcesContent":["import { createFieldset } from \"@kirana-ui/core/fieldset\"\nimport type { Fieldset as Controller, FieldsetProps } from \"@kirana-ui/core/fieldset\"\nimport { defineComponent, h, inject, provide, useId } from \"vue\"\nimport type { InjectionKey } from \"vue\"\n\nimport { controller, partComponent } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\n\ntype State = StatesOf<\"fieldset\">\n\nconst KEY: InjectionKey<Controller> = Symbol(\"Fieldset\")\n\n/** The fieldset a field is in, if it is in one. */\nexport const useFieldset = (): Controller | undefined => inject(KEY, undefined)\n\nfunction use(): Controller {\n const made = useFieldset()\n if (!made) throw new Error(\"A Fieldset part must be inside <Fieldset.Root>\")\n return made\n}\n\nconst RootElement = partComponent(\"FieldsetRootElement\", \"fieldset\", () => use().root)\n\nexport type RootProps = Omit<FieldsetProps, \"id\"> & {\n id?: string | undefined\n} & PartComponentProps\n\nconst Root = defineComponent({\n name: \"FieldsetRoot\",\n inheritAttrs: false,\n props: { disabled: Boolean, id: String },\n setup(props, { attrs, slots }) {\n const generated = useId()\n provide(\n KEY,\n controller(createFieldset, () => ({ id: props.id ?? generated, disabled: props.disabled }))\n )\n return () => h(RootElement, attrs, slots)\n },\n}) as unknown as PartComponent<\"fieldset\", State[\"root\"], RootProps>\n\nexport type LegendProps = PartComponentProps\nexport const Fieldset = {\n Root,\n Legend: partComponent<\"div\", State[\"legend\"]>(\"FieldsetLegend\", \"div\", () => use().legend),\n}\n"],"mappings":";;;;AAUA,MAAM,MAAgC,OAAO,UAAU;;AAGvD,MAAa,oBAA4C,OAAO,KAAK,KAAA,CAAS;AAE9E,SAAS,MAAkB;CACzB,MAAM,OAAO,YAAY;CACzB,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,gDAAgD;CAC3E,OAAO;AACT;AAEA,MAAM,cAAc,cAAc,uBAAuB,kBAAkB,IAAI,CAAC,CAAC,IAAI;AAqBrF,MAAa,WAAW;CACtB,MAhBW,gBAAgB;EAC3B,MAAM;EACN,cAAc;EACd,OAAO;GAAE,UAAU;GAAS,IAAI;EAAO;EACvC,MAAM,OAAO,EAAE,OAAO,SAAS;GAC7B,MAAM,YAAY,MAAM;GACxB,QACE,KACA,WAAW,uBAAuB;IAAE,IAAI,MAAM,MAAM;IAAW,UAAU,MAAM;GAAS,EAAE,CAC5F;GACA,aAAa,EAAE,aAAa,OAAO,KAAK;EAC1C;CACF,CAIE;CACA,QAAQ,cAAsC,kBAAkB,aAAa,IAAI,CAAC,CAAC,MAAM;AAC3F"}
|
package/src/form.d.ts
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Form as Form$1, FormProps } from "@kirana-ui/core/form";
|
|
1
|
+
import { PartComponent, PartComponentProps, StatesOf } from "./runtime.js";
|
|
2
|
+
import { Form as Form$1, FormProps as FormProps$1 } from "@kirana-ui/core/form";
|
|
3
3
|
/** The form a field is in, if it is in one. */
|
|
4
4
|
export declare const useForm: () => Form$1 | undefined;
|
|
5
|
+
/** `onFormSubmit` and `onClearErrors` are heard as `@form-submit` and `@clear-errors`. */
|
|
6
|
+
export interface FormProps extends FormProps$1, PartComponentProps {}
|
|
5
7
|
/**
|
|
6
8
|
* A `<form>` whose fields say what is wrong; `@form-submit="(values, details) => …"` takes the
|
|
7
9
|
* values once all are valid, and `@clear-errors` what is left of `errors`.
|
|
8
10
|
*/
|
|
9
|
-
export declare const Form:
|
|
10
|
-
errors: PropType<FormProps["errors"]>;
|
|
11
|
-
validationMode: PropType<FormProps["validationMode"]>;
|
|
12
|
-
onFormSubmit: PropType<FormProps["onFormSubmit"]>;
|
|
13
|
-
onClearErrors: PropType<FormProps["onClearErrors"]>;
|
|
14
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
-
errors: PropType<FormProps["errors"]>;
|
|
18
|
-
validationMode: PropType<FormProps["validationMode"]>;
|
|
19
|
-
onFormSubmit: PropType<FormProps["onFormSubmit"]>;
|
|
20
|
-
onClearErrors: PropType<FormProps["onClearErrors"]>;
|
|
21
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export declare const Form: PartComponent<"form", StatesOf<"form">["root"], FormProps>;
|
|
22
12
|
//# sourceMappingURL=form.d.ts.map
|
package/src/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":[],"sources":["../../../../packages/vue/src/form.ts"],"sourcesContent":["import { createForm } from \"@kirana-ui/core/form\"\nimport type { Form as Controller, FormProps } from \"@kirana-ui/core/form\"\nimport { defineComponent, h, inject, provide } from \"vue\"\nimport type { InjectionKey, PropType } from \"vue\"\n\nimport { controller, partComponent } from \"./runtime.ts\"\n\nconst KEY: InjectionKey<Controller> = Symbol(\"Form\")\n\n/** The form a field is in, if it is in one. */\nexport const useForm = (): Controller | undefined => inject(KEY, undefined)\n\nconst Element = partComponent(\"FormElement\", \"form\", () => useForm()!.root)\n\n/**\n * A `<form>` whose fields say what is wrong; `@form-submit=\"(values, details) => …\"` takes the\n * values once all are valid, and `@clear-errors` what is left of `errors`.\n */\nexport const Form = defineComponent({\n name: \"Form\",\n inheritAttrs: false,\n props: {\n errors: Object as PropType<
|
|
1
|
+
{"version":3,"file":"form.js","names":[],"sources":["../../../../packages/vue/src/form.ts"],"sourcesContent":["import { createForm } from \"@kirana-ui/core/form\"\nimport type { Form as Controller, FormProps as CoreProps } from \"@kirana-ui/core/form\"\nimport { defineComponent, h, inject, provide } from \"vue\"\nimport type { InjectionKey, PropType } from \"vue\"\n\nimport { controller, partComponent } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\n\nconst KEY: InjectionKey<Controller> = Symbol(\"Form\")\n\n/** The form a field is in, if it is in one. */\nexport const useForm = (): Controller | undefined => inject(KEY, undefined)\n\nconst Element = partComponent(\"FormElement\", \"form\", () => useForm()!.root)\n\n/** `onFormSubmit` and `onClearErrors` are heard as `@form-submit` and `@clear-errors`. */\nexport interface FormProps extends CoreProps, PartComponentProps {}\n\n/**\n * A `<form>` whose fields say what is wrong; `@form-submit=\"(values, details) => …\"` takes the\n * values once all are valid, and `@clear-errors` what is left of `errors`.\n */\nexport const Form = defineComponent({\n name: \"Form\",\n inheritAttrs: false,\n props: {\n errors: Object as PropType<CoreProps[\"errors\"]>,\n validationMode: String as PropType<CoreProps[\"validationMode\"]>,\n // Listeners as props, so the form knows whether anyone takes the values.\n onFormSubmit: Function as PropType<CoreProps[\"onFormSubmit\"]>,\n onClearErrors: Function as PropType<CoreProps[\"onClearErrors\"]>,\n },\n setup(props, { attrs, slots }) {\n provide(\n KEY,\n controller(createForm, () => ({ ...props }))\n )\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"form\", StatesOf<\"form\">[\"root\"], FormProps>\n"],"mappings":";;;;AAQA,MAAM,MAAgC,OAAO,MAAM;;AAGnD,MAAa,gBAAwC,OAAO,KAAK,KAAA,CAAS;AAE1E,MAAM,UAAU,cAAc,eAAe,cAAc,QAAQ,CAAC,CAAE,IAAI;;;;;AAS1E,MAAa,OAAO,gBAAgB;CAClC,MAAM;CACN,cAAc;CACd,OAAO;EACL,QAAQ;EACR,gBAAgB;EAEhB,cAAc;EACd,eAAe;CACjB;CACA,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,QACE,KACA,WAAW,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAC7C;EACA,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC"}
|
package/src/hover-card.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 HoverCard: {
|
|
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<"a", {
|
|
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=hover-card.d.ts.map
|
package/src/hover-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.js","names":[],"sources":["../../../../packages/vue/src/hover-card.ts"],"sourcesContent":["import { createHoverCard } from \"@kirana-ui/core/hover-card\"\n\nimport { hoverPopup } from \"./hover-popup.ts\"\n\nexport const HoverCard = hoverPopup(\"HoverCard\", createHoverCard, \"a\")\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"hover-card.js","names":[],"sources":["../../../../packages/vue/src/hover-card.ts"],"sourcesContent":["import { createHoverCard } from \"@kirana-ui/core/hover-card\"\n\nimport { hoverPopup } from \"./hover-popup.ts\"\nimport type { StatesOf } from \"./runtime.ts\"\n\nexport type * from \"./hover-popup.ts\"\n\nexport const HoverCard = hoverPopup<StatesOf<\"hoverCard\">, \"a\">(\"HoverCard\", createHoverCard, \"a\")\n"],"mappings":";;;AAOA,MAAa,YAAY,WAAuC,aAAa,iBAAiB,GAAG"}
|
package/src/hover-popup.d.ts
CHANGED
|
@@ -1,49 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Changes, PartComponent, PartComponentProps, PlainComponent, PortalProps } from "./runtime.js";
|
|
2
|
+
import { PositionerProps } from "./popover.js";
|
|
3
|
+
import { PartState, ReadonlySignal } from "@kirana-ui/core";
|
|
2
4
|
import { HoverPopup, HoverPopupProps } from "@kirana-ui/core/tooltip";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Root: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
-
open: {
|
|
7
|
-
type: BooleanConstructor;
|
|
8
|
-
default: undefined;
|
|
9
|
-
};
|
|
10
|
-
defaultOpen: BooleanConstructor;
|
|
11
|
-
delay: NumberConstructor;
|
|
12
|
-
closeDelay: NumberConstructor;
|
|
13
|
-
disabled: BooleanConstructor;
|
|
14
|
-
id: StringConstructor;
|
|
15
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("openChange" | "update:open")[], "openChange" | "update:open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
-
open: {
|
|
19
|
-
type: BooleanConstructor;
|
|
20
|
-
default: undefined;
|
|
21
|
-
};
|
|
22
|
-
defaultOpen: BooleanConstructor;
|
|
23
|
-
delay: NumberConstructor;
|
|
24
|
-
closeDelay: NumberConstructor;
|
|
25
|
-
disabled: BooleanConstructor;
|
|
26
|
-
id: StringConstructor;
|
|
27
|
-
}>> & Readonly<{
|
|
28
|
-
onOpenChange?: ((...args: any[]) => any) | undefined;
|
|
29
|
-
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
30
|
-
}>, {
|
|
31
|
-
open: boolean;
|
|
32
|
-
defaultOpen: boolean;
|
|
33
|
-
disabled: boolean;
|
|
34
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
|
-
Trigger: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
36
|
-
delay: NumberConstructor;
|
|
37
|
-
closeDelay: NumberConstructor;
|
|
38
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
39
|
-
[key: string]: any;
|
|
40
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
41
|
-
delay: NumberConstructor;
|
|
42
|
-
closeDelay: NumberConstructor;
|
|
43
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
44
|
-
Portal: import("vue").Component;
|
|
45
|
-
Positioner: import("vue").Component;
|
|
46
|
-
Popup: import("vue").Component;
|
|
47
|
-
Arrow: import("vue").Component;
|
|
5
|
+
export type RootProps = Omit<HoverPopupProps, "id" | "onOpenChange"> & {
|
|
6
|
+
id?: string | undefined;
|
|
48
7
|
};
|
|
8
|
+
export type RootEmits = Changes<"open", boolean>;
|
|
9
|
+
export interface TriggerProps extends PartComponentProps {
|
|
10
|
+
/** How long the pointer rests on this trigger before the popup opens: before the root's. */
|
|
11
|
+
delay?: number | undefined;
|
|
12
|
+
/** How long after the pointer leaves the popup closes: before the root's. */
|
|
13
|
+
closeDelay?: number | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type PopupProps = PartComponentProps;
|
|
16
|
+
export type ArrowProps = PartComponentProps;
|
|
17
|
+
/**
|
|
18
|
+
* The parts of a popup the pointer opens: a tooltip's, a hover card's. `States` is the state
|
|
19
|
+
* of each (`StatesOf<"tooltip">`), `Tag` the trigger's element.
|
|
20
|
+
*/
|
|
21
|
+
export declare function hoverPopup<States extends Record<"trigger" | "positioner" | "popup" | "arrow", PartState>, Tag extends string>(name: string, create: (props: ReadonlySignal<HoverPopupProps>) => HoverPopup, triggerTag: Tag): {
|
|
22
|
+
Root: PlainComponent<RootProps, RootEmits>;
|
|
23
|
+
Trigger: PartComponent<Tag, States["trigger"], TriggerProps>;
|
|
24
|
+
Portal: PlainComponent<PortalProps, {}, {}>;
|
|
25
|
+
Positioner: PartComponent<"div", States["positioner"], PositionerProps>;
|
|
26
|
+
Popup: PartComponent<"div", States["popup"], PartComponentProps, {}, unknown>;
|
|
27
|
+
Arrow: PartComponent<"div", States["arrow"], PartComponentProps, {}, unknown>;
|
|
28
|
+
};
|
|
29
|
+
export type { PortalProps, PositionerProps };
|
|
49
30
|
//# sourceMappingURL=hover-popup.d.ts.map
|
package/src/hover-popup.js
CHANGED
|
@@ -3,7 +3,10 @@ import { context, controller, optional, partComponent, portalComponent } from ".
|
|
|
3
3
|
import { defined } from "@kirana-ui/core";
|
|
4
4
|
import { defineComponent, h, useId, watchEffect } from "vue";
|
|
5
5
|
// src/hover-popup.ts
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The parts of a popup the pointer opens: a tooltip's, a hover card's. `States` is the state
|
|
8
|
+
* of each (`StatesOf<"tooltip">`), `Tag` the trigger's element.
|
|
9
|
+
*/
|
|
7
10
|
function hoverPopup(name, create, triggerTag) {
|
|
8
11
|
const scope = context(name);
|
|
9
12
|
/** `v-model:open`, or `open` with `@open-change="(open, details) => …"`. */
|
package/src/hover-popup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-popup.js","names":[],"sources":["../../../../packages/vue/src/hover-popup.ts"],"sourcesContent":["import type { ChangeDetails, ReadonlySignal } from \"@kirana-ui/core\"\nimport type { HoverPopup, HoverPopupProps } from \"@kirana-ui/core/tooltip\"\nimport { defined } from \"@kirana-ui/core\"\nimport { defineComponent, h, useId, watchEffect } from \"vue\"\n\nimport { positionerComponent } from \"./popover.ts\"\nimport { context, controller, optional, partComponent, portalComponent } from \"./runtime.ts\"\n\n/** The parts of a popup the pointer opens: a tooltip's, a hover card's. */\nexport function hoverPopup
|
|
1
|
+
{"version":3,"file":"hover-popup.js","names":[],"sources":["../../../../packages/vue/src/hover-popup.ts"],"sourcesContent":["import type { ChangeDetails, PartState, ReadonlySignal } from \"@kirana-ui/core\"\nimport type { HoverPopup, HoverPopupProps } from \"@kirana-ui/core/tooltip\"\nimport { defined } from \"@kirana-ui/core\"\nimport { defineComponent, h, useId, watchEffect } from \"vue\"\n\nimport { positionerComponent } from \"./popover.ts\"\nimport { context, controller, optional, partComponent, portalComponent } from \"./runtime.ts\"\nimport type { Changes, PartComponent, PartComponentProps, PlainComponent } from \"./runtime.ts\"\n\nexport type { PositionerProps } from \"./popover.ts\"\n\nexport type { PortalProps } from \"./runtime.ts\"\n\nexport type RootProps = Omit<HoverPopupProps, \"id\" | \"onOpenChange\"> & { id?: string | undefined }\n\nexport type RootEmits = Changes<\"open\", boolean>\n\nexport interface TriggerProps extends PartComponentProps {\n /** How long the pointer rests on this trigger before the popup opens: before the root's. */\n delay?: number | undefined\n /** How long after the pointer leaves the popup closes: before the root's. */\n closeDelay?: number | undefined\n}\n\nexport type PopupProps = PartComponentProps\nexport type ArrowProps = PartComponentProps\n\n/**\n * The parts of a popup the pointer opens: a tooltip's, a hover card's. `States` is the state\n * of each (`StatesOf<\"tooltip\">`), `Tag` the trigger's element.\n */\nexport function hoverPopup<\n States extends Record<\"trigger\" | \"positioner\" | \"popup\" | \"arrow\", PartState>,\n Tag extends string,\n>(name: string, create: (props: ReadonlySignal<HoverPopupProps>) => HoverPopup, triggerTag: Tag) {\n const scope = context<HoverPopup>(name)\n\n /** `v-model:open`, or `open` with `@open-change=\"(open, details) => …\"`. */\n const Root = defineComponent({\n name: `${name}Root`,\n props: {\n open: optional(Boolean),\n defaultOpen: Boolean,\n delay: Number,\n closeDelay: Number,\n disabled: Boolean,\n id: String,\n },\n emits: [\"update:open\", \"openChange\"],\n setup(props, { slots, emit }) {\n const generated = useId()\n scope.provide(\n controller(create, () => ({\n id: props.id ?? generated,\n open: props.open,\n defaultOpen: props.defaultOpen,\n delay: props.delay,\n closeDelay: props.closeDelay,\n disabled: props.disabled,\n onOpenChange(open: boolean, details: ChangeDetails) {\n emit(\"openChange\", open, details)\n if (!details.canceled) emit(\"update:open\", open)\n },\n }))\n )\n return () => slots.default?.()\n },\n }) as unknown as PlainComponent<RootProps, RootEmits>\n\n const TriggerElement = partComponent<string>(\n `${name}TriggerElement`,\n triggerTag,\n () => scope.use().trigger\n )\n\n /** `delay` and `close-delay` here come before the root's. */\n const Trigger = defineComponent({\n name: `${name}Trigger`,\n inheritAttrs: false,\n props: { delay: Number, closeDelay: Number },\n setup(props, { attrs, slots }) {\n const { timing } = scope.use()\n watchEffect(() => timing.set(defined({ ...props })), { flush: \"sync\" })\n return () => h(TriggerElement, attrs, slots)\n },\n }) as unknown as PartComponent<Tag, States[\"trigger\"], TriggerProps>\n\n return {\n Root,\n Trigger,\n Portal: portalComponent(`${name}Portal`, () => scope.use().mounted),\n Positioner: positionerComponent<States[\"positioner\"]>(\n `${name}Positioner`,\n () => scope.use(),\n partComponent(`${name}PositionerElement`, \"div\", () => scope.use().positioner)\n ),\n Popup: partComponent<\"div\", States[\"popup\"]>(`${name}Popup`, \"div\", () => scope.use().popup),\n Arrow: partComponent<\"div\", States[\"arrow\"]>(`${name}Arrow`, \"div\", () => scope.use().arrow),\n }\n}\n"],"mappings":";;;;;;;;;AA+BA,SAAgB,WAGd,MAAc,QAAgE,YAAiB;CAC/F,MAAM,QAAQ,QAAoB,IAAI;;CAGtC,MAAM,OAAO,gBAAgB;EAC3B,MAAM,GAAG,KAAK;EACd,OAAO;GACL,MAAM,SAAS,OAAO;GACtB,aAAa;GACb,OAAO;GACP,YAAY;GACZ,UAAU;GACV,IAAI;EACN;EACA,OAAO,CAAC,eAAe,YAAY;EACnC,MAAM,OAAO,EAAE,OAAO,QAAQ;GAC5B,MAAM,YAAY,MAAM;GACxB,MAAM,QACJ,WAAW,eAAe;IACxB,IAAI,MAAM,MAAM;IAChB,MAAM,MAAM;IACZ,aAAa,MAAM;IACnB,OAAO,MAAM;IACb,YAAY,MAAM;IAClB,UAAU,MAAM;IAChB,aAAa,MAAe,SAAwB;KAClD,KAAK,cAAc,MAAM,OAAO;KAChC,IAAI,CAAC,QAAQ,UAAU,KAAK,eAAe,IAAI;IACjD;GACF,EAAE,CACJ;GACA,aAAa,MAAM,UAAU;EAC/B;CACF,CAAC;CAED,MAAM,iBAAiB,cACrB,GAAG,KAAK,iBACR,kBACM,MAAM,IAAI,CAAC,CAAC,OACpB;CAcA,OAAO;EACL;EACA,SAbc,gBAAgB;GAC9B,MAAM,GAAG,KAAK;GACd,cAAc;GACd,OAAO;IAAE,OAAO;IAAQ,YAAY;GAAO;GAC3C,MAAM,OAAO,EAAE,OAAO,SAAS;IAC7B,MAAM,EAAE,WAAW,MAAM,IAAI;IAC7B,kBAAkB,OAAO,IAAI,QAAQ,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,OAAO,CAAC;IACtE,aAAa,EAAE,gBAAgB,OAAO,KAAK;GAC7C;EACF,CAIQ;EACN,QAAQ,gBAAgB,GAAG,KAAK,eAAe,MAAM,IAAI,CAAC,CAAC,OAAO;EAClE,YAAY,oBACV,GAAG,KAAK,mBACF,MAAM,IAAI,GAChB,cAAc,GAAG,KAAK,oBAAoB,aAAa,MAAM,IAAI,CAAC,CAAC,UAAU,CAC/E;EACA,OAAO,cAAsC,GAAG,KAAK,QAAQ,aAAa,MAAM,IAAI,CAAC,CAAC,KAAK;EAC3F,OAAO,cAAsC,GAAG,KAAK,QAAQ,aAAa,MAAM,IAAI,CAAC,CAAC,KAAK;CAC7F;AACF"}
|
package/src/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { Calendar } from "./calendar.js";
|
|
|
22
22
|
import { QrCode } from "./qr-code.js";
|
|
23
23
|
import { Autosize } from "./autosize.js";
|
|
24
24
|
import { Carousel } from "./carousel.js";
|
|
25
|
-
import { Toast, createToaster } from "./toast.js";
|
|
25
|
+
import { Toast, ToastActionOptions, ToastContent, ToastOptions, ToastRecord, ToastState, Toaster, ToasterOptions, createToaster } from "./toast.js";
|
|
26
26
|
import { Resizable } from "./resizable.js";
|
|
27
27
|
import { Popover } from "./popover.js";
|
|
28
28
|
import { RadioGroup } from "./radio-group.js";
|
|
@@ -44,5 +44,15 @@ import { Field } from "./field.js";
|
|
|
44
44
|
import { Fieldset } from "./fieldset.js";
|
|
45
45
|
import { Form } from "./form.js";
|
|
46
46
|
import { DirectionProvider, useDirection } from "./direction.js";
|
|
47
|
-
import { PortalProvider } from "./runtime.js";
|
|
48
|
-
|
|
47
|
+
import { PartEvent, PortalProvider } from "./runtime.js";
|
|
48
|
+
import { Align, Anchor, AnchorOption, Bindable, ChangeDetails, ChangeSource, ComponentDefinition, Direction, ItemLabels, ListCollection, Orientation, Part, PartDefinition, PartProps, PartState, PartStyle, PhysicalSide, PositionOptions, ReadonlySignal, Side, Signal, StateDefinition, StateOf } from "@kirana-ui/core";
|
|
49
|
+
import { DrawerSide, DrawerSnapPoint } from "@kirana-ui/core/drawer";
|
|
50
|
+
import { PaginationEntry } from "@kirana-ui/core/pagination";
|
|
51
|
+
import { DateFieldSegment, DateUnit } from "@kirana-ui/core/date-field";
|
|
52
|
+
import { CalendarDay, CalendarValue, CalendarWeekday, DateRange, IsoDate } from "@kirana-ui/core/calendar";
|
|
53
|
+
import { QrCorrection } from "@kirana-ui/core/qr-code";
|
|
54
|
+
import { SelectShown } from "@kirana-ui/core/select";
|
|
55
|
+
import { SliderChangeDetails, SliderTold } from "@kirana-ui/core/slider";
|
|
56
|
+
import { FieldValidity, ValidityKey } from "@kirana-ui/core/field";
|
|
57
|
+
import { FormErrors, FormValues, ValidationMode } from "@kirana-ui/core/form";
|
|
58
|
+
export { Accordion, AlertDialog, type Align, type Anchor, type AnchorOption, Autocomplete, Autosize, Avatar, type Bindable, Button, Calendar, type CalendarDay, type CalendarValue, type CalendarWeekday, Carousel, type ChangeDetails, type ChangeSource, Checkbox, Collapsible, Combobox, Command, type ComponentDefinition, ContextMenu, DateField, type DateFieldSegment, DatePicker, type DateRange, type DateUnit, Dialog, type Direction, DirectionProvider, Drawer, type DrawerSide, type DrawerSnapPoint, Field, type FieldValidity, Fieldset, Form, type FormErrors, type FormValues, HoverCard, Input, type IsoDate, type ItemLabels, Label, type ListCollection, Listbox, Menu, Menubar, MessageScroller, Meter, NavigationMenu, NumberField, type Orientation, Otp, Pagination, type PaginationEntry, type Part, type PartDefinition, type PartEvent, type PartProps, type PartState, type PartStyle, type PhysicalSide, Popover, PortalProvider, type PositionOptions, Progress, QrCode, type QrCorrection, RadioGroup, type ReadonlySignal, Resizable, ScrollArea, Select, type SelectShown, Separator, type Side, type Signal, Slider, type SliderChangeDetails, type SliderTold, type StateDefinition, type StateOf, Switch, Tabs, Toast, type ToastActionOptions, type ToastContent, type ToastOptions, type ToastRecord, type ToastState, type Toaster, type ToasterOptions, Toggle, ToggleGroup, Toolbar, Tooltip, type ValidationMode, type ValidityKey, createToaster, useDirection };
|
package/src/input.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
+
import { PartComponent, PartComponentProps, StatesOf } from "./runtime.js";
|
|
2
|
+
import { ChangeDetails } from "@kirana-ui/core";
|
|
3
|
+
export interface InputProps extends PartComponentProps {
|
|
4
|
+
/** The text: `v-model`. */
|
|
5
|
+
modelValue?: string | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
}
|
|
8
|
+
export type InputEmits = {
|
|
9
|
+
"update:modelValue": (value: string) => void;
|
|
10
|
+
valueChange: (value: string, details: ChangeDetails) => void;
|
|
11
|
+
};
|
|
1
12
|
/**
|
|
2
13
|
* An `<input>`; `as="textarea"` for a text area. It takes what an `<input>` takes, and
|
|
3
14
|
* `v-model`. Inside a `<Field.Root>` it is the field's control.
|
|
4
15
|
*/
|
|
5
|
-
export declare const Input:
|
|
6
|
-
modelValue: StringConstructor;
|
|
7
|
-
disabled: BooleanConstructor;
|
|
8
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "valueChange")[], "update:modelValue" | "valueChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
-
modelValue: StringConstructor;
|
|
12
|
-
disabled: BooleanConstructor;
|
|
13
|
-
}>> & Readonly<{
|
|
14
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
15
|
-
onValueChange?: ((...args: any[]) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
export declare const Input: PartComponent<"input", StatesOf<"input">["input"], InputProps, InputEmits>;
|
|
19
17
|
//# sourceMappingURL=input.d.ts.map
|
package/src/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":[],"sources":["../../../../packages/vue/src/input.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createInput } from \"@kirana-ui/core/input\"\nimport { defineComponent, h } from \"vue\"\n\nimport { useFieldAround } from \"./field-context.ts\"\nimport { controller, partComponent } from \"./runtime.ts\"\n\n/**\n * An `<input>`; `as=\"textarea\"` for a text area. It takes what an `<input>` takes, and\n * `v-model`. Inside a `<Field.Root>` it is the field's control.\n */\nexport const Input = defineComponent({\n name: \"Input\",\n inheritAttrs: false,\n props: { modelValue: String, disabled: Boolean },\n emits: [\"update:modelValue\", \"valueChange\"],\n setup(props, { attrs, slots, emit }) {\n const made = controller(within(createInput, { field: useFieldAround() }), () => ({\n disabled: props.disabled,\n onValueChange(value: string, details: ChangeDetails) {\n emit(\"valueChange\", value, details)\n emit(\"update:modelValue\", value)\n },\n }))\n const Element = partComponent(\"InputElement\", \"input\", () => made.input)\n return () =>\n h(\n Element,\n { ...attrs, ...(props.modelValue === undefined ? {} : { value: props.modelValue }) },\n slots\n )\n },\n})\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../../../packages/vue/src/input.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createInput } from \"@kirana-ui/core/input\"\nimport { defineComponent, h } from \"vue\"\n\nimport { useFieldAround } from \"./field-context.ts\"\nimport { controller, partComponent } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\n\nexport interface InputProps extends PartComponentProps {\n /** The text: `v-model`. */\n modelValue?: string | undefined\n disabled?: boolean | undefined\n}\n\nexport type InputEmits = {\n \"update:modelValue\": (value: string) => void\n valueChange: (value: string, details: ChangeDetails) => void\n}\n\n/**\n * An `<input>`; `as=\"textarea\"` for a text area. It takes what an `<input>` takes, and\n * `v-model`. Inside a `<Field.Root>` it is the field's control.\n */\nexport const Input = defineComponent({\n name: \"Input\",\n inheritAttrs: false,\n props: { modelValue: String, disabled: Boolean },\n emits: [\"update:modelValue\", \"valueChange\"],\n setup(props, { attrs, slots, emit }) {\n const made = controller(within(createInput, { field: useFieldAround() }), () => ({\n disabled: props.disabled,\n onValueChange(value: string, details: ChangeDetails) {\n emit(\"valueChange\", value, details)\n emit(\"update:modelValue\", value)\n },\n }))\n const Element = partComponent(\"InputElement\", \"input\", () => made.input)\n return () =>\n h(\n Element,\n { ...attrs, ...(props.modelValue === undefined ? {} : { value: props.modelValue }) },\n slots\n )\n },\n}) as unknown as PartComponent<\"input\", StatesOf<\"input\">[\"input\"], InputProps, InputEmits>\n"],"mappings":";;;;;;;;;;AAwBA,MAAa,QAAQ,gBAAgB;CACnC,MAAM;CACN,cAAc;CACd,OAAO;EAAE,YAAY;EAAQ,UAAU;CAAQ;CAC/C,OAAO,CAAC,qBAAqB,aAAa;CAC1C,MAAM,OAAO,EAAE,OAAO,OAAO,QAAQ;EACnC,MAAM,OAAO,WAAW,OAAO,aAAa,EAAE,OAAO,eAAe,EAAE,CAAC,UAAU;GAC/E,UAAU,MAAM;GAChB,cAAc,OAAe,SAAwB;IACnD,KAAK,eAAe,OAAO,OAAO;IAClC,KAAK,qBAAqB,KAAK;GACjC;EACF,EAAE;EACF,MAAM,UAAU,cAAc,gBAAgB,eAAe,KAAK,KAAK;EACvE,aACE,EACE,SACA;GAAE,GAAG;GAAO,GAAI,MAAM,eAAe,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO,MAAM,WAAW;EAAG,GACnF,KACF;CACJ;AACF,CAAC"}
|
package/src/label.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PartComponent, PartComponentProps, StatesOf } from "./runtime.js";
|
|
2
|
+
export type LabelProps = PartComponentProps;
|
|
1
3
|
/** A `<label>`. Inside a `<Field.Root>` it is the field's label. */
|
|
2
|
-
export declare const Label:
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export declare const Label: PartComponent<"label", StatesOf<"label">["label"], LabelProps>;
|
|
5
5
|
//# sourceMappingURL=label.d.ts.map
|
package/src/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","names":[],"sources":["../../../../packages/vue/src/label.ts"],"sourcesContent":["import { createLabel } from \"@kirana-ui/core/label\"\nimport { defineComponent, h } from \"vue\"\n\nimport { useFieldAround } from \"./field-context.ts\"\nimport { partComponent } from \"./runtime.ts\"\n\n/** A `<label>`. Inside a `<Field.Root>` it is the field's label. */\nexport const Label = defineComponent({\n name: \"Label\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n const made = createLabel({ field: useFieldAround() })\n const Element = partComponent(\"LabelElement\", \"label\", () => made.label)\n return () => h(Element, attrs, slots)\n },\n})\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../../../../packages/vue/src/label.ts"],"sourcesContent":["import { createLabel } from \"@kirana-ui/core/label\"\nimport { defineComponent, h } from \"vue\"\n\nimport { useFieldAround } from \"./field-context.ts\"\nimport { partComponent } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\n\nexport type LabelProps = PartComponentProps\n\n/** A `<label>`. Inside a `<Field.Root>` it is the field's label. */\nexport const Label = defineComponent({\n name: \"Label\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n const made = createLabel({ field: useFieldAround() })\n const Element = partComponent(\"LabelElement\", \"label\", () => made.label)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"label\", StatesOf<\"label\">[\"label\"], LabelProps>\n"],"mappings":";;;;;;AAUA,MAAa,QAAQ,gBAAgB;CACnC,MAAM;CACN,cAAc;CACd,MAAM,QAAQ,EAAE,OAAO,SAAS;EAC9B,MAAM,OAAO,YAAY,EAAE,OAAO,eAAe,EAAE,CAAC;EACpD,MAAM,UAAU,cAAc,gBAAgB,eAAe,KAAK,KAAK;EACvE,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC"}
|
package/src/listbox.d.ts
CHANGED
|
@@ -1,92 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Changes, PartComponent, PartComponentProps, PartGiven, PartInstance, StatesOf } from "./runtime.js";
|
|
2
|
+
import { PublicProps } from "vue";
|
|
3
|
+
import { ListboxItemOptions, ListboxProps } from "@kirana-ui/core/listbox";
|
|
4
|
+
type State = StatesOf<"listbox">;
|
|
5
|
+
export type RootProps<Value = unknown> = Omit<ListboxProps<Value>, "id" | "onValueChange"> & {
|
|
6
|
+
id?: string | undefined;
|
|
7
|
+
} & PartComponentProps;
|
|
8
|
+
export type RootEmits<Value = unknown> = Changes<"value", Value[]>;
|
|
9
|
+
export interface ItemProps extends ListboxItemOptions, PartComponentProps {
|
|
10
|
+
/** What is in the listbox's value while this item is chosen. */
|
|
11
|
+
value: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface ItemIndicatorProps extends PartComponentProps {
|
|
14
|
+
/** Keeps the mark in the page while its item is not chosen. */
|
|
15
|
+
keepMounted?: boolean | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface GroupProps extends PartComponentProps {
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export type GroupLabelProps = PartComponentProps;
|
|
3
21
|
export declare const Listbox: {
|
|
4
|
-
Root:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
form: StringConstructor;
|
|
18
|
-
virtualized: PropType<ListboxProps["virtualized"]>;
|
|
19
|
-
id: StringConstructor;
|
|
20
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "valueChange")[], "update:value" | "valueChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
-
value: {
|
|
24
|
-
type: PropType<readonly unknown[]>;
|
|
25
|
-
default: undefined;
|
|
26
|
-
};
|
|
27
|
-
defaultValue: PropType<readonly unknown[]>;
|
|
28
|
-
multiple: BooleanConstructor;
|
|
29
|
-
disabled: BooleanConstructor;
|
|
30
|
-
loop: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
default: undefined;
|
|
33
|
-
};
|
|
34
|
-
name: StringConstructor;
|
|
35
|
-
form: StringConstructor;
|
|
36
|
-
virtualized: PropType<ListboxProps["virtualized"]>;
|
|
37
|
-
id: StringConstructor;
|
|
38
|
-
}>> & Readonly<{
|
|
39
|
-
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
40
|
-
onValueChange?: ((...args: any[]) => any) | undefined;
|
|
41
|
-
}>, {
|
|
42
|
-
value: readonly unknown[];
|
|
43
|
-
multiple: boolean;
|
|
44
|
-
disabled: boolean;
|
|
45
|
-
loop: boolean;
|
|
46
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
-
Item: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
48
|
-
value: {
|
|
49
|
-
type: PropType<unknown>;
|
|
50
|
-
required: true;
|
|
51
|
-
};
|
|
52
|
-
disabled: {
|
|
53
|
-
type: BooleanConstructor;
|
|
54
|
-
default: undefined;
|
|
55
|
-
};
|
|
56
|
-
label: StringConstructor;
|
|
57
|
-
index: NumberConstructor;
|
|
58
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
61
|
-
value: {
|
|
62
|
-
type: PropType<unknown>;
|
|
63
|
-
required: true;
|
|
64
|
-
};
|
|
65
|
-
disabled: {
|
|
66
|
-
type: BooleanConstructor;
|
|
67
|
-
default: undefined;
|
|
68
|
-
};
|
|
69
|
-
label: StringConstructor;
|
|
70
|
-
index: NumberConstructor;
|
|
71
|
-
}>> & Readonly<{}>, {
|
|
72
|
-
disabled: boolean;
|
|
73
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
74
|
-
ItemIndicator: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
75
|
-
keepMounted: BooleanConstructor;
|
|
76
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
77
|
-
[key: string]: any;
|
|
78
|
-
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
|
-
keepMounted: BooleanConstructor;
|
|
80
|
-
}>> & Readonly<{}>, {
|
|
81
|
-
keepMounted: boolean;
|
|
82
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
83
|
-
Group: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
84
|
-
id: StringConstructor;
|
|
85
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
86
|
-
[key: string]: any;
|
|
87
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
88
|
-
id: StringConstructor;
|
|
89
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
90
|
-
GroupLabel: import("vue").Component;
|
|
22
|
+
Root: new <Value = unknown, As extends string = "div">(props: PartGiven<As, RootProps<Value>, RootEmits<Value>> & PublicProps) => PartInstance<As, RootProps<Value>, RootEmits<Value>, {
|
|
23
|
+
state: State["root"];
|
|
24
|
+
}>;
|
|
25
|
+
Item: PartComponent<"div", {
|
|
26
|
+
readonly selected?: true | undefined;
|
|
27
|
+
readonly highlighted?: true | undefined;
|
|
28
|
+
readonly disabled?: true | undefined;
|
|
29
|
+
}, ItemProps>;
|
|
30
|
+
ItemIndicator: PartComponent<"span", {
|
|
31
|
+
readonly selected?: true | undefined;
|
|
32
|
+
}, ItemIndicatorProps>;
|
|
33
|
+
Group: PartComponent<"div", Record<never, never>, GroupProps>;
|
|
34
|
+
GroupLabel: PartComponent<"div", Record<never, never>, PartComponentProps, {}, unknown>;
|
|
91
35
|
};
|
|
36
|
+
export {};
|
|
92
37
|
//# sourceMappingURL=listbox.d.ts.map
|
package/src/listbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../packages/vue/src/listbox.ts"],"sourcesContent":["import { defined } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createListbox } from \"@kirana-ui/core/listbox\"\nimport type {
|
|
1
|
+
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../packages/vue/src/listbox.ts"],"sourcesContent":["import { defined } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createListbox } from \"@kirana-ui/core/listbox\"\nimport type {\n Listbox as Controller,\n ListboxGroup,\n ListboxItemOptions,\n ListboxProps,\n} from \"@kirana-ui/core/listbox\"\nimport { defineComponent, h, inject, provide, useId } from \"vue\"\nimport type { InjectionKey, PropType, PublicProps } from \"vue\"\n\nimport { context, controller, fromSignal, optional, partComponent, toSignal } from \"./runtime.ts\"\nimport type {\n Changes,\n PartComponent,\n PartComponentProps,\n PartGiven,\n PartInstance,\n StatesOf,\n} from \"./runtime.ts\"\n\ntype State = StatesOf<\"listbox\">\n\nconst scope = context<Controller>(\"Listbox\")\nconst ITEM: InjectionKey<unknown> = Symbol(\"ListboxItem\")\nconst GROUP: InjectionKey<ListboxGroup> = Symbol(\"ListboxGroup\")\nconst ANY = null as unknown as PropType<unknown>\n\nconst RootElement = partComponent(\"ListboxRootElement\", \"div\", () => scope.use().root)\n\nexport type RootProps<Value = unknown> = Omit<ListboxProps<Value>, \"id\" | \"onValueChange\"> & {\n id?: string | undefined\n} & PartComponentProps\n\nexport type RootEmits<Value = unknown> = Changes<\"value\", Value[]>\n\n/** `v-model:value` (a list); `@value-change` carries the details. */\nconst Root = defineComponent({\n name: \"ListboxRoot\",\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 loop: optional(Boolean),\n name: String,\n form: String,\n virtualized: Object as PropType<ListboxProps[\"virtualized\"]>,\n id: String,\n },\n emits: [\"update:value\", \"valueChange\"],\n setup(props, { attrs, slots, emit }) {\n const generated = useId()\n scope.provide(\n controller(createListbox, () => ({\n id: props.id ?? generated,\n value: props.value,\n defaultValue: props.defaultValue,\n multiple: props.multiple,\n disabled: props.disabled,\n loop: props.loop,\n name: props.name,\n form: props.form,\n virtualized: props.virtualized,\n onValueChange(value: unknown[], details: ChangeDetails) {\n emit(\"valueChange\", value, details)\n if (!details.canceled) emit(\"update:value\", value)\n },\n }))\n )\n return () => h(RootElement, attrs, slots)\n },\n}) as unknown as new <Value = unknown, As extends string = \"div\">(\n props: PartGiven<As, RootProps<Value>, RootEmits<Value>> & PublicProps\n) => PartInstance<As, RootProps<Value>, RootEmits<Value>, { state: State[\"root\"] }>\n\nexport interface ItemProps extends ListboxItemOptions, PartComponentProps {\n /** What is in the listbox's value while this item is chosen. */\n value: unknown\n}\n\nconst Item = defineComponent({\n name: \"ListboxItem\",\n inheritAttrs: false,\n props: {\n value: { type: ANY, required: true },\n disabled: optional(Boolean),\n label: String,\n index: Number,\n },\n setup(props, { attrs, slots }) {\n // An item is its value for as long as it is in the page.\n const value = props.value\n const options = toSignal(() => ({\n disabled: props.disabled,\n label: props.label,\n index: props.index,\n }))\n const part = scope.use().item(value, () => defined(options.get()))\n provide(ITEM, value)\n const Element = partComponent(\"ListboxItemElement\", \"div\", () => part)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"div\", State[\"item\"], ItemProps>\n\nexport interface ItemIndicatorProps extends PartComponentProps {\n /** Keeps the mark in the page while its item is not chosen. */\n keepMounted?: boolean | undefined\n}\n\nconst ItemIndicator = defineComponent({\n name: \"ListboxItemIndicator\",\n inheritAttrs: false,\n props: { keepMounted: Boolean },\n setup(props, { attrs, slots }) {\n const value = inject(ITEM)\n const made = scope.use()\n const selected = fromSignal(made.selected(value))\n const Element = partComponent(\"ListboxItemIndicatorElement\", \"span\", () =>\n made.indicator(value)\n )\n return () => (selected.value || props.keepMounted ? h(Element, attrs, slots) : null)\n },\n}) as unknown as PartComponent<\"span\", State[\"itemIndicator\"], ItemIndicatorProps>\n\nexport interface GroupProps extends PartComponentProps {\n id?: string | undefined\n}\n\nconst Group = defineComponent({\n name: \"ListboxGroup\",\n inheritAttrs: false,\n props: { id: String },\n setup(props, { attrs, slots }) {\n const generated = useId()\n const group = scope.use().group(props.id ?? generated)\n provide(GROUP, group)\n const Element = partComponent(\"ListboxGroupElement\", \"div\", () => group.root)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"div\", State[\"group\"], GroupProps>\n\nconst GroupLabel = partComponent<\"div\", State[\"groupLabel\"]>(\"ListboxGroupLabel\", \"div\", () => {\n const group = inject(GROUP, undefined)\n if (!group) throw new Error(\"A Listbox.GroupLabel must be inside <Listbox.Group>\")\n return group.label\n})\n\nexport type GroupLabelProps = PartComponentProps\nexport const Listbox = { Root, Item, ItemIndicator, Group, GroupLabel }\n"],"mappings":";;;;;AAwBA,MAAM,QAAQ,QAAoB,SAAS;AAC3C,MAAM,OAA8B,OAAO,aAAa;AACxD,MAAM,QAAoC,OAAO,cAAc;AAC/D,MAAM,MAAM;AAEZ,MAAM,cAAc,cAAc,sBAAsB,aAAa,MAAM,IAAI,CAAC,CAAC,IAAI;AA0HrF,MAAa,UAAU;CAAE,MAjHZ,gBAAgB;EAC3B,MAAM;EACN,cAAc;EACd,OAAO;GACL,OAAO,SAAS,KAAqC;GACrD,cAAc;GACd,UAAU;GACV,UAAU;GACV,MAAM,SAAS,OAAO;GACtB,MAAM;GACN,MAAM;GACN,aAAa;GACb,IAAI;EACN;EACA,OAAO,CAAC,gBAAgB,aAAa;EACrC,MAAM,OAAO,EAAE,OAAO,OAAO,QAAQ;GACnC,MAAM,YAAY,MAAM;GACxB,MAAM,QACJ,WAAW,sBAAsB;IAC/B,IAAI,MAAM,MAAM;IAChB,OAAO,MAAM;IACb,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,UAAU,MAAM;IAChB,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,aAAa,MAAM;IACnB,cAAc,OAAkB,SAAwB;KACtD,KAAK,eAAe,OAAO,OAAO;KAClC,IAAI,CAAC,QAAQ,UAAU,KAAK,gBAAgB,KAAK;IACnD;GACF,EAAE,CACJ;GACA,aAAa,EAAE,aAAa,OAAO,KAAK;EAC1C;CACF,CA6EyB;CAAM,MApElB,gBAAgB;EAC3B,MAAM;EACN,cAAc;EACd,OAAO;GACL,OAAO;IAAE,MAAM;IAAK,UAAU;GAAK;GACnC,UAAU,SAAS,OAAO;GAC1B,OAAO;GACP,OAAO;EACT;EACA,MAAM,OAAO,EAAE,OAAO,SAAS;GAE7B,MAAM,QAAQ,MAAM;GACpB,MAAM,UAAU,gBAAgB;IAC9B,UAAU,MAAM;IAChB,OAAO,MAAM;IACb,OAAO,MAAM;GACf,EAAE;GACF,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC,KAAK,aAAa,QAAQ,QAAQ,IAAI,CAAC,CAAC;GACjE,QAAQ,MAAM,KAAK;GACnB,MAAM,UAAU,cAAc,sBAAsB,aAAa,IAAI;GACrE,aAAa,EAAE,SAAS,OAAO,KAAK;EACtC;CACF,CA8C+B;CAAM,eAvCf,gBAAgB;EACpC,MAAM;EACN,cAAc;EACd,OAAO,EAAE,aAAa,QAAQ;EAC9B,MAAM,OAAO,EAAE,OAAO,SAAS;GAC7B,MAAM,QAAQ,OAAO,IAAI;GACzB,MAAM,OAAO,MAAM,IAAI;GACvB,MAAM,WAAW,WAAW,KAAK,SAAS,KAAK,CAAC;GAChD,MAAM,UAAU,cAAc,+BAA+B,cAC3D,KAAK,UAAU,KAAK,CACtB;GACA,aAAc,SAAS,SAAS,MAAM,cAAc,EAAE,SAAS,OAAO,KAAK,IAAI;EACjF;CACF,CA0BqC;CAAe,OApBtC,gBAAgB;EAC5B,MAAM;EACN,cAAc;EACd,OAAO,EAAE,IAAI,OAAO;EACpB,MAAM,OAAO,EAAE,OAAO,SAAS;GAC7B,MAAM,YAAY,MAAM;GACxB,MAAM,QAAQ,MAAM,IAAI,CAAC,CAAC,MAAM,MAAM,MAAM,SAAS;GACrD,QAAQ,OAAO,KAAK;GACpB,MAAM,UAAU,cAAc,uBAAuB,aAAa,MAAM,IAAI;GAC5E,aAAa,EAAE,SAAS,OAAO,KAAK;EACtC;CACF,CASoD;CAAO,YAPxC,cAA0C,qBAAqB,aAAa;EAC7F,MAAM,QAAQ,OAAO,OAAO,KAAA,CAAS;EACrC,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,qDAAqD;EACjF,OAAO,MAAM;CACf,CAG2D;AAAW"}
|