@versini/ui-types 4.0.0 → 4.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +69 -14
  2. package/package.json +5 -2
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import React$1 from 'react';
2
+ import { Placement } from '@floating-ui/react';
2
3
 
3
4
  type CommonButtonProps = {
4
5
  /**
@@ -99,7 +100,51 @@ declare namespace ButtonLinkTypes {
99
100
  }
100
101
 
101
102
  declare namespace ButtonIconTypes {
102
- export type Props = {
103
+ // Union type to require label if labelLeft/labelRight are undefined
104
+ type LabelProps =
105
+ | {
106
+ /**
107
+ * The label to use as aria-label.
108
+ */
109
+ label?: string;
110
+ /**
111
+ * The label to show to the left of the icon.
112
+ */
113
+ labelLeft: string;
114
+ /**
115
+ * The label to show to the right of the icon.
116
+ */
117
+ labelRight?: string;
118
+ }
119
+ | {
120
+ /**
121
+ * The label to use as aria-label.
122
+ */
123
+ label?: string;
124
+ /**
125
+ * The label to show to the left of the icon.
126
+ */
127
+ labelLeft?: string;
128
+ /**
129
+ * The label to show to the right of the icon.
130
+ */
131
+ labelRight: string;
132
+ }
133
+ | {
134
+ /**
135
+ * The label to use as aria-label.
136
+ */
137
+ label: string;
138
+ /**
139
+ * The label to show to the left of the icon.
140
+ */
141
+ labelLeft?: undefined;
142
+ /**
143
+ * The label to show to the right of the icon.
144
+ */
145
+ labelRight?: undefined;
146
+ };
147
+ export type Props = LabelProps & {
103
148
  /**
104
149
  * The icon to render in the button.
105
150
  */
@@ -109,18 +154,6 @@ declare namespace ButtonIconTypes {
109
154
  * @default center
110
155
  */
111
156
  align?: "left" | "right" | "center";
112
- /**
113
- * The label to use as aria-label.
114
- */
115
- label?: string;
116
- /**
117
- * The label to show to the left of the icon.
118
- */
119
- labelLeft?: string;
120
- /**
121
- * The label to show to the right of the icon.
122
- */
123
- labelRight?: string;
124
157
  /**
125
158
  * Option to make the Button transparent.
126
159
  */
@@ -352,4 +385,26 @@ declare namespace SvgIconTypes {
352
385
  };
353
386
  }
354
387
 
355
- export { ButtonCopyTypes, ButtonIconTypes, ButtonLinkTypes, ButtonSortTypes, ButtonTypes, CardTypes, LiveRegionTypes, ModalTypes, SvgIconTypes };
388
+ declare namespace TooltipTypes {
389
+ export type Props = {
390
+ /**
391
+ * The label to show in the tooltip.
392
+ */
393
+ label: string;
394
+ /**
395
+ * The trigger element for the tooltip.
396
+ */
397
+ trigger: React.ReactNode;
398
+ /**
399
+ * The placement of the tooltip.
400
+ * @default top
401
+ */
402
+ placement?: Placement;
403
+ /**
404
+ * The mode of tooltip. This will change the color of the tooltip.
405
+ */
406
+ mode?: "dark" | "light" | "system" | "alt-system";
407
+ };
408
+ }
409
+
410
+ export { ButtonCopyTypes, ButtonIconTypes, ButtonLinkTypes, ButtonSortTypes, ButtonTypes, CardTypes, LiveRegionTypes, ModalTypes, SvgIconTypes, TooltipTypes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-types",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -32,5 +32,8 @@
32
32
  "react": "^18.3.1 || ^19.0.0",
33
33
  "react-dom": "^18.3.1 || ^19.0.0"
34
34
  },
35
- "gitHead": "406bf426c5b3186ef7197e0b51d83ec0de689cde"
35
+ "devDependencies": {
36
+ "@floating-ui/react": "0.27.3"
37
+ },
38
+ "gitHead": "62e5ad9aef3842ebba9e968c0cde595e6fd81544"
36
39
  }