@fluidattacks/design 11.6.1 → 11.7.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/_virtual/index.js +2 -3
- package/dist/_virtual/index2.js +3 -5
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -2
- package/dist/assets/styles/global.css +1 -1
- package/dist/components/charts/distribution-bar/index.d.ts +4 -0
- package/dist/components/charts/distribution-bar/index.js +44 -0
- package/dist/components/charts/distribution-bar/index.stories.d.ts +10 -0
- package/dist/components/charts/distribution-bar/index.test.d.ts +1 -0
- package/dist/components/charts/distribution-bar/styles.d.ts +10 -0
- package/dist/components/charts/distribution-bar/styles.js +20 -0
- package/dist/components/charts/distribution-bar/types.d.ts +37 -0
- package/dist/components/charts/distribution-bar/utils.d.ts +3 -0
- package/dist/components/charts/distribution-bar/utils.js +22 -0
- package/dist/components/charts/index.d.ts +3 -1
- package/dist/components/charts/index.js +8 -6
- package/dist/components/code-snippet/constants.js +6 -5
- package/dist/components/code-snippet/index.js +51 -66
- package/dist/components/form/index.js +51 -54
- package/dist/components/form/styles.js +17 -12
- package/dist/components/inputs/fields/month/panel.d.ts +11 -0
- package/dist/components/inputs/fields/month/panel.test.d.ts +1 -0
- package/dist/components/inputs/fields/month/styles.d.ts +4 -0
- package/dist/components/inputs/fields/month/utils.d.ts +15 -0
- package/dist/components/inputs/fields/month/utils.test.d.ts +1 -0
- package/dist/components/modal/styles.js +10 -9
- package/dist/index.js +298 -296
- package/dist/node_modules/react-joyride/dist/index.js +4 -4
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,56 @@
|
|
|
1
1
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { yupResolver as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { Controller as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { InnerForm as
|
|
2
|
+
import { yupResolver as S } from "../../node_modules/@hookform/resolvers/yup/dist/yup.js";
|
|
3
|
+
import { useForm as j, FormProvider as k } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
4
|
+
import { Controller as J, useController as K, useFieldArray as L, useFormContext as M, useWatch as N } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
5
|
+
import { useTheme as D } from "styled-components";
|
|
6
|
+
import { InnerForm as U } from "./inner-form/index.js";
|
|
7
7
|
import { StyledForm as R, FormContent as W } from "./styles.js";
|
|
8
|
-
import { Button as
|
|
8
|
+
import { Button as f } from "../button/index.js";
|
|
9
9
|
import { Container as l } from "../container/index.js";
|
|
10
|
-
const
|
|
10
|
+
const A = ({
|
|
11
11
|
alert: n,
|
|
12
12
|
buttonAlignment: d,
|
|
13
|
-
cancelButton:
|
|
14
|
-
children:
|
|
15
|
-
confirmButton:
|
|
16
|
-
defaultDisabled:
|
|
17
|
-
id:
|
|
18
|
-
maxButtonWidth:
|
|
19
|
-
mode:
|
|
20
|
-
onSubmit:
|
|
21
|
-
padding:
|
|
13
|
+
cancelButton: r,
|
|
14
|
+
children: h,
|
|
15
|
+
confirmButton: t,
|
|
16
|
+
defaultDisabled: u = !0,
|
|
17
|
+
id: m = "modal-confirm",
|
|
18
|
+
maxButtonWidth: x,
|
|
19
|
+
mode: y,
|
|
20
|
+
onSubmit: b,
|
|
21
|
+
padding: g = !0,
|
|
22
22
|
showButtons: a = !0,
|
|
23
|
-
yupSchema:
|
|
24
|
-
...
|
|
23
|
+
yupSchema: p,
|
|
24
|
+
...C
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
...
|
|
28
|
-
mode:
|
|
29
|
-
resolver:
|
|
26
|
+
const e = D(), i = j({
|
|
27
|
+
...C,
|
|
28
|
+
mode: y ?? "all",
|
|
29
|
+
resolver: p ? S(p) : void 0
|
|
30
30
|
});
|
|
31
|
-
function
|
|
32
|
-
|
|
31
|
+
function F(c) {
|
|
32
|
+
c.stopPropagation(), i.handleSubmit(b)(c);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */ o(
|
|
34
|
+
const $ = a ? `calc(100% - ${n ? "139px" : "83px"})` : "100%", v = x ?? (r ? "392px" : "190px");
|
|
35
|
+
return /* @__PURE__ */ o(k, { ...i, children: /* @__PURE__ */ o(R, { onSubmit: F, children: /* @__PURE__ */ s(l, { scroll: "y", width: "100%", children: [
|
|
36
36
|
/* @__PURE__ */ o(
|
|
37
37
|
W,
|
|
38
38
|
{
|
|
39
|
-
$padded:
|
|
40
|
-
borderRadius: `0 0 ${
|
|
39
|
+
$padded: g,
|
|
40
|
+
borderRadius: `0 0 ${e.spacing[0.25]} ${e.spacing[0.25]}`,
|
|
41
41
|
display: "flex",
|
|
42
42
|
flexDirection: "column",
|
|
43
43
|
gap: 0.5,
|
|
44
|
-
height:
|
|
45
|
-
pb: f,
|
|
46
|
-
pt: 0,
|
|
47
|
-
px: f,
|
|
44
|
+
height: $,
|
|
48
45
|
scroll: "y",
|
|
49
|
-
children:
|
|
46
|
+
children: h
|
|
50
47
|
}
|
|
51
48
|
),
|
|
52
49
|
a && /* @__PURE__ */ s(
|
|
53
50
|
l,
|
|
54
51
|
{
|
|
55
|
-
borderRadius: `0 0 ${
|
|
56
|
-
borderTop: `1px solid ${
|
|
52
|
+
borderRadius: `0 0 ${e.spacing[0.25]} ${e.spacing[0.25]}`,
|
|
53
|
+
borderTop: `1px solid ${e.palette.gray[200]}`,
|
|
57
54
|
display: "flex",
|
|
58
55
|
flexDirection: d ? "unset" : "column",
|
|
59
56
|
gap: 0.625,
|
|
@@ -63,30 +60,30 @@ const E = ({
|
|
|
63
60
|
py: 1.25,
|
|
64
61
|
children: [
|
|
65
62
|
n,
|
|
66
|
-
/* @__PURE__ */ s(l, { display: "flex", gap: 0.75, maxWidth:
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
/* @__PURE__ */ s(l, { display: "flex", gap: 0.75, maxWidth: v, children: [
|
|
64
|
+
r ? /* @__PURE__ */ o(
|
|
65
|
+
f,
|
|
69
66
|
{
|
|
70
|
-
icon:
|
|
71
|
-
id: `${
|
|
67
|
+
icon: r.icon,
|
|
68
|
+
id: `${m}-cancel`,
|
|
72
69
|
justify: "center",
|
|
73
|
-
onClick:
|
|
70
|
+
onClick: r.onClick,
|
|
74
71
|
type: "reset",
|
|
75
72
|
variant: "tertiary",
|
|
76
73
|
width: "100%",
|
|
77
|
-
children:
|
|
74
|
+
children: r.label ?? "Cancel"
|
|
78
75
|
}
|
|
79
76
|
) : void 0,
|
|
80
77
|
/* @__PURE__ */ o(
|
|
81
|
-
|
|
78
|
+
f,
|
|
82
79
|
{
|
|
83
|
-
disabled: (
|
|
84
|
-
icon:
|
|
85
|
-
id:
|
|
80
|
+
disabled: (t?.disabled ?? !1) || i.formState.isSubmitting || u && !i.formState.isDirty,
|
|
81
|
+
icon: t?.icon,
|
|
82
|
+
id: m,
|
|
86
83
|
justify: "center",
|
|
87
84
|
type: "submit",
|
|
88
85
|
width: "100%",
|
|
89
|
-
children:
|
|
86
|
+
children: t?.label ?? "Confirm"
|
|
90
87
|
}
|
|
91
88
|
)
|
|
92
89
|
] })
|
|
@@ -96,11 +93,11 @@ const E = ({
|
|
|
96
93
|
] }) }) });
|
|
97
94
|
};
|
|
98
95
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
J as Controller,
|
|
97
|
+
A as Form,
|
|
98
|
+
U as InnerForm,
|
|
99
|
+
K as useController,
|
|
100
|
+
L as useFieldArray,
|
|
101
|
+
M as useFormContext,
|
|
102
|
+
N as useWatch
|
|
106
103
|
};
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { Container as
|
|
3
|
-
const
|
|
1
|
+
import { styled as o } from "styled-components";
|
|
2
|
+
import { Container as a } from "../container/index.js";
|
|
3
|
+
const r = o(a)`
|
|
4
4
|
> * {
|
|
5
5
|
flex-shrink: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
${({ $padded:
|
|
8
|
+
${({ $padded: n, theme: i }) => n ? `
|
|
9
|
+
padding: 0 var(--form-padding, ${i.spacing[1.5]})
|
|
10
|
+
var(--form-padding, ${i.spacing[1.5]});
|
|
11
|
+
` : `
|
|
12
|
+
padding: 0;
|
|
13
|
+
|
|
9
14
|
> #footer {
|
|
10
15
|
box-sizing: content-box;
|
|
11
|
-
padding-bottom: ${
|
|
12
|
-
padding-left: ${
|
|
13
|
-
padding-right: ${
|
|
16
|
+
padding-bottom: ${i.spacing[1.25]};
|
|
17
|
+
padding-left: ${i.spacing[1.25]};
|
|
18
|
+
padding-right: ${i.spacing[1.25]};
|
|
14
19
|
}
|
|
15
20
|
`}
|
|
16
|
-
`,
|
|
17
|
-
${({ theme:
|
|
21
|
+
`, g = o.form`
|
|
22
|
+
${({ theme: n }) => `
|
|
18
23
|
align-items: flex-start;
|
|
19
24
|
align-self: stretch;
|
|
20
25
|
display: flex;
|
|
21
26
|
flex-direction: column;
|
|
22
|
-
gap: ${
|
|
27
|
+
gap: ${n.spacing[0.5]};
|
|
23
28
|
overflow: hidden auto;
|
|
24
29
|
width: 100%;
|
|
25
30
|
`}
|
|
26
31
|
`;
|
|
27
32
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
r as FormContent,
|
|
34
|
+
g as StyledForm
|
|
30
35
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Props of the month panel; `value`, `minValue` and `maxValue` are `MM/YYYY`. */
|
|
2
|
+
interface IMonthPanelProps {
|
|
3
|
+
maxValue?: string;
|
|
4
|
+
minValue?: string;
|
|
5
|
+
onSelect: (period: string) => void;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
/** The year bar and the month grid of a month picker. */
|
|
9
|
+
declare const MonthPanel: ({ maxValue, minValue, onSelect, value, }: Readonly<IMonthPanelProps>) => JSX.Element;
|
|
10
|
+
export { MonthPanel };
|
|
11
|
+
export type { IMonthPanelProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const YearBar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
2
|
+
declare const MonthGrid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
3
|
+
declare const MonthItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
4
|
+
export { MonthGrid, MonthItem, YearBar };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Month abbreviations, indexed by zero-based month. */
|
|
2
|
+
declare const MONTHS: readonly ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
3
|
+
interface IMonth {
|
|
4
|
+
month: number;
|
|
5
|
+
year: number;
|
|
6
|
+
}
|
|
7
|
+
/** The `MM/YYYY` of a full year and a zero-based month. */
|
|
8
|
+
declare const toPeriod: (year: number, month: number) => string;
|
|
9
|
+
/** The full year and zero-based month of a `MM/YYYY`; undefined when `period` is not one. */
|
|
10
|
+
declare const fromPeriod: (period: string) => IMonth | undefined;
|
|
11
|
+
/** The `Mon YYYY` a trigger shows; empty when `period` is not a `MM/YYYY`. */
|
|
12
|
+
declare const formatPeriod: (period: string) => string;
|
|
13
|
+
/** Whether the zero-based `month` of a full `year` is outside the inclusive `MM/YYYY` bounds; a bound that is not a `MM/YYYY` excludes every month. */
|
|
14
|
+
declare const isOutOfRange: (year: number, month: number, minValue: string | undefined, maxValue: string | undefined) => boolean;
|
|
15
|
+
export { MONTHS, formatPeriod, fromPeriod, isOutOfRange, toPeriod };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled as a } from "styled-components";
|
|
2
2
|
import { variantBuilder as p } from "../@core/variants/utils.js";
|
|
3
3
|
import { Container as c } from "../container/index.js";
|
|
4
|
-
import { FormContent as
|
|
4
|
+
import { FormContent as e } from "../form/styles.js";
|
|
5
5
|
const { getVariant: l } = p(
|
|
6
6
|
(i) => ({
|
|
7
7
|
fixed: `
|
|
@@ -32,7 +32,7 @@ const { getVariant: l } = p(
|
|
|
32
32
|
}
|
|
33
33
|
`
|
|
34
34
|
})
|
|
35
|
-
),
|
|
35
|
+
), m = a.div.attrs({
|
|
36
36
|
className: "comp-modal fixed inset-0 overflow-auto"
|
|
37
37
|
})`
|
|
38
38
|
align-items: center;
|
|
@@ -62,9 +62,9 @@ const { getVariant: l } = p(
|
|
|
62
62
|
${l(i, o)}
|
|
63
63
|
`}
|
|
64
64
|
`, t = (i, o) => {
|
|
65
|
-
const n = i.spacing[1.
|
|
65
|
+
const n = i.spacing[1.25], r = `1px + ${i.spacing[1.25]}`, d = `${i.spacing[1.25]} + 2 * ${o} + 2px`, s = i.spacing[0.5];
|
|
66
66
|
return `calc(${n} + ${r} + ${d} + ${s})`;
|
|
67
|
-
},
|
|
67
|
+
}, b = a.div`
|
|
68
68
|
${({ theme: i }) => `
|
|
69
69
|
background-color: ${i.palette.white};
|
|
70
70
|
border-radius: 0 0 ${i.spacing[0.25]} ${i.spacing[0.25]};
|
|
@@ -72,12 +72,14 @@ const { getVariant: l } = p(
|
|
|
72
72
|
flex-direction: column;
|
|
73
73
|
flex-grow: 1;
|
|
74
74
|
overflow: hidden auto;
|
|
75
|
-
padding: ${i.spacing[1.25]}
|
|
75
|
+
padding: ${i.spacing[1.25]};
|
|
76
76
|
scrollbar-color: ${i.palette.gray[600]} ${i.palette.gray[100]};
|
|
77
77
|
scroll-padding: ${i.spacing[0.5]};
|
|
78
|
+
/* The modal sets the padding of any Form inside it */
|
|
79
|
+
--form-padding: ${i.spacing[1.25]};
|
|
78
80
|
|
|
79
81
|
&,
|
|
80
|
-
${
|
|
82
|
+
${e} {
|
|
81
83
|
> #footer {
|
|
82
84
|
background-color: ${i.palette.white};
|
|
83
85
|
border-top: 1px solid transparent;
|
|
@@ -130,7 +132,6 @@ const { getVariant: l } = p(
|
|
|
130
132
|
max-height: 100%;
|
|
131
133
|
max-width: 100%;
|
|
132
134
|
padding: ${({ theme: i }) => `${i.spacing[1.25]}`};
|
|
133
|
-
padding-bottom: ${({ theme: i }) => `${i.spacing[1.5]}`};
|
|
134
135
|
position: sticky;
|
|
135
136
|
z-index: 1;
|
|
136
137
|
`, y = a.div.attrs({
|
|
@@ -188,7 +189,7 @@ export {
|
|
|
188
189
|
u as Header,
|
|
189
190
|
h as ImageContainer,
|
|
190
191
|
w as ModalContainer,
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
b as ModalContent,
|
|
193
|
+
m as ModalWrapper,
|
|
193
194
|
y as Title
|
|
194
195
|
};
|