@spark-web/button 2.0.0-rc.9 → 5.0.0-rc.25
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/CHANGELOG.md +271 -0
- package/dist/declarations/src/button-link.d.ts +1 -2
- package/dist/declarations/src/button.d.ts +0 -4
- package/dist/declarations/src/types.d.ts +9 -1
- package/dist/declarations/src/use-button-styles.d.ts +960 -21
- package/dist/declarations/src/utils.d.ts +10 -10
- package/dist/spark-web-button.cjs.dev.js +40 -9
- package/dist/spark-web-button.cjs.prod.js +40 -9
- package/dist/spark-web-button.esm.js +40 -9
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,276 @@
|
|
|
1
1
|
# @spark-web/button
|
|
2
2
|
|
|
3
|
+
## 5.0.0-rc.25
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Implement checkbox tokens for test theme
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies []:
|
|
12
|
+
- @spark-web/spinner@5.0.0-rc.25
|
|
13
|
+
- @spark-web/theme@5.0.0-rc.25
|
|
14
|
+
- @spark-web/utils@5.0.0-rc.25
|
|
15
|
+
- @spark-web/a11y@5.0.0-rc.25
|
|
16
|
+
- @spark-web/icon@5.0.0-rc.25
|
|
17
|
+
- @spark-web/link@5.0.0-rc.25
|
|
18
|
+
- @spark-web/text@5.0.0-rc.25
|
|
19
|
+
- @spark-web/box@5.0.0-rc.25
|
|
20
|
+
|
|
21
|
+
## 5.0.0-rc.24
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- Resolve issues with package build output
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies []:
|
|
30
|
+
- @spark-web/spinner@5.0.0-rc.24
|
|
31
|
+
- @spark-web/theme@5.0.0-rc.24
|
|
32
|
+
- @spark-web/utils@5.0.0-rc.24
|
|
33
|
+
- @spark-web/a11y@5.0.0-rc.24
|
|
34
|
+
- @spark-web/icon@5.0.0-rc.24
|
|
35
|
+
- @spark-web/link@5.0.0-rc.24
|
|
36
|
+
- @spark-web/text@5.0.0-rc.24
|
|
37
|
+
- @spark-web/box@5.0.0-rc.24
|
|
38
|
+
|
|
39
|
+
## 2.0.0-rc.23
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- Add support for component-level theming in ButtonLink
|
|
44
|
+
|
|
45
|
+
## 2.0.0-rc.22
|
|
46
|
+
|
|
47
|
+
### Minor Changes
|
|
48
|
+
|
|
49
|
+
- Add new optional "rounded" prop for Button
|
|
50
|
+
|
|
51
|
+
Add support for custom CSS in Button
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies []:
|
|
56
|
+
- @spark-web/text@2.0.0-rc.22
|
|
57
|
+
|
|
58
|
+
## 2.0.0-rc.21
|
|
59
|
+
|
|
60
|
+
### Minor Changes
|
|
61
|
+
|
|
62
|
+
- Introduce global theming provider to set global default theme
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies []:
|
|
67
|
+
- @spark-web/spinner@2.0.0-rc.21
|
|
68
|
+
- @spark-web/theme@4.0.0-rc.21
|
|
69
|
+
- @spark-web/utils@2.0.0-rc.21
|
|
70
|
+
- @spark-web/a11y@2.0.0-rc.21
|
|
71
|
+
- @spark-web/icon@2.0.0-rc.21
|
|
72
|
+
- @spark-web/link@2.0.0-rc.21
|
|
73
|
+
- @spark-web/text@2.0.0-rc.21
|
|
74
|
+
- @spark-web/box@2.0.0-rc.21
|
|
75
|
+
|
|
76
|
+
## 2.0.0-rc.20
|
|
77
|
+
|
|
78
|
+
### Minor Changes
|
|
79
|
+
|
|
80
|
+
- Support for component-level theming; button-level theming
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- Updated dependencies []:
|
|
85
|
+
- @spark-web/spinner@2.0.0-rc.20
|
|
86
|
+
- @spark-web/theme@4.0.0-rc.20
|
|
87
|
+
- @spark-web/utils@2.0.0-rc.20
|
|
88
|
+
- @spark-web/a11y@2.0.0-rc.20
|
|
89
|
+
- @spark-web/icon@2.0.0-rc.20
|
|
90
|
+
- @spark-web/link@2.0.0-rc.20
|
|
91
|
+
- @spark-web/text@2.0.0-rc.20
|
|
92
|
+
- @spark-web/box@2.0.0-rc.20
|
|
93
|
+
|
|
94
|
+
## 2.0.0-rc.19
|
|
95
|
+
|
|
96
|
+
### Major Changes
|
|
97
|
+
|
|
98
|
+
- test
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- Updated dependencies []:
|
|
103
|
+
- @spark-web/spinner@2.0.0-rc.19
|
|
104
|
+
- @spark-web/theme@4.0.0-rc.19
|
|
105
|
+
- @spark-web/utils@2.0.0-rc.19
|
|
106
|
+
- @spark-web/a11y@2.0.0-rc.19
|
|
107
|
+
- @spark-web/icon@2.0.0-rc.19
|
|
108
|
+
- @spark-web/link@2.0.0-rc.19
|
|
109
|
+
- @spark-web/text@2.0.0-rc.19
|
|
110
|
+
- @spark-web/box@2.0.0-rc.19
|
|
111
|
+
|
|
112
|
+
## 2.0.0-rc.18
|
|
113
|
+
|
|
114
|
+
### Major Changes
|
|
115
|
+
|
|
116
|
+
- tests
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies []:
|
|
121
|
+
- @spark-web/spinner@2.0.0-rc.18
|
|
122
|
+
- @spark-web/theme@4.0.0-rc.18
|
|
123
|
+
- @spark-web/utils@2.0.0-rc.18
|
|
124
|
+
- @spark-web/a11y@2.0.0-rc.18
|
|
125
|
+
- @spark-web/icon@2.0.0-rc.18
|
|
126
|
+
- @spark-web/link@2.0.0-rc.18
|
|
127
|
+
- @spark-web/text@2.0.0-rc.18
|
|
128
|
+
- @spark-web/box@2.0.0-rc.18
|
|
129
|
+
|
|
130
|
+
## 2.0.0-rc.17
|
|
131
|
+
|
|
132
|
+
### Major Changes
|
|
133
|
+
|
|
134
|
+
- test
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- Updated dependencies []:
|
|
139
|
+
- @spark-web/spinner@2.0.0-rc.17
|
|
140
|
+
- @spark-web/theme@4.0.0-rc.17
|
|
141
|
+
- @spark-web/utils@2.0.0-rc.17
|
|
142
|
+
- @spark-web/a11y@2.0.0-rc.17
|
|
143
|
+
- @spark-web/icon@2.0.0-rc.17
|
|
144
|
+
- @spark-web/link@2.0.0-rc.17
|
|
145
|
+
- @spark-web/text@2.0.0-rc.17
|
|
146
|
+
- @spark-web/box@2.0.0-rc.17
|
|
147
|
+
|
|
148
|
+
## 2.0.0-rc.16
|
|
149
|
+
|
|
150
|
+
### Major Changes
|
|
151
|
+
|
|
152
|
+
- test
|
|
153
|
+
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- Updated dependencies []:
|
|
157
|
+
- @spark-web/spinner@2.0.0-rc.16
|
|
158
|
+
- @spark-web/theme@4.0.0-rc.16
|
|
159
|
+
- @spark-web/utils@2.0.0-rc.16
|
|
160
|
+
- @spark-web/a11y@2.0.0-rc.16
|
|
161
|
+
- @spark-web/icon@2.0.0-rc.16
|
|
162
|
+
- @spark-web/link@2.0.0-rc.16
|
|
163
|
+
- @spark-web/text@2.0.0-rc.16
|
|
164
|
+
- @spark-web/box@2.0.0-rc.16
|
|
165
|
+
|
|
166
|
+
## 2.0.0-rc.15
|
|
167
|
+
|
|
168
|
+
### Major Changes
|
|
169
|
+
|
|
170
|
+
- test
|
|
171
|
+
|
|
172
|
+
### Patch Changes
|
|
173
|
+
|
|
174
|
+
- Updated dependencies []:
|
|
175
|
+
- @spark-web/spinner@2.0.0-rc.15
|
|
176
|
+
- @spark-web/theme@4.0.0-rc.15
|
|
177
|
+
- @spark-web/utils@2.0.0-rc.15
|
|
178
|
+
- @spark-web/a11y@2.0.0-rc.15
|
|
179
|
+
- @spark-web/icon@2.0.0-rc.15
|
|
180
|
+
- @spark-web/link@2.0.0-rc.15
|
|
181
|
+
- @spark-web/text@2.0.0-rc.15
|
|
182
|
+
- @spark-web/box@2.0.0-rc.15
|
|
183
|
+
|
|
184
|
+
## 2.0.0-rc.14
|
|
185
|
+
|
|
186
|
+
### Major Changes
|
|
187
|
+
|
|
188
|
+
- test
|
|
189
|
+
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- Updated dependencies []:
|
|
193
|
+
- @spark-web/spinner@2.0.0-rc.14
|
|
194
|
+
- @spark-web/theme@4.0.0-rc.14
|
|
195
|
+
- @spark-web/utils@2.0.0-rc.14
|
|
196
|
+
- @spark-web/a11y@2.0.0-rc.14
|
|
197
|
+
- @spark-web/icon@2.0.0-rc.14
|
|
198
|
+
- @spark-web/link@2.0.0-rc.14
|
|
199
|
+
- @spark-web/text@2.0.0-rc.14
|
|
200
|
+
- @spark-web/box@2.0.0-rc.14
|
|
201
|
+
|
|
202
|
+
## 2.0.0-rc.13
|
|
203
|
+
|
|
204
|
+
### Major Changes
|
|
205
|
+
|
|
206
|
+
- test
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- Updated dependencies []:
|
|
211
|
+
- @spark-web/spinner@2.0.0-rc.13
|
|
212
|
+
- @spark-web/theme@4.0.0-rc.13
|
|
213
|
+
- @spark-web/utils@2.0.0-rc.13
|
|
214
|
+
- @spark-web/a11y@2.0.0-rc.13
|
|
215
|
+
- @spark-web/icon@2.0.0-rc.13
|
|
216
|
+
- @spark-web/link@2.0.0-rc.13
|
|
217
|
+
- @spark-web/text@2.0.0-rc.13
|
|
218
|
+
- @spark-web/box@2.0.0-rc.13
|
|
219
|
+
|
|
220
|
+
## 2.0.0-rc.12
|
|
221
|
+
|
|
222
|
+
### Major Changes
|
|
223
|
+
|
|
224
|
+
- test
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- Updated dependencies []:
|
|
229
|
+
- @spark-web/spinner@2.0.0-rc.12
|
|
230
|
+
- @spark-web/theme@4.0.0-rc.12
|
|
231
|
+
- @spark-web/utils@2.0.0-rc.12
|
|
232
|
+
- @spark-web/a11y@2.0.0-rc.12
|
|
233
|
+
- @spark-web/icon@2.0.0-rc.12
|
|
234
|
+
- @spark-web/link@2.0.0-rc.12
|
|
235
|
+
- @spark-web/text@2.0.0-rc.12
|
|
236
|
+
- @spark-web/box@2.0.0-rc.12
|
|
237
|
+
|
|
238
|
+
## 2.0.0-rc.11
|
|
239
|
+
|
|
240
|
+
### Major Changes
|
|
241
|
+
|
|
242
|
+
- test
|
|
243
|
+
|
|
244
|
+
### Patch Changes
|
|
245
|
+
|
|
246
|
+
- Updated dependencies []:
|
|
247
|
+
- @spark-web/spinner@2.0.0-rc.11
|
|
248
|
+
- @spark-web/theme@4.0.0-rc.11
|
|
249
|
+
- @spark-web/utils@2.0.0-rc.11
|
|
250
|
+
- @spark-web/a11y@2.0.0-rc.11
|
|
251
|
+
- @spark-web/icon@2.0.0-rc.11
|
|
252
|
+
- @spark-web/link@2.0.0-rc.11
|
|
253
|
+
- @spark-web/text@2.0.0-rc.11
|
|
254
|
+
- @spark-web/box@2.0.0-rc.11
|
|
255
|
+
|
|
256
|
+
## 2.0.0-rc.10
|
|
257
|
+
|
|
258
|
+
### Major Changes
|
|
259
|
+
|
|
260
|
+
- test
|
|
261
|
+
|
|
262
|
+
### Patch Changes
|
|
263
|
+
|
|
264
|
+
- Updated dependencies []:
|
|
265
|
+
- @spark-web/spinner@2.0.0-rc.10
|
|
266
|
+
- @spark-web/theme@4.0.0-rc.10
|
|
267
|
+
- @spark-web/utils@2.0.0-rc.10
|
|
268
|
+
- @spark-web/a11y@2.0.0-rc.10
|
|
269
|
+
- @spark-web/icon@2.0.0-rc.10
|
|
270
|
+
- @spark-web/link@2.0.0-rc.10
|
|
271
|
+
- @spark-web/text@2.0.0-rc.10
|
|
272
|
+
- @spark-web/box@2.0.0-rc.10
|
|
273
|
+
|
|
3
274
|
## 2.0.0-rc.9
|
|
4
275
|
|
|
5
276
|
### Major Changes
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import type { LinkComponentProps } from '@spark-web/link';
|
|
3
3
|
import type { CommonButtonProps } from "./types.js";
|
|
4
4
|
export declare type ButtonLinkProps = LinkComponentProps & CommonButtonProps;
|
|
5
|
-
/** The appearance of a `Button`, with the semantics of a link. */
|
|
6
5
|
export declare const ButtonLink: <Comp extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "a">(props: {
|
|
7
6
|
as?: Comp | undefined;
|
|
8
|
-
ref?: import("react").Ref<Comp extends "symbol" | "
|
|
7
|
+
ref?: import("react").Ref<Comp extends "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
|
|
9
8
|
} & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & ButtonLinkProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -21,8 +21,4 @@ export declare type ButtonProps = CommonButtonProps & {
|
|
|
21
21
|
/** Provide an alternate type if the button is within a form. */
|
|
22
22
|
type?: 'button' | 'submit' | 'reset';
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Buttons are used to initialize an action, their label should express what
|
|
26
|
-
* action will occur when the user interacts with it.
|
|
27
|
-
*/
|
|
28
24
|
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { CSSObject } from '@emotion/react';
|
|
1
2
|
import type { BackgroundTone } from '@spark-web/a11y';
|
|
2
3
|
import type { IconProps } from '@spark-web/icon';
|
|
4
|
+
import type { SparkThemeName } from '@spark-web/theme';
|
|
3
5
|
import type { DataAttributeMap } from '@spark-web/utils/internal';
|
|
4
6
|
import type { ButtonHTMLAttributes, ReactElement } from 'react';
|
|
5
7
|
import type { mapTokens } from "./utils.js";
|
|
@@ -25,10 +27,16 @@ export declare type CommonButtonProps = {
|
|
|
25
27
|
data?: DataAttributeMap;
|
|
26
28
|
/** Unique identifier for the underlying element. */
|
|
27
29
|
id?: string;
|
|
28
|
-
|
|
30
|
+
/** The theme to use for the button styles. Defaults to Brighte. */
|
|
31
|
+
theme?: SparkThemeName;
|
|
32
|
+
} & ButtonStyleProps & ButtonChildrenProps;
|
|
29
33
|
export declare type ButtonStyleProps = {
|
|
34
|
+
/** Sets override styles for the button. */
|
|
35
|
+
css?: CSSObject;
|
|
30
36
|
/** Sets the visual prominence of the button. */
|
|
31
37
|
prominence?: ButtonProminence;
|
|
38
|
+
/** Sets whether the button has rounded sides. */
|
|
39
|
+
rounded?: boolean;
|
|
32
40
|
/** Sets the size of the button. */
|
|
33
41
|
size?: ButtonSize;
|
|
34
42
|
/** Sets the tone of the button. */
|