@synerise/ds-list-item 2.2.4 → 2.4.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/CHANGELOG.md +22 -0
- package/CLAUDE.md +5 -3
- package/dist/components/Danger/Danger.d.ts +2 -2
- package/dist/components/Danger/Danger.styles.js +8 -11
- package/dist/components/GroupItem/GroupItem.styles.js +1 -1
- package/dist/components/Header/Header.styles.js +2 -2
- package/dist/components/HoverTooltip/HoverTooltip.const.d.ts +2 -1
- package/dist/components/HoverTooltip/HoverTooltip.const.js +4 -0
- package/dist/components/HoverTooltip/HoverTooltip.js +3 -2
- package/dist/components/ListWrapper/ListWrapper.styles.js +1 -1
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Select/Select.styles.js +1 -1
- package/dist/components/Text/ItemLabel.js +3 -5
- package/dist/components/Text/Text.d.ts +2 -2
- package/dist/components/Text/Text.styles.js +7 -9
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.4.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@2.3.0...@synerise/ds-list-item@2.4.0) (2026-11-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **item-picker:** add a mixed list mode and open row cards on keyboard focus ([7237582](https://github.com/Synerise/synerise-design/commit/7237582567e8ab83877b945f7fd5a072b9858ee6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@2.2.4...@synerise/ds-list-item@2.3.0) (2026-10-29)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [2.2.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-list-item@2.2.3...@synerise/ds-list-item@2.2.4) (2026-10-28)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @synerise/ds-list-item
|
package/CLAUDE.md
CHANGED
|
@@ -18,8 +18,8 @@ src/
|
|
|
18
18
|
Text/DynamicLabel.tsx — swaps normal label for copiedLabel via CSS transition
|
|
19
19
|
Text/utils.ts — renderAddon, removeHandlerProps, getCopyConfig
|
|
20
20
|
Text/ItemLabel.const.ts — INDENT_WIDTH = 20 (px per indentLevel)
|
|
21
|
-
HoverTooltip/HoverTooltip.tsx — wraps item in @synerise/ds-popover on hover
|
|
22
|
-
HoverTooltip/HoverTooltip.const.ts — offset 8px, open 100ms / close 400ms delays
|
|
21
|
+
HoverTooltip/HoverTooltip.tsx — wraps item in @synerise/ds-popover on hover and keyboard focus
|
|
22
|
+
HoverTooltip/HoverTooltip.const.ts — offset 8px, open 100ms / close 400ms delays; focus opens after 100ms
|
|
23
23
|
GroupItem/GroupItem.tsx — renders a title + array of ListItems or children
|
|
24
24
|
SubMenu/SubMenu.tsx — collapsible inline sub-list, indented by level
|
|
25
25
|
ListContext/ListContext.tsx — React context + useListContext hook
|
|
@@ -67,7 +67,7 @@ src/
|
|
|
67
67
|
| `subMenuOpen` | `boolean` | — | Controlled open state of `subMenu`; when set, the component stops managing it internally — pair with `onSubMenuToggle` |
|
|
68
68
|
| `onSubMenuToggle` | `(open: boolean) => void` | — | Fires with the next open state on every `subMenu` toggle (row click in default mode, or the suffix arrow when `selectableParent`) |
|
|
69
69
|
| `indentLevel` | `number` | — | Left indent = `indentLevel * 20px` |
|
|
70
|
-
| `renderHoverTooltip` | `() => JSX.Element` | — | Popover rendered on hover via `HoverTooltip
|
|
70
|
+
| `renderHoverTooltip` | `() => JSX.Element` | — | Popover rendered on hover and on keyboard focus of the row via `HoverTooltip` (`trigger={['hover', 'focus']}`); wraps item in a `PropagationStopper` |
|
|
71
71
|
| `popoverProps` | `{ placement?, getPopupContainer?, offsetConfig?, flipConfig?, shiftConfig?, initialOpen? }` | — | Passed to `HoverTooltip`'s `Popover`; only used when `renderHoverTooltip` is set |
|
|
72
72
|
| `onClick` | `ListItemEventHandler<MouseEvent \| KeyboardEvent>` | — | Receives `{ key, item, domEvent }` |
|
|
73
73
|
| `onItemHover` | `ListItemEventHandler<MouseEvent>` | — | Fires on `mouseOver` |
|
|
@@ -176,6 +176,8 @@ import ListItem, { ListWrapper, ListContextProvider, useListContext } from '@syn
|
|
|
176
176
|
|
|
177
177
|
## Styling / Key dependencies / Implementation notes
|
|
178
178
|
|
|
179
|
+
- **`ds-list-item-inner`** is the class hook on the inner row (`S.Inner`), which paints the hover, focused and selected backgrounds. ds-select targets it to give its keyboard-highlighted option the `--ds-list-item-role-normal-bg-hover` background.
|
|
180
|
+
|
|
179
181
|
- **`react-intl` (peer)** — `ListWrapper` calls `useIntl()`, so an `IntlProvider` must be present.
|
|
180
182
|
- **`@floating-ui/react` `useListItem`** — `Text` registers each item with floating-ui's list context via `useListItem()`. The merged ref (`useMergeRefs`) handles both the forwarded ref and the floating-ui ref. This is required for keyboard navigation in dropdowns.
|
|
181
183
|
- **`useDropdown` integration** — if an item is rendered inside `@synerise/ds-core`'s `DropdownProvider`, clicking an item calls `setIsOpen(false)` when `hideOnItemClick === true`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NestedItemProps } from '../../ListItem.types';
|
|
3
|
-
declare const Danger: React.ForwardRefExoticComponent<Omit<import('
|
|
4
|
-
ItemComponent: React.ComponentType<import('
|
|
3
|
+
declare const Danger: React.ForwardRefExoticComponent<Omit<import('../..').ListItemProps, "level" | "higher" | "text" | "type"> & {
|
|
4
|
+
ItemComponent: React.ComponentType<import('../..').ListItemProps>;
|
|
5
5
|
} & NestedItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export default Danger;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import { IconContainer } from "@synerise/ds-icon";
|
|
3
2
|
import Text from "../Text/Text.js";
|
|
4
3
|
import { Inner, Wrapper, PrefixWrapper } from "../Text/Text.styles.js";
|
|
5
4
|
const DangerItem = /* @__PURE__ */ styled(Text).withConfig({
|
|
6
5
|
displayName: "Dangerstyles__DangerItem",
|
|
7
6
|
componentId: "sc-1v6qv1-0"
|
|
8
|
-
})(["&&&{", "{color:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
${PrefixWrapper} > ${IconContainer} > svg {
|
|
12
|
-
fill: ${props.theme.palette["red-600"]} !important;
|
|
7
|
+
})(["&&&{", "{color:var(--ds-list-item-role-delete-text-default);", "{color:var(--ds-list-item-role-delete-text-default);}", "{color:var(--ds-list-item-role-delete-icon-default);}&:hover{", "}&:focus-visible{", "}&:focus-visible:active{", "}}}"], Inner, Wrapper, PrefixWrapper, (props) => !props.disabled && `
|
|
8
|
+
${PrefixWrapper} {
|
|
9
|
+
color: var(--ds-list-item-role-delete-icon-hover);
|
|
13
10
|
}
|
|
14
|
-
background:
|
|
11
|
+
background: var(--ds-list-item-role-delete-bg-hover);
|
|
15
12
|
`, (props) => !props.disabled && `
|
|
16
|
-
${PrefixWrapper}
|
|
17
|
-
|
|
13
|
+
${PrefixWrapper} {
|
|
14
|
+
color: var(--ds-list-item-role-delete-icon-focused);
|
|
18
15
|
}
|
|
19
|
-
background:
|
|
16
|
+
background: var(--ds-list-item-role-delete-bg-focused) !important;
|
|
20
17
|
`, (props) => !props.disabled && `
|
|
21
|
-
background:
|
|
18
|
+
background: var(--ds-list-item-role-delete-bg-active) !important;
|
|
22
19
|
`);
|
|
23
20
|
export {
|
|
24
21
|
DangerItem
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
const Title = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "GroupItemstyles__Title",
|
|
4
4
|
componentId: "sc-1ut24k3-0"
|
|
5
|
-
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:
|
|
5
|
+
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:var(--ds-divider-header-text-color);padding:8px 0;"]);
|
|
6
6
|
export {
|
|
7
7
|
Title
|
|
8
8
|
};
|
|
@@ -2,11 +2,11 @@ import styled from "styled-components";
|
|
|
2
2
|
const MenuHeader = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "Headerstyles__MenuHeader",
|
|
4
4
|
componentId: "sc-1ntgmf9-0"
|
|
5
|
-
})(["display:flex;align-items:center;font-size:10px;font-weight:500;text-transform:uppercase;color:
|
|
5
|
+
})(["display:flex;align-items:center;font-size:10px;font-weight:500;text-transform:uppercase;color:var(--ds-divider-header-text-color);height:40px;padding:12px;line-height:1.6;letter-spacing:0.1px;"]);
|
|
6
6
|
const HeaderIconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
7
7
|
displayName: "Headerstyles__HeaderIconWrapper",
|
|
8
8
|
componentId: "sc-1ntgmf9-1"
|
|
9
|
-
})(["color:
|
|
9
|
+
})(["color:var(--ds-color-icon-base-muted);"]);
|
|
10
10
|
export {
|
|
11
11
|
HeaderIconWrapper,
|
|
12
12
|
MenuHeader
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FlipConfig, HoverConfig, OffsetConfig, ShiftConfig } from '@synerise/ds-popover';
|
|
1
|
+
import { FlipConfig, FocusConfig, HoverConfig, OffsetConfig, ShiftConfig } from '@synerise/ds-popover';
|
|
2
2
|
export declare const TRANSITION_DURATION = 150;
|
|
3
3
|
export declare const OFFSET_CONFIG: OffsetConfig;
|
|
4
4
|
export declare const FLIP_CONFIG: FlipConfig;
|
|
5
5
|
export declare const HOVER_CONFIG: HoverConfig;
|
|
6
|
+
export declare const FOCUS_CONFIG: FocusConfig;
|
|
6
7
|
export declare const SHIFT_CONFIG: ShiftConfig;
|
|
@@ -2,8 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { useTheme } from "@synerise/ds-core";
|
|
4
4
|
import { getPlacement, Popover, PopoverContent, PopoverTrigger } from "@synerise/ds-popover";
|
|
5
|
-
import { TRANSITION_DURATION, HOVER_CONFIG, FLIP_CONFIG, OFFSET_CONFIG, SHIFT_CONFIG } from "./HoverTooltip.const.js";
|
|
5
|
+
import { TRANSITION_DURATION, FOCUS_CONFIG, HOVER_CONFIG, FLIP_CONFIG, OFFSET_CONFIG, SHIFT_CONFIG } from "./HoverTooltip.const.js";
|
|
6
6
|
import { PropagationStopper } from "./HoverTooltip.styles.js";
|
|
7
|
+
const TRIGGER = ["hover", "focus"];
|
|
7
8
|
const HoverTooltip = ({
|
|
8
9
|
popoverProps,
|
|
9
10
|
renderHoverTooltip,
|
|
@@ -16,7 +17,7 @@ const HoverTooltip = ({
|
|
|
16
17
|
const popoverPlacement = getPlacement(popoverProps?.placement || "right");
|
|
17
18
|
return (
|
|
18
19
|
// onKeyDown is used to disallow propagating key events to tooltip's container element
|
|
19
|
-
/* @__PURE__ */ jsx(PropagationStopper, { onKeyDown: cancelBubblingEvent, onClick: cancelBubblingEvent, children: /* @__PURE__ */ jsxs(Popover, { trigger:
|
|
20
|
+
/* @__PURE__ */ jsx(PropagationStopper, { onKeyDown: cancelBubblingEvent, onClick: cancelBubblingEvent, children: /* @__PURE__ */ jsxs(Popover, { trigger: TRIGGER, modal: false, componentId: "information-card", testId: "information-card", shiftConfig: SHIFT_CONFIG, offsetConfig: OFFSET_CONFIG, flipConfig: FLIP_CONFIG, hoverConfig: HOVER_CONFIG, focusConfig: FOCUS_CONFIG, transitionDuration: TRANSITION_DURATION, zIndex, ...popoverProps, placement: popoverPlacement, children: [
|
|
20
21
|
/* @__PURE__ */ jsx(PopoverContent, { children: renderHoverTooltip && renderHoverTooltip() }),
|
|
21
22
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { style: {
|
|
22
23
|
position: "relative",
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
const ListWrapperContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "ListWrapperstyles__ListWrapperContainer",
|
|
4
4
|
componentId: "sc-1f54kju-0"
|
|
5
|
-
})(["padding:8px;background:
|
|
5
|
+
})(["padding:8px;background:var(--ds-color-background-base-default);border-radius:3px;"]);
|
|
6
6
|
const ToggleButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
7
7
|
displayName: "ListWrapperstyles__ToggleButtonWrapper",
|
|
8
8
|
componentId: "sc-1f54kju-1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NestedItemProps } from '../../ListItem.types';
|
|
3
|
-
declare const Select: React.ForwardRefExoticComponent<Omit<import('
|
|
4
|
-
ItemComponent: React.ComponentType<import('
|
|
3
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<import('../..').ListItemProps, "level" | "higher" | "text" | "type"> & {
|
|
4
|
+
ItemComponent: React.ComponentType<import('../..').ListItemProps>;
|
|
5
5
|
} & NestedItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export default Select;
|
|
@@ -4,7 +4,7 @@ import { SuffixWrapper } from "../Text/Text.styles.js";
|
|
|
4
4
|
const SelectItem = /* @__PURE__ */ styled(Text).withConfig({
|
|
5
5
|
displayName: "Selectstyles__SelectItem",
|
|
6
6
|
componentId: "sc-a89gla-0"
|
|
7
|
-
})(["&{", " > *{opacity:0;transition:opacity 0.3s ease-in-out,color 0.3s ease-in-out;}}&:hover,&:focus{", " > *{opacity:1;color:
|
|
7
|
+
})(["&{", " > *{opacity:0;transition:opacity 0.3s ease-in-out,color 0.3s ease-in-out;}}&:hover,&:focus{", " > *{opacity:1;color:var(--ds-list-item-role-normal-text-hover);}}"], SuffixWrapper, SuffixWrapper);
|
|
8
8
|
export {
|
|
9
9
|
SelectItem
|
|
10
10
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import { useTheme } from "@synerise/ds-core";
|
|
5
4
|
import Icon, { AngleRightS, CheckS, AngleUpS, AngleDownS } from "@synerise/ds-icon";
|
|
6
5
|
import { rendersDescription } from "./ItemLabel.const.js";
|
|
7
6
|
import { Wrapper, Inner, PrefixWrapper, Content, Description, ArrowRight, SuffixWrapper, SubMenuToggle } from "./Text.styles.js";
|
|
@@ -35,7 +34,6 @@ const ItemLabel = forwardRef(({
|
|
|
35
34
|
featured,
|
|
36
35
|
...rest
|
|
37
36
|
}, ref) => {
|
|
38
|
-
const theme = useTheme();
|
|
39
37
|
return /* @__PURE__ */ jsx(
|
|
40
38
|
Wrapper,
|
|
41
39
|
{
|
|
@@ -62,15 +60,15 @@ const ItemLabel = forwardRef(({
|
|
|
62
60
|
indentLevel,
|
|
63
61
|
featured,
|
|
64
62
|
...rest,
|
|
65
|
-
children: /* @__PURE__ */ jsxs(Inner, { children: [
|
|
63
|
+
children: /* @__PURE__ */ jsxs(Inner, { className: "ds-list-item-inner", children: [
|
|
66
64
|
prefixElement && /* @__PURE__ */ jsx(PrefixWrapper, { "data-testid": "list-item-prefix", visible: prefixVisible, disabled, children: prefixElement }),
|
|
67
65
|
/* @__PURE__ */ jsxs(Content, { className: "ds-list-item-content", children: [
|
|
68
66
|
content,
|
|
69
67
|
description && rendersDescription(size) && /* @__PURE__ */ jsx(Description, { children: description })
|
|
70
68
|
] }),
|
|
71
|
-
parent && /* @__PURE__ */ jsx(ArrowRight, { children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleRightS, {})
|
|
69
|
+
parent && /* @__PURE__ */ jsx(ArrowRight, { children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleRightS, {}) }) }),
|
|
72
70
|
(!!suffixElement || !!checked || hasSubMenu) && /* @__PURE__ */ jsxs(SuffixWrapper, { "data-testid": "list-item-suffix", visible: suffixVisible || hasSubMenu, disabled, children: [
|
|
73
|
-
!!checked && /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CheckS, {}), color:
|
|
71
|
+
!!checked && /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CheckS, {}), color: "var(--ds-color-icon-success-default)" }),
|
|
74
72
|
hasSubMenu && (onToggleSubMenu ? /* @__PURE__ */ jsx(SubMenuToggle, { role: "button", tabIndex: disabled ? -1 : 0, "aria-expanded": subMenuOpen, "aria-label": "Toggle sub-menu", "data-testid": "list-item-submenu-toggle", onClick: onToggleSubMenu, onKeyDown: (event) => {
|
|
75
73
|
if (event.key === "Enter" || event.key === " ") {
|
|
76
74
|
event.preventDefault();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NestedItemProps } from '../../ListItem.types';
|
|
3
|
-
declare const Text: React.ForwardRefExoticComponent<Omit<import('
|
|
4
|
-
ItemComponent: React.ComponentType<import('
|
|
3
|
+
declare const Text: React.ForwardRefExoticComponent<Omit<import('../..').ListItemProps, "level" | "higher" | "text" | "type"> & {
|
|
4
|
+
ItemComponent: React.ComponentType<import('../..').ListItemProps>;
|
|
5
5
|
} & NestedItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export default Text;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import { IconContainer } from "@synerise/ds-icon";
|
|
3
2
|
import { LIST_ITEM_SIZE_MAPPING } from "../../ListItem.const.js";
|
|
4
3
|
import { itemSizes } from "../../ListItem.types.js";
|
|
5
4
|
import { INDENT_WIDTH } from "./ItemLabel.const.js";
|
|
@@ -13,11 +12,11 @@ const SuffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
13
12
|
const SubMenuToggle = /* @__PURE__ */ styled.span.withConfig({
|
|
14
13
|
displayName: "Textstyles__SubMenuToggle",
|
|
15
14
|
componentId: "sc-1j4eogh-1"
|
|
16
|
-
})(["display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border-radius:3px;outline:none;&:focus-visible{box-shadow:inset 0 0 0 2px
|
|
15
|
+
})(["display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border-radius:3px;outline:none;&:focus-visible{box-shadow:inset 0 0 0 2px var(--ds-color-border-brand-default);}"]);
|
|
17
16
|
const PrefixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
18
17
|
displayName: "Textstyles__PrefixWrapper",
|
|
19
18
|
componentId: "sc-1j4eogh-2"
|
|
20
|
-
})(["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);
|
|
19
|
+
})(["display:flex;order:1;", ";transition:opacity ", ";margin-top:-7px;margin-bottom:-7px;margin-left:-4px;margin-right:12px;align-items:center;.ds-avatar.ds-avatar{color:inherit;}"], (props) => props.visible ? visibleElementStyle() : hiddenElementStyle(), TRANSITION_FN);
|
|
21
20
|
const Highlight = /* @__PURE__ */ styled.span.withConfig({
|
|
22
21
|
displayName: "Textstyles__Highlight",
|
|
23
22
|
componentId: "sc-1j4eogh-3"
|
|
@@ -28,7 +27,7 @@ const getPaddingFromIndentLevel = (indentLevel = 0) => {
|
|
|
28
27
|
const calculatePadding = (indentLevel = 0, withPrefixel = false) => {
|
|
29
28
|
return getPaddingFromIndentLevel(indentLevel) + (withPrefixel ? 8 : 12);
|
|
30
29
|
};
|
|
31
|
-
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:
|
|
30
|
+
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:var(--ds-color-background-base-default);border:none;color:var(--ds-list-item-role-normal-text-default);cursor:pointer;opacity:1;"], (props) => calculatePadding(props.indentLevel, !!props.prefixel), (props) => LIST_ITEM_SIZE_MAPPING[props.size || "default"]);
|
|
32
31
|
const ArrowRight = /* @__PURE__ */ styled.div.withConfig({
|
|
33
32
|
displayName: "Textstyles__ArrowRight",
|
|
34
33
|
componentId: "sc-1j4eogh-4"
|
|
@@ -37,7 +36,7 @@ const Inner = /* @__PURE__ */ styled.div.withConfig({
|
|
|
37
36
|
displayName: "Textstyles__Inner",
|
|
38
37
|
componentId: "sc-1j4eogh-5"
|
|
39
38
|
})(["flex-grow:1;min-width:0;&::after{content:'';flex-grow:1;order:4;}"]);
|
|
40
|
-
const selectedStyle = /* @__PURE__ */ css(["background:
|
|
39
|
+
const selectedStyle = /* @__PURE__ */ css(["background:var(--ds-list-item-role-normal-bg-active);color:var(--ds-list-item-role-normal-text-active);", "{color:var(--ds-list-item-role-normal-icon-active);}"], PrefixWrapper);
|
|
41
40
|
const highlightStyle = /* @__PURE__ */ css(["font-weight:400;.ds-list-item-highlight{font-weight:600;}"]);
|
|
42
41
|
const orderedStyle = /* @__PURE__ */ css(["&::before{content:none;}"]);
|
|
43
42
|
const Content = /* @__PURE__ */ styled.div.withConfig({
|
|
@@ -52,9 +51,8 @@ const Wrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
52
51
|
})(["display:flex;min-width:173px;", " ", " ", " ", "{", " ", " ", " ", "{transition:all ", ";opacity:", ";}", " ", " ", " .ds-checkbox,.ds-checkbox > .ant-checkbox-wrapper{padding:0;}}"], (props) => props.inTooltip && css(["height:100%;"]), ({
|
|
53
52
|
featured,
|
|
54
53
|
disabled,
|
|
55
|
-
selected
|
|
56
|
-
|
|
57
|
-
}) => 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, (props) => props.size === itemSizes.AUTO && autoSizeStyles, ArrowRight, TRANSITION_FN, (props) => props.disabled ? "1" : "0", (props) => props.selected && selectedStyle, (props) => props.highlight && highlightStyle, (props) => !props.ordered && orderedStyle);
|
|
54
|
+
selected
|
|
55
|
+
}) => featured && css(["&&{", ",", ",", ",", "{color:var(--ds-list-item-role-normal-text-active);}}&:hover,&:active,&:focus-visible:not(:active){&&{", ",", ",", ",", "{color:var(--ds-color-text-brand-defaulthover);}&:focus-visible:not(:active) ", "{box-shadow:inset 0 0 0 2px var(--ds-color-focus-base-strong);}}}", " ", ""], PrefixWrapper, SuffixWrapper, ArrowRight, Content, PrefixWrapper, SuffixWrapper, ArrowRight, Content, Inner, disabled && css(["&:hover{&&{", ",", ",", "{color:var(--ds-list-item-role-normal-text-active);}}}"], PrefixWrapper, SuffixWrapper, Content), selected && css(["&:hover{&&{", ",", ",", "{color:var(--ds-color-text-brand-defaulthover);}}}"], PrefixWrapper, SuffixWrapper, Content)), (props) => props.disabled ? css(["cursor:not-allowed;opacity:var(--ds-list-item-states-disabled-opacity);", ",", "{color:var(--ds-list-item-role-normal-icon-default);}&:hover{", "{opacity:1;color:var(--ds-list-item-role-normal-icon-default);}}"], PrefixWrapper, ArrowRight, ArrowRight) : css(["", ",", "{color:var(--ds-list-item-role-normal-icon-default);}&:hover{", "{background:var(--ds-list-item-role-normal-bg-hover);", ";}}&:focus-visible:not(:active){", "{box-shadow:inset 0 0 0 2px var(--ds-color-focus-base-default);}}&:focus-visible:active,&:active{", "{background:var(--ds-list-item-role-normal-bg-active);", "}}}"], PrefixWrapper, ArrowRight, Inner, !props.noHover && css(["&{color:", ";}", "{color:var(--ds-list-item-role-normal-icon-hover);}", "{opacity:1;color:var(--ds-list-item-role-normal-icon-hover);}"], props.noHover ? "var(--ds-list-item-role-normal-text-default)" : "var(--ds-list-item-role-normal-text-hover)", PrefixWrapper, ArrowRight), Inner, Inner, !props.noHover && css(["color:var(--ds-list-item-role-normal-text-active);", "{color:var(--ds-list-item-role-normal-icon-active);}"], PrefixWrapper)), Inner, (props) => props.ordered && css(["&::before{font-weight:400;color:var(--ds-color-text-neutral-default);counter-increment:ds-list-items 1;content:'0' counter(ds-list-items) '. \\00A0';}"]), baseStyles, (props) => props.size === itemSizes.AUTO && autoSizeStyles, ArrowRight, TRANSITION_FN, (props) => props.disabled ? "1" : "0", (props) => props.selected && selectedStyle, (props) => props.highlight && highlightStyle, (props) => !props.ordered && orderedStyle);
|
|
58
56
|
const Divider = /* @__PURE__ */ styled.div.withConfig({
|
|
59
57
|
displayName: "Textstyles__Divider",
|
|
60
58
|
componentId: "sc-1j4eogh-8"
|
|
@@ -74,7 +72,7 @@ const DynamicLabelWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
|
74
72
|
const Description = /* @__PURE__ */ styled.div.withConfig({
|
|
75
73
|
displayName: "Textstyles__Description",
|
|
76
74
|
componentId: "sc-1j4eogh-12"
|
|
77
|
-
})(["text-overflow:ellipsis;overflow:hidden;color:
|
|
75
|
+
})(["text-overflow:ellipsis;overflow:hidden;color:var(--ds-list-item-content-description-color);font-weight:normal;line-height:1.39;font-size:13px;width:100%;"]);
|
|
78
76
|
export {
|
|
79
77
|
ArrowRight,
|
|
80
78
|
Content,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-list-item",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "ListItem UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@floating-ui/react": "^0.27.16",
|
|
46
|
-
"@synerise/ds-button": "^2.1
|
|
47
|
-
"@synerise/ds-divider": "^2.
|
|
48
|
-
"@synerise/ds-icon": "^2.
|
|
49
|
-
"@synerise/ds-popover": "^2.
|
|
50
|
-
"@synerise/ds-tooltip": "^2.
|
|
51
|
-
"@synerise/ds-utils": "^2.
|
|
46
|
+
"@synerise/ds-button": "^2.2.1",
|
|
47
|
+
"@synerise/ds-divider": "^2.1.1",
|
|
48
|
+
"@synerise/ds-icon": "^2.3.1",
|
|
49
|
+
"@synerise/ds-popover": "^2.3.0",
|
|
50
|
+
"@synerise/ds-tooltip": "^2.1.1",
|
|
51
|
+
"@synerise/ds-utils": "^2.3.1",
|
|
52
52
|
"classnames": "^2.5.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"@testing-library/react": "^14.0.0",
|
|
63
63
|
"vitest": "^4.0.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
|
|
66
66
|
}
|