22
33import "@opal/components/divider/styles.css" ;
44import { useState , useCallback } from "react" ;
5- import type { OrientationVariants , Spacing , RichStr } from "@opal/types" ;
5+ import type { OrientationVariants , RichStr } from "@opal/types" ;
66import { Button , Text } from "@opal/components" ;
77import { SvgChevronRight } from "@opal/icons" ;
88import { Interactive } from "@opal/core" ;
@@ -27,6 +27,15 @@ interface DividerSharedProps {
2727 children ?: never ;
2828}
2929
30+ /**
31+ * The insets a divider offers, as spacing steps (`N / 4` rem).
32+ *
33+ * A closed set rather than an open number: a divider's inset is a shared rhythm
34+ * across the surfaces it separates, so an arbitrary step would only ever put one
35+ * divider out of step with the rest.
36+ */
37+ type DividerSpacing = 0 | 0.5 | 1 | 2 | 4 | 6 ;
38+
3039/** Plain line — no title, no description. */
3140type DividerBareProps = Omit <
3241 DividerSharedProps ,
@@ -35,9 +44,9 @@ type DividerBareProps = Omit<
3544 /** Orientation of the line. Default: `"horizontal"`. */
3645 orientation ?: OrientationVariants ;
3746 /** Padding along the line direction, as a spacing step. Default: `2` (0.5rem). */
38- paddingParallel ?: Spacing ;
47+ paddingParallel ?: DividerSpacing ;
3948 /** Padding perpendicular to the line, as a spacing step. Default: `1` (0.25rem). */
40- paddingPerpendicular ?: Spacing ;
49+ paddingPerpendicular ?: DividerSpacing ;
4150} ;
4251
4352/** Line with a title to the left. */
@@ -192,4 +201,4 @@ function FoldableDivider({
192201 ) ;
193202}
194203
195- export { Divider , type DividerProps } ;
204+ export { Divider , type DividerProps , type DividerSpacing } ;
0 commit comments