podo-ui 0.5.3 → 0.7.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.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import Editor from './react/atom/editor';
4
4
  import EditorView from './react/atom/editor-view';
5
5
  import Avatar from './react/atom/avatar';
6
6
  import Chip from './react/atom/chip';
7
+ import Tooltip from './react/atom/tooltip';
7
8
  import Pagination from './react/molecule/pagination';
8
9
  import Field from './react/molecule/field';
9
10
  declare const Form: {
@@ -14,5 +15,5 @@ declare const Form: {
14
15
  Field: ({ label, labelClass, required, helper, helperClass, children, validator, value, setClassName, className, }: import("./react/molecule/field").FieldProps) => import("react/jsx-runtime").JSX.Element;
15
16
  };
16
17
  export default Form;
17
- export { Input, Textarea, Editor, EditorView, Avatar, Chip, Pagination, Field };
18
+ export { Input, Textarea, Editor, EditorView, Avatar, Chip, Tooltip, Pagination, Field };
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,wBAAwB,CAAC;AAC3C,QAAA,MAAM,IAAI;;;;;;CAMT,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,wBAAwB,CAAC;AAC3C,QAAA,MAAM,IAAI;;;;;;CAMT,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import Editor from './react/atom/editor';
4
4
  import EditorView from './react/atom/editor-view';
5
5
  import Avatar from './react/atom/avatar';
6
6
  import Chip from './react/atom/chip';
7
+ import Tooltip from './react/atom/tooltip';
7
8
  import Pagination from './react/molecule/pagination';
8
9
  import Field from './react/molecule/field';
9
10
  const Form = {
@@ -14,4 +15,4 @@ const Form = {
14
15
  Field,
15
16
  };
16
17
  export default Form;
17
- export { Input, Textarea, Editor, EditorView, Avatar, Chip, Pagination, Field };
18
+ export { Input, Textarea, Editor, EditorView, Avatar, Chip, Tooltip, Pagination, Field };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export type TooltipVariant = 'default' | 'info';
3
+ export type TooltipPosition = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom';
4
+ export interface TooltipProps {
5
+ /** Trigger element (button, icon, etc.) */
6
+ children: React.ReactNode;
7
+ /** Tooltip content (can include any JSX) */
8
+ content: React.ReactNode;
9
+ /** Tooltip visual variant */
10
+ variant?: TooltipVariant;
11
+ /** Arrow position */
12
+ position?: TooltipPosition;
13
+ /** Distance from trigger element in pixels */
14
+ offset?: number;
15
+ /** Control visibility externally (overrides hover state) */
16
+ isVisible?: boolean;
17
+ /** Additional CSS class */
18
+ className?: string;
19
+ }
20
+ export default function Tooltip({ children, content, variant, position, offset, isVisible: controlledIsVisible, className, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
21
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../react/atom/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhD,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,SAAS,GACT,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,MAAM,GACN,SAAS,GACT,YAAY,GACZ,OAAO,GACP,UAAU,GACV,aAAa,CAAC;AAElB,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,QAAQ,EACR,OAAO,EACP,OAAmB,EACnB,QAAgB,EAChB,MAAU,EACV,SAAS,EAAE,mBAAmB,EAC9B,SAAc,GACf,EAAE,YAAY,2CAkCd"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import styles from './tooltip.module.scss';
4
+ export default function Tooltip({ children, content, variant = 'default', position = 'top', offset = 8, isVisible: controlledIsVisible, className = '', }) {
5
+ const [hoverIsVisible, setHoverIsVisible] = useState(false);
6
+ const variantClass = variant === 'default' ? styles.variantDefault : styles.variantInfo;
7
+ const tooltipClassNames = [
8
+ styles.tooltipBox,
9
+ variantClass,
10
+ styles[position],
11
+ className,
12
+ ]
13
+ .filter(Boolean)
14
+ .join(' ');
15
+ // Show tooltip if controlled visibility is true OR hover state is true
16
+ const shouldShowTooltip = controlledIsVisible === true || hoverIsVisible;
17
+ return (_jsxs("div", { className: styles.tooltipWrapper, onMouseEnter: () => setHoverIsVisible(true), onMouseLeave: () => setHoverIsVisible(false), children: [children, shouldShowTooltip && (_jsx("div", { className: tooltipClassNames, style: { '--tooltip-offset': `${offset}px` }, children: content }))] }));
18
+ }
@@ -0,0 +1,227 @@
1
+ @use '../../../mixin.scss' as *;
2
+
3
+ .tooltipWrapper {
4
+ position: relative;
5
+ display: inline-flex;
6
+ }
7
+
8
+ .tooltipBox {
9
+ position: absolute;
10
+ padding: s(2) s(4);
11
+ border-radius: r(3);
12
+ font-family: 'Pretendard', -apple-system, sans-serif;
13
+ font-size: 14px;
14
+ font-weight: 400;
15
+ line-height: 22.4px;
16
+ white-space: nowrap;
17
+ z-index: 1000;
18
+
19
+ // Default variant
20
+ &.variantDefault {
21
+ background-color: color(default-deep);
22
+ color: color(text-action-reverse) !important;
23
+ }
24
+
25
+ // Info variant
26
+ &.variantInfo {
27
+ background-color: color(info);
28
+ color: color(text-action-reverse) !important;
29
+ }
30
+
31
+ // Arrow styles
32
+ &::before {
33
+ content: '';
34
+ position: absolute;
35
+ width: 12px;
36
+ height: 12px;
37
+ transform-origin: center;
38
+ }
39
+
40
+ // Top positions
41
+ &.top,
42
+ &.topLeft,
43
+ &.topRight {
44
+ bottom: calc(100% + var(--tooltip-offset, 8px));
45
+
46
+ &::before {
47
+ bottom: -6px;
48
+ border-radius: 0 0 2px 0;
49
+ transform: rotate(45deg);
50
+ }
51
+
52
+ &.variantDefault::before {
53
+ background-color: color(default-deep);
54
+ }
55
+
56
+ &.variantInfo::before {
57
+ background-color: color(info);
58
+ }
59
+ }
60
+
61
+ &.top {
62
+ left: 50%;
63
+ transform: translateX(-50%);
64
+
65
+ &::before {
66
+ left: 50%;
67
+ transform: translateX(-50%) rotate(45deg);
68
+ }
69
+ }
70
+
71
+ &.topLeft {
72
+ left: 0;
73
+
74
+ &::before {
75
+ left: 8px;
76
+ }
77
+ }
78
+
79
+ &.topRight {
80
+ right: 0;
81
+
82
+ &::before {
83
+ right: 8px;
84
+ }
85
+ }
86
+
87
+ // Bottom positions
88
+ &.bottom,
89
+ &.bottomLeft,
90
+ &.bottomRight {
91
+ top: calc(100% + var(--tooltip-offset, 8px));
92
+
93
+ &::before {
94
+ top: -6px;
95
+ border-radius: 2px 0 0 0;
96
+ transform: rotate(45deg);
97
+ }
98
+
99
+ &.variantDefault::before {
100
+ background-color: color(default-deep);
101
+ }
102
+
103
+ &.variantInfo::before {
104
+ background-color: color(info);
105
+ }
106
+ }
107
+
108
+ &.bottom {
109
+ left: 50%;
110
+ transform: translateX(-50%);
111
+
112
+ &::before {
113
+ left: 50%;
114
+ transform: translateX(-50%) rotate(45deg);
115
+ }
116
+ }
117
+
118
+ &.bottomLeft {
119
+ left: 0;
120
+
121
+ &::before {
122
+ left: 8px;
123
+ }
124
+ }
125
+
126
+ &.bottomRight {
127
+ right: 0;
128
+
129
+ &::before {
130
+ right: 8px;
131
+ }
132
+ }
133
+
134
+ // Left positions
135
+ &.left,
136
+ &.leftTop,
137
+ &.leftBottom {
138
+ right: calc(100% + var(--tooltip-offset, 8px));
139
+
140
+ &::before {
141
+ right: -6px;
142
+ border-radius: 0 2px 0 0;
143
+ transform: rotate(45deg);
144
+ }
145
+
146
+ &.variantDefault::before {
147
+ background-color: color(default-deep);
148
+ }
149
+
150
+ &.variantInfo::before {
151
+ background-color: color(info);
152
+ }
153
+ }
154
+
155
+ &.left {
156
+ top: 50%;
157
+ transform: translateY(-50%);
158
+
159
+ &::before {
160
+ top: 50%;
161
+ transform: translateY(-50%) rotate(45deg);
162
+ }
163
+ }
164
+
165
+ &.leftTop {
166
+ top: 0;
167
+
168
+ &::before {
169
+ top: 8px;
170
+ }
171
+ }
172
+
173
+ &.leftBottom {
174
+ bottom: 0;
175
+
176
+ &::before {
177
+ bottom: 8px;
178
+ }
179
+ }
180
+
181
+ // Right positions
182
+ &.right,
183
+ &.rightTop,
184
+ &.rightBottom {
185
+ left: calc(100% + var(--tooltip-offset, 8px));
186
+
187
+ &::before {
188
+ left: -6px;
189
+ border-radius: 0 0 0 2px;
190
+ transform: rotate(45deg);
191
+ }
192
+
193
+ &.variantDefault::before {
194
+ background-color: color(default-deep);
195
+ }
196
+
197
+ &.variantInfo::before {
198
+ background-color: color(info);
199
+ }
200
+ }
201
+
202
+ &.right {
203
+ top: 50%;
204
+ transform: translateY(-50%);
205
+
206
+ &::before {
207
+ top: 50%;
208
+ transform: translateY(-50%) rotate(45deg);
209
+ }
210
+ }
211
+
212
+ &.rightTop {
213
+ top: 0;
214
+
215
+ &::before {
216
+ top: 8px;
217
+ }
218
+ }
219
+
220
+ &.rightBottom {
221
+ bottom: 0;
222
+
223
+ &::before {
224
+ bottom: 8px;
225
+ }
226
+ }
227
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podo-ui",
3
- "version": "0.5.3",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "author": "hada0127 <work@tarucy.net>",
6
6
  "license": "MIT",