@dimasbaguspm/versaur 0.0.1 → 0.0.2

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.
@@ -1,2 +1,2 @@
1
1
  import { BottomBarItemProps } from './types';
2
- export declare const BottomBarItem: import('react').ForwardRefExoticComponent<BottomBarItemProps & import('react').RefAttributes<HTMLButtonElement>>;
2
+ export declare const BottomBarItem: import('react').ForwardRefExoticComponent<BottomBarItemProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
1
  import { BottomBarProps } from './types';
2
2
  export declare const BottomBar: (({ children, variant, size, className, ...props }: BottomBarProps) => import("react/jsx-runtime").JSX.Element) & {
3
- Item: import('react').ForwardRefExoticComponent<import('./types').BottomBarItemProps & import('react').RefAttributes<HTMLButtonElement>>;
3
+ Item: import('react').ForwardRefExoticComponent<import('./types').BottomBarItemProps & import('react').RefAttributes<HTMLDivElement>>;
4
4
  };
@@ -1,7 +1,8 @@
1
+ import { HTMLAttributes } from 'react';
1
2
  /**
2
3
  * Props for the BottomBar container
3
4
  */
4
- export interface BottomBarProps extends React.HTMLAttributes<HTMLElement> {
5
+ export interface BottomBarProps extends HTMLAttributes<HTMLElement> {
5
6
  /**
6
7
  * Visual variant for the BottomBar
7
8
  * @default 'primary'
@@ -16,7 +17,7 @@ export interface BottomBarProps extends React.HTMLAttributes<HTMLElement> {
16
17
  /**
17
18
  * Props for each BottomBar.Item
18
19
  */
19
- export interface BottomBarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
20
+ export interface BottomBarItemProps extends HTMLAttributes<HTMLDivElement> {
20
21
  /**
21
22
  * Icon element for the item
22
23
  */
@@ -7,6 +7,7 @@ export * from './breadcrumbs';
7
7
  export * from './button';
8
8
  export * from './button-icon';
9
9
  export * from './button-float';
10
+ export * from './calendar';
10
11
  export * from './checkbox-input';
11
12
  export * from './chip-input';
12
13
  export * from './date-single-picker-input';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as wr from "react";
2
2
  import I, { forwardRef as E, useState as U, useEffect as H, useCallback as ke, createContext as ee, useContext as re, useRef as ce, useId as Ee, useLayoutEffect as yr } from "react";
3
- import { Check as kr, ChevronLeft as jr, ChevronRight as Nr, X as Cr } from "lucide-react";
3
+ import { ChevronLeft as kr, ChevronRight as jr, Check as Nr, X as Cr } from "lucide-react";
4
4
  var ve = { exports: {} }, be = {};
5
5
  /**
6
6
  * @license React
@@ -3557,7 +3557,7 @@ const Le = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, $e = Ye, y
3557
3557
  );
3558
3558
  Ct.displayName = "Badge";
3559
3559
  const zt = y(
3560
- "absolute bottom-0 left-0 w-full flex justify-between items-center bg-white border-t border-coral/10 z-40 safe-bottom px-6 py-1",
3560
+ "sticky bottom-0 left-0 w-full flex justify-between items-center bg-white border-t border-coral z-40 safe-bottom px-8 py-1",
3561
3561
  {
3562
3562
  variants: {
3563
3563
  variant: {
@@ -3593,10 +3593,9 @@ const zt = y(
3593
3593
  }
3594
3594
  ), St = E(
3595
3595
  ({ icon: e, label: r, active: t = !1, className: o, ...s }, a) => /* @__PURE__ */ n.jsxs(
3596
- "button",
3596
+ "div",
3597
3597
  {
3598
3598
  ref: a,
3599
- type: "button",
3600
3599
  "aria-current": t ? "page" : void 0,
3601
3600
  className: It({ active: t, className: o }),
3602
3601
  ...s,
@@ -3931,7 +3930,110 @@ const Pt = E(
3931
3930
  }
3932
3931
  );
3933
3932
  }
3934
- ), _t = y("space-y-2", {
3933
+ ), _t = ({
3934
+ value: e,
3935
+ onChange: r,
3936
+ className: t,
3937
+ ...o
3938
+ }) => {
3939
+ const s = /* @__PURE__ */ new Date(), [a, i] = U(s.getMonth()), [l, c] = U(s.getFullYear()), d = (v, w) => new Date(v, w + 1, 0).getDate(), f = (v, w) => new Date(v, w, 1).getDay(), g = () => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-between px-4 pt-4 pb-2", children: [
3940
+ /* @__PURE__ */ n.jsx("span", { className: "font-semibold text-lg", children: e ? e.toLocaleDateString(void 0, {
3941
+ year: "numeric",
3942
+ month: "long",
3943
+ day: "numeric"
3944
+ }) : `${l} ${new Date(l, a).toLocaleString(void 0, { month: "long" })}` }),
3945
+ /* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
3946
+ /* @__PURE__ */ n.jsx(
3947
+ le,
3948
+ {
3949
+ variant: "ghost",
3950
+ size: "sm",
3951
+ "aria-label": "Previous month",
3952
+ onClick: () => {
3953
+ const v = a === 0 ? 11 : a - 1, w = a === 0 ? l - 1 : l;
3954
+ i(v), c(w), r?.(new Date(w, v, 1));
3955
+ },
3956
+ children: /* @__PURE__ */ n.jsx(kr, { className: "h-4 w-4" })
3957
+ }
3958
+ ),
3959
+ /* @__PURE__ */ n.jsx(
3960
+ le,
3961
+ {
3962
+ variant: "ghost",
3963
+ size: "sm",
3964
+ "aria-label": "Next month",
3965
+ onClick: () => {
3966
+ const v = a === 11 ? 0 : a + 1, w = a === 11 ? l + 1 : l;
3967
+ i(v), c(w), r?.(new Date(w, v, 1));
3968
+ },
3969
+ children: /* @__PURE__ */ n.jsx(jr, { className: "h-4 w-4" })
3970
+ }
3971
+ )
3972
+ ] })
3973
+ ] }), b = () => /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-7 px-4 text-xs text-slate-500 mb-1", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((v) => /* @__PURE__ */ n.jsx("div", { className: "flex items-center justify-center h-6", children: v }, v)) }), m = () => {
3974
+ const v = [], w = f(l, a), C = d(l, a), R = d(l, a - 1 < 0 ? 11 : a - 1);
3975
+ for (let N = 0; N < w; N++)
3976
+ v.push(
3977
+ /* @__PURE__ */ n.jsx(
3978
+ le,
3979
+ {
3980
+ size: "sm",
3981
+ "aria-label": "Previous month day",
3982
+ variant: "ghost",
3983
+ className: "text-slate-300",
3984
+ onClick: () => {
3985
+ const M = a === 0 ? 11 : a - 1, F = a === 0 ? l - 1 : l, L = R - w + N + 1;
3986
+ r?.(new Date(F, M, L)), i(M), c(F);
3987
+ },
3988
+ children: R - w + N + 1
3989
+ },
3990
+ "prev-" + N
3991
+ )
3992
+ );
3993
+ for (let N = 1; N <= C; N++) {
3994
+ const M = e && e.getFullYear() === l && e.getMonth() === a && e.getDate() === N;
3995
+ v.push(
3996
+ /* @__PURE__ */ n.jsx(
3997
+ le,
3998
+ {
3999
+ variant: M ? "primary" : "ghost",
4000
+ size: "sm",
4001
+ "aria-label": `Select ${l}-${a + 1}-${N}`,
4002
+ "aria-current": M ? "date" : void 0,
4003
+ onClick: () => r?.(new Date(l, a, N)),
4004
+ children: N
4005
+ },
4006
+ N
4007
+ )
4008
+ );
4009
+ }
4010
+ const A = w + C;
4011
+ for (let N = 0; N < (A % 7 === 0 ? 0 : 7 - A % 7); N++)
4012
+ v.push(
4013
+ /* @__PURE__ */ n.jsx(
4014
+ le,
4015
+ {
4016
+ size: "sm",
4017
+ "aria-label": "Next month day",
4018
+ variant: "ghost",
4019
+ className: "text-slate-300",
4020
+ onClick: () => {
4021
+ const M = a === 11 ? 0 : a + 1, F = a === 11 ? l + 1 : l, L = N + 1;
4022
+ r?.(new Date(F, M, L)), i(M), c(F);
4023
+ },
4024
+ children: N + 1
4025
+ },
4026
+ "next-" + N
4027
+ )
4028
+ );
4029
+ return /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
4030
+ };
4031
+ return /* @__PURE__ */ n.jsxs("div", { className: p("select-none", t), ...o, children: [
4032
+ g(),
4033
+ b(),
4034
+ m()
4035
+ ] });
4036
+ }, or = Object.assign(_t, {}), Ft = y("space-y-2", {
3935
4037
  variants: {
3936
4038
  direction: {
3937
4039
  vertical: "space-y-2 space-x-0",
@@ -3941,7 +4043,7 @@ const Pt = E(
3941
4043
  defaultVariants: {
3942
4044
  direction: "vertical"
3943
4045
  }
3944
- }), Ft = y(
4046
+ }), Lt = y(
3945
4047
  "relative h-4 w-4 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed appearance-none bg-white",
3946
4048
  {
3947
4049
  variants: {
@@ -3979,7 +4081,7 @@ const Pt = E(
3979
4081
  size: "md"
3980
4082
  }
3981
4083
  }
3982
- ), Lt = y(
4084
+ ), $t = y(
3983
4085
  "text-foreground cursor-pointer select-none",
3984
4086
  {
3985
4087
  variants: {
@@ -3998,13 +4100,13 @@ const Pt = E(
3998
4100
  disabled: !1
3999
4101
  }
4000
4102
  }
4001
- ), or = ee(null), $t = () => {
4002
- const e = re(or);
4103
+ ), sr = ee(null), Gt = () => {
4104
+ const e = re(sr);
4003
4105
  if (!e)
4004
4106
  throw new Error("CheckboxOption must be used within CheckboxInput");
4005
4107
  return e;
4006
- }, sr = I.forwardRef(({ children: e, description: r, className: t, disabled: o, id: s, ...a }, i) => {
4007
- const l = $t(), c = I.useId(), d = s || c, f = o || l.disabled, g = l.error ? "danger" : l.variant || "primary";
4108
+ }, nr = I.forwardRef(({ children: e, description: r, className: t, disabled: o, id: s, ...a }, i) => {
4109
+ const l = Gt(), c = I.useId(), d = s || c, f = o || l.disabled, g = l.error ? "danger" : l.variant || "primary";
4008
4110
  return /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
4009
4111
  /* @__PURE__ */ n.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ n.jsx(
4010
4112
  "input",
@@ -4014,7 +4116,7 @@ const Pt = E(
4014
4116
  id: d,
4015
4117
  disabled: f,
4016
4118
  className: p(
4017
- Ft({
4119
+ Lt({
4018
4120
  variant: g,
4019
4121
  size: l.size
4020
4122
  }),
@@ -4037,7 +4139,7 @@ const Pt = E(
4037
4139
  "label",
4038
4140
  {
4039
4141
  htmlFor: d,
4040
- className: Lt({
4142
+ className: $t({
4041
4143
  size: l.size,
4042
4144
  disabled: f
4043
4145
  }),
@@ -4060,8 +4162,8 @@ const Pt = E(
4060
4162
  ] })
4061
4163
  ] });
4062
4164
  });
4063
- sr.displayName = "CheckboxOption";
4064
- const nr = I.forwardRef(
4165
+ nr.displayName = "CheckboxOption";
4166
+ const ar = I.forwardRef(
4065
4167
  ({
4066
4168
  variant: e = "primary",
4067
4169
  size: r = "md",
@@ -4080,25 +4182,25 @@ const nr = I.forwardRef(
4080
4182
  disabled: l,
4081
4183
  error: g
4082
4184
  };
4083
- return /* @__PURE__ */ n.jsx(or.Provider, { value: b, children: /* @__PURE__ */ n.jsxs("div", { ref: f, className: p("w-full", i), ...d, children: [
4185
+ return /* @__PURE__ */ n.jsx(sr.Provider, { value: b, children: /* @__PURE__ */ n.jsxs("div", { ref: f, className: p("w-full", i), ...d, children: [
4084
4186
  t && /* @__PURE__ */ n.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: t }),
4085
- /* @__PURE__ */ n.jsx("div", { className: _t({ direction: a }), children: c }),
4187
+ /* @__PURE__ */ n.jsx("div", { className: Ft({ direction: a }), children: c }),
4086
4188
  g && /* @__PURE__ */ n.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: s }),
4087
4189
  !g && o && /* @__PURE__ */ n.jsx("div", { className: "mt-2 text-sm text-gray-600", children: o })
4088
4190
  ] }) });
4089
4191
  }
4090
4192
  );
4091
- nr.displayName = "CheckboxInput";
4092
- const Ls = Object.assign(nr, {
4093
- Option: sr
4094
- }), ar = ee(
4193
+ ar.displayName = "CheckboxInput";
4194
+ const Ls = Object.assign(ar, {
4195
+ Option: nr
4196
+ }), ir = ee(
4095
4197
  null
4096
- ), Gt = () => {
4097
- const e = re(ar);
4198
+ ), Wt = () => {
4199
+ const e = re(ir);
4098
4200
  if (!e)
4099
4201
  throw new Error("useChipInputContext must be used within ChipInputContext");
4100
4202
  return e;
4101
- }, Wt = y(
4203
+ }, Yt = y(
4102
4204
  "inline-flex items-center px-2 py-1 text-xs bg-neutral rounded-full font-medium transition-colors duration-200 cursor-pointer border border-slate-100",
4103
4205
  {
4104
4206
  variants: {
@@ -4177,8 +4279,8 @@ const Ls = Object.assign(nr, {
4177
4279
  selected: !1
4178
4280
  }
4179
4281
  }
4180
- ), ir = I.forwardRef(({ children: e, className: r, disabled: t, id: o, value: s, ...a }, i) => {
4181
- const l = Gt(), c = I.useId(), d = o || c, f = t || l.disabled, g = l.error ? "danger" : l.variant || "primary", b = l.value?.includes(s) ?? !1, m = (v) => {
4282
+ ), lr = I.forwardRef(({ children: e, className: r, disabled: t, id: o, value: s, ...a }, i) => {
4283
+ const l = Wt(), c = I.useId(), d = o || c, f = t || l.disabled, g = l.error ? "danger" : l.variant || "primary", b = l.value?.includes(s) ?? !1, m = (v) => {
4182
4284
  if (!f) {
4183
4285
  const w = l.value || [];
4184
4286
  let C;
@@ -4208,7 +4310,7 @@ const Ls = Object.assign(nr, {
4208
4310
  htmlFor: d,
4209
4311
  "data-selected": b,
4210
4312
  className: p(
4211
- Wt({
4313
+ Yt({
4212
4314
  variant: g,
4213
4315
  selected: b
4214
4316
  }),
@@ -4226,7 +4328,7 @@ const Ls = Object.assign(nr, {
4226
4328
  ),
4227
4329
  "aria-hidden": "true",
4228
4330
  children: b && /* @__PURE__ */ n.jsx(
4229
- kr,
4331
+ Nr,
4230
4332
  {
4231
4333
  size: 16,
4232
4334
  className: g === "primary" ? "text-coral" : g === "secondary" ? "text-sage" : g === "tertiary" ? "text-mist" : g === "ghost" ? "text-slate" : g === "success" ? "text-success" : g === "info" ? "text-info" : g === "warning" ? "text-warning" : g === "danger" ? "text-danger" : "text-coral"
@@ -4240,8 +4342,8 @@ const Ls = Object.assign(nr, {
4240
4342
  )
4241
4343
  ] });
4242
4344
  });
4243
- ir.displayName = "ChipOption";
4244
- const Yt = I.forwardRef(
4345
+ lr.displayName = "ChipOption";
4346
+ const qt = I.forwardRef(
4245
4347
  ({
4246
4348
  variant: e = "primary",
4247
4349
  label: r,
@@ -4263,16 +4365,16 @@ const Yt = I.forwardRef(
4263
4365
  value: l,
4264
4366
  onChange: c
4265
4367
  };
4266
- return /* @__PURE__ */ n.jsx(ar.Provider, { value: m, children: /* @__PURE__ */ n.jsxs("div", { ref: g, className: p("w-full", s), ...f, children: [
4368
+ return /* @__PURE__ */ n.jsx(ir.Provider, { value: m, children: /* @__PURE__ */ n.jsxs("div", { ref: g, className: p("w-full", s), ...f, children: [
4267
4369
  r && /* @__PURE__ */ n.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: r }),
4268
4370
  /* @__PURE__ */ n.jsx("div", { className: "flex flex-wrap gap-2", children: d }),
4269
4371
  b && /* @__PURE__ */ n.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: o }),
4270
4372
  !b && t && /* @__PURE__ */ n.jsx("div", { className: "mt-2 text-sm text-gray-600", children: t })
4271
4373
  ] }) });
4272
4374
  }
4273
- ), $s = Object.assign(Yt, {
4274
- Option: ir
4275
- }), qt = E(
4375
+ ), $s = Object.assign(qt, {
4376
+ Option: lr
4377
+ }), Ut = E(
4276
4378
  ({ className: e, ...r }, t) => /* @__PURE__ */ n.jsx(
4277
4379
  "div",
4278
4380
  {
@@ -4281,7 +4383,7 @@ const Yt = I.forwardRef(
4281
4383
  ...r
4282
4384
  }
4283
4385
  )
4284
- ), Ut = E(
4386
+ ), Ht = E(
4285
4387
  ({ className: e, ...r }, t) => /* @__PURE__ */ n.jsx(
4286
4388
  "div",
4287
4389
  {
@@ -4290,9 +4392,9 @@ const Yt = I.forwardRef(
4290
4392
  ...r
4291
4393
  }
4292
4394
  )
4293
- ), Ht = E(
4294
- ({ className: e, ...r }, t) => /* @__PURE__ */ n.jsx("div", { ref: t, className: p("px-6 py-2", e), ...r })
4295
4395
  ), Jt = E(
4396
+ ({ className: e, ...r }, t) => /* @__PURE__ */ n.jsx("div", { ref: t, className: p("px-6 py-2", e), ...r })
4397
+ ), Xt = E(
4296
4398
  ({ onOverlayClick: e, ...r }, t) => /* @__PURE__ */ n.jsx(
4297
4399
  "div",
4298
4400
  {
@@ -4304,7 +4406,7 @@ const Yt = I.forwardRef(
4304
4406
  ...r
4305
4407
  }
4306
4408
  )
4307
- ), Xt = y(
4409
+ ), Kt = y(
4308
4410
  "fixed inset-0 z-51 transition-opacity duration-300 bg-black/30 backdrop-blur-md flex items-center justify-center transition-opacity duration-200 ease-in-out",
4309
4411
  {
4310
4412
  variants: {
@@ -4317,7 +4419,7 @@ const Yt = I.forwardRef(
4317
4419
  placement: "center"
4318
4420
  }
4319
4421
  }
4320
- ), Kt = y(
4422
+ ), Zt = y(
4321
4423
  [
4322
4424
  "bg-white rounded-lg shadow-xl relative",
4323
4425
  "flex flex-col",
@@ -4346,7 +4448,7 @@ const Yt = I.forwardRef(
4346
4448
  }
4347
4449
  }
4348
4450
  );
4349
- function Zt(e, r) {
4451
+ function Qt(e, r) {
4350
4452
  H(() => {
4351
4453
  if (r && e.current) {
4352
4454
  const t = e.current.querySelectorAll(
@@ -4356,7 +4458,7 @@ function Zt(e, r) {
4356
4458
  }
4357
4459
  }, [r, e]);
4358
4460
  }
4359
- function Qt(e, r) {
4461
+ function eo(e, r) {
4360
4462
  H(() => {
4361
4463
  if (!e) return;
4362
4464
  const t = (o) => {
@@ -4365,7 +4467,7 @@ function Qt(e, r) {
4365
4467
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
4366
4468
  }, [e, r]);
4367
4469
  }
4368
- const eo = 200, ro = ({
4470
+ const ro = 200, to = ({
4369
4471
  isOpen: e,
4370
4472
  onOpenChange: r,
4371
4473
  size: t = "md",
@@ -4383,16 +4485,16 @@ const eo = 200, ro = ({
4383
4485
  m(!0);
4384
4486
  const v = setTimeout(() => {
4385
4487
  g(!1), m(!1), c.current && c.current.focus();
4386
- }, eo);
4488
+ }, ro);
4387
4489
  return () => clearTimeout(v);
4388
4490
  }
4389
- }, [e]), Qt(e && !i, () => {
4491
+ }, [e]), eo(e && !i, () => {
4390
4492
  r && r(!1);
4391
- }), Zt(d, e), /* @__PURE__ */ n.jsx(
4392
- Jt,
4493
+ }), Qt(d, e), /* @__PURE__ */ n.jsx(
4494
+ Xt,
4393
4495
  {
4394
4496
  ref: d,
4395
- className: `${Xt({ placement: o })} transition-opacity duration-200 ease-in-out ` + (e && !b ? "opacity-100" : "opacity-0 pointer-events-none"),
4497
+ className: `${Kt({ placement: o })} transition-opacity duration-200 ease-in-out ` + (e && !b ? "opacity-100" : "opacity-0 pointer-events-none"),
4396
4498
  onOverlayClick: (v) => {
4397
4499
  v.target === d.current && !a && r && r(!1);
4398
4500
  },
@@ -4400,7 +4502,7 @@ const eo = 200, ro = ({
4400
4502
  children: /* @__PURE__ */ n.jsx(
4401
4503
  "div",
4402
4504
  {
4403
- className: `${Kt({ size: t, placement: o })} transition-all duration-200 ease-in-out ` + (e && !b ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"),
4505
+ className: `${Zt({ size: t, placement: o })} transition-all duration-200 ease-in-out ` + (e && !b ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"),
4404
4506
  role: "dialog",
4405
4507
  ...l,
4406
4508
  tabIndex: 0,
@@ -4410,11 +4512,11 @@ const eo = 200, ro = ({
4410
4512
  )
4411
4513
  }
4412
4514
  );
4413
- }, ze = Object.assign(ro, {
4414
- Header: qt,
4415
- Body: Ht,
4416
- Footer: Ut
4417
- }), lr = y(
4515
+ }, ze = Object.assign(to, {
4516
+ Header: Ut,
4517
+ Body: Jt,
4518
+ Footer: Ht
4519
+ }), cr = y(
4418
4520
  "block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50",
4419
4521
  {
4420
4522
  variants: {
@@ -4446,7 +4548,7 @@ const eo = 200, ro = ({
4446
4548
  variant: "primary"
4447
4549
  }
4448
4550
  }
4449
- ), to = lr, cr = I.forwardRef(
4551
+ ), oo = cr, dr = I.forwardRef(
4450
4552
  ({
4451
4553
  leftContent: e,
4452
4554
  rightContent: r,
@@ -4464,7 +4566,7 @@ const eo = 200, ro = ({
4464
4566
  type: "button",
4465
4567
  "aria-invalid": t,
4466
4568
  className: p(
4467
- to({
4569
+ oo({
4468
4570
  variant: t ? "danger" : o
4469
4571
  }),
4470
4572
  e ? "pl-9" : "pl-3",
@@ -4506,13 +4608,13 @@ const eo = 200, ro = ({
4506
4608
  }
4507
4609
  )
4508
4610
  );
4509
- cr.displayName = "DateSinglePickerTrigger";
4510
- const dr = ee(null), Ae = () => {
4511
- const e = re(dr);
4611
+ dr.displayName = "DateSinglePickerTrigger";
4612
+ const ur = ee(null), Ae = () => {
4613
+ const e = re(ur);
4512
4614
  if (!e)
4513
4615
  throw new Error("useMenuContext must be used within a Menu component");
4514
4616
  return e;
4515
- }, oo = y(
4617
+ }, so = y(
4516
4618
  // Modern, clean, accessible base style
4517
4619
  "z-50 min-w-40 bg-neutral-50 text-black rounded-lg shadow-md border border-transparent",
4518
4620
  {
@@ -4531,7 +4633,7 @@ const dr = ee(null), Ae = () => {
4531
4633
  size: "md"
4532
4634
  }
4533
4635
  }
4534
- ), so = y(
4636
+ ), no = y(
4535
4637
  "w-full text-left px-4 rounded-md cursor-pointer transition-colors duration-150 font-medium select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-coral/70 hover:bg-slate-100 active:bg-slate-200 disabled:opacity-50 disabled:cursor-not-allowed",
4536
4638
  {
4537
4639
  variants: {
@@ -4549,7 +4651,7 @@ const dr = ee(null), Ae = () => {
4549
4651
  size: "md"
4550
4652
  }
4551
4653
  }
4552
- ), no = E(
4654
+ ), ao = E(
4553
4655
  ({ children: e, ...r }, t) => {
4554
4656
  const { open: o, triggerRef: s } = Ae();
4555
4657
  return /* @__PURE__ */ n.jsx(
@@ -4567,7 +4669,7 @@ const dr = ee(null), Ae = () => {
4567
4669
  }
4568
4670
  );
4569
4671
  }
4570
- ), ao = E(
4672
+ ), io = E(
4571
4673
  ({ children: e, className: r, ...t }, o) => {
4572
4674
  const { open: s, contentRef: a, triggerRef: i, size: l } = Ae(), c = Ee();
4573
4675
  let d = 0, f = 0;
@@ -4586,7 +4688,7 @@ const dr = ee(null), Ae = () => {
4586
4688
  tabIndex: -1,
4587
4689
  "aria-hidden": !s,
4588
4690
  className: p(
4589
- oo({
4691
+ so({
4590
4692
  size: l
4591
4693
  }),
4592
4694
  "absolute z-50 transition-opacity duration-150 ease-out",
@@ -4603,7 +4705,7 @@ const dr = ee(null), Ae = () => {
4603
4705
  }
4604
4706
  );
4605
4707
  }
4606
- ), io = E(
4708
+ ), lo = E(
4607
4709
  ({ children: e, disabled: r, className: t, ...o }, s) => {
4608
4710
  const { size: a } = Ae();
4609
4711
  return /* @__PURE__ */ n.jsx(
@@ -4615,7 +4717,7 @@ const dr = ee(null), Ae = () => {
4615
4717
  disabled: r,
4616
4718
  "aria-disabled": r,
4617
4719
  className: p(
4618
- so({
4720
+ no({
4619
4721
  size: a
4620
4722
  }),
4621
4723
  t
@@ -4626,7 +4728,7 @@ const dr = ee(null), Ae = () => {
4626
4728
  );
4627
4729
  }
4628
4730
  );
4629
- function lo(e, r, t, o) {
4731
+ function co(e, r, t, o) {
4630
4732
  H(() => {
4631
4733
  if (!e) return;
4632
4734
  function s(a) {
@@ -4635,7 +4737,7 @@ function lo(e, r, t, o) {
4635
4737
  return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
4636
4738
  }, [e, o, r, t]);
4637
4739
  }
4638
- function co(e, r) {
4740
+ function uo(e, r) {
4639
4741
  H(() => {
4640
4742
  if (e && r.current) {
4641
4743
  const t = r.current.querySelectorAll('[role="menuitem"]');
@@ -4643,7 +4745,7 @@ function co(e, r) {
4643
4745
  }
4644
4746
  }, [e, r]);
4645
4747
  }
4646
- function uo(e, r, t, o) {
4748
+ function go(e, r, t, o) {
4647
4749
  H(() => {
4648
4750
  if (!e || !r.current) return;
4649
4751
  const s = r.current;
@@ -4656,135 +4758,32 @@ function uo(e, r, t, o) {
4656
4758
  return s.addEventListener("keydown", a), () => s.removeEventListener("keydown", a);
4657
4759
  }, [e, o, r, t]);
4658
4760
  }
4659
- const go = ({
4761
+ const fo = ({
4660
4762
  children: e,
4661
4763
  isOpen: r,
4662
4764
  onOutsideClick: t,
4663
4765
  size: o = "md"
4664
4766
  }) => {
4665
4767
  const s = ce(null), a = ce(null);
4666
- return lo(r, a, s, t), co(r, a), uo(r, a, s, t), /* @__PURE__ */ n.jsx(
4667
- dr.Provider,
4768
+ return co(r, a, s, t), uo(r, a), go(r, a, s, t), /* @__PURE__ */ n.jsx(
4769
+ ur.Provider,
4668
4770
  {
4669
4771
  value: { open: r, triggerRef: s, contentRef: a, size: o },
4670
4772
  children: e
4671
4773
  }
4672
4774
  );
4673
- }, Ie = Object.assign(go, {
4674
- Trigger: no,
4675
- Content: ao,
4676
- Item: io
4677
- }), fo = ({
4678
- value: e,
4679
- onChange: r,
4680
- className: t,
4681
- ...o
4682
- }) => {
4683
- const s = /* @__PURE__ */ new Date(), [a, i] = U(s.getMonth()), [l, c] = U(s.getFullYear()), d = (v, w) => new Date(v, w + 1, 0).getDate(), f = (v, w) => new Date(v, w, 1).getDay(), g = () => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-between px-4 pt-4 pb-2", children: [
4684
- /* @__PURE__ */ n.jsx("span", { className: "font-semibold text-lg", children: e ? e.toLocaleDateString(void 0, {
4685
- year: "numeric",
4686
- month: "long",
4687
- day: "numeric"
4688
- }) : `${l} ${new Date(l, a).toLocaleString(void 0, { month: "long" })}` }),
4689
- /* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
4690
- /* @__PURE__ */ n.jsx(
4691
- le,
4692
- {
4693
- variant: "ghost",
4694
- size: "sm",
4695
- "aria-label": "Previous month",
4696
- onClick: () => {
4697
- const v = a === 0 ? 11 : a - 1, w = a === 0 ? l - 1 : l;
4698
- i(v), c(w), r?.(new Date(w, v, 1));
4699
- },
4700
- children: /* @__PURE__ */ n.jsx(jr, { className: "h-4 w-4" })
4701
- }
4702
- ),
4703
- /* @__PURE__ */ n.jsx(
4704
- le,
4705
- {
4706
- variant: "ghost",
4707
- size: "sm",
4708
- "aria-label": "Next month",
4709
- onClick: () => {
4710
- const v = a === 11 ? 0 : a + 1, w = a === 11 ? l + 1 : l;
4711
- i(v), c(w), r?.(new Date(w, v, 1));
4712
- },
4713
- children: /* @__PURE__ */ n.jsx(Nr, { className: "h-4 w-4" })
4714
- }
4715
- )
4716
- ] })
4717
- ] }), b = () => /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-7 px-4 text-xs text-slate-500 mb-1", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((v) => /* @__PURE__ */ n.jsx("div", { className: "flex items-center justify-center h-6", children: v }, v)) }), m = () => {
4718
- const v = [], w = f(l, a), C = d(l, a), R = d(l, a - 1 < 0 ? 11 : a - 1);
4719
- for (let N = 0; N < w; N++)
4720
- v.push(
4721
- /* @__PURE__ */ n.jsx(
4722
- le,
4723
- {
4724
- size: "sm",
4725
- "aria-label": "Previous month day",
4726
- variant: "ghost",
4727
- className: "text-slate-300",
4728
- onClick: () => {
4729
- const M = a === 0 ? 11 : a - 1, F = a === 0 ? l - 1 : l, L = R - w + N + 1;
4730
- r?.(new Date(F, M, L)), i(M), c(F);
4731
- },
4732
- children: R - w + N + 1
4733
- },
4734
- "prev-" + N
4735
- )
4736
- );
4737
- for (let N = 1; N <= C; N++) {
4738
- const M = e && e.getFullYear() === l && e.getMonth() === a && e.getDate() === N;
4739
- v.push(
4740
- /* @__PURE__ */ n.jsx(
4741
- le,
4742
- {
4743
- variant: M ? "primary" : "ghost",
4744
- size: "sm",
4745
- "aria-label": `Select ${l}-${a + 1}-${N}`,
4746
- "aria-current": M ? "date" : void 0,
4747
- onClick: () => r?.(new Date(l, a, N)),
4748
- children: N
4749
- },
4750
- N
4751
- )
4752
- );
4753
- }
4754
- const A = w + C;
4755
- for (let N = 0; N < (A % 7 === 0 ? 0 : 7 - A % 7); N++)
4756
- v.push(
4757
- /* @__PURE__ */ n.jsx(
4758
- le,
4759
- {
4760
- size: "sm",
4761
- "aria-label": "Next month day",
4762
- variant: "ghost",
4763
- className: "text-slate-300",
4764
- onClick: () => {
4765
- const M = a === 11 ? 0 : a + 1, F = a === 11 ? l + 1 : l, L = N + 1;
4766
- r?.(new Date(F, M, L)), i(M), c(F);
4767
- },
4768
- children: N + 1
4769
- },
4770
- "next-" + N
4771
- )
4772
- );
4773
- return /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
4774
- };
4775
- return /* @__PURE__ */ n.jsxs("div", { className: p("select-none", t), ...o, children: [
4776
- g(),
4777
- b(),
4778
- m()
4779
- ] });
4780
- }, ur = Object.assign(fo, {}), bo = ({
4775
+ }, Ie = Object.assign(fo, {
4776
+ Trigger: ao,
4777
+ Content: io,
4778
+ Item: lo
4779
+ }), bo = ({
4781
4780
  open: e,
4782
4781
  value: r,
4783
4782
  onChange: t,
4784
4783
  handleMenuClose: o
4785
4784
  }) => /* @__PURE__ */ n.jsxs(Ie, { isOpen: e, onOutsideClick: o, children: [
4786
4785
  /* @__PURE__ */ n.jsx(Ie.Trigger, { className: "absolute top-[90%] left-0", children: /* @__PURE__ */ n.jsx("span", { "aria-hidden": "true" }) }),
4787
- /* @__PURE__ */ n.jsx(Ie.Content, { className: "drop-shadow-lg rounded-lg bg-white border border-neutral", children: /* @__PURE__ */ n.jsx(ur, { value: r, onChange: t }) })
4786
+ /* @__PURE__ */ n.jsx(Ie.Content, { className: "drop-shadow-lg rounded-lg bg-white border border-neutral", children: /* @__PURE__ */ n.jsx(or, { value: r, onChange: t }) })
4788
4787
  ] }), mo = ({
4789
4788
  open: e,
4790
4789
  setOpen: r,
@@ -4815,7 +4814,7 @@ const go = ({
4815
4814
  disableOverlayClose: !1,
4816
4815
  disableEscClose: !1,
4817
4816
  children: [
4818
- /* @__PURE__ */ n.jsx(ze.Body, { className: "px-2", children: /* @__PURE__ */ n.jsx(ur, { value: i, onChange: l }) }),
4817
+ /* @__PURE__ */ n.jsx(ze.Body, { className: "px-2", children: /* @__PURE__ */ n.jsx(or, { value: i, onChange: l }) }),
4819
4818
  /* @__PURE__ */ n.jsxs(ze.Footer, { className: "px-6", children: [
4820
4819
  /* @__PURE__ */ n.jsx(
4821
4820
  Ge,
@@ -4906,7 +4905,7 @@ const Gs = I.forwardRef(
4906
4905
  }
4907
4906
  ),
4908
4907
  /* @__PURE__ */ n.jsx(
4909
- cr,
4908
+ dr,
4910
4909
  {
4911
4910
  ref: (_) => {
4912
4911
  R.current = _, typeof m == "function" ? m(_) : m && (m.current = _);
@@ -6344,7 +6343,7 @@ const ts = ({
6344
6343
  "aria-disabled": l,
6345
6344
  disabled: l,
6346
6345
  className: p(
6347
- lr({
6346
+ cr({
6348
6347
  variant: m ? "danger" : e
6349
6348
  }),
6350
6349
  t ? "pl-9" : "pl-3",
@@ -6967,6 +6966,7 @@ export {
6967
6966
  Ge as Button,
6968
6967
  Fs as ButtonFloat,
6969
6968
  le as ButtonIcon,
6969
+ or as Calendar,
6970
6970
  Ls as CheckboxInput,
6971
6971
  $s as ChipInput,
6972
6972
  Gs as DateSinglePickerInput,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "React UI library with Tailwind CSS",
5
5
  "author": "Dimas Bagus Prayogo Mukti<dimas.bagus.pm@gmail.com>",
6
6
  "license": "MIT",