@proyecto-viviana/solidaria 0.4.2 → 0.4.3

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 (54) hide show
  1. package/dist/_chunk/DragManager.js.map +1 -1
  2. package/dist/_chunk/DragManager.jsx.map +1 -1
  3. package/dist/_chunk/actiongroup.js.map +1 -1
  4. package/dist/_chunk/actiongroup.jsx.map +1 -1
  5. package/dist/_chunk/datepicker.js +544 -544
  6. package/dist/_chunk/datepicker.js.map +1 -1
  7. package/dist/_chunk/datepicker.jsx +544 -544
  8. package/dist/_chunk/datepicker.jsx.map +1 -1
  9. package/dist/_chunk/dnd.js.map +1 -1
  10. package/dist/_chunk/dnd.jsx.map +1 -1
  11. package/dist/_chunk/select.js +6 -2
  12. package/dist/_chunk/select.js.map +1 -1
  13. package/dist/_chunk/select.jsx +6 -2
  14. package/dist/_chunk/select.jsx.map +1 -1
  15. package/dist/_chunk/spinbutton.js +34 -34
  16. package/dist/_chunk/spinbutton.js.map +1 -1
  17. package/dist/_chunk/spinbutton.jsx +34 -34
  18. package/dist/_chunk/spinbutton.jsx.map +1 -1
  19. package/dist/_chunk/table.js.map +1 -1
  20. package/dist/_chunk/table.jsx.map +1 -1
  21. package/dist/_chunk/tree.js.map +1 -1
  22. package/dist/_chunk/tree.jsx.map +1 -1
  23. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  24. package/dist/datepicker/createDateField.d.ts.map +1 -1
  25. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
  26. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  27. package/dist/datepicker/createTimeField.d.ts.map +1 -1
  28. package/dist/datepicker/intl.d.ts.map +1 -1
  29. package/dist/dnd/DragManager.d.ts.map +1 -1
  30. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  31. package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
  32. package/dist/select/createSelect.d.ts.map +1 -1
  33. package/dist/spinbutton/index.d.ts +2 -2
  34. package/dist/spinbutton/index.d.ts.map +1 -1
  35. package/dist/table/createTable.d.ts.map +1 -1
  36. package/dist/table/utils.d.ts.map +1 -1
  37. package/dist/tree/createTree.d.ts.map +1 -1
  38. package/package.json +4 -2
  39. package/src/actiongroup/createActionGroup.ts +1 -4
  40. package/src/datepicker/createDateField.ts +3 -1
  41. package/src/datepicker/createDatePickerGroup.ts +8 -4
  42. package/src/datepicker/createDateSegment.ts +47 -39
  43. package/src/datepicker/createTimeField.ts +1 -5
  44. package/src/datepicker/intl.ts +587 -544
  45. package/src/dnd/DragManager.ts +5 -5
  46. package/src/dnd/DropTargetKeyboardNavigation.ts +6 -4
  47. package/src/dnd/createDraggableItem.ts +3 -1
  48. package/src/dnd/createDroppableCollection.ts +7 -8
  49. package/src/select/createSelect.ts +19 -16
  50. package/src/spinbutton/index.ts +2 -10
  51. package/src/spinbutton/intl.ts +34 -34
  52. package/src/table/createTable.ts +2 -3
  53. package/src/table/utils.ts +1 -6
  54. package/src/tree/createTree.ts +1 -4
@@ -245,10 +245,7 @@ class DragSession {
245
245
  this.cancelEvent(e);
246
246
 
247
247
  if (e.key === "Enter") {
248
- if (
249
- e.altKey ||
250
- nodeContains(this.getCurrentActivateButton(), getEventTarget<Node>(e))
251
- ) {
248
+ if (e.altKey || nodeContains(this.getCurrentActivateButton(), getEventTarget<Node>(e))) {
252
249
  this.activate(this.currentDropTarget, this.currentDropItem);
253
250
  } else {
254
251
  this.drop();
@@ -556,7 +553,10 @@ class DragSession {
556
553
  }
557
554
 
558
555
  if (item != null && item !== this.currentDropItem) {
559
- if (this.currentDropTarget && typeof this.currentDropTarget.onDropTargetEnter === "function") {
556
+ if (
557
+ this.currentDropTarget &&
558
+ typeof this.currentDropTarget.onDropTargetEnter === "function"
559
+ ) {
560
560
  this.currentDropTarget.onDropTargetEnter(item.target);
561
561
  }
562
562
  item.element.focus();
@@ -93,7 +93,9 @@ function nextDropTarget(
93
93
  } else {
94
94
  nextKey = keyboardDelegate.getKeyBelow?.(target.key, { includeDisabled: true });
95
95
  }
96
- let nextCollectionKey = getNextItem(collection, target.key, (key) => collection.getKeyAfter(key));
96
+ let nextCollectionKey = getNextItem(collection, target.key, (key) =>
97
+ collection.getKeyAfter(key),
98
+ );
97
99
 
98
100
  // If the keyboard delegate did not move to the next key in the collection,
99
101
  // jump to that key with the same drop position. Otherwise, try the other
@@ -137,7 +139,8 @@ function nextDropTarget(
137
139
  // If this is the last sibling in a level, traverse to the parent.
138
140
  let targetNode = collection.getItem(target.key);
139
141
  let nextSiblingKey = targetNode != null ? collection.getKeyAfter(targetNode.key) : null;
140
- let nextItemInSameLevel = nextSiblingKey != null ? collection.getItem(nextSiblingKey) : null;
142
+ let nextItemInSameLevel =
143
+ nextSiblingKey != null ? collection.getItem(nextSiblingKey) : null;
141
144
  while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") {
142
145
  let afterKey = collection.getKeyAfter(nextItemInSameLevel.key);
143
146
  nextItemInSameLevel = afterKey != null ? collection.getItem(afterKey) : null;
@@ -306,8 +309,7 @@ function getLastChild(collection: Collection, key: Key): DropTarget | null {
306
309
  let nextNode = nextKey != null ? collection.getItem(nextKey) : null;
307
310
  if (targetNode && nextNode && nextNode.level > targetNode.level) {
308
311
  let lastChild: CollectionNode | null = null;
309
- lastChild =
310
- Array.from(targetNode.childNodes).findLast((item) => item.type === "item") || null;
312
+ lastChild = Array.from(targetNode.childNodes).findLast((item) => item.type === "item") || null;
311
313
 
312
314
  if (lastChild) {
313
315
  return {
@@ -114,7 +114,9 @@ export function createDraggableItem(
114
114
  if (opts.hasAction && dragModality === "keyboard") {
115
115
  msg += "Alt";
116
116
  }
117
- return stringFormatter().format(msg as Parameters<ReturnType<typeof stringFormatter>["format"]>[0]);
117
+ return stringFormatter().format(
118
+ msg as Parameters<ReturnType<typeof stringFormatter>["format"]>[0],
119
+ );
118
120
  });
119
121
  const descriptionProps = createDescription(dragDescription);
120
122
 
@@ -717,12 +717,7 @@ export function createDroppableCollection(
717
717
 
718
718
  let target = state.target;
719
719
  if (!target) {
720
- target = nextValidTarget(
721
- null,
722
- types,
723
- drag.allowedDropOperations,
724
- getPreviousTarget,
725
- );
720
+ target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
726
721
  } else if (target.type === "item") {
727
722
  // If at the top already, switch to the root. Otherwise navigate a page up.
728
723
  if (target.key === keyboardDelegate.getFirstKey?.()) {
@@ -809,9 +804,13 @@ function normalizeSelection(selection: "all" | Iterable<Key> | undefined): "all"
809
804
  // stamps `data-key={String(key)}`, so the attribute is the stringified key; map it
810
805
  // back to the real (possibly numeric) collection key by matching against the
811
806
  // collection's nodes.
812
- function keyFromDragElement(element: HTMLElement | null, collection: Collection | undefined): Key | null {
807
+ function keyFromDragElement(
808
+ element: HTMLElement | null,
809
+ collection: Collection | undefined,
810
+ ): Key | null {
813
811
  if (!element) return null;
814
- const raw = element.getAttribute("data-key") ?? element.closest("[data-key]")?.getAttribute("data-key");
812
+ const raw =
813
+ element.getAttribute("data-key") ?? element.closest("[data-key]")?.getAttribute("data-key");
815
814
  if (raw == null) return null;
816
815
  if (!collection) return raw;
817
816
  // Fast path: the raw string is already a valid key.
@@ -387,15 +387,17 @@ export function createSelect<T>(
387
387
  "aria-disabled": isDisabled || undefined,
388
388
  "aria-required": p.isRequired || undefined,
389
389
  "aria-describedby": p["aria-describedby"] || undefined,
390
- // Mirror upstream `useSelect`: the trigger's accessible name folds the
391
- // SELECTED VALUE ("Pro") ahead of the field label ("Plan") → "Pro Plan"
392
- // via `aria-labelledby=[valueId, labelId]`. Only wire this when there is
393
- // a real visible label; with an `aria-label` (no `labelledby`) the field
394
- // props' `aria-label` stays the trigger name (label-less legacy path,
395
- // keeps TabsPicker/label-less Select unchanged).
396
- "aria-labelledby": fieldProps["aria-labelledby"]
397
- ? [valueId, fieldProps["aria-labelledby"]].filter(Boolean).join(" ")
398
- : undefined,
390
+ // Mirror upstream `useSelect` exactly: the trigger name starts with
391
+ // the selected value, then the visible label. When only `aria-label`
392
+ // is present, the trigger references itself so that label follows the
393
+ // value as well ("Pro Plan"), rather than masking visible text.
394
+ "aria-labelledby": [
395
+ valueId,
396
+ fieldProps["aria-labelledby"],
397
+ fieldProps["aria-label"] && !fieldProps["aria-labelledby"] ? fieldProps.id : undefined,
398
+ ]
399
+ .filter(Boolean)
400
+ .join(" "),
399
401
  onKeyDown,
400
402
  onFocus: handleFocus,
401
403
  onBlur: handleBlur,
@@ -428,13 +430,14 @@ export function createSelect<T>(
428
430
  return {
429
431
  id: listBoxId,
430
432
  role: "listbox",
431
- // Mirror upstream `useSelect`: the listbox is labelled by the FIELD LABEL
432
- // (`fieldProps['aria-labelledby']` → the visible "Plan" label), NOT the
433
- // trigger button — the button's own accessible name folds in the selected
434
- // value ("Pro Plan"), which must not leak onto the listbox. Only when
435
- // there is no visible label (an `aria-label` on the field) does it fall
436
- // back to the trigger id (unchanged legacy behavior for label-less use).
437
- "aria-labelledby": fieldProps["aria-labelledby"] ?? buttonId,
433
+ // Mirror upstream `useSelect`: a visible field label names the listbox;
434
+ // the trigger is the fallback only for the `aria-label` branch.
435
+ "aria-labelledby": [
436
+ fieldProps["aria-labelledby"],
437
+ fieldProps["aria-label"] && !fieldProps["aria-labelledby"] ? fieldProps.id : undefined,
438
+ ]
439
+ .filter(Boolean)
440
+ .join(" "),
438
441
  "aria-multiselectable": state.selectionMode() === "multiple" ? true : undefined,
439
442
  tabIndex: -1,
440
443
  onBlur: (e: FocusEvent) => {
@@ -1,10 +1,2 @@
1
- export {
2
- createSpinButton,
3
- type SpinButtonProps,
4
- type SpinButtonAria,
5
- } from "./createSpinButton";
6
- export {
7
- spinButtonStrings,
8
- spinButtonDictionary,
9
- type SpinButtonStringKey,
10
- } from "./intl";
1
+ export { createSpinButton, type SpinButtonProps, type SpinButtonAria } from "./createSpinButton";
2
+ export { spinButtonStrings, spinButtonDictionary, type SpinButtonStringKey } from "./intl";
@@ -7,106 +7,106 @@ export type SpinButtonStringKey = "Empty";
7
7
 
8
8
  export const spinButtonStrings: Record<string, Record<SpinButtonStringKey, string>> = {
9
9
  "ar-AE": {
10
- "Empty": `\u{641}\u{627}\u{631}\u{63A}`
10
+ Empty: `\u{641}\u{627}\u{631}\u{63A}`,
11
11
  },
12
12
  "bg-BG": {
13
- "Empty": `\u{418}\u{437}\u{43F}\u{440}\u{430}\u{437}\u{43D}\u{438}`
13
+ Empty: `\u{418}\u{437}\u{43F}\u{440}\u{430}\u{437}\u{43D}\u{438}`,
14
14
  },
15
15
  "cs-CZ": {
16
- "Empty": `Pr\xe1zdn\xe9`
16
+ Empty: `Pr\xe1zdn\xe9`,
17
17
  },
18
18
  "da-DK": {
19
- "Empty": `Tom`
19
+ Empty: `Tom`,
20
20
  },
21
21
  "de-DE": {
22
- "Empty": `Leer`
22
+ Empty: `Leer`,
23
23
  },
24
24
  "el-GR": {
25
- "Empty": `\u{386}\u{3B4}\u{3B5}\u{3B9}\u{3BF}`
25
+ Empty: `\u{386}\u{3B4}\u{3B5}\u{3B9}\u{3BF}`,
26
26
  },
27
27
  "en-US": {
28
- "Empty": `Empty`
28
+ Empty: `Empty`,
29
29
  },
30
30
  "es-ES": {
31
- "Empty": `Vac\xedo`
31
+ Empty: `Vac\xedo`,
32
32
  },
33
33
  "et-EE": {
34
- "Empty": `T\xfchjenda`
34
+ Empty: `T\xfchjenda`,
35
35
  },
36
36
  "fi-FI": {
37
- "Empty": `Tyhj\xe4`
37
+ Empty: `Tyhj\xe4`,
38
38
  },
39
39
  "fr-FR": {
40
- "Empty": `Vide`
40
+ Empty: `Vide`,
41
41
  },
42
42
  "he-IL": {
43
- "Empty": `\u{5E8}\u{5D9}\u{5E7}`
43
+ Empty: `\u{5E8}\u{5D9}\u{5E7}`,
44
44
  },
45
45
  "hr-HR": {
46
- "Empty": `Prazno`
46
+ Empty: `Prazno`,
47
47
  },
48
48
  "hu-HU": {
49
- "Empty": `\xdcres`
49
+ Empty: `\xdcres`,
50
50
  },
51
51
  "it-IT": {
52
- "Empty": `Vuoto`
52
+ Empty: `Vuoto`,
53
53
  },
54
54
  "ja-JP": {
55
- "Empty": `\u{7A7A}`
55
+ Empty: `\u{7A7A}`,
56
56
  },
57
57
  "ko-KR": {
58
- "Empty": `\u{BE44}\u{C5B4} \u{C788}\u{C74C}`
58
+ Empty: `\u{BE44}\u{C5B4} \u{C788}\u{C74C}`,
59
59
  },
60
60
  "lt-LT": {
61
- "Empty": `Tu\u{161}\u{10D}ias`
61
+ Empty: `Tu\u{161}\u{10D}ias`,
62
62
  },
63
63
  "lv-LV": {
64
- "Empty": `Tuk\u{161}s`
64
+ Empty: `Tuk\u{161}s`,
65
65
  },
66
66
  "nb-NO": {
67
- "Empty": `Tom`
67
+ Empty: `Tom`,
68
68
  },
69
69
  "nl-NL": {
70
- "Empty": `Leeg`
70
+ Empty: `Leeg`,
71
71
  },
72
72
  "pl-PL": {
73
- "Empty": `Pusty`
73
+ Empty: `Pusty`,
74
74
  },
75
75
  "pt-BR": {
76
- "Empty": `Vazio`
76
+ Empty: `Vazio`,
77
77
  },
78
78
  "pt-PT": {
79
- "Empty": `Vazio`
79
+ Empty: `Vazio`,
80
80
  },
81
81
  "ro-RO": {
82
- "Empty": `Gol`
82
+ Empty: `Gol`,
83
83
  },
84
84
  "ru-RU": {
85
- "Empty": `\u{41D}\u{435} \u{437}\u{430}\u{43F}\u{43E}\u{43B}\u{43D}\u{435}\u{43D}\u{43E}`
85
+ Empty: `\u{41D}\u{435} \u{437}\u{430}\u{43F}\u{43E}\u{43B}\u{43D}\u{435}\u{43D}\u{43E}`,
86
86
  },
87
87
  "sk-SK": {
88
- "Empty": `Pr\xe1zdne`
88
+ Empty: `Pr\xe1zdne`,
89
89
  },
90
90
  "sl-SI": {
91
- "Empty": `Prazen`
91
+ Empty: `Prazen`,
92
92
  },
93
93
  "sr-SP": {
94
- "Empty": `Prazno`
94
+ Empty: `Prazno`,
95
95
  },
96
96
  "sv-SE": {
97
- "Empty": `Tomt`
97
+ Empty: `Tomt`,
98
98
  },
99
99
  "tr-TR": {
100
- "Empty": `Bo\u{15F}`
100
+ Empty: `Bo\u{15F}`,
101
101
  },
102
102
  "uk-UA": {
103
- "Empty": `\u{41F}\u{443}\u{441}\u{442}\u{43E}`
103
+ Empty: `\u{41F}\u{443}\u{441}\u{442}\u{43E}`,
104
104
  },
105
105
  "zh-CN": {
106
- "Empty": `\u{7A7A}`
106
+ Empty: `\u{7A7A}`,
107
107
  },
108
108
  "zh-TW": {
109
- "Empty": `\u{7A7A}\u{767D}`
109
+ Empty: `\u{7A7A}\u{767D}`,
110
110
  },
111
111
  };
112
112
 
@@ -615,9 +615,8 @@ export function createTable<T extends object>(
615
615
  const s = state();
616
616
 
617
617
  const describedBy =
618
- [sortDescriptionProps["aria-describedby"], p["aria-describedby"]]
619
- .filter(Boolean)
620
- .join(" ") || undefined;
618
+ [sortDescriptionProps["aria-describedby"], p["aria-describedby"]].filter(Boolean).join(" ") ||
619
+ undefined;
621
620
 
622
621
  const baseProps: Record<string, unknown> = {
623
622
  role: "grid",
@@ -3,12 +3,7 @@
3
3
  * Port of @react-aria/table/utils (`getRowLabelledBy` / cell id derivation).
4
4
  */
5
5
 
6
- import type {
7
- Key,
8
- GridNode,
9
- TableState,
10
- TableCollection,
11
- } from "@proyecto-viviana/solid-stately";
6
+ import type { Key, GridNode, TableState, TableCollection } from "@proyecto-viviana/solid-stately";
12
7
  import { getTableData } from "./createTable";
13
8
 
14
9
  /**
@@ -287,10 +287,7 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
287
287
  // enters at the first selected row, else the first navigable row.
288
288
  const backward =
289
289
  !!relatedTarget &&
290
- !!(
291
- currentTarget.compareDocumentPosition(relatedTarget) &
292
- Node.DOCUMENT_POSITION_FOLLOWING
293
- );
290
+ !!(currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING);
294
291
  key = backward
295
292
  ? (lastSelectedKey(s) ??
296
293
  findNextNavigableKey(s, s.collection.getLastKey(), (k) => s.collection.getKeyBefore(k)))