glints-aries 4.0.386 → 4.0.388

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.
@@ -8,6 +8,10 @@ export declare type AlertProps = {
8
8
  /** Duration of alert in miliseconds */
9
9
  duration?: number;
10
10
  zIndex?: number;
11
+ position?: {
12
+ top?: string;
13
+ right?: string;
14
+ };
11
15
  onDismissed?: () => void;
12
16
  };
13
17
  export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
@@ -17,6 +17,7 @@ export var Alert = /*#__PURE__*/React.forwardRef(function Alert(_ref, ref) {
17
17
  duration = _ref$duration === void 0 ? 4000 : _ref$duration,
18
18
  children = _ref.children,
19
19
  zIndex = _ref.zIndex,
20
+ position = _ref.position,
20
21
  onDismissed = _ref.onDismissed;
21
22
  useEffect(function () {
22
23
  if (!show) {
@@ -43,7 +44,8 @@ export var Alert = /*#__PURE__*/React.forwardRef(function Alert(_ref, ref) {
43
44
  role: "alert",
44
45
  "data-titled": hasTitle,
45
46
  "data-status": status || 'info',
46
- zIndex: zIndex
47
+ zIndex: zIndex,
48
+ position: position
47
49
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
48
50
  name: iconName
49
51
  })), /*#__PURE__*/React.createElement("div", null, hasTitle && /*#__PURE__*/React.createElement(StyledAlertContentColumn, null, /*#__PURE__*/React.createElement(Typography, {
@@ -1,5 +1,9 @@
1
1
  export declare const StyledAlertContainer: import("styled-components").StyledComponent<"div", any, {
2
2
  zIndex?: number;
3
+ position?: {
4
+ top?: string;
5
+ right?: string;
6
+ };
3
7
  }, never>;
4
8
  export declare const StyledAlertCloseIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
9
  export declare const StyledAlertContentColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -6,7 +6,13 @@ import { space12, space8 } from '../utilities/spacing';
6
6
  export var StyledAlertContainer = styled.div.withConfig({
7
7
  displayName: "AlertStyle__StyledAlertContainer",
8
8
  componentId: "sc-1e5i2kj-0"
9
- })(["position:fixed;top:90px;right:24px;display:flex;padding:", ";gap:", ";max-width:640px;width:fit-content;border-radius:", ";box-shadow:0px 8px 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);animation:slide-from-right 400ms cubic-bezier(0.35,0.8,1,0.86);z-index:", ";color:", ";svg{display:block;height:24px;width:24px;}&[data-titled='true'] svg{margin-top:3px;}&[data-status='success']{background:", ";}&[data-status='success'] svg{fill:", ";}&[data-status='info']{background:", ";}&[data-status='info'] svg{fill:", ";}&[data-status='warning']{background:", ";}&[data-status='warning'] svg{fill:", ";}&[data-status='error']{background:", ";}&[data-status='error'] svg{fill:", ";}@media (max-width:", "){top:60px;&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}padding:", ";min-height:37px;}@media (max-width:480px){&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}max-width:calc(100vw - 48px);}@keyframes slide-from-right{0%{transform:translateX(50px);}50%{transform:translateX(0px);}75%{transform:translateX(-10px);}100%{transform:translateX(0px);}}"], space12, space8, borderRadius4, function (props) {
9
+ })(["position:fixed;top:", ";right:", ";display:flex;padding:", ";gap:", ";max-width:640px;width:fit-content;border-radius:", ";box-shadow:0px 8px 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);animation:slide-from-right 400ms cubic-bezier(0.35,0.8,1,0.86);z-index:", ";color:", ";svg{display:block;height:24px;width:24px;}&[data-titled='true'] svg{margin-top:3px;}&[data-status='success']{background:", ";}&[data-status='success'] svg{fill:", ";}&[data-status='info']{background:", ";}&[data-status='info'] svg{fill:", ";}&[data-status='warning']{background:", ";}&[data-status='warning'] svg{fill:", ";}&[data-status='error']{background:", ";}&[data-status='error'] svg{fill:", ";}@media (max-width:", "){top:60px;&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}padding:", ";min-height:37px;}@media (max-width:480px){&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}max-width:calc(100vw - 48px);}@keyframes slide-from-right{0%{transform:translateX(50px);}50%{transform:translateX(0px);}75%{transform:translateX(-10px);}100%{transform:translateX(0px);}}"], function (props) {
10
+ var _props$position;
11
+ return (_props$position = props.position) != null && _props$position.top ? props.position.top : '90px';
12
+ }, function (props) {
13
+ var _props$position2;
14
+ return (_props$position2 = props.position) != null && _props$position2.right ? props.position.right : '24px';
15
+ }, space12, space8, borderRadius4, function (props) {
10
16
  return props.zIndex ? props.zIndex : 100;
11
17
  }, Neutral.B18, Green.B89, Green.B61, Blue.S08, Blue.S99, Orange.S21, Orange.S86, Red.B100, Red.B93, Breakpoints.large, space8);
12
18
  export var StyledAlertCloseIconContainer = styled.div.withConfig({
@@ -3,6 +3,7 @@ export declare type TabProps = {
3
3
  content: React.ReactNode;
4
4
  id?: string;
5
5
  selected?: boolean;
6
+ disabled?: boolean;
6
7
  onSelect: () => void;
7
8
  };
8
- export declare const Tab: ({ content, id, selected, onSelect }: TabProps) => JSX.Element;
9
+ export declare const Tab: ({ content, id, selected, disabled, onSelect, }: TabProps) => JSX.Element;
@@ -5,9 +5,12 @@ export var Tab = function Tab(_ref) {
5
5
  var content = _ref.content,
6
6
  id = _ref.id,
7
7
  selected = _ref.selected,
8
+ _ref$disabled = _ref.disabled,
9
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
8
10
  onSelect = _ref.onSelect;
9
11
  var tabRef = useRef(null);
10
12
  var handleClick = function handleClick(event) {
13
+ if (disabled) return;
11
14
  event.preventDefault();
12
15
  tabRef.current.scrollIntoView({
13
16
  behavior: 'smooth'
@@ -17,6 +20,7 @@ export var Tab = function Tab(_ref) {
17
20
  return /*#__PURE__*/React.createElement(StyledTabButton, {
18
21
  ref: tabRef,
19
22
  "data-selected": selected,
23
+ "data-disabled": disabled,
20
24
  id: id,
21
25
  onClick: handleClick
22
26
  }, /*#__PURE__*/React.createElement(StyledSpan, null, /*#__PURE__*/React.createElement(Typography, {
@@ -25,4 +25,4 @@ export var StyledSpan = styled.span.withConfig({
25
25
  export var StyledTabButton = styled.button.withConfig({
26
26
  displayName: "TabStyle__StyledTabButton",
27
27
  componentId: "sc-3xj4eu-5"
28
- })(["border:0;background:transparent;height:56px;cursor:pointer;color:", ";width:100%;padding:0 ", ";&:hover{color:", ";}&:hover span::before{background:", ";}&[data-selected='true']{color:", ";}&[data-selected='true'] > span::before{background:", ";}@media (max-width:", "){height:48px;}"], Neutral.B40, space4, Neutral.B18, Blue.S100, Blue.S99, Blue.S99, Breakpoints.large);
28
+ })(["border:0;background:transparent;height:56px;cursor:default;color:", ";width:100%;padding:0 ", ";&[data-disabled='false']{cursor:pointer;&:hover{color:", ";}&:hover span::before{background:", ";}}&&&[data-selected='true']{color:", ";}&&&[data-selected='true'] > span::before{background:", ";}@media (max-width:", "){height:48px;}"], Neutral.B40, space4, Neutral.B18, Blue.S100, Blue.S99, Blue.S99, Breakpoints.large);
@@ -1,9 +1,12 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  export declare type TabModel = {
3
3
  /** Id of the tab, a random id will nbe assigned if empty */
4
4
  id?: string;
5
5
  /** Content of the type header */
6
6
  content: React.ReactNode;
7
+ disabled?: boolean;
8
+ /** The contentWrapper will be a wrapper component for the content */
9
+ contentWrapper?: (children: ReactNode) => ReactNode;
7
10
  };
8
11
  export declare type TabsProps = {
9
12
  /** TabModel has 2 properties
@@ -77,18 +77,20 @@ export var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(_ref, ref) {
77
77
  };
78
78
  var renderTabs = tabs.map(function (tab, index) {
79
79
  var tabId = tab.id || nextId();
80
- return /*#__PURE__*/React.createElement(StyledLi, {
81
- key: tabId + "-" + index,
82
- className: "tab-item"
83
- }, /*#__PURE__*/React.createElement(Tab, {
80
+ var tabContent = /*#__PURE__*/React.createElement(Tab, {
84
81
  id: tabId,
85
82
  key: "tab-" + tabId + "-" + index,
86
83
  content: tab.content,
87
84
  onSelect: function onSelect() {
88
85
  return handleSelectedIndexChanged(index);
89
86
  },
90
- selected: index === selectedTabIndex
91
- }));
87
+ selected: index === selectedTabIndex,
88
+ disabled: tab.disabled
89
+ });
90
+ return /*#__PURE__*/React.createElement(StyledLi, {
91
+ key: tabId + "-" + index,
92
+ className: "tab-item"
93
+ }, tab.contentWrapper ? tab.contentWrapper(tabContent) : tabContent);
92
94
  });
93
95
  return /*#__PURE__*/React.createElement(StyledTabsContainer, {
94
96
  ref: ref,
@@ -3,3 +3,5 @@ declare const _default: Meta<import("@storybook/react").Args>;
3
3
  export default _default;
4
4
  export declare const Interactive: any;
5
5
  export declare const Overflow: any;
6
+ export declare const Disabled: any;
7
+ export declare const CustomWrapper: any;
@@ -8,6 +8,10 @@ export declare type AlertProps = {
8
8
  /** Duration of alert in miliseconds */
9
9
  duration?: number;
10
10
  zIndex?: number;
11
+ position?: {
12
+ top?: string;
13
+ right?: string;
14
+ };
11
15
  onDismissed?: () => void;
12
16
  };
13
17
  export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
@@ -23,6 +23,7 @@ var Alert = /*#__PURE__*/_react["default"].forwardRef(function Alert(_ref, ref)
23
23
  duration = _ref$duration === void 0 ? 4000 : _ref$duration,
24
24
  children = _ref.children,
25
25
  zIndex = _ref.zIndex,
26
+ position = _ref.position,
26
27
  onDismissed = _ref.onDismissed;
27
28
  (0, _react.useEffect)(function () {
28
29
  if (!show) {
@@ -49,7 +50,8 @@ var Alert = /*#__PURE__*/_react["default"].forwardRef(function Alert(_ref, ref)
49
50
  role: "alert",
50
51
  "data-titled": hasTitle,
51
52
  "data-status": status || 'info',
52
- zIndex: zIndex
53
+ zIndex: zIndex,
54
+ position: position
53
55
  }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
54
56
  name: iconName
55
57
  })), /*#__PURE__*/_react["default"].createElement("div", null, hasTitle && /*#__PURE__*/_react["default"].createElement(_AlertStyle.StyledAlertContentColumn, null, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
@@ -1,5 +1,9 @@
1
1
  export declare const StyledAlertContainer: import("styled-components").StyledComponent<"div", any, {
2
2
  zIndex?: number;
3
+ position?: {
4
+ top?: string;
5
+ right?: string;
6
+ };
3
7
  }, never>;
4
8
  export declare const StyledAlertCloseIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
9
  export declare const StyledAlertContentColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -13,7 +13,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
13
13
  var StyledAlertContainer = _styledComponents["default"].div.withConfig({
14
14
  displayName: "AlertStyle__StyledAlertContainer",
15
15
  componentId: "sc-1e5i2kj-0"
16
- })(["position:fixed;top:90px;right:24px;display:flex;padding:", ";gap:", ";max-width:640px;width:fit-content;border-radius:", ";box-shadow:0px 8px 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);animation:slide-from-right 400ms cubic-bezier(0.35,0.8,1,0.86);z-index:", ";color:", ";svg{display:block;height:24px;width:24px;}&[data-titled='true'] svg{margin-top:3px;}&[data-status='success']{background:", ";}&[data-status='success'] svg{fill:", ";}&[data-status='info']{background:", ";}&[data-status='info'] svg{fill:", ";}&[data-status='warning']{background:", ";}&[data-status='warning'] svg{fill:", ";}&[data-status='error']{background:", ";}&[data-status='error'] svg{fill:", ";}@media (max-width:", "){top:60px;&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}padding:", ";min-height:37px;}@media (max-width:480px){&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}max-width:calc(100vw - 48px);}@keyframes slide-from-right{0%{transform:translateX(50px);}50%{transform:translateX(0px);}75%{transform:translateX(-10px);}100%{transform:translateX(0px);}}"], _spacing.space12, _spacing.space8, _borderRadius.borderRadius4, function (props) {
16
+ })(["position:fixed;top:", ";right:", ";display:flex;padding:", ";gap:", ";max-width:640px;width:fit-content;border-radius:", ";box-shadow:0px 8px 20px rgba(71,71,71,0.2),0px 3px 6px -3px rgba(71,71,71,0.08);animation:slide-from-right 400ms cubic-bezier(0.35,0.8,1,0.86);z-index:", ";color:", ";svg{display:block;height:24px;width:24px;}&[data-titled='true'] svg{margin-top:3px;}&[data-status='success']{background:", ";}&[data-status='success'] svg{fill:", ";}&[data-status='info']{background:", ";}&[data-status='info'] svg{fill:", ";}&[data-status='warning']{background:", ";}&[data-status='warning'] svg{fill:", ";}&[data-status='error']{background:", ";}&[data-status='error'] svg{fill:", ";}@media (max-width:", "){top:60px;&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}padding:", ";min-height:37px;}@media (max-width:480px){&[data-titled='true']{margin-top:-1px;}&[data-titled='true'] svg{margin-top:0;}max-width:calc(100vw - 48px);}@keyframes slide-from-right{0%{transform:translateX(50px);}50%{transform:translateX(0px);}75%{transform:translateX(-10px);}100%{transform:translateX(0px);}}"], function (props) {
17
+ var _props$position;
18
+ return (_props$position = props.position) != null && _props$position.top ? props.position.top : '90px';
19
+ }, function (props) {
20
+ var _props$position2;
21
+ return (_props$position2 = props.position) != null && _props$position2.right ? props.position.right : '24px';
22
+ }, _spacing.space12, _spacing.space8, _borderRadius.borderRadius4, function (props) {
17
23
  return props.zIndex ? props.zIndex : 100;
18
24
  }, _colors.Neutral.B18, _colors.Green.B89, _colors.Green.B61, _colors.Blue.S08, _colors.Blue.S99, _colors.Orange.S21, _colors.Orange.S86, _colors.Red.B100, _colors.Red.B93, Breakpoints.large, _spacing.space8);
19
25
  exports.StyledAlertContainer = StyledAlertContainer;
@@ -3,6 +3,7 @@ export declare type TabProps = {
3
3
  content: React.ReactNode;
4
4
  id?: string;
5
5
  selected?: boolean;
6
+ disabled?: boolean;
6
7
  onSelect: () => void;
7
8
  };
8
- export declare const Tab: ({ content, id, selected, onSelect }: TabProps) => JSX.Element;
9
+ export declare const Tab: ({ content, id, selected, disabled, onSelect, }: TabProps) => JSX.Element;
@@ -11,9 +11,12 @@ var Tab = function Tab(_ref) {
11
11
  var content = _ref.content,
12
12
  id = _ref.id,
13
13
  selected = _ref.selected,
14
+ _ref$disabled = _ref.disabled,
15
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
14
16
  onSelect = _ref.onSelect;
15
17
  var tabRef = (0, _react.useRef)(null);
16
18
  var handleClick = function handleClick(event) {
19
+ if (disabled) return;
17
20
  event.preventDefault();
18
21
  tabRef.current.scrollIntoView({
19
22
  behavior: 'smooth'
@@ -23,6 +26,7 @@ var Tab = function Tab(_ref) {
23
26
  return /*#__PURE__*/_react["default"].createElement(_TabStyle.StyledTabButton, {
24
27
  ref: tabRef,
25
28
  "data-selected": selected,
29
+ "data-disabled": disabled,
26
30
  id: id,
27
31
  onClick: handleClick
28
32
  }, /*#__PURE__*/_react["default"].createElement(_TabStyle.StyledSpan, null, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
@@ -37,5 +37,5 @@ exports.StyledSpan = StyledSpan;
37
37
  var StyledTabButton = _styledComponents["default"].button.withConfig({
38
38
  displayName: "TabStyle__StyledTabButton",
39
39
  componentId: "sc-3xj4eu-5"
40
- })(["border:0;background:transparent;height:56px;cursor:pointer;color:", ";width:100%;padding:0 ", ";&:hover{color:", ";}&:hover span::before{background:", ";}&[data-selected='true']{color:", ";}&[data-selected='true'] > span::before{background:", ";}@media (max-width:", "){height:48px;}"], _colors.Neutral.B40, _spacing.space4, _colors.Neutral.B18, _colors.Blue.S100, _colors.Blue.S99, _colors.Blue.S99, Breakpoints.large);
40
+ })(["border:0;background:transparent;height:56px;cursor:default;color:", ";width:100%;padding:0 ", ";&[data-disabled='false']{cursor:pointer;&:hover{color:", ";}&:hover span::before{background:", ";}}&&&[data-selected='true']{color:", ";}&&&[data-selected='true'] > span::before{background:", ";}@media (max-width:", "){height:48px;}"], _colors.Neutral.B40, _spacing.space4, _colors.Neutral.B18, _colors.Blue.S100, _colors.Blue.S99, _colors.Blue.S99, Breakpoints.large);
41
41
  exports.StyledTabButton = StyledTabButton;
@@ -1,9 +1,12 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  export declare type TabModel = {
3
3
  /** Id of the tab, a random id will nbe assigned if empty */
4
4
  id?: string;
5
5
  /** Content of the type header */
6
6
  content: React.ReactNode;
7
+ disabled?: boolean;
8
+ /** The contentWrapper will be a wrapper component for the content */
9
+ contentWrapper?: (children: ReactNode) => ReactNode;
7
10
  };
8
11
  export declare type TabsProps = {
9
12
  /** TabModel has 2 properties
@@ -84,18 +84,20 @@ var Tabs = /*#__PURE__*/_react["default"].forwardRef(function Tabs(_ref, ref) {
84
84
  };
85
85
  var renderTabs = tabs.map(function (tab, index) {
86
86
  var tabId = tab.id || (0, _reactIdGenerator["default"])();
87
- return /*#__PURE__*/_react["default"].createElement(_TabStyle.StyledLi, {
88
- key: tabId + "-" + index,
89
- className: "tab-item"
90
- }, /*#__PURE__*/_react["default"].createElement(_Tab.Tab, {
87
+ var tabContent = /*#__PURE__*/_react["default"].createElement(_Tab.Tab, {
91
88
  id: tabId,
92
89
  key: "tab-" + tabId + "-" + index,
93
90
  content: tab.content,
94
91
  onSelect: function onSelect() {
95
92
  return handleSelectedIndexChanged(index);
96
93
  },
97
- selected: index === selectedTabIndex
98
- }));
94
+ selected: index === selectedTabIndex,
95
+ disabled: tab.disabled
96
+ });
97
+ return /*#__PURE__*/_react["default"].createElement(_TabStyle.StyledLi, {
98
+ key: tabId + "-" + index,
99
+ className: "tab-item"
100
+ }, tab.contentWrapper ? tab.contentWrapper(tabContent) : tabContent);
99
101
  });
100
102
  return /*#__PURE__*/_react["default"].createElement(_TabStyle.StyledTabsContainer, {
101
103
  ref: ref,
@@ -3,3 +3,5 @@ declare const _default: Meta<import("@storybook/react").Args>;
3
3
  export default _default;
4
4
  export declare const Interactive: any;
5
5
  export declare const Overflow: any;
6
+ export declare const Disabled: any;
7
+ export declare const CustomWrapper: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glints-aries",
3
- "version": "4.0.386",
3
+ "version": "4.0.388",
4
4
  "description": "Glints ui-kit for frontend",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",