bootstrap-rn 0.4.11 → 0.4.12
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/module/components/collapse/Collapse.js +1 -0
- package/lib/module/components/collapse/Collapse.js.map +1 -1
- package/lib/module/components/forms/Radio.js +1 -0
- package/lib/module/components/forms/Radio.js.map +1 -1
- package/lib/module/components/helpers/Portal.js +20 -1
- package/lib/module/components/helpers/Portal.js.map +1 -1
- package/lib/module/components/helpers/Portal.web.js +10 -2
- package/lib/module/components/helpers/Portal.web.js.map +1 -1
- package/lib/module/components/helpers/PortalHost.web.js +4 -1
- package/lib/module/components/helpers/PortalHost.web.js.map +1 -1
- package/lib/module/components/list-group/ListGroup.js +1 -0
- package/lib/module/components/list-group/ListGroup.js.map +1 -1
- package/lib/module/components/popover/Popover.js +1 -0
- package/lib/module/components/popover/Popover.js.map +1 -1
- package/lib/module/components/progress/Progress.js +1 -0
- package/lib/module/components/progress/Progress.js.map +1 -1
- package/lib/module/components/tooltip/Tooltip.js +1 -0
- package/lib/module/components/tooltip/Tooltip.js.map +1 -1
- package/lib/module/components/type/Paragraph.js +2 -2
- package/lib/module/components/type/Paragraph.js.map +1 -1
- package/lib/module/hooks/usePortalRegistry.js +26 -0
- package/lib/module/hooks/usePortalRegistry.js.map +1 -0
- package/lib/typescript/components/collapse/Collapse.d.ts +5 -0
- package/lib/typescript/components/collapse/Collapse.d.ts.map +1 -1
- package/lib/typescript/components/forms/Radio.d.ts +5 -0
- package/lib/typescript/components/forms/Radio.d.ts.map +1 -1
- package/lib/typescript/components/helpers/Portal.d.ts +2 -1
- package/lib/typescript/components/helpers/Portal.d.ts.map +1 -1
- package/lib/typescript/components/helpers/Portal.web.d.ts +2 -1
- package/lib/typescript/components/helpers/Portal.web.d.ts.map +1 -1
- package/lib/typescript/components/list-group/ListGroup.d.ts +3 -0
- package/lib/typescript/components/list-group/ListGroup.d.ts.map +1 -1
- package/lib/typescript/components/list-group/ListGroupContext.d.ts +2 -2
- package/lib/typescript/components/list-group/ListGroupContext.d.ts.map +1 -1
- package/lib/typescript/components/popover/Popover.d.ts +4 -0
- package/lib/typescript/components/popover/Popover.d.ts.map +1 -1
- package/lib/typescript/components/progress/Progress.d.ts +4 -0
- package/lib/typescript/components/progress/Progress.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/Tooltip.d.ts +4 -0
- package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/components/type/Paragraph.d.ts +2 -2
- package/lib/typescript/components/type/Paragraph.d.ts.map +1 -1
- package/lib/typescript/hooks/usePortalRegistry.d.ts +2 -0
- package/lib/typescript/hooks/usePortalRegistry.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/buttons/Button.tsx +380 -380
- package/src/components/collapse/Collapse.tsx +1 -0
- package/src/components/forms/Input.tsx +219 -219
- package/src/components/forms/Radio.tsx +1 -0
- package/src/components/forms/RadioContext.ts +13 -13
- package/src/components/forms/internals/PickerNativeContext.ts +14 -14
- package/src/components/helpers/Portal.tsx +16 -2
- package/src/components/helpers/Portal.web.tsx +16 -4
- package/src/components/helpers/PortalHost.web.tsx +1 -1
- package/src/components/list-group/ListGroup.tsx +1 -0
- package/src/components/list-group/ListGroupContext.ts +11 -11
- package/src/components/popover/Popover.tsx +1 -0
- package/src/components/popover/PopoverContext.ts +13 -13
- package/src/components/progress/Progress.tsx +1 -0
- package/src/components/tooltip/Tooltip.tsx +1 -0
- package/src/components/tooltip/TooltipContext.ts +13 -13
- package/src/components/type/Paragraph.tsx +2 -2
- package/src/hooks/usePortalRegistry.ts +36 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { OverlayPlacement } from '../../types';
|
|
3
|
-
|
|
4
|
-
type TooltipContextType = {
|
|
5
|
-
placement: OverlayPlacement;
|
|
6
|
-
floating?: boolean;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const TooltipContext = React.createContext<TooltipContextType | null>(null);
|
|
10
|
-
|
|
11
|
-
TooltipContext.displayName = 'TooltipContext';
|
|
12
|
-
|
|
13
|
-
export default TooltipContext;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OverlayPlacement } from '../../types';
|
|
3
|
+
|
|
4
|
+
type TooltipContextType = {
|
|
5
|
+
placement: OverlayPlacement;
|
|
6
|
+
floating?: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const TooltipContext = React.createContext<TooltipContextType | null>(null);
|
|
10
|
+
|
|
11
|
+
TooltipContext.displayName = 'TooltipContext';
|
|
12
|
+
|
|
13
|
+
export default TooltipContext;
|
|
@@ -21,7 +21,7 @@ const styles = StyleSheet.create({
|
|
|
21
21
|
`,
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function Paragraph(props: ParagraphProps & React.RefAttributes<TextRef>) {
|
|
25
25
|
const { ref, children, lead, style, ...elementProps } = props;
|
|
26
26
|
|
|
27
27
|
const classes = getStyles(styles, ['paragraph', lead && '.lead']);
|
|
@@ -37,4 +37,4 @@ function Heading(props: ParagraphProps & React.RefAttributes<TextRef>) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export default
|
|
40
|
+
export default Paragraph;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_PORTAL_HOST = 'INTERNAL_PRIMITIVE_DEFAULT_HOST_NAME';
|
|
4
|
+
|
|
5
|
+
const registry = new Map<string, Set<string>>();
|
|
6
|
+
|
|
7
|
+
export default function usePortalRegistry(
|
|
8
|
+
name: string,
|
|
9
|
+
hostName: string = DEFAULT_PORTAL_HOST,
|
|
10
|
+
) {
|
|
11
|
+
useLayoutEffect(() => {
|
|
12
|
+
let names = registry.get(hostName);
|
|
13
|
+
|
|
14
|
+
if (!names) {
|
|
15
|
+
names = new Set();
|
|
16
|
+
registry.set(hostName, names);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (names.has(name)) {
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.warn(
|
|
22
|
+
`Portal: A portal with name "${name}" is already registered on host "${hostName}".`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
names.add(name);
|
|
27
|
+
|
|
28
|
+
return () => {
|
|
29
|
+
names.delete(name);
|
|
30
|
+
|
|
31
|
+
if (names.size === 0) {
|
|
32
|
+
registry.delete(hostName);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}, [name, hostName]);
|
|
36
|
+
}
|