@synerise/ds-list-item 1.4.8 → 1.4.10
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/CHANGELOG.md +8 -0
- package/README.md +27 -9
- package/dist/ListItem.const.d.ts +1 -1
- package/dist/ListItem.const.js +6 -3
- package/dist/ListItem.d.ts +14 -14
- package/dist/ListItem.js +33 -50
- package/dist/ListItem.styles.js +1 -0
- package/dist/ListItem.types.d.ts +5 -5
- package/dist/ListItem.types.js +13 -14
- package/dist/components/Danger/Danger.d.ts +4 -4
- package/dist/components/Danger/Danger.js +11 -12
- package/dist/components/Danger/Danger.styles.d.ts +3 -3
- package/dist/components/Danger/Danger.styles.js +23 -18
- package/dist/components/Divider/Divider.d.ts +2 -2
- package/dist/components/Divider/Divider.js +8 -9
- package/dist/components/Divider/Divider.styles.d.ts +2 -2
- package/dist/components/Divider/Divider.styles.js +7 -8
- package/dist/components/Divider/Divider.types.d.ts +1 -1
- package/dist/components/Divider/Divider.types.js +1 -1
- package/dist/components/GroupItem/GroupItem.d.ts +2 -2
- package/dist/components/GroupItem/GroupItem.js +17 -9
- package/dist/components/GroupItem/GroupItem.styles.d.ts +1 -1
- package/dist/components/GroupItem/GroupItem.styles.js +6 -5
- package/dist/components/Header/Header.d.ts +2 -2
- package/dist/components/Header/Header.js +19 -22
- package/dist/components/Header/Header.styles.d.ts +2 -2
- package/dist/components/Header/Header.styles.js +9 -9
- package/dist/components/Header/Header.types.d.ts +2 -2
- package/dist/components/Header/Header.types.js +1 -1
- package/dist/components/HoverTooltip/HoverTooltip.const.d.ts +1 -1
- package/dist/components/HoverTooltip/HoverTooltip.const.js +13 -6
- package/dist/components/HoverTooltip/HoverTooltip.d.ts +2 -2
- package/dist/components/HoverTooltip/HoverTooltip.js +26 -44
- package/dist/components/HoverTooltip/HoverTooltip.styles.d.ts +1 -1
- package/dist/components/HoverTooltip/HoverTooltip.styles.js +6 -3
- package/dist/components/HoverTooltip/HoverTooltip.types.d.ts +2 -2
- package/dist/components/HoverTooltip/HoverTooltip.types.js +1 -1
- package/dist/components/ListContext/ListContext.d.ts +3 -3
- package/dist/components/ListContext/ListContext.js +8 -4
- package/dist/components/ListContext/ListContextProvider.d.ts +2 -2
- package/dist/components/ListContext/ListContextProvider.js +16 -19
- package/dist/components/ListWrapper/ListWrapper.d.ts +3 -3
- package/dist/components/ListWrapper/ListWrapper.js +13 -13
- package/dist/components/ListWrapper/ListWrapper.styles.d.ts +1 -1
- package/dist/components/ListWrapper/ListWrapper.styles.js +6 -5
- package/dist/components/Select/Select.d.ts +4 -5
- package/dist/components/Select/Select.js +12 -16
- package/dist/components/Select/Select.styles.d.ts +3 -3
- package/dist/components/Select/Select.styles.js +8 -7
- package/dist/components/SubMenu/SubMenu.d.ts +2 -2
- package/dist/components/SubMenu/SubMenu.js +16 -22
- package/dist/components/SubMenu/SubMenu.styles.d.ts +2 -2
- package/dist/components/SubMenu/SubMenu.styles.js +9 -7
- package/dist/components/Text/DynamicLabel.d.ts +1 -1
- package/dist/components/Text/DynamicLabel.js +15 -10
- package/dist/components/Text/ItemLabel.const.js +4 -1
- package/dist/components/Text/ItemLabel.d.ts +3 -3
- package/dist/components/Text/ItemLabel.js +81 -82
- package/dist/components/Text/Text.d.ts +4 -4
- package/dist/components/Text/Text.js +119 -159
- package/dist/components/Text/Text.styles.d.ts +14 -14
- package/dist/components/Text/Text.styles.js +49 -85
- package/dist/components/Text/utils.d.ts +2 -2
- package/dist/components/Text/utils.js +27 -27
- package/dist/components/index.js +12 -5
- package/dist/hooks/useTemporaryLabel.d.ts +1 -1
- package/dist/hooks/useTemporaryLabel.js +12 -13
- package/dist/index.js +22 -7
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +9 -9
|
@@ -1,120 +1,84 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import { IconContainer } from
|
|
3
|
-
import { LIST_ITEM_SIZE_MAPPING } from
|
|
4
|
-
import { INDENT_WIDTH } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var visibleElementStyle = function visibleElementStyle() {
|
|
10
|
-
return css(["opacity:1;pointer-events:all;"]);
|
|
11
|
-
};
|
|
12
|
-
export var SuffixWrapper = styled.div.withConfig({
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
3
|
+
import { LIST_ITEM_SIZE_MAPPING } from "../../ListItem.const.js";
|
|
4
|
+
import { INDENT_WIDTH } from "./ItemLabel.const.js";
|
|
5
|
+
const TRANSITION_FN = "0.2s ease-out";
|
|
6
|
+
const hiddenElementStyle = () => css(["opacity:0;pointer-events:none;"]);
|
|
7
|
+
const visibleElementStyle = () => css(["opacity:1;pointer-events:all;"]);
|
|
8
|
+
const SuffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
13
9
|
displayName: "Textstyles__SuffixWrapper",
|
|
14
10
|
componentId: "sc-1j4eogh-0"
|
|
15
|
-
})(["display:flex;order:10;justify-content:flex-end;", ";"],
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
export var PrefixWrapper = styled.div.withConfig({
|
|
11
|
+
})(["display:flex;order:10;justify-content:flex-end;", ";"], (props) => props.visible ? visibleElementStyle() : hiddenElementStyle());
|
|
12
|
+
const PrefixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
19
13
|
displayName: "Textstyles__PrefixWrapper",
|
|
20
14
|
componentId: "sc-1j4eogh-1"
|
|
21
|
-
})(["display:flex;order:1;", ";transition:opacity ", ";margin-top:-7px;margin-bottom:-7px;margin-left:-4px;margin-right:12px;align-items:center;"],
|
|
22
|
-
|
|
23
|
-
}, TRANSITION_FN);
|
|
24
|
-
export var Highlight = styled.span.withConfig({
|
|
15
|
+
})(["display:flex;order:1;", ";transition:opacity ", ";margin-top:-7px;margin-bottom:-7px;margin-left:-4px;margin-right:12px;align-items:center;"], (props) => props.visible ? visibleElementStyle() : hiddenElementStyle(), TRANSITION_FN);
|
|
16
|
+
const Highlight = /* @__PURE__ */ styled.span.withConfig({
|
|
25
17
|
displayName: "Textstyles__Highlight",
|
|
26
18
|
componentId: "sc-1j4eogh-2"
|
|
27
19
|
})([""]);
|
|
28
|
-
|
|
29
|
-
if (indentLevel === void 0) {
|
|
30
|
-
indentLevel = 0;
|
|
31
|
-
}
|
|
20
|
+
const getPaddingFromIndentLevel = (indentLevel = 0) => {
|
|
32
21
|
return indentLevel * INDENT_WIDTH;
|
|
33
22
|
};
|
|
34
|
-
|
|
35
|
-
if (indentLevel === void 0) {
|
|
36
|
-
indentLevel = 0;
|
|
37
|
-
}
|
|
38
|
-
if (withPrefixel === void 0) {
|
|
39
|
-
withPrefixel = false;
|
|
40
|
-
}
|
|
23
|
+
const calculatePadding = (indentLevel = 0, withPrefixel = false) => {
|
|
41
24
|
return getPaddingFromIndentLevel(indentLevel) + (withPrefixel ? 8 : 12);
|
|
42
25
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, function (props) {
|
|
46
|
-
return LIST_ITEM_SIZE_MAPPING[props.size || 'default'];
|
|
47
|
-
}, function (props) {
|
|
48
|
-
return props.theme.palette.white;
|
|
49
|
-
}, function (props) {
|
|
50
|
-
return props.theme.palette['grey-700'];
|
|
51
|
-
});
|
|
52
|
-
export var ArrowRight = styled.div.withConfig({
|
|
26
|
+
const baseStyles = /* @__PURE__ */ css(["display:flex;align-items:center;margin:0;padding-left:", "px;padding-right:12px;font-size:13px;line-height:1.39;font-weight:500;user-select:none;border-radius:3px;transition:background-color 0.2s ease-out,color 0.2s ease-out;min-height:", "px;background:", ";border:none;color:", ";cursor:pointer;opacity:1;"], (props) => calculatePadding(props.indentLevel, !!props.prefixel), (props) => LIST_ITEM_SIZE_MAPPING[props.size || "default"], (props) => props.theme.palette.white, (props) => props.theme.palette["grey-700"]);
|
|
27
|
+
const ArrowRight = /* @__PURE__ */ styled.div.withConfig({
|
|
53
28
|
displayName: "Textstyles__ArrowRight",
|
|
54
29
|
componentId: "sc-1j4eogh-3"
|
|
55
30
|
})(["order:3;"]);
|
|
56
|
-
|
|
31
|
+
const Inner = /* @__PURE__ */ styled.div.withConfig({
|
|
57
32
|
displayName: "Textstyles__Inner",
|
|
58
33
|
componentId: "sc-1j4eogh-4"
|
|
59
34
|
})(["flex-grow:1;min-width:0;&::after{content:'';flex-grow:1;order:4;}"]);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, PrefixWrapper, function (props) {
|
|
65
|
-
return props.theme.palette['blue-600'];
|
|
66
|
-
});
|
|
67
|
-
var highlightStyle = css(["font-weight:400;.ds-list-item-highlight{font-weight:600;}"]);
|
|
68
|
-
var orderedStyle = css(["&::before{content:none;}"]);
|
|
69
|
-
export var Content = styled.div.withConfig({
|
|
35
|
+
const selectedStyle = /* @__PURE__ */ css(["background:", ";color:", ";", "{svg{fill:", ";}}"], (props) => props.theme.palette["blue-050"], (props) => props.theme.palette["blue-600"], PrefixWrapper, (props) => props.theme.palette["blue-600"]);
|
|
36
|
+
const highlightStyle = /* @__PURE__ */ css(["font-weight:400;.ds-list-item-highlight{font-weight:600;}"]);
|
|
37
|
+
const orderedStyle = /* @__PURE__ */ css(["&::before{content:none;}"]);
|
|
38
|
+
const Content = /* @__PURE__ */ styled.div.withConfig({
|
|
70
39
|
displayName: "Textstyles__Content",
|
|
71
40
|
componentId: "sc-1j4eogh-5"
|
|
72
41
|
})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;order:2;"]);
|
|
73
|
-
|
|
42
|
+
const Wrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
74
43
|
displayName: "Textstyles__Wrapper",
|
|
75
44
|
componentId: "sc-1j4eogh-6"
|
|
76
|
-
})(["display:flex;min-width:173px;", " ", " ", " ", "{", " ", " ", "{transition:all ", ";opacity:", ";}", " &.ant-menu-item-selected,&.-item-selected{", "}", " ", " .ds-checkbox,.ds-checkbox > .ant-checkbox-wrapper{padding:0;}}"],
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return featured && css(["&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", " svg,", "{fill:", ";color:", ";}}&:hover,&:active,&:focus-visible:not(:active){&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", " svg,", "{fill:", ";color:", ";}&:focus-visible:not(:active) ", "{box-shadow:inset 0 0 0 2px ", ";}}}", " ", ""], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, ArrowRight, Content, theme.palette['blue-600'], theme.palette['blue-600'], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, ArrowRight, Content, theme.palette['blue-700'], theme.palette['blue-700'], Inner, theme.palette['blue-700'], disabled && css(["&:hover{&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", "{fill:", ";color:", ";}}}"], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, Content, theme.palette['blue-600'], theme.palette['blue-600']), selected && css(["&:hover{&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", "{fill:", ";color:", ";}}}"], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, Content, theme.palette['blue-700'], theme.palette['blue-700']));
|
|
84
|
-
}, function (props) {
|
|
85
|
-
return props.disabled ? css(["cursor:not-allowed;opacity:0.4;svg{fill:", ";}&:hover{", "{opacity:1;svg{fill:", ";}}}"], props.theme.palette['grey-600'], ArrowRight, props.theme.palette['grey-600']) : css(["", " > .ds-icon > svg{fill:", ";}&:hover{", "{background:", ";", ";}}&:focus-visible:not(:active){", "{box-shadow:inset 0 0 0 2px ", ";}}&:focus-visible:active,&:active{", "{background:", ";", "}}}"], PrefixWrapper, props.theme.palette['grey-600'], Inner, props.theme.palette['grey-050'], !props.noHover && css(["&{color:", ";}", "{", " > svg{fill:", ";}}", "{opacity:1;svg{fill:", ";}}"], props.noHover ? props.theme.palette['grey-700'] : props.theme.palette['blue-600'], PrefixWrapper, IconContainer, props.theme.palette['blue-600'], ArrowRight, props.theme.palette['blue-600']), Inner, props.theme.palette['blue-600'], Inner, props.theme.palette['blue-050'], !props.noHover && css(["color:", ";", "{", " > svg{fill:", ";}}"], props.theme.palette['blue-600'], PrefixWrapper, IconContainer, props.theme.palette['blue-600']));
|
|
86
|
-
}, Inner, function (props) {
|
|
87
|
-
return props.ordered && css(["&::before{font-weight:400;color:", ";counter-increment:ds-list-items 1;content:'0' counter(ds-list-items) '. \\00A0';}"], props.theme.palette['grey-500']);
|
|
88
|
-
}, baseStyles, ArrowRight, TRANSITION_FN, function (props) {
|
|
89
|
-
return props.disabled ? '1' : '0';
|
|
90
|
-
}, function (props) {
|
|
91
|
-
return props.selected && selectedStyle;
|
|
92
|
-
}, selectedStyle, function (props) {
|
|
93
|
-
return props.highlight && highlightStyle;
|
|
94
|
-
}, function (props) {
|
|
95
|
-
return !props.ordered && orderedStyle;
|
|
96
|
-
});
|
|
97
|
-
export var Divider = styled.div.withConfig({
|
|
45
|
+
})(["display:flex;min-width:173px;", " ", " ", " ", "{", " ", " ", "{transition:all ", ";opacity:", ";}", " &.ant-menu-item-selected,&.-item-selected{", "}", " ", " .ds-checkbox,.ds-checkbox > .ant-checkbox-wrapper{padding:0;}}"], (props) => props.inTooltip && css(["height:100%;"]), ({
|
|
46
|
+
featured,
|
|
47
|
+
disabled,
|
|
48
|
+
selected,
|
|
49
|
+
theme
|
|
50
|
+
}) => featured && css(["&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", " svg,", "{fill:", ";color:", ";}}&:hover,&:active,&:focus-visible:not(:active){&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", " svg,", "{fill:", ";color:", ";}&:focus-visible:not(:active) ", "{box-shadow:inset 0 0 0 2px ", ";}}}", " ", ""], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, ArrowRight, Content, theme.palette["blue-600"], theme.palette["blue-600"], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, ArrowRight, Content, theme.palette["blue-700"], theme.palette["blue-700"], Inner, theme.palette["blue-700"], disabled && css(["&:hover{&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", "{fill:", ";color:", ";}}}"], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, Content, theme.palette["blue-600"], theme.palette["blue-600"]), selected && css(["&:hover{&&{", " > .ds-icon > svg,", " ", " > svg,", " > .ds-icon > svg,", " ", " > svg,", "{fill:", ";color:", ";}}}"], PrefixWrapper, PrefixWrapper, IconContainer, SuffixWrapper, SuffixWrapper, IconContainer, Content, theme.palette["blue-700"], theme.palette["blue-700"])), (props) => props.disabled ? css(["cursor:not-allowed;opacity:0.4;svg{fill:", ";}&:hover{", "{opacity:1;svg{fill:", ";}}}"], props.theme.palette["grey-600"], ArrowRight, props.theme.palette["grey-600"]) : css(["", " > .ds-icon > svg{fill:", ";}&:hover{", "{background:", ";", ";}}&:focus-visible:not(:active){", "{box-shadow:inset 0 0 0 2px ", ";}}&:focus-visible:active,&:active{", "{background:", ";", "}}}"], PrefixWrapper, props.theme.palette["grey-600"], Inner, props.theme.palette["grey-050"], !props.noHover && css(["&{color:", ";}", "{", " > svg{fill:", ";}}", "{opacity:1;svg{fill:", ";}}"], props.noHover ? props.theme.palette["grey-700"] : props.theme.palette["blue-600"], PrefixWrapper, IconContainer, props.theme.palette["blue-600"], ArrowRight, props.theme.palette["blue-600"]), Inner, props.theme.palette["blue-600"], Inner, props.theme.palette["blue-050"], !props.noHover && css(["color:", ";", "{", " > svg{fill:", ";}}"], props.theme.palette["blue-600"], PrefixWrapper, IconContainer, props.theme.palette["blue-600"])), Inner, (props) => props.ordered && css(["&::before{font-weight:400;color:", ";counter-increment:ds-list-items 1;content:'0' counter(ds-list-items) '. \\00A0';}"], props.theme.palette["grey-500"]), baseStyles, ArrowRight, TRANSITION_FN, (props) => props.disabled ? "1" : "0", (props) => props.selected && selectedStyle, selectedStyle, (props) => props.highlight && highlightStyle, (props) => !props.ordered && orderedStyle);
|
|
51
|
+
const Divider = /* @__PURE__ */ styled.div.withConfig({
|
|
98
52
|
displayName: "Textstyles__Divider",
|
|
99
53
|
componentId: "sc-1j4eogh-7"
|
|
100
54
|
})(["flex-grow:1;"]);
|
|
101
|
-
|
|
55
|
+
const DynamicLabelMain = /* @__PURE__ */ styled.div.withConfig({
|
|
102
56
|
displayName: "Textstyles__DynamicLabelMain",
|
|
103
57
|
componentId: "sc-1j4eogh-8"
|
|
104
58
|
})([""]);
|
|
105
|
-
|
|
59
|
+
const DynamicLabelAlternate = /* @__PURE__ */ styled.div.withConfig({
|
|
106
60
|
displayName: "Textstyles__DynamicLabelAlternate",
|
|
107
61
|
componentId: "sc-1j4eogh-9"
|
|
108
62
|
})([""]);
|
|
109
|
-
|
|
63
|
+
const DynamicLabelWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
110
64
|
displayName: "Textstyles__DynamicLabelWrapper",
|
|
111
65
|
componentId: "sc-1j4eogh-10"
|
|
112
|
-
})(["", ""],
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
export var Description = styled.div.withConfig({
|
|
66
|
+
})(["", ""], (props) => props.showAlternative ? css(["", "{height:0;visibility:hidden;}", "{height:auto;visibility:visible;}"], DynamicLabelMain, DynamicLabelAlternate) : css(["", "{height:auto;visibility:visible;}", "{height:0;visibility:hidden;}"], DynamicLabelMain, DynamicLabelAlternate));
|
|
67
|
+
const Description = /* @__PURE__ */ styled.div.withConfig({
|
|
116
68
|
displayName: "Textstyles__Description",
|
|
117
69
|
componentId: "sc-1j4eogh-11"
|
|
118
|
-
})(["text-overflow:ellipsis;overflow:hidden;color:", ";font-weight:normal;line-height:1.39;font-size:13px;width:100%;"],
|
|
119
|
-
|
|
120
|
-
|
|
70
|
+
})(["text-overflow:ellipsis;overflow:hidden;color:", ";font-weight:normal;line-height:1.39;font-size:13px;width:100%;"], (props) => props.theme.palette["grey-600"]);
|
|
71
|
+
export {
|
|
72
|
+
ArrowRight,
|
|
73
|
+
Content,
|
|
74
|
+
Description,
|
|
75
|
+
Divider,
|
|
76
|
+
DynamicLabelAlternate,
|
|
77
|
+
DynamicLabelMain,
|
|
78
|
+
DynamicLabelWrapper,
|
|
79
|
+
Highlight,
|
|
80
|
+
Inner,
|
|
81
|
+
PrefixWrapper,
|
|
82
|
+
SuffixWrapper,
|
|
83
|
+
Wrapper
|
|
84
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AddonRenderer, BasicItemProps } from '../../ListItem.types';
|
|
3
3
|
export declare const renderAddon: (addon: ReactNode | AddonRenderer, ...params: Parameters<AddonRenderer>) => ReactNode;
|
|
4
4
|
export declare const removeHandlerProps: (props: BasicItemProps) => {
|
|
5
5
|
[k: string]: any;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
params[_key - 1] = arguments[_key];
|
|
4
|
-
}
|
|
5
|
-
return addon instanceof Function ? addon.apply(void 0, params) : addon;
|
|
1
|
+
const renderAddon = (addon, ...params) => {
|
|
2
|
+
return addon instanceof Function ? addon(...params) : addon;
|
|
6
3
|
};
|
|
7
|
-
|
|
8
|
-
return Object.fromEntries(Object.entries(props).filter(
|
|
9
|
-
var key = _ref[0];
|
|
10
|
-
return typeof props[key] !== 'function';
|
|
11
|
-
}));
|
|
4
|
+
const removeHandlerProps = (props) => {
|
|
5
|
+
return Object.fromEntries(Object.entries(props).filter(([key]) => typeof props[key] !== "function"));
|
|
12
6
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
const getCopyConfig = ({
|
|
8
|
+
copyable,
|
|
9
|
+
copyValue,
|
|
10
|
+
disabled
|
|
11
|
+
}) => {
|
|
12
|
+
const DEFAULT_RESET_TIMER = 1e3;
|
|
13
|
+
const DELAY_CLICK_AFTER_COPY_DURATION = 700;
|
|
14
|
+
const enabled = copyable && (copyValue || typeof copyable === "object" && copyable.copyValue) && !disabled;
|
|
15
|
+
const valueToCopy = typeof copyable === "object" ? copyable.copyValue : copyValue;
|
|
16
|
+
const copiedLabel = typeof copyable === "object" ? copyable.copiedLabel : null;
|
|
17
|
+
const labelTimerReset = typeof copyable === "object" && copyable.timeToReset || DEFAULT_RESET_TIMER;
|
|
18
|
+
const delayClickEvent = typeof copyable === "object" && copyable.delayClickEvent !== void 0 ? copyable.delayClickEvent : copyable ? DELAY_CLICK_AFTER_COPY_DURATION : false;
|
|
24
19
|
return {
|
|
25
|
-
delayClickEvent
|
|
26
|
-
enabled
|
|
27
|
-
valueToCopy
|
|
28
|
-
copiedLabel
|
|
29
|
-
labelTimerReset
|
|
20
|
+
delayClickEvent,
|
|
21
|
+
enabled,
|
|
22
|
+
valueToCopy,
|
|
23
|
+
copiedLabel,
|
|
24
|
+
labelTimerReset
|
|
30
25
|
};
|
|
31
|
-
};
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
getCopyConfig,
|
|
29
|
+
removeHandlerProps,
|
|
30
|
+
renderAddon
|
|
31
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { default as default2 } from "./Danger/Danger.js";
|
|
2
|
+
import { default as default3 } from "./Select/Select.js";
|
|
3
|
+
import { default as default4 } from "./Text/Text.js";
|
|
4
|
+
import { default as default5 } from "./HoverTooltip/HoverTooltip.js";
|
|
5
|
+
import { GroupItem } from "./GroupItem/GroupItem.js";
|
|
6
|
+
export {
|
|
7
|
+
default2 as Danger,
|
|
8
|
+
GroupItem,
|
|
9
|
+
default5 as HoverTooltip,
|
|
10
|
+
default3 as Select,
|
|
11
|
+
default4 as Text
|
|
12
|
+
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var timer = setTimeout(function () {
|
|
8
|
-
return setTemporaryLabel(false);
|
|
9
|
-
}, duration);
|
|
10
|
-
return function () {
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
const useTemporaryLabel = (duration) => {
|
|
3
|
+
const [temporaryLabel, setTemporaryLabel] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const timer = setTimeout(() => setTemporaryLabel(false), duration);
|
|
6
|
+
return () => {
|
|
11
7
|
clearTimeout(timer);
|
|
12
8
|
};
|
|
13
9
|
});
|
|
14
10
|
return {
|
|
15
|
-
temporaryLabel
|
|
16
|
-
setTemporaryLabel
|
|
11
|
+
temporaryLabel,
|
|
12
|
+
setTemporaryLabel
|
|
17
13
|
};
|
|
18
|
-
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
useTemporaryLabel
|
|
17
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { default as default2 } from "./ListItem.js";
|
|
2
|
+
import "./components/Danger/Danger.js";
|
|
3
|
+
import "./components/Select/Select.js";
|
|
4
|
+
import "./components/Text/Text.js";
|
|
5
|
+
import { default as default3 } from "./components/HoverTooltip/HoverTooltip.js";
|
|
6
|
+
import { GroupItem } from "./components/GroupItem/GroupItem.js";
|
|
7
|
+
import { ListWrapper } from "./components/ListWrapper/ListWrapper.js";
|
|
8
|
+
import { useListContext } from "./components/ListContext/ListContext.js";
|
|
9
|
+
import { ListContextProvider } from "./components/ListContext/ListContextProvider.js";
|
|
10
|
+
import { itemSizes, itemTypes } from "./ListItem.types.js";
|
|
11
|
+
import { LIST_ITEM_SIZE_MAPPING } from "./ListItem.const.js";
|
|
12
|
+
export {
|
|
13
|
+
GroupItem,
|
|
14
|
+
default3 as HoverTooltip,
|
|
15
|
+
LIST_ITEM_SIZE_MAPPING,
|
|
16
|
+
ListContextProvider,
|
|
17
|
+
ListWrapper,
|
|
18
|
+
default2 as default,
|
|
19
|
+
itemSizes,
|
|
20
|
+
itemTypes,
|
|
21
|
+
useListContext
|
|
22
|
+
};
|
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-list-item",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "ListItem UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/react": "^0.27.16",
|
|
39
|
-
"@synerise/ds-divider": "^1.3.
|
|
40
|
-
"@synerise/ds-icon": "^1.
|
|
41
|
-
"@synerise/ds-popover": "^1.5.
|
|
42
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
43
|
-
"@synerise/ds-utils": "^1.
|
|
39
|
+
"@synerise/ds-divider": "^1.3.2",
|
|
40
|
+
"@synerise/ds-icon": "^1.15.1",
|
|
41
|
+
"@synerise/ds-popover": "^1.5.3",
|
|
42
|
+
"@synerise/ds-tooltip": "^1.4.10",
|
|
43
|
+
"@synerise/ds-utils": "^1.7.1",
|
|
44
44
|
"classnames": "^2.5.1",
|
|
45
45
|
"uuid": "^8.3.2"
|
|
46
46
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"react": ">=16.9.0 <= 18.3.1",
|
|
51
51
|
"styled-components": "^5.3.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
54
54
|
}
|