react-public-components 1.1.17 → 1.1.18

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/index.css CHANGED
@@ -153,4 +153,44 @@
153
153
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
154
154
  will-change: transform;
155
155
  }
156
+
157
+ /* BorderBeam/index.less */
158
+ .react-public-border-beam-container {
159
+ position: relative;
160
+ }
161
+ .react-public-border-beam-mask {
162
+ position: absolute;
163
+ pointer-events: none;
164
+ box-sizing: border-box;
165
+ border-radius: inherit;
166
+ border: var(--border-beam-line-width, 1px) solid transparent;
167
+ top: calc(-1 * var(--border-beam-outset, 0px));
168
+ left: calc(-1 * var(--border-beam-outset, 0px));
169
+ right: calc(-1 * var(--border-beam-outset, 0px));
170
+ bottom: calc(-1 * var(--border-beam-outset, 0px));
171
+ -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
172
+ -webkit-mask-clip: padding-box, border-box;
173
+ -webkit-mask-composite: destination-out;
174
+ mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
175
+ mask-clip: padding-box, border-box;
176
+ mask-composite: exclude;
177
+ }
178
+ .react-public-border-beam-item {
179
+ position: absolute;
180
+ width: var(--border-beam-size, 100px);
181
+ height: var(--border-beam-size, 100px);
182
+ background: var(--border-beam-gradient);
183
+ offset-path: rect(0% 100% 100% 0% round var(--border-beam-radius, 12px));
184
+ offset-anchor: 100% 50%;
185
+ will-change: offset-distance;
186
+ animation: react-public-border-beam-spin var(--border-beam-duration, 6s) linear infinite;
187
+ }
188
+ @keyframes react-public-border-beam-spin {
189
+ 0% {
190
+ offset-distance: 0%;
191
+ }
192
+ 100% {
193
+ offset-distance: 100%;
194
+ }
195
+ }
156
196
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../CollapseBox/index.less","../DisabledBox/index.less","../Masonry/index.less"],"sourcesContent":[".collapsible-wrapper {\n position: relative;\n box-sizing: border-box;\n}\n.collapsible-wrapper.horizontal {\n display: inline-flex;\n align-items: stretch;\n}\n.collapsible-wrapper.vertical {\n display: flex;\n flex-direction: column;\n}\n.collapsible-container {\n position: relative;\n box-sizing: border-box;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n background-color: #ffffff;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);\n transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n.collapsible-container.align-right {\n margin-left: auto;\n}\n.collapsible-container.align-bottom {\n margin-top: auto;\n}\n.collapsible-header {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n height: 48px;\n padding: 12px 16px;\n background-color: #f9fafb;\n border-bottom: 1px solid #d1d5db;\n}\n.collapsible-header h3 {\n margin: 0;\n color: #1f2937;\n font-weight: 600;\n font-size: 18px;\n}\n.collapsible-content {\n box-sizing: border-box;\n padding: 16px;\n}\n.toggle-button {\n position: absolute;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #8c8c8c;\n background-color: #f3f4f6;\n border: 1px solid #e5e7eb;\n border-radius: 3px;\n cursor: pointer;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;\n font-size: 10px;\n}\n.toggle-button:hover {\n background-color: #e5e7eb;\n color: #1f2937;\n border-color: #d1d5db;\n}\n.toggle-button.button-right {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n width: 14px;\n height: 48px;\n}\n.toggle-button.button-left {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n width: 14px;\n height: 48px;\n}\n.toggle-button.button-bottom {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n width: 48px;\n height: 14px;\n}\n.toggle-button.button-top {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 48px;\n height: 14px;\n}\n",".disabled_box_container {\n display: flex;\n flex: 1;\n gap: 2px;\n align-items: center;\n justify-content: flex-start;\n min-width: 0;\n color: rgba(0, 0, 0, 0.35);\n}\n.disabled_box_container .disabled_box_title {\n display: flex;\n flex: 1;\n min-width: 0;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden;\n}\n.disabled_box_container .disabled_box_icon {\n flex-shrink: 0;\n margin-right: 2px;\n font-size: 12px;\n}\n.disabled_box_container .disabled_box_icon:last-child {\n margin-right: 0;\n margin-left: 2px;\n}\n.disabled_box_disabled {\n color: rgba(0, 0, 0, 0.35) !important;\n cursor: not-allowed;\n}\n.disabled_box_disabled * {\n color: inherit !important;\n}\n",".masonry_root {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n}\n.masonry_item {\n position: absolute;\n top: 0;\n left: 0;\n box-sizing: border-box;\n transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s cubic-bezier(0.2, 0, 0, 1);\n will-change: transform;\n}\n"],"mappings":";AAAA,CAAC;AACC,YAAU;AACV,cAAY;AACd;AACA,CAJC,mBAImB,CAAC;AACnB,WAAS;AACT,eAAa;AACf;AACA,CARC,mBAQmB,CAAC;AACnB,WAAS;AACT,kBAAgB;AAClB;AACA,CAAC;AACC,YAAU;AACV,cAAY;AACZ,aAAW;AACX,cAAY;AACZ,YAAU;AACV,oBAAkB;AAClB,UAAQ,IAAI,MAAM;AAClB,iBAAe;AACf,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACpC,cAAY,MAAM,KAAK,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,KAAK,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;AAC7F;AACA,CAZC,qBAYqB,CAAC;AACrB,eAAa;AACf;AACA,CAf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AC,EAAE,CAAC,EAAE;AACvB;AACA,CATC,uBASuB,CAAC;AACvB,WAAS;AACT,QAAM;AACN,aAAW;AACX,UAAQ;AACR,WAAS;AACT,YAAU;AACZ;AACA,CAjBC,uBAiBuB,CAAC;AACvB,eAAa;AACb,gBAAc;AACd,aAAW;AACb;AACA,CAtBC,uBAsBuB,CALC,iBAKiB;AACxC,gBAAc;AACd,eAAa;AACf;AACA,CAAC;AACC,SAAO,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACrB,UAAQ;AACV;AACA,CAJC,sBAIsB;AACrB,SAAO;AACT;;;AChCA,CAAC;AACC,YAAU;AACV,SAAO;AACP,cAAY;AACd;AACA,CAAC;AACC,YAAU;AACV,OAAK;AACL,QAAM;AACN,cAAY;AACZ,cAAY,UAAU,KAAK,aAAa,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,KAAK,aAAa,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE;AAC5F,eAAa;AACf;","names":[]}
1
+ {"version":3,"sources":["../CollapseBox/index.less","../DisabledBox/index.less","../Masonry/index.less","../BorderBeam/index.less"],"sourcesContent":[".collapsible-wrapper {\n position: relative;\n box-sizing: border-box;\n}\n.collapsible-wrapper.horizontal {\n display: inline-flex;\n align-items: stretch;\n}\n.collapsible-wrapper.vertical {\n display: flex;\n flex-direction: column;\n}\n.collapsible-container {\n position: relative;\n box-sizing: border-box;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n background-color: #ffffff;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);\n transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n.collapsible-container.align-right {\n margin-left: auto;\n}\n.collapsible-container.align-bottom {\n margin-top: auto;\n}\n.collapsible-header {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n height: 48px;\n padding: 12px 16px;\n background-color: #f9fafb;\n border-bottom: 1px solid #d1d5db;\n}\n.collapsible-header h3 {\n margin: 0;\n color: #1f2937;\n font-weight: 600;\n font-size: 18px;\n}\n.collapsible-content {\n box-sizing: border-box;\n padding: 16px;\n}\n.toggle-button {\n position: absolute;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #8c8c8c;\n background-color: #f3f4f6;\n border: 1px solid #e5e7eb;\n border-radius: 3px;\n cursor: pointer;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;\n font-size: 10px;\n}\n.toggle-button:hover {\n background-color: #e5e7eb;\n color: #1f2937;\n border-color: #d1d5db;\n}\n.toggle-button.button-right {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n width: 14px;\n height: 48px;\n}\n.toggle-button.button-left {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n width: 14px;\n height: 48px;\n}\n.toggle-button.button-bottom {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n width: 48px;\n height: 14px;\n}\n.toggle-button.button-top {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 48px;\n height: 14px;\n}\n",".disabled_box_container {\n display: flex;\n flex: 1;\n gap: 2px;\n align-items: center;\n justify-content: flex-start;\n min-width: 0;\n color: rgba(0, 0, 0, 0.35);\n}\n.disabled_box_container .disabled_box_title {\n display: flex;\n flex: 1;\n min-width: 0;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden;\n}\n.disabled_box_container .disabled_box_icon {\n flex-shrink: 0;\n margin-right: 2px;\n font-size: 12px;\n}\n.disabled_box_container .disabled_box_icon:last-child {\n margin-right: 0;\n margin-left: 2px;\n}\n.disabled_box_disabled {\n color: rgba(0, 0, 0, 0.35) !important;\n cursor: not-allowed;\n}\n.disabled_box_disabled * {\n color: inherit !important;\n}\n",".masonry_root {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n}\n.masonry_item {\n position: absolute;\n top: 0;\n left: 0;\n box-sizing: border-box;\n transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s cubic-bezier(0.2, 0, 0, 1);\n will-change: transform;\n}\n",".react-public-border-beam-container {\n position: relative;\n}\n.react-public-border-beam-mask {\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n border-radius: inherit;\n /* 边框线宽 */\n border: var(--border-beam-line-width, 1px) solid transparent;\n /* 定位与 outset 外扩 */\n top: calc(-1 * var(--border-beam-outset, 0px));\n left: calc(-1 * var(--border-beam-outset, 0px));\n right: calc(-1 * var(--border-beam-outset, 0px));\n bottom: calc(-1 * var(--border-beam-outset, 0px));\n /* WebKit 遮罩兼容 (Chrome, Safari, Edge) */\n -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);\n -webkit-mask-clip: padding-box, border-box;\n -webkit-mask-composite: destination-out;\n /* 标准 CSS 遮罩 (Firefox, Modern Chrome) */\n mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);\n mask-clip: padding-box, border-box;\n mask-composite: exclude;\n}\n.react-public-border-beam-item {\n position: absolute;\n width: var(--border-beam-size, 100px);\n height: var(--border-beam-size, 100px);\n background: var(--border-beam-gradient);\n /* 沿矩形路径轨迹移动 */\n offset-path: rect(0% 100% 100% 0% round var(--border-beam-radius, 12px));\n offset-anchor: 100% 50%;\n will-change: offset-distance;\n animation: react-public-border-beam-spin var(--border-beam-duration, 6s) linear infinite;\n}\n@keyframes react-public-border-beam-spin {\n 0% {\n offset-distance: 0%;\n }\n 100% {\n offset-distance: 100%;\n }\n}\n"],"mappings":";AAAA,CAAC;AACC,YAAU;AACV,cAAY;AACd;AACA,CAJC,mBAImB,CAAC;AACnB,WAAS;AACT,eAAa;AACf;AACA,CARC,mBAQmB,CAAC;AACnB,WAAS;AACT,kBAAgB;AAClB;AACA,CAAC;AACC,YAAU;AACV,cAAY;AACZ,aAA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,EAAE,IAAI,oBAAoB,EAAE;AAC3C,UAAQ,KAAK,GAAG,EAAE,IAAI,oBAAoB,EAAE;AAE5C,sBAAoB,gBAAgB,KAAK,EAAE,EAAE,EAAE,gBAAgB,KAAK,EAAE;AACtE,qBAAmB,WAAW,EAAE;AAChC,0BAAwB;AAExB,cAAY,gBAAgB,KAAK,EAAE,EAAE,EAAE,gBAAgB,KAAK,EAAE;AAC9D,aAAW,WAAW,EAAE;AACxB,kBAAgB;AAClB;AACA,CAAC;AACC,YAAU;AACV,SAAO,IAAI,kBAAkB,EAAE;AAC/B,UAAQ,IAAI,kBAAkB,EAAE;AAChC,cAAY,IAAI;AAEhB,eAAa,KAAK,GAAG,KAAK,KAAK,GAAG,MAAM,IAAI,oBAAoB,EAAE;AAClE,iBAAe,KAAK;AACpB,eAAa;AACb,aAAW,8BAA8B,IAAI,sBAAsB,EAAE,IAAI,OAAO;AAClF;AACA,WAFa;AAGX;AACE,qBAAiB;AACnB;AACA;AACE,qBAAiB;AACnB;AACF;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { ReactNode, CSSProperties, Key } from 'react';
2
+ import React__default, { ReactNode, CSSProperties, Key, HTMLAttributes } from 'react';
3
3
 
4
4
  type CollapseBoxDirection = 'horizontal' | 'vertical';
5
5
  type CollapseBoxButtonPosition = 'left' | 'right' | 'top' | 'bottom';
@@ -164,4 +164,26 @@ interface MasonryProps<T = any> {
164
164
  }
165
165
  declare const Masonry: <T = unknown>(props: MasonryProps<T>) => React__default.JSX.Element;
166
166
 
167
- export { type Breakpoint, CollapsibleBox as CollapseBox, type CollapseBoxButtonPosition, type CollapseBoxDirection, type CollapseBoxProps, DisabledBox, type DisabledBoxProps, type Gap, Masonry, type MasonryClassNames, type MasonryItem, type MasonryProps, type MasonrySemanticDOM, type MasonryStyles, CustomSplitter as Splitter, type SplitterCollapsible, type SplitterOrientation, type SplitterPanelProps, type SplitterProps, type SplitterSize };
167
+ type BorderBeamColorStop = {
168
+ color: string;
169
+ percent: number;
170
+ };
171
+ interface BorderBeamProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
172
+ /** 装饰内容 */
173
+ children?: ReactNode;
174
+ /** 流光颜色配置,支持单色字符串或渐变停靠点数组 */
175
+ color?: string | BorderBeamColorStop[];
176
+ /** 流光数量,默认为 1 */
177
+ count?: number;
178
+ /** 流光完成一圈动画的时间,单位秒,默认为 6 */
179
+ duration?: number;
180
+ /** 流光线宽,数字类型按像素处理,默认为 1px */
181
+ lineWidth?: number | string;
182
+ /** 流光层相对容器边缘的外扩距离,遇到裁剪容器时可设为 0 */
183
+ outset?: number | string;
184
+ /** 流光可见段的尺寸,数字类型按像素处理,默认为 100 */
185
+ size?: number | string;
186
+ }
187
+ declare const BorderBeam: (props: BorderBeamProps) => React.JSX.Element;
188
+
189
+ export { BorderBeam, type BorderBeamColorStop, type BorderBeamProps, type Breakpoint, CollapsibleBox as CollapseBox, type CollapseBoxButtonPosition, type CollapseBoxDirection, type CollapseBoxProps, DisabledBox, type DisabledBoxProps, type Gap, Masonry, type MasonryClassNames, type MasonryItem, type MasonryProps, type MasonrySemanticDOM, type MasonryStyles, CustomSplitter as Splitter, type SplitterCollapsible, type SplitterOrientation, type SplitterPanelProps, type SplitterProps, type SplitterSize };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { ReactNode, CSSProperties, Key } from 'react';
2
+ import React__default, { ReactNode, CSSProperties, Key, HTMLAttributes } from 'react';
3
3
 
4
4
  type CollapseBoxDirection = 'horizontal' | 'vertical';
5
5
  type CollapseBoxButtonPosition = 'left' | 'right' | 'top' | 'bottom';
@@ -164,4 +164,26 @@ interface MasonryProps<T = any> {
164
164
  }
165
165
  declare const Masonry: <T = unknown>(props: MasonryProps<T>) => React__default.JSX.Element;
166
166
 
167
- export { type Breakpoint, CollapsibleBox as CollapseBox, type CollapseBoxButtonPosition, type CollapseBoxDirection, type CollapseBoxProps, DisabledBox, type DisabledBoxProps, type Gap, Masonry, type MasonryClassNames, type MasonryItem, type MasonryProps, type MasonrySemanticDOM, type MasonryStyles, CustomSplitter as Splitter, type SplitterCollapsible, type SplitterOrientation, type SplitterPanelProps, type SplitterProps, type SplitterSize };
167
+ type BorderBeamColorStop = {
168
+ color: string;
169
+ percent: number;
170
+ };
171
+ interface BorderBeamProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
172
+ /** 装饰内容 */
173
+ children?: ReactNode;
174
+ /** 流光颜色配置,支持单色字符串或渐变停靠点数组 */
175
+ color?: string | BorderBeamColorStop[];
176
+ /** 流光数量,默认为 1 */
177
+ count?: number;
178
+ /** 流光完成一圈动画的时间,单位秒,默认为 6 */
179
+ duration?: number;
180
+ /** 流光线宽,数字类型按像素处理,默认为 1px */
181
+ lineWidth?: number | string;
182
+ /** 流光层相对容器边缘的外扩距离,遇到裁剪容器时可设为 0 */
183
+ outset?: number | string;
184
+ /** 流光可见段的尺寸,数字类型按像素处理,默认为 100 */
185
+ size?: number | string;
186
+ }
187
+ declare const BorderBeam: (props: BorderBeamProps) => React.JSX.Element;
188
+
189
+ export { BorderBeam, type BorderBeamColorStop, type BorderBeamProps, type Breakpoint, CollapsibleBox as CollapseBox, type CollapseBoxButtonPosition, type CollapseBoxDirection, type CollapseBoxProps, DisabledBox, type DisabledBoxProps, type Gap, Masonry, type MasonryClassNames, type MasonryItem, type MasonryProps, type MasonrySemanticDOM, type MasonryStyles, CustomSplitter as Splitter, type SplitterCollapsible, type SplitterOrientation, type SplitterPanelProps, type SplitterProps, type SplitterSize };
package/dist/index.js CHANGED
@@ -1068,7 +1068,106 @@ var Masonry = (props) => {
1068
1068
  );
1069
1069
  };
1070
1070
  var Masonry_default = Masonry;
1071
+
1072
+ // BorderBeam/index.tsx
1073
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
1074
+ var formatSizeUnit = (value, defaultValue) => {
1075
+ if (value === void 0 || value === null) {
1076
+ return defaultValue;
1077
+ }
1078
+ if (typeof value === "number") {
1079
+ return `${value}px`;
1080
+ }
1081
+ return value;
1082
+ };
1083
+ var buildGradientString = (color) => {
1084
+ if (!color) {
1085
+ return "linear-gradient(to left, #1677ff 0%, transparent 100%)";
1086
+ }
1087
+ if (typeof color === "string") {
1088
+ return `linear-gradient(to left, ${color} 0%, transparent 100%)`;
1089
+ }
1090
+ if (Array.isArray(color)) {
1091
+ if (color.length === 0) {
1092
+ return "linear-gradient(to left, #1677ff 0%, transparent 100%)";
1093
+ }
1094
+ const sorted = [...color].sort((a, b) => a.percent - b.percent);
1095
+ const mappedStops = sorted.map((stop) => {
1096
+ const mappedPercent = Math.min(Math.max(stop.percent / 100 * 80, 0), 80);
1097
+ return `${stop.color} ${mappedPercent.toFixed(2)}%`;
1098
+ });
1099
+ return `linear-gradient(to left, ${mappedStops.join(", ")}, transparent 100%)`;
1100
+ }
1101
+ return "linear-gradient(to left, #1677ff 0%, transparent 100%)";
1102
+ };
1103
+ var BorderBeam = (props) => {
1104
+ const {
1105
+ children,
1106
+ color,
1107
+ count = 1,
1108
+ duration = 6,
1109
+ lineWidth = "1px",
1110
+ outset = "0px",
1111
+ size = 100,
1112
+ className,
1113
+ style,
1114
+ ...restProps
1115
+ } = props;
1116
+ const formattedLineWidth = formatSizeUnit(lineWidth, "1px");
1117
+ const formattedOutset = formatSizeUnit(outset, "0px");
1118
+ const formattedSize = formatSizeUnit(size, "100px");
1119
+ const gradientCss = buildGradientString(color);
1120
+ const maskStyle = {
1121
+ "--border-beam-line-width": formattedLineWidth,
1122
+ "--border-beam-outset": formattedOutset,
1123
+ "--border-beam-size": formattedSize,
1124
+ "--border-beam-duration": `${duration}s`,
1125
+ "--border-beam-gradient": gradientCss
1126
+ };
1127
+ const beamCount = Math.max(1, count);
1128
+ const beams = Array.from({ length: beamCount }).map((_, index) => {
1129
+ const delaySeconds = -(duration * index / beamCount);
1130
+ return /* @__PURE__ */ jsx6(
1131
+ "div",
1132
+ {
1133
+ className: "react-public-border-beam-item",
1134
+ style: {
1135
+ animationDelay: `${delaySeconds}s`
1136
+ }
1137
+ },
1138
+ index
1139
+ );
1140
+ });
1141
+ if (children !== void 0) {
1142
+ return /* @__PURE__ */ jsxs4(
1143
+ "div",
1144
+ {
1145
+ className: `react-public-border-beam-container ${className || ""}`.trim(),
1146
+ style,
1147
+ ...restProps,
1148
+ children: [
1149
+ children,
1150
+ /* @__PURE__ */ jsx6("div", { className: "react-public-border-beam-mask", style: maskStyle, children: beams })
1151
+ ]
1152
+ }
1153
+ );
1154
+ }
1155
+ return /* @__PURE__ */ jsx6(
1156
+ "div",
1157
+ {
1158
+ className: `react-public-border-beam-mask ${className || ""}`.trim(),
1159
+ style: {
1160
+ ...maskStyle,
1161
+ ...style
1162
+ },
1163
+ ...restProps,
1164
+ children: beams
1165
+ }
1166
+ );
1167
+ };
1168
+ var BorderBeam_default = BorderBeam;
1071
1169
  export {
1170
+ BorderBeam_default as BorderBeam,
1072
1171
  CollapseBox_default as CollapseBox,
1073
1172
  DisabledBox_default as DisabledBox,
1074
1173
  Masonry_default as Masonry,