@exsto/ds 0.0.1-rc.3 → 0.0.1-rc.4

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.
@@ -1,7 +1,14 @@
1
1
  import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area';
2
2
  import { ComponentProps, RefObject } from 'react';
3
- /** When the bar shows: 'hover' on area hover or while scrolling (default), 'scroll' only while scrolling, 'always' permanent. */
3
+ /**
4
+ * When the bar shows: 'hover' on area hover or while scrolling (default),
5
+ * 'scroll' only while scrolling, 'always' permanent. In every mode the bar is
6
+ * mounted only while that axis actually overflows, so 'always' means "always
7
+ * when there is something to scroll", never a bar on a list that fits.
8
+ */
4
9
  export type TScrollbarVisibility = 'hover' | 'scroll' | 'always';
10
+ /** Surface the edge fades blend into. */
11
+ export type TScrollAreaFadeFrom = 'card' | 'background' | 'sidebar' | 'popover';
5
12
  export interface IScrollBarProps extends ComponentProps<typeof BaseScrollArea.Scrollbar> {
6
13
  visibility?: TScrollbarVisibility;
7
14
  }
@@ -11,11 +18,27 @@ export interface IScrollAreaProps extends ComponentProps<typeof BaseScrollArea.R
11
18
  orientation?: 'horizontal' | 'vertical' | 'both';
12
19
  /** Scrollbar reveal behavior (mirrors the Radix ScrollArea `type` prop). */
13
20
  type?: TScrollbarVisibility;
14
- viewPortId?: string;
21
+ /** Edge fades hinting at clipped content; each one shows only while its own edge hides something. */
22
+ fade?: boolean;
23
+ /** Surface the fades blend into: 'card' inside a card (default), 'background' page-level, 'sidebar', 'popover' for popup lists. */
24
+ fadeFrom?: TScrollAreaFadeFrom;
25
+ /** Places both bars, for a host that gives them a gutter of their own (a sidebar menu). */
26
+ scrollbarClassName?: string;
27
+ viewportId?: string;
15
28
  /** Access to the scrollable viewport (e.g. to reset scroll position on route changes). */
29
+ viewportRef?: RefObject<HTMLDivElement | null>;
30
+ viewportClassName?: string;
31
+ /** Published on the viewport as data-scroll-restoration-id, for a router that restores scroll position. */
32
+ scrollRestorationId?: string;
33
+ /** @deprecated Use `viewportId`. */
34
+ viewPortId?: string;
35
+ /** @deprecated Use `viewportRef`. */
16
36
  viewPortRef?: RefObject<HTMLDivElement | null>;
37
+ /** @deprecated Use `viewportClassName`. */
17
38
  viewPortClassName?: string;
39
+ /** Places the vertical bar only; `scrollbarClassName` covers both. */
18
40
  scrollVerticalClassName?: string;
41
+ /** Places the horizontal bar only; `scrollbarClassName` covers both. */
19
42
  scrollHorizontalClassName?: string;
20
43
  }
21
44
  /**
@@ -24,9 +47,20 @@ export interface IScrollAreaProps extends ComponentProps<typeof BaseScrollArea.R
24
47
  * rule: wide/tall content (tables, lists, code) always goes through this, never a bare
25
48
  * overflow-* utility.
26
49
  *
50
+ * Cap the height with a plain class on the component itself, e.g.
51
+ * `<ScrollArea className="max-h-88">`. The viewport picks the cap up through
52
+ * `max-h-inherit`, which matters because the viewport is the element that actually
53
+ * scrolls: a cap that lands only on the root leaves tall content spilling out
54
+ * underneath with no scrollbar, and that reads as a working height right up until the
55
+ * content outgrows it.
56
+ *
57
+ * `fade` draws an edge fade on each side that is currently hiding content, rather than
58
+ * always painting one: a permanent fade is a lie half the time, dimming the last row
59
+ * that fits and promising more below when the reader is already at the end. The static
60
+ * faded-* utilities in @edyn/theme/utilities.css are the other tool, for DECORATIVE
61
+ * edges that do not track scroll position.
62
+ *
27
63
  * The viewport publishes its size as --scroll-area-width/--scroll-area-height CSS vars
28
- * so children can size against the visible area. Edge fades are NOT built in; apply
29
- * the faded-* utilities from @edyn/theme/utilities.css on the ScrollArea (it is the
30
- * positioning root) where a fade is wanted.
64
+ * so children can size against the visible area.
31
65
  */
32
- export declare const ScrollArea: ({ className, children, orientation, type, viewPortId, viewPortRef, viewPortClassName, scrollVerticalClassName, scrollHorizontalClassName, ...props }: IScrollAreaProps) => import('react').JSX.Element;
66
+ export declare const ScrollArea: ({ className, children, orientation, type, fade, fadeFrom, scrollbarClassName, viewportId, viewportRef, viewportClassName, scrollRestorationId, viewPortId, viewPortRef, viewPortClassName, scrollVerticalClassName, scrollHorizontalClassName, ...props }: IScrollAreaProps) => import('react').JSX.Element;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Orientation styling for Separator, and a guard for the bug class behind it.
3
+ *
4
+ * Base UI publishes orientation as `data-orientation="horizontal|vertical"`. It
5
+ * has no `data-horizontal` / `data-vertical` attribute, so a bare
6
+ * `data-vertical:` variant compiles to a selector that matches nothing: the
7
+ * component looks styled, and silently is not. A vertical Separator came out
8
+ * with no width at all that way.
9
+ *
10
+ * PATH TAKEN: happy-dom renders no layout, so this asserts the class the
11
+ * component chose per orientation plus the attribute Base UI emitted, and the
12
+ * second block greps the package for the dead variant form.
13
+ */
14
+ export {};
@@ -1,2 +1,16 @@
1
1
  import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
2
+ /**
3
+ * Hairline rule between content, announced as `role="separator"`.
4
+ *
5
+ * The orientation styles are branched in TS rather than written as
6
+ * `data-[orientation=*]:` variants on purpose. A variant carries two
7
+ * selectors' worth of specificity, so it would outrank a plain class passed in
8
+ * by the caller: the sidebar's own `w-auto` lost to `w-full` that way. Branching
9
+ * emits one plain class per axis, which `cn` can dedupe and a caller can
10
+ * override.
11
+ *
12
+ * Vertical uses `self-stretch` instead of `h-full`: a percentage height needs a
13
+ * definite parent, and the usual host is an `items-center` row whose height
14
+ * comes from its content.
15
+ */
2
16
  export declare const Separator: ({ className, orientation, ...props }: SeparatorPrimitive.Props) => import('react').JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exsto/ds",
3
- "version": "0.0.1-rc.3",
3
+ "version": "0.0.1-rc.4",
4
4
  "description": "The eDynamix design system: React components, design tokens, and optional web components.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [