@a4ui/core 0.38.1 → 0.39.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 (129) hide show
  1. package/README.md +66 -9
  2. package/dist/{Collapse-Cr5cDqAl.js → Collapse-CrKiFD8K.js} +173 -124
  3. package/dist/charts/Sparkline.d.ts +2 -0
  4. package/dist/charts.js +8 -5
  5. package/dist/commerce.js +59 -59
  6. package/dist/elements.css +248 -151
  7. package/dist/elements.iife.js +1 -1
  8. package/dist/elements.js +1025 -1015
  9. package/dist/full.css +248 -151
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +4723 -4656
  12. package/dist/lib/anchored.d.ts +7 -0
  13. package/dist/lib/direction.d.ts +18 -0
  14. package/dist/styles.css +27 -11
  15. package/dist/theme.css +1559 -0
  16. package/dist/ui/DirectionProvider.d.ts +47 -0
  17. package/dist/ui/Drawer.d.ts +6 -2
  18. package/dist/ui/Sidebar.d.ts +8 -2
  19. package/dist/ui/Toast.d.ts +5 -1
  20. package/package.json +5 -3
  21. package/preset.d.ts +2 -1
  22. package/preset.js +16 -5
  23. package/src/charts/BarList.tsx +1 -1
  24. package/src/charts/Sparkline.tsx +5 -1
  25. package/src/commerce/CartLine.tsx +1 -1
  26. package/src/commerce/FacetSidebar.tsx +1 -1
  27. package/src/commerce/ProductCard.tsx +1 -1
  28. package/src/index.ts +7 -1
  29. package/src/layout/NavGroup.tsx +2 -2
  30. package/src/lib/anchored.ts +13 -0
  31. package/src/lib/direction.ts +35 -0
  32. package/src/ui/Accordion.tsx +2 -2
  33. package/src/ui/ActivityFeed.tsx +2 -2
  34. package/src/ui/AlertDialog.tsx +2 -1
  35. package/src/ui/Anchor.tsx +1 -1
  36. package/src/ui/AnnouncementBar.tsx +3 -3
  37. package/src/ui/ArtifactPanel.tsx +1 -1
  38. package/src/ui/AvailabilityPicker.tsx +2 -2
  39. package/src/ui/AvatarGroup.tsx +2 -2
  40. package/src/ui/BackToTop.tsx +1 -1
  41. package/src/ui/Badge.tsx +1 -1
  42. package/src/ui/BlockEditor.tsx +1 -1
  43. package/src/ui/ButtonGroup.tsx +1 -1
  44. package/src/ui/Callout.tsx +1 -1
  45. package/src/ui/Carousel.tsx +17 -9
  46. package/src/ui/Cascader.tsx +2 -2
  47. package/src/ui/CategoryStrip.tsx +4 -1
  48. package/src/ui/CodeEditor.tsx +5 -5
  49. package/src/ui/CodeTabs.tsx +1 -1
  50. package/src/ui/Combobox.tsx +2 -1
  51. package/src/ui/Command.tsx +3 -2
  52. package/src/ui/Comment.tsx +1 -1
  53. package/src/ui/Configurator.tsx +2 -2
  54. package/src/ui/ContextMenu.tsx +2 -1
  55. package/src/ui/DateField.tsx +4 -4
  56. package/src/ui/DateRangePicker.tsx +4 -4
  57. package/src/ui/DiffViewer.tsx +4 -3
  58. package/src/ui/DirectionProvider.tsx +82 -0
  59. package/src/ui/Drawer.tsx +23 -5
  60. package/src/ui/Dropdown.tsx +2 -1
  61. package/src/ui/EmojiPicker.tsx +5 -2
  62. package/src/ui/Expandable.tsx +2 -2
  63. package/src/ui/Faq.tsx +1 -1
  64. package/src/ui/Field.tsx +1 -1
  65. package/src/ui/FloatingActionButton.tsx +2 -2
  66. package/src/ui/FollowingPointer.tsx +2 -2
  67. package/src/ui/Hero.tsx +2 -2
  68. package/src/ui/HoldToConfirm.tsx +2 -2
  69. package/src/ui/HoverCard.tsx +2 -1
  70. package/src/ui/Image.tsx +3 -2
  71. package/src/ui/InlineSelect.tsx +1 -1
  72. package/src/ui/InputGroup.tsx +2 -2
  73. package/src/ui/Item.tsx +1 -1
  74. package/src/ui/JsonViewer.tsx +2 -2
  75. package/src/ui/Kanban.tsx +1 -1
  76. package/src/ui/KpiBlock.tsx +1 -1
  77. package/src/ui/Lightbox.tsx +9 -6
  78. package/src/ui/MasterDetail.tsx +1 -1
  79. package/src/ui/Mentions.tsx +1 -1
  80. package/src/ui/Menubar.tsx +9 -8
  81. package/src/ui/Modal.tsx +3 -2
  82. package/src/ui/ModelPicker.tsx +2 -1
  83. package/src/ui/MultiSelect.tsx +5 -5
  84. package/src/ui/NativeSelect.tsx +2 -2
  85. package/src/ui/NavigationMenu.tsx +5 -4
  86. package/src/ui/NotificationCenter.tsx +1 -1
  87. package/src/ui/NotificationStack.tsx +1 -1
  88. package/src/ui/NumberInput.tsx +2 -2
  89. package/src/ui/OnboardingChecklist.tsx +2 -2
  90. package/src/ui/Pagination.tsx +2 -2
  91. package/src/ui/PillSearch.tsx +3 -3
  92. package/src/ui/PivotTable.tsx +0 -0
  93. package/src/ui/Popover.tsx +2 -1
  94. package/src/ui/Portal.tsx +3 -1
  95. package/src/ui/PresenceAvatars.tsx +4 -4
  96. package/src/ui/PricingTable.tsx +1 -1
  97. package/src/ui/Prose.tsx +3 -3
  98. package/src/ui/QueryBuilder.tsx +4 -4
  99. package/src/ui/Rating.tsx +6 -2
  100. package/src/ui/ReasoningTrace.tsx +1 -1
  101. package/src/ui/ScrollArea.tsx +1 -1
  102. package/src/ui/ScrollProgress.tsx +2 -2
  103. package/src/ui/SideRail.tsx +3 -3
  104. package/src/ui/Sidebar.tsx +43 -23
  105. package/src/ui/SlashMenu.tsx +1 -1
  106. package/src/ui/Snippet.tsx +6 -3
  107. package/src/ui/Sortable.tsx +1 -1
  108. package/src/ui/SpecSheet.tsx +1 -1
  109. package/src/ui/SpeedDial.tsx +1 -1
  110. package/src/ui/Splitter.tsx +8 -3
  111. package/src/ui/SpreadsheetGrid.tsx +4 -4
  112. package/src/ui/Stepper.tsx +1 -1
  113. package/src/ui/SuggestionChips.tsx +1 -1
  114. package/src/ui/Switch.tsx +1 -1
  115. package/src/ui/Table.tsx +5 -2
  116. package/src/ui/TimeField.tsx +8 -8
  117. package/src/ui/Timeline.tsx +2 -2
  118. package/src/ui/Toast.tsx +9 -3
  119. package/src/ui/ToolCallTimeline.tsx +2 -2
  120. package/src/ui/Tooltip.tsx +2 -1
  121. package/src/ui/Tour.tsx +1 -1
  122. package/src/ui/TransactionFeed.tsx +1 -1
  123. package/src/ui/Transfer.tsx +2 -2
  124. package/src/ui/Tree.tsx +2 -2
  125. package/src/ui/TreeSelect.tsx +2 -2
  126. package/src/ui/TreeTable.tsx +4 -4
  127. package/src/ui/UsageMeter.tsx +1 -1
  128. package/src/ui/VideoPlayerShell.tsx +2 -2
  129. package/src/ui/internal/CalendarCore.tsx +6 -6
@@ -14,3 +14,10 @@ export interface AnchorReflowOptions {
14
14
  * from any ancestor container, and scroll events do not bubble to `window`.
15
15
  */
16
16
  export declare function createAnchorReflow(options: AnchorReflowOptions): () => void;
17
+ /**
18
+ * Viewport `left` for a fixed panel aligned with its trigger's inline-start edge,
19
+ * kept 8px inside the viewport. Under `dir="rtl"` that is the trigger's right
20
+ * edge, so the panel extends leftwards. The direction is read from the trigger,
21
+ * which also works for a `dir` set by a provider or an ancestor element.
22
+ */
23
+ export declare function anchoredLeft(anchor: HTMLElement, panelWidth: number): number;
@@ -0,0 +1,18 @@
1
+ import { Accessor } from 'solid-js';
2
+ /** Text direction supported by {@link DirectionProvider}. */
3
+ export type Direction = 'ltr' | 'rtl';
4
+ /** Accessor of the nearest provider's direction, or `undefined` outside one. */
5
+ export declare const DirectionContext: import('solid-js').Context<Accessor<Direction> | undefined>;
6
+ /**
7
+ * Maps a physical horizontal arrow key to the key that means the same thing in
8
+ * reading order: under `rtl`, ArrowLeft moves forward and ArrowRight back, so
9
+ * handlers written for LTR can run on the swapped key. Other keys pass through.
10
+ */
11
+ export declare function readingKey(key: string, dir: Direction): string;
12
+ /**
13
+ * `ref` for a portal container (Solid `Portal` or any Kobalte `*.Portal`).
14
+ * Copies the nearest `DirectionProvider`'s direction onto the container so the
15
+ * overlay renders in the same direction as the tree that opened it. Outside a
16
+ * provider it does nothing, so the overlay inherits from `<body>` as before.
17
+ */
18
+ export declare function portalDir(el: Element): void;
package/dist/styles.css CHANGED
@@ -134,11 +134,22 @@ body {
134
134
  animation: modal-content-out 0.15s ease-in;
135
135
  }
136
136
 
137
+ /* Reading direction as a number, so horizontal slide offsets can mirror:
138
+ `translateX(calc(16px * var(--dir-x)))`. Inherited, so any element (including
139
+ portaled overlays, which get their own `dir`) sees the nearest `dir`. */
140
+ :root,
141
+ [dir='ltr'] {
142
+ --dir-x: 1;
143
+ }
144
+ [dir='rtl'] {
145
+ --dir-x: -1;
146
+ }
147
+
137
148
  /* Toast — same animationend-only presence mechanism as Dialog. */
138
149
  @keyframes toast-in {
139
150
  from {
140
151
  opacity: 0;
141
- transform: translateX(16px);
152
+ transform: translateX(calc(16px * var(--dir-x, 1)));
142
153
  }
143
154
  to {
144
155
  opacity: 1;
@@ -152,7 +163,7 @@ body {
152
163
  }
153
164
  to {
154
165
  opacity: 0;
155
- transform: translateX(16px);
166
+ transform: translateX(calc(16px * var(--dir-x, 1)));
156
167
  }
157
168
  }
158
169
  .toast-item[data-opened] {
@@ -167,7 +178,7 @@ body {
167
178
  on every theme; the sweep is a pure CSS animation (no engine). */
168
179
  @keyframes skeleton-shimmer {
169
180
  100% {
170
- transform: translateX(100%);
181
+ transform: translateX(calc(100% * var(--dir-x, 1)));
171
182
  }
172
183
  }
173
184
  .skeleton-shimmer {
@@ -178,8 +189,13 @@ body {
178
189
  content: '';
179
190
  position: absolute;
180
191
  inset: 0;
181
- transform: translateX(-100%);
182
- background: linear-gradient(90deg, transparent, hsl(var(--foreground) / 0.08), transparent);
192
+ transform: translateX(calc(-100% * var(--dir-x, 1)));
193
+ background: linear-gradient(
194
+ calc(90deg * var(--dir-x, 1)),
195
+ transparent,
196
+ hsl(var(--foreground) / 0.08),
197
+ transparent
198
+ );
183
199
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
184
200
  }
185
201
 
@@ -298,7 +314,7 @@ body {
298
314
  @keyframes questionnaire-step-in {
299
315
  from {
300
316
  opacity: 0;
301
- transform: translateX(16px);
317
+ transform: translateX(calc(16px * var(--dir-x, 1)));
302
318
  }
303
319
  to {
304
320
  opacity: 1;
@@ -308,7 +324,7 @@ body {
308
324
  @keyframes questionnaire-step-in-back {
309
325
  from {
310
326
  opacity: 0;
311
- transform: translateX(-16px);
327
+ transform: translateX(calc(-16px * var(--dir-x, 1)));
312
328
  }
313
329
  to {
314
330
  opacity: 1;
@@ -342,7 +358,7 @@ body {
342
358
  @keyframes navmenu-from-start {
343
359
  from {
344
360
  opacity: 0;
345
- transform: translateX(-2.5rem);
361
+ transform: translateX(calc(-2.5rem * var(--dir-x, 1)));
346
362
  }
347
363
  to {
348
364
  opacity: 1;
@@ -352,7 +368,7 @@ body {
352
368
  @keyframes navmenu-from-end {
353
369
  from {
354
370
  opacity: 0;
355
- transform: translateX(2.5rem);
371
+ transform: translateX(calc(2.5rem * var(--dir-x, 1)));
356
372
  }
357
373
  to {
358
374
  opacity: 1;
@@ -367,7 +383,7 @@ body {
367
383
  to {
368
384
  opacity: 0;
369
385
  visibility: hidden;
370
- transform: translateX(-2.5rem);
386
+ transform: translateX(calc(-2.5rem * var(--dir-x, 1)));
371
387
  }
372
388
  }
373
389
  @keyframes navmenu-to-end {
@@ -378,7 +394,7 @@ body {
378
394
  to {
379
395
  opacity: 0;
380
396
  visibility: hidden;
381
- transform: translateX(2.5rem);
397
+ transform: translateX(calc(2.5rem * var(--dir-x, 1)));
382
398
  }
383
399
  }
384
400
  .navmenu-viewport[data-expanded] {