@allxsmith/bestax-bulma 5.28.0 → 5.30.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 (94) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/ContextMenu.js +244 -0
  4. package/dist/esm/components/ContextMenu.js.map +1 -0
  5. package/dist/esm/components/Dialog.js +8 -4
  6. package/dist/esm/components/Dialog.js.map +1 -1
  7. package/dist/esm/components/HoverCard.js +3 -10
  8. package/dist/esm/components/HoverCard.js.map +1 -1
  9. package/dist/esm/components/Modal.js +19 -11
  10. package/dist/esm/components/Modal.js.map +1 -1
  11. package/dist/esm/components/Popover.js.map +1 -1
  12. package/dist/esm/components/Sidebar.js +12 -3
  13. package/dist/esm/components/Sidebar.js.map +1 -1
  14. package/dist/esm/components/Toast.js +5 -3
  15. package/dist/esm/components/Toast.js.map +1 -1
  16. package/dist/esm/components/Tooltip.js +36 -61
  17. package/dist/esm/components/Tooltip.js.map +1 -1
  18. package/dist/esm/elements/Button.js.map +1 -1
  19. package/dist/esm/elements/Notification.js +3 -1
  20. package/dist/esm/elements/Notification.js.map +1 -1
  21. package/dist/esm/elements/ToggleButton.js +60 -0
  22. package/dist/esm/elements/ToggleButton.js.map +1 -0
  23. package/dist/esm/form/DateInputBase.js.map +1 -1
  24. package/dist/esm/form/DateRangeInputBase.js.map +1 -1
  25. package/dist/esm/form/DateTimeInputBase.js.map +1 -1
  26. package/dist/esm/form/TimeInputBase.js.map +1 -1
  27. package/dist/esm/form/_pickerInternals/PickerPopover.js +3 -1
  28. package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
  29. package/dist/esm/form/_pickerInternals/pickerTypes.js +14 -6
  30. package/dist/esm/form/_pickerInternals/pickerTypes.js.map +1 -1
  31. package/dist/esm/helpers/Config.js +5 -2
  32. package/dist/esm/helpers/Config.js.map +1 -1
  33. package/dist/esm/helpers/portal.js +30 -5
  34. package/dist/esm/helpers/portal.js.map +1 -1
  35. package/dist/esm/helpers/useContextMenuTrigger.js +166 -0
  36. package/dist/esm/helpers/useContextMenuTrigger.js.map +1 -0
  37. package/dist/esm/helpers/useHoverOpen.js +40 -6
  38. package/dist/esm/helpers/useHoverOpen.js.map +1 -1
  39. package/dist/esm/helpers/useMenuKeys.js +182 -0
  40. package/dist/esm/helpers/useMenuKeys.js.map +1 -0
  41. package/dist/extras.css +1 -1
  42. package/dist/extras.css.map +1 -1
  43. package/dist/index.cjs +2150 -1474
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.esm.js +2 -0
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/types/components/ContextMenu.d.ts +66 -0
  48. package/dist/types/components/HoverCard.d.ts +14 -12
  49. package/dist/types/components/Modal.d.ts +2 -1
  50. package/dist/types/components/Popover.d.ts +8 -7
  51. package/dist/types/components/Tooltip.d.ts +45 -4
  52. package/dist/types/elements/Button.d.ts +1 -1
  53. package/dist/types/elements/ToggleButton.d.ts +90 -0
  54. package/dist/types/form/DateInputBase.d.ts +4 -1
  55. package/dist/types/form/DateRangeInputBase.d.ts +4 -1
  56. package/dist/types/form/DateTimeInputBase.d.ts +8 -2
  57. package/dist/types/form/TimeInputBase.d.ts +7 -3
  58. package/dist/types/form/_pickerInternals/pickerTypes.d.ts +16 -1
  59. package/dist/types/helpers/Config.d.ts +34 -3
  60. package/dist/types/helpers/portal.d.ts +27 -5
  61. package/dist/types/helpers/useContextMenuTrigger.d.ts +67 -0
  62. package/dist/types/helpers/useHoverOpen.d.ts +19 -3
  63. package/dist/types/helpers/useMenuKeys.d.ts +57 -0
  64. package/dist/types/index.d.ts +2 -0
  65. package/dist/types-cjs/components/ContextMenu.d.ts +66 -0
  66. package/dist/types-cjs/components/HoverCard.d.ts +14 -12
  67. package/dist/types-cjs/components/Modal.d.ts +2 -1
  68. package/dist/types-cjs/components/Popover.d.ts +8 -7
  69. package/dist/types-cjs/components/Tooltip.d.ts +45 -4
  70. package/dist/types-cjs/elements/Button.d.ts +1 -1
  71. package/dist/types-cjs/elements/ToggleButton.d.ts +90 -0
  72. package/dist/types-cjs/form/DateInputBase.d.ts +4 -1
  73. package/dist/types-cjs/form/DateRangeInputBase.d.ts +4 -1
  74. package/dist/types-cjs/form/DateTimeInputBase.d.ts +8 -2
  75. package/dist/types-cjs/form/TimeInputBase.d.ts +7 -3
  76. package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +16 -1
  77. package/dist/types-cjs/helpers/Config.d.ts +34 -3
  78. package/dist/types-cjs/helpers/portal.d.ts +27 -5
  79. package/dist/types-cjs/helpers/useContextMenuTrigger.d.ts +67 -0
  80. package/dist/types-cjs/helpers/useHoverOpen.d.ts +19 -3
  81. package/dist/types-cjs/helpers/useMenuKeys.d.ts +57 -0
  82. package/dist/types-cjs/index.d.ts +2 -0
  83. package/dist/versions/bestax-no-dark-mode.css +1 -1
  84. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  85. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  86. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  87. package/dist/versions/bestax-no-helpers.css +1 -1
  88. package/dist/versions/bestax-no-helpers.css.map +1 -1
  89. package/dist/versions/bestax-prefixed.css +1 -1
  90. package/dist/versions/bestax-prefixed.css.map +1 -1
  91. package/package.json +1 -1
  92. package/src/scss/components/_contextmenu.scss +50 -0
  93. package/src/scss/components/_index.scss +1 -0
  94. package/src/scss/components/_tooltip.scss +76 -1
@@ -0,0 +1,182 @@
1
+ /* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
2
+ import { useRef, useEffect, useMemo } from 'react';
3
+ import { getActiveElementInTree } from './shadowDom.js';
4
+
5
+ // INTERNAL: deliberately not exported from src/index.ts.
6
+ /**
7
+ * Every menu-item role, so an item a caller gives `menuitemcheckbox` or
8
+ * `menuitemradio` (a filter or sort menu) stays reachable.
9
+ */
10
+ const MENU_ITEM_SELECTOR = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]';
11
+ /**
12
+ * Whether a menu item can be reached and activated: it isn't disabled, as a
13
+ * native control or through `aria-disabled="true"`.
14
+ */
15
+ function isEnabledMenuItem(item) {
16
+ return (!item.hasAttribute('disabled') &&
17
+ item.getAttribute('aria-disabled') !== 'true');
18
+ }
19
+ /** Whether `node` is one of `menu`'s items, enabled or not. */
20
+ const isItemOf = (menu, node) => Boolean(node && menu.contains(node) && node.matches(MENU_ITEM_SELECTOR));
21
+ /** The items in `menu` the keys reach, in document order. */
22
+ function enabledMenuItems(menu) {
23
+ return Array.from(menu.querySelectorAll(MENU_ITEM_SELECTOR)).filter(isEnabledMenuItem);
24
+ }
25
+ /** How long typed characters keep adding up to one search, in milliseconds. */
26
+ const TYPEAHEAD_TIMEOUT = 500;
27
+ /**
28
+ * Whether the browser activates `item` on this key by itself: a `<button>`
29
+ * answers Enter and Space, and a link with an `href` answers Enter.
30
+ */
31
+ function activatesItself(item, key) {
32
+ if (item.tagName === 'BUTTON')
33
+ return true;
34
+ return key === 'Enter' && item.tagName === 'A' && item.hasAttribute('href');
35
+ }
36
+ /**
37
+ * The text typing finds an item by: what it says, without what's hidden from
38
+ * assistive technology, such as an icon whose glyph is a ligature's name.
39
+ */
40
+ function label(item) {
41
+ let text = '';
42
+ const read = (node) => {
43
+ node.childNodes.forEach(child => {
44
+ if (child.nodeType === 3)
45
+ text += child.textContent;
46
+ else if (child.nodeType === 1 &&
47
+ child.getAttribute('aria-hidden') !== 'true') {
48
+ read(child);
49
+ }
50
+ });
51
+ };
52
+ read(item);
53
+ return text.trim().toLowerCase();
54
+ }
55
+ /**
56
+ * The item typing `search` moves to, or none. A single character looks from
57
+ * the item after the focused one, so typing the same letter again cycles
58
+ * through the items that start with it, and so does a run of one letter
59
+ * ("dd"). A longer search looks from the focused item, so typing more of
60
+ * its own text keeps it.
61
+ */
62
+ function typeaheadMatch(items, search, current) {
63
+ const repeated = Array.from(search).every(char => char === search[0]);
64
+ const wanted = repeated ? search[0] : search;
65
+ const start = current < 0 ? 0 : current + (wanted.length === 1 ? 1 : 0);
66
+ for (let i = 0; i < items.length; i += 1) {
67
+ const item = items[(start + i) % items.length];
68
+ if (label(item).startsWith(wanted))
69
+ return item;
70
+ }
71
+ return undefined;
72
+ }
73
+ /**
74
+ * Moves through and activates the items of a `role="menu"` element from the
75
+ * keyboard. Put the `onKeyDown` it returns on that element. It reads the
76
+ * items from the element each time, so items that come and go are found,
77
+ * and it renders nothing.
78
+ *
79
+ * It acts only while focus is on the menu element itself or on one of its
80
+ * items, so anything else focusable inside the menu, such as a filter
81
+ * field, keeps its own keys.
82
+ *
83
+ * - Down and Up move to the next and previous enabled item, wrapping, and
84
+ * Home and End go to the first and last. From no item, Down goes to the
85
+ * first and Up to the last.
86
+ * - Enter and Space activate the focused item. A `<button>`, and a link with
87
+ * an `href` for Enter, get the browser's own click, and anything else gets
88
+ * one from here, so its `onClick` runs either way. A key held down
89
+ * activates it once. A key handler on the item that called
90
+ * `preventDefault()` has claimed the key, and nothing else runs it.
91
+ * - A printable character moves to the next enabled item whose text starts
92
+ * with what has been typed. Characters typed within `TYPEAHEAD_TIMEOUT` of
93
+ * each other add up to one search, until `reset` starts a new one.
94
+ *
95
+ * Items are `MENU_ITEM_SELECTOR` matches, and disabled ones are skipped by
96
+ * all of the above. Escape and Tab are left to the menu's owner, since what
97
+ * closing means is up to it, and so is any other key.
98
+ *
99
+ * @function useMenuKeys
100
+ * @returns The `keydown` handler for the menu element, and a way to forget
101
+ * what has been typed.
102
+ */
103
+ function useMenuKeys() {
104
+ const typedRef = useRef({ text: '' });
105
+ useEffect(() => {
106
+ const typed = typedRef.current;
107
+ return () => clearTimeout(typed.timer);
108
+ }, []);
109
+ return useMemo(() => {
110
+ const reset = () => {
111
+ const typed = typedRef.current;
112
+ clearTimeout(typed.timer);
113
+ typed.text = '';
114
+ };
115
+ const onKeyDown = (event) => {
116
+ const menu = event.currentTarget;
117
+ const focused = getActiveElementInTree(menu);
118
+ if (focused !== menu && !isItemOf(menu, focused))
119
+ return;
120
+ const items = enabledMenuItems(menu);
121
+ if (!items.length)
122
+ return;
123
+ const current = items.indexOf(focused);
124
+ switch (event.key) {
125
+ case 'ArrowDown':
126
+ event.preventDefault();
127
+ items[current >= 0 ? (current + 1) % items.length : 0].focus();
128
+ return;
129
+ case 'ArrowUp':
130
+ event.preventDefault();
131
+ items[current >= 0
132
+ ? (current - 1 + items.length) % items.length
133
+ : items.length - 1].focus();
134
+ return;
135
+ case 'Home':
136
+ event.preventDefault();
137
+ items[0].focus();
138
+ return;
139
+ case 'End':
140
+ event.preventDefault();
141
+ items[items.length - 1].focus();
142
+ return;
143
+ case 'Enter':
144
+ case ' ': {
145
+ if (current < 0 || event.defaultPrevented)
146
+ return;
147
+ const item = items[current];
148
+ if (activatesItself(item, event.key)) {
149
+ // The browser clicks on Enter's keydown, and a held key sends one
150
+ // per auto-repeat. Space clicks on keyup, once however long it's
151
+ // held.
152
+ if (event.repeat && event.key === 'Enter')
153
+ event.preventDefault();
154
+ return;
155
+ }
156
+ // Space would scroll the page, and a held key repeats.
157
+ event.preventDefault();
158
+ if (!event.repeat)
159
+ item.click();
160
+ return;
161
+ }
162
+ }
163
+ if (event.key.length !== 1 ||
164
+ event.ctrlKey ||
165
+ event.metaKey ||
166
+ event.altKey ||
167
+ event.defaultPrevented) {
168
+ return;
169
+ }
170
+ event.preventDefault();
171
+ const typed = typedRef.current;
172
+ typed.text += event.key.toLowerCase();
173
+ clearTimeout(typed.timer);
174
+ typed.timer = setTimeout(reset, TYPEAHEAD_TIMEOUT);
175
+ typeaheadMatch(items, typed.text, current)?.focus();
176
+ };
177
+ return { onKeyDown, reset };
178
+ }, []);
179
+ }
180
+
181
+ export { MENU_ITEM_SELECTOR, TYPEAHEAD_TIMEOUT, enabledMenuItems, isEnabledMenuItem, useMenuKeys };
182
+ //# sourceMappingURL=useMenuKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMenuKeys.js","sources":["../../../src/helpers/useMenuKeys.ts"],"sourcesContent":["// INTERNAL: deliberately not exported from src/index.ts.\nimport { useEffect, useMemo, useRef } from 'react';\nimport type { KeyboardEvent } from 'react';\nimport { getActiveElementInTree } from './shadowDom';\n\n/**\n * Every menu-item role, so an item a caller gives `menuitemcheckbox` or\n * `menuitemradio` (a filter or sort menu) stays reachable.\n */\nexport const MENU_ITEM_SELECTOR =\n '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]';\n\n/**\n * Whether a menu item can be reached and activated: it isn't disabled, as a\n * native control or through `aria-disabled=\"true\"`.\n */\nexport function isEnabledMenuItem(item: Element): boolean {\n return (\n !item.hasAttribute('disabled') &&\n item.getAttribute('aria-disabled') !== 'true'\n );\n}\n\n/** Whether `node` is one of `menu`'s items, enabled or not. */\nconst isItemOf = (menu: Element, node: Element | null): boolean =>\n Boolean(node && menu.contains(node) && node.matches(MENU_ITEM_SELECTOR));\n\n/** The items in `menu` the keys reach, in document order. */\nexport function enabledMenuItems(menu: Element): HTMLElement[] {\n return Array.from(\n menu.querySelectorAll<HTMLElement>(MENU_ITEM_SELECTOR)\n ).filter(isEnabledMenuItem);\n}\n\n/** How long typed characters keep adding up to one search, in milliseconds. */\nexport const TYPEAHEAD_TIMEOUT = 500;\n\n/**\n * Whether the browser activates `item` on this key by itself: a `<button>`\n * answers Enter and Space, and a link with an `href` answers Enter.\n */\nfunction activatesItself(item: HTMLElement, key: string): boolean {\n if (item.tagName === 'BUTTON') return true;\n return key === 'Enter' && item.tagName === 'A' && item.hasAttribute('href');\n}\n\n/**\n * The text typing finds an item by: what it says, without what's hidden from\n * assistive technology, such as an icon whose glyph is a ligature's name.\n */\nfunction label(item: Element): string {\n let text = '';\n const read = (node: Node) => {\n node.childNodes.forEach(child => {\n if (child.nodeType === 3) text += child.textContent;\n else if (\n child.nodeType === 1 &&\n (child as Element).getAttribute('aria-hidden') !== 'true'\n ) {\n read(child);\n }\n });\n };\n read(item);\n return text.trim().toLowerCase();\n}\n\n/**\n * The item typing `search` moves to, or none. A single character looks from\n * the item after the focused one, so typing the same letter again cycles\n * through the items that start with it, and so does a run of one letter\n * (\"dd\"). A longer search looks from the focused item, so typing more of\n * its own text keeps it.\n */\nfunction typeaheadMatch(\n items: HTMLElement[],\n search: string,\n current: number\n): HTMLElement | undefined {\n const repeated = Array.from(search).every(char => char === search[0]);\n const wanted = repeated ? search[0] : search;\n const start = current < 0 ? 0 : current + (wanted.length === 1 ? 1 : 0);\n for (let i = 0; i < items.length; i += 1) {\n const item = items[(start + i) % items.length];\n if (label(item).startsWith(wanted)) return item;\n }\n return undefined;\n}\n\n/** What `useMenuKeys` returns. */\nexport interface MenuKeys {\n /** The `keydown` handler for the `role=\"menu\"` element. */\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n /**\n * Forgets what has been typed, so the next character starts a new search.\n * Call it when the menu opens, so a search typed just before it last\n * closed doesn't carry over.\n */\n reset: () => void;\n}\n\n/**\n * Moves through and activates the items of a `role=\"menu\"` element from the\n * keyboard. Put the `onKeyDown` it returns on that element. It reads the\n * items from the element each time, so items that come and go are found,\n * and it renders nothing.\n *\n * It acts only while focus is on the menu element itself or on one of its\n * items, so anything else focusable inside the menu, such as a filter\n * field, keeps its own keys.\n *\n * - Down and Up move to the next and previous enabled item, wrapping, and\n * Home and End go to the first and last. From no item, Down goes to the\n * first and Up to the last.\n * - Enter and Space activate the focused item. A `<button>`, and a link with\n * an `href` for Enter, get the browser's own click, and anything else gets\n * one from here, so its `onClick` runs either way. A key held down\n * activates it once. A key handler on the item that called\n * `preventDefault()` has claimed the key, and nothing else runs it.\n * - A printable character moves to the next enabled item whose text starts\n * with what has been typed. Characters typed within `TYPEAHEAD_TIMEOUT` of\n * each other add up to one search, until `reset` starts a new one.\n *\n * Items are `MENU_ITEM_SELECTOR` matches, and disabled ones are skipped by\n * all of the above. Escape and Tab are left to the menu's owner, since what\n * closing means is up to it, and so is any other key.\n *\n * @function useMenuKeys\n * @returns The `keydown` handler for the menu element, and a way to forget\n * what has been typed.\n */\nexport function useMenuKeys(): MenuKeys {\n const typedRef = useRef<{\n text: string;\n timer?: ReturnType<typeof setTimeout>;\n }>({ text: '' });\n\n useEffect(() => {\n const typed = typedRef.current;\n return () => clearTimeout(typed.timer);\n }, []);\n\n return useMemo<MenuKeys>(() => {\n const reset = () => {\n const typed = typedRef.current;\n clearTimeout(typed.timer);\n typed.text = '';\n };\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const menu = event.currentTarget;\n const focused = getActiveElementInTree(menu);\n if (focused !== menu && !isItemOf(menu, focused)) return;\n const items = enabledMenuItems(menu);\n if (!items.length) return;\n const current = items.indexOf(focused as HTMLElement);\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n items[current >= 0 ? (current + 1) % items.length : 0].focus();\n return;\n case 'ArrowUp':\n event.preventDefault();\n items[\n current >= 0\n ? (current - 1 + items.length) % items.length\n : items.length - 1\n ].focus();\n return;\n case 'Home':\n event.preventDefault();\n items[0].focus();\n return;\n case 'End':\n event.preventDefault();\n items[items.length - 1].focus();\n return;\n case 'Enter':\n case ' ': {\n if (current < 0 || event.defaultPrevented) return;\n const item = items[current];\n if (activatesItself(item, event.key)) {\n // The browser clicks on Enter's keydown, and a held key sends one\n // per auto-repeat. Space clicks on keyup, once however long it's\n // held.\n if (event.repeat && event.key === 'Enter') event.preventDefault();\n return;\n }\n // Space would scroll the page, and a held key repeats.\n event.preventDefault();\n if (!event.repeat) item.click();\n return;\n }\n default:\n break;\n }\n\n if (\n event.key.length !== 1 ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.defaultPrevented\n ) {\n return;\n }\n event.preventDefault();\n const typed = typedRef.current;\n typed.text += event.key.toLowerCase();\n clearTimeout(typed.timer);\n typed.timer = setTimeout(reset, TYPEAHEAD_TIMEOUT);\n typeaheadMatch(items, typed.text, current)?.focus();\n };\n return { onKeyDown, reset };\n }, []);\n}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