@k2b/ui 0.32.0 → 0.33.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 (109) hide show
  1. package/dist/browser/actions/Dropdown.js +159 -99
  2. package/dist/browser/actions/Dropdown.js.map +1 -1
  3. package/dist/browser/actions/FilterChip.js +113 -56
  4. package/dist/browser/actions/FilterChip.js.map +1 -1
  5. package/dist/browser/actions/filter-messages.js +26 -2
  6. package/dist/browser/actions/filter-messages.js.map +1 -1
  7. package/dist/browser/actions/menu-rows.js +23 -3
  8. package/dist/browser/actions/menu-rows.js.map +1 -1
  9. package/dist/browser/actions/menu-sheet.js +2 -7
  10. package/dist/browser/actions/menu-sheet.js.map +1 -1
  11. package/dist/browser/chat/ChatComposer.js +480 -403
  12. package/dist/browser/chat/ChatComposer.js.map +1 -1
  13. package/dist/browser/chat/chat-messages.js +14 -0
  14. package/dist/browser/chat/chat-messages.js.map +1 -1
  15. package/dist/browser/chat/index.js.map +1 -1
  16. package/dist/browser/content/Calendar.js +39 -29
  17. package/dist/browser/content/Calendar.js.map +1 -1
  18. package/dist/browser/content/CalendarDayView.js +159 -165
  19. package/dist/browser/content/CalendarDayView.js.map +1 -1
  20. package/dist/browser/content/MessageRow.js +607 -343
  21. package/dist/browser/content/MessageRow.js.map +1 -1
  22. package/dist/browser/content/ReactionBar.js +17 -0
  23. package/dist/browser/content/ReactionBar.js.map +1 -1
  24. package/dist/browser/content/index.js +1 -1
  25. package/dist/browser/content/index.js.map +1 -1
  26. package/dist/browser/feedback/dialog-core.js +6 -0
  27. package/dist/browser/feedback/dialog-core.js.map +1 -1
  28. package/dist/browser/inputs/TextInput.js +4 -1
  29. package/dist/browser/inputs/TextInput.js.map +1 -1
  30. package/dist/browser/intl/shortcut-messages.js +4 -0
  31. package/dist/browser/intl/shortcut-messages.js.map +1 -1
  32. package/dist/browser/intl/shortcut.js +4 -0
  33. package/dist/browser/intl/shortcut.js.map +1 -1
  34. package/dist/browser/layout/AppWorkspace.js +529 -512
  35. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  36. package/dist/browser/layout/MobileShell.js +213 -38
  37. package/dist/browser/layout/MobileShell.js.map +1 -1
  38. package/dist/browser/layout/index.js +1 -0
  39. package/dist/browser/layout/index.js.map +1 -1
  40. package/dist/browser/layout/scroll-fade.js +32 -5
  41. package/dist/browser/layout/scroll-fade.js.map +1 -1
  42. package/dist/browser/surfaces/NoticeCard.js +46 -30
  43. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  44. package/dist/browser/surfaces/resource-messages.js +2 -2
  45. package/dist/browser/surfaces/resource-messages.js.map +1 -1
  46. package/dist/ssr/actions/Dropdown.js +51 -27
  47. package/dist/ssr/actions/Dropdown.js.map +1 -1
  48. package/dist/ssr/actions/FilterChip.js +67 -16
  49. package/dist/ssr/actions/FilterChip.js.map +1 -1
  50. package/dist/ssr/actions/filter-messages.js +26 -2
  51. package/dist/ssr/actions/filter-messages.js.map +1 -1
  52. package/dist/ssr/actions/menu-rows.js +23 -3
  53. package/dist/ssr/actions/menu-rows.js.map +1 -1
  54. package/dist/ssr/actions/menu-sheet.js +2 -7
  55. package/dist/ssr/actions/menu-sheet.js.map +1 -1
  56. package/dist/ssr/chat/ChatComposer.js +96 -67
  57. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  58. package/dist/ssr/chat/chat-messages.js +14 -0
  59. package/dist/ssr/chat/chat-messages.js.map +1 -1
  60. package/dist/ssr/chat/index.js.map +1 -1
  61. package/dist/ssr/content/Calendar.js +40 -31
  62. package/dist/ssr/content/Calendar.js.map +1 -1
  63. package/dist/ssr/content/CalendarDayView.js +40 -48
  64. package/dist/ssr/content/CalendarDayView.js.map +1 -1
  65. package/dist/ssr/content/MessageRow.js +264 -91
  66. package/dist/ssr/content/MessageRow.js.map +1 -1
  67. package/dist/ssr/content/ReactionBar.js +17 -0
  68. package/dist/ssr/content/ReactionBar.js.map +1 -1
  69. package/dist/ssr/content/index.js +1 -1
  70. package/dist/ssr/content/index.js.map +1 -1
  71. package/dist/ssr/feedback/dialog-core.js +6 -0
  72. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  73. package/dist/ssr/inputs/TextInput.js +4 -1
  74. package/dist/ssr/inputs/TextInput.js.map +1 -1
  75. package/dist/ssr/intl/shortcut-messages.js +4 -0
  76. package/dist/ssr/intl/shortcut-messages.js.map +1 -1
  77. package/dist/ssr/intl/shortcut.js +4 -0
  78. package/dist/ssr/intl/shortcut.js.map +1 -1
  79. package/dist/ssr/layout/AppWorkspace.js +134 -122
  80. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  81. package/dist/ssr/layout/MobileShell.js +100 -20
  82. package/dist/ssr/layout/MobileShell.js.map +1 -1
  83. package/dist/ssr/layout/index.js +1 -0
  84. package/dist/ssr/layout/index.js.map +1 -1
  85. package/dist/ssr/layout/scroll-fade.js +32 -5
  86. package/dist/ssr/layout/scroll-fade.js.map +1 -1
  87. package/dist/ssr/surfaces/NoticeCard.js +21 -12
  88. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  89. package/dist/ssr/surfaces/resource-messages.js +2 -2
  90. package/dist/ssr/surfaces/resource-messages.js.map +1 -1
  91. package/dist/styles.css +1 -1
  92. package/dist/types/actions/Dropdown.d.ts +14 -0
  93. package/dist/types/actions/FilterChip.d.ts +11 -0
  94. package/dist/types/actions/filter-messages.d.ts +12 -0
  95. package/dist/types/actions/menu-rows.d.ts +7 -2
  96. package/dist/types/chat/ChatComposer.d.ts +13 -0
  97. package/dist/types/chat/chat-messages.d.ts +7 -0
  98. package/dist/types/chat/index.d.ts +1 -1
  99. package/dist/types/content/Calendar.d.ts +7 -0
  100. package/dist/types/content/MessageRow.d.ts +64 -2
  101. package/dist/types/content/index.d.ts +2 -2
  102. package/dist/types/feedback/dialog-core.d.ts +3 -0
  103. package/dist/types/intl/shortcut-messages.d.ts +2 -0
  104. package/dist/types/layout/AppWorkspace.d.ts +2 -0
  105. package/dist/types/layout/MobileShell.d.ts +52 -5
  106. package/dist/types/layout/index.d.ts +2 -1
  107. package/dist/types/layout/scroll-fade.d.ts +5 -0
  108. package/dist/types/surfaces/NoticeCard.d.ts +3 -0
  109. package/package.json +2 -2
@@ -11,13 +11,15 @@ import { spread as _$spread } from "solid-js/web";
11
11
  import { mergeProps as _$mergeProps } from "solid-js/web";
12
12
  import { memo as _$memo } from "solid-js/web";
13
13
  var _tmpl$ = /*#__PURE__*/_$template(`<div>`),
14
- _tmpl$2 = /*#__PURE__*/_$template(`<article><div><!$><!/><!$><!/><!$><!/>`),
15
- _tmpl$3 = /*#__PURE__*/_$template(`<div><p></p><!$><!/>`),
16
- _tmpl$4 = /*#__PURE__*/_$template(`<span>`),
17
- _tmpl$5 = /*#__PURE__*/_$template(`<p>`);
14
+ _tmpl$2 = /*#__PURE__*/_$template(`<article><!$><!/><div><!$><!/><!$><!/><!$><!/>`),
15
+ _tmpl$3 = /*#__PURE__*/_$template(`<i aria-hidden=true>`),
16
+ _tmpl$4 = /*#__PURE__*/_$template(`<div><p></p><!$><!/>`),
17
+ _tmpl$5 = /*#__PURE__*/_$template(`<span>`),
18
+ _tmpl$6 = /*#__PURE__*/_$template(`<p>`);
18
19
  import { children, For, Show, splitProps } from "solid-js";
19
20
  export const NOTICE_CARD_CLASSES = {
20
21
  root: "k2b-notice-card",
22
+ icon: "k2b-notice-card__icon",
21
23
  content: "k2b-notice-card__content",
22
24
  head: "k2b-notice-card__head",
23
25
  title: "k2b-notice-card__title",
@@ -26,13 +28,15 @@ export const NOTICE_CARD_CLASSES = {
26
28
  body: "k2b-notice-card__body"
27
29
  };
28
30
  function NoticeCardComponent(props) {
29
- const [local, articleProps] = splitProps(props, ["tone", "title", "detail", "meta", "children", "class", "bodyClass"]);
31
+ const [local, articleProps] = splitProps(props, ["tone", "icon", "title", "detail", "meta", "children", "class", "bodyClass"]);
30
32
  // Children that render nothing, such as a Show whose condition is false, add no body and no gap.
31
33
  const body = children(() => local.children);
32
34
  const hasBody = () => body.toArray().some(node => node != null && node !== false && node !== "");
33
35
  return (() => {
34
36
  var _el$ = _$getNextElement(_tmpl$2),
35
- _el$2 = _el$.firstChild,
37
+ _el$0 = _el$.firstChild,
38
+ [_el$1, _co$4] = _$getNextMarker(_el$0.nextSibling),
39
+ _el$2 = _el$1.nextSibling,
36
40
  _el$4 = _el$2.firstChild,
37
41
  [_el$5, _co$] = _$getNextMarker(_el$4.nextSibling),
38
42
  _el$6 = _el$5.nextSibling,
@@ -46,39 +50,51 @@ function NoticeCardComponent(props) {
46
50
  get ["data-tone"]() {
47
51
  return local.tone ?? "neutral";
48
52
  }
49
- }), false, true);
53
+ }, () => local.icon ? {
54
+ "data-icon": ""
55
+ } : {}), false, true);
56
+ _$insert(_el$, _$createComponent(Show, {
57
+ get when() {
58
+ return local.icon;
59
+ },
60
+ children: icon => (() => {
61
+ var _el$10 = _$getNextElement(_tmpl$3);
62
+ _$effect(() => _$className(_el$10, `${icon()} ${NOTICE_CARD_CLASSES.icon}`));
63
+ return _el$10;
64
+ })()
65
+ }), _el$1, _co$4);
50
66
  _$insert(_el$2, _$createComponent(Show, {
51
67
  get when() {
52
68
  return local.title;
53
69
  },
54
70
  children: title => (() => {
55
- var _el$0 = _$getNextElement(_tmpl$3),
56
- _el$1 = _el$0.firstChild,
57
- _el$10 = _el$1.nextSibling,
58
- [_el$11, _co$4] = _$getNextMarker(_el$10.nextSibling);
59
- _$insert(_el$1, title);
60
- _$insert(_el$0, _$createComponent(Show, {
71
+ var _el$11 = _$getNextElement(_tmpl$4),
72
+ _el$12 = _el$11.firstChild,
73
+ _el$13 = _el$12.nextSibling,
74
+ [_el$14, _co$5] = _$getNextMarker(_el$13.nextSibling);
75
+ _$insert(_el$12, title);
76
+ _$insert(_el$11, _$createComponent(Show, {
61
77
  get when() {
62
78
  return local.meta;
63
79
  },
64
80
  children: meta => (() => {
65
- var _el$12 = _$getNextElement(_tmpl$4);
66
- _$insert(_el$12, meta);
67
- _$effect(() => _$className(_el$12, NOTICE_CARD_CLASSES.meta));
68
- return _el$12;
81
+ var _el$15 = _$getNextElement(_tmpl$5);
82
+ _$insert(_el$15, meta);
83
+ _$effect(() => _$className(_el$15, NOTICE_CARD_CLASSES.meta));
84
+ return _el$15;
69
85
  })()
70
- }), _el$11, _co$4);
86
+ }), _el$14, _co$5);
71
87
  _$effect(_p$ => {
72
88
  var _v$ = NOTICE_CARD_CLASSES.head,
73
89
  _v$2 = NOTICE_CARD_CLASSES.title;
74
- _v$ !== _p$.e && _$className(_el$0, _p$.e = _v$);
75
- _v$2 !== _p$.t && _$className(_el$1, _p$.t = _v$2);
90
+ _v$ !== _p$.e && _$className(_el$11, _p$.e = _v$);
91
+ _v$2 !== _p$.t && _$className(_el$12, _p$.t = _v$2);
76
92
  return _p$;
77
93
  }, {
78
94
  e: undefined,
79
95
  t: undefined
80
96
  });
81
- return _el$0;
97
+ return _el$11;
82
98
  })()
83
99
  }), _el$5, _co$);
84
100
  _$insert(_el$2, _$createComponent(Show, {
@@ -86,10 +102,10 @@ function NoticeCardComponent(props) {
86
102
  return local.detail;
87
103
  },
88
104
  children: detail => (() => {
89
- var _el$13 = _$getNextElement(_tmpl$5);
90
- _$insert(_el$13, detail);
91
- _$effect(() => _$className(_el$13, NOTICE_CARD_CLASSES.description));
92
- return _el$13;
105
+ var _el$16 = _$getNextElement(_tmpl$6);
106
+ _$insert(_el$16, detail);
107
+ _$effect(() => _$className(_el$16, NOTICE_CARD_CLASSES.description));
108
+ return _el$16;
93
109
  })()
94
110
  }), _el$7, _co$2);
95
111
  _$insert(_el$2, _$createComponent(Show, {
@@ -115,8 +131,8 @@ function NoticeGrid(props) {
115
131
  return props.items.length > 0;
116
132
  },
117
133
  get children() {
118
- var _el$14 = _$getNextElement(_tmpl$);
119
- _$insert(_el$14, _$createComponent(For, {
134
+ var _el$17 = _$getNextElement(_tmpl$);
135
+ _$insert(_el$17, _$createComponent(For, {
120
136
  get each() {
121
137
  return props.items;
122
138
  },
@@ -125,14 +141,14 @@ function NoticeGrid(props) {
125
141
  _$effect(_p$ => {
126
142
  var _v$3 = `k2b-notice-grid ${props.class ?? ""}`,
127
143
  _v$4 = columns();
128
- _v$3 !== _p$.e && _$className(_el$14, _p$.e = _v$3);
129
- _v$4 !== _p$.t && _$setAttribute(_el$14, "data-columns", _p$.t = _v$4);
144
+ _v$3 !== _p$.e && _$className(_el$17, _p$.e = _v$3);
145
+ _v$4 !== _p$.t && _$setAttribute(_el$17, "data-columns", _p$.t = _v$4);
130
146
  return _p$;
131
147
  }, {
132
148
  e: undefined,
133
149
  t: undefined
134
150
  });
135
- return _el$14;
151
+ return _el$17;
136
152
  }
137
153
  });
138
154
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["surfaces/NoticeCard.tsx"],"sourcesContent":["import { children, For, type JSX, Show, splitProps } from \"solid-js\";\nimport type { IntentTone } from \"../semantics\";\n\nexport type NoticeTone = Extract<IntentTone, \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\">;\n\ntype NoticeCardContentProps =\n | { title: JSX.Element; detail?: JSX.Element; meta?: JSX.Element; children?: JSX.Element }\n | { title?: never; detail?: never; meta?: never; children: JSX.Element };\n\nexport type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"title\"> &\n NoticeCardContentProps & {\n tone?: NoticeTone;\n class?: string;\n bodyClass?: string;\n };\n\nexport const NOTICE_CARD_CLASSES = {\n root: \"k2b-notice-card\",\n content: \"k2b-notice-card__content\",\n head: \"k2b-notice-card__head\",\n title: \"k2b-notice-card__title\",\n meta: \"k2b-notice-card__meta\",\n description: \"k2b-notice-card__description\",\n body: \"k2b-notice-card__body\",\n} as const;\n\nfunction NoticeCardComponent(props: NoticeCardProps): JSX.Element {\n const [local, articleProps] = splitProps(props, [\"tone\", \"title\", \"detail\", \"meta\", \"children\", \"class\", \"bodyClass\"]);\n // Children that render nothing, such as a Show whose condition is false, add no body and no gap.\n const body = children(() => local.children);\n const hasBody = () => body.toArray().some((node) => node != null && node !== false && node !== \"\");\n return (\n <article {...articleProps} class={`${NOTICE_CARD_CLASSES.root} ${local.class ?? \"\"}`} data-tone={local.tone ?? \"neutral\"}>\n <div class={NOTICE_CARD_CLASSES.content}>\n <Show when={local.title}>\n {(title) => (\n <div class={NOTICE_CARD_CLASSES.head}>\n <p class={NOTICE_CARD_CLASSES.title}>{title()}</p>\n <Show when={local.meta}>{(meta) => <span class={NOTICE_CARD_CLASSES.meta}>{meta()}</span>}</Show>\n </div>\n )}\n </Show>\n <Show when={local.detail}>{(detail) => <p class={NOTICE_CARD_CLASSES.description}>{detail()}</p>}</Show>\n <Show when={hasBody()}>\n <div class={`${NOTICE_CARD_CLASSES.body} ${local.bodyClass ?? \"\"}`}>{body()}</div>\n </Show>\n </div>\n </article>\n );\n}\n\nexport type NoticeGridProps<T> = {\n items: readonly T[];\n children: (item: T) => JSX.Element;\n class?: string;\n};\n\nfunction NoticeGrid<T>(props: NoticeGridProps<T>): JSX.Element {\n const columns = () => (props.items.length <= 1 ? \"one\" : props.items.length === 2 ? \"two\" : \"three\");\n return (\n <Show when={props.items.length > 0}>\n <div class={`k2b-notice-grid ${props.class ?? \"\"}`} data-columns={columns()}>\n <For each={props.items}>{(item) => props.children(item)}</For>\n </div>\n </Show>\n );\n}\n\nexport const NoticeCard = Object.assign(NoticeCardComponent, { Grid: NoticeGrid });\nexport default NoticeCard;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AAgBpE,OAAO,MAAM,mBAAmB,GAAG;EACjC,IAAI,EAAE,iBAAiB;EACvB,OAAO,EAAE,0BAA0B;EACnC,IAAI,EAAE,uBAAuB;EAC7B,KAAK,EAAE,wBAAwB;EAC/B,IAAI,EAAE,uBAAuB;EAC7B,WAAW,EAAE,8BAA8B;EAC3C,IAAI,EAAE;AACR,CAAU;AAEV,SAAS,mBAAmB,CAAC,KAAsB,EAAe;EAChE,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A;IAAgB;IAAA,kCAC/F,IAAI;MAAA,IAAC,IAAI;QAAA,OAAE,OAAO,CAAC,CAAC;MAAA;MAAA;QAAA;QAAA,gBACkD,IAAI;QAAA,kCAA7D,GAAG,mBAAmB,CAAC,IAAI,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE;QAAA;MAAA;IAAA;IAAA,kCAX1D,mBAAmB,CAAC,OAAO;IAAA;IAAA;EAAA;AAgB7C;AAQA,SAAS,UAAU,CAAI,KAAyB,EAAe;EAC7D,MAAM,OAAO,GAAG,MAAO,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,OAAQ;EACpG,yBACG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;IAAA;IAAA;MAAA;MAAA,mCAE7B,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,KAAK;QAAA;QAAA,UAAI,IAAI,IAAK,KAAK,CAAC,QAAQ,CAAC,IAAI;MAAC;MAAA;QAAA,WAD7C,mBAAmB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;UAAA,OAAgB,OAAO,CAAC,CAAC;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;MAAA;MAAA;IAAA;EAAA;AAKjF;AAEA,OAAO,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE;EAAE,IAAI,EAAE;AAAW,CAAC,CAAC;AAClF,eAAe,UAAU","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["surfaces/NoticeCard.tsx"],"sourcesContent":["import { children, For, type JSX, Show, splitProps } from \"solid-js\";\nimport type { IntentTone } from \"../semantics\";\n\nexport type NoticeTone = Extract<IntentTone, \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\">;\n\ntype NoticeCardContentProps =\n | { title: JSX.Element; detail?: JSX.Element; meta?: JSX.Element; children?: JSX.Element }\n | { title?: never; detail?: never; meta?: never; children: JSX.Element };\n\nexport type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"class\" | \"title\"> &\n NoticeCardContentProps & {\n tone?: NoticeTone;\n /** A Tabler icon class. Turns the notice into a compact status line whose icon and text take the tone colour. */\n icon?: string;\n class?: string;\n bodyClass?: string;\n };\n\nexport const NOTICE_CARD_CLASSES = {\n root: \"k2b-notice-card\",\n icon: \"k2b-notice-card__icon\",\n content: \"k2b-notice-card__content\",\n head: \"k2b-notice-card__head\",\n title: \"k2b-notice-card__title\",\n meta: \"k2b-notice-card__meta\",\n description: \"k2b-notice-card__description\",\n body: \"k2b-notice-card__body\",\n} as const;\n\nfunction NoticeCardComponent(props: NoticeCardProps): JSX.Element {\n const [local, articleProps] = splitProps(props, [\"tone\", \"icon\", \"title\", \"detail\", \"meta\", \"children\", \"class\", \"bodyClass\"]);\n // Children that render nothing, such as a Show whose condition is false, add no body and no gap.\n const body = children(() => local.children);\n const hasBody = () => body.toArray().some((node) => node != null && node !== false && node !== \"\");\n return (\n <article\n {...articleProps}\n class={`${NOTICE_CARD_CLASSES.root} ${local.class ?? \"\"}`}\n data-tone={local.tone ?? \"neutral\"}\n {...(local.icon ? { \"data-icon\": \"\" } : {})}\n >\n <Show when={local.icon}>{(icon) => <i class={`${icon()} ${NOTICE_CARD_CLASSES.icon}`} aria-hidden=\"true\" />}</Show>\n <div class={NOTICE_CARD_CLASSES.content}>\n <Show when={local.title}>\n {(title) => (\n <div class={NOTICE_CARD_CLASSES.head}>\n <p class={NOTICE_CARD_CLASSES.title}>{title()}</p>\n <Show when={local.meta}>{(meta) => <span class={NOTICE_CARD_CLASSES.meta}>{meta()}</span>}</Show>\n </div>\n )}\n </Show>\n <Show when={local.detail}>{(detail) => <p class={NOTICE_CARD_CLASSES.description}>{detail()}</p>}</Show>\n <Show when={hasBody()}>\n <div class={`${NOTICE_CARD_CLASSES.body} ${local.bodyClass ?? \"\"}`}>{body()}</div>\n </Show>\n </div>\n </article>\n );\n}\n\nexport type NoticeGridProps<T> = {\n items: readonly T[];\n children: (item: T) => JSX.Element;\n class?: string;\n};\n\nfunction NoticeGrid<T>(props: NoticeGridProps<T>): JSX.Element {\n const columns = () => (props.items.length <= 1 ? \"one\" : props.items.length === 2 ? \"two\" : \"three\");\n return (\n <Show when={props.items.length > 0}>\n <div class={`k2b-notice-grid ${props.class ?? \"\"}`} data-columns={columns()}>\n <For each={props.items}>{(item) => props.children(item)}</For>\n </div>\n </Show>\n );\n}\n\nexport const NoticeCard = Object.assign(NoticeCardComponent, { Grid: NoticeGrid });\nexport default NoticeCard;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AAkBpE,OAAO,MAAM,mBAAmB,GAAG;EACjC,IAAI,EAAE,iBAAiB;EACvB,IAAI,EAAE,uBAAuB;EAC7B,OAAO,EAAE,0BAA0B;EACnC,IAAI,EAAE,uBAAuB;EAC7B,KAAK,EAAE,wBAAwB;EAC/B,IAAI,EAAE,uBAAuB;EAC7B,WAAW,EAAE,8BAA8B;EAC3C,IAAI,EAAE;AACR,CAAU;AAEV,SAAS,mBAAmB,CAAC,KAAsB,EAAe;EAChE,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;EAC9H;EACA,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC;EAC3C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAE,IAAI,IAAK,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,K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BACkD,IAAI;QAAA,kCAA7D,GAAG,mBAAmB,CAAC,IAAI,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE;QAAA;MAAA;IAAA;IAAA,kCAX1D,mBAAmB,CAAC,OAAO;IAAA;IAAA;EAAA;AAgB7C;AAQA,SAAS,UAAU,CAAI,KAAyB,EAAe;EAC7D,MAAM,OAAO,GAAG,MAAO,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,OAAQ;EACpG,yBACG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;IAAA;IAAA;MAAA;MAAA,mCAE7B,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,KAAK;QAAA;QAAA,UAAI,IAAI,IAAK,KAAK,CAAC,QAAQ,CAAC,IAAI;MAAC;MAAA;QAAA,WAD7C,mBAAmB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;UAAA,OAAgB,OAAO,CAAC,CAAC;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;MAAA;MAAA;IAAA;EAAA;AAKjF;AAEA,OAAO,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE;EAAE,IAAI,EAAE;AAAW,CAAC,CAAC;AAClF,eAAe,UAAU","ignoreList":[]}
@@ -5,13 +5,13 @@ const resourceMessages = i18n.define({
5
5
  messages: {
6
6
  en: {
7
7
  resourceUntitled: "Untitled",
8
- resourceNoAccess: "No access",
8
+ resourceNoAccess: "Item not available",
9
9
  resourceDeleted: "Item deleted",
10
10
  resourceUnavailable: "Not available right now"
11
11
  },
12
12
  de: {
13
13
  resourceUntitled: "Ohne Titel",
14
- resourceNoAccess: "Kein Zugriff",
14
+ resourceNoAccess: "Element nicht verfügbar",
15
15
  resourceDeleted: "Element gelöscht",
16
16
  resourceUnavailable: "Gerade nicht verfügbar"
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["surfaces/resource-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst resourceMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n resourceUntitled: \"Untitled\",\n resourceNoAccess: \"No access\",\n resourceDeleted: \"Item deleted\",\n resourceUnavailable: \"Not available right now\",\n },\n de: {\n resourceUntitled: \"Ohne Titel\",\n resourceNoAccess: \"Kein Zugriff\",\n resourceDeleted: \"Element gelöscht\",\n resourceUnavailable: \"Gerade nicht verfügbar\",\n },\n },\n});\n\nexport type ResourceMessages = ReturnType<(typeof resourceMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useResourceMessages = (): (() => ResourceMessages) => {\n const locale = useLocale();\n return () => resourceMessages.resolve([locale()]).t;\n};\n\nexport const checkResourceMessages = () => resourceMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,gBAAgB,EAAE,UAAU;MAC5B,gBAAgB,EAAE,WAAW;MAC7B,eAAe,EAAE,cAAc;MAC/B,mBAAmB,EAAE;IACvB,CAAC;IACD,EAAE,EAAE;MACF,gBAAgB,EAAE,YAAY;MAC9B,gBAAgB,EAAE,cAAc;MAChC,eAAe,EAAE,kBAAkB;MACnC,mBAAmB,EAAE;IACvB;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["surfaces/resource-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst resourceMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n resourceUntitled: \"Untitled\",\n resourceNoAccess: \"Item not available\",\n resourceDeleted: \"Item deleted\",\n resourceUnavailable: \"Not available right now\",\n },\n de: {\n resourceUntitled: \"Ohne Titel\",\n resourceNoAccess: \"Element nicht verfügbar\",\n resourceDeleted: \"Element gelöscht\",\n resourceUnavailable: \"Gerade nicht verfügbar\",\n },\n },\n});\n\nexport type ResourceMessages = ReturnType<(typeof resourceMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useResourceMessages = (): (() => ResourceMessages) => {\n const locale = useLocale();\n return () => resourceMessages.resolve([locale()]).t;\n};\n\nexport const checkResourceMessages = () => resourceMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,gBAAgB,EAAE,UAAU;MAC5B,gBAAgB,EAAE,oBAAoB;MACtC,eAAe,EAAE,cAAc;MAC/B,mBAAmB,EAAE;IACvB,CAAC;IACD,EAAE,EAAE;MACF,gBAAgB,EAAE,YAAY;MAC9B,gBAAgB,EAAE,yBAAyB;MAC3C,eAAe,EAAE,kBAAkB;MACnC,mBAAmB,EAAE;IACvB;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,mBAAmB,GAAG,MAAgC;EACjE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import { ssrStyle as _$ssrStyle } from "solid-js/web";
2
2
  import { ssrElement as _$ssrElement } from "solid-js/web";
3
- import { mergeProps as _$mergeProps } from "solid-js/web";
4
3
  import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
4
+ import { mergeProps as _$mergeProps } from "solid-js/web";
5
5
  import { memo as _$memo } from "solid-js/web";
6
6
  import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
7
7
  import { ssr as _$ssr } from "solid-js/web";
@@ -13,14 +13,17 @@ var _tmpl$ = ["<span class=\"k2b-dropdown__copy\"><span>", "</span>", "</span>"]
13
13
  _tmpl$4 = ["<small>", "</small>"],
14
14
  _tmpl$5 = ["<button type=\"button\" role=\"menuitem\"", " tabindex=\"-1\" class=\"", "\"", "", ">", "</button>"],
15
15
  _tmpl$6 = ["<a", " role=\"menuitem\"", " tabindex=\"-1\" class=\"", "\"", ">", "</a>"],
16
- _tmpl$7 = "<i class=\"ti ti-check\"></i>",
17
- _tmpl$8 = ["<span class=\"k2b-dropdown__checkbox\" aria-hidden=\"true\">", "</span>"],
18
- _tmpl$9 = ["<i class=\"ti ti-check k2b-dropdown__check\"", " aria-hidden=\"true\"></i>"],
19
- _tmpl$0 = ["<span class=\"k2b-dropdown__color\" style=\"", "\" aria-hidden=\"true\"></span>"],
20
- _tmpl$1 = ["<div class=\"k2b-dropdown__row\">", "</div>"],
21
- _tmpl$10 = ["<div class=\"k2b-dropdown__section\"", " role=\"group\"", ">", "", "</div>"],
22
- _tmpl$11 = ["<div class=\"k2b-dropdown__label\">", "</div>"],
23
- _tmpl$12 = ["<span class=\"", "\">", "<div", " popover=\"auto\" role=\"menu\"", " class=\"", "\" style=\"", "\"", ">", "</div></span>"];
16
+ _tmpl$7 = ["<div class=\"k2b-dropdown__pair\">", "", "</div>"],
17
+ _tmpl$8 = ["<button type=\"button\" role=\"menuitem\" tabindex=\"-1\"", ">", "</button>"],
18
+ _tmpl$9 = "<i class=\"ti ti-check\"></i>",
19
+ _tmpl$0 = ["<span class=\"k2b-dropdown__checkbox\" aria-hidden=\"true\">", "</span>"],
20
+ _tmpl$1 = ["<i class=\"ti ti-check k2b-dropdown__check\"", " aria-hidden=\"true\"></i>"],
21
+ _tmpl$10 = ["<span class=\"k2b-dropdown__color\" style=\"", "\" aria-hidden=\"true\"></span>"],
22
+ _tmpl$11 = ["<div class=\"k2b-dropdown__row\">", "</div>"],
23
+ _tmpl$12 = ["<div class=\"k2b-dropdown__section\"", " role=\"group\"", ">", "", "</div>"],
24
+ _tmpl$13 = ["<div class=\"k2b-dropdown__label\">", "</div>"],
25
+ _tmpl$14 = ["<div class=\"k2b-dropdown__label k2b-dropdown__label--action\"><span>", "</span>", "</div>"],
26
+ _tmpl$15 = ["<span class=\"", "\">", "<div", " popover=\"auto\" role=\"menu\"", " class=\"", "\" style=\"", "\"", ">", "</div></span>"];
24
27
  import { createContext, createEffect, createSignal, createUniqueId, For, onCleanup, onMount, Show, splitProps, useContext } from "solid-js";
25
28
  import { Dynamic } from "solid-js/web";
26
29
  import { Tooltip, useLabelTooltip } from "../feedback/Tooltip";
@@ -28,19 +31,21 @@ import { returnFocus, ringOnReturn } from "../internal/focus-return";
28
31
  import { useLocale } from "../intl/locale";
29
32
  import { useUiMessages } from "../intl/messages";
30
33
  import { Button, iconTitle } from "./Button";
31
- import { focusRowSegment } from "./menu-rows";
34
+ import { focusMenuRow, focusRowSegment } from "./menu-rows";
32
35
  import { openMenuSheet, prefersMenuSheet } from "./menu-sheet";
33
36
 
34
37
  // Resolved outside JSX: a conditional attribute compiles to a lazy memo, which would be created inside the click handler.
35
38
  const selectAction = item => item.action;
36
39
 
40
+ /** A second, smaller action at the end of a row, such as "Only" beside a checkbox; it keeps the menu open. */
41
+
37
42
  /** Declarative radio or checkbox row for compact action menus. */
38
43
 
39
44
  const MenuContext = createContext();
40
45
  const DropdownContext = createContext();
41
46
  const actionableItems = menu => menu ? Array.from(menu.querySelectorAll(["[role='menuitem']:not([aria-disabled='true'])", "[role='menuitemcheckbox']:not([aria-disabled='true'])", "[role='menuitemradio']:not([aria-disabled='true'])"].join(", "))) : [];
42
47
  const focusMenuItem = (menu, index) => {
43
- const items = actionableItems(menu);
48
+ const items = actionableItems(menu).filter(item => !item.classList.contains("k2b-dropdown__secondary"));
44
49
  if (items.length === 0) return;
45
50
  items[(index + items.length) % items.length]?.focus();
46
51
  };
@@ -92,6 +97,22 @@ export function DropdownItem(props) {
92
97
  });
93
98
  }
94
99
  function DropdownChoiceItem(props) {
100
+ return _$createComponent(Show, {
101
+ get when() {
102
+ return props.secondary;
103
+ },
104
+ get fallback() {
105
+ return _$createComponent(DropdownChoiceRow, props);
106
+ },
107
+ children: secondary => _$ssr(_tmpl$7, _$escape(_$createComponent(DropdownChoiceRow, props)), _$escape(_$createComponent(DropdownSecondaryButton, _$mergeProps(secondary, {
108
+ "class": "k2b-dropdown__secondary"
109
+ }))))
110
+ });
111
+ }
112
+ function DropdownSecondaryButton(props) {
113
+ return _$ssr(_tmpl$8, _$ssrAttribute("class", _$escape(props.class, true), false) + _$ssrAttribute("aria-label", _$escape(props.ariaLabel, true), false), _$escape(props.label));
114
+ }
115
+ function DropdownChoiceRow(props) {
95
116
  const menu = useContext(MenuContext);
96
117
  const checked = () => typeof props.checked === "function" ? props.checked() : props.checked;
97
118
  let element;
@@ -149,12 +170,12 @@ function DropdownChoiceItem(props) {
149
170
  return props.choice === "checkbox";
150
171
  },
151
172
  get children() {
152
- return _$ssr(_tmpl$8, _$escape(_$createComponent(Show, {
173
+ return _$ssr(_tmpl$0, _$escape(_$createComponent(Show, {
153
174
  get when() {
154
175
  return checked();
155
176
  },
156
177
  get children() {
157
- return _$ssr(_tmpl$7);
178
+ return _$ssr(_tmpl$9);
158
179
  }
159
180
  })));
160
181
  }
@@ -175,7 +196,7 @@ function DropdownChoiceItem(props) {
175
196
  get when() {
176
197
  return props.color;
177
198
  },
178
- children: color => _$ssr(_tmpl$0, _$ssrStyleProperty("--k2b-dropdown-color:", _$escape(color(), true)))
199
+ children: color => _$ssr(_tmpl$10, _$ssrStyleProperty("--k2b-dropdown-color:", _$escape(color(), true)))
179
200
  }), _$ssr(_tmpl$, _$escape(props.label), _$escape(_$createComponent(Show, {
180
201
  get when() {
181
202
  return props.description;
@@ -186,7 +207,7 @@ function DropdownChoiceItem(props) {
186
207
  return props.choice === "radio";
187
208
  },
188
209
  get children() {
189
- return _$ssr(_tmpl$9, _$ssrAttribute("data-hidden", checked() ? _$escape(undefined, true) : "true", false));
210
+ return _$ssr(_tmpl$1, _$ssrAttribute("data-hidden", checked() ? _$escape(undefined, true) : "true", false));
190
211
  }
191
212
  })];
192
213
  }
@@ -254,11 +275,21 @@ export function DropdownItems(props) {
254
275
  return renderItem(item);
255
276
  },
256
277
  get children() {
257
- return _$ssr(_tmpl$10, _$ssrAttribute("data-divided", index() > 0 ? "true" : _$escape(undefined, true), false), _$ssrAttribute("aria-label", _$escape(item.sectionLabel ?? (item.layout === "row" ? undefined : messages().actions), true), false), _$escape(_$createComponent(Show, {
278
+ return _$ssr(_tmpl$12, _$ssrAttribute("data-divided", index() > 0 ? "true" : _$escape(undefined, true), false), _$ssrAttribute("aria-label", _$escape(item.sectionLabel ?? (item.layout === "row" ? undefined : messages().actions), true), false), _$escape(_$createComponent(Show, {
258
279
  get when() {
259
280
  return item.sectionLabel;
260
281
  },
261
- children: label => _$ssr(_tmpl$11, _$escape(label()))
282
+ children: label => _$createComponent(Show, {
283
+ get when() {
284
+ return item.labelAction;
285
+ },
286
+ get fallback() {
287
+ return _$ssr(_tmpl$13, _$escape(label()));
288
+ },
289
+ children: action => _$ssr(_tmpl$14, _$escape(label()), _$escape(_$createComponent(DropdownSecondaryButton, _$mergeProps(action, {
290
+ "class": "k2b-dropdown__label-action"
291
+ }))))
292
+ })
262
293
  })), _$escape(_$createComponent(Show, {
263
294
  get when() {
264
295
  return item.layout === "row";
@@ -272,7 +303,7 @@ export function DropdownItems(props) {
272
303
  });
273
304
  },
274
305
  get children() {
275
- return _$ssr(_tmpl$1, _$escape(_$createComponent(For, {
306
+ return _$ssr(_tmpl$11, _$escape(_$createComponent(For, {
276
307
  get each() {
277
308
  return item.items;
278
309
  },
@@ -505,15 +536,8 @@ function DropdownRoot(props) {
505
536
  };
506
537
  const handleMenuKeyDown = event => {
507
538
  const items = actionableItems(menuRef);
508
- const current = items.indexOf(document.activeElement);
509
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
510
- event.preventDefault();
511
- focusMenuItem(menuRef, current + (event.key === "ArrowDown" ? 1 : -1));
512
- } else if (focusRowSegment(items, event.key)) {
513
- event.preventDefault();
514
- } else if (event.key === "Home" || event.key === "End") {
539
+ if (focusMenuRow(items, event.key) || focusRowSegment(items, event.key)) {
515
540
  event.preventDefault();
516
- focusMenuItem(menuRef, event.key === "Home" ? 0 : -1);
517
541
  } else if (event.key === "Escape") {
518
542
  event.preventDefault();
519
543
  returnFocus(triggerRef, triggerRing);
@@ -563,7 +587,7 @@ function DropdownRoot(props) {
563
587
  return _$createComponent(DropdownContext.Provider, {
564
588
  value: context,
565
589
  get children() {
566
- return _$ssr(_tmpl$12, `k2b-dropdown ${_$escape(props.class ?? "", true)}`, _$escape(props.children), _$ssrAttribute("id", _$escape(menuId, true), false), _$ssrAttribute("aria-label", _$escape(props.label ?? messages().dropdownMenu, true), false), `k2b-dropdown__menu ${_$escape(props.menuClass ?? "", true)}`, _$ssrStyle(props.width ? {
590
+ return _$ssr(_tmpl$15, `k2b-dropdown ${_$escape(props.class ?? "", true)}`, _$escape(props.children), _$ssrAttribute("id", _$escape(menuId, true), false), _$ssrAttribute("aria-label", _$escape(props.label ?? messages().dropdownMenu, true), false), `k2b-dropdown__menu ${_$escape(props.menuClass ?? "", true)}`, _$ssrStyle(props.width ? {
567
591
  "--k2b-dropdown-width": props.width
568
592
  } : undefined), _$ssrAttribute("data-width", props.width ? "fixed" : _$escape(undefined, true), false) + _$ssrAttribute("data-variant", _$escape(props.variant ?? "default", true), false) + _$ssrAttribute("data-position", _$escape(position(), true), false), _$escape(_$createComponent(DropdownItems, {
569
593
  get items() {
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["actions/Dropdown.tsx"],"sourcesContent":["import {\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n For,\n type JSX,\n onCleanup,\n onMount,\n Show,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Tooltip, type TooltipPlacement, useLabelTooltip } from \"../feedback/Tooltip\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { useLocale } from \"../intl/locale\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant, iconTitle } from \"./Button\";\nimport { focusRowSegment } from \"./menu-rows\";\nimport { openMenuSheet, prefersMenuSheet } from \"./menu-sheet\";\n\n// Resolved outside JSX: a conditional attribute compiles to a lazy memo, which would be created inside the click handler.\nconst selectAction = (item: { action?: () => void }) => item.action;\n\nexport type DropdownPosition = \"bottom-right\" | \"bottom-left\" | \"top-right\" | \"top-left\" | \"right-start\";\n\nexport type DropdownActionBase = {\n class?: string;\n disabled?: boolean;\n icon?: string;\n image?: string;\n label: string;\n /**\n * Accessible name when it must say more than the visible label, such as the current value and what the next\n * activation does. It must contain the visible label.\n */\n ariaLabel?: string;\n description?: string;\n /** Quiet trailing information, such as a count. */\n trailing?: JSX.Element;\n variant?: \"danger\";\n};\n\nexport type DropdownAction =\n | (DropdownActionBase & {\n action: () => void;\n /**\n * Set `false` for an action that changes a value in place, such as cycling a setting: the menu stays open and\n * the focus stays on the row. Defaults to `true`.\n */\n closeOnSelect?: boolean;\n /**\n * In a phone sheet, run while the tap still counts as the person's gesture, before the sheet closes, as browsers\n * require for clipboard writes. Other actions run after the sheet has left the history. Such an action must\n * not navigate or open a dialog.\n */\n immediate?: boolean;\n href?: never;\n external?: never;\n })\n | (DropdownActionBase & {\n href: string;\n external?: boolean;\n /** Runs on a plain click instead of following the link; modified clicks, middle-click, and the link's menu keep it. */\n action?: () => void;\n })\n | (DropdownActionBase & {\n disabled: true;\n action?: never;\n href?: never;\n external?: never;\n });\n\n/** Declarative radio or checkbox row for compact action menus. */\nexport type DropdownChoice = DropdownActionBase & {\n action: () => void;\n checked: boolean | (() => boolean);\n choice: \"checkbox\" | \"radio\";\n href?: string;\n closeOnSelect?: boolean;\n color?: string;\n};\n\nexport type DropdownSection = {\n sectionLabel?: string;\n /**\n * `row` sets a few short radio choices, such as a sort direction, side by side as one segmented row. Give it a\n * `sectionLabel`: the label names the choice above the row and for screen readers.\n */\n layout?: \"row\";\n items: readonly (DropdownAction | DropdownChoice)[];\n};\n\nexport type DropdownItem = DropdownAction | DropdownChoice | DropdownSection;\n\nexport type DropdownProps = {\n items: readonly DropdownItem[];\n children: JSX.Element;\n position?: DropdownPosition | (() => DropdownPosition);\n /** Larger menu rows and typography for touch. Defaults to `default`. */\n variant?: \"default\" | \"touch\";\n /**\n * Exact menu width as a CSS length. Without it the menu sizes to its longest\n * entry: at least `12rem` (`18rem` for touch), at most the viewport width\n * less `1rem` per side, where longer entries wrap.\n */\n width?: string;\n class?: string;\n menuClass?: string;\n onClose?: () => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n label?: string;\n align?: \"start\" | \"end\";\n /**\n * `sheet` opens the same items as a bottom sheet on phones (below 48rem) instead of a menu beside the trigger.\n * Defaults to `menu`. A controlled menu (`open`) always stays a menu.\n */\n phone?: \"menu\" | \"sheet\";\n};\n\nexport type DropdownTriggerProps = Omit<\n ButtonProps,\n \"aria-controls\" | \"aria-expanded\" | \"aria-haspopup\" | \"children\" | \"disabled\" | \"onClick\" | \"onKeyDown\"\n> & {\n children: JSX.Element;\n /** Use `plain` when a specialized component class owns the complete visual treatment. */\n appearance?: \"button\" | \"plain\";\n disabled?: boolean;\n iconOnly?: boolean;\n label?: string;\n size?: ButtonSize;\n tooltip?: JSX.Element | false;\n tooltipDelay?: number;\n tooltipPlacement?: TooltipPlacement;\n variant?: ButtonVariant;\n};\n\nexport type DropdownItemProps = {\n children: JSX.Element;\n closeOnSelect?: boolean;\n ariaLabel?: string;\n icon?: string;\n image?: string;\n description?: string;\n /** Quiet trailing information, such as a count. */\n trailing?: JSX.Element;\n disabled?: boolean;\n danger?: boolean;\n variant?: \"danger\";\n href?: string;\n external?: boolean;\n /** Runs when the item is chosen. With `href`, a plain click runs it instead of following the link. */\n onSelect?: () => void;\n class?: string;\n};\n\ntype MenuContextValue = {\n close: (restoreFocus?: boolean) => void;\n};\n\ntype DropdownContextValue = {\n disabled: () => boolean;\n menuId: string;\n open: () => boolean;\n registerTrigger: (element: HTMLButtonElement) => void;\n toggle: () => void;\n triggerKeyDown: JSX.EventHandlerUnion<HTMLButtonElement, KeyboardEvent>;\n};\n\nconst MenuContext = createContext<MenuContextValue>();\nconst DropdownContext = createContext<DropdownContextValue>();\n\nconst actionableItems = (menu: HTMLElement | undefined): HTMLElement[] =>\n menu\n ? Array.from(\n menu.querySelectorAll<HTMLElement>(\n [\n \"[role='menuitem']:not([aria-disabled='true'])\",\n \"[role='menuitemcheckbox']:not([aria-disabled='true'])\",\n \"[role='menuitemradio']:not([aria-disabled='true'])\",\n ].join(\", \"),\n ),\n )\n : [];\n\nconst focusMenuItem = (menu: HTMLElement | undefined, index: number): void => {\n const items = actionableItems(menu);\n if (items.length === 0) return;\n items[(index + items.length) % items.length]?.focus();\n};\n\nexport const dropdownPosition = (\n trigger: DOMRect,\n menu: Pick<DOMRect, \"width\" | \"height\">,\n position: DropdownPosition,\n viewport: { width: number; height: number },\n gap = 4,\n): { left: number; top: number } => {\n let left = trigger.left;\n let top = trigger.bottom + gap;\n\n if (position === \"bottom-left\" || position === \"top-left\") left = trigger.right - menu.width;\n if (position === \"top-right\" || position === \"top-left\") top = trigger.top - menu.height - gap;\n if (position === \"right-start\") {\n left = trigger.right + gap;\n top = trigger.top;\n }\n\n return {\n left: Math.max(8, Math.min(left, viewport.width - menu.width - 8)),\n top: Math.max(8, Math.min(top, viewport.height - menu.height - 8)),\n };\n};\n\nconst itemContent = (props: {\n description?: string;\n icon?: string;\n image?: string;\n trailing?: JSX.Element;\n children: JSX.Element;\n}): JSX.Element => (\n <>\n <Show when={props.image} fallback={<Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}>\n {(image) => <img class=\"k2b-dropdown__image\" src={image()} alt=\"\" />}\n </Show>\n <span class=\"k2b-dropdown__copy\">\n <span>{props.children}</span>\n <Show when={props.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n {props.trailing}\n </>\n);\n\nexport function DropdownItem(props: DropdownItemProps): JSX.Element {\n const menu = useContext(MenuContext);\n const danger = () => props.danger || props.variant === \"danger\";\n const content = itemContent(props);\n\n return (\n <Show\n when={!props.disabled ? props.href : undefined}\n fallback={\n <button\n type=\"button\"\n role=\"menuitem\"\n aria-label={props.ariaLabel}\n tabIndex={-1}\n class={`k2b-dropdown__item ${props.class ?? \"\"}`}\n data-danger={danger() ? \"true\" : undefined}\n disabled={props.disabled}\n aria-disabled={props.disabled ? \"true\" : undefined}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (props.closeOnSelect !== false) menu?.close();\n props.onSelect?.();\n }}\n >\n {content}\n </button>\n }\n >\n {(href) => (\n <a\n href={href()}\n target={props.external ? \"_blank\" : undefined}\n rel={props.external ? \"noopener noreferrer\" : undefined}\n role=\"menuitem\"\n aria-label={props.ariaLabel}\n tabIndex={-1}\n class={`k2b-dropdown__item ${props.class ?? \"\"}`}\n data-danger={danger() ? \"true\" : undefined}\n onClick={(event) => {\n // With `onSelect`, a plain click runs it in place of the link; a modified click keeps its browser meaning.\n if (props.onSelect && !(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {\n event.preventDefault();\n menu?.close();\n props.onSelect();\n return;\n }\n menu?.close(false);\n }}\n >\n {content}\n </a>\n )}\n </Show>\n );\n}\n\nfunction DropdownChoiceItem(props: DropdownChoice): JSX.Element {\n const menu = useContext(MenuContext);\n const checked = () => (typeof props.checked === \"function\" ? props.checked() : props.checked);\n let element: HTMLElement | undefined;\n return (\n <Dynamic\n ref={(node: HTMLAnchorElement | HTMLButtonElement) => {\n element = node;\n }}\n component={!props.disabled && props.href ? \"a\" : \"button\"}\n href={!props.disabled ? props.href : undefined}\n type={!props.disabled && props.href ? undefined : \"button\"}\n role={props.choice === \"checkbox\" ? \"menuitemcheckbox\" : \"menuitemradio\"}\n aria-label={props.ariaLabel}\n aria-checked={checked()}\n aria-disabled={props.disabled ? \"true\" : undefined}\n tabIndex={-1}\n class={`k2b-dropdown__item ${props.class ?? \"\"}`}\n data-selected={checked() ? \"true\" : undefined}\n disabled={props.disabled}\n onClick={(event: MouseEvent) => {\n if (props.href && (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {\n menu?.close(false);\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n if (props.closeOnSelect !== false) menu?.close();\n props.action();\n }}\n onKeyDown={(event: KeyboardEvent) => {\n // A link answers only Enter; as a menu choice it also answers Space, like the button form.\n if (event.key !== \" \" || props.disabled || !props.href) return;\n event.preventDefault();\n element?.click();\n }}\n >\n <Show when={props.choice === \"checkbox\"}>\n <span class=\"k2b-dropdown__checkbox\" aria-hidden=\"true\">\n <Show when={checked()}>\n <i class=\"ti ti-check\" />\n </Show>\n </span>\n </Show>\n <Show when={props.image} fallback={<Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}>\n {(image) => <img class=\"k2b-dropdown__image\" src={image()} alt=\"\" />}\n </Show>\n <Show when={props.color}>\n {(color) => <span class=\"k2b-dropdown__color\" style={{ \"--k2b-dropdown-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-dropdown__copy\">\n <span>{props.label}</span>\n <Show when={props.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n {props.trailing}\n {/* Always present for radios, so selecting the widest entry cannot widen a content-sized menu. */}\n <Show when={props.choice === \"radio\"}>\n <i class=\"ti ti-check k2b-dropdown__check\" data-hidden={checked() ? undefined : \"true\"} aria-hidden=\"true\" />\n </Show>\n </Dynamic>\n );\n}\n\nexport function DropdownItems(props: { items: readonly DropdownItem[]; close: (restoreFocus?: boolean) => void }): JSX.Element {\n const messages = useUiMessages();\n const renderItem = (item: DropdownAction | DropdownChoice): JSX.Element =>\n \"choice\" in item ? (\n <DropdownChoiceItem {...item} />\n ) : (\n <DropdownItem\n ariaLabel={item.ariaLabel}\n closeOnSelect={\"closeOnSelect\" in item ? item.closeOnSelect : undefined}\n icon={item.icon}\n image={item.image}\n description={item.description}\n trailing={item.trailing}\n variant={item.variant}\n disabled={item.disabled}\n class={item.class}\n href={\"href\" in item ? item.href : undefined}\n external={\"external\" in item ? item.external : undefined}\n onSelect={selectAction(item)}\n >\n {item.label}\n </DropdownItem>\n );\n\n return (\n <MenuContext.Provider value={{ close: props.close }}>\n <For each={props.items}>\n {(item, index) => (\n <Show when={\"items\" in item} fallback={renderItem(item as DropdownAction | DropdownChoice)}>\n <div\n class=\"k2b-dropdown__section\"\n data-divided={index() > 0 ? \"true\" : undefined}\n role=\"group\"\n // A row of choices is no set of actions: without a label it stays unnamed rather than misnamed.\n aria-label={\n (item as DropdownSection).sectionLabel ?? ((item as DropdownSection).layout === \"row\" ? undefined : messages().actions)\n }\n >\n <Show when={(item as DropdownSection).sectionLabel}>{(label) => <div class=\"k2b-dropdown__label\">{label()}</div>}</Show>\n <Show\n when={(item as DropdownSection).layout === \"row\"}\n fallback={<For each={(item as DropdownSection).items}>{renderItem}</For>}\n >\n <div class=\"k2b-dropdown__row\">\n <For each={(item as DropdownSection).items}>{renderItem}</For>\n </div>\n </Show>\n </div>\n </Show>\n )}\n </For>\n </MenuContext.Provider>\n );\n}\n\nfunction DropdownTrigger(props: DropdownTriggerProps): JSX.Element {\n const context = useContext(DropdownContext);\n if (!context) throw new Error(\"Dropdown.Trigger must be used inside Dropdown.Root\");\n const [local, rest] = splitProps(props, [\n \"appearance\",\n \"children\",\n \"class\",\n \"disabled\",\n \"iconOnly\",\n \"label\",\n \"ref\",\n \"size\",\n \"tabIndex\",\n \"title\",\n \"tooltip\",\n \"tooltipDelay\",\n \"tooltipPlacement\",\n \"type\",\n \"variant\",\n ]);\n let target: HTMLButtonElement | undefined;\n const disabled = () => Boolean(context.disabled() || local.disabled);\n // An icon-only trigger shows its label as a hint, like IconButton.\n const tooltip = useLabelTooltip(\n () => local.tooltip,\n () => (local.iconOnly ? (local.title ?? local.label) : undefined),\n );\n const register = (element: HTMLButtonElement) => {\n target = element;\n context.registerTrigger(element);\n if (typeof local.ref === \"function\") local.ref(element);\n };\n const click: JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent> = (event) => {\n event.stopPropagation();\n context.toggle();\n };\n\n if (local.appearance !== \"plain\") {\n return (\n <Button\n {...rest}\n ref={register}\n aria-controls={context.menuId}\n aria-expanded={context.open()}\n aria-haspopup=\"menu\"\n aria-label={local.label}\n disabled={disabled()}\n tabIndex={disabled() ? -1 : local.tabIndex}\n onClick={click}\n onKeyDown={context.triggerKeyDown}\n type={local.type ?? \"button\"}\n class={`${local.iconOnly ? \"k2b-icon-button\" : \"\"} k2b-dropdown__trigger ${local.class ?? \"\"}`}\n size={local.size}\n variant={local.variant ?? (local.iconOnly ? \"ghost\" : undefined)}\n title={iconTitle(local.title, tooltip())}\n tooltip={tooltip()}\n tooltipDelay={local.tooltipDelay}\n tooltipPlacement={local.tooltipPlacement}\n >\n {local.children}\n </Button>\n );\n }\n\n return (\n <>\n <button\n {...rest}\n ref={register}\n aria-controls={context.menuId}\n aria-expanded={context.open()}\n aria-haspopup=\"menu\"\n aria-label={local.label}\n disabled={disabled()}\n tabIndex={disabled() ? -1 : local.tabIndex}\n onClick={click}\n onKeyDown={context.triggerKeyDown}\n type={local.type ?? \"button\"}\n class={`k2b-dropdown__trigger ${local.class ?? \"\"}`}\n title={iconTitle(local.title, tooltip())}\n >\n {local.children}\n </button>\n <Show when={tooltip() !== false && tooltip() !== undefined}>\n <Tooltip\n content={tooltip() as JSX.Element}\n target={() => target}\n delay={local.tooltipDelay}\n disabled={disabled()}\n placement={local.tooltipPlacement}\n />\n </Show>\n </>\n );\n}\n\n/** Accessible top-layer menu with explicit trigger ownership. */\nfunction DropdownRoot(props: DropdownProps): JSX.Element {\n const messages = useUiMessages();\n const locale = useLocale();\n /** The open phone sheet's cancel switch: it closes when the menu goes or is disabled, as the popover does. */\n let sheet: AbortController | undefined;\n const id = createUniqueId().replace(/[^a-zA-Z0-9_-]/g, \"-\");\n const menuId = `k2b-dropdown-${id}`;\n const [internalOpen, setInternalOpen] = createSignal(false);\n let triggerRef: HTMLButtonElement | undefined;\n let menuRef: HTMLDivElement | undefined;\n let triggerRing = true;\n let mounted = false;\n /** Where a key on the trigger asked the focus to go; a controlled menu opens later, in its owner's update. */\n let keyFocus: \"first\" | \"last\" | false = false;\n let viewportListenersAttached = false;\n let resizeObserver: ResizeObserver | undefined;\n\n const isOpen = () => props.open ?? internalOpen();\n const position = (): DropdownPosition =>\n typeof props.position === \"function\" ? props.position() : (props.position ?? (props.align === \"end\" ? \"bottom-left\" : \"bottom-right\"));\n\n const place = () => {\n if (!triggerRef || !menuRef) return;\n const rect = dropdownPosition(triggerRef.getBoundingClientRect(), menuRef.getBoundingClientRect(), position(), {\n width: window.innerWidth,\n height: window.innerHeight,\n });\n menuRef.style.left = `${rect.left}px`;\n menuRef.style.top = `${rect.top}px`;\n };\n const reposition = () => {\n if (isOpen()) place();\n };\n const attachViewportListeners = () => {\n if (viewportListenersAttached) return;\n viewportListenersAttached = true;\n window.addEventListener(\"resize\", reposition);\n window.addEventListener(\"scroll\", reposition, true);\n // A content-sized menu changes size when its items change while it is open.\n if (menuRef && typeof ResizeObserver !== \"undefined\") {\n resizeObserver ??= new ResizeObserver(reposition);\n resizeObserver.observe(menuRef);\n }\n };\n const detachViewportListeners = () => {\n if (!viewportListenersAttached) return;\n viewportListenersAttached = false;\n window.removeEventListener(\"resize\", reposition);\n window.removeEventListener(\"scroll\", reposition, true);\n resizeObserver?.disconnect();\n };\n const close = (restoreFocus = true) => {\n // Before hiding, so the popover does not return focus on its own.\n if (restoreFocus) returnFocus(triggerRef, triggerRing);\n if (menuRef?.matches(\":popover-open\")) menuRef.hidePopover();\n // Like `open`, expose the closed state now: the toggle event can arrive after the next key press, and a trigger\n // that still reads as open would ignore Enter (Escape, then Enter at once, must reopen).\n setInternalOpen(false);\n detachViewportListeners();\n };\n const open = (focus: \"first\" | \"last\" | false = \"first\") => {\n if (props.disabled || !menuRef || menuRef.matches(\":popover-open\")) return;\n triggerRing = ringOnReturn(triggerRef);\n menuRef.showPopover();\n // The toggle event arrives a task later; expose the open state before focus moves into the menu.\n setInternalOpen(true);\n attachViewportListeners();\n place();\n queueMicrotask(() => {\n if (focus) focusMenuItem(menuRef, focus === \"first\" ? 0 : -1);\n });\n };\n const requestOpen = (next: boolean, focus: \"first\" | \"last\" | false = \"first\") => {\n if (props.disabled && next) return;\n if (props.open !== undefined) {\n props.onOpenChange?.(next);\n return;\n }\n if (next && props.phone === \"sheet\" && prefersMenuSheet()) {\n if (sheet) return;\n const current = new AbortController();\n sheet = current;\n // The sheet is this menu's open state: the trigger reports it and the owner hears both ends.\n setInternalOpen(true);\n props.onOpenChange?.(true);\n void openMenuSheet({\n Items: DropdownItems,\n items: props.items,\n label: props.label ?? messages().dropdownMenu,\n locale: locale(),\n signal: current.signal,\n }).finally(() => {\n sheet = undefined;\n setInternalOpen(false);\n props.onOpenChange?.(false);\n props.onClose?.();\n });\n return;\n }\n if (next) open(focus);\n else close(false);\n };\n const handleMenuKeyDown = (event: KeyboardEvent) => {\n const items = actionableItems(menuRef);\n const current = items.indexOf(document.activeElement as HTMLElement);\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n focusMenuItem(menuRef, current + (event.key === \"ArrowDown\" ? 1 : -1));\n } else if (focusRowSegment(items, event.key)) {\n event.preventDefault();\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n focusMenuItem(menuRef, event.key === \"Home\" ? 0 : -1);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n returnFocus(triggerRef, triggerRing);\n requestOpen(false);\n } else if (event.key === \"Tab\") {\n requestOpen(false);\n }\n };\n\n const context: DropdownContextValue = {\n disabled: () => Boolean(props.disabled),\n menuId,\n open: isOpen,\n registerTrigger: (element) => {\n triggerRef = element;\n },\n toggle: () => requestOpen(!isOpen()),\n triggerKeyDown: (event) => {\n if (![\"Enter\", \" \", \"ArrowDown\", \"ArrowUp\"].includes(event.key)) return;\n event.preventDefault();\n event.stopPropagation();\n if (isOpen()) {\n focusMenuItem(menuRef, event.key === \"ArrowUp\" ? -1 : 0);\n return;\n }\n keyFocus = event.key === \"ArrowUp\" ? \"last\" : \"first\";\n requestOpen(true, keyFocus);\n keyFocus = false;\n },\n };\n\n createEffect(() => {\n const controlled = props.open;\n if (!mounted || controlled === undefined || !menuRef) return;\n if (controlled && !menuRef.matches(\":popover-open\")) open(keyFocus);\n if (!controlled && menuRef.matches(\":popover-open\")) close(false);\n });\n createEffect(() => {\n if (!props.disabled) return;\n sheet?.abort();\n if (mounted) close(false);\n });\n onMount(() => {\n mounted = true;\n if (props.open) open(false);\n onCleanup(detachViewportListeners);\n });\n onCleanup(() => sheet?.abort());\n\n return (\n <DropdownContext.Provider value={context}>\n <span class={`k2b-dropdown ${props.class ?? \"\"}`}>\n {props.children}\n <div\n ref={menuRef}\n id={menuId}\n popover=\"auto\"\n role=\"menu\"\n aria-label={props.label ?? messages().dropdownMenu}\n class={`k2b-dropdown__menu ${props.menuClass ?? \"\"}`}\n style={props.width ? { \"--k2b-dropdown-width\": props.width } : undefined}\n data-width={props.width ? \"fixed\" : undefined}\n data-variant={props.variant ?? \"default\"}\n data-position={position()}\n onKeyDown={handleMenuKeyDown}\n onToggle={(event) => {\n const nextOpen = (event as ToggleEvent).newState === \"open\";\n const wasOpen = (event as ToggleEvent).oldState === \"open\";\n setInternalOpen(nextOpen);\n if (nextOpen) attachViewportListeners();\n else detachViewportListeners();\n if (props.open === undefined || props.open !== nextOpen) props.onOpenChange?.(nextOpen);\n if (wasOpen && !nextOpen) props.onClose?.();\n if (!nextOpen && props.open === true) queueMicrotask(() => props.open === true && open(false));\n }}\n >\n <DropdownItems items={props.items} close={close} />\n </div>\n </span>\n </DropdownContext.Provider>\n );\n}\n\ntype DropdownComponent = ((props: DropdownProps) => JSX.Element) & {\n Root: (props: DropdownProps) => JSX.Element;\n Trigger: (props: DropdownTriggerProps) => JSX.Element;\n Item: (props: DropdownItemProps) => JSX.Element;\n};\n\nexport const Dropdown = DropdownRoot as DropdownComponent;\nDropdown.Root = DropdownRoot;\nDropdown.Trigger = DropdownTrigger;\nDropdown.Item = DropdownItem;\n\nexport default Dropdown;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SACE,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,GAAG,EAEH,SAAS,EACT,OAAO,EACP,IAAI,EACJ,UAAU,EACV,UAAU,QACL,UAAU;AACjB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,OAAO,EAAyB,eAAe,QAAQ,qBAAqB;AACrF,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AACpE,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,MAAM,EAAyD,SAAS,QAAQ,UAAU;AACnG,SAAS,eAAe,QAAQ,aAAa;AAC7C,SAAS,aAAa,EAAE,gBAAgB,QAAQ,cAAc;;AAE9D;AACA,MAAM,YAAY,GAAI,IAA6B,IAAK,IAAI,CAAC,MAAM;;AAmDnE;;AAk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C,SAAS,IAAI,EAAE,SAAE,aAC7C,KAAK,CAAC,KAAK,GAAG;QAAE,sBAAsB,EAAE,KAAK,CAAC;MAAM,CAAC,GAAG,SAAS,gCAC5D,KAAK,CAAC,KAAK,GAAG,OAAO,YAAG,SAAS,0DAC/B,KAAK,CAAC,OAAO,IAAI,SAAS,2DACzB,QAAQ,CAAC,CAAC,4CAaxB,aAAa;QAAA,IAAC,KAAK;UAAA,OAAE,KAAK,CAAC,KAAK;QAAA;QAAE,KAAK,EAAE;MAAK;IAAA;EAAA;AAKzD;AAQA,OAAO,MAAM,QAAQ,GAAG,YAAiC;AACzD,QAAQ,CAAC,IAAI,GAAG,YAAY;AAC5B,QAAQ,CAAC,OAAO,GAAG,eAAe;AAClC,QAAQ,CAAC,IAAI,GAAG,YAAY;AAE5B,eAAe,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["actions/Dropdown.tsx"],"sourcesContent":["import {\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n For,\n type JSX,\n onCleanup,\n onMount,\n Show,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Tooltip, type TooltipPlacement, useLabelTooltip } from \"../feedback/Tooltip\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { useLocale } from \"../intl/locale\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { Button, type ButtonProps, type ButtonSize, type ButtonVariant, iconTitle } from \"./Button\";\nimport { focusMenuRow, focusRowSegment } from \"./menu-rows\";\nimport { openMenuSheet, prefersMenuSheet } from \"./menu-sheet\";\n\n// Resolved outside JSX: a conditional attribute compiles to a lazy memo, which would be created inside the click handler.\nconst selectAction = (item: { action?: () => void }) => item.action;\n\nexport type DropdownPosition = \"bottom-right\" | \"bottom-left\" | \"top-right\" | \"top-left\" | \"right-start\";\n\nexport type DropdownActionBase = {\n class?: string;\n disabled?: boolean;\n icon?: string;\n image?: string;\n label: string;\n /**\n * Accessible name when it must say more than the visible label, such as the current value and what the next\n * activation does. It must contain the visible label.\n */\n ariaLabel?: string;\n description?: string;\n /** Quiet trailing information, such as a count. */\n trailing?: JSX.Element;\n variant?: \"danger\";\n};\n\nexport type DropdownAction =\n | (DropdownActionBase & {\n action: () => void;\n /**\n * Set `false` for an action that changes a value in place, such as cycling a setting: the menu stays open and\n * the focus stays on the row. Defaults to `true`.\n */\n closeOnSelect?: boolean;\n /**\n * In a phone sheet, run while the tap still counts as the person's gesture, before the sheet closes, as browsers\n * require for clipboard writes. Other actions run after the sheet has left the history. Such an action must\n * not navigate or open a dialog.\n */\n immediate?: boolean;\n href?: never;\n external?: never;\n })\n | (DropdownActionBase & {\n href: string;\n external?: boolean;\n /** Runs on a plain click instead of following the link; modified clicks, middle-click, and the link's menu keep it. */\n action?: () => void;\n })\n | (DropdownActionBase & {\n disabled: true;\n action?: never;\n href?: never;\n external?: never;\n });\n\n/** A second, smaller action at the end of a row, such as \"Only\" beside a checkbox; it keeps the menu open. */\nexport type DropdownSecondaryAction = {\n label: string;\n /** Accessible name when the visible label alone does not say what it acts on, such as \"Only Team Logistik\". */\n ariaLabel?: string;\n action: () => void;\n};\n\n/** Declarative radio or checkbox row for compact action menus. */\nexport type DropdownChoice = DropdownActionBase & {\n action: () => void;\n checked: boolean | (() => boolean);\n choice: \"checkbox\" | \"radio\";\n href?: string;\n closeOnSelect?: boolean;\n color?: string;\n /**\n * A second action at the end of the row. It shows while the row is hovered or focused, always on a touch screen,\n * and keeps its place when hidden, so the row never changes width. Right and Left move between the two.\n */\n secondary?: DropdownSecondaryAction;\n};\n\nexport type DropdownSection = {\n sectionLabel?: string;\n /**\n * `row` sets a few short radio choices, such as a sort direction, side by side as one segmented row. Give it a\n * `sectionLabel`: the label names the choice above the row and for screen readers.\n */\n layout?: \"row\";\n /** A quiet action at the end of the section label, such as \"All\"; it needs a `sectionLabel` and keeps the menu open. */\n labelAction?: DropdownSecondaryAction;\n items: readonly (DropdownAction | DropdownChoice)[];\n};\n\nexport type DropdownItem = DropdownAction | DropdownChoice | DropdownSection;\n\nexport type DropdownProps = {\n items: readonly DropdownItem[];\n children: JSX.Element;\n position?: DropdownPosition | (() => DropdownPosition);\n /** Larger menu rows and typography for touch. Defaults to `default`. */\n variant?: \"default\" | \"touch\";\n /**\n * Exact menu width as a CSS length. Without it the menu sizes to its longest\n * entry: at least `12rem` (`18rem` for touch), at most the viewport width\n * less `1rem` per side, where longer entries wrap.\n */\n width?: string;\n class?: string;\n menuClass?: string;\n onClose?: () => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n label?: string;\n align?: \"start\" | \"end\";\n /**\n * `sheet` opens the same items as a bottom sheet on phones (below 48rem) instead of a menu beside the trigger.\n * Defaults to `menu`. A controlled menu (`open`) always stays a menu.\n */\n phone?: \"menu\" | \"sheet\";\n};\n\nexport type DropdownTriggerProps = Omit<\n ButtonProps,\n \"aria-controls\" | \"aria-expanded\" | \"aria-haspopup\" | \"children\" | \"disabled\" | \"onClick\" | \"onKeyDown\"\n> & {\n children: JSX.Element;\n /** Use `plain` when a specialized component class owns the complete visual treatment. */\n appearance?: \"button\" | \"plain\";\n disabled?: boolean;\n iconOnly?: boolean;\n label?: string;\n size?: ButtonSize;\n tooltip?: JSX.Element | false;\n tooltipDelay?: number;\n tooltipPlacement?: TooltipPlacement;\n variant?: ButtonVariant;\n};\n\nexport type DropdownItemProps = {\n children: JSX.Element;\n closeOnSelect?: boolean;\n ariaLabel?: string;\n icon?: string;\n image?: string;\n description?: string;\n /** Quiet trailing information, such as a count. */\n trailing?: JSX.Element;\n disabled?: boolean;\n danger?: boolean;\n variant?: \"danger\";\n href?: string;\n external?: boolean;\n /** Runs when the item is chosen. With `href`, a plain click runs it instead of following the link. */\n onSelect?: () => void;\n class?: string;\n};\n\ntype MenuContextValue = {\n close: (restoreFocus?: boolean) => void;\n};\n\ntype DropdownContextValue = {\n disabled: () => boolean;\n menuId: string;\n open: () => boolean;\n registerTrigger: (element: HTMLButtonElement) => void;\n toggle: () => void;\n triggerKeyDown: JSX.EventHandlerUnion<HTMLButtonElement, KeyboardEvent>;\n};\n\nconst MenuContext = createContext<MenuContextValue>();\nconst DropdownContext = createContext<DropdownContextValue>();\n\nconst actionableItems = (menu: HTMLElement | undefined): HTMLElement[] =>\n menu\n ? Array.from(\n menu.querySelectorAll<HTMLElement>(\n [\n \"[role='menuitem']:not([aria-disabled='true'])\",\n \"[role='menuitemcheckbox']:not([aria-disabled='true'])\",\n \"[role='menuitemradio']:not([aria-disabled='true'])\",\n ].join(\", \"),\n ),\n )\n : [];\n\nconst focusMenuItem = (menu: HTMLElement | undefined, index: number): void => {\n const items = actionableItems(menu).filter((item) => !item.classList.contains(\"k2b-dropdown__secondary\"));\n if (items.length === 0) return;\n items[(index + items.length) % items.length]?.focus();\n};\n\nexport const dropdownPosition = (\n trigger: DOMRect,\n menu: Pick<DOMRect, \"width\" | \"height\">,\n position: DropdownPosition,\n viewport: { width: number; height: number },\n gap = 4,\n): { left: number; top: number } => {\n let left = trigger.left;\n let top = trigger.bottom + gap;\n\n if (position === \"bottom-left\" || position === \"top-left\") left = trigger.right - menu.width;\n if (position === \"top-right\" || position === \"top-left\") top = trigger.top - menu.height - gap;\n if (position === \"right-start\") {\n left = trigger.right + gap;\n top = trigger.top;\n }\n\n return {\n left: Math.max(8, Math.min(left, viewport.width - menu.width - 8)),\n top: Math.max(8, Math.min(top, viewport.height - menu.height - 8)),\n };\n};\n\nconst itemContent = (props: {\n description?: string;\n icon?: string;\n image?: string;\n trailing?: JSX.Element;\n children: JSX.Element;\n}): JSX.Element => (\n <>\n <Show when={props.image} fallback={<Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}>\n {(image) => <img class=\"k2b-dropdown__image\" src={image()} alt=\"\" />}\n </Show>\n <span class=\"k2b-dropdown__copy\">\n <span>{props.children}</span>\n <Show when={props.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n {props.trailing}\n </>\n);\n\nexport function DropdownItem(props: DropdownItemProps): JSX.Element {\n const menu = useContext(MenuContext);\n const danger = () => props.danger || props.variant === \"danger\";\n const content = itemContent(props);\n\n return (\n <Show\n when={!props.disabled ? props.href : undefined}\n fallback={\n <button\n type=\"button\"\n role=\"menuitem\"\n aria-label={props.ariaLabel}\n tabIndex={-1}\n class={`k2b-dropdown__item ${props.class ?? \"\"}`}\n data-danger={danger() ? \"true\" : undefined}\n disabled={props.disabled}\n aria-disabled={props.disabled ? \"true\" : undefined}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (props.closeOnSelect !== false) menu?.close();\n props.onSelect?.();\n }}\n >\n {content}\n </button>\n }\n >\n {(href) => (\n <a\n href={href()}\n target={props.external ? \"_blank\" : undefined}\n rel={props.external ? \"noopener noreferrer\" : undefined}\n role=\"menuitem\"\n aria-label={props.ariaLabel}\n tabIndex={-1}\n class={`k2b-dropdown__item ${props.class ?? \"\"}`}\n data-danger={danger() ? \"true\" : undefined}\n onClick={(event) => {\n // With `onSelect`, a plain click runs it in place of the link; a modified click keeps its browser meaning.\n if (props.onSelect && !(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {\n event.preventDefault();\n menu?.close();\n props.onSelect();\n return;\n }\n menu?.close(false);\n }}\n >\n {content}\n </a>\n )}\n </Show>\n );\n}\n\nfunction DropdownChoiceItem(props: DropdownChoice): JSX.Element {\n return (\n <Show when={props.secondary} fallback={<DropdownChoiceRow {...props} />}>\n {(secondary) => (\n <div class=\"k2b-dropdown__pair\">\n <DropdownChoiceRow {...props} />\n <DropdownSecondaryButton {...secondary()} class=\"k2b-dropdown__secondary\" />\n </div>\n )}\n </Show>\n );\n}\n\nfunction DropdownSecondaryButton(props: DropdownSecondaryAction & { class: string }): JSX.Element {\n return (\n <button\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n class={props.class}\n aria-label={props.ariaLabel}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n props.action();\n }}\n >\n {props.label}\n </button>\n );\n}\n\nfunction DropdownChoiceRow(props: DropdownChoice): JSX.Element {\n const menu = useContext(MenuContext);\n const checked = () => (typeof props.checked === \"function\" ? props.checked() : props.checked);\n let element: HTMLElement | undefined;\n return (\n <Dynamic\n ref={(node: HTMLAnchorElement | HTMLButtonElement) => {\n element = node;\n }}\n component={!props.disabled && props.href ? \"a\" : \"button\"}\n href={!props.disabled ? props.href : undefined}\n type={!props.disabled && props.href ? undefined : \"button\"}\n role={props.choice === \"checkbox\" ? \"menuitemcheckbox\" : \"menuitemradio\"}\n aria-label={props.ariaLabel}\n aria-checked={checked()}\n aria-disabled={props.disabled ? \"true\" : undefined}\n tabIndex={-1}\n class={`k2b-dropdown__item ${props.class ?? \"\"}`}\n data-selected={checked() ? \"true\" : undefined}\n disabled={props.disabled}\n onClick={(event: MouseEvent) => {\n if (props.href && (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {\n menu?.close(false);\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n if (props.closeOnSelect !== false) menu?.close();\n props.action();\n }}\n onKeyDown={(event: KeyboardEvent) => {\n // A link answers only Enter; as a menu choice it also answers Space, like the button form.\n if (event.key !== \" \" || props.disabled || !props.href) return;\n event.preventDefault();\n element?.click();\n }}\n >\n <Show when={props.choice === \"checkbox\"}>\n <span class=\"k2b-dropdown__checkbox\" aria-hidden=\"true\">\n <Show when={checked()}>\n <i class=\"ti ti-check\" />\n </Show>\n </span>\n </Show>\n <Show when={props.image} fallback={<Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}>\n {(image) => <img class=\"k2b-dropdown__image\" src={image()} alt=\"\" />}\n </Show>\n <Show when={props.color}>\n {(color) => <span class=\"k2b-dropdown__color\" style={{ \"--k2b-dropdown-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-dropdown__copy\">\n <span>{props.label}</span>\n <Show when={props.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n {props.trailing}\n {/* Always present for radios, so selecting the widest entry cannot widen a content-sized menu. */}\n <Show when={props.choice === \"radio\"}>\n <i class=\"ti ti-check k2b-dropdown__check\" data-hidden={checked() ? undefined : \"true\"} aria-hidden=\"true\" />\n </Show>\n </Dynamic>\n );\n}\n\nexport function DropdownItems(props: { items: readonly DropdownItem[]; close: (restoreFocus?: boolean) => void }): JSX.Element {\n const messages = useUiMessages();\n const renderItem = (item: DropdownAction | DropdownChoice): JSX.Element =>\n \"choice\" in item ? (\n <DropdownChoiceItem {...item} />\n ) : (\n <DropdownItem\n ariaLabel={item.ariaLabel}\n closeOnSelect={\"closeOnSelect\" in item ? item.closeOnSelect : undefined}\n icon={item.icon}\n image={item.image}\n description={item.description}\n trailing={item.trailing}\n variant={item.variant}\n disabled={item.disabled}\n class={item.class}\n href={\"href\" in item ? item.href : undefined}\n external={\"external\" in item ? item.external : undefined}\n onSelect={selectAction(item)}\n >\n {item.label}\n </DropdownItem>\n );\n\n return (\n <MenuContext.Provider value={{ close: props.close }}>\n <For each={props.items}>\n {(item, index) => (\n <Show when={\"items\" in item} fallback={renderItem(item as DropdownAction | DropdownChoice)}>\n <div\n class=\"k2b-dropdown__section\"\n data-divided={index() > 0 ? \"true\" : undefined}\n role=\"group\"\n // A row of choices is no set of actions: without a label it stays unnamed rather than misnamed.\n aria-label={\n (item as DropdownSection).sectionLabel ?? ((item as DropdownSection).layout === \"row\" ? undefined : messages().actions)\n }\n >\n <Show when={(item as DropdownSection).sectionLabel}>\n {(label) => (\n <Show when={(item as DropdownSection).labelAction} fallback={<div class=\"k2b-dropdown__label\">{label()}</div>}>\n {(action) => (\n <div class=\"k2b-dropdown__label k2b-dropdown__label--action\">\n <span>{label()}</span>\n <DropdownSecondaryButton {...action()} class=\"k2b-dropdown__label-action\" />\n </div>\n )}\n </Show>\n )}\n </Show>\n <Show\n when={(item as DropdownSection).layout === \"row\"}\n fallback={<For each={(item as DropdownSection).items}>{renderItem}</For>}\n >\n <div class=\"k2b-dropdown__row\">\n <For each={(item as DropdownSection).items}>{renderItem}</For>\n </div>\n </Show>\n </div>\n </Show>\n )}\n </For>\n </MenuContext.Provider>\n );\n}\n\nfunction DropdownTrigger(props: DropdownTriggerProps): JSX.Element {\n const context = useContext(DropdownContext);\n if (!context) throw new Error(\"Dropdown.Trigger must be used inside Dropdown.Root\");\n const [local, rest] = splitProps(props, [\n \"appearance\",\n \"children\",\n \"class\",\n \"disabled\",\n \"iconOnly\",\n \"label\",\n \"ref\",\n \"size\",\n \"tabIndex\",\n \"title\",\n \"tooltip\",\n \"tooltipDelay\",\n \"tooltipPlacement\",\n \"type\",\n \"variant\",\n ]);\n let target: HTMLButtonElement | undefined;\n const disabled = () => Boolean(context.disabled() || local.disabled);\n // An icon-only trigger shows its label as a hint, like IconButton.\n const tooltip = useLabelTooltip(\n () => local.tooltip,\n () => (local.iconOnly ? (local.title ?? local.label) : undefined),\n );\n const register = (element: HTMLButtonElement) => {\n target = element;\n context.registerTrigger(element);\n if (typeof local.ref === \"function\") local.ref(element);\n };\n const click: JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent> = (event) => {\n event.stopPropagation();\n context.toggle();\n };\n\n if (local.appearance !== \"plain\") {\n return (\n <Button\n {...rest}\n ref={register}\n aria-controls={context.menuId}\n aria-expanded={context.open()}\n aria-haspopup=\"menu\"\n aria-label={local.label}\n disabled={disabled()}\n tabIndex={disabled() ? -1 : local.tabIndex}\n onClick={click}\n onKeyDown={context.triggerKeyDown}\n type={local.type ?? \"button\"}\n class={`${local.iconOnly ? \"k2b-icon-button\" : \"\"} k2b-dropdown__trigger ${local.class ?? \"\"}`}\n size={local.size}\n variant={local.variant ?? (local.iconOnly ? \"ghost\" : undefined)}\n title={iconTitle(local.title, tooltip())}\n tooltip={tooltip()}\n tooltipDelay={local.tooltipDelay}\n tooltipPlacement={local.tooltipPlacement}\n >\n {local.children}\n </Button>\n );\n }\n\n return (\n <>\n <button\n {...rest}\n ref={register}\n aria-controls={context.menuId}\n aria-expanded={context.open()}\n aria-haspopup=\"menu\"\n aria-label={local.label}\n disabled={disabled()}\n tabIndex={disabled() ? -1 : local.tabIndex}\n onClick={click}\n onKeyDown={context.triggerKeyDown}\n type={local.type ?? \"button\"}\n class={`k2b-dropdown__trigger ${local.class ?? \"\"}`}\n title={iconTitle(local.title, tooltip())}\n >\n {local.children}\n </button>\n <Show when={tooltip() !== false && tooltip() !== undefined}>\n <Tooltip\n content={tooltip() as JSX.Element}\n target={() => target}\n delay={local.tooltipDelay}\n disabled={disabled()}\n placement={local.tooltipPlacement}\n />\n </Show>\n </>\n );\n}\n\n/** Accessible top-layer menu with explicit trigger ownership. */\nfunction DropdownRoot(props: DropdownProps): JSX.Element {\n const messages = useUiMessages();\n const locale = useLocale();\n /** The open phone sheet's cancel switch: it closes when the menu goes or is disabled, as the popover does. */\n let sheet: AbortController | undefined;\n const id = createUniqueId().replace(/[^a-zA-Z0-9_-]/g, \"-\");\n const menuId = `k2b-dropdown-${id}`;\n const [internalOpen, setInternalOpen] = createSignal(false);\n let triggerRef: HTMLButtonElement | undefined;\n let menuRef: HTMLDivElement | undefined;\n let triggerRing = true;\n let mounted = false;\n /** Where a key on the trigger asked the focus to go; a controlled menu opens later, in its owner's update. */\n let keyFocus: \"first\" | \"last\" | false = false;\n let viewportListenersAttached = false;\n let resizeObserver: ResizeObserver | undefined;\n\n const isOpen = () => props.open ?? internalOpen();\n const position = (): DropdownPosition =>\n typeof props.position === \"function\" ? props.position() : (props.position ?? (props.align === \"end\" ? \"bottom-left\" : \"bottom-right\"));\n\n const place = () => {\n if (!triggerRef || !menuRef) return;\n const rect = dropdownPosition(triggerRef.getBoundingClientRect(), menuRef.getBoundingClientRect(), position(), {\n width: window.innerWidth,\n height: window.innerHeight,\n });\n menuRef.style.left = `${rect.left}px`;\n menuRef.style.top = `${rect.top}px`;\n };\n const reposition = () => {\n if (isOpen()) place();\n };\n const attachViewportListeners = () => {\n if (viewportListenersAttached) return;\n viewportListenersAttached = true;\n window.addEventListener(\"resize\", reposition);\n window.addEventListener(\"scroll\", reposition, true);\n // A content-sized menu changes size when its items change while it is open.\n if (menuRef && typeof ResizeObserver !== \"undefined\") {\n resizeObserver ??= new ResizeObserver(reposition);\n resizeObserver.observe(menuRef);\n }\n };\n const detachViewportListeners = () => {\n if (!viewportListenersAttached) return;\n viewportListenersAttached = false;\n window.removeEventListener(\"resize\", reposition);\n window.removeEventListener(\"scroll\", reposition, true);\n resizeObserver?.disconnect();\n };\n const close = (restoreFocus = true) => {\n // Before hiding, so the popover does not return focus on its own.\n if (restoreFocus) returnFocus(triggerRef, triggerRing);\n if (menuRef?.matches(\":popover-open\")) menuRef.hidePopover();\n // Like `open`, expose the closed state now: the toggle event can arrive after the next key press, and a trigger\n // that still reads as open would ignore Enter (Escape, then Enter at once, must reopen).\n setInternalOpen(false);\n detachViewportListeners();\n };\n const open = (focus: \"first\" | \"last\" | false = \"first\") => {\n if (props.disabled || !menuRef || menuRef.matches(\":popover-open\")) return;\n triggerRing = ringOnReturn(triggerRef);\n menuRef.showPopover();\n // The toggle event arrives a task later; expose the open state before focus moves into the menu.\n setInternalOpen(true);\n attachViewportListeners();\n place();\n queueMicrotask(() => {\n if (focus) focusMenuItem(menuRef, focus === \"first\" ? 0 : -1);\n });\n };\n const requestOpen = (next: boolean, focus: \"first\" | \"last\" | false = \"first\") => {\n if (props.disabled && next) return;\n if (props.open !== undefined) {\n props.onOpenChange?.(next);\n return;\n }\n if (next && props.phone === \"sheet\" && prefersMenuSheet()) {\n if (sheet) return;\n const current = new AbortController();\n sheet = current;\n // The sheet is this menu's open state: the trigger reports it and the owner hears both ends.\n setInternalOpen(true);\n props.onOpenChange?.(true);\n void openMenuSheet({\n Items: DropdownItems,\n items: props.items,\n label: props.label ?? messages().dropdownMenu,\n locale: locale(),\n signal: current.signal,\n }).finally(() => {\n sheet = undefined;\n setInternalOpen(false);\n props.onOpenChange?.(false);\n props.onClose?.();\n });\n return;\n }\n if (next) open(focus);\n else close(false);\n };\n const handleMenuKeyDown = (event: KeyboardEvent) => {\n const items = actionableItems(menuRef);\n if (focusMenuRow(items, event.key) || focusRowSegment(items, event.key)) {\n event.preventDefault();\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n returnFocus(triggerRef, triggerRing);\n requestOpen(false);\n } else if (event.key === \"Tab\") {\n requestOpen(false);\n }\n };\n\n const context: DropdownContextValue = {\n disabled: () => Boolean(props.disabled),\n menuId,\n open: isOpen,\n registerTrigger: (element) => {\n triggerRef = element;\n },\n toggle: () => requestOpen(!isOpen()),\n triggerKeyDown: (event) => {\n if (![\"Enter\", \" \", \"ArrowDown\", \"ArrowUp\"].includes(event.key)) return;\n event.preventDefault();\n event.stopPropagation();\n if (isOpen()) {\n focusMenuItem(menuRef, event.key === \"ArrowUp\" ? -1 : 0);\n return;\n }\n keyFocus = event.key === \"ArrowUp\" ? \"last\" : \"first\";\n requestOpen(true, keyFocus);\n keyFocus = false;\n },\n };\n\n createEffect(() => {\n const controlled = props.open;\n if (!mounted || controlled === undefined || !menuRef) return;\n if (controlled && !menuRef.matches(\":popover-open\")) open(keyFocus);\n if (!controlled && menuRef.matches(\":popover-open\")) close(false);\n });\n createEffect(() => {\n if (!props.disabled) return;\n sheet?.abort();\n if (mounted) close(false);\n });\n onMount(() => {\n mounted = true;\n if (props.open) open(false);\n onCleanup(detachViewportListeners);\n });\n onCleanup(() => sheet?.abort());\n\n return (\n <DropdownContext.Provider value={context}>\n <span class={`k2b-dropdown ${props.class ?? \"\"}`}>\n {props.children}\n <div\n ref={menuRef}\n id={menuId}\n popover=\"auto\"\n role=\"menu\"\n aria-label={props.label ?? messages().dropdownMenu}\n class={`k2b-dropdown__menu ${props.menuClass ?? \"\"}`}\n style={props.width ? { \"--k2b-dropdown-width\": props.width } : undefined}\n data-width={props.width ? \"fixed\" : undefined}\n data-variant={props.variant ?? \"default\"}\n data-position={position()}\n onKeyDown={handleMenuKeyDown}\n onToggle={(event) => {\n const nextOpen = (event as ToggleEvent).newState === \"open\";\n const wasOpen = (event as ToggleEvent).oldState === \"open\";\n setInternalOpen(nextOpen);\n if (nextOpen) attachViewportListeners();\n else detachViewportListeners();\n if (props.open === undefined || props.open !== nextOpen) props.onOpenChange?.(nextOpen);\n if (wasOpen && !nextOpen) props.onClose?.();\n if (!nextOpen && props.open === true) queueMicrotask(() => props.open === true && open(false));\n }}\n >\n <DropdownItems items={props.items} close={close} />\n </div>\n </span>\n </DropdownContext.Provider>\n );\n}\n\ntype DropdownComponent = ((props: DropdownProps) => JSX.Element) & {\n Root: (props: DropdownProps) => JSX.Element;\n Trigger: (props: DropdownTriggerProps) => JSX.Element;\n Item: (props: DropdownItemProps) => JSX.Element;\n};\n\nexport const Dropdown = DropdownRoot as DropdownComponent;\nDropdown.Root = DropdownRoot;\nDropdown.Trigger = DropdownTrigger;\nDropdown.Item = DropdownItem;\n\nexport default Dropdown;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SACE,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,GAAG,EAEH,SAAS,EACT,OAAO,EACP,IAAI,EACJ,UAAU,EACV,UAAU,QACL,UAAU;AACjB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,OAAO,EAAyB,eAAe,QAAQ,qBAAqB;AACrF,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AACpE,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,MAAM,EAAyD,SAAS,QAAQ,UAAU;AACnG,SAAS,YAAY,EAAE,eAAe,QAAQ,aAAa;AAC3D,SAAS,aAAa,EAAE,gBAAgB,QAAQ,cAAc;;AAE9D;AACA,MAAM,YAAY,GAAI,IAA6B,IAAK,IAAI,CAAC,MAAM;;AAmDnE;;AAQA;;AAyGA,MAAM,WAAW,GAAG,aAAa,CAAmB,CAAC;AACrD,MAAM,eAAe,GAAG,aAAa,CAAuB,CAAC;AAE7D,MAAM,eAAe,GAAI,IAA6B,IACpD,IAAI,GACA,K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