@i-novus/n2o-components 7.27.37 → 7.27.39
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/lib/Typography/FormattedText.d.ts +10 -0
- package/lib/Typography/FormattedText.js +19 -0
- package/lib/Typography/FormattedText.js.map +1 -0
- package/lib/Typography/Text.d.ts +8 -0
- package/lib/Typography/Text.js +16 -0
- package/lib/Typography/Text.js.map +1 -0
- package/lib/Typography/Title.d.ts +267 -0
- package/lib/Typography/Title.js +14 -0
- package/lib/Typography/Title.js.map +1 -0
- package/lib/Typography/utils.d.ts +3 -0
- package/lib/Typography/utils.js +28 -0
- package/lib/Typography/utils.js.map +1 -0
- package/lib/display/Block.d.ts +2 -2
- package/lib/display/Tooltip/Tooltip.d.ts +13 -0
- package/lib/display/Tooltip/Tooltip.js +24 -0
- package/lib/display/Tooltip/Tooltip.js.map +1 -0
- package/lib/display/Tooltip/TooltipComponent.d.ts +15 -0
- package/lib/display/Tooltip/TooltipComponent.js +21 -0
- package/lib/display/Tooltip/TooltipComponent.js.map +1 -0
- package/lib/display/Tooltip/useTooltipFloating.d.ts +808 -0
- package/lib/display/Tooltip/useTooltipFloating.js +74 -0
- package/lib/display/Tooltip/useTooltipFloating.js.map +1 -0
- package/lib/display/Tooltip/useTooltipTrigger.d.ts +24 -0
- package/lib/display/Tooltip/useTooltipTrigger.js +52 -0
- package/lib/display/Tooltip/useTooltipTrigger.js.map +1 -0
- package/lib/utils/parseFormatter.d.ts +1 -1
- package/lib/utils/parseFormatter.js +1 -1
- package/lib/utils/parseFormatter.js.map +1 -1
- package/lib/utils/useClickOutside.d.ts +11 -0
- package/lib/utils/useClickOutside.js +23 -0
- package/lib/utils/useClickOutside.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextProps } from './Text';
|
|
3
|
+
export declare type FormattedTextProps = {
|
|
4
|
+
children: string | number;
|
|
5
|
+
format?: string;
|
|
6
|
+
} & Omit<TextProps, 'children'>;
|
|
7
|
+
export declare function FormattedText({ children, format, ...attributes }: FormattedTextProps): JSX.Element;
|
|
8
|
+
export declare namespace FormattedText {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { parseFormatter } from '../utils/parseFormatter';
|
|
4
|
+
import { Text } from './Text';
|
|
5
|
+
export function FormattedText(_a) {
|
|
6
|
+
var { children = '', format } = _a, attributes = __rest(_a, ["children", "format"]);
|
|
7
|
+
const text = useMemo(() => {
|
|
8
|
+
if (!children && children !== 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (!format) {
|
|
12
|
+
return children.toString();
|
|
13
|
+
}
|
|
14
|
+
return parseFormatter(children.toString(), format);
|
|
15
|
+
}, [children, format]);
|
|
16
|
+
return (React.createElement(Text, Object.assign({}, attributes), text));
|
|
17
|
+
}
|
|
18
|
+
FormattedText.displayName = '@n2o-components/Typography/FormattedText';
|
|
19
|
+
//# sourceMappingURL=FormattedText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormattedText.js","sourceRoot":"","sources":["../../src/Typography/FormattedText.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AAOxC,MAAM,UAAU,aAAa,CAAC,EAIT;QAJS,EAC1B,QAAQ,GAAG,EAAE,EACb,MAAM,OAEW,EADd,UAAU,cAHa,sBAI7B,CADgB;IAEb,MAAM,IAAI,GAAkB,OAAO,CAAC,GAAG,EAAE;QACrC,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,CAAC,EAAE;YAAE,OAAO,IAAI,CAAA;SAAE;QAChD,IAAI,CAAC,MAAM,EAAE;YAAE,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAA;SAAE;QAE3C,OAAO,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAA;IACtD,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;IAEtB,OAAO,CACH,oBAAC,IAAI,oBAAK,UAAU,GACf,IAAI,CACF,CACV,CAAA;AACL,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,0CAA0C,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { replaceWrappingSymbol } from './utils';
|
|
3
|
+
export function Text({ children, }) {
|
|
4
|
+
const content = useMemo(() => {
|
|
5
|
+
if (!children) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return typeof children === 'string'
|
|
9
|
+
? replaceWrappingSymbol(children)
|
|
10
|
+
: children;
|
|
11
|
+
}, [children]);
|
|
12
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
13
|
+
return React.createElement(React.Fragment, null, content);
|
|
14
|
+
}
|
|
15
|
+
Text.displayName = '@n2o-components/Typography/Text';
|
|
16
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/Typography/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,OAAO,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAM/C,MAAM,UAAU,IAAI,CAAC,EACjB,QAAQ,GACA;IACR,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;SAAE;QAE9B,OAAO,OAAO,QAAQ,KAAK,QAAQ;YAC/B,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC;YACjC,CAAC,CAAC,QAAQ,CAAA;IAClB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,yDAAyD;IACzD,OAAO,0CAAG,OAAO,CAAI,CAAA;AACzB,CAAC;AAED,IAAI,CAAC,WAAW,GAAG,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
declare type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
declare type Props = {
|
|
4
|
+
level: Level | `${Level}`;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
} & HTMLAttributes<HTMLElement>;
|
|
7
|
+
export declare function Title({ level, children, ...rest }: Props): false | React.DOMElement<{
|
|
8
|
+
defaultChecked?: boolean | undefined;
|
|
9
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
10
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
11
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
12
|
+
accessKey?: string | undefined;
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
15
|
+
contextMenu?: string | undefined;
|
|
16
|
+
dir?: string | undefined;
|
|
17
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
18
|
+
hidden?: boolean | undefined;
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
lang?: string | undefined;
|
|
21
|
+
placeholder?: string | undefined;
|
|
22
|
+
slot?: string | undefined;
|
|
23
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
24
|
+
style?: React.CSSProperties | undefined;
|
|
25
|
+
tabIndex?: number | undefined;
|
|
26
|
+
title?: string | undefined;
|
|
27
|
+
translate?: "yes" | "no" | undefined;
|
|
28
|
+
radioGroup?: string | undefined;
|
|
29
|
+
role?: React.AriaRole | undefined;
|
|
30
|
+
about?: string | undefined;
|
|
31
|
+
datatype?: string | undefined;
|
|
32
|
+
inlist?: any;
|
|
33
|
+
prefix?: string | undefined;
|
|
34
|
+
property?: string | undefined;
|
|
35
|
+
resource?: string | undefined;
|
|
36
|
+
typeof?: string | undefined;
|
|
37
|
+
vocab?: string | undefined;
|
|
38
|
+
autoCapitalize?: string | undefined;
|
|
39
|
+
autoCorrect?: string | undefined;
|
|
40
|
+
autoSave?: string | undefined;
|
|
41
|
+
color?: string | undefined;
|
|
42
|
+
itemProp?: string | undefined;
|
|
43
|
+
itemScope?: boolean | undefined;
|
|
44
|
+
itemType?: string | undefined;
|
|
45
|
+
itemID?: string | undefined;
|
|
46
|
+
itemRef?: string | undefined;
|
|
47
|
+
results?: number | undefined;
|
|
48
|
+
security?: string | undefined;
|
|
49
|
+
unselectable?: "on" | "off" | undefined;
|
|
50
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
51
|
+
is?: string | undefined;
|
|
52
|
+
'aria-activedescendant'?: string | undefined;
|
|
53
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
54
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
55
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
56
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
57
|
+
'aria-colcount'?: number | undefined;
|
|
58
|
+
'aria-colindex'?: number | undefined;
|
|
59
|
+
'aria-colspan'?: number | undefined;
|
|
60
|
+
'aria-controls'?: string | undefined;
|
|
61
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
62
|
+
'aria-describedby'?: string | undefined;
|
|
63
|
+
'aria-details'?: string | undefined;
|
|
64
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
65
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
66
|
+
'aria-errormessage'?: string | undefined;
|
|
67
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
68
|
+
'aria-flowto'?: string | undefined;
|
|
69
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
70
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
71
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
72
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
73
|
+
'aria-keyshortcuts'?: string | undefined;
|
|
74
|
+
'aria-label'?: string | undefined;
|
|
75
|
+
'aria-labelledby'?: string | undefined;
|
|
76
|
+
'aria-level'?: number | undefined;
|
|
77
|
+
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
78
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
79
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
80
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
81
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
82
|
+
'aria-owns'?: string | undefined;
|
|
83
|
+
'aria-placeholder'?: string | undefined;
|
|
84
|
+
'aria-posinset'?: number | undefined;
|
|
85
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
86
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
88
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
89
|
+
'aria-roledescription'?: string | undefined;
|
|
90
|
+
'aria-rowcount'?: number | undefined;
|
|
91
|
+
'aria-rowindex'?: number | undefined;
|
|
92
|
+
'aria-rowspan'?: number | undefined;
|
|
93
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
94
|
+
'aria-setsize'?: number | undefined;
|
|
95
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
96
|
+
'aria-valuemax'?: number | undefined;
|
|
97
|
+
'aria-valuemin'?: number | undefined;
|
|
98
|
+
'aria-valuenow'?: number | undefined;
|
|
99
|
+
'aria-valuetext'?: string | undefined;
|
|
100
|
+
dangerouslySetInnerHTML?: {
|
|
101
|
+
__html: string;
|
|
102
|
+
} | undefined;
|
|
103
|
+
onCopy?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
104
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
105
|
+
onCut?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
106
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
107
|
+
onPaste?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
108
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
109
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
110
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
111
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
112
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
113
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
114
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
115
|
+
onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
116
|
+
onFocusCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
117
|
+
onBlur?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
118
|
+
onBlurCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
119
|
+
onChange?: React.FormEventHandler<HTMLElement> | undefined;
|
|
120
|
+
onChangeCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
121
|
+
onBeforeInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
122
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
123
|
+
onInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
124
|
+
onInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
125
|
+
onReset?: React.FormEventHandler<HTMLElement> | undefined;
|
|
126
|
+
onResetCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
127
|
+
onSubmit?: React.FormEventHandler<HTMLElement> | undefined;
|
|
128
|
+
onSubmitCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
129
|
+
onInvalid?: React.FormEventHandler<HTMLElement> | undefined;
|
|
130
|
+
onInvalidCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
131
|
+
onLoad?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
132
|
+
onLoadCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
133
|
+
onError?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
134
|
+
onErrorCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
135
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
136
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
137
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
138
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
139
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
140
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
141
|
+
onAbort?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
142
|
+
onAbortCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
143
|
+
onCanPlay?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
144
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
145
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
146
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
147
|
+
onDurationChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
148
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
149
|
+
onEmptied?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
150
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
151
|
+
onEncrypted?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
152
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
153
|
+
onEnded?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
154
|
+
onEndedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
155
|
+
onLoadedData?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
156
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
157
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
158
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
159
|
+
onLoadStart?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
160
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
161
|
+
onPause?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
162
|
+
onPauseCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
163
|
+
onPlay?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
164
|
+
onPlayCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
165
|
+
onPlaying?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
166
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
167
|
+
onProgress?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
168
|
+
onProgressCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
169
|
+
onRateChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
170
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
171
|
+
onSeeked?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
172
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
173
|
+
onSeeking?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
174
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
175
|
+
onStalled?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
176
|
+
onStalledCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
177
|
+
onSuspend?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
178
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
179
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
180
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
181
|
+
onVolumeChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
182
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
183
|
+
onWaiting?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
184
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
185
|
+
onAuxClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
186
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
187
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
188
|
+
onClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
189
|
+
onContextMenu?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
190
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
191
|
+
onDoubleClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
192
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
193
|
+
onDrag?: React.DragEventHandler<HTMLElement> | undefined;
|
|
194
|
+
onDragCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
195
|
+
onDragEnd?: React.DragEventHandler<HTMLElement> | undefined;
|
|
196
|
+
onDragEndCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
197
|
+
onDragEnter?: React.DragEventHandler<HTMLElement> | undefined;
|
|
198
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
199
|
+
onDragExit?: React.DragEventHandler<HTMLElement> | undefined;
|
|
200
|
+
onDragExitCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
201
|
+
onDragLeave?: React.DragEventHandler<HTMLElement> | undefined;
|
|
202
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
203
|
+
onDragOver?: React.DragEventHandler<HTMLElement> | undefined;
|
|
204
|
+
onDragOverCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
205
|
+
onDragStart?: React.DragEventHandler<HTMLElement> | undefined;
|
|
206
|
+
onDragStartCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
207
|
+
onDrop?: React.DragEventHandler<HTMLElement> | undefined;
|
|
208
|
+
onDropCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
209
|
+
onMouseDown?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
210
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
211
|
+
onMouseEnter?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
212
|
+
onMouseLeave?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
213
|
+
onMouseMove?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
214
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
215
|
+
onMouseOut?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
216
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
217
|
+
onMouseOver?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
218
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
219
|
+
onMouseUp?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
220
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
221
|
+
onSelect?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
222
|
+
onSelectCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
223
|
+
onTouchCancel?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
224
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
225
|
+
onTouchEnd?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
226
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
227
|
+
onTouchMove?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
228
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
229
|
+
onTouchStart?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
230
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
231
|
+
onPointerDown?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
232
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
233
|
+
onPointerMove?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
234
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
235
|
+
onPointerUp?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
236
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
237
|
+
onPointerCancel?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
238
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
239
|
+
onPointerEnter?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
240
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
241
|
+
onPointerLeave?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
242
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
243
|
+
onPointerOver?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
244
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
245
|
+
onPointerOut?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
246
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
247
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
248
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
249
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
250
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
251
|
+
onScroll?: React.UIEventHandler<HTMLElement> | undefined;
|
|
252
|
+
onScrollCapture?: React.UIEventHandler<HTMLElement> | undefined;
|
|
253
|
+
onWheel?: React.WheelEventHandler<HTMLElement> | undefined;
|
|
254
|
+
onWheelCapture?: React.WheelEventHandler<HTMLElement> | undefined;
|
|
255
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
256
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
257
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
258
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
259
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
260
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
261
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
262
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
263
|
+
}, Element>;
|
|
264
|
+
export declare namespace Title {
|
|
265
|
+
var displayName: string;
|
|
266
|
+
}
|
|
267
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Text } from './Text';
|
|
4
|
+
export function Title(_a) {
|
|
5
|
+
var { level, children } = _a, rest = __rest(_a, ["level", "children"]);
|
|
6
|
+
if (!children) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const content = React.createElement(Text, null, children);
|
|
10
|
+
const tag = `h${level}`;
|
|
11
|
+
return React.createElement(tag, Object.assign({}, rest), content);
|
|
12
|
+
}
|
|
13
|
+
Title.displayName = '@n2o-components/Typography/Title';
|
|
14
|
+
//# sourceMappingURL=Title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Title.js","sourceRoot":"","sources":["../../src/Typography/Title.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAS7B,MAAM,UAAU,KAAK,CAAC,EAAmC;QAAnC,EAAE,KAAK,EAAE,QAAQ,OAAkB,EAAb,IAAI,cAA1B,qBAA4B,CAAF;IAC5C,IAAI,CAAC,QAAQ,EAAE;QAAE,OAAO,KAAK,CAAA;KAAE;IAE/B,MAAM,OAAO,GAAG,oBAAC,IAAI,QAAE,QAAQ,CAAQ,CAAA;IACvC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAA;IAEvB,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,oBACvB,IAAI,GACR,OAAO,CAAC,CAAA;AACf,CAAC;AAED,KAAK,CAAC,WAAW,GAAG,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const mnemonicMap = {
|
|
3
|
+
'\n': ' ',
|
|
4
|
+
'\t': '	',
|
|
5
|
+
'\s': ' ',
|
|
6
|
+
};
|
|
7
|
+
export function replaceWrappingSymbol(text) {
|
|
8
|
+
if (!text.includes('\n')) {
|
|
9
|
+
return text;
|
|
10
|
+
}
|
|
11
|
+
const encoded = [];
|
|
12
|
+
const list = text.split('\n');
|
|
13
|
+
list.forEach((row, index) => {
|
|
14
|
+
encoded.push(row);
|
|
15
|
+
if (index < list.length - 1) {
|
|
16
|
+
encoded.push(React.createElement("br", null));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return encoded;
|
|
20
|
+
}
|
|
21
|
+
export function encodeAttribute(text = '') {
|
|
22
|
+
let encoded = text;
|
|
23
|
+
for (const [key, value] of Object.values(mnemonicMap)) {
|
|
24
|
+
encoded = encoded.replaceAll(key, value);
|
|
25
|
+
}
|
|
26
|
+
return encoded;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/Typography/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,GAAG;CACZ,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAC9C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAA;KAAE;IAEzC,MAAM,OAAO,GAAgB,EAAE,CAAA;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE7B,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEjB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAAE,OAAO,CAAC,IAAI,CAAC,+BAAM,CAAC,CAAA;SAAE;IACzD,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAI,GAAG,EAAE;IACrC,IAAI,OAAO,GAAG,IAAI,CAAA;IAElB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;QACnD,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KAC3C;IAED,OAAO,OAAO,CAAA;AAClB,CAAC"}
|
package/lib/display/Block.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export declare function Block<TTag>({ tag, className, disabled, ...props }: Prop
|
|
|
149
149
|
results?: number | undefined;
|
|
150
150
|
security?: string | undefined;
|
|
151
151
|
unselectable?: "on" | "off" | undefined;
|
|
152
|
-
inputMode?: "
|
|
152
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
153
153
|
is?: string | undefined;
|
|
154
154
|
'aria-activedescendant'?: string | undefined;
|
|
155
155
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -160,7 +160,7 @@ export declare function Block<TTag>({ tag, className, disabled, ...props }: Prop
|
|
|
160
160
|
'aria-colindex'?: number | undefined;
|
|
161
161
|
'aria-colspan'?: number | undefined;
|
|
162
162
|
'aria-controls'?: string | undefined;
|
|
163
|
-
'aria-current'?: boolean | "time" | "
|
|
163
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
164
164
|
'aria-describedby'?: string | undefined;
|
|
165
165
|
'aria-details'?: string | undefined;
|
|
166
166
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipTheme } from './TooltipComponent';
|
|
3
|
+
import { type TooltipFloating } from './useTooltipFloating';
|
|
4
|
+
import { Trigger, type TooltipTrigger } from './useTooltipTrigger';
|
|
5
|
+
export interface Props extends TooltipFloating {
|
|
6
|
+
hint: ReactNode | string | number;
|
|
7
|
+
className?: string;
|
|
8
|
+
trigger?: Trigger;
|
|
9
|
+
children: TooltipTrigger['children'];
|
|
10
|
+
closeOnClickOutside: boolean;
|
|
11
|
+
theme?: TooltipTheme;
|
|
12
|
+
}
|
|
13
|
+
export declare function Tooltip({ hint, className, children, theme, closeOnClickOutside, placement, delay, trigger, container, }: Props): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipComponent } from './TooltipComponent';
|
|
3
|
+
import { useTooltipFloating, Container } from './useTooltipFloating';
|
|
4
|
+
import { useTooltipTrigger, Trigger } from './useTooltipTrigger';
|
|
5
|
+
export function Tooltip({ hint, className, children, theme, closeOnClickOutside = true, placement = 'top', delay = 0, trigger = Trigger.HOVER, container = Container.TARGET, }) {
|
|
6
|
+
const { open, handleOpen, handleClose, toggle, refs, floatingRef, floatingStyles, portal, } = useTooltipFloating({
|
|
7
|
+
delay,
|
|
8
|
+
placement,
|
|
9
|
+
container,
|
|
10
|
+
closeOnClickOutside: closeOnClickOutside && trigger === Trigger.CLICK,
|
|
11
|
+
});
|
|
12
|
+
const triggerElement = useTooltipTrigger({
|
|
13
|
+
children,
|
|
14
|
+
refs,
|
|
15
|
+
trigger,
|
|
16
|
+
handleOpen,
|
|
17
|
+
handleClose,
|
|
18
|
+
toggle,
|
|
19
|
+
});
|
|
20
|
+
return (React.createElement(React.Fragment, null,
|
|
21
|
+
triggerElement,
|
|
22
|
+
React.createElement(TooltipComponent, { floatingRef: floatingRef, style: floatingStyles, className: className, visible: open, portal: portal, theme: theme }, hint)));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/display/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,OAAO,EAAgB,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAwB,MAAM,sBAAsB,CAAA;AAC1F,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAuB,MAAM,qBAAqB,CAAA;AAWrF,MAAM,UAAU,OAAO,CAAC,EACpB,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACL,mBAAmB,GAAG,IAAI,EAC1B,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,CAAC,EACT,OAAO,GAAG,OAAO,CAAC,KAAK,EACvB,SAAS,GAAG,SAAS,CAAC,MAAM,GACxB;IACJ,MAAM,EACF,IAAI,EACJ,UAAU,EACV,WAAW,EACX,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,MAAM,GACT,GAAG,kBAAkB,CAAC;QACnB,KAAK;QACL,SAAS;QACT,SAAS;QACT,mBAAmB,EAAE,mBAAmB,IAAI,OAAO,KAAK,OAAO,CAAC,KAAK;KACxE,CAAC,CAAA;IAEF,MAAM,cAAc,GAAG,iBAAiB,CAAC;QACrC,QAAQ;QACR,IAAI;QACJ,OAAO;QACP,UAAU;QACV,WAAW;QACX,MAAM;KACT,CAAC,CAAA;IAEF,OAAO,CACH;QACK,cAAc;QACf,oBAAC,gBAAgB,IACb,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,IAEX,IAAI,CACU,CACpB,CACN,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export declare enum TooltipTheme {
|
|
3
|
+
DARK = "DARK",
|
|
4
|
+
LIGHT = "light"
|
|
5
|
+
}
|
|
6
|
+
export interface TooltipContentProps {
|
|
7
|
+
floatingRef(node: HTMLElement | null): void;
|
|
8
|
+
style: CSSProperties;
|
|
9
|
+
className?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
visible: boolean;
|
|
12
|
+
portal?: boolean;
|
|
13
|
+
theme?: TooltipTheme;
|
|
14
|
+
}
|
|
15
|
+
export declare const TooltipComponent: ({ floatingRef, style, className, children, visible, portal, theme, }: TooltipContentProps) => JSX.Element | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { FloatingPortal } from '@floating-ui/react';
|
|
4
|
+
import { Text } from '../../Typography/Text';
|
|
5
|
+
export var TooltipTheme;
|
|
6
|
+
(function (TooltipTheme) {
|
|
7
|
+
TooltipTheme["DARK"] = "DARK";
|
|
8
|
+
TooltipTheme["LIGHT"] = "light";
|
|
9
|
+
})(TooltipTheme || (TooltipTheme = {}));
|
|
10
|
+
export const TooltipComponent = ({ floatingRef, style, className, children, visible, portal = false, theme = TooltipTheme.DARK, }) => {
|
|
11
|
+
if (!visible) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const content = (React.createElement("div", { ref: floatingRef, style: style, className: classNames('tooltip-container', 'tooltip-inner', 'py-1 px-2 rounded text-sm', className, {
|
|
15
|
+
'bg-dark text-white': theme === TooltipTheme.DARK,
|
|
16
|
+
'bg-white text-dark border border-gray-200 shadow-sm': theme === TooltipTheme.LIGHT,
|
|
17
|
+
}) },
|
|
18
|
+
React.createElement(Text, null, children)));
|
|
19
|
+
return portal ? React.createElement(FloatingPortal, null, content) : content;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=TooltipComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipComponent.js","sourceRoot":"","sources":["../../../src/display/Tooltip/TooltipComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAA;AACvD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAE5C,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACnB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAYD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC7B,WAAW,EACX,KAAK,EACL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,KAAK,EACd,KAAK,GAAG,YAAY,CAAC,IAAI,GACP,EAAE,EAAE;IACtB,IAAI,CAAC,OAAO,EAAE;QAAE,OAAO,IAAI,CAAA;KAAE;IAE7B,MAAM,OAAO,GAAG,CACZ,6BACI,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CACjB,mBAAmB,EACnB,eAAe,EACf,2BAA2B,EAC3B,SAAS,EACT;YACI,oBAAoB,EAAE,KAAK,KAAK,YAAY,CAAC,IAAI;YACjD,qDAAqD,EAAE,KAAK,KAAK,YAAY,CAAC,KAAK;SACtF,CACJ;QAED,oBAAC,IAAI,QAAE,QAAQ,CAAQ,CACrB,CACT,CAAA;IAED,OAAO,MAAM,CAAC,CAAC,CAAC,oBAAC,cAAc,QAAE,OAAO,CAAkB,CAAC,CAAC,CAAC,OAAO,CAAA;AACxE,CAAC,CAAA"}
|