@openfin/ui-library 0.1.19-alpha.1623880773 → 0.1.19

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.
@@ -48,10 +48,10 @@ const InputContainer = styled_components_1.default(Box_1.Box) `
48
48
  height: var(--px-toggle);
49
49
  width: calc(2 * var(--px-toggle));
50
50
  border: 1px solid
51
- ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.background6};
51
+ ${({ isChecked, theme }) => (isChecked ? theme.palette.brandPrimary : theme.palette.inputBg)};
52
52
  border-radius: calc(0.5 * var(--px-toggle));
53
53
 
54
- background: ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.background6};
54
+ background: ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.inputBg};
55
55
  transition: background var(--openfin-ui-globalTransition),
56
56
  border-color var(---openfin-ui-globalTransition);
57
57
 
@@ -3,7 +3,6 @@ import { WithStatusProps } from '../../system/HOC';
3
3
  export declare type BaseInputProps = InputHTMLAttributes<HTMLInputElement> & {
4
4
  message?: string;
5
5
  label?: string;
6
- type?: string;
7
6
  renderInput?: Function;
8
7
  isFullWidth?: true;
9
8
  } & WithStatusProps;
@@ -13,7 +12,6 @@ export declare type BaseInputProps = InputHTMLAttributes<HTMLInputElement> & {
13
12
  export declare const BaseInput: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
14
13
  message?: string | undefined;
15
14
  label?: string | undefined;
16
- type?: string | undefined;
17
15
  renderInput?: Function | undefined;
18
16
  isFullWidth?: true | undefined;
19
17
  } & WithStatusProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -25,28 +25,13 @@ const Text_1 = require("../../typography/Text");
25
25
  * @private This should not be exposed beyond the ui-library.
26
26
  */
27
27
  exports.BaseInput = react_1.forwardRef((_a, ref) => {
28
- var { className, renderInput, message, label, status, name, type } = _a, inputProps = __rest(_a, ["className", "renderInput", "message", "label", "status", "name", "type"]);
29
- const displayLabelInline = type === 'checkbox' || type === 'radio';
30
- return (jsx_runtime_1.jsxs(InputContainer, Object.assign({ flexDirection: "column", alignItems: "flex-start" }, { children: [jsx_runtime_1.jsxs(LabelWrapper, Object.assign({ inline: displayLabelInline }, { children: [!!label && (jsx_runtime_1.jsx(InputLabel, Object.assign({ as: "label", htmlFor: name, weight: "bold" }, { children: label }), void 0)),
31
- !!renderInput && renderInput(Object.assign({ name, status }, inputProps)),
32
- !renderInput && (jsx_runtime_1.jsx(exports.StyledInputField, Object.assign({ className: className, name: name, status: status }, inputProps, { ref: ref }), void 0))] }), void 0),
28
+ var { className, renderInput, message, label, status, name } = _a, inputProps = __rest(_a, ["className", "renderInput", "message", "label", "status", "name"]);
29
+ return (jsx_runtime_1.jsxs(InputContainer, Object.assign({ flexDirection: "column", alignItems: "flex-start" }, { children: [!!label && (jsx_runtime_1.jsx(InputLabel, Object.assign({ as: "label", htmlFor: name, weight: "bold" }, { children: label }), void 0)),
30
+ !!renderInput && renderInput(Object.assign({ name, status }, inputProps)),
31
+ !renderInput && (jsx_runtime_1.jsx(exports.StyledInputField, Object.assign({ className: className, name: name, status: status }, inputProps, { ref: ref }), void 0)),
33
32
  !!message && jsx_runtime_1.jsx(InputMessage, Object.assign({ status: status }, { children: message }), void 0)] }), void 0));
34
33
  });
35
34
  exports.BaseInput.displayName = 'BaseInput';
36
- const LabelWrapper = styled_components_1.default(Box_1.Box) `
37
- align-items: ${({ inline }) => (inline ? 'center' : 'flex-start')};
38
- flex-direction: ${({ inline }) => (inline ? 'row-reverse' : 'column')};
39
-
40
- ${({ inline, theme }) => inline &&
41
- `
42
- ${InputLabel} {
43
- cursor: pointer;
44
- margin-bottom: 0;
45
- margin-left: ${theme.px.small};
46
- font-weight: ${theme.fontWeight.normal};
47
- }
48
- `}
49
- `;
50
35
  const InputLabel = styled_components_1.default(Text_1.Text) `
51
36
  margin-bottom: ${({ theme }) => theme.px.small};
52
37
  `;
@@ -58,8 +43,8 @@ const InputContainer = styled_components_1.default(Box_1.Box) `
58
43
  font-size: ${({ theme }) => theme.fontSize.base};
59
44
  `;
60
45
  exports.StyledInputField = styled_components_1.default.input `
61
- background: ${({ theme }) => theme.palette.background5};
62
- border: 1px solid ${({ theme }) => theme.palette.background6};
46
+ background: ${({ theme }) => theme.palette.inputBg};
47
+ border: 1px solid ${({ theme }) => theme.palette.inputBg};
63
48
  border-color: ${({ theme, status }) => ThemeProvider_1.getStatusColor(theme, status, 'inputBg')};
64
49
  border-radius: ${({ theme }) => theme.radius.small};
65
50
  box-shadow: ${({ theme }) => theme.shadow.base};
@@ -58,7 +58,7 @@ const StyledNumberInput = react_1.forwardRef((_a, ref) => {
58
58
  jsx_runtime_1.jsxs(ControlContainer, Object.assign({ flexDirection: "column", disabled: props.disabled }, { children: [jsx_runtime_1.jsx(ArrowControl, Object.assign({ onClick: onIncrement, disabled: props.disabled }, { children: jsx_runtime_1.jsx(Icon_1.Icon, { icon: "TriangleUpIcon" }, void 0) }), void 0),
59
59
  jsx_runtime_1.jsx(ArrowControl, Object.assign({ onClick: onDecrement, disabled: props.disabled }, { children: jsx_runtime_1.jsx(Icon_1.Icon, { icon: "TriangleDownIcon" }, void 0) }), void 0)] }), void 0)] }, void 0));
60
60
  });
61
- StyledNumberInput.displayName = 'StyledNumberInput';
61
+ StyledNumberInput.displayName = "StyledNumberInput";
62
62
  const StyledInputContainer = styled_components_1.default.div `
63
63
  position: relative;
64
64
  overflow: hidden;
@@ -4,7 +4,6 @@ export declare type TextInputProps = BaseInputProps;
4
4
  export declare const TextInput: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
5
5
  message?: string | undefined;
6
6
  label?: string | undefined;
7
- type?: string | undefined;
8
7
  renderInput?: Function | undefined;
9
8
  isFullWidth?: true | undefined;
10
9
  } & import("../../system/HOC").WithStatusProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -17,8 +17,8 @@ export declare const Color: {
17
17
  readonly neutralGray: "#7D808A";
18
18
  readonly darkGray1: "#53565F";
19
19
  readonly darkGray2: "#383A40";
20
- readonly darkGray3: "#2F3136";
21
- readonly darkGray4: "#24262B";
20
+ readonly darkGray3: "#24262B";
21
+ readonly darkGray4: "#2F3136";
22
22
  readonly darkGray5: "#1E1F23";
23
23
  readonly darkGray6: "#111214";
24
24
  readonly openFinDarkest: "#3D39CD";
@@ -41,8 +41,8 @@ exports.Color = {
41
41
  neutralGray: '#7D808A',
42
42
  darkGray1: '#53565F',
43
43
  darkGray2: '#383A40',
44
- darkGray3: '#2F3136',
45
- darkGray4: '#24262B',
44
+ darkGray3: '#24262B',
45
+ darkGray4: '#2F3136',
46
46
  darkGray5: '#1E1F23',
47
47
  darkGray6: '#111214',
48
48
  openFinDarkest: '#3D39CD',
@@ -34,6 +34,6 @@ exports.OpenFinDarkTheme = createTheme_1.createTheme(Object.assign(Object.assign
34
34
  // Brand
35
35
  [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray2,
36
36
  // Inputs
37
- [palette_1.Palette.inputBg]: constants_1.Color.darkGray1, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray5, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray5,
37
+ [palette_1.Palette.inputBg]: constants_1.Color.darkGray3, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray5, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray5,
38
38
  // Text
39
39
  [palette_1.Palette.textDefault]: constants_1.Color.white, [palette_1.Palette.textHelp]: constants_1.Color.lightGray5, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }));
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ export * from './components/elements/Loader';
6
6
  export * from './components/input/RawInput';
7
7
  export * from './components/input/TextInput';
8
8
  export * from './components/input/NumberInput';
9
- export * from './components/input/Checkbox';
10
9
  export * from './components/layout/Box';
11
10
  export * from './components/layout/DefinitionList';
12
11
  export * from './components/system/GlobalStyles';
package/dist/index.js CHANGED
@@ -31,7 +31,6 @@ __exportStar(require("./components/elements/Loader"), exports);
31
31
  __exportStar(require("./components/input/RawInput"), exports);
32
32
  __exportStar(require("./components/input/TextInput"), exports);
33
33
  __exportStar(require("./components/input/NumberInput"), exports);
34
- __exportStar(require("./components/input/Checkbox"), exports);
35
34
  __exportStar(require("./components/layout/Box"), exports);
36
35
  __exportStar(require("./components/layout/DefinitionList"), exports);
37
36
  __exportStar(require("./components/system/GlobalStyles"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfin/ui-library",
3
3
  "description": "OpenFin UI Component Library",
4
- "version": "0.1.19-alpha.1623880773",
4
+ "version": "0.1.19",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",
@@ -128,9 +128,6 @@
128
128
  "@typescript-eslint/no-unused-vars": "error",
129
129
  "@typescript-eslint/no-explicit-any": "error"
130
130
  },
131
- "globals": {
132
- "JSX": "readonly"
133
- },
134
131
  "settings": {
135
132
  "react": {
136
133
  "version": "detect"
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { BaseInputProps } from '../BaseInput';
3
- import { WithStatusProps } from '../../system/HOC';
4
- export declare type CheckboxProps = BaseInputProps;
5
- export declare const Checkbox: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
6
- message?: string | undefined;
7
- label?: string | undefined;
8
- type?: string | undefined;
9
- renderInput?: Function | undefined;
10
- isFullWidth?: true | undefined;
11
- } & WithStatusProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __rest = (this && this.__rest) || function (s, e) {
22
- var t = {};
23
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24
- t[p] = s[p];
25
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
26
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
27
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
28
- t[p[i]] = s[p[i]];
29
- }
30
- return t;
31
- };
32
- var __importDefault = (this && this.__importDefault) || function (mod) {
33
- return (mod && mod.__esModule) ? mod : { "default": mod };
34
- };
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Checkbox = void 0;
37
- const jsx_runtime_1 = require("react/jsx-runtime");
38
- const React = __importStar(require("react"));
39
- const styled_components_1 = __importDefault(require("styled-components"));
40
- const BaseInput_1 = require("../BaseInput");
41
- const Icon_1 = require("../../elements/Icon");
42
- const ThemeProvider_1 = require("../../system/ThemeProvider");
43
- exports.Checkbox = React.forwardRef((_a, ref) => {
44
- var { status } = _a, props = __rest(_a, ["status"]);
45
- return (jsx_runtime_1.jsx(BaseInput_1.BaseInput, Object.assign({}, props, { type: "checkbox", status: status, renderInput: (_a) => {
46
- var inputProps = __rest(_a, []);
47
- return (jsx_runtime_1.jsxs(Container, { children: [jsx_runtime_1.jsx(Input, Object.assign({ ref: ref, id: inputProps.name, type: "checkbox" }, inputProps), void 0),
48
- jsx_runtime_1.jsx(Fauxbox, Object.assign({ status: status }, { children: jsx_runtime_1.jsx(CheckIcon, {}, void 0) }), void 0)] }, void 0));
49
- } }), void 0));
50
- });
51
- exports.Checkbox.displayName = 'Checkbox';
52
- const Container = styled_components_1.default.div `
53
- display: inline-block;
54
- position: relative;
55
- `;
56
- const Fauxbox = styled_components_1.default.div `
57
- display: flex;
58
- align-items: center;
59
- justify-content: center;
60
- height: ${({ theme }) => theme.px.base};
61
- width: ${({ theme }) => theme.px.base};
62
- border: 1px solid ${({ theme }) => theme.palette.textDefault};
63
- border-color: ${({ theme, status }) => ThemeProvider_1.getStatusColor(theme, status, 'textDefault')};
64
- border-radius: 2px;
65
- pointer-events: none;
66
- `;
67
- const CheckIcon = styled_components_1.default(Icon_1.Icon).attrs({ icon: 'CheckIcon', size: 'small' }) `
68
- opacity: 0;
69
- `;
70
- const Input = styled_components_1.default.input `
71
- opacity: 0;
72
- position: absolute;
73
- width: 100%;
74
- height: 100%;
75
- cursor: pointer;
76
-
77
- &:checked + ${Fauxbox + ' ' + CheckIcon} {
78
- opacity: 1;
79
- }
80
-
81
- &:hover + ${Fauxbox} {
82
- box-shadow: 0 0 1px 1px ${({ theme }) => theme.palette.inputFocused};
83
- }
84
-
85
- &:focus + ${Fauxbox} {
86
- box-shadow: 0 0 1px 1px ${({ theme }) => theme.palette.inputFocused};
87
- }
88
-
89
- &:disabled {
90
- cursor: not-allowed;
91
- }
92
-
93
- &:disabled + ${Fauxbox} {
94
- opacity: 0.5;
95
- }
96
- `;
@@ -1 +0,0 @@
1
- export * from './checkbox';
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./checkbox"), exports);