@veracity/vui 2.8.3-rc.3 → 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;AACD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;UAoHX,iBAAiB;UACjB,iBAAiB;CACxB,CAAA;AAKD,eAAe,MAAM,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"}
@@ -83,7 +83,7 @@ exports.Button = (0, core_1.vui)((props, ref) => {
83
83
  const buttonGroupProps = (0, context_1.useButtonGroupContext)();
84
84
  const mergedProps = Object.assign(Object.assign({}, buttonGroupProps), props);
85
85
  const { borderWidth: borderWidthProp, children, className, colorScheme, disabled, dropDownIcon = 'falAngleDown', icon, iconLeft, iconRight, isActive, isDropDown, isElevated, isFullWidth, isLoading, // eslint-disable-line
86
- 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"]);
87
87
  const hasState = Boolean(state) && state !== 'idle';
88
88
  const states = Object.assign(Object.assign({}, consts_1.buttonStateMapping), stateMapping);
89
89
  const _e = (_a = states[state]) !== null && _a !== void 0 ? _a : {}, { iconProps: stateIconProps } = _e, stateProps = __rest(_e, ["iconProps"]);
@@ -123,7 +123,7 @@ exports.Button = (0, core_1.vui)((props, ref) => {
123
123
  w: isFullWidth ? '100%' : undefined
124
124
  });
125
125
  return (react_1.default.createElement(context_2.ButtonProvider, { value: context },
126
- 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 }, buttonStyles, disabledProps, aliasedProps, rest),
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),
127
127
  hasState && (react_1.default.createElement(StateWrapper, Object.assign({ onClick: (e) => e.stopPropagation() }, stateProps),
128
128
  react_1.default.createElement(buttonIcon_1.default, Object.assign({ m: "auto" }, stateIconProps)))),
129
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;AACD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;UAoHX,iBAAiB;UACjB,iBAAiB;CACxB,CAAA;AAKD,eAAe,MAAM,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"}
@@ -42,7 +42,7 @@ export const Button = vui((props, ref) => {
42
42
  const buttonGroupProps = useButtonGroupContext();
43
43
  const mergedProps = { ...buttonGroupProps, ...props };
44
44
  const { borderWidth: borderWidthProp, children, className, colorScheme, disabled, dropDownIcon = 'falAngleDown', icon, iconLeft, iconRight, isActive, isDropDown, isElevated, isFullWidth, isLoading, // eslint-disable-line
45
- 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;
46
46
  const hasState = Boolean(state) && state !== 'idle';
47
47
  const states = { ...buttonStateMapping, ...stateMapping };
48
48
  const { iconProps: stateIconProps, ...stateProps } = states[state] ?? {};
@@ -82,7 +82,7 @@ export const Button = vui((props, ref) => {
82
82
  w: isFullWidth ? '100%' : undefined
83
83
  });
84
84
  return (React.createElement(ButtonProvider, { value: context },
85
- 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, ...buttonStyles, ...disabledProps, ...aliasedProps, ...rest },
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 },
86
86
  hasState && (React.createElement(StateWrapper, { onClick: (e) => e.stopPropagation(), ...stateProps },
87
87
  React.createElement(ButtonIcon, { m: "auto", ...stateIconProps }))),
88
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",
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",
@@ -36,6 +36,7 @@ export const ButtonBase = styled.buttonBox<ButtonProps>`
36
36
  user-select: none;
37
37
  width: fit-content;
38
38
  `
39
+
39
40
  /**
40
41
  * Triggers given actions on click. Supports multiple states, sizes and variants.
41
42
  *
@@ -60,7 +61,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
60
61
  isDropDown,
61
62
  isElevated,
62
63
  isFullWidth,
63
- isLoading, // eslint-disable-line
64
+ isLoading, // eslint-disable-line
64
65
  isRound,
65
66
  isSplit,
66
67
  isTruncated,
@@ -68,6 +69,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
68
69
  state = props.isLoading ? 'loading' : '',
69
70
  stateMapping,
70
71
  text,
72
+ title,
71
73
  variant: variantProp,
72
74
  ...rest
73
75
  } = mergedProps
@@ -121,6 +123,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
121
123
  return (
122
124
  <ButtonProvider value={context}>
123
125
  <ButtonBase
126
+ aria-label={title ? undefined : 'button'}
124
127
  borderWidth={border}
125
128
  className={cs('vui-button', className, isActive && activeClassName)}
126
129
  disabled={disabled}
@@ -129,6 +132,7 @@ export const Button = vui<'button', ButtonProps>((props, ref) => {
129
132
  pl={pl}
130
133
  pr={isDropDown ? 0 : pr}
131
134
  ref={ref}
135
+ title={title}
132
136
  type="button"
133
137
  variant={variant}
134
138
  {...buttonStyles}