@fluidattacks/design 10.0.1 → 10.2.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/components/card/card-with-input/index.js +3 -2
- package/dist/components/filters/filters-menu/index.js +24 -23
- package/dist/components/filters/options-menu/options/index.js +38 -37
- package/dist/components/filters/utils.js +22 -22
- package/dist/components/form/index.js +26 -26
- package/dist/components/form/styles.d.ts +6 -1
- package/dist/components/form/styles.js +14 -3
- package/dist/components/inputs/fields/combobox/field/index.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/field/index.js +115 -112
- package/dist/components/inputs/fields/combobox/index.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/index.js +34 -31
- package/dist/components/inputs/fields/combobox/index.stories.d.ts +4 -1
- package/dist/components/inputs/fields/combobox/option/index.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/option/index.js +79 -68
- package/dist/components/inputs/fields/combobox/styles.js +10 -3
- package/dist/components/inputs/fields/combobox/types.d.ts +5 -0
- package/dist/components/inputs/fields/combobox/utils.d.ts +1 -1
- package/dist/components/inputs/fields/combobox/utils.js +10 -10
- package/dist/components/list-item/styles.js +2 -0
- package/dist/components/loading/index.js +11 -11
- package/dist/components/loading/index.stories.d.ts +2 -1
- package/dist/components/modal/index.stories.d.ts +6 -2
- package/dist/components/modal/modal-confirm/index.d.ts +1 -1
- package/dist/components/modal/modal-confirm/index.js +34 -20
- package/dist/components/modal/types.d.ts +2 -0
- package/dist/components/slider/index.js +3 -2
- package/package.json +1 -1
|
@@ -1,126 +1,137 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useOption as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { StyledOption as
|
|
6
|
-
import { describeSelection as
|
|
7
|
-
import { Checkbox as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Link as
|
|
10
|
-
import { Tag as
|
|
1
|
+
import { jsx as l, jsxs as H } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as J, useMemo as k, useCallback as f } from "react";
|
|
3
|
+
import { useOption as Q } from "../../../../../node_modules/react-aria/dist/private/listbox/useOption.js";
|
|
4
|
+
import { useTheme as W } from "styled-components";
|
|
5
|
+
import { StyledOption as X } from "../styles.js";
|
|
6
|
+
import { describeSelection as Y, toSelection as u } from "../utils.js";
|
|
7
|
+
import { Checkbox as D } from "../../../../checkbox/index.js";
|
|
8
|
+
import { Icon as Z } from "../../../../icon/index.js";
|
|
9
|
+
import { Link as _ } from "../../../../link/index.js";
|
|
10
|
+
import { Tag as I } from "../../../../tag/index.js";
|
|
11
11
|
import "../../../../typography/heading/index.js";
|
|
12
12
|
import "../../../../typography/span/index.js";
|
|
13
|
-
import { Text as
|
|
14
|
-
import { useClickOutside as
|
|
15
|
-
import { openUrl as
|
|
16
|
-
const
|
|
13
|
+
import { Text as V } from "../../../../typography/text/index.js";
|
|
14
|
+
import { useClickOutside as oo } from "../../../../../hooks/use-click-outside.js";
|
|
15
|
+
import { openUrl as eo } from "../../../../../utils/open-url.js";
|
|
16
|
+
const yo = ({
|
|
17
17
|
allItemKeys: a,
|
|
18
|
-
containerRef:
|
|
18
|
+
containerRef: w,
|
|
19
|
+
countLabel: $,
|
|
19
20
|
item: o,
|
|
20
21
|
multiSelection: s,
|
|
21
22
|
name: e,
|
|
22
|
-
popoverRef:
|
|
23
|
-
setInputValue:
|
|
23
|
+
popoverRef: z,
|
|
24
|
+
setInputValue: t,
|
|
24
25
|
setValue: n,
|
|
25
26
|
state: c,
|
|
26
|
-
tag:
|
|
27
|
+
tag: y,
|
|
27
28
|
watch: h
|
|
28
29
|
}) => {
|
|
29
|
-
const
|
|
30
|
+
const F = W(), C = J(null), d = o.props.hrefLang, g = c.disabledKeys, A = a.filter(
|
|
30
31
|
(r) => !Array.from(g).includes(r) && r !== "All"
|
|
31
|
-
), { optionProps:
|
|
32
|
+
), { optionProps: q, isSelected: S, isFocused: B, isDisabled: O } = Q(
|
|
32
33
|
{ key: o.key },
|
|
33
34
|
c,
|
|
34
|
-
|
|
35
|
-
), b = k(() => c.collection.getItem("All")?.rendered?.toString(), [c.collection]),
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
C
|
|
36
|
+
), b = k(() => c.collection.getItem("All")?.rendered?.toString(), [c.collection]), K = [
|
|
37
|
+
S ? "selected" : "",
|
|
38
|
+
B ? "focused" : "",
|
|
38
39
|
O ? "disabled" : ""
|
|
39
|
-
].join(" "),
|
|
40
|
+
].join(" "), m = f(
|
|
40
41
|
(r) => {
|
|
41
|
-
const { allSelected:
|
|
42
|
+
const { allSelected: i, text: p } = Y(
|
|
42
43
|
r,
|
|
43
44
|
a,
|
|
44
45
|
g,
|
|
45
|
-
b
|
|
46
|
+
b,
|
|
47
|
+
$
|
|
46
48
|
);
|
|
47
|
-
n?.(`${e}CheckAll`,
|
|
49
|
+
n?.(`${e}CheckAll`, i ? p : ""), t(p);
|
|
48
50
|
},
|
|
49
|
-
[
|
|
50
|
-
|
|
51
|
+
[
|
|
52
|
+
a,
|
|
53
|
+
b,
|
|
54
|
+
$,
|
|
55
|
+
g,
|
|
56
|
+
e,
|
|
57
|
+
t,
|
|
58
|
+
n
|
|
59
|
+
]
|
|
60
|
+
), M = f(
|
|
51
61
|
(r) => {
|
|
52
62
|
if (r.target.checked) {
|
|
53
|
-
const
|
|
54
|
-
n?.(`${e}Options`,
|
|
63
|
+
const i = [...A].sort();
|
|
64
|
+
n?.(`${e}Options`, i), n?.(`${e}CheckAll`, r.target.value), t(r.target.value);
|
|
55
65
|
} else
|
|
56
|
-
n?.(`${e}Options`, []), n?.(`${e}CheckAll`, ""),
|
|
66
|
+
n?.(`${e}Options`, []), n?.(`${e}CheckAll`, ""), t("");
|
|
57
67
|
},
|
|
58
|
-
[
|
|
59
|
-
),
|
|
68
|
+
[A, e, t, n]
|
|
69
|
+
), N = f(
|
|
60
70
|
(r) => {
|
|
61
|
-
const
|
|
62
|
-
n?.(`${e}Options`,
|
|
71
|
+
const i = r.target.value, p = u(h?.(`${e}Options`)), j = r.target.checked ? [...p, i] : p.filter((G) => G !== i);
|
|
72
|
+
n?.(`${e}Options`, j), m(j);
|
|
63
73
|
},
|
|
64
|
-
[e, n, h,
|
|
65
|
-
),
|
|
66
|
-
() =>
|
|
67
|
-
[
|
|
68
|
-
),
|
|
69
|
-
() =>
|
|
70
|
-
[
|
|
71
|
-
),
|
|
72
|
-
|
|
74
|
+
[e, n, h, m]
|
|
75
|
+
), v = h?.(`${e}Options`), x = k(
|
|
76
|
+
() => u(v),
|
|
77
|
+
[v]
|
|
78
|
+
), P = k(
|
|
79
|
+
() => x.includes(o.key.toString()),
|
|
80
|
+
[x, o.key]
|
|
81
|
+
), L = h?.(`${e}CheckAll`), R = k(() => !!L, [L]), U = o.key === "All" ? /* @__PURE__ */ l(
|
|
82
|
+
D,
|
|
73
83
|
{
|
|
74
|
-
checked:
|
|
84
|
+
checked: R,
|
|
75
85
|
label: o.rendered?.toString(),
|
|
76
86
|
name: `${e}CheckAll`,
|
|
77
|
-
onChange:
|
|
87
|
+
onChange: M,
|
|
78
88
|
value: o.rendered?.toString()
|
|
79
89
|
}
|
|
80
90
|
) : /* @__PURE__ */ l(
|
|
81
|
-
|
|
91
|
+
D,
|
|
82
92
|
{
|
|
83
|
-
checked:
|
|
93
|
+
checked: P,
|
|
84
94
|
label: o.rendered?.toString(),
|
|
85
95
|
name: `${e}Options`,
|
|
86
|
-
onChange:
|
|
96
|
+
onChange: N,
|
|
87
97
|
value: o.key.toString()
|
|
88
98
|
}
|
|
89
|
-
),
|
|
90
|
-
|
|
99
|
+
), T = s && !O ? U : /* @__PURE__ */ l(
|
|
100
|
+
V,
|
|
91
101
|
{
|
|
92
|
-
color:
|
|
102
|
+
color: F.palette.gray[800],
|
|
93
103
|
size: "md",
|
|
94
104
|
textOverflow: "ellipsis",
|
|
95
105
|
whiteSpace: "nowrap",
|
|
96
106
|
children: o.rendered
|
|
97
107
|
}
|
|
98
|
-
),
|
|
108
|
+
), E = f(
|
|
99
109
|
(r) => {
|
|
100
|
-
r.preventDefault(),
|
|
110
|
+
r.preventDefault(), t(o.rendered?.toString() ?? ""), c.setSelectedKey(o.key), requestAnimationFrame(() => {
|
|
101
111
|
c.setOpen(!1);
|
|
102
|
-
}),
|
|
112
|
+
}), eo(d);
|
|
103
113
|
},
|
|
104
|
-
[d, o.key, o.rendered, c,
|
|
114
|
+
[d, o.key, o.rendered, c, t]
|
|
105
115
|
);
|
|
106
|
-
return
|
|
116
|
+
return oo(z, () => {
|
|
107
117
|
s && c.close();
|
|
108
|
-
}, [
|
|
109
|
-
|
|
118
|
+
}, [w]), /* @__PURE__ */ H(
|
|
119
|
+
X,
|
|
110
120
|
{
|
|
111
|
-
...!s && !d ?
|
|
121
|
+
...!s && !d ? q : {},
|
|
112
122
|
$multiSelection: s,
|
|
113
|
-
className:
|
|
123
|
+
className: K,
|
|
114
124
|
"data-testid": `${e}-option-${o.key}`,
|
|
115
|
-
ref:
|
|
125
|
+
ref: C,
|
|
126
|
+
title: o.textValue,
|
|
116
127
|
children: [
|
|
117
|
-
d ? /* @__PURE__ */ l(
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
d ? /* @__PURE__ */ l(_, { href: d, onClick: E, children: T }) : T,
|
|
129
|
+
S && !O && !s ? /* @__PURE__ */ l(Z, { icon: "check", iconSize: "sm", iconType: "fa-light" }) : void 0,
|
|
130
|
+
y === void 0 ? void 0 : /* @__PURE__ */ l(I, { tagLabel: y, variant: "inactive" })
|
|
120
131
|
]
|
|
121
132
|
}
|
|
122
133
|
);
|
|
123
134
|
};
|
|
124
135
|
export {
|
|
125
|
-
|
|
136
|
+
yo as Option
|
|
126
137
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled as o } from "styled-components";
|
|
2
|
-
import { StyledIconButton as
|
|
2
|
+
import { StyledIconButton as l } from "../../../icon-button/styles.js";
|
|
3
3
|
const t = o.ul`
|
|
4
4
|
${({ theme: a, $hasStatus: n, $multiSelection: p, $width: i }) => `
|
|
5
5
|
align-self: center;
|
|
@@ -23,6 +23,7 @@ const t = o.ul`
|
|
|
23
23
|
`, d = o.li`
|
|
24
24
|
${({ theme: a, $multiSelection: n }) => `
|
|
25
25
|
align-items: center;
|
|
26
|
+
background: ${a.palette.white};
|
|
26
27
|
color: ${a.palette.gray[800]};
|
|
27
28
|
cursor: pointer;
|
|
28
29
|
display: flex;
|
|
@@ -42,6 +43,12 @@ const t = o.ul`
|
|
|
42
43
|
width: 100%;
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
label {
|
|
47
|
+
display: block;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
|
|
45
52
|
span {
|
|
46
53
|
color: ${a.palette.gray[700]};
|
|
47
54
|
}
|
|
@@ -51,7 +58,7 @@ const t = o.ul`
|
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
&.selected {
|
|
54
|
-
background: ${n ?
|
|
61
|
+
background: ${n ? a.palette.white : a.palette.gray[200]};
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
&.disabled {
|
|
@@ -74,7 +81,7 @@ const t = o.ul`
|
|
|
74
81
|
padding: ${a.spacing[0.25]} ${a.spacing[1]};
|
|
75
82
|
size: 28;
|
|
76
83
|
`}
|
|
77
|
-
`, g = o(
|
|
84
|
+
`, g = o(l)`
|
|
78
85
|
${({ disabled: a, theme: n }) => `
|
|
79
86
|
position: relative;
|
|
80
87
|
|
|
@@ -23,6 +23,7 @@ interface IItem {
|
|
|
23
23
|
* Props for the option component.
|
|
24
24
|
* @interface IOptionProps
|
|
25
25
|
* @property { MutableRefObject } containerRef - The ref of the ComboBox container.
|
|
26
|
+
* @property { string } [countLabel] - Plural noun of the selection summary.
|
|
26
27
|
* @property { IItem } item - The item to be rendered as an option.
|
|
27
28
|
* @property { boolean } multiSelection - Enable to select more than one option.
|
|
28
29
|
* @property { string } name - The name of the Select.
|
|
@@ -33,6 +34,7 @@ interface IItem {
|
|
|
33
34
|
interface IOptionProps<T> {
|
|
34
35
|
allItemKeys: string[];
|
|
35
36
|
containerRef: MutableRefObject<HTMLDivElement | null>;
|
|
37
|
+
countLabel?: string;
|
|
36
38
|
item: Node<IItem>;
|
|
37
39
|
multiSelection: boolean;
|
|
38
40
|
name: string;
|
|
@@ -59,6 +61,8 @@ interface IOptionProps<T> {
|
|
|
59
61
|
* next to the items it describes.
|
|
60
62
|
* @property { boolean } [clearable] - Whether the clear button is shown.
|
|
61
63
|
* @property {Function} [onClear] - Called when the clear button is clicked.
|
|
64
|
+
* @property { string } [countLabel] - Plural noun that summarizes two or
|
|
65
|
+
* more selected options as "N countLabel".
|
|
62
66
|
*/
|
|
63
67
|
interface IComboBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "onBlur">, Partial<Omit<IOutlineContainerProps, "maxLength" | "value">> {
|
|
64
68
|
control?: Control<any>;
|
|
@@ -76,6 +80,7 @@ interface IComboBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "on
|
|
|
76
80
|
emptyMessage?: string;
|
|
77
81
|
statusMessage?: string;
|
|
78
82
|
clearable?: boolean;
|
|
83
|
+
countLabel?: string;
|
|
79
84
|
setValue?: UseFormSetValue<any>;
|
|
80
85
|
watch?: UseFormWatch<any>;
|
|
81
86
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Key } from 'react-aria';
|
|
2
2
|
declare const toSelection: (options: unknown) => string[];
|
|
3
|
-
declare const describeSelection: (selected: readonly string[], keys: readonly string[], disabledKeys: Iterable<Key>, allName: string | undefined) => {
|
|
3
|
+
declare const describeSelection: (selected: readonly string[], keys: readonly string[], disabledKeys: Iterable<Key>, allName: string | undefined, countLabel?: string) => {
|
|
4
4
|
allSelected: boolean;
|
|
5
5
|
text: string;
|
|
6
6
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
(s) => s !== "All" && !
|
|
5
|
-
),
|
|
6
|
-
if (
|
|
1
|
+
import g from "../../../../_virtual/isEqual.js";
|
|
2
|
+
const u = (t) => Array.isArray(t) ? t : typeof t == "string" && t ? [t] : [], d = (t, a, c, h, o) => {
|
|
3
|
+
const i = new Set(c), l = a.filter(
|
|
4
|
+
(s) => s !== "All" && !i.has(s)
|
|
5
|
+
), n = i.has("All") ? void 0 : h, r = !!n && l.length > 0 && t.length === l.length && g([...l].sort(), [...t].sort());
|
|
6
|
+
if (r && n) return { allSelected: r, text: n };
|
|
7
7
|
const e = [...t].sort();
|
|
8
|
-
return {
|
|
9
|
-
allSelected:
|
|
8
|
+
return o !== void 0 && e.length > 1 ? { allSelected: r, text: `${e.length} ${o}` } : {
|
|
9
|
+
allSelected: r,
|
|
10
10
|
text: e.length <= 2 ? e.join(", ") : `${e.slice(0, 2).join(", ")}, +${e.length - 2} more`
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
d as describeSelection,
|
|
15
|
+
u as toSelection
|
|
16
16
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { LoadingContainer as c, CircleBg as
|
|
4
|
-
import { Container as
|
|
2
|
+
import { useTheme as p } from "styled-components";
|
|
3
|
+
import { LoadingContainer as c, CircleBg as s, Circle as a } from "./styles.js";
|
|
4
|
+
import { Container as l } from "../container/index.js";
|
|
5
5
|
import "../typography/heading/index.js";
|
|
6
6
|
import "../typography/span/index.js";
|
|
7
|
-
import { Text as
|
|
8
|
-
const
|
|
7
|
+
import { Text as d } from "../typography/text/index.js";
|
|
8
|
+
const y = ({
|
|
9
9
|
color: e = "red",
|
|
10
10
|
label: t,
|
|
11
11
|
size: n
|
|
12
12
|
}) => {
|
|
13
|
-
const i =
|
|
14
|
-
return /* @__PURE__ */ o(
|
|
13
|
+
const i = p(), m = e === "red" || e === "blue" ? i.palette.gray[700] : e === "white" ? i.palette.white : e;
|
|
14
|
+
return /* @__PURE__ */ o(l, { alignItems: "center", display: "flex", children: [
|
|
15
15
|
/* @__PURE__ */ o(c, { $size: n, viewBox: "0 0 100 100", children: [
|
|
16
|
-
/* @__PURE__ */ r(
|
|
17
|
-
/* @__PURE__ */ r(
|
|
16
|
+
/* @__PURE__ */ r(s, { $color: e, cx: "50", cy: "50", r: "45" }),
|
|
17
|
+
/* @__PURE__ */ r(a, { $color: e, cx: "50", cy: "50", r: "45" })
|
|
18
18
|
] }),
|
|
19
|
-
t && /* @__PURE__ */ r(
|
|
19
|
+
t && /* @__PURE__ */ r(d, { color: m, ml: 0.5, size: "md", whiteSpace: "nowrap", children: t })
|
|
20
20
|
] });
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
y as Loading
|
|
24
24
|
};
|
|
@@ -3,5 +3,6 @@ import { ILoadingProps } from '.';
|
|
|
3
3
|
declare const config: Meta;
|
|
4
4
|
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ILoadingProps>;
|
|
5
5
|
declare const DarkBackground: StoryFn;
|
|
6
|
-
|
|
6
|
+
declare const InConfirmButton: StoryFn;
|
|
7
|
+
export { Default, DarkBackground, InConfirmButton };
|
|
7
8
|
export default config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { IModalProps } from './types';
|
|
4
4
|
declare const config: Meta;
|
|
@@ -8,6 +8,10 @@ declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import(
|
|
|
8
8
|
declare const WithForm: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
9
9
|
id: string;
|
|
10
10
|
}>>;
|
|
11
|
+
declare const WithTabsAndLongForm: StoryFn;
|
|
12
|
+
declare const WithStickyConfirm: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
13
|
+
id: string;
|
|
14
|
+
}>>;
|
|
11
15
|
declare const ScrollableContent: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
|
|
12
16
|
id: string;
|
|
13
17
|
}>>;
|
|
@@ -24,4 +28,4 @@ declare const WithTabs: import('storybook/internal/csf').AnnotatedStoryFn<import
|
|
|
24
28
|
id: string;
|
|
25
29
|
}>>;
|
|
26
30
|
export default config;
|
|
27
|
-
export { Default, ImageModal, WithTabs, ScrollableContent, SingleAction, WithoutFooter, WithForm, };
|
|
31
|
+
export { Default, ImageModal, WithTabs, ScrollableContent, SingleAction, WithoutFooter, WithForm, WithStickyConfirm, WithTabsAndLongForm, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IModalConfirmProps } from '../types';
|
|
2
|
-
declare const ModalConfirm: ({ disabled, id, onCancel, onConfirm, txtCancel, txtConfirm, }: Readonly<IModalConfirmProps>) => JSX.Element;
|
|
2
|
+
declare const ModalConfirm: ({ disabled, id, onCancel, onConfirm, sticky, txtCancel, txtConfirm, }: Readonly<IModalConfirmProps>) => JSX.Element;
|
|
3
3
|
export { ModalConfirm };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as u } from "styled-components";
|
|
2
3
|
import { Button as n } from "../../button/index.js";
|
|
3
|
-
import { Container as
|
|
4
|
-
const
|
|
5
|
-
disabled:
|
|
6
|
-
id:
|
|
4
|
+
import { Container as p } from "../../container/index.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
disabled: a,
|
|
7
|
+
id: o = "modal-confirm",
|
|
7
8
|
onCancel: t,
|
|
8
9
|
onConfirm: r = "submit",
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
sticky: c = !1,
|
|
11
|
+
txtCancel: d,
|
|
12
|
+
txtConfirm: l
|
|
11
13
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
c,
|
|
14
|
+
const e = u(), m = r === "submit", s = /* @__PURE__ */ f(
|
|
15
|
+
p,
|
|
15
16
|
{
|
|
16
17
|
display: "flex",
|
|
17
18
|
gap: 0.75,
|
|
@@ -19,34 +20,47 @@ const u = ({
|
|
|
19
20
|
maxWidth: t ? "392px" : "190px",
|
|
20
21
|
mt: 1.5,
|
|
21
22
|
children: [
|
|
22
|
-
t ? /* @__PURE__ */
|
|
23
|
+
t ? /* @__PURE__ */ i(
|
|
23
24
|
n,
|
|
24
25
|
{
|
|
25
|
-
id: `${
|
|
26
|
+
id: `${o}-cancel`,
|
|
26
27
|
justify: "center",
|
|
27
28
|
onClick: t,
|
|
28
29
|
variant: "tertiary",
|
|
29
30
|
width: "100%",
|
|
30
|
-
children:
|
|
31
|
+
children: d ?? "Cancel"
|
|
31
32
|
}
|
|
32
33
|
) : void 0,
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ i(
|
|
34
35
|
n,
|
|
35
36
|
{
|
|
36
|
-
disabled:
|
|
37
|
-
id:
|
|
37
|
+
disabled: a,
|
|
38
|
+
id: o,
|
|
38
39
|
justify: "center",
|
|
39
|
-
onClick:
|
|
40
|
-
type:
|
|
40
|
+
onClick: m ? void 0 : r,
|
|
41
|
+
type: m ? "submit" : "button",
|
|
41
42
|
variant: "primary",
|
|
42
43
|
width: "100%",
|
|
43
|
-
children:
|
|
44
|
+
children: l ?? "Confirm"
|
|
44
45
|
}
|
|
45
46
|
)
|
|
46
47
|
]
|
|
47
48
|
}
|
|
48
49
|
);
|
|
50
|
+
return c ? /* @__PURE__ */ i(
|
|
51
|
+
p,
|
|
52
|
+
{
|
|
53
|
+
bgColor: e.palette.white,
|
|
54
|
+
borderTop: `1px solid ${e.palette.gray[200]}`,
|
|
55
|
+
bottom: "0",
|
|
56
|
+
id: "sticky-footer",
|
|
57
|
+
pb: 1.25,
|
|
58
|
+
position: "sticky",
|
|
59
|
+
px: 1.25,
|
|
60
|
+
children: s
|
|
61
|
+
}
|
|
62
|
+
) : s;
|
|
49
63
|
};
|
|
50
64
|
export {
|
|
51
|
-
|
|
65
|
+
j as ModalConfirm
|
|
52
66
|
};
|
|
@@ -111,6 +111,7 @@ interface IModalProps extends Omit<IModalHeaderProps, "modalRef">, IModalFooterP
|
|
|
111
111
|
* @property { string } [id] - The id of the confirm button.
|
|
112
112
|
* @property { Function } [onCancel] - The function to call when the cancel button is clicked.
|
|
113
113
|
* @property { "submit" | Function } [onConfirm] - The function to call when the confirm button is clicked.
|
|
114
|
+
* @property { boolean } [sticky] - Whether the buttons stay at the bottom while the content scrolls.
|
|
114
115
|
* @property { string } [txtCancel] - The text of the cancel button.
|
|
115
116
|
* @property { React.ReactNode | string } [txtConfirm] - The text of the confirm button.
|
|
116
117
|
*/
|
|
@@ -119,6 +120,7 @@ interface IModalConfirmProps {
|
|
|
119
120
|
id?: string;
|
|
120
121
|
onCancel?: () => void;
|
|
121
122
|
onConfirm?: "submit" | (() => void);
|
|
123
|
+
sticky?: boolean;
|
|
122
124
|
txtCancel?: string;
|
|
123
125
|
txtConfirm?: React.ReactNode | string;
|
|
124
126
|
}
|
|
@@ -9,6 +9,7 @@ import { Thumb as k } from "./thumb/index.js";
|
|
|
9
9
|
import { normalizeValue as v } from "./utils.js";
|
|
10
10
|
import { Container as w } from "../container/index.js";
|
|
11
11
|
import { OutlineContainer as y } from "../inputs/outline-container/index.js";
|
|
12
|
+
import "../inputs/styles.js";
|
|
12
13
|
import "../checkbox/index.js";
|
|
13
14
|
import "../icon/index.js";
|
|
14
15
|
import "../../_virtual/lodash.js";
|
|
@@ -22,7 +23,7 @@ import "react-dom";
|
|
|
22
23
|
import "../layout/categories/buttons/index.js";
|
|
23
24
|
import "../inputs/utils/action-button/index.js";
|
|
24
25
|
import "../../node_modules/react-international-phone/dist/index.js";
|
|
25
|
-
const
|
|
26
|
+
const re = (o) => {
|
|
26
27
|
const p = S(), m = $(null), { label: s, minValue: i = 0, maxValue: n = 100, name: r, setValue: d, watch: c } = o, a = x(), t = V({
|
|
27
28
|
...o,
|
|
28
29
|
numberFormatter: a,
|
|
@@ -75,6 +76,6 @@ const ee = (o) => {
|
|
|
75
76
|
) });
|
|
76
77
|
};
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
re as Slider,
|
|
79
80
|
x as useNumberFormatter
|
|
80
81
|
};
|
package/package.json
CHANGED