@teamturing/react-kit 2.19.29 → 2.19.31

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,16 +8,18 @@ import { DialogHeaderTitleProps } from './DialogHeaderTitle';
8
8
  import { UnstyledDialogBodyProps } from './_UnstyledDialogBody';
9
9
  import { UnstyledDialogFooterProps } from './_UnstyledDialogFooter';
10
10
  import { UnstyledDialogHeaderProps } from './_UnstyledDialogHeader';
11
- type DialogSizeType = 'l' | 'm' | 's';
11
+ type DialogSizeType = 'full' | 'l' | 'm' | 's';
12
12
  type Props = {
13
13
  isOpen?: boolean;
14
14
  onDismiss?: () => void;
15
+ isOutsideClickDismissable?: boolean;
15
16
  size?: DialogSizeType;
16
17
  initialFocusRef?: RefObject<HTMLElement>;
17
18
  } & SxProp;
18
19
  declare const _default: import("react").ForwardRefExoticComponent<{
19
20
  isOpen?: boolean | undefined;
20
21
  onDismiss?: (() => void) | undefined;
22
+ isOutsideClickDismissable?: boolean | undefined;
21
23
  size?: DialogSizeType | undefined;
22
24
  initialFocusRef?: RefObject<HTMLElement> | undefined;
23
25
  } & SxProp & {
@@ -1,9 +1,10 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ComponentType, PropsWithChildren, SVGProps } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
- type FlashVariantType = 'danger';
3
+ type FlashVariantType = 'neutral' | 'danger';
4
4
  type Props = {
5
5
  variant?: FlashVariantType;
6
+ icon?: ComponentType<SVGProps<SVGSVGElement>>;
6
7
  } & SxProp;
7
- declare const Flash: ({ variant, children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
8
+ declare const Flash: ({ variant, icon: Icon, children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
8
9
  export default Flash;
9
10
  export type { Props as FlashProps };
package/dist/index.js CHANGED
@@ -19002,6 +19002,7 @@ const Dialog = ({
19002
19002
  children,
19003
19003
  isOpen,
19004
19004
  onDismiss,
19005
+ isOutsideClickDismissable = true,
19005
19006
  size = 'm',
19006
19007
  initialFocusRef,
19007
19008
  sx
@@ -19030,13 +19031,13 @@ const Dialog = ({
19030
19031
  disabled: !isOpen
19031
19032
  });
19032
19033
  React.useEffect(() => {
19033
- if (isOpen) {
19034
+ if (isOpen && isOutsideClickDismissable) {
19034
19035
  document.addEventListener('click', handleOutsideClick);
19035
19036
  return () => {
19036
19037
  document.removeEventListener('click', handleOutsideClick);
19037
19038
  };
19038
19039
  }
19039
- }, [isOpen, handleOutsideClick]);
19040
+ }, [isOpen, isOutsideClickDismissable, handleOutsideClick]);
19040
19041
  return isOpen ? /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
19041
19042
  sx: {
19042
19043
  position: 'fixed',
@@ -19077,6 +19078,12 @@ const Dialog = ({
19077
19078
  marginX: [0, 0, 'auto'],
19078
19079
  marginY: 'auto',
19079
19080
  borderRadius: ['none', 'none', 'l']
19081
+ } : size === 'full' ? {
19082
+ height: ['100%', '100%', 'calc(100vh - 40px)'],
19083
+ width: ['100%', '100%', 'calc(100vw - 40px)'],
19084
+ marginX: [0, 0, 'auto'],
19085
+ marginY: 'auto',
19086
+ borderRadius: ['none', 'none', 'l']
19080
19087
  } : {}),
19081
19088
  ...sx
19082
19089
  },
@@ -19238,14 +19245,15 @@ const BaseEmptyState = styled__default.default.div`
19238
19245
  `;
19239
19246
 
19240
19247
  const Flash = ({
19241
- variant = 'danger',
19248
+ variant = 'neutral',
19249
+ icon: Icon = SvgInfoInCircle,
19242
19250
  children,
19243
19251
  ...props
19244
19252
  }) => {
19245
19253
  return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseFlash, {
19246
19254
  variant: variant,
19247
19255
  ...props,
19248
- children: [variant === 'danger' ? /*#__PURE__*/jsxRuntimeExports.jsx(SvgWarning, {}) : null, children]
19256
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(Icon, {}), children]
19249
19257
  });
19250
19258
  };
19251
19259
  const BaseFlash = styled__default.default.div`
@@ -19264,6 +19272,20 @@ const BaseFlash = styled__default.default.div`
19264
19272
  ${variant({
19265
19273
  prop: 'variant',
19266
19274
  variants: {
19275
+ neutral: {
19276
+ 'display': 'flex',
19277
+ 'flexDirection': 'row',
19278
+ 'alignItems': 'center',
19279
+ 'padding': 4,
19280
+ 'fontSize': 'xs',
19281
+ 'fontWeight': 'medium',
19282
+ 'lineHeight': 2,
19283
+ 'color': 'text/neutral',
19284
+ 'backgroundColor': 'bg/neutral',
19285
+ '& > svg': {
19286
+ color: 'icon/neutral/bold'
19287
+ }
19288
+ },
19267
19289
  danger: {
19268
19290
  'display': 'flex',
19269
19291
  'flexDirection': 'row',
@@ -22,6 +22,7 @@ const Dialog = ({
22
22
  children,
23
23
  isOpen,
24
24
  onDismiss,
25
+ isOutsideClickDismissable = true,
25
26
  size = 'm',
26
27
  initialFocusRef,
27
28
  sx
@@ -50,13 +51,13 @@ const Dialog = ({
50
51
  disabled: !isOpen
51
52
  });
52
53
  useEffect(() => {
53
- if (isOpen) {
54
+ if (isOpen && isOutsideClickDismissable) {
54
55
  document.addEventListener('click', handleOutsideClick);
55
56
  return () => {
56
57
  document.removeEventListener('click', handleOutsideClick);
57
58
  };
58
59
  }
59
- }, [isOpen, handleOutsideClick]);
60
+ }, [isOpen, isOutsideClickDismissable, handleOutsideClick]);
60
61
  return isOpen ? /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
61
62
  sx: {
62
63
  position: 'fixed',
@@ -97,6 +98,12 @@ const Dialog = ({
97
98
  marginX: [0, 0, 'auto'],
98
99
  marginY: 'auto',
99
100
  borderRadius: ['none', 'none', 'l']
101
+ } : size === 'full' ? {
102
+ height: ['100%', '100%', 'calc(100vh - 40px)'],
103
+ width: ['100%', '100%', 'calc(100vw - 40px)'],
104
+ marginX: [0, 0, 'auto'],
105
+ marginY: 'auto',
106
+ borderRadius: ['none', 'none', 'l']
100
107
  } : {}),
101
108
  ...sx
102
109
  },
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
- import SvgWarning from '../../packages/icons/esm/Warning.js';
2
+ import SvgInfoInCircle from '../../packages/icons/esm/InfoInCircle.js';
3
3
  import { forcePixelValue } from '../../packages/utils/esm/forcePixelValue.js';
4
4
  import styled from 'styled-components';
5
5
  import '../../node_modules/styled-system/dist/index.esm.js';
@@ -8,14 +8,15 @@ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js'
8
8
  import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
9
9
 
10
10
  const Flash = ({
11
- variant = 'danger',
11
+ variant = 'neutral',
12
+ icon: Icon = SvgInfoInCircle,
12
13
  children,
13
14
  ...props
14
15
  }) => {
15
16
  return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseFlash, {
16
17
  variant: variant,
17
18
  ...props,
18
- children: [variant === 'danger' ? /*#__PURE__*/jsxRuntimeExports.jsx(SvgWarning, {}) : null, children]
19
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(Icon, {}), children]
19
20
  });
20
21
  };
21
22
  const BaseFlash = styled.div`
@@ -34,6 +35,20 @@ const BaseFlash = styled.div`
34
35
  ${variant({
35
36
  prop: 'variant',
36
37
  variants: {
38
+ neutral: {
39
+ 'display': 'flex',
40
+ 'flexDirection': 'row',
41
+ 'alignItems': 'center',
42
+ 'padding': 4,
43
+ 'fontSize': 'xs',
44
+ 'fontWeight': 'medium',
45
+ 'lineHeight': 2,
46
+ 'color': 'text/neutral',
47
+ 'backgroundColor': 'bg/neutral',
48
+ '& > svg': {
49
+ color: 'icon/neutral/bold'
50
+ }
51
+ },
37
52
  danger: {
38
53
  'display': 'flex',
39
54
  'flexDirection': 'row',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.19.29",
3
+ "version": "2.19.31",
4
4
  "description": "React components, hooks for create teamturing web application",
5
5
  "author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
6
6
  "homepage": "https://github.com/weareteamturing/bombe#readme",
@@ -65,5 +65,5 @@
65
65
  "react-textarea-autosize": "^8.5.3",
66
66
  "styled-system": "^5.1.5"
67
67
  },
68
- "gitHead": "1a074f05104380da3b4f6e89d94c4853870dd489"
68
+ "gitHead": "fafd0ad315a50e2779a033af6f92420eb9b49a0f"
69
69
  }