@teamturing/react-kit 2.19.3 → 2.19.5

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,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { UnstyledDialogBodyProps } from './_UnstyledDialogBody';
3
+ type Props = {} & UnstyledDialogBodyProps;
4
+ declare const DialogBody: ({ children, sx, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export default DialogBody;
6
+ export type { Props as DialogBodyProps };
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { UnstyledDialogFooterProps } from './_UnstyledDialogFooter';
3
+ type Props = {} & UnstyledDialogFooterProps;
4
+ declare const DialogFooter: ({ children, sx, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export default DialogFooter;
6
+ export type { Props as DialogFooterProps };
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { UnstyledDialogHeaderProps } from './_UnstyledDialogHeader';
3
+ type Props = {} & UnstyledDialogHeaderProps;
4
+ declare const DialogHeader: ({ children, sx, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export default DialogHeader;
6
+ export type { Props as DialogHeaderProps };
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { TextProps } from '../Text';
3
+ type Props = {} & TextProps;
4
+ declare const DialogHeaderSubtitle: ({ typography, color, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export default DialogHeaderSubtitle;
6
+ export type { Props as DialogHeaderSubtitleProps };
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { TextProps } from '../Text';
3
+ type Props = {} & TextProps;
4
+ declare const DialogHeaderTitle: ({ typography, color, ...props }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export default DialogHeaderTitle;
6
+ export type { Props as DialogHeaderTitleProps };
@@ -0,0 +1,6 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { SxProp } from '../../utils/styled-system';
3
+ type Props = {} & HTMLAttributes<HTMLDivElement> & SxProp;
4
+ declare const UnstyledDialogBody: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Props>>;
5
+ export default UnstyledDialogBody;
6
+ export type { Props as UnstyledDialogBodyProps };
@@ -0,0 +1,6 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { SxProp } from '../../utils/styled-system';
3
+ type Props = {} & HTMLAttributes<HTMLDivElement> & SxProp;
4
+ declare const UnstyledDialogFooter: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Props>>;
5
+ export default UnstyledDialogFooter;
6
+ export type { Props as UnstyledDialogFooterProps };
@@ -0,0 +1,6 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { SxProp } from '../../utils/styled-system';
3
+ type Props = {} & HTMLAttributes<HTMLDivElement> & SxProp;
4
+ declare const UnstyledDialogHeader: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Props>>;
5
+ export default UnstyledDialogHeader;
6
+ export type { Props as UnstyledDialogHeaderProps };
@@ -1,16 +1,34 @@
1
- /// <reference types="react" />
1
+ import { PropsWithChildren } from 'react';
2
2
  import { SxProp } from '../../utils/styled-system';
3
+ import { DialogBodyProps } from './DialogBody';
4
+ import { DialogFooterProps } from './DialogFooter';
5
+ import { DialogHeaderProps } from './DialogHeader';
6
+ import { DialogHeaderSubtitleProps } from './DialogHeaderSubtitle';
7
+ import { DialogHeaderTitleProps } from './DialogHeaderTitle';
8
+ import { UnstyledDialogBodyProps } from './_UnstyledDialogBody';
9
+ import { UnstyledDialogFooterProps } from './_UnstyledDialogFooter';
10
+ import { UnstyledDialogHeaderProps } from './_UnstyledDialogHeader';
11
+ type DialogSizeType = 'l' | 'm' | 's';
3
12
  type Props = {
4
13
  isOpen?: boolean;
5
14
  onDismiss?: () => void;
6
- size?: 'l' | 's';
15
+ size?: DialogSizeType;
7
16
  } & SxProp;
8
17
  declare const _default: import("react").ForwardRefExoticComponent<{
9
18
  isOpen?: boolean | undefined;
10
19
  onDismiss?: (() => void) | undefined;
11
- size?: "s" | "l" | undefined;
20
+ size?: DialogSizeType | undefined;
12
21
  } & SxProp & {
13
22
  children?: import("react").ReactNode;
14
- } & import("react").RefAttributes<HTMLDivElement>>;
23
+ } & import("react").RefAttributes<HTMLDivElement>> & {
24
+ UnstyledHeader: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, UnstyledDialogHeaderProps>>;
25
+ UnstyledBody: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, UnstyledDialogBodyProps>>;
26
+ UnstyledFooter: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, UnstyledDialogFooterProps>>;
27
+ Header: ({ children, sx, ...props }: PropsWithChildren<DialogHeaderProps>) => import("react/jsx-runtime").JSX.Element;
28
+ HeaderTitle: ({ typography, color, ...props }: PropsWithChildren<DialogHeaderTitleProps>) => import("react/jsx-runtime").JSX.Element;
29
+ HeaderSubtitle: ({ typography, color, ...props }: PropsWithChildren<DialogHeaderSubtitleProps>) => import("react/jsx-runtime").JSX.Element;
30
+ Body: ({ children, sx, ...props }: PropsWithChildren<DialogBodyProps>) => import("react/jsx-runtime").JSX.Element;
31
+ Footer: ({ children, sx, ...props }: PropsWithChildren<DialogFooterProps>) => import("react/jsx-runtime").JSX.Element;
32
+ };
15
33
  export default _default;
16
- export type { Props as DialogProps };
34
+ export type { Props as DialogProps, UnstyledDialogHeaderProps, UnstyledDialogBodyProps, UnstyledDialogFooterProps, DialogHeaderProps, DialogHeaderTitleProps, DialogHeaderSubtitleProps, DialogBodyProps, DialogFooterProps, };
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export type { DatagridProps, DatagridBodyProps, DatagridCellProps, DatagridHeade
24
24
  export { default as DescriptionList } from './core/DescriptionList';
25
25
  export type { DescriptionListProps } from './core/DescriptionList';
26
26
  export { default as Dialog } from './core/Dialog';
27
- export type { DialogProps } from './core/Dialog';
27
+ export type { DialogProps, UnstyledDialogHeaderProps, UnstyledDialogBodyProps, UnstyledDialogFooterProps, DialogHeaderProps, DialogHeaderTitleProps, DialogHeaderSubtitleProps, DialogBodyProps, DialogFooterProps, } from './core/Dialog';
28
28
  export { default as DialogHandler } from './core/DialogHandler';
29
29
  export { default as EmptyState } from './core/EmptyState';
30
30
  export type { EmptyStateProps } from './core/EmptyState';
package/dist/index.js CHANGED
@@ -18691,15 +18691,111 @@ const useFocusTrap = (settings, dependencies = []) => {
18691
18691
 
18692
18692
  const MotionView = motion(View);
18693
18693
 
18694
+ const UnstyledDialogBody = styled__default.default.div`
18695
+ flex-grow: 1;
18696
+ flex-shrink: 1;
18697
+ flex-basis: auto;
18698
+ overflow-y: auto;
18699
+
18700
+ ${sx}
18701
+ `;
18702
+
18703
+ const DialogBody = ({
18704
+ children,
18705
+ sx,
18706
+ ...props
18707
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledDialogBody, {
18708
+ ...props,
18709
+ sx: {
18710
+ p: 5,
18711
+ ...sx
18712
+ },
18713
+ children: children
18714
+ });
18715
+
18716
+ const UnstyledDialogFooter = styled__default.default.div`
18717
+ flex-grow: 0;
18718
+ flex-shrink: 0;
18719
+ flex-basis: auto;
18720
+
18721
+ ${sx}
18722
+ `;
18723
+
18724
+ const DialogFooter = ({
18725
+ children,
18726
+ sx,
18727
+ ...props
18728
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledDialogFooter, {
18729
+ ...props,
18730
+ sx: {
18731
+ display: 'flex',
18732
+ alignItems: 'center',
18733
+ justifyContent: 'flex-end',
18734
+ flexWrap: 'wrap-reverse',
18735
+ px: 5,
18736
+ py: 4,
18737
+ borderTopWidth: 1,
18738
+ borderTopStyle: 'solid',
18739
+ borderTopColor: 'border/neutral',
18740
+ rowGap: 1,
18741
+ columnGap: 2,
18742
+ ...sx
18743
+ },
18744
+ children: children
18745
+ });
18746
+
18747
+ const UnstyledDialogHeader = styled__default.default.div`
18748
+ flex-grow: 0;
18749
+ flex-shrink: 0;
18750
+ flex-basis: auto;
18751
+
18752
+ ${sx}
18753
+ `;
18754
+
18755
+ const DialogHeader = ({
18756
+ children,
18757
+ sx,
18758
+ ...props
18759
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledDialogHeader, {
18760
+ ...props,
18761
+ sx: {
18762
+ px: 5,
18763
+ py: 4,
18764
+ borderBottomWidth: 1,
18765
+ borderBottomStyle: 'solid',
18766
+ borderBottomColor: 'border/neutral',
18767
+ ...sx
18768
+ },
18769
+ children: children
18770
+ });
18771
+
18772
+ const DialogHeaderSubtitle = ({
18773
+ typography = 'xs',
18774
+ color = 'text/neutral/subtler',
18775
+ ...props
18776
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
18777
+ typography: typography,
18778
+ color: color,
18779
+ ...props
18780
+ });
18781
+
18782
+ const DialogHeaderTitle = ({
18783
+ typography = 'm/bold',
18784
+ color = 'text/neutral',
18785
+ ...props
18786
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
18787
+ typography: typography,
18788
+ color: color,
18789
+ ...props
18790
+ });
18791
+
18694
18792
  const Dialog = ({
18695
18793
  children,
18696
18794
  isOpen,
18697
18795
  onDismiss,
18698
- size,
18796
+ size = 'm',
18699
18797
  sx
18700
18798
  }, ref) => {
18701
- const dialogRoot = typeof document !== 'undefined' ? document.getElementById('dialog_root') : null;
18702
- if (dialogRoot === null) return null;
18703
18799
  const handleDismiss = React.useCallback(() => onDismiss?.(), [onDismiss]);
18704
18800
  const overlayRef = React.useRef(null);
18705
18801
  const dialogRef = React.useRef(null);
@@ -18731,13 +18827,6 @@ const Dialog = ({
18731
18827
  };
18732
18828
  }
18733
18829
  }, [isOpen, handleOutsideClick]);
18734
- React.useEffect(() => {
18735
- if (isOpen) {
18736
- if (closeButtonRef && closeButtonRef.current) {
18737
- closeButtonRef.current.focus();
18738
- }
18739
- }
18740
- }, [isOpen, closeButtonRef]);
18741
18830
  return /*#__PURE__*/jsxRuntimeExports.jsx(AnimatePresence, {
18742
18831
  children: isOpen ? /*#__PURE__*/jsxRuntimeExports.jsxs(MotionView, {
18743
18832
  initial: {
@@ -18777,16 +18866,24 @@ const Dialog = ({
18777
18866
  tabIndex: -1,
18778
18867
  sx: {
18779
18868
  ...(size === 's' ? {
18780
- maxHeight: 'calc(100vh - 32px)',
18781
- width: ['100%', 400, 400],
18782
- marginX: [8, 'auto', 'auto'],
18869
+ maxHeight: 'calc(100vh - 64px)',
18870
+ width: ['calc(100% - 64px)', 400, 400],
18871
+ marginX: 'auto',
18783
18872
  marginY: 'auto',
18784
18873
  borderRadius: 'l'
18874
+ } : size === 'm' ? {
18875
+ maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
18876
+ height: ['100%', '100%', 'auto'],
18877
+ minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
18878
+ width: ['100%', '100%', 640],
18879
+ marginX: [0, 0, 'auto'],
18880
+ marginY: 'auto',
18881
+ borderRadius: ['none', 'none', 'l']
18785
18882
  } : size === 'l' ? {
18786
- maxHeight: '100vh',
18883
+ maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
18787
18884
  height: ['100%', '100%', 'auto'],
18788
18885
  minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
18789
- width: ['100%', '100%', 820],
18886
+ width: ['100%', '100%', 860],
18790
18887
  marginX: [0, 0, 'auto'],
18791
18888
  marginY: 'auto',
18792
18889
  borderRadius: ['none', 'none', 'l']
@@ -18797,8 +18894,8 @@ const Dialog = ({
18797
18894
  children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
18798
18895
  sx: {
18799
18896
  position: 'absolute',
18800
- top: 4,
18801
- right: 4
18897
+ top: 3,
18898
+ right: 3
18802
18899
  },
18803
18900
  children: /*#__PURE__*/jsxRuntimeExports.jsx(IconButton, {
18804
18901
  ref: closeButtonRef,
@@ -18826,6 +18923,8 @@ const Blanket = styled__default.default.span`
18826
18923
  }
18827
18924
  `;
18828
18925
  const BaseDialog = styled__default.default.div(() => ({
18926
+ display: 'flex',
18927
+ flexDirection: 'column',
18829
18928
  position: 'relative',
18830
18929
  boxShadow: elevation['shadow/overlay'],
18831
18930
  backgroundColor: elevation['surface/overlay'],
@@ -18833,7 +18932,16 @@ const BaseDialog = styled__default.default.div(() => ({
18833
18932
  overflow: 'hidden',
18834
18933
  margin: 'auto'
18835
18934
  }), sx);
18836
- var index$6 = /*#__PURE__*/React.forwardRef(Dialog);
18935
+ var index$6 = Object.assign( /*#__PURE__*/React.forwardRef(Dialog), {
18936
+ UnstyledHeader: UnstyledDialogHeader,
18937
+ UnstyledBody: UnstyledDialogBody,
18938
+ UnstyledFooter: UnstyledDialogFooter,
18939
+ Header: DialogHeader,
18940
+ HeaderTitle: DialogHeaderTitle,
18941
+ HeaderSubtitle: DialogHeaderSubtitle,
18942
+ Body: DialogBody,
18943
+ Footer: DialogFooter
18944
+ });
18837
18945
 
18838
18946
  const useDialogHandler = () => {
18839
18947
  const [isOpen, setIsOpen] = React.useState(false);
@@ -20809,7 +20917,7 @@ const OverlaySelectInput = ({
20809
20917
  position: 'absolute',
20810
20918
  top: '50%',
20811
20919
  transform: 'translateY(-50%)',
20812
- right: 5,
20920
+ right: 4,
20813
20921
  pointerEvents: 'none'
20814
20922
  },
20815
20923
  icon: SvgChevronDown,
@@ -20916,7 +21024,7 @@ const TextInputWrapper$1 = styled__default.default.div`
20916
21024
  `};
20917
21025
 
20918
21026
  ${props => props.hasLeadingVisual && styled.css`
20919
- padding-left: ${forcePixelValue(props.theme.space[5])};
21027
+ padding-left: ${forcePixelValue(props.theme.space[4])};
20920
21028
  input {
20921
21029
  padding-left: ${forcePixelValue(props.theme.space[2])};
20922
21030
  }
@@ -20946,16 +21054,20 @@ const UnstyledInput$1 = styled__default.default.input`
20946
21054
  const BaseInput$1 = styled__default.default(UnstyledInput$1)`
20947
21055
  padding-top: ${({
20948
21056
  theme
20949
- }) => forcePixelValue(theme.space['4'])};
21057
+ }) => forcePixelValue(theme.space[3])};
20950
21058
  padding-right: ${({
20951
21059
  theme
20952
- }) => forcePixelValue(theme.space['5'])};
21060
+ }) => forcePixelValue(theme.space[10])};
20953
21061
  padding-bottom: ${({
20954
21062
  theme
20955
- }) => forcePixelValue(theme.space['4'])};
21063
+ }) => forcePixelValue(theme.space[3])};
20956
21064
  padding-left: ${({
20957
21065
  theme
20958
- }) => forcePixelValue(theme.space['5'])};
21066
+ }) => forcePixelValue(theme.space[4])};
21067
+
21068
+ white-space: pre;
21069
+ text-overflow: ellipsis;
21070
+ pointer-events: none;
20959
21071
  `;
20960
21072
  var OverlaySelectInput$1 = /*#__PURE__*/React.forwardRef(OverlaySelectInput);
20961
21073
 
@@ -21032,7 +21144,7 @@ const Select = ({
21032
21144
  position: 'absolute',
21033
21145
  top: '50%',
21034
21146
  transform: 'translateY(-50%)',
21035
- right: 5,
21147
+ right: 4,
21036
21148
  pointerEvents: 'none'
21037
21149
  },
21038
21150
  icon: SvgChevronDown,
@@ -21139,7 +21251,7 @@ const SelectWrapper = styled__default.default.div`
21139
21251
  `};
21140
21252
 
21141
21253
  ${props => props.hasLeadingVisual && styled.css`
21142
- padding-left: ${forcePixelValue(props.theme.space[5])};
21254
+ padding-left: ${forcePixelValue(props.theme.space[4])};
21143
21255
  select {
21144
21256
  padding-left: ${forcePixelValue(props.theme.space[2])};
21145
21257
  }
@@ -21173,16 +21285,16 @@ const UnstyledSelect = styled__default.default.select`
21173
21285
  const BaseSelect = styled__default.default(UnstyledSelect)`
21174
21286
  padding-top: ${({
21175
21287
  theme
21176
- }) => forcePixelValue(theme.space['4'])};
21288
+ }) => forcePixelValue(theme.space[3])};
21177
21289
  padding-right: ${({
21178
21290
  theme
21179
- }) => forcePixelValue(theme.space['12'])};
21291
+ }) => forcePixelValue(theme.space[10])};
21180
21292
  padding-bottom: ${({
21181
21293
  theme
21182
- }) => forcePixelValue(theme.space['4'])};
21294
+ }) => forcePixelValue(theme.space[3])};
21183
21295
  padding-left: ${({
21184
21296
  theme
21185
- }) => forcePixelValue(theme.space['5'])};
21297
+ }) => forcePixelValue(theme.space[4])};
21186
21298
 
21187
21299
  white-space: pre;
21188
21300
  text-overflow: ellipsis;
@@ -21399,18 +21511,18 @@ const TextInputWrapper = styled__default.default.div`
21399
21511
  `};
21400
21512
 
21401
21513
  ${props => props.hasLeadingVisual && styled.css`
21402
- padding-left: ${forcePixelValue(props.theme.space[5])};
21514
+ padding-left: ${forcePixelValue(props.theme.space[4])};
21403
21515
  input {
21404
21516
  padding-left: ${forcePixelValue(props.theme.space[2])};
21405
21517
  }
21406
21518
  `}
21407
21519
 
21408
21520
  ${props => props.hasTrailingVisual && styled.css`
21409
- padding-right: ${forcePixelValue(props.theme.space[5])};
21521
+ padding-right: ${forcePixelValue(props.theme.space[4])};
21410
21522
  `}
21411
21523
 
21412
21524
  ${props => props.hasTrailingAction && styled.css`
21413
- padding-right: ${forcePixelValue(props.theme.space[3])};
21525
+ padding-right: ${forcePixelValue(props.theme.space[2])};
21414
21526
  `}
21415
21527
 
21416
21528
  ${props => (props.hasTrailingVisual || props.hasTrailingAction) && styled.css`
@@ -21444,16 +21556,16 @@ const UnstyledInput = styled__default.default.input`
21444
21556
  const BaseInput = styled__default.default(UnstyledInput)`
21445
21557
  padding-top: ${({
21446
21558
  theme
21447
- }) => forcePixelValue(theme.space['4'])};
21559
+ }) => forcePixelValue(theme.space[3])};
21448
21560
  padding-right: ${({
21449
21561
  theme
21450
- }) => forcePixelValue(theme.space['5'])};
21562
+ }) => forcePixelValue(theme.space[4])};
21451
21563
  padding-bottom: ${({
21452
21564
  theme
21453
- }) => forcePixelValue(theme.space['4'])};
21565
+ }) => forcePixelValue(theme.space[3])};
21454
21566
  padding-left: ${({
21455
21567
  theme
21456
- }) => forcePixelValue(theme.space['5'])};
21568
+ }) => forcePixelValue(theme.space[4])};
21457
21569
  `;
21458
21570
  var TextInput$1 = Object.assign( /*#__PURE__*/React.forwardRef(TextInput), {
21459
21571
  TrailingAction: TextInputTrailingAction$1
@@ -23471,16 +23583,16 @@ const TextareaWrapper = styled__default.default.div`
23471
23583
 
23472
23584
  padding-top: ${({
23473
23585
  theme
23474
- }) => forcePixelValue(theme.space['4'])};
23586
+ }) => forcePixelValue(theme.space['3'])};
23475
23587
  padding-right: ${({
23476
23588
  theme
23477
23589
  }) => forcePixelValue(theme.space['4'])};
23478
23590
  padding-bottom: ${({
23479
23591
  theme
23480
- }) => forcePixelValue(theme.space['4'])};
23592
+ }) => forcePixelValue(theme.space['3'])};
23481
23593
  padding-left: ${({
23482
23594
  theme
23483
- }) => forcePixelValue(theme.space['5'])};
23595
+ }) => forcePixelValue(theme.space['4'])};
23484
23596
 
23485
23597
  font-size: ${({
23486
23598
  theme
@@ -0,0 +1,17 @@
1
+ import UnstyledDialogBody from './_UnstyledDialogBody.js';
2
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
3
+
4
+ const DialogBody = ({
5
+ children,
6
+ sx,
7
+ ...props
8
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledDialogBody, {
9
+ ...props,
10
+ sx: {
11
+ p: 5,
12
+ ...sx
13
+ },
14
+ children: children
15
+ });
16
+
17
+ export { DialogBody as default };
@@ -0,0 +1,27 @@
1
+ import UnstyledDialogFooter from './_UnstyledDialogFooter.js';
2
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
3
+
4
+ const DialogFooter = ({
5
+ children,
6
+ sx,
7
+ ...props
8
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledDialogFooter, {
9
+ ...props,
10
+ sx: {
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ justifyContent: 'flex-end',
14
+ flexWrap: 'wrap-reverse',
15
+ px: 5,
16
+ py: 4,
17
+ borderTopWidth: 1,
18
+ borderTopStyle: 'solid',
19
+ borderTopColor: 'border/neutral',
20
+ rowGap: 1,
21
+ columnGap: 2,
22
+ ...sx
23
+ },
24
+ children: children
25
+ });
26
+
27
+ export { DialogFooter as default };
@@ -0,0 +1,21 @@
1
+ import UnstyledDialogHeader from './_UnstyledDialogHeader.js';
2
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
3
+
4
+ const DialogHeader = ({
5
+ children,
6
+ sx,
7
+ ...props
8
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(UnstyledDialogHeader, {
9
+ ...props,
10
+ sx: {
11
+ px: 5,
12
+ py: 4,
13
+ borderBottomWidth: 1,
14
+ borderBottomStyle: 'solid',
15
+ borderBottomColor: 'border/neutral',
16
+ ...sx
17
+ },
18
+ children: children
19
+ });
20
+
21
+ export { DialogHeader as default };
@@ -0,0 +1,14 @@
1
+ import Text from '../Text/index.js';
2
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
3
+
4
+ const DialogHeaderSubtitle = ({
5
+ typography = 'xs',
6
+ color = 'text/neutral/subtler',
7
+ ...props
8
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
9
+ typography: typography,
10
+ color: color,
11
+ ...props
12
+ });
13
+
14
+ export { DialogHeaderSubtitle as default };
@@ -0,0 +1,14 @@
1
+ import Text from '../Text/index.js';
2
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
3
+
4
+ const DialogHeaderTitle = ({
5
+ typography = 'm/bold',
6
+ color = 'text/neutral',
7
+ ...props
8
+ }) => /*#__PURE__*/jsxRuntimeExports.jsx(Text, {
9
+ typography: typography,
10
+ color: color,
11
+ ...props
12
+ });
13
+
14
+ export { DialogHeaderTitle as default };
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components';
2
+ import { sx } from '../../utils/styled-system/index.js';
3
+
4
+ const UnstyledDialogBody = styled.div`
5
+ flex-grow: 1;
6
+ flex-shrink: 1;
7
+ flex-basis: auto;
8
+ overflow-y: auto;
9
+
10
+ ${sx}
11
+ `;
12
+
13
+ export { UnstyledDialogBody as default };
@@ -0,0 +1,12 @@
1
+ import styled from 'styled-components';
2
+ import { sx } from '../../utils/styled-system/index.js';
3
+
4
+ const UnstyledDialogFooter = styled.div`
5
+ flex-grow: 0;
6
+ flex-shrink: 0;
7
+ flex-basis: auto;
8
+
9
+ ${sx}
10
+ `;
11
+
12
+ export { UnstyledDialogFooter as default };
@@ -0,0 +1,12 @@
1
+ import styled from 'styled-components';
2
+ import { sx } from '../../utils/styled-system/index.js';
3
+
4
+ const UnstyledDialogHeader = styled.div`
5
+ flex-grow: 0;
6
+ flex-shrink: 0;
7
+ flex-basis: auto;
8
+
9
+ ${sx}
10
+ `;
11
+
12
+ export { UnstyledDialogHeader as default };
@@ -9,6 +9,14 @@ import View from '../View/index.js';
9
9
  import useFocusTrap from '../../hook/useFocusTrap.js';
10
10
  import { sx } from '../../utils/styled-system/index.js';
11
11
  import MotionView from '../MotionView/index.js';
12
+ import DialogBody from './DialogBody.js';
13
+ import DialogFooter from './DialogFooter.js';
14
+ import DialogHeader from './DialogHeader.js';
15
+ import DialogHeaderSubtitle from './DialogHeaderSubtitle.js';
16
+ import DialogHeaderTitle from './DialogHeaderTitle.js';
17
+ import UnstyledDialogBody from './_UnstyledDialogBody.js';
18
+ import UnstyledDialogFooter from './_UnstyledDialogFooter.js';
19
+ import UnstyledDialogHeader from './_UnstyledDialogHeader.js';
12
20
  import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
13
21
  import { AnimatePresence } from '../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js';
14
22
  import { cubicBezier } from '../../node_modules/framer-motion/dist/es/easing/cubic-bezier.js';
@@ -17,11 +25,9 @@ const Dialog = ({
17
25
  children,
18
26
  isOpen,
19
27
  onDismiss,
20
- size,
28
+ size = 'm',
21
29
  sx
22
30
  }, ref) => {
23
- const dialogRoot = typeof document !== 'undefined' ? document.getElementById('dialog_root') : null;
24
- if (dialogRoot === null) return null;
25
31
  const handleDismiss = useCallback(() => onDismiss?.(), [onDismiss]);
26
32
  const overlayRef = useRef(null);
27
33
  const dialogRef = useRef(null);
@@ -53,13 +59,6 @@ const Dialog = ({
53
59
  };
54
60
  }
55
61
  }, [isOpen, handleOutsideClick]);
56
- useEffect(() => {
57
- if (isOpen) {
58
- if (closeButtonRef && closeButtonRef.current) {
59
- closeButtonRef.current.focus();
60
- }
61
- }
62
- }, [isOpen, closeButtonRef]);
63
62
  return /*#__PURE__*/jsxRuntimeExports.jsx(AnimatePresence, {
64
63
  children: isOpen ? /*#__PURE__*/jsxRuntimeExports.jsxs(MotionView, {
65
64
  initial: {
@@ -99,16 +98,24 @@ const Dialog = ({
99
98
  tabIndex: -1,
100
99
  sx: {
101
100
  ...(size === 's' ? {
102
- maxHeight: 'calc(100vh - 32px)',
103
- width: ['100%', 400, 400],
104
- marginX: [8, 'auto', 'auto'],
101
+ maxHeight: 'calc(100vh - 64px)',
102
+ width: ['calc(100% - 64px)', 400, 400],
103
+ marginX: 'auto',
105
104
  marginY: 'auto',
106
105
  borderRadius: 'l'
106
+ } : size === 'm' ? {
107
+ maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
108
+ height: ['100%', '100%', 'auto'],
109
+ minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
110
+ width: ['100%', '100%', 640],
111
+ marginX: [0, 0, 'auto'],
112
+ marginY: 'auto',
113
+ borderRadius: ['none', 'none', 'l']
107
114
  } : size === 'l' ? {
108
- maxHeight: '100vh',
115
+ maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
109
116
  height: ['100%', '100%', 'auto'],
110
117
  minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
111
- width: ['100%', '100%', 820],
118
+ width: ['100%', '100%', 860],
112
119
  marginX: [0, 0, 'auto'],
113
120
  marginY: 'auto',
114
121
  borderRadius: ['none', 'none', 'l']
@@ -119,8 +126,8 @@ const Dialog = ({
119
126
  children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
120
127
  sx: {
121
128
  position: 'absolute',
122
- top: 4,
123
- right: 4
129
+ top: 3,
130
+ right: 3
124
131
  },
125
132
  children: /*#__PURE__*/jsxRuntimeExports.jsx(IconButton, {
126
133
  ref: closeButtonRef,
@@ -148,6 +155,8 @@ const Blanket = styled.span`
148
155
  }
149
156
  `;
150
157
  const BaseDialog = styled.div(() => ({
158
+ display: 'flex',
159
+ flexDirection: 'column',
151
160
  position: 'relative',
152
161
  boxShadow: elevation['shadow/overlay'],
153
162
  backgroundColor: elevation['surface/overlay'],
@@ -155,6 +164,15 @@ const BaseDialog = styled.div(() => ({
155
164
  overflow: 'hidden',
156
165
  margin: 'auto'
157
166
  }), sx);
158
- var index = /*#__PURE__*/forwardRef(Dialog);
167
+ var index = Object.assign( /*#__PURE__*/forwardRef(Dialog), {
168
+ UnstyledHeader: UnstyledDialogHeader,
169
+ UnstyledBody: UnstyledDialogBody,
170
+ UnstyledFooter: UnstyledDialogFooter,
171
+ Header: DialogHeader,
172
+ HeaderTitle: DialogHeaderTitle,
173
+ HeaderSubtitle: DialogHeaderSubtitle,
174
+ Body: DialogBody,
175
+ Footer: DialogFooter
176
+ });
159
177
 
160
178
  export { index as default };
@@ -85,7 +85,7 @@ const OverlaySelectInput = ({
85
85
  position: 'absolute',
86
86
  top: '50%',
87
87
  transform: 'translateY(-50%)',
88
- right: 5,
88
+ right: 4,
89
89
  pointerEvents: 'none'
90
90
  },
91
91
  icon: SvgChevronDown,
@@ -192,7 +192,7 @@ const TextInputWrapper = styled.div`
192
192
  `};
193
193
 
194
194
  ${props => props.hasLeadingVisual && css`
195
- padding-left: ${forcePixelValue(props.theme.space[5])};
195
+ padding-left: ${forcePixelValue(props.theme.space[4])};
196
196
  input {
197
197
  padding-left: ${forcePixelValue(props.theme.space[2])};
198
198
  }
@@ -222,16 +222,20 @@ const UnstyledInput = styled.input`
222
222
  const BaseInput = styled(UnstyledInput)`
223
223
  padding-top: ${({
224
224
  theme
225
- }) => forcePixelValue(theme.space['4'])};
225
+ }) => forcePixelValue(theme.space[3])};
226
226
  padding-right: ${({
227
227
  theme
228
- }) => forcePixelValue(theme.space['5'])};
228
+ }) => forcePixelValue(theme.space[10])};
229
229
  padding-bottom: ${({
230
230
  theme
231
- }) => forcePixelValue(theme.space['4'])};
231
+ }) => forcePixelValue(theme.space[3])};
232
232
  padding-left: ${({
233
233
  theme
234
- }) => forcePixelValue(theme.space['5'])};
234
+ }) => forcePixelValue(theme.space[4])};
235
+
236
+ white-space: pre;
237
+ text-overflow: ellipsis;
238
+ pointer-events: none;
235
239
  `;
236
240
  var OverlaySelectInput$1 = /*#__PURE__*/forwardRef(OverlaySelectInput);
237
241
 
@@ -72,7 +72,7 @@ const Select = ({
72
72
  position: 'absolute',
73
73
  top: '50%',
74
74
  transform: 'translateY(-50%)',
75
- right: 5,
75
+ right: 4,
76
76
  pointerEvents: 'none'
77
77
  },
78
78
  icon: SvgChevronDown,
@@ -179,7 +179,7 @@ const SelectWrapper = styled.div`
179
179
  `};
180
180
 
181
181
  ${props => props.hasLeadingVisual && css`
182
- padding-left: ${forcePixelValue(props.theme.space[5])};
182
+ padding-left: ${forcePixelValue(props.theme.space[4])};
183
183
  select {
184
184
  padding-left: ${forcePixelValue(props.theme.space[2])};
185
185
  }
@@ -213,16 +213,16 @@ const UnstyledSelect = styled.select`
213
213
  const BaseSelect = styled(UnstyledSelect)`
214
214
  padding-top: ${({
215
215
  theme
216
- }) => forcePixelValue(theme.space['4'])};
216
+ }) => forcePixelValue(theme.space[3])};
217
217
  padding-right: ${({
218
218
  theme
219
- }) => forcePixelValue(theme.space['12'])};
219
+ }) => forcePixelValue(theme.space[10])};
220
220
  padding-bottom: ${({
221
221
  theme
222
- }) => forcePixelValue(theme.space['4'])};
222
+ }) => forcePixelValue(theme.space[3])};
223
223
  padding-left: ${({
224
224
  theme
225
- }) => forcePixelValue(theme.space['5'])};
225
+ }) => forcePixelValue(theme.space[4])};
226
226
 
227
227
  white-space: pre;
228
228
  text-overflow: ellipsis;
@@ -169,18 +169,18 @@ const TextInputWrapper = styled.div`
169
169
  `};
170
170
 
171
171
  ${props => props.hasLeadingVisual && css`
172
- padding-left: ${forcePixelValue(props.theme.space[5])};
172
+ padding-left: ${forcePixelValue(props.theme.space[4])};
173
173
  input {
174
174
  padding-left: ${forcePixelValue(props.theme.space[2])};
175
175
  }
176
176
  `}
177
177
 
178
178
  ${props => props.hasTrailingVisual && css`
179
- padding-right: ${forcePixelValue(props.theme.space[5])};
179
+ padding-right: ${forcePixelValue(props.theme.space[4])};
180
180
  `}
181
181
 
182
182
  ${props => props.hasTrailingAction && css`
183
- padding-right: ${forcePixelValue(props.theme.space[3])};
183
+ padding-right: ${forcePixelValue(props.theme.space[2])};
184
184
  `}
185
185
 
186
186
  ${props => (props.hasTrailingVisual || props.hasTrailingAction) && css`
@@ -214,16 +214,16 @@ const UnstyledInput = styled.input`
214
214
  const BaseInput = styled(UnstyledInput)`
215
215
  padding-top: ${({
216
216
  theme
217
- }) => forcePixelValue(theme.space['4'])};
217
+ }) => forcePixelValue(theme.space[3])};
218
218
  padding-right: ${({
219
219
  theme
220
- }) => forcePixelValue(theme.space['5'])};
220
+ }) => forcePixelValue(theme.space[4])};
221
221
  padding-bottom: ${({
222
222
  theme
223
- }) => forcePixelValue(theme.space['4'])};
223
+ }) => forcePixelValue(theme.space[3])};
224
224
  padding-left: ${({
225
225
  theme
226
- }) => forcePixelValue(theme.space['5'])};
226
+ }) => forcePixelValue(theme.space[4])};
227
227
  `;
228
228
  var TextInput$1 = Object.assign( /*#__PURE__*/forwardRef(TextInput), {
229
229
  TrailingAction: TextInputTrailingAction
@@ -46,16 +46,16 @@ const TextareaWrapper = styled.div`
46
46
 
47
47
  padding-top: ${({
48
48
  theme
49
- }) => forcePixelValue(theme.space['4'])};
49
+ }) => forcePixelValue(theme.space['3'])};
50
50
  padding-right: ${({
51
51
  theme
52
52
  }) => forcePixelValue(theme.space['4'])};
53
53
  padding-bottom: ${({
54
54
  theme
55
- }) => forcePixelValue(theme.space['4'])};
55
+ }) => forcePixelValue(theme.space['3'])};
56
56
  padding-left: ${({
57
57
  theme
58
- }) => forcePixelValue(theme.space['5'])};
58
+ }) => forcePixelValue(theme.space['4'])};
59
59
 
60
60
  font-size: ${({
61
61
  theme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.19.3",
3
+ "version": "2.19.5",
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": "b45053ed94e44f578e44dce29e277726777ef881"
65
+ "gitHead": "29280659eecfa0404a06a9aa4f019eba500eed7d"
66
66
  }