atlas-react-kit 0.9.4 → 0.11.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 (101) hide show
  1. package/COMPONENTS.md +52 -10
  2. package/DESIGN_RULES.md +26 -0
  3. package/README.md +2 -2
  4. package/dist/accordion.d.ts +8 -1
  5. package/dist/accordion.js +8 -3
  6. package/dist/alert.js +1 -1
  7. package/dist/avatar.d.ts +5 -1
  8. package/dist/avatar.js +7 -2
  9. package/dist/badge.js +1 -1
  10. package/dist/breadcrumb.js +3 -2
  11. package/dist/button.js +6 -6
  12. package/dist/calendar.js +19 -12
  13. package/dist/card.d.ts +1 -1
  14. package/dist/checkbox.js +2 -2
  15. package/dist/color-legend.d.ts +6 -4
  16. package/dist/color-legend.js +7 -4
  17. package/dist/combobox.d.ts +10 -2
  18. package/dist/combobox.js +35 -25
  19. package/dist/date-picker.d.ts +7 -13
  20. package/dist/date-picker.js +14 -20
  21. package/dist/date-time-picker.d.ts +5 -13
  22. package/dist/date-time-picker.js +26 -30
  23. package/dist/dialog.d.ts +5 -1
  24. package/dist/dialog.js +4 -3
  25. package/dist/dropdown-menu.js +5 -4
  26. package/dist/empty-panel.d.ts +4 -3
  27. package/dist/empty-panel.js +3 -3
  28. package/dist/error-boundary.d.ts +5 -3
  29. package/dist/error-boundary.js +9 -4
  30. package/dist/field.d.ts +14 -1
  31. package/dist/field.js +16 -3
  32. package/dist/form/date-picker-field.d.ts +8 -2
  33. package/dist/form/date-picker-field.js +4 -4
  34. package/dist/form/date-time-picker-field.d.ts +8 -1
  35. package/dist/form/date-time-picker-field.js +3 -3
  36. package/dist/form/feedback-field.d.ts +2 -1
  37. package/dist/form/feedback-field.js +3 -2
  38. package/dist/form/field-error.d.ts +4 -1
  39. package/dist/form/field-error.js +3 -2
  40. package/dist/form/field-shell.d.ts +25 -1
  41. package/dist/form/field-shell.js +36 -3
  42. package/dist/form/markdown-field.d.ts +7 -1
  43. package/dist/form/markdown-field.js +10 -5
  44. package/dist/form/select-field.d.ts +7 -1
  45. package/dist/form/select-field.js +3 -3
  46. package/dist/form/text-field.d.ts +5 -1
  47. package/dist/form/text-field.js +6 -3
  48. package/dist/info-tip.d.ts +5 -2
  49. package/dist/info-tip.js +34 -16
  50. package/dist/internal/form-control.d.ts +5 -0
  51. package/dist/internal/form-control.js +7 -0
  52. package/dist/internal/listbox-navigation.d.ts +32 -0
  53. package/dist/internal/listbox-navigation.js +38 -0
  54. package/dist/internal/listbox-option.d.ts +25 -0
  55. package/dist/internal/listbox-option.js +23 -0
  56. package/dist/internal/math.d.ts +5 -0
  57. package/dist/internal/math.js +7 -0
  58. package/dist/internal/overlay-styles.d.ts +28 -0
  59. package/dist/internal/overlay-styles.js +28 -0
  60. package/dist/internal/styles.d.ts +27 -0
  61. package/dist/internal/styles.js +27 -0
  62. package/dist/internal/tabs-styles.d.ts +10 -1
  63. package/dist/internal/tabs-styles.js +27 -5
  64. package/dist/lazy-calendar.d.ts +6 -0
  65. package/dist/lazy-calendar.js +26 -0
  66. package/dist/markdown.js +10 -4
  67. package/dist/meter.d.ts +3 -2
  68. package/dist/meter.js +6 -3
  69. package/dist/pagination.d.ts +8 -1
  70. package/dist/pagination.js +15 -9
  71. package/dist/picker-shell.d.ts +59 -0
  72. package/dist/picker-shell.js +21 -0
  73. package/dist/popover.js +2 -1
  74. package/dist/progress.d.ts +7 -3
  75. package/dist/progress.js +10 -4
  76. package/dist/radio-group.js +2 -2
  77. package/dist/search-picker.d.ts +6 -6
  78. package/dist/search-picker.js +28 -33
  79. package/dist/select.js +12 -6
  80. package/dist/separator.d.ts +4 -0
  81. package/dist/separator.js +5 -1
  82. package/dist/slider.d.ts +8 -3
  83. package/dist/slider.js +7 -5
  84. package/dist/sortable-table-head.d.ts +3 -1
  85. package/dist/sortable-table-head.js +3 -2
  86. package/dist/stat-tile.d.ts +6 -4
  87. package/dist/stat-tile.js +6 -4
  88. package/dist/switch.js +2 -2
  89. package/dist/table-body-skeleton.d.ts +8 -2
  90. package/dist/table-body-skeleton.js +7 -3
  91. package/dist/table.d.ts +7 -1
  92. package/dist/table.js +6 -2
  93. package/dist/tabs.d.ts +13 -3
  94. package/dist/tabs.js +29 -10
  95. package/dist/theme-provider.d.ts +2 -1
  96. package/dist/theme-provider.js +1 -1
  97. package/dist/toggle.js +4 -4
  98. package/dist/tooltip.d.ts +7 -3
  99. package/dist/tooltip.js +17 -6
  100. package/package.json +1 -1
  101. package/theme.css +43 -50
package/dist/tooltip.js CHANGED
@@ -2,25 +2,36 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Tooltip as TooltipPrimitive } from "radix-ui";
5
+ import { overlaySideSlide } from "./internal/overlay-styles.js";
5
6
  import { cn } from "./utils.js";
7
+ /** True inside a TooltipProvider, so `Tooltip` does not add its own. */
8
+ const HasTooltipProvider = React.createContext(false);
6
9
  /**
7
- * Shares open delay across tooltips. `Tooltip` adds one per instance, so a
8
- * provider at the app root is optional; add it to tune `delayDuration`.
10
+ * Shares open delay across tooltips. `Tooltip` adds one when none is above
11
+ * it, so a provider at the app root is optional; add it to tune
12
+ * `delayDuration`.
9
13
  */
10
14
  function TooltipProvider({ delayDuration = 0, ...props }) {
11
- return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
15
+ return (_jsx(HasTooltipProvider.Provider, { value: true, children: _jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }) }));
12
16
  }
13
17
  /**
14
18
  * Short label for an icon button or truncated text. Opens on hover and
15
19
  * keyboard focus; put essential information in visible text instead.
16
20
  */
17
21
  function Tooltip({ ...props }) {
18
- return (_jsx(TooltipProvider, { children: _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) }));
22
+ const root = _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
23
+ // A nested provider would override the app's delayDuration.
24
+ if (React.useContext(HasTooltipProvider))
25
+ return root;
26
+ return _jsx(TooltipProvider, { children: root });
19
27
  }
20
28
  function TooltipTrigger({ ...props }) {
21
29
  return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
22
30
  }
23
- function TooltipContent({ className, sideOffset = 4, children, ...props }) {
24
- return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) rounded-none bg-foreground px-3 py-1.5 text-xs text-balance text-background duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "fill-foreground" })] }) }));
31
+ function TooltipContent({ className, arrowClassName, sideOffset = 4, children, ...props }) {
32
+ return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn(overlaySideSlide,
33
+ // Radix tooltips open as "delayed-open" or "instant-open", which
34
+ // the shared data-open fade does not match.
35
+ "z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) rounded-none bg-foreground px-3 py-1.5 text-xs text-balance text-background duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { "data-slot": "tooltip-arrow", className: cn("fill-foreground", arrowClassName) })] }) }));
25
36
  }
26
37
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-react-kit",
3
- "version": "0.9.4",
3
+ "version": "0.11.0",
4
4
  "description": "Shared React components and Tailwind theme for Atlas",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/theme.css CHANGED
@@ -166,11 +166,7 @@
166
166
  --border: oklch(1 0 0 / 10%);
167
167
  --input: oklch(0.52 0 0);
168
168
  --ring: oklch(0.75 0.14 293);
169
- --chart-1: oklch(0.87 0 0);
170
- --chart-2: oklch(0.556 0 0);
171
- --chart-3: oklch(0.439 0 0);
172
- --chart-4: oklch(0.371 0 0);
173
- --chart-5: oklch(0.269 0 0);
169
+ /* --chart-1..5 are the same in both themes; :root sets them. */
174
170
  --sidebar: oklch(0.205 0 0);
175
171
  --sidebar-foreground: oklch(0.985 0 0);
176
172
  --sidebar-primary: oklch(0.606 0.25 292.717);
@@ -195,6 +191,22 @@
195
191
  html {
196
192
  @apply font-sans;
197
193
  }
194
+ /*
195
+ * Reduced motion: overlays, accordions, spinners and skeletons stop moving.
196
+ * Durations go near zero rather than none so animationend still fires and
197
+ * Radix can unmount closing overlays. `!important` in this early layer
198
+ * beats the utility classes that set the animations.
199
+ */
200
+ @media (prefers-reduced-motion: reduce) {
201
+ *,
202
+ ::before,
203
+ ::after {
204
+ animation-duration: 0.01ms !important;
205
+ animation-iteration-count: 1 !important;
206
+ transition-duration: 0.01ms !important;
207
+ scroll-behavior: auto !important;
208
+ }
209
+ }
198
210
  }
199
211
 
200
212
  /*
@@ -218,15 +230,19 @@
218
230
  }
219
231
 
220
232
  /*
221
- * Horizontal scroll shadows: edge fades stay pinned (`scroll`) while
222
- * matching covers ride with the content (`local`), so a clipped column
223
- * like LICENSE is visible as overflow instead of looking truncated.
233
+ * Horizontal scroll shadows for tables and tab rows: edge fades stay
234
+ * pinned (`scroll`) while matching covers ride with the content (`local`),
235
+ * so a clipped column or label is visible as overflow instead of looking
236
+ * truncated. `--scroll-fade` is the cover color; `--scroll-fill` is the
237
+ * fifth layer, the fill behind the content (transparent for tables; the
238
+ * muted list for tabs, whose list stays transparent so the fades show).
224
239
  */
225
- [data-slot="table-container"] {
226
- --table-scroll-fade: var(--background);
240
+ [data-slot="table-container"],
241
+ [data-slot="tabs-scroller"] {
242
+ --scroll-fill: transparent;
227
243
  background:
228
- linear-gradient(to right, var(--table-scroll-fade) 40%, transparent),
229
- linear-gradient(to left, var(--table-scroll-fade) 40%, transparent),
244
+ linear-gradient(to right, var(--scroll-fade) 40%, transparent),
245
+ linear-gradient(to left, var(--scroll-fade) 40%, transparent),
230
246
  linear-gradient(
231
247
  to right,
232
248
  color-mix(in oklch, var(--foreground) 16%, transparent),
@@ -236,19 +252,27 @@
236
252
  to left,
237
253
  color-mix(in oklch, var(--foreground) 16%, transparent),
238
254
  transparent 80%
239
- );
255
+ ),
256
+ var(--scroll-fill);
240
257
  background-repeat: no-repeat;
241
258
  background-size:
242
259
  1.5rem 100%,
243
260
  1.5rem 100%,
244
261
  0.75rem 100%,
245
- 0.75rem 100%;
262
+ 0.75rem 100%,
263
+ 100% 100%;
246
264
  background-position:
247
265
  left center,
248
266
  right center,
249
267
  left center,
250
- right center;
251
- background-attachment: local, local, scroll, scroll;
268
+ right center,
269
+ center;
270
+ background-attachment: local, local, scroll, scroll, scroll;
271
+ }
272
+
273
+ [data-slot="table-container"] {
274
+ --table-scroll-fade: var(--background);
275
+ --scroll-fade: var(--table-scroll-fade);
252
276
  }
253
277
 
254
278
  /* Covers match the card face so the fade does not flash the page background. */
@@ -256,45 +280,14 @@
256
280
  --table-scroll-fade: var(--card);
257
281
  }
258
282
 
259
- /*
260
- * Tab row overflow: same pinned-shadow / local-cover trick as tables.
261
- * Covers match the muted list so a clipped label reads as overflow.
262
- * The fifth layer is the list fill — the list itself stays transparent
263
- * so the fades show through. Scrollbars stay hidden; the fade is the cue.
264
- */
283
+ /* Tab rows hide their scrollbar; the fade is the cue. */
265
284
  [data-slot="tabs-scroller"] {
266
285
  --tabs-scroll-fade: var(--muted);
286
+ --scroll-fade: var(--tabs-scroll-fade);
287
+ --scroll-fill: var(--tabs-scroll-fade);
267
288
  scrollbar-width: none;
268
289
  -ms-overflow-style: none;
269
290
  scroll-padding-inline: 1rem;
270
- background:
271
- linear-gradient(to right, var(--tabs-scroll-fade) 40%, transparent),
272
- linear-gradient(to left, var(--tabs-scroll-fade) 40%, transparent),
273
- linear-gradient(
274
- to right,
275
- color-mix(in oklch, var(--foreground) 16%, transparent),
276
- transparent 80%
277
- ),
278
- linear-gradient(
279
- to left,
280
- color-mix(in oklch, var(--foreground) 16%, transparent),
281
- transparent 80%
282
- ),
283
- var(--tabs-scroll-fade);
284
- background-repeat: no-repeat;
285
- background-size:
286
- 1.5rem 100%,
287
- 1.5rem 100%,
288
- 0.75rem 100%,
289
- 0.75rem 100%,
290
- 100% 100%;
291
- background-position:
292
- left center,
293
- right center,
294
- left center,
295
- right center,
296
- center;
297
- background-attachment: local, local, scroll, scroll, scroll;
298
291
  }
299
292
 
300
293
  [data-slot="tabs-scroller"]::-webkit-scrollbar {