@teambit/react.ui.component-highlighter 0.0.492 → 0.0.493
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/component-highlighter.docs.md +9 -0
- package/dist/component-highlighter.docs.md +9 -0
- package/dist/element-highlighter/element-highlighter.compositions.d.ts +3 -1
- package/dist/element-highlighter/element-highlighter.compositions.js +15 -7
- package/dist/element-highlighter/element-highlighter.compositions.js.map +1 -1
- package/dist/element-highlighter/element-highlighter.d.ts +8 -9
- package/dist/element-highlighter/element-highlighter.js +3 -3
- package/dist/element-highlighter/element-highlighter.js.map +1 -1
- package/dist/element-highlighter/index.d.ts +1 -1
- package/dist/hover-highlighter/use-hover-highlighter.d.ts +5 -2
- package/dist/hover-highlighter/use-hover-highlighter.js +13 -15
- package/dist/hover-highlighter/use-hover-highlighter.js.map +1 -1
- package/dist/hybrid-highligher/hybrid-highlighter.d.ts +6 -3
- package/dist/hybrid-highligher/hybrid-highlighter.js +4 -2
- package/dist/hybrid-highligher/hybrid-highlighter.js.map +1 -1
- package/dist/label/component-strip.d.ts +9 -0
- package/dist/label/component-strip.js +49 -0
- package/dist/label/component-strip.js.map +1 -0
- package/dist/label/component-strip.module.scss +64 -0
- package/dist/label/index.d.ts +4 -2
- package/dist/label/index.js +3 -2
- package/dist/label/index.js.map +1 -1
- package/dist/label/label-container.d.ts +13 -0
- package/dist/label/label-container.js +53 -0
- package/dist/label/label-container.js.map +1 -0
- package/dist/label/label.d.ts +7 -19
- package/dist/label/label.js +20 -27
- package/dist/label/label.js.map +1 -1
- package/dist/label/label.module.scss +24 -0
- package/dist/label/links.d.ts +2 -0
- package/dist/label/links.js +17 -0
- package/dist/label/links.js.map +1 -0
- package/dist/label/other-components.d.ts +10 -0
- package/dist/label/other-components.js +35 -0
- package/dist/label/other-components.js.map +1 -0
- package/dist/multi-highlighter/multi-highlighter.composition.d.ts +1 -0
- package/dist/multi-highlighter/multi-highlighter.composition.js +20 -5
- package/dist/multi-highlighter/multi-highlighter.composition.js.map +1 -1
- package/dist/multi-highlighter/use-multi-highlighter.d.ts +3 -2
- package/dist/multi-highlighter/use-multi-highlighter.js +7 -8
- package/dist/multi-highlighter/use-multi-highlighter.js.map +1 -1
- package/dist/rule-matcher.d.ts +6 -0
- package/dist/rule-matcher.js +20 -2
- package/dist/rule-matcher.js.map +1 -1
- package/dist/use-animation-frame.d.ts +1 -1
- package/dist/use-animation-frame.js.map +1 -1
- package/element-highlighter/element-highlighter.compositions.tsx +22 -8
- package/element-highlighter/element-highlighter.tsx +11 -16
- package/element-highlighter/index.ts +7 -1
- package/hover-highlighter/use-hover-highlighter.tsx +36 -19
- package/hybrid-highligher/hybrid-highlighter.tsx +16 -2
- package/label/component-strip.module.scss +64 -0
- package/label/component-strip.tsx +49 -0
- package/label/index.ts +5 -2
- package/label/label-container.tsx +46 -0
- package/label/label.module.scss +24 -0
- package/label/label.tsx +35 -66
- package/label/links.tsx +9 -0
- package/label/other-components.tsx +53 -0
- package/multi-highlighter/multi-highlighter.composition.tsx +22 -4
- package/multi-highlighter/use-multi-highlighter.tsx +15 -11
- package/package-tar/teambit-react.ui.component-highlighter-0.0.493.tgz +0 -0
- package/package.json +8 -8
- package/rule-matcher.tsx +27 -0
- package/use-animation-frame.tsx +1 -1
- package/bubble/bubble.module.scss +0 -24
- package/bubble/index.ts +0 -3
- package/dist/bubble/bubble.module.scss +0 -24
- package/dist/bubble/index.d.ts +0 -1
- package/dist/bubble/index.js +0 -9
- package/dist/bubble/index.js.map +0 -1
- package/dist/label/component-label/component-bubble.d.ts +0 -7
- package/dist/label/component-label/component-bubble.js +0 -35
- package/dist/label/component-label/component-bubble.js.map +0 -1
- package/dist/label/component-label/component-label.d.ts +0 -9
- package/dist/label/component-label/component-label.js +0 -32
- package/dist/label/component-label/component-label.js.map +0 -1
- package/dist/label/component-label/duo-component-bubble.module.scss +0 -24
- package/dist/label/component-label/index.d.ts +0 -2
- package/dist/label/component-label/index.js +0 -6
- package/dist/label/component-label/index.js.map +0 -1
- package/dist/label/component-label/scope-bubble.d.ts +0 -6
- package/dist/label/component-label/scope-bubble.js +0 -28
- package/dist/label/component-label/scope-bubble.js.map +0 -1
- package/dist/label/default-label/default-label.d.ts +0 -5
- package/dist/label/default-label/default-label.js +0 -30
- package/dist/label/default-label/default-label.js.map +0 -1
- package/dist/label/default-label/default-label.module.scss +0 -12
- package/dist/label/default-label/index.d.ts +0 -1
- package/dist/label/default-label/index.js +0 -6
- package/dist/label/default-label/index.js.map +0 -1
- package/label/component-label/component-bubble.tsx +0 -30
- package/label/component-label/component-label.tsx +0 -31
- package/label/component-label/duo-component-bubble.module.scss +0 -24
- package/label/component-label/index.ts +0 -2
- package/label/component-label/scope-bubble.tsx +0 -20
- package/label/default-label/default-label.module.scss +0 -12
- package/label/default-label/default-label.tsx +0 -22
- package/label/default-label/index.ts +0 -1
- package/package-tar/teambit-react.ui.component-highlighter-0.0.492.tgz +0 -0
package/bubble/index.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.bubble {
|
|
2
|
-
padding: 0.23em 1em;
|
|
3
|
-
|
|
4
|
-
transition: filter 300ms, background-color 300ms;
|
|
5
|
-
transform: translateZ(0); //fix blurriness in Safari
|
|
6
|
-
|
|
7
|
-
// override styles from <a>
|
|
8
|
-
&:link,
|
|
9
|
-
&:visited {
|
|
10
|
-
text-decoration: inherit;
|
|
11
|
-
color: inherit;
|
|
12
|
-
|
|
13
|
-
background: var(--bit-highlighter-color, #eebcc9);
|
|
14
|
-
|
|
15
|
-
&:hover {
|
|
16
|
-
background: var(--bit-highlighter-color-hover, #f6dae2);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&:active {
|
|
20
|
-
background: var(--bit-highlighter-color-active, #e79db1);
|
|
21
|
-
color: inherit;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
package/dist/bubble/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const bubble: string;
|
package/dist/bubble/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bubble = void 0;
|
|
7
|
-
const bubble_module_scss_1 = __importDefault(require("./bubble.module.scss"));
|
|
8
|
-
exports.bubble = bubble_module_scss_1.default.bubble;
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/bubble/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../bubble/index.ts"],"names":[],"mappings":";;;;;;AAAA,8EAA0C;AAE7B,QAAA,MAAM,GAAG,4BAAM,CAAC,MAAM,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import { LinkProps } from '@teambit/base-ui.routing.native-link';
|
|
3
|
-
export interface ComponentBubbleProps extends LinkProps {
|
|
4
|
-
componentId: ComponentID;
|
|
5
|
-
local?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function ComponentBubble({ componentId, className, href, local, ...rest }: ComponentBubbleProps): JSX.Element;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ComponentBubble = void 0;
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
const base_ui_routing_native_link_1 = require("@teambit/base-ui.routing.native-link");
|
|
21
|
-
const component_modules_component_url_1 = require("@teambit/component.modules.component-url");
|
|
22
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
23
|
-
const duo_component_bubble_module_scss_1 = __importDefault(require("./duo-component-bubble.module.scss"));
|
|
24
|
-
function ComponentBubble(_a) {
|
|
25
|
-
var { componentId, className, href, local = false } = _a, rest = __rest(_a, ["componentId", "className", "href", "local"]);
|
|
26
|
-
const { version, fullName } = componentId;
|
|
27
|
-
const componentHref = href || (local ? (0, url_join_1.default)('/', fullName) : component_modules_component_url_1.ComponentUrl.toUrl(componentId));
|
|
28
|
-
return (react_1.default.createElement(base_ui_routing_native_link_1.NativeLink, Object.assign({ external: true, href: componentHref, className: (0, classnames_1.default)(duo_component_bubble_module_scss_1.default.componentName, className) }, rest),
|
|
29
|
-
react_1.default.createElement("div", { className: duo_component_bubble_module_scss_1.default.fullName }, fullName),
|
|
30
|
-
version && version !== 'latest' && (react_1.default.createElement("div", { className: duo_component_bubble_module_scss_1.default.version },
|
|
31
|
-
react_1.default.createElement("span", { className: duo_component_bubble_module_scss_1.default.versionPrefix }, "@"),
|
|
32
|
-
version))));
|
|
33
|
-
}
|
|
34
|
-
exports.ComponentBubble = ComponentBubble;
|
|
35
|
-
//# sourceMappingURL=component-bubble.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-bubble.js","sourceRoot":"","sources":["../../../label/component-label/component-bubble.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AAEpC,sFAA6E;AAC7E,8FAAwE;AACxE,wDAA+B;AAC/B,0GAAwD;AAOxD,SAAgB,eAAe,CAAC,EAA8E;QAA9E,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,OAAiC,EAA5B,IAAI,cAAtD,6CAAwD,CAAF;IACpF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IAC1C,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,8CAAY,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjG,OAAO,CACL,8BAAC,wCAAU,kBAAC,QAAQ,QAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,0CAAM,CAAC,aAAa,EAAE,SAAS,CAAC,IAAM,IAAI;QACxG,uCAAK,SAAS,EAAE,0CAAM,CAAC,QAAQ,IAAG,QAAQ,CAAO;QAEhD,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,CAClC,uCAAK,SAAS,EAAE,0CAAM,CAAC,OAAO;YAC5B,wCAAM,SAAS,EAAE,0CAAM,CAAC,aAAa,QAAU;YAC9C,OAAO,CACJ,CACP,CACU,CACd,CAAC;AACJ,CAAC;AAhBD,0CAgBC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CardProps } from '@teambit/base-ui.surfaces.card';
|
|
2
|
-
import type { ComponentID } from '@teambit/component-id';
|
|
3
|
-
export interface ComponentLabelProps extends CardProps {
|
|
4
|
-
componentId: ComponentID;
|
|
5
|
-
link?: string;
|
|
6
|
-
scopeLink?: string;
|
|
7
|
-
local?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function ComponentLabel({ componentId, className, link, scopeLink, local, ...rest }: ComponentLabelProps): JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ComponentLabel = void 0;
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
const base_ui_surfaces_card_1 = require("@teambit/base-ui.surfaces.card");
|
|
21
|
-
const bubble_1 = require("../../bubble");
|
|
22
|
-
const duo_component_bubble_module_scss_1 = __importDefault(require("./duo-component-bubble.module.scss"));
|
|
23
|
-
const component_bubble_1 = require("./component-bubble");
|
|
24
|
-
const scope_bubble_1 = require("./scope-bubble");
|
|
25
|
-
function ComponentLabel(_a) {
|
|
26
|
-
var { componentId, className, link, scopeLink, local } = _a, rest = __rest(_a, ["componentId", "className", "link", "scopeLink", "local"]);
|
|
27
|
-
return (react_1.default.createElement(base_ui_surfaces_card_1.Card, Object.assign({}, rest, { className: (0, classnames_1.default)(className, duo_component_bubble_module_scss_1.default.duoComponentBubble) }),
|
|
28
|
-
react_1.default.createElement(scope_bubble_1.ScopeBubble, { href: scopeLink, componentId: componentId, className: bubble_1.bubble }),
|
|
29
|
-
react_1.default.createElement(component_bubble_1.ComponentBubble, { href: link, componentId: componentId, className: bubble_1.bubble, local: local })));
|
|
30
|
-
}
|
|
31
|
-
exports.ComponentLabel = ComponentLabel;
|
|
32
|
-
//# sourceMappingURL=component-label.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-label.js","sourceRoot":"","sources":["../../../label/component-label/component-label.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AACpC,0EAAiE;AAGjE,yCAAsC;AACtC,0GAAwD;AAExD,yDAAqD;AACrD,iDAA6C;AAS7C,SAAgB,cAAc,CAAC,EAAgF;QAAhF,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,OAAgC,EAA3B,IAAI,cAAzD,0DAA2D,CAAF;IACtF,OAAO,CACL,8BAAC,4BAAI,oBAAK,IAAI,IAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,0CAAM,CAAC,kBAAkB,CAAC;QACzE,8BAAC,0BAAW,IAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,eAAM,GAAI;QAC7E,8BAAC,kCAAe,IACd,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,eAAM,EACjB,KAAK,EAAE,KAAK,GACZ,CACG,CACR,CAAC;AACJ,CAAC;AAZD,wCAYC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.duoComponentBubble {
|
|
2
|
-
display: flex;
|
|
3
|
-
|
|
4
|
-
//reset styles from card:
|
|
5
|
-
padding: 0;
|
|
6
|
-
border: none;
|
|
7
|
-
background: none;
|
|
8
|
-
|
|
9
|
-
> :first-child {
|
|
10
|
-
border-top-left-radius: 4px;
|
|
11
|
-
border-bottom-left-radius: 4px;
|
|
12
|
-
|
|
13
|
-
margin-right: 2px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
> :last-child {
|
|
17
|
-
border-top-right-radius: 4px;
|
|
18
|
-
border-bottom-right-radius: 4px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.componentName {
|
|
23
|
-
display: flex;
|
|
24
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComponentLabel = void 0;
|
|
4
|
-
var component_label_1 = require("./component-label");
|
|
5
|
-
Object.defineProperty(exports, "ComponentLabel", { enumerable: true, get: function () { return component_label_1.ComponentLabel; } });
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../label/component-label/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import { LinkProps } from '@teambit/base-ui.routing.native-link';
|
|
3
|
-
export interface ScopeBubbleProps extends LinkProps {
|
|
4
|
-
componentId: ComponentID;
|
|
5
|
-
}
|
|
6
|
-
export declare function ScopeBubble({ componentId, className, href, ...rest }: ScopeBubbleProps): JSX.Element;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ScopeBubble = void 0;
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const base_ui_routing_native_link_1 = require("@teambit/base-ui.routing.native-link");
|
|
20
|
-
const component_modules_component_url_1 = require("@teambit/component.modules.component-url");
|
|
21
|
-
function ScopeBubble(_a) {
|
|
22
|
-
var { componentId, className, href } = _a, rest = __rest(_a, ["componentId", "className", "href"]);
|
|
23
|
-
const scope = componentId.scope;
|
|
24
|
-
const scopeUrl = href || component_modules_component_url_1.ScopeUrl.toUrl(componentId.scope);
|
|
25
|
-
return (react_1.default.createElement(base_ui_routing_native_link_1.NativeLink, Object.assign({ href: scopeUrl, external: true, className: className }, rest), scope));
|
|
26
|
-
}
|
|
27
|
-
exports.ScopeBubble = ScopeBubble;
|
|
28
|
-
//# sourceMappingURL=scope-bubble.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scope-bubble.js","sourceRoot":"","sources":["../../../label/component-label/scope-bubble.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAG1B,sFAA6E;AAC7E,8FAAoE;AAMpE,SAAgB,WAAW,CAAC,EAA2D;QAA3D,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,OAA6B,EAAxB,IAAI,cAAvC,oCAAyC,CAAF;IACjE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAChC,MAAM,QAAQ,GAAG,IAAI,IAAI,0CAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE3D,OAAO,CACL,8BAAC,wCAAU,kBAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,QAAC,SAAS,EAAE,SAAS,IAAM,IAAI,GAChE,KAAK,CACK,CACd,CAAC;AACJ,CAAC;AATD,kCASC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DefaultLabel = void 0;
|
|
18
|
-
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
const base_ui_surfaces_card_1 = require("@teambit/base-ui.surfaces.card");
|
|
21
|
-
const base_ui_routing_native_link_1 = require("@teambit/base-ui.routing.native-link");
|
|
22
|
-
const bubble_1 = require("../../bubble");
|
|
23
|
-
const default_label_module_scss_1 = __importDefault(require("./default-label.module.scss"));
|
|
24
|
-
function DefaultLabel(_a) {
|
|
25
|
-
var { className, href, children } = _a, rest = __rest(_a, ["className", "href", "children"]);
|
|
26
|
-
return (react_1.default.createElement(base_ui_surfaces_card_1.Card, Object.assign({}, rest, { className: (0, classnames_1.default)(default_label_module_scss_1.default.container, className) }),
|
|
27
|
-
react_1.default.createElement(base_ui_routing_native_link_1.NativeLink, { external: true, href: href, className: bubble_1.bubble }, children)));
|
|
28
|
-
}
|
|
29
|
-
exports.DefaultLabel = DefaultLabel;
|
|
30
|
-
//# sourceMappingURL=default-label.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-label.js","sourceRoot":"","sources":["../../../label/default-label/default-label.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AAEpC,0EAAiE;AACjE,sFAAkE;AAElE,yCAAsC;AACtC,4FAAiD;AAMjD,SAAgB,YAAY,CAAC,EAAyD;QAAzD,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,OAA8B,EAAzB,IAAI,cAApC,iCAAsC,CAAF;IAC/D,OAAO,CACL,8BAAC,4BAAI,oBAAK,IAAI,IAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,mCAAM,CAAC,SAAS,EAAE,SAAS,CAAC;QAChE,8BAAC,wCAAU,IAAC,QAAQ,QAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,eAAM,IAC/C,QAAQ,CACE,CACR,CACR,CAAC;AACJ,CAAC;AARD,oCAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DefaultLabel } from './default-label';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultLabel = void 0;
|
|
4
|
-
var default_label_1 = require("./default-label");
|
|
5
|
-
Object.defineProperty(exports, "DefaultLabel", { enumerable: true, get: function () { return default_label_1.DefaultLabel; } });
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../label/default-label/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,6GAAA,YAAY,OAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { ComponentID } from '@teambit/component-id';
|
|
4
|
-
import { NativeLink, LinkProps } from '@teambit/base-ui.routing.native-link';
|
|
5
|
-
import { ComponentUrl } from '@teambit/component.modules.component-url';
|
|
6
|
-
import urljoin from 'url-join';
|
|
7
|
-
import styles from './duo-component-bubble.module.scss';
|
|
8
|
-
|
|
9
|
-
export interface ComponentBubbleProps extends LinkProps {
|
|
10
|
-
componentId: ComponentID;
|
|
11
|
-
local?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function ComponentBubble({ componentId, className, href, local = false, ...rest }: ComponentBubbleProps) {
|
|
15
|
-
const { version, fullName } = componentId;
|
|
16
|
-
const componentHref = href || (local ? urljoin('/', fullName) : ComponentUrl.toUrl(componentId));
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<NativeLink external href={componentHref} className={classnames(styles.componentName, className)} {...rest}>
|
|
20
|
-
<div className={styles.fullName}>{fullName}</div>
|
|
21
|
-
|
|
22
|
-
{version && version !== 'latest' && (
|
|
23
|
-
<div className={styles.version}>
|
|
24
|
-
<span className={styles.versionPrefix}>@</span>
|
|
25
|
-
{version}
|
|
26
|
-
</div>
|
|
27
|
-
)}
|
|
28
|
-
</NativeLink>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { Card, CardProps } from '@teambit/base-ui.surfaces.card';
|
|
4
|
-
import type { ComponentID } from '@teambit/component-id';
|
|
5
|
-
|
|
6
|
-
import { bubble } from '../../bubble';
|
|
7
|
-
import styles from './duo-component-bubble.module.scss';
|
|
8
|
-
|
|
9
|
-
import { ComponentBubble } from './component-bubble';
|
|
10
|
-
import { ScopeBubble } from './scope-bubble';
|
|
11
|
-
|
|
12
|
-
export interface ComponentLabelProps extends CardProps {
|
|
13
|
-
componentId: ComponentID;
|
|
14
|
-
link?: string;
|
|
15
|
-
scopeLink?: string;
|
|
16
|
-
local?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function ComponentLabel({ componentId, className, link, scopeLink, local, ...rest }: ComponentLabelProps) {
|
|
20
|
-
return (
|
|
21
|
-
<Card {...rest} className={classNames(className, styles.duoComponentBubble)}>
|
|
22
|
-
<ScopeBubble href={scopeLink} componentId={componentId} className={bubble} />
|
|
23
|
-
<ComponentBubble
|
|
24
|
-
href={link}
|
|
25
|
-
componentId={componentId}
|
|
26
|
-
className={bubble}
|
|
27
|
-
local={local}
|
|
28
|
-
/>
|
|
29
|
-
</Card>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.duoComponentBubble {
|
|
2
|
-
display: flex;
|
|
3
|
-
|
|
4
|
-
//reset styles from card:
|
|
5
|
-
padding: 0;
|
|
6
|
-
border: none;
|
|
7
|
-
background: none;
|
|
8
|
-
|
|
9
|
-
> :first-child {
|
|
10
|
-
border-top-left-radius: 4px;
|
|
11
|
-
border-bottom-left-radius: 4px;
|
|
12
|
-
|
|
13
|
-
margin-right: 2px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
> :last-child {
|
|
17
|
-
border-top-right-radius: 4px;
|
|
18
|
-
border-bottom-right-radius: 4px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.componentName {
|
|
23
|
-
display: flex;
|
|
24
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { ComponentID } from '@teambit/component-id';
|
|
4
|
-
import { NativeLink, LinkProps } from '@teambit/base-ui.routing.native-link';
|
|
5
|
-
import { ScopeUrl } from '@teambit/component.modules.component-url';
|
|
6
|
-
|
|
7
|
-
export interface ScopeBubbleProps extends LinkProps {
|
|
8
|
-
componentId: ComponentID;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function ScopeBubble({ componentId, className, href, ...rest }: ScopeBubbleProps) {
|
|
12
|
-
const scope = componentId.scope;
|
|
13
|
-
const scopeUrl = href || ScopeUrl.toUrl(componentId.scope);
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<NativeLink href={scopeUrl} external className={className} {...rest}>
|
|
17
|
-
{scope}
|
|
18
|
-
</NativeLink>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
|
|
4
|
-
import { Card, CardProps } from '@teambit/base-ui.surfaces.card';
|
|
5
|
-
import { NativeLink } from '@teambit/base-ui.routing.native-link';
|
|
6
|
-
|
|
7
|
-
import { bubble } from '../../bubble';
|
|
8
|
-
import styles from './default-label.module.scss';
|
|
9
|
-
|
|
10
|
-
export interface DefaultLabelProps extends CardProps {
|
|
11
|
-
href?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function DefaultLabel({ className, href, children, ...rest }: DefaultLabelProps) {
|
|
15
|
-
return (
|
|
16
|
-
<Card {...rest} className={classnames(styles.container, className)}>
|
|
17
|
-
<NativeLink external href={href} className={bubble}>
|
|
18
|
-
{children}
|
|
19
|
-
</NativeLink>
|
|
20
|
-
</Card>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DefaultLabel } from './default-label';
|
|
Binary file
|