@kirana-ui/web 0.1.1 → 0.3.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 +3174 -0
- package/package.json +14 -2
- package/skills/kirana-ui-primitives/SKILL.md +163 -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 +14 -3
- package/src/alert-dialog.js +6 -2
- package/src/alert-dialog.js.map +1 -1
- package/src/around.d.ts +37 -4
- package/src/around.js +72 -8
- package/src/around.js.map +1 -1
- package/src/autocomplete.d.ts +17 -3
- package/src/autocomplete.js +9 -4
- 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 +21 -3
- package/src/avatar.js +39 -10
- 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 +19 -5
- package/src/calendar.js +21 -9
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +10 -1
- package/src/carousel.js.map +1 -1
- package/src/checkbox-group.d.ts +22 -0
- package/src/checkbox-group.js +36 -0
- package/src/checkbox-group.js.map +1 -0
- package/src/checkbox.d.ts +16 -3
- package/src/checkbox.js +10 -4
- 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 +37 -7
- package/src/combobox.js +52 -16
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +12 -2
- package/src/command.js +2 -1
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +13 -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 +19 -4
- package/src/date-picker.js +14 -11
- package/src/date-picker.js.map +1 -1
- package/src/dates.d.ts +5 -2
- package/src/dates.js +50 -15
- package/src/dates.js.map +1 -1
- package/src/dialog.d.ts +14 -3
- package/src/dialog.js +6 -2
- 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 +10 -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 +60 -1
- package/src/index.js +1 -0
- 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 +15 -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 +15 -4
- package/src/navigation-menu.js +7 -13
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +18 -3
- package/src/number-field.js +23 -3
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +12 -2
- package/src/otp.js +2 -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 +16 -3
- package/src/popover.js +35 -12
- 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 +12 -2
- package/src/radio-group.js +9 -2
- 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 +42 -4
- package/src/runtime.js +35 -7
- 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 +26 -5
- package/src/select.js +36 -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 +20 -5
- package/src/slider.js +9 -8
- 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 +10 -1
- package/src/tooltip.js.map +1 -1
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`, `read-only`,\n * `name`, `form`, `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 \"read-only\": \"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,aAAa;EACb,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,16 @@
|
|
|
1
|
+
import { ElementOf, Tag } from "./runtime.js";
|
|
2
|
+
import { Placed } from "./around.js";
|
|
1
3
|
/**
|
|
2
4
|
* `<kui-tooltip>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its
|
|
3
5
|
* `kui-side` and the like) around the `popup`, which may hold an `arrow`. `open`,
|
|
4
6
|
* `default-open`, `delay`, `close-delay`, `disabled`; it tells `open-change`.
|
|
5
7
|
*/
|
|
6
|
-
export declare const tag:
|
|
8
|
+
export declare const tag: Tag<import("@kirana-ui/core/hover-card").HoverPopupProps, import("@kirana-ui/core/hover-card").HoverPopup>;
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
"kui-tooltip": ElementOf<typeof tag, {
|
|
12
|
+
"open-change": ["onOpenChange", "open"];
|
|
13
|
+
}> & Placed;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
7
16
|
//# sourceMappingURL=tooltip.d.ts.map
|
package/src/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../../packages/web/src/tooltip.ts"],"sourcesContent":["import { createTooltip } from \"@kirana-ui/core/tooltip\"\n\nimport { hoverPopup } from \"./hover-popup.ts\"\n\n/**\n * `<kui-tooltip>` around a `kui-part=\"trigger\"` and a `portal` with a `positioner` (its\n * `kui-side` and the like) around the `popup`, which may hold an `arrow`. `open`,\n * `default-open`, `delay`, `close-delay`, `disabled`; it tells `open-change`.\n */\nexport const tag = hoverPopup(\"kui-tooltip\", createTooltip)\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../../packages/web/src/tooltip.ts"],"sourcesContent":["import { createTooltip } from \"@kirana-ui/core/tooltip\"\n\nimport { hoverPopup } from \"./hover-popup.ts\"\nimport type { Placed } from \"./around.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-tooltip>` around a `kui-part=\"trigger\"` and a `portal` with a `positioner` (its\n * `kui-side` and the like) around the `popup`, which may hold an `arrow`. `open`,\n * `default-open`, `delay`, `close-delay`, `disabled`; it tells `open-change`.\n */\nexport const tag = hoverPopup(\"kui-tooltip\", createTooltip)\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-tooltip\": ElementOf<typeof tag, { \"open-change\": [\"onOpenChange\", \"open\"] }> & Placed\n }\n}\n"],"mappings":";;;;;;;;AAWA,MAAa,MAAM,WAAW,eAAe,aAAa"}
|