@bubo-squared/ui-framework 0.1.95 → 0.1.96

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.d.cts CHANGED
@@ -146,9 +146,12 @@ interface BadgeStatusProps extends React$1.HTMLAttributes<HTMLDivElement> {
146
146
  declare const BadgeStatus: React$1.ForwardRefExoticComponent<BadgeStatusProps & React$1.RefAttributes<HTMLDivElement>>;
147
147
 
148
148
  type DividerType = "default" | "text" | "iconButton" | "iconButtonGroup" | "button";
149
+ type DividerOrientation = "horizontal" | "vertical";
149
150
  type SimpleDividerType = Exclude<DividerType, "button" | "iconButton" | "iconButtonGroup">;
150
151
  interface BaseDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
151
152
  type?: SimpleDividerType;
153
+ /** Orientation of the divider lines. Defaults to "horizontal". */
154
+ orientation?: DividerOrientation;
152
155
  /** Size variant for the divider (affects line thickness + center element sizing). */
153
156
  size?: DividerSize;
154
157
  /** Label shown for text variant (e.g. "OR"). */
@@ -159,6 +162,8 @@ type IconButtonVariant = ButtonProps["variant"];
159
162
  type DividerSize = IconButtonGroupProps["size"];
160
163
  interface IconLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
161
164
  type: "iconButton";
165
+ /** Orientation of the divider lines. Defaults to "horizontal". */
166
+ orientation?: DividerOrientation;
162
167
  /** Size variant for the divider (affects line thickness + icon button size). */
163
168
  size?: DividerSize;
164
169
  /** Icon rendered between the lines. */
@@ -172,6 +177,8 @@ interface IconLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
172
177
  }
173
178
  interface ButtonLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
174
179
  type: "button";
180
+ /** Orientation of the divider lines. Defaults to "horizontal". */
181
+ orientation?: DividerOrientation;
175
182
  /** Size variant for the divider (affects line thickness + button size). */
176
183
  size?: DividerSize;
177
184
  /** Text inside the button between the lines. */
@@ -183,6 +190,8 @@ interface ButtonLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement>
183
190
  }
184
191
  interface IconGroupLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
185
192
  type: "iconButtonGroup";
193
+ /** Orientation of the divider lines. Defaults to "horizontal". */
194
+ orientation?: DividerOrientation;
186
195
  /** Size variant for the divider (affects line thickness + icon group size). */
187
196
  size?: DividerSize;
188
197
  /** Items rendered as a segmented icon group between the lines. */
package/dist/index.d.ts CHANGED
@@ -146,9 +146,12 @@ interface BadgeStatusProps extends React$1.HTMLAttributes<HTMLDivElement> {
146
146
  declare const BadgeStatus: React$1.ForwardRefExoticComponent<BadgeStatusProps & React$1.RefAttributes<HTMLDivElement>>;
147
147
 
148
148
  type DividerType = "default" | "text" | "iconButton" | "iconButtonGroup" | "button";
149
+ type DividerOrientation = "horizontal" | "vertical";
149
150
  type SimpleDividerType = Exclude<DividerType, "button" | "iconButton" | "iconButtonGroup">;
150
151
  interface BaseDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
151
152
  type?: SimpleDividerType;
153
+ /** Orientation of the divider lines. Defaults to "horizontal". */
154
+ orientation?: DividerOrientation;
152
155
  /** Size variant for the divider (affects line thickness + center element sizing). */
153
156
  size?: DividerSize;
154
157
  /** Label shown for text variant (e.g. "OR"). */
@@ -159,6 +162,8 @@ type IconButtonVariant = ButtonProps["variant"];
159
162
  type DividerSize = IconButtonGroupProps["size"];
160
163
  interface IconLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
161
164
  type: "iconButton";
165
+ /** Orientation of the divider lines. Defaults to "horizontal". */
166
+ orientation?: DividerOrientation;
162
167
  /** Size variant for the divider (affects line thickness + icon button size). */
163
168
  size?: DividerSize;
164
169
  /** Icon rendered between the lines. */
@@ -172,6 +177,8 @@ interface IconLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
172
177
  }
173
178
  interface ButtonLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
174
179
  type: "button";
180
+ /** Orientation of the divider lines. Defaults to "horizontal". */
181
+ orientation?: DividerOrientation;
175
182
  /** Size variant for the divider (affects line thickness + button size). */
176
183
  size?: DividerSize;
177
184
  /** Text inside the button between the lines. */
@@ -183,6 +190,8 @@ interface ButtonLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement>
183
190
  }
184
191
  interface IconGroupLinesDividerProps extends React$1.HTMLAttributes<HTMLDivElement> {
185
192
  type: "iconButtonGroup";
193
+ /** Orientation of the divider lines. Defaults to "horizontal". */
194
+ orientation?: DividerOrientation;
186
195
  /** Size variant for the divider (affects line thickness + icon group size). */
187
196
  size?: DividerSize;
188
197
  /** Items rendered as a segmented icon group between the lines. */
package/dist/index.js CHANGED
@@ -656,7 +656,6 @@ BadgeStatus.displayName = "BadgeStatus";
656
656
  import "react";
657
657
  import { TargetIcon } from "@bubo-squared/icons";
658
658
  import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
659
- var lineClassBase = "flex-1 bg-(--border-secondary) h-px";
660
659
  var gapBySize = {
661
660
  sm: "gap-2",
662
661
  md: "gap-3",
@@ -672,50 +671,74 @@ var textClassBySize = {
672
671
  var Divider = (props) => {
673
672
  const resolvedType = props.type ?? "default";
674
673
  const resolvedSize = props.size ?? "sm";
674
+ const resolvedOrientation = props.orientation ?? "horizontal";
675
+ const ariaOrientation = resolvedOrientation === "vertical" ? "vertical" : "horizontal";
675
676
  const showCenter = resolvedType !== "default";
676
- const lineClass = lineClassBase;
677
+ const lineClass = resolvedOrientation === "vertical" ? "flex-1 bg-(--border-secondary) w-px" : "flex-1 bg-(--border-secondary) h-px";
677
678
  const wrapperClass = cn(
678
- "flex w-full items-center",
679
+ "flex items-center",
680
+ resolvedOrientation === "vertical" ? "h-full flex-col" : "w-full",
679
681
  showCenter ? gapBySize[resolvedSize] : "gap-0",
680
682
  props.className
681
683
  );
682
684
  if (props.type === void 0 || props.type === "default") {
683
685
  const {
684
686
  type: _type,
687
+ orientation: _orientation,
685
688
  size: _size,
686
689
  label: _label,
687
690
  className: _className,
688
691
  ...divProps
689
692
  } = props;
690
- return /* @__PURE__ */ jsx13("div", { className: wrapperClass, ...divProps, children: /* @__PURE__ */ jsx13("div", { className: lineClass }) });
693
+ return /* @__PURE__ */ jsx13(
694
+ "div",
695
+ {
696
+ className: wrapperClass,
697
+ role: "separator",
698
+ "aria-orientation": ariaOrientation,
699
+ ...divProps,
700
+ children: /* @__PURE__ */ jsx13("div", { className: lineClass })
701
+ }
702
+ );
691
703
  }
692
704
  if (props.type === "text") {
693
705
  const {
694
706
  type: _type,
707
+ orientation: _orientation,
695
708
  size: _size,
696
709
  label,
697
710
  className: _className,
698
711
  ...divProps
699
712
  } = props;
700
713
  const textLabel = label ? label : "OR";
701
- return /* @__PURE__ */ jsxs7("div", { className: wrapperClass, ...divProps, children: [
702
- /* @__PURE__ */ jsx13("div", { className: lineClass }),
703
- /* @__PURE__ */ jsx13(
704
- "span",
705
- {
706
- className: cn(
707
- textClassBySize[resolvedSize],
708
- "text-(--color-secondary)"
714
+ return /* @__PURE__ */ jsxs7(
715
+ "div",
716
+ {
717
+ className: wrapperClass,
718
+ role: "separator",
719
+ "aria-orientation": ariaOrientation,
720
+ ...divProps,
721
+ children: [
722
+ /* @__PURE__ */ jsx13("div", { className: lineClass }),
723
+ /* @__PURE__ */ jsx13(
724
+ "span",
725
+ {
726
+ className: cn(
727
+ textClassBySize[resolvedSize],
728
+ "text-(--color-secondary)"
729
+ ),
730
+ children: textLabel
731
+ }
709
732
  ),
710
- children: textLabel
711
- }
712
- ),
713
- /* @__PURE__ */ jsx13("div", { className: lineClass })
714
- ] });
733
+ /* @__PURE__ */ jsx13("div", { className: lineClass })
734
+ ]
735
+ }
736
+ );
715
737
  }
716
738
  if (props.type === "iconButton") {
717
739
  const {
718
740
  type: _type,
741
+ orientation: _orientation,
719
742
  size: _size,
720
743
  icon,
721
744
  iconButtonVariant,
@@ -724,38 +747,65 @@ var Divider = (props) => {
724
747
  className: _className,
725
748
  ...divProps
726
749
  } = props;
727
- return /* @__PURE__ */ jsxs7("div", { className: wrapperClass, ...divProps, children: [
728
- /* @__PURE__ */ jsx13("div", { className: lineClass }),
729
- /* @__PURE__ */ jsx13(
730
- IconButton,
731
- {
732
- variant: iconButtonVariant ?? "secondary",
733
- size: resolvedSize,
734
- "aria-label": ariaLabel ?? "More options",
735
- icon: icon ?? /* @__PURE__ */ jsx13(TargetIcon, {}),
736
- onClick: onIconClick
737
- }
738
- ),
739
- /* @__PURE__ */ jsx13("div", { className: lineClass })
740
- ] });
750
+ return /* @__PURE__ */ jsxs7(
751
+ "div",
752
+ {
753
+ className: wrapperClass,
754
+ role: "separator",
755
+ "aria-orientation": ariaOrientation,
756
+ ...divProps,
757
+ children: [
758
+ /* @__PURE__ */ jsx13("div", { className: lineClass }),
759
+ /* @__PURE__ */ jsx13(
760
+ IconButton,
761
+ {
762
+ variant: iconButtonVariant ?? "secondary",
763
+ size: resolvedSize,
764
+ "aria-label": ariaLabel ?? "More options",
765
+ icon: icon ?? /* @__PURE__ */ jsx13(TargetIcon, {}),
766
+ onClick: onIconClick
767
+ }
768
+ ),
769
+ /* @__PURE__ */ jsx13("div", { className: lineClass })
770
+ ]
771
+ }
772
+ );
741
773
  }
742
774
  if (props.type === "iconButtonGroup") {
743
775
  const {
744
776
  type: _type,
777
+ orientation: _orientation,
745
778
  size: _size,
746
779
  iconGroupItems,
747
780
  className: _className,
748
781
  ...divProps
749
782
  } = props;
750
- return /* @__PURE__ */ jsxs7("div", { className: wrapperClass, ...divProps, children: [
751
- /* @__PURE__ */ jsx13("div", { className: lineClass }),
752
- /* @__PURE__ */ jsx13(IconButtonGroup, { items: iconGroupItems, size: resolvedSize }),
753
- /* @__PURE__ */ jsx13("div", { className: lineClass })
754
- ] });
783
+ return /* @__PURE__ */ jsxs7(
784
+ "div",
785
+ {
786
+ className: wrapperClass,
787
+ role: "separator",
788
+ "aria-orientation": ariaOrientation,
789
+ ...divProps,
790
+ children: [
791
+ /* @__PURE__ */ jsx13("div", { className: lineClass }),
792
+ /* @__PURE__ */ jsx13(
793
+ IconButtonGroup,
794
+ {
795
+ className: resolvedOrientation === "vertical" ? "flex-col" : "flex-row",
796
+ items: iconGroupItems,
797
+ size: resolvedSize
798
+ }
799
+ ),
800
+ /* @__PURE__ */ jsx13("div", { className: lineClass })
801
+ ]
802
+ }
803
+ );
755
804
  }
756
805
  if (props.type === "button") {
757
806
  const {
758
807
  type: _type,
808
+ orientation: _orientation,
759
809
  size: _size,
760
810
  buttonLabel,
761
811
  onButtonClick,
@@ -763,19 +813,28 @@ var Divider = (props) => {
763
813
  className: _className,
764
814
  ...divProps
765
815
  } = props;
766
- return /* @__PURE__ */ jsxs7("div", { className: wrapperClass, ...divProps, children: [
767
- /* @__PURE__ */ jsx13("div", { className: lineClass }),
768
- /* @__PURE__ */ jsx13(
769
- Button,
770
- {
771
- variant: buttonVariant ?? "secondary",
772
- size: resolvedSize,
773
- onClick: onButtonClick,
774
- children: buttonLabel
775
- }
776
- ),
777
- /* @__PURE__ */ jsx13("div", { className: lineClass })
778
- ] });
816
+ return /* @__PURE__ */ jsxs7(
817
+ "div",
818
+ {
819
+ className: wrapperClass,
820
+ role: "separator",
821
+ "aria-orientation": ariaOrientation,
822
+ ...divProps,
823
+ children: [
824
+ /* @__PURE__ */ jsx13("div", { className: lineClass }),
825
+ /* @__PURE__ */ jsx13(
826
+ Button,
827
+ {
828
+ variant: buttonVariant ?? "secondary",
829
+ size: resolvedSize,
830
+ onClick: onButtonClick,
831
+ children: buttonLabel
832
+ }
833
+ ),
834
+ /* @__PURE__ */ jsx13("div", { className: lineClass })
835
+ ]
836
+ }
837
+ );
779
838
  }
780
839
  return null;
781
840
  };