@cloudflare/component-button 8.5.10 → 8.5.12
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 +11 -0
- package/dist/Button.d.ts +4 -1
- package/es/Button.js +4 -3
- package/lib/Button.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 8.5.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0dccb6d732: feat(@cloudflare/component-button): DESSYS-1848 Add iconProps prop
|
|
8
|
+
In the Workers and Pages settings pages, we make use of component-button for our action buttons. Each of these buttons' icons have a margin-right specified on them in accordance with the iconPosition prop. If the position is "left" (default), then a margin-right is applied and the reverse it true for right.
|
|
9
|
+
|
|
10
|
+
We'd like to able to override that margin and zero it out. This change proposes the introduction of a new prop to component-button: `iconProps` which passes through props to the Icon component from Button.
|
|
11
|
+
|
|
12
|
+
## 8.5.11
|
|
13
|
+
|
|
3
14
|
## 8.5.10
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ThemeProp } from '@cloudflare/style-container';
|
|
3
|
-
import { IconType } from '@cloudflare/component-icon';
|
|
3
|
+
import { Icon, IconType } from '@cloudflare/component-icon';
|
|
4
|
+
declare type IconProps = React.ComponentProps<typeof Icon>;
|
|
4
5
|
export declare const buttonStyles: (props: PropsWithTheme) => {
|
|
5
6
|
readonly borderTopRightRadius: 0 | "4px";
|
|
6
7
|
readonly borderTopLeftRadius: 0 | "4px";
|
|
@@ -117,6 +118,7 @@ declare type Props = React.PropsWithChildren<{
|
|
|
117
118
|
inverted?: boolean;
|
|
118
119
|
iconType?: IconType;
|
|
119
120
|
iconLabel?: string;
|
|
121
|
+
iconProps?: IconProps;
|
|
120
122
|
iconSize?: number;
|
|
121
123
|
iconPosition?: 'left' | 'right';
|
|
122
124
|
ariaLabel?: string;
|
|
@@ -150,6 +152,7 @@ declare const _default: React.ComponentType<{
|
|
|
150
152
|
group?: "first" | "last" | "inbetween" | undefined;
|
|
151
153
|
iconType?: "search" | "link" | "code" | "script" | "time" | "filter" | "image" | "right" | "none" | "download" | "list" | "version" | "key" | "left" | "revert" | "copy" | "help" | "add" | "subtract" | "warning" | "pause" | "dlp" | "timer" | "account-analytics-logo" | "add-member" | "ai-audit" | "analytics-data" | "api-security" | "api" | "applications" | "arrow-down" | "arrow-external-link" | "backward" | "bolt" | "byoip" | "calendar" | "calls" | "carbon" | "caret-double-left" | "caret-double-right" | "caret-down" | "caret-down-stroke" | "caret-left" | "caret-left-stroke" | "caret-right" | "caret-right-stroke" | "caret-up" | "caret-up-stroke" | "case-study" | "certificate" | "chart" | "clipboard" | "cloud-internet-solid" | "cloud-internet" | "cloud-multi" | "cloudflare-access" | "cloudflare-dex" | "cloudflare-email-security" | "cloudflare-magic-wan" | "cloudflare-security-application" | "cloudflare-security-network" | "cloudflare-zero-trust" | "code-edit" | "connector" | "credit-card" | "d1" | "ddos-attack" | "device-desktop" | "device-laptop" | "device-mobile" | "device-tablet" | "discord" | "discover" | "documentation" | "drive" | "edge-log-delivery" | "edgeworker" | "edit" | "email-forwarding" | "exclamation-sign" | "expand" | "external-link" | "eye" | "facebook" | "file" | "firewall-rules" | "flowchart" | "folder" | "forward" | "funnel" | "garbage" | "gateway" | "gear" | "git-branch" | "github" | "globe" | "hamburger" | "hide-eye" | "home" | "hyperdrive" | "inbox" | "info-sign" | "internet-browser" | "leaf" | "linkedin" | "lock" | "logs" | "magic-firewall" | "magic-transit-logo" | "mail" | "minus" | "more" | "network-analytics-logo" | "network-security" | "network" | "no-edit" | "notifications" | "office-branch" | "ok-sign" | "ok" | "optimization-scale" | "pages-logo" | "platform-apps" | "plus" | "printer" | "processing" | "product-security-center" | "pub-sub" | "pull-request" | "queues" | "r2" | "refresh" | "registrar-logo" | "reliability-dns" | "reliability-load-balancer" | "remove" | "reorder" | "resize-horizontal" | "retarget" | "router" | "security-bots" | "security-waf" | "server-origin" | "shield" | "spectrum" | "speech" | "star-outline" | "star" | "stream" | "tail-worker" | "teams" | "terraform" | "thumbs-down-outline" | "thumbs-down-solid" | "thumbs-up-outline" | "thumbs-up-solid" | "trace" | "traffic-attack-browser" | "turnstile" | "twitter" | "two-way" | "unlock-outline" | "upload" | "user-multi" | "user-outline" | "user" | "vectorize" | "waiting-room" | "warp" | "web-analytics-logo" | "web3" | "workers-bundled" | "workers-constellation" | "workers-durable-objects" | "workers-for-platforms" | "workers-kv" | "workers-pages" | "workers-unbound" | "wrangler" | "wrench" | "youtube" | "zaraz" | "zero-trust-risk-scoring" | "zerotrust-casb-logo" | "zerotrust-networks-logo" | undefined;
|
|
152
154
|
iconLabel?: string | undefined;
|
|
155
|
+
iconProps?: IconProps | undefined;
|
|
153
156
|
iconSize?: number | undefined;
|
|
154
157
|
iconPosition?: "right" | "left" | undefined;
|
|
155
158
|
noWrapText?: boolean | undefined;
|
package/es/Button.js
CHANGED
|
@@ -252,6 +252,7 @@ var Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
252
252
|
onClick,
|
|
253
253
|
iconType,
|
|
254
254
|
iconLabel,
|
|
255
|
+
iconProps,
|
|
255
256
|
iconSize,
|
|
256
257
|
iconPosition = 'left',
|
|
257
258
|
form,
|
|
@@ -273,15 +274,15 @@ var Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
273
274
|
tabIndex: tabIndex,
|
|
274
275
|
ref: ref,
|
|
275
276
|
"aria-label": ariaLabel
|
|
276
|
-
}), iconType && iconPosition === 'left' && /*#__PURE__*/React.createElement(Icon, {
|
|
277
|
+
}), iconType && iconPosition === 'left' && /*#__PURE__*/React.createElement(Icon, _extends({
|
|
277
278
|
size: iconSize,
|
|
278
279
|
type: iconType,
|
|
279
280
|
ariaLabel: iconLabel
|
|
280
|
-
}), children, iconType && iconPosition === 'right' && /*#__PURE__*/React.createElement(Icon, {
|
|
281
|
+
}, iconProps)), children, iconType && iconPosition === 'right' && /*#__PURE__*/React.createElement(Icon, _extends({
|
|
281
282
|
size: iconSize,
|
|
282
283
|
type: iconType,
|
|
283
284
|
ariaLabel: iconLabel
|
|
284
|
-
}));
|
|
285
|
+
}, iconProps)));
|
|
285
286
|
});
|
|
286
287
|
Button.propTypes = {
|
|
287
288
|
id: PropTypes.string,
|
package/lib/Button.js
CHANGED
|
@@ -269,6 +269,7 @@ var Button = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
269
269
|
onClick = props.onClick,
|
|
270
270
|
iconType = props.iconType,
|
|
271
271
|
iconLabel = props.iconLabel,
|
|
272
|
+
iconProps = props.iconProps,
|
|
272
273
|
iconSize = props.iconSize,
|
|
273
274
|
_props$iconPosition = props.iconPosition,
|
|
274
275
|
iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition,
|
|
@@ -292,15 +293,15 @@ var Button = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
292
293
|
tabIndex: tabIndex,
|
|
293
294
|
ref: ref,
|
|
294
295
|
"aria-label": ariaLabel
|
|
295
|
-
}), iconType && iconPosition === 'left' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
296
|
+
}), iconType && iconPosition === 'left' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, _extends({
|
|
296
297
|
size: iconSize,
|
|
297
298
|
type: iconType,
|
|
298
299
|
ariaLabel: iconLabel
|
|
299
|
-
}), children, iconType && iconPosition === 'right' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, {
|
|
300
|
+
}, iconProps)), children, iconType && iconPosition === 'right' && /*#__PURE__*/_react.default.createElement(_componentIcon.Icon, _extends({
|
|
300
301
|
size: iconSize,
|
|
301
302
|
type: iconType,
|
|
302
303
|
ariaLabel: iconLabel
|
|
303
|
-
}));
|
|
304
|
+
}, iconProps)));
|
|
304
305
|
});
|
|
305
306
|
|
|
306
307
|
Button.propTypes = {
|
package/package.json
CHANGED