@synerise/ds-card-tabs 0.13.69 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
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
+ # [0.14.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card-tabs@0.13.70...@synerise/ds-card-tabs@0.14.0) (2023-10-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * **slider:** add possibility to block allocation handler ([7c8f33c](https://github.com/Synerise/synerise-design/commit/7c8f33c7b2ca2616a53f94370161030e350d16e4))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.13.70](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card-tabs@0.13.69...@synerise/ds-card-tabs@0.13.70) (2023-10-02)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-card-tabs
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.13.69](https://github.com/Synerise/synerise-design/compare/@synerise/ds-card-tabs@0.13.68...@synerise/ds-card-tabs@0.13.69) (2023-09-26)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-card-tabs
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { CardTabProps } from './CardTab.types';
3
- declare const _default: React.ForwardRefExoticComponent<Pick<CardTabProps, "name" | "color" | "id" | "draggable" | "prefix" | "disabled" | "active" | "invalid" | "greyBackground" | "itemData" | "onChangeName" | "onDuplicateTab" | "onRemoveTab" | "onSelectTab" | "tag" | "colorDot" | "prefixIcon" | "suffixIcon" | "invalidName" | "texts" | "actionsAsDropdown" | "renderSuffix"> & {
4
- forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
3
+ declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<CardTabProps, "intl"> & {
4
+ forwardedRef?: React.Ref<any> | undefined;
5
5
  } & React.RefAttributes<any>> & {
6
6
  WrappedComponent: React.ComponentType<CardTabProps>;
7
7
  };
@@ -4,8 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- import * as React from 'react';
8
- import { useState, useMemo, useCallback } from 'react';
7
+ import React, { useState, useMemo, useCallback } from 'react';
9
8
  import Icon from '@synerise/ds-icon';
10
9
  import InlineEdit from '@synerise/ds-inline-edit/dist/InlineEdit';
11
10
  import { injectIntl } from 'react-intl';
@@ -49,10 +48,6 @@ var CardTab = function CardTab(props) {
49
48
  editedName = _useState2[0],
50
49
  setEditedName = _useState2[1];
51
50
 
52
- var _useState3 = useState(false),
53
- pressed = _useState3[0],
54
- setPressed = _useState3[1];
55
-
56
51
  var getTexts = useMemo(function () {
57
52
  return _objectSpread({
58
53
  changeNameTooltip: intl.formatMessage({
@@ -143,7 +138,7 @@ var CardTab = function CardTab(props) {
143
138
  texts: getTexts
144
139
  });
145
140
 
146
- var cardSuffix = useMemo(function () {
141
+ var cardSuffix = function () {
147
142
  var showActionsDropdownMenu = actionsAsDropdown && (onChangeName || handleDuplicate || handleRemove);
148
143
 
149
144
  if (showActionsDropdownMenu) {
@@ -176,9 +171,9 @@ var CardTab = function CardTab(props) {
176
171
  }
177
172
 
178
173
  return /*#__PURE__*/React.createElement(React.Fragment, null);
179
- }, [renderSuffix, suffixProps, actionsAsDropdown, suffixIcon, showCardActions, onChangeName, handleEditName, handleDuplicate, handleRemove, getTexts]);
174
+ }();
175
+
180
176
  return /*#__PURE__*/React.createElement(S.CardTabContainer, {
181
- className: "" + (pressed ? 'pressed' : ''),
182
177
  edited: edited,
183
178
  active: Boolean(active),
184
179
  invalid: Boolean(invalid || invalidName),
@@ -186,18 +181,6 @@ var CardTab = function CardTab(props) {
186
181
  draggable: draggable,
187
182
  color: color,
188
183
  onClick: handleSelect,
189
- onMouseDown: function onMouseDown() {
190
- return setPressed(true);
191
- },
192
- onMouseLeave: !draggable ? function () {
193
- return setPressed(false);
194
- } : undefined,
195
- onMouseUp: function onMouseUp() {
196
- return setPressed(false);
197
- },
198
- onDragEnd: function onDragEnd() {
199
- return setPressed(false);
200
- },
201
184
  greyBackground: !!greyBackground,
202
185
  "data-id": id,
203
186
  "data-testid": "card-tab-container",
@@ -1,4 +1,4 @@
1
- declare type CardTabContainerProps = {
1
+ type CardTabContainerProps = {
2
2
  active: boolean;
3
3
  invalid: boolean;
4
4
  greyBackground: boolean;
@@ -59,7 +59,7 @@ export var CardIconPrefix = styled.div.withConfig({
59
59
  export var CardTabContainer = styled.div.withConfig({
60
60
  displayName: "CardTabstyles__CardTabContainer",
61
61
  componentId: "sc-1n86s98-10"
62
- })(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:12px;width:180px;@media (max-width:588px){max-width:145px;}height:48px;user-select:none;background-color:", ";box-shadow:", ";border-radius:3px;border-width:", ";border-color:", ";border-style:solid;pointer-events:", ";", "{background-color:", ";color:", ";}", "{background-color:", ";}", "{height:", ";width:", ";border-width:", ";border-color:", ";border-style:solid;}", "{svg{color:", ";fill:", " !important;}}", "{svg{color:", " !important;fill:", " !important;}.remove{svg{color:", " !important;fill:", " !important;}}}&:hover{cursor:pointer;box-shadow:", ";background-color:", ";", "{display:", ";}", "{display:", ";}", "{color:", ";}", "{background-color:", ";color:", ";display:", ";}", "{svg{color:", ";fill:", ";}}", "{display:", ";svg{color:", ";fill:", " !important;}}", "{display:", ";}", "{display:", ";svg{color:", ";fill:", ";}}.ds-card-tabs__suffix-icon{svg{color:", ";fill:", " !important;}}}&.pressed{background-color:", ";}", "{input{color:", ";padding:0 !important;background-image:linear-gradient( to right,", " 0%,", " 33%,rgba(255,255,255,0) 34%,rgba(255,255,255,0) 100% ) !important;}}", "{color:", ";opacity:", ";}.ds-card-tabs__suffix-icon{svg{color:", ";fill:", ";}opacity:", ";}", "{opacity:", ";.ds-card-tabs__handle-icon{svg{color:", ";fill:", ";}}svg{color:", ";fill:", ";}", "{opacity:", ";}}"], function (_ref3) {
62
+ })(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:12px;width:180px;@media (max-width:588px){max-width:145px;}height:48px;user-select:none;background-color:", ";box-shadow:", ";border-radius:3px;border-width:", ";border-color:", ";border-style:solid;pointer-events:", ";", "{background-color:", ";color:", ";}", "{background-color:", ";}", "{height:", ";width:", ";border-width:", ";border-color:", ";border-style:solid;}", "{svg{color:", ";fill:", " !important;}}", "{svg{color:", " !important;fill:", " !important;}.remove{svg{color:", " !important;fill:", " !important;}}}&:hover{cursor:pointer;box-shadow:", ";background-color:", ";", "{display:", ";}", "{display:", ";}", "{color:", ";}", "{background-color:", ";color:", ";display:", ";}", "{svg{color:", ";fill:", ";}}", "{display:", ";svg{color:", ";fill:", " !important;}}", "{display:", ";}", "{display:", ";svg{color:", ";fill:", ";}}.ds-card-tabs__suffix-icon{svg{color:", ";fill:", " !important;}}}&:active{background-color:", ";}", "{input{color:", ";padding:0 !important;background-image:linear-gradient( to right,", " 0%,", " 33%,rgba(255,255,255,0) 34%,rgba(255,255,255,0) 100% ) !important;}}", "{color:", ";opacity:", ";}.ds-card-tabs__suffix-icon{svg{color:", ";fill:", ";}opacity:", ";}", "{opacity:", ";.ds-card-tabs__handle-icon{svg{color:", ";fill:", ";}}svg{color:", ";fill:", ";}", "{opacity:", ";}}"], function (_ref3) {
63
63
  var theme = _ref3.theme,
64
64
  active = _ref3.active,
65
65
  invalid = _ref3.invalid,
@@ -7,8 +7,8 @@ export declare enum prefixType {
7
7
  DOT = 2,
8
8
  HANDLE = 3
9
9
  }
10
- export declare type Color = 'red' | 'green' | 'grey' | 'yellow' | 'blue' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
11
- export declare type CardTabTexts = {
10
+ export type Color = 'red' | 'green' | 'grey' | 'yellow' | 'blue' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
11
+ export type CardTabTexts = {
12
12
  changeNameTooltip?: string | ReactNode;
13
13
  removeTooltip?: string | ReactNode;
14
14
  duplicateTooltip?: string | ReactNode;
@@ -41,7 +41,7 @@ export interface CardTabProps {
41
41
  actionsAsDropdown?: boolean;
42
42
  renderSuffix?: (props: CardTabSuffixProps) => ReactNode;
43
43
  }
44
- export declare type CardTabSuffixProps = Omit<CardTabProps & {
44
+ export type CardTabSuffixProps = Omit<CardTabProps & {
45
45
  handleRemove?: (event?: MouseEvent<HTMLElement>) => void;
46
46
  handleDuplicate?: (event?: MouseEvent<HTMLElement>) => void;
47
47
  handleEditName?: (event?: MouseEvent<HTMLElement>) => void;
@@ -1,4 +1,3 @@
1
- import { FC } from 'react';
2
1
  import { CardTabsProps } from './CardTabs.types';
3
- declare const CardTabs: FC<CardTabsProps>;
2
+ declare const CardTabs: ({ className, onChangeOrder, onAddTab, maxTabsCount, children, addTabLabel }: CardTabsProps) => JSX.Element;
4
3
  export default CardTabs;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import type { CardTabProps } from './CardTab/CardTab.types';
3
- export declare type CardTabsProps = {
2
+ export type CardTabsProps = {
4
3
  className?: string;
5
4
  onChangeOrder?: (newOrder: CardTabsItem[]) => void;
6
5
  onAddTab?: () => void;
@@ -8,4 +7,4 @@ export declare type CardTabsProps = {
8
7
  maxTabsCount?: number;
9
8
  children?: JSX.Element[];
10
9
  };
11
- export declare type CardTabsItem = Partial<CardTabProps>;
10
+ export type CardTabsItem = Partial<CardTabProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-card-tabs",
3
- "version": "0.13.69",
3
+ "version": "0.14.0",
4
4
  "description": "CardTabs UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -32,15 +32,15 @@
32
32
  ],
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
- "@synerise/ds-button": "^0.18.2",
36
- "@synerise/ds-cruds": "^0.3.34",
37
- "@synerise/ds-dropdown": "^0.17.80",
38
- "@synerise/ds-icon": "^0.58.2",
39
- "@synerise/ds-inline-edit": "^0.6.80",
40
- "@synerise/ds-menu": "^0.17.19",
41
- "@synerise/ds-tooltip": "^0.14.4",
42
- "@synerise/ds-typography": "^0.13.0",
43
- "@synerise/ds-utils": "^0.24.16",
35
+ "@synerise/ds-button": "^0.18.3",
36
+ "@synerise/ds-cruds": "^0.3.35",
37
+ "@synerise/ds-dropdown": "^0.17.82",
38
+ "@synerise/ds-icon": "^0.58.3",
39
+ "@synerise/ds-inline-edit": "^0.6.82",
40
+ "@synerise/ds-menu": "^0.18.0",
41
+ "@synerise/ds-tooltip": "^0.14.5",
42
+ "@synerise/ds-typography": "^0.13.1",
43
+ "@synerise/ds-utils": "^0.24.17",
44
44
  "react-sortablejs-typescript": "2.0.3"
45
45
  },
46
46
  "peerDependencies": {
@@ -54,5 +54,5 @@
54
54
  "@testing-library/react": "10.0.1",
55
55
  "@testing-library/user-event": "^10.3.1"
56
56
  },
57
- "gitHead": "f1f520c4c5ef9f90bacb5d5e0b2e778ceb8fdf79"
57
+ "gitHead": "d944339a738211d8f74b27360481aafd7ef51ddd"
58
58
  }