@teamturing/react-kit 2.19.12 → 2.19.13

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.
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { SxProp } from '../../utils/styled-system';
3
+ type FlashVariantType = 'danger';
4
+ type Props = {
5
+ variant?: FlashVariantType;
6
+ } & SxProp;
7
+ declare const Flash: ({ variant, children, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
8
+ export default Flash;
9
+ export type { Props as FlashProps };
package/dist/index.d.ts CHANGED
@@ -27,6 +27,8 @@ export { default as Dialog } from './core/Dialog';
27
27
  export type { DialogProps, UnstyledDialogHeaderProps, UnstyledDialogBodyProps, UnstyledDialogFooterProps, DialogHeaderProps, DialogHeaderTitleProps, DialogHeaderSubtitleProps, DialogBodyProps, DialogFooterProps, } from './core/Dialog';
28
28
  export { default as EmptyState } from './core/EmptyState';
29
29
  export type { EmptyStateProps } from './core/EmptyState';
30
+ export { default as Flash } from './core/Flash';
31
+ export type { FlashProps } from './core/Flash';
30
32
  export { default as FormControl } from './core/FormControl';
31
33
  export type { FormControlProps, FormControlFieldProps, FormControlCaptionProps, FormControlErrorMessageProps, FormControlLabelProps, FormControlSuccessMessageProps, } from './core/FormControl';
32
34
  export { default as GradientText } from './core/GradientText';
package/dist/index.js CHANGED
@@ -19102,6 +19102,53 @@ const BaseEmptyState = styled__default.default.div`
19102
19102
  ${sx}
19103
19103
  `;
19104
19104
 
19105
+ const Flash = ({
19106
+ variant = 'danger',
19107
+ children,
19108
+ ...props
19109
+ }) => {
19110
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseFlash, {
19111
+ variant: variant,
19112
+ ...props,
19113
+ children: [variant === 'danger' ? /*#__PURE__*/jsxRuntimeExports.jsx(SvgWarning, {}) : null, children]
19114
+ });
19115
+ };
19116
+ const BaseFlash = styled__default.default.div`
19117
+ border-radius: ${({
19118
+ theme
19119
+ }) => forcePixelValue(theme.radii.xs)};
19120
+ & > svg {
19121
+ min-width: ${forcePixelValue(16)};
19122
+ height: ${forcePixelValue(16)};
19123
+ margin-right: ${({
19124
+ theme
19125
+ }) => forcePixelValue(theme.space[2])};
19126
+ }
19127
+ word-break: keep-all;
19128
+
19129
+ ${variant({
19130
+ prop: 'variant',
19131
+ variants: {
19132
+ danger: {
19133
+ 'display': 'flex',
19134
+ 'flexDirection': 'row',
19135
+ 'alignItems': 'center',
19136
+ 'padding': 4,
19137
+ 'fontSize': 'xs',
19138
+ 'fontWeight': 'medium',
19139
+ 'lineHeight': 2,
19140
+ 'color': 'text/neutral',
19141
+ 'backgroundColor': 'bg/danger',
19142
+ '& > svg': {
19143
+ color: 'icon/danger'
19144
+ }
19145
+ }
19146
+ }
19147
+ })}
19148
+
19149
+ ${sx}
19150
+ `;
19151
+
19105
19152
  const Overlay = ({
19106
19153
  children,
19107
19154
  isOpen,
@@ -24134,6 +24181,7 @@ exports.DescriptionList = DescriptionList;
24134
24181
  exports.Dialog = index$6;
24135
24182
  exports.EmptyState = EmptyState;
24136
24183
  exports.EnigmaUI = index;
24184
+ exports.Flash = Flash;
24137
24185
  exports.FormControl = index$4;
24138
24186
  exports.GradientText = GradientText;
24139
24187
  exports.Grid = Grid$1;
@@ -0,0 +1,57 @@
1
+ import 'react';
2
+ import SvgWarning from '../../packages/icons/esm/Warning.js';
3
+ import { forcePixelValue } from '../../packages/utils/esm/forcePixelValue.js';
4
+ import styled from 'styled-components';
5
+ import '../../node_modules/styled-system/dist/index.esm.js';
6
+ import { sx } from '../../utils/styled-system/index.js';
7
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
8
+ import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
9
+
10
+ const Flash = ({
11
+ variant = 'danger',
12
+ children,
13
+ ...props
14
+ }) => {
15
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseFlash, {
16
+ variant: variant,
17
+ ...props,
18
+ children: [variant === 'danger' ? /*#__PURE__*/jsxRuntimeExports.jsx(SvgWarning, {}) : null, children]
19
+ });
20
+ };
21
+ const BaseFlash = styled.div`
22
+ border-radius: ${({
23
+ theme
24
+ }) => forcePixelValue(theme.radii.xs)};
25
+ & > svg {
26
+ min-width: ${forcePixelValue(16)};
27
+ height: ${forcePixelValue(16)};
28
+ margin-right: ${({
29
+ theme
30
+ }) => forcePixelValue(theme.space[2])};
31
+ }
32
+ word-break: keep-all;
33
+
34
+ ${variant({
35
+ prop: 'variant',
36
+ variants: {
37
+ danger: {
38
+ 'display': 'flex',
39
+ 'flexDirection': 'row',
40
+ 'alignItems': 'center',
41
+ 'padding': 4,
42
+ 'fontSize': 'xs',
43
+ 'fontWeight': 'medium',
44
+ 'lineHeight': 2,
45
+ 'color': 'text/neutral',
46
+ 'backgroundColor': 'bg/danger',
47
+ '& > svg': {
48
+ color: 'icon/danger'
49
+ }
50
+ }
51
+ }
52
+ })}
53
+
54
+ ${sx}
55
+ `;
56
+
57
+ export { Flash as default };
package/esm/index.js CHANGED
@@ -10,6 +10,7 @@ export { default as Datagrid } from './core/Datagrid/index.js';
10
10
  export { default as DescriptionList } from './core/DescriptionList/index.js';
11
11
  export { default as Dialog } from './core/Dialog/index.js';
12
12
  export { default as EmptyState } from './core/EmptyState/index.js';
13
+ export { default as Flash } from './core/Flash/index.js';
13
14
  export { default as FormControl } from './core/FormControl/index.js';
14
15
  export { default as GradientText } from './core/GradientText/index.js';
15
16
  export { default as Grid } from './core/Grid/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.19.12",
3
+ "version": "2.19.13",
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",
@@ -62,5 +62,5 @@
62
62
  "react-is": "^18.2.0",
63
63
  "styled-system": "^5.1.5"
64
64
  },
65
- "gitHead": "cf4b596b8cb53dc61d532f7d01d6064649004ee3"
65
+ "gitHead": "0f7b13b7bf46b81369e159ad9e89aa7f17ddc7c0"
66
66
  }