@synerise/ds-tray 1.1.26 → 1.1.28

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.28](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.27...@synerise/ds-tray@1.1.28) (2026-04-01)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-tray
9
+
10
+ ## [1.1.27](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.26...@synerise/ds-tray@1.1.27) (2026-03-24)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-tray
13
+
6
14
  ## [1.1.26](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tray@1.1.25...@synerise/ds-tray@1.1.26) (2026-03-20)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-tray
@@ -1,3 +1,8 @@
1
- export var WRAPPER_HEIGHT = 562;
2
- export var FOOTER_HEIGHT = 48;
3
- export var HEADER_HEIGHT = 56;
1
+ const WRAPPER_HEIGHT = 562;
2
+ const FOOTER_HEIGHT = 48;
3
+ const HEADER_HEIGHT = 56;
4
+ export {
5
+ FOOTER_HEIGHT,
6
+ HEADER_HEIGHT,
7
+ WRAPPER_HEIGHT
8
+ };
package/dist/Tray.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import type { TrayProps } from './Tray.types';
1
+ import { default as React } from 'react';
2
+ import { TrayProps } from './Tray.types';
3
3
  declare const Tray: ({ id, ...htmlAttributes }: TrayProps) => React.JSX.Element | null;
4
4
  export default Tray;
package/dist/Tray.js CHANGED
@@ -1,40 +1,45 @@
1
- var _excluded = ["id"];
2
- 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; }
3
- import React from 'react';
4
- import Button from '@synerise/ds-button';
5
- import Icon, { CloseM } from '@synerise/ds-icon';
6
- import * as S from './Tray.styles';
7
- import { useTrayContext } from './hooks/useTrayContext';
8
- var Tray = function Tray(_ref) {
9
- var id = _ref.id,
10
- htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
11
- var _useTrayContext = useTrayContext(),
12
- getTrayState = _useTrayContext.getTrayState,
13
- closeTray = _useTrayContext.closeTray;
14
- var _getTrayState = getTrayState(id),
15
- isOpen = _getTrayState.isOpen,
16
- data = _getTrayState.data;
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import Button from "@synerise/ds-button";
3
+ import Icon, { CloseM } from "@synerise/ds-icon";
4
+ import { TrayWrapper, TrayHeader, TrayHeaderLeft, TrayTitle, TrayHeaderRight, TrayContent, TrayScrollbar, TrayFooter } from "./Tray.styles.js";
5
+ import { useTrayContext } from "./hooks/useTrayContext.js";
6
+ const Tray = ({
7
+ id,
8
+ ...htmlAttributes
9
+ }) => {
10
+ const {
11
+ getTrayState,
12
+ closeTray
13
+ } = useTrayContext();
14
+ const {
15
+ isOpen,
16
+ data
17
+ } = getTrayState(id);
17
18
  if (!isOpen) {
18
19
  return null;
19
20
  }
20
- var content = data.content,
21
- title = data.title,
22
- footer = data.footer,
23
- headerRightSide = data.headerRightSide,
24
- onClose = data.onClose;
25
- return /*#__PURE__*/React.createElement(S.TrayWrapper, htmlAttributes, /*#__PURE__*/React.createElement(S.TrayHeader, null, /*#__PURE__*/React.createElement(S.TrayHeaderLeft, null, /*#__PURE__*/React.createElement(S.TrayTitle, {
26
- level: 4
27
- }, title)), /*#__PURE__*/React.createElement(S.TrayHeaderRight, null, headerRightSide, /*#__PURE__*/React.createElement(Button, {
28
- type: "ghost",
29
- mode: "single-icon",
30
- onClick: function onClick() {
31
- closeTray(id);
32
- onClose == null || onClose(id);
33
- }
34
- }, /*#__PURE__*/React.createElement(Icon, {
35
- component: /*#__PURE__*/React.createElement(CloseM, null)
36
- })))), /*#__PURE__*/React.createElement(S.TrayContent, null, /*#__PURE__*/React.createElement(S.TrayScrollbar, {
37
- absolute: true
38
- }, content)), footer && /*#__PURE__*/React.createElement(S.TrayFooter, null, footer));
21
+ const {
22
+ content,
23
+ title,
24
+ footer,
25
+ headerRightSide,
26
+ onClose
27
+ } = data;
28
+ return /* @__PURE__ */ jsxs(TrayWrapper, { ...htmlAttributes, children: [
29
+ /* @__PURE__ */ jsxs(TrayHeader, { children: [
30
+ /* @__PURE__ */ jsx(TrayHeaderLeft, { children: /* @__PURE__ */ jsx(TrayTitle, { level: 4, children: title }) }),
31
+ /* @__PURE__ */ jsxs(TrayHeaderRight, { children: [
32
+ headerRightSide,
33
+ /* @__PURE__ */ jsx(Button, { type: "ghost", mode: "single-icon", onClick: () => {
34
+ closeTray(id);
35
+ onClose?.(id);
36
+ }, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) })
37
+ ] })
38
+ ] }),
39
+ /* @__PURE__ */ jsx(TrayContent, { children: /* @__PURE__ */ jsx(TrayScrollbar, { absolute: true, children: content }) }),
40
+ footer && /* @__PURE__ */ jsx(TrayFooter, { children: footer })
41
+ ] });
42
+ };
43
+ export {
44
+ Tray as default
39
45
  };
40
- export default Tray;
@@ -1,8 +1,8 @@
1
- export declare const TrayContent: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const TrayScrollbar: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<(import("@synerise/ds-scrollbar").ScrollbarProps | import("@synerise/ds-scrollbar").VirtualScrollbarProps) & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
3
- export declare const TrayWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const TrayHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const TrayHeaderLeft: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export declare const TrayHeaderRight: import("styled-components").StyledComponent<"div", any, {}, never>;
7
- export declare const TrayFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const TrayTitle: import("styled-components").StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import("@synerise/ds-typography/dist/Title.types").Props) => React.JSX.Element, any, {}, never>;
1
+ export declare const TrayContent: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const TrayScrollbar: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<(import('@synerise/ds-scrollbar').ScrollbarProps | import('@synerise/ds-scrollbar').VirtualScrollbarProps) & import('react').RefAttributes<HTMLElement>>, any, {}, never>;
3
+ export declare const TrayWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
4
+ export declare const TrayHeader: import('styled-components').StyledComponent<"div", any, {}, never>;
5
+ export declare const TrayHeaderLeft: import('styled-components').StyledComponent<"div", any, {}, never>;
6
+ export declare const TrayHeaderRight: import('styled-components').StyledComponent<"div", any, {}, never>;
7
+ export declare const TrayFooter: import('styled-components').StyledComponent<"div", any, {}, never>;
8
+ export declare const TrayTitle: import('styled-components').StyledComponent<({ level, withoutMargin, children, className, ellipsis, ...antdProps }: import('@synerise/ds-typography/dist/Title.types').Props) => React.JSX.Element, any, {}, never>;
@@ -1,48 +1,46 @@
1
- import styled from 'styled-components';
2
- import Scrollbar from '@synerise/ds-scrollbar';
3
- import { Title } from '@synerise/ds-typography';
4
- import { FOOTER_HEIGHT, HEADER_HEIGHT, WRAPPER_HEIGHT } from './Tray.const';
5
- export var TrayContent = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ import Scrollbar from "@synerise/ds-scrollbar";
3
+ import { Title } from "@synerise/ds-typography";
4
+ import { FOOTER_HEIGHT, HEADER_HEIGHT, WRAPPER_HEIGHT } from "./Tray.const.js";
5
+ const TrayContent = /* @__PURE__ */ styled.div.withConfig({
6
6
  displayName: "Traystyles__TrayContent",
7
7
  componentId: "sc-1v5sbw5-0"
8
8
  })(["flex:1 1 auto;min-height:0;position:relative;display:flex;flex-direction:column;"]);
9
- export var TrayScrollbar = styled(Scrollbar).withConfig({
9
+ const TrayScrollbar = /* @__PURE__ */ styled(Scrollbar).withConfig({
10
10
  displayName: "Traystyles__TrayScrollbar",
11
11
  componentId: "sc-1v5sbw5-1"
12
12
  })(["min-height:0;display:flex;flex-direction:column;.scrollbar-container{min-height:0;}"]);
13
- export var TrayWrapper = styled.div.withConfig({
13
+ const TrayWrapper = /* @__PURE__ */ styled.div.withConfig({
14
14
  displayName: "Traystyles__TrayWrapper",
15
15
  componentId: "sc-1v5sbw5-2"
16
- })(["position:fixed;top:0;right:0;z-index:", ";box-shadow:", ";width:400px;border-radius:3px;max-height:", "px;display:flex;flex-direction:column;background:", ";"], function (props) {
17
- return props.theme.variables['zindex-tooltip'];
18
- }, function (props) {
19
- return props.theme.variables['box-shadow-2'];
20
- }, WRAPPER_HEIGHT, function (props) {
21
- return props.theme.palette.white;
22
- });
23
- export var TrayHeader = styled.div.withConfig({
16
+ })(["position:fixed;top:0;right:0;z-index:", ";box-shadow:", ";width:400px;border-radius:3px;max-height:", "px;display:flex;flex-direction:column;background:", ";"], (props) => props.theme.variables["zindex-tooltip"], (props) => props.theme.variables["box-shadow-2"], WRAPPER_HEIGHT, (props) => props.theme.palette.white);
17
+ const TrayHeader = /* @__PURE__ */ styled.div.withConfig({
24
18
  displayName: "Traystyles__TrayHeader",
25
19
  componentId: "sc-1v5sbw5-3"
26
- })(["height:", "px;flex:0 0 ", "px;padding-left:18px;padding-right:12px;border-bottom:solid 1px ", ";display:flex;align-items:center;justify-content:space-between;"], HEADER_HEIGHT, HEADER_HEIGHT, function (props) {
27
- return props.theme.palette['grey-200'];
28
- });
29
- export var TrayHeaderLeft = styled.div.withConfig({
20
+ })(["height:", "px;flex:0 0 ", "px;padding-left:18px;padding-right:12px;border-bottom:solid 1px ", ";display:flex;align-items:center;justify-content:space-between;"], HEADER_HEIGHT, HEADER_HEIGHT, (props) => props.theme.palette["grey-200"]);
21
+ const TrayHeaderLeft = /* @__PURE__ */ styled.div.withConfig({
30
22
  displayName: "Traystyles__TrayHeaderLeft",
31
23
  componentId: "sc-1v5sbw5-4"
32
24
  })([""]);
33
- export var TrayHeaderRight = styled.div.withConfig({
25
+ const TrayHeaderRight = /* @__PURE__ */ styled.div.withConfig({
34
26
  displayName: "Traystyles__TrayHeaderRight",
35
27
  componentId: "sc-1v5sbw5-5"
36
28
  })(["display:flex;gap:8px;align-items:center;"]);
37
- export var TrayFooter = styled.div.withConfig({
29
+ const TrayFooter = /* @__PURE__ */ styled.div.withConfig({
38
30
  displayName: "Traystyles__TrayFooter",
39
31
  componentId: "sc-1v5sbw5-6"
40
- })(["border-top:solid 1px ", ";background:", ";height:", "px;display:flex;align-items:center;padding:0 8px;flex:0 0 ", "px;"], function (props) {
41
- return props.theme.palette['grey-100'];
42
- }, function (props) {
43
- return props.theme.palette['grey-050'];
44
- }, FOOTER_HEIGHT, FOOTER_HEIGHT);
45
- export var TrayTitle = styled(Title).withConfig({
32
+ })(["border-top:solid 1px ", ";background:", ";height:", "px;display:flex;align-items:center;padding:0 8px;flex:0 0 ", "px;"], (props) => props.theme.palette["grey-100"], (props) => props.theme.palette["grey-050"], FOOTER_HEIGHT, FOOTER_HEIGHT);
33
+ const TrayTitle = /* @__PURE__ */ styled(Title).withConfig({
46
34
  displayName: "Traystyles__TrayTitle",
47
35
  componentId: "sc-1v5sbw5-7"
48
- })(["margin:0;"]);
36
+ })(["margin:0;"]);
37
+ export {
38
+ TrayContent,
39
+ TrayFooter,
40
+ TrayHeader,
41
+ TrayHeaderLeft,
42
+ TrayHeaderRight,
43
+ TrayScrollbar,
44
+ TrayTitle,
45
+ TrayWrapper
46
+ };
@@ -1,4 +1,4 @@
1
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
2
2
  export type TrayProps = WithHTMLAttributes<HTMLDivElement, {
3
3
  id: string;
4
4
  }>;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React, { type ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  export type TrayData = {
3
3
  content: ReactNode;
4
4
  title: ReactNode;
@@ -1,39 +1,40 @@
1
- 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); }
2
- import React, { useState } from 'react';
3
- import { TrayContext } from '../contexts/TrayContext';
4
- export var TrayProvider = function TrayProvider(_ref) {
5
- var children = _ref.children;
6
- var _useState = useState({}),
7
- trayState = _useState[0],
8
- setTrayState = _useState[1];
9
- var openTray = function openTray(id, data) {
10
- setTrayState(function (prev) {
11
- var _extends2;
12
- return _extends({}, prev, (_extends2 = {}, _extends2[id] = {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { TrayContext } from "../contexts/TrayContext.js";
4
+ const TrayProvider = ({
5
+ children
6
+ }) => {
7
+ const [trayState, setTrayState] = useState({});
8
+ const openTray = (id, data) => {
9
+ setTrayState((prev) => ({
10
+ ...prev,
11
+ [id]: {
13
12
  isOpen: true,
14
- data: data
15
- }, _extends2));
16
- });
13
+ data
14
+ }
15
+ }));
17
16
  };
18
- var closeTray = function closeTray(id) {
19
- setTrayState(function (prev) {
20
- var _extends3;
21
- return _extends({}, prev, (_extends3 = {}, _extends3[id] = _extends({}, prev[id], {
17
+ const closeTray = (id) => {
18
+ setTrayState((prev) => ({
19
+ ...prev,
20
+ [id]: {
21
+ ...prev[id],
22
22
  isOpen: false
23
- }), _extends3));
24
- });
23
+ }
24
+ }));
25
25
  };
26
- var getTrayState = function getTrayState(id) {
26
+ const getTrayState = (id) => {
27
27
  return trayState[id] || {
28
28
  isOpen: false,
29
29
  data: null
30
30
  };
31
31
  };
32
- return /*#__PURE__*/React.createElement(TrayContext.Provider, {
33
- value: {
34
- openTray: openTray,
35
- closeTray: closeTray,
36
- getTrayState: getTrayState
37
- }
38
- }, children);
39
- };
32
+ return /* @__PURE__ */ jsx(TrayContext.Provider, { value: {
33
+ openTray,
34
+ closeTray,
35
+ getTrayState
36
+ }, children });
37
+ };
38
+ export {
39
+ TrayProvider
40
+ };
@@ -1,4 +1,4 @@
1
- import { type TrayData } from '../components/TrayProvider';
1
+ import { TrayData } from '../components/TrayProvider';
2
2
  export type TrayContextType = {
3
3
  openTray: (id: string, data: TrayData) => void;
4
4
  closeTray: (id: string) => void;
@@ -7,4 +7,4 @@ export type TrayContextType = {
7
7
  data: TrayData;
8
8
  };
9
9
  };
10
- export declare const TrayContext: import("react").Context<TrayContextType | undefined>;
10
+ export declare const TrayContext: import('react').Context<TrayContextType | undefined>;
@@ -1,2 +1,5 @@
1
- import { createContext } from 'react';
2
- export var TrayContext = /*#__PURE__*/createContext(undefined);
1
+ import { createContext } from "react";
2
+ const TrayContext = createContext(void 0);
3
+ export {
4
+ TrayContext
5
+ };
@@ -1,4 +1,4 @@
1
1
  export declare const useTray: () => {
2
- open: (id: string, data: import("../components/TrayProvider").TrayData) => void;
2
+ open: (id: string, data: import('../components/TrayProvider').TrayData) => void;
3
3
  close: (id: string) => void;
4
4
  };
@@ -1,10 +1,14 @@
1
- import { useTrayContext } from './useTrayContext';
2
- export var useTray = function useTray() {
3
- var _useTrayContext = useTrayContext(),
4
- openTray = _useTrayContext.openTray,
5
- closeTray = _useTrayContext.closeTray;
1
+ import { useTrayContext } from "./useTrayContext.js";
2
+ const useTray = () => {
3
+ const {
4
+ openTray,
5
+ closeTray
6
+ } = useTrayContext();
6
7
  return {
7
8
  open: openTray,
8
9
  close: closeTray
9
10
  };
10
- };
11
+ };
12
+ export {
13
+ useTray
14
+ };
@@ -1,2 +1,2 @@
1
- import { type TrayContextType } from '../contexts/TrayContext';
1
+ import { TrayContextType } from '../contexts/TrayContext';
2
2
  export declare const useTrayContext: () => TrayContextType;
@@ -1,9 +1,12 @@
1
- import { useContext } from 'react';
2
- import { TrayContext } from '../contexts/TrayContext';
3
- export var useTrayContext = function useTrayContext() {
4
- var context = useContext(TrayContext);
1
+ import { useContext } from "react";
2
+ import { TrayContext } from "../contexts/TrayContext.js";
3
+ const useTrayContext = () => {
4
+ const context = useContext(TrayContext);
5
5
  if (!context) {
6
- throw new Error('useTrayContext must be used within a TrayProvider');
6
+ throw new Error("useTrayContext must be used within a TrayProvider");
7
7
  }
8
8
  return context;
9
- };
9
+ };
10
+ export {
11
+ useTrayContext
12
+ };
package/dist/index.js CHANGED
@@ -1,3 +1,8 @@
1
- export { default } from './Tray';
2
- export { TrayProvider } from './components/TrayProvider';
3
- export { useTray } from './hooks/useTray';
1
+ import { default as default2 } from "./Tray.js";
2
+ import { TrayProvider } from "./components/TrayProvider.js";
3
+ import { useTray } from "./hooks/useTray.js";
4
+ export {
5
+ TrayProvider,
6
+ default2 as default,
7
+ useTray
8
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-tray",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "Tray 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
  "prepublish": "pnpm run build",
25
25
  "types": "tsc --noEmit",
@@ -34,16 +34,16 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^1.5.17",
38
- "@synerise/ds-icon": "^1.15.0",
39
- "@synerise/ds-scrollbar": "^1.2.16",
40
- "@synerise/ds-typography": "^1.1.12",
41
- "@synerise/ds-utils": "^1.7.0"
37
+ "@synerise/ds-button": "^1.5.19",
38
+ "@synerise/ds-icon": "^1.15.2",
39
+ "@synerise/ds-scrollbar": "^1.2.18",
40
+ "@synerise/ds-typography": "^1.1.14",
41
+ "@synerise/ds-utils": "^1.7.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@synerise/ds-core": "*",
45
45
  "react": ">=16.9.0 <= 18.3.1",
46
46
  "styled-components": "^5.3.3"
47
47
  },
48
- "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
48
+ "gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
49
49
  }