@iress-oss/ids-components 6.0.1 → 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/Field/Field.js +47 -47
- package/dist/components/Field/Field.styles.d.ts +1 -1
- package/dist/components/Field/Field.styles.js +6 -0
- 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 +9 -9
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.d.ts +1 -1
- package/dist/components/{Field/FieldGroup → FieldGroup}/FieldGroup.styles.js +2 -2
- 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-OHZiBoEb.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
|
@@ -3,6 +3,11 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
import { FormControlValue, IressStyledProps } from '../../types';
|
|
4
4
|
import { IressCustomiseSlot } from '../../interfaces';
|
|
5
5
|
export interface IressTabSetProps extends Omit<IressStyledProps, 'onChange'> {
|
|
6
|
+
/**
|
|
7
|
+
* Content rendered alongside the tablist in the tab bar row, but outside the tablist itself.
|
|
8
|
+
* Useful for placing action buttons (e.g. "Add tab") at the end of the tab bar.
|
|
9
|
+
*/
|
|
10
|
+
append?: ReactNode;
|
|
6
11
|
/**
|
|
7
12
|
* Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
8
13
|
*/
|
|
@@ -43,6 +48,6 @@ export interface IressTabSetProps extends Omit<IressStyledProps, 'onChange'> {
|
|
|
43
48
|
type?: 'primary' | 'secondary';
|
|
44
49
|
}
|
|
45
50
|
export declare const IressTabSet: {
|
|
46
|
-
({ children, className, defaultSelected, layout, onChange, panelStyle, selected, tabHolderStyle, type, ...restProps }: IressTabSetProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
({ append, children, className, defaultSelected, layout, onChange, panelStyle, selected, tabHolderStyle, type, ...restProps }: IressTabSetProps): import("react/jsx-runtime").JSX.Element;
|
|
47
52
|
displayName: string;
|
|
48
53
|
};
|
|
@@ -62,18 +62,18 @@ var g = (e) => {
|
|
|
62
62
|
ref: i,
|
|
63
63
|
style: t
|
|
64
64
|
});
|
|
65
|
-
}, v = ({
|
|
66
|
-
let [
|
|
67
|
-
layout:
|
|
68
|
-
overflowStart:
|
|
69
|
-
overflowEnd:
|
|
70
|
-
type:
|
|
65
|
+
}, v = ({ append: a, children: c, className: u, defaultSelected: v, layout: y = "top-left", onChange: b, panelStyle: x, selected: S, tabHolderStyle: C, type: w, ...T }) => {
|
|
66
|
+
let [E, D] = f(null), [O, k] = f(!1), [A, j] = f(!1), M = d(null), N = s({
|
|
67
|
+
layout: y,
|
|
68
|
+
overflowStart: O,
|
|
69
|
+
overflowEnd: A,
|
|
70
|
+
type: w
|
|
71
71
|
});
|
|
72
72
|
return l(() => {
|
|
73
|
-
let e =
|
|
73
|
+
let e = M.current?.querySelector("[role=\"tablist\"]"), t = () => {
|
|
74
74
|
if (e) {
|
|
75
75
|
let { scrollWidth: t, clientWidth: n, scrollLeft: r } = e;
|
|
76
|
-
t > n ? (
|
|
76
|
+
t > n ? (k(r > 1), j(r < t - n - 1)) : (k(!1), j(!1));
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
t(), e?.addEventListener("scroll", t);
|
|
@@ -81,40 +81,44 @@ var g = (e) => {
|
|
|
81
81
|
return e && typeof ResizeObserver < "u" && (n = new ResizeObserver(t), n.observe(e)), () => {
|
|
82
82
|
e?.removeEventListener("scroll", t), n?.disconnect();
|
|
83
83
|
};
|
|
84
|
-
}, [
|
|
85
|
-
defaultSelected:
|
|
86
|
-
onChange:
|
|
87
|
-
panel:
|
|
88
|
-
selected:
|
|
89
|
-
type:
|
|
84
|
+
}, [c]), /* @__PURE__ */ m(o, {
|
|
85
|
+
defaultSelected: v,
|
|
86
|
+
onChange: b,
|
|
87
|
+
panel: E,
|
|
88
|
+
selected: S,
|
|
89
|
+
type: w,
|
|
90
90
|
children: /* @__PURE__ */ m(t.div, {
|
|
91
|
-
className: e(
|
|
92
|
-
...
|
|
93
|
-
children:
|
|
94
|
-
...
|
|
95
|
-
ref:
|
|
96
|
-
className: e(
|
|
91
|
+
className: e(u, N.root, n.TabSet),
|
|
92
|
+
...T,
|
|
93
|
+
children: c && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h(t.div, {
|
|
94
|
+
...C,
|
|
95
|
+
ref: M,
|
|
96
|
+
className: e(N.listHolder, C?.className),
|
|
97
97
|
children: [
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
O && /* @__PURE__ */ m("div", { className: N.overflowStartIndicator }),
|
|
99
|
+
A && /* @__PURE__ */ m("div", { className: N.overflowEndIndicator }),
|
|
100
100
|
/* @__PURE__ */ h(i, {
|
|
101
101
|
render: /* @__PURE__ */ m("div", {
|
|
102
|
-
className:
|
|
102
|
+
className: N.list,
|
|
103
103
|
role: "tablist"
|
|
104
104
|
}),
|
|
105
105
|
loop: !1,
|
|
106
106
|
children: [
|
|
107
|
-
/* @__PURE__ */ m(_, { className:
|
|
108
|
-
/* @__PURE__ */ m(g, { className:
|
|
109
|
-
|
|
107
|
+
/* @__PURE__ */ m(_, { className: N.activeIndicator }),
|
|
108
|
+
/* @__PURE__ */ m(g, { className: N.hoverIndicator }),
|
|
109
|
+
c
|
|
110
110
|
]
|
|
111
|
+
}),
|
|
112
|
+
a && /* @__PURE__ */ m("div", {
|
|
113
|
+
className: N.append,
|
|
114
|
+
children: a
|
|
111
115
|
})
|
|
112
116
|
]
|
|
113
117
|
}), /* @__PURE__ */ m(t.div, {
|
|
114
|
-
...
|
|
115
|
-
className: e(
|
|
116
|
-
"data-testid":
|
|
117
|
-
ref:
|
|
118
|
+
...x,
|
|
119
|
+
className: e(N.panel, x?.className),
|
|
120
|
+
"data-testid": x?.["data-testid"] ?? r(T["data-testid"], "panel"),
|
|
121
|
+
ref: D
|
|
118
122
|
})] })
|
|
119
123
|
})
|
|
120
124
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const tabSet: import('../../styled-system/types').SlotRecipeRuntimeFn<"list" | "root" | "hoverIndicator" | "panel" | "listHolder" | "activeIndicator" | "overflowEndIndicator" | "overflowStartIndicator", {
|
|
1
|
+
export declare const tabSet: import('../../styled-system/types').SlotRecipeRuntimeFn<"append" | "list" | "root" | "hoverIndicator" | "panel" | "listHolder" | "activeIndicator" | "overflowEndIndicator" | "overflowStartIndicator", {
|
|
2
2
|
layout: {
|
|
3
3
|
'top-left': {
|
|
4
4
|
list: {
|
|
@@ -6,6 +6,7 @@ var t = e({
|
|
|
6
6
|
"list",
|
|
7
7
|
"listHolder",
|
|
8
8
|
"panel",
|
|
9
|
+
"append",
|
|
9
10
|
"activeIndicator",
|
|
10
11
|
"hoverIndicator",
|
|
11
12
|
"overflowEndIndicator",
|
|
@@ -22,6 +23,8 @@ var t = e({
|
|
|
22
23
|
overflowX: "clip",
|
|
23
24
|
overflowY: "visible",
|
|
24
25
|
pt: "spacing.2",
|
|
26
|
+
display: "flex",
|
|
27
|
+
alignItems: "stretch",
|
|
25
28
|
_after: {
|
|
26
29
|
content: "\"\"",
|
|
27
30
|
position: "absolute",
|
|
@@ -32,13 +35,22 @@ var t = e({
|
|
|
32
35
|
pointerEvents: "none"
|
|
33
36
|
}
|
|
34
37
|
},
|
|
38
|
+
append: {
|
|
39
|
+
display: "flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
marginLeft: "auto",
|
|
42
|
+
flexShrink: "[0]",
|
|
43
|
+
pb: "spacing.1"
|
|
44
|
+
},
|
|
35
45
|
list: {
|
|
36
46
|
display: "flex",
|
|
37
47
|
flexWrap: "nowrap",
|
|
38
48
|
scrollable: "x",
|
|
39
49
|
overflowY: "visible",
|
|
40
50
|
scrollSnapType: "[x proximity]",
|
|
41
|
-
position: "relative"
|
|
51
|
+
position: "relative",
|
|
52
|
+
flex: "[1 1 auto]",
|
|
53
|
+
minWidth: "[0]"
|
|
42
54
|
},
|
|
43
55
|
panel: {
|
|
44
56
|
textStyle: "typography.body.md",
|
|
@@ -48,91 +48,91 @@ export declare const tag: import('../../styled-system/types').SlotRecipeRuntimeF
|
|
|
48
48
|
'10': {
|
|
49
49
|
root: {
|
|
50
50
|
'--tag-bg': "{colors.colour.data.subtle.10}";
|
|
51
|
-
'--tag-border': "{colors.colour.data.
|
|
51
|
+
'--tag-border': "{colors.colour.data.bold.10}";
|
|
52
52
|
'--tag-color': "{colors.colour.data.bold.10}";
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
'20': {
|
|
56
56
|
root: {
|
|
57
57
|
'--tag-bg': "{colors.colour.data.subtle.20}";
|
|
58
|
-
'--tag-border': "{colors.colour.data.
|
|
58
|
+
'--tag-border': "{colors.colour.data.bold.20}";
|
|
59
59
|
'--tag-color': "{colors.colour.data.bold.20}";
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
'30': {
|
|
63
63
|
root: {
|
|
64
64
|
'--tag-bg': "{colors.colour.data.subtle.30}";
|
|
65
|
-
'--tag-border': "{colors.colour.data.
|
|
65
|
+
'--tag-border': "{colors.colour.data.bold.30}";
|
|
66
66
|
'--tag-color': "{colors.colour.data.bold.30}";
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
'40': {
|
|
70
70
|
root: {
|
|
71
71
|
'--tag-bg': "{colors.colour.data.subtle.40}";
|
|
72
|
-
'--tag-border': "{colors.colour.data.
|
|
72
|
+
'--tag-border': "{colors.colour.data.bold.40}";
|
|
73
73
|
'--tag-color': "{colors.colour.data.bold.40}";
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
'50': {
|
|
77
77
|
root: {
|
|
78
78
|
'--tag-bg': "{colors.colour.data.subtle.50}";
|
|
79
|
-
'--tag-border': "{colors.colour.data.
|
|
79
|
+
'--tag-border': "{colors.colour.data.bold.50}";
|
|
80
80
|
'--tag-color': "{colors.colour.data.bold.50}";
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
'60': {
|
|
84
84
|
root: {
|
|
85
85
|
'--tag-bg': "{colors.colour.data.subtle.60}";
|
|
86
|
-
'--tag-border': "{colors.colour.data.
|
|
86
|
+
'--tag-border': "{colors.colour.data.bold.60}";
|
|
87
87
|
'--tag-color': "{colors.colour.data.bold.60}";
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
'70': {
|
|
91
91
|
root: {
|
|
92
92
|
'--tag-bg': "{colors.colour.data.subtle.70}";
|
|
93
|
-
'--tag-border': "{colors.colour.data.
|
|
93
|
+
'--tag-border': "{colors.colour.data.bold.70}";
|
|
94
94
|
'--tag-color': "{colors.colour.data.bold.70}";
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
97
|
'80': {
|
|
98
98
|
root: {
|
|
99
99
|
'--tag-bg': "{colors.colour.data.subtle.80}";
|
|
100
|
-
'--tag-border': "{colors.colour.data.
|
|
100
|
+
'--tag-border': "{colors.colour.data.bold.80}";
|
|
101
101
|
'--tag-color': "{colors.colour.data.bold.80}";
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
'90': {
|
|
105
105
|
root: {
|
|
106
106
|
'--tag-bg': "{colors.colour.data.subtle.90}";
|
|
107
|
-
'--tag-border': "{colors.colour.data.
|
|
107
|
+
'--tag-border': "{colors.colour.data.bold.90}";
|
|
108
108
|
'--tag-color': "{colors.colour.data.bold.90}";
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
111
|
danger: {
|
|
112
112
|
root: {
|
|
113
113
|
'--tag-bg': "{colors.colour.system.danger.surface}";
|
|
114
|
-
'--tag-border': "{colors.colour.system.danger.
|
|
114
|
+
'--tag-border': "{colors.colour.system.danger.text}";
|
|
115
115
|
'--tag-color': "{colors.colour.system.danger.text}";
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
118
|
info: {
|
|
119
119
|
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
|
};
|
|
125
125
|
success: {
|
|
126
126
|
root: {
|
|
127
127
|
'--tag-bg': "{colors.colour.system.success.surface}";
|
|
128
|
-
'--tag-border': "{colors.colour.system.success.
|
|
128
|
+
'--tag-border': "{colors.colour.system.success.text}";
|
|
129
129
|
'--tag-color': "{colors.colour.system.success.text}";
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
132
|
warning: {
|
|
133
133
|
root: {
|
|
134
134
|
'--tag-bg': "{colors.colour.system.warning.surface}";
|
|
135
|
-
'--tag-border': "{colors.colour.system.warning.
|
|
135
|
+
'--tag-border': "{colors.colour.system.warning.text}";
|
|
136
136
|
'--tag-color': "{colors.colour.system.warning.text}";
|
|
137
137
|
};
|
|
138
138
|
};
|
|
@@ -140,7 +140,7 @@ export declare const tag: import('../../styled-system/types').SlotRecipeRuntimeF
|
|
|
140
140
|
bordered: {
|
|
141
141
|
true: {
|
|
142
142
|
root: {
|
|
143
|
-
borderColor: "[
|
|
143
|
+
borderColor: "[var(--tag-border, {colors.colour.neutral.70})]";
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
146
|
};
|
|
@@ -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 };
|