@kirana-ui/web 0.3.0 → 0.4.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/llms.txt +1378 -97
  3. package/package.json +44 -3
  4. package/skills/kirana-ui-primitives/SKILL.md +24 -4
  5. package/src/accordion.d.ts +1 -1
  6. package/src/accordion.js +2 -1
  7. package/src/accordion.js.map +1 -1
  8. package/src/alert-dialog.js +3 -2
  9. package/src/alert-dialog.js.map +1 -1
  10. package/src/around.d.ts +7 -0
  11. package/src/around.js +13 -2
  12. package/src/around.js.map +1 -1
  13. package/src/autocomplete.d.ts +1 -1
  14. package/src/avatar.js +2 -2
  15. package/src/avatar.js.map +1 -1
  16. package/src/button.d.ts +2 -1
  17. package/src/button.js +2 -1
  18. package/src/button.js.map +1 -1
  19. package/src/calendar.d.ts +1 -1
  20. package/src/calendar.js +2 -1
  21. package/src/calendar.js.map +1 -1
  22. package/src/carousel.d.ts +1 -1
  23. package/src/carousel.js +4 -2
  24. package/src/carousel.js.map +1 -1
  25. package/src/color-picker.d.ts +28 -0
  26. package/src/color-picker.js +81 -0
  27. package/src/color-picker.js.map +1 -0
  28. package/src/combobox.d.ts +11 -4
  29. package/src/combobox.js +37 -12
  30. package/src/combobox.js.map +1 -1
  31. package/src/command.d.ts +2 -2
  32. package/src/command.js +4 -4
  33. package/src/command.js.map +1 -1
  34. package/src/date-field.d.ts +2 -2
  35. package/src/date-field.js +3 -3
  36. package/src/date-field.js.map +1 -1
  37. package/src/date-picker.d.ts +7 -4
  38. package/src/date-picker.js +37 -7
  39. package/src/date-picker.js.map +1 -1
  40. package/src/dates.d.ts +6 -3
  41. package/src/dates.js +8 -5
  42. package/src/dates.js.map +1 -1
  43. package/src/dialog.d.ts +3 -2
  44. package/src/dialog.js +8 -4
  45. package/src/dialog.js.map +1 -1
  46. package/src/drawer.d.ts +2 -1
  47. package/src/drawer.js +7 -3
  48. package/src/drawer.js.map +1 -1
  49. package/src/editable.d.ts +21 -0
  50. package/src/editable.js +56 -0
  51. package/src/editable.js.map +1 -0
  52. package/src/file-upload.d.ts +23 -0
  53. package/src/file-upload.js +98 -0
  54. package/src/file-upload.js.map +1 -0
  55. package/src/index.d.ts +27 -9
  56. package/src/index.js +10 -0
  57. package/src/menu.d.ts +2 -2
  58. package/src/menu.js +19 -10
  59. package/src/menu.js.map +1 -1
  60. package/src/menubar.d.ts +2 -2
  61. package/src/menubar.js +5 -3
  62. package/src/menubar.js.map +1 -1
  63. package/src/navigation-menu.d.ts +2 -2
  64. package/src/navigation-menu.js +10 -6
  65. package/src/navigation-menu.js.map +1 -1
  66. package/src/otp.d.ts +4 -2
  67. package/src/otp.js +23 -4
  68. package/src/otp.js.map +1 -1
  69. package/src/password-input.d.ts +20 -0
  70. package/src/password-input.js +39 -0
  71. package/src/password-input.js.map +1 -0
  72. package/src/rating.d.ts +18 -0
  73. package/src/rating.js +54 -0
  74. package/src/rating.js.map +1 -0
  75. package/src/runtime.d.ts +2 -2
  76. package/src/runtime.js +1 -1
  77. package/src/runtime.js.map +1 -1
  78. package/src/select.d.ts +10 -3
  79. package/src/select.js +32 -10
  80. package/src/select.js.map +1 -1
  81. package/src/steps.d.ts +17 -0
  82. package/src/steps.js +47 -0
  83. package/src/steps.js.map +1 -0
  84. package/src/tags-input.d.ts +35 -0
  85. package/src/tags-input.js +96 -0
  86. package/src/tags-input.js.map +1 -0
  87. package/src/time-field.d.ts +18 -0
  88. package/src/time-field.js +54 -0
  89. package/src/time-field.js.map +1 -0
  90. package/src/toast.d.ts +4 -3
  91. package/src/toast.js +6 -4
  92. package/src/toast.js.map +1 -1
  93. package/src/toggle-group.d.ts +1 -1
  94. package/src/toggle-group.js +2 -1
  95. package/src/toggle-group.js.map +1 -1
  96. package/src/toolbar.d.ts +0 -6
  97. package/src/toolbar.js +14 -3
  98. package/src/toolbar.js.map +1 -1
  99. package/src/tour.d.ts +27 -0
  100. package/src/tour.js +62 -0
  101. package/src/tour.js.map +1 -0
  102. package/src/tree.d.ts +29 -0
  103. package/src/tree.js +99 -0
  104. package/src/tree.js.map +1 -0
package/src/dialog.d.ts CHANGED
@@ -3,8 +3,9 @@ import { DialogProps } from "@kirana-ui/core/dialog";
3
3
  /**
4
4
  * `<kui-dialog>` around a `kui-part="trigger"` button and a `portal`, which is drawn at the
5
5
  * end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a
6
- * `title`, a `description` and a `close` button. A long dialog's popup is in a `viewport`,
7
- * which scrolls. `open`, `default-open`, `modal`, `dismissible`; it tells `open-change`.
6
+ * `title`, a `description` and a `close` button. The trigger and the close take `kui-disabled`. A long dialog's popup is in a `viewport`,
7
+ * which scrolls. `open`, `default-open`, `modal`, `disable-pointer-dismissal`
8
+ * (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read); it tells `open-change`.
8
9
  */
9
10
  export declare const tag: Tag<{
10
11
  id: string;
package/src/dialog.js CHANGED
@@ -1,11 +1,13 @@
1
+ import { ownDisabled } from "./around.js";
1
2
  import { defineElement } from "./runtime.js";
2
3
  import { createDialog } from "@kirana-ui/core/dialog";
3
4
  // src/dialog.ts
4
5
  /**
5
6
  * `<kui-dialog>` around a `kui-part="trigger"` button and a `portal`, which is drawn at the
6
7
  * end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a
7
- * `title`, a `description` and a `close` button. A long dialog's popup is in a `viewport`,
8
- * which scrolls. `open`, `default-open`, `modal`, `dismissible`; it tells `open-change`.
8
+ * `title`, a `description` and a `close` button. The trigger and the close take `kui-disabled`. A long dialog's popup is in a `viewport`,
9
+ * which scrolls. `open`, `default-open`, `modal`, `disable-pointer-dismissal`
10
+ * (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read); it tells `open-change`.
9
11
  */
10
12
  const tag = defineElement({
11
13
  tag: "kui-dialog",
@@ -13,6 +15,8 @@ const tag = defineElement({
13
15
  open: "boolean",
14
16
  "default-open": "boolean",
15
17
  modal: "boolean",
18
+ "disable-pointer-dismissal": "boolean",
19
+ "close-on-outside-press": "boolean",
16
20
  dismissible: "boolean"
17
21
  },
18
22
  create: (props) => createDialog(props),
@@ -21,7 +25,7 @@ const tag = defineElement({
21
25
  prop: "open"
22
26
  } },
23
27
  parts: {
24
- trigger: (controller) => controller.trigger,
28
+ trigger: (controller, element) => ownDisabled(element, controller.triggerPart),
25
29
  backdrop: (controller) => ({
26
30
  mounted: controller.mounted,
27
31
  part: controller.backdrop
@@ -36,7 +40,7 @@ const tag = defineElement({
36
40
  }),
37
41
  title: (controller) => controller.title,
38
42
  description: (controller) => controller.description,
39
- close: (controller) => controller.close
43
+ close: (controller, element) => ownDisabled(element, controller.closePart)
40
44
  }
41
45
  });
42
46
  export { tag };
package/src/dialog.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":[],"sources":["../../../../packages/web/src/dialog.ts"],"sourcesContent":["import { createDialog } from \"@kirana-ui/core/dialog\"\nimport type { DialogProps } from \"@kirana-ui/core/dialog\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-dialog>` around a `kui-part=\"trigger\"` button and a `portal`, which is drawn at the\n * end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a\n * `title`, a `description` and a `close` button. A long dialog's popup is in a `viewport`,\n * which scrolls. `open`, `default-open`, `modal`, `dismissible`; it tells `open-change`.\n */\nexport const tag = defineElement({\n tag: \"kui-dialog\",\n props: {\n open: \"boolean\",\n \"default-open\": \"boolean\",\n modal: \"boolean\",\n dismissible: \"boolean\",\n },\n create: (props) => createDialog(props),\n changes: { onOpenChange: { event: \"open-change\", prop: \"open\" } },\n parts: {\n trigger: (controller) => controller.trigger,\n backdrop: (controller) => ({ mounted: controller.mounted, part: controller.backdrop }),\n viewport: (controller) => ({ mounted: controller.mounted, part: controller.viewport }),\n popup: (controller) => ({ mounted: controller.mounted, part: controller.popup }),\n title: (controller) => controller.title,\n description: (controller) => controller.description,\n close: (controller) => controller.close,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-dialog\": ElementOf<\n As<typeof tag, DialogProps>,\n { \"open-change\": [\"onOpenChange\", \"open\"] }\n >\n }\n}\n"],"mappings":";;;;;;;;;AAYA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EACL,MAAM;EACN,gBAAgB;EAChB,OAAO;EACP,aAAa;CACf;CACA,SAAS,UAAU,aAAa,KAAK;CACrC,SAAS,EAAE,cAAc;EAAE,OAAO;EAAe,MAAM;CAAO,EAAE;CAChE,OAAO;EACL,UAAU,eAAe,WAAW;EACpC,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;EACpF,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;EACpF,QAAQ,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAM;EAC9E,QAAQ,eAAe,WAAW;EAClC,cAAc,eAAe,WAAW;EACxC,QAAQ,eAAe,WAAW;CACpC;AACF,CAAC"}
1
+ {"version":3,"file":"dialog.js","names":[],"sources":["../../../../packages/web/src/dialog.ts"],"sourcesContent":["import { createDialog } from \"@kirana-ui/core/dialog\"\nimport type { DialogProps } from \"@kirana-ui/core/dialog\"\n\nimport { ownDisabled } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { As, ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-dialog>` around a `kui-part=\"trigger\"` button and a `portal`, which is drawn at the\n * end of the page while the dialog is open and holds its `backdrop` and its `popup`, with a\n * `title`, a `description` and a `close` button. The trigger and the close take `kui-disabled`. A long dialog's popup is in a `viewport`,\n * which scrolls. `open`, `default-open`, `modal`, `disable-pointer-dismissal`\n * (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read); it tells `open-change`.\n */\nexport const tag = defineElement({\n tag: \"kui-dialog\",\n props: {\n open: \"boolean\",\n \"default-open\": \"boolean\",\n modal: \"boolean\",\n \"disable-pointer-dismissal\": \"boolean\",\n \"close-on-outside-press\": \"boolean\",\n dismissible: \"boolean\",\n },\n create: (props) => createDialog(props),\n changes: { onOpenChange: { event: \"open-change\", prop: \"open\" } },\n parts: {\n trigger: (controller, element) => ownDisabled(element, controller.triggerPart),\n backdrop: (controller) => ({ mounted: controller.mounted, part: controller.backdrop }),\n viewport: (controller) => ({ mounted: controller.mounted, part: controller.viewport }),\n popup: (controller) => ({ mounted: controller.mounted, part: controller.popup }),\n title: (controller) => controller.title,\n description: (controller) => controller.description,\n close: (controller, element) => ownDisabled(element, controller.closePart),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-dialog\": ElementOf<\n As<typeof tag, DialogProps>,\n { \"open-change\": [\"onOpenChange\", \"open\"] }\n >\n }\n}\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,MAAM,cAAc;CAC/B,KAAK;CACL,OAAO;EACL,MAAM;EACN,gBAAgB;EAChB,OAAO;EACP,6BAA6B;EAC7B,0BAA0B;EAC1B,aAAa;CACf;CACA,SAAS,UAAU,aAAa,KAAK;CACrC,SAAS,EAAE,cAAc;EAAE,OAAO;EAAe,MAAM;CAAO,EAAE;CAChE,OAAO;EACL,UAAU,YAAY,YAAY,YAAY,SAAS,WAAW,WAAW;EAC7E,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;EACpF,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;EACpF,QAAQ,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAM;EAC9E,QAAQ,eAAe,WAAW;EAClC,cAAc,eAAe,WAAW;EACxC,QAAQ,YAAY,YAAY,YAAY,SAAS,WAAW,SAAS;CAC3E;AACF,CAAC"}
package/src/drawer.d.ts CHANGED
@@ -7,7 +7,8 @@ type Props = Omit<DrawerProps, "snapPoints" | "snapPoint" | "defaultSnapPoint">
7
7
  };
8
8
  /**
9
9
  * `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the
10
- * dialog's parts. `open`, `default-open`, `modal`, `dismissible`, `swipe-direction`,
10
+ * dialog's parts. `open`, `default-open`, `modal`, `disable-pointer-dismissal`
11
+ * (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read), `swipe-direction`,
11
12
  * `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`,
12
13
  * `default-snap-point`; it tells `open-change` and `snap-point-change`.
13
14
  */
package/src/drawer.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { ownDisabled } from "./around.js";
1
2
  import { defineElement } from "./runtime.js";
2
3
  import { computed } from "@kirana-ui/core";
3
4
  import { createDrawer } from "@kirana-ui/core/drawer";
@@ -6,7 +7,8 @@ import { createDrawer } from "@kirana-ui/core/drawer";
6
7
  const point = (text) => typeof text !== "string" || text === "" ? text : isNaN(+text) ? text : +text;
7
8
  /**
8
9
  * `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the
9
- * dialog's parts. `open`, `default-open`, `modal`, `dismissible`, `swipe-direction`,
10
+ * dialog's parts. `open`, `default-open`, `modal`, `disable-pointer-dismissal`
11
+ * (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read), `swipe-direction`,
10
12
  * `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`,
11
13
  * `default-snap-point`; it tells `open-change` and `snap-point-change`.
12
14
  */
@@ -16,6 +18,8 @@ const tag = defineElement({
16
18
  open: "boolean",
17
19
  "default-open": "boolean",
18
20
  modal: "boolean",
21
+ "disable-pointer-dismissal": "boolean",
22
+ "close-on-outside-press": "boolean",
19
23
  dismissible: "boolean",
20
24
  "swipe-direction": "string",
21
25
  "snap-points": "string",
@@ -43,7 +47,7 @@ const tag = defineElement({
43
47
  }
44
48
  },
45
49
  parts: {
46
- trigger: (controller) => controller.trigger,
50
+ trigger: (controller, element) => ownDisabled(element, controller.triggerPart),
47
51
  backdrop: (controller) => ({
48
52
  mounted: controller.mounted,
49
53
  part: controller.backdrop
@@ -54,7 +58,7 @@ const tag = defineElement({
54
58
  }),
55
59
  title: (controller) => controller.title,
56
60
  description: (controller) => controller.description,
57
- close: (controller) => controller.close
61
+ close: (controller, element) => ownDisabled(element, controller.closePart)
58
62
  }
59
63
  });
60
64
  export { tag };
package/src/drawer.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":[],"sources":["../../../../packages/web/src/drawer.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createDrawer } from \"@kirana-ui/core/drawer\"\nimport type { Drawer, DrawerProps, DrawerSnapPoint } from \"@kirana-ui/core/drawer\"\n\nimport { defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/** A place to rest, as an attribute writes it: a share (`0.5`) or a length (`200px`). */\nconst point = (text: unknown): DrawerSnapPoint | undefined =>\n typeof text !== \"string\" || text === \"\" ? (text as undefined) : isNaN(+text) ? text : +text\n\ntype Props = Omit<DrawerProps, \"snapPoints\" | \"snapPoint\" | \"defaultSnapPoint\"> & {\n snapPoints?: string | readonly DrawerSnapPoint[]\n snapPoint?: DrawerSnapPoint\n defaultSnapPoint?: DrawerSnapPoint\n}\n\n/**\n * `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the\n * dialog's parts. `open`, `default-open`, `modal`, `dismissible`, `swipe-direction`,\n * `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`,\n * `default-snap-point`; it tells `open-change` and `snap-point-change`.\n */\nexport const tag = defineElement<Props, Drawer>({\n tag: \"kui-drawer\",\n props: {\n open: \"boolean\",\n \"default-open\": \"boolean\",\n modal: \"boolean\",\n dismissible: \"boolean\",\n \"swipe-direction\": \"string\",\n \"snap-points\": \"string\",\n \"snap-point\": \"string\",\n \"default-snap-point\": \"string\",\n },\n create: (props) =>\n createDrawer(\n computed(() => {\n const own = props.get()\n const points = own.snapPoints\n return {\n ...own,\n snapPoints:\n typeof points === \"string\" ? points.split(\",\").map((each) => point(each)!) : points,\n snapPoint: point(own.snapPoint),\n defaultSnapPoint: point(own.defaultSnapPoint),\n }\n })\n ),\n changes: {\n onOpenChange: { event: \"open-change\", prop: \"open\" },\n onSnapPointChange: { event: \"snap-point-change\", prop: \"snapPoint\" },\n },\n parts: {\n trigger: (controller) => controller.trigger,\n backdrop: (controller) => ({ mounted: controller.mounted, part: controller.backdrop }),\n popup: (controller) => ({ mounted: controller.mounted, part: controller.popup }),\n title: (controller) => controller.title,\n description: (controller) => controller.description,\n close: (controller) => controller.close,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-drawer\": ElementOf<\n typeof tag,\n {\n \"open-change\": [\"onOpenChange\", \"open\"]\n \"snap-point-change\": [\"onSnapPointChange\", \"snapPoint\"]\n }\n >\n }\n}\n"],"mappings":";;;;;AAQA,MAAM,SAAS,SACb,OAAO,SAAS,YAAY,SAAS,KAAM,OAAqB,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC;;;;;;;AAczF,MAAa,MAAM,cAA6B;CAC9C,KAAK;CACL,OAAO;EACL,MAAM;EACN,gBAAgB;EAChB,OAAO;EACP,aAAa;EACb,mBAAmB;EACnB,eAAe;EACf,cAAc;EACd,sBAAsB;CACxB;CACA,SAAS,UACP,aACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,MAAM,SAAS,IAAI;EACnB,OAAO;GACL,GAAG;GACH,YACE,OAAO,WAAW,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,MAAM,IAAI,CAAE,IAAI;GAC/E,WAAW,MAAM,IAAI,SAAS;GAC9B,kBAAkB,MAAM,IAAI,gBAAgB;EAC9C;CACF,CAAC,CACH;CACF,SAAS;EACP,cAAc;GAAE,OAAO;GAAe,MAAM;EAAO;EACnD,mBAAmB;GAAE,OAAO;GAAqB,MAAM;EAAY;CACrE;CACA,OAAO;EACL,UAAU,eAAe,WAAW;EACpC,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;EACpF,QAAQ,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAM;EAC9E,QAAQ,eAAe,WAAW;EAClC,cAAc,eAAe,WAAW;EACxC,QAAQ,eAAe,WAAW;CACpC;AACF,CAAC"}
1
+ {"version":3,"file":"drawer.js","names":[],"sources":["../../../../packages/web/src/drawer.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createDrawer } from \"@kirana-ui/core/drawer\"\nimport type { Drawer, DrawerProps, DrawerSnapPoint } from \"@kirana-ui/core/drawer\"\n\nimport { ownDisabled } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/** A place to rest, as an attribute writes it: a share (`0.5`) or a length (`200px`). */\nconst point = (text: unknown): DrawerSnapPoint | undefined =>\n typeof text !== \"string\" || text === \"\" ? (text as undefined) : isNaN(+text) ? text : +text\n\ntype Props = Omit<DrawerProps, \"snapPoints\" | \"snapPoint\" | \"defaultSnapPoint\"> & {\n snapPoints?: string | readonly DrawerSnapPoint[]\n snapPoint?: DrawerSnapPoint\n defaultSnapPoint?: DrawerSnapPoint\n}\n\n/**\n * `<kui-drawer>`: a dialog that comes from an edge and is dragged back to it, with the\n * dialog's parts. `open`, `default-open`, `modal`, `disable-pointer-dismissal`\n * (`close-on-outside-press` and `dismissible`, the other way round, its old names, still read), `swipe-direction`,\n * `snap-points` (with commas between: `0.4,1` or `200px,1`), `snap-point`,\n * `default-snap-point`; it tells `open-change` and `snap-point-change`.\n */\nexport const tag = defineElement<Props, Drawer>({\n tag: \"kui-drawer\",\n props: {\n open: \"boolean\",\n \"default-open\": \"boolean\",\n modal: \"boolean\",\n \"disable-pointer-dismissal\": \"boolean\",\n \"close-on-outside-press\": \"boolean\",\n dismissible: \"boolean\",\n \"swipe-direction\": \"string\",\n \"snap-points\": \"string\",\n \"snap-point\": \"string\",\n \"default-snap-point\": \"string\",\n },\n create: (props) =>\n createDrawer(\n computed(() => {\n const own = props.get()\n const points = own.snapPoints\n return {\n ...own,\n snapPoints:\n typeof points === \"string\" ? points.split(\",\").map((each) => point(each)!) : points,\n snapPoint: point(own.snapPoint),\n defaultSnapPoint: point(own.defaultSnapPoint),\n }\n })\n ),\n changes: {\n onOpenChange: { event: \"open-change\", prop: \"open\" },\n onSnapPointChange: { event: \"snap-point-change\", prop: \"snapPoint\" },\n },\n parts: {\n trigger: (controller, element) => ownDisabled(element, controller.triggerPart),\n backdrop: (controller) => ({ mounted: controller.mounted, part: controller.backdrop }),\n popup: (controller) => ({ mounted: controller.mounted, part: controller.popup }),\n title: (controller) => controller.title,\n description: (controller) => controller.description,\n close: (controller, element) => ownDisabled(element, controller.closePart),\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-drawer\": ElementOf<\n typeof tag,\n {\n \"open-change\": [\"onOpenChange\", \"open\"]\n \"snap-point-change\": [\"onSnapPointChange\", \"snapPoint\"]\n }\n >\n }\n}\n"],"mappings":";;;;;;AASA,MAAM,SAAS,SACb,OAAO,SAAS,YAAY,SAAS,KAAM,OAAqB,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC;;;;;;;;AAezF,MAAa,MAAM,cAA6B;CAC9C,KAAK;CACL,OAAO;EACL,MAAM;EACN,gBAAgB;EAChB,OAAO;EACP,6BAA6B;EAC7B,0BAA0B;EAC1B,aAAa;EACb,mBAAmB;EACnB,eAAe;EACf,cAAc;EACd,sBAAsB;CACxB;CACA,SAAS,UACP,aACE,eAAe;EACb,MAAM,MAAM,MAAM,IAAI;EACtB,MAAM,SAAS,IAAI;EACnB,OAAO;GACL,GAAG;GACH,YACE,OAAO,WAAW,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,MAAM,IAAI,CAAE,IAAI;GAC/E,WAAW,MAAM,IAAI,SAAS;GAC9B,kBAAkB,MAAM,IAAI,gBAAgB;EAC9C;CACF,CAAC,CACH;CACF,SAAS;EACP,cAAc;GAAE,OAAO;GAAe,MAAM;EAAO;EACnD,mBAAmB;GAAE,OAAO;GAAqB,MAAM;EAAY;CACrE;CACA,OAAO;EACL,UAAU,YAAY,YAAY,YAAY,SAAS,WAAW,WAAW;EAC7E,WAAW,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAS;EACpF,QAAQ,gBAAgB;GAAE,SAAS,WAAW;GAAS,MAAM,WAAW;EAAM;EAC9E,QAAQ,eAAe,WAAW;EAClC,cAAc,eAAe,WAAW;EACxC,QAAQ,YAAY,YAAY,YAAY,SAAS,WAAW,SAAS;CAC3E;AACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ElementOf, Tag } from "./runtime.js";
2
+ import { Editable, EditableProps } from "@kirana-ui/core/editable";
3
+ /**
4
+ * `<kui-editable>` around `kui-part="root"`, a `preview`, which says the text (or the
5
+ * placeholder while there is none) unless the page gave it something to say, an `input` or a
6
+ * textarea, and `edit-trigger`, `submit-trigger` and `cancel-trigger` buttons. The input's id is
7
+ * the element's `kui-id`. `value`, `default-value`, `editing`, `default-editing`, `placeholder`,
8
+ * `activation`, `submit-on-blur`, `select-on-focus`, `disabled`, `read-only`, `required`,
9
+ * `name`, `form`; it tells `value-change` and `editing-change`. Inside a `<kui-field>` its
10
+ * input is the field's control.
11
+ */
12
+ export declare const tag: Tag<EditableProps, Editable>;
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ "kui-editable": ElementOf<typeof tag, {
16
+ "value-change": ["onValueChange", "value"];
17
+ "editing-change": ["onEditingChange", "editing"];
18
+ }>;
19
+ }
20
+ }
21
+ //# sourceMappingURL=editable.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { fieldAround } from "./around.js";
2
+ import { defineElement } from "./runtime.js";
3
+ import { createEditable } from "@kirana-ui/core/editable";
4
+ // src/editable.ts
5
+ /**
6
+ * `<kui-editable>` around `kui-part="root"`, a `preview`, which says the text (or the
7
+ * placeholder while there is none) unless the page gave it something to say, an `input` or a
8
+ * textarea, and `edit-trigger`, `submit-trigger` and `cancel-trigger` buttons. The input's id is
9
+ * the element's `kui-id`. `value`, `default-value`, `editing`, `default-editing`, `placeholder`,
10
+ * `activation`, `submit-on-blur`, `select-on-focus`, `disabled`, `read-only`, `required`,
11
+ * `name`, `form`; it tells `value-change` and `editing-change`. Inside a `<kui-field>` its
12
+ * input is the field's control.
13
+ */
14
+ const tag = defineElement({
15
+ tag: "kui-editable",
16
+ props: {
17
+ value: "string",
18
+ "default-value": "string",
19
+ editing: "boolean",
20
+ "default-editing": "boolean",
21
+ placeholder: "string",
22
+ activation: "string",
23
+ "submit-on-blur": "boolean",
24
+ "select-on-focus": "boolean",
25
+ disabled: "boolean",
26
+ "read-only": "boolean",
27
+ required: "boolean",
28
+ name: "string",
29
+ form: "string"
30
+ },
31
+ create: (props, host) => createEditable(props, { field: fieldAround(host) }),
32
+ changes: {
33
+ onValueChange: {
34
+ event: "value-change",
35
+ prop: "value"
36
+ },
37
+ onEditingChange: {
38
+ event: "editing-change",
39
+ prop: "editing"
40
+ }
41
+ },
42
+ parts: {
43
+ root: (controller) => controller.root,
44
+ preview: (controller) => ({
45
+ part: controller.preview,
46
+ text: controller.text
47
+ }),
48
+ input: (controller) => controller.input,
49
+ "edit-trigger": (controller) => controller.editTrigger,
50
+ "submit-trigger": (controller) => controller.submitTrigger,
51
+ "cancel-trigger": (controller) => controller.cancelTrigger
52
+ }
53
+ });
54
+ export { tag };
55
+
56
+ //# sourceMappingURL=editable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editable.js","names":[],"sources":["../../../../packages/web/src/editable.ts"],"sourcesContent":["import { createEditable } from \"@kirana-ui/core/editable\"\nimport type { Editable, EditableProps } from \"@kirana-ui/core/editable\"\n\nimport { fieldAround } from \"./around.ts\"\nimport { defineElement } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/**\n * `<kui-editable>` around `kui-part=\"root\"`, a `preview`, which says the text (or the\n * placeholder while there is none) unless the page gave it something to say, an `input` or a\n * textarea, and `edit-trigger`, `submit-trigger` and `cancel-trigger` buttons. The input's id is\n * the element's `kui-id`. `value`, `default-value`, `editing`, `default-editing`, `placeholder`,\n * `activation`, `submit-on-blur`, `select-on-focus`, `disabled`, `read-only`, `required`,\n * `name`, `form`; it tells `value-change` and `editing-change`. Inside a `<kui-field>` its\n * input is the field's control.\n */\nexport const tag = defineElement<EditableProps, Editable>({\n tag: \"kui-editable\",\n props: {\n value: \"string\",\n \"default-value\": \"string\",\n editing: \"boolean\",\n \"default-editing\": \"boolean\",\n placeholder: \"string\",\n activation: \"string\",\n \"submit-on-blur\": \"boolean\",\n \"select-on-focus\": \"boolean\",\n disabled: \"boolean\",\n \"read-only\": \"boolean\",\n required: \"boolean\",\n name: \"string\",\n form: \"string\",\n },\n create: (props, host) => createEditable(props, { field: fieldAround(host) }),\n changes: {\n onValueChange: { event: \"value-change\", prop: \"value\" },\n onEditingChange: { event: \"editing-change\", prop: \"editing\" },\n },\n parts: {\n root: (controller) => controller.root,\n preview: (controller) => ({ part: controller.preview, text: controller.text }),\n input: (controller) => controller.input,\n \"edit-trigger\": (controller) => controller.editTrigger,\n \"submit-trigger\": (controller) => controller.submitTrigger,\n \"cancel-trigger\": (controller) => controller.cancelTrigger,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-editable\": ElementOf<\n typeof tag,\n {\n \"value-change\": [\"onValueChange\", \"value\"]\n \"editing-change\": [\"onEditingChange\", \"editing\"]\n }\n >\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,MAAM,cAAuC;CACxD,KAAK;CACL,OAAO;EACL,OAAO;EACP,iBAAiB;EACjB,SAAS;EACT,mBAAmB;EACnB,aAAa;EACb,YAAY;EACZ,kBAAkB;EAClB,mBAAmB;EACnB,UAAU;EACV,aAAa;EACb,UAAU;EACV,MAAM;EACN,MAAM;CACR;CACA,SAAS,OAAO,SAAS,eAAe,OAAO,EAAE,OAAO,YAAY,IAAI,EAAE,CAAC;CAC3E,SAAS;EACP,eAAe;GAAE,OAAO;GAAgB,MAAM;EAAQ;EACtD,iBAAiB;GAAE,OAAO;GAAkB,MAAM;EAAU;CAC9D;CACA,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,UAAU,gBAAgB;GAAE,MAAM,WAAW;GAAS,MAAM,WAAW;EAAK;EAC5E,QAAQ,eAAe,WAAW;EAClC,iBAAiB,eAAe,WAAW;EAC3C,mBAAmB,eAAe,WAAW;EAC7C,mBAAmB,eAAe,WAAW;CAC/C;AACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ElementOf, Tag } from "./runtime.js";
2
+ import { FileUpload, FileUploadProps } from "@kirana-ui/core/file-upload";
3
+ /**
4
+ * `<kui-file-upload>` around `kui-part="root"`, which holds a `dropzone` (with a `trigger`
5
+ * button inside, if the page wants one), a `list` with a `<template kui-each="items">` for a
6
+ * file (`{name}`, `{size}` in bytes, `{type}` and `{index}` are its own), and a `clear` button.
7
+ * An `item` holds its `item-name` and `item-size`, which say the file's name and its size as
8
+ * people read one (in the language of its `kui-locale`) unless the page wrote something, and an
9
+ * `item-remove` button. The dropzone draws the native file input, hidden, as its last child.
10
+ * `accept`, `multiple`, `max-files`, `max-size`, `min-size`, `disabled`, `required`, `name`,
11
+ * `form`; `files`, `default-files` and `validate` as properties. It tells `files-change` and
12
+ * `files-reject` (`detail.rejections`).
13
+ */
14
+ export declare const tag: Tag<FileUploadProps, FileUpload>;
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ "kui-file-upload": ElementOf<typeof tag, {
18
+ "files-change": ["onFilesChange", "files"];
19
+ "files-reject": ["onFilesReject", "rejections"];
20
+ }>;
21
+ }
22
+ }
23
+ //# sourceMappingURL=file-upload.d.ts.map
@@ -0,0 +1,98 @@
1
+ import { fieldAround } from "./around.js";
2
+ import { defineElement, entryAround } from "./runtime.js";
3
+ import { computed } from "@kirana-ui/core";
4
+ import { createFileUpload, formatBytes } from "@kirana-ui/core/file-upload";
5
+ // src/file-upload.ts
6
+ /** The file a part is in: the entry its item was stamped for. */
7
+ const keyOf = (element) => entryAround(element)?.key;
8
+ /**
9
+ * `<kui-file-upload>` around `kui-part="root"`, which holds a `dropzone` (with a `trigger`
10
+ * button inside, if the page wants one), a `list` with a `<template kui-each="items">` for a
11
+ * file (`{name}`, `{size}` in bytes, `{type}` and `{index}` are its own), and a `clear` button.
12
+ * An `item` holds its `item-name` and `item-size`, which say the file's name and its size as
13
+ * people read one (in the language of its `kui-locale`) unless the page wrote something, and an
14
+ * `item-remove` button. The dropzone draws the native file input, hidden, as its last child.
15
+ * `accept`, `multiple`, `max-files`, `max-size`, `min-size`, `disabled`, `required`, `name`,
16
+ * `form`; `files`, `default-files` and `validate` as properties. It tells `files-change` and
17
+ * `files-reject` (`detail.rejections`).
18
+ */
19
+ const tag = defineElement({
20
+ tag: "kui-file-upload",
21
+ props: {
22
+ accept: "string",
23
+ multiple: "boolean",
24
+ "max-files": "number",
25
+ "max-size": "number",
26
+ "min-size": "number",
27
+ disabled: "boolean",
28
+ required: "boolean",
29
+ name: "string",
30
+ form: "string"
31
+ },
32
+ properties: [
33
+ "files",
34
+ "defaultFiles",
35
+ "validate"
36
+ ],
37
+ create: (props, host) => createFileUpload(props, { field: fieldAround(host) }),
38
+ changes: {
39
+ onFilesChange: {
40
+ event: "files-change",
41
+ prop: "files"
42
+ },
43
+ onFilesReject: {
44
+ event: "files-reject",
45
+ prop: "rejections",
46
+ hold: false
47
+ }
48
+ },
49
+ lists: { items: (controller) => ({
50
+ entries: controller.entries,
51
+ key: (entry) => entry.key,
52
+ values: (entry) => ({
53
+ name: entry.file.name,
54
+ size: entry.file.size,
55
+ type: entry.file.type,
56
+ index: entry.index
57
+ })
58
+ }) },
59
+ parts: {
60
+ root: (controller) => controller.root,
61
+ dropzone: (controller) => ({
62
+ part: controller.dropzone,
63
+ inner: controller.input
64
+ }),
65
+ trigger: (controller) => controller.trigger,
66
+ list: (controller) => controller.list,
67
+ item(controller, element) {
68
+ const key = keyOf(element);
69
+ return key === void 0 ? void 0 : controller.item(key);
70
+ },
71
+ "item-name"(controller, element) {
72
+ const entry = entryAround(element);
73
+ if (!entry) return void 0;
74
+ const { name } = entry.file;
75
+ return {
76
+ part: controller.itemName(entry.key),
77
+ text: computed(() => name)
78
+ };
79
+ },
80
+ "item-size"(controller, element) {
81
+ const entry = entryAround(element);
82
+ if (!entry) return void 0;
83
+ const { size } = entry.file;
84
+ return {
85
+ part: controller.itemSize(entry.key),
86
+ text: computed(() => formatBytes(size, element.getAttribute("kui-locale") ?? void 0))
87
+ };
88
+ },
89
+ "item-remove"(controller, element) {
90
+ const key = keyOf(element);
91
+ return key === void 0 ? void 0 : controller.itemRemove(key);
92
+ },
93
+ clear: (controller) => controller.clear
94
+ }
95
+ });
96
+ export { tag };
97
+
98
+ //# sourceMappingURL=file-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload.js","names":[],"sources":["../../../../packages/web/src/file-upload.ts"],"sourcesContent":["import { computed } from \"@kirana-ui/core\"\nimport { createFileUpload, formatBytes } from \"@kirana-ui/core/file-upload\"\nimport type { FileUpload, FileUploadEntry, FileUploadProps } from \"@kirana-ui/core/file-upload\"\n\nimport { fieldAround } from \"./around.ts\"\nimport { defineElement, entryAround } from \"./runtime.ts\"\nimport type { ElementOf } from \"./runtime.ts\"\n\n/** The file a part is in: the entry its item was stamped for. */\nconst keyOf = (element: HTMLElement) => entryAround<FileUploadEntry>(element)?.key\n\n/**\n * `<kui-file-upload>` around `kui-part=\"root\"`, which holds a `dropzone` (with a `trigger`\n * button inside, if the page wants one), a `list` with a `<template kui-each=\"items\">` for a\n * file (`{name}`, `{size}` in bytes, `{type}` and `{index}` are its own), and a `clear` button.\n * An `item` holds its `item-name` and `item-size`, which say the file's name and its size as\n * people read one (in the language of its `kui-locale`) unless the page wrote something, and an\n * `item-remove` button. The dropzone draws the native file input, hidden, as its last child.\n * `accept`, `multiple`, `max-files`, `max-size`, `min-size`, `disabled`, `required`, `name`,\n * `form`; `files`, `default-files` and `validate` as properties. It tells `files-change` and\n * `files-reject` (`detail.rejections`).\n */\nexport const tag = defineElement<FileUploadProps, FileUpload>({\n tag: \"kui-file-upload\",\n props: {\n accept: \"string\",\n multiple: \"boolean\",\n \"max-files\": \"number\",\n \"max-size\": \"number\",\n \"min-size\": \"number\",\n disabled: \"boolean\",\n required: \"boolean\",\n name: \"string\",\n form: \"string\",\n },\n properties: [\"files\", \"defaultFiles\", \"validate\"],\n create: (props, host) => createFileUpload(props, { field: fieldAround(host) }),\n changes: {\n onFilesChange: { event: \"files-change\", prop: \"files\" },\n onFilesReject: { event: \"files-reject\", prop: \"rejections\", hold: false },\n },\n lists: {\n items: (controller) => ({\n entries: controller.entries,\n key: (entry: FileUploadEntry) => entry.key,\n values: (entry: FileUploadEntry) => ({\n name: entry.file.name,\n size: entry.file.size,\n type: entry.file.type,\n index: entry.index,\n }),\n }),\n },\n parts: {\n root: (controller) => controller.root,\n dropzone: (controller) => ({ part: controller.dropzone, inner: controller.input }),\n trigger: (controller) => controller.trigger,\n list: (controller) => controller.list,\n item(controller, element) {\n const key = keyOf(element)\n return key === undefined ? undefined : controller.item(key)\n },\n \"item-name\"(controller, element) {\n const entry = entryAround<FileUploadEntry>(element)\n if (!entry) return undefined\n const { name } = entry.file\n return { part: controller.itemName(entry.key), text: computed(() => name) }\n },\n \"item-size\"(controller, element) {\n const entry = entryAround<FileUploadEntry>(element)\n if (!entry) return undefined\n const { size } = entry.file\n return {\n part: controller.itemSize(entry.key),\n text: computed(() => formatBytes(size, element.getAttribute(\"kui-locale\") ?? undefined)),\n }\n },\n \"item-remove\"(controller, element) {\n const key = keyOf(element)\n return key === undefined ? undefined : controller.itemRemove(key)\n },\n clear: (controller) => controller.clear,\n },\n})\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kui-file-upload\": ElementOf<\n typeof tag,\n {\n \"files-change\": [\"onFilesChange\", \"files\"]\n \"files-reject\": [\"onFilesReject\", \"rejections\"]\n }\n >\n }\n}\n"],"mappings":";;;;;;AASA,MAAM,SAAS,YAAyB,YAA6B,OAAO,CAAC,EAAE;;;;;;;;;;;;AAa/E,MAAa,MAAM,cAA2C;CAC5D,KAAK;CACL,OAAO;EACL,QAAQ;EACR,UAAU;EACV,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,UAAU;EACV,MAAM;EACN,MAAM;CACR;CACA,YAAY;EAAC;EAAS;EAAgB;CAAU;CAChD,SAAS,OAAO,SAAS,iBAAiB,OAAO,EAAE,OAAO,YAAY,IAAI,EAAE,CAAC;CAC7E,SAAS;EACP,eAAe;GAAE,OAAO;GAAgB,MAAM;EAAQ;EACtD,eAAe;GAAE,OAAO;GAAgB,MAAM;GAAc,MAAM;EAAM;CAC1E;CACA,OAAO,EACL,QAAQ,gBAAgB;EACtB,SAAS,WAAW;EACpB,MAAM,UAA2B,MAAM;EACvC,SAAS,WAA4B;GACnC,MAAM,MAAM,KAAK;GACjB,MAAM,MAAM,KAAK;GACjB,MAAM,MAAM,KAAK;GACjB,OAAO,MAAM;EACf;CACF,GACF;CACA,OAAO;EACL,OAAO,eAAe,WAAW;EACjC,WAAW,gBAAgB;GAAE,MAAM,WAAW;GAAU,OAAO,WAAW;EAAM;EAChF,UAAU,eAAe,WAAW;EACpC,OAAO,eAAe,WAAW;EACjC,KAAK,YAAY,SAAS;GACxB,MAAM,MAAM,MAAM,OAAO;GACzB,OAAO,QAAQ,KAAA,IAAY,KAAA,IAAY,WAAW,KAAK,GAAG;EAC5D;EACA,YAAY,YAAY,SAAS;GAC/B,MAAM,QAAQ,YAA6B,OAAO;GAClD,IAAI,CAAC,OAAO,OAAO,KAAA;GACnB,MAAM,EAAE,SAAS,MAAM;GACvB,OAAO;IAAE,MAAM,WAAW,SAAS,MAAM,GAAG;IAAG,MAAM,eAAe,IAAI;GAAE;EAC5E;EACA,YAAY,YAAY,SAAS;GAC/B,MAAM,QAAQ,YAA6B,OAAO;GAClD,IAAI,CAAC,OAAO,OAAO,KAAA;GACnB,MAAM,EAAE,SAAS,MAAM;GACvB,OAAO;IACL,MAAM,WAAW,SAAS,MAAM,GAAG;IACnC,MAAM,eAAe,YAAY,MAAM,QAAQ,aAAa,YAAY,KAAK,KAAA,CAAS,CAAC;GACzF;EACF;EACA,cAAc,YAAY,SAAS;GACjC,MAAM,MAAM,MAAM,OAAO;GACzB,OAAO,QAAQ,KAAA,IAAY,KAAA,IAAY,WAAW,WAAW,GAAG;EAClE;EACA,QAAQ,eAAe,WAAW;CACpC;AACF,CAAC"}
package/src/index.d.ts CHANGED
@@ -9,6 +9,7 @@ import "./carousel.js";
9
9
  import "./checkbox.js";
10
10
  import "./checkbox-group.js";
11
11
  import "./collapsible.js";
12
+ import "./color-picker.js";
12
13
  import "./combobox.js";
13
14
  import "./command.js";
14
15
  import "./context-menu.js";
@@ -16,8 +17,10 @@ import "./date-field.js";
16
17
  import "./date-picker.js";
17
18
  import "./dialog.js";
18
19
  import "./drawer.js";
20
+ import "./editable.js";
19
21
  import "./field.js";
20
22
  import "./fieldset.js";
23
+ import "./file-upload.js";
21
24
  import "./form.js";
22
25
  import "./hover-card.js";
23
26
  import "./input.js";
@@ -31,34 +34,49 @@ import "./navigation-menu.js";
31
34
  import "./number-field.js";
32
35
  import "./otp.js";
33
36
  import "./pagination.js";
37
+ import "./password-input.js";
34
38
  import "./popover.js";
35
39
  import "./progress.js";
36
40
  import "./qr-code.js";
37
41
  import "./radio-group.js";
42
+ import "./rating.js";
38
43
  import "./resizable.js";
39
44
  import "./scroll-area.js";
40
45
  import "./select.js";
41
46
  import "./separator.js";
42
47
  import "./slider.js";
48
+ import "./steps.js";
43
49
  import "./switch.js";
44
50
  import "./tabs.js";
51
+ import "./tags-input.js";
52
+ import "./time-field.js";
45
53
  import "./toast.js";
46
54
  import "./toggle.js";
47
55
  import "./toggle-group.js";
48
56
  import "./toolbar.js";
49
57
  import "./tooltip.js";
58
+ import "./tour.js";
59
+ import "./tree.js";
50
60
  import { Drawn, Each, ElementSpec, controllerAround, defineElement, entryAround, hostAround, partAround, partProps } from "./runtime.js";
51
61
  import { Placed } from "./around.js";
52
- import { Align, Anchor, AnchorOption, Bindable, ChangeDetails, ChangeSource, CollisionAvoidance, CollisionBoundary, CollisionPadding, ComponentDefinition, Direction, ItemLabels, ListCollection, OffsetData, OffsetFunction, Orientation, Part, PartDefinition, PartProps, PartState, PartStyle, PhysicalSide, PositionOptions, ReadonlySignal, Side, Signal, StateDefinition, StateOf } from "@kirana-ui/core";
53
- import { ComboboxEntry, ComboboxGroupData, ComboboxGroupEntry, ComboboxItemData, ComboboxItemEntry, ComboboxShown } from "@kirana-ui/core/combobox";
62
+ import { Align, Anchor, AnchorOption, Bindable, ChangeDetails, ChangeSource, CollisionAvoidance, CollisionBoundary, CollisionPadding, ComponentDefinition, Direction, ItemLabels, ListCollection, OffsetData, OffsetFunction, Orientation, Part, PartDefinition, PartProps, PartState, PartStyle, PhysicalSide, PositionOptions, Presentation, ReadonlySignal, Side, Signal, StateDefinition, StateOf } from "@kirana-ui/core";
63
+ import { FileRejection, FileRejectionReason, FileUploadEntry } from "@kirana-ui/core/file-upload";
64
+ import { QrCorrection } from "@kirana-ui/core/qr-code";
65
+ import { SelectShown } from "@kirana-ui/core/select";
66
+ import { CalendarDay, CalendarMode, CalendarMonth, CalendarValue, CalendarValueOf, CalendarWeekday, DateRange, IsoDate } from "@kirana-ui/core/calendar";
67
+ import { TourStep, TourTarget } from "@kirana-ui/core/tour";
54
68
  import { DrawerSide, DrawerSnapPoint } from "@kirana-ui/core/drawer";
55
- import { PaginationEntry } from "@kirana-ui/core/pagination";
69
+ import { FieldValidity, ValidityKey } from "@kirana-ui/core/field";
56
70
  import { ImageStatus } from "@kirana-ui/core/avatar";
57
- import { CalendarDay, CalendarMode, CalendarMonth, CalendarValue, CalendarValueOf, CalendarWeekday, DateRange, IsoDate } from "@kirana-ui/core/calendar";
71
+ import { ComboboxEntry, ComboboxGroupData, ComboboxGroupEntry, ComboboxItemData, ComboboxItemEntry, ComboboxShown } from "@kirana-ui/core/combobox";
72
+ import { PaginationEntry } from "@kirana-ui/core/pagination";
73
+ import { HourCycle, IsoTime, TimeFieldSegment, TimeGranularity, TimeUnit } from "@kirana-ui/core/time-field";
74
+ import { TagsInputEntry } from "@kirana-ui/core/tags-input";
75
+ import { SliderChangeDetails, SliderTold } from "@kirana-ui/core/slider";
76
+ import { OtpValidation } from "@kirana-ui/core/otp";
77
+ import { ColorFormat, ColorPickerInputChannel, ColorPickerSliderChannel, ColorPickerThumb, Hsva } from "@kirana-ui/core/color-picker";
58
78
  import { DateFieldSegment, DateUnit } from "@kirana-ui/core/date-field";
59
- import { FieldValidity, ValidityKey } from "@kirana-ui/core/field";
79
+ import { DatePickerMode, DatePickerRange, DatePickerValue, DatePickerValueOf } from "@kirana-ui/core/date-picker";
60
80
  import { FormErrors, FormValues, ValidationMode } from "@kirana-ui/core/form";
61
- import { QrCorrection } from "@kirana-ui/core/qr-code";
62
- import { SelectShown } from "@kirana-ui/core/select";
63
- import { SliderChangeDetails, SliderTold } from "@kirana-ui/core/slider";
64
- export { type Align, type Anchor, type AnchorOption, type Bindable, type CalendarDay, type CalendarMode, type CalendarMonth, type CalendarValue, type CalendarValueOf, type CalendarWeekday, type ChangeDetails, type ChangeSource, type CollisionAvoidance, type CollisionBoundary, type CollisionPadding, type ComboboxEntry, type ComboboxGroupData, type ComboboxGroupEntry, type ComboboxItemData, type ComboboxItemEntry, type ComboboxShown, type ComponentDefinition, type DateFieldSegment, type DateRange, type DateUnit, type Direction, type DrawerSide, type DrawerSnapPoint, type Drawn, type Each, type ElementSpec, type FieldValidity, type FormErrors, type FormValues, type ImageStatus, type IsoDate, type ItemLabels, type ListCollection, type OffsetData, type OffsetFunction, type Orientation, type PaginationEntry, type Part, type PartDefinition, type PartProps, type PartState, type PartStyle, type PhysicalSide, type Placed, type PositionOptions, type QrCorrection, type ReadonlySignal, type SelectShown, type Side, type Signal, type SliderChangeDetails, type SliderTold, type StateDefinition, type StateOf, type ValidationMode, type ValidityKey, controllerAround, defineElement, entryAround, hostAround, partAround, partProps };
81
+ import { TreeSelectionMode } from "@kirana-ui/core/tree";
82
+ export { type Align, type Anchor, type AnchorOption, type Bindable, type CalendarDay, type CalendarMode, type CalendarMonth, type CalendarValue, type CalendarValueOf, type CalendarWeekday, type ChangeDetails, type ChangeSource, type CollisionAvoidance, type CollisionBoundary, type CollisionPadding, type ColorFormat, type ColorPickerInputChannel, type ColorPickerSliderChannel, type ColorPickerThumb, type ComboboxEntry, type ComboboxGroupData, type ComboboxGroupEntry, type ComboboxItemData, type ComboboxItemEntry, type ComboboxShown, type ComponentDefinition, type DateFieldSegment, type DatePickerMode, type DatePickerRange, type DatePickerValue, type DatePickerValueOf, type DateRange, type DateUnit, type Direction, type DrawerSide, type DrawerSnapPoint, type Drawn, type Each, type ElementSpec, type FieldValidity, type FileRejection, type FileRejectionReason, type FileUploadEntry, type FormErrors, type FormValues, type HourCycle, type Hsva, type ImageStatus, type IsoDate, type IsoTime, type ItemLabels, type ListCollection, type OffsetData, type OffsetFunction, type Orientation, type OtpValidation, type PaginationEntry, type Part, type PartDefinition, type PartProps, type PartState, type PartStyle, type PhysicalSide, type Placed, type PositionOptions, type Presentation, type QrCorrection, type ReadonlySignal, type SelectShown, type Side, type Signal, type SliderChangeDetails, type SliderTold, type StateDefinition, type StateOf, type TagsInputEntry, type TimeFieldSegment, type TimeGranularity, type TimeUnit, type TourStep, type TourTarget, type TreeSelectionMode, type ValidationMode, type ValidityKey, controllerAround, defineElement, entryAround, hostAround, partAround, partProps };
package/src/index.js CHANGED
@@ -9,6 +9,7 @@ import "./carousel.js";
9
9
  import "./checkbox.js";
10
10
  import "./checkbox-group.js";
11
11
  import "./collapsible.js";
12
+ import "./color-picker.js";
12
13
  import "./combobox.js";
13
14
  import "./command.js";
14
15
  import "./context-menu.js";
@@ -16,8 +17,10 @@ import "./date-field.js";
16
17
  import "./date-picker.js";
17
18
  import "./dialog.js";
18
19
  import "./drawer.js";
20
+ import "./editable.js";
19
21
  import "./field.js";
20
22
  import "./fieldset.js";
23
+ import "./file-upload.js";
21
24
  import "./form.js";
22
25
  import "./hover-card.js";
23
26
  import "./input.js";
@@ -31,20 +34,27 @@ import "./navigation-menu.js";
31
34
  import "./number-field.js";
32
35
  import "./otp.js";
33
36
  import "./pagination.js";
37
+ import "./password-input.js";
34
38
  import "./popover.js";
35
39
  import "./progress.js";
36
40
  import "./qr-code.js";
37
41
  import "./radio-group.js";
42
+ import "./rating.js";
38
43
  import "./resizable.js";
39
44
  import "./scroll-area.js";
40
45
  import "./select.js";
41
46
  import "./separator.js";
42
47
  import "./slider.js";
48
+ import "./steps.js";
43
49
  import "./switch.js";
44
50
  import "./tabs.js";
51
+ import "./tags-input.js";
52
+ import "./time-field.js";
45
53
  import "./toast.js";
46
54
  import "./toggle.js";
47
55
  import "./toggle-group.js";
48
56
  import "./toolbar.js";
49
57
  import "./tooltip.js";
58
+ import "./tour.js";
59
+ import "./tree.js";
50
60
  export { controllerAround, defineElement, entryAround, hostAround, partAround, partProps } from "./runtime.js";
package/src/menu.d.ts CHANGED
@@ -5,12 +5,12 @@ declare const menu: (tag: string, around: (host: HTMLElement) => MenuAround, tri
5
5
  /**
6
6
  * `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its
7
7
  * `kui-side` and the like) around the `popup`, which holds its `item`s (`kui-disabled`,
8
- * `kui-label`, `kui-close-on-click="false"`), `separator`s, `group`s with a `group-label`,
8
+ * `kui-label`, `kui-close-on-select="false"`), `separator`s, `group`s with a `group-label`,
9
9
  * `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a
10
10
  * `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells
11
11
  * `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>`
12
12
  * inside a menu is its submenu, its trigger an item of the menu; inside a `<kui-menubar>`, one
13
- * of the bar's. `open`, `default-open`, `disabled`, `loop`, `modal`; it tells `open-change`.
13
+ * of the bar's. `open`, `default-open`, `disabled`, `loop-focus` (`loop` is its older name), `modal`; it tells `open-change`.
14
14
  */
15
15
  export declare const tag: Tag<MenuProps, Menu>;
16
16
  declare global {
package/src/menu.js CHANGED
@@ -3,10 +3,14 @@ import { defineElement, hostAround, partAround, partProps } from "./runtime.js";
3
3
  import { createMenu } from "@kirana-ui/core/menu";
4
4
  // src/menu.ts
5
5
  const MENUS = ["kui-menu", "kui-context-menu"];
6
- /** An item's own options: `kui-disabled`, `kui-label`, `kui-close-on-click="false"`. */
6
+ /**
7
+ * An item's own options: `kui-disabled`, `kui-label`, `kui-close-on-select="false"`
8
+ * (`kui-close-on-click`, its old name, still read).
9
+ */
7
10
  const options = (element) => () => ({
8
11
  ...element.hasAttribute("kui-disabled") ? { disabled: true } : {},
9
12
  ...element.hasAttribute("kui-label") ? { label: element.getAttribute("kui-label") } : {},
13
+ ...element.hasAttribute("kui-close-on-select") ? { closeOnSelect: element.getAttribute("kui-close-on-select") !== "false" } : {},
10
14
  ...element.hasAttribute("kui-close-on-click") ? { closeOnClick: element.getAttribute("kui-close-on-click") !== "false" } : {}
11
15
  });
12
16
  const groups = /* @__PURE__ */ new WeakMap();
@@ -16,6 +20,7 @@ let made = 0;
16
20
  const ITEM = {
17
21
  disabled: "boolean",
18
22
  label: "string",
23
+ "close-on-select": "boolean",
19
24
  "close-on-click": "boolean"
20
25
  };
21
26
  const boxOf = (menu, element) => once(boxes, element, (item) => {
@@ -69,10 +74,11 @@ const PARTS = {
69
74
  };
70
75
  },
71
76
  "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
77
+ const mark = boxOf(controller, partAround(element, "checkbox-item"))?.controller.indicator;
78
+ return mark && {
79
+ part: mark,
80
+ mounted: mark.mounted,
81
+ mount: mark.mount
76
82
  };
77
83
  },
78
84
  "radio-group"(controller, element) {
@@ -88,9 +94,11 @@ const PARTS = {
88
94
  "radio-item-indicator"(controller, element) {
89
95
  const group = radioOf(controller, partAround(element, "radio-group"))?.controller;
90
96
  const value = valueOf(partAround(element, "radio-item"));
91
- return group && {
92
- part: group.indicator(value),
93
- mounted: group.checked(value)
97
+ const mark = group?.indicator(value);
98
+ return mark && {
99
+ part: mark,
100
+ mounted: mark.mounted,
101
+ mount: mark.mount
94
102
  };
95
103
  }
96
104
  };
@@ -98,6 +106,7 @@ const PROPS = {
98
106
  open: "boolean",
99
107
  "default-open": "boolean",
100
108
  disabled: "boolean",
109
+ "loop-focus": "boolean",
101
110
  loop: "boolean",
102
111
  modal: "boolean"
103
112
  };
@@ -117,12 +126,12 @@ const menu = (tag, around, trigger) => defineElement({
117
126
  /**
118
127
  * `<kui-menu>` around a `kui-part="trigger"` and a `portal` with a `positioner` (its
119
128
  * `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`,
129
+ * `kui-label`, `kui-close-on-select="false"`), `separator`s, `group`s with a `group-label`,
121
130
  * `checkbox-item`s (`kui-checked`, `kui-default-checked`; it tells `checked-change`) with a
122
131
  * `checkbox-item-indicator`, and a `radio-group` (`kui-value`, `kui-default-value`; it tells
123
132
  * `value-change`) of `radio-item`s (`kui-value`) with a `radio-item-indicator`. A `<kui-menu>`
124
133
  * 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`.
134
+ * of the bar's. `open`, `default-open`, `disabled`, `loop-focus` (`loop` is its older name), `modal`; it tells `open-change`.
126
135
  */
127
136
  const tag = menu("kui-menu", (host) => {
128
137
  const around = hostAround(host, [...MENUS, "kui-menubar"]);