@teambit/react.ui.component-highlighter 0.0.494 → 0.0.495
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/children-highlighter/children-highlighter.composition.tsx +9 -5
- package/component-highlighter.docs.md +1 -0
- package/dist/children-highlighter/children-highlighter.composition.js +7 -5
- package/dist/children-highlighter/children-highlighter.composition.js.map +1 -1
- package/dist/component-highlighter.docs.md +1 -0
- package/dist/element-highlighter/element-highlighter.compositions.js +4 -4
- package/dist/element-highlighter/element-highlighter.compositions.js.map +1 -1
- package/dist/element-highlighter/element-highlighter.module.scss +2 -5
- package/dist/hover-highlighter/hover-highlighter.compositions.js +1 -1
- package/dist/hover-highlighter/hover-highlighter.compositions.js.map +1 -1
- package/dist/label/component-strip.module.scss +6 -21
- package/element-highlighter/element-highlighter.compositions.tsx +4 -4
- package/element-highlighter/element-highlighter.module.scss +2 -5
- package/hover-highlighter/hover-highlighter.compositions.tsx +1 -1
- package/label/component-strip.module.scss +6 -21
- package/package-tar/teambit-react.ui.component-highlighter-0.0.495.tgz +0 -0
- package/package.json +2 -2
- package/tsconfig.json +2 -1
- package/package-tar/teambit-react.ui.component-highlighter-0.0.494.tgz +0 -0
|
@@ -7,7 +7,8 @@ import { ChildrenHighlighter } from './children-highlighter';
|
|
|
7
7
|
|
|
8
8
|
export const ChildrenHighlighterPreview = () => {
|
|
9
9
|
return (
|
|
10
|
-
|
|
10
|
+
// highlighter runs in compositions, therefor should not have our font
|
|
11
|
+
<ChildrenHighlighter style={{ padding: 40, minWidth: 200, fontFamily: 'sans-serif' }}>
|
|
11
12
|
<MockedComponentWithMeta>hover here</MockedComponentWithMeta>
|
|
12
13
|
<br />
|
|
13
14
|
<br />
|
|
@@ -20,7 +21,7 @@ export const ChildrenHighlighterPreview = () => {
|
|
|
20
21
|
export const ChildrenHighlighterWithCustomColors = () => {
|
|
21
22
|
return (
|
|
22
23
|
<ChildrenHighlighter
|
|
23
|
-
style={{ padding: 40, minWidth: 200, color: 'yellow' }}
|
|
24
|
+
style={{ padding: 40, minWidth: 200, color: 'yellow', fontFamily: 'sans-serif' }}
|
|
24
25
|
bgColor="cornflowerblue"
|
|
25
26
|
bgColorHover="blue"
|
|
26
27
|
bgColorActive="DarkSlateBlue"
|
|
@@ -37,7 +38,7 @@ export const ChildrenHighlighterWithCustomColors = () => {
|
|
|
37
38
|
export const ChildrenHighlighterInsideIgnore = () => {
|
|
38
39
|
return (
|
|
39
40
|
<ExcludeHighlighter>
|
|
40
|
-
<ChildrenHighlighter>
|
|
41
|
+
<ChildrenHighlighter style={{ fontFamily: 'sans-serif' }}>
|
|
41
42
|
Multi Highlighter should still work when inside <code>{'<ExcludeHighlighter>'}</code>
|
|
42
43
|
<br />
|
|
43
44
|
It should only skip exclusion zones inside of it.
|
|
@@ -56,7 +57,7 @@ export const ChildrenHighlighterInsideIgnore = () => {
|
|
|
56
57
|
|
|
57
58
|
export const ChildrenHighlighterWithRule = () => {
|
|
58
59
|
return (
|
|
59
|
-
<ChildrenHighlighter rule="#someSubTree *" style={{ minWidth: 300 }}>
|
|
60
|
+
<ChildrenHighlighter rule="#someSubTree *" style={{ minWidth: 300, fontFamily: 'sans-serif' }}>
|
|
60
61
|
<div>
|
|
61
62
|
element filter: <code>"#someSubTree *"</code>
|
|
62
63
|
</div>
|
|
@@ -74,7 +75,10 @@ export const ChildrenHighlighterWithRule = () => {
|
|
|
74
75
|
|
|
75
76
|
export const ChildrenHighlighterWithComponentRule = () => {
|
|
76
77
|
return (
|
|
77
|
-
<ChildrenHighlighter
|
|
78
|
+
<ChildrenHighlighter
|
|
79
|
+
componentRule="teambit.design/ui/icon-button"
|
|
80
|
+
style={{ minWidth: 300, fontFamily: 'sans-serif' }}
|
|
81
|
+
>
|
|
78
82
|
<div>
|
|
79
83
|
component filter: <code>"teambit.design/ui/icon-button"</code>
|
|
80
84
|
</div>
|
|
@@ -170,6 +170,7 @@ Use these CSS variables to edit the highlighter color
|
|
|
170
170
|
--bit-highlighter-color: #eebcc9;
|
|
171
171
|
--bit-highlighter-color-hover: #f6dae2;
|
|
172
172
|
--bit-highlighter-color-active: #e79db1;
|
|
173
|
+
--bit-highlighter-shadow: 0px 11px 29px 0px rgba(0, 0, 0, 0.23));
|
|
173
174
|
```
|
|
174
175
|
|
|
175
176
|
While it is preferred to use the css variables, you can also set them using react props:
|
|
@@ -11,7 +11,9 @@ const design_ui_icon_button_1 = require("@teambit/design.ui.icon-button");
|
|
|
11
11
|
const ignore_highlighter_1 = require("../ignore-highlighter");
|
|
12
12
|
const children_highlighter_1 = require("./children-highlighter");
|
|
13
13
|
const ChildrenHighlighterPreview = () => {
|
|
14
|
-
return (
|
|
14
|
+
return (
|
|
15
|
+
// highlighter runs in compositions, therefor should not have our font
|
|
16
|
+
react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { style: { padding: 40, minWidth: 200, fontFamily: 'sans-serif' } },
|
|
15
17
|
react_1.default.createElement(react_ui_highlighter_component_metadata_bit_component_meta_1.MockedComponentWithMeta, null, "hover here"),
|
|
16
18
|
react_1.default.createElement("br", null),
|
|
17
19
|
react_1.default.createElement("br", null),
|
|
@@ -20,7 +22,7 @@ const ChildrenHighlighterPreview = () => {
|
|
|
20
22
|
};
|
|
21
23
|
exports.ChildrenHighlighterPreview = ChildrenHighlighterPreview;
|
|
22
24
|
const ChildrenHighlighterWithCustomColors = () => {
|
|
23
|
-
return (react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { style: { padding: 40, minWidth: 200, color: 'yellow' }, bgColor: "cornflowerblue", bgColorHover: "blue", bgColorActive: "DarkSlateBlue" },
|
|
25
|
+
return (react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { style: { padding: 40, minWidth: 200, color: 'yellow', fontFamily: 'sans-serif' }, bgColor: "cornflowerblue", bgColorHover: "blue", bgColorActive: "DarkSlateBlue" },
|
|
24
26
|
react_1.default.createElement(react_ui_highlighter_component_metadata_bit_component_meta_1.MockedComponentWithMeta, null, "hover here"),
|
|
25
27
|
react_1.default.createElement("br", null),
|
|
26
28
|
react_1.default.createElement("br", null),
|
|
@@ -30,7 +32,7 @@ const ChildrenHighlighterWithCustomColors = () => {
|
|
|
30
32
|
exports.ChildrenHighlighterWithCustomColors = ChildrenHighlighterWithCustomColors;
|
|
31
33
|
const ChildrenHighlighterInsideIgnore = () => {
|
|
32
34
|
return (react_1.default.createElement(ignore_highlighter_1.ExcludeHighlighter, null,
|
|
33
|
-
react_1.default.createElement(children_highlighter_1.ChildrenHighlighter,
|
|
35
|
+
react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { style: { fontFamily: 'sans-serif' } },
|
|
34
36
|
"Multi Highlighter should still work when inside ",
|
|
35
37
|
react_1.default.createElement("code", null, '<ExcludeHighlighter>'),
|
|
36
38
|
react_1.default.createElement("br", null),
|
|
@@ -46,7 +48,7 @@ const ChildrenHighlighterInsideIgnore = () => {
|
|
|
46
48
|
};
|
|
47
49
|
exports.ChildrenHighlighterInsideIgnore = ChildrenHighlighterInsideIgnore;
|
|
48
50
|
const ChildrenHighlighterWithRule = () => {
|
|
49
|
-
return (react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { rule: "#someSubTree *", style: { minWidth: 300 } },
|
|
51
|
+
return (react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { rule: "#someSubTree *", style: { minWidth: 300, fontFamily: 'sans-serif' } },
|
|
50
52
|
react_1.default.createElement("div", null,
|
|
51
53
|
"element filter: ",
|
|
52
54
|
react_1.default.createElement("code", null, "\"#someSubTree *\"")),
|
|
@@ -60,7 +62,7 @@ const ChildrenHighlighterWithRule = () => {
|
|
|
60
62
|
};
|
|
61
63
|
exports.ChildrenHighlighterWithRule = ChildrenHighlighterWithRule;
|
|
62
64
|
const ChildrenHighlighterWithComponentRule = () => {
|
|
63
|
-
return (react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { componentRule: "teambit.design/ui/icon-button", style: { minWidth: 300 } },
|
|
65
|
+
return (react_1.default.createElement(children_highlighter_1.ChildrenHighlighter, { componentRule: "teambit.design/ui/icon-button", style: { minWidth: 300, fontFamily: 'sans-serif' } },
|
|
64
66
|
react_1.default.createElement("div", null,
|
|
65
67
|
"component filter: ",
|
|
66
68
|
react_1.default.createElement("code", null, "\"teambit.design/ui/icon-button\"")),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children-highlighter.composition.js","sourceRoot":"","sources":["../../children-highlighter/children-highlighter.composition.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,sFAAsF;AACtF,oJAA8G;AAC9G,0EAA4D;AAC5D,8DAA2D;AAC3D,iEAA6D;AAEtD,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"children-highlighter.composition.js","sourceRoot":"","sources":["../../children-highlighter/children-highlighter.composition.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,sFAAsF;AACtF,oJAA8G;AAC9G,0EAA4D;AAC5D,8DAA2D;AAC3D,iEAA6D;AAEtD,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO;IACL,sEAAsE;IACtE,8BAAC,0CAAmB,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE;QAClF,8BAAC,oFAAuB,qBAAqC;QAC7D,yCAAM;QACN,yCAAM;QACN,yCAAM;QACN,8BAAC,kCAAU,iDAAoD,CAC3C,CACvB,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,0BAA0B,8BAWrC;AAEK,MAAM,mCAAmC,GAAG,GAAG,EAAE;IACtD,OAAO,CACL,8BAAC,0CAAmB,IAClB,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,EAChF,OAAO,EAAC,gBAAgB,EACxB,YAA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AuB,yBAAyC;QACjE,yCAAM;QACN,yCAAM;QACN,yCAAM;QACN,8BAAC,kCAAU,mCAAsC,CAC7B,CACvB,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,oCAAoC,wCAiB/C;AAEF,oEAAoE;AACpE,aAAa;AACb,4BAA4B;AAC5B,uDAAuD;AACvD,6BAA6B;AAC7B,OAAO;AACP,KAAK"}
|
|
@@ -170,6 +170,7 @@ Use these CSS variables to edit the highlighter color
|
|
|
170
170
|
--bit-highlighter-color: #eebcc9;
|
|
171
171
|
--bit-highlighter-color-hover: #f6dae2;
|
|
172
172
|
--bit-highlighter-color-active: #e79db1;
|
|
173
|
+
--bit-highlighter-shadow: 0px 11px 29px 0px rgba(0, 0, 0, 0.23));
|
|
173
174
|
```
|
|
174
175
|
|
|
175
176
|
While it is preferred to use the css variables, you can also set them using react props:
|
|
@@ -37,7 +37,7 @@ const HighlightedElement = ({ style, targetStyle, watchMotion, className, size }
|
|
|
37
37
|
const targetRef = (0, react_1.createRef)();
|
|
38
38
|
(0, react_1.useEffect)(() => setTargetElement(targetRef.current || undefined), [targetRef.current]);
|
|
39
39
|
const target = targetElement && Object.assign(Object.assign({}, mockTarget), { element: targetElement });
|
|
40
|
-
return (react_1.default.createElement("div", { className: className, style: { padding: '16px 16px 40px 16px', width: 300 } },
|
|
40
|
+
return (react_1.default.createElement("div", { className: className, style: { padding: '16px 16px 40px 16px', width: 300, fontFamily: 'sans-serif' } },
|
|
41
41
|
react_1.default.createElement("div", { ref: targetRef, style: Object.assign({ width: 100 }, targetStyle) }, "highlight target"),
|
|
42
42
|
target && (react_1.default.createElement(element_highlighter_1.ElementHighlighter, { target: target, style: style, watchMotion: watchMotion, placement: "bottom", size: size }))));
|
|
43
43
|
};
|
|
@@ -52,9 +52,9 @@ const Customized = () => {
|
|
|
52
52
|
exports.Customized = Customized;
|
|
53
53
|
const Sizes = () => {
|
|
54
54
|
return (react_1.default.createElement("div", null,
|
|
55
|
-
react_1.default.createElement(exports.HighlightedElement, {
|
|
56
|
-
react_1.default.createElement(exports.HighlightedElement, {
|
|
57
|
-
react_1.default.createElement(exports.HighlightedElement, {
|
|
55
|
+
react_1.default.createElement(exports.HighlightedElement, { style: { fontSize: 10 } }),
|
|
56
|
+
react_1.default.createElement(exports.HighlightedElement, { style: { fontSize: 14 } }),
|
|
57
|
+
react_1.default.createElement(exports.HighlightedElement, { style: { fontSize: 18 } })));
|
|
58
58
|
};
|
|
59
59
|
exports.Sizes = Sizes;
|
|
60
60
|
const MovingElement = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-highlighter.compositions.js","sourceRoot":"","sources":["../../element-highlighter/element-highlighter.compositions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oJAAyG;AACzG,+CAA6E;AAC7E,+DAA6F;AAE7F,MAAM,UAAU,GAA6B;IAC3C,UAAU,EAAE;QACV;YACE,CAAC,+EAAkB,CAAC,EAAE;gBACpB,EAAE,EAAE,qCAAqC;aAC1C;SACF;KACF;CACF,CAAC;AAUK,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAA2B,EAAE,EAAE;IAClH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAA0B,SAAS,CAAC,CAAC;IACvF,MAAM,SAAS,GAAG,IAAA,iBAAS,GAAkB,CAAC;IAE9C,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACvF,MAAM,MAAM,GAAG,aAAa,oCAAS,UAAU,KAAE,OAAO,EAAE,aAAa,GAAE,CAAC;IAE1E,OAAO,CACL,uCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"element-highlighter.compositions.js","sourceRoot":"","sources":["../../element-highlighter/element-highlighter.compositions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oJAAyG;AACzG,+CAA6E;AAC7E,+DAA6F;AAE7F,MAAM,UAAU,GAA6B;IAC3C,UAAU,EAAE;QACV;YACE,CAAC,+EAAkB,CAAC,EAAE;gBACpB,EAAE,EAAE,qCAAqC;aAC1C;SACF;KACF;CACF,CAAC;AAUK,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAA2B,EAAE,EAAE;IAClH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAA0B,SAAS,CAAC,CAAC;IACvF,MAAM,SAAS,GAAG,IAAA,iBAAS,GAAkB,CAAC;IAE9C,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACvF,MAAM,MAAM,GAAG,aAAa,oCAAS,UAAU,KAAE,OAAO,EAAE,aAAa,GAAE,CAAC;IAE1E,OAAO,CACL,uCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE;QACxG,uCAAK,GAAG,EAAE,SAAS,EAAE,KAAK,kBAAI,KAAK,EAAE,GAAG,IAAK,WAAW,wBAElD;QACL,MAAM,IAAI,CACT,8BAAC,wCAAkB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,GAAI,CAC9G,CACG,CACP,CAAC;AACJ,CAAC,CA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.constants.z-indexes/z-indexes.module.scss';
|
|
2
2
|
|
|
3
|
-
.container {
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.label {
|
|
8
|
-
|
|
4
|
+
// space between the label and the target
|
|
5
|
+
// keep this space so users can move their cursor in this space.
|
|
9
6
|
padding: 8px;
|
|
10
7
|
}
|
|
11
8
|
|
|
@@ -25,7 +25,7 @@ const design_ui_icon_button_1 = require("@teambit/design.ui.icon-button");
|
|
|
25
25
|
const hover_highlighter_1 = require("./hover-highlighter");
|
|
26
26
|
const ShowWhenHovering = () => {
|
|
27
27
|
const [disabled, setDisabled] = (0, react_1.useState)(false);
|
|
28
|
-
return (react_1.default.createElement("div", { style: { padding: '16px 50px 32px 16px', minWidth: 300 } },
|
|
28
|
+
return (react_1.default.createElement("div", { style: { padding: '16px 50px 32px 16px', minWidth: 300, fontFamily: 'sans-serif' } },
|
|
29
29
|
react_1.default.createElement(hover_highlighter_1.HoverHighlighter, { style: { padding: 16 }, disabled: disabled },
|
|
30
30
|
react_1.default.createElement("div", null,
|
|
31
31
|
react_1.default.createElement("br", null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-highlighter.compositions.js","sourceRoot":"","sources":["../../hover-highlighter/hover-highlighter.compositions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,0EAA4D;AAC5D,2DAAuD;AAEhD,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAEzD,OAAO,CACL,uCAAK,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"hover-highlighter.compositions.js","sourceRoot":"","sources":["../../hover-highlighter/hover-highlighter.compositions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AACxC,0EAA4D;AAC5D,2DAAuD;AAEhD,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAEzD,OAAO,CACL,uCAAK,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE;QACrF,8BAAC,oCAAgB,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ;YAC1D;gBACE,yCAAM;gBACN;oBACE,8BAAC,kCAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAyB,CACtE;gBACN;oBACG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;;oBAAkB,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CACpE,CACF,CACW,CACf,CACP,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B"}
|
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
$borderRadius:
|
|
2
|
-
$gap:
|
|
1
|
+
$borderRadius: 0.5em;
|
|
2
|
+
$gap: 0.125em;
|
|
3
3
|
|
|
4
4
|
.componentStrip {
|
|
5
5
|
display: flex;
|
|
6
|
+
width: fit-content; // for correct shadow size
|
|
6
7
|
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
line-height: 16px;
|
|
9
8
|
border-radius: $borderRadius;
|
|
10
|
-
box-shadow:
|
|
11
|
-
|
|
12
|
-
&[data-size='s'] {
|
|
13
|
-
font-size: 12px;
|
|
14
|
-
line-height: 16px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&[data-size='m'] {
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
line-height: 16px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&[data-size='l'] {
|
|
23
|
-
font-size: 16px;
|
|
24
|
-
line-height: 24px;
|
|
25
|
-
}
|
|
9
|
+
box-shadow: var(--bit-highlighter-shadow);
|
|
26
10
|
|
|
27
11
|
> * {
|
|
28
|
-
padding:
|
|
12
|
+
padding: 0 0.5em;
|
|
13
|
+
line-height: 1.5; //use line height to get rounder values than 0.25em padding
|
|
29
14
|
|
|
30
15
|
transition: filter 300ms, background-color 300ms;
|
|
31
16
|
transform: translateZ(0); //fix blurriness in Safari
|
|
@@ -28,7 +28,7 @@ export const HighlightedElement = ({ style, targetStyle, watchMotion, className,
|
|
|
28
28
|
const target = targetElement && { ...mockTarget, element: targetElement };
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<div className={className} style={{ padding: '16px 16px 40px 16px', width: 300 }}>
|
|
31
|
+
<div className={className} style={{ padding: '16px 16px 40px 16px', width: 300, fontFamily: 'sans-serif' }}>
|
|
32
32
|
<div ref={targetRef} style={{ width: 100, ...targetStyle }}>
|
|
33
33
|
highlight target
|
|
34
34
|
</div>
|
|
@@ -56,9 +56,9 @@ export const Customized = () => {
|
|
|
56
56
|
export const Sizes = () => {
|
|
57
57
|
return (
|
|
58
58
|
<div>
|
|
59
|
-
<HighlightedElement
|
|
60
|
-
<HighlightedElement
|
|
61
|
-
<HighlightedElement
|
|
59
|
+
<HighlightedElement style={{ fontSize: 10 }} />
|
|
60
|
+
<HighlightedElement style={{ fontSize: 14 }} />
|
|
61
|
+
<HighlightedElement style={{ fontSize: 18 }} />
|
|
62
62
|
</div>
|
|
63
63
|
);
|
|
64
64
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
@import '~@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';
|
|
2
2
|
|
|
3
|
-
.container {
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.label {
|
|
8
|
-
|
|
4
|
+
// space between the label and the target
|
|
5
|
+
// keep this space so users can move their cursor in this space.
|
|
9
6
|
padding: 8px;
|
|
10
7
|
}
|
|
11
8
|
|
|
@@ -6,7 +6,7 @@ export const ShowWhenHovering = () => {
|
|
|
6
6
|
const [disabled, setDisabled] = useState<boolean>(false);
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<div style={{ padding: '16px 50px 32px 16px', minWidth: 300 }}>
|
|
9
|
+
<div style={{ padding: '16px 50px 32px 16px', minWidth: 300, fontFamily: 'sans-serif' }}>
|
|
10
10
|
<HoverHighlighter style={{ padding: 16 }} disabled={disabled}>
|
|
11
11
|
<div>
|
|
12
12
|
<br />
|
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
$borderRadius:
|
|
2
|
-
$gap:
|
|
1
|
+
$borderRadius: 0.5em;
|
|
2
|
+
$gap: 0.125em;
|
|
3
3
|
|
|
4
4
|
.componentStrip {
|
|
5
5
|
display: flex;
|
|
6
|
+
width: fit-content; // for correct shadow size
|
|
6
7
|
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
line-height: 16px;
|
|
9
8
|
border-radius: $borderRadius;
|
|
10
|
-
box-shadow:
|
|
11
|
-
|
|
12
|
-
&[data-size='s'] {
|
|
13
|
-
font-size: 12px;
|
|
14
|
-
line-height: 16px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&[data-size='m'] {
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
line-height: 16px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&[data-size='l'] {
|
|
23
|
-
font-size: 16px;
|
|
24
|
-
line-height: 24px;
|
|
25
|
-
}
|
|
9
|
+
box-shadow: var(--bit-highlighter-shadow);
|
|
26
10
|
|
|
27
11
|
> * {
|
|
28
|
-
padding:
|
|
12
|
+
padding: 0 0.5em;
|
|
13
|
+
line-height: 1.5; //use line height to get rounder values than 0.25em padding
|
|
29
14
|
|
|
30
15
|
transition: filter 300ms, background-color 300ms;
|
|
31
16
|
transform: translateZ(0); //fix blurriness in Safari
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/react.ui.component-highlighter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.495",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/react/ui/component-highlighter",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.react",
|
|
8
8
|
"name": "ui/component-highlighter",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.495"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"get-xpath": "3.0.1",
|
package/tsconfig.json
CHANGED
|
Binary file
|