@openfin/ui-library 0.1.3-alpha.1616640160 → 0.1.3-alpha.1616718353
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/README.md +9 -0
- package/dist/components/layout/Box/box.js +6 -0
- package/dist/components/system/ThemeProvider/index.d.ts +1 -0
- package/dist/components/system/ThemeProvider/index.js +1 -0
- package/dist/components/system/ThemeProvider/lib/constants.d.ts +0 -8
- package/dist/components/system/ThemeProvider/lib/constants.js +1 -16
- package/dist/components/system/ThemeProvider/lib/mixins.d.ts +12 -0
- package/dist/components/system/ThemeProvider/lib/mixins.js +67 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -204,6 +204,15 @@ This triggers a Github Action to automatically build the latest version of the `
|
|
|
204
204
|
- useColorScheme
|
|
205
205
|
- useTheme
|
|
206
206
|
|
|
207
|
+
## [Mixins](./src/components/system/ThemeProvider/lib/mixins.ts)
|
|
208
|
+
|
|
209
|
+
CSS fragments that you can include in any styled component
|
|
210
|
+
|
|
211
|
+
- `${Mixins.noSelect}`
|
|
212
|
+
- `${Mixins.textOverflow}`
|
|
213
|
+
- `${Mixins.scrollbar.base}`
|
|
214
|
+
- `${Mixins.scrollbar.small}`
|
|
215
|
+
|
|
207
216
|
## Variants
|
|
208
217
|
|
|
209
218
|
### What are variants?
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Box = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const mixins_1 = require("../../system/ThemeProvider/lib/mixins");
|
|
8
9
|
const palette_1 = require("../../system/ThemeProvider/lib/palette");
|
|
9
10
|
/**
|
|
10
11
|
* ## BackgroundLevels
|
|
@@ -27,6 +28,11 @@ const BackgroundLevels = {
|
|
|
27
28
|
* - None of the child properties should be applied unless specified.
|
|
28
29
|
*/
|
|
29
30
|
exports.Box = styled_components_1.default.div `
|
|
31
|
+
/**
|
|
32
|
+
* Style Scrollbar for Boxes with overflow
|
|
33
|
+
*/
|
|
34
|
+
${mixins_1.Mixins.scrollbar.base}
|
|
35
|
+
|
|
30
36
|
display: ${({ display = 'flex' }) => display};
|
|
31
37
|
flex-direction: ${({ flexDirection = 'row' }) => flexDirection};
|
|
32
38
|
flex-wrap: ${({ flexWrap = 'nowrap' }) => flexWrap};
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./lib/constants"), exports);
|
|
14
14
|
__exportStar(require("./lib/helpers"), exports);
|
|
15
15
|
__exportStar(require("./lib/interface"), exports);
|
|
16
|
+
__exportStar(require("./lib/mixins"), exports);
|
|
16
17
|
__exportStar(require("./lib/palette"), exports);
|
|
17
18
|
__exportStar(require("./lib/types"), exports);
|
|
18
19
|
__exportStar(require("./themeProvider"), exports);
|
|
@@ -517,11 +517,3 @@ export declare const IconSize: {
|
|
|
517
517
|
readonly xxlarge: "32px";
|
|
518
518
|
readonly xxxlarge: "48px";
|
|
519
519
|
};
|
|
520
|
-
/**
|
|
521
|
-
* Mixins --
|
|
522
|
-
* Reusable utility fragments of CSS that make sense to express once (for consistency, maintainability).
|
|
523
|
-
*/
|
|
524
|
-
export declare const Mixins: {
|
|
525
|
-
readonly noSelect: import("styled-components").FlattenSimpleInterpolation;
|
|
526
|
-
readonly textOverflow: import("styled-components").FlattenSimpleInterpolation;
|
|
527
|
-
};
|
|
@@ -19,9 +19,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.IconSize = exports.IconSet = exports.Transition = exports.Typography = exports.LineHeight = exports.FontWeight = exports.FontSize = exports.FontStack = exports.Shadow = exports.Radius = exports.UnitPx = exports.Unit = exports.SizeName = exports.Size = exports.Color = void 0;
|
|
23
23
|
const RadixIcons = __importStar(require("@modulz/radix-icons"));
|
|
24
|
-
const styled_components_1 = require("styled-components");
|
|
25
24
|
const OpenFinIcons = __importStar(require("../../../elements/Icon/openfin"));
|
|
26
25
|
/**
|
|
27
26
|
* Color --
|
|
@@ -254,17 +253,3 @@ exports.IconSize = {
|
|
|
254
253
|
[exports.Size.xxlarge]: exports.UnitPx.xxxlarge,
|
|
255
254
|
[exports.Size.xxxlarge]: exports.UnitPx.xxxxlarge,
|
|
256
255
|
};
|
|
257
|
-
/**
|
|
258
|
-
* Mixins --
|
|
259
|
-
* Reusable utility fragments of CSS that make sense to express once (for consistency, maintainability).
|
|
260
|
-
*/
|
|
261
|
-
exports.Mixins = {
|
|
262
|
-
noSelect: styled_components_1.css `
|
|
263
|
-
user-select: none;
|
|
264
|
-
`,
|
|
265
|
-
textOverflow: styled_components_1.css `
|
|
266
|
-
white-space: nowrap;
|
|
267
|
-
overflow: hidden;
|
|
268
|
-
text-overflow: ellipsis;
|
|
269
|
-
`,
|
|
270
|
-
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mixins --
|
|
3
|
+
* Reusable utility fragments of CSS that make sense to express once (for consistency, maintainability).
|
|
4
|
+
*/
|
|
5
|
+
export declare const Mixins: {
|
|
6
|
+
readonly noSelect: import("styled-components").FlattenSimpleInterpolation;
|
|
7
|
+
readonly textOverflow: import("styled-components").FlattenSimpleInterpolation;
|
|
8
|
+
readonly scrollbar: {
|
|
9
|
+
readonly base: import("styled-components").FlattenSimpleInterpolation;
|
|
10
|
+
readonly small: import("styled-components").FlattenSimpleInterpolation;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mixins = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
const styled_components_1 = require("styled-components");
|
|
6
|
+
/**
|
|
7
|
+
* Mixins
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Prevent User Selection
|
|
11
|
+
*/
|
|
12
|
+
const noSelect = styled_components_1.css `
|
|
13
|
+
user-select: none;
|
|
14
|
+
`;
|
|
15
|
+
/**
|
|
16
|
+
* Prevent Text from Wrapping and truncate with ellipsis
|
|
17
|
+
* when it overflows the parent container
|
|
18
|
+
*/
|
|
19
|
+
const textOverflow = styled_components_1.css `
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
`;
|
|
24
|
+
/**
|
|
25
|
+
* Scrollbar (4px)
|
|
26
|
+
* @link https://www.figma.com/file/0Y3pKZj0tJWuleF12h5Sua/Spatial---Components?node-id=2048%3A7477
|
|
27
|
+
*/
|
|
28
|
+
const scrollbar = styled_components_1.css `
|
|
29
|
+
&::-webkit-scrollbar {
|
|
30
|
+
width: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
|
|
31
|
+
height: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&::-webkit-scrollbar-track {
|
|
35
|
+
background: ${constants_1.Color.neutralGray};
|
|
36
|
+
border-radius: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
|
|
37
|
+
opacity: 0.8;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&::-webkit-scrollbar-thumb {
|
|
41
|
+
background: ${constants_1.Color.white};
|
|
42
|
+
width: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
|
|
43
|
+
height: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
|
|
44
|
+
border-radius: var(--scrollbarSize, ${constants_1.UnitPx.xsmall});
|
|
45
|
+
opacity: 0.8;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
/**
|
|
49
|
+
* Scrollbar Tiny (2px)
|
|
50
|
+
* Extends the regular scrollbar
|
|
51
|
+
*/
|
|
52
|
+
const scrollbarSmall = styled_components_1.css `
|
|
53
|
+
--scrollbarSize: 2px;
|
|
54
|
+
${scrollbar};
|
|
55
|
+
`;
|
|
56
|
+
/**
|
|
57
|
+
* Mixins --
|
|
58
|
+
* Reusable utility fragments of CSS that make sense to express once (for consistency, maintainability).
|
|
59
|
+
*/
|
|
60
|
+
exports.Mixins = {
|
|
61
|
+
noSelect,
|
|
62
|
+
textOverflow,
|
|
63
|
+
scrollbar: {
|
|
64
|
+
[constants_1.Size.base]: scrollbar,
|
|
65
|
+
[constants_1.Size.small]: scrollbarSmall,
|
|
66
|
+
},
|
|
67
|
+
};
|
package/package.json
CHANGED