@bitrise/bitkit-v2 0.3.154 → 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.
@@ -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 h } from "@chakra-ui/react/box";
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 x, useRef as N, useEffect as A } from "react";
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 v from "./components/CalendarMonth.js";
9
- import D from "./components/CalendarMonthSelect.js";
10
- import w from "./components/CalendarNextTrigger.js";
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 V from "./components/CalendarYearSelect.js";
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
- mode: t,
20
- showSelectedDate: s
19
+ selectionMode: t,
20
+ showSelectedDate: m
21
21
  }) => {
22
- const m = b(), l = N(t);
22
+ const l = b(), s = N(t);
23
23
  return A(() => {
24
- l.current !== t && (m.clearValue(), l.current = t);
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(h, { display: "flex", alignItems: "center", gap: "12", children: [
28
+ /* @__PURE__ */ r(p, { display: "flex", alignItems: "center", gap: "12", children: [
29
29
  /* @__PURE__ */ e(W, {}),
30
- /* @__PURE__ */ r(h, { display: "flex", alignItems: "center", children: [
31
- /* @__PURE__ */ e(D, { offset: 0, layout: n, max: i, min: o }),
32
- /* @__PURE__ */ e(V, { monthOffset: 0, max: i, min: o })
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(w, {})
34
+ n === "1-month" && /* @__PURE__ */ e(V, {})
35
35
  ] }),
36
- n === "2-month" && /* @__PURE__ */ r(h, { display: "flex", alignItems: "center", gap: "12", children: [
37
- /* @__PURE__ */ e(D, { offset: 1, layout: n, max: i, min: o }),
38
- /* @__PURE__ */ e(V, { monthOffset: 1, max: i, min: o }),
39
- /* @__PURE__ */ e(w, {})
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(v, { monthsIndex: 0 }),
44
- n === "2-month" && /* @__PURE__ */ e(v, { monthsIndex: 1 })
43
+ /* @__PURE__ */ e(D, { monthsIndex: 0 }),
44
+ n === "2-month" && /* @__PURE__ */ e(D, { monthsIndex: 1 })
45
45
  ] })
46
46
  ] }),
47
- /* @__PURE__ */ e(F, { mode: t, showSelectedDate: s })
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
- layout: s,
54
- mode: m = "range",
55
- min: l,
53
+ device: m = "desktop",
54
+ layout: l,
55
+ selectionMode: s = "range",
56
+ min: f,
56
57
  max: c,
57
- onValueChange: p,
58
- showOutsideDays: k = !1,
59
- showSelectedDate: y = !1,
60
- value: M,
61
- variant: O = "desktop",
62
- ...P
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: s,
67
- max: C,
68
- min: u,
69
- mode: m,
70
- showSelectedDate: y
66
+ layout: l,
67
+ max: g,
68
+ min: C,
69
+ selectionMode: s,
70
+ showSelectedDate: O
71
71
  }
72
- ), T = k ?? s === "1-month";
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
- numOfMonths: s === "2-month" ? 2 : 1,
77
+ device: m,
78
+ numOfMonths: l === "2-month" ? 2 : 1,
78
79
  ref: i,
79
- inline: f,
80
- min: u,
81
- max: C,
82
- onValueChange: p ? (B) => {
83
- const R = B.value?.map(E) || null;
84
- p(R);
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: m === "day" ? "single" : "range",
87
- showOutsideDays: T,
87
+ selectionMode: s === "day" ? "single" : "range",
88
+ showOutsideDays: B,
88
89
  startOfWeek: 1,
89
- value: I,
90
- variant: O,
91
- ...P,
90
+ value: T,
91
+ ...I,
92
92
  children: [
93
- !f && /* @__PURE__ */ e(a.Control, { children: /* @__PURE__ */ e(Y, { children: o }) }),
94
- f ? g : /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(a.Positioner, { children: g }) })
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
- mode?: 'day' | 'range';
2
+ selectionMode?: 'day' | 'range';
3
3
  showSelectedDate?: boolean;
4
4
  };
5
- declare const CalendarFooter: ({ mode, showSelectedDate }: CalendarFooterProps) => import("react/jsx-runtime").JSX.Element | null;
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 p } from "@chakra-ui/react/text";
5
- import { CalendarDate as g } from "@internationalized/date";
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 v = ({ mode: n, showSelectedDate: l }) => {
9
- const { setOpen: i, setValue: c, value: e } = D(), m = () => {
10
- const t = /* @__PURE__ */ new Date(), r = new g(t.getFullYear(), t.getMonth() + 1, t.getDate());
11
- c([r]), i(!1);
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: m, children: "Today" }) });
15
- if (e.length === 2 && l) {
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: "numeric",
19
+ day: "2-digit",
19
20
  year: "numeric"
20
- }), r = a(e[0]), s = a(e[1]), d = `${t(r)} – ${t(s)}`;
21
- return /* @__PURE__ */ o(p, { textAlign: "center", color: "text/secondary", marginTop: "24", textStyle: "body/lg/regular", children: d });
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
- v as default
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: a, onValueChange: d, value: p } = c, o = u({
10
- items: a,
11
- groupBy: (m) => m.group || ""
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: d,
18
+ onValueChange: a,
19
19
  size: "md",
20
- value: p,
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
  );
@@ -27,7 +27,7 @@ declare const datePickerSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinit
27
27
  };
28
28
  };
29
29
  };
30
- variant: {
30
+ device: {
31
31
  mobile: {
32
32
  content: {
33
33
  boxShadow: "none";
@@ -84,6 +84,7 @@ const i = a({
84
84
  borderRadius: 0,
85
85
  backgroundColor: "interactive/disabled",
86
86
  color: "text/disabled",
87
+ cursor: "default",
87
88
  "&:hover, &[data-outside-range]:hover": {
88
89
  borderRadius: 0,
89
90
  backgroundColor: "interactive/disabled",
@@ -91,16 +92,14 @@ const i = a({
91
92
  }
92
93
  },
93
94
  "&[data-outside-range]": {
94
- color: "text/tertiary",
95
- cursor: "not-allowed"
95
+ color: "text/tertiary"
96
96
  },
97
97
  "&[data-outside-range][data-unavailable]": {
98
98
  color: "text/disabled"
99
99
  },
100
100
  "&[data-outside-range][data-in-range], &[data-outside-range][data-in-range]:hover": {
101
101
  backgroundColor: "interactive/moderate",
102
- color: "interactive/bold",
103
- cursor: "not-allowed"
102
+ color: "interactive/bold"
104
103
  },
105
104
  "&[data-outside-range][data-range-end]": {
106
105
  backgroundColor: "interactive/highlight",
@@ -229,7 +228,7 @@ const i = a({
229
228
  }
230
229
  }
231
230
  },
232
- variant: {
231
+ device: {
233
232
  mobile: {
234
233
  content: {
235
234
  boxShadow: "none",
@@ -352,7 +352,7 @@ declare const slotRecipes: {
352
352
  };
353
353
  };
354
354
  };
355
- variant: {
355
+ device: {
356
356
  mobile: {
357
357
  content: {
358
358
  boxShadow: "none";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit-v2",
3
3
  "private": false,
4
- "version": "0.3.154",
4
+ "version": "0.3.155",
5
5
  "description": "Bitrise Design System Components built with Chakra UI V3",
6
6
  "keywords": [
7
7
  "react",