@redis-ui/components 38.0.0 → 38.6.0
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/dist/AppSelectionMenu/components/Item/Item.styles.d.ts +1 -1
- package/dist/AutoCompleteSelect/AutoCompleteSelect.style.d.ts +1 -1
- package/dist/Badge/Badge.cjs +3 -1
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +3 -1
- package/dist/Badge/Badge.style.cjs +8 -6
- package/dist/Badge/Badge.style.d.ts +5 -2
- package/dist/Badge/Badge.style.js +9 -7
- package/dist/Badge/Badge.types.d.ts +1 -0
- package/dist/Banner/components/Message/Message.style.d.ts +1 -1
- package/dist/BoxSelectionGroup/BoxSelectionGroup.style.cjs +1 -1
- package/dist/BoxSelectionGroup/BoxSelectionGroup.style.js +1 -1
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.cjs +3 -1
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.js +3 -1
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.cjs +1 -1
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.js +1 -1
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.types.d.ts +2 -0
- package/dist/Checkbox/components/Indicator/Indicator.style.cjs +1 -1
- package/dist/Checkbox/components/Indicator/Indicator.style.js +1 -1
- package/dist/Checkbox/components/Label/Label.style.d.ts +1 -1
- package/dist/Chip/components/CloseButton/CloseButton.style.cjs +1 -1
- package/dist/Chip/components/CloseButton/CloseButton.style.js +1 -1
- package/dist/ChipList/Components/ExtraItem.style.d.ts +1 -1
- package/dist/DatePicker/DatePicker.d.ts +3 -0
- package/dist/Drawer/components/Content/Content.cjs +11 -0
- package/dist/Drawer/components/Content/Content.js +12 -1
- package/dist/Drawer/components/Content/Content.style.cjs +1 -1
- package/dist/Drawer/components/Content/Content.style.js +1 -1
- package/dist/Drawer/components/Header/components/Title/Title.style.d.ts +1 -1
- package/dist/Filters/components/MultiSelectFilter/MultiSelectFilter.styles.d.ts +1 -1
- package/dist/FormField/components/AdditionalText/AdditionalText.style.d.ts +1 -1
- package/dist/Helpers/UnstyledButtonTrigger.cjs +5 -0
- package/dist/Helpers/UnstyledButtonTrigger.d.ts +1 -0
- package/dist/Helpers/UnstyledButtonTrigger.js +5 -0
- package/dist/Inputs/Input/Input.d.ts +1 -1
- package/dist/Inputs/NumericInput/NumericInput.d.ts +1 -1
- package/dist/Inputs/QuantityCounter/QuantityCounter.d.ts +1 -1
- package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.style.d.ts +1 -1
- package/dist/Inputs/TextArea/TextArea.d.ts +1 -1
- package/dist/Inputs/TextArea/components/Compose/Compose.style.d.ts +1 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.cjs +1 -14
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.js +2 -15
- package/dist/Inputs/components/Compose/Compose.style.d.ts +1 -1
- package/dist/Inputs/components/InputTag/InputTag.style.cjs +4 -0
- package/dist/Inputs/components/InputTag/InputTag.style.js +4 -0
- package/dist/Label/components/Optional/Optional.style.d.ts +1 -1
- package/dist/Label/components/Required/Required.style.d.ts +1 -1
- package/dist/Label/components/Text/Text.style.d.ts +1 -1
- package/dist/Link/Link.cjs +72 -36
- package/dist/Link/Link.d.ts +287 -2
- package/dist/Link/Link.js +73 -37
- package/dist/Link/Link.style.cjs +31 -31
- package/dist/Link/Link.style.d.ts +6 -6
- package/dist/Link/Link.style.js +31 -31
- package/dist/Link/Link.types.d.ts +18 -12
- package/dist/Menu/Menu.d.ts +1 -1
- package/dist/Menu/components/Content/Content.d.ts +1 -1
- package/dist/Menu/components/Content/Content.style.cjs +5 -0
- package/dist/Menu/components/Content/Content.style.js +5 -0
- package/dist/Menu/components/Content/components/DropdownArrow/DropdownArrow.cjs +4 -15
- package/dist/Menu/components/Content/components/DropdownArrow/DropdownArrow.d.ts +1 -1
- package/dist/Menu/components/Content/components/DropdownArrow/DropdownArrow.js +4 -15
- package/dist/Menu/components/Content/components/DropdownArrow/DropdownArrow.style.cjs +19 -0
- package/dist/Menu/components/Content/components/DropdownArrow/DropdownArrow.style.d.ts +3 -0
- package/dist/Menu/components/Content/components/DropdownArrow/DropdownArrow.style.js +17 -0
- package/dist/Menu/components/Content/components/Item/Components/SubHead/SubHead.style.d.ts +1 -1
- package/dist/Menu/components/Content/components/Item/Components/Text/Text.style.d.ts +1 -1
- package/dist/Menu/components/Content/components/Label/Label.style.d.ts +1 -1
- package/dist/Menu/components/Trigger/Trigger.style.cjs +2 -1
- package/dist/Menu/components/Trigger/Trigger.style.js +2 -1
- package/dist/Modal/components/Content/components/Body/components/Text/Text.style.d.ts +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.style.d.ts +1 -1
- package/dist/Modal/components/Trigger/Trigger.style.cjs +2 -1
- package/dist/Modal/components/Trigger/Trigger.style.js +2 -1
- package/dist/Popover/Popover.d.ts +2 -2
- package/dist/Popover/components/Content/Content.d.ts +1 -1
- package/dist/Popover/components/Content/components/Body/components/BodyText/BodyText.styles.d.ts +1 -1
- package/dist/Popover/components/Content/components/Footer/Footer.cjs +2 -2
- package/dist/Popover/components/Content/components/Footer/Footer.js +2 -2
- package/dist/Popover/components/Content/components/Header/components/HeaderTitle/HeaderTitle.styles.d.ts +1 -1
- package/dist/Popover/components/Content/components/Text/Text.styles.d.ts +1 -1
- package/dist/Popover/components/Content/components/WindowBar/WindowBar.d.ts +1 -1
- package/dist/Popover/components/Content/components/WindowBar/WindowBar.style.d.ts +1 -1
- package/dist/Popover/components/PopoverCard/PopoverCard.d.ts +1 -1
- package/dist/Popover/components/Trigger/Trigger.style.cjs +2 -1
- package/dist/Popover/components/Trigger/Trigger.style.js +2 -1
- package/dist/ProgressBar/ProgressBar.styles.d.ts +1 -1
- package/dist/Section/components/Body/Body.cjs +4 -1
- package/dist/Section/components/Body/Body.js +4 -1
- package/dist/Section/components/Header/components/CategoryValueList/CategoryValueList.style.d.ts +1 -1
- package/dist/Section/components/Header/components/CategoryValueList/components/CategoryValueChip/CategoryValueChip.style.d.ts +2 -2
- package/dist/Section/components/Header/components/Compose/Compose.style.cjs +2 -1
- package/dist/Section/components/Header/components/Compose/Compose.style.js +2 -1
- package/dist/Section/components/Header/components/Label/Label.style.d.ts +1 -1
- package/dist/Select/components/Content/components/Compose/Compose.style.cjs +1 -1
- package/dist/Select/components/Content/components/Compose/Compose.style.js +1 -1
- package/dist/Select/components/Trigger/components/ResetButton/ResetButton.style.cjs +1 -1
- package/dist/Select/components/Trigger/components/ResetButton/ResetButton.style.js +1 -1
- package/dist/SideBar/components/Footer/components/Text/Text.style.d.ts +1 -1
- package/dist/SideBar/components/Item/components/Text/Text.style.d.ts +1 -1
- package/dist/SideBar/components/ItemsContainer/ItemsContainer.style.cjs +1 -1
- package/dist/SideBar/components/ItemsContainer/ItemsContainer.style.js +1 -1
- package/dist/Skeleton/Skeleton.d.ts +3 -0
- package/dist/Switch/components/Switcher/Switcher.style.cjs +46 -24
- package/dist/Switch/components/Switcher/Switcher.style.d.ts +6 -446
- package/dist/Switch/components/Switcher/Switcher.style.js +47 -25
- package/dist/Switch/components/Title/Title.style.d.ts +1 -1
- package/dist/Toast/components/Content/components/Description/Description.style.d.ts +1 -1
- package/dist/Toast/components/Content/components/Message/Message.style.d.ts +1 -1
- package/dist/Toast/core/mapping.types.d.ts +2 -2
- package/dist/Tooltip/components/Content/components/Text/Text.styles.d.ts +1 -1
- package/dist/Tooltip/components/Trigger/Trigger.style.cjs +2 -1
- package/dist/Tooltip/components/Trigger/Trigger.style.js +2 -1
- package/dist/TreeView/components/Compose/Compose.style.cjs +1 -2
- package/dist/TreeView/components/Compose/Compose.style.js +1 -2
- package/dist/TreeView/components/TreeItem/components/Checkbox/Checkbox.style.d.ts +1 -1
- package/dist/Typography/Typography.d.ts +3 -3
- package/dist/Typography/components/Body/Body.cjs +2 -0
- package/dist/Typography/components/Body/Body.d.ts +1 -1
- package/dist/Typography/components/Body/Body.js +2 -0
- package/dist/Typography/components/Body/Body.style.cjs +12 -2
- package/dist/Typography/components/Body/Body.style.d.ts +1 -1
- package/dist/Typography/components/Body/Body.style.js +12 -2
- package/dist/Typography/components/Body/Body.types.d.ts +3 -0
- package/dist/Typography/components/Code/Code.cjs +2 -0
- package/dist/Typography/components/Code/Code.d.ts +1 -1
- package/dist/Typography/components/Code/Code.js +2 -0
- package/dist/Typography/components/Code/Code.style.cjs +11 -1
- package/dist/Typography/components/Code/Code.style.js +11 -1
- package/dist/Typography/components/Code/Code.types.d.ts +3 -0
- package/dist/Typography/components/Heading/Heading.cjs +2 -0
- package/dist/Typography/components/Heading/Heading.d.ts +1 -1
- package/dist/Typography/components/Heading/Heading.js +2 -0
- package/dist/Typography/components/Heading/Heading.style.cjs +10 -2
- package/dist/Typography/components/Heading/Heading.style.d.ts +2 -1
- package/dist/Typography/components/Heading/Heading.style.js +10 -2
- package/dist/Typography/components/Heading/Heading.types.d.ts +2 -0
- package/dist/index.cjs +0 -2
- package/dist/index.js +0 -2
- package/package.json +4 -3
- package/dist/Link/Link.types.cjs +0 -4
- package/dist/Link/Link.types.js +0 -4
package/dist/Link/Link.cjs
CHANGED
|
@@ -1,62 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const jsxRuntime = require("../node_modules/react/jsx-runtime.cjs");
|
|
4
|
-
const redisUiIcons = require("@redislabsdev/redis-ui-icons");
|
|
5
4
|
const React = require("react");
|
|
6
5
|
const Link_style = require("./Link.style.cjs");
|
|
7
6
|
const linkSizeMap = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
M: "M",
|
|
8
|
+
S: "S"
|
|
9
|
+
};
|
|
10
|
+
const iconSizeMap = {
|
|
11
|
+
M: "L",
|
|
12
|
+
S: "M"
|
|
12
13
|
};
|
|
13
14
|
const linkIconSizeMap = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
small: "M",
|
|
17
|
-
"small-inline": "M"
|
|
15
|
+
M: "M",
|
|
16
|
+
S: "S"
|
|
18
17
|
};
|
|
18
|
+
const getFalse = () => false;
|
|
19
19
|
const Link = React.forwardRef(({
|
|
20
20
|
icon,
|
|
21
|
-
isExternalLink
|
|
21
|
+
isExternalLink,
|
|
22
|
+
external = isExternalLink,
|
|
22
23
|
children = "Read More",
|
|
23
|
-
variant
|
|
24
|
-
|
|
24
|
+
variant: userVariant,
|
|
25
|
+
size: userSize,
|
|
26
|
+
allowWrap = false,
|
|
27
|
+
disabled,
|
|
28
|
+
href,
|
|
29
|
+
onClick,
|
|
25
30
|
...restProps
|
|
26
31
|
}, ref) => {
|
|
32
|
+
const {
|
|
33
|
+
size = "M",
|
|
34
|
+
variant = "button"
|
|
35
|
+
} = getSizeAndLayout(userVariant, userSize);
|
|
27
36
|
const IconElement = icon;
|
|
28
|
-
const
|
|
37
|
+
const commonProps = {
|
|
38
|
+
ref,
|
|
39
|
+
$variant: variant,
|
|
40
|
+
$size: size,
|
|
41
|
+
$allowWrap: allowWrap,
|
|
42
|
+
tabIndex: 0
|
|
43
|
+
};
|
|
44
|
+
const hrefProps = href ? {
|
|
45
|
+
href,
|
|
46
|
+
target: "_blank",
|
|
47
|
+
rel: "noreferrer"
|
|
48
|
+
} : {
|
|
49
|
+
role: "button",
|
|
50
|
+
onClick,
|
|
51
|
+
onKeyDown: onClick && ((e) => {
|
|
52
|
+
if (e.key === "Enter") {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
onClick == null ? void 0 : onClick(e);
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
const disabledProps = disabled || !href && !onClick && disabled === void 0 ? {
|
|
59
|
+
disabled: true,
|
|
60
|
+
tabIndex: -1,
|
|
61
|
+
href: void 0,
|
|
62
|
+
onClick: getFalse,
|
|
63
|
+
onKeyDown: getFalse,
|
|
64
|
+
"aria-disabled": true
|
|
65
|
+
} : null;
|
|
66
|
+
return jsxRuntime.jsxRuntimeExports.jsxs(Link_style.StyledLink, {
|
|
67
|
+
...commonProps,
|
|
68
|
+
...hrefProps,
|
|
69
|
+
...restProps,
|
|
70
|
+
...disabledProps,
|
|
29
71
|
children: [icon && jsxRuntime.jsxRuntimeExports.jsx(IconElement, {
|
|
30
|
-
size:
|
|
72
|
+
size: iconSizeMap[size],
|
|
31
73
|
customColor: "currentColor"
|
|
32
|
-
}), jsxRuntime.jsxRuntimeExports.jsx(Link_style.StyledLinkText, {
|
|
74
|
+
}), typeof children === "string" ? jsxRuntime.jsxRuntimeExports.jsx(Link_style.StyledLinkText, {
|
|
33
75
|
variant: "semiBold",
|
|
34
|
-
size: linkSizeMap[
|
|
76
|
+
size: linkSizeMap[size],
|
|
35
77
|
component: "span",
|
|
78
|
+
ellipsis: true,
|
|
79
|
+
tooltipOnEllipsis: true,
|
|
36
80
|
children
|
|
37
|
-
}),
|
|
38
|
-
size: linkIconSizeMap[
|
|
81
|
+
}) : children, external && jsxRuntime.jsxRuntimeExports.jsx(Link_style.ExternalArrow, {
|
|
82
|
+
size: linkIconSizeMap[size],
|
|
39
83
|
customColor: "currentColor"
|
|
40
84
|
})]
|
|
41
85
|
});
|
|
42
|
-
if (restProps.href !== void 0) {
|
|
43
|
-
return jsxRuntime.jsxRuntimeExports.jsx(Link_style.StyledLink, {
|
|
44
|
-
ref,
|
|
45
|
-
variant,
|
|
46
|
-
disabled,
|
|
47
|
-
target: "_blank",
|
|
48
|
-
rel: "noreferrer",
|
|
49
|
-
...restProps,
|
|
50
|
-
children: linkContent
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return jsxRuntime.jsxRuntimeExports.jsx(Link_style.StyledLinkButton, {
|
|
54
|
-
variant,
|
|
55
|
-
type: "button",
|
|
56
|
-
...restProps,
|
|
57
|
-
disabled,
|
|
58
|
-
children: linkContent
|
|
59
|
-
});
|
|
60
86
|
});
|
|
61
87
|
const Link$1 = Link;
|
|
88
|
+
const variantSizeMap = {
|
|
89
|
+
regular: "M",
|
|
90
|
+
"regular-inline": "M",
|
|
91
|
+
small: "S",
|
|
92
|
+
"small-inline": "S"
|
|
93
|
+
};
|
|
94
|
+
const getSizeAndLayout = (variant, size) => ({
|
|
95
|
+
variant: (variant == null ? void 0 : variant.includes("inline")) ? "inline" : void 0,
|
|
96
|
+
size: size || variantSizeMap[variant]
|
|
97
|
+
});
|
|
62
98
|
exports.default = Link$1;
|
package/dist/Link/Link.d.ts
CHANGED
|
@@ -1,4 +1,289 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import { IconType } from '@redislabsdev/redis-ui-icons/monochrome';
|
|
4
|
+
import { LinkButtonVariants, LinkSize, ObsoleteLinkVariants } from './Link.types';
|
|
5
|
+
declare const Link: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
slot?: string | undefined;
|
|
7
|
+
style?: import("react").CSSProperties | undefined;
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
type?: string | undefined;
|
|
10
|
+
defaultChecked?: boolean | undefined;
|
|
11
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
12
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
13
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
14
|
+
accessKey?: string | undefined;
|
|
15
|
+
autoFocus?: boolean | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
18
|
+
contextMenu?: string | undefined;
|
|
19
|
+
dir?: string | undefined;
|
|
20
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
id?: string | undefined;
|
|
23
|
+
lang?: string | undefined;
|
|
24
|
+
nonce?: string | undefined;
|
|
25
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
26
|
+
tabIndex?: number | undefined;
|
|
27
|
+
translate?: "no" | "yes" | undefined;
|
|
28
|
+
radioGroup?: string | undefined;
|
|
29
|
+
role?: import("react").AriaRole | undefined;
|
|
30
|
+
about?: string | undefined;
|
|
31
|
+
content?: string | undefined;
|
|
32
|
+
datatype?: string | undefined;
|
|
33
|
+
inlist?: any;
|
|
34
|
+
prefix?: string | undefined;
|
|
35
|
+
property?: string | undefined;
|
|
36
|
+
rel?: string | undefined;
|
|
37
|
+
resource?: string | undefined;
|
|
38
|
+
rev?: string | undefined;
|
|
39
|
+
typeof?: string | undefined;
|
|
40
|
+
vocab?: string | undefined;
|
|
41
|
+
autoCapitalize?: string | undefined;
|
|
42
|
+
autoCorrect?: string | undefined;
|
|
43
|
+
autoSave?: string | undefined;
|
|
44
|
+
color?: string | undefined;
|
|
45
|
+
itemProp?: string | undefined;
|
|
46
|
+
itemScope?: boolean | undefined;
|
|
47
|
+
itemType?: string | undefined;
|
|
48
|
+
itemID?: string | undefined;
|
|
49
|
+
itemRef?: string | undefined;
|
|
50
|
+
results?: number | undefined;
|
|
51
|
+
security?: string | undefined;
|
|
52
|
+
unselectable?: "on" | "off" | undefined;
|
|
53
|
+
inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
|
|
54
|
+
is?: string | undefined;
|
|
55
|
+
"aria-activedescendant"?: string | undefined;
|
|
56
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
57
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
58
|
+
"aria-braillelabel"?: string | undefined;
|
|
59
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
60
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
61
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
62
|
+
"aria-colcount"?: number | undefined;
|
|
63
|
+
"aria-colindex"?: number | undefined;
|
|
64
|
+
"aria-colindextext"?: string | undefined;
|
|
65
|
+
"aria-colspan"?: number | undefined;
|
|
66
|
+
"aria-controls"?: string | undefined;
|
|
67
|
+
"aria-current"?: boolean | "time" | "step" | "date" | "true" | "false" | "page" | "location" | undefined;
|
|
68
|
+
"aria-describedby"?: string | undefined;
|
|
69
|
+
"aria-description"?: string | undefined;
|
|
70
|
+
"aria-details"?: string | undefined;
|
|
71
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
72
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
73
|
+
"aria-errormessage"?: string | undefined;
|
|
74
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
75
|
+
"aria-flowto"?: string | undefined;
|
|
76
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
77
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
|
|
78
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
79
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
80
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
81
|
+
"aria-label"?: string | undefined;
|
|
82
|
+
"aria-labelledby"?: string | undefined;
|
|
83
|
+
"aria-level"?: number | undefined;
|
|
84
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
85
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
86
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
88
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
89
|
+
"aria-owns"?: string | undefined;
|
|
90
|
+
"aria-placeholder"?: string | undefined;
|
|
91
|
+
"aria-posinset"?: number | undefined;
|
|
92
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
93
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
94
|
+
"aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
95
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
96
|
+
"aria-roledescription"?: string | undefined;
|
|
97
|
+
"aria-rowcount"?: number | undefined;
|
|
98
|
+
"aria-rowindex"?: number | undefined;
|
|
99
|
+
"aria-rowindextext"?: string | undefined;
|
|
100
|
+
"aria-rowspan"?: number | undefined;
|
|
101
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
"aria-setsize"?: number | undefined;
|
|
103
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
104
|
+
"aria-valuemax"?: number | undefined;
|
|
105
|
+
"aria-valuemin"?: number | undefined;
|
|
106
|
+
"aria-valuenow"?: number | undefined;
|
|
107
|
+
"aria-valuetext"?: string | undefined;
|
|
108
|
+
children?: import("react").ReactNode;
|
|
109
|
+
dangerouslySetInnerHTML?: {
|
|
110
|
+
__html: string | TrustedHTML;
|
|
111
|
+
} | undefined;
|
|
112
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
113
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
114
|
+
onCut?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
115
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
116
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
117
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
118
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
119
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
120
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
121
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
122
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
123
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
124
|
+
onFocus?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
125
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
126
|
+
onBlur?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
127
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
128
|
+
onChange?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
129
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
130
|
+
onBeforeInput?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
131
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
132
|
+
onInput?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
133
|
+
onInputCapture?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
134
|
+
onReset?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
135
|
+
onResetCapture?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
136
|
+
onSubmit?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
137
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
138
|
+
onInvalid?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
139
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLAnchorElement> | undefined;
|
|
140
|
+
onLoad?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
141
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
142
|
+
onError?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
143
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
144
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
145
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
146
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
147
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
148
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
149
|
+
onAbort?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
150
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
151
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
152
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
153
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
154
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
155
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
156
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
157
|
+
onEmptied?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
158
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
159
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
160
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
161
|
+
onEnded?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
162
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
163
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
164
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
165
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
166
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
167
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
168
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
169
|
+
onPause?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
170
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
171
|
+
onPlay?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
172
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
173
|
+
onPlaying?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
174
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
175
|
+
onProgress?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
176
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
177
|
+
onRateChange?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
178
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
179
|
+
onResize?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
180
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
181
|
+
onSeeked?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
182
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
183
|
+
onSeeking?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
184
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
185
|
+
onStalled?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
186
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
187
|
+
onSuspend?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
188
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
189
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
190
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
191
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
192
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
193
|
+
onWaiting?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
194
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
195
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
196
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
197
|
+
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
198
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
199
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
200
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
201
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
202
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
203
|
+
onDrag?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
204
|
+
onDragCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
205
|
+
onDragEnd?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
206
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
207
|
+
onDragEnter?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
208
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
209
|
+
onDragExit?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
210
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
211
|
+
onDragLeave?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
212
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
213
|
+
onDragOver?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
214
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
215
|
+
onDragStart?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
216
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
217
|
+
onDrop?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
218
|
+
onDropCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
219
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
220
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
221
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
222
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
223
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
224
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
225
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
226
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
227
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
228
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
229
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
230
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
231
|
+
onSelect?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
232
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
233
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
234
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
235
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
236
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
237
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
238
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
239
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
240
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
241
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
242
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
243
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
244
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
245
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
246
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
247
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
248
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
249
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
250
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
251
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
252
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
253
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
254
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
255
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
256
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
257
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
258
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
259
|
+
onScroll?: import("react").UIEventHandler<HTMLAnchorElement> | undefined;
|
|
260
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLAnchorElement> | undefined;
|
|
261
|
+
onWheel?: import("react").WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
262
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
263
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
264
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
265
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
266
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
267
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
268
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
269
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
270
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
271
|
+
media?: string | undefined;
|
|
272
|
+
target?: import("react").HTMLAttributeAnchorTarget | undefined;
|
|
273
|
+
href?: string | undefined;
|
|
274
|
+
download?: any;
|
|
275
|
+
hrefLang?: string | undefined;
|
|
276
|
+
ping?: string | undefined;
|
|
277
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
278
|
+
} & {
|
|
279
|
+
icon?: IconType | undefined;
|
|
280
|
+
variant?: ObsoleteLinkVariants | LinkButtonVariants | undefined;
|
|
281
|
+
allowWrap?: boolean | undefined;
|
|
282
|
+
size?: LinkSize | undefined;
|
|
283
|
+
external?: boolean | undefined;
|
|
284
|
+
disabled?: boolean | undefined;
|
|
285
|
+
href?: string | undefined;
|
|
286
|
+
onClick?: import("react").UIEventHandler<Element> | undefined;
|
|
287
|
+
isExternalLink?: boolean | undefined;
|
|
288
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
4
289
|
export default Link;
|
package/dist/Link/Link.js
CHANGED
|
@@ -1,62 +1,98 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import { ArrowDiagonalIcon } from "@redislabsdev/redis-ui-icons";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
3
|
+
import { StyledLink, StyledLinkText, ExternalArrow } from "./Link.style.js";
|
|
5
4
|
const linkSizeMap = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
M: "M",
|
|
6
|
+
S: "S"
|
|
7
|
+
};
|
|
8
|
+
const iconSizeMap = {
|
|
9
|
+
M: "L",
|
|
10
|
+
S: "M"
|
|
10
11
|
};
|
|
11
12
|
const linkIconSizeMap = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
small: "M",
|
|
15
|
-
"small-inline": "M"
|
|
13
|
+
M: "M",
|
|
14
|
+
S: "S"
|
|
16
15
|
};
|
|
16
|
+
const getFalse = () => false;
|
|
17
17
|
const Link = forwardRef(({
|
|
18
18
|
icon,
|
|
19
|
-
isExternalLink
|
|
19
|
+
isExternalLink,
|
|
20
|
+
external = isExternalLink,
|
|
20
21
|
children = "Read More",
|
|
21
|
-
variant
|
|
22
|
-
|
|
22
|
+
variant: userVariant,
|
|
23
|
+
size: userSize,
|
|
24
|
+
allowWrap = false,
|
|
25
|
+
disabled,
|
|
26
|
+
href,
|
|
27
|
+
onClick,
|
|
23
28
|
...restProps
|
|
24
29
|
}, ref) => {
|
|
30
|
+
const {
|
|
31
|
+
size = "M",
|
|
32
|
+
variant = "button"
|
|
33
|
+
} = getSizeAndLayout(userVariant, userSize);
|
|
25
34
|
const IconElement = icon;
|
|
26
|
-
const
|
|
35
|
+
const commonProps = {
|
|
36
|
+
ref,
|
|
37
|
+
$variant: variant,
|
|
38
|
+
$size: size,
|
|
39
|
+
$allowWrap: allowWrap,
|
|
40
|
+
tabIndex: 0
|
|
41
|
+
};
|
|
42
|
+
const hrefProps = href ? {
|
|
43
|
+
href,
|
|
44
|
+
target: "_blank",
|
|
45
|
+
rel: "noreferrer"
|
|
46
|
+
} : {
|
|
47
|
+
role: "button",
|
|
48
|
+
onClick,
|
|
49
|
+
onKeyDown: onClick && ((e) => {
|
|
50
|
+
if (e.key === "Enter") {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
onClick == null ? void 0 : onClick(e);
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
const disabledProps = disabled || !href && !onClick && disabled === void 0 ? {
|
|
57
|
+
disabled: true,
|
|
58
|
+
tabIndex: -1,
|
|
59
|
+
href: void 0,
|
|
60
|
+
onClick: getFalse,
|
|
61
|
+
onKeyDown: getFalse,
|
|
62
|
+
"aria-disabled": true
|
|
63
|
+
} : null;
|
|
64
|
+
return jsxRuntimeExports.jsxs(StyledLink, {
|
|
65
|
+
...commonProps,
|
|
66
|
+
...hrefProps,
|
|
67
|
+
...restProps,
|
|
68
|
+
...disabledProps,
|
|
27
69
|
children: [icon && jsxRuntimeExports.jsx(IconElement, {
|
|
28
|
-
size:
|
|
70
|
+
size: iconSizeMap[size],
|
|
29
71
|
customColor: "currentColor"
|
|
30
|
-
}), jsxRuntimeExports.jsx(StyledLinkText, {
|
|
72
|
+
}), typeof children === "string" ? jsxRuntimeExports.jsx(StyledLinkText, {
|
|
31
73
|
variant: "semiBold",
|
|
32
|
-
size: linkSizeMap[
|
|
74
|
+
size: linkSizeMap[size],
|
|
33
75
|
component: "span",
|
|
76
|
+
ellipsis: true,
|
|
77
|
+
tooltipOnEllipsis: true,
|
|
34
78
|
children
|
|
35
|
-
}),
|
|
36
|
-
size: linkIconSizeMap[
|
|
79
|
+
}) : children, external && jsxRuntimeExports.jsx(ExternalArrow, {
|
|
80
|
+
size: linkIconSizeMap[size],
|
|
37
81
|
customColor: "currentColor"
|
|
38
82
|
})]
|
|
39
83
|
});
|
|
40
|
-
if (restProps.href !== void 0) {
|
|
41
|
-
return jsxRuntimeExports.jsx(StyledLink, {
|
|
42
|
-
ref,
|
|
43
|
-
variant,
|
|
44
|
-
disabled,
|
|
45
|
-
target: "_blank",
|
|
46
|
-
rel: "noreferrer",
|
|
47
|
-
...restProps,
|
|
48
|
-
children: linkContent
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return jsxRuntimeExports.jsx(StyledLinkButton, {
|
|
52
|
-
variant,
|
|
53
|
-
type: "button",
|
|
54
|
-
...restProps,
|
|
55
|
-
disabled,
|
|
56
|
-
children: linkContent
|
|
57
|
-
});
|
|
58
84
|
});
|
|
59
85
|
const Link$1 = Link;
|
|
86
|
+
const variantSizeMap = {
|
|
87
|
+
regular: "M",
|
|
88
|
+
"regular-inline": "M",
|
|
89
|
+
small: "S",
|
|
90
|
+
"small-inline": "S"
|
|
91
|
+
};
|
|
92
|
+
const getSizeAndLayout = (variant, size) => ({
|
|
93
|
+
variant: (variant == null ? void 0 : variant.includes("inline")) ? "inline" : void 0,
|
|
94
|
+
size: size || variantSizeMap[variant]
|
|
95
|
+
});
|
|
60
96
|
export {
|
|
61
97
|
Link$1 as default
|
|
62
98
|
};
|
package/dist/Link/Link.style.cjs
CHANGED
|
@@ -2,60 +2,60 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const _styled = require("styled-components");
|
|
4
4
|
const redisUiStyles = require("@redislabsdev/redis-ui-styles");
|
|
5
|
+
const redisUiIcons = require("@redislabsdev/redis-ui-icons");
|
|
5
6
|
const Button_style_utils = require("../Button/Button.style.utils.cjs");
|
|
6
7
|
const css_utils = require("../Helpers/css.utils.cjs");
|
|
7
8
|
const Typography = require("../Typography/Typography.cjs");
|
|
8
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
9
10
|
const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
size,
|
|
14
|
-
layout
|
|
15
|
-
};
|
|
11
|
+
const themeSizeMap = {
|
|
12
|
+
M: "regular",
|
|
13
|
+
S: "small"
|
|
16
14
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
15
|
+
const themeLayoutMap = {
|
|
16
|
+
button: "block",
|
|
17
|
+
inline: "inline"
|
|
18
|
+
};
|
|
19
|
+
const getVariantStyle = (theme, variant, size) => {
|
|
20
|
+
const themeSize = themeSizeMap[size];
|
|
21
|
+
const themeLayout = themeLayoutMap[variant];
|
|
22
|
+
const layoutStyle = theme.components.link.variants[themeLayout];
|
|
23
|
+
const sizeStyle = layoutStyle.sizes[themeSize];
|
|
24
24
|
return _styled.css`
|
|
25
25
|
padding: ${sizeStyle.padding};
|
|
26
26
|
border-radius: ${sizeStyle.borderRadius};
|
|
27
|
-
|
|
27
|
+
min-height: ${sizeStyle.minHeight};
|
|
28
28
|
|
|
29
29
|
&:disabled,
|
|
30
30
|
&[disabled] {
|
|
31
|
-
|
|
31
|
+
cursor: not-allowed;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
${Button_style_utils.getButtonStatesStyle(layoutStyle.states, [css_utils.tokenMaps.bgColor, css_utils.tokenMaps.textColor])};
|
|
34
|
+
${Button_style_utils.getButtonStatesStyle(layoutStyle.states, [css_utils.tokenMaps.bgColor, css_utils.tokenMaps.textColor, css_utils.tokenMaps.shadowBorder])};
|
|
35
35
|
|
|
36
36
|
${redisUiStyles.getFocusStyle()};
|
|
37
37
|
`;
|
|
38
38
|
};
|
|
39
|
-
const linkStyles = _styled.css`
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
`;
|
|
43
39
|
const StyledLink = _styled__default.default.a.withConfig({
|
|
44
40
|
displayName: "Linkstyle__StyledLink",
|
|
45
41
|
componentId: "RedisUI__sc-1hmmpl3-0"
|
|
46
|
-
})(["", ";", ";"
|
|
47
|
-
|
|
48
|
-
}) =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}) => getVariantStyle(redisUiStyles.useTheme(), variant));
|
|
42
|
+
})(["white-space:", ";display:", ";text-decoration:none;cursor:pointer;line-height:unset;align-items:center;> svg{vertical-align:text-bottom;flex:none;}", ";"], ({
|
|
43
|
+
$allowWrap
|
|
44
|
+
}) => $allowWrap ? "wrap" : "nowrap", ({
|
|
45
|
+
$variant,
|
|
46
|
+
$allowWrap
|
|
47
|
+
}) => $variant === "inline" && "inline" || ($allowWrap ? "inline-block" : "inline-flex"), ({
|
|
48
|
+
$variant,
|
|
49
|
+
$size
|
|
50
|
+
}) => getVariantStyle(redisUiStyles.useTheme(), $variant, $size));
|
|
55
51
|
const StyledLinkText = _styled__default.default(Typography.default.Body).withConfig({
|
|
56
52
|
displayName: "Linkstyle__StyledLinkText",
|
|
53
|
+
componentId: "RedisUI__sc-1hmmpl3-1"
|
|
54
|
+
})(["text-decoration:underline;white-space:inherit;min-width:0;flex:1;"]);
|
|
55
|
+
const ExternalArrow = _styled__default.default(redisUiIcons.ArrowDiagonalIcon).withConfig({
|
|
56
|
+
displayName: "Linkstyle__ExternalArrow",
|
|
57
57
|
componentId: "RedisUI__sc-1hmmpl3-2"
|
|
58
|
-
})(["
|
|
58
|
+
})(["&&{vertical-align:middle;}"]);
|
|
59
|
+
exports.ExternalArrow = ExternalArrow;
|
|
59
60
|
exports.StyledLink = StyledLink;
|
|
60
|
-
exports.StyledLinkButton = StyledLinkButton;
|
|
61
61
|
exports.StyledLinkText = StyledLinkText;
|