@sesamehr/react-design-system 3.10.1 → 3.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.
@@ -15,7 +15,12 @@ export interface BrandLogoProps extends Omit<React.SVGAttributes<SVGSVGElement>,
15
15
  * dark-mode switch — see the note below.
16
16
  */
17
17
  color?: BrandLogoVariants['color'];
18
- /** 32px tall, or 88px. The width follows the art. */
18
+ /**
19
+ * 20px tall, or 56px: the logo's own height, which is what the board's 32 and
20
+ * 88 frames hold once their padding comes off. The `viewBox` is cropped to
21
+ * the paths, so the element's edges are the art's edges and spacing around it
22
+ * is the caller's.
23
+ */
19
24
  size?: BrandLogoVariants['size'];
20
25
  dataTestid: string;
21
26
  }
@@ -1,9 +1,9 @@
1
1
  const o = {
2
- "ox-brand-logo": "_ox-brand-logo_51b7b_2",
3
- "ox-brand-logo--md": "_ox-brand-logo--md_51b7b_2",
4
- "ox-brand-logo--lg": "_ox-brand-logo--lg_51b7b_2",
5
- "ox-brand-logo--dark": "_ox-brand-logo--dark_51b7b_2",
6
- "ox-brand-logo--light": "_ox-brand-logo--light_51b7b_2"
2
+ "ox-brand-logo": "_ox-brand-logo_1q2c2_2",
3
+ "ox-brand-logo--md": "_ox-brand-logo--md_1q2c2_2",
4
+ "ox-brand-logo--lg": "_ox-brand-logo--lg_1q2c2_2",
5
+ "ox-brand-logo--dark": "_ox-brand-logo--dark_1q2c2_2",
6
+ "ox-brand-logo--light": "_ox-brand-logo--light_1q2c2_2"
7
7
  };
8
8
  export {
9
9
  o as default
@@ -15,6 +15,23 @@
15
15
  * Composed from the vector groups Figma exports, each placed with the offset
16
16
  * the group has inside its variant frame. Regenerated rather than edited: the
17
17
  * numbers are measurements, and a hand-nudged logo is a wrong logo.
18
+ *
19
+ * **The viewBox is the ink, not the frame Figma exports.** Every variant frame
20
+ * on the board is padded — 8.74 x 5.82 around the lockup, 5.82 all round the
21
+ * mark — and a regeneration hands that frame over as the box. Baked in, it is
22
+ * padding nobody asked for: a 32px-tall element drew 20px of logo inside 12px
23
+ * of air, its edges sat nowhere near the art, and anything positioning the logo
24
+ * positioned the air instead. So the `viewBox` is cropped to the measured
25
+ * bounds of the paths, while the group offsets are left exactly as exported —
26
+ * which is why the box no longer starts at `0 0`. Spacing is the caller's to
27
+ * add; a logo flush to its own box is the only one a caller can place.
28
+ * The component's own test re-measures the curves and fails if the frame comes
29
+ * back.
30
+ *
31
+ * Note what cropping does *not* mean: the logo is not drawn any larger to fill
32
+ * the space the padding used to take. The stylesheet's two heights moved down
33
+ * with the box, from the board's frame heights to the heights of the drawing
34
+ * inside them — see the component.
18
35
  */
19
36
  export interface BrandLogoArt {
20
37
  viewBox: string;
@@ -23,7 +40,11 @@ export interface BrandLogoArt {
23
40
  paths: string[];
24
41
  }[];
25
42
  }
26
- /** Symbol plus the "sesame" wordmark: 113.6 x 32, which is 3.55:1. */
43
+ /** Symbol plus the "sesame" wordmark: 96.12 x 20.39 of ink, which is 4.714:1. */
27
44
  export declare const BRAND_LOGO_FULL: BrandLogoArt;
28
- /** The symbol on its own, square. */
45
+ /**
46
+ * The symbol on its own. Square to four decimals — the ink measures
47
+ * 20.3629 x 20.3636, and the box takes the taller of the two on both axes so
48
+ * that "the mark is square" stays literally true for a caller sizing it.
49
+ */
29
50
  export declare const BRAND_LOGO_MARK: BrandLogoArt;
@@ -1,5 +1,5 @@
1
1
  const C = {
2
- viewBox: "0 0 113.6 32",
2
+ viewBox: "8.738 5.8249 96.1233 20.3904",
3
3
  groups: [
4
4
  {
5
5
  transform: "translate(8.738 5.8249)",
@@ -26,7 +26,7 @@ const C = {
26
26
  }
27
27
  ]
28
28
  }, L = {
29
- viewBox: "0 0 32 32",
29
+ viewBox: "5.8174 5.818 20.3636 20.3636",
30
30
  groups: [
31
31
  {
32
32
  transform: "translate(5.8174 5.818)",
@@ -3,5 +3,7 @@ export interface ComboboxContentProps extends Omit<React.ComponentPropsWithoutRe
3
3
  side?: 'top' | 'right' | 'bottom' | 'left';
4
4
  sideOffset?: number;
5
5
  align?: 'start' | 'center' | 'end';
6
+ /** Called when the end of the list comes into view. */
7
+ onReachEnd?: () => void;
6
8
  }
7
9
  export declare const ComboboxContent: import('react').ForwardRefExoticComponent<ComboboxContentProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,78 +1,90 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import * as c from "@radix-ui/react-popover";
3
- import { Command as h, CommandInput as v, CommandList as N } from "cmdk";
4
- import { forwardRef as P, useRef as L } from "react";
3
+ import { Command as P, CommandInput as S, CommandList as L } from "cmdk";
4
+ import { forwardRef as F, useRef as j, useState as A } from "react";
5
5
  /* empty css */
6
- import { useComboboxContext as F } from "./context.js";
7
- import { Surface as S } from "../../../internal/Surface/Surface.js";
8
- import { ListboxViewport as j } from "../../../internal/Listbox/ListboxViewport.js";
9
- import { Scrollbar as A } from "../../../Layout/Scrollbar/Scrollbar.js";
10
- const D = 16, I = P(
6
+ import { useComboboxContext as D } from "./context.js";
7
+ import { useReachEnd as I } from "./useReachEnd.js";
8
+ import { Surface as O } from "../../../internal/Surface/Surface.js";
9
+ import { ListboxViewport as R } from "../../../internal/Listbox/ListboxViewport.js";
10
+ import { Scrollbar as k } from "../../../Layout/Scrollbar/Scrollbar.js";
11
+ const w = 16, G = F(
11
12
  ({
12
- children: n,
13
+ children: d,
13
14
  side: b = "bottom",
14
- sideOffset: d = 4,
15
- align: p = "start",
16
- onInteractOutside: m,
17
- onEscapeKeyDown: i,
18
- ...x
19
- }, f) => {
20
- const { search: e, cancelOpenEdit: u, skipFilter: C } = F(), l = L(null);
21
- return /* @__PURE__ */ r(c.Portal, { children: /* @__PURE__ */ r(
15
+ sideOffset: p = 4,
16
+ align: x = "start",
17
+ onInteractOutside: e,
18
+ onEscapeKeyDown: m,
19
+ onReachEnd: a,
20
+ ...f
21
+ }, u) => {
22
+ const { search: s, cancelOpenEdit: h, skipFilter: C } = D(), i = j(null), [v, N] = A(null);
23
+ return I(i, v, a), /* @__PURE__ */ r(c.Portal, { children: /* @__PURE__ */ r(
22
24
  c.Content,
23
25
  {
24
- ref: f,
26
+ ref: u,
25
27
  asChild: !0,
26
28
  "data-slot": "combobox-content",
27
29
  side: b,
28
- sideOffset: d,
29
- collisionPadding: D,
30
- align: p,
30
+ sideOffset: p,
31
+ collisionPadding: w,
32
+ align: x,
31
33
  onOpenAutoFocus: (o) => o.preventDefault(),
32
34
  onInteractOutside: (o) => {
33
- var a;
35
+ var n;
34
36
  const t = o.target;
35
- (a = t == null ? void 0 : t.closest) != null && a.call(t, '[data-slot="combobox"]') && o.preventDefault(), m == null || m(o);
37
+ (n = t == null ? void 0 : t.closest) != null && n.call(t, '[data-slot="combobox"]') && o.preventDefault(), e == null || e(o);
36
38
  },
37
39
  onEscapeKeyDown: (o) => {
38
- u() && o.preventDefault(), i == null || i(o);
40
+ h() && o.preventDefault(), m == null || m(o);
39
41
  },
40
- ...x,
41
- children: /* @__PURE__ */ s(S, { children: [
42
- /* @__PURE__ */ s(
43
- h,
42
+ ...f,
43
+ children: /* @__PURE__ */ l(O, { children: [
44
+ /* @__PURE__ */ l(
45
+ P,
44
46
  {
45
47
  shouldFilter: !C,
46
- value: e,
48
+ value: s,
47
49
  className: "ox-combobox-command",
48
50
  children: [
49
51
  /* @__PURE__ */ r(
50
- v,
52
+ S,
51
53
  {
52
- value: e,
54
+ value: s,
53
55
  "aria-hidden": !0,
54
56
  tabIndex: -1,
55
57
  className: "ox-combobox-hidden-input"
56
58
  }
57
59
  ),
58
- /* @__PURE__ */ r(N, { asChild: !0, children: /* @__PURE__ */ r(
59
- j,
60
+ /* @__PURE__ */ r(L, { asChild: !0, children: /* @__PURE__ */ l(
61
+ R,
60
62
  {
61
- ref: l,
63
+ ref: i,
62
64
  className: "ox-combobox-viewport",
63
- children: n
65
+ children: [
66
+ d,
67
+ a && /* @__PURE__ */ r(
68
+ "div",
69
+ {
70
+ ref: N,
71
+ className: "ox-combobox-reach-end",
72
+ "aria-hidden": !0
73
+ }
74
+ )
75
+ ]
64
76
  }
65
77
  ) })
66
78
  ]
67
79
  }
68
80
  ),
69
- /* @__PURE__ */ r(A, { port: l, dataTestid: "combobox-scrollbar" })
81
+ /* @__PURE__ */ r(k, { port: i, dataTestid: "combobox-scrollbar" })
70
82
  ] })
71
83
  }
72
84
  ) });
73
85
  }
74
86
  );
75
- I.displayName = "OxComboboxContent";
87
+ G.displayName = "OxComboboxContent";
76
88
  export {
77
- I as ComboboxContent
89
+ G as ComboboxContent
78
90
  };
@@ -0,0 +1,22 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Reports that the end of a scrolling list has come into view, once per
4
+ * arrival.
5
+ *
6
+ * An `IntersectionObserver` and not a scroll listener because of the re-arm: a
7
+ * listener has to be disarmed after firing or it fires on every frame the user
8
+ * sits at the bottom, and then something has to decide when to arm it again.
9
+ * The observer re-fires on the transition for free.
10
+ *
11
+ * The sentinel arrives as an element and the port as a ref, which is the one
12
+ * place this diverges from the Vue composable. It has to: the list mounts when
13
+ * it opens, long after this hook first runs, and a ref filling in is not a
14
+ * render — so a hook waiting on `sentinel.current` waits for ever. A callback
15
+ * ref behind state is what turns the element arriving into something the effect
16
+ * can hang off. By the time it has, `port.current` is set too: both land in the
17
+ * same commit.
18
+ *
19
+ * @param port The scrolling element, which is also the observer's root.
20
+ * @param sentinel An empty element at the end of the list, inside `port`.
21
+ */
22
+ export declare function useReachEnd(port: RefObject<HTMLElement | null>, sentinel: HTMLElement | null, reached: (() => void) | undefined): void;
@@ -0,0 +1,33 @@
1
+ import { useRef as i, useEffect as p } from "react";
2
+ const I = 88;
3
+ function O(s, u, r) {
4
+ const o = i(r);
5
+ p(() => {
6
+ o.current = r;
7
+ }, [r]);
8
+ const f = r !== void 0;
9
+ p(() => {
10
+ const n = s.current, c = u;
11
+ if (!f || !n || !c) return;
12
+ let d = n.scrollHeight, e = null;
13
+ const x = () => {
14
+ e == null || e.disconnect(), e == null || e.observe(c);
15
+ };
16
+ typeof IntersectionObserver < "u" && (e = new IntersectionObserver(
17
+ (b) => {
18
+ var l;
19
+ b.some((g) => g.isIntersecting) && ((l = o.current) == null || l.call(o));
20
+ },
21
+ { root: n, rootMargin: `0px 0px ${I}px 0px` }
22
+ ), e.observe(c));
23
+ const t = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
24
+ n.scrollHeight <= d || (d = n.scrollHeight, x());
25
+ });
26
+ return t == null || t.observe(n, { childList: !0, subtree: !0 }), () => {
27
+ e == null || e.disconnect(), t == null || t.disconnect();
28
+ };
29
+ }, [s, u, f]);
30
+ }
31
+ export {
32
+ O as useReachEnd
33
+ };