@yahoo/uds 3.141.0 → 3.142.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.
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/automated-config/dist/utils/index.cjs +1 -1
- package/dist/automated-config/dist/utils/index.js +1 -1
- package/dist/components/Divider/Divider.cjs +86 -5
- package/dist/components/Divider/Divider.d.cts +15 -4
- package/dist/components/Divider/Divider.d.ts +15 -4
- package/dist/components/Divider/Divider.js +88 -7
- package/dist/components/Divider/DividerLabel.cjs +30 -0
- package/dist/components/Divider/DividerLabel.d.cts +18 -0
- package/dist/components/Divider/DividerLabel.d.ts +18 -0
- package/dist/components/Divider/DividerLabel.js +28 -0
- package/dist/components/Divider/DividerLine.cjs +41 -0
- package/dist/components/Divider/DividerLine.d.cts +19 -0
- package/dist/components/Divider/DividerLine.d.ts +19 -0
- package/dist/components/Divider/DividerLine.js +39 -0
- package/dist/components/Divider/index.cjs +4 -0
- package/dist/components/Divider/index.d.cts +4 -1
- package/dist/components/Divider/index.d.ts +4 -1
- package/dist/components/Divider/index.js +3 -1
- package/dist/components/Divider/types.cjs +1 -0
- package/dist/components/Divider/types.d.cts +38 -0
- package/dist/components/Divider/types.d.ts +38 -0
- package/dist/components/Divider/types.js +1 -0
- package/dist/components/Divider/utils.cjs +33 -0
- package/dist/components/Divider/utils.d.cts +11 -0
- package/dist/components/Divider/utils.d.ts +11 -0
- package/dist/components/Divider/utils.js +29 -0
- package/dist/components/client/Menu/Menu.Divider.cjs +2 -2
- package/dist/components/client/Menu/Menu.Divider.js +2 -2
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
- package/dist/components/index.cjs +6 -0
- package/dist/components/index.d.cts +3 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +5 -1
- package/dist/index.cjs +5 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -2
- package/dist/styles/styler.d.cts +3 -3
- package/dist/styles/styler.d.ts +3 -3
- package/dist/tailwind/dist/automated-config/dist/utils/index.cjs +1 -1
- package/dist/tailwind/dist/automated-config/dist/utils/index.js +1 -1
- package/dist/tailwind/dist/automated-config/dist/utils/index.js.map +1 -1
- package/dist/tokens/automation/index.cjs +1 -1
- package/dist/tokens/automation/index.js +1 -1
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/uds/generated/componentData.cjs +1418 -1416
- package/dist/uds/generated/componentData.js +1415 -1413
- package/dist/uds/generated/tailwindPurge.cjs +1688 -50
- package/dist/uds/generated/tailwindPurge.js +1688 -50
- package/generated/componentData.json +1826 -1813
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +1 -1
- package/dist/components/Divider/DividerCore.cjs +0 -83
- package/dist/components/Divider/DividerCore.d.cts +0 -22
- package/dist/components/Divider/DividerCore.d.ts +0 -22
- package/dist/components/Divider/DividerCore.js +0 -81
- package/dist/components/Divider/DividerInternal.cjs +0 -31
- package/dist/components/Divider/DividerInternal.d.cts +0 -13
- package/dist/components/Divider/DividerInternal.d.ts +0 -13
- package/dist/components/Divider/DividerInternal.js +0 -29
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.cjs";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -11,8 +11,8 @@ import { SelectedConfigurableProperty } from "../properties.js";
|
|
|
11
11
|
* @returns A Record of layer names to their properties, or null if no properties are found
|
|
12
12
|
*/
|
|
13
13
|
declare function getConfigVariantProperties(variant?: VariantConfig): {
|
|
14
|
-
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
15
|
-
root: Readonly<Record<string, SelectedConfigurableProperty<"
|
|
14
|
+
[x: string]: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
15
|
+
root: Readonly<Record<string, SelectedConfigurableProperty<"textTransform" | "fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "letterSpacing" | "backgroundColor" | "borderWidth" | "underlineWidth" | "strokeWidth" | "borderRadius" | "borderRadiusVar" | "borderColor" | "underlineColor" | "stroke" | "buttonSize" | "buttonVariant" | "fontVariationSettings" | "gap" | "color" | "opacity" | "fillOpacity" | "iconSize" | "spacing" | "iconVariant" | "horizontalMargin" | "bottomMargin" | "spacingHorizontal" | "spacingVertical" | "spacingTop" | "spacingBottom" | "textVariant" | "textDecorationLine" | "shadow" | "shadowVar" | "insetShadow" | "bannerInnerShadow" | "height" | "width" | "scaleEffect" | "backdropBlur" | "blurBackgroundColor" | "blurBackgroundColorFallback" | "scrimBackgroundColor" | "scrimOpacity", string, readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases" | "elevationAliases")[] | readonly ("elevationAliases" | "borderWidths" | "spacingAliases")[] | readonly "borderRadii"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "elevationAliases" | "linePaletteColors")[] | readonly "buttonSizes"[] | readonly "buttonVariantsFlat"[] | readonly "textVariants"[] | readonly "spacingAliases"[] | readonly ("spectrumColors" | "alwaysPaletteAliases" | "foregroundPaletteColors")[] | readonly "opacitySteps"[] | readonly "iconSizes"[] | readonly "iconVariants"[] | readonly "textDecorationLines"[] | readonly ("elevationAliases" | "shadowVariants" | "shadowVariantConfig")[] | readonly ("shadowVariantConfig" | "shadowVariantsWithInvert")[] | readonly "bannerInnerShadowOptions"[] | readonly "scaleEffects"[] | readonly "positiveIntegers"[] | readonly ("backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases")[], readonly (readonly unknown[])[]>>>;
|
|
16
16
|
} | null; //#endregion
|
|
17
17
|
//#endregion
|
|
18
18
|
export { getConfigVariantProperties };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
const require_index = require("../../../css-tokens/dist/index.cjs");
|
|
4
4
|
const require_properties = require("../properties.cjs");
|
|
5
|
+
const require_generateDefaultClassName = require("./generateDefaultClassName.cjs");
|
|
5
6
|
const require_generateSchemaKey = require("./generateSchemaKey.cjs");
|
|
6
7
|
const require_variantConfigGuards = require("./variantConfigGuards.cjs");
|
|
7
8
|
require("./buildConfigSchema.cjs");
|
|
@@ -9,7 +10,6 @@ require("./cartesianProduct.cjs");
|
|
|
9
10
|
require("./subcomponents.cjs");
|
|
10
11
|
require("./coalesceConfigVariant.cjs");
|
|
11
12
|
require("./defaults.cjs");
|
|
12
|
-
const require_generateDefaultClassName = require("./generateDefaultClassName.cjs");
|
|
13
13
|
require("./generateKeyFromFlatConfigPath.cjs");
|
|
14
14
|
require("./getConfigVariantComponentStatesMatrix.cjs");
|
|
15
15
|
require("./getConfigVariantProperties.cjs");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST } from "../../../css-tokens/dist/index.js";
|
|
3
3
|
import { configurableProperties } from "../properties.js";
|
|
4
|
+
import { generateDefaultClassName } from "./generateDefaultClassName.js";
|
|
4
5
|
import { generateSchemaKey } from "./generateSchemaKey.js";
|
|
5
6
|
import { isVariantConfigWithComponentStates, isVariantConfigWithProperties } from "./variantConfigGuards.js";
|
|
6
7
|
import "./buildConfigSchema.js";
|
|
@@ -8,7 +9,6 @@ import "./cartesianProduct.js";
|
|
|
8
9
|
import "./subcomponents.js";
|
|
9
10
|
import "./coalesceConfigVariant.js";
|
|
10
11
|
import "./defaults.js";
|
|
11
|
-
import { generateDefaultClassName } from "./generateDefaultClassName.js";
|
|
12
12
|
import "./generateKeyFromFlatConfigPath.js";
|
|
13
13
|
import "./getConfigVariantComponentStatesMatrix.js";
|
|
14
14
|
import "./getConfigVariantProperties.js";
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
-
const
|
|
4
|
+
const require_styles_styler = require("../../styles/styler.cjs");
|
|
5
|
+
const require_components_Box = require("../Box.cjs");
|
|
6
|
+
const require_components_HStack = require("../HStack.cjs");
|
|
7
|
+
const require_components_VStack = require("../VStack.cjs");
|
|
8
|
+
const require_components_Divider_DividerLabel = require("./DividerLabel.cjs");
|
|
9
|
+
const require_components_Divider_DividerLine = require("./DividerLine.cjs");
|
|
10
|
+
const require_components_Divider_utils = require("./utils.cjs");
|
|
5
11
|
let react = require("react");
|
|
6
12
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
13
|
//#region src/components/Divider/Divider.tsx
|
|
14
|
+
const ORIENTATION_WIDTH_MAP = {
|
|
15
|
+
horizontal: "w-full",
|
|
16
|
+
vertical: ""
|
|
17
|
+
};
|
|
8
18
|
/**
|
|
9
19
|
* **📦 A divider component that can be used to visually separate components**
|
|
10
20
|
*
|
|
11
21
|
* @description
|
|
12
22
|
* The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
|
|
13
23
|
*
|
|
24
|
+
* For custom composition, import `DividerLine` and `DividerLabel` from the same package entrypoint
|
|
25
|
+
* and compose them inside `Divider`, `HStack`, or `VStack`.
|
|
26
|
+
*
|
|
14
27
|
* @example
|
|
15
28
|
* ```tsx
|
|
16
|
-
* import { Divider } from '@yahoo/uds';
|
|
29
|
+
* import { Divider, DividerLabel, DividerLine } from '@yahoo/uds';
|
|
17
30
|
*
|
|
18
31
|
* // Default primary horizontal divider. Similar to <hr />
|
|
19
32
|
* <Divider />
|
|
@@ -26,19 +39,87 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
26
39
|
*
|
|
27
40
|
* // A vertical divider with the tertiary styling.
|
|
28
41
|
* <Divider vertical variant="tertiary" />
|
|
42
|
+
*
|
|
43
|
+
* // Manual composition.
|
|
44
|
+
* <Divider>
|
|
45
|
+
* <DividerLine />
|
|
46
|
+
* <DividerLabel>Section</DividerLabel>
|
|
47
|
+
* <DividerLine />
|
|
48
|
+
* </Divider>
|
|
29
49
|
* ```
|
|
30
50
|
*
|
|
31
51
|
* @usage
|
|
32
52
|
* - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
|
|
53
|
+
* - Use `DividerLine` and `DividerLabel` when a layout needs custom composition.
|
|
33
54
|
*
|
|
34
55
|
* @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
|
|
35
56
|
*
|
|
36
57
|
* @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
|
|
37
58
|
*/
|
|
38
|
-
const Divider = (0, react.forwardRef)(function Divider(
|
|
39
|
-
|
|
59
|
+
const Divider = (0, react.forwardRef)(function Divider({ variant = "primary", vertical = false, contentPosition = "center", className, slotProps, children, gap, ...boxProps }, ref) {
|
|
60
|
+
const direction = vertical ? "vertical" : "horizontal";
|
|
61
|
+
const InternalComponent = vertical ? require_components_VStack.VStack : require_components_HStack.HStack;
|
|
62
|
+
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
63
|
+
const { className: labelClassName, variant: labelTextVariant, ...labelSlotProps } = slotProps?.label ?? {};
|
|
64
|
+
const { className: lineClassName, ...lineSlotProps } = slotProps?.line ?? {};
|
|
65
|
+
const classNames = (0, react.useMemo)(() => ({
|
|
66
|
+
root: require_styles_styler.cx(ORIENTATION_WIDTH_MAP[direction], variant !== "inherit" && require_styles_styler.getStyles({ dividerVariantRoot: variant }), className, rootClassName),
|
|
67
|
+
label: labelClassName,
|
|
68
|
+
line: lineClassName
|
|
69
|
+
}), [
|
|
70
|
+
className,
|
|
71
|
+
direction,
|
|
72
|
+
labelClassName,
|
|
73
|
+
lineClassName,
|
|
74
|
+
rootClassName,
|
|
75
|
+
variant
|
|
76
|
+
]);
|
|
77
|
+
if (children !== void 0 && children !== null && children !== false) {
|
|
78
|
+
const content = require_components_Divider_utils.shouldWrapInLabel(children) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLabel.DividerLabel, {
|
|
79
|
+
className: classNames.label,
|
|
80
|
+
textVariant: labelTextVariant,
|
|
81
|
+
variant,
|
|
82
|
+
...labelSlotProps,
|
|
83
|
+
children
|
|
84
|
+
}) : require_components_Divider_utils.renderManualChildren(children, variant, vertical);
|
|
85
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalComponent, {
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
className: classNames.root,
|
|
88
|
+
flex: "1",
|
|
89
|
+
gap,
|
|
90
|
+
ref,
|
|
91
|
+
...boxProps,
|
|
92
|
+
...rootSlotProps,
|
|
93
|
+
children: require_components_Divider_utils.hasManualLine(children) ? content : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
94
|
+
contentPosition !== "start" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLine.DividerLine, {
|
|
95
|
+
className: classNames.line,
|
|
96
|
+
variant,
|
|
97
|
+
vertical,
|
|
98
|
+
...lineSlotProps
|
|
99
|
+
}),
|
|
100
|
+
content,
|
|
101
|
+
contentPosition !== "end" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLine.DividerLine, {
|
|
102
|
+
className: classNames.line,
|
|
103
|
+
variant,
|
|
104
|
+
vertical,
|
|
105
|
+
...lineSlotProps
|
|
106
|
+
})
|
|
107
|
+
] })
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
111
|
+
className: classNames.root,
|
|
112
|
+
display: "flex",
|
|
113
|
+
flex: "none",
|
|
40
114
|
ref,
|
|
41
|
-
...
|
|
115
|
+
...boxProps,
|
|
116
|
+
...rootSlotProps,
|
|
117
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Divider_DividerLine.DividerLine, {
|
|
118
|
+
className: classNames.line,
|
|
119
|
+
variant,
|
|
120
|
+
vertical,
|
|
121
|
+
...lineSlotProps
|
|
122
|
+
})
|
|
42
123
|
});
|
|
43
124
|
});
|
|
44
125
|
Divider.displayName = "Divider";
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DividerProps as DividerProps$1 } from "./types.cjs";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Divider/Divider.d.ts
|
|
6
|
-
type DividerProps =
|
|
6
|
+
type DividerProps = DividerProps$1;
|
|
7
7
|
/**
|
|
8
8
|
* **📦 A divider component that can be used to visually separate components**
|
|
9
9
|
*
|
|
10
10
|
* @description
|
|
11
11
|
* The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
|
|
12
12
|
*
|
|
13
|
+
* For custom composition, import `DividerLine` and `DividerLabel` from the same package entrypoint
|
|
14
|
+
* and compose them inside `Divider`, `HStack`, or `VStack`.
|
|
15
|
+
*
|
|
13
16
|
* @example
|
|
14
17
|
* ```tsx
|
|
15
|
-
* import { Divider } from '@yahoo/uds';
|
|
18
|
+
* import { Divider, DividerLabel, DividerLine } from '@yahoo/uds';
|
|
16
19
|
*
|
|
17
20
|
* // Default primary horizontal divider. Similar to <hr />
|
|
18
21
|
* <Divider />
|
|
@@ -25,15 +28,23 @@ type DividerProps = DividerInternalProps;
|
|
|
25
28
|
*
|
|
26
29
|
* // A vertical divider with the tertiary styling.
|
|
27
30
|
* <Divider vertical variant="tertiary" />
|
|
31
|
+
*
|
|
32
|
+
* // Manual composition.
|
|
33
|
+
* <Divider>
|
|
34
|
+
* <DividerLine />
|
|
35
|
+
* <DividerLabel>Section</DividerLabel>
|
|
36
|
+
* <DividerLine />
|
|
37
|
+
* </Divider>
|
|
28
38
|
* ```
|
|
29
39
|
*
|
|
30
40
|
* @usage
|
|
31
41
|
* - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
|
|
42
|
+
* - Use `DividerLine` and `DividerLabel` when a layout needs custom composition.
|
|
32
43
|
*
|
|
33
44
|
* @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
|
|
34
45
|
*
|
|
35
46
|
* @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
|
|
36
47
|
*/
|
|
37
|
-
declare const Divider: _$react.ForwardRefExoticComponent<
|
|
48
|
+
declare const Divider: _$react.ForwardRefExoticComponent<DividerProps$1 & _$react.RefAttributes<HTMLDivElement>>;
|
|
38
49
|
//#endregion
|
|
39
50
|
export { Divider, type DividerProps };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { DividerProps as DividerProps$1 } from "./types.js";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Divider/Divider.d.ts
|
|
6
|
-
type DividerProps =
|
|
6
|
+
type DividerProps = DividerProps$1;
|
|
7
7
|
/**
|
|
8
8
|
* **📦 A divider component that can be used to visually separate components**
|
|
9
9
|
*
|
|
10
10
|
* @description
|
|
11
11
|
* The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
|
|
12
12
|
*
|
|
13
|
+
* For custom composition, import `DividerLine` and `DividerLabel` from the same package entrypoint
|
|
14
|
+
* and compose them inside `Divider`, `HStack`, or `VStack`.
|
|
15
|
+
*
|
|
13
16
|
* @example
|
|
14
17
|
* ```tsx
|
|
15
|
-
* import { Divider } from '@yahoo/uds';
|
|
18
|
+
* import { Divider, DividerLabel, DividerLine } from '@yahoo/uds';
|
|
16
19
|
*
|
|
17
20
|
* // Default primary horizontal divider. Similar to <hr />
|
|
18
21
|
* <Divider />
|
|
@@ -25,15 +28,23 @@ type DividerProps = DividerInternalProps;
|
|
|
25
28
|
*
|
|
26
29
|
* // A vertical divider with the tertiary styling.
|
|
27
30
|
* <Divider vertical variant="tertiary" />
|
|
31
|
+
*
|
|
32
|
+
* // Manual composition.
|
|
33
|
+
* <Divider>
|
|
34
|
+
* <DividerLine />
|
|
35
|
+
* <DividerLabel>Section</DividerLabel>
|
|
36
|
+
* <DividerLine />
|
|
37
|
+
* </Divider>
|
|
28
38
|
* ```
|
|
29
39
|
*
|
|
30
40
|
* @usage
|
|
31
41
|
* - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
|
|
42
|
+
* - Use `DividerLine` and `DividerLabel` when a layout needs custom composition.
|
|
32
43
|
*
|
|
33
44
|
* @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
|
|
34
45
|
*
|
|
35
46
|
* @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
|
|
36
47
|
*/
|
|
37
|
-
declare const Divider: _$react.ForwardRefExoticComponent<
|
|
48
|
+
declare const Divider: _$react.ForwardRefExoticComponent<DividerProps$1 & _$react.RefAttributes<HTMLDivElement>>;
|
|
38
49
|
//#endregion
|
|
39
50
|
export { Divider, type DividerProps };
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { cx, getStyles } from "../../styles/styler.js";
|
|
3
|
+
import { Box } from "../Box.js";
|
|
4
|
+
import { HStack } from "../HStack.js";
|
|
5
|
+
import { VStack } from "../VStack.js";
|
|
6
|
+
import { DividerLabel } from "./DividerLabel.js";
|
|
7
|
+
import { DividerLine } from "./DividerLine.js";
|
|
8
|
+
import { hasManualLine, renderManualChildren, shouldWrapInLabel } from "./utils.js";
|
|
9
|
+
import { forwardRef, useMemo } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
11
|
//#region src/components/Divider/Divider.tsx
|
|
12
|
+
const ORIENTATION_WIDTH_MAP = {
|
|
13
|
+
horizontal: "w-full",
|
|
14
|
+
vertical: ""
|
|
15
|
+
};
|
|
6
16
|
/**
|
|
7
17
|
* **📦 A divider component that can be used to visually separate components**
|
|
8
18
|
*
|
|
9
19
|
* @description
|
|
10
20
|
* The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
|
|
11
21
|
*
|
|
22
|
+
* For custom composition, import `DividerLine` and `DividerLabel` from the same package entrypoint
|
|
23
|
+
* and compose them inside `Divider`, `HStack`, or `VStack`.
|
|
24
|
+
*
|
|
12
25
|
* @example
|
|
13
26
|
* ```tsx
|
|
14
|
-
* import { Divider } from '@yahoo/uds';
|
|
27
|
+
* import { Divider, DividerLabel, DividerLine } from '@yahoo/uds';
|
|
15
28
|
*
|
|
16
29
|
* // Default primary horizontal divider. Similar to <hr />
|
|
17
30
|
* <Divider />
|
|
@@ -24,19 +37,87 @@ import { jsx } from "react/jsx-runtime";
|
|
|
24
37
|
*
|
|
25
38
|
* // A vertical divider with the tertiary styling.
|
|
26
39
|
* <Divider vertical variant="tertiary" />
|
|
40
|
+
*
|
|
41
|
+
* // Manual composition.
|
|
42
|
+
* <Divider>
|
|
43
|
+
* <DividerLine />
|
|
44
|
+
* <DividerLabel>Section</DividerLabel>
|
|
45
|
+
* <DividerLine />
|
|
46
|
+
* </Divider>
|
|
27
47
|
* ```
|
|
28
48
|
*
|
|
29
49
|
* @usage
|
|
30
50
|
* - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
|
|
51
|
+
* - Use `DividerLine` and `DividerLabel` when a layout needs custom composition.
|
|
31
52
|
*
|
|
32
53
|
* @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
|
|
33
54
|
*
|
|
34
55
|
* @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
|
|
35
56
|
*/
|
|
36
|
-
const Divider = forwardRef(function Divider(
|
|
37
|
-
|
|
57
|
+
const Divider = forwardRef(function Divider({ variant = "primary", vertical = false, contentPosition = "center", className, slotProps, children, gap, ...boxProps }, ref) {
|
|
58
|
+
const direction = vertical ? "vertical" : "horizontal";
|
|
59
|
+
const InternalComponent = vertical ? VStack : HStack;
|
|
60
|
+
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
61
|
+
const { className: labelClassName, variant: labelTextVariant, ...labelSlotProps } = slotProps?.label ?? {};
|
|
62
|
+
const { className: lineClassName, ...lineSlotProps } = slotProps?.line ?? {};
|
|
63
|
+
const classNames = useMemo(() => ({
|
|
64
|
+
root: cx(ORIENTATION_WIDTH_MAP[direction], variant !== "inherit" && getStyles({ dividerVariantRoot: variant }), className, rootClassName),
|
|
65
|
+
label: labelClassName,
|
|
66
|
+
line: lineClassName
|
|
67
|
+
}), [
|
|
68
|
+
className,
|
|
69
|
+
direction,
|
|
70
|
+
labelClassName,
|
|
71
|
+
lineClassName,
|
|
72
|
+
rootClassName,
|
|
73
|
+
variant
|
|
74
|
+
]);
|
|
75
|
+
if (children !== void 0 && children !== null && children !== false) {
|
|
76
|
+
const content = shouldWrapInLabel(children) ? /* @__PURE__ */ jsx(DividerLabel, {
|
|
77
|
+
className: classNames.label,
|
|
78
|
+
textVariant: labelTextVariant,
|
|
79
|
+
variant,
|
|
80
|
+
...labelSlotProps,
|
|
81
|
+
children
|
|
82
|
+
}) : renderManualChildren(children, variant, vertical);
|
|
83
|
+
return /* @__PURE__ */ jsx(InternalComponent, {
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
className: classNames.root,
|
|
86
|
+
flex: "1",
|
|
87
|
+
gap,
|
|
88
|
+
ref,
|
|
89
|
+
...boxProps,
|
|
90
|
+
...rootSlotProps,
|
|
91
|
+
children: hasManualLine(children) ? content : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
92
|
+
contentPosition !== "start" && /* @__PURE__ */ jsx(DividerLine, {
|
|
93
|
+
className: classNames.line,
|
|
94
|
+
variant,
|
|
95
|
+
vertical,
|
|
96
|
+
...lineSlotProps
|
|
97
|
+
}),
|
|
98
|
+
content,
|
|
99
|
+
contentPosition !== "end" && /* @__PURE__ */ jsx(DividerLine, {
|
|
100
|
+
className: classNames.line,
|
|
101
|
+
variant,
|
|
102
|
+
vertical,
|
|
103
|
+
...lineSlotProps
|
|
104
|
+
})
|
|
105
|
+
] })
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
109
|
+
className: classNames.root,
|
|
110
|
+
display: "flex",
|
|
111
|
+
flex: "none",
|
|
38
112
|
ref,
|
|
39
|
-
...
|
|
113
|
+
...boxProps,
|
|
114
|
+
...rootSlotProps,
|
|
115
|
+
children: /* @__PURE__ */ jsx(DividerLine, {
|
|
116
|
+
className: classNames.line,
|
|
117
|
+
variant,
|
|
118
|
+
vertical,
|
|
119
|
+
...lineSlotProps
|
|
120
|
+
})
|
|
40
121
|
});
|
|
41
122
|
});
|
|
42
123
|
Divider.displayName = "Divider";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_styles_styler = require("../../styles/styler.cjs");
|
|
5
|
+
const require_components_Text = require("../Text.cjs");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region src/components/Divider/DividerLabel.tsx
|
|
9
|
+
/**
|
|
10
|
+
* **The configured label element used by Divider.**
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* DividerLabel applies the configured divider label typography and color.
|
|
14
|
+
*
|
|
15
|
+
* @category Layout
|
|
16
|
+
* @platform web
|
|
17
|
+
*/
|
|
18
|
+
const DividerLabel = (0, react.forwardRef)(function DividerLabel({ variant = "primary", textVariant = "inherit", color = "inherit", as = "span", className, ...textProps }, ref) {
|
|
19
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
20
|
+
as,
|
|
21
|
+
className: require_styles_styler.cx(variant !== "inherit" && require_styles_styler.getStyles({ dividerVariantLabel: variant }), className),
|
|
22
|
+
color,
|
|
23
|
+
ref,
|
|
24
|
+
variant: textVariant,
|
|
25
|
+
...textProps
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
DividerLabel.displayName = "DividerLabel";
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.DividerLabel = DividerLabel;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { DividerLabelProps as DividerLabelProps$1 } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Divider/DividerLabel.d.ts
|
|
6
|
+
type DividerLabelProps = DividerLabelProps$1;
|
|
7
|
+
/**
|
|
8
|
+
* **The configured label element used by Divider.**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* DividerLabel applies the configured divider label typography and color.
|
|
12
|
+
*
|
|
13
|
+
* @category Layout
|
|
14
|
+
* @platform web
|
|
15
|
+
*/
|
|
16
|
+
declare const DividerLabel: _$react.ForwardRefExoticComponent<Omit<DividerLabelProps$1, "ref"> & _$react.RefAttributes<HTMLElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DividerLabel, type DividerLabelProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { DividerLabelProps as DividerLabelProps$1 } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Divider/DividerLabel.d.ts
|
|
6
|
+
type DividerLabelProps = DividerLabelProps$1;
|
|
7
|
+
/**
|
|
8
|
+
* **The configured label element used by Divider.**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* DividerLabel applies the configured divider label typography and color.
|
|
12
|
+
*
|
|
13
|
+
* @category Layout
|
|
14
|
+
* @platform web
|
|
15
|
+
*/
|
|
16
|
+
declare const DividerLabel: _$react.ForwardRefExoticComponent<Omit<DividerLabelProps$1, "ref"> & _$react.RefAttributes<HTMLElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DividerLabel, type DividerLabelProps };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { cx, getStyles } from "../../styles/styler.js";
|
|
3
|
+
import { Text } from "../Text.js";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Divider/DividerLabel.tsx
|
|
7
|
+
/**
|
|
8
|
+
* **The configured label element used by Divider.**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* DividerLabel applies the configured divider label typography and color.
|
|
12
|
+
*
|
|
13
|
+
* @category Layout
|
|
14
|
+
* @platform web
|
|
15
|
+
*/
|
|
16
|
+
const DividerLabel = forwardRef(function DividerLabel({ variant = "primary", textVariant = "inherit", color = "inherit", as = "span", className, ...textProps }, ref) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
18
|
+
as,
|
|
19
|
+
className: cx(variant !== "inherit" && getStyles({ dividerVariantLabel: variant }), className),
|
|
20
|
+
color,
|
|
21
|
+
ref,
|
|
22
|
+
variant: textVariant,
|
|
23
|
+
...textProps
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
DividerLabel.displayName = "DividerLabel";
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DividerLabel };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_styles_styler = require("../../styles/styler.cjs");
|
|
5
|
+
const require_components_Box = require("../Box.cjs");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region src/components/Divider/DividerLine.tsx
|
|
9
|
+
/**
|
|
10
|
+
* **The configured line element used by Divider.**
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* DividerLine can be used inside Divider for custom composition, or directly
|
|
14
|
+
* inside HStack/VStack when a fully manual layout is easier.
|
|
15
|
+
*
|
|
16
|
+
* @category Layout
|
|
17
|
+
* @platform web
|
|
18
|
+
*/
|
|
19
|
+
const DividerLine = (0, react.forwardRef)(function DividerLine({ variant = "primary", vertical = false, className, style, "aria-hidden": ariaHidden = true, ...boxProps }, ref) {
|
|
20
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
21
|
+
"aria-hidden": ariaHidden,
|
|
22
|
+
className: require_styles_styler.cx(variant !== "inherit" && require_styles_styler.getStyles({ dividerVariantLine: variant }), className),
|
|
23
|
+
flex: "1",
|
|
24
|
+
ref,
|
|
25
|
+
style: (0, react.useMemo)(() => vertical ? {
|
|
26
|
+
borderTopWidth: 0,
|
|
27
|
+
borderRightWidth: 0,
|
|
28
|
+
borderBottomWidth: 0,
|
|
29
|
+
...style
|
|
30
|
+
} : {
|
|
31
|
+
borderLeftWidth: 0,
|
|
32
|
+
borderRightWidth: 0,
|
|
33
|
+
borderBottomWidth: 0,
|
|
34
|
+
...style
|
|
35
|
+
}, [style, vertical]),
|
|
36
|
+
...boxProps
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
DividerLine.displayName = "DividerLine";
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.DividerLine = DividerLine;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { DividerLineProps as DividerLineProps$1 } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Divider/DividerLine.d.ts
|
|
6
|
+
type DividerLineProps = DividerLineProps$1;
|
|
7
|
+
/**
|
|
8
|
+
* **The configured line element used by Divider.**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* DividerLine can be used inside Divider for custom composition, or directly
|
|
12
|
+
* inside HStack/VStack when a fully manual layout is easier.
|
|
13
|
+
*
|
|
14
|
+
* @category Layout
|
|
15
|
+
* @platform web
|
|
16
|
+
*/
|
|
17
|
+
declare const DividerLine: _$react.ForwardRefExoticComponent<DividerLineProps$1 & _$react.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DividerLine, type DividerLineProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { DividerLineProps as DividerLineProps$1 } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Divider/DividerLine.d.ts
|
|
6
|
+
type DividerLineProps = DividerLineProps$1;
|
|
7
|
+
/**
|
|
8
|
+
* **The configured line element used by Divider.**
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* DividerLine can be used inside Divider for custom composition, or directly
|
|
12
|
+
* inside HStack/VStack when a fully manual layout is easier.
|
|
13
|
+
*
|
|
14
|
+
* @category Layout
|
|
15
|
+
* @platform web
|
|
16
|
+
*/
|
|
17
|
+
declare const DividerLine: _$react.ForwardRefExoticComponent<DividerLineProps$1 & _$react.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DividerLine, type DividerLineProps };
|