@versini/ui-types 8.1.1 → 8.3.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +28 -0
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -46,6 +46,10 @@ type CommonButtonProps = {
46
46
 
47
47
  declare namespace ButtonTypes {
48
48
  export type Props = {
49
+ /**
50
+ * A ref to the button element.
51
+ */
52
+ ref?: React.Ref<HTMLButtonElement>;
49
53
  /**
50
54
  * The text to render in the button.
51
55
  */
@@ -77,6 +81,10 @@ declare namespace ButtonTypes {
77
81
 
78
82
  declare namespace ButtonLinkTypes {
79
83
  export type Props = {
84
+ /**
85
+ * A ref to the anchor element.
86
+ */
87
+ ref?: React.Ref<HTMLAnchorElement>;
80
88
  /**
81
89
  * Whether or not to add an icon indicating that the link
82
90
  * opens in a new window.
@@ -144,6 +152,10 @@ declare namespace ButtonIconTypes {
144
152
  labelRight?: undefined;
145
153
  };
146
154
  export type Props = LabelProps & {
155
+ /**
156
+ * A ref to the button element.
157
+ */
158
+ ref?: React.Ref<HTMLButtonElement>;
147
159
  /**
148
160
  * The icon to render in the button.
149
161
  */
@@ -171,12 +183,24 @@ declare namespace ButtonIconTypes {
171
183
  * @default false
172
184
  */
173
185
  animated?: boolean;
186
+ /**
187
+ * Show a badge on the button icon.
188
+ * - If `true`, a red dot badge will be displayed.
189
+ * - If a number, the number will be displayed in the badge.
190
+ * - Numbers greater than 99 will be displayed as "99+".
191
+ * @default undefined
192
+ */
193
+ badge?: boolean | number;
174
194
  } & CommonButtonProps &
175
195
  React.ButtonHTMLAttributes<HTMLButtonElement>;
176
196
  }
177
197
 
178
198
  declare namespace ButtonSortTypes {
179
199
  export type Props = {
200
+ /**
201
+ * A ref to the button element.
202
+ */
203
+ ref?: React.Ref<HTMLButtonElement>;
180
204
  /**
181
205
  * Prop to signal if the Button is active.
182
206
  */
@@ -186,6 +210,10 @@ declare namespace ButtonSortTypes {
186
210
 
187
211
  declare namespace ButtonCopyTypes {
188
212
  export type Props = {
213
+ /**
214
+ * A ref to the button element.
215
+ */
216
+ ref?: React.Ref<HTMLButtonElement>;
189
217
  /**
190
218
  * What kind of text to copy to the clipboard.
191
219
  * - If a string is passed, that string will be copied.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-types",
3
- "version": "8.1.1",
3
+ "version": "8.3.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
32
32
  "test:watch": "vitest",
33
33
  "test": "vitest run"
34
34
  },
35
- "gitHead": "a3730974df8fcea3c016bd83844c4243dbb10208"
35
+ "gitHead": "fae53f4bd56440f7a72ed63b1a2a02b0c3b5a7e6"
36
36
  }