@synerise/ds-dropdown 1.3.0 → 1.3.2
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 +17 -10
- package/dist/Dropdown.const.d.ts +4 -4
- package/dist/Dropdown.const.js +31 -21
- package/dist/Dropdown.d.ts +3 -3
- package/dist/Dropdown.js +64 -81
- package/dist/Dropdown.styles.d.ts +1 -1
- package/dist/Dropdown.styles.js +7 -6
- package/dist/Dropdown.types.d.ts +4 -4
- package/dist/Dropdown.types.js +1 -1
- package/dist/components/BackAction/BackAction.d.ts +2 -2
- package/dist/components/BackAction/BackAction.js +20 -25
- package/dist/components/BackAction/BackAction.styles.d.ts +4 -4
- package/dist/components/BackAction/BackAction.styles.js +15 -17
- package/dist/components/BackAction/BackAction.types.d.ts +2 -2
- package/dist/components/BackAction/BackAction.types.js +1 -1
- package/dist/components/BottomAction/BottomAction.d.ts +2 -2
- package/dist/components/BottomAction/BottomAction.js +15 -17
- package/dist/components/BottomAction/BottomAction.styles.d.ts +3 -3
- package/dist/components/BottomAction/BottomAction.styles.js +11 -18
- package/dist/components/BottomAction/BottomAction.types.d.ts +2 -2
- package/dist/components/BottomAction/BottomAction.types.js +1 -1
- package/dist/components/DropdownFooter/DropdownFooter.d.ts +2 -2
- package/dist/components/DropdownFooter/DropdownFooter.js +15 -10
- package/dist/components/DropdownFooter/DropdownFooter.styles.d.ts +3 -3
- package/dist/components/DropdownFooter/DropdownFooter.styles.js +11 -10
- package/dist/components/DropdownFooter/DropdownFooter.types.d.ts +1 -1
- package/dist/components/DropdownFooter/DropdownFooter.types.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +3 -3
- package/dist/components/DropdownMenu/DropdownMenu.js +71 -118
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +3 -3
- package/dist/components/DropdownMenu/DropdownMenu.types.js +1 -1
- package/dist/components/DropdownMenuList/DropdownMenuList.d.ts +3 -3
- package/dist/components/DropdownMenuList/DropdownMenuList.js +62 -76
- package/dist/components/DropdownMenuList/DropdownMenuList.styles.d.ts +5 -5
- package/dist/components/DropdownMenuList/DropdownMenuList.styles.js +16 -9
- package/dist/components/DropdownMenuList/DropdownMenuList.types.d.ts +2 -2
- package/dist/components/DropdownMenuList/DropdownMenuList.types.js +1 -1
- package/dist/components/DropdownOverlay/DropdownOverlay.d.ts +2 -2
- package/dist/components/DropdownOverlay/DropdownOverlay.js +45 -53
- package/dist/components/DropdownOverlay/DropdownOverlay.styles.d.ts +1 -1
- package/dist/components/DropdownOverlay/DropdownOverlay.styles.js +7 -10
- package/dist/components/DropdownOverlay/DropdownOverlay.types.d.ts +2 -2
- package/dist/components/DropdownOverlay/DropdownOverlay.types.js +1 -1
- package/dist/components/DropdownPopover/DropdownPopover.d.ts +2 -2
- package/dist/components/DropdownPopover/DropdownPopover.js +44 -74
- package/dist/components/DropdownPopover/DropdownPopover.types.d.ts +1 -1
- package/dist/components/DropdownPopover/DropdownPopover.types.js +1 -1
- package/dist/components/TextTrigger/TextTrigger.d.ts +2 -2
- package/dist/components/TextTrigger/TextTrigger.js +24 -31
- package/dist/components/TextTrigger/TextTrigger.styles.d.ts +3 -3
- package/dist/components/TextTrigger/TextTrigger.styles.js +9 -23
- package/dist/components/TextTrigger/TextTrigger.types.d.ts +1 -1
- package/dist/components/TextTrigger/TextTrigger.types.js +1 -1
- package/dist/hooks/useDefaultTexts.d.ts +1 -1
- package/dist/hooks/useDefaultTexts.js +18 -20
- package/dist/hooks/useDropdownVisibility.js +19 -21
- package/dist/index.js +15 -6
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/utils/getDropdownWidth.d.ts +1 -1
- package/dist/utils/getDropdownWidth.js +12 -9
- package/dist/utils/getTransitionConfig.d.ts +1 -1
- package/dist/utils/getTransitionConfig.js +11 -7
- package/dist/utils/index.js +8 -3
- package/dist/utils/isSplitFooter.d.ts +1 -1
- package/dist/utils/isSplitFooter.js +6 -3
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [1.3.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@1.3.1...@synerise/ds-dropdown@1.3.2) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-dropdown
|
|
9
|
+
|
|
10
|
+
## [1.3.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@1.3.0...@synerise/ds-dropdown@1.3.1) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-dropdown
|
|
13
|
+
|
|
6
14
|
# [1.3.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-dropdown@1.2.7...@synerise/ds-dropdown@1.3.0) (2026-03-09)
|
|
7
15
|
|
|
8
16
|
### Features
|
package/README.md
CHANGED
|
@@ -17,14 +17,19 @@ Dropdown UI Component
|
|
|
17
17
|
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------- |
|
|
18
18
|
| disabled | Whether the dropdown menu is disabled | boolean | - |
|
|
19
19
|
| getPopupContainer | Function used to set the container of the dropdown menu. The default is to create a `div` element in `body`, you can reset it to the scrolling area and make a relative reposition. | Function(triggerNode) | `() => document.body` |
|
|
20
|
-
| overlay | Dropdown
|
|
20
|
+
| overlay | Dropdown panel content | ReactNode | - |
|
|
21
21
|
| overlayClassName | Class name of the dropdown root element | string | - |
|
|
22
22
|
| overlayStyle | Style of the dropdown root element | object | - |
|
|
23
|
-
| placement | Placement of pop menu. | `bottomLeft` / `bottomCenter` / `bottomRight` / `topLeft` / `topCenter` / `topRight`
|
|
24
|
-
| trigger | Trigger mode which executes the drop-down action
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
23
|
+
| placement | Placement of pop menu. | `bottomLeft` / `bottomCenter` / `bottomRight` / `topLeft` / `topCenter` / `topRight` | - |
|
|
24
|
+
| trigger | Trigger mode which executes the drop-down action | `'click'` / `'hover'` / `'focus'` / array of these | `'click'` |
|
|
25
|
+
| open | Controlled open state | boolean | - |
|
|
26
|
+
| onOpenChange | Callback executed on visibility changes | (isOpen: boolean) => void | - |
|
|
27
|
+
| onDismiss | Callback executed when closed by clicking outside | (event?: Event, reason?: OpenChangeReason) => void | - |
|
|
28
|
+
| size | Width of the overlay | `'small'`(216px) / `'medium'`(282px) / `'large'`(588px) / `'auto'` / `'match-trigger'` / `'min-match-trigger'` / number(px) | - |
|
|
29
|
+
| footer | Footer below overlay content; object `{ left?, right? }` renders split layout | ReactNode / `{ left?: ReactNode; right?: ReactNode }` | - |
|
|
30
|
+
| hideOnItemClick | Close on click of an item inside the dropdown. Provide a CSS selector or `true` to use `[role="menuitem"]` | boolean / string | - |
|
|
31
|
+
| asChild | Forward trigger props to first child element (Radix-style) | boolean | - |
|
|
32
|
+
| popoverProps | Pass-through props to the underlying ds-popover | Partial\<PopoverOptions\> | - |
|
|
28
33
|
|
|
29
34
|
### Dropdown.SearchInput
|
|
30
35
|
|
|
@@ -43,7 +48,9 @@ Dropdown UI Component
|
|
|
43
48
|
|
|
44
49
|
### Dropdown.BackAction
|
|
45
50
|
|
|
46
|
-
| Property
|
|
47
|
-
|
|
|
48
|
-
| onClick
|
|
49
|
-
| label
|
|
51
|
+
| Property | Description | Type | Default |
|
|
52
|
+
| ------------ | ------------------------------ | ------------------------ | ------- |
|
|
53
|
+
| onClick | Action triggered on click | () => void | - |
|
|
54
|
+
| label | Label of the button | ReactNode | - |
|
|
55
|
+
| tooltip | Tooltip content | ReactNode | - |
|
|
56
|
+
| tooltipProps | Props passed to ds-tooltip | Partial\<TooltipProps\> | - |
|
package/dist/Dropdown.const.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Placement } from '@floating-ui/react';
|
|
2
|
+
import { ListItemProps } from '@synerise/ds-list-item';
|
|
3
|
+
import { FlipConfig, OffsetConfig, ShiftConfig } from '@synerise/ds-popover';
|
|
4
|
+
import { DropdownPlacement } from './Dropdown.types';
|
|
5
5
|
export declare const PLACEMENT_MAP: Record<DropdownPlacement, Placement>;
|
|
6
6
|
export declare const COPYABLE_CLOSE_DELAY = 500;
|
|
7
7
|
export declare const DEFAULT_MATCHING_FUNCTION: (item: ListItemProps, query: string) => boolean;
|
package/dist/Dropdown.const.js
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
topRight:
|
|
3
|
-
topLeft:
|
|
4
|
-
top:
|
|
5
|
-
topCenter:
|
|
6
|
-
bottom:
|
|
7
|
-
bottomCenter:
|
|
8
|
-
bottomLeft:
|
|
9
|
-
bottomRight:
|
|
1
|
+
const PLACEMENT_MAP = {
|
|
2
|
+
topRight: "top-end",
|
|
3
|
+
topLeft: "top-start",
|
|
4
|
+
top: "top",
|
|
5
|
+
topCenter: "top",
|
|
6
|
+
bottom: "bottom",
|
|
7
|
+
bottomCenter: "bottom",
|
|
8
|
+
bottomLeft: "bottom-start",
|
|
9
|
+
bottomRight: "bottom-end"
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export var POPOVER_TRANSITION_DURATION = 150;
|
|
19
|
-
export var POPOVER_OFFSET_CONFIG = {
|
|
11
|
+
const COPYABLE_CLOSE_DELAY = 500;
|
|
12
|
+
const DEFAULT_MATCHING_FUNCTION = (item, query) => !!(item.text && item.text.toLocaleLowerCase().match(query.toLocaleLowerCase()));
|
|
13
|
+
const DROPDOWN_MAX_HEIGHT = 400;
|
|
14
|
+
const MAX_VISIBLE_ITEMS = 7;
|
|
15
|
+
const SCROLLBAR_OFFSET = 11;
|
|
16
|
+
const POPOVER_TRANSITION_DURATION = 150;
|
|
17
|
+
const POPOVER_OFFSET_CONFIG = {
|
|
20
18
|
mainAxis: 8
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const POPOVER_FLIP_CONFIG = {};
|
|
21
|
+
const POPOVER_SHIFT_CONFIG = {
|
|
24
22
|
crossAxis: true
|
|
25
|
-
};
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
COPYABLE_CLOSE_DELAY,
|
|
26
|
+
DEFAULT_MATCHING_FUNCTION,
|
|
27
|
+
DROPDOWN_MAX_HEIGHT,
|
|
28
|
+
MAX_VISIBLE_ITEMS,
|
|
29
|
+
PLACEMENT_MAP,
|
|
30
|
+
POPOVER_FLIP_CONFIG,
|
|
31
|
+
POPOVER_OFFSET_CONFIG,
|
|
32
|
+
POPOVER_SHIFT_CONFIG,
|
|
33
|
+
POPOVER_TRANSITION_DURATION,
|
|
34
|
+
SCROLLBAR_OFFSET
|
|
35
|
+
};
|
package/dist/Dropdown.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import SearchBar from '@synerise/ds-search-bar';
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { default as SearchBar } from '@synerise/ds-search-bar';
|
|
3
3
|
import { Wrapper } from './Dropdown.styles';
|
|
4
|
-
import {
|
|
4
|
+
import { DropdownProps } from './Dropdown.types';
|
|
5
5
|
import { BackAction } from './components/BackAction/BackAction';
|
|
6
6
|
import { BottomAction } from './components/BottomAction/BottomAction';
|
|
7
7
|
import { MenuWrapper } from './components/DropdownMenuList/DropdownMenuList.styles';
|
package/dist/Dropdown.js
CHANGED
|
@@ -1,85 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setActiveIndex = _useState[1];
|
|
48
|
-
var renderedOverlay = useMemo(function () {
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo } from "react";
|
|
3
|
+
import SearchBar from "@synerise/ds-search-bar";
|
|
4
|
+
import { getPopupContainer } from "@synerise/ds-utils";
|
|
5
|
+
import { Wrapper } from "./Dropdown.styles.js";
|
|
6
|
+
import { BackAction } from "./components/BackAction/BackAction.js";
|
|
7
|
+
import { BottomAction } from "./components/BottomAction/BottomAction.js";
|
|
8
|
+
import { DropdownFooter } from "./components/DropdownFooter/DropdownFooter.js";
|
|
9
|
+
import { MenuWrapper } from "./components/DropdownMenuList/DropdownMenuList.styles.js";
|
|
10
|
+
import { DropdownPopover } from "./components/DropdownPopover/DropdownPopover.js";
|
|
11
|
+
import { TextTrigger } from "./components/TextTrigger/TextTrigger.js";
|
|
12
|
+
import { useDropdownVisibility } from "./hooks/useDropdownVisibility.js";
|
|
13
|
+
const Dropdown = ({
|
|
14
|
+
hideOnItemClick,
|
|
15
|
+
placement,
|
|
16
|
+
dropdownRender,
|
|
17
|
+
open,
|
|
18
|
+
onOpenChange,
|
|
19
|
+
onDismiss,
|
|
20
|
+
overlay,
|
|
21
|
+
trigger = "click",
|
|
22
|
+
size,
|
|
23
|
+
asChild,
|
|
24
|
+
children,
|
|
25
|
+
overlayStyle,
|
|
26
|
+
overlayClassName,
|
|
27
|
+
disabled,
|
|
28
|
+
destroyPopupOnHide,
|
|
29
|
+
// unused
|
|
30
|
+
align,
|
|
31
|
+
// unused
|
|
32
|
+
getPopupContainer: getPopupContainer$1 = getPopupContainer,
|
|
33
|
+
popoverProps,
|
|
34
|
+
popoverTriggerProps,
|
|
35
|
+
footer,
|
|
36
|
+
...htmlAttributes
|
|
37
|
+
}) => {
|
|
38
|
+
const {
|
|
39
|
+
open: isOpen,
|
|
40
|
+
toggleOpen
|
|
41
|
+
} = useDropdownVisibility({
|
|
42
|
+
open,
|
|
43
|
+
onOpenChange
|
|
44
|
+
});
|
|
45
|
+
const [activeIndex, setActiveIndex] = useState(null);
|
|
46
|
+
const renderedOverlay = useMemo(() => {
|
|
49
47
|
return overlay ? overlay : dropdownRender && dropdownRender();
|
|
50
48
|
}, [dropdownRender, overlay]);
|
|
51
|
-
|
|
52
|
-
return disabled ?
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
hideOnItemClick: hideOnItemClick,
|
|
66
|
-
handleItemClick: function handleItemClick() {
|
|
67
|
-
if (hideOnItemClick) {
|
|
68
|
-
toggleOpen(false);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
onDismiss: onDismiss,
|
|
72
|
-
popoverProps: _extends({}, popoverProps, {
|
|
73
|
-
componentId: 'dropdown'
|
|
74
|
-
}),
|
|
75
|
-
popoverTriggerProps: popoverTriggerProps,
|
|
76
|
-
trigger: trigger,
|
|
77
|
-
size: size,
|
|
78
|
-
overlayStyle: overlayStyle,
|
|
79
|
-
overlayClassName: overlayClassName,
|
|
80
|
-
activeIndex: activeIndex,
|
|
81
|
-
setActiveIndex: setActiveIndex
|
|
82
|
-
}, children);
|
|
49
|
+
const isTriggeredByClick = Array.isArray(trigger) ? trigger.includes("click") : trigger === "click";
|
|
50
|
+
return disabled ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(DropdownPopover, { getPopupContainer: getPopupContainer$1, overlayHTMLAttributes: htmlAttributes, open: isOpen, placement, asChild, overlay: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
renderedOverlay,
|
|
52
|
+
footer && /* @__PURE__ */ jsx(DropdownFooter, { footer })
|
|
53
|
+
] }), handleOpenChange: toggleOpen, handleTriggerClick: () => {
|
|
54
|
+
isTriggeredByClick && toggleOpen(!isOpen);
|
|
55
|
+
}, hideOnItemClick, handleItemClick: () => {
|
|
56
|
+
if (hideOnItemClick) {
|
|
57
|
+
toggleOpen(false);
|
|
58
|
+
}
|
|
59
|
+
}, onDismiss, popoverProps: {
|
|
60
|
+
...popoverProps,
|
|
61
|
+
componentId: "dropdown"
|
|
62
|
+
}, popoverTriggerProps, trigger, size, overlayStyle, overlayClassName, activeIndex, setActiveIndex, children });
|
|
83
63
|
};
|
|
84
64
|
Dropdown.Wrapper = Wrapper;
|
|
85
65
|
Dropdown.MenuWrapper = MenuWrapper;
|
|
@@ -87,4 +67,7 @@ Dropdown.SearchInput = SearchBar;
|
|
|
87
67
|
Dropdown.BottomAction = BottomAction;
|
|
88
68
|
Dropdown.BackAction = BackAction;
|
|
89
69
|
Dropdown.TextTrigger = TextTrigger;
|
|
90
|
-
export
|
|
70
|
+
export {
|
|
71
|
+
Dropdown,
|
|
72
|
+
Dropdown as default
|
|
73
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Wrapper: import(
|
|
1
|
+
export declare const Wrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
package/dist/Dropdown.styles.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { Wrapper as
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Wrapper as Wrapper$1 } from "@synerise/ds-list-item/dist/components/Text/Text.styles";
|
|
3
|
+
const Wrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "Dropdownstyles__Wrapper",
|
|
5
5
|
componentId: "sc-1onktq5-0"
|
|
6
|
-
})(["overflow:hidden;background:", ";", "{min-width:0;}"],
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
})(["overflow:hidden;background:", ";", "{min-width:0;}"], (props) => props.theme.palette.white, Wrapper$1);
|
|
7
|
+
export {
|
|
8
|
+
Wrapper
|
|
9
|
+
};
|
package/dist/Dropdown.types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { OpenChangeReason } from '@floating-ui/react';
|
|
3
|
+
import { LegacyDropdownPlacement, PopoverOptions, PopoverTriggerType } from '@synerise/ds-popover';
|
|
4
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
5
5
|
export type DropdownProps = Omit<WithHTMLAttributes<HTMLDivElement, DropdownSharedProps & {
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated all dropdowns are destroyed when hidden
|
package/dist/Dropdown.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Props } from './BackAction.types';
|
|
3
3
|
export declare const BackAction: ({ label, onClick, tooltip, tooltipProps, }: Props) => React.JSX.Element;
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, label)), /*#__PURE__*/React.createElement(Divider, {
|
|
22
|
-
dashed: true,
|
|
23
|
-
withSideMargin: true
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Divider from "@synerise/ds-divider";
|
|
3
|
+
import Icon, { ArrowLeftM } from "@synerise/ds-icon";
|
|
4
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
5
|
+
import { BackActionWrapper, ContentWrapper, IconWrapper, Label } from "./BackAction.styles.js";
|
|
6
|
+
const BackAction = ({
|
|
7
|
+
label,
|
|
8
|
+
onClick,
|
|
9
|
+
tooltip,
|
|
10
|
+
tooltipProps
|
|
11
|
+
}) => /* @__PURE__ */ jsxs(BackActionWrapper, { children: [
|
|
12
|
+
/* @__PURE__ */ jsxs(ContentWrapper, { "data-testid": "dropdown-back-action-arrow", onClick, children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Tooltip, { title: tooltip, ...tooltipProps, children: /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(ArrowLeftM, {}) }) }) }),
|
|
14
|
+
/* @__PURE__ */ jsx(Label, { "data-testid": "dropdown-back-action-label", children: label })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsx(Divider, { dashed: true, withSideMargin: true })
|
|
17
|
+
] });
|
|
18
|
+
export {
|
|
19
|
+
BackAction
|
|
20
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Label: import(
|
|
2
|
-
export declare const IconWrapper: import(
|
|
3
|
-
export declare const BackActionWrapper: import(
|
|
4
|
-
export declare const ContentWrapper: import(
|
|
1
|
+
export declare const Label: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const BackActionWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const ContentWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const Label = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "BackActionstyles__Label",
|
|
4
4
|
componentId: "sc-1cwqmxm-0"
|
|
5
|
-
})(["font-weight:500;font-size:14px;transition:color 0.3s ease;color:", ";"],
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
export var IconWrapper = styled.div.withConfig({
|
|
5
|
+
})(["font-weight:500;font-size:14px;transition:color 0.3s ease;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
6
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
9
7
|
displayName: "BackActionstyles__IconWrapper",
|
|
10
8
|
componentId: "sc-1cwqmxm-1"
|
|
11
|
-
})(["margin-right:12px;color:", ";transition:color 0.3s ease;"],
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
export var BackActionWrapper = styled.div.withConfig({
|
|
9
|
+
})(["margin-right:12px;color:", ";transition:color 0.3s ease;"], (props) => props.theme.palette["grey-700"]);
|
|
10
|
+
const BackActionWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
15
11
|
displayName: "BackActionstyles__BackActionWrapper",
|
|
16
12
|
componentId: "sc-1cwqmxm-2"
|
|
17
|
-
})(["padding:0 8px;&:hover{", "{color:", ";}", "{color:", ";}}"], Label,
|
|
18
|
-
|
|
19
|
-
}, IconWrapper, function (props) {
|
|
20
|
-
return props.theme.palette['grey-800'];
|
|
21
|
-
});
|
|
22
|
-
export var ContentWrapper = styled.div.withConfig({
|
|
13
|
+
})(["padding:0 8px;&:hover{", "{color:", ";}", "{color:", ";}}"], Label, (props) => props.theme.palette["grey-800"], IconWrapper, (props) => props.theme.palette["grey-800"]);
|
|
14
|
+
const ContentWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
23
15
|
displayName: "BackActionstyles__ContentWrapper",
|
|
24
16
|
componentId: "sc-1cwqmxm-3"
|
|
25
|
-
})(["padding:14px 8px;display:flex;align-items:center;cursor:pointer;"]);
|
|
17
|
+
})(["padding:14px 8px;display:flex;align-items:center;cursor:pointer;"]);
|
|
18
|
+
export {
|
|
19
|
+
BackActionWrapper,
|
|
20
|
+
ContentWrapper,
|
|
21
|
+
IconWrapper,
|
|
22
|
+
Label
|
|
23
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BottomActionProps } from './BottomAction.types';
|
|
3
3
|
export declare const BottomAction: ({ onClickAction, children, icon, ...rest }: BottomActionProps) => React.JSX.Element;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})), /*#__PURE__*/React.createElement(S.TextWrapper, null, children));
|
|
17
|
-
};
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Icon from "@synerise/ds-icon";
|
|
3
|
+
import { BottomAction as BottomAction$1, IconWrapper, TextWrapper } from "./BottomAction.styles.js";
|
|
4
|
+
const BottomAction = ({
|
|
5
|
+
onClickAction,
|
|
6
|
+
children,
|
|
7
|
+
icon,
|
|
8
|
+
...rest
|
|
9
|
+
}) => /* @__PURE__ */ jsxs(BottomAction$1, { onClick: onClickAction, ...rest, children: [
|
|
10
|
+
icon && /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(Icon, { component: icon }) }),
|
|
11
|
+
/* @__PURE__ */ jsx(TextWrapper, { children })
|
|
12
|
+
] });
|
|
13
|
+
export {
|
|
14
|
+
BottomAction
|
|
15
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const IconWrapper: import(
|
|
2
|
-
export declare const TextWrapper: import(
|
|
3
|
-
export declare const BottomAction: import(
|
|
1
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const TextWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const BottomAction: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "BottomActionstyles__IconWrapper",
|
|
4
4
|
componentId: "sc-sbwluh-0"
|
|
5
|
-
})(["margin-right:4px;svg{fill:", ";}"],
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
export var TextWrapper = styled.div.withConfig({
|
|
5
|
+
})(["margin-right:4px;svg{fill:", ";}"], (props) => props.theme.palette["grey-600"]);
|
|
6
|
+
const TextWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
9
7
|
displayName: "BottomActionstyles__TextWrapper",
|
|
10
8
|
componentId: "sc-sbwluh-1"
|
|
11
9
|
})(["line-height:12px;width:100%;"]);
|
|
12
|
-
|
|
10
|
+
const BottomAction = /* @__PURE__ */ styled.div.withConfig({
|
|
13
11
|
displayName: "BottomActionstyles__BottomAction",
|
|
14
12
|
componentId: "sc-sbwluh-2"
|
|
15
|
-
})(["background-color:", ";padding:0 16px;height:52px;display:flex;align-items:center;color:", ";font-weight:500;border-width:1px 0 0 0;border-color:", ";border-style:solid;margin-top:8px;cursor:pointer;&:hover{color:", ";", "{svg{fill:", ";}}}"],
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, function (props) {
|
|
22
|
-
return props.theme.palette['blue-600'];
|
|
23
|
-
}, IconWrapper, function (props) {
|
|
24
|
-
return props.theme.palette['blue-600'];
|
|
25
|
-
});
|
|
13
|
+
})(["background-color:", ";padding:0 16px;height:52px;display:flex;align-items:center;color:", ";font-weight:500;border-width:1px 0 0 0;border-color:", ";border-style:solid;margin-top:8px;cursor:pointer;&:hover{color:", ";", "{svg{fill:", ";}}}"], (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["grey-100"], (props) => props.theme.palette["blue-600"], IconWrapper, (props) => props.theme.palette["blue-600"]);
|
|
14
|
+
export {
|
|
15
|
+
BottomAction,
|
|
16
|
+
IconWrapper,
|
|
17
|
+
TextWrapper
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export type BottomActionProps = WithHTMLAttributes<HTMLDivElement, {
|
|
4
4
|
onClickAction: () => void;
|
|
5
5
|
icon?: ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DropdownFooterProps } from './DropdownFooter.types';
|
|
3
3
|
export declare const DropdownFooter: ({ footer }: DropdownFooterProps) => React.JSX.Element;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isSplitFooter } from
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { isSplitFooter } from "../../utils/isSplitFooter.js";
|
|
3
|
+
import { DropdownFooterWrapper, DropdownFooterLeft } from "./DropdownFooter.styles.js";
|
|
4
|
+
const DropdownFooter = ({
|
|
5
|
+
footer
|
|
6
|
+
}) => {
|
|
7
|
+
const split = isSplitFooter(footer);
|
|
8
|
+
return /* @__PURE__ */ jsx(DropdownFooterWrapper, { split, children: split ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ jsx(DropdownFooterLeft, { children: footer.left }),
|
|
10
|
+
/* @__PURE__ */ jsx(DropdownFooterLeft, { children: footer.right })
|
|
11
|
+
] }) : footer });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
DropdownFooter
|
|
15
|
+
};
|