@bitrise/bitkit-v2 0.3.153 → 0.3.155
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/atoms/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/BitkitCalendar/BitkitCalendar.d.ts +2 -2
- package/dist/components/BitkitCalendar/BitkitCalendar.js +52 -52
- package/dist/components/BitkitCalendar/components/CalendarFooter.d.ts +2 -2
- package/dist/components/BitkitCalendar/components/CalendarFooter.js +13 -12
- package/dist/components/BitkitCalendar/components/CalendarSelect.js +6 -6
- package/dist/components/BitkitLinkButton/BitkitLinkButton.d.ts +9 -0
- package/dist/components/BitkitLinkButton/BitkitLinkButton.js +14 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/main.js +566 -564
- package/dist/theme/recipes/LinkButton.recipe.d.ts +14 -0
- package/dist/theme/recipes/LinkButton.recipe.js +43 -0
- package/dist/theme/recipes/index.d.ts +13 -0
- package/dist/theme/recipes/index.js +12 -10
- package/dist/theme/slot-recipes/DatePicker.recipe.d.ts +1 -1
- package/dist/theme/slot-recipes/DatePicker.recipe.js +4 -5
- package/dist/theme/slot-recipes/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -45,8 +45,8 @@ export interface DatePickerTableCellTriggerProps extends HTMLChakraProps<'span',
|
|
|
45
45
|
export declare const DatePickerTableCellTrigger: import('react').ForwardRefExoticComponent<DatePickerTableCellTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
46
46
|
export declare const DatePickerContext: (props: ArkDatePicker.ContextProps) => import('react').ReactNode;
|
|
47
47
|
export interface DatePickerProps extends DatePickerRootProps {
|
|
48
|
+
device: 'desktop' | 'mobile';
|
|
48
49
|
showOutsideDays?: boolean;
|
|
49
|
-
variant: 'desktop' | 'mobile';
|
|
50
50
|
}
|
|
51
51
|
export declare const DatePicker: {
|
|
52
52
|
Root: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -2,15 +2,15 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface BitkitCalendarProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
defaultValue?: Date | Date[] | null;
|
|
5
|
+
device?: 'desktop' | 'mobile';
|
|
5
6
|
layout?: '1-month' | '2-month';
|
|
6
7
|
max?: Date;
|
|
7
8
|
min?: Date;
|
|
8
|
-
mode?: 'day' | 'range';
|
|
9
9
|
onValueChange?: (value: Date[] | null) => void;
|
|
10
|
+
selectionMode?: 'day' | 'range';
|
|
10
11
|
showOutsideDays?: boolean;
|
|
11
12
|
showSelectedDate?: boolean;
|
|
12
13
|
value?: Date[] | null;
|
|
13
|
-
variant?: 'desktop' | 'mobile';
|
|
14
14
|
}
|
|
15
15
|
declare const BitkitCalendar: import('react').ForwardRefExoticComponent<BitkitCalendarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
16
|
export default BitkitCalendar;
|
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Box as
|
|
2
|
+
import { Box as p } from "@chakra-ui/react/box";
|
|
3
3
|
import { Portal as S } from "@chakra-ui/react/portal";
|
|
4
|
-
import { forwardRef as j, useMemo as
|
|
4
|
+
import { forwardRef as j, useMemo as v, useRef as N, useEffect as A } from "react";
|
|
5
5
|
import { DatePicker as a } from "../../atoms/DatePicker/DatePicker.js";
|
|
6
6
|
import { dateToCalendarDate as d, calendarDateToDate as E } from "./Calendar.utils.js";
|
|
7
7
|
import F from "./components/CalendarFooter.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import D from "./components/CalendarMonth.js";
|
|
9
|
+
import w from "./components/CalendarMonthSelect.js";
|
|
10
|
+
import V from "./components/CalendarNextTrigger.js";
|
|
11
11
|
import W from "./components/CalendarPrevTrigger.js";
|
|
12
12
|
import Y from "./components/CalendarTrigger.js";
|
|
13
|
-
import
|
|
13
|
+
import k from "./components/CalendarYearSelect.js";
|
|
14
14
|
import { useDatePickerContext as b } from "@ark-ui/react/date-picker";
|
|
15
15
|
const q = ({
|
|
16
16
|
layout: n,
|
|
17
17
|
max: i,
|
|
18
18
|
min: o,
|
|
19
|
-
|
|
20
|
-
showSelectedDate:
|
|
19
|
+
selectionMode: t,
|
|
20
|
+
showSelectedDate: m
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
22
|
+
const l = b(), s = N(t);
|
|
23
23
|
return A(() => {
|
|
24
|
-
|
|
24
|
+
s.current !== t && (l.clearValue(), s.current = t);
|
|
25
25
|
}, [t]), /* @__PURE__ */ r(a.Content, { children: [
|
|
26
26
|
/* @__PURE__ */ r(a.View, { view: "day", children: [
|
|
27
27
|
/* @__PURE__ */ r(a.ViewControl, { children: [
|
|
28
|
-
/* @__PURE__ */ r(
|
|
28
|
+
/* @__PURE__ */ r(p, { display: "flex", alignItems: "center", gap: "12", children: [
|
|
29
29
|
/* @__PURE__ */ e(W, {}),
|
|
30
|
-
/* @__PURE__ */ r(
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
-
/* @__PURE__ */ e(
|
|
30
|
+
/* @__PURE__ */ r(p, { display: "flex", alignItems: "center", children: [
|
|
31
|
+
/* @__PURE__ */ e(w, { offset: 0, layout: n, max: i, min: o }),
|
|
32
|
+
/* @__PURE__ */ e(k, { monthOffset: 0, max: i, min: o })
|
|
33
33
|
] }),
|
|
34
|
-
n === "1-month" && /* @__PURE__ */ e(
|
|
34
|
+
n === "1-month" && /* @__PURE__ */ e(V, {})
|
|
35
35
|
] }),
|
|
36
|
-
n === "2-month" && /* @__PURE__ */ r(
|
|
37
|
-
/* @__PURE__ */ e(
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */ e(
|
|
36
|
+
n === "2-month" && /* @__PURE__ */ r(p, { display: "flex", alignItems: "center", gap: "12", children: [
|
|
37
|
+
/* @__PURE__ */ e(w, { offset: 1, layout: n, max: i, min: o }),
|
|
38
|
+
/* @__PURE__ */ e(k, { monthOffset: 1, max: i, min: o }),
|
|
39
|
+
/* @__PURE__ */ e(V, {})
|
|
40
40
|
] })
|
|
41
41
|
] }),
|
|
42
42
|
/* @__PURE__ */ r(a.Months, { children: [
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
n === "2-month" && /* @__PURE__ */ e(
|
|
43
|
+
/* @__PURE__ */ e(D, { monthsIndex: 0 }),
|
|
44
|
+
n === "2-month" && /* @__PURE__ */ e(D, { monthsIndex: 1 })
|
|
45
45
|
] })
|
|
46
46
|
] }),
|
|
47
|
-
/* @__PURE__ */ e(F, {
|
|
47
|
+
/* @__PURE__ */ e(F, { selectionMode: t, showSelectedDate: m })
|
|
48
48
|
] });
|
|
49
49
|
}, z = j((n, i) => {
|
|
50
50
|
const {
|
|
51
51
|
children: o,
|
|
52
52
|
defaultValue: t,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
device: m = "desktop",
|
|
54
|
+
layout: l,
|
|
55
|
+
selectionMode: s = "range",
|
|
56
|
+
min: f,
|
|
56
57
|
max: c,
|
|
57
|
-
onValueChange:
|
|
58
|
-
showOutsideDays:
|
|
59
|
-
showSelectedDate:
|
|
60
|
-
value:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} = n, u = x(() => l ? d(l) : void 0, [l]), C = x(() => c ? d(c) : void 0, [c]), I = M?.map(d), f = !o, g = /* @__PURE__ */ e(
|
|
58
|
+
onValueChange: u,
|
|
59
|
+
showOutsideDays: y = !1,
|
|
60
|
+
showSelectedDate: O = !1,
|
|
61
|
+
value: P,
|
|
62
|
+
...I
|
|
63
|
+
} = n, C = v(() => f ? d(f) : void 0, [f]), g = v(() => c ? d(c) : void 0, [c]), T = P?.map(d), h = !o, x = /* @__PURE__ */ e(
|
|
64
64
|
q,
|
|
65
65
|
{
|
|
66
|
-
layout:
|
|
67
|
-
max:
|
|
68
|
-
min:
|
|
69
|
-
|
|
70
|
-
showSelectedDate:
|
|
66
|
+
layout: l,
|
|
67
|
+
max: g,
|
|
68
|
+
min: C,
|
|
69
|
+
selectionMode: s,
|
|
70
|
+
showSelectedDate: O
|
|
71
71
|
}
|
|
72
|
-
),
|
|
72
|
+
), B = y ?? l === "1-month";
|
|
73
73
|
return /* @__PURE__ */ r(
|
|
74
74
|
a.Root,
|
|
75
75
|
{
|
|
76
76
|
defaultValue: t instanceof Array ? t.map(d) : t ? [d(t)] : void 0,
|
|
77
|
-
|
|
77
|
+
device: m,
|
|
78
|
+
numOfMonths: l === "2-month" ? 2 : 1,
|
|
78
79
|
ref: i,
|
|
79
|
-
inline:
|
|
80
|
-
min:
|
|
81
|
-
max:
|
|
82
|
-
onValueChange:
|
|
83
|
-
const R =
|
|
84
|
-
|
|
80
|
+
inline: h,
|
|
81
|
+
min: C,
|
|
82
|
+
max: g,
|
|
83
|
+
onValueChange: u ? (M) => {
|
|
84
|
+
const R = M.value?.map(E) || null;
|
|
85
|
+
u(R);
|
|
85
86
|
} : void 0,
|
|
86
|
-
selectionMode:
|
|
87
|
-
showOutsideDays:
|
|
87
|
+
selectionMode: s === "day" ? "single" : "range",
|
|
88
|
+
showOutsideDays: B,
|
|
88
89
|
startOfWeek: 1,
|
|
89
|
-
value:
|
|
90
|
-
|
|
91
|
-
...P,
|
|
90
|
+
value: T,
|
|
91
|
+
...I,
|
|
92
92
|
children: [
|
|
93
|
-
!
|
|
94
|
-
|
|
93
|
+
!h && /* @__PURE__ */ e(a.Control, { children: /* @__PURE__ */ e(Y, { children: o }) }),
|
|
94
|
+
h ? x : /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(a.Positioner, { children: x }) })
|
|
95
95
|
]
|
|
96
96
|
}
|
|
97
97
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type CalendarFooterProps = {
|
|
2
|
-
|
|
2
|
+
selectionMode?: 'day' | 'range';
|
|
3
3
|
showSelectedDate?: boolean;
|
|
4
4
|
};
|
|
5
|
-
declare const CalendarFooter: ({
|
|
5
|
+
declare const CalendarFooter: ({ selectionMode, showSelectedDate }: CalendarFooterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
export default CalendarFooter;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Box as u } from "@chakra-ui/react/box";
|
|
3
3
|
import { Button as y } from "@chakra-ui/react/button";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { CalendarDate as
|
|
4
|
+
import { Text as g } from "@chakra-ui/react/text";
|
|
5
|
+
import { CalendarDate as p } from "@internationalized/date";
|
|
6
6
|
import { calendarDateToDate as a } from "../Calendar.utils.js";
|
|
7
7
|
import { useDatePickerContext as D } from "@ark-ui/react/date-picker";
|
|
8
|
-
const
|
|
9
|
-
const { setOpen:
|
|
10
|
-
const t = /* @__PURE__ */ new Date(), r = new
|
|
11
|
-
|
|
8
|
+
const j = ({ selectionMode: n, showSelectedDate: i }) => {
|
|
9
|
+
const { setOpen: l, setValue: s, value: e } = D(), c = () => {
|
|
10
|
+
const t = /* @__PURE__ */ new Date(), r = new p(t.getFullYear(), t.getMonth() + 1, t.getDate());
|
|
11
|
+
s([r]), l(!1);
|
|
12
12
|
};
|
|
13
13
|
if (n === "day")
|
|
14
|
-
return /* @__PURE__ */ o(u, { display: "flex", justifyContent: "center", marginTop: "16", children: /* @__PURE__ */ o(y, { variant: "tertiary", size: "sm", onClick:
|
|
15
|
-
if (e.length === 2 &&
|
|
14
|
+
return /* @__PURE__ */ o(u, { display: "flex", justifyContent: "center", marginTop: "16", children: /* @__PURE__ */ o(y, { variant: "tertiary", size: "sm", onClick: c, children: "Today" }) });
|
|
15
|
+
if (e.length === 2 && i) {
|
|
16
16
|
const t = (f) => f.toLocaleDateString("en-US", {
|
|
17
|
+
weekday: "short",
|
|
17
18
|
month: "short",
|
|
18
|
-
day: "
|
|
19
|
+
day: "2-digit",
|
|
19
20
|
year: "numeric"
|
|
20
|
-
}), r = a(e[0]),
|
|
21
|
-
return /* @__PURE__ */ o(
|
|
21
|
+
}), r = a(e[0]), d = a(e[1]), m = `${t(r)} – ${t(d)}`;
|
|
22
|
+
return /* @__PURE__ */ o(g, { textAlign: "center", color: "text/secondary", marginTop: "24", textStyle: "body/lg/regular", children: m });
|
|
22
23
|
}
|
|
23
24
|
return null;
|
|
24
25
|
};
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
j as default
|
|
27
28
|
};
|
|
@@ -6,25 +6,25 @@ import { useSlotRecipe as f } from "@chakra-ui/react/styled-system";
|
|
|
6
6
|
import g from "../../../utilities/AssetSelectChevron.js";
|
|
7
7
|
import S from "../../BitkitSelectMenu/BitkitSelectMenu.js";
|
|
8
8
|
const C = (c) => {
|
|
9
|
-
const { contentProps: l, controlProps: n, defaultValue: s, items:
|
|
10
|
-
items:
|
|
11
|
-
groupBy: (
|
|
9
|
+
const { contentProps: l, controlProps: n, defaultValue: s, items: d, onValueChange: a, value: m } = c, o = u({
|
|
10
|
+
items: d,
|
|
11
|
+
groupBy: (p) => p.group || ""
|
|
12
12
|
}), t = f({ key: "datePickerSelect" })();
|
|
13
13
|
return /* @__PURE__ */ i(
|
|
14
14
|
r.Root,
|
|
15
15
|
{
|
|
16
16
|
collection: o,
|
|
17
17
|
defaultValue: s,
|
|
18
|
-
onValueChange:
|
|
18
|
+
onValueChange: a,
|
|
19
19
|
size: "md",
|
|
20
|
-
value:
|
|
20
|
+
value: m,
|
|
21
21
|
children: [
|
|
22
22
|
/* @__PURE__ */ e(r.HiddenSelect, {}),
|
|
23
23
|
/* @__PURE__ */ i(r.Control, { ...n, children: [
|
|
24
24
|
/* @__PURE__ */ e(r.Trigger, { css: t.trigger, children: /* @__PURE__ */ e(r.ValueText, {}) }),
|
|
25
25
|
/* @__PURE__ */ e(r.IndicatorGroup, { css: t.indicatorGroup, children: /* @__PURE__ */ e(r.Indicator, { asChild: !0, css: t.indicator, children: /* @__PURE__ */ e(g, { width: "20", height: "20" }) }) })
|
|
26
26
|
] }),
|
|
27
|
-
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(r.Positioner, { children: /* @__PURE__ */ e(S, { collection: o, contentProps: l }) }) })
|
|
27
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(r.Positioner, { children: /* @__PURE__ */ e(S, { collection: o, contentProps: l, size: "md" }) }) })
|
|
28
28
|
]
|
|
29
29
|
}
|
|
30
30
|
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTMLChakraProps, RecipeProps } from '@chakra-ui/react/styled-system';
|
|
2
|
+
import { BitkitIconComponent } from '../../icons';
|
|
3
|
+
export interface BitkitLinkButtonProps extends Omit<HTMLChakraProps<'button'>, 'css' | 'disabled' | 'type'>, RecipeProps<'linkButton'> {
|
|
4
|
+
children: string;
|
|
5
|
+
state?: 'disabled';
|
|
6
|
+
suffixIcon?: BitkitIconComponent;
|
|
7
|
+
}
|
|
8
|
+
declare const BitkitLinkButton: import('react').ForwardRefExoticComponent<BitkitLinkButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default BitkitLinkButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as f, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useRecipe as d, chakra as l } from "@chakra-ui/react/styled-system";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
const k = p((e, o) => {
|
|
5
|
+
const { children: s, size: t, state: n, suffixIcon: i, ...r } = e, c = d({ key: "linkButton" }), a = t === "lg" ? "24" : "16";
|
|
6
|
+
return /* @__PURE__ */ f(l.button, { ref: o, ...r, css: c({ size: t }), disabled: n === "disabled", type: "button", children: [
|
|
7
|
+
s,
|
|
8
|
+
i && /* @__PURE__ */ u(i, { size: a })
|
|
9
|
+
] });
|
|
10
|
+
});
|
|
11
|
+
k.displayName = "BitkitLinkButton";
|
|
12
|
+
export {
|
|
13
|
+
k as default
|
|
14
|
+
};
|
|
@@ -23,6 +23,7 @@ export { default as BitkitField, type BitkitFieldProps } from './BitkitField/Bit
|
|
|
23
23
|
export { default as BitkitIconButton, type BitkitIconButtonProps } from './BitkitIconButton/BitkitIconButton';
|
|
24
24
|
export { default as BitkitInteractiveTooltip, type BitkitInteractiveTooltipProps, } from './BitkitInteractiveTooltip/BitkitInteractiveTooltip';
|
|
25
25
|
export { default as BitkitLink, type BitkitLinkProps } from './BitkitLink/BitkitLink';
|
|
26
|
+
export { default as BitkitLinkButton, type BitkitLinkButtonProps } from './BitkitLinkButton/BitkitLinkButton';
|
|
26
27
|
export { default as BitkitNativeSelect, type BitkitNativeSelectProps } from './BitkitNativeSelect/BitkitNativeSelect';
|
|
27
28
|
export { default as BitkitNumberInput, type BitkitNumberInputProps } from './BitkitNumberInput/BitkitNumberInput';
|
|
28
29
|
export { default as BitkitRadio, type BitkitRadioProps } from './BitkitRadio/BitkitRadio';
|