@veracity/vui 2.8.3-rc.2 → 2.8.3-rc.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAGtC,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,UAAU,MAAM,cAAc,CAAA;AAiBrC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;SAatB,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAGtC,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,UAAU,MAAM,cAAc,CAAA;AAiBrC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;SAatB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;UAuHX,iBAAiB;UACjB,iBAAiB;CACxB,CAAA;AAKD,eAAe,MAAM,CAAA"}
|
|
@@ -71,9 +71,6 @@ exports.ButtonBase = core_1.styled.buttonBox `
|
|
|
71
71
|
user-select: none;
|
|
72
72
|
width: fit-content;
|
|
73
73
|
`;
|
|
74
|
-
const ariaProps = {
|
|
75
|
-
'aria-label': 'button'
|
|
76
|
-
};
|
|
77
74
|
/**
|
|
78
75
|
* Triggers given actions on click. Supports multiple states, sizes and variants.
|
|
79
76
|
*
|
|
@@ -86,7 +83,7 @@ exports.Button = (0, core_1.vui)((props, ref) => {
|
|
|
86
83
|
const buttonGroupProps = (0, context_1.useButtonGroupContext)();
|
|
87
84
|
const mergedProps = Object.assign(Object.assign({}, buttonGroupProps), props);
|
|
88
85
|
const { borderWidth: borderWidthProp, children, className, colorScheme, disabled, dropDownIcon = 'falAngleDown', icon, iconLeft, iconRight, isActive, isDropDown, isElevated, isFullWidth, isLoading, // eslint-disable-line
|
|
89
|
-
isRound, isSplit, isTruncated, size, state = props.isLoading ? 'loading' : '', stateMapping, text, variant: variantProp } = mergedProps, rest = __rest(mergedProps, ["borderWidth", "children", "className", "colorScheme", "disabled", "dropDownIcon", "icon", "iconLeft", "iconRight", "isActive", "isDropDown", "isElevated", "isFullWidth", "isLoading", "isRound", "isSplit", "isTruncated", "size", "state", "stateMapping", "text", "variant"]);
|
|
86
|
+
isRound, isSplit, isTruncated, size, state = props.isLoading ? 'loading' : '', stateMapping, text, title, variant: variantProp } = mergedProps, rest = __rest(mergedProps, ["borderWidth", "children", "className", "colorScheme", "disabled", "dropDownIcon", "icon", "iconLeft", "iconRight", "isActive", "isDropDown", "isElevated", "isFullWidth", "isLoading", "isRound", "isSplit", "isTruncated", "size", "state", "stateMapping", "text", "title", "variant"]);
|
|
90
87
|
const hasState = Boolean(state) && state !== 'idle';
|
|
91
88
|
const states = Object.assign(Object.assign({}, consts_1.buttonStateMapping), stateMapping);
|
|
92
89
|
const _e = (_a = states[state]) !== null && _a !== void 0 ? _a : {}, { iconProps: stateIconProps } = _e, stateProps = __rest(_e, ["iconProps"]);
|
|
@@ -126,7 +123,7 @@ exports.Button = (0, core_1.vui)((props, ref) => {
|
|
|
126
123
|
w: isFullWidth ? '100%' : undefined
|
|
127
124
|
});
|
|
128
125
|
return (react_1.default.createElement(context_2.ButtonProvider, { value: context },
|
|
129
|
-
react_1.default.createElement(exports.ButtonBase, Object.assign({ borderWidth: border, className: (0, utils_1.cs)('vui-button', className, isActive && utils_1.activeClassName), disabled: disabled, focusRing: 3, h: h, pl: pl, pr: isDropDown ? 0 : pr, ref: ref, type: "button", variant: variant },
|
|
126
|
+
react_1.default.createElement(exports.ButtonBase, Object.assign({ "aria-label": title ? undefined : 'button', borderWidth: border, className: (0, utils_1.cs)('vui-button', className, isActive && utils_1.activeClassName), disabled: disabled, focusRing: 3, h: h, pl: pl, pr: isDropDown ? 0 : pr, ref: ref, title: title, type: "button", variant: variant }, buttonStyles, disabledProps, aliasedProps, rest),
|
|
130
127
|
hasState && (react_1.default.createElement(StateWrapper, Object.assign({ onClick: (e) => e.stopPropagation() }, stateProps),
|
|
131
128
|
react_1.default.createElement(buttonIcon_1.default, Object.assign({ m: "auto" }, stateIconProps)))),
|
|
132
129
|
react_1.default.createElement(Content, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAGtC,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,UAAU,MAAM,cAAc,CAAA;AAiBrC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;SAatB,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAGtC,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,UAAU,MAAM,cAAc,CAAA;AAiBrC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;SAatB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;UAuHX,iBAAiB;UACjB,iBAAiB;CACxB,CAAA;AAKD,eAAe,MAAM,CAAA"}
|
|
@@ -31,9 +31,6 @@ export const ButtonBase = styled.buttonBox `
|
|
|
31
31
|
user-select: none;
|
|
32
32
|
width: fit-content;
|
|
33
33
|
`;
|
|
34
|
-
const ariaProps = {
|
|
35
|
-
'aria-label': 'button'
|
|
36
|
-
};
|
|
37
34
|
/**
|
|
38
35
|
* Triggers given actions on click. Supports multiple states, sizes and variants.
|
|
39
36
|
*
|
|
@@ -45,7 +42,7 @@ export const Button = vui((props, ref) => {
|
|
|
45
42
|
const buttonGroupProps = useButtonGroupContext();
|
|
46
43
|
const mergedProps = { ...buttonGroupProps, ...props };
|
|
47
44
|
const { borderWidth: borderWidthProp, children, className, colorScheme, disabled, dropDownIcon = 'falAngleDown', icon, iconLeft, iconRight, isActive, isDropDown, isElevated, isFullWidth, isLoading, // eslint-disable-line
|
|
48
|
-
isRound, isSplit, isTruncated, size, state = props.isLoading ? 'loading' : '', stateMapping, text, variant: variantProp, ...rest } = mergedProps;
|
|
45
|
+
isRound, isSplit, isTruncated, size, state = props.isLoading ? 'loading' : '', stateMapping, text, title, variant: variantProp, ...rest } = mergedProps;
|
|
49
46
|
const hasState = Boolean(state) && state !== 'idle';
|
|
50
47
|
const states = { ...buttonStateMapping, ...stateMapping };
|
|
51
48
|
const { iconProps: stateIconProps, ...stateProps } = states[state] ?? {};
|
|
@@ -85,7 +82,7 @@ export const Button = vui((props, ref) => {
|
|
|
85
82
|
w: isFullWidth ? '100%' : undefined
|
|
86
83
|
});
|
|
87
84
|
return (React.createElement(ButtonProvider, { value: context },
|
|
88
|
-
React.createElement(ButtonBase, { borderWidth: border, className: cs('vui-button', className, isActive && activeClassName), disabled: disabled, focusRing: 3, h: h, pl: pl, pr: isDropDown ? 0 : pr, ref: ref, type: "button", variant: variant, ...
|
|
85
|
+
React.createElement(ButtonBase, { "aria-label": title ? undefined : 'button', borderWidth: border, className: cs('vui-button', className, isActive && activeClassName), disabled: disabled, focusRing: 3, h: h, pl: pl, pr: isDropDown ? 0 : pr, ref: ref, title: title, type: "button", variant: variant, ...buttonStyles, ...disabledProps, ...aliasedProps, ...rest },
|
|
89
86
|
hasState && (React.createElement(StateWrapper, { onClick: (e) => e.stopPropagation(), ...stateProps },
|
|
90
87
|
React.createElement(ButtonIcon, { m: "auto", ...stateIconProps }))),
|
|
91
88
|
React.createElement(Content, null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.8.3-rc.
|
|
3
|
+
"version": "2.8.3-rc.4",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
package/src/button/button.tsx
CHANGED
|
@@ -37,10 +37,6 @@ export const ButtonBase = styled.buttonBox<ButtonProps>`
|
|
|
37
37
|
width: fit-content;
|
|
38
38
|
`
|
|
39
39
|
|
|
40
|
-
const ariaProps = {
|
|
41
|
-
'aria-label': 'button'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
40
|
/**
|
|
45
41
|
* Triggers given actions on click. Supports multiple states, sizes and variants.
|
|
46
42
|
*
|
|
@@ -65,7 +61,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
|
|
|
65
61
|
isDropDown,
|
|
66
62
|
isElevated,
|
|
67
63
|
isFullWidth,
|
|
68
|
-
|
|
64
|
+
isLoading, // eslint-disable-line
|
|
69
65
|
isRound,
|
|
70
66
|
isSplit,
|
|
71
67
|
isTruncated,
|
|
@@ -73,6 +69,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
|
|
|
73
69
|
state = props.isLoading ? 'loading' : '',
|
|
74
70
|
stateMapping,
|
|
75
71
|
text,
|
|
72
|
+
title,
|
|
76
73
|
variant: variantProp,
|
|
77
74
|
...rest
|
|
78
75
|
} = mergedProps
|
|
@@ -126,6 +123,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
|
|
|
126
123
|
return (
|
|
127
124
|
<ButtonProvider value={context}>
|
|
128
125
|
<ButtonBase
|
|
126
|
+
aria-label={title ? undefined : 'button'}
|
|
129
127
|
borderWidth={border}
|
|
130
128
|
className={cs('vui-button', className, isActive && activeClassName)}
|
|
131
129
|
disabled={disabled}
|
|
@@ -134,9 +132,9 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
|
|
|
134
132
|
pl={pl}
|
|
135
133
|
pr={isDropDown ? 0 : pr}
|
|
136
134
|
ref={ref}
|
|
135
|
+
title={title}
|
|
137
136
|
type="button"
|
|
138
137
|
variant={variant}
|
|
139
|
-
{...ariaProps}
|
|
140
138
|
{...buttonStyles}
|
|
141
139
|
{...disabledProps}
|
|
142
140
|
{...aliasedProps}
|