@kirana-ui/web 0.0.0 → 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/LICENSE +1 -1
- package/llms.txt +3000 -0
- package/package.json +231 -6
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.d.ts +23 -0
- package/src/accordion.js +68 -0
- package/src/accordion.js.map +1 -0
- package/src/agent.d.ts +1 -0
- package/src/agent.js +1 -0
- package/src/alert-dialog.d.ts +17 -0
- package/src/alert-dialog.js +36 -0
- package/src/alert-dialog.js.map +1 -0
- package/src/around.d.ts +46 -0
- package/src/around.js +95 -0
- package/src/around.js.map +1 -0
- package/src/autocomplete.d.ts +19 -0
- package/src/autocomplete.js +43 -0
- package/src/autocomplete.js.map +1 -0
- package/src/autosize.d.ts +15 -0
- package/src/autosize.js +18 -0
- package/src/autosize.js.map +1 -0
- package/src/avatar.d.ts +19 -0
- package/src/avatar.js +38 -0
- package/src/avatar.js.map +1 -0
- package/src/button.d.ts +15 -0
- package/src/button.js +21 -0
- package/src/button.js.map +1 -0
- package/src/calendar.d.ts +22 -0
- package/src/calendar.js +60 -0
- package/src/calendar.js.map +1 -0
- package/src/carousel.d.ts +16 -0
- package/src/carousel.js +34 -0
- package/src/carousel.js.map +1 -0
- package/src/checkbox.d.ts +19 -0
- package/src/checkbox.js +42 -0
- package/src/checkbox.js.map +1 -0
- package/src/collapsible.d.ts +16 -0
- package/src/collapsible.js +32 -0
- package/src/collapsible.js.map +1 -0
- package/src/combobox.d.ts +44 -0
- package/src/combobox.js +124 -0
- package/src/combobox.js.map +1 -0
- package/src/command.d.ts +20 -0
- package/src/command.js +61 -0
- package/src/command.js.map +1 -0
- package/src/context-menu.d.ts +18 -0
- package/src/context-menu.js +11 -0
- package/src/context-menu.js.map +1 -0
- package/src/date-field.d.ts +18 -0
- package/src/date-field.js +41 -0
- package/src/date-field.js.map +1 -0
- package/src/date-picker.d.ts +23 -0
- package/src/date-picker.js +69 -0
- package/src/date-picker.js.map +1 -0
- package/src/dates.d.ts +19 -0
- package/src/dates.js +70 -0
- package/src/dates.js.map +1 -0
- package/src/dialog.d.ts +19 -0
- package/src/dialog.js +40 -0
- package/src/dialog.js.map +1 -0
- package/src/drawer.d.ts +24 -0
- package/src/drawer.js +62 -0
- package/src/drawer.js.map +1 -0
- package/src/field.d.ts +16 -0
- package/src/field.js +47 -0
- package/src/field.js.map +1 -0
- package/src/fieldset.d.ts +12 -0
- package/src/fieldset.js +17 -0
- package/src/fieldset.js.map +1 -0
- package/src/form.d.ts +19 -0
- package/src/form.js +30 -0
- package/src/form.js.map +1 -0
- package/src/hover-card.d.ts +15 -0
- package/src/hover-card.js +12 -0
- package/src/hover-card.js.map +1 -0
- package/src/hover-popup.d.ts +6 -0
- package/src/hover-popup.js +37 -0
- package/src/hover-popup.js.map +1 -0
- package/src/index.d.ts +60 -0
- package/src/index.js +49 -0
- package/src/input.d.ts +17 -0
- package/src/input.js +22 -0
- package/src/input.js.map +1 -0
- package/src/label.d.ts +11 -0
- package/src/label.js +15 -0
- package/src/label.js.map +1 -0
- package/src/listbox.d.ts +22 -0
- package/src/listbox.js +54 -0
- package/src/listbox.js.map +1 -0
- package/src/menu.d.ts +26 -0
- package/src/menu.js +133 -0
- package/src/menu.js.map +1 -0
- package/src/menubar.d.ts +16 -0
- package/src/menubar.js +22 -0
- package/src/menubar.js.map +1 -0
- package/src/message-scroller.d.ts +16 -0
- package/src/message-scroller.js +30 -0
- package/src/message-scroller.js.map +1 -0
- package/src/meter.d.ts +16 -0
- package/src/meter.js +40 -0
- package/src/meter.js.map +1 -0
- package/src/navigation-menu.d.ts +20 -0
- package/src/navigation-menu.js +71 -0
- package/src/navigation-menu.js.map +1 -0
- package/src/number-field.d.ts +21 -0
- package/src/number-field.js +57 -0
- package/src/number-field.js.map +1 -0
- package/src/otp.d.ts +19 -0
- package/src/otp.js +64 -0
- package/src/otp.js.map +1 -0
- package/src/pagination.d.ts +18 -0
- package/src/pagination.js +45 -0
- package/src/pagination.js.map +1 -0
- package/src/popover.d.ts +20 -0
- package/src/popover.js +34 -0
- package/src/popover.js.map +1 -0
- package/src/progress.d.ts +16 -0
- package/src/progress.js +40 -0
- package/src/progress.js.map +1 -0
- package/src/qr-code.d.ts +13 -0
- package/src/qr-code.js +24 -0
- package/src/qr-code.js.map +1 -0
- package/src/radio-group.d.ts +17 -0
- package/src/radio-group.js +40 -0
- package/src/radio-group.js.map +1 -0
- package/src/resizable.d.ts +16 -0
- package/src/resizable.js +38 -0
- package/src/resizable.js.map +1 -0
- package/src/runtime.d.ts +157 -0
- package/src/runtime.js +477 -0
- package/src/runtime.js.map +1 -0
- package/src/scroll-area.d.ts +18 -0
- package/src/scroll-area.js +37 -0
- package/src/scroll-area.js.map +1 -0
- package/src/select.d.ts +33 -0
- package/src/select.js +107 -0
- package/src/select.js.map +1 -0
- package/src/separator.d.ts +12 -0
- package/src/separator.js +14 -0
- package/src/separator.js.map +1 -0
- package/src/slider.d.ts +25 -0
- package/src/slider.js +71 -0
- package/src/slider.js.map +1 -0
- package/src/switch.d.ts +18 -0
- package/src/switch.js +37 -0
- package/src/switch.js.map +1 -0
- package/src/tabs.d.ts +16 -0
- package/src/tabs.js +31 -0
- package/src/tabs.js.map +1 -0
- package/src/testing.d.ts +1 -0
- package/src/testing.js +1 -0
- package/src/toast.d.ts +30 -0
- package/src/toast.js +93 -0
- package/src/toast.js.map +1 -0
- package/src/toggle-group.d.ts +22 -0
- package/src/toggle-group.js +37 -0
- package/src/toggle-group.js.map +1 -0
- package/src/toggle.d.ts +18 -0
- package/src/toggle.js +32 -0
- package/src/toggle.js.map +1 -0
- package/src/toolbar.d.ts +17 -0
- package/src/toolbar.js +31 -0
- package/src/toolbar.js.map +1 -0
- package/src/tooltip.d.ts +15 -0
- package/src/tooltip.js +12 -0
- package/src/tooltip.js.map +1 -0
- package/README.md +0 -7
- package/index.js +0 -5
package/src/listbox.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { list, once, options, valueOf } from "./around.js";
|
|
2
|
+
import { defineElement, partAround } from "./runtime.js";
|
|
3
|
+
import { computed } from "@kirana-ui/core";
|
|
4
|
+
import { createListbox } from "@kirana-ui/core/listbox";
|
|
5
|
+
// src/listbox.ts
|
|
6
|
+
const groups = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let made = 0;
|
|
8
|
+
const groupOf = (controller, element) => once(groups, partAround(element, "group"), (around) => controller.group(around.getAttribute("kui-id") ?? `kui-group-${++made}`));
|
|
9
|
+
/**
|
|
10
|
+
* `<kui-listbox>` around `kui-part="root"` and an `item` for each `kui-value`
|
|
11
|
+
* (`kui-disabled`, `kui-label`), which may hold an `indicator`, in the page while the item is
|
|
12
|
+
* chosen. Items may be in a `group` with its `group-label`. `value` and `default-value` (with
|
|
13
|
+
* commas between), `multiple`, `disabled`, `loop`, `name`, `form`; it tells `value-change`.
|
|
14
|
+
*/
|
|
15
|
+
const tag = defineElement({
|
|
16
|
+
tag: "kui-listbox",
|
|
17
|
+
props: {
|
|
18
|
+
value: "string",
|
|
19
|
+
"default-value": "string",
|
|
20
|
+
multiple: "boolean",
|
|
21
|
+
disabled: "boolean",
|
|
22
|
+
loop: "boolean",
|
|
23
|
+
name: "string",
|
|
24
|
+
form: "string"
|
|
25
|
+
},
|
|
26
|
+
create: (props) => createListbox(computed(() => {
|
|
27
|
+
const own = props.get();
|
|
28
|
+
return {
|
|
29
|
+
...own,
|
|
30
|
+
value: list(own.value),
|
|
31
|
+
defaultValue: list(own.defaultValue)
|
|
32
|
+
};
|
|
33
|
+
})),
|
|
34
|
+
changes: { onValueChange: {
|
|
35
|
+
event: "value-change",
|
|
36
|
+
prop: "value"
|
|
37
|
+
} },
|
|
38
|
+
parts: {
|
|
39
|
+
root: (controller) => controller.root,
|
|
40
|
+
item: (controller, element) => controller.item(valueOf(element), options(element)),
|
|
41
|
+
indicator(controller, element) {
|
|
42
|
+
const value = valueOf(partAround(element, "item"));
|
|
43
|
+
return {
|
|
44
|
+
part: controller.indicator(value),
|
|
45
|
+
mounted: controller.selected(value)
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
group: (controller, element) => groupOf(controller, element)?.root,
|
|
49
|
+
"group-label": (controller, element) => groupOf(controller, element)?.label
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export { tag };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=listbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../packages/web/src/listbox.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createListbox } from \"@kirana-ui/core/listbox\"\nimport type { Listbox, ListboxGroup, ListboxProps } from \"@kirana-ui/core/listbox\"\n\nimport { list, once, options, valueOf } from \"./around.ts\"\nimport { defineElement, partAround } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\nconst groups = new WeakMap<HTMLElement, ListboxGroup>()\nlet made = 0\nconst groupOf = (controller: Listbox<string>, element: HTMLElement) =>\n once(groups, partAround(element, \"group\"), (around) =>\n controller.group(around.getAttribute(\"kui-id\") ?? `kui-group-${++made}`)\n )\n\ntype Props = Omit<ListboxProps<string>, \"value\" | \"defaultValue\"> & {\n value?: string | readonly string[]\n defaultValue?: string | readonly string[]\n}\n\n/**\n * `<kui-listbox>` around `kui-part=\"root\"` and an `item` for each `kui-value`\n * (`kui-disabled`, `kui-label`), which may hold an `indicator`, in the page while the item is\n * chosen. Items may be in a `group` with its `group-label`. `value` and `default-value` (with\n * commas between), `multiple`, `disabled`, `loop`, `name`, `form`; it tells `value-change`.\n */\nexport const tag = defineElement<Props, Listbox<string>>({\n tag: \"kui-listbox\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n multiple: \"boolean\",\n disabled: \"boolean\",\n loop: \"boolean\",\n name: \"string\",\n form: \"string\",\n },\n create: (props) =>\n createListbox<string>(\n computed(() => {\n const own = props.get()\n return { ...own, value: list(own.value), defaultValue: list(own.defaultValue) }\n })\n ),\n changes: { onValueChange: { event: \"value-change\", prop: \"value\" } },\n parts: {\n root: (controller) => controller.root,\n item: (controller, element) => controller.item(valueOf(element), options(element)),\n indicator(controller, element) {\n const value = valueOf(partAround(element, \"item\"))\n return { part: controller.indicator(value), mounted: controller.selected(value) }\n },\n group: (controller, element) => groupOf(controller, element)?.root,\n \"group-label\": (controller, element) => groupOf(controller, element)?.label,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-listbox\": ElementOf<typeof tag, { \"value-change\": [\"onValueChange\", \"value\"] }>\n }\n}\n"],"mappings":";;;;;AAQA,MAAM,yBAAS,IAAI,QAAmC;AACtD,IAAI,OAAO;AACX,MAAM,WAAW,YAA6B,YAC5C,KAAK,QAAQ,WAAW,SAAS,OAAO,IAAI,WAC1C,WAAW,MAAM,OAAO,aAAa,QAAQ,KAAK,aAAa,EAAE,MAAM,CACzE;;;;;;;AAaF,MAAa,MAAM,cAAsC;CACvD,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,UAAU;EACV,UAAU;EACV,MAAM;EACN,MAAM;EACN,MAAM;CACR;CACA,SAAS,UACP,cACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,OAAO;GAAE,GAAG;GAAK,OAAO,KAAK,IAAI,KAAK;GAAG,cAAc,KAAK,IAAI,YAAY;EAAE;CAChF,CAAC,CACH;CACF,SAAS,EAAE,eAAe;EAAE,OAAO;EAAgB,MAAM;CAAQ,EAAE;CACnE,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,OAAO,YAAY,YAAY,WAAW,KAAK,QAAQ,OAAO,GAAG,QAAQ,OAAO,CAAC;EACjF,UAAU,YAAY,SAAS;GAC7B,MAAM,QAAQ,QAAQ,WAAW,SAAS,MAAM,CAAC;GACjD,OAAO;IAAE,MAAM,WAAW,UAAU,KAAK;IAAG,SAAS,WAAW,SAAS,KAAK;GAAE;EAClF;EACA,QAAQ,YAAY,YAAY,QAAQ,YAAY,OAAO,CAAC,EAAE;EAC9D,gBAAgB,YAAY,YAAY,QAAQ,YAAY,OAAO,CAAC,EAAE;CACxE;AACF,CAAC"}
|
package/src/menu.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Drawn, ElementOf, Tag, Told } from "./runtime.js";
|
|
2
|
+
import { Menu, MenuAround, MenuProps } from "@kirana-ui/core/menu";
|
|
3
|
+
declare const menu: (tag: string, around: (host: HTMLElement) => MenuAround, trigger: (controller: Menu) => Drawn["part"]) => Tag<MenuProps, Menu>;
|
|
4
|
+
/**
|
|
5
|
+
* `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its
|
|
6
|
+
* `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`,
|
|
7
|
+
* `kui-label`, `kui-close-on-click="false"`), `separator`s, `group`s with a `group-label`,
|
|
8
|
+
* `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a
|
|
9
|
+
* `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells
|
|
10
|
+
* `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>`
|
|
11
|
+
* inside a menu is its submenu, its trigger an item of the menu; inside a `<kui-menubar>`, one
|
|
12
|
+
* of the bar's. `open`, `default-open`, `disabled`, `loop`, `modal`; it tells `open-change`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const tag: Tag<MenuProps, Menu>;
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"kui-menu": ElementOf<typeof tag, {
|
|
18
|
+
"open-change": ["onOpenChange", "open"];
|
|
19
|
+
}, {
|
|
20
|
+
"checked-change": Told<"checked", boolean>;
|
|
21
|
+
"value-change": Told<"value", string>;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export { menu as defineMenu };
|
|
26
|
+
//# sourceMappingURL=menu.d.ts.map
|
package/src/menu.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { once, positioner, valueOf } from "./around.js";
|
|
2
|
+
import { defineElement, hostAround, partAround, partProps } from "./runtime.js";
|
|
3
|
+
import { createMenu } from "@kirana-ui/core/menu";
|
|
4
|
+
// src/menu.ts
|
|
5
|
+
const MENUS = ["kui-menu", "kui-context-menu"];
|
|
6
|
+
/** An item's own options: `kui-disabled`, `kui-label`, `kui-close-on-click="false"`. */
|
|
7
|
+
const options = (element) => () => ({
|
|
8
|
+
...element.hasAttribute("kui-disabled") ? { disabled: true } : {},
|
|
9
|
+
...element.hasAttribute("kui-label") ? { label: element.getAttribute("kui-label") } : {},
|
|
10
|
+
...element.hasAttribute("kui-close-on-click") ? { closeOnClick: element.getAttribute("kui-close-on-click") !== "false" } : {}
|
|
11
|
+
});
|
|
12
|
+
const groups = /* @__PURE__ */ new WeakMap();
|
|
13
|
+
const boxes = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
const radios = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
let made = 0;
|
|
16
|
+
const ITEM = {
|
|
17
|
+
disabled: "boolean",
|
|
18
|
+
label: "string",
|
|
19
|
+
"close-on-click": "boolean"
|
|
20
|
+
};
|
|
21
|
+
const boxOf = (menu, element) => once(boxes, element, (item) => {
|
|
22
|
+
const { props, mount } = partProps(item, {
|
|
23
|
+
...ITEM,
|
|
24
|
+
checked: "boolean",
|
|
25
|
+
"default-checked": "boolean"
|
|
26
|
+
}, { onCheckedChange: {
|
|
27
|
+
event: "checked-change",
|
|
28
|
+
prop: "checked"
|
|
29
|
+
} });
|
|
30
|
+
const controller = menu.checkboxItem(props);
|
|
31
|
+
return {
|
|
32
|
+
controller,
|
|
33
|
+
mount: both(mount, () => controller.mount())
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const radioOf = (menu, element) => once(radios, element, (group) => {
|
|
37
|
+
const { props, mount } = partProps(group, {
|
|
38
|
+
value: "string",
|
|
39
|
+
"default-value": "string",
|
|
40
|
+
disabled: "boolean"
|
|
41
|
+
}, { onValueChange: {
|
|
42
|
+
event: "value-change",
|
|
43
|
+
prop: "value"
|
|
44
|
+
} });
|
|
45
|
+
const controller = menu.radioGroup(props);
|
|
46
|
+
return {
|
|
47
|
+
controller,
|
|
48
|
+
mount: both(mount, () => controller.mount())
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const both = (one, other) => () => {
|
|
52
|
+
const stops = [one(), other()];
|
|
53
|
+
return () => stops.forEach((stop) => stop());
|
|
54
|
+
};
|
|
55
|
+
/** A menu's parts but for its trigger, which a context menu has as an area. */
|
|
56
|
+
const PARTS = {
|
|
57
|
+
positioner,
|
|
58
|
+
popup: (controller) => controller.popup,
|
|
59
|
+
arrow: (controller) => controller.arrow,
|
|
60
|
+
separator: (controller) => controller.separator,
|
|
61
|
+
item: (controller, element) => controller.item(options(element)),
|
|
62
|
+
group: (controller, element) => once(groups, element, (group) => controller.group(group.getAttribute("kui-id") ?? `kui-menu-group-${++made}`))?.root,
|
|
63
|
+
"group-label": (controller, element) => groups.get(partAround(element, "group"))?.label ?? controller.label,
|
|
64
|
+
"checkbox-item"(controller, element) {
|
|
65
|
+
const box = boxOf(controller, element);
|
|
66
|
+
return {
|
|
67
|
+
part: box.controller.part,
|
|
68
|
+
mount: box.mount
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
"checkbox-item-indicator"(controller, element) {
|
|
72
|
+
const box = boxOf(controller, partAround(element, "checkbox-item"));
|
|
73
|
+
return box && {
|
|
74
|
+
part: box.controller.indicator,
|
|
75
|
+
mounted: box.controller.checked
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
"radio-group"(controller, element) {
|
|
79
|
+
const group = radioOf(controller, element);
|
|
80
|
+
return {
|
|
81
|
+
part: group.controller.root,
|
|
82
|
+
mount: group.mount
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
"radio-item"(controller, element) {
|
|
86
|
+
return radioOf(controller, partAround(element, "radio-group"))?.controller.item(valueOf(element), options(element));
|
|
87
|
+
},
|
|
88
|
+
"radio-item-indicator"(controller, element) {
|
|
89
|
+
const group = radioOf(controller, partAround(element, "radio-group"))?.controller;
|
|
90
|
+
const value = valueOf(partAround(element, "radio-item"));
|
|
91
|
+
return group && {
|
|
92
|
+
part: group.indicator(value),
|
|
93
|
+
mounted: group.checked(value)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const PROPS = {
|
|
98
|
+
open: "boolean",
|
|
99
|
+
"default-open": "boolean",
|
|
100
|
+
disabled: "boolean",
|
|
101
|
+
loop: "boolean",
|
|
102
|
+
modal: "boolean"
|
|
103
|
+
};
|
|
104
|
+
const menu = (tag, around, trigger) => defineElement({
|
|
105
|
+
tag,
|
|
106
|
+
props: PROPS,
|
|
107
|
+
create: (props, host) => createMenu(props, around(host)),
|
|
108
|
+
changes: { onOpenChange: {
|
|
109
|
+
event: "open-change",
|
|
110
|
+
prop: "open"
|
|
111
|
+
} },
|
|
112
|
+
parts: {
|
|
113
|
+
...PARTS,
|
|
114
|
+
trigger
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its
|
|
119
|
+
* `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`,
|
|
120
|
+
* `kui-label`, `kui-close-on-click="false"`), `separator`s, `group`s with a `group-label`,
|
|
121
|
+
* `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a
|
|
122
|
+
* `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells
|
|
123
|
+
* `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>`
|
|
124
|
+
* inside a menu is its submenu, its trigger an item of the menu; inside a `<kui-menubar>`, one
|
|
125
|
+
* of the bar's. `open`, `default-open`, `disabled`, `loop`, `modal`; it tells `open-change`.
|
|
126
|
+
*/
|
|
127
|
+
const tag = menu("kui-menu", (host) => {
|
|
128
|
+
const around = hostAround(host, [...MENUS, "kui-menubar"]);
|
|
129
|
+
return around?.tag === "kui-menubar" ? { menubar: around.controller } : around ? { parent: around.controller } : {};
|
|
130
|
+
}, (controller) => controller.trigger);
|
|
131
|
+
export { menu as defineMenu, tag };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=menu.js.map
|
package/src/menu.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","names":[],"sources":["../../../../packages/web/src/menu.ts"],"sourcesContent":["import type { ReadonlySignal } from \"@kirana-ui/core\"\nimport { createMenu } from \"@kirana-ui/core/menu\"\nimport type {\n Menu,\n MenuAround,\n MenuCheckboxItem,\n MenuCheckboxItemProps,\n MenuGroup,\n MenuProps,\n MenuRadioGroup,\n MenuRadioGroupProps,\n} from \"@kirana-ui/core/menu\"\n\nimport { once, positioner, valueOf } from \"./around.ts\"\nimport { defineElement, hostAround, partAround, partProps } from \"./runtime.ts\"\nimport type { Drawn, ElementOf, Told } from \"./runtime.ts\"\n\nconst MENUS = [\"kui-menu\", \"kui-context-menu\"]\n\n/** An item's own options: `kui-disabled`, `kui-label`, `kui-close-on-click=\"false\"`. */\nconst options = (element: HTMLElement) => () => ({\n ...(element.hasAttribute(\"kui-disabled\") ? { disabled: true } : {}),\n ...(element.hasAttribute(\"kui-label\") ? { label: element.getAttribute(\"kui-label\")! } : {}),\n ...(element.hasAttribute(\"kui-close-on-click\")\n ? { closeOnClick: element.getAttribute(\"kui-close-on-click\") !== \"false\" }\n : {}),\n})\n\ninterface Made<Controller> {\n controller: Controller\n mount(): () => void\n}\nconst groups = new WeakMap<HTMLElement, MenuGroup>()\nconst boxes = new WeakMap<HTMLElement, Made<MenuCheckboxItem>>()\nconst radios = new WeakMap<HTMLElement, Made<MenuRadioGroup<string>>>()\nlet made = 0\n\nconst ITEM = { disabled: \"boolean\", label: \"string\", \"close-on-click\": \"boolean\" } as const\n\nconst boxOf = (menu: Menu, element: HTMLElement | null) =>\n once(boxes, element, (item) => {\n const { props, mount } = partProps<MenuCheckboxItemProps>(\n item,\n { ...ITEM, checked: \"boolean\", \"default-checked\": \"boolean\" },\n { onCheckedChange: { event: \"checked-change\", prop: \"checked\" } }\n )\n const controller = menu.checkboxItem(props)\n return { controller, mount: both(mount, () => controller.mount()) }\n })\n\nconst radioOf = (menu: Menu, element: HTMLElement | null) =>\n once(radios, element, (group) => {\n const { props, mount } = partProps<MenuRadioGroupProps<string>>(\n group,\n { value: \"string\", \"default-value\": \"string\", disabled: \"boolean\" },\n { onValueChange: { event: \"value-change\", prop: \"value\" } }\n )\n const controller = menu.radioGroup<string>(props)\n return { controller, mount: both(mount, () => controller.mount()) }\n })\n\nconst both = (one: () => () => void, other: () => () => void) => () => {\n const stops = [one(), other()]\n return () => stops.forEach((stop) => stop())\n}\n\ntype Parts = Record<\n string,\n (controller: Menu, element: HTMLElement) => Drawn[\"part\"] | Drawn | undefined\n>\n\n/** A menu's parts but for its trigger, which a context menu has as an area. */\nconst PARTS: Parts = {\n positioner,\n popup: (controller) => controller.popup,\n arrow: (controller) => controller.arrow,\n separator: (controller) => controller.separator,\n item: (controller, element) => controller.item(options(element)),\n group: (controller, element) =>\n once(groups, element, (group) =>\n controller.group(group.getAttribute(\"kui-id\") ?? `kui-menu-group-${++made}`)\n )?.root,\n // With no group around it, it is plain text.\n \"group-label\": (controller, element) =>\n groups.get(partAround(element, \"group\")!)?.label ?? controller.label,\n \"checkbox-item\"(controller, element) {\n const box = boxOf(controller, element)!\n return { part: box.controller.part, mount: box.mount }\n },\n \"checkbox-item-indicator\"(controller, element) {\n const box = boxOf(controller, partAround(element, \"checkbox-item\"))\n return box && { part: box.controller.indicator, mounted: box.controller.checked }\n },\n \"radio-group\"(controller, element) {\n const group = radioOf(controller, element)!\n return { part: group.controller.root, mount: group.mount }\n },\n \"radio-item\"(controller, element) {\n const group = radioOf(controller, partAround(element, \"radio-group\"))\n return group?.controller.item(valueOf(element), options(element))\n },\n \"radio-item-indicator\"(controller, element) {\n const group = radioOf(controller, partAround(element, \"radio-group\"))?.controller\n const value = valueOf(partAround(element, \"radio-item\"))\n return group && { part: group.indicator(value), mounted: group.checked(value) }\n },\n}\n\nconst PROPS = {\n open: \"boolean\",\n \"default-open\": \"boolean\",\n disabled: \"boolean\",\n loop: \"boolean\",\n modal: \"boolean\",\n} as const\n\nconst menu = (\n tag: string,\n around: (host: HTMLElement) => MenuAround,\n trigger: (controller: Menu) => Drawn[\"part\"]\n) =>\n defineElement<MenuProps, Menu>({\n tag,\n props: PROPS,\n create: (props: ReadonlySignal<MenuProps>, host) => createMenu(props, around(host)),\n changes: { onOpenChange: { event: \"open-change\", prop: \"open\" } },\n parts: { ...PARTS, trigger },\n })\n\n/**\n * `<kui-menu>` around a `kui-part=\"trigger\"` and a `portal` with a `positioner` (its\n * `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`,\n * `kui-label`, `kui-close-on-click=\"false\"`), `separator`s, `group`s with a `group-label`,\n * `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a\n * `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells\n * `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>`\n * inside a menu is its submenu, its trigger an item of the menu; inside a `<kui-menubar>`, one\n * of the bar's. `open`, `default-open`, `disabled`, `loop`, `modal`; it tells `open-change`.\n */\nexport const tag = menu(\n \"kui-menu\",\n (host) => {\n // The nearest: a menu written inside a bar's menu is that menu's, not the bar's.\n const around = hostAround(host, [...MENUS, \"kui-menubar\"])\n return around?.tag === \"kui-menubar\"\n ? { menubar: around.controller as NonNullable<MenuAround[\"menubar\"]> }\n : around\n ? { parent: around.controller as Menu }\n : {}\n },\n (controller) => controller.trigger\n)\n\nexport { menu as defineMenu }\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-menu\": ElementOf<\n typeof tag,\n { \"open-change\": [\"onOpenChange\", \"open\"] },\n { \"checked-change\": Told<\"checked\", boolean>; \"value-change\": Told<\"value\", string> }\n >\n }\n}\n"],"mappings":"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"}
|
package/src/menubar.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { MenubarProps } from "@kirana-ui/core/menubar";
|
|
3
|
+
/**
|
|
4
|
+
* `<kui-menubar>` around `kui-part="root"` and its `<kui-menu>`s, which work as one: the
|
|
5
|
+
* arrows move between them, and with one open the pointer opens the next. `loop`, `disabled`,
|
|
6
|
+
* `orientation`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const tag: Tag<{
|
|
9
|
+
id: string;
|
|
10
|
+
}, import("@kirana-ui/core/menubar").Menubar>;
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"kui-menubar": ElementOf<As<typeof tag, MenubarProps>>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=menubar.d.ts.map
|
package/src/menubar.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineElement } from "./runtime.js";
|
|
2
|
+
import { createMenubar } from "@kirana-ui/core/menubar";
|
|
3
|
+
// src/menubar.ts
|
|
4
|
+
/**
|
|
5
|
+
* `<kui-menubar>` around `kui-part="root"` and its `<kui-menu>`s, which work as one: the
|
|
6
|
+
* arrows move between them, and with one open the pointer opens the next. `loop`, `disabled`,
|
|
7
|
+
* `orientation`.
|
|
8
|
+
*/
|
|
9
|
+
const tag = defineElement({
|
|
10
|
+
tag: "kui-menubar",
|
|
11
|
+
props: {
|
|
12
|
+
loop: "boolean",
|
|
13
|
+
disabled: "boolean",
|
|
14
|
+
orientation: "string"
|
|
15
|
+
},
|
|
16
|
+
create: (props) => createMenubar(props),
|
|
17
|
+
changes: {},
|
|
18
|
+
parts: { root: (controller) => controller.root }
|
|
19
|
+
});
|
|
20
|
+
export { tag };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=menubar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar.js","names":[],"sources":["../../../../packages/web/src/menubar.ts"],"sourcesContent":["import { createMenubar } from \"@kirana-ui/core/menubar\"\nimport type { MenubarProps } from \"@kirana-ui/core/menubar\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-menubar>` around `kui-part=\"root\"` and its `<kui-menu>`s, which work as one: the\n * arrows move between them, and with one open the pointer opens the next. `loop`, `disabled`,\n * `orientation`.\n */\nexport const tag = defineElement({\n tag: \"kui-menubar\",\n props: { loop: \"boolean\", disabled: \"boolean\", orientation: \"string\" },\n create: (props) => createMenubar(props),\n changes: {},\n parts: { root: (controller) => controller.root },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-menubar\": ElementOf<As<typeof tag, MenubarProps>>\n }\n}\n"],"mappings":";;;;;;;;AAWA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EAAE,MAAM;EAAW,UAAU;EAAW,aAAa;CAAS;CACrE,SAAS,UAAU,cAAc,KAAK;CACtC,SAAS,CAAC;CACV,OAAO,EAAE,OAAO,eAAe,WAAW,KAAK;AACjD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { MessageScroller, MessageScrollerProps } from "@kirana-ui/core/message-scroller";
|
|
3
|
+
/**
|
|
4
|
+
* `<kui-message-scroller>` around `kui-part="root"`, a `viewport` with its `content`, and a
|
|
5
|
+
* `button` that goes back to the newest. It stays at the bottom as content comes, unless the
|
|
6
|
+
* reader has scrolled away. `initial`, `threshold`; it tells `at-bottom-change`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const tag: Tag<MessageScrollerProps, MessageScroller>;
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
"kui-message-scroller": ElementOf<typeof tag, {
|
|
12
|
+
"at-bottom-change": ["onAtBottomChange", "atBottom"];
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=message-scroller.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineElement } from "./runtime.js";
|
|
2
|
+
import { createMessageScroller } from "@kirana-ui/core/message-scroller";
|
|
3
|
+
// src/message-scroller.ts
|
|
4
|
+
/**
|
|
5
|
+
* `<kui-message-scroller>` around `kui-part="root"`, a `viewport` with its `content`, and a
|
|
6
|
+
* `button` that goes back to the newest. It stays at the bottom as content comes, unless the
|
|
7
|
+
* reader has scrolled away. `initial`, `threshold`; it tells `at-bottom-change`.
|
|
8
|
+
*/
|
|
9
|
+
const tag = defineElement({
|
|
10
|
+
tag: "kui-message-scroller",
|
|
11
|
+
props: {
|
|
12
|
+
initial: "string",
|
|
13
|
+
threshold: "number"
|
|
14
|
+
},
|
|
15
|
+
create: (props) => createMessageScroller(props),
|
|
16
|
+
changes: { onAtBottomChange: {
|
|
17
|
+
event: "at-bottom-change",
|
|
18
|
+
prop: "atBottom",
|
|
19
|
+
hold: false
|
|
20
|
+
} },
|
|
21
|
+
parts: {
|
|
22
|
+
root: (controller) => controller.root,
|
|
23
|
+
viewport: (controller) => controller.viewport,
|
|
24
|
+
content: (controller) => controller.content,
|
|
25
|
+
button: (controller) => controller.button
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export { tag };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=message-scroller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-scroller.js","names":[],"sources":["../../../../packages/web/src/message-scroller.ts"],"sourcesContent":["import { createMessageScroller } from \"@kirana-ui/core/message-scroller\"\nimport type { MessageScroller, MessageScrollerProps } from \"@kirana-ui/core/message-scroller\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-message-scroller>` around `kui-part=\"root\"`, a `viewport` with its `content`, and a\n * `button` that goes back to the newest. It stays at the bottom as content comes, unless the\n * reader has scrolled away. `initial`, `threshold`; it tells `at-bottom-change`.\n */\nexport const tag = defineElement<MessageScrollerProps, MessageScroller>({\n tag: \"kui-message-scroller\",\n props: { initial: \"string\", threshold: \"number\" },\n create: (props) => createMessageScroller(props),\n changes: { onAtBottomChange: { event: \"at-bottom-change\", prop: \"atBottom\", hold: false } },\n parts: {\n root: (controller) => controller.root,\n viewport: (controller) => controller.viewport,\n content: (controller) => controller.content,\n button: (controller) => controller.button,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-message-scroller\": ElementOf<\n typeof tag,\n { \"at-bottom-change\": [\"onAtBottomChange\", \"atBottom\"] }\n >\n }\n}\n"],"mappings":";;;;;;;;AAWA,MAAa,MAAM,cAAqD;CACtE,KAAK;CACL,OAAO;EAAE,SAAS;EAAU,WAAW;CAAS;CAChD,SAAS,UAAU,sBAAsB,KAAK;CAC9C,SAAS,EAAE,kBAAkB;EAAE,OAAO;EAAoB,MAAM;EAAY,MAAM;CAAM,EAAE;CAC1F,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,WAAW,eAAe,WAAW;EACrC,UAAU,eAAe,WAAW;EACpC,SAAS,eAAe,WAAW;CACrC;AACF,CAAC"}
|
package/src/meter.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { MeterProps } from "@kirana-ui/core/meter";
|
|
3
|
+
/**
|
|
4
|
+
* `<kui-meter>` around `kui-part="root"`, a `label`, a `track` with its `indicator`, and a
|
|
5
|
+
* `value`, which says the value as it is written unless the page gave it something to say.
|
|
6
|
+
* `value`, `min`, `max`, `locale`; `format` and `getAriaValueText` as properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare const tag: Tag<{
|
|
9
|
+
id: string;
|
|
10
|
+
}, import("@kirana-ui/core/meter").ValueBar>;
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"kui-meter": ElementOf<As<typeof tag, MeterProps>>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=meter.d.ts.map
|
package/src/meter.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineElement } from "./runtime.js";
|
|
2
|
+
import { computed } from "@kirana-ui/core";
|
|
3
|
+
import { createMeter } from "@kirana-ui/core/meter";
|
|
4
|
+
// src/meter.ts
|
|
5
|
+
/**
|
|
6
|
+
* `<kui-meter>` around `kui-part="root"`, a `label`, a `track` with its `indicator`, and a
|
|
7
|
+
* `value`, which says the value as it is written unless the page gave it something to say.
|
|
8
|
+
* `value`, `min`, `max`, `locale`; `format` and `getAriaValueText` as properties.
|
|
9
|
+
*/
|
|
10
|
+
const tag = defineElement({
|
|
11
|
+
tag: "kui-meter",
|
|
12
|
+
props: {
|
|
13
|
+
value: "number",
|
|
14
|
+
min: "number",
|
|
15
|
+
max: "number",
|
|
16
|
+
locale: "string"
|
|
17
|
+
},
|
|
18
|
+
properties: ["format", "getAriaValueText"],
|
|
19
|
+
create: (props) => createMeter(computed(() => {
|
|
20
|
+
const own = props.get();
|
|
21
|
+
return {
|
|
22
|
+
...own,
|
|
23
|
+
value: own.value ?? 0
|
|
24
|
+
};
|
|
25
|
+
})),
|
|
26
|
+
changes: {},
|
|
27
|
+
parts: {
|
|
28
|
+
root: (controller) => controller.root,
|
|
29
|
+
label: (controller) => controller.label,
|
|
30
|
+
track: (controller) => controller.track,
|
|
31
|
+
indicator: (controller) => controller.indicator,
|
|
32
|
+
value: (controller) => ({
|
|
33
|
+
part: controller.value,
|
|
34
|
+
text: controller.text
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export { tag };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=meter.js.map
|
package/src/meter.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter.js","names":[],"sources":["../../../../packages/web/src/meter.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createMeter } from \"@kirana-ui/core/meter\"\nimport type { MeterProps } from \"@kirana-ui/core/meter\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-meter>` around `kui-part=\"root\"`, a `label`, a `track` with its `indicator`, and a\n * `value`, which says the value as it is written unless the page gave it something to say.\n * `value`, `min`, `max`, `locale`; `format` and `getAriaValueText` as properties.\n */\nexport const tag = defineElement({\n tag: \"kui-meter\",\n props: { value: \"number\", min: \"number\", max: \"number\", locale: \"string\" },\n properties: [\"format\", \"getAriaValueText\"],\n create: (props) =>\n createMeter(\n computed(() => {\n const own = props.get() as { id: string; value?: number | null }\n return { ...own, value: own.value ?? 0 }\n }) as never\n ),\n changes: {},\n parts: {\n root: (controller) => controller.root,\n label: (controller) => controller.label,\n track: (controller) => controller.track,\n indicator: (controller) => controller.indicator,\n value: (controller) => ({ part: controller.value, text: controller.text }),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-meter\": ElementOf<As<typeof tag, MeterProps>>\n }\n}\n"],"mappings":";;;;;;;;;AAYA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EAAE,OAAO;EAAU,KAAK;EAAU,KAAK;EAAU,QAAQ;CAAS;CACzE,YAAY,CAAC,UAAU,kBAAkB;CACzC,SAAS,UACP,YACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,OAAO;GAAE,GAAG;GAAK,OAAO,IAAI,SAAS;EAAE;CACzC,CAAC,CACH;CACF,SAAS,CAAC;CACV,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,QAAQ,eAAe,WAAW;EAClC,QAAQ,eAAe,WAAW;EAClC,YAAY,eAAe,WAAW;EACtC,QAAQ,gBAAgB;GAAE,MAAM,WAAW;GAAO,MAAM,WAAW;EAAK;CAC1E;AACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { NavigationMenu, NavigationMenuProps } from "@kirana-ui/core/navigation-menu";
|
|
3
|
+
/**
|
|
4
|
+
* `<kui-navigation-menu>` around a `kui-part="root"` nav with its `list`. An `item` has a
|
|
5
|
+
* `trigger` (with an `icon` if it has one) and a `content`, which is drawn in the menu's one
|
|
6
|
+
* `viewport` while its item is open; its `kui-value` tells it from the others, and an item
|
|
7
|
+
* that is given none makes its own. A `link` is a link (`kui-active`,
|
|
8
|
+
* `kui-close-on-click="false"`). The viewport is in a `portal` with a `positioner` around
|
|
9
|
+
* the `popup`, with an `arrow` and a `backdrop` if it has them. `value`, `default-value`,
|
|
10
|
+
* `delay`, `close-delay`, `orientation`; it tells `value-change`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const tag: Tag<NavigationMenuProps<string>, NavigationMenu<string>>;
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
"kui-navigation-menu": ElementOf<typeof tag, {
|
|
16
|
+
"value-change": ["onValueChange", "value"];
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { once, ownValue, positioner } from "./around.js";
|
|
2
|
+
import { defineElement, partAround } from "./runtime.js";
|
|
3
|
+
import { computed } from "@kirana-ui/core";
|
|
4
|
+
import { createNavigationMenu } from "@kirana-ui/core/navigation-menu";
|
|
5
|
+
// src/navigation-menu.ts
|
|
6
|
+
const NOTHING = computed(() => ({}));
|
|
7
|
+
const items = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
const itemOf = (controller, element) => once(items, partAround(element, "item"), (item) => controller.item(item.getAttribute("kui-value") ?? ownValue(item)));
|
|
9
|
+
/**
|
|
10
|
+
* `<kui-navigation-menu>` around a `kui-part="root"` nav with its `list`. An `item` has a
|
|
11
|
+
* `trigger` (with an `icon` if it has one) and a `content`, which is drawn in the menu's one
|
|
12
|
+
* `viewport` while its item is open; its `kui-value` tells it from the others, and an item
|
|
13
|
+
* that is given none makes its own. A `link` is a link (`kui-active`,
|
|
14
|
+
* `kui-close-on-click="false"`). The viewport is in a `portal` with a `positioner` around
|
|
15
|
+
* the `popup`, with an `arrow` and a `backdrop` if it has them. `value`, `default-value`,
|
|
16
|
+
* `delay`, `close-delay`, `orientation`; it tells `value-change`.
|
|
17
|
+
*/
|
|
18
|
+
const tag = defineElement({
|
|
19
|
+
tag: "kui-navigation-menu",
|
|
20
|
+
props: {
|
|
21
|
+
value: "string",
|
|
22
|
+
"default-value": "string",
|
|
23
|
+
delay: "number",
|
|
24
|
+
"close-delay": "number",
|
|
25
|
+
orientation: "string"
|
|
26
|
+
},
|
|
27
|
+
create: (props) => createNavigationMenu(props),
|
|
28
|
+
changes: { onValueChange: {
|
|
29
|
+
event: "value-change",
|
|
30
|
+
prop: "value"
|
|
31
|
+
} },
|
|
32
|
+
parts: {
|
|
33
|
+
root: (controller) => controller.root,
|
|
34
|
+
list: (controller) => controller.list,
|
|
35
|
+
item(controller, element) {
|
|
36
|
+
const item = itemOf(controller, element);
|
|
37
|
+
return {
|
|
38
|
+
part: {
|
|
39
|
+
props: NOTHING,
|
|
40
|
+
attach: () => () => {}
|
|
41
|
+
},
|
|
42
|
+
mount: () => item.mount()
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
trigger: (controller, element) => itemOf(controller, element)?.trigger,
|
|
46
|
+
icon: (controller, element) => itemOf(controller, element)?.icon,
|
|
47
|
+
content(controller, element) {
|
|
48
|
+
const item = itemOf(controller, element);
|
|
49
|
+
return item && {
|
|
50
|
+
part: item.content,
|
|
51
|
+
mounted: item.mounted,
|
|
52
|
+
into: controller.viewportElement
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
link: (controller, element) => controller.link(() => ({
|
|
56
|
+
...element.hasAttribute("kui-active") ? { active: true } : {},
|
|
57
|
+
...element.hasAttribute("kui-close-on-click") ? { closeOnClick: element.getAttribute("kui-close-on-click") !== "false" } : {}
|
|
58
|
+
})),
|
|
59
|
+
positioner,
|
|
60
|
+
popup: (controller) => controller.popup,
|
|
61
|
+
viewport: (controller) => controller.viewport,
|
|
62
|
+
arrow: (controller) => controller.arrow,
|
|
63
|
+
backdrop: (controller) => ({
|
|
64
|
+
mounted: controller.mounted,
|
|
65
|
+
part: controller.backdrop
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export { tag };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../../../packages/web/src/navigation-menu.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createNavigationMenu } from \"@kirana-ui/core/navigation-menu\"\nimport type {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuProps,\n} from \"@kirana-ui/core/navigation-menu\"\n\nimport { once, ownValue, positioner } from \"./around.ts\"\nimport { defineElement, partAround } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\nconst NOTHING = computed(() => ({}))\nconst items = new WeakMap<HTMLElement, NavigationMenuItem>()\nconst itemOf = (controller: NavigationMenu<string>, element: HTMLElement) =>\n once(items, partAround(element, \"item\"), (item) =>\n controller.item(item.getAttribute(\"kui-value\") ?? ownValue(item))\n )\n\n/**\n * `<kui-navigation-menu>` around a `kui-part=\"root\"` nav with its `list`. An `item` has a\n * `trigger` (with an `icon` if it has one) and a `content`, which is drawn in the menu's one\n * `viewport` while its item is open; its `kui-value` tells it from the others, and an item\n * that is given none makes its own. A `link` is a link (`kui-active`,\n * `kui-close-on-click=\"false\"`). The viewport is in a `portal` with a `positioner` around\n * the `popup`, with an `arrow` and a `backdrop` if it has them. `value`, `default-value`,\n * `delay`, `close-delay`, `orientation`; it tells `value-change`.\n */\nexport const tag = defineElement<NavigationMenuProps<string>, NavigationMenu<string>>({\n tag: \"kui-navigation-menu\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n delay: \"number\",\n \"close-delay\": \"number\",\n orientation: \"string\",\n },\n create: (props) => createNavigationMenu<string>(props),\n changes: { onValueChange: { event: \"value-change\", prop: \"value\" } },\n parts: {\n root: (controller) => controller.root,\n list: (controller) => controller.list,\n // The item's own element takes nothing: it is where the item is in the page.\n item(controller, element) {\n const item = itemOf(controller, element)!\n return { part: { props: NOTHING, attach: () => () => {} }, mount: () => item.mount() }\n },\n trigger: (controller, element) => itemOf(controller, element)?.trigger,\n icon: (controller, element) => itemOf(controller, element)?.icon,\n content(controller, element) {\n const item = itemOf(controller, element)\n return item && { part: item.content, mounted: item.mounted, into: controller.viewportElement }\n },\n link: (controller, element) =>\n controller.link(() => ({\n ...(element.hasAttribute(\"kui-active\") ? { active: true } : {}),\n ...(element.hasAttribute(\"kui-close-on-click\")\n ? { closeOnClick: element.getAttribute(\"kui-close-on-click\") !== \"false\" }\n : {}),\n })),\n positioner,\n popup: (controller) => controller.popup,\n viewport: (controller) => controller.viewport,\n arrow: (controller) => controller.arrow,\n backdrop: (controller) => ({ mounted: controller.mounted, part: controller.backdrop }),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-navigation-menu\": ElementOf<typeof tag, { \"value-change\": [\"onValueChange\", \"value\"] }>\n }\n}\n"],"mappings":";;;;;AAYA,MAAM,UAAU,gBAAgB,CAAC,EAAE;AACnC,MAAM,wBAAQ,IAAI,QAAyC;AAC3D,MAAM,UAAU,YAAoC,YAClD,KAAK,OAAO,WAAW,SAAS,MAAM,IAAI,SACxC,WAAW,KAAK,KAAK,aAAa,WAAW,KAAK,SAAS,IAAI,CAAC,CAClE;;;;;;;;;;AAWF,MAAa,MAAM,cAAmE;CACpF,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,OAAO;EACP,eAAe;EACf,aAAa;CACf;CACA,SAAS,UAAU,qBAA6B,KAAK;CACrD,SAAS,EAAE,eAAe;EAAE,OAAO;EAAgB,MAAM;CAAQ,EAAE;CACnE,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,OAAO,eAAe,WAAW;EAEjC,KAAK,YAAY,SAAS;GACxB,MAAM,OAAO,OAAO,YAAY,OAAO;GACvC,OAAO;IAAE,MAAM;KAAE,OAAO;KAAS,oBAAoB,CAAC;IAAE;IAAG,aAAa,KAAK,MAAM;GAAE;EACvF;EACA,UAAU,YAAY,YAAY,OAAO,YAAY,OAAO,CAAC,EAAE;EAC/D,OAAO,YAAY,YAAY,OAAO,YAAY,OAAO,CAAC,EAAE;EAC5D,QAAQ,YAAY,SAAS;GAC3B,MAAM,OAAO,OAAO,YAAY,OAAO;GACvC,OAAO,QAAQ;IAAE,MAAM,KAAK;IAAS,SAAS,KAAK;IAAS,MAAM,WAAW;GAAgB;EAC/F;EACA,OAAO,YAAY,YACjB,WAAW,YAAY;GACrB,GAAI,QAAQ,aAAa,YAAY,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;GAC7D,GAAI,QAAQ,aAAa,oBAAoB,IACzC,EAAE,cAAc,QAAQ,aAAa,oBAAoB,MAAM,QAAQ,IACvE,CAAC;EACP,EAAE;EACJ;EACA,QAAQ,eAAe,WAAW;EAClC,WAAW,eAAe,WAAW;EACrC,QAAQ,eAAe,WAAW;EAClC,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;CACtF;AACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { As, ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { NumberFieldProps } from "@kirana-ui/core/number-field";
|
|
3
|
+
/**
|
|
4
|
+
* `<kui-number-field>` around `kui-part="root"`, a `group`, an `input`, and `increment` and
|
|
5
|
+
* `decrement` buttons. With a name, the root draws the hidden input a form reads. `value`,
|
|
6
|
+
* `default-value`, `min`, `max`, `step`, `small-step`, `large-step`, `snap-on-step`,
|
|
7
|
+
* `allow-wheel-scrub`, `locale`, `disabled`, `read-only`, `required`, `name`, `form`; `format`
|
|
8
|
+
* as a property; it tells `value-change` and `value-committed`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const tag: Tag<{
|
|
11
|
+
id: string;
|
|
12
|
+
}, import("@kirana-ui/core/number-field").NumberField>;
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
"kui-number-field": ElementOf<As<typeof tag, NumberFieldProps>, {
|
|
16
|
+
"value-change": ["onValueChange", "value"];
|
|
17
|
+
"value-committed": ["onValueCommitted", "value"];
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { fieldAround } from "./around.js";
|
|
2
|
+
import { defineElement } from "./runtime.js";
|
|
3
|
+
import { createNumberField } from "@kirana-ui/core/number-field";
|
|
4
|
+
// src/number-field.ts
|
|
5
|
+
/**
|
|
6
|
+
* `<kui-number-field>` around `kui-part="root"`, a `group`, an `input`, and `increment` and
|
|
7
|
+
* `decrement` buttons. With a name, the root draws the hidden input a form reads. `value`,
|
|
8
|
+
* `default-value`, `min`, `max`, `step`, `small-step`, `large-step`, `snap-on-step`,
|
|
9
|
+
* `allow-wheel-scrub`, `locale`, `disabled`, `read-only`, `required`, `name`, `form`; `format`
|
|
10
|
+
* as a property; it tells `value-change` and `value-committed`.
|
|
11
|
+
*/
|
|
12
|
+
const tag = defineElement({
|
|
13
|
+
tag: "kui-number-field",
|
|
14
|
+
props: {
|
|
15
|
+
value: "number",
|
|
16
|
+
"default-value": "number",
|
|
17
|
+
min: "number",
|
|
18
|
+
max: "number",
|
|
19
|
+
step: "number",
|
|
20
|
+
"small-step": "number",
|
|
21
|
+
"large-step": "number",
|
|
22
|
+
"snap-on-step": "boolean",
|
|
23
|
+
"allow-wheel-scrub": "boolean",
|
|
24
|
+
locale: "string",
|
|
25
|
+
disabled: "boolean",
|
|
26
|
+
"read-only": "boolean",
|
|
27
|
+
required: "boolean",
|
|
28
|
+
name: "string",
|
|
29
|
+
form: "string"
|
|
30
|
+
},
|
|
31
|
+
properties: ["format"],
|
|
32
|
+
create: (props, host) => createNumberField(props, { field: fieldAround(host) }),
|
|
33
|
+
changes: {
|
|
34
|
+
onValueChange: {
|
|
35
|
+
event: "value-change",
|
|
36
|
+
prop: "value"
|
|
37
|
+
},
|
|
38
|
+
onValueCommitted: {
|
|
39
|
+
event: "value-committed",
|
|
40
|
+
prop: "value",
|
|
41
|
+
hold: false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
parts: {
|
|
45
|
+
root: (controller) => controller.named.peek() ? {
|
|
46
|
+
part: controller.root,
|
|
47
|
+
inner: controller.hidden
|
|
48
|
+
} : controller.root,
|
|
49
|
+
group: (controller) => controller.group,
|
|
50
|
+
input: (controller) => controller.input,
|
|
51
|
+
increment: (controller) => controller.increment,
|
|
52
|
+
decrement: (controller) => controller.decrement
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export { tag };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=number-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-field.js","names":[],"sources":["../../../../packages/web/src/number-field.ts"],"sourcesContent":["import { createNumberField } from \"@kirana-ui/core/number-field\"\nimport type { NumberFieldProps } from \"@kirana-ui/core/number-field\"\n\nimport { fieldAround } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-number-field>` around `kui-part=\"root\"`, a `group`, an `input`, and `increment` and\n * `decrement` buttons. With a name, the root draws the hidden input a form reads. `value`,\n * `default-value`, `min`, `max`, `step`, `small-step`, `large-step`, `snap-on-step`,\n * `allow-wheel-scrub`, `locale`, `disabled`, `read-only`, `required`, `name`, `form`; `format`\n * as a property; it tells `value-change` and `value-committed`.\n */\nexport const tag = defineElement({\n tag: \"kui-number-field\",\n props: {\n value: \"number\",\n \"default-value\": \"number\",\n min: \"number\",\n max: \"number\",\n step: \"number\",\n \"small-step\": \"number\",\n \"large-step\": \"number\",\n \"snap-on-step\": \"boolean\",\n \"allow-wheel-scrub\": \"boolean\",\n locale: \"string\",\n disabled: \"boolean\",\n \"read-only\": \"boolean\",\n required: \"boolean\",\n name: \"string\",\n form: \"string\",\n },\n properties: [\"format\"],\n create: (props, host) => createNumberField(props, { field: fieldAround(host) }),\n changes: {\n onValueChange: { event: \"value-change\", prop: \"value\" },\n onValueCommitted: { event: \"value-committed\", prop: \"value\", hold: false },\n },\n parts: {\n root: (controller) =>\n controller.named.peek()\n ? { part: controller.root, inner: controller.hidden }\n : controller.root,\n group: (controller) => controller.group,\n input: (controller) => controller.input,\n increment: (controller) => controller.increment,\n decrement: (controller) => controller.decrement,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-number-field\": ElementOf<\n As<typeof tag, NumberFieldProps>,\n {\n \"value-change\": [\"onValueChange\", \"value\"]\n \"value-committed\": [\"onValueCommitted\", \"value\"]\n }\n >\n }\n}\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,KAAK;EACL,KAAK;EACL,MAAM;EACN,cAAc;EACd,cAAc;EACd,gBAAgB;EAChB,qBAAqB;EACrB,QAAQ;EACR,UAAU;EACV,aAAa;EACb,UAAU;EACV,MAAM;EACN,MAAM;CACR;CACA,YAAY,CAAC,QAAQ;CACrB,SAAS,OAAO,SAAS,kBAAkB,OAAO,EAAE,OAAO,YAAY,IAAI,EAAE,CAAC;CAC9E,SAAS;EACP,eAAe;GAAE,OAAO;GAAgB,MAAM;EAAQ;EACtD,kBAAkB;GAAE,OAAO;GAAmB,MAAM;GAAS,MAAM;EAAM;CAC3E;CACA,OAAO;EACL,OAAO,eACL,WAAW,MAAM,KAAK,IAClB;GAAE,MAAM,WAAW;GAAM,OAAO,WAAW;EAAO,IAClD,WAAW;EACjB,QAAQ,eAAe,WAAW;EAClC,QAAQ,eAAe,WAAW;EAClC,YAAY,eAAe,WAAW;EACtC,YAAY,eAAe,WAAW;CACxC;AACF,CAAC"}
|
package/src/otp.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { Otp, OtpProps } from "@kirana-ui/core/otp";
|
|
3
|
+
/**
|
|
4
|
+
* `<kui-otp>` around `kui-part="root"`, the one `input` that is typed in, and a `slot` for
|
|
5
|
+
* each character (`kui-index`, from 0), which says its character and may hold a `caret`, in
|
|
6
|
+
* the page while the next character goes there. Slots may be in `group`s with a `separator`
|
|
7
|
+
* between. `length`, `value`, `default-value`, `mode`, `disabled`, `name`, `form`; it tells
|
|
8
|
+
* `value-change` and `complete`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const tag: Tag<OtpProps, Otp>;
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"kui-otp": ElementOf<typeof tag, {
|
|
14
|
+
"value-change": ["onValueChange", "value"];
|
|
15
|
+
complete: ["onComplete", "value"];
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=otp.d.ts.map
|