@teamturing/react-kit 2.11.0 → 2.13.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.
Files changed (28) hide show
  1. package/dist/core/Button/index.d.ts +2 -2
  2. package/dist/core/IconButton/index.d.ts +2 -2
  3. package/dist/core/Overlay/index.d.ts +18 -0
  4. package/dist/core/OverlayPopper/index.d.ts +16 -0
  5. package/dist/hook/useFocusTrap.d.ts +13 -0
  6. package/dist/hook/useFocusZone.d.ts +15 -0
  7. package/dist/index.d.ts +8 -0
  8. package/dist/index.js +2523 -164
  9. package/esm/core/Button/index.js +2 -2
  10. package/esm/core/Dialog/index.js +8 -36
  11. package/esm/core/IconButton/index.js +1 -1
  12. package/esm/core/Overlay/index.js +92 -0
  13. package/esm/core/OverlayPopper/index.js +69 -0
  14. package/esm/hook/useFocusTrap.js +39 -0
  15. package/esm/hook/useFocusZone.js +35 -0
  16. package/esm/index.js +6 -0
  17. package/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js +475 -0
  18. package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +599 -0
  19. package/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +229 -0
  20. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +121 -0
  21. package/esm/node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.js +128 -0
  22. package/esm/node_modules/@primer/behaviors/dist/esm/focus-trap.js +105 -0
  23. package/esm/node_modules/@primer/behaviors/dist/esm/focus-zone.js +436 -0
  24. package/esm/node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.js +38 -0
  25. package/esm/node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.js +65 -0
  26. package/esm/node_modules/@primer/behaviors/dist/esm/utils/unique-id.js +6 -0
  27. package/esm/node_modules/@primer/behaviors/dist/esm/utils/user-agent.js +9 -0
  28. package/package.json +5 -2
@@ -11,7 +11,7 @@ type Props = {
11
11
  * 색을 정의합니다.
12
12
  * hover, active, focused, disabled, loading 등의 모든 상황에 관여합니다.
13
13
  */
14
- variant?: 'primary' | 'secondary' | 'tertiary' | 'outlined' | 'plain' | 'danger';
14
+ variant?: 'primary' | 'secondary' | 'neutral' | 'outlined' | 'plain' | 'danger';
15
15
  /**
16
16
  * 감싸고 있는 컨테이너의 너비를 채웁니다.
17
17
  */
@@ -43,7 +43,7 @@ declare const Button: import("react").ForwardRefExoticComponent<{
43
43
  * 색을 정의합니다.
44
44
  * hover, active, focused, disabled, loading 등의 모든 상황에 관여합니다.
45
45
  */
46
- variant?: "primary" | "secondary" | "tertiary" | "outlined" | "plain" | "danger" | undefined;
46
+ variant?: "primary" | "secondary" | "neutral" | "outlined" | "plain" | "danger" | undefined;
47
47
  /**
48
48
  * 감싸고 있는 컨테이너의 너비를 채웁니다.
49
49
  */
@@ -15,7 +15,7 @@ type Props = {
15
15
  * 색을 정의합니다.
16
16
  * hover, active, focused, disabled, loading 등의 모든 상황에 관여합니다.
17
17
  */
18
- variant?: 'primary' | 'secondary' | 'tertiary' | 'outlined' | 'plain-bold' | 'plain' | 'plain-subtle' | 'danger';
18
+ variant?: 'primary' | 'secondary' | 'neutral' | 'outlined' | 'plain-bold' | 'plain' | 'plain-subtle' | 'danger';
19
19
  /**
20
20
  * 비활성화 상태를 정의합니다.
21
21
  */
@@ -39,7 +39,7 @@ declare const IconButton: import("react").ForwardRefExoticComponent<{
39
39
  * 색을 정의합니다.
40
40
  * hover, active, focused, disabled, loading 등의 모든 상황에 관여합니다.
41
41
  */
42
- variant?: "primary" | "secondary" | "tertiary" | "outlined" | "plain" | "danger" | "plain-bold" | "plain-subtle" | undefined;
42
+ variant?: "primary" | "secondary" | "neutral" | "outlined" | "plain" | "danger" | "plain-bold" | "plain-subtle" | undefined;
43
43
  /**
44
44
  * 비활성화 상태를 정의합니다.
45
45
  */
@@ -0,0 +1,18 @@
1
+ import { HTMLAttributes, RefObject } from 'react';
2
+ import { ResponsiveValue } from 'styled-system';
3
+ type Props = {
4
+ isOpen?: boolean;
5
+ onDismiss?: () => void;
6
+ size?: ResponsiveValue<'m'>;
7
+ ignoreOutsideClickRefs?: RefObject<HTMLElement>[];
8
+ } & HTMLAttributes<HTMLElement>;
9
+ declare const _default: import("react").ForwardRefExoticComponent<{
10
+ isOpen?: boolean | undefined;
11
+ onDismiss?: (() => void) | undefined;
12
+ size?: ResponsiveValue<"m"> | undefined;
13
+ ignoreOutsideClickRefs?: RefObject<HTMLElement>[] | undefined;
14
+ } & HTMLAttributes<HTMLElement> & {
15
+ children?: import("react").ReactNode;
16
+ } & import("react").RefAttributes<HTMLDivElement>>;
17
+ export default _default;
18
+ export type { Props as OverlayProps };
@@ -0,0 +1,16 @@
1
+ import { Placement } from '@floating-ui/react-dom';
2
+ import { PropsWithChildren, ReactNode } from 'react';
3
+ import { FocusTrapHookSettings } from '../../hook/useFocusTrap';
4
+ import { FocusZoneHookSettings } from '../../hook/useFocusZone';
5
+ type Props = {
6
+ renderOverlay: ({ isOpen, closeOverlay }: {
7
+ isOpen: boolean;
8
+ closeOverlay: () => void;
9
+ }) => ReactNode;
10
+ placement?: Placement;
11
+ focusZoneSettings?: Partial<FocusZoneHookSettings>;
12
+ focusTrapSettings?: Partial<FocusTrapHookSettings>;
13
+ };
14
+ declare const OverlayPopper: ({ children: propChildren, renderOverlay, placement, focusZoneSettings, focusTrapSettings, }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
15
+ export default OverlayPopper;
16
+ export type { Props as OverlayPopperProps };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface FocusTrapHookSettings {
3
+ containerRef?: React.RefObject<HTMLElement>;
4
+ initialFocusRef?: React.RefObject<HTMLElement>;
5
+ disabled?: boolean;
6
+ restoreFocusOnCleanUp?: boolean;
7
+ }
8
+ declare const useFocusTrap: (settings?: FocusTrapHookSettings, dependencies?: React.DependencyList) => {
9
+ containerRef: React.RefObject<HTMLElement>;
10
+ initialFocusRef: React.RefObject<HTMLElement>;
11
+ };
12
+ export default useFocusTrap;
13
+ export type { FocusTrapHookSettings };
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { FocusZoneSettings } from '@primer/behaviors';
3
+ export { FocusKeys } from '@primer/behaviors';
4
+ export type { Direction } from '@primer/behaviors';
5
+ interface FocusZoneHookSettings extends Omit<FocusZoneSettings, 'activeDescendantControl'> {
6
+ containerRef?: React.RefObject<HTMLElement>;
7
+ activeDescendantFocus?: boolean | React.RefObject<HTMLElement>;
8
+ disabled?: boolean;
9
+ }
10
+ declare const useFocusZone: (settings?: FocusZoneHookSettings, dependencies?: import("react").DependencyList) => {
11
+ containerRef: React.RefObject<HTMLElement>;
12
+ activeDescendantControlRef: React.RefObject<HTMLElement>;
13
+ };
14
+ export default useFocusZone;
15
+ export type { FocusZoneHookSettings };
package/dist/index.d.ts CHANGED
@@ -27,6 +27,10 @@ export type { ImageProps } from './core/Image';
27
27
  export { default as ItemList } from './core/ItemList';
28
28
  export type { ItemListProps } from './core/ItemList';
29
29
  export { default as MotionView } from './core/MotionView';
30
+ export { default as Overlay } from './core/Overlay';
31
+ export type { OverlayProps } from './core/Overlay';
32
+ export { default as OverlayPopper } from './core/OverlayPopper';
33
+ export type { OverlayPopperProps } from './core/OverlayPopper';
30
34
  export { default as Space } from './core/Space';
31
35
  export type { SpaceProps } from './core/Space';
32
36
  export { default as Spinner } from './core/Spinner';
@@ -60,6 +64,10 @@ export { default as EnigmaUI } from './enigma/EnigmaUI';
60
64
  * hooks
61
65
  */
62
66
  export { default as useDevice } from './hook/useDevice';
67
+ export { default as useDialogHandler } from './hook/useDialogHandler';
68
+ export { default as useFocusTrap } from './hook/useFocusTrap';
69
+ export { default as useFocusZone } from './hook/useFocusZone';
70
+ export { default as useMediaQuery } from './hook/useMediaQuery';
63
71
  export { default as useOutsideClick } from './hook/useOutsideClick';
64
72
  export { default as useProvidedOrCreatedRef } from './hook/useProvidedOrCreatedRef';
65
73
  export { default as useResize } from './hook/useResize';