@versini/ui-types 4.0.0 → 4.0.1

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 +45 -13
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -99,7 +99,51 @@ declare namespace ButtonLinkTypes {
99
99
  }
100
100
 
101
101
  declare namespace ButtonIconTypes {
102
- export type Props = {
102
+ // Union type to require label if labelLeft/labelRight are undefined
103
+ type LabelProps =
104
+ | {
105
+ /**
106
+ * The label to use as aria-label.
107
+ */
108
+ label?: string;
109
+ /**
110
+ * The label to show to the left of the icon.
111
+ */
112
+ labelLeft: string;
113
+ /**
114
+ * The label to show to the right of the icon.
115
+ */
116
+ labelRight?: string;
117
+ }
118
+ | {
119
+ /**
120
+ * The label to use as aria-label.
121
+ */
122
+ label?: string;
123
+ /**
124
+ * The label to show to the left of the icon.
125
+ */
126
+ labelLeft?: string;
127
+ /**
128
+ * The label to show to the right of the icon.
129
+ */
130
+ labelRight: string;
131
+ }
132
+ | {
133
+ /**
134
+ * The label to use as aria-label.
135
+ */
136
+ label: string;
137
+ /**
138
+ * The label to show to the left of the icon.
139
+ */
140
+ labelLeft?: undefined;
141
+ /**
142
+ * The label to show to the right of the icon.
143
+ */
144
+ labelRight?: undefined;
145
+ };
146
+ export type Props = LabelProps & {
103
147
  /**
104
148
  * The icon to render in the button.
105
149
  */
@@ -109,18 +153,6 @@ declare namespace ButtonIconTypes {
109
153
  * @default center
110
154
  */
111
155
  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
156
  /**
125
157
  * Option to make the Button transparent.
126
158
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-types",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
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
+ "gitHead": "ad21cab4bf6b5fc26fc8bf9b61fb5f00ef0f66f6"
36
36
  }