@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.
Files changed (71) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +27 -9
  3. package/dist/ListItem.const.d.ts +1 -1
  4. package/dist/ListItem.const.js +6 -3
  5. package/dist/ListItem.d.ts +14 -14
  6. package/dist/ListItem.js +33 -50
  7. package/dist/ListItem.styles.js +1 -0
  8. package/dist/ListItem.types.d.ts +5 -5
  9. package/dist/ListItem.types.js +13 -14
  10. package/dist/components/Danger/Danger.d.ts +4 -4
  11. package/dist/components/Danger/Danger.js +11 -12
  12. package/dist/components/Danger/Danger.styles.d.ts +3 -3
  13. package/dist/components/Danger/Danger.styles.js +23 -18
  14. package/dist/components/Divider/Divider.d.ts +2 -2
  15. package/dist/components/Divider/Divider.js +8 -9
  16. package/dist/components/Divider/Divider.styles.d.ts +2 -2
  17. package/dist/components/Divider/Divider.styles.js +7 -8
  18. package/dist/components/Divider/Divider.types.d.ts +1 -1
  19. package/dist/components/Divider/Divider.types.js +1 -1
  20. package/dist/components/GroupItem/GroupItem.d.ts +2 -2
  21. package/dist/components/GroupItem/GroupItem.js +17 -9
  22. package/dist/components/GroupItem/GroupItem.styles.d.ts +1 -1
  23. package/dist/components/GroupItem/GroupItem.styles.js +6 -5
  24. package/dist/components/Header/Header.d.ts +2 -2
  25. package/dist/components/Header/Header.js +19 -22
  26. package/dist/components/Header/Header.styles.d.ts +2 -2
  27. package/dist/components/Header/Header.styles.js +9 -9
  28. package/dist/components/Header/Header.types.d.ts +2 -2
  29. package/dist/components/Header/Header.types.js +1 -1
  30. package/dist/components/HoverTooltip/HoverTooltip.const.d.ts +1 -1
  31. package/dist/components/HoverTooltip/HoverTooltip.const.js +13 -6
  32. package/dist/components/HoverTooltip/HoverTooltip.d.ts +2 -2
  33. package/dist/components/HoverTooltip/HoverTooltip.js +26 -44
  34. package/dist/components/HoverTooltip/HoverTooltip.styles.d.ts +1 -1
  35. package/dist/components/HoverTooltip/HoverTooltip.styles.js +6 -3
  36. package/dist/components/HoverTooltip/HoverTooltip.types.d.ts +2 -2
  37. package/dist/components/HoverTooltip/HoverTooltip.types.js +1 -1
  38. package/dist/components/ListContext/ListContext.d.ts +3 -3
  39. package/dist/components/ListContext/ListContext.js +8 -4
  40. package/dist/components/ListContext/ListContextProvider.d.ts +2 -2
  41. package/dist/components/ListContext/ListContextProvider.js +16 -19
  42. package/dist/components/ListWrapper/ListWrapper.d.ts +3 -3
  43. package/dist/components/ListWrapper/ListWrapper.js +13 -13
  44. package/dist/components/ListWrapper/ListWrapper.styles.d.ts +1 -1
  45. package/dist/components/ListWrapper/ListWrapper.styles.js +6 -5
  46. package/dist/components/Select/Select.d.ts +4 -5
  47. package/dist/components/Select/Select.js +12 -16
  48. package/dist/components/Select/Select.styles.d.ts +3 -3
  49. package/dist/components/Select/Select.styles.js +8 -7
  50. package/dist/components/SubMenu/SubMenu.d.ts +2 -2
  51. package/dist/components/SubMenu/SubMenu.js +16 -22
  52. package/dist/components/SubMenu/SubMenu.styles.d.ts +2 -2
  53. package/dist/components/SubMenu/SubMenu.styles.js +9 -7
  54. package/dist/components/Text/DynamicLabel.d.ts +1 -1
  55. package/dist/components/Text/DynamicLabel.js +15 -10
  56. package/dist/components/Text/ItemLabel.const.js +4 -1
  57. package/dist/components/Text/ItemLabel.d.ts +3 -3
  58. package/dist/components/Text/ItemLabel.js +81 -82
  59. package/dist/components/Text/Text.d.ts +4 -4
  60. package/dist/components/Text/Text.js +119 -159
  61. package/dist/components/Text/Text.styles.d.ts +14 -14
  62. package/dist/components/Text/Text.styles.js +49 -85
  63. package/dist/components/Text/utils.d.ts +2 -2
  64. package/dist/components/Text/utils.js +27 -27
  65. package/dist/components/index.js +12 -5
  66. package/dist/hooks/useTemporaryLabel.d.ts +1 -1
  67. package/dist/hooks/useTemporaryLabel.js +12 -13
  68. package/dist/index.js +22 -7
  69. package/dist/modules.d.js +1 -1
  70. package/dist/modules.d.ts +0 -0
  71. package/package.json +9 -9
@@ -1,120 +1,84 @@
1
- import styled, { css } from 'styled-components';
2
- import { IconContainer } from '@synerise/ds-icon';
3
- import { LIST_ITEM_SIZE_MAPPING } from '../../ListItem.const';
4
- import { INDENT_WIDTH } from './ItemLabel.const';
5
- var TRANSITION_FN = '0.2s ease-out';
6
- var hiddenElementStyle = function hiddenElementStyle() {
7
- return css(["opacity:0;pointer-events:none;"]);
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;", ";"], function (props) {
16
- return props.visible ? visibleElementStyle() : hiddenElementStyle();
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;"], function (props) {
22
- return props.visible ? visibleElementStyle() : hiddenElementStyle();
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
- var getPaddingFromIndentLevel = function getPaddingFromIndentLevel(indentLevel) {
29
- if (indentLevel === void 0) {
30
- indentLevel = 0;
31
- }
20
+ const getPaddingFromIndentLevel = (indentLevel = 0) => {
32
21
  return indentLevel * INDENT_WIDTH;
33
22
  };
34
- var calculatePadding = function calculatePadding(indentLevel, withPrefixel) {
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
- var baseStyles = 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;"], function (props) {
44
- return calculatePadding(props.indentLevel, !!props.prefixel);
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
- export var Inner = styled.div.withConfig({
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
- var selectedStyle = css(["background:", ";color:", ";", "{svg{fill:", ";}}"], function (props) {
61
- return props.theme.palette['blue-050'];
62
- }, function (props) {
63
- return props.theme.palette['blue-600'];
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
- export var Wrapper = styled.div.withConfig({
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;}}"], function (props) {
77
- return props.inTooltip && css(["height:100%;"]);
78
- }, function (_ref) {
79
- var featured = _ref.featured,
80
- disabled = _ref.disabled,
81
- selected = _ref.selected,
82
- theme = _ref.theme;
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
- export var DynamicLabelMain = styled.div.withConfig({
55
+ const DynamicLabelMain = /* @__PURE__ */ styled.div.withConfig({
102
56
  displayName: "Textstyles__DynamicLabelMain",
103
57
  componentId: "sc-1j4eogh-8"
104
58
  })([""]);
105
- export var DynamicLabelAlternate = styled.div.withConfig({
59
+ const DynamicLabelAlternate = /* @__PURE__ */ styled.div.withConfig({
106
60
  displayName: "Textstyles__DynamicLabelAlternate",
107
61
  componentId: "sc-1j4eogh-9"
108
62
  })([""]);
109
- export var DynamicLabelWrapper = styled.div.withConfig({
63
+ const DynamicLabelWrapper = /* @__PURE__ */ styled.div.withConfig({
110
64
  displayName: "Textstyles__DynamicLabelWrapper",
111
65
  componentId: "sc-1j4eogh-10"
112
- })(["", ""], function (props) {
113
- return props.showAlternative ? css(["", "{height:0;visibility:hidden;}", "{height:auto;visibility:visible;}"], DynamicLabelMain, DynamicLabelAlternate) : css(["", "{height:auto;visibility:visible;}", "{height:0;visibility:hidden;}"], DynamicLabelMain, DynamicLabelAlternate);
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%;"], function (props) {
119
- return props.theme.palette['grey-600'];
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 type { ReactNode } from 'react';
2
- import { type AddonRenderer, type BasicItemProps } from '../../ListItem.types';
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
- export var renderAddon = function renderAddon(addon) {
2
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
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
- export var removeHandlerProps = function removeHandlerProps(props) {
8
- return Object.fromEntries(Object.entries(props).filter(function (_ref) {
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
- export var getCopyConfig = function getCopyConfig(_ref2) {
14
- var copyable = _ref2.copyable,
15
- copyValue = _ref2.copyValue,
16
- disabled = _ref2.disabled;
17
- var DEFAULT_RESET_TIMER = 1000;
18
- var DELAY_CLICK_AFTER_COPY_DURATION = 700;
19
- var enabled = copyable && (copyValue || typeof copyable === 'object' && copyable.copyValue) && !disabled;
20
- var valueToCopy = typeof copyable === 'object' ? copyable.copyValue : copyValue;
21
- var copiedLabel = typeof copyable === 'object' ? copyable.copiedLabel : null;
22
- var labelTimerReset = typeof copyable === 'object' && copyable.timeToReset || DEFAULT_RESET_TIMER;
23
- var delayClickEvent = typeof copyable === 'object' && copyable.delayClickEvent !== undefined ? copyable.delayClickEvent : copyable ? DELAY_CLICK_AFTER_COPY_DURATION : false;
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: delayClickEvent,
26
- enabled: enabled,
27
- valueToCopy: valueToCopy,
28
- copiedLabel: copiedLabel,
29
- labelTimerReset: labelTimerReset
20
+ delayClickEvent,
21
+ enabled,
22
+ valueToCopy,
23
+ copiedLabel,
24
+ labelTimerReset
30
25
  };
31
- };
26
+ };
27
+ export {
28
+ getCopyConfig,
29
+ removeHandlerProps,
30
+ renderAddon
31
+ };
@@ -1,5 +1,12 @@
1
- export { default as Danger } from './Danger/Danger';
2
- export { default as Select } from './Select/Select';
3
- export { default as Text } from './Text/Text';
4
- export { default as HoverTooltip } from './HoverTooltip/HoverTooltip';
5
- export { GroupItem } from './GroupItem/GroupItem';
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,4 +1,4 @@
1
1
  export declare const useTemporaryLabel: (duration: number) => {
2
2
  temporaryLabel: boolean;
3
- setTemporaryLabel: import("react").Dispatch<import("react").SetStateAction<boolean>>;
3
+ setTemporaryLabel: import('react').Dispatch<import('react').SetStateAction<boolean>>;
4
4
  };
@@ -1,18 +1,17 @@
1
- import { useEffect, useState } from 'react';
2
- export var useTemporaryLabel = function useTemporaryLabel(duration) {
3
- var _useState = useState(false),
4
- temporaryLabel = _useState[0],
5
- setTemporaryLabel = _useState[1];
6
- useEffect(function () {
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: temporaryLabel,
16
- setTemporaryLabel: setTemporaryLabel
11
+ temporaryLabel,
12
+ setTemporaryLabel
17
13
  };
18
- };
14
+ };
15
+ export {
16
+ useTemporaryLabel
17
+ };
package/dist/index.js CHANGED
@@ -1,7 +1,22 @@
1
- export { default } from './ListItem';
2
- export { HoverTooltip, GroupItem } from './components';
3
- export { ListWrapper } from './components/ListWrapper/ListWrapper';
4
- export { useListContext } from './components/ListContext/ListContext';
5
- export { ListContextProvider } from './components/ListContext/ListContextProvider';
6
- export { itemSizes, itemTypes } from './ListItem.types';
7
- export * from './ListItem.const';
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 '@testing-library/jest-dom';
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.8",
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": "pnpm run build:js && pnpm run build:css && pnpm run defs",
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": "pnpm run build:js -- --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.0",
40
- "@synerise/ds-icon": "^1.14.1",
41
- "@synerise/ds-popover": "^1.5.1",
42
- "@synerise/ds-tooltip": "^1.4.8",
43
- "@synerise/ds-utils": "^1.6.0",
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": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
53
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
54
54
  }