@versini/ui-button 13.0.0 → 13.1.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/README.md CHANGED
@@ -16,7 +16,7 @@ The Button package provides a complete set of button components including standa
16
16
 
17
17
  ## Features
18
18
 
19
- - **🎯 Multiple Button Types**: Button, ButtonIcon, ButtonLink, ButtonCopy
19
+ - **🎯 Multiple Button Types**: Button, ButtonIcon, ButtonLink, ButtonCopy, ButtonGroup
20
20
  - **♿ Accessible**: WCAG compliant with proper ARIA support and keyboard navigation
21
21
  - **🎨 Customizable**: Multiple variants, sizes, and styling options
22
22
  - **🌲 Tree-shakeable**: Import only the components you need
@@ -89,6 +89,39 @@ function App() {
89
89
  }
90
90
  ```
91
91
 
92
+ ### Button Group
93
+
94
+ ```tsx
95
+ import { Button } from "@versini/ui-button/button";
96
+ import { ButtonGroup } from "@versini/ui-button/button-group";
97
+
98
+ function App() {
99
+ return (
100
+ <ButtonGroup gap="medium">
101
+ <Button>OK</Button>
102
+ <Button>Cancel and go back</Button>
103
+ </ButtonGroup>
104
+ );
105
+ }
106
+ ```
107
+
108
+ ### Vertical Button Group
109
+
110
+ ```tsx
111
+ import { Button } from "@versini/ui-button/button";
112
+ import { ButtonGroup } from "@versini/ui-button/button-group";
113
+
114
+ function App() {
115
+ return (
116
+ <ButtonGroup orientation="vertical">
117
+ <Button>Save changes</Button>
118
+ <Button variant="secondary">Cancel</Button>
119
+ <Button variant="danger">Delete account</Button>
120
+ </ButtonGroup>
121
+ );
122
+ }
123
+ ```
124
+
92
125
  ### Different Variants
93
126
 
94
127
  ```tsx
@@ -216,3 +249,15 @@ _Inherits all Button props_
216
249
  | copyToClipboard | `string \| (() => string)` | - | What text to copy to the clipboard |
217
250
 
218
251
  _Inherits all ButtonIcon props except children, align, label, fullWidth, size_
252
+
253
+ ### ButtonGroup Props
254
+
255
+ | Prop | Type | Default | Description |
256
+ | ----------- | ---------------------------------- | -------------- | -------------------------------------------------- |
257
+ | children | `React.ReactNode` | - | The buttons to render in the group |
258
+ | gap | `"small" \| "medium" \| "large"` | `"medium"` | The spacing between buttons in the group |
259
+ | orientation | `"horizontal" \| "vertical"` | `"horizontal"` | The layout direction of the button group |
260
+ | className | `string` | - | CSS class(es) to add to the main component wrapper |
261
+ | aria-label | `string` | - | Accessible label for the button group |
262
+
263
+ _Renders with `role="group"`. All buttons share equal width via CSS Grid._
@@ -1,11 +1,9 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
6
- import clsx from "clsx";
7
-
8
-
6
+ import { clsx } from "./726.js";
9
7
 
10
8
  const BUTTON_CLASSNAME = "av-button";
11
9
 
@@ -452,5 +450,4 @@ const getButtonClasses = ({ type, className, raw, mode, disabled, fullWidth, siz
452
450
  }), className);
453
451
  };
454
452
 
455
- export { TYPE_BUTTON, TYPE_ICON, TYPE_LINK, clsx, getBadgeClasses, getButtonClasses, getButtonIconLabelClasses, getIconClasses };
456
- export { jsx, jsxs } from "react/jsx-runtime";
453
+ export { TYPE_BUTTON, TYPE_ICON, TYPE_LINK, getBadgeClasses, getButtonClasses, getButtonIconLabelClasses, getIconClasses };
package/dist/370.js CHANGED
@@ -1,12 +1,14 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
6
6
  import { useMergeRefs } from "@versini/ui-hooks/use-merge-refs";
7
7
  import { useResizeObserver } from "@versini/ui-hooks/use-resize-observer";
8
- import { jsxs, getButtonClasses, getIconClasses, getButtonIconLabelClasses, TYPE_ICON, getBadgeClasses, jsx } from "./188.js";
9
- import { useLayoutEffect, useRef, useEffect, BaseButton_private } from "./795.js";
8
+ import { jsxs, jsx } from "./726.js";
9
+ import { useRef, useLayoutEffect, useEffect } from "./946.js";
10
+ import { getButtonClasses, getIconClasses, getButtonIconLabelClasses, TYPE_ICON, getBadgeClasses } from "./277.js";
11
+ import { BaseButton_private } from "./795.js";
10
12
 
11
13
 
12
14
 
package/dist/726.js ADDED
@@ -0,0 +1,9 @@
1
+ /*!
2
+ @versini/ui-button v13.1.0
3
+ © 2026 gizmette.com
4
+ */
5
+
6
+
7
+
8
+ export { jsx, jsxs } from "react/jsx-runtime";
9
+ export { default as clsx } from "clsx";
package/dist/795.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
6
- import { jsx } from "./188.js";
7
-
6
+ import { jsx } from "./726.js";
7
+ import "./946.js";
8
8
 
9
9
 
10
10
 
@@ -40,4 +40,3 @@ import { jsx } from "./188.js";
40
40
  }
41
41
 
42
42
  export { BaseButton_private };
43
- export { useEffect, useLayoutEffect, useRef, useState } from "react";
package/dist/946.js ADDED
@@ -0,0 +1,7 @@
1
+ /*!
2
+ @versini/ui-button v13.1.0
3
+ © 2026 gizmette.com
4
+ */
5
+
6
+
7
+ export { default as react, useEffect, useLayoutEffect, useRef, useState } from "react";
@@ -1,9 +1,10 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
6
- import { getButtonClasses, TYPE_BUTTON, jsx } from "../../188.js";
6
+ import { jsx } from "../../726.js";
7
+ import { getButtonClasses, TYPE_BUTTON } from "../../277.js";
7
8
  import { BaseButton_private } from "../../795.js";
8
9
 
9
10
 
@@ -1,11 +1,11 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
6
6
  import { IconCopied, IconCopy } from "@versini/ui-icons";
7
- import { jsx } from "../../188.js";
8
- import { useState, useEffect } from "../../795.js";
7
+ import { jsx } from "../../726.js";
8
+ import { useState, useEffect } from "../../946.js";
9
9
  import { ButtonIcon } from "../../370.js";
10
10
 
11
11
 
@@ -0,0 +1,2 @@
1
+ import type { ButtonGroupTypes } from "@versini/ui-types";
2
+ export declare function ButtonGroup({ children, gap, orientation, className, ...otherProps }: ButtonGroupTypes.Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ /*!
2
+ @versini/ui-button v13.1.0
3
+ © 2026 gizmette.com
4
+ */
5
+
6
+ import { clsx, jsx } from "../../726.js";
7
+ import { react } from "../../946.js";
8
+
9
+
10
+ const getButtonGroupClasses = ({ gap = "medium", className })=>{
11
+ return clsx("grid", {
12
+ "gap-1": gap === "small",
13
+ "gap-2": gap === "medium",
14
+ "gap-4": gap === "large"
15
+ }, className);
16
+ };
17
+ const getButtonGroupStyle = ({ orientation = "horizontal", childCount })=>{
18
+ if (orientation === "vertical") {
19
+ return {
20
+ gridTemplateColumns: "1fr"
21
+ };
22
+ }
23
+ return {
24
+ gridTemplateColumns: `repeat(${childCount}, minmax(0, 1fr))`
25
+ };
26
+ };
27
+
28
+
29
+
30
+
31
+ const getValidChildCount = (children)=>{
32
+ return react.Children.toArray(children).length;
33
+ };
34
+ function ButtonGroup({ children, gap = "medium", orientation = "horizontal", className, ...otherProps }) {
35
+ const childCount = getValidChildCount(children);
36
+ const groupClass = getButtonGroupClasses({
37
+ gap,
38
+ className
39
+ });
40
+ const groupStyle = getButtonGroupStyle({
41
+ orientation,
42
+ childCount
43
+ });
44
+ return /*#__PURE__*/ jsx("div", {
45
+ role: "group",
46
+ className: groupClass,
47
+ style: groupStyle,
48
+ ...otherProps,
49
+ children: children
50
+ });
51
+ }
52
+
53
+ export { ButtonGroup };
@@ -0,0 +1,6 @@
1
+ import type { ButtonGroupTypes } from "@versini/ui-types";
2
+ export declare const getButtonGroupClasses: ({ gap, className, }: Pick<ButtonGroupTypes.Props, "gap" | "className">) => string;
3
+ export declare const getButtonGroupStyle: ({ orientation, childCount, }: {
4
+ orientation?: ButtonGroupTypes.Props["orientation"];
5
+ childCount: number;
6
+ }) => React.CSSProperties;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
@@ -1,9 +1,10 @@
1
1
  /*!
2
- @versini/ui-button v13.0.0
2
+ @versini/ui-button v13.1.0
3
3
  © 2026 gizmette.com
4
4
  */
5
5
 
6
- import { jsxs, getButtonClasses, TYPE_LINK, clsx, jsx } from "../../188.js";
6
+ import { jsxs, clsx, jsx } from "../../726.js";
7
+ import { getButtonClasses, TYPE_LINK } from "../../277.js";
7
8
 
8
9
 
9
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-button",
3
- "version": "13.0.0",
3
+ "version": "13.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -25,6 +25,10 @@
25
25
  "types": "./dist/components/Button/ButtonIcon.d.ts",
26
26
  "import": "./dist/components/Button/ButtonIcon.js"
27
27
  },
28
+ "./button-group": {
29
+ "types": "./dist/components/Button/ButtonGroup.d.ts",
30
+ "import": "./dist/components/Button/ButtonGroup.js"
31
+ },
28
32
  "./button-link": {
29
33
  "types": "./dist/components/Button/ButtonLink.d.ts",
30
34
  "import": "./dist/components/Button/ButtonLink.js"
@@ -59,7 +63,7 @@
59
63
  },
60
64
  "devDependencies": {
61
65
  "@testing-library/jest-dom": "6.9.1",
62
- "@versini/ui-types": "9.0.0"
66
+ "@versini/ui-types": "9.1.0"
63
67
  },
64
68
  "dependencies": {
65
69
  "@versini/ui-hooks": "6.1.1",
@@ -70,5 +74,5 @@
70
74
  "sideEffects": [
71
75
  "**/*.css"
72
76
  ],
73
- "gitHead": "a295349019d1512796f266bba535de383f12b6ee"
77
+ "gitHead": "e1d07ef9f8c39af8e1cf471a2d1688f4bca1771c"
74
78
  }