@veracity/vui 2.0.1 → 2.0.3

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.
@@ -22,7 +22,7 @@ const utils_1 = require("../utils");
22
22
  const context_1 = require("./context");
23
23
  const Badge = core_1.styled.spanBox `
24
24
  align-items: center;
25
- background-color: red.70;
25
+ background-color: hsl(357, 83%, 60%);
26
26
  border-radius: round;
27
27
  color: white;
28
28
  display: flex;
@@ -41,7 +41,7 @@ exports.HeaderNotifications = (0, core_1.vui)((props, ref) => {
41
41
  const { children, className, count = 0, url } = props, rest = __rest(props, ["children", "className", "count", "url"]);
42
42
  const { links } = (_a = (0, context_1.useHeaderContext)()) !== null && _a !== void 0 ? _a : {};
43
43
  const styles = (0, core_1.useStyleConfig)('Header', (0, context_1.useHeaderContext)()).notifications;
44
- return (react_1.default.createElement(button_1.default, Object.assign({ as: "a", className: (0, utils_1.cs)('vui-headerNotifications', className), href: url !== null && url !== void 0 ? url : links.notifications, minW: 0, ml: 1, position: "relative", px: "7px", ref: ref, title: "Notifications", variant: "text" }, styles.container, rest), children !== null && children !== void 0 ? children : (react_1.default.createElement(react_1.default.Fragment, null,
44
+ return (react_1.default.createElement(button_1.default, Object.assign({ as: "a", className: (0, utils_1.cs)('vui-headerNotifications', className), href: url !== null && url !== void 0 ? url : links.notifications, minW: 0, ml: 1, position: "relative", px: "7px", ref: ref, title: "Notifications", variant: "tertiaryDark" }, styles.container, rest), children !== null && children !== void 0 ? children : (react_1.default.createElement(react_1.default.Fragment, null,
45
45
  react_1.default.createElement(button_1.default.Icon, { name: "falBell" }),
46
46
  count > 0 && react_1.default.createElement(Badge, null, count < 100 ? count : '99+')))));
47
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/input/input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAMnE,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,eAAO,MAAM,SAAS,+HAiBrB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK;UA+HV,gBAAgB;WACf,iBAAiB;cACd,eAAe;CAC1B,CAAA;AAMD,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/input/input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAMnE,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,eAAO,MAAM,SAAS,+HAgBrB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK;UA+HV,gBAAgB;WACf,iBAAiB;cACd,eAAe;CAC1B,CAAA;AAMD,eAAe,KAAK,CAAA"}
@@ -61,8 +61,7 @@ exports.InputBase = core_1.styled.divBox `
61
61
  width: 100%;
62
62
 
63
63
  &[aria-disabled='true'] {
64
- background-color: disabled.bg;
65
- color: disabled.color;
64
+ opacity: 0.5;
66
65
  cursor: not-allowed;
67
66
  }
68
67
  `;
@@ -75,7 +74,7 @@ exports.Input = (0, core_1.vui)((props, ref) => {
75
74
  var _a, _b, _c, _d;
76
75
  const { autoComplete, autoFocus, children, className, colorScheme, defaultValue, disabled, errorText, iconLeft, iconRight, id, input, inputProps, inputRef, isInvalid, itemLeft, itemRight, helpText, max, maxLength, min, name, onBlur, onChange: onChangeProp, onFocus, pattern, placeholder, readOnly, required, showCount, size, state = '', stateMapping, step, type = 'text', value, variant } = props, rest = __rest(props, ["autoComplete", "autoFocus", "children", "className", "colorScheme", "defaultValue", "disabled", "errorText", "iconLeft", "iconRight", "id", "input", "inputProps", "inputRef", "isInvalid", "itemLeft", "itemRight", "helpText", "max", "maxLength", "min", "name", "onBlur", "onChange", "onFocus", "pattern", "placeholder", "readOnly", "required", "showCount", "size", "state", "stateMapping", "step", "type", "value", "variant"]);
77
76
  const [count, setCount] = (0, react_1.useState)((0, helpers_1.getInitialCount)(props));
78
- const [valueInternal, setValueInternal] = (0, react_1.useState)(defaultValue);
77
+ const [valueInternal, setValueInternal] = (0, react_1.useState)(defaultValue || '');
79
78
  const states = Object.assign(Object.assign({}, consts_1.inputStateMapping), stateMapping);
80
79
  const computedColorScheme = (0, utils_1.filterUndefined)({
81
80
  colorScheme: (_a = colorScheme !== null && colorScheme !== void 0 ? colorScheme : (isInvalid ? consts_1.redColor : undefined)) !== null && _a !== void 0 ? _a : (_b = states[state]) === null || _b === void 0 ? void 0 : _b.colorScheme
@@ -95,7 +94,7 @@ exports.Input = (0, core_1.vui)((props, ref) => {
95
94
  });
96
95
  (0, react_1.useEffect)(() => {
97
96
  var _a;
98
- setValueInternal(value);
97
+ setValueInternal(value !== null && value !== void 0 ? value : '');
99
98
  setCount(((_a = `${value}`) === null || _a === void 0 ? void 0 : _a.length) ? `${value}`.length : 0);
100
99
  }, [value]);
101
100
  return (react_1.default.createElement(context_1.InputProvider, { value: context },
@@ -5,7 +5,7 @@ import { cs } from '../utils';
5
5
  import { useHeaderContext } from './context';
6
6
  const Badge = styled.spanBox `
7
7
  align-items: center;
8
- background-color: red.70;
8
+ background-color: hsl(357, 83%, 60%);
9
9
  border-radius: round;
10
10
  color: white;
11
11
  display: flex;
@@ -23,7 +23,7 @@ export const HeaderNotifications = vui((props, ref) => {
23
23
  const { children, className, count = 0, url, ...rest } = props;
24
24
  const { links } = useHeaderContext() ?? {};
25
25
  const styles = useStyleConfig('Header', useHeaderContext()).notifications;
26
- return (React.createElement(Button, { as: "a", className: cs('vui-headerNotifications', className), href: url ?? links.notifications, minW: 0, ml: 1, position: "relative", px: "7px", ref: ref, title: "Notifications", variant: "text", ...styles.container, ...rest }, children ?? (React.createElement(React.Fragment, null,
26
+ return (React.createElement(Button, { as: "a", className: cs('vui-headerNotifications', className), href: url ?? links.notifications, minW: 0, ml: 1, position: "relative", px: "7px", ref: ref, title: "Notifications", variant: "tertiaryDark", ...styles.container, ...rest }, children ?? (React.createElement(React.Fragment, null,
27
27
  React.createElement(Button.Icon, { name: "falBell" }),
28
28
  count > 0 && React.createElement(Badge, null, count < 100 ? count : '99+')))));
29
29
  });
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/input/input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAMnE,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,eAAO,MAAM,SAAS,+HAiBrB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK;UA+HV,gBAAgB;WACf,iBAAiB;cACd,eAAe;CAC1B,CAAA;AAMD,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/input/input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAMnE,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,eAAO,MAAM,SAAS,+HAgBrB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK;UA+HV,gBAAgB;WACf,iBAAiB;cACd,eAAe;CAC1B,CAAA;AAMD,eAAe,KAAK,CAAA"}
@@ -21,8 +21,7 @@ export const InputBase = styled.divBox `
21
21
  width: 100%;
22
22
 
23
23
  &[aria-disabled='true'] {
24
- background-color: disabled.bg;
25
- color: disabled.color;
24
+ opacity: 0.5;
26
25
  cursor: not-allowed;
27
26
  }
28
27
  `;
@@ -34,7 +33,7 @@ export const InputBase = styled.divBox `
34
33
  export const Input = vui((props, ref) => {
35
34
  const { autoComplete, autoFocus, children, className, colorScheme, defaultValue, disabled, errorText, iconLeft, iconRight, id, input, inputProps, inputRef, isInvalid, itemLeft, itemRight, helpText, max, maxLength, min, name, onBlur, onChange: onChangeProp, onFocus, pattern, placeholder, readOnly, required, showCount, size, state = '', stateMapping, step, type = 'text', value, variant, ...rest } = props;
36
35
  const [count, setCount] = useState(getInitialCount(props));
37
- const [valueInternal, setValueInternal] = useState(defaultValue);
36
+ const [valueInternal, setValueInternal] = useState(defaultValue || '');
38
37
  const states = { ...inputStateMapping, ...stateMapping };
39
38
  const computedColorScheme = filterUndefined({
40
39
  colorScheme: colorScheme ?? (isInvalid ? redColor : undefined) ?? states[state]?.colorScheme
@@ -53,7 +52,7 @@ export const Input = vui((props, ref) => {
53
52
  focusWithinRingColor: readOnly ? 'transparent' : undefined
54
53
  });
55
54
  useEffect(() => {
56
- setValueInternal(value);
55
+ setValueInternal(value ?? '');
57
56
  setCount(`${value}`?.length ? `${value}`.length : 0);
58
57
  }, [value]);
59
58
  return (React.createElement(InputProvider, { value: context },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/vui",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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",
@@ -8,7 +8,7 @@ import { HeaderNotificationsProps } from './header.types'
8
8
 
9
9
  const Badge = styled.spanBox`
10
10
  align-items: center;
11
- background-color: red.70;
11
+ background-color: hsl(357, 83%, 60%);
12
12
  border-radius: round;
13
13
  color: white;
14
14
  display: flex;
@@ -39,7 +39,7 @@ export const HeaderNotifications = vui<'a', HeaderNotificationsProps>((props, re
39
39
  px="7px"
40
40
  ref={ref}
41
41
  title="Notifications"
42
- variant="text"
42
+ variant="tertiaryDark"
43
43
  {...styles.container}
44
44
  {...rest}
45
45
  >
@@ -24,8 +24,7 @@ export const InputBase = styled.divBox`
24
24
  width: 100%;
25
25
 
26
26
  &[aria-disabled='true'] {
27
- background-color: disabled.bg;
28
- color: disabled.color;
27
+ opacity: 0.5;
29
28
  cursor: not-allowed;
30
29
  }
31
30
  `
@@ -78,7 +77,7 @@ export const Input = vui<'div', InputProps>((props, ref) => {
78
77
  } = props
79
78
 
80
79
  const [count, setCount] = useState(getInitialCount(props))
81
- const [valueInternal, setValueInternal] = useState(defaultValue)
80
+ const [valueInternal, setValueInternal] = useState(defaultValue || '')
82
81
  const states = { ...inputStateMapping, ...stateMapping }
83
82
  const computedColorScheme = filterUndefined({
84
83
  colorScheme: colorScheme ?? (isInvalid ? redColor : undefined) ?? states[state]?.colorScheme
@@ -105,7 +104,7 @@ export const Input = vui<'div', InputProps>((props, ref) => {
105
104
  })
106
105
 
107
106
  useEffect(() => {
108
- setValueInternal(value)
107
+ setValueInternal(value ?? '')
109
108
  setCount(`${value}`?.length ? `${value}`.length : 0)
110
109
  }, [value])
111
110