jy-headless 0.2.36 → 0.3.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 (84) hide show
  1. package/Popover/Popover.d.ts +2 -0
  2. package/Popover/Popover.js +75 -0
  3. package/Popover/Popover.type.d.ts +9 -0
  4. package/Popover/index.d.ts +2 -0
  5. package/cjs/Popover/Popover.d.ts +2 -0
  6. package/cjs/Popover/Popover.js +77 -0
  7. package/cjs/Popover/Popover.type.d.ts +9 -0
  8. package/cjs/Popover/index.d.ts +2 -0
  9. package/cjs/index.d.ts +1 -7
  10. package/cjs/index.js +2 -24
  11. package/index.d.ts +1 -7
  12. package/index.js +1 -14
  13. package/package.json +8 -68
  14. package/version.txt +1 -1
  15. package/buttons/Button/Button.d.ts +0 -3
  16. package/buttons/Button/Button.js +0 -9
  17. package/buttons/index.d.ts +0 -1
  18. package/cjs/buttons/Button/Button.d.ts +0 -3
  19. package/cjs/buttons/Button/Button.js +0 -11
  20. package/cjs/buttons/index.d.ts +0 -1
  21. package/cjs/hooks/index.d.ts +0 -3
  22. package/cjs/hooks/useDebouncing.d.ts +0 -2
  23. package/cjs/hooks/useDebouncing.js +0 -16
  24. package/cjs/hooks/useDropdown.d.ts +0 -10
  25. package/cjs/hooks/useDropdown.js +0 -32
  26. package/cjs/hooks/useThrottling.d.ts +0 -2
  27. package/cjs/hooks/useThrottling.js +0 -16
  28. package/cjs/inputs/ImageInput/ImageInput.d.ts +0 -7
  29. package/cjs/inputs/ImageInput/ImageInput.js +0 -76
  30. package/cjs/inputs/Input/Input.d.ts +0 -3
  31. package/cjs/inputs/Input/Input.js +0 -17
  32. package/cjs/inputs/checkboxList/CheckboxList.d.ts +0 -5
  33. package/cjs/inputs/checkboxList/CheckboxList.js +0 -32
  34. package/cjs/inputs/checkboxList/index.d.ts +0 -5
  35. package/cjs/inputs/checkboxList/index.js +0 -32
  36. package/cjs/inputs/index.d.ts +0 -3
  37. package/cjs/selectors/Dropdown/Dropdown.d.ts +0 -8
  38. package/cjs/selectors/Dropdown/Dropdown.js +0 -55
  39. package/cjs/selectors/index.d.ts +0 -1
  40. package/cjs/tooltip/Tooltip/Tooltip.d.ts +0 -5
  41. package/cjs/tooltip/Tooltip/Tooltip.js +0 -66
  42. package/cjs/tooltip/index.d.ts +0 -1
  43. package/cjs/types/buttons/index.d.ts +0 -7
  44. package/cjs/types/common/index.d.ts +0 -11
  45. package/cjs/types/index.d.ts +0 -4
  46. package/cjs/types/inputs/index.d.ts +0 -36
  47. package/cjs/types/selectors/index.d.ts +0 -16
  48. package/cjs/types/tooltip/index.d.ts +0 -14
  49. package/cjs/types/tooltip/index.js +0 -7
  50. package/cjs/utils/ArrayUtils.d.ts +0 -2
  51. package/cjs/utils/MessageUtils.d.ts +0 -1
  52. package/cjs/utils/index.d.ts +0 -1
  53. package/hooks/index.d.ts +0 -3
  54. package/hooks/useDebouncing.d.ts +0 -2
  55. package/hooks/useDebouncing.js +0 -14
  56. package/hooks/useDropdown.d.ts +0 -10
  57. package/hooks/useDropdown.js +0 -26
  58. package/hooks/useThrottling.d.ts +0 -2
  59. package/hooks/useThrottling.js +0 -14
  60. package/inputs/ImageInput/ImageInput.d.ts +0 -7
  61. package/inputs/ImageInput/ImageInput.js +0 -71
  62. package/inputs/Input/Input.d.ts +0 -3
  63. package/inputs/Input/Input.js +0 -15
  64. package/inputs/checkboxList/CheckboxList.d.ts +0 -5
  65. package/inputs/checkboxList/CheckboxList.js +0 -30
  66. package/inputs/checkboxList/index.d.ts +0 -5
  67. package/inputs/checkboxList/index.js +0 -30
  68. package/inputs/index.d.ts +0 -3
  69. package/selectors/Dropdown/Dropdown.d.ts +0 -8
  70. package/selectors/Dropdown/Dropdown.js +0 -53
  71. package/selectors/index.d.ts +0 -1
  72. package/tooltip/Tooltip/Tooltip.d.ts +0 -5
  73. package/tooltip/Tooltip/Tooltip.js +0 -64
  74. package/tooltip/index.d.ts +0 -1
  75. package/types/buttons/index.d.ts +0 -7
  76. package/types/common/index.d.ts +0 -11
  77. package/types/index.d.ts +0 -4
  78. package/types/inputs/index.d.ts +0 -36
  79. package/types/selectors/index.d.ts +0 -16
  80. package/types/tooltip/index.d.ts +0 -14
  81. package/types/tooltip/index.js +0 -5
  82. package/utils/ArrayUtils.d.ts +0 -2
  83. package/utils/MessageUtils.d.ts +0 -1
  84. package/utils/index.d.ts +0 -1
@@ -1,5 +0,0 @@
1
- import { TooltipProps } from '../../types/tooltip';
2
- declare const Tooltip: (({ children, style, position, space, ...props }: TooltipProps) => import("react/jsx-runtime").JSX.Element) & {
3
- Label: ({ children, style, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
4
- };
5
- export default Tooltip;
@@ -1,64 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useState, useEffect, useContext } from 'react';
3
- import { TooltipContext } from '../../types/tooltip/index.js';
4
-
5
- const TooltipRoot = ({ children, style, position = 'top', space = 8, ...props }) => {
6
- const [showTooltip, setShowTooltip] = useState(false);
7
- const [tooltipPosition, setTooltipPosition] = useState({});
8
- useEffect(() => {
9
- if (!showTooltip)
10
- return;
11
- const positionStyles = {
12
- zIndex: 1000,
13
- };
14
- switch (position) {
15
- case 'top':
16
- positionStyles.bottom = `calc(100% + ${space}px)`;
17
- positionStyles.left = '50%';
18
- positionStyles.transform = 'translateX(-50%)';
19
- break;
20
- case 'bottom':
21
- positionStyles.top = `calc(100% + ${space}px)`;
22
- positionStyles.left = '50%';
23
- positionStyles.transform = 'translateX(-50%)';
24
- break;
25
- case 'left':
26
- positionStyles.right = `calc(100% + ${space}px)`;
27
- positionStyles.top = '50%';
28
- positionStyles.transform = 'translateY(-50%)';
29
- break;
30
- case 'right':
31
- positionStyles.left = `calc(100% + ${space}px)`;
32
- positionStyles.top = '50%';
33
- positionStyles.transform = 'translateY(-50%)';
34
- break;
35
- }
36
- setTooltipPosition(positionStyles);
37
- }, [showTooltip, position]);
38
- const onMouseOver = () => setShowTooltip(true);
39
- const onMouseLeave = () => setShowTooltip(false);
40
- return (jsx("div", { style: {
41
- position: 'relative',
42
- display: 'inline-block', // 자식 크기에 영향 안 받도록
43
- ...style,
44
- }, onMouseOver: onMouseOver, onMouseLeave: onMouseLeave, ...props, children: jsx(TooltipContext.Provider, { value: { show: showTooltip, tooltipPosition }, children: children }) }));
45
- };
46
- const TooltipLabel = ({ children, style, ...props }) => {
47
- const context = useContext(TooltipContext);
48
- if (!context) {
49
- throw new Error('Tooltip.* 컴포넌트는 Tooltip 내에서만 사용해야 합니다.');
50
- }
51
- const { show, tooltipPosition } = context;
52
- const labelStyle = {
53
- position: 'absolute',
54
- visibility: show ? 'visible' : 'hidden',
55
- ...tooltipPosition,
56
- ...style,
57
- };
58
- return (jsx("div", { style: labelStyle, ...props, children: children }));
59
- };
60
- const Tooltip = Object.assign(TooltipRoot, {
61
- Label: TooltipLabel,
62
- });
63
-
64
- export { Tooltip as default };
@@ -1 +0,0 @@
1
- export * as Tooltip from './Tooltip/Tooltip';
@@ -1,7 +0,0 @@
1
- import { ButtonHTMLAttributes } from 'react';
2
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
- loading?: boolean;
4
- readOnly?: boolean;
5
- useDebounce?: boolean;
6
- timeout?: number;
7
- }
@@ -1,11 +0,0 @@
1
- import { HTMLAttributes, ImgHTMLAttributes } from 'react';
2
- export interface DivAttribute<T> extends HTMLAttributes<HTMLDivElement> {
3
- value?: T;
4
- }
5
- export interface SpanAttribute<T> extends HTMLAttributes<HTMLSpanElement> {
6
- value?: T;
7
- }
8
- export interface LabelAttribute extends HTMLAttributes<HTMLLabelElement> {
9
- }
10
- export interface ImageAttribute extends ImgHTMLAttributes<HTMLImageElement> {
11
- }
package/types/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './buttons';
2
- export * from './inputs';
3
- export * from './selectors';
4
- export * from './common';
@@ -1,36 +0,0 @@
1
- import { ChangeEvent, CSSProperties, InputHTMLAttributes, ReactElement, ReactNode } from 'react';
2
- import { DivAttribute } from '../common';
3
- export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
4
- suffixElement?: ReactElement | ReactNode;
5
- prefixElement?: ReactElement | ReactNode;
6
- wrapperStyle?: CSSProperties;
7
- wrapperClass?: string[];
8
- timeout?: number;
9
- showLimit?: boolean;
10
- maxLength?: number;
11
- onThrottledChange?: (e: ChangeEvent<HTMLInputElement>) => void;
12
- }
13
- export interface ImageInputContextData {
14
- id?: string;
15
- previewUrl?: string;
16
- dragOver?: boolean;
17
- }
18
- export type ImageType = 'jpeg' | 'png' | 'gif' | 'svg' | 'bmp' | 'webp' | 'heic' | 'heif' | 'tiff' | 'x-icon' | 'vn';
19
- export interface ImageInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
20
- accepts?: ImageType[];
21
- draggable?: boolean;
22
- onChange?: (file: File) => void;
23
- value?: File;
24
- }
25
- export interface CheckboxProps<T> extends Omit<DivAttribute<T>, 'onChange'> {
26
- values: T[];
27
- onChange: (newValue: T[]) => void;
28
- max?: number;
29
- }
30
- export interface CheckboxItemProps<T> extends DivAttribute<T> {
31
- value: T;
32
- }
33
- export interface CheckboxContextData<T> {
34
- onToggle: (newValue: T, isCheck: boolean) => void;
35
- values: T[];
36
- }
@@ -1,16 +0,0 @@
1
- import { HTMLAttributes } from 'react';
2
- export interface DropdownContextValue<T> {
3
- isOpen: boolean;
4
- toggle: () => void;
5
- select: (value: T) => void;
6
- selected: T | null;
7
- }
8
- export interface DropdownProps<T> extends HTMLAttributes<HTMLElement> {
9
- isOpen?: boolean;
10
- toggle?: () => void;
11
- select?: (value: T) => void;
12
- selected?: T | null;
13
- }
14
- export interface UseDropdownProps<T> {
15
- defaultValue?: T;
16
- }
@@ -1,14 +0,0 @@
1
- import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
- export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
3
- export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
4
- children: ReactNode;
5
- position?: TooltipPosition;
6
- style?: CSSProperties;
7
- space?: number;
8
- }
9
- interface TooltipContextProps {
10
- show: boolean;
11
- tooltipPosition: CSSProperties;
12
- }
13
- export declare const TooltipContext: import("react").Context<TooltipContextProps | null>;
14
- export {};
@@ -1,5 +0,0 @@
1
- import { createContext } from 'react';
2
-
3
- const TooltipContext = createContext(null);
4
-
5
- export { TooltipContext };
@@ -1,2 +0,0 @@
1
- declare const ArrayUtils: {};
2
- export default ArrayUtils;
@@ -1 +0,0 @@
1
- declare const logCannotFindContextError: (componentName: string) => never;
package/utils/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from './ArrayUtils';