@iress-oss/ids-components 6.0.0-alpha.12 → 6.0.0-alpha.14
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/{Button-ZGbOkyOo.js → Button-BTkololu.js} +124 -117
- package/dist/{Provider-BPoPUE-B.js → Provider-B87u_maF.js} +4 -4
- package/dist/components/Alert/Alert.js +35 -36
- package/dist/components/Alert/Alert.styles.d.ts +24 -32
- package/dist/components/Alert/Alert.styles.js +24 -32
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/CloseButton/CloseButton.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Card/Card.styles.js +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +24 -20
- package/dist/components/Divider/Divider.styles.d.ts +6 -1
- package/dist/components/Divider/Divider.styles.js +17 -3
- package/dist/components/Expander/Expander.js +65 -52
- package/dist/components/Expander/Expander.styles.d.ts +23 -11
- package/dist/components/Expander/Expander.styles.js +44 -31
- package/dist/components/Filter/Filter.js +120 -117
- package/dist/components/Filter/Filter.styles.js +5 -3
- package/dist/components/Filter/components/FilterResetButton.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Link/Link.styles.js +0 -1
- package/dist/components/Menu/MenuText/MenuText.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.styles.d.ts +1 -1
- package/dist/components/Modal/Modal.styles.js +1 -1
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Provider/Provider.js +1 -1
- package/dist/components/Provider/index.js +1 -1
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +19 -19
- package/dist/components/RichSelect/SelectTags/SelectTags.js +1 -1
- package/dist/components/SkipLink/SkipLink.js +1 -1
- package/dist/components/Slideout/components/SlideoutInner.js +1 -1
- package/dist/components/Slideout/hooks/usePushElement.js +1 -1
- package/dist/components/Stack/Stack.d.ts +5 -1
- package/dist/components/Stack/Stack.styles.d.ts +20 -0
- package/dist/components/Stack/Stack.styles.js +23 -3
- package/dist/components/TabSet/TabSet.styles.js +1 -1
- package/dist/components/Tag/Tag.d.ts +27 -4
- package/dist/components/Tag/Tag.js +50 -33
- package/dist/components/Tag/Tag.styles.d.ts +25 -0
- package/dist/components/Tag/Tag.styles.js +39 -12
- package/dist/components/Tag/TagInput/TagInput.js +51 -48
- package/dist/components/Tag/TagInput/TagInput.styles.js +4 -10
- package/dist/components/Toaster/components/Toast/Toast.d.ts +5 -3
- package/dist/components/Toaster/components/Toast/Toast.js +65 -58
- package/dist/components/Toaster/components/Toast/Toast.styles.d.ts +31 -1
- package/dist/components/Toaster/components/Toast/Toast.styles.js +33 -6
- package/dist/{index-gmMGso0u.js → index-Bm5rQqn5.js} +5 -1
- package/dist/interfaces.d.ts +7 -2
- package/dist/main.js +2 -2
- package/dist/patterns/Loading/components/LongLoading.js +28 -28
- package/dist/patterns/Loading/components/PageLoading.js +32 -32
- package/dist/patterns/Loading/components/ValidateLoading.js +1 -1
- package/dist/patterns/Loading/hooks/useEstimatedProgressValue.js +14 -14
- package/dist/patterns/Shadow/Shadow.js +469 -776
- package/dist/style.css +1 -1
- package/dist/styled-system/recipes/button.d.ts +1 -1
- package/dist/styled-system/tokens/tokens.d.ts +1 -1
- package/dist/styled-system/types/prop-type.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
1
|
+
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { c as p } from "../../../cx-DN21T1EH.js";
|
|
3
3
|
import { richSelect as d } from "../RichSelect.styles.js";
|
|
4
4
|
import { forwardRef as f, useRef as u, useImperativeHandle as I } from "react";
|
|
@@ -8,7 +8,7 @@ import "../../Menu/MenuDivider/MenuDivider.js";
|
|
|
8
8
|
import "../../Menu/MenuItem/MenuItem.js";
|
|
9
9
|
import { IressMenuHeading as g } from "../../Menu/MenuText/MenuText.js";
|
|
10
10
|
import { GlobalCSSClass as a } from "../../../enums.js";
|
|
11
|
-
import { I as
|
|
11
|
+
import { I as h } from "../../../Button-BTkololu.js";
|
|
12
12
|
import "../../Button/CloseButton/CloseButton.js";
|
|
13
13
|
import "../../Popover/Popover.js";
|
|
14
14
|
import "../../Popover/Popover.styles.js";
|
|
@@ -16,22 +16,22 @@ import "../../Popover/InputPopover/InputPopover.js";
|
|
|
16
16
|
import "../../Popover/hooks/useFloatingPopover.js";
|
|
17
17
|
import { usePopoverItem as v } from "../../Popover/hooks/usePopoverItem.js";
|
|
18
18
|
import "../../Inline/Inline.styles.js";
|
|
19
|
-
import { IressInline as
|
|
20
|
-
const
|
|
21
|
-
(
|
|
22
|
-
const e = u(null), { isActiveInPopover:
|
|
23
|
-
onKeyDown:
|
|
19
|
+
import { IressInline as y } from "../../Inline/Inline.js";
|
|
20
|
+
const c = d(), S = f(
|
|
21
|
+
(r, i) => {
|
|
22
|
+
const e = u(null), { isActiveInPopover: o, ...t } = v("", {
|
|
23
|
+
onKeyDown: r.onKeyDown
|
|
24
24
|
});
|
|
25
25
|
return I(i, () => e.current), /* @__PURE__ */ s(
|
|
26
|
-
|
|
26
|
+
h,
|
|
27
27
|
{
|
|
28
|
-
...
|
|
28
|
+
...r,
|
|
29
29
|
...t,
|
|
30
30
|
className: p(
|
|
31
|
-
|
|
31
|
+
c.dropdownClear,
|
|
32
32
|
a.RichSelectClearButton
|
|
33
33
|
),
|
|
34
|
-
active:
|
|
34
|
+
active: o,
|
|
35
35
|
mode: "tertiary",
|
|
36
36
|
ref: (n) => {
|
|
37
37
|
e.current = n, t?.ref?.(e.current);
|
|
@@ -40,31 +40,31 @@ const l = d(), S = f(
|
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
), w = ({
|
|
43
|
-
children:
|
|
43
|
+
children: r,
|
|
44
44
|
className: i,
|
|
45
45
|
clearAll: e,
|
|
46
|
-
onClearAll:
|
|
47
|
-
textStyle: t = "typography.
|
|
46
|
+
onClearAll: o,
|
|
47
|
+
textStyle: t = "typography.heading.4",
|
|
48
48
|
...n
|
|
49
49
|
}) => /* @__PURE__ */ s(
|
|
50
50
|
g,
|
|
51
51
|
{
|
|
52
52
|
...n,
|
|
53
53
|
className: p(
|
|
54
|
-
|
|
54
|
+
c.dropdownSelectedHeading,
|
|
55
55
|
i,
|
|
56
56
|
a.RichSelectHeading
|
|
57
57
|
),
|
|
58
58
|
role: void 0,
|
|
59
59
|
textStyle: t,
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
|
|
60
|
+
children: /* @__PURE__ */ l(y, { horizontalAlign: "between", verticalAlign: "middle", children: [
|
|
61
|
+
r,
|
|
62
62
|
e && /* @__PURE__ */ s(
|
|
63
63
|
S,
|
|
64
64
|
{
|
|
65
|
-
onClick:
|
|
65
|
+
onClick: o,
|
|
66
66
|
onKeyDown: (m) => {
|
|
67
|
-
m.key === "Enter" && (m.preventDefault(),
|
|
67
|
+
m.key === "Enter" && (m.preventDefault(), o?.(m));
|
|
68
68
|
},
|
|
69
69
|
children: typeof e == "boolean" ? "Clear all" : e
|
|
70
70
|
}
|
|
@@ -21,7 +21,7 @@ import "../../Popover/Popover.styles.js";
|
|
|
21
21
|
import "../../Popover/InputPopover/InputPopover.js";
|
|
22
22
|
import { usePopover as V } from "../../Popover/hooks/usePopover.js";
|
|
23
23
|
import "../../Popover/hooks/useFloatingPopover.js";
|
|
24
|
-
import { I as G } from "../../../Button-
|
|
24
|
+
import { I as G } from "../../../Button-BTkololu.js";
|
|
25
25
|
import "../../Button/CloseButton/CloseButton.js";
|
|
26
26
|
import { IressIcon as R } from "../../Icon/Icon.js";
|
|
27
27
|
import "../../Icon/Icon.styles.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
|
-
import { I as m } from "../../Button-
|
|
3
|
+
import { I as m } from "../../Button-BTkololu.js";
|
|
4
4
|
import "../Button/CloseButton/CloseButton.js";
|
|
5
5
|
import { c as k } from "../../cx-DN21T1EH.js";
|
|
6
6
|
import { skipLink as n } from "./SkipLink.styles.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { propagateTestid as o } from "../../../helpers/utility/propagateTestid.js";
|
|
3
|
-
import "../../../Button-
|
|
3
|
+
import "../../../Button-BTkololu.js";
|
|
4
4
|
import { IressCloseButton as j } from "../../Button/CloseButton/CloseButton.js";
|
|
5
5
|
import { slideout as v } from "../Slideout.styles.js";
|
|
6
6
|
import { s as f } from "../../../factory-CsinCTPr.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as m, useEffect as y } from "react";
|
|
2
2
|
import { GlobalCSSClass as e } from "../../../enums.js";
|
|
3
|
-
import { t as p } from "../../../index-
|
|
3
|
+
import { t as p } from "../../../index-Bm5rQqn5.js";
|
|
4
4
|
import { useBreakpoint as S } from "../../../hooks/useBreakpoint.js";
|
|
5
5
|
function h({
|
|
6
6
|
element: r,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { PositiveSpacingToken, HorizontalAligns, IressStyledProps, ResponsiveProp } from '../../types';
|
|
2
|
+
import { PositiveSpacingToken, HorizontalAligns, VerticalAligns, IressStyledProps, ResponsiveProp } from '../../types';
|
|
3
3
|
export type IressStackProps<E extends keyof React.JSX.IntrinsicElements = 'div'> = IressStyledProps<E> & {
|
|
4
4
|
/**
|
|
5
5
|
* Content to be separated by a gutter.
|
|
@@ -19,6 +19,10 @@ export type IressStackProps<E extends keyof React.JSX.IntrinsicElements = 'div'>
|
|
|
19
19
|
* Sets the horizontal alignment of the stack content.
|
|
20
20
|
*/
|
|
21
21
|
horizontalAlign?: HorizontalAligns;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the vertical alignment of the stack content.
|
|
24
|
+
*/
|
|
25
|
+
verticalAlign?: Omit<VerticalAligns, 'stretch'> | 'between' | 'around' | 'evenly';
|
|
22
26
|
};
|
|
23
27
|
export declare const IressStack: {
|
|
24
28
|
<E extends keyof React.JSX.IntrinsicElements = "div">({ className, element, ...restProps }: IressStackProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,4 +10,24 @@ export declare const stack: import('../../styled-system/types').RecipeRuntimeFn<
|
|
|
10
10
|
alignItems: "flex-end";
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
+
verticalAlign: {
|
|
14
|
+
top: {
|
|
15
|
+
justifyContent: "flex-start";
|
|
16
|
+
};
|
|
17
|
+
middle: {
|
|
18
|
+
justifyContent: "center";
|
|
19
|
+
};
|
|
20
|
+
bottom: {
|
|
21
|
+
justifyContent: "flex-end";
|
|
22
|
+
};
|
|
23
|
+
between: {
|
|
24
|
+
justifyContent: "space-between";
|
|
25
|
+
};
|
|
26
|
+
around: {
|
|
27
|
+
justifyContent: "space-around";
|
|
28
|
+
};
|
|
29
|
+
evenly: {
|
|
30
|
+
justifyContent: "space-evenly";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
13
33
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const
|
|
1
|
+
import { c as t } from "../../cva-DtPMccE9.js";
|
|
2
|
+
const n = t({
|
|
3
3
|
base: {
|
|
4
4
|
display: "flex",
|
|
5
5
|
flexDirection: "column",
|
|
@@ -19,9 +19,29 @@ const i = e({
|
|
|
19
19
|
right: {
|
|
20
20
|
alignItems: "flex-end"
|
|
21
21
|
}
|
|
22
|
+
},
|
|
23
|
+
verticalAlign: {
|
|
24
|
+
top: {
|
|
25
|
+
justifyContent: "flex-start"
|
|
26
|
+
},
|
|
27
|
+
middle: {
|
|
28
|
+
justifyContent: "center"
|
|
29
|
+
},
|
|
30
|
+
bottom: {
|
|
31
|
+
justifyContent: "flex-end"
|
|
32
|
+
},
|
|
33
|
+
between: {
|
|
34
|
+
justifyContent: "space-between"
|
|
35
|
+
},
|
|
36
|
+
around: {
|
|
37
|
+
justifyContent: "space-around"
|
|
38
|
+
},
|
|
39
|
+
evenly: {
|
|
40
|
+
justifyContent: "space-evenly"
|
|
41
|
+
}
|
|
22
42
|
}
|
|
23
43
|
}
|
|
24
44
|
});
|
|
25
45
|
export {
|
|
26
|
-
|
|
46
|
+
n as stack
|
|
27
47
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { FocusEvent, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { MouseEventHandler, FocusEvent, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { IressStyledProps } from '../../types';
|
|
3
|
+
interface TagBaseProps {
|
|
4
4
|
/**
|
|
5
5
|
* Contents of the tag.
|
|
6
6
|
*/
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* If true, reduces the padding and height of the tag. Useful when used inside an input component.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* You can completely replace the delete button to provide your own functionality.
|
|
10
14
|
* When this is provided, `deleteButtonText` will not be used and `onDelete` and `onDeleteButtonBlur` will not be called.
|
|
@@ -23,7 +27,26 @@ export interface IressTagProps extends Omit<IressTextProps<'span'>, 'element'> {
|
|
|
23
27
|
*/
|
|
24
28
|
onDeleteButtonBlur?: (e: FocusEvent<HTMLButtonElement>) => void;
|
|
25
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Props for IressTag when onClick is provided (renders as button)
|
|
32
|
+
*/
|
|
33
|
+
type ClickableTagProps = Omit<IressStyledProps<'button'>, 'onClick'> & TagBaseProps & {
|
|
34
|
+
/**
|
|
35
|
+
* Callback triggered when the tag is clicked.
|
|
36
|
+
* If this prop is provided, the tag will render as a `<button>` element with hover styles to indicate it is clickable.
|
|
37
|
+
*/
|
|
38
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Props for IressTag when onClick is not provided (renders as span)
|
|
42
|
+
*/
|
|
43
|
+
type StaticTagProps = IressStyledProps<'span'> & TagBaseProps & {
|
|
44
|
+
onClick?: never;
|
|
45
|
+
};
|
|
46
|
+
export type IressTagProps = ClickableTagProps | StaticTagProps;
|
|
26
47
|
export declare const IressTag: {
|
|
27
|
-
(
|
|
48
|
+
(props: StaticTagProps): React.JSX.Element;
|
|
49
|
+
(props: ClickableTagProps): React.JSX.Element;
|
|
28
50
|
displayName: string;
|
|
29
51
|
};
|
|
52
|
+
export {};
|
|
@@ -1,46 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { propagateTestid as
|
|
4
|
-
import "../../Button-
|
|
5
|
-
import { IressCloseButton as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { c as
|
|
9
|
-
import { GlobalCSSClass as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as B, useMemo as D } from "react";
|
|
3
|
+
import { propagateTestid as P } from "../../helpers/utility/propagateTestid.js";
|
|
4
|
+
import "../../Button-BTkololu.js";
|
|
5
|
+
import { IressCloseButton as j } from "../Button/CloseButton/CloseButton.js";
|
|
6
|
+
import { tag as l } from "./Tag.styles.js";
|
|
7
|
+
import { c as w } from "../../css-DNdLYQld.js";
|
|
8
|
+
import { c as C } from "../../cx-DN21T1EH.js";
|
|
9
|
+
import { GlobalCSSClass as I } from "../../enums.js";
|
|
10
|
+
import { s as p } from "../../factory-CsinCTPr.js";
|
|
11
|
+
import { s as R } from "../../is-valid-prop-DweT-eOL.js";
|
|
12
|
+
const c = ({
|
|
13
|
+
children: i,
|
|
14
|
+
className: u,
|
|
15
|
+
compact: o,
|
|
16
|
+
"data-testid": r,
|
|
14
17
|
deleteButton: s,
|
|
15
|
-
deleteButtonText:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
deleteButtonText: f = "Delete",
|
|
19
|
+
onClick: t,
|
|
20
|
+
onDelete: a,
|
|
21
|
+
onDeleteButtonBlur: d,
|
|
22
|
+
...b
|
|
19
23
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
const n = B(null), m = l({
|
|
25
|
+
customDeleteButton: !!s,
|
|
26
|
+
clickable: !!t,
|
|
27
|
+
compact: o
|
|
28
|
+
}), y = l.raw({
|
|
29
|
+
customDeleteButton: !!s,
|
|
30
|
+
clickable: !!t,
|
|
31
|
+
compact: o
|
|
32
|
+
}), g = !!(a ?? s), [x, T] = R(b), N = D(() => t ? p.button : p.span, [t]);
|
|
33
|
+
return /* @__PURE__ */ h(
|
|
34
|
+
N,
|
|
23
35
|
{
|
|
24
|
-
className:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
className: C(
|
|
37
|
+
u,
|
|
38
|
+
w(y.root, x),
|
|
39
|
+
I.Tag
|
|
40
|
+
),
|
|
41
|
+
"data-testid": r,
|
|
42
|
+
...t ? { onClick: t, type: "button" } : {},
|
|
43
|
+
...T,
|
|
28
44
|
children: [
|
|
29
|
-
/* @__PURE__ */ e("span", { ref:
|
|
30
|
-
/* @__PURE__ */ e("span", { className:
|
|
31
|
-
|
|
45
|
+
/* @__PURE__ */ e("span", { ref: n, className: m.content, children: i }),
|
|
46
|
+
g && /* @__PURE__ */ e("span", { className: m.deleteButton, children: s ?? /* @__PURE__ */ e(
|
|
47
|
+
j,
|
|
32
48
|
{
|
|
33
|
-
"data-testid":
|
|
34
|
-
onBlur:
|
|
35
|
-
onClick: (
|
|
36
|
-
screenreaderText:
|
|
49
|
+
"data-testid": P(r, "delete-button__button"),
|
|
50
|
+
onBlur: d,
|
|
51
|
+
onClick: (S) => a?.(n.current?.textContent ?? "", S),
|
|
52
|
+
screenreaderText: f
|
|
37
53
|
}
|
|
38
54
|
) })
|
|
39
55
|
]
|
|
40
56
|
}
|
|
41
57
|
);
|
|
42
58
|
};
|
|
43
|
-
|
|
59
|
+
c.displayName = "IressTag";
|
|
60
|
+
const K = c;
|
|
44
61
|
export {
|
|
45
|
-
|
|
62
|
+
K as IressTag
|
|
46
63
|
};
|
|
@@ -8,6 +8,31 @@ export declare const tag: import('../../styled-system/types').SlotRecipeRuntimeF
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
clickable: {
|
|
12
|
+
true: {
|
|
13
|
+
root: {
|
|
14
|
+
_hover: {
|
|
15
|
+
bg: "colour.primary.surface";
|
|
16
|
+
borderColor: "colour.primary.fill";
|
|
17
|
+
color: "colour.primary.text";
|
|
18
|
+
cursor: "pointer";
|
|
19
|
+
};
|
|
20
|
+
_active: {
|
|
21
|
+
boxShadow: "color-mix(in srgb, {colors.colour.primary.surface}, transparent 60%) 0px 0px 0px 3px";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
compact: {
|
|
27
|
+
true: {
|
|
28
|
+
root: {
|
|
29
|
+
height: "[calc({sizes.input.height} - {spacing.spacing.2} - 2px)]";
|
|
30
|
+
py: "none";
|
|
31
|
+
px: "xs";
|
|
32
|
+
textStyle: "typography.body.sm";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
11
36
|
customDeleteButton: {
|
|
12
37
|
true: {
|
|
13
38
|
root: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as
|
|
2
|
-
const t =
|
|
1
|
+
import { s as r } from "../../sva-B7kca5XO.js";
|
|
2
|
+
const t = r({
|
|
3
3
|
slots: ["root", "content", "deleteButton"],
|
|
4
4
|
base: {
|
|
5
5
|
root: {
|
|
@@ -7,25 +7,27 @@ const t = o({
|
|
|
7
7
|
bg: "colour.neutral.20",
|
|
8
8
|
border: "divider",
|
|
9
9
|
borderRadius: "radius.system.badge",
|
|
10
|
+
color: "colour.neutral.80",
|
|
10
11
|
display: "inline-flex",
|
|
11
12
|
gap: "spacing.1",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
lineHeight: 1
|
|
13
|
+
py: "xs",
|
|
14
|
+
px: "sm",
|
|
15
|
+
transition: "[all .2s]",
|
|
16
|
+
textStyle: "typography.body.md"
|
|
17
17
|
},
|
|
18
18
|
deleteButton: {
|
|
19
|
+
my: "-spacing.1",
|
|
20
|
+
mr: "-spacing.1",
|
|
19
21
|
"& button": {
|
|
20
22
|
color: "[inherit]",
|
|
21
23
|
fontSize: "inherit",
|
|
22
24
|
minWidth: "[0]",
|
|
23
25
|
minHeight: "[0]",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
p: "spacing.1",
|
|
27
|
+
m: "spacing.0",
|
|
28
|
+
_hover: {
|
|
29
|
+
bg: "transparent",
|
|
30
|
+
borderColor: "transparent"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -40,6 +42,31 @@ const t = o({
|
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
},
|
|
45
|
+
clickable: {
|
|
46
|
+
true: {
|
|
47
|
+
root: {
|
|
48
|
+
_hover: {
|
|
49
|
+
bg: "colour.primary.surface",
|
|
50
|
+
borderColor: "colour.primary.fill",
|
|
51
|
+
color: "colour.primary.text",
|
|
52
|
+
cursor: "pointer"
|
|
53
|
+
},
|
|
54
|
+
_active: {
|
|
55
|
+
boxShadow: "color-mix(in srgb, {colors.colour.primary.surface}, transparent 60%) 0px 0px 0px 3px"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
compact: {
|
|
61
|
+
true: {
|
|
62
|
+
root: {
|
|
63
|
+
height: "[calc({sizes.input.height} - {spacing.spacing.2} - 2px)]",
|
|
64
|
+
py: "none",
|
|
65
|
+
px: "xs",
|
|
66
|
+
textStyle: "typography.body.sm"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
43
70
|
customDeleteButton: {
|
|
44
71
|
true: {
|
|
45
72
|
root: {
|
|
@@ -1,103 +1,106 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
1
|
+
import { jsxs as h, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as b, useState as z, useCallback as F } from "react";
|
|
3
3
|
import { IressInput as G } from "../../Input/Input.js";
|
|
4
4
|
import "../../Input/Input.styles.js";
|
|
5
5
|
import { useControlledState as H } from "../../../hooks/useControlledState.js";
|
|
6
6
|
import { getValueAsEvent as p } from "../../../helpers/form/getValueAsEvent.js";
|
|
7
|
-
import { IressTag as
|
|
7
|
+
import { IressTag as I } from "../Tag.js";
|
|
8
8
|
import { propagateTestid as v } from "../../../helpers/utility/propagateTestid.js";
|
|
9
9
|
import "../../Inline/Inline.styles.js";
|
|
10
10
|
import { IressInline as J } from "../../Inline/Inline.js";
|
|
11
11
|
import { tagInput as L } from "./TagInput.styles.js";
|
|
12
12
|
const w = ({
|
|
13
|
-
"data-testid":
|
|
14
|
-
onTagDelete:
|
|
13
|
+
"data-testid": l,
|
|
14
|
+
onTagDelete: d,
|
|
15
15
|
onTagDeleteAll: i,
|
|
16
16
|
onTagDeleteButtonBlur: u,
|
|
17
|
-
selectedOptionsTagText:
|
|
18
|
-
tags:
|
|
17
|
+
selectedOptionsTagText: r,
|
|
18
|
+
tags: n = [],
|
|
19
19
|
tagLimit: m = 5
|
|
20
|
-
}) =>
|
|
21
|
-
|
|
20
|
+
}) => n.length ? n.length <= m ? n.map((s) => /* @__PURE__ */ c(
|
|
21
|
+
I,
|
|
22
22
|
{
|
|
23
|
-
deleteButtonText: `Delete ${
|
|
24
|
-
onDelete:
|
|
23
|
+
deleteButtonText: `Delete ${s}`,
|
|
24
|
+
onDelete: d,
|
|
25
25
|
onDeleteButtonBlur: u,
|
|
26
|
-
"data-testid": v(
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"data-testid": v(l, "tag"),
|
|
27
|
+
compact: !0,
|
|
28
|
+
my: "spacing.1",
|
|
29
|
+
mr: "spacing.1",
|
|
30
|
+
children: s
|
|
29
31
|
},
|
|
30
|
-
|
|
32
|
+
s
|
|
31
33
|
)) : /* @__PURE__ */ h(
|
|
32
|
-
|
|
34
|
+
I,
|
|
33
35
|
{
|
|
34
36
|
onDelete: i,
|
|
35
37
|
onDeleteButtonBlur: u,
|
|
36
|
-
"data-testid": v(
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
"data-testid": v(l, "tag"),
|
|
39
|
+
compact: !0,
|
|
40
|
+
my: "spacing.1",
|
|
41
|
+
mr: "spacing.1",
|
|
39
42
|
children: [
|
|
40
|
-
String(
|
|
43
|
+
String(n.length) || "0",
|
|
41
44
|
" ",
|
|
42
|
-
|
|
45
|
+
r
|
|
43
46
|
]
|
|
44
47
|
}
|
|
45
48
|
) : null;
|
|
46
49
|
w.displayName = "Tags";
|
|
47
50
|
const M = b(
|
|
48
51
|
({
|
|
49
|
-
className:
|
|
50
|
-
defaultValue:
|
|
52
|
+
className: l,
|
|
53
|
+
defaultValue: d,
|
|
51
54
|
name: i,
|
|
52
55
|
onBlur: u,
|
|
53
|
-
onChange:
|
|
54
|
-
onExistingTag:
|
|
56
|
+
onChange: r,
|
|
57
|
+
onExistingTag: n,
|
|
55
58
|
onKeyDown: m,
|
|
56
|
-
onTagDelete:
|
|
59
|
+
onTagDelete: s,
|
|
57
60
|
onTagDeleteAll: B,
|
|
58
|
-
onTagDeleteButtonBlur:
|
|
59
|
-
selectedOptionsTagText:
|
|
60
|
-
style:
|
|
61
|
+
onTagDeleteButtonBlur: k,
|
|
62
|
+
selectedOptionsTagText: j = "selected",
|
|
63
|
+
style: x,
|
|
61
64
|
tagLimit: A = 5,
|
|
62
65
|
width: N = "100%",
|
|
63
66
|
value: S,
|
|
64
67
|
...f
|
|
65
68
|
}, E) => {
|
|
66
|
-
const [
|
|
69
|
+
const [y, g] = z(""), { value: a, setValue: o } = H({
|
|
67
70
|
component: "IressTagInput",
|
|
68
|
-
defaultValue:
|
|
71
|
+
defaultValue: d,
|
|
69
72
|
value: S
|
|
70
|
-
}), K = L(),
|
|
73
|
+
}), K = L(), D = F(
|
|
71
74
|
(e = "") => {
|
|
72
75
|
if (!e)
|
|
73
76
|
return;
|
|
74
77
|
if (a?.includes(e)) {
|
|
75
|
-
|
|
78
|
+
n?.(e);
|
|
76
79
|
return;
|
|
77
80
|
}
|
|
78
81
|
const t = [...a ?? [], e];
|
|
79
|
-
|
|
82
|
+
r?.(p(t), t), o(t);
|
|
80
83
|
},
|
|
81
|
-
[
|
|
84
|
+
[r, n, o, a]
|
|
82
85
|
), V = (e) => {
|
|
83
|
-
u?.(e),
|
|
86
|
+
u?.(e), D(e.currentTarget.value), g("");
|
|
84
87
|
}, q = (e) => {
|
|
85
|
-
if (m?.(e), e.key === "Backspace" && !
|
|
88
|
+
if (m?.(e), e.key === "Backspace" && !y) {
|
|
86
89
|
const t = a?.slice(0, -1);
|
|
87
|
-
|
|
90
|
+
r?.(p(t), t), o(t);
|
|
88
91
|
} else if (e.key === "Enter") {
|
|
89
92
|
const t = e.currentTarget;
|
|
90
|
-
t.value && (e.preventDefault(),
|
|
93
|
+
t.value && (e.preventDefault(), D(t.value), g(""));
|
|
91
94
|
}
|
|
92
95
|
}, Q = (e, t) => {
|
|
93
|
-
t.stopPropagation(),
|
|
96
|
+
t.stopPropagation(), s?.(e, t);
|
|
94
97
|
const T = a?.filter(($) => $ !== e);
|
|
95
|
-
|
|
98
|
+
r?.(p(T), T), o(T);
|
|
96
99
|
}, R = (e, t) => {
|
|
97
|
-
t.stopPropagation(), B?.(e, t),
|
|
100
|
+
t.stopPropagation(), B?.(e, t), r?.(p([]), []), o([]);
|
|
98
101
|
};
|
|
99
|
-
return /* @__PURE__ */ h(J, { gap: "sm", className:
|
|
100
|
-
/* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ h(J, { gap: "sm", className: l, style: x, children: [
|
|
103
|
+
/* @__PURE__ */ c(
|
|
101
104
|
G,
|
|
102
105
|
{
|
|
103
106
|
...f,
|
|
@@ -105,24 +108,24 @@ const M = b(
|
|
|
105
108
|
onBlur: V,
|
|
106
109
|
onChange: (e) => g(e.currentTarget.value),
|
|
107
110
|
onKeyDown: q,
|
|
108
|
-
prepend: /* @__PURE__ */
|
|
111
|
+
prepend: /* @__PURE__ */ c(
|
|
109
112
|
w,
|
|
110
113
|
{
|
|
111
114
|
"data-testid": f["data-testid"],
|
|
112
115
|
onTagDelete: Q,
|
|
113
116
|
onTagDeleteAll: R,
|
|
114
|
-
onTagDeleteButtonBlur:
|
|
115
|
-
selectedOptionsTagText:
|
|
117
|
+
onTagDeleteButtonBlur: k,
|
|
118
|
+
selectedOptionsTagText: j,
|
|
116
119
|
tags: a ?? [],
|
|
117
120
|
tagLimit: A
|
|
118
121
|
}
|
|
119
122
|
),
|
|
120
123
|
ref: E,
|
|
121
124
|
width: N,
|
|
122
|
-
value:
|
|
125
|
+
value: y
|
|
123
126
|
}
|
|
124
127
|
),
|
|
125
|
-
i && /* @__PURE__ */
|
|
128
|
+
i && /* @__PURE__ */ c(
|
|
126
129
|
"input",
|
|
127
130
|
{
|
|
128
131
|
type: "hidden",
|