@kirana-ui/web 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 +3000 -0
- package/package.json +10 -2
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.d.ts +18 -3
- package/src/accordion.js +5 -4
- 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 +12 -1
- package/src/alert-dialog.js.map +1 -1
- package/src/around.d.ts +19 -3
- package/src/around.js +45 -3
- package/src/around.js.map +1 -1
- package/src/autocomplete.d.ts +13 -2
- package/src/autocomplete.js +2 -1
- package/src/autocomplete.js.map +1 -1
- package/src/autosize.d.ts +10 -1
- package/src/autosize.js.map +1 -1
- package/src/avatar.d.ts +13 -1
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +10 -1
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +11 -1
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +10 -1
- package/src/carousel.js.map +1 -1
- package/src/checkbox.d.ts +12 -1
- package/src/checkbox.js.map +1 -1
- package/src/collapsible.d.ts +10 -1
- package/src/collapsible.js.map +1 -1
- package/src/combobox.d.ts +23 -6
- package/src/combobox.js +10 -11
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +11 -1
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +12 -1
- package/src/context-menu.js.map +1 -1
- package/src/date-field.d.ts +10 -1
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +13 -1
- package/src/date-picker.js +2 -8
- package/src/date-picker.js.map +1 -1
- package/src/dialog.d.ts +12 -1
- package/src/dialog.js.map +1 -1
- package/src/drawer.d.ts +17 -1
- package/src/drawer.js.map +1 -1
- package/src/field.d.ts +8 -1
- package/src/field.js.map +1 -1
- package/src/fieldset.d.ts +10 -1
- package/src/fieldset.js.map +1 -1
- package/src/form.d.ts +13 -1
- package/src/form.js.map +1 -1
- package/src/hover-card.d.ts +9 -1
- package/src/hover-card.js.map +1 -1
- package/src/hover-popup.d.ts +2 -1
- package/src/hover-popup.js +2 -8
- package/src/hover-popup.js.map +1 -1
- package/src/index.d.ts +56 -1
- package/src/input.d.ts +12 -1
- package/src/input.js.map +1 -1
- package/src/label.d.ts +9 -1
- package/src/label.js.map +1 -1
- package/src/listbox.d.ts +15 -1
- package/src/listbox.js.map +1 -1
- package/src/menu.d.ts +14 -4
- package/src/menu.js +2 -8
- package/src/menu.js.map +1 -1
- package/src/menubar.d.ts +10 -1
- package/src/menubar.js.map +1 -1
- package/src/message-scroller.d.ts +10 -1
- package/src/message-scroller.js.map +1 -1
- package/src/meter.d.ts +10 -1
- package/src/meter.js.map +1 -1
- package/src/navigation-menu.d.ts +14 -4
- package/src/navigation-menu.js +7 -13
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +13 -1
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +11 -1
- package/src/otp.js.map +1 -1
- package/src/pagination.d.ts +10 -1
- package/src/pagination.js.map +1 -1
- package/src/popover.d.ts +14 -2
- package/src/popover.js +4 -9
- package/src/popover.js.map +1 -1
- package/src/progress.d.ts +10 -1
- package/src/progress.js.map +1 -1
- package/src/qr-code.d.ts +8 -1
- package/src/qr-code.js.map +1 -1
- package/src/radio-group.d.ts +10 -1
- package/src/radio-group.js.map +1 -1
- package/src/resizable.d.ts +10 -1
- package/src/resizable.js.map +1 -1
- package/src/runtime.d.ts +35 -2
- package/src/runtime.js +28 -3
- package/src/runtime.js.map +1 -1
- package/src/scroll-area.d.ts +13 -2
- package/src/scroll-area.js +3 -1
- package/src/scroll-area.js.map +1 -1
- package/src/select.d.ts +25 -5
- package/src/select.js +35 -11
- package/src/select.js.map +1 -1
- package/src/separator.d.ts +10 -1
- package/src/separator.js.map +1 -1
- package/src/slider.d.ts +18 -3
- package/src/slider.js +6 -6
- package/src/slider.js.map +1 -1
- package/src/switch.d.ts +12 -1
- package/src/switch.js.map +1 -1
- package/src/tabs.d.ts +10 -1
- 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 +20 -7
- package/src/toast.js +28 -7
- package/src/toast.js.map +1 -1
- package/src/toggle-group.d.ts +16 -1
- package/src/toggle-group.js.map +1 -1
- package/src/toggle.d.ts +12 -1
- package/src/toggle.js.map +1 -1
- package/src/toolbar.d.ts +10 -1
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +9 -1
- package/src/tooltip.js.map +1 -1
package/src/scroll-area.js
CHANGED
|
@@ -5,7 +5,9 @@ const way = (element) => element?.getAttribute("kui-orientation") === "horizonta
|
|
|
5
5
|
/**
|
|
6
6
|
* `<kui-scroll-area>` around `kui-part="root"`, a `viewport` with its `content`, a `scrollbar`
|
|
7
7
|
* for each way (`kui-orientation="horizontal"` for the one across) with its `thumb`, and a
|
|
8
|
-
* `corner`. A scrollbar is in the page while there is something to scroll its way.
|
|
8
|
+
* `corner`. A scrollbar is in the page while there is something to scroll its way. The
|
|
9
|
+
* library places the scrollbars and the corner against the root; the page gives a scrollbar
|
|
10
|
+
* its thickness and draws it.
|
|
9
11
|
*/
|
|
10
12
|
const tag = defineElement({
|
|
11
13
|
tag: "kui-scroll-area",
|
package/src/scroll-area.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.js","names":[],"sources":["../../../../packages/web/src/scroll-area.ts"],"sourcesContent":["import type { Orientation } from \"@kirana-ui/core\"\nimport { createScrollArea } from \"@kirana-ui/core/scroll-area\"\n\nimport { defineElement, partAround } from \"./runtime.ts\"\n\nconst way = (element: HTMLElement | null): Orientation =>\n element?.getAttribute(\"kui-orientation\") === \"horizontal\" ? \"horizontal\" : \"vertical\"\n\n/**\n * `<kui-scroll-area>` around `kui-part=\"root\"`, a `viewport` with its `content`, a `scrollbar`\n * for each way (`kui-orientation=\"horizontal\"` for the one across) with its `thumb`, and a\n * `corner`. A scrollbar is in the page while there is something to scroll its way.\n */\nexport const tag = defineElement({\n tag: \"kui-scroll-area\",\n props: {},\n create: (props) => createScrollArea(props as never),\n changes: {},\n parts: {\n root: (controller) => controller.root,\n viewport: (controller) => controller.viewport,\n content: (controller) => controller.content,\n scrollbar(controller, element) {\n const bar = controller.scrollbar(way(element))\n return { part: bar.part, mounted: bar.shown }\n },\n thumb: (controller, element) =>\n controller.scrollbar(way(partAround(element, \"scrollbar\"))).thumb,\n corner: (controller) => ({ part: controller.corner.part, mounted: controller.corner.shown }),\n },\n})\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":[],"sources":["../../../../packages/web/src/scroll-area.ts"],"sourcesContent":["import type { Orientation } from \"@kirana-ui/core\"\nimport { createScrollArea } from \"@kirana-ui/core/scroll-area\"\nimport type { ScrollAreaProps } from \"@kirana-ui/core/scroll-area\"\n\nimport { defineElement, partAround } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\nconst way = (element: HTMLElement | null): Orientation =>\n element?.getAttribute(\"kui-orientation\") === \"horizontal\" ? \"horizontal\" : \"vertical\"\n\n/**\n * `<kui-scroll-area>` around `kui-part=\"root\"`, a `viewport` with its `content`, a `scrollbar`\n * for each way (`kui-orientation=\"horizontal\"` for the one across) with its `thumb`, and a\n * `corner`. A scrollbar is in the page while there is something to scroll its way. The\n * library places the scrollbars and the corner against the root; the page gives a scrollbar\n * its thickness and draws it.\n */\nexport const tag = defineElement({\n tag: \"kui-scroll-area\",\n props: {},\n create: (props) => createScrollArea(props as never),\n changes: {},\n parts: {\n root: (controller) => controller.root,\n viewport: (controller) => controller.viewport,\n content: (controller) => controller.content,\n scrollbar(controller, element) {\n const bar = controller.scrollbar(way(element))\n return { part: bar.part, mounted: bar.shown }\n },\n thumb: (controller, element) =>\n controller.scrollbar(way(partAround(element, \"scrollbar\"))).thumb,\n corner: (controller) => ({ part: controller.corner.part, mounted: controller.corner.shown }),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-scroll-area\": ElementOf<As<typeof tag, ScrollAreaProps>>\n }\n}\n"],"mappings":";;;AAOA,MAAM,OAAO,YACX,SAAS,aAAa,iBAAiB,MAAM,eAAe,eAAe;;;;;;;;AAS7E,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO,CAAC;CACR,SAAS,UAAU,iBAAiB,KAAc;CAClD,SAAS,CAAC;CACV,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,WAAW,eAAe,WAAW;EACrC,UAAU,eAAe,WAAW;EACpC,UAAU,YAAY,SAAS;GAC7B,MAAM,MAAM,WAAW,UAAU,IAAI,OAAO,CAAC;GAC7C,OAAO;IAAE,MAAM,IAAI;IAAM,SAAS,IAAI;GAAM;EAC9C;EACA,QAAQ,YAAY,YAClB,WAAW,UAAU,IAAI,WAAW,SAAS,WAAW,CAAC,CAAC,CAAC,CAAC;EAC9D,SAAS,gBAAgB;GAAE,MAAM,WAAW,OAAO;GAAM,SAAS,WAAW,OAAO;EAAM;CAC5F;AACF,CAAC"}
|
package/src/select.d.ts
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { Select, SelectProps } from "@kirana-ui/core/select";
|
|
3
|
+
type Props = Omit<SelectProps<string>, "values" | "defaultValues"> & {
|
|
4
|
+
values?: string | readonly string[];
|
|
5
|
+
defaultValues?: string | readonly string[];
|
|
6
|
+
};
|
|
1
7
|
/**
|
|
2
8
|
* `<kui-select>` around a `kui-part="trigger"` button holding a `value` (it says the chosen
|
|
3
|
-
* item's text, or its `kui-placeholder
|
|
9
|
+
* item's text, or its `kui-placeholder`; with `multiple`, the chosen items' texts with commas
|
|
10
|
+
* between), and a `portal` with a `positioner` (its `kui-side`
|
|
4
11
|
* and the like, and `kui-align-item-with-trigger`) around the `popup`. The popup holds an
|
|
5
12
|
* `item` for each `kui-value` (`kui-disabled`, `kui-label`), each with an `item-text` and an
|
|
6
13
|
* `item-indicator`; items may be in a `group` with a `group-label`, with `separator`s
|
|
7
14
|
* between, and in a `list` between a `scroll-up-arrow` and a `scroll-down-arrow`. With a name
|
|
8
|
-
* it draws the hidden input a form reads.
|
|
9
|
-
*
|
|
10
|
-
* `open
|
|
15
|
+
* it draws the hidden input a form reads. A `value` part that holds something says what the
|
|
16
|
+
* page wrote there: a `<template kui-each="values">` in it is drawn for each chosen value
|
|
17
|
+
* (`{value}`, `{label}`), in the items' order. `value`, `default-value`, `open`,
|
|
18
|
+
* `default-open`, `disabled`, `required`, `multiple`, `values` and `default-values` (with
|
|
19
|
+
* commas between), `name`, `form`; `items` as a property; it tells `value-change`,
|
|
20
|
+
* `values-change` and `open-change`.
|
|
11
21
|
*/
|
|
12
|
-
export declare const tag: string
|
|
22
|
+
export declare const tag: Tag<Props, Select<string>>;
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
"kui-select": ElementOf<typeof tag, {
|
|
26
|
+
"value-change": ["onValueChange", "value"];
|
|
27
|
+
"values-change": ["onValuesChange", "values"];
|
|
28
|
+
"open-change": ["onOpenChange", "open"];
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
13
33
|
//# sourceMappingURL=select.d.ts.map
|
package/src/select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MARK, fieldAround, itemOptions, once,
|
|
1
|
+
import { MARK, fieldAround, itemOptions, list, once, positioner, valueOf } from "./around.js";
|
|
2
2
|
import { defineElement, partAround } from "./runtime.js";
|
|
3
3
|
import { computed } from "@kirana-ui/core";
|
|
4
4
|
import { createSelect } from "@kirana-ui/core/select";
|
|
@@ -12,14 +12,18 @@ const arrow = (drawn) => ({
|
|
|
12
12
|
});
|
|
13
13
|
/**
|
|
14
14
|
* `<kui-select>` around a `kui-part="trigger"` button holding a `value` (it says the chosen
|
|
15
|
-
* item's text, or its `kui-placeholder
|
|
15
|
+
* item's text, or its `kui-placeholder`; with `multiple`, the chosen items' texts with commas
|
|
16
|
+
* between), and a `portal` with a `positioner` (its `kui-side`
|
|
16
17
|
* and the like, and `kui-align-item-with-trigger`) around the `popup`. The popup holds an
|
|
17
18
|
* `item` for each `kui-value` (`kui-disabled`, `kui-label`), each with an `item-text` and an
|
|
18
19
|
* `item-indicator`; items may be in a `group` with a `group-label`, with `separator`s
|
|
19
20
|
* between, and in a `list` between a `scroll-up-arrow` and a `scroll-down-arrow`. With a name
|
|
20
|
-
* it draws the hidden input a form reads.
|
|
21
|
-
*
|
|
22
|
-
* `open
|
|
21
|
+
* it draws the hidden input a form reads. A `value` part that holds something says what the
|
|
22
|
+
* page wrote there: a `<template kui-each="values">` in it is drawn for each chosen value
|
|
23
|
+
* (`{value}`, `{label}`), in the items' order. `value`, `default-value`, `open`,
|
|
24
|
+
* `default-open`, `disabled`, `required`, `multiple`, `values` and `default-values` (with
|
|
25
|
+
* commas between), `name`, `form`; `items` as a property; it tells `value-change`,
|
|
26
|
+
* `values-change` and `open-change`.
|
|
23
27
|
*/
|
|
24
28
|
const tag = defineElement({
|
|
25
29
|
tag: "kui-select",
|
|
@@ -30,11 +34,31 @@ const tag = defineElement({
|
|
|
30
34
|
"default-open": "boolean",
|
|
31
35
|
disabled: "boolean",
|
|
32
36
|
required: "boolean",
|
|
37
|
+
multiple: "boolean",
|
|
38
|
+
values: "string",
|
|
39
|
+
"default-values": "string",
|
|
33
40
|
name: "string",
|
|
34
41
|
form: "string"
|
|
35
42
|
},
|
|
36
43
|
properties: ["items"],
|
|
37
|
-
create: (props, host) => createSelect(
|
|
44
|
+
create: (props, host) => createSelect(computed(() => {
|
|
45
|
+
const own = props.get();
|
|
46
|
+
return {
|
|
47
|
+
...own,
|
|
48
|
+
values: list(own.values),
|
|
49
|
+
defaultValues: list(own.defaultValues)
|
|
50
|
+
};
|
|
51
|
+
}), { field: fieldAround(host) }),
|
|
52
|
+
lists: { values: (controller) => ({
|
|
53
|
+
entries: computed(() => {
|
|
54
|
+
const { values, labels } = controller.shown.get();
|
|
55
|
+
return values.map((value, at) => ({
|
|
56
|
+
value,
|
|
57
|
+
label: labels[at] ?? value
|
|
58
|
+
}));
|
|
59
|
+
}),
|
|
60
|
+
key: (chosen) => chosen.value
|
|
61
|
+
}) },
|
|
38
62
|
inner: (controller) => ({
|
|
39
63
|
part: controller.input,
|
|
40
64
|
mounted: controller.named
|
|
@@ -44,6 +68,10 @@ const tag = defineElement({
|
|
|
44
68
|
event: "value-change",
|
|
45
69
|
prop: "value"
|
|
46
70
|
},
|
|
71
|
+
onValuesChange: {
|
|
72
|
+
event: "values-change",
|
|
73
|
+
prop: "values"
|
|
74
|
+
},
|
|
47
75
|
onOpenChange: {
|
|
48
76
|
event: "open-change",
|
|
49
77
|
prop: "open"
|
|
@@ -57,11 +85,7 @@ const tag = defineElement({
|
|
|
57
85
|
}),
|
|
58
86
|
positioner(controller, element) {
|
|
59
87
|
controller.alignItemWithTrigger.set(element.hasAttribute("kui-align-item-with-trigger"));
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
mounted: controller.mounted,
|
|
63
|
-
part: controller.positioner
|
|
64
|
-
};
|
|
88
|
+
return positioner(controller, element);
|
|
65
89
|
},
|
|
66
90
|
popup: (controller) => controller.popup,
|
|
67
91
|
list: (controller) => controller.list,
|
package/src/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":[],"sources":["../../../../packages/web/src/select.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createSelect } from \"@kirana-ui/core/select\"\nimport type { Select, SelectGroup, SelectProps, SelectScrollArrow } from \"@kirana-ui/core/select\"\n\nimport { fieldAround, itemOptions, MARK, once,
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../../../packages/web/src/select.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createSelect } from \"@kirana-ui/core/select\"\nimport type { Select, SelectGroup, SelectProps, SelectScrollArrow } from \"@kirana-ui/core/select\"\n\nimport { fieldAround, itemOptions, list, MARK, once, positioner, valueOf } from \"./around.ts\"\nimport { defineElement, partAround } from \"./runtime.ts\"\nimport type { Drawn, Each, ElementOf } from \"./runtime.ts\"\n\ntype Props = Omit<SelectProps<string>, \"values\" | \"defaultValues\"> & {\n values?: string | readonly string[]\n defaultValues?: string | readonly string[]\n}\n\nconst groups = new WeakMap<HTMLElement, SelectGroup>()\nlet made = 0\n\nconst arrow = (drawn: SelectScrollArrow): Drawn => ({\n part: drawn.part,\n mounted: drawn.mounted,\n mount: () => drawn.mount(),\n})\n\n/**\n * `<kui-select>` around a `kui-part=\"trigger\"` button holding a `value` (it says the chosen\n * item's text, or its `kui-placeholder`; with `multiple`, the chosen items' texts with commas\n * between), and a `portal` with a `positioner` (its `kui-side`\n * and the like, and `kui-align-item-with-trigger`) around the `popup`. The popup holds an\n * `item` for each `kui-value` (`kui-disabled`, `kui-label`), each with an `item-text` and an\n * `item-indicator`; items may be in a `group` with a `group-label`, with `separator`s\n * between, and in a `list` between a `scroll-up-arrow` and a `scroll-down-arrow`. With a name\n * it draws the hidden input a form reads. A `value` part that holds something says what the\n * page wrote there: a `<template kui-each=\"values\">` in it is drawn for each chosen value\n * (`{value}`, `{label}`), in the items' order. `value`, `default-value`, `open`,\n * `default-open`, `disabled`, `required`, `multiple`, `values` and `default-values` (with\n * commas between), `name`, `form`; `items` as a property; it tells `value-change`,\n * `values-change` and `open-change`.\n */\nexport const tag = defineElement<Props, Select<string>>({\n tag: \"kui-select\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n open: \"boolean\",\n \"default-open\": \"boolean\",\n disabled: \"boolean\",\n required: \"boolean\",\n multiple: \"boolean\",\n values: \"string\",\n \"default-values\": \"string\",\n name: \"string\",\n form: \"string\",\n },\n properties: [\"items\"],\n create: (props, host) =>\n createSelect<string>(\n computed(() => {\n const own = props.get()\n return { ...own, values: list(own.values), defaultValues: list(own.defaultValues) }\n }),\n { field: fieldAround(host) }\n ),\n lists: {\n values: (controller): Each<{ value: string; label: string }> => ({\n entries: computed(() => {\n const { values, labels } = controller.shown.get()\n return values.map((value, at) => ({ value, label: labels[at] ?? value }))\n }),\n key: (chosen) => chosen.value,\n }),\n },\n inner: (controller) => ({ part: controller.input, mounted: controller.named }),\n changes: {\n onValueChange: { event: \"value-change\", prop: \"value\" },\n onValuesChange: { event: \"values-change\", prop: \"values\" },\n onOpenChange: { event: \"open-change\", prop: \"open\" },\n },\n parts: {\n trigger: (controller) => controller.trigger,\n value: (controller, element) => ({\n part: controller.valuePart,\n text: computed(\n () => controller.label.get() ?? element.getAttribute(\"kui-placeholder\") ?? undefined\n ),\n }),\n positioner(controller, element) {\n controller.alignItemWithTrigger.set(element.hasAttribute(\"kui-align-item-with-trigger\"))\n return positioner(controller, element)\n },\n popup: (controller) => controller.popup,\n list: (controller) => controller.list,\n \"scroll-up-arrow\": (controller) => arrow(controller.scrollArrow(\"up\")),\n \"scroll-down-arrow\": (controller) => arrow(controller.scrollArrow(\"down\")),\n group: (controller, element) =>\n once(groups, element, (group) =>\n controller.group(group.getAttribute(\"kui-id\") ?? `kui-select-group-${++made}`)\n )?.root,\n // Outside a group it is plain text, and names nothing.\n \"group-label\": (controller, element) =>\n groups.get(partAround(element, \"group\")!)?.label ?? controller.groupLabel,\n separator: (controller) => controller.separator,\n item: (controller, element) => controller.item(valueOf(element), itemOptions(element)),\n \"item-text\": (controller, element) => controller.itemText(valueOf(partAround(element, \"item\"))),\n \"item-indicator\": (controller, element) => ({\n part: MARK,\n mounted: controller.selected(valueOf(partAround(element, \"item\"))),\n }),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-select\": ElementOf<\n typeof tag,\n {\n \"value-change\": [\"onValueChange\", \"value\"]\n \"values-change\": [\"onValuesChange\", \"values\"]\n \"open-change\": [\"onOpenChange\", \"open\"]\n }\n >\n }\n}\n"],"mappings":";;;;;AAaA,MAAM,yBAAS,IAAI,QAAkC;AACrD,IAAI,OAAO;AAEX,MAAM,SAAS,WAAqC;CAClD,MAAM,MAAM;CACZ,SAAS,MAAM;CACf,aAAa,MAAM,MAAM;AAC3B;;;;;;;;;;;;;;;;AAiBA,MAAa,MAAM,cAAqC;CACtD,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,MAAM;EACN,gBAAgB;EAChB,UAAU;EACV,UAAU;EACV,UAAU;EACV,QAAQ;EACR,kBAAkB;EAClB,MAAM;EACN,MAAM;CACR;CACA,YAAY,CAAC,OAAO;CACpB,SAAS,OAAO,SACd,aACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,OAAO;GAAE,GAAG;GAAK,QAAQ,KAAK,IAAI,MAAM;GAAG,eAAe,KAAK,IAAI,aAAa;EAAE;CACpF,CAAC,GACD,EAAE,OAAO,YAAY,IAAI,EAAE,CAC7B;CACF,OAAO,EACL,SAAS,gBAAwD;EAC/D,SAAS,eAAe;GACtB,MAAM,EAAE,QAAQ,WAAW,WAAW,MAAM,IAAI;GAChD,OAAO,OAAO,KAAK,OAAO,QAAQ;IAAE;IAAO,OAAO,OAAO,OAAO;GAAM,EAAE;EAC1E,CAAC;EACD,MAAM,WAAW,OAAO;CAC1B,GACF;CACA,QAAQ,gBAAgB;EAAE,MAAM,WAAW;EAAO,SAAS,WAAW;CAAM;CAC5E,SAAS;EACP,eAAe;GAAE,OAAO;GAAgB,MAAM;EAAQ;EACtD,gBAAgB;GAAE,OAAO;GAAiB,MAAM;EAAS;EACzD,cAAc;GAAE,OAAO;GAAe,MAAM;EAAO;CACrD;CACA,OAAO;EACL,UAAU,eAAe,WAAW;EACpC,QAAQ,YAAY,aAAa;GAC/B,MAAM,WAAW;GACjB,MAAM,eACE,WAAW,MAAM,IAAI,KAAK,QAAQ,aAAa,iBAAiB,KAAK,KAAA,CAC7E;EACF;EACA,WAAW,YAAY,SAAS;GAC9B,WAAW,qBAAqB,IAAI,QAAQ,aAAa,6BAA6B,CAAC;GACvF,OAAO,WAAW,YAAY,OAAO;EACvC;EACA,QAAQ,eAAe,WAAW;EAClC,OAAO,eAAe,WAAW;EACjC,oBAAoB,eAAe,MAAM,WAAW,YAAY,IAAI,CAAC;EACrE,sBAAsB,eAAe,MAAM,WAAW,YAAY,MAAM,CAAC;EACzE,QAAQ,YAAY,YAClB,KAAK,QAAQ,UAAU,UACrB,WAAW,MAAM,MAAM,aAAa,QAAQ,KAAK,oBAAoB,EAAE,MAAM,CAC/E,CAAC,EAAE;EAEL,gBAAgB,YAAY,YAC1B,OAAO,IAAI,WAAW,SAAS,OAAO,CAAE,CAAC,EAAE,SAAS,WAAW;EACjE,YAAY,eAAe,WAAW;EACtC,OAAO,YAAY,YAAY,WAAW,KAAK,QAAQ,OAAO,GAAG,YAAY,OAAO,CAAC;EACrF,cAAc,YAAY,YAAY,WAAW,SAAS,QAAQ,WAAW,SAAS,MAAM,CAAC,CAAC;EAC9F,mBAAmB,YAAY,aAAa;GAC1C,MAAM;GACN,SAAS,WAAW,SAAS,QAAQ,WAAW,SAAS,MAAM,CAAC,CAAC;EACnE;CACF;AACF,CAAC"}
|
package/src/separator.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { SeparatorProps } from "@kirana-ui/core/separator";
|
|
1
3
|
/** `<kui-separator>` around `kui-part="root"`. `orientation`. */
|
|
2
|
-
export declare const tag:
|
|
4
|
+
export declare const tag: Tag<{
|
|
5
|
+
id: string;
|
|
6
|
+
}, import("@kirana-ui/core/separator").Separator>;
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
"kui-separator": ElementOf<As<typeof tag, SeparatorProps>>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
3
12
|
//# sourceMappingURL=separator.d.ts.map
|
package/src/separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../../../packages/web/src/separator.ts"],"sourcesContent":["import { createSeparator } from \"@kirana-ui/core/separator\"\n\nimport { defineElement } from \"./runtime.ts\"\n\n/** `<kui-separator>` around `kui-part=\"root\"`. `orientation`. */\nexport const tag = defineElement({\n tag: \"kui-separator\",\n props: { orientation: \"string\" },\n create: (props) => createSeparator(props as never),\n changes: {},\n parts: { root: (controller) => controller.root },\n})\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../../packages/web/src/separator.ts"],"sourcesContent":["import { createSeparator } from \"@kirana-ui/core/separator\"\nimport type { SeparatorProps } from \"@kirana-ui/core/separator\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/** `<kui-separator>` around `kui-part=\"root\"`. `orientation`. */\nexport const tag = defineElement({\n tag: \"kui-separator\",\n props: { orientation: \"string\" },\n create: (props) => createSeparator(props as never),\n changes: {},\n parts: { root: (controller) => controller.root },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-separator\": ElementOf<As<typeof tag, SeparatorProps>>\n }\n}\n"],"mappings":";;;;AAOA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO,EAAE,aAAa,SAAS;CAC/B,SAAS,UAAU,gBAAgB,KAAc;CACjD,SAAS,CAAC;CACV,OAAO,EAAE,OAAO,eAAe,WAAW,KAAK;AACjD,CAAC"}
|
package/src/slider.d.ts
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { Slider, SliderProps } from "@kirana-ui/core/slider";
|
|
3
|
+
type Props = Omit<SliderProps, "value" | "defaultValue"> & {
|
|
4
|
+
value?: string | number | number[];
|
|
5
|
+
defaultValue?: string | number | number[];
|
|
6
|
+
};
|
|
1
7
|
/**
|
|
2
8
|
* `<kui-slider>` around `kui-part="root"`, a `value` (which says the value as it is written),
|
|
3
|
-
* a `control` with its `track`, `indicator` and a `thumb` for each value
|
|
4
|
-
*
|
|
9
|
+
* a `control` with its `track`, `indicator` and a `thumb` for each value, in the values'
|
|
10
|
+
* order (or each with its `kui-index`). A thumb draws the hidden input a form reads. `value` and
|
|
5
11
|
* `default-value` (a range with a comma), `min`, `max`, `step`, `large-step`,
|
|
6
12
|
* `min-steps-between-values`, `thumb-alignment`, `orientation`, `disabled`, `name`, `form`,
|
|
7
13
|
* `locale`; it tells `value-change` and `value-committed`.
|
|
8
14
|
*/
|
|
9
|
-
export declare const tag:
|
|
15
|
+
export declare const tag: Tag<Props, Slider>;
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"kui-slider": ElementOf<typeof tag, {
|
|
19
|
+
"value-change": ["onValueChange", "value"];
|
|
20
|
+
"value-committed": ["onValueCommitted", "value"];
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
10
25
|
//# sourceMappingURL=slider.d.ts.map
|
package/src/slider.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { fieldAround } from "./around.js";
|
|
1
|
+
import { fieldAround, ownValue } from "./around.js";
|
|
2
2
|
import { defineElement } from "./runtime.js";
|
|
3
3
|
import { computed } from "@kirana-ui/core";
|
|
4
4
|
import { createSlider } from "@kirana-ui/core/slider";
|
|
5
5
|
// src/slider.ts
|
|
6
6
|
/** A value as an attribute writes it: `"40"`, or for a range `"20,80"`. */
|
|
7
7
|
const read = (given) => typeof given === "string" ? given.includes(",") ? given.split(",").map(Number) : Number(given) : given;
|
|
8
|
-
const
|
|
8
|
+
const at = (element) => element.hasAttribute("kui-index") ? Number(element.getAttribute("kui-index")) : ownValue(element);
|
|
9
9
|
/**
|
|
10
10
|
* `<kui-slider>` around `kui-part="root"`, a `value` (which says the value as it is written),
|
|
11
|
-
* a `control` with its `track`, `indicator` and a `thumb` for each value
|
|
12
|
-
*
|
|
11
|
+
* a `control` with its `track`, `indicator` and a `thumb` for each value, in the values'
|
|
12
|
+
* order (or each with its `kui-index`). A thumb draws the hidden input a form reads. `value` and
|
|
13
13
|
* `default-value` (a range with a comma), `min`, `max`, `step`, `large-step`,
|
|
14
14
|
* `min-steps-between-values`, `thumb-alignment`, `orientation`, `disabled`, `name`, `form`,
|
|
15
15
|
* `locale`; it tells `value-change` and `value-committed`.
|
|
@@ -61,8 +61,8 @@ const tag = defineElement({
|
|
|
61
61
|
track: (controller) => controller.track,
|
|
62
62
|
indicator: (controller) => controller.indicator,
|
|
63
63
|
thumb: (controller, element) => ({
|
|
64
|
-
part: controller.thumb(
|
|
65
|
-
inner: controller.thumbInput(
|
|
64
|
+
part: controller.thumb(at(element)),
|
|
65
|
+
inner: controller.thumbInput(at(element))
|
|
66
66
|
})
|
|
67
67
|
}
|
|
68
68
|
});
|
package/src/slider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","names":[],"sources":["../../../../packages/web/src/slider.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createSlider } from \"@kirana-ui/core/slider\"\nimport type { Slider, SliderProps } from \"@kirana-ui/core/slider\"\n\nimport { fieldAround } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\n\n/** A value as an attribute writes it: `\"40\"`, or for a range `\"20,80\"`. */\nconst read = (given: unknown): number | number[] | undefined =>\n typeof given === \"string\"\n ? given.includes(\",\")\n ? given.split(\",\").map(Number)\n : Number(given)\n : (given as number | number[] | undefined)\n\nconst
|
|
1
|
+
{"version":3,"file":"slider.js","names":[],"sources":["../../../../packages/web/src/slider.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createSlider } from \"@kirana-ui/core/slider\"\nimport type { Slider, SliderProps } from \"@kirana-ui/core/slider\"\n\nimport { fieldAround, ownValue } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/** A value as an attribute writes it: `\"40\"`, or for a range `\"20,80\"`. */\nconst read = (given: unknown): number | number[] | undefined =>\n typeof given === \"string\"\n ? given.includes(\",\")\n ? given.split(\",\").map(Number)\n : Number(given)\n : (given as number | number[] | undefined)\n\n// A thumb with no `kui-index` takes its place among the slider's thumbs, in the page's order.\nconst at = (element: HTMLElement) =>\n element.hasAttribute(\"kui-index\") ? Number(element.getAttribute(\"kui-index\")) : ownValue(element)\n\ntype Props = Omit<SliderProps, \"value\" | \"defaultValue\"> & {\n value?: string | number | number[]\n defaultValue?: string | number | number[]\n}\n\n/**\n * `<kui-slider>` around `kui-part=\"root\"`, a `value` (which says the value as it is written),\n * a `control` with its `track`, `indicator` and a `thumb` for each value, in the values'\n * order (or each with its `kui-index`). A thumb draws the hidden input a form reads. `value` and\n * `default-value` (a range with a comma), `min`, `max`, `step`, `large-step`,\n * `min-steps-between-values`, `thumb-alignment`, `orientation`, `disabled`, `name`, `form`,\n * `locale`; it tells `value-change` and `value-committed`.\n */\nexport const tag = defineElement<Props, Slider>({\n tag: \"kui-slider\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n min: \"number\",\n max: \"number\",\n step: \"number\",\n \"large-step\": \"number\",\n \"min-steps-between-values\": \"number\",\n \"thumb-alignment\": \"string\",\n orientation: \"string\",\n disabled: \"boolean\",\n name: \"string\",\n form: \"string\",\n locale: \"string\",\n },\n properties: [\"format\", \"getAriaValueText\"],\n create: (props, host) =>\n createSlider(\n computed(() => {\n const own = props.get()\n return { ...own, value: read(own.value), defaultValue: read(own.defaultValue) }\n }),\n { field: fieldAround(host) }\n ),\n changes: {\n onValueChange: { event: \"value-change\", prop: \"value\" },\n onValueCommitted: { event: \"value-committed\", prop: \"value\", hold: false },\n },\n parts: {\n root: (controller) => controller.root,\n value: (controller) => ({ part: controller.value, text: controller.text }),\n control: (controller) => controller.control,\n track: (controller) => controller.track,\n indicator: (controller) => controller.indicator,\n thumb: (controller, element) => ({\n part: controller.thumb(at(element)),\n inner: controller.thumbInput(at(element)),\n }),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-slider\": ElementOf<\n typeof tag,\n {\n \"value-change\": [\"onValueChange\", \"value\"]\n \"value-committed\": [\"onValueCommitted\", \"value\"]\n }\n >\n }\n}\n"],"mappings":";;;;;;AASA,MAAM,QAAQ,UACZ,OAAO,UAAU,WACb,MAAM,SAAS,GAAG,IAChB,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,IAC3B,OAAO,KAAK,IACb;AAGP,MAAM,MAAM,YACV,QAAQ,aAAa,WAAW,IAAI,OAAO,QAAQ,aAAa,WAAW,CAAC,IAAI,SAAS,OAAO;;;;;;;;;AAelG,MAAa,MAAM,cAA6B;CAC9C,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,KAAK;EACL,KAAK;EACL,MAAM;EACN,cAAc;EACd,4BAA4B;EAC5B,mBAAmB;EACnB,aAAa;EACb,UAAU;EACV,MAAM;EACN,MAAM;EACN,QAAQ;CACV;CACA,YAAY,CAAC,UAAU,kBAAkB;CACzC,SAAS,OAAO,SACd,aACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,OAAO;GAAE,GAAG;GAAK,OAAO,KAAK,IAAI,KAAK;GAAG,cAAc,KAAK,IAAI,YAAY;EAAE;CAChF,CAAC,GACD,EAAE,OAAO,YAAY,IAAI,EAAE,CAC7B;CACF,SAAS;EACP,eAAe;GAAE,OAAO;GAAgB,MAAM;EAAQ;EACtD,kBAAkB;GAAE,OAAO;GAAmB,MAAM;GAAS,MAAM;EAAM;CAC3E;CACA,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,QAAQ,gBAAgB;GAAE,MAAM,WAAW;GAAO,MAAM,WAAW;EAAK;EACxE,UAAU,eAAe,WAAW;EACpC,QAAQ,eAAe,WAAW;EAClC,YAAY,eAAe,WAAW;EACtC,QAAQ,YAAY,aAAa;GAC/B,MAAM,WAAW,MAAM,GAAG,OAAO,CAAC;GAClC,OAAO,WAAW,WAAW,GAAG,OAAO,CAAC;EAC1C;CACF;AACF,CAAC"}
|
package/src/switch.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { SwitchProps } from "@kirana-ui/core/switch";
|
|
1
3
|
/**
|
|
2
4
|
* `<kui-switch>` around a `kui-part="root"` button with a `thumb` inside. The root draws the
|
|
3
5
|
* hidden native input a form and a label reach. `checked`, `default-checked`, `disabled`,
|
|
4
6
|
* `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.
|
|
5
7
|
*/
|
|
6
|
-
export declare const tag:
|
|
8
|
+
export declare const tag: Tag<{
|
|
9
|
+
id: string;
|
|
10
|
+
}, import("@kirana-ui/core/switch").Switch>;
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"kui-switch": ElementOf<As<typeof tag, SwitchProps>, {
|
|
14
|
+
"checked-change": ["onCheckedChange", "checked"];
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
7
18
|
//# sourceMappingURL=switch.d.ts.map
|
package/src/switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","names":[],"sources":["../../../../packages/web/src/switch.ts"],"sourcesContent":["import { createSwitch } from \"@kirana-ui/core/switch\"\n\nimport { fieldAround } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\n\n/**\n * `<kui-switch>` around a `kui-part=\"root\"` button with a `thumb` inside. The root draws the\n * hidden native input a form and a label reach. `checked`, `default-checked`, `disabled`,\n * `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.\n */\nexport const tag = defineElement({\n tag: \"kui-switch\",\n props: {\n checked: \"boolean\",\n \"default-checked\": \"boolean\",\n disabled: \"boolean\",\n \"read-only\": \"boolean\",\n required: \"boolean\",\n name: \"string\",\n form: \"string\",\n value: \"string\",\n },\n create: (props, host) => createSwitch(props, { field: fieldAround(host) }),\n changes: { onCheckedChange: { event: \"checked-change\", prop: \"checked\" } },\n parts: {\n root: (controller) => ({ part: controller.root, inner: controller.input }),\n thumb: (controller) => controller.thumb,\n },\n})\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"switch.js","names":[],"sources":["../../../../packages/web/src/switch.ts"],"sourcesContent":["import { createSwitch } from \"@kirana-ui/core/switch\"\nimport type { SwitchProps } from \"@kirana-ui/core/switch\"\n\nimport { fieldAround } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-switch>` around a `kui-part=\"root\"` button with a `thumb` inside. The root draws the\n * hidden native input a form and a label reach. `checked`, `default-checked`, `disabled`,\n * `read-only`, `required`, `name`, `form`, `value`; it tells `checked-change`.\n */\nexport const tag = defineElement({\n tag: \"kui-switch\",\n props: {\n checked: \"boolean\",\n \"default-checked\": \"boolean\",\n disabled: \"boolean\",\n \"read-only\": \"boolean\",\n required: \"boolean\",\n name: \"string\",\n form: \"string\",\n value: \"string\",\n },\n create: (props, host) => createSwitch(props, { field: fieldAround(host) }),\n changes: { onCheckedChange: { event: \"checked-change\", prop: \"checked\" } },\n parts: {\n root: (controller) => ({ part: controller.root, inner: controller.input }),\n thumb: (controller) => controller.thumb,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-switch\": ElementOf<\n As<typeof tag, SwitchProps>,\n { \"checked-change\": [\"onCheckedChange\", \"checked\"] }\n >\n }\n}\n"],"mappings":";;;;;;;;;AAYA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EACL,SAAS;EACT,mBAAmB;EACnB,UAAU;EACV,aAAa;EACb,UAAU;EACV,MAAM;EACN,MAAM;EACN,OAAO;CACT;CACA,SAAS,OAAO,SAAS,aAAa,OAAO,EAAE,OAAO,YAAY,IAAI,EAAE,CAAC;CACzE,SAAS,EAAE,iBAAiB;EAAE,OAAO;EAAkB,MAAM;CAAU,EAAE;CACzE,OAAO;EACL,OAAO,gBAAgB;GAAE,MAAM,WAAW;GAAM,OAAO,WAAW;EAAM;EACxE,QAAQ,eAAe,WAAW;CACpC;AACF,CAAC"}
|
package/src/tabs.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { TabsProps } from "@kirana-ui/core/tabs";
|
|
1
3
|
/**
|
|
2
4
|
* `<kui-tabs>` around `kui-part="root"`, a `list` with a `tab` for each `value` and an
|
|
3
5
|
* `indicator`, and a `panel` for each `value`, in the page while its tab is the active one.
|
|
4
6
|
* `value`, `default-value`, `orientation`; it tells `value-change`.
|
|
5
7
|
*/
|
|
6
|
-
export declare const tag: string
|
|
8
|
+
export declare const tag: Tag<TabsProps<string>, import("@kirana-ui/core/tabs").Tabs<string>>;
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
"kui-tabs": ElementOf<typeof tag, {
|
|
12
|
+
"value-change": ["onValueChange", "value"];
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
7
16
|
//# sourceMappingURL=tabs.d.ts.map
|
package/src/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","names":[],"sources":["../../../../packages/web/src/tabs.ts"],"sourcesContent":["import { createTabs } from \"@kirana-ui/core/tabs\"\nimport type { TabsProps } from \"@kirana-ui/core/tabs\"\n\nimport { defineElement } from \"./runtime.ts\"\n\n/**\n * `<kui-tabs>` around `kui-part=\"root\"`, a `list` with a `tab` for each `value` and an\n * `indicator`, and a `panel` for each `value`, in the page while its tab is the active one.\n * `value`, `default-value`, `orientation`; it tells `value-change`.\n */\nexport const tag = defineElement<TabsProps<string>, ReturnType<typeof createTabs<string>>>({\n tag: \"kui-tabs\",\n props: { value: \"string\", \"default-value\": \"string\", orientation: \"string\" },\n create: (props) => createTabs<string>(props),\n changes: { onValueChange: { event: \"value-change\", prop: \"value\" } },\n parts: {\n root: (controller) => controller.root,\n list: (controller) => controller.list,\n indicator: (controller) => controller.indicator,\n tab: (controller, element) =>\n controller.tab(element.getAttribute(\"kui-value\") ?? \"\", () => ({\n disabled: element.hasAttribute(\"kui-disabled\"),\n })),\n panel: (controller, element) => controller.panel(element.getAttribute(\"kui-value\") ?? \"\"),\n },\n})\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"tabs.js","names":[],"sources":["../../../../packages/web/src/tabs.ts"],"sourcesContent":["import { createTabs } from \"@kirana-ui/core/tabs\"\nimport type { TabsProps } from \"@kirana-ui/core/tabs\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-tabs>` around `kui-part=\"root\"`, a `list` with a `tab` for each `value` and an\n * `indicator`, and a `panel` for each `value`, in the page while its tab is the active one.\n * `value`, `default-value`, `orientation`; it tells `value-change`.\n */\nexport const tag = defineElement<TabsProps<string>, ReturnType<typeof createTabs<string>>>({\n tag: \"kui-tabs\",\n props: { value: \"string\", \"default-value\": \"string\", orientation: \"string\" },\n create: (props) => createTabs<string>(props),\n changes: { onValueChange: { event: \"value-change\", prop: \"value\" } },\n parts: {\n root: (controller) => controller.root,\n list: (controller) => controller.list,\n indicator: (controller) => controller.indicator,\n tab: (controller, element) =>\n controller.tab(element.getAttribute(\"kui-value\") ?? \"\", () => ({\n disabled: element.hasAttribute(\"kui-disabled\"),\n })),\n panel: (controller, element) => controller.panel(element.getAttribute(\"kui-value\") ?? \"\"),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-tabs\": ElementOf<typeof tag, { \"value-change\": [\"onValueChange\", \"value\"] }>\n }\n}\n"],"mappings":";;;;;;;;AAWA,MAAa,MAAM,cAAwE;CACzF,KAAK;CACL,OAAO;EAAE,OAAO;EAAU,iBAAiB;EAAU,aAAa;CAAS;CAC3E,SAAS,UAAU,WAAmB,KAAK;CAC3C,SAAS,EAAE,eAAe;EAAE,OAAO;EAAgB,MAAM;CAAQ,EAAE;CACnE,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,OAAO,eAAe,WAAW;EACjC,YAAY,eAAe,WAAW;EACtC,MAAM,YAAY,YAChB,WAAW,IAAI,QAAQ,aAAa,WAAW,KAAK,WAAW,EAC7D,UAAU,QAAQ,aAAa,cAAc,EAC/C,EAAE;EACJ,QAAQ,YAAY,YAAY,WAAW,MAAM,QAAQ,aAAa,WAAW,KAAK,EAAE;CAC1F;AACF,CAAC"}
|
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,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { Toast, ToastActionOptions, ToastOptions, ToastProps, ToastRecord, ToastState, Toaster, ToasterOptions, createToaster } from "@kirana-ui/core/toast";
|
|
2
3
|
/**
|
|
3
4
|
* The toaster a `<kui-toast>` draws: its own (made with the element's `duration` and
|
|
4
5
|
* `limit`), unless it was given one as its `toaster` property before it began.
|
|
@@ -7,11 +8,23 @@ import { Toaster, createToaster } from "@kirana-ui/core/toast";
|
|
|
7
8
|
export declare function toasterOf(element: Element): Toaster;
|
|
8
9
|
/**
|
|
9
10
|
* `<kui-toast>` around a `kui-part="viewport"`, which holds a `<template kui-each="toasts">`
|
|
10
|
-
* with a `toast` for each message (`{id}`, `{
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* with a `toast` for each message (`{id}`, `{type}`), its `content` with a `title` and a
|
|
12
|
+
* `description`, and a `close` and an `action` button. A `title`, a `description` and an
|
|
13
|
+
* `action` written empty say what the toast was added with, and are in the page only for a
|
|
14
|
+
* toast that has one; one written with something in it (`{title}`) is always there. `label`,
|
|
15
|
+
* `hotkey`, `swipe-direction`; `duration` and `limit` for the toaster it makes, or `toaster`
|
|
16
|
+
* as a property for one of the page's own. A title, a description and an action's label are
|
|
17
|
+
* strings.
|
|
14
18
|
*/
|
|
15
|
-
export declare const tag: string
|
|
16
|
-
|
|
19
|
+
export declare const tag: Tag<Omit<ToastProps<string>, "toaster"> & {
|
|
20
|
+
toaster?: Toaster;
|
|
21
|
+
duration?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}, Toast<string>>;
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
"kui-toast": ElementOf<typeof tag>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export { type ToastActionOptions, type ToastOptions, type ToastRecord, type ToastState, type Toaster, type ToasterOptions, createToaster };
|
|
17
30
|
//# sourceMappingURL=toast.d.ts.map
|
package/src/toast.js
CHANGED
|
@@ -24,11 +24,32 @@ const partsOf = (controller, element) => {
|
|
|
24
24
|
return toast && controller.toast(toast.id);
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
+
* A part that says something of the toast's, when the page wrote nothing in its element: the
|
|
28
|
+
* text the toast was added with, and out of the page while the toast has none. What the page
|
|
29
|
+
* wrote there (`{title}`) stays the page's.
|
|
30
|
+
*/
|
|
31
|
+
const said = (name) => (controller, element) => {
|
|
32
|
+
const parts = partsOf(controller, element);
|
|
33
|
+
if (!parts || element.childNodes.length > 0) return parts?.[name];
|
|
34
|
+
const text = computed(() => {
|
|
35
|
+
const toast = parts.record.get();
|
|
36
|
+
return name === "action" ? toast?.action?.label : toast?.[name];
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
part: parts[name],
|
|
40
|
+
text,
|
|
41
|
+
mounted: computed(() => text.get() !== void 0)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
27
45
|
* `<kui-toast>` around a `kui-part="viewport"`, which holds a `<template kui-each="toasts">`
|
|
28
|
-
* with a `toast` for each message (`{id}`, `{
|
|
29
|
-
* `
|
|
30
|
-
*
|
|
31
|
-
*
|
|
46
|
+
* with a `toast` for each message (`{id}`, `{type}`), its `content` with a `title` and a
|
|
47
|
+
* `description`, and a `close` and an `action` button. A `title`, a `description` and an
|
|
48
|
+
* `action` written empty say what the toast was added with, and are in the page only for a
|
|
49
|
+
* toast that has one; one written with something in it (`{title}`) is always there. `label`,
|
|
50
|
+
* `hotkey`, `swipe-direction`; `duration` and `limit` for the toaster it makes, or `toaster`
|
|
51
|
+
* as a property for one of the page's own. A title, a description and an action's label are
|
|
52
|
+
* strings.
|
|
32
53
|
*/
|
|
33
54
|
const tag = defineElement({
|
|
34
55
|
tag: "kui-toast",
|
|
@@ -61,10 +82,10 @@ const tag = defineElement({
|
|
|
61
82
|
viewport: (controller) => controller.viewport,
|
|
62
83
|
toast: (controller, element) => partsOf(controller, element)?.root,
|
|
63
84
|
content: (controller, element) => partsOf(controller, element)?.content,
|
|
64
|
-
title: (
|
|
65
|
-
description: (
|
|
85
|
+
title: said("title"),
|
|
86
|
+
description: said("description"),
|
|
66
87
|
close: (controller, element) => partsOf(controller, element)?.close,
|
|
67
|
-
action: (
|
|
88
|
+
action: said("action")
|
|
68
89
|
}
|
|
69
90
|
});
|
|
70
91
|
export { createToaster, tag, toasterOf };
|
package/src/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","names":[],"sources":["../../../../packages/web/src/toast.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createToast, createToaster } from \"@kirana-ui/core/toast\"\nimport type { Toast, ToastProps, ToastRecord, Toaster } from \"@kirana-ui/core/toast\"\n\nimport { defineElement, entryAround } from \"./runtime.ts\"\n\nconst toasters = new WeakMap<Element, Toaster>()\n\n/**\n * The toaster a `<kui-toast>` draws: its own (made with the element's `duration` and\n * `limit`), unless it was given one as its `toaster` property before it began.\n * `toasterOf(element).add({ title: \"Saved\" })`.\n */\nexport function toasterOf(element: Element): Toaster {\n let toaster = toasters.get(element)\n if (!toaster) {\n const number = (name: string) =>\n element.hasAttribute(name) ? { [name]: Number(element.getAttribute(name)) } : {}\n toasters.set(element, (toaster = createToaster({ ...number(\"duration\"), ...number(\"limit\") })))\n }\n return toaster\n}\n\nconst partsOf = (controller: Toast, element: HTMLElement) => {\n const toast = entryAround<ToastRecord>(element)\n return toast && controller.toast(toast.id)\n}\n\n/**\n * `<kui-toast>` around a `kui-part=\"viewport\"`, which holds a `<template kui-each=\"toasts\">`\n * with a `toast` for each message (`{id}`, `{
|
|
1
|
+
{"version":3,"file":"toast.js","names":[],"sources":["../../../../packages/web/src/toast.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport type { Part } from \"@kirana-ui/core\"\nimport { createToast, createToaster } from \"@kirana-ui/core/toast\"\nimport type { Toast, ToastProps, ToastRecord, Toaster } from \"@kirana-ui/core/toast\"\n\nimport { defineElement, entryAround } from \"./runtime.ts\"\nimport type { Drawn, ElementOf } from \"./runtime.ts\"\n\nconst toasters = new WeakMap<Element, Toaster>()\n\n/**\n * The toaster a `<kui-toast>` draws: its own (made with the element's `duration` and\n * `limit`), unless it was given one as its `toaster` property before it began.\n * `toasterOf(element).add({ title: \"Saved\" })`.\n */\nexport function toasterOf(element: Element): Toaster {\n let toaster = toasters.get(element)\n if (!toaster) {\n const number = (name: string) =>\n element.hasAttribute(name) ? { [name]: Number(element.getAttribute(name)) } : {}\n toasters.set(element, (toaster = createToaster({ ...number(\"duration\"), ...number(\"limit\") })))\n }\n return toaster\n}\n\nconst partsOf = (controller: Toast, element: HTMLElement) => {\n const toast = entryAround<ToastRecord>(element)\n return toast && controller.toast(toast.id)\n}\n\n/**\n * A part that says something of the toast's, when the page wrote nothing in its element: the\n * text the toast was added with, and out of the page while the toast has none. What the page\n * wrote there (`{title}`) stays the page's.\n */\nconst said =\n (name: \"title\" | \"description\" | \"action\") =>\n (controller: Toast, element: HTMLElement): Part | Drawn | undefined => {\n const parts = partsOf(controller, element)\n if (!parts || element.childNodes.length > 0) return parts?.[name]\n const text = computed(() => {\n const toast = parts.record.get()\n return name === \"action\" ? toast?.action?.label : toast?.[name]\n })\n return { part: parts[name], text, mounted: computed(() => text.get() !== undefined) }\n }\n\n/**\n * `<kui-toast>` around a `kui-part=\"viewport\"`, which holds a `<template kui-each=\"toasts\">`\n * with a `toast` for each message (`{id}`, `{type}`), its `content` with a `title` and a\n * `description`, and a `close` and an `action` button. A `title`, a `description` and an\n * `action` written empty say what the toast was added with, and are in the page only for a\n * toast that has one; one written with something in it (`{title}`) is always there. `label`,\n * `hotkey`, `swipe-direction`; `duration` and `limit` for the toaster it makes, or `toaster`\n * as a property for one of the page's own. A title, a description and an action's label are\n * strings.\n */\nexport const tag = defineElement<\n Omit<ToastProps, \"toaster\"> & { toaster?: Toaster; duration?: number; limit?: number },\n Toast\n>({\n tag: \"kui-toast\",\n props: {\n label: \"string\",\n hotkey: \"string\",\n \"swipe-direction\": \"string\",\n duration: \"number\",\n limit: \"number\",\n },\n properties: [\"toaster\"],\n create(props, host) {\n const given = props.peek().toaster\n if (given) toasters.set(host, given)\n const toaster = toasterOf(host)\n return createToast(\n computed(() => {\n const { duration: _duration, limit: _limit, ...own } = props.get()\n return { ...own, toaster }\n })\n )\n },\n changes: {},\n lists: {\n toasts: (controller) => ({ entries: controller.toasts, key: (toast: ToastRecord) => toast.id }),\n },\n parts: {\n viewport: (controller) => controller.viewport,\n toast: (controller, element) => partsOf(controller, element)?.root,\n content: (controller, element) => partsOf(controller, element)?.content,\n title: said(\"title\"),\n description: said(\"description\"),\n close: (controller, element) => partsOf(controller, element)?.close,\n action: said(\"action\"),\n },\n})\n\nexport { createToaster }\nexport type { Toaster }\nexport type {\n ToastActionOptions,\n ToastOptions,\n ToastRecord,\n ToastState,\n ToasterOptions,\n} from \"@kirana-ui/core/toast\"\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-toast\": ElementOf<typeof tag>\n }\n}\n"],"mappings":";;;;AAQA,MAAM,2BAAW,IAAI,QAA0B;;;;;;AAO/C,SAAgB,UAAU,SAA2B;CACnD,IAAI,UAAU,SAAS,IAAI,OAAO;CAClC,IAAI,CAAC,SAAS;EACZ,MAAM,UAAU,SACd,QAAQ,aAAa,IAAI,IAAI,GAAG,OAAO,OAAO,QAAQ,aAAa,IAAI,CAAC,EAAE,IAAI,CAAC;EACjF,SAAS,IAAI,SAAU,UAAU,cAAc;GAAE,GAAG,OAAO,UAAU;GAAG,GAAG,OAAO,OAAO;EAAE,CAAC,CAAE;CAChG;CACA,OAAO;AACT;AAEA,MAAM,WAAW,YAAmB,YAAyB;CAC3D,MAAM,QAAQ,YAAyB,OAAO;CAC9C,OAAO,SAAS,WAAW,MAAM,MAAM,EAAE;AAC3C;;;;;;AAOA,MAAM,QACH,UACA,YAAmB,YAAmD;CACrE,MAAM,QAAQ,QAAQ,YAAY,OAAO;CACzC,IAAI,CAAC,SAAS,QAAQ,WAAW,SAAS,GAAG,OAAO,QAAQ;CAC5D,MAAM,OAAO,eAAe;EAC1B,MAAM,QAAQ,MAAM,OAAO,IAAI;EAC/B,OAAO,SAAS,WAAW,OAAO,QAAQ,QAAQ,QAAQ;CAC5D,CAAC;CACD,OAAO;EAAE,MAAM,MAAM;EAAO;EAAM,SAAS,eAAe,KAAK,IAAI,MAAM,KAAA,CAAS;CAAE;AACtF;;;;;;;;;;;AAYF,MAAa,MAAM,cAGjB;CACA,KAAK;CACL,OAAO;EACL,OAAO;EACP,QAAQ;EACR,mBAAmB;EACnB,UAAU;EACV,OAAO;CACT;CACA,YAAY,CAAC,SAAS;CACtB,OAAO,OAAO,MAAM;EAClB,MAAM,QAAQ,MAAM,KAAK,CAAC,CAAC;EAC3B,IAAI,OAAO,SAAS,IAAI,MAAM,KAAK;EACnC,MAAM,UAAU,UAAU,IAAI;EAC9B,OAAO,YACL,eAAe;GACb,MAAM,EAAE,UAAU,WAAW,OAAO,QAAQ,GAAG,QAAQ,MAAM,IAAI;GACjE,OAAO;IAAE,GAAG;IAAK;GAAQ;EAC3B,CAAC,CACH;CACF;CACA,SAAS,CAAC;CACV,OAAO,EACL,SAAS,gBAAgB;EAAE,SAAS,WAAW;EAAQ,MAAM,UAAuB,MAAM;CAAG,GAC/F;CACA,OAAO;EACL,WAAW,eAAe,WAAW;EACrC,QAAQ,YAAY,YAAY,QAAQ,YAAY,OAAO,CAAC,EAAE;EAC9D,UAAU,YAAY,YAAY,QAAQ,YAAY,OAAO,CAAC,EAAE;EAChE,OAAO,KAAK,OAAO;EACnB,aAAa,KAAK,aAAa;EAC/B,QAAQ,YAAY,YAAY,QAAQ,YAAY,OAAO,CAAC,EAAE;EAC9D,QAAQ,KAAK,QAAQ;CACvB;AACF,CAAC"}
|
package/src/toggle-group.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { ToggleGroup, ToggleGroupProps } from "@kirana-ui/core/toggle-group";
|
|
3
|
+
type Props = Omit<ToggleGroupProps<string>, "value" | "defaultValue"> & {
|
|
4
|
+
id: string;
|
|
5
|
+
value?: string | readonly string[];
|
|
6
|
+
defaultValue?: string | readonly string[];
|
|
7
|
+
};
|
|
1
8
|
/**
|
|
2
9
|
* `<kui-toggle-group>` around `kui-part="root"` and its `<kui-toggle>`s, each with a `value`.
|
|
3
10
|
* `value` and `default-value` (the pressed ones, with commas between), `multiple`, `disabled`,
|
|
4
11
|
* `orientation`, `loop`; it tells `value-change`.
|
|
5
12
|
*/
|
|
6
|
-
export declare const tag: string
|
|
13
|
+
export declare const tag: Tag<Props, ToggleGroup<string>>;
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
"kui-toggle-group": ElementOf<typeof tag, {
|
|
17
|
+
"value-change": ["onValueChange", "value"];
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
7
22
|
//# 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/web/src/toggle-group.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createToggleGroup } from \"@kirana-ui/core/toggle-group\"\nimport type { ToggleGroup, ToggleGroupProps } from \"@kirana-ui/core/toggle-group\"\n\nimport { list } from \"./around.ts\"\nimport { controllerAround, defineElement } from \"./runtime.ts\"\n\ntype Props = Omit<ToggleGroupProps<string>, \"value\" | \"defaultValue\"> & {\n id: string\n value?: string | readonly string[]\n defaultValue?: string | readonly string[]\n}\n\n/**\n * `<kui-toggle-group>` around `kui-part=\"root\"` and its `<kui-toggle>`s, each with a `value`.\n * `value` and `default-value` (the pressed ones, with commas between), `multiple`, `disabled`,\n * `orientation`, `loop`; it tells `value-change`.\n */\nexport const tag = defineElement<Props, ToggleGroup<string>>({\n tag: \"kui-toggle-group\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n multiple: \"boolean\",\n disabled: \"boolean\",\n orientation: \"string\",\n loop: \"boolean\",\n },\n create: (props, host) =>\n createToggleGroup<string>(\n computed(() => {\n const own = props.get()\n return { ...own, value: list(own.value), defaultValue: list(own.defaultValue) }\n }),\n { toolbar: controllerAround(host, \"kui-toolbar\") }\n ),\n changes: { onValueChange: { event: \"value-change\", prop: \"value\" } },\n parts: { root: (controller) => controller.root },\n})\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toggle-group.js","names":[],"sources":["../../../../packages/web/src/toggle-group.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createToggleGroup } from \"@kirana-ui/core/toggle-group\"\nimport type { ToggleGroup, ToggleGroupProps } from \"@kirana-ui/core/toggle-group\"\n\nimport { list } from \"./around.ts\"\nimport { controllerAround, defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\ntype Props = Omit<ToggleGroupProps<string>, \"value\" | \"defaultValue\"> & {\n id: string\n value?: string | readonly string[]\n defaultValue?: string | readonly string[]\n}\n\n/**\n * `<kui-toggle-group>` around `kui-part=\"root\"` and its `<kui-toggle>`s, each with a `value`.\n * `value` and `default-value` (the pressed ones, with commas between), `multiple`, `disabled`,\n * `orientation`, `loop`; it tells `value-change`.\n */\nexport const tag = defineElement<Props, ToggleGroup<string>>({\n tag: \"kui-toggle-group\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n multiple: \"boolean\",\n disabled: \"boolean\",\n orientation: \"string\",\n loop: \"boolean\",\n },\n create: (props, host) =>\n createToggleGroup<string>(\n computed(() => {\n const own = props.get()\n return { ...own, value: list(own.value), defaultValue: list(own.defaultValue) }\n }),\n { toolbar: controllerAround(host, \"kui-toolbar\") }\n ),\n changes: { onValueChange: { event: \"value-change\", prop: \"value\" } },\n parts: { root: (controller) => controller.root },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-toggle-group\": ElementOf<typeof tag, { \"value-change\": [\"onValueChange\", \"value\"] }>\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,MAAM,cAA0C;CAC3D,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,UAAU;EACV,UAAU;EACV,aAAa;EACb,MAAM;CACR;CACA,SAAS,OAAO,SACd,kBACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,OAAO;GAAE,GAAG;GAAK,OAAO,KAAK,IAAI,KAAK;GAAG,cAAc,KAAK,IAAI,YAAY;EAAE;CAChF,CAAC,GACD,EAAE,SAAS,iBAAiB,MAAM,aAAa,EAAE,CACnD;CACF,SAAS,EAAE,eAAe;EAAE,OAAO;EAAgB,MAAM;CAAQ,EAAE;CACnE,OAAO,EAAE,OAAO,eAAe,WAAW,KAAK;AACjD,CAAC"}
|
package/src/toggle.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { ToggleProps } from "@kirana-ui/core/toggle";
|
|
1
3
|
/**
|
|
2
4
|
* `<kui-toggle>` around a `kui-part="root"` button. Inside a `<kui-toggle-group>` it is one of
|
|
3
5
|
* the group's, by its `value`; inside a `<kui-toolbar>`, one of its items. `pressed`,
|
|
4
6
|
* `default-pressed`, `disabled`, `value`; it tells `pressed-change`.
|
|
5
7
|
*/
|
|
6
|
-
export declare const tag:
|
|
8
|
+
export declare const tag: Tag<{
|
|
9
|
+
id: string;
|
|
10
|
+
}, import("@kirana-ui/core/toggle").Toggle>;
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"kui-toggle": ElementOf<As<typeof tag, ToggleProps>, {
|
|
14
|
+
"pressed-change": ["onPressedChange", "pressed"];
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
7
18
|
//# sourceMappingURL=toggle.d.ts.map
|
package/src/toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","names":[],"sources":["../../../../packages/web/src/toggle.ts"],"sourcesContent":["import { createToggle } from \"@kirana-ui/core/toggle\"\nimport type { ToggleAround } from \"@kirana-ui/core/toggle\"\n\nimport { defineElement, hostAround } from \"./runtime.ts\"\n\ntype Group = NonNullable<ToggleAround[\"group\"]>\ntype Toolbar = NonNullable<ToggleAround[\"toolbar\"]>\n\n/**\n * `<kui-toggle>` around a `kui-part=\"root\"` button. Inside a `<kui-toggle-group>` it is one of\n * the group's, by its `value`; inside a `<kui-toolbar>`, one of its items. `pressed`,\n * `default-pressed`, `disabled`, `value`; it tells `pressed-change`.\n */\nexport const tag = defineElement({\n tag: \"kui-toggle\",\n props: { pressed: \"boolean\", \"default-pressed\": \"boolean\", disabled: \"boolean\", value: \"string\" },\n create(props, host) {\n // The nearer of the two: a group around a toolbar is not the group of the toolbar's toggles.\n const around = hostAround(host, [\"kui-toggle-group\", \"kui-toolbar\"])\n return createToggle(props as never, {\n group: around?.tag === \"kui-toggle-group\" ? (around.controller as Group) : undefined,\n toolbar: around?.tag === \"kui-toolbar\" ? (around.controller as Toolbar) : undefined,\n })\n },\n changes: { onPressedChange: { event: \"pressed-change\", prop: \"pressed\" } },\n parts: { root: (controller) => controller.root },\n})\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"toggle.js","names":[],"sources":["../../../../packages/web/src/toggle.ts"],"sourcesContent":["import { createToggle } from \"@kirana-ui/core/toggle\"\nimport type { ToggleAround, ToggleProps } from \"@kirana-ui/core/toggle\"\n\nimport { defineElement, hostAround } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\ntype Group = NonNullable<ToggleAround[\"group\"]>\ntype Toolbar = NonNullable<ToggleAround[\"toolbar\"]>\n\n/**\n * `<kui-toggle>` around a `kui-part=\"root\"` button. Inside a `<kui-toggle-group>` it is one of\n * the group's, by its `value`; inside a `<kui-toolbar>`, one of its items. `pressed`,\n * `default-pressed`, `disabled`, `value`; it tells `pressed-change`.\n */\nexport const tag = defineElement({\n tag: \"kui-toggle\",\n props: { pressed: \"boolean\", \"default-pressed\": \"boolean\", disabled: \"boolean\", value: \"string\" },\n create(props, host) {\n // The nearer of the two: a group around a toolbar is not the group of the toolbar's toggles.\n const around = hostAround(host, [\"kui-toggle-group\", \"kui-toolbar\"])\n return createToggle(props as never, {\n group: around?.tag === \"kui-toggle-group\" ? (around.controller as Group) : undefined,\n toolbar: around?.tag === \"kui-toolbar\" ? (around.controller as Toolbar) : undefined,\n })\n },\n changes: { onPressedChange: { event: \"pressed-change\", prop: \"pressed\" } },\n parts: { root: (controller) => controller.root },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-toggle\": ElementOf<\n As<typeof tag, ToggleProps>,\n { \"pressed-change\": [\"onPressedChange\", \"pressed\"] }\n >\n }\n}\n"],"mappings":";;;;;;;;AAcA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EAAE,SAAS;EAAW,mBAAmB;EAAW,UAAU;EAAW,OAAO;CAAS;CAChG,OAAO,OAAO,MAAM;EAElB,MAAM,SAAS,WAAW,MAAM,CAAC,oBAAoB,aAAa,CAAC;EACnE,OAAO,aAAa,OAAgB;GAClC,OAAO,QAAQ,QAAQ,qBAAsB,OAAO,aAAuB,KAAA;GAC3E,SAAS,QAAQ,QAAQ,gBAAiB,OAAO,aAAyB,KAAA;EAC5E,CAAC;CACH;CACA,SAAS,EAAE,iBAAiB;EAAE,OAAO;EAAkB,MAAM;CAAU,EAAE;CACzE,OAAO,EAAE,OAAO,eAAe,WAAW,KAAK;AACjD,CAAC"}
|
package/src/toolbar.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { ToolbarProps } from "@kirana-ui/core/toolbar";
|
|
1
3
|
/**
|
|
2
4
|
* `<kui-toolbar>` around `kui-part="root"` and its items: a `button`, a `link`, an `input`, a
|
|
3
5
|
* `group`, a `separator` (`kui-disabled` on one that is off), and `<kui-toggle>`s and
|
|
4
6
|
* `<kui-toggle-group>`s, which are the toolbar's items too. One stop for Tab; the arrows move
|
|
5
7
|
* between them. `orientation`, `loop`, `disabled`.
|
|
6
8
|
*/
|
|
7
|
-
export declare const tag:
|
|
9
|
+
export declare const tag: Tag<{
|
|
10
|
+
id: string;
|
|
11
|
+
}, import("@kirana-ui/core/toolbar").Toolbar>;
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"kui-toolbar": ElementOf<As<typeof tag, ToolbarProps>>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
8
17
|
//# sourceMappingURL=toolbar.d.ts.map
|
package/src/toolbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","names":[],"sources":["../../../../packages/web/src/toolbar.ts"],"sourcesContent":["import { createToolbar } from \"@kirana-ui/core/toolbar\"\n\nimport { options } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\n\n/**\n * `<kui-toolbar>` around `kui-part=\"root\"` and its items: a `button`, a `link`, an `input`, a\n * `group`, a `separator` (`kui-disabled` on one that is off), and `<kui-toggle>`s and\n * `<kui-toggle-group>`s, which are the toolbar's items too. One stop for Tab; the arrows move\n * between them. `orientation`, `loop`, `disabled`.\n */\nexport const tag = defineElement({\n tag: \"kui-toolbar\",\n props: { orientation: \"string\", loop: \"boolean\", disabled: \"boolean\" },\n create: (props) => createToolbar(props as never),\n changes: {},\n parts: {\n root: (controller) => controller.root,\n button: (controller, element) => controller.button(options(element)),\n input: (controller, element) => controller.input(options(element)),\n group: (controller, element) => controller.group(options(element)),\n link: (controller) => controller.link(),\n separator: (controller) => controller.separator,\n },\n})\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolbar.js","names":[],"sources":["../../../../packages/web/src/toolbar.ts"],"sourcesContent":["import { createToolbar } from \"@kirana-ui/core/toolbar\"\nimport type { ToolbarProps } from \"@kirana-ui/core/toolbar\"\n\nimport { options } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-toolbar>` around `kui-part=\"root\"` and its items: a `button`, a `link`, an `input`, a\n * `group`, a `separator` (`kui-disabled` on one that is off), and `<kui-toggle>`s and\n * `<kui-toggle-group>`s, which are the toolbar's items too. One stop for Tab; the arrows move\n * between them. `orientation`, `loop`, `disabled`.\n */\nexport const tag = defineElement({\n tag: \"kui-toolbar\",\n props: { orientation: \"string\", loop: \"boolean\", disabled: \"boolean\" },\n create: (props) => createToolbar(props as never),\n changes: {},\n parts: {\n root: (controller) => controller.root,\n button: (controller, element) => controller.button(options(element)),\n input: (controller, element) => controller.input(options(element)),\n group: (controller, element) => controller.group(options(element)),\n link: (controller) => controller.link(),\n separator: (controller) => controller.separator,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-toolbar\": ElementOf<As<typeof tag, ToolbarProps>>\n }\n}\n"],"mappings":";;;;;;;;;;AAaA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EAAE,aAAa;EAAU,MAAM;EAAW,UAAU;CAAU;CACrE,SAAS,UAAU,cAAc,KAAc;CAC/C,SAAS,CAAC;CACV,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,SAAS,YAAY,YAAY,WAAW,OAAO,QAAQ,OAAO,CAAC;EACnE,QAAQ,YAAY,YAAY,WAAW,MAAM,QAAQ,OAAO,CAAC;EACjE,QAAQ,YAAY,YAAY,WAAW,MAAM,QAAQ,OAAO,CAAC;EACjE,OAAO,eAAe,WAAW,KAAK;EACtC,YAAY,eAAe,WAAW;CACxC;AACF,CAAC"}
|
package/src/tooltip.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
1
2
|
/**
|
|
2
3
|
* `<kui-tooltip>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its
|
|
3
4
|
* `kui-side` and the like) around the `popup`, which may hold an `arrow`. `open`,
|
|
4
5
|
* `default-open`, `delay`, `close-delay`, `disabled`; it tells `open-change`.
|
|
5
6
|
*/
|
|
6
|
-
export declare const tag:
|
|
7
|
+
export declare const tag: Tag<import("@kirana-ui/core/hover-card").HoverPopupProps, import("@kirana-ui/core/hover-card").HoverPopup>;
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
"kui-tooltip": ElementOf<typeof tag, {
|
|
11
|
+
"open-change": ["onOpenChange", "open"];
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
7
15
|
//# sourceMappingURL=tooltip.d.ts.map
|