@synerise/ds-sidebar 1.1.22 → 1.1.24

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 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.1.24](https://github.com/Synerise/synerise-design/compare/@synerise/ds-sidebar@1.1.23...@synerise/ds-sidebar@1.1.24) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-sidebar
9
+
10
+ ## [1.1.23](https://github.com/Synerise/synerise-design/compare/@synerise/ds-sidebar@1.1.22...@synerise/ds-sidebar@1.1.23) (2026-03-20)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-sidebar
13
+
6
14
  ## [1.1.22](https://github.com/Synerise/synerise-design/compare/@synerise/ds-sidebar@1.1.21...@synerise/ds-sidebar@1.1.22) (2026-03-09)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-sidebar
package/README.md CHANGED
@@ -30,26 +30,30 @@ import Sidebar from '@synerise/ds-sidebar'
30
30
 
31
31
  #### Sidebar
32
32
 
33
- | Property | Description | Type | Default |
34
- | ----------------- | ------------------------------------------- | ------------------------------------- | ------- |
35
- | children | Place for Panel element | React.ReactNode | - |
36
- | order | Place for optional Array with render order | string[] | - |
37
- | onChangeOrder | Called on drag and drop fired | (order: string / string[])=>void | - |
38
- | defaultActiveKey | Place for optional default active panel | string[] | - |
39
- | getPopupContainer | Determines where to render the drag overlay | (elem: HTMLDivElement) => HTMLElement | - |
33
+ | Property | Description | Type | Default |
34
+ | ----------------- | ---------------------------------------------------------------------------------------- | ------------------------------------- | ------- |
35
+ | children | Place for Panel element | React.ReactNode | - |
36
+ | order | Panel IDs in display order; enables sortable mode when combined with `onChangeOrder` | string[] | - |
37
+ | onChangeOrder | Called on drag and drop fired; must be set alongside `order` to enable drag mode | (order: string \| string[]) => void | - |
38
+ | defaultActiveKey | Initially open panel IDs | string[] | - |
39
+ | activeKey | Controlled open panels | string \| string[] | - |
40
+ | onChange | Called when panels open/close | (keys: string \| string[]) => void | - |
41
+ | getPopupContainer | Determines where to render the drag overlay | (elem: HTMLDivElement) => HTMLElement | - |
42
+ | className | Added to the Ant Collapse | string | - |
40
43
 
41
44
  #### Panel
42
45
 
43
- | Property | Description | Type | Default |
44
- | -------- | ----------------- | ------------------------ | ------- |
45
- | header | Panel header name | React.ReactNode / string | - |
46
- | children | Panel content | React.ReactNode / string | - |
47
- | id | Panel unique id | string | - |
46
+ | Property | Description | Type | Default |
47
+ | ----------- | ---------------------------------------------------- | ------------------------ | ------- |
48
+ | id | Panel unique id (required) | string | - |
49
+ | header | Panel header name | React.ReactNode / string | - |
50
+ | children | Panel content | React.ReactNode / string | - |
51
+ | forceRender | Render body even when collapsed | boolean | - |
48
52
 
49
- #### SidebarButton
53
+ #### SidebarWithButton
50
54
 
51
- | Property | Description | Type | Default |
52
- | ----------- | ----------------------------- | ---------------------- | ------- |
53
- | buttonLabel | prop to show text of button | string | - |
54
- | title | prop to show title | string | - |
55
- | dataSource | data of all items in dropdown | string / MenuItemProps | - |
55
+ | Property | Description | Type | Default |
56
+ | ----------- | ----------------------------- | -------------- | ------- |
57
+ | dataSource | data of all items in dropdown | MenuItemProps[] | - |
58
+ | buttonLabel | prop to show text of button | string | - |
59
+ | title | prop to show title | string | - |
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type PanelProps } from '../Sidebar.types';
1
+ import { default as React } from 'react';
2
+ import { PanelProps } from '../Sidebar.types';
3
3
  export declare const DragOverlayPanel: ({ header, children, id, isActive, forceRender, }: PanelProps) => React.JSX.Element;
@@ -1,22 +1,23 @@
1
- import React from 'react';
2
- import { theme } from '@synerise/ds-core';
3
- import Icon, { AngleDownS, AngleUpS, DragHandleM } from '@synerise/ds-icon';
4
- import * as S from '../Sidebar.styles';
5
- export var DragOverlayPanel = function DragOverlayPanel(_ref) {
6
- var header = _ref.header,
7
- children = _ref.children,
8
- id = _ref.id,
9
- isActive = _ref.isActive,
10
- forceRender = _ref.forceRender;
11
- return /*#__PURE__*/React.createElement(S.DragOverlay, {
12
- key: "sidebar-drag-overlay-" + id
13
- }, /*#__PURE__*/React.createElement(S.DragOverlayHeader, null, /*#__PURE__*/React.createElement(S.SidebarHeader, null, /*#__PURE__*/React.createElement("span", null, header), /*#__PURE__*/React.createElement(S.SidebarHandle, {
14
- "data-testid": "ds-sidebar-header-handle"
15
- }, /*#__PURE__*/React.createElement(Icon, {
16
- color: theme.palette['grey-400'],
17
- component: /*#__PURE__*/React.createElement(DragHandleM, null)
18
- })), /*#__PURE__*/React.createElement(S.ExpandIcon, null, /*#__PURE__*/React.createElement(Icon, {
19
- color: theme.palette['grey-600'],
20
- component: isActive ? /*#__PURE__*/React.createElement(AngleUpS, null) : /*#__PURE__*/React.createElement(AngleDownS, null)
21
- })))), (isActive || forceRender) && /*#__PURE__*/React.createElement(S.DragOverlayContent, null, /*#__PURE__*/React.createElement(S.SidebarContentWrapper, null, children)));
22
- };
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { theme } from "@synerise/ds-core";
3
+ import Icon, { DragHandleM, AngleUpS, AngleDownS } from "@synerise/ds-icon";
4
+ import { DragOverlay, DragOverlayHeader, SidebarHeader, SidebarHandle, ExpandIcon, DragOverlayContent, SidebarContentWrapper } from "../Sidebar.styles.js";
5
+ const DragOverlayPanel = ({
6
+ header,
7
+ children,
8
+ id,
9
+ isActive,
10
+ forceRender
11
+ }) => {
12
+ return /* @__PURE__ */ jsxs(DragOverlay, { children: [
13
+ /* @__PURE__ */ jsx(DragOverlayHeader, { children: /* @__PURE__ */ jsxs(SidebarHeader, { children: [
14
+ /* @__PURE__ */ jsx("span", { children: header }),
15
+ /* @__PURE__ */ jsx(SidebarHandle, { "data-testid": "ds-sidebar-header-handle", children: /* @__PURE__ */ jsx(Icon, { color: theme.palette["grey-400"], component: /* @__PURE__ */ jsx(DragHandleM, {}) }) }),
16
+ /* @__PURE__ */ jsx(ExpandIcon, { children: /* @__PURE__ */ jsx(Icon, { color: theme.palette["grey-600"], component: isActive ? /* @__PURE__ */ jsx(AngleUpS, {}) : /* @__PURE__ */ jsx(AngleDownS, {}) }) })
17
+ ] }) }),
18
+ (isActive || forceRender) && /* @__PURE__ */ jsx(DragOverlayContent, { children: /* @__PURE__ */ jsx(SidebarContentWrapper, { children }) })
19
+ ] }, `sidebar-drag-overlay-${id}`);
20
+ };
21
+ export {
22
+ DragOverlayPanel
23
+ };
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type PanelProps } from '../Sidebar.types';
1
+ import { default as React } from 'react';
2
+ import { PanelProps } from '../Sidebar.types';
3
3
  export declare const DraggablePanel: ({ id, ...props }: PanelProps) => React.JSX.Element;
@@ -1,32 +1,29 @@
1
- var _excluded = ["id"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React from 'react';
5
- import { CSS, useSortable } from '@synerise/ds-sortable';
6
- import { PanelContent } from '../PanelContent/PanelContent';
7
- import * as S from '../Sidebar.styles';
8
- export var DraggablePanel = function DraggablePanel(_ref) {
9
- var id = _ref.id,
10
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
11
- var _useSortable = useSortable({
12
- id: id
13
- }),
14
- attributes = _useSortable.attributes,
15
- listeners = _useSortable.listeners,
16
- setNodeRef = _useSortable.setNodeRef,
17
- transform = _useSortable.transform,
18
- transition = _useSortable.transition;
19
- var dragStyle = {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useSortable, CSS } from "@synerise/ds-sortable";
3
+ import { PanelContent } from "../PanelContent/PanelContent.js";
4
+ import { DraggablePanelWrapper } from "../Sidebar.styles.js";
5
+ const DraggablePanel = ({
6
+ id,
7
+ ...props
8
+ }) => {
9
+ const {
10
+ attributes,
11
+ listeners,
12
+ setNodeRef,
13
+ transform,
14
+ transition
15
+ } = useSortable({
16
+ id
17
+ });
18
+ const dragStyle = {
20
19
  transform: CSS.Transform.toString(transform),
21
- transition: transition
20
+ transition
22
21
  };
23
- return /*#__PURE__*/React.createElement(S.DraggablePanelWrapper, {
24
- ref: setNodeRef,
25
- style: dragStyle
26
- }, /*#__PURE__*/React.createElement(PanelContent, _extends({
27
- id: id
28
- }, props, {
29
- draggable: true,
30
- dragHandleProps: _extends({}, attributes, listeners)
31
- })));
32
- };
22
+ return /* @__PURE__ */ jsx(DraggablePanelWrapper, { ref: setNodeRef, style: dragStyle, children: /* @__PURE__ */ jsx(PanelContent, { id, ...props, draggable: true, dragHandleProps: {
23
+ ...attributes,
24
+ ...listeners
25
+ } }) });
26
+ };
27
+ export {
28
+ DraggablePanel
29
+ };
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type PanelProps } from '../Sidebar.types';
1
+ import { default as React } from 'react';
2
+ import { PanelProps } from '../Sidebar.types';
3
3
  export declare const Panel: (props: PanelProps) => React.JSX.Element;
4
4
  export default Panel;
@@ -1,11 +1,16 @@
1
- import React, { useContext } from 'react';
2
- import { DraggablePanel } from '../DraggablePanel/DraggablePanel';
3
- import { PanelContent } from '../PanelContent/PanelContent';
4
- import { SidebarContext } from '../Sidebar.context';
5
- export var Panel = function Panel(props) {
6
- var context = useContext(SidebarContext);
7
- var _ref = context || {},
8
- isSortable = _ref.isSortable;
9
- return isSortable ? /*#__PURE__*/React.createElement(DraggablePanel, props) : /*#__PURE__*/React.createElement(PanelContent, props);
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useContext } from "react";
3
+ import { DraggablePanel } from "../DraggablePanel/DraggablePanel.js";
4
+ import { PanelContent } from "../PanelContent/PanelContent.js";
5
+ import { SidebarContext } from "../Sidebar.context.js";
6
+ const Panel = (props) => {
7
+ const context = useContext(SidebarContext);
8
+ const {
9
+ isSortable
10
+ } = context || {};
11
+ return isSortable ? /* @__PURE__ */ jsx(DraggablePanel, { ...props }) : /* @__PURE__ */ jsx(PanelContent, { ...props });
12
+ };
13
+ export {
14
+ Panel,
15
+ Panel as default
10
16
  };
11
- export default Panel;
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type PanelProps } from '../Sidebar.types';
1
+ import { default as React } from 'react';
2
+ import { PanelProps } from '../Sidebar.types';
3
3
  export declare const PanelContent: ({ header, children, id, draggable, dragHandleProps, ...props }: PanelProps) => React.JSX.Element;
@@ -1,27 +1,20 @@
1
- var _excluded = ["header", "children", "id", "draggable", "dragHandleProps"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React from 'react';
5
- import { theme } from '@synerise/ds-core';
6
- import Icon, { DragHandleM } from '@synerise/ds-icon';
7
- import * as S from '../Sidebar.styles';
8
- export var PanelContent = function PanelContent(_ref) {
9
- var header = _ref.header,
10
- children = _ref.children,
11
- id = _ref.id,
12
- draggable = _ref.draggable,
13
- dragHandleProps = _ref.dragHandleProps,
14
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
15
- return /*#__PURE__*/React.createElement(S.AntdPanel, _extends({
16
- header: /*#__PURE__*/React.createElement(S.SidebarHeader, null, /*#__PURE__*/React.createElement("span", {
17
- "data-testid": "header-" + id
18
- }, header), draggable && /*#__PURE__*/React.createElement(S.SidebarHandle, _extends({
19
- "data-testid": "ds-sidebar-header-handle"
20
- }, dragHandleProps), /*#__PURE__*/React.createElement(Icon, {
21
- color: theme.palette['grey-400'],
22
- component: /*#__PURE__*/React.createElement(DragHandleM, null)
23
- }))),
24
- key: id,
25
- isDragOverlay: id === '-1'
26
- }, props), /*#__PURE__*/React.createElement(S.SidebarContentWrapper, null, children));
27
- };
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { theme } from "@synerise/ds-core";
3
+ import Icon, { DragHandleM } from "@synerise/ds-icon";
4
+ import { AntdPanel, SidebarContentWrapper, SidebarHeader, SidebarHandle } from "../Sidebar.styles.js";
5
+ const PanelContent = ({
6
+ header,
7
+ children,
8
+ id,
9
+ draggable,
10
+ dragHandleProps,
11
+ ...props
12
+ }) => {
13
+ return /* @__PURE__ */ jsx(AntdPanel, { header: /* @__PURE__ */ jsxs(SidebarHeader, { children: [
14
+ /* @__PURE__ */ jsx("span", { "data-testid": `header-${id}`, children: header }),
15
+ draggable && /* @__PURE__ */ jsx(SidebarHandle, { "data-testid": "ds-sidebar-header-handle", ...dragHandleProps, children: /* @__PURE__ */ jsx(Icon, { color: theme.palette["grey-400"], component: /* @__PURE__ */ jsx(DragHandleM, {}) }) })
16
+ ] }), isDragOverlay: id === "-1", ...props, children: /* @__PURE__ */ jsx(SidebarContentWrapper, { children }) }, id);
17
+ };
18
+ export {
19
+ PanelContent
20
+ };
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type SidebarContextType } from './Sidebar.types';
1
+ import { default as React } from 'react';
2
+ import { SidebarContextType } from './Sidebar.types';
3
3
  export declare const SidebarContext: React.Context<SidebarContextType | undefined>;
4
4
  export default SidebarContext;
@@ -1,3 +1,6 @@
1
- import React from 'react';
2
- export var SidebarContext = /*#__PURE__*/React.createContext(undefined);
3
- export default SidebarContext;
1
+ import React from "react";
2
+ const SidebarContext = React.createContext(void 0);
3
+ export {
4
+ SidebarContext,
5
+ SidebarContext as default
6
+ };
package/dist/Sidebar.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { type PanelProps, type SidebarProps } from './Sidebar.types';
3
- import './style/index.less';
1
+ import { default as React } from 'react';
2
+ import { PanelProps, SidebarProps } from './Sidebar.types';
4
3
  export declare const Sidebar: {
5
4
  ({ children, order, onChangeOrder, defaultActiveKey, activeKey, onChange, className, getPopupContainer, ...collapseProps }: SidebarProps): React.JSX.Element;
6
5
  Panel: (props: PanelProps) => React.JSX.Element;
package/dist/Sidebar.js CHANGED
@@ -1,143 +1,107 @@
1
- var _excluded = ["children", "order", "onChangeOrder", "defaultActiveKey", "activeKey", "onChange", "className", "getPopupContainer"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import classNames from 'classnames';
5
- import React, { Children, useCallback, useMemo, useRef, useState } from 'react';
6
- import { createPortal } from 'react-dom';
7
- import { useTheme } from '@synerise/ds-core';
8
- import Icon, { AngleDownS, AngleUpS } from '@synerise/ds-icon';
9
- import { DragOverlay, SortableContainer } from '@synerise/ds-sortable';
10
- import { DragOverlayPanel } from './DragOverlayPanel/DragOverlayPanel';
11
- import { Panel } from './Panel/Panel';
12
- import { SidebarContext } from './Sidebar.context';
13
- import * as S from './Sidebar.styles';
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState, useRef, useMemo, useCallback, Children, createElement } from "react";
3
+ import classNames from "classnames";
4
+ import { createPortal } from "react-dom";
5
+ import { useTheme } from "@synerise/ds-core";
6
+ import Icon, { AngleUpS, AngleDownS } from "@synerise/ds-icon";
7
+ import { DragOverlay, SortableContainer } from "@synerise/ds-sortable";
8
+ import { DragOverlayPanel } from "./DragOverlayPanel/DragOverlayPanel.js";
9
+ import { Panel } from "./Panel/Panel.js";
10
+ import { SidebarContext } from "./Sidebar.context.js";
11
+ import { AntdCollapse } from "./Sidebar.styles.js";
12
+ import { prefixKeys } from "./utils/prefixKeys.js";
14
13
  import "./style/index.css";
15
- import { prefixKeys } from './utils/prefixKeys';
16
- export var Sidebar = function Sidebar(_ref) {
17
- var children = _ref.children,
18
- _ref$order = _ref.order,
19
- order = _ref$order === void 0 ? [] : _ref$order,
20
- onChangeOrder = _ref.onChangeOrder,
21
- defaultActiveKey = _ref.defaultActiveKey,
22
- activeKey = _ref.activeKey,
23
- onChange = _ref.onChange,
24
- className = _ref.className,
25
- getPopupContainer = _ref.getPopupContainer,
26
- collapseProps = _objectWithoutPropertiesLoose(_ref, _excluded);
27
- var _useState = useState(),
28
- draggedItem = _useState[0],
29
- setDraggedItem = _useState[1];
30
- var isSortable = Array.isArray(order) && order.length > 0 && !!onChangeOrder;
31
- var theme = useTheme();
32
- var wrapperRef = useRef(null);
33
- var _useState2 = useState(function () {
34
- if (!activeKey && !defaultActiveKey) {
35
- return [];
36
- }
37
- if (activeKey) {
38
- return Array.isArray(activeKey) ? activeKey : [activeKey];
39
- }
40
- if (defaultActiveKey) {
41
- return Array.isArray(defaultActiveKey) ? defaultActiveKey : [defaultActiveKey];
42
- }
14
+ const Sidebar = ({
15
+ children,
16
+ order = [],
17
+ onChangeOrder,
18
+ defaultActiveKey,
19
+ activeKey,
20
+ onChange,
21
+ className,
22
+ getPopupContainer,
23
+ ...collapseProps
24
+ }) => {
25
+ const [draggedItem, setDraggedItem] = useState();
26
+ const isSortable = Array.isArray(order) && order.length > 0 && !!onChangeOrder;
27
+ const theme = useTheme();
28
+ const wrapperRef = useRef(null);
29
+ const [activeKeys, setActiveKeys] = useState(() => {
30
+ if (!activeKey && !defaultActiveKey) {
43
31
  return [];
44
- }),
45
- activeKeys = _useState2[0],
46
- setActiveKeys = _useState2[1];
47
- var sortableItems = useMemo(function () {
48
- return order.map(function (id) {
49
- return {
50
- id: id
51
- };
52
- });
53
- }, [order]);
54
- var handleOnChange = useCallback(function (keys) {
55
- var finalKeys = isSortable ? (Array.isArray(keys) ? keys : [keys]).map(function (key) {
56
- return key.startsWith('.$') ? key.substring(2) : key;
57
- }) : keys;
32
+ }
33
+ if (activeKey) {
34
+ return Array.isArray(activeKey) ? activeKey : [activeKey];
35
+ }
36
+ if (defaultActiveKey) {
37
+ return Array.isArray(defaultActiveKey) ? defaultActiveKey : [defaultActiveKey];
38
+ }
39
+ return [];
40
+ });
41
+ const sortableItems = useMemo(() => order.map((id) => ({
42
+ id
43
+ })), [order]);
44
+ const handleOnChange = useCallback((keys) => {
45
+ const finalKeys = isSortable ? (Array.isArray(keys) ? keys : [keys]).map((key) => key.startsWith(".$") ? key.substring(2) : key) : keys;
58
46
  setActiveKeys(Array.isArray(finalKeys) ? finalKeys : [finalKeys]);
59
- onChange == null || onChange(finalKeys);
47
+ onChange?.(finalKeys);
60
48
  }, [isSortable, onChange]);
61
- var sortedChildren = useMemo(function () {
62
- return Children.toArray(children).sort(function (a, b) {
49
+ const sortedChildren = useMemo(() => {
50
+ return Children.toArray(children).sort((a, b) => {
63
51
  if (!isSortable) {
64
52
  return 1;
65
53
  }
66
54
  return Array.isArray(order) && order.indexOf(a.props.id) > order.indexOf(b.props.id) ? 1 : -1;
67
55
  });
68
56
  }, [children, isSortable, order]);
69
- var activeKeysProp = useMemo(function () {
70
- var prependedActiveKey = isSortable && activeKey ? prefixKeys(activeKey) : activeKey;
71
- var prependedDefaultActiveKey = isSortable && defaultActiveKey ? prefixKeys(defaultActiveKey) : defaultActiveKey;
72
- var keyProp = {};
73
- if (prependedDefaultActiveKey !== undefined) {
57
+ const activeKeysProp = useMemo(() => {
58
+ const prependedActiveKey = isSortable && activeKey ? prefixKeys(activeKey) : activeKey;
59
+ const prependedDefaultActiveKey = isSortable && defaultActiveKey ? prefixKeys(defaultActiveKey) : defaultActiveKey;
60
+ let keyProp = {};
61
+ if (prependedDefaultActiveKey !== void 0) {
74
62
  keyProp = {
75
63
  defaultActiveKey: prependedDefaultActiveKey
76
64
  };
77
- } else if (prependedActiveKey !== undefined) {
65
+ } else if (prependedActiveKey !== void 0) {
78
66
  keyProp = {
79
67
  activeKey: prependedActiveKey
80
68
  };
81
69
  }
82
70
  return keyProp;
83
71
  }, [isSortable, activeKey, defaultActiveKey]);
84
- var isDraggedPanelActive = useCallback(function (id) {
72
+ const isDraggedPanelActive = useCallback((id) => {
85
73
  return activeKeys.indexOf(id) > -1;
86
74
  }, [activeKeys]);
87
- var handleDragStart = useCallback(function (_ref2) {
88
- var active = _ref2.active;
89
- var activePanel = sortedChildren.find(function (child) {
90
- return child.props.id === active.id;
91
- });
92
- setDraggedItem(activePanel == null ? void 0 : activePanel.props);
75
+ const handleDragStart = useCallback(({
76
+ active
77
+ }) => {
78
+ const activePanel = sortedChildren.find((child) => child.props.id === active.id);
79
+ setDraggedItem(activePanel?.props);
93
80
  }, [sortedChildren]);
94
- var handleDragEnd = useCallback(function () {
95
- setDraggedItem(undefined);
81
+ const handleDragEnd = useCallback(() => {
82
+ setDraggedItem(void 0);
96
83
  }, []);
97
- var handleOrderChange = function handleOrderChange(newOrder) {
98
- onChangeOrder == null || onChangeOrder(newOrder.map(function (item) {
99
- return item.id;
100
- }));
84
+ const handleOrderChange = (newOrder) => {
85
+ onChangeOrder?.(newOrder.map((item) => item.id));
101
86
  };
102
- var collapseContent = useMemo(function () {
103
- var dragOverlay = /*#__PURE__*/React.createElement(DragOverlay, null, draggedItem && /*#__PURE__*/React.createElement(DragOverlayPanel, _extends({
104
- isActive: isDraggedPanelActive(draggedItem.id),
105
- forceRender: isDraggedPanelActive(draggedItem.id)
106
- }, draggedItem, {
107
- draggable: true,
108
- id: "-1",
109
- key: "-1"
110
- })));
111
- return /*#__PURE__*/React.createElement("div", {
112
- ref: wrapperRef
113
- }, /*#__PURE__*/React.createElement(S.AntdCollapse, _extends({}, activeKeysProp, {
114
- className: classNames({
115
- 'is-drag-drop': isSortable,
116
- className: className
117
- }),
118
- expandIconPosition: "end",
119
- expandIcon: function expandIcon(_ref3) {
120
- var isActive = _ref3.isActive;
121
- return /*#__PURE__*/React.createElement(Icon, {
122
- color: theme.palette['grey-600'],
123
- component: isActive ? /*#__PURE__*/React.createElement(AngleUpS, null) : /*#__PURE__*/React.createElement(AngleDownS, null)
124
- });
125
- },
126
- onChange: handleOnChange
127
- }, collapseProps), isSortable ? sortedChildren : children), wrapperRef.current && getPopupContainer ? /*#__PURE__*/createPortal(dragOverlay, getPopupContainer(wrapperRef.current)) : dragOverlay);
87
+ const collapseContent = useMemo(() => {
88
+ const dragOverlay = /* @__PURE__ */ jsx(DragOverlay, { children: draggedItem && /* @__PURE__ */ createElement(DragOverlayPanel, { isActive: isDraggedPanelActive(draggedItem.id), forceRender: isDraggedPanelActive(draggedItem.id), ...draggedItem, draggable: true, id: "-1", key: "-1" }) });
89
+ return /* @__PURE__ */ jsxs("div", { ref: wrapperRef, children: [
90
+ /* @__PURE__ */ jsx(AntdCollapse, { ...activeKeysProp, className: classNames({
91
+ "is-drag-drop": isSortable,
92
+ className
93
+ }), expandIconPosition: "end", expandIcon: ({
94
+ isActive
95
+ }) => /* @__PURE__ */ jsx(Icon, { color: theme.palette["grey-600"], component: isActive ? /* @__PURE__ */ jsx(AngleUpS, {}) : /* @__PURE__ */ jsx(AngleDownS, {}) }), onChange: handleOnChange, ...collapseProps, children: isSortable ? sortedChildren : children }),
96
+ wrapperRef.current && getPopupContainer ? createPortal(dragOverlay, getPopupContainer(wrapperRef.current)) : dragOverlay
97
+ ] });
128
98
  }, [draggedItem, isDraggedPanelActive, activeKeysProp, isSortable, className, handleOnChange, collapseProps, sortedChildren, children, getPopupContainer, theme.palette]);
129
- return isSortable ? /*#__PURE__*/React.createElement(SortableContainer, {
130
- axis: "y",
131
- items: sortableItems,
132
- onDragStart: handleDragStart,
133
- onDragEnd: handleDragEnd,
134
- onDragCancel: handleDragEnd,
135
- onOrderChange: handleOrderChange
136
- }, /*#__PURE__*/React.createElement(SidebarContext.Provider, {
137
- value: {
138
- isSortable: isSortable
139
- }
140
- }, collapseContent)) : collapseContent;
99
+ return isSortable ? /* @__PURE__ */ jsx(SortableContainer, { axis: "y", items: sortableItems, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDragCancel: handleDragEnd, onOrderChange: handleOrderChange, children: /* @__PURE__ */ jsx(SidebarContext.Provider, { value: {
100
+ isSortable
101
+ }, children: collapseContent }) }) : collapseContent;
141
102
  };
142
103
  Sidebar.Panel = Panel;
143
- export default Sidebar;
104
+ export {
105
+ Sidebar,
106
+ Sidebar as default
107
+ };
@@ -1,14 +1,14 @@
1
- export declare const SidebarHandle: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const SidebarHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const DraggablePanelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const AntdCollapse: import("styled-components").StyledComponent<import("react").FC<import("antd/lib/collapse").CollapseProps> & {
5
- Panel: import("react").FC<import("antd/lib/collapse").CollapsePanelProps>;
1
+ export declare const SidebarHandle: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const SidebarHeader: import('styled-components').StyledComponent<"div", any, {}, never>;
3
+ export declare const DraggablePanelWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
4
+ export declare const AntdCollapse: import('styled-components').StyledComponent<import('react').FC<import('antd/lib/collapse').CollapseProps> & {
5
+ Panel: import('react').FC<import('antd/lib/collapse').CollapsePanelProps>;
6
6
  }, any, {}, never>;
7
- export declare const AntdPanel: import("styled-components").StyledComponent<import("react").FC<import("antd/lib/collapse").CollapsePanelProps>, any, {
7
+ export declare const AntdPanel: import('styled-components').StyledComponent<import('react').FC<import('antd/lib/collapse').CollapsePanelProps>, any, {
8
8
  isDragOverlay?: boolean;
9
9
  }, never>;
10
- export declare const SidebarContentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
11
- export declare const DragOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export declare const DragOverlayHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
13
- export declare const DragOverlayContent: import("styled-components").StyledComponent<"div", any, {}, never>;
14
- export declare const ExpandIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export declare const SidebarContentWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
11
+ export declare const DragOverlay: import('styled-components').StyledComponent<"div", any, {}, never>;
12
+ export declare const DragOverlayHeader: import('styled-components').StyledComponent<"div", any, {}, never>;
13
+ export declare const DragOverlayContent: import('styled-components').StyledComponent<"div", any, {}, never>;
14
+ export declare const ExpandIcon: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,63 +1,59 @@
1
- import Collapse from 'antd/lib/collapse';
2
- import styled, { css } from 'styled-components';
3
- var Panel = Collapse.Panel;
4
- export var SidebarHandle = styled.div.withConfig({
1
+ import Collapse from "antd/lib/collapse";
2
+ import styled, { css } from "styled-components";
3
+ const {
4
+ Panel
5
+ } = Collapse;
6
+ const SidebarHandle = /* @__PURE__ */ styled.div.withConfig({
5
7
  displayName: "Sidebarstyles__SidebarHandle",
6
8
  componentId: "sc-19um1hw-0"
7
9
  })(["display:flex;opacity:1;transition:0.2s ease-in-out;cursor:grabbing;position:absolute;left:0;top:50%;transform:translateY(-50%);&::before{content:'';position:absolute;width:100%;height:100%;left:0;top:0;pointer-events:none;}"]);
8
- export var SidebarHeader = styled.div.withConfig({
10
+ const SidebarHeader = /* @__PURE__ */ styled.div.withConfig({
9
11
  displayName: "Sidebarstyles__SidebarHeader",
10
12
  componentId: "sc-19um1hw-1"
11
13
  })(["display:flex;align-items:center;max-height:20px;"]);
12
- export var DraggablePanelWrapper = styled.div.withConfig({
14
+ const DraggablePanelWrapper = /* @__PURE__ */ styled.div.withConfig({
13
15
  displayName: "Sidebarstyles__DraggablePanelWrapper",
14
16
  componentId: "sc-19um1hw-2"
15
17
  })(["position:relative;"]);
16
- var expandIconStyles = css(["right:24px;top:50%;transform:translateY(-50%);position:absolute;"]);
17
- var headerStyle = css(["padding:18px 24px;color:", ";font-weight:500;font-size:14px;background:white;position:relative;cursor:pointer;&:hover{color:", ";}"], function (props) {
18
- return props.theme.palette['grey-700'];
19
- }, function (props) {
20
- return props.theme.palette['grey-800'];
21
- });
22
- export var AntdCollapse = styled(Collapse).withConfig({
18
+ const expandIconStyles = /* @__PURE__ */ css(["right:24px;top:50%;transform:translateY(-50%);position:absolute;"]);
19
+ const headerStyle = /* @__PURE__ */ css(["padding:18px 24px;color:", ";font-weight:500;font-size:14px;background:white;position:relative;cursor:pointer;&:hover{color:", ";}"], (props) => props.theme.palette["grey-700"], (props) => props.theme.palette["grey-800"]);
20
+ const AntdCollapse = /* @__PURE__ */ styled(Collapse).withConfig({
23
21
  displayName: "Sidebarstyles__AntdCollapse",
24
22
  componentId: "sc-19um1hw-3"
25
- })(["&.ant-collapse{background-color:", ";border:none;.ant-collapse-arrow{position:static !important;vertical-align:0 !important;transform:none !important;display:block;}.ant-collapse-header{", "}", " > .ant-collapse-item > .ant-collapse-header{transition:0.2s ease-in-out;display:flex;align-items:center;justify-content:flex-start;}.ant-collapse-content-active,.ant-collapse-item-active{border-top:0;", ",", "{color:", ";&:hover{color:", ";}}}.ant-collapse-content-box{padding:16px 24px;}.ant-collapse-item{position:relative;border-top:solid 1px ", ";border-bottom:none;}}.ant-collapse-item:hover ", "{opacity:1;}&.ant-collapse-icon-position-end{.ant-collapse-item > .ant-collapse-header{padding:18px 24px;user-select:none;.ant-collapse-expand-icon{", "}}&.ant-collapse-icon-position-end.is-drag-drop ", " > .ant-collapse-item{&:hover{color:", ";}}}"], function (props) {
26
- return props.theme.palette['blue-050'];
27
- }, headerStyle, DraggablePanelWrapper, SidebarHeader, SidebarHandle, function (props) {
28
- return props.theme.palette['grey-700'];
29
- }, function (props) {
30
- return props.theme.palette['grey-800'];
31
- }, function (props) {
32
- return props.theme.palette['grey-200'];
33
- }, SidebarHandle, expandIconStyles, DraggablePanelWrapper, function (props) {
34
- return props.theme.palette['grey-800'];
35
- });
36
- export var AntdPanel = styled(Panel).withConfig({
23
+ })(["&.ant-collapse{background-color:", ";border:none;.ant-collapse-arrow{position:static !important;vertical-align:0 !important;transform:none !important;display:block;}.ant-collapse-header{", "}", " > .ant-collapse-item > .ant-collapse-header{transition:0.2s ease-in-out;display:flex;align-items:center;justify-content:flex-start;}.ant-collapse-content-active,.ant-collapse-item-active{border-top:0;", ",", "{color:", ";&:hover{color:", ";}}}.ant-collapse-content-box{padding:16px 24px;}.ant-collapse-item{position:relative;border-top:solid 1px ", ";border-bottom:none;}}.ant-collapse-item:hover ", "{opacity:1;}&.ant-collapse-icon-position-end{.ant-collapse-item > .ant-collapse-header{padding:18px 24px;user-select:none;.ant-collapse-expand-icon{", "}}&.ant-collapse-icon-position-end.is-drag-drop ", " > .ant-collapse-item{&:hover{color:", ";}}}"], (props) => props.theme.palette["blue-050"], headerStyle, DraggablePanelWrapper, SidebarHeader, SidebarHandle, (props) => props.theme.palette["grey-700"], (props) => props.theme.palette["grey-800"], (props) => props.theme.palette["grey-200"], SidebarHandle, expandIconStyles, DraggablePanelWrapper, (props) => props.theme.palette["grey-800"]);
24
+ const AntdPanel = /* @__PURE__ */ styled(Panel).withConfig({
37
25
  displayName: "Sidebarstyles__AntdPanel",
38
26
  componentId: "sc-19um1hw-4"
39
- })(["", " .ant-collapse-content{background-color:white;border-radius:0;border:none;}"], function (props) {
40
- return props.isDragOverlay && css(["box-shadow:", ";z-index:10;"], props.theme.variables['box-shadow-2']);
41
- });
42
- export var SidebarContentWrapper = styled.div.withConfig({
27
+ })(["", " .ant-collapse-content{background-color:white;border-radius:0;border:none;}"], (props) => props.isDragOverlay && css(["box-shadow:", ";z-index:10;"], props.theme.variables["box-shadow-2"]));
28
+ const SidebarContentWrapper = /* @__PURE__ */ styled.div.withConfig({
43
29
  displayName: "Sidebarstyles__SidebarContentWrapper",
44
30
  componentId: "sc-19um1hw-5"
45
31
  })([""]);
46
- export var DragOverlay = styled.div.withConfig({
32
+ const DragOverlay = /* @__PURE__ */ styled.div.withConfig({
47
33
  displayName: "Sidebarstyles__DragOverlay",
48
34
  componentId: "sc-19um1hw-6"
49
35
  })([""]);
50
- export var DragOverlayHeader = styled.div.withConfig({
36
+ const DragOverlayHeader = /* @__PURE__ */ styled.div.withConfig({
51
37
  displayName: "Sidebarstyles__DragOverlayHeader",
52
38
  componentId: "sc-19um1hw-7"
53
- })(["border-top:1px solid ", ";padding:18px 24px;user-select:none;", ""], function (props) {
54
- return props.theme.palette['grey-200'];
55
- }, headerStyle);
56
- export var DragOverlayContent = styled.div.withConfig({
39
+ })(["border-top:1px solid ", ";padding:18px 24px;user-select:none;", ""], (props) => props.theme.palette["grey-200"], headerStyle);
40
+ const DragOverlayContent = /* @__PURE__ */ styled.div.withConfig({
57
41
  displayName: "Sidebarstyles__DragOverlayContent",
58
42
  componentId: "sc-19um1hw-8"
59
43
  })(["background-color:white;padding:16px 24px;"]);
60
- export var ExpandIcon = styled.div.withConfig({
44
+ const ExpandIcon = /* @__PURE__ */ styled.div.withConfig({
61
45
  displayName: "Sidebarstyles__ExpandIcon",
62
46
  componentId: "sc-19um1hw-9"
63
- })(["", ""], expandIconStyles);
47
+ })(["", ""], expandIconStyles);
48
+ export {
49
+ AntdCollapse,
50
+ AntdPanel,
51
+ DragOverlay,
52
+ DragOverlayContent,
53
+ DragOverlayHeader,
54
+ DraggablePanelWrapper,
55
+ ExpandIcon,
56
+ SidebarContentWrapper,
57
+ SidebarHandle,
58
+ SidebarHeader
59
+ };
@@ -1,5 +1,5 @@
1
- import { type CollapseProps } from 'antd/lib/collapse';
2
- import type { HTMLAttributes, ReactElement, ReactNode } from 'react';
1
+ import { CollapseProps } from 'antd/lib/collapse';
2
+ import { HTMLAttributes, ReactElement, ReactNode } from 'react';
3
3
  export type SidebarProps = CollapseProps & {
4
4
  children: ReactNode;
5
5
  order?: string[];
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type SidebarWithButtonProps } from './SidebarWithButton.types';
1
+ import { default as React } from 'react';
2
+ import { SidebarWithButtonProps } from './SidebarWithButton.types';
3
3
  declare const SidebarWithButton: ({ dataSource, buttonLabel, title, }: SidebarWithButtonProps) => React.JSX.Element;
4
4
  export default SidebarWithButton;
@@ -1,51 +1,35 @@
1
- import React, { useRef, useState } from 'react';
2
- import Button from '@synerise/ds-button';
3
- import Dropdown from '@synerise/ds-dropdown';
4
- import Icon, { AngleDownS } from '@synerise/ds-icon';
5
- import Menu from '@synerise/ds-menu';
6
- import { useOnClickOutside } from '@synerise/ds-utils';
7
- import * as S from './SidebarWithButton.styles';
8
- var SidebarWithButton = function SidebarWithButton(_ref) {
9
- var dataSource = _ref.dataSource,
10
- buttonLabel = _ref.buttonLabel,
11
- title = _ref.title;
12
- var _useState = useState(false),
13
- dropdownVisible = _useState[0],
14
- setDropdownVisible = _useState[1];
15
- var ref = useRef(null);
16
- useOnClickOutside(ref, function () {
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useRef } from "react";
3
+ import Button from "@synerise/ds-button";
4
+ import Dropdown from "@synerise/ds-dropdown";
5
+ import Icon, { AngleDownS } from "@synerise/ds-icon";
6
+ import Menu from "@synerise/ds-menu";
7
+ import { useOnClickOutside } from "@synerise/ds-utils";
8
+ import { SidebarWithButtonWrapper, TextWrapper } from "./SidebarWithButton.styles.js";
9
+ const SidebarWithButton = ({
10
+ dataSource,
11
+ buttonLabel,
12
+ title
13
+ }) => {
14
+ const [dropdownVisible, setDropdownVisible] = useState(false);
15
+ const ref = useRef(null);
16
+ useOnClickOutside(ref, () => {
17
17
  setDropdownVisible(false);
18
18
  });
19
- return /*#__PURE__*/React.createElement(S.SidebarWithButtonWrapper, {
20
- className: "ds-SidebarWithButton"
21
- }, /*#__PURE__*/React.createElement(S.TextWrapper, null, /*#__PURE__*/React.createElement("span", null, title)), /*#__PURE__*/React.createElement(Dropdown, {
22
- overlayStyle: {
23
- borderRadius: '3px'
24
- },
25
- open: dropdownVisible,
26
- placement: "bottomLeft",
27
- size: 220,
28
- popoverProps: {
29
- testId: 'sidebar-menu'
30
- },
31
- asChild: true,
32
- overlay: /*#__PURE__*/React.createElement(Dropdown.Wrapper, {
33
- ref: ref
34
- }, /*#__PURE__*/React.createElement(Menu, {
35
- dataSource: dataSource,
36
- asDropdownMenu: true,
37
- style: {
38
- width: '100%'
39
- }
40
- }))
41
- }, /*#__PURE__*/React.createElement(Button, {
42
- onClick: function onClick() {
43
- return setDropdownVisible(!dropdownVisible);
44
- },
45
- type: "ghost-primary",
46
- mode: "label-icon"
47
- }, buttonLabel, /*#__PURE__*/React.createElement(Icon, {
48
- component: /*#__PURE__*/React.createElement(AngleDownS, null)
49
- }))));
19
+ return /* @__PURE__ */ jsxs(SidebarWithButtonWrapper, { className: "ds-SidebarWithButton", children: [
20
+ /* @__PURE__ */ jsx(TextWrapper, { children: /* @__PURE__ */ jsx("span", { children: title }) }),
21
+ /* @__PURE__ */ jsx(Dropdown, { overlayStyle: {
22
+ borderRadius: "3px"
23
+ }, open: dropdownVisible, placement: "bottomLeft", size: 220, popoverProps: {
24
+ testId: "sidebar-menu"
25
+ }, asChild: true, overlay: /* @__PURE__ */ jsx(Dropdown.Wrapper, { ref, children: /* @__PURE__ */ jsx(Menu, { dataSource, asDropdownMenu: true, style: {
26
+ width: "100%"
27
+ } }) }), children: /* @__PURE__ */ jsxs(Button, { onClick: () => setDropdownVisible(!dropdownVisible), type: "ghost-primary", mode: "label-icon", children: [
28
+ buttonLabel,
29
+ /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleDownS, {}) })
30
+ ] }) })
31
+ ] });
32
+ };
33
+ export {
34
+ SidebarWithButton as default
50
35
  };
51
- export default SidebarWithButton;
@@ -1,2 +1,2 @@
1
- export declare const SidebarWithButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const TextWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const SidebarWithButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const TextWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,11 +1,13 @@
1
- import styled from 'styled-components';
2
- export var SidebarWithButtonWrapper = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ const SidebarWithButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "SidebarWithButtonstyles__SidebarWithButtonWrapper",
4
4
  componentId: "sc-1h2ysa0-0"
5
- })(["display:flex;align-items:center;justify-content:center;padding:12px;font-weight:500;color:", ";"], function (props) {
6
- return props.theme.palette['grey-700'];
7
- });
8
- export var TextWrapper = styled.div.withConfig({
5
+ })(["display:flex;align-items:center;justify-content:center;padding:12px;font-weight:500;color:", ";"], (props) => props.theme.palette["grey-700"]);
6
+ const TextWrapper = /* @__PURE__ */ styled.div.withConfig({
9
7
  displayName: "SidebarWithButtonstyles__TextWrapper",
10
8
  componentId: "sc-1h2ysa0-1"
11
- })(["padding-right:8px;"]);
9
+ })(["padding-right:8px;"]);
10
+ export {
11
+ SidebarWithButtonWrapper,
12
+ TextWrapper
13
+ };
@@ -1,4 +1,4 @@
1
- import { type MenuItemProps } from '@synerise/ds-menu';
1
+ import { MenuItemProps } from '@synerise/ds-menu';
2
2
  export type SidebarWithButtonProps = {
3
3
  dataSource: MenuItemProps[];
4
4
  buttonLabel?: string;
@@ -1 +1 @@
1
- export {};
1
+
File without changes
package/dist/index.js CHANGED
@@ -1,3 +1,8 @@
1
- export { default } from './Sidebar';
2
- export { default as Panel } from './Panel/Panel';
3
- export { default as SidebarWithButton } from './SidebarWithButton/SidebarWithButton';
1
+ import { Sidebar } from "./Sidebar.js";
2
+ import { Panel } from "./Panel/Panel.js";
3
+ import { default as default2 } from "./SidebarWithButton/SidebarWithButton.js";
4
+ export {
5
+ Panel,
6
+ default2 as SidebarWithButton,
7
+ Sidebar as default
8
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
@@ -1,5 +1,6 @@
1
- export var prefixKeys = function prefixKeys(keys) {
2
- return keys && Array.isArray(keys) ? keys.map(function (el) {
3
- return ".$" + el;
4
- }) : ".$" + keys;
5
- };
1
+ const prefixKeys = (keys) => {
2
+ return keys && Array.isArray(keys) ? keys.map((el) => `.$${el}`) : `.$${keys}`;
3
+ };
4
+ export {
5
+ prefixKeys
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-sidebar",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "Sidebar 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",
@@ -35,12 +35,12 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-button": "^1.5.16",
39
- "@synerise/ds-dropdown": "^1.3.0",
40
- "@synerise/ds-icon": "^1.14.1",
41
- "@synerise/ds-menu": "^1.4.11",
42
- "@synerise/ds-sortable": "^1.3.12",
43
- "@synerise/ds-utils": "^1.6.0",
38
+ "@synerise/ds-button": "^1.5.18",
39
+ "@synerise/ds-dropdown": "^1.3.2",
40
+ "@synerise/ds-icon": "^1.15.1",
41
+ "@synerise/ds-menu": "^1.4.13",
42
+ "@synerise/ds-sortable": "^1.3.14",
43
+ "@synerise/ds-utils": "^1.7.1",
44
44
  "classnames": "^2.5.1"
45
45
  },
46
46
  "peerDependencies": {
@@ -49,5 +49,5 @@
49
49
  "react": ">=16.9.0 <= 18.3.1",
50
50
  "styled-components": "^5.3.3"
51
51
  },
52
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
52
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
53
53
  }