@fluidattacks/design 3.1.12 → 3.1.13
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/@core/index.js +2 -2
- package/dist/components/accordion/accordion-content/index.js +18 -5
- package/dist/components/accordion/index.js +71 -14
- package/dist/components/alert/index.js +108 -57
- package/dist/components/button/index.js +64 -13
- package/dist/components/card/card-header/index.js +78 -9
- package/dist/components/card/card-with-image/index.js +88 -13
- package/dist/components/card/card-with-input/index.js +72 -23
- package/dist/components/card/card-with-selector/index.js +63 -8
- package/dist/components/card/card-with-switch/index.js +46 -8
- package/dist/components/carousel/index.js +54 -28
- package/dist/components/checkbox/index.js +66 -32
- package/dist/components/cloud-image/index.js +2 -2
- package/dist/components/code-snippet/index.js +64 -19
- package/dist/components/code-snippet/location-code/index.js +146 -100
- package/dist/components/colors/index.js +220 -5
- package/dist/components/confirm-dialog/index.js +41 -18
- package/dist/components/container/index.js +39 -15
- package/dist/components/content-card/category-tag/index.js +37 -8
- package/dist/components/content-card/event-date/index.js +53 -10
- package/dist/components/content-card/index.js +118 -13
- package/dist/components/content-card-carousel/index.js +87 -7
- package/dist/components/content-card-carousel/scroll-buttons/index.js +1 -1
- package/dist/components/divider/index.js +22 -7
- package/dist/components/empty-state/empty-button/index.js +4 -4
- package/dist/components/empty-state/index.js +52 -15
- package/dist/components/file-preview/index.js +28 -12
- package/dist/components/form/index.js +46 -9
- package/dist/components/grid-container/index.js +31 -11
- package/dist/components/group-selector/index.js +126 -17
- package/dist/components/group-selector/option-container/index.js +1 -1
- package/dist/components/icon/index.js +78 -18
- package/dist/components/icon-button/index.js +63 -14
- package/dist/components/indicator-card/index.js +70 -11
- package/dist/components/info-sidebar/index.js +107 -7
- package/dist/components/inputs/fields/combobox/index.js +141 -21
- package/dist/components/inputs/fields/combobox/option/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/cell/index.js +22 -11
- package/dist/components/inputs/fields/date/calendar/grid/index.js +21 -10
- package/dist/components/inputs/fields/date/calendar/header/index.js +35 -13
- package/dist/components/inputs/fields/date/calendar/index.js +26 -11
- package/dist/components/inputs/fields/date/index.js +65 -15
- package/dist/components/inputs/fields/date-range/calendar/index.js +29 -10
- package/dist/components/inputs/fields/date-range/index.js +98 -18
- package/dist/components/inputs/fields/date-time/calendar/index.js +44 -15
- package/dist/components/inputs/fields/date-time/index.js +65 -14
- package/dist/components/inputs/fields/editable/index.js +22 -10
- package/dist/components/inputs/fields/input/index.js +74 -10
- package/dist/components/inputs/fields/input-file/index.js +114 -21
- package/dist/components/inputs/fields/input-tags/index.js +60 -11
- package/dist/components/inputs/fields/number/index.js +54 -7
- package/dist/components/inputs/fields/number-range/index.js +46 -8
- package/dist/components/inputs/fields/phone/index.js +446 -286
- package/dist/components/inputs/fields/text-area/index.js +78 -10
- package/dist/components/inputs/label/index.js +34 -8
- package/dist/components/inputs/outline-container/index.js +98 -12
- package/dist/components/inputs/utils/action-button/index.js +28 -7
- package/dist/components/inputs/utils/calendar-button/index.js +34 -10
- package/dist/components/inputs/utils/date-selector/index.js +60 -6
- package/dist/components/inputs/utils/date-time-field/index.js +129 -28
- package/dist/components/inputs/utils/dialog/index.js +10 -7
- package/dist/components/inputs/utils/number-field/index.js +81 -8
- package/dist/components/inputs/utils/popover/index.js +41 -10
- package/dist/components/interactive-card/icon/index.js +1 -1
- package/dist/components/interactive-card/index.js +110 -7
- package/dist/components/language-selector/index.js +34 -10
- package/dist/components/language-selector/item-list/index.js +1 -1
- package/dist/components/link/index.js +71 -17
- package/dist/components/list-item/index.js +64 -13
- package/dist/components/little-flag/index.js +26 -9
- package/dist/components/loading/index.js +48 -21
- package/dist/components/logo/index.js +10 -4
- package/dist/components/logo-carousel/index.js +40 -5
- package/dist/components/lottie/index.js +12 -7
- package/dist/components/menu/index.js +53 -9
- package/dist/components/message-banner/index.js +79 -13
- package/dist/components/modal/index.js +59 -13
- package/dist/components/modal/modal-confirm/index.js +48 -7
- package/dist/components/modal/modal-footer/index.js +22 -13
- package/dist/components/modal/modal-header/index.js +45 -19
- package/dist/components/notification/index.js +65 -20
- package/dist/components/notification-sign/index.js +27 -10
- package/dist/components/number-input/index.js +58 -21
- package/dist/components/oauth-selector/index.js +97 -23
- package/dist/components/oauth-selector/option-container/index.js +68 -7
- package/dist/components/plan-card/index.js +99 -28
- package/dist/components/plan-card/recommended-tag/index.js +23 -2
- package/dist/components/pop-up/description/index.js +47 -9
- package/dist/components/pop-up/index.js +146 -17
- package/dist/components/premium-feature/index.js +56 -16
- package/dist/components/priority-score/index.js +24 -9
- package/dist/components/progress/index.js +30 -17
- package/dist/components/progress-bar/index.js +99 -41
- package/dist/components/radio-button/index.js +64 -27
- package/dist/components/scroll-button/index.js +33 -15
- package/dist/components/search/index.js +77 -35
- package/dist/components/search-bar/index.js +211 -24
- package/dist/components/search-bar/item-searching/index.js +1 -1
- package/dist/components/severity-badge/index.js +66 -6
- package/dist/components/severity-overview/badge/index.js +62 -11
- package/dist/components/severity-overview/index.js +15 -5
- package/dist/components/show-on-hover/index.js +16 -10
- package/dist/components/slide-out-menu/index.js +2611 -1164
- package/dist/components/slide-out-menu/menu-item/index.js +58 -6
- package/dist/components/slider/index.js +79 -48
- package/dist/components/slider/thumb/index.js +13 -6
- package/dist/components/step-lapse/index.js +81 -23
- package/dist/components/table-button/index.js +65 -24
- package/dist/components/tabs/fixed-tabs/index.js +24 -4
- package/dist/components/tabs/index.js +54 -11
- package/dist/components/tabs/tab/index.js +37 -6
- package/dist/components/tag/index.js +95 -27
- package/dist/components/timeline/card/index.js +1 -1
- package/dist/components/timeline/index.js +15 -5
- package/dist/components/toggle/index.js +65 -25
- package/dist/components/toggle-buttons/index.js +51 -22
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tour/index.js +3897 -1829
- package/dist/components/typography/heading/index.js +43 -5
- package/dist/components/typography/span/index.js +38 -6
- package/dist/components/typography/text/index.js +44 -6
- package/dist/components/web-form/index.js +28 -19
- package/dist/hooks/index.js +5 -5
- package/dist/index-BMHVi812.mjs +234 -0
- package/dist/index-BzAniA2J.mjs +135 -0
- package/dist/index-C6LbClYh.mjs +146 -0
- package/dist/index-CAIe8hBv.mjs +130 -0
- package/dist/index-CUQBAqt_.mjs +75 -0
- package/dist/index-CWlrSlUk.mjs +68 -0
- package/dist/index-Ckmu1TfV.mjs +86 -0
- package/dist/index-DwznImvK.mjs +1678 -0
- package/dist/index-maWH3JYC.mjs +3561 -0
- package/dist/index.js +11 -11
- package/dist/styles-B2N0JLw1.mjs +114 -0
- package/dist/styles-B64DVBIF.mjs +115 -0
- package/dist/{styles-lSVV9kjn.mjs → styles-BXFVwnWT.mjs} +28 -28
- package/dist/styles-BZQOqe8p.mjs +141 -0
- package/dist/styles-Bdque9TT.mjs +65 -0
- package/dist/{styles-CI-I6joH.mjs → styles-BlHspTrz.mjs} +18 -18
- package/dist/{styles-Cx93EcVo.mjs → styles-CROOwXEH.mjs} +5 -5
- package/dist/styles-CplEd2kw.mjs +228 -0
- package/dist/styles-D1eTIklB.mjs +110 -0
- package/dist/styles-ePGii_9g.mjs +74 -0
- package/dist/use-carousel-CgAF78h3.mjs +23 -0
- package/dist/use-click-outside-BUll8Ag-.mjs +18 -0
- package/dist/use-cloudinary-image-BCxwj15o.mjs +1176 -0
- package/dist/use-modal-CtgexKnf.mjs +14 -0
- package/dist/use-search-Dj47QDw9.mjs +15 -0
- package/dist/utils-V0EumEPM.mjs +6 -0
- package/package.json +1 -3
- package/dist/index-38JqtnAI.mjs +0 -122
- package/dist/index-B5yoGFs6.mjs +0 -54
- package/dist/index-BLbKylyw.mjs +0 -209
- package/dist/index-Bu448Tz2.mjs +0 -106
- package/dist/index-BwFnfaRh.mjs +0 -2310
- package/dist/index-Co_k0WFk.mjs +0 -75
- package/dist/index-Cu7uUMlx.mjs +0 -82
- package/dist/index-D-lcuEHY.mjs +0 -1018
- package/dist/index-DrfjITyT.mjs +0 -61
- package/dist/styles-7_q7nHce.mjs +0 -110
- package/dist/styles-BA0WIQL-.mjs +0 -74
- package/dist/styles-C3cZmKVJ.mjs +0 -131
- package/dist/styles-D85YYIjM.mjs +0 -131
- package/dist/styles-EIbGRPlk.mjs +0 -106
- package/dist/styles-Q1VXuWI7.mjs +0 -65
- package/dist/styles-fH2c4cfc.mjs +0 -77
- package/dist/use-carousel-CvRxi2FI.mjs +0 -17
- package/dist/use-click-outside-BtZLIoU1.mjs +0 -18
- package/dist/use-cloudinary-image-fG7ODNgr.mjs +0 -611
- package/dist/use-modal-CkrZ-_-M.mjs +0 -14
- package/dist/use-search-DpLNvt7Q.mjs +0 -12
- package/dist/utils-CQvBF-wY.mjs +0 -4
|
@@ -1,26 +1,146 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as J, useState as
|
|
1
|
+
import { jsx as r, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useState as x, useRef as u, useMemo as Q, useCallback as C } from "react";
|
|
3
3
|
import { useFilter as U, useComboBox as W, useListBox as X, useButton as Y } from "react-aria";
|
|
4
4
|
import { Item as Z, useComboBoxState as _ } from "react-stately";
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { S as
|
|
7
|
-
import { OutlineContainer as
|
|
8
|
-
import { S as
|
|
9
|
-
import { Popover as
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { IconButton as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
import { useTheme as k } from "styled-components";
|
|
6
|
+
import { S as g, O as oo } from "../../../../index-CUQBAqt_.mjs";
|
|
7
|
+
import { OutlineContainer as to } from "../../outline-container/index.js";
|
|
8
|
+
import { S as eo } from "../../../../styles-BXFVwnWT.mjs";
|
|
9
|
+
import { Popover as no } from "../../utils/popover/index.js";
|
|
10
|
+
import { Icon as ro } from "../../../icon/index.js";
|
|
11
|
+
import { IconButton as so } from "../../../icon-button/index.js";
|
|
12
|
+
const Io = J(function({
|
|
13
|
+
disabled: b = !1,
|
|
14
|
+
error: i,
|
|
15
|
+
helpLink: z,
|
|
16
|
+
helpLinkText: F,
|
|
17
|
+
helpText: N,
|
|
18
|
+
label: B,
|
|
19
|
+
name: m,
|
|
20
|
+
items: t,
|
|
21
|
+
onChange: e,
|
|
22
|
+
required: T,
|
|
23
|
+
tooltip: V,
|
|
24
|
+
value: S,
|
|
25
|
+
weight: j,
|
|
26
|
+
...K
|
|
27
|
+
}, I) {
|
|
28
|
+
const P = k(), [l, R] = x(S ?? ""), [L, v] = x(S), [a, h] = x(t), { contains: c } = U({ sensitivity: "base" }), f = u(null), d = u(null), w = u(null), y = u(null), $ = Q(() => t.map(
|
|
29
|
+
(o) => c(o.name, l) ? /* @__PURE__ */ r(Z, { children: o.name }, o.value) : null
|
|
30
|
+
), [c, l, t]), D = C(
|
|
31
|
+
(o) => {
|
|
32
|
+
R(o), v((s) => {
|
|
33
|
+
const p = o === "" ? "" : s;
|
|
34
|
+
return e == null || e(p), p;
|
|
35
|
+
}), h(t.filter((s) => c(s.name, o)));
|
|
36
|
+
},
|
|
37
|
+
[c, t, e]
|
|
38
|
+
), E = C(
|
|
39
|
+
(o) => {
|
|
40
|
+
var s;
|
|
41
|
+
o && (R(((s = t.find((p) => p.value === o)) == null ? void 0 : s.name) ?? ""), v(String(o)), e == null || e(o), h(t));
|
|
42
|
+
},
|
|
43
|
+
[e, t]
|
|
44
|
+
), n = _({
|
|
45
|
+
allowsEmptyCollection: !0,
|
|
46
|
+
inputValue: l,
|
|
47
|
+
items: a,
|
|
48
|
+
shouldCloseOnBlur: !0,
|
|
49
|
+
selectedKey: L,
|
|
50
|
+
onInputChange: D,
|
|
51
|
+
onSelectionChange: E,
|
|
52
|
+
children: $
|
|
53
|
+
}), {
|
|
54
|
+
buttonProps: M,
|
|
55
|
+
inputProps: q,
|
|
56
|
+
listBoxProps: A
|
|
57
|
+
} = W(
|
|
58
|
+
{
|
|
59
|
+
inputValue: l,
|
|
60
|
+
items: a,
|
|
61
|
+
buttonRef: f,
|
|
62
|
+
id: m,
|
|
63
|
+
inputRef: I,
|
|
64
|
+
label: B,
|
|
65
|
+
listBoxRef: d,
|
|
66
|
+
name: m,
|
|
67
|
+
popoverRef: y
|
|
68
|
+
},
|
|
69
|
+
n
|
|
70
|
+
), { listBoxProps: G } = X(A, n, d), { buttonProps: H } = Y(M, f);
|
|
71
|
+
return /* @__PURE__ */ O(
|
|
72
|
+
to,
|
|
73
|
+
{
|
|
74
|
+
error: i,
|
|
75
|
+
helpLink: z,
|
|
76
|
+
helpLinkText: F,
|
|
77
|
+
helpText: N,
|
|
78
|
+
htmlFor: m,
|
|
79
|
+
label: B,
|
|
80
|
+
required: T,
|
|
81
|
+
tooltip: V,
|
|
82
|
+
weight: j,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ O(
|
|
85
|
+
eo,
|
|
86
|
+
{
|
|
87
|
+
className: `${b ? "disabled" : ""} ${i ? "error" : ""}`,
|
|
88
|
+
ref: w,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ r(
|
|
91
|
+
"input",
|
|
92
|
+
{
|
|
93
|
+
...q,
|
|
94
|
+
...K,
|
|
95
|
+
"aria-invalid": i ? "true" : "false",
|
|
96
|
+
ref: I
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
i ? /* @__PURE__ */ r(
|
|
100
|
+
ro,
|
|
101
|
+
{
|
|
102
|
+
icon: "exclamation-circle",
|
|
103
|
+
iconClass: "error-icon",
|
|
104
|
+
iconColor: P.palette.error[500],
|
|
105
|
+
iconSize: "xs"
|
|
106
|
+
}
|
|
107
|
+
) : void 0,
|
|
108
|
+
/* @__PURE__ */ r(
|
|
109
|
+
so,
|
|
110
|
+
{
|
|
111
|
+
...H,
|
|
112
|
+
className: "action",
|
|
113
|
+
icon: n.isOpen ? "chevron-up" : "chevron-down",
|
|
114
|
+
iconColor: P.palette.gray[400],
|
|
115
|
+
iconSize: "xxs",
|
|
116
|
+
iconType: "fa-light",
|
|
117
|
+
px: 0.125,
|
|
118
|
+
py: 0.125,
|
|
119
|
+
ref: f,
|
|
120
|
+
variant: "ghost"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
n.isOpen && n.collection.size > 0 && !b ? /* @__PURE__ */ r(
|
|
127
|
+
no,
|
|
128
|
+
{
|
|
129
|
+
className: "dropdown",
|
|
130
|
+
offset: 4,
|
|
131
|
+
placement: "bottom start",
|
|
132
|
+
popoverRef: y,
|
|
133
|
+
state: n,
|
|
134
|
+
triggerRef: w,
|
|
135
|
+
children: /* @__PURE__ */ r(g, { ...G, ref: d, children: a.map(
|
|
136
|
+
(o) => /* @__PURE__ */ r(oo, { item: o, state: n }, o.value)
|
|
137
|
+
) })
|
|
138
|
+
}
|
|
139
|
+
) : null
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
);
|
|
23
143
|
});
|
|
24
144
|
export {
|
|
25
|
-
|
|
145
|
+
Io as ComboBox
|
|
26
146
|
};
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { isToday as u, getLocalTimeZone as R, isSameDay as
|
|
3
|
-
import { isNull as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useCalendarCell as
|
|
6
|
-
import { a as
|
|
7
|
-
import { Icon as
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { isToday as u, getLocalTimeZone as R, isSameDay as a } from "@internationalized/date";
|
|
3
|
+
import { isNull as g } from "lodash";
|
|
4
|
+
import { useRef as S } from "react";
|
|
5
|
+
import { useCalendarCell as b } from "react-aria";
|
|
6
|
+
import { a as x, b as y } from "../../../../../../styles-BlHspTrz.mjs";
|
|
7
|
+
import { Icon as C } from "../../../../../icon/index.js";
|
|
8
8
|
const k = ({ state: e, date: i }) => {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const r = S(null), o = u(i, R()), { cellProps: h, buttonProps: m, isSelected: l, isDisabled: c, formattedDate: f } = b({ date: i }, e, r), s = "highlightedRange" in e && !g(e.highlightedRange) ? a(i, e.highlightedRange.start) : l, d = "highlightedRange" in e && !g(e.highlightedRange) ? a(i, e.highlightedRange.end) : l, t = l && !c && !(s || d) ? "range" : "";
|
|
10
|
+
return /* @__PURE__ */ n(x, { id: t, ...h, children: /* @__PURE__ */ p(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
...m,
|
|
14
|
+
className: `cell ${s || d ? "selected" : ""}
|
|
15
|
+
${c ? "disabled" : ""} ${o ? "today" : ""}
|
|
16
|
+
${!e.isFocused && !o ? "focused" : ""} ${t}`,
|
|
17
|
+
ref: r,
|
|
18
|
+
children: [
|
|
19
|
+
f,
|
|
20
|
+
o ? /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(C, { clickable: !1, icon: "circle", iconSize: "xxs" }) }) : void 0
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
13
24
|
};
|
|
14
25
|
export {
|
|
15
26
|
k as CalendarCell
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { getWeeksInMonth as
|
|
3
|
-
import { useLocale as
|
|
2
|
+
import { getWeeksInMonth as h } from "@internationalized/date";
|
|
3
|
+
import { useLocale as k, useCalendarGrid as p } from "react-aria";
|
|
4
4
|
import { CalendarCell as y } from "../cell/index.js";
|
|
5
|
-
import { W as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { W as s, D as f } from "../../../../../../styles-BlHspTrz.mjs";
|
|
6
|
+
const g = ({
|
|
7
|
+
state: r,
|
|
8
|
+
...l
|
|
9
|
+
}) => {
|
|
10
|
+
const { locale: d } = k(), { weekDays: i } = p(l, r), c = h(r.visibleRange.start, d);
|
|
11
|
+
return /* @__PURE__ */ m("table", { children: [
|
|
12
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e(s, { children: i.map((n, o) => {
|
|
13
|
+
const a = `key_${o}`;
|
|
14
|
+
return /* @__PURE__ */ e(f, { children: n }, a);
|
|
15
|
+
}) }) }),
|
|
16
|
+
/* @__PURE__ */ e("tbody", { children: [...new Array(c).keys()].map(
|
|
17
|
+
(n) => /* @__PURE__ */ e(s, { children: r.getDatesInWeek(n).map((o, a) => {
|
|
18
|
+
const t = `key_${a}`;
|
|
19
|
+
return o ? /* @__PURE__ */ e(y, { date: o, state: r }, t) : /* @__PURE__ */ e("td", {}, t);
|
|
20
|
+
}) }, n)
|
|
21
|
+
) })
|
|
22
|
+
] });
|
|
12
23
|
};
|
|
13
24
|
export {
|
|
14
|
-
|
|
25
|
+
g as CalendarGrid
|
|
15
26
|
};
|
|
@@ -1,16 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { T as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Button as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as c } from "react";
|
|
3
|
+
import { T as m, Y as u, C as i } from "../../../../../../styles-BlHspTrz.mjs";
|
|
4
|
+
import { Icon as s } from "../../../../../icon/index.js";
|
|
5
|
+
import { Button as t } from "../../../../utils/calendar-button/index.js";
|
|
6
|
+
const v = ({
|
|
7
|
+
state: r,
|
|
8
|
+
prevButtonProps: n,
|
|
9
|
+
nextButtonProps: l,
|
|
10
|
+
title: d
|
|
11
|
+
}) => {
|
|
12
|
+
const e = r.focusedDate, h = c(() => {
|
|
13
|
+
r.setFocusedDate(e.add({ years: 1 }));
|
|
14
|
+
}, [e, r]), p = c(() => {
|
|
15
|
+
r.setFocusedDate(e.subtract({ years: 1 }));
|
|
16
|
+
}, [e, r]);
|
|
17
|
+
return /* @__PURE__ */ a("div", { className: "header flex items-start", children: [
|
|
18
|
+
/* @__PURE__ */ o(t, { icon: "chevron-left", props: n }),
|
|
19
|
+
/* @__PURE__ */ a(m, { children: [
|
|
20
|
+
d,
|
|
21
|
+
/* @__PURE__ */ a(u, { children: [
|
|
22
|
+
/* @__PURE__ */ o(i, { "aria-label": "top", onClick: h, children: /* @__PURE__ */ o(s, { icon: "caret-up", iconClass: "fa-sharp", iconSize: "xxss" }) }),
|
|
23
|
+
/* @__PURE__ */ o(i, { "aria-label": "bottom", onClick: p, children: /* @__PURE__ */ o(
|
|
24
|
+
s,
|
|
25
|
+
{
|
|
26
|
+
icon: "caret-down",
|
|
27
|
+
iconClass: "fa-sharp",
|
|
28
|
+
iconSize: "xxss"
|
|
29
|
+
}
|
|
30
|
+
) })
|
|
31
|
+
] })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ o(t, { icon: "chevron-right", props: l })
|
|
34
|
+
] });
|
|
13
35
|
};
|
|
14
36
|
export {
|
|
15
|
-
|
|
37
|
+
v as Header
|
|
16
38
|
};
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createCalendar as
|
|
3
|
-
import { useLocale as
|
|
4
|
-
import { useCalendarState as
|
|
5
|
-
import { CalendarGrid as
|
|
6
|
-
import { Header as
|
|
7
|
-
import { F as
|
|
8
|
-
import { Button as
|
|
9
|
-
const G = ({
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createCalendar as s } from "@internationalized/date";
|
|
3
|
+
import { useLocale as c, useCalendar as d } from "react-aria";
|
|
4
|
+
import { useCalendarState as p } from "react-stately";
|
|
5
|
+
import { CalendarGrid as f } from "./grid/index.js";
|
|
6
|
+
import { Header as C } from "./header/index.js";
|
|
7
|
+
import { F as u } from "../../../../../styles-BlHspTrz.mjs";
|
|
8
|
+
import { Button as h } from "../../../../button/index.js";
|
|
9
|
+
const G = ({
|
|
10
|
+
onClose: e,
|
|
11
|
+
props: t
|
|
12
|
+
}) => {
|
|
13
|
+
const { locale: a } = c(), o = p({ ...t, createCalendar: s, locale: a }), { prevButtonProps: n, nextButtonProps: i, title: m } = d(t, o);
|
|
14
|
+
return /* @__PURE__ */ l("div", { className: "calendar", children: [
|
|
15
|
+
/* @__PURE__ */ r(
|
|
16
|
+
C,
|
|
17
|
+
{
|
|
18
|
+
nextButtonProps: i,
|
|
19
|
+
prevButtonProps: n,
|
|
20
|
+
state: o,
|
|
21
|
+
title: m
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ r(f, { state: o }),
|
|
25
|
+
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(h, { onClick: e, variant: "ghost", children: "Cancel" }) })
|
|
26
|
+
] });
|
|
12
27
|
};
|
|
13
28
|
export {
|
|
14
29
|
G as Calendar
|
|
@@ -1,18 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { parseDate as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useDatePicker as
|
|
6
|
-
import { useDatePickerState as
|
|
7
|
-
import { Calendar as
|
|
8
|
-
import { OutlineContainer as
|
|
9
|
-
import { DateSelector as
|
|
10
|
-
import { Dialog as
|
|
11
|
-
import { Popover as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { parseDate as k } from "@internationalized/date";
|
|
3
|
+
import a from "lodash";
|
|
4
|
+
import { forwardRef as x, useRef as C } from "react";
|
|
5
|
+
import { useDatePicker as j } from "react-aria";
|
|
6
|
+
import { useDatePickerState as I } from "react-stately";
|
|
7
|
+
import { Calendar as O } from "./calendar/index.js";
|
|
8
|
+
import { OutlineContainer as S } from "../../outline-container/index.js";
|
|
9
|
+
import { DateSelector as b } from "../../utils/date-selector/index.js";
|
|
10
|
+
import { Dialog as w } from "../../utils/dialog/index.js";
|
|
11
|
+
import { Popover as y } from "../../utils/popover/index.js";
|
|
12
|
+
const L = x(function({
|
|
13
|
+
disabled: p = !1,
|
|
14
|
+
error: s,
|
|
15
|
+
required: l,
|
|
16
|
+
label: m,
|
|
17
|
+
name: e,
|
|
18
|
+
tooltip: c,
|
|
19
|
+
value: o,
|
|
20
|
+
...f
|
|
21
|
+
}, u) {
|
|
22
|
+
const i = C(null), r = I(f), { close: P } = r, { groupProps: d, fieldProps: n, buttonProps: D, dialogProps: g, calendarProps: R } = j(
|
|
23
|
+
{ ...f, "aria-label": m ?? e },
|
|
24
|
+
r,
|
|
25
|
+
i
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ h(
|
|
28
|
+
S,
|
|
29
|
+
{
|
|
30
|
+
error: s,
|
|
31
|
+
htmlFor: e,
|
|
32
|
+
label: m,
|
|
33
|
+
required: l,
|
|
34
|
+
tooltip: c,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
b,
|
|
38
|
+
{
|
|
39
|
+
buttonProps: D,
|
|
40
|
+
datePickerRef: i,
|
|
41
|
+
disabled: p,
|
|
42
|
+
error: s,
|
|
43
|
+
fieldProps: a.isNil(o) || a.isEmpty(o) || o === "-" ? n : {
|
|
44
|
+
...n,
|
|
45
|
+
value: k(o.replace(/\//gu, "-"))
|
|
46
|
+
},
|
|
47
|
+
groupProps: d,
|
|
48
|
+
inputRef: u,
|
|
49
|
+
name: e
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
r.isOpen && !p ? /* @__PURE__ */ t(
|
|
53
|
+
y,
|
|
54
|
+
{
|
|
55
|
+
offset: 8,
|
|
56
|
+
placement: "bottom start",
|
|
57
|
+
state: r,
|
|
58
|
+
triggerRef: i,
|
|
59
|
+
children: /* @__PURE__ */ t(w, { ...g, children: /* @__PURE__ */ t(O, { onClose: P, props: { ...R } }) })
|
|
60
|
+
}
|
|
61
|
+
) : null
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
15
65
|
});
|
|
16
66
|
export {
|
|
17
|
-
|
|
67
|
+
L as InputDate
|
|
18
68
|
};
|
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createCalendar as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useLocale as
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createCalendar as c } from "@internationalized/date";
|
|
3
|
+
import { useRef as d } from "react";
|
|
4
|
+
import { useLocale as f, useRangeCalendar as p } from "react-aria";
|
|
5
5
|
import { useRangeCalendarState as u } from "react-stately";
|
|
6
6
|
import { CalendarGrid as C } from "../../date/calendar/grid/index.js";
|
|
7
|
-
import { Header as
|
|
8
|
-
import { F as h } from "../../../../../styles-
|
|
9
|
-
import { Button as
|
|
10
|
-
const L = ({
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { Header as g } from "../../date/calendar/header/index.js";
|
|
8
|
+
import { F as h } from "../../../../../styles-BlHspTrz.mjs";
|
|
9
|
+
import { Button as x } from "../../../../button/index.js";
|
|
10
|
+
const L = ({
|
|
11
|
+
onClose: a,
|
|
12
|
+
props: o
|
|
13
|
+
}) => {
|
|
14
|
+
const { locale: n } = f(), t = d(null), e = u({ ...o, createCalendar: c, locale: n }), { prevButtonProps: l, nextButtonProps: m, title: i } = p(
|
|
15
|
+
o,
|
|
16
|
+
e,
|
|
17
|
+
t
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ s("div", { className: "calendar-range", ref: t, children: [
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
|
+
g,
|
|
22
|
+
{
|
|
23
|
+
nextButtonProps: m,
|
|
24
|
+
prevButtonProps: l,
|
|
25
|
+
state: e,
|
|
26
|
+
title: i
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ r(C, { state: e }),
|
|
30
|
+
/* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(x, { onClick: a, variant: "ghost", children: "Cancel" }) })
|
|
31
|
+
] });
|
|
13
32
|
};
|
|
14
33
|
export {
|
|
15
34
|
L as Calendar
|
|
@@ -1,28 +1,108 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useDateRangePicker as
|
|
4
|
-
import { useDateRangePickerState as
|
|
5
|
-
import { Calendar as
|
|
6
|
-
import { styled as
|
|
7
|
-
import { OutlineContainer as
|
|
8
|
-
import { DateSelector as
|
|
1
|
+
import { jsxs as m, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k, useRef as w } from "react";
|
|
3
|
+
import { useDateRangePicker as y } from "react-aria";
|
|
4
|
+
import { useDateRangePickerState as S } from "react-stately";
|
|
5
|
+
import { Calendar as C } from "./calendar/index.js";
|
|
6
|
+
import { styled as F } from "styled-components";
|
|
7
|
+
import { OutlineContainer as O } from "../../outline-container/index.js";
|
|
8
|
+
import { DateSelector as g } from "../../utils/date-selector/index.js";
|
|
9
9
|
import { Dialog as j } from "../../utils/dialog/index.js";
|
|
10
|
-
import { Popover as
|
|
11
|
-
const
|
|
12
|
-
${({ theme:
|
|
13
|
-
border-color: ${
|
|
10
|
+
import { Popover as q } from "../../utils/popover/index.js";
|
|
11
|
+
const I = F.div`
|
|
12
|
+
${({ theme: t, $disabled: e, $show: a }) => `
|
|
13
|
+
border-color: ${a ? t.palette.error[500] : t.palette.gray[300]};
|
|
14
14
|
display: flex;
|
|
15
|
-
gap: ${
|
|
15
|
+
gap: ${t.spacing[0.25]};
|
|
16
16
|
width: 100%;
|
|
17
17
|
|
|
18
18
|
~ div {
|
|
19
|
-
background: ${
|
|
19
|
+
background: ${e ? t.palette.gray[200] : t.palette.white};
|
|
20
20
|
}
|
|
21
21
|
`}
|
|
22
|
-
`,
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
`, N = k(function({
|
|
23
|
+
disabled: e = !1,
|
|
24
|
+
error: a,
|
|
25
|
+
label: P,
|
|
26
|
+
name: o,
|
|
27
|
+
required: $,
|
|
28
|
+
tooltip: R,
|
|
29
|
+
...d
|
|
30
|
+
}, u) {
|
|
31
|
+
const r = w(null), n = S(d), { close: v } = n, b = `min${o}`, D = `max${o}`, {
|
|
32
|
+
groupProps: f,
|
|
33
|
+
startFieldProps: i,
|
|
34
|
+
endFieldProps: s,
|
|
35
|
+
buttonProps: c,
|
|
36
|
+
dialogProps: h,
|
|
37
|
+
calendarProps: x
|
|
38
|
+
} = y(d, n, r);
|
|
39
|
+
return /* @__PURE__ */ m(
|
|
40
|
+
O,
|
|
41
|
+
{
|
|
42
|
+
error: a,
|
|
43
|
+
htmlFor: o,
|
|
44
|
+
label: P,
|
|
45
|
+
required: $,
|
|
46
|
+
tooltip: R,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ m(
|
|
49
|
+
I,
|
|
50
|
+
{
|
|
51
|
+
$disabled: e,
|
|
52
|
+
$show: a !== void 0,
|
|
53
|
+
ref: r,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ l(
|
|
56
|
+
g,
|
|
57
|
+
{
|
|
58
|
+
buttonProps: c,
|
|
59
|
+
datePickerRef: r,
|
|
60
|
+
disabled: e,
|
|
61
|
+
error: a,
|
|
62
|
+
fieldProps: {
|
|
63
|
+
...i,
|
|
64
|
+
"aria-label": `${i["aria-label"]} ${o}`,
|
|
65
|
+
validate: (p) => s.value && p > s.value ? "Start date must be less than or equal to end date" : null
|
|
66
|
+
},
|
|
67
|
+
groupProps: f,
|
|
68
|
+
inputRef: u,
|
|
69
|
+
name: b
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ l(
|
|
73
|
+
g,
|
|
74
|
+
{
|
|
75
|
+
buttonProps: c,
|
|
76
|
+
datePickerRef: r,
|
|
77
|
+
disabled: e,
|
|
78
|
+
error: a,
|
|
79
|
+
fieldProps: {
|
|
80
|
+
...s,
|
|
81
|
+
"aria-label": `${s["aria-label"]} ${o}`,
|
|
82
|
+
validate: (p) => i.value && p < i.value ? "End date must be greater than or equal to start date" : null
|
|
83
|
+
},
|
|
84
|
+
groupProps: f,
|
|
85
|
+
inputRef: u,
|
|
86
|
+
name: D
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
n.isOpen && !e ? /* @__PURE__ */ l(
|
|
93
|
+
q,
|
|
94
|
+
{
|
|
95
|
+
offset: 8,
|
|
96
|
+
placement: "bottom start",
|
|
97
|
+
state: n,
|
|
98
|
+
triggerRef: r,
|
|
99
|
+
children: /* @__PURE__ */ l(j, { ...h, children: /* @__PURE__ */ l(C, { onClose: v, props: { ...x } }) })
|
|
100
|
+
}
|
|
101
|
+
) : null
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
25
105
|
});
|
|
26
106
|
export {
|
|
27
|
-
|
|
107
|
+
N as InputDateRange
|
|
28
108
|
};
|