@once-ui-system/core 2.0.0-alpha.1 → 2.0.0-alpha.2

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 (116) hide show
  1. package/ai/catalog.json +11 -4
  2. package/ai/components/Effect.json +1 -1
  3. package/ai/components/Feedback.json +1 -0
  4. package/ai/components/Form.json +15 -0
  5. package/ai/components/Input.json +3 -2
  6. package/ai/components/{Particle.json → ParticleFx.json} +1 -1
  7. package/ai/components/ScrollContainer.json +9 -1
  8. package/ai/components/Textarea.json +3 -2
  9. package/ai/components/ThemeSwitcher.json +2 -1
  10. package/ai/examples/blocks/Footer4.tsx +2 -2
  11. package/ai/examples/blocks/manifest.json +2 -2
  12. package/ai/gotchas.json +7 -0
  13. package/ai/manifest.json +2 -2
  14. package/ai/rules.md +1 -1
  15. package/ai/spec.json +35 -10
  16. package/dist/ai/catalog.json +11 -4
  17. package/dist/ai/components/Effect.json +1 -1
  18. package/dist/ai/components/Feedback.json +1 -0
  19. package/dist/ai/components/Form.json +15 -0
  20. package/dist/ai/components/Input.json +3 -2
  21. package/dist/ai/components/{Particle.json → ParticleFx.json} +1 -1
  22. package/dist/ai/components/ScrollContainer.json +9 -1
  23. package/dist/ai/components/Textarea.json +3 -2
  24. package/dist/ai/components/ThemeSwitcher.json +2 -1
  25. package/dist/ai/examples/blocks/manifest.json +2 -2
  26. package/dist/ai/gotchas.json +7 -0
  27. package/dist/ai/manifest.json +2 -2
  28. package/dist/ai/rules.md +1 -1
  29. package/dist/ai/spec.json +35 -10
  30. package/dist/components/Animation.d.ts +1 -2
  31. package/dist/components/Animation.d.ts.map +1 -1
  32. package/dist/components/Animation.js +1 -1
  33. package/dist/components/Animation.js.map +1 -1
  34. package/dist/components/ArrowNavigationContext.d.ts.map +1 -1
  35. package/dist/components/ArrowNavigationContext.js +12 -3
  36. package/dist/components/ArrowNavigationContext.js.map +1 -1
  37. package/dist/components/ContextMenu.d.ts +1 -1
  38. package/dist/components/ContextMenu.d.ts.map +1 -1
  39. package/dist/components/CursorCard.d.ts +1 -1
  40. package/dist/components/CursorCard.d.ts.map +1 -1
  41. package/dist/components/DatePicker.d.ts.map +1 -1
  42. package/dist/components/DatePicker.js +7 -0
  43. package/dist/components/DatePicker.js.map +1 -1
  44. package/dist/components/DropdownWrapper.d.ts +1 -1
  45. package/dist/components/DropdownWrapper.d.ts.map +1 -1
  46. package/dist/components/DropdownWrapper.js +178 -35
  47. package/dist/components/DropdownWrapper.js.map +1 -1
  48. package/dist/components/DropdownWrapper.module.scss +3 -1
  49. package/dist/components/Effect.d.ts +2 -2
  50. package/dist/components/Effect.d.ts.map +1 -1
  51. package/dist/components/Effect.js +2 -2
  52. package/dist/components/Effect.js.map +1 -1
  53. package/dist/components/Feedback.d.ts +4 -0
  54. package/dist/components/Feedback.d.ts.map +1 -1
  55. package/dist/components/Feedback.js +2 -2
  56. package/dist/components/Feedback.js.map +1 -1
  57. package/dist/components/FocusTrap.d.ts +3 -3
  58. package/dist/components/FocusTrap.d.ts.map +1 -1
  59. package/dist/components/FocusTrap.js +10 -0
  60. package/dist/components/FocusTrap.js.map +1 -1
  61. package/dist/components/Form.d.ts +48 -0
  62. package/dist/components/Form.d.ts.map +1 -0
  63. package/dist/components/Form.js +191 -0
  64. package/dist/components/Form.js.map +1 -0
  65. package/dist/components/Form.module.scss +160 -0
  66. package/dist/components/FormContext.d.ts +20 -0
  67. package/dist/components/FormContext.d.ts.map +1 -0
  68. package/dist/components/FormContext.js +12 -0
  69. package/dist/components/FormContext.js.map +1 -0
  70. package/dist/components/Input.d.ts +3 -0
  71. package/dist/components/Input.d.ts.map +1 -1
  72. package/dist/components/Input.js +13 -2
  73. package/dist/components/Input.js.map +1 -1
  74. package/dist/components/Input.module.scss +27 -6
  75. package/dist/components/{Particle.d.ts → ParticleFx.d.ts} +9 -4
  76. package/dist/components/ParticleFx.d.ts.map +1 -0
  77. package/dist/components/{Particle.js → ParticleFx.js} +9 -4
  78. package/dist/components/ParticleFx.js.map +1 -0
  79. package/dist/components/ScrollContainer.d.ts +69 -2
  80. package/dist/components/ScrollContainer.d.ts.map +1 -1
  81. package/dist/components/ScrollContainer.js +377 -46
  82. package/dist/components/ScrollContainer.js.map +1 -1
  83. package/dist/components/ScrollContainer.module.scss +131 -0
  84. package/dist/components/Select.d.ts +1 -1
  85. package/dist/components/Select.d.ts.map +1 -1
  86. package/dist/components/Setting.d.ts.map +1 -1
  87. package/dist/components/Setting.js +6 -1
  88. package/dist/components/Setting.js.map +1 -1
  89. package/dist/components/Textarea.d.ts +3 -0
  90. package/dist/components/Textarea.d.ts.map +1 -1
  91. package/dist/components/Textarea.js +22 -6
  92. package/dist/components/Textarea.js.map +1 -1
  93. package/dist/components/ThemeSwitcher.d.ts +16 -0
  94. package/dist/components/ThemeSwitcher.d.ts.map +1 -1
  95. package/dist/components/ThemeSwitcher.js +48 -9
  96. package/dist/components/ThemeSwitcher.js.map +1 -1
  97. package/dist/components/ThemeSwitcher.module.scss +112 -0
  98. package/dist/components/UserMenu.d.ts +1 -1
  99. package/dist/components/UserMenu.d.ts.map +1 -1
  100. package/dist/components/index.d.ts +2 -1
  101. package/dist/components/index.d.ts.map +1 -1
  102. package/dist/components/index.js +2 -1
  103. package/dist/components/index.js.map +1 -1
  104. package/dist/data/emoji-data.json +10 -0
  105. package/dist/hooks/useArrowNavigation.d.ts.map +1 -1
  106. package/dist/hooks/useArrowNavigation.js +52 -7
  107. package/dist/hooks/useArrowNavigation.js.map +1 -1
  108. package/dist/modules/navigation/MegaMenu.d.ts.map +1 -1
  109. package/dist/modules/navigation/MegaMenu.js +76 -10
  110. package/dist/modules/navigation/MegaMenu.js.map +1 -1
  111. package/dist/package.json +1 -1
  112. package/dist/types.d.ts +14 -0
  113. package/dist/types.d.ts.map +1 -1
  114. package/package.json +1 -1
  115. package/dist/components/Particle.d.ts.map +0 -1
  116. package/dist/components/Particle.js.map +0 -1
@@ -4,7 +4,7 @@ import React, { useEffect, useRef } from "react";
4
4
  import { Flex } from ".";
5
5
  import { useInViewport } from "../hooks/useInViewport";
6
6
  import { useReducedMotion } from "../hooks/useReducedMotion";
7
- const Particle = React.forwardRef(({ density = 100, color = "brand-on-background-weak", size = "2", speed = 0.3, interactive = false, mode = "repel", intensity = 20, opacity = 100, reducedMotion = "auto", children, className, style, ...rest }, forwardedRef) => {
7
+ const ParticleFx = React.forwardRef(({ density = 100, color = "brand-on-background-weak", size = "2", speed = 0.3, interactive = false, mode = "repel", intensity = 20, opacity = 100, reducedMotion = "auto", children, className, style, ...rest }, forwardedRef) => {
8
8
  const containerRef = useRef(null);
9
9
  const isInViewport = useInViewport(containerRef);
10
10
  const { shouldAnimate } = useReducedMotion(reducedMotion);
@@ -135,6 +135,11 @@ const Particle = React.forwardRef(({ density = 100, color = "brand-on-background
135
135
  }, [color, size, speed, interactive, intensity, opacity, density, mode, shouldAnimate, isInViewport]);
136
136
  return (_jsx(Flex, { ref: containerRef, fill: true, position: "relative", pointerEvents: interactive ? "auto" : "none", className: className, style: { containerType: "size", ...style }, ...rest, children: children }));
137
137
  });
138
- Particle.displayName = "Particle";
139
- export { Particle };
140
- //# sourceMappingURL=Particle.js.map
138
+ ParticleFx.displayName = "ParticleFx";
139
+ /**
140
+ * @deprecated Renamed to `ParticleFx`, in line with the other effects. This
141
+ * name keeps working through 2.x and is removed in 3.0.
142
+ */
143
+ const Particle = ParticleFx;
144
+ export { ParticleFx, Particle };
145
+ //# sourceMappingURL=ParticleFx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticleFx.js","sourceRoot":"","sources":["../../src/components/ParticleFx.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,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AC,CAAC;QAC9E,CAAC;QAED,sCAAsC;QACtC,IAAI,YAAY,EAAE,CAAC;YACjB,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;QAC5D,CAAC;QAED,SAAS,OAAO;YACd,SAAU,CAAC,mBAAmB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YAC7D,IAAI,gBAAgB,IAAI,IAAI,EAAE,CAAC;gBAC7B,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;YACzC,CAAC;YACD,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC;IAEtG,OAAO,CACL,KAAC,IAAI,IACH,GAAG,EAAE,YAAY,EACjB,IAAI,QACJ,QAAQ,EAAC,UAAU,EACnB,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAC5C,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,KACtC,IAAI,YAEP,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC;;;GAGG;AACH,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,9 +1,76 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  import { Row } from ".";
3
+ export type ScrollContainerControlPlacement = "top-start" | "top-center" | "top-end" | "top-between" | "bottom-start" | "bottom-center" | "bottom-end" | "bottom-between";
3
4
  export interface ScrollContainerProps extends React.ComponentProps<typeof Row> {
4
5
  items: React.ReactNode[];
5
- controlPlacement?: "top-start" | "top-center" | "top-end" | "top-between" | "bottom-start" | "bottom-center" | "bottom-end" | "bottom-between";
6
+ controlPlacement?: ScrollContainerControlPlacement;
7
+ /**
8
+ * Wrap around: past the last item the track continues into the first, in the
9
+ * same direction, with no rewind.
10
+ */
11
+ infinite?: boolean;
12
+ /**
13
+ * Markers showing how many items there are and which one is in front.
14
+ * `true` puts them opposite the controls, or name the side yourself.
15
+ */
16
+ markers?: boolean | "top" | "bottom";
17
+ /** Drag the track with a pointer — mouse, pen or finger. */
18
+ draggable?: boolean;
19
+ /** Items moved per control press. */
20
+ step?: number;
21
+ /** Clip the track at its edges instead of letting tiles paint past them. */
22
+ clip?: boolean;
23
+ /**
24
+ * Scale tiles by how far they are from the one in front, so the run has a
25
+ * focus that follows the track as it moves. `true` uses a gentle default;
26
+ * a number is how much smaller each whole step away is, as a fraction —
27
+ * `0.08` makes the neighbour 92%.
28
+ */
29
+ proximity?: boolean | number;
30
+ /**
31
+ * The item to bring to the front, by its index in `items`.
32
+ *
33
+ * Changing it moves the run, by the shorter way round when `infinite`. It
34
+ * is a command rather than a lock: the run still moves on its own from the
35
+ * controls, the markers and a drag, and `onActiveChange` is how the caller
36
+ * keeps up with that. Pair the two to drive the run from your own UI — a
37
+ * row of names beside it, say — without the two disagreeing.
38
+ */
39
+ active?: number;
40
+ /**
41
+ * Called with the index of the item that has come to the front, however it
42
+ * got there. Not called on mount.
43
+ */
44
+ onActiveChange?: (index: number) => void;
6
45
  }
46
+ /**
47
+ * A horizontal run of items with controls, drag, optional wrap-around,
48
+ * optional proximity scaling and optional markers.
49
+ *
50
+ * This moves a track with a transform rather than scrolling a box, which is
51
+ * the decision the rest of the component follows from. The previous version
52
+ * was an `overflow-x: auto` row, and a scroll box cannot do any of the three
53
+ * things asked of a carousel: its contents are clipped at its own edge by
54
+ * definition, so no tile can peek past it; its scroll range has two hard ends,
55
+ * so there is nowhere for a wrap-around to go; and the browser owns the
56
+ * easing, so a drag can only set `scrollLeft` and hope. A transform has none
57
+ * of those limits — the track is laid out once and moved, tiles paint wherever
58
+ * they land, the offset is free to run past either end, and the motion is a
59
+ * CSS transition this component controls.
60
+ *
61
+ * What it gives up is the browser's own scrolling: a trackpad's horizontal
62
+ * gesture no longer moves the track, and that is why `draggable` is on by
63
+ * default and the controls are never hidden. Both are real affordances rather
64
+ * than the invisible one a scroll box relies on.
65
+ *
66
+ * Tiles are unstyled. The wrapper each item sits in used to arrive with
67
+ * `aspectRatio="3/4"`, `border`, `radius="xl"` and a width range already set,
68
+ * so anything that was not a tall bordered portrait card had to override four
69
+ * properties before it could begin — and any prop passed to override them
70
+ * landed on every tile, since that is where the rest props go. The wrapper now
71
+ * contributes only what a track item cannot do without, which is refusing to
72
+ * shrink. Sizing stays with the caller, through those same rest props.
73
+ */
7
74
  declare const ScrollContainer: React.ForwardRefExoticComponent<Omit<ScrollContainerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
75
  export { ScrollContainer };
9
76
  //# sourceMappingURL=ScrollContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../src/components/ScrollContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AACpF,OAAO,EAAU,GAAG,EAAc,MAAM,GAAG,CAAC;AAE5C,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC;IAC5E,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,YAAY,GAAG,gBAAgB,CAAC;CAChJ;AAUD,QAAA,MAAM,eAAe,0GAkGnB,CAAA;AAGF,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../src/components/ScrollContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,GAAG,EAAE,MAAM,GAAG,CAAC;AAGlD,MAAM,MAAM,+BAA+B,GACvC,WAAW,GACX,YAAY,GACZ,SAAS,GACT,aAAa,GACb,cAAc,GACd,eAAe,GACf,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC;IAC5E,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IACrC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAsBD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,eAAe,0GAudpB,CAAC;AAIF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,66 +1,397 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useRef, useState, useEffect, useCallback, forwardRef } from "react";
4
- import { Column, Row, IconButton } from ".";
3
+ import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ import { Column, Flex, IconButton, Row } from ".";
5
+ import styles from "./ScrollContainer.module.scss";
5
6
  const getHorizontalAlignment = (placement) => {
6
- if (placement === "top-start" || placement === "bottom-start")
7
- return "start";
8
- if (placement === "top-end" || placement === "bottom-end")
7
+ if (placement.endsWith("-end"))
9
8
  return "end";
10
- if (placement === "top-center" || placement === "bottom-center")
9
+ if (placement.endsWith("-center"))
11
10
  return "center";
12
- if (placement === "top-between" || placement === "bottom-between")
11
+ if (placement.endsWith("-between"))
13
12
  return "between";
14
13
  return "start";
15
14
  };
16
- const ScrollContainer = forwardRef(({ items, controlPlacement = "top-start", ...flex }, ref) => {
17
- const scrollRef = useRef(null);
18
- const [canScrollLeft, setCanScrollLeft] = useState(false);
19
- const [canScrollRight, setCanScrollRight] = useState(true);
20
- const checkScrollPosition = useCallback(() => {
21
- const element = scrollRef.current;
22
- if (!element)
15
+ /** Past this many pixels a pointer is dragging the track, not clicking a tile. */
16
+ const DRAG_THRESHOLD = 6;
17
+ /** Past this fraction of a tile, let go and the track advances rather than settling back. */
18
+ const COMMIT_RATIO = 0.2;
19
+ /** Past this speed the same is true however short the drag was. */
20
+ const FLICK_VELOCITY = 0.5;
21
+ /** How far a track can be pulled past its own end before it stops following. */
22
+ const RUBBER_BAND = 0.35;
23
+ /** How much smaller each whole step from the front is, when `proximity` is on. */
24
+ const PROXIMITY_FALLOFF = 0.08;
25
+ /** Tiles stop shrinking here, so a long run does not trail off into nothing. */
26
+ const PROXIMITY_FLOOR = 0.72;
27
+ /**
28
+ * A horizontal run of items with controls, drag, optional wrap-around,
29
+ * optional proximity scaling and optional markers.
30
+ *
31
+ * This moves a track with a transform rather than scrolling a box, which is
32
+ * the decision the rest of the component follows from. The previous version
33
+ * was an `overflow-x: auto` row, and a scroll box cannot do any of the three
34
+ * things asked of a carousel: its contents are clipped at its own edge by
35
+ * definition, so no tile can peek past it; its scroll range has two hard ends,
36
+ * so there is nowhere for a wrap-around to go; and the browser owns the
37
+ * easing, so a drag can only set `scrollLeft` and hope. A transform has none
38
+ * of those limits — the track is laid out once and moved, tiles paint wherever
39
+ * they land, the offset is free to run past either end, and the motion is a
40
+ * CSS transition this component controls.
41
+ *
42
+ * What it gives up is the browser's own scrolling: a trackpad's horizontal
43
+ * gesture no longer moves the track, and that is why `draggable` is on by
44
+ * default and the controls are never hidden. Both are real affordances rather
45
+ * than the invisible one a scroll box relies on.
46
+ *
47
+ * Tiles are unstyled. The wrapper each item sits in used to arrive with
48
+ * `aspectRatio="3/4"`, `border`, `radius="xl"` and a width range already set,
49
+ * so anything that was not a tall bordered portrait card had to override four
50
+ * properties before it could begin — and any prop passed to override them
51
+ * landed on every tile, since that is where the rest props go. The wrapper now
52
+ * contributes only what a track item cannot do without, which is refusing to
53
+ * shrink. Sizing stays with the caller, through those same rest props.
54
+ */
55
+ const ScrollContainer = forwardRef(({ items, controlPlacement = "top-start", infinite = false, markers = false, draggable = true, step = 1, clip = false, proximity = false, active, onActiveChange, ...tile }, ref) => {
56
+ const count = items.length;
57
+ const viewportRef = useRef(null);
58
+ const trackRef = useRef(null);
59
+ const [index, setIndex] = useState(0);
60
+ const [tileStep, setTileStep] = useState(0);
61
+ const [perView, setPerView] = useState(1);
62
+ const [dragPx, setDragPx] = useState(0);
63
+ const [animated, setAnimated] = useState(true);
64
+ const [dragging, setDragging] = useState(false);
65
+ /**
66
+ * The last index that still fills the viewport.
67
+ *
68
+ * Without wrap-around there is no reason to advance into empty space once
69
+ * the final tile is already in view, so the end of the run is the last
70
+ * whole screenful rather than the last item.
71
+ */
72
+ const maxIndex = infinite ? Number.POSITIVE_INFINITY : Math.max(0, count - perView);
73
+ /**
74
+ * Wrap-around is three copies of the run with the real one in the middle.
75
+ *
76
+ * Moving off either side of the middle copy lands on a real tile of the
77
+ * neighbouring copy, so the motion is continuous and in the direction of
78
+ * travel. `onTransitionEnd` then puts the index back in range with the
79
+ * transition switched off, which shifts the track by exactly one copy —
80
+ * the same tiles under the same pixels, so nothing moves on screen.
81
+ */
82
+ const rendered = useMemo(() => (infinite && count > 0 ? [...items, ...items, ...items] : items), [infinite, items, count]);
83
+ const origin = infinite ? count : 0;
84
+ const measure = useCallback(() => {
85
+ const viewport = viewportRef.current;
86
+ const track = trackRef.current;
87
+ const first = track?.firstElementChild;
88
+ if (!viewport || !track || !first)
23
89
  return;
24
- const { scrollLeft, scrollWidth, clientWidth } = element;
25
- setCanScrollLeft(scrollLeft > 0);
26
- setCanScrollRight(scrollLeft < scrollWidth - clientWidth - 1);
90
+ const gap = Number.parseFloat(getComputedStyle(track).columnGap) || 0;
91
+ const width = first.offsetWidth + gap;
92
+ setTileStep(width);
93
+ setPerView(width > 0 ? Math.max(1, Math.round(viewport.clientWidth / width)) : 1);
27
94
  }, []);
28
95
  useEffect(() => {
29
- const element = scrollRef.current;
30
- if (!element)
96
+ measure();
97
+ const viewport = viewportRef.current;
98
+ if (!viewport || typeof ResizeObserver === "undefined") {
99
+ window.addEventListener("resize", measure);
100
+ return () => window.removeEventListener("resize", measure);
101
+ }
102
+ // Watches the track's own box too: a tile sized in percentages changes
103
+ // with the viewport, but one sized by its content changes when the
104
+ // content does, and only the track hears about that.
105
+ const observer = new ResizeObserver(measure);
106
+ observer.observe(viewport);
107
+ if (trackRef.current)
108
+ observer.observe(trackRef.current);
109
+ return () => observer.disconnect();
110
+ }, [measure]);
111
+ // A shorter list can leave the index past the end of it.
112
+ useEffect(() => {
113
+ setIndex((current) => Math.min(current, infinite ? current : Math.max(0, count - 1)));
114
+ }, [count, infinite]);
115
+ const go = useCallback((delta) => {
116
+ setAnimated(true);
117
+ setIndex((current) => {
118
+ const next = current + delta;
119
+ return infinite ? next : Math.max(0, Math.min(maxIndex, next));
120
+ });
121
+ }, [infinite, maxIndex]);
122
+ const goTo = useCallback((target) => {
123
+ setAnimated(true);
124
+ setIndex((current) => {
125
+ if (!infinite)
126
+ return Math.max(0, Math.min(maxIndex, target));
127
+ // Take whichever way round is shorter, so a marker near the end of
128
+ // the run does not walk the whole track to reach a neighbour.
129
+ const here = ((current % count) + count) % count;
130
+ const forward = (((target - here) % count) + count) % count;
131
+ return current + (forward <= count - forward ? forward : forward - count);
132
+ });
133
+ }, [count, infinite, maxIndex]);
134
+ /**
135
+ * Which item is in front, counted in `items` rather than in the track.
136
+ *
137
+ * With wrap-around the internal index is free to run past either end —
138
+ * that is what makes the motion continuous — so it is not a number any
139
+ * caller could use. This folds it back into the range of the real run,
140
+ * and it is the only index this component reports or accepts.
141
+ */
142
+ const activeIndex = count > 0 ? ((index % count) + count) % count : 0;
143
+ /**
144
+ * Report the front item, but never on mount.
145
+ *
146
+ * The callback is read through a ref so that a caller passing a fresh
147
+ * arrow function on every render — which is most of them — does not make
148
+ * this fire again for an index that has not moved.
149
+ */
150
+ const onActiveChangeRef = useRef(onActiveChange);
151
+ onActiveChangeRef.current = onActiveChange;
152
+ const reportedRef = useRef(activeIndex);
153
+ useEffect(() => {
154
+ if (reportedRef.current === activeIndex)
155
+ return;
156
+ reportedRef.current = activeIndex;
157
+ onActiveChangeRef.current?.(activeIndex);
158
+ }, [activeIndex]);
159
+ /**
160
+ * Move when `active` changes.
161
+ *
162
+ * Deliberately keyed on `active` alone. Were it to depend on where the run
163
+ * actually is, every drag would be undone a frame after it finished by an
164
+ * effect insisting on the last value the caller passed — the run would
165
+ * fight the pointer. `active` says go here; it does not say stay here.
166
+ */
167
+ // biome-ignore lint/correctness/useExhaustiveDependencies: see above — reacting to the caller's command, not to our own position
168
+ useEffect(() => {
169
+ if (active === undefined || count === 0)
170
+ return;
171
+ goTo(active);
172
+ }, [active, count]);
173
+ /**
174
+ * Put the index back inside the real copy once the motion has finished.
175
+ *
176
+ * Switching the transition off for one frame is what makes the jump
177
+ * invisible: the index changes by a whole copy and the transform changes
178
+ * by exactly one copy's width, so the pixels are identical.
179
+ */
180
+ const handleTransitionEnd = useCallback((event) => {
181
+ // `transitionend` bubbles, so a tile animating its own background would
182
+ // otherwise be read as the track arriving.
183
+ if (event.target !== trackRef.current || event.propertyName !== "transform")
184
+ return;
185
+ if (!infinite || count === 0)
186
+ return;
187
+ if (index >= 0 && index < count)
31
188
  return;
32
- checkScrollPosition();
33
- element.addEventListener("scroll", checkScrollPosition);
34
- window.addEventListener("resize", checkScrollPosition);
35
- return () => {
36
- element.removeEventListener("scroll", checkScrollPosition);
37
- window.removeEventListener("resize", checkScrollPosition);
189
+ setAnimated(false);
190
+ setIndex(((index % count) + count) % count);
191
+ }, [count, index, infinite]);
192
+ /**
193
+ * Put the transition back one frame after the wrap-around jump — but not
194
+ * while a drag is in progress.
195
+ *
196
+ * Without the `dragging` guard this fires for any `animated === false`,
197
+ * and a drag is the other thing that sets it false. One frame in, the
198
+ * transition came back on, and every `dragPx` update after that was eased
199
+ * over `--transition-duration-macro-long` instead of applied: the track
200
+ * crawled toward the pointer at 0.6s a step and never caught up. Measured
201
+ * before the guard — a 164px drag moved the track 46px, in increments of
202
+ * 40, 1, 2, 3. It only looked right on release because the commit works
203
+ * from the raw pointer delta, not from where the track had got to.
204
+ */
205
+ useEffect(() => {
206
+ if (animated || dragging)
207
+ return;
208
+ const frame = requestAnimationFrame(() => setAnimated(true));
209
+ return () => cancelAnimationFrame(frame);
210
+ }, [animated, dragging]);
211
+ const drag = useRef({
212
+ active: false,
213
+ axis: null,
214
+ startX: 0,
215
+ startY: 0,
216
+ lastX: 0,
217
+ lastT: 0,
218
+ velocity: 0,
219
+ moved: false,
220
+ });
221
+ const onPointerDown = (event) => {
222
+ if (!draggable || tileStep === 0 || event.button !== 0)
223
+ return;
224
+ drag.current = {
225
+ active: true,
226
+ axis: null,
227
+ startX: event.clientX,
228
+ startY: event.clientY,
229
+ lastX: event.clientX,
230
+ lastT: event.timeStamp,
231
+ velocity: 0,
232
+ moved: false,
38
233
  };
39
- }, [checkScrollPosition]);
40
- const scroll = (direction) => {
41
- const element = scrollRef.current;
42
- if (!element)
234
+ };
235
+ const onPointerMove = (event) => {
236
+ const state = drag.current;
237
+ if (!state.active)
43
238
  return;
44
- const firstChild = element.firstElementChild;
45
- if (!firstChild)
239
+ const dx = event.clientX - state.startX;
240
+ const dy = event.clientY - state.startY;
241
+ /**
242
+ * Which axis this gesture belongs to is decided once, on the first
243
+ * movement past the threshold, and never revisited.
244
+ *
245
+ * A carousel that takes every gesture takes vertical ones too, and on a
246
+ * phone that means the page stops scrolling wherever a carousel happens
247
+ * to be. Deciding once rather than per-event also stops a diagonal drag
248
+ * from flickering between the two.
249
+ */
250
+ if (state.axis === null) {
251
+ if (Math.abs(dx) < DRAG_THRESHOLD && Math.abs(dy) < DRAG_THRESHOLD)
252
+ return;
253
+ state.axis = Math.abs(dx) > Math.abs(dy) ? "x" : "y";
254
+ if (state.axis === "y") {
255
+ state.active = false;
256
+ return;
257
+ }
258
+ event.currentTarget.setPointerCapture(event.pointerId);
259
+ setAnimated(false);
260
+ setDragging(true);
261
+ }
262
+ const elapsed = event.timeStamp - state.lastT;
263
+ if (elapsed > 0)
264
+ state.velocity = (event.clientX - state.lastX) / elapsed;
265
+ state.lastX = event.clientX;
266
+ state.lastT = event.timeStamp;
267
+ state.moved = true;
268
+ // Past either end there is nothing to show, so the track follows at a
269
+ // fraction of the pointer and springs back on release.
270
+ let offset = dx;
271
+ if (!infinite) {
272
+ const over = index - dx / tileStep;
273
+ if (over < 0)
274
+ offset = dx * RUBBER_BAND;
275
+ else if (over > maxIndex)
276
+ offset = dx * RUBBER_BAND;
277
+ }
278
+ setDragPx(offset);
279
+ };
280
+ const endDrag = (event) => {
281
+ const state = drag.current;
282
+ if (!state.active || state.axis !== "x") {
283
+ drag.current.active = false;
284
+ setDragging(false);
46
285
  return;
47
- const gap = parseFloat(getComputedStyle(element).gap) || 0;
48
- const tileWidth = firstChild.offsetWidth + gap;
49
- const targetScroll = element.scrollLeft + (direction === "right" ? tileWidth : -tileWidth);
50
- element.scrollTo({
51
- left: targetScroll,
52
- behavior: "smooth",
53
- });
286
+ }
287
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
288
+ event.currentTarget.releasePointerCapture(event.pointerId);
289
+ }
290
+ const dx = event.clientX - state.startX;
291
+ const travelled = -dx / tileStep;
292
+ const flicked = Math.abs(state.velocity) > FLICK_VELOCITY;
293
+ const committed = Math.abs(travelled) > COMMIT_RATIO || flicked;
294
+ // A flick is a direction, not a distance: it moves one tile whichever
295
+ // way it was thrown, even if the pointer barely left where it started.
296
+ const delta = committed
297
+ ? Math.abs(travelled) < 1
298
+ ? Math.sign(travelled) || -Math.sign(state.velocity)
299
+ : Math.round(travelled)
300
+ : 0;
301
+ state.active = false;
302
+ setDragging(false);
303
+ setDragPx(0);
304
+ go(delta);
305
+ };
306
+ /**
307
+ * A drag that ends on a tile must not also open it.
308
+ *
309
+ * The pointer goes down and up on the same anchor, so the browser fires a
310
+ * click regardless of how far it travelled in between. This swallows that
311
+ * one click during the capture phase, before it reaches the tile.
312
+ */
313
+ const onClickCapture = (event) => {
314
+ if (!drag.current.moved)
315
+ return;
316
+ drag.current.moved = false;
317
+ event.preventDefault();
318
+ event.stopPropagation();
319
+ };
320
+ const onKeyDown = (event) => {
321
+ if (event.key === "ArrowLeft") {
322
+ event.preventDefault();
323
+ go(-step);
324
+ }
325
+ else if (event.key === "ArrowRight") {
326
+ event.preventDefault();
327
+ go(step);
328
+ }
54
329
  };
330
+ const canGoBack = infinite || index > 0;
331
+ const canGoForward = infinite || index < maxIndex;
55
332
  const isTopPlacement = controlPlacement.startsWith("top");
56
- const horizontalAlignment = getHorizontalAlignment(controlPlacement);
57
- return (_jsxs(Column, { fillWidth: true, gap: "8", direction: isTopPlacement ? "column" : "column-reverse", children: [_jsxs(Row, { fillWidth: true, gap: "8", paddingX: "24", horizontal: horizontalAlignment, children: [_jsx(IconButton, { icon: "chevronLeft", "aria-label": "Scroll backward", onClick: () => scroll("left"), disabled: !canScrollLeft, style: { border: "none" } }), _jsx(IconButton, { icon: "chevronRight", "aria-label": "Scroll forward", onClick: () => scroll("right"), disabled: !canScrollRight, style: { border: "none" } })] }), _jsx(Row, { ref: scrollRef, gap: "8", overflowX: "auto", style: {
58
- scrollSnapType: "x mandatory",
59
- scrollbarWidth: "none",
60
- }, children: items.map((item, index) => (_jsx(Column, { maxWidth: 48, minWidth: 28, border: true, radius: "xl", overflow: "hidden", gap: "8", aspectRatio: "3/4", style: {
61
- scrollSnapAlign: "start",
62
- flexShrink: 0,
63
- }, ...flex, children: item }, index))) })] }));
333
+ const markerSide = markers === true ? (isTopPlacement ? "bottom" : "top") : markers;
334
+ const controls = (_jsxs(Row, { fillWidth: true, gap: "8", horizontal: getHorizontalAlignment(controlPlacement), children: [_jsx(IconButton, { icon: "chevronLeft", "aria-label": "Previous", onClick: () => go(-step), disabled: !canGoBack, style: { border: "none" } }), _jsx(IconButton, { icon: "chevronRight", "aria-label": "Next", onClick: () => go(step), disabled: !canGoForward, style: { border: "none" } })] }));
335
+ const markerRow = markerSide ? (_jsx(Row, { fillWidth: true, gap: "8", horizontal: "center", vertical: "center", paddingY: "4", children: items.map((_, i) => (_jsx("button", { type: "button", className: styles.marker, "data-active": i === activeIndex ? "true" : undefined, "aria-label": `Go to item ${i + 1} of ${count}`, "aria-current": i === activeIndex ? "true" : undefined, onClick: () => goTo(i) }, i))) })) : null;
336
+ /**
337
+ * Where the track really is, between two indices, while it is being moved.
338
+ *
339
+ * The settled `index` is a whole number and would step the scaling from
340
+ * one tile to the next, which is the opposite of what this is for: the
341
+ * point is that a tile grows as you drag it towards the front rather than
342
+ * snapping when it arrives. `dragPx` is the live offset, so dividing it by
343
+ * the tile pitch gives the fraction of a step the track has travelled, and
344
+ * the sign is negative because dragging right shows earlier items.
345
+ */
346
+ const falloff = proximity === true ? PROXIMITY_FALLOFF : typeof proximity === "number" ? proximity : 0;
347
+ const scaling = falloff > 0 && tileStep > 0;
348
+ const front = index - (tileStep > 0 ? dragPx / tileStep : 0);
349
+ const offset = -(index + origin) * tileStep + dragPx;
350
+ return (_jsxs(Column, { ref: ref, fillWidth: true, gap: "8", "aria-roledescription": "carousel", children: [markerSide === "top" && markerRow, isTopPlacement && controls, _jsx(Flex, { ref: viewportRef, fillWidth: true, className: clip ? styles.viewportClipped : styles.viewport, "data-dragging": dragging ? "true" : undefined, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: endDrag, onPointerCancel: endDrag, onClickCapture: onClickCapture, onKeyDown: onKeyDown,
351
+ // The track is the thing you move, so it is the thing that takes
352
+ // focus and answers the arrow keys.
353
+ tabIndex: 0, role: "group", "aria-label": "Items", children: _jsx(Row, { ref: trackRef, gap: "8", className: styles.track, onTransitionEnd: handleTransitionEnd, style: {
354
+ transform: `translate3d(${offset}px, 0, 0)`,
355
+ // Spread rather than `transition: animated ? undefined : "none"`.
356
+ // The style object is passed through before it reaches the DOM
357
+ // and an `undefined` value survives that trip as the string
358
+ // "undefined", which is not a valid transition and overrides the
359
+ // one on the class — so the track moved instantly, no
360
+ // `transitionend` ever fired, and the wrap-around never
361
+ // normalised. An absent key cannot be stringified.
362
+ ...(animated ? {} : { transition: "none" }),
363
+ }, children: rendered.map((item, i) => {
364
+ const scale = scaling
365
+ ? Math.max(PROXIMITY_FLOOR, 1 - falloff * Math.abs(i - origin - front))
366
+ : 1;
367
+ return (_jsx(Column
368
+ // Same as above, and with wrap-around the same item appears in
369
+ // three copies, so its own identity would not be unique either.
370
+ // biome-ignore lint/suspicious/noArrayIndexKey: no stable id exists
371
+ , { className: styles.tile,
372
+ // The one sizing default that stays. A tile with no width of
373
+ // its own sizes to its content, which is fine for a card of
374
+ // text and collapses to nothing for anything that fills its
375
+ // parent — so the out-of-the-box carousel would depend on what
376
+ // was put in it. `minWidth` is a floor, not a shape: content
377
+ // wider than this still sets the tile's width.
378
+ minWidth: 20, "aria-hidden": infinite && (i < origin || i >= origin + count) ? "true" : undefined, ...tile, style: {
379
+ ...tile.style,
380
+ // Only when asked. Off, a tile carries no transform at all,
381
+ // so it never becomes a containing block for whatever the
382
+ // caller positioned inside it.
383
+ ...(scaling
384
+ ? {
385
+ transform: `scale(${scale})`,
386
+ // Follows the pointer during a drag and eases with the
387
+ // track afterwards, the same rule the track itself
388
+ // uses — and for the same reason, spread rather than
389
+ // set to `undefined`.
390
+ ...(animated ? {} : { transition: "none" }),
391
+ }
392
+ : {}),
393
+ }, children: item }, i));
394
+ }) }) }), !isTopPlacement && controls, markerSide === "bottom" && markerRow] }));
64
395
  });
65
396
  ScrollContainer.displayName = "ScrollContainer";
66
397
  export { ScrollContainer };
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollContainer.js","sourceRoot":"","sources":["../../src/components/ScrollContainer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAO5C,MAAM,sBAAsB,GAAG,CAAC,SAAmD,EAAE,EAAE;IACrF,IAAI,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,cAAc;QAAE,OAAO,OAAO,CAAC;IAC9E,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,YAAY;QAAE,OAAO,KAAK,CAAC;IACxE,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,eAAe;QAAE,OAAO,QAAQ,CAAC;IACjF,IAAI,SAAS,KAAK,aAAa,IAAI,SAAS,KAAK,gBAAgB;QAAE,OAAO,SAAS,CAAC;IACpF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,UAAU,CAAuC,CAAC,EAAE,KAAK,EAAE,gBAAgB,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACnI,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAA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