beacon-ui 3.5.4 → 3.5.5
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/CHANGELOG.md +14 -0
- package/dist/components/Divider.d.ts +13 -0
- package/dist/components/Divider.d.ts.map +1 -0
- package/dist/components/Divider.js +112 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.5.5] - 2026-01-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- New Divider component for visually separating content
|
|
12
|
+
- Supports horizontal and vertical orientations
|
|
13
|
+
- Optional slot for icons or custom content with configurable positions (default, center, left, right, top, bottom)
|
|
14
|
+
- Custom color and width props for flexible styling
|
|
15
|
+
- Slot automatically shows/hides based on slotPosition selection (default = no slot, others = slot shown)
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Divider component default state now properly displays when no slot is present
|
|
19
|
+
- Vertical dividers in preview container no longer overflow outside boundaries
|
|
20
|
+
- Divider anatomy diagram no longer shows primary color background
|
|
21
|
+
|
|
8
22
|
## [3.5.4] - 2026-01-15
|
|
9
23
|
|
|
10
24
|
### Changed
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
export type DividerOrientation = "horizontal" | "vertical";
|
|
3
|
+
export type DividerSlotPosition = "default" | "center" | "left" | "right" | "top" | "bottom";
|
|
4
|
+
export interface DividerProps extends Omit<ComponentPropsWithRef<"div">, "slot"> {
|
|
5
|
+
orientation?: DividerOrientation;
|
|
6
|
+
slot?: boolean;
|
|
7
|
+
slotPosition?: DividerSlotPosition;
|
|
8
|
+
slotContent?: React.ReactNode;
|
|
9
|
+
color?: string;
|
|
10
|
+
width?: string | "100%";
|
|
11
|
+
}
|
|
12
|
+
export declare function Divider({ orientation, slot, slotPosition, slotContent, color, width, className, style, ref, ...rest }: DividerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../src/components/Divider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7F,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9E,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,wBAAgB,OAAO,CAAC,EACtB,WAA0B,EAC1B,IAAY,EACZ,YAAwB,EACxB,WAAW,EACX,KAAK,EACL,KAAc,EACd,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,YAAY,2CA6Jd"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useThemeSafe } from "../providers/ThemeProvider";
|
|
5
|
+
import { ArrowDownFallSlotIcon } from "../icons";
|
|
6
|
+
export function Divider({ orientation = "horizontal", slot = false, slotPosition = "default", slotContent, color, width = "100%", className, style, ref, ...rest }) {
|
|
7
|
+
useThemeSafe();
|
|
8
|
+
const dividerStyles = useMemo(() => {
|
|
9
|
+
const baseStyles = {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
};
|
|
13
|
+
if (orientation === "horizontal") {
|
|
14
|
+
baseStyles.flexDirection = "row";
|
|
15
|
+
baseStyles.width = width;
|
|
16
|
+
baseStyles.gap = slot ? "var(--spacing-100)" : "0";
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
baseStyles.flexDirection = "column";
|
|
20
|
+
baseStyles.height = width; // For vertical, width prop controls height
|
|
21
|
+
baseStyles.gap = slot ? "var(--spacing-100)" : "0";
|
|
22
|
+
}
|
|
23
|
+
return { ...baseStyles, ...style };
|
|
24
|
+
}, [orientation, slot, width, style]);
|
|
25
|
+
const lineStyles = useMemo(() => {
|
|
26
|
+
const baseStyles = {
|
|
27
|
+
backgroundColor: color || "var(--border-neutral-secondary)",
|
|
28
|
+
};
|
|
29
|
+
if (orientation === "horizontal") {
|
|
30
|
+
baseStyles.height = "1px";
|
|
31
|
+
baseStyles.minHeight = "1px";
|
|
32
|
+
baseStyles.width = "100%";
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
baseStyles.width = "1px";
|
|
36
|
+
baseStyles.minWidth = "1px";
|
|
37
|
+
baseStyles.height = "100%";
|
|
38
|
+
}
|
|
39
|
+
return baseStyles;
|
|
40
|
+
}, [orientation, color]);
|
|
41
|
+
const slotStyles = useMemo(() => {
|
|
42
|
+
return {
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
width: "24px",
|
|
47
|
+
height: "24px",
|
|
48
|
+
minWidth: "24px",
|
|
49
|
+
minHeight: "24px",
|
|
50
|
+
flexShrink: 0,
|
|
51
|
+
backgroundColor: "var(--bg-warning-tonal)",
|
|
52
|
+
border: "var(--border-width-25) dashed var(--border-warning)",
|
|
53
|
+
borderRadius: "var(--corner-radius-100)",
|
|
54
|
+
padding: "var(--spacing-200)",
|
|
55
|
+
};
|
|
56
|
+
}, []);
|
|
57
|
+
const iconContainerStyles = useMemo(() => {
|
|
58
|
+
return {
|
|
59
|
+
display: "flex",
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
justifyContent: "center",
|
|
62
|
+
width: "16px",
|
|
63
|
+
height: "16px",
|
|
64
|
+
flexShrink: 0,
|
|
65
|
+
color: "var(--fg-warning-on-tonal)",
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
const renderSlot = () => {
|
|
69
|
+
if (!slot)
|
|
70
|
+
return null;
|
|
71
|
+
const defaultSlotContent = (_jsx("div", { style: iconContainerStyles, children: _jsx(ArrowDownFallSlotIcon, { size: 16 }) }));
|
|
72
|
+
return (_jsx("div", { style: slotStyles, children: slotContent || defaultSlotContent }));
|
|
73
|
+
};
|
|
74
|
+
const renderDivider = () => {
|
|
75
|
+
if (!slot) {
|
|
76
|
+
return _jsx("div", { style: lineStyles });
|
|
77
|
+
}
|
|
78
|
+
// With slot, need to handle different positions
|
|
79
|
+
const flexLineStyles = {
|
|
80
|
+
...lineStyles,
|
|
81
|
+
flexGrow: 1,
|
|
82
|
+
flexShrink: 0,
|
|
83
|
+
flexBasis: 0,
|
|
84
|
+
};
|
|
85
|
+
if (orientation === "horizontal") {
|
|
86
|
+
if (slotPosition === "left") {
|
|
87
|
+
return (_jsxs(_Fragment, { children: [renderSlot(), _jsx("div", { style: flexLineStyles })] }));
|
|
88
|
+
}
|
|
89
|
+
else if (slotPosition === "right") {
|
|
90
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: flexLineStyles }), renderSlot()] }));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// center or default
|
|
94
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: flexLineStyles }), renderSlot(), _jsx("div", { style: flexLineStyles })] }));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// vertical
|
|
99
|
+
if (slotPosition === "top") {
|
|
100
|
+
return (_jsxs(_Fragment, { children: [renderSlot(), _jsx("div", { style: flexLineStyles })] }));
|
|
101
|
+
}
|
|
102
|
+
else if (slotPosition === "bottom") {
|
|
103
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: flexLineStyles }), renderSlot()] }));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// center or default
|
|
107
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { style: flexLineStyles }), renderSlot(), _jsx("div", { style: flexLineStyles })] }));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return (_jsx("div", { ref: ref, className: className, style: dividerStyles, ...rest, children: renderDivider() }));
|
|
112
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { Input } from "./components/Input";
|
|
|
7
7
|
export { Select } from "./components/Select";
|
|
8
8
|
export { Avatar } from "./components/Avatar";
|
|
9
9
|
export { Chip } from "./components/Chip";
|
|
10
|
+
export { Divider } from "./components/Divider";
|
|
10
11
|
export { Menu, type MenuItem as MenuItemData } from "./components/Menu";
|
|
11
12
|
export { MenuItem, type MenuItemProps, type MenuItemState } from "./components/MenuItem";
|
|
12
13
|
export { RadioButton } from "./components/RadioButton";
|
|
@@ -23,6 +24,7 @@ export type { InputProps, InputSize, InputStatus } from "./components/Input";
|
|
|
23
24
|
export type { SelectProps, SelectSize, SelectStatus, SelectOption } from "./components/Select";
|
|
24
25
|
export type { AvatarProps, AvatarSize, AvatarType, AvatarColor, AvatarVariant } from "./components/Avatar";
|
|
25
26
|
export type { ChipProps, ChipSize, ChipColor } from "./components/Chip";
|
|
27
|
+
export type { DividerProps, DividerOrientation, DividerSlotPosition } from "./components/Divider";
|
|
26
28
|
export type { MenuProps } from "./components/Menu";
|
|
27
29
|
export type { RadioButtonProps, RadioButtonStatus } from "./components/RadioButton";
|
|
28
30
|
export type { SliderProps, SliderStatus } from "./components/Slider";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,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GACZ,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { Input } from "./components/Input";
|
|
|
8
8
|
export { Select } from "./components/Select";
|
|
9
9
|
export { Avatar } from "./components/Avatar";
|
|
10
10
|
export { Chip } from "./components/Chip";
|
|
11
|
+
export { Divider } from "./components/Divider";
|
|
11
12
|
export { Menu } from "./components/Menu";
|
|
12
13
|
export { MenuItem } from "./components/MenuItem";
|
|
13
14
|
export { RadioButton } from "./components/RadioButton";
|