@forgedevstack/bear 1.0.2 → 1.0.3

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.
Files changed (94) hide show
  1. package/dist/components/ActiveBar/ActiveBar.cjs +8 -0
  2. package/dist/components/ActiveBar/ActiveBar.d.ts +2 -0
  3. package/dist/components/ActiveBar/ActiveBar.js +90 -0
  4. package/dist/components/ActiveBar/ActiveBar.types.d.ts +16 -0
  5. package/dist/components/ActiveBar/index.d.ts +2 -0
  6. package/dist/components/Box/Box.cjs +1 -0
  7. package/dist/components/Box/Box.d.ts +2 -0
  8. package/dist/components/Box/Box.js +64 -0
  9. package/dist/components/Box/Box.types.d.ts +24 -0
  10. package/dist/components/Box/Box.utils.cjs +1 -0
  11. package/dist/components/Box/Box.utils.d.ts +3 -0
  12. package/dist/components/Box/Box.utils.js +21 -0
  13. package/dist/components/Box/index.d.ts +2 -0
  14. package/dist/components/Calendar/Calendar.cjs +1 -1
  15. package/dist/components/Calendar/Calendar.const.cjs +1 -0
  16. package/dist/components/Calendar/Calendar.const.d.ts +18 -0
  17. package/dist/components/Calendar/Calendar.const.js +27 -0
  18. package/dist/components/Calendar/Calendar.js +131 -145
  19. package/dist/components/Calendar/Calendar.types.d.ts +4 -0
  20. package/dist/components/Calendar/Calendar.utils.cjs +1 -0
  21. package/dist/components/Calendar/Calendar.utils.d.ts +41 -0
  22. package/dist/components/Calendar/Calendar.utils.js +33 -0
  23. package/dist/components/Calendar/index.d.ts +2 -0
  24. package/dist/components/CodeBlock/CodeBlock.cjs +2 -0
  25. package/dist/components/CodeBlock/CodeBlock.d.ts +2 -0
  26. package/dist/components/CodeBlock/CodeBlock.js +55 -0
  27. package/dist/components/CodeBlock/CodeBlock.types.d.ts +10 -0
  28. package/dist/components/CodeBlock/index.d.ts +2 -0
  29. package/dist/components/Columns/Columns.cjs +1 -0
  30. package/dist/components/Columns/Columns.d.ts +5 -0
  31. package/dist/components/Columns/Columns.js +54 -0
  32. package/dist/components/Columns/Columns.types.d.ts +17 -0
  33. package/dist/components/Columns/index.d.ts +2 -0
  34. package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
  35. package/dist/components/DateTimePicker/DateTimePicker.js +28 -28
  36. package/dist/components/Editable/Editable.cjs +1 -0
  37. package/dist/components/Editable/Editable.d.ts +10 -0
  38. package/dist/components/Editable/Editable.js +194 -0
  39. package/dist/components/Editable/Editable.types.d.ts +39 -0
  40. package/dist/components/Editable/index.d.ts +2 -0
  41. package/dist/components/Em/Em.cjs +1 -0
  42. package/dist/components/Em/Em.d.ts +2 -0
  43. package/dist/components/Em/Em.js +24 -0
  44. package/dist/components/Em/Em.types.d.ts +5 -0
  45. package/dist/components/Em/index.d.ts +2 -0
  46. package/dist/components/Fab/Fab.cjs +1 -1
  47. package/dist/components/Fab/Fab.js +9 -9
  48. package/dist/components/Highlight/Highlight.cjs +1 -0
  49. package/dist/components/Highlight/Highlight.d.ts +2 -0
  50. package/dist/components/Highlight/Highlight.js +28 -0
  51. package/dist/components/Highlight/Highlight.types.d.ts +6 -0
  52. package/dist/components/Highlight/index.d.ts +2 -0
  53. package/dist/components/HoverCard/HoverCard.cjs +6 -0
  54. package/dist/components/HoverCard/HoverCard.d.ts +2 -0
  55. package/dist/components/HoverCard/HoverCard.js +68 -0
  56. package/dist/components/HoverCard/HoverCard.types.d.ts +13 -0
  57. package/dist/components/HoverCard/HoverCard.utils.cjs +1 -0
  58. package/dist/components/HoverCard/HoverCard.utils.d.ts +2 -0
  59. package/dist/components/HoverCard/HoverCard.utils.js +23 -0
  60. package/dist/components/HoverCard/index.d.ts +2 -0
  61. package/dist/components/Icon/icons/status.js +1 -1
  62. package/dist/components/Icon/index.cjs +1 -1
  63. package/dist/components/Icon/index.d.ts +5 -0
  64. package/dist/components/Icon/index.js +28 -21
  65. package/dist/components/Mark/Mark.cjs +1 -0
  66. package/dist/components/Mark/Mark.d.ts +2 -0
  67. package/dist/components/Mark/Mark.js +26 -0
  68. package/dist/components/Mark/Mark.types.d.ts +5 -0
  69. package/dist/components/Mark/index.d.ts +2 -0
  70. package/dist/components/RichEditor/RichEditor.cjs +10 -0
  71. package/dist/components/RichEditor/RichEditor.d.ts +4 -0
  72. package/dist/components/RichEditor/RichEditor.icons.cjs +1 -0
  73. package/dist/components/RichEditor/RichEditor.icons.d.ts +16 -0
  74. package/dist/components/RichEditor/RichEditor.icons.js +62 -0
  75. package/dist/components/RichEditor/RichEditor.js +151 -0
  76. package/dist/components/RichEditor/RichEditor.types.d.ts +20 -0
  77. package/dist/components/RichEditor/RichEditor.utils.cjs +1 -0
  78. package/dist/components/RichEditor/RichEditor.utils.d.ts +3 -0
  79. package/dist/components/RichEditor/RichEditor.utils.js +22 -0
  80. package/dist/components/RichEditor/index.d.ts +2 -0
  81. package/dist/components/Sidebar/Sidebar.cjs +1 -0
  82. package/dist/components/Sidebar/Sidebar.d.ts +5 -0
  83. package/dist/components/Sidebar/Sidebar.js +158 -0
  84. package/dist/components/Sidebar/Sidebar.types.d.ts +40 -0
  85. package/dist/components/Sidebar/index.d.ts +2 -0
  86. package/dist/components/Slider/Slider.cjs +1 -1
  87. package/dist/components/Slider/Slider.js +8 -8
  88. package/dist/components/index.cjs +1 -1
  89. package/dist/components/index.d.ts +22 -0
  90. package/dist/components/index.js +87 -63
  91. package/dist/index.cjs +1 -1
  92. package/dist/index.js +107 -83
  93. package/dist/styles.css +1 -1
  94. package/package.json +2 -2
@@ -1,203 +1,189 @@
1
- import { jsxs as m, Fragment as ue, jsx as c } from "react/jsx-runtime";
2
- import { useMemo as w, useCallback as N } from "react";
3
- import { cn as E } from "../../utils/cn.js";
4
- import { useBearStyles as me } from "../../hooks/useBearStyles.js";
5
- const he = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"], xe = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], q = (n, a) => new Date(n, a + 1, 0).getDate(), ve = (n, a) => new Date(n, a, 1).getDay(), P = (n, a) => !n || !a ? !1 : n.getDate() === a.getDate() && n.getMonth() === a.getMonth() && n.getFullYear() === a.getFullYear();
6
- function pe(n, a, f) {
7
- let l = (ve(n, a) - f + 7) % 7;
8
- const v = q(n, a), y = a === 0 ? 11 : a - 1, g = a === 0 ? n - 1 : n, p = q(g, y), i = [], H = 42;
9
- for (let e = 0; e < H; e++)
10
- if (e < l) {
11
- const h = p - l + e + 1;
12
- i.push({ date: new Date(g, y, h), isCurrentMonth: !1 });
13
- } else if (e < l + v) {
14
- const h = e - l + 1;
15
- i.push({ date: new Date(n, a, h), isCurrentMonth: !0 });
16
- } else {
17
- const h = e - l - v + 1, x = a === 11 ? 0 : a + 1, Y = a === 11 ? n + 1 : n;
18
- i.push({ date: new Date(Y, x, h), isCurrentMonth: !1 });
19
- }
20
- return i;
21
- }
22
- const ke = ({
23
- viewDate: n,
24
- value: a = null,
25
- onSelect: f,
26
- onViewChange: b,
27
- minDate: l,
28
- maxDate: v,
29
- disabledDates: y = [],
30
- highlightedDates: g = [],
31
- weekdayLabels: p = he,
32
- firstDayOfWeek: i = 0,
33
- showWeekNumbers: H = !1,
1
+ import { jsxs as l, Fragment as ue, jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as L, useCallback as u } from "react";
3
+ import { cn as O } from "../../utils/cn.js";
4
+ import { useBearStyles as be } from "../../hooks/useBearStyles.js";
5
+ import { ChevronsLeftIcon as me, ChevronLeftIcon as he, ChevronRightIcon as ke, ChevronsRightIcon as xe } from "../Icon/index.js";
6
+ import { NUMBER as a, DEFAULT_WEEKDAYS as ve, MONTHS as pe, WEEKEND_LABELS as ze } from "./Calendar.const.js";
7
+ import { isSameDay as N, buildCalendarGrid as Ne, reorderWeekdays as ye, isWeekendDay as fe } from "./Calendar.utils.js";
8
+ const ge = ({ month: k, year: x }) => /* @__PURE__ */ l("span", { className: "font-semibold text-sm select-none", children: [
9
+ k,
10
+ " ",
11
+ x
12
+ ] }), Ce = ({
13
+ viewDate: k,
14
+ value: x = null,
15
+ onSelect: y,
16
+ onViewChange: c,
17
+ minDate: f,
18
+ maxDate: g,
19
+ disabledDates: D = [],
20
+ highlightedDates: C = [],
21
+ weekdayLabels: W = ve,
22
+ firstDayOfWeek: v = a.ZERO,
23
+ showWeekNumbers: Ee = !1,
34
24
  slots: e = {},
35
- clearable: h = !0,
36
- onClear: x,
37
- showTodayButton: Y = !0,
38
- onToday: z,
39
- bis: O,
40
- style: Q,
41
- inline: X = !1,
42
- className: Z
25
+ clearable: w = !0,
26
+ onClear: b,
27
+ showTodayButton: K = !0,
28
+ onToday: m,
29
+ bis: U,
30
+ style: Z,
31
+ inline: q = !1,
32
+ className: J
43
33
  }) => {
44
- const s = n.getFullYear(), U = me(O, Q), d = n.getMonth(), $ = w(() => /* @__PURE__ */ new Date(), []), S = N(() => {
45
- b == null || b(new Date(s - 1, d, 1));
46
- }, [s, d, b]), I = N(() => {
47
- b == null || b(new Date(s, d - 1, 1));
48
- }, [s, d, b]), G = N(() => {
49
- b == null || b(new Date(s, d + 1, 1));
50
- }, [s, d, b]), F = N(() => {
51
- b == null || b(new Date(s + 1, d, 1));
52
- }, [s, d, b]), j = I, B = G, V = {
53
- onPrevYear: S,
54
- onPrevMonth: I,
55
- onNextMonth: G,
56
- onNextYear: F
57
- }, ee = N(
58
- (t) => l && t < l || v && t > v ? !0 : y.some((r) => P(r, t)),
59
- [l, v, y]
60
- ), re = N(
61
- (t) => g.some((r) => P(r, t)),
62
- [g]
63
- ), te = w(
64
- () => pe(s, d, i),
65
- [s, d, i]
66
- ), J = w(
67
- () => i > 0 ? [...p.slice(i), ...p.slice(0, i)] : p,
68
- [p, i]
69
- ), T = xe[d], A = a != null, ae = X ? "bear-block bear-w-full bear-bg-white bear-rounded-xl bear-shadow-none bear-border bear-border-zinc-200 bear-p-4 bear-text-zinc-900" : "bear-absolute bear-z-50 bear-mt-2 bear-bg-white bear-rounded-xl bear-shadow-xl bear-border bear-border-zinc-200 bear-p-4 bear-w-80 bear-text-zinc-900", ne = () => {
34
+ const i = k.getFullYear(), H = be(U, Z), d = k.getMonth(), Q = L(() => /* @__PURE__ */ new Date(), []), E = u(() => {
35
+ c == null || c(new Date(i - a.ONE, d, a.ONE));
36
+ }, [i, d, c]), R = u(() => {
37
+ c == null || c(new Date(i, d - a.ONE, a.ONE));
38
+ }, [i, d, c]), S = u(() => {
39
+ c == null || c(new Date(i, d + a.ONE, a.ONE));
40
+ }, [i, d, c]), P = u(() => {
41
+ c == null || c(new Date(i + a.ONE, d, a.ONE));
42
+ }, [i, d, c]), Y = R, B = S, X = {
43
+ onPrevYear: E,
44
+ onPrevMonth: R,
45
+ onNextMonth: S,
46
+ onNextYear: P
47
+ }, $ = u(
48
+ (r) => f && r < f || g && r > g ? !0 : D.some((t) => N(t, r)),
49
+ [f, g, D]
50
+ ), V = u(
51
+ (r) => C.some((t) => N(t, r)),
52
+ [C]
53
+ ), ee = L(
54
+ () => Ne(i, d, v),
55
+ [i, d, v]
56
+ ), F = L(
57
+ () => ye(W, v),
58
+ [W, v]
59
+ ), I = pe[d], M = x != null, te = q ? "block w-full bg-white dark:bg-gray-900 rounded-xl shadow-none border border-zinc-200 dark:border-zinc-700 p-4 text-zinc-900 dark:text-zinc-100" : "absolute z-50 mt-2 bg-white dark:bg-gray-900 rounded-xl shadow-xl border border-zinc-200 dark:border-zinc-700 p-4 w-80 text-zinc-900 dark:text-zinc-100", re = () => {
70
60
  if (e.header)
71
- return e.header({ month: T, year: s, onPrev: j, onNext: B, nav: V });
72
- const t = e.navPrevYear, r = e.navPrev, o = e.navNext, u = e.navNextYear, k = e.headerLabel;
73
- return /* @__PURE__ */ m("div", { className: "bear-flex bear-items-center bear-justify-between bear-gap-1 bear-mb-4", children: [
74
- /* @__PURE__ */ m("div", { className: "bear-flex bear-items-center bear-gap-0.5", children: [
75
- t ? t({ onClick: S }) : /* @__PURE__ */ c(
61
+ return e.header({ month: I, year: i, onPrev: Y, onNext: B, nav: X });
62
+ const r = e.navPrevYear, t = e.navPrev, o = e.navNext, s = e.navNextYear, p = e.headerLabel || ge;
63
+ return /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-1 mb-4", children: [
64
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
65
+ r ? r({ onClick: E }) : /* @__PURE__ */ n(
76
66
  "button",
77
67
  {
78
68
  type: "button",
79
- onClick: S,
80
- className: "bear-p-1.5 bear-rounded bear-text-zinc-500 hover:bear-bg-zinc-100 bear-dark:hover:bear-bg-zinc-800 bear-transition-colors bear-font-medium",
69
+ onClick: E,
70
+ className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
81
71
  "aria-label": "Previous year",
82
- children: "‹‹"
72
+ children: /* @__PURE__ */ n(me, { size: 16 })
83
73
  }
84
74
  ),
85
- r ? r({ onClick: j }) : /* @__PURE__ */ c(
75
+ t ? t({ onClick: Y }) : /* @__PURE__ */ n(
86
76
  "button",
87
77
  {
88
78
  type: "button",
89
- onClick: j,
90
- className: "bear-p-1.5 bear-rounded bear-text-zinc-500 hover:bear-bg-zinc-100 bear-dark:hover:bear-bg-zinc-800 bear-transition-colors",
79
+ onClick: Y,
80
+ className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
91
81
  "aria-label": "Previous month",
92
- children: "‹"
82
+ children: /* @__PURE__ */ n(he, { size: 16 })
93
83
  }
94
84
  )
95
85
  ] }),
96
- k ? k({ month: T, year: s }) : /* @__PURE__ */ m("span", { className: "bear-font-semibold bear-text-sm bear-select-none", children: [
97
- T,
98
- " ",
99
- s
100
- ] }),
101
- /* @__PURE__ */ m("div", { className: "bear-flex bear-items-center bear-gap-0.5", children: [
102
- o ? o({ onClick: B }) : /* @__PURE__ */ c(
86
+ p({ month: I, year: i }),
87
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
88
+ o ? o({ onClick: B }) : /* @__PURE__ */ n(
103
89
  "button",
104
90
  {
105
91
  type: "button",
106
92
  onClick: B,
107
- className: "bear-p-1.5 bear-rounded bear-text-zinc-500 hover:bear-bg-zinc-100 bear-dark:hover:bear-bg-zinc-800 bear-transition-colors",
93
+ className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
108
94
  "aria-label": "Next month",
109
- children: "›"
95
+ children: /* @__PURE__ */ n(ke, { size: 16 })
110
96
  }
111
97
  ),
112
- u ? u({ onClick: F }) : /* @__PURE__ */ c(
98
+ s ? s({ onClick: P }) : /* @__PURE__ */ n(
113
99
  "button",
114
100
  {
115
101
  type: "button",
116
- onClick: F,
117
- className: "bear-p-1.5 bear-rounded bear-text-zinc-500 hover:bear-bg-zinc-100 bear-dark:hover:bear-bg-zinc-800 bear-transition-colors bear-font-medium",
102
+ onClick: P,
103
+ className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
118
104
  "aria-label": "Next year",
119
- children: "››"
105
+ children: /* @__PURE__ */ n(xe, { size: 16 })
120
106
  }
121
107
  )
122
108
  ] })
123
109
  ] });
124
- }, be = () => {
125
- if (e.weekdays) return e.weekdays({ days: J });
126
- const t = e.weekday;
127
- return /* @__PURE__ */ c("div", { className: "bear-grid bear-grid-cols-7 bear-gap-1 bear-mb-2", children: J.map(
128
- (r) => t ? /* @__PURE__ */ c("div", { children: t({ label: r }) }, r) : /* @__PURE__ */ c(
110
+ }, ne = () => {
111
+ if (e.weekdays) return e.weekdays({ days: F });
112
+ const r = e.weekday;
113
+ return /* @__PURE__ */ n("div", { className: "grid grid-cols-7 gap-1 mb-2", children: F.map(
114
+ (t) => r ? /* @__PURE__ */ n("div", { children: r({ label: t }) }, t) : /* @__PURE__ */ n(
129
115
  "div",
130
116
  {
131
- className: E(
132
- "bear-text-center bear-text-xs bear-font-medium bear-uppercase",
133
- (r === "SUN" || r === "SAT" || r === "Sun" || r === "Sat") && "bear-text-red-500"
117
+ className: O(
118
+ "text-center text-xs font-medium uppercase",
119
+ ze.includes(t) && "text-red-500"
134
120
  ),
135
- children: r
121
+ children: t
136
122
  },
137
- r
123
+ t
138
124
  )
139
125
  ) });
140
- }, ce = (t, r) => {
141
- const { date: o, isCurrentMonth: u } = t, k = o.getDate(), K = o.getDay(), de = K === 0 || K === 6, M = P(a, o), C = P($, o), D = ee(o), L = re(o), R = () => {
142
- D || f == null || f(o);
126
+ }, ce = (r, t) => {
127
+ const { date: o, isCurrentMonth: s } = r, p = o.getDate(), ae = o.getDay(), se = fe(ae), h = N(x, o), j = N(Q, o), z = $(o), T = V(o), _ = () => {
128
+ z || y == null || y(o);
143
129
  }, le = {
144
130
  date: o,
145
- day: k,
146
- isCurrentMonth: u,
147
- isSelected: M,
148
- isToday: C,
149
- isDisabled: D,
150
- isHighlighted: L,
151
- onClick: R
131
+ day: p,
132
+ isCurrentMonth: s,
133
+ isSelected: h,
134
+ isToday: j,
135
+ isDisabled: z,
136
+ isHighlighted: T,
137
+ onClick: _
152
138
  };
153
- return e.day ? /* @__PURE__ */ c("span", { children: e.day(le) }, r) : /* @__PURE__ */ c(
139
+ return e.day ? /* @__PURE__ */ n("span", { children: e.day(le) }, t) : /* @__PURE__ */ n(
154
140
  "button",
155
141
  {
156
142
  type: "button",
157
- onClick: R,
158
- disabled: D,
159
- className: E(
160
- "bear-w-8 bear-h-8 bear-rounded-full bear-text-sm bear-font-medium bear-transition-colors bear-flex bear-items-center bear-justify-center",
161
- M && "bear-bg-bear-500 bear-text-white hover:bear-bg-bear-600",
162
- !M && C && "bear-ring-2 bear-ring-bear-500/50 bear-bg-transparent",
163
- !M && !C && (u ? de ? "bear-text-red-500 hover:bear-bg-zinc-100" : "bear-text-zinc-700 hover:bear-bg-zinc-100" : "bear-text-zinc-400 hover:bear-bg-zinc-50"),
164
- L && !M && "bear-bg-bear-500/15",
165
- D && "bear-opacity-40 bear-cursor-not-allowed"
143
+ onClick: _,
144
+ disabled: z,
145
+ className: O(
146
+ "w-8 h-8 rounded-full text-sm font-medium transition-colors flex items-center justify-center",
147
+ h && "bg-pink-500 text-white hover:bg-pink-600",
148
+ !h && j && "ring-2 ring-pink-500/50 bg-transparent",
149
+ !h && !j && (s ? se ? "text-red-500 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-800" : "text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800" : "text-zinc-400 dark:text-zinc-600 hover:bg-zinc-50 dark:hover:bg-zinc-800/50"),
150
+ T && !h && "bg-pink-500/15",
151
+ z && "opacity-40 cursor-not-allowed"
166
152
  ),
167
- children: k
153
+ children: p
168
154
  },
169
- r
155
+ t
170
156
  );
171
157
  }, oe = () => {
172
- const t = te.map((r, o) => ce(r, o));
173
- return e.daysGrid ? e.daysGrid({ children: t, className: "bear-grid bear-grid-cols-7 bear-gap-1" }) : /* @__PURE__ */ c("div", { className: "bear-grid bear-grid-cols-7 bear-gap-1", children: t });
174
- }, se = () => {
175
- const t = h && A && x, r = Y && z;
176
- if (!t && !r) return null;
158
+ const r = ee.map((t, o) => ce(t, o));
159
+ return e.daysGrid ? e.daysGrid({ children: r, className: "grid grid-cols-7 gap-1" }) : /* @__PURE__ */ n("div", { className: "grid grid-cols-7 gap-1", children: r });
160
+ }, ie = () => {
161
+ const r = w && M && b, t = K && m;
162
+ if (!r && !t) return null;
177
163
  if (e.footer) {
178
- const o = e.clearButton, u = e.todayButton;
164
+ const o = e.clearButton, s = e.todayButton;
179
165
  return e.footer({
180
- children: /* @__PURE__ */ m("div", { className: "bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200", children: [
181
- t && o ? o({ onClick: x, hasSelection: A }) : t ? /* @__PURE__ */ c("button", { type: "button", onClick: x, className: "bear-text-sm bear-text-zinc-500 hover:bear-text-zinc-700", children: "Clear" }) : /* @__PURE__ */ c("span", {}),
182
- r && u ? u({ onClick: z }) : r ? /* @__PURE__ */ c("button", { type: "button", onClick: z, className: "bear-text-sm bear-text-bear-600 hover:bear-text-bear-700 bear-font-medium", children: "Today" }) : null
166
+ children: /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
167
+ r && o ? o({ onClick: b, hasSelection: M }) : r ? /* @__PURE__ */ n("button", { type: "button", onClick: b, className: "text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200", children: "Clear" }) : /* @__PURE__ */ n("span", {}),
168
+ t && s ? s({ onClick: m }) : t ? /* @__PURE__ */ n("button", { type: "button", onClick: m, className: "text-sm text-pink-600 hover:text-pink-700 font-medium", children: "Today" }) : null
183
169
  ] })
184
170
  });
185
171
  }
186
- return e.clearButton && e.todayButton ? /* @__PURE__ */ m("div", { className: "bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200", children: [
187
- t && e.clearButton({ onClick: x, hasSelection: A }),
188
- r && e.todayButton({ onClick: z })
189
- ] }) : /* @__PURE__ */ m("div", { className: "bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200", children: [
190
- t ? /* @__PURE__ */ c("button", { type: "button", onClick: x, className: "bear-text-sm bear-text-zinc-500 hover:bear-text-zinc-700 bear-transition-colors", children: "Clear" }) : /* @__PURE__ */ c("span", {}),
191
- r ? /* @__PURE__ */ c("button", { type: "button", onClick: z, className: "bear-text-sm bear-text-bear-600 hover:bear-text-bear-700 bear-font-medium bear-transition-colors", children: "Today" }) : null
172
+ return e.clearButton && e.todayButton ? /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
173
+ r && e.clearButton({ onClick: b, hasSelection: M }),
174
+ t && e.todayButton({ onClick: m })
175
+ ] }) : /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
176
+ r ? /* @__PURE__ */ n("button", { type: "button", onClick: b, className: "text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors", children: "Clear" }) : /* @__PURE__ */ n("span", {}),
177
+ t ? /* @__PURE__ */ n("button", { type: "button", onClick: m, className: "text-sm text-pink-600 dark:text-pink-400 hover:text-pink-700 dark:hover:text-pink-300 font-medium transition-colors", children: "Today" }) : null
192
178
  ] });
193
- }, W = /* @__PURE__ */ m(ue, { children: [
179
+ }, A = /* @__PURE__ */ l(ue, { children: [
180
+ re(),
194
181
  ne(),
195
- be(),
196
182
  oe(),
197
- se()
198
- ] }), _ = E(ae, Z), ie = Object.keys(U).length ? U : void 0;
199
- return e.root ? e.root({ children: W, className: _ }) : /* @__PURE__ */ c("div", { className: _, style: ie, children: W });
183
+ ie()
184
+ ] }), G = O(te, J), de = Object.keys(H).length ? H : void 0;
185
+ return e.root ? e.root({ children: A, className: G }) : /* @__PURE__ */ n("div", { className: G, style: de, children: A });
200
186
  };
201
187
  export {
202
- ke as Calendar
188
+ Ce as Calendar
203
189
  };
@@ -8,6 +8,10 @@ export interface CalendarDayProps {
8
8
  isDisabled: boolean;
9
9
  isHighlighted?: boolean;
10
10
  }
11
+ export type HeaderLabelRFC = (props: {
12
+ month: string;
13
+ year: number;
14
+ }) => ReactNode;
11
15
  export interface CalendarNavActions {
12
16
  onPrevYear: () => void;
13
17
  onPrevMonth: () => void;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Calendar.const.cjs"),N=(e,t)=>new Date(e,t+n.NUMBER.ONE,n.NUMBER.ZERO).getDate(),c=(e,t)=>new Date(e,t,n.NUMBER.ONE).getDay(),g=(e,t)=>!e||!t?!1:e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),l=e=>e===n.NUMBER.ZERO||e===n.NUMBER.SIX,i=(e,t)=>({prevMonth:t===n.NUMBER.ZERO?n.NUMBER.ELEVEN:t-n.NUMBER.ONE,prevYear:t===n.NUMBER.ZERO?e-n.NUMBER.ONE:e}),B=(e,t)=>({nextMonth:t===n.NUMBER.ELEVEN?n.NUMBER.ZERO:t+n.NUMBER.ONE,nextYear:t===n.NUMBER.ELEVEN?e+n.NUMBER.ONE:e}),D=(e,t)=>t>n.NUMBER.ZERO?[...e.slice(t),...e.slice(n.NUMBER.ZERO,t)]:[...e];function h(e,t,U){const s=(c(e,t)-U+n.NUMBER.SEVEN)%n.NUMBER.SEVEN,o=N(e,t),{prevMonth:a,prevYear:R}=i(e,t),d=N(R,a),M=[];for(let E=n.NUMBER.ZERO;E<n.NUMBER.TOTAL_CELLS;E++)if(E<s){const r=d-s+E+n.NUMBER.ONE;M.push({date:new Date(R,a,r),isCurrentMonth:!1})}else if(E<s+o){const r=E-s+n.NUMBER.ONE;M.push({date:new Date(e,t,r),isCurrentMonth:!0})}else{const r=E-s-o+n.NUMBER.ONE,{nextMonth:O,nextYear:u}=B(e,t);M.push({date:new Date(u,O,r),isCurrentMonth:!1})}return M}exports.buildCalendarGrid=h;exports.getDaysInMonth=N;exports.getFirstDayOfMonth=c;exports.getNextMonthYear=B;exports.getPrevMonthYear=i;exports.isSameDay=g;exports.isWeekendDay=l;exports.reorderWeekdays=D;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Get number of days in a given month
3
+ */
4
+ export declare const getDaysInMonth: (year: number, month: number) => number;
5
+ /**
6
+ * Get the day of week for the first day of a month (0 = Sunday)
7
+ */
8
+ export declare const getFirstDayOfMonth: (year: number, month: number) => number;
9
+ /**
10
+ * Check if two dates are the same day
11
+ */
12
+ export declare const isSameDay: (a: Date | null, b: Date | null) => boolean;
13
+ /**
14
+ * Check if a day is a weekend (Saturday or Sunday)
15
+ */
16
+ export declare const isWeekendDay: (weekday: number) => boolean;
17
+ /**
18
+ * Get previous month and year
19
+ */
20
+ export declare const getPrevMonthYear: (year: number, month: number) => {
21
+ prevMonth: number;
22
+ prevYear: number;
23
+ };
24
+ /**
25
+ * Get next month and year
26
+ */
27
+ export declare const getNextMonthYear: (year: number, month: number) => {
28
+ nextMonth: number;
29
+ nextYear: number;
30
+ };
31
+ /**
32
+ * Reorder weekday labels based on first day of week
33
+ */
34
+ export declare const reorderWeekdays: <T>(labels: readonly T[], firstDayOfWeek: number) => T[];
35
+ /**
36
+ * Build 6-week calendar grid: prev month trailing, current month, next month leading
37
+ */
38
+ export declare function buildCalendarGrid(year: number, month: number, firstDayOfWeek: number): {
39
+ date: Date;
40
+ isCurrentMonth: boolean;
41
+ }[];
@@ -0,0 +1,33 @@
1
+ import { NUMBER as n } from "./Calendar.const.js";
2
+ const i = (t, e) => new Date(t, e + n.ONE, n.ZERO).getDate(), g = (t, e) => new Date(t, e, n.ONE).getDay(), p = (t, e) => !t || !e ? !1 : t.getDate() === e.getDate() && t.getMonth() === e.getMonth() && t.getFullYear() === e.getFullYear(), R = (t) => t === n.ZERO || t === n.SIX, l = (t, e) => ({
3
+ prevMonth: e === n.ZERO ? n.ELEVEN : e - n.ONE,
4
+ prevYear: e === n.ZERO ? t - n.ONE : t
5
+ }), D = (t, e) => ({
6
+ nextMonth: e === n.ELEVEN ? n.ZERO : e + n.ONE,
7
+ nextYear: e === n.ELEVEN ? t + n.ONE : t
8
+ }), Y = (t, e) => e > n.ZERO ? [...t.slice(e), ...t.slice(n.ZERO, e)] : [...t];
9
+ function Z(t, e, N) {
10
+ const r = (g(t, e) - N + n.SEVEN) % n.SEVEN, c = i(t, e), { prevMonth: a, prevYear: O } = l(t, e), M = i(O, a), o = [];
11
+ for (let s = n.ZERO; s < n.TOTAL_CELLS; s++)
12
+ if (s < r) {
13
+ const E = M - r + s + n.ONE;
14
+ o.push({ date: new Date(O, a, E), isCurrentMonth: !1 });
15
+ } else if (s < r + c) {
16
+ const E = s - r + n.ONE;
17
+ o.push({ date: new Date(t, e, E), isCurrentMonth: !0 });
18
+ } else {
19
+ const E = s - r - c + n.ONE, { nextMonth: u, nextYear: d } = D(t, e);
20
+ o.push({ date: new Date(d, u, E), isCurrentMonth: !1 });
21
+ }
22
+ return o;
23
+ }
24
+ export {
25
+ Z as buildCalendarGrid,
26
+ i as getDaysInMonth,
27
+ g as getFirstDayOfMonth,
28
+ D as getNextMonthYear,
29
+ l as getPrevMonthYear,
30
+ p as isSameDay,
31
+ R as isWeekendDay,
32
+ Y as reorderWeekdays
33
+ };
@@ -1,2 +1,4 @@
1
1
  export { Calendar } from './Calendar';
2
2
  export type { CalendarProps, CalendarSlots, CalendarDayProps, CalendarNavActions } from './Calendar.types';
3
+ export { NUMBER, DEFAULT_WEEKDAYS, MONTHS, WEEKEND, WEEKEND_LABELS } from './Calendar.const';
4
+ export { buildCalendarGrid, isSameDay, isWeekendDay, getDaysInMonth, getFirstDayOfMonth, reorderWeekdays } from './Calendar.utils';
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),x=c.forwardRef(({code:a,language:o="typescript",showLineNumbers:g=!0,title:s,copyable:d=!0,maxHeight:t,theme:r="dark",className:y="",...p},h)=>{const[n,i]=c.useState(!1),b=async()=>{await navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},u=a.split(`
2
+ `),j=r==="dark"?"bg-gray-900 text-gray-100":"bg-gray-50 text-gray-900 border border-gray-200";return e.jsxs("div",{className:`bear-code-block rounded-lg overflow-hidden ${j} ${y}`.trim(),children:[(s||d)&&e.jsxs("div",{className:`flex items-center justify-between px-4 py-2 ${r==="dark"?"bg-gray-800 border-b border-gray-700":"bg-gray-100 border-b border-gray-200"}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx("span",{className:`text-sm font-medium ${r==="dark"?"text-gray-300":"text-gray-700"}`,children:s}),o&&e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${r==="dark"?"bg-gray-700 text-gray-400":"bg-gray-200 text-gray-600"}`,children:o})]}),d&&e.jsx("button",{onClick:b,className:`p-1.5 rounded transition-colors ${r==="dark"?"hover:bg-gray-700 text-gray-400 hover:text-gray-200":"hover:bg-gray-200 text-gray-500 hover:text-gray-700"}`,title:n?"Copied!":"Copy code",children:n?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})})]}),e.jsx("pre",{ref:h,className:"overflow-x-auto p-4",style:{maxHeight:t?typeof t=="number"?`${t}px`:t:void 0},...p,children:e.jsx("code",{className:"text-sm font-mono",children:u.map((m,l)=>e.jsxs("div",{className:"flex",children:[g&&e.jsx("span",{className:`select-none w-8 flex-shrink-0 text-right pr-4 ${r==="dark"?"text-gray-600":"text-gray-400"}`,children:l+1}),e.jsx("span",{className:"flex-1",children:m||" "})]},l))})})]})});x.displayName="CodeBlock";exports.CodeBlock=x;
@@ -0,0 +1,2 @@
1
+ import { CodeBlockProps } from './CodeBlock.types';
2
+ export declare const CodeBlock: import('react').ForwardRefExoticComponent<CodeBlockProps & import('react').RefAttributes<HTMLPreElement>>;
@@ -0,0 +1,55 @@
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as f, useState as v } from "react";
3
+ const k = f(({
4
+ code: s,
5
+ language: d = "typescript",
6
+ showLineNumbers: g = !0,
7
+ title: o,
8
+ copyable: i = !0,
9
+ maxHeight: a,
10
+ theme: r = "dark",
11
+ className: y = "",
12
+ ...x
13
+ }, p) => {
14
+ const [l, n] = v(!1), h = async () => {
15
+ await navigator.clipboard.writeText(s), n(!0), setTimeout(() => n(!1), 2e3);
16
+ }, m = s.split(`
17
+ `);
18
+ return /* @__PURE__ */ t("div", { className: `bear-code-block rounded-lg overflow-hidden ${r === "dark" ? "bg-gray-900 text-gray-100" : "bg-gray-50 text-gray-900 border border-gray-200"} ${y}`.trim(), children: [
19
+ (o || i) && /* @__PURE__ */ t("div", { className: `flex items-center justify-between px-4 py-2 ${r === "dark" ? "bg-gray-800 border-b border-gray-700" : "bg-gray-100 border-b border-gray-200"}`, children: [
20
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
21
+ o && /* @__PURE__ */ e("span", { className: `text-sm font-medium ${r === "dark" ? "text-gray-300" : "text-gray-700"}`, children: o }),
22
+ d && /* @__PURE__ */ e("span", { className: `text-xs px-2 py-0.5 rounded ${r === "dark" ? "bg-gray-700 text-gray-400" : "bg-gray-200 text-gray-600"}`, children: d })
23
+ ] }),
24
+ i && /* @__PURE__ */ e(
25
+ "button",
26
+ {
27
+ onClick: h,
28
+ className: `p-1.5 rounded transition-colors ${r === "dark" ? "hover:bg-gray-700 text-gray-400 hover:text-gray-200" : "hover:bg-gray-200 text-gray-500 hover:text-gray-700"}`,
29
+ title: l ? "Copied!" : "Copy code",
30
+ children: l ? /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
31
+ /* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
32
+ /* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" })
33
+ ] })
34
+ }
35
+ )
36
+ ] }),
37
+ /* @__PURE__ */ e(
38
+ "pre",
39
+ {
40
+ ref: p,
41
+ className: "overflow-x-auto p-4",
42
+ style: { maxHeight: a ? typeof a == "number" ? `${a}px` : a : void 0 },
43
+ ...x,
44
+ children: /* @__PURE__ */ e("code", { className: "text-sm font-mono", children: m.map((b, c) => /* @__PURE__ */ t("div", { className: "flex", children: [
45
+ g && /* @__PURE__ */ e("span", { className: `select-none w-8 flex-shrink-0 text-right pr-4 ${r === "dark" ? "text-gray-600" : "text-gray-400"}`, children: c + 1 }),
46
+ /* @__PURE__ */ e("span", { className: "flex-1", children: b || " " })
47
+ ] }, c)) })
48
+ }
49
+ )
50
+ ] });
51
+ });
52
+ k.displayName = "CodeBlock";
53
+ export {
54
+ k as CodeBlock
55
+ };
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface CodeBlockProps extends HTMLAttributes<HTMLPreElement> {
3
+ code: string;
4
+ language?: string;
5
+ showLineNumbers?: boolean;
6
+ title?: string;
7
+ copyable?: boolean;
8
+ maxHeight?: number | string;
9
+ theme?: 'dark' | 'light';
10
+ }
@@ -0,0 +1,2 @@
1
+ export { CodeBlock } from './CodeBlock';
2
+ export type { CodeBlockProps } from './CodeBlock.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),a=require("../../utils/cn.cjs"),c={none:"0",xs:"0.5rem",sm:"1rem",md:"1.5rem",lg:"2rem",xl:"3rem"},b=({children:l,count:e="auto",gap:n="md",fill:r=!1,minWidth:o,className:s,style:m})=>{const t={columnCount:e==="auto"?"auto":e,columnGap:c[n],columnFill:r?"balance":"auto",...o&&{columnWidth:typeof o=="number"?`${o}px`:o},...m};return u.jsx("div",{className:a.cn("bear-w-full",s),style:t,children:l})},i=({children:l,span:e="avoid",className:n,style:r})=>u.jsx("div",{className:a.cn("bear-inline-block bear-w-full bear-mb-4",e==="avoid"&&"bear-break-inside-avoid",n),style:r,children:l});exports.Column=i;exports.Columns=b;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { ColumnsProps, ColumnProps } from './Columns.types';
3
+ export declare const Columns: FC<ColumnsProps>;
4
+ export declare const Column: FC<ColumnProps>;
5
+ export default Columns;
@@ -0,0 +1,54 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { cn as n } from "../../utils/cn.js";
3
+ const c = {
4
+ none: "0",
5
+ xs: "0.5rem",
6
+ sm: "1rem",
7
+ md: "1.5rem",
8
+ lg: "2rem",
9
+ xl: "3rem"
10
+ }, d = ({
11
+ children: l,
12
+ count: o = "auto",
13
+ gap: a = "md",
14
+ fill: r = !1,
15
+ minWidth: e,
16
+ className: u,
17
+ style: s
18
+ }) => {
19
+ const t = {
20
+ columnCount: o === "auto" ? "auto" : o,
21
+ columnGap: c[a],
22
+ columnFill: r ? "balance" : "auto",
23
+ ...e && { columnWidth: typeof e == "number" ? `${e}px` : e },
24
+ ...s
25
+ };
26
+ return /* @__PURE__ */ m(
27
+ "div",
28
+ {
29
+ className: n("bear-w-full", u),
30
+ style: t,
31
+ children: l
32
+ }
33
+ );
34
+ }, f = ({
35
+ children: l,
36
+ span: o = "avoid",
37
+ className: a,
38
+ style: r
39
+ }) => /* @__PURE__ */ m(
40
+ "div",
41
+ {
42
+ className: n(
43
+ "bear-inline-block bear-w-full bear-mb-4",
44
+ o === "avoid" && "bear-break-inside-avoid",
45
+ a
46
+ ),
47
+ style: r,
48
+ children: l
49
+ }
50
+ );
51
+ export {
52
+ f as Column,
53
+ d as Columns
54
+ };
@@ -0,0 +1,17 @@
1
+ import { ReactNode, CSSProperties } from 'react';
2
+ export interface ColumnsProps {
3
+ children: ReactNode;
4
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 'auto';
5
+ gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ fill?: boolean;
7
+ minWidth?: string | number;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ }
11
+ export interface ColumnProps {
12
+ children: ReactNode;
13
+ span?: 'avoid' | 'auto';
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ }
17
+ export type ColumnsCountType = 1 | 2 | 3 | 4 | 5 | 6 | 'auto';
@@ -0,0 +1,2 @@
1
+ export { Columns, Column } from './Columns';
2
+ export type { ColumnsProps, ColumnProps, ColumnsCountType } from './Columns.types';