@iress-oss/ids-components 6.0.0 → 6.1.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/Autocomplete-BRGD9dSh.js +321 -0
- package/dist/Shadow-D2KoVwxD.js +57 -0
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/Expander/Expander.styles.d.ts +4 -0
- package/dist/components/Expander/Expander.styles.js +5 -1
- package/dist/components/Field/Field.js +47 -47
- package/dist/components/Field/Field.styles.d.ts +2 -2
- package/dist/components/Field/Field.styles.js +8 -2
- package/dist/components/Field/components/FieldHint.js +27 -19
- package/dist/components/Field/index.d.ts +0 -2
- package/dist/components/Field/index.js +1 -3
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.js +10 -9
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.d.ts +8 -1
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.js +6 -4
- package/dist/components/FieldGroup/index.d.ts +2 -0
- package/dist/components/FieldGroup/index.js +3 -0
- package/dist/components/Input/Input.styles.d.ts +4 -4
- package/dist/components/Input/Input.styles.js +4 -4
- package/dist/components/Link/Link.styles.d.ts +1 -0
- package/dist/components/Link/Link.styles.js +4 -1
- package/dist/components/Menu/Menu.js +81 -77
- package/dist/components/Menu/Menu.styles.js +7 -0
- package/dist/components/Menu/MenuGroup/MenuGroup.d.ts +18 -3
- package/dist/components/Menu/MenuGroup/MenuGroup.js +38 -34
- package/dist/components/Menu/MenuHeading/MenuHeading.d.ts +20 -0
- package/dist/components/Menu/MenuHeading/MenuHeading.js +14 -0
- package/dist/components/Menu/MenuItem/MenuItem.styles.js +9 -0
- package/dist/components/Menu/MenuText/MenuText.d.ts +1 -5
- package/dist/components/Menu/MenuText/MenuText.js +11 -17
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.js +4 -3
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/SelectHeading/SelectHeading.js +5 -5
- package/dist/components/Select/SelectTags/SelectTags.js +15 -15
- package/dist/components/Select/components/SelectOptions.js +108 -95
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +1 -0
- package/dist/components/TabSet/TabSet.d.ts +6 -1
- package/dist/components/TabSet/TabSet.js +34 -30
- package/dist/components/TabSet/TabSet.styles.d.ts +1 -1
- package/dist/components/TabSet/TabSet.styles.js +13 -1
- package/dist/components/Tag/Tag.styles.d.ts +14 -14
- package/dist/components/Tag/Tag.styles.js +16 -16
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/Tag/index.js +1 -2
- package/dist/components/{Tag/TagInput → TagInput}/TagInput.d.ts +1 -1
- package/dist/components/{Tag/TagInput → TagInput}/TagInput.js +7 -7
- package/dist/components/TagInput/TagInput.styles.d.ts +1 -0
- package/dist/components/{Tag/TagInput → TagInput}/TagInput.styles.js +2 -2
- package/dist/components/TagInput/index.d.ts +2 -0
- package/dist/components/TagInput/index.js +3 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -2
- package/dist/components/Tooltip/Tooltip.js +48 -42
- package/dist/components/Tooltip/TooltipProvider.d.ts +27 -0
- package/dist/components/Tooltip/TooltipProvider.js +14 -0
- package/dist/components/Tooltip/hooks/useTooltipContainer.d.ts +17 -0
- package/dist/components/Tooltip/hooks/useTooltipContainer.js +5 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/index.js +4 -2
- package/dist/components/ValidationMessage/ValidationMessage.js +2 -2
- package/dist/main.d.ts +2 -0
- package/dist/main.js +125 -121
- package/dist/patterns/DropdownMenu/DropdownMenu.js +113 -102
- package/dist/patterns/DropdownMenu/hooks/useDropdownMenuFlags.d.ts +1 -0
- package/dist/patterns/DropdownMenu/hooks/useDropdownMenuFlags.js +1 -0
- package/dist/patterns/Form/FormField/FormFieldset.d.ts +1 -1
- package/dist/patterns/Form/FormField/FormFieldset.js +1 -1
- package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -0
- package/dist/patterns/Form/components/LongForm.js +3 -1
- package/dist/patterns/Form/components/ShortForm.js +1 -0
- package/dist/patterns/Loading/Loading.styles.d.ts +3 -0
- package/dist/patterns/Loading/Loading.styles.js +4 -1
- package/dist/patterns/Loading/components/PageLoading.js +4 -4
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/dist/patterns/SideNav/SideNav.d.ts +6 -0
- package/dist/patterns/SideNav/SideNav.js +74 -68
- package/dist/patterns/SideNav/SideNav.styles.js +6 -2
- package/dist/style.css +1 -1
- package/dist/{useAutocompleteSearch-BJ_hhoKp.js → useAutocompleteSearch-DxKxs6HH.js} +29 -24
- package/package.json +1 -1
- package/dist/Autocomplete-CuUjmIAw.js +0 -308
- package/dist/Shadow-BL3YAhE_.js +0 -57
- package/dist/components/Tag/TagInput/TagInput.styles.d.ts +0 -1
- /package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.d.ts +0 -0
|
@@ -10,10 +10,10 @@ var t = e({
|
|
|
10
10
|
root: {
|
|
11
11
|
contain: "layout style",
|
|
12
12
|
alignItems: "center",
|
|
13
|
-
bg: "[var(--tag-bg, {colors.colour.neutral.
|
|
13
|
+
bg: "[var(--tag-bg, {colors.colour.neutral.30})]",
|
|
14
14
|
borderRadius: "radius.system.tag",
|
|
15
15
|
border: "divider",
|
|
16
|
-
borderColor: "[var(--tag-
|
|
16
|
+
borderColor: "[var(--tag-bg, {colors.colour.neutral.30})]",
|
|
17
17
|
color: "[var(--tag-color, {colors.colour.neutral.80})]",
|
|
18
18
|
display: "inline-flex",
|
|
19
19
|
gap: "spacing.1",
|
|
@@ -68,71 +68,71 @@ var t = e({
|
|
|
68
68
|
mode: {
|
|
69
69
|
10: { root: {
|
|
70
70
|
"--tag-bg": "{colors.colour.data.subtle.10}",
|
|
71
|
-
"--tag-border": "{colors.colour.data.
|
|
71
|
+
"--tag-border": "{colors.colour.data.bold.10}",
|
|
72
72
|
"--tag-color": "{colors.colour.data.bold.10}"
|
|
73
73
|
} },
|
|
74
74
|
20: { root: {
|
|
75
75
|
"--tag-bg": "{colors.colour.data.subtle.20}",
|
|
76
|
-
"--tag-border": "{colors.colour.data.
|
|
76
|
+
"--tag-border": "{colors.colour.data.bold.20}",
|
|
77
77
|
"--tag-color": "{colors.colour.data.bold.20}"
|
|
78
78
|
} },
|
|
79
79
|
30: { root: {
|
|
80
80
|
"--tag-bg": "{colors.colour.data.subtle.30}",
|
|
81
|
-
"--tag-border": "{colors.colour.data.
|
|
81
|
+
"--tag-border": "{colors.colour.data.bold.30}",
|
|
82
82
|
"--tag-color": "{colors.colour.data.bold.30}"
|
|
83
83
|
} },
|
|
84
84
|
40: { root: {
|
|
85
85
|
"--tag-bg": "{colors.colour.data.subtle.40}",
|
|
86
|
-
"--tag-border": "{colors.colour.data.
|
|
86
|
+
"--tag-border": "{colors.colour.data.bold.40}",
|
|
87
87
|
"--tag-color": "{colors.colour.data.bold.40}"
|
|
88
88
|
} },
|
|
89
89
|
50: { root: {
|
|
90
90
|
"--tag-bg": "{colors.colour.data.subtle.50}",
|
|
91
|
-
"--tag-border": "{colors.colour.data.
|
|
91
|
+
"--tag-border": "{colors.colour.data.bold.50}",
|
|
92
92
|
"--tag-color": "{colors.colour.data.bold.50}"
|
|
93
93
|
} },
|
|
94
94
|
60: { root: {
|
|
95
95
|
"--tag-bg": "{colors.colour.data.subtle.60}",
|
|
96
|
-
"--tag-border": "{colors.colour.data.
|
|
96
|
+
"--tag-border": "{colors.colour.data.bold.60}",
|
|
97
97
|
"--tag-color": "{colors.colour.data.bold.60}"
|
|
98
98
|
} },
|
|
99
99
|
70: { root: {
|
|
100
100
|
"--tag-bg": "{colors.colour.data.subtle.70}",
|
|
101
|
-
"--tag-border": "{colors.colour.data.
|
|
101
|
+
"--tag-border": "{colors.colour.data.bold.70}",
|
|
102
102
|
"--tag-color": "{colors.colour.data.bold.70}"
|
|
103
103
|
} },
|
|
104
104
|
80: { root: {
|
|
105
105
|
"--tag-bg": "{colors.colour.data.subtle.80}",
|
|
106
|
-
"--tag-border": "{colors.colour.data.
|
|
106
|
+
"--tag-border": "{colors.colour.data.bold.80}",
|
|
107
107
|
"--tag-color": "{colors.colour.data.bold.80}"
|
|
108
108
|
} },
|
|
109
109
|
90: { root: {
|
|
110
110
|
"--tag-bg": "{colors.colour.data.subtle.90}",
|
|
111
|
-
"--tag-border": "{colors.colour.data.
|
|
111
|
+
"--tag-border": "{colors.colour.data.bold.90}",
|
|
112
112
|
"--tag-color": "{colors.colour.data.bold.90}"
|
|
113
113
|
} },
|
|
114
114
|
danger: { root: {
|
|
115
115
|
"--tag-bg": "{colors.colour.system.danger.surface}",
|
|
116
|
-
"--tag-border": "{colors.colour.system.danger.
|
|
116
|
+
"--tag-border": "{colors.colour.system.danger.text}",
|
|
117
117
|
"--tag-color": "{colors.colour.system.danger.text}"
|
|
118
118
|
} },
|
|
119
119
|
info: { root: {
|
|
120
120
|
"--tag-bg": "{colors.colour.system.info.surface}",
|
|
121
|
-
"--tag-border": "{colors.colour.system.info.
|
|
121
|
+
"--tag-border": "{colors.colour.system.info.text}",
|
|
122
122
|
"--tag-color": "{colors.colour.system.info.text}"
|
|
123
123
|
} },
|
|
124
124
|
success: { root: {
|
|
125
125
|
"--tag-bg": "{colors.colour.system.success.surface}",
|
|
126
|
-
"--tag-border": "{colors.colour.system.success.
|
|
126
|
+
"--tag-border": "{colors.colour.system.success.text}",
|
|
127
127
|
"--tag-color": "{colors.colour.system.success.text}"
|
|
128
128
|
} },
|
|
129
129
|
warning: { root: {
|
|
130
130
|
"--tag-bg": "{colors.colour.system.warning.surface}",
|
|
131
|
-
"--tag-border": "{colors.colour.system.warning.
|
|
131
|
+
"--tag-border": "{colors.colour.system.warning.text}",
|
|
132
132
|
"--tag-color": "{colors.colour.system.warning.text}"
|
|
133
133
|
} }
|
|
134
134
|
},
|
|
135
|
-
bordered: { true: { root: { borderColor: "[
|
|
135
|
+
bordered: { true: { root: { borderColor: "[var(--tag-border, {colors.colour.neutral.70})]" } } }
|
|
136
136
|
},
|
|
137
137
|
compoundVariants: [{
|
|
138
138
|
bordered: !0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
|
-
import { InputBaseElement, InputRef, IressInputProps } from '
|
|
2
|
+
import { InputBaseElement, InputRef, IressInputProps } from '../Input';
|
|
3
3
|
import { IressTagProps } from '../Tag';
|
|
4
4
|
export interface IressTagInputProps extends Omit<IressInputProps<string>, 'defaultValue' | 'onChange' | 'prepend' | 'value' | 'rows'> {
|
|
5
5
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { propagateTestid as e } from "
|
|
2
|
-
import { useControlledState as t } from "
|
|
3
|
-
import { IressInput as n } from "
|
|
4
|
-
import { getValueAsEvent as r } from "
|
|
5
|
-
import { IressTag as i } from "../Tag.js";
|
|
6
|
-
import { IressInline as a } from "
|
|
1
|
+
import { propagateTestid as e } from "../../helpers/utility/propagateTestid.js";
|
|
2
|
+
import { useControlledState as t } from "../../hooks/useControlledState.js";
|
|
3
|
+
import { IressInput as n } from "../Input/Input.js";
|
|
4
|
+
import { getValueAsEvent as r } from "../../helpers/form/getValueAsEvent.js";
|
|
5
|
+
import { IressTag as i } from "../Tag/Tag.js";
|
|
6
|
+
import { IressInline as a } from "../Inline/Inline.js";
|
|
7
7
|
import { tagInput as o } from "./TagInput.styles.js";
|
|
8
8
|
import { forwardRef as s, useCallback as c, useState as l } from "react";
|
|
9
9
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
-
//#region src/components/
|
|
10
|
+
//#region src/components/TagInput/TagInput.tsx
|
|
11
11
|
var f = ({ "data-testid": t, onTagDelete: n, onTagDeleteAll: r, onTagDeleteButtonBlur: a, selectedOptionsTagText: o, tags: s = [], tagLimit: c = 5 }) => s.length ? s.length <= c ? s.map((r) => /* @__PURE__ */ u(i, {
|
|
12
12
|
deleteButtonText: `Delete ${r}`,
|
|
13
13
|
onDelete: n,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tagInput: import('../../styled-system/types').SlotRecipeRuntimeFn<"input" | "tag", import('../../styled-system/types').SlotRecipeVariantRecord<"input" | "tag">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "
|
|
2
|
-
//#region src/components/
|
|
1
|
+
import { t as e } from "../../sva-DOLIp5Dd.js";
|
|
2
|
+
//#region src/components/TagInput/TagInput.styles.ts
|
|
3
3
|
var t = e({
|
|
4
4
|
slots: ["input", "tag"],
|
|
5
5
|
base: { input: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { FloatingUIAligns, IressStyledProps } from '../../types';
|
|
2
|
+
import { FloatingUIAligns, FloatingUIContainer, IressStyledProps } from '../../types';
|
|
3
3
|
export interface IressTooltipProps extends IressStyledProps {
|
|
4
4
|
/**
|
|
5
5
|
* Sets the alignment of the popover relative to the activator element.
|
|
@@ -10,6 +10,11 @@ export interface IressTooltipProps extends IressStyledProps {
|
|
|
10
10
|
* The element to add a tooltip to.
|
|
11
11
|
*/
|
|
12
12
|
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The container element to render the tooltip into.
|
|
15
|
+
* Overrides the container set by `IressTooltipProvider`.
|
|
16
|
+
*/
|
|
17
|
+
container?: FloatingUIContainer;
|
|
13
18
|
/**
|
|
14
19
|
* Sets the tooltip display delay in milliseconds.
|
|
15
20
|
* @default 500
|
|
@@ -32,6 +37,6 @@ export interface IressTooltipProps extends IressStyledProps {
|
|
|
32
37
|
variant?: 'rich';
|
|
33
38
|
}
|
|
34
39
|
export declare const IressTooltip: {
|
|
35
|
-
({ children, className, align, delay, open, tooltipText, variant, "data-testid": testid, ...restProps }: IressTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
({ children, className, align, container, delay, open, tooltipText, variant, "data-testid": testid, ...restProps }: IressTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
36
41
|
displayName: string;
|
|
37
42
|
};
|
|
@@ -5,55 +5,61 @@ import { idsLogger as r } from "../../helpers/utility/idsLogger.js";
|
|
|
5
5
|
import { propagateTestid as i } from "../../helpers/utility/propagateTestid.js";
|
|
6
6
|
import { toArray as a } from "../../helpers/formatting/toArray.js";
|
|
7
7
|
import { focusableElements as o } from "../../helpers/dom/focusableElements.js";
|
|
8
|
-
import { C as s, S as c, d as l, g as u, h as d, m as f,
|
|
9
|
-
import { tooltip as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { C as s, S as c, d as l, g as u, h as d, m as f, s as p, u as m, w as h, x as g, y as _ } from "../../floating-ui.react-COiJC198.js";
|
|
9
|
+
import { tooltip as v } from "./Tooltip.styles.js";
|
|
10
|
+
import { useTooltipContainer as y } from "./hooks/useTooltipContainer.js";
|
|
11
|
+
import { Fragment as b, useEffect as x, useState as S } from "react";
|
|
12
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
13
|
-
var
|
|
14
|
-
let
|
|
15
|
-
placement:
|
|
16
|
-
open:
|
|
17
|
-
onOpenChange:
|
|
14
|
+
var T = ({ children: T, className: E, align: D = "top", container: O, delay: k = 500, open: A = !1, tooltipText: j, variant: M, "data-testid": N, ...P }) => {
|
|
15
|
+
let F = v({ variant: M }), I = D === "auto", { container: L } = y(), R = O === void 0 ? L : O, [z, B] = S(A), { refs: V, floatingStyles: H, context: U } = l({
|
|
16
|
+
placement: I ? void 0 : D,
|
|
17
|
+
open: z,
|
|
18
|
+
onOpenChange: B,
|
|
18
19
|
middleware: [
|
|
19
20
|
s(5),
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
I ? g() : c(),
|
|
22
|
+
h()
|
|
22
23
|
]
|
|
23
|
-
}), { getReferenceProps:
|
|
24
|
-
d(
|
|
24
|
+
}), { getReferenceProps: W, getFloatingProps: G } = u([
|
|
25
|
+
d(U, {
|
|
25
26
|
move: !1,
|
|
26
|
-
restMs:
|
|
27
|
+
restMs: k
|
|
27
28
|
}),
|
|
28
|
-
f(
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
f(U),
|
|
30
|
+
m(U),
|
|
31
|
+
_(U, { role: "tooltip" })
|
|
31
32
|
]);
|
|
32
|
-
|
|
33
|
-
!
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children:
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
x(() => {
|
|
34
|
+
!T || !V.reference.current || o(V.reference.current).length > 0 || r("IressTooltip: The content that activates the tooltip is not focusable,\n which is a failure of WCAG Level AA Success Criterion 1.4.13 - Content on Hover or Focus.\n To fix this warning, change the activator to either IressButton, IressMenuItem or another focusable component.", "warn");
|
|
35
|
+
}, [T, V.reference]);
|
|
36
|
+
let K = z && /* @__PURE__ */ C("div", {
|
|
37
|
+
className: F.content,
|
|
38
|
+
style: H,
|
|
39
|
+
"data-testid": i(N, "tooltip-text"),
|
|
40
|
+
ref: V.setFloating,
|
|
41
|
+
...G(),
|
|
42
|
+
children: M === "rich" ? a(j).map((e, t) => /* @__PURE__ */ C("span", {
|
|
43
|
+
className: t === 0 ? F.richName : F.richMeta,
|
|
44
|
+
children: e
|
|
45
|
+
}, t)) : a(j).map((e, t, n) => /* @__PURE__ */ w(b, { children: [e, t < n.length - 1 && /* @__PURE__ */ C("br", {})] }, t))
|
|
46
|
+
});
|
|
47
|
+
return /* @__PURE__ */ w(t.div, {
|
|
48
|
+
className: e(F.root, E, n.Tooltip),
|
|
49
|
+
...P,
|
|
50
|
+
"data-testid": N,
|
|
51
|
+
children: [/* @__PURE__ */ C("div", {
|
|
52
|
+
className: F.activator,
|
|
53
|
+
"data-testid": i(N, "activator"),
|
|
54
|
+
ref: V.setReference,
|
|
55
|
+
...W(),
|
|
56
|
+
children: T
|
|
57
|
+
}), R ? /* @__PURE__ */ C(p, {
|
|
58
|
+
root: R,
|
|
59
|
+
children: K
|
|
60
|
+
}) : K]
|
|
55
61
|
});
|
|
56
62
|
};
|
|
57
|
-
|
|
63
|
+
T.displayName = "IressTooltip";
|
|
58
64
|
//#endregion
|
|
59
|
-
export {
|
|
65
|
+
export { T as IressTooltip };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { FloatingUIContainer } from '../../types';
|
|
3
|
+
export interface IressTooltipProviderProps extends PropsWithChildren {
|
|
4
|
+
/**
|
|
5
|
+
* The container element to render nested tooltips into.
|
|
6
|
+
* By default, tooltips render where their parent is rendered.
|
|
7
|
+
*
|
|
8
|
+
* Individual tooltips can override this by setting their own `container` prop.
|
|
9
|
+
*/
|
|
10
|
+
container?: FloatingUIContainer;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Provides a shared container context for nested tooltips to render into.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { IressTooltipProvider } from '@iress-oss/ids-components';
|
|
18
|
+
*
|
|
19
|
+
* <IressTooltipProvider container={document.getElementById('tooltip-root')}>
|
|
20
|
+
* {children}
|
|
21
|
+
* </IressTooltipProvider>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const IressTooltipProvider: {
|
|
25
|
+
({ children, container, }: IressTooltipProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TooltipContainerContext as e } from "./hooks/useTooltipContainer.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Tooltip/TooltipProvider.tsx
|
|
5
|
+
var r = ({ children: r, container: i }) => {
|
|
6
|
+
let a = t(() => ({ container: i }), [i]);
|
|
7
|
+
return /* @__PURE__ */ n(e.Provider, {
|
|
8
|
+
value: a,
|
|
9
|
+
children: r
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
r.displayName = "IressTooltipProvider";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as IressTooltipProvider };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FloatingUIContainer } from '../../../types';
|
|
2
|
+
export interface TooltipContainerContextValue {
|
|
3
|
+
/**
|
|
4
|
+
* The container element to render tooltips into.
|
|
5
|
+
* By default, tooltips render where their parent is rendered.
|
|
6
|
+
*/
|
|
7
|
+
container?: FloatingUIContainer;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Context used by `IressTooltipProvider` to supply a shared container
|
|
11
|
+
* to all nested `IressTooltip` components.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TooltipContainerContext: import('react').Context<TooltipContainerContextValue | undefined>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the container supplied by the nearest `IressTooltipProvider`, if any.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useTooltipContainer: () => TooltipContainerContextValue;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export * from './Tooltip';
|
|
2
2
|
export * from './Tooltip.styles';
|
|
3
|
+
export { IressTooltipProvider } from './TooltipProvider';
|
|
4
|
+
export type { IressTooltipProviderProps } from './TooltipProvider';
|
|
5
|
+
export { TooltipContainerContext, useTooltipContainer, } from './hooks/useTooltipContainer';
|
|
6
|
+
export type { TooltipContainerContextValue } from './hooks/useTooltipContainer';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { tooltip as e } from "./Tooltip.styles.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { TooltipContainerContext as t, useTooltipContainer as n } from "./hooks/useTooltipContainer.js";
|
|
3
|
+
import { IressTooltip as r } from "./Tooltip.js";
|
|
4
|
+
import { IressTooltipProvider as i } from "./TooltipProvider.js";
|
|
5
|
+
export { r as IressTooltip, i as IressTooltipProvider, t as TooltipContainerContext, e as tooltip, n as useTooltipContainer };
|
|
@@ -7,7 +7,7 @@ import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
|
7
7
|
//#region src/components/ValidationMessage/ValidationMessage.tsx
|
|
8
8
|
var s = ({ prefix: e, status: t = "danger" }) => e || `${t === "danger" ? "Error" : i(t)}: `, c = (e) => e.tagName === "SELECT" && !e.disabled || !!e.name && !e.disabled && e.type !== "file" && e.type !== "reset" && e.type !== "submit" && e.type !== "button", l = ({ children: i, className: l, linkToTarget: u, prefix: d, status: f = "danger", visiblePrefix: p = !1, ...m }) => /* @__PURE__ */ o(r, {
|
|
9
9
|
color: `colour.system.${f}.text`,
|
|
10
|
-
display: "
|
|
10
|
+
display: "flex",
|
|
11
11
|
...m,
|
|
12
12
|
element: u ? "a" : "div",
|
|
13
13
|
href: u ? `#${u}` : void 0,
|
|
@@ -19,7 +19,7 @@ var s = ({ prefix: e, status: t = "danger" }) => e || `${t === "danger" ? "Error
|
|
|
19
19
|
className: e(l, n.ValidationMessage),
|
|
20
20
|
children: [/* @__PURE__ */ a(t.div, {
|
|
21
21
|
srOnly: p ? void 0 : !0,
|
|
22
|
-
display: "inline",
|
|
22
|
+
display: "inline-flex",
|
|
23
23
|
pe: "spacing.1",
|
|
24
24
|
children: /* @__PURE__ */ a(s, {
|
|
25
25
|
prefix: d,
|
package/dist/main.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './components/Container';
|
|
|
11
11
|
export * from './components/Divider';
|
|
12
12
|
export * from './components/Expander';
|
|
13
13
|
export * from './components/Field';
|
|
14
|
+
export * from './components/FieldGroup';
|
|
14
15
|
export * from './components/Hide';
|
|
15
16
|
export * from './components/Icon';
|
|
16
17
|
export * from './components/Image';
|
|
@@ -44,6 +45,7 @@ export * from './components/Styled';
|
|
|
44
45
|
export * from './components/Table';
|
|
45
46
|
export * from './components/TabSet';
|
|
46
47
|
export * from './components/Tag';
|
|
48
|
+
export * from './components/TagInput';
|
|
47
49
|
export * from './components/Text';
|
|
48
50
|
export * from './components/Toaster';
|
|
49
51
|
export * from './components/Toggle';
|