@devalok/shilp-sutra 0.4.2 → 0.6.0

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 (43) hide show
  1. package/dist/composed/command-palette.d.ts +1 -2
  2. package/dist/composed/command-palette.d.ts.map +1 -1
  3. package/dist/composed/command-palette.js +27 -33
  4. package/dist/composed/date-picker/calendar-grid.d.ts +7 -0
  5. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  6. package/dist/composed/date-picker/calendar-grid.js +92 -72
  7. package/dist/composed/date-picker/index.d.ts +1 -1
  8. package/dist/composed/date-picker/index.d.ts.map +1 -1
  9. package/dist/composed/empty-state.d.ts +1 -2
  10. package/dist/composed/empty-state.d.ts.map +1 -1
  11. package/dist/composed/empty-state.js +67 -56
  12. package/dist/composed/index.d.ts +5 -1
  13. package/dist/composed/index.d.ts.map +1 -1
  14. package/dist/composed/index.js +42 -38
  15. package/dist/composed/page-header.d.ts +1 -1
  16. package/dist/composed/page-header.d.ts.map +1 -1
  17. package/dist/composed/page-header.js +63 -59
  18. package/dist/composed/schedule-view.d.ts +26 -0
  19. package/dist/composed/schedule-view.d.ts.map +1 -0
  20. package/dist/composed/schedule-view.js +183 -0
  21. package/dist/composed/simple-tooltip.d.ts +15 -0
  22. package/dist/composed/simple-tooltip.d.ts.map +1 -0
  23. package/dist/composed/simple-tooltip.js +17 -0
  24. package/dist/composed/status-badge.d.ts +2 -1
  25. package/dist/composed/status-badge.d.ts.map +1 -1
  26. package/dist/composed/status-badge.js +37 -22
  27. package/dist/shell/app-command-palette.js +87 -87
  28. package/dist/shell/bottom-navbar.d.ts +1 -3
  29. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  30. package/dist/shell/bottom-navbar.js +37 -37
  31. package/dist/shell/notification-preferences.d.ts.map +1 -1
  32. package/dist/shell/notification-preferences.js +31 -31
  33. package/dist/shell/sidebar.d.ts +1 -3
  34. package/dist/shell/sidebar.d.ts.map +1 -1
  35. package/dist/shell/sidebar.js +6 -6
  36. package/dist/ui/alert.d.ts +3 -0
  37. package/dist/ui/alert.d.ts.map +1 -1
  38. package/dist/ui/alert.js +56 -31
  39. package/dist/ui/charts/index.js +21 -0
  40. package/dist/ui/index.d.ts +0 -3
  41. package/dist/ui/index.d.ts.map +1 -1
  42. package/dist/ui/index.js +253 -275
  43. package/package.json +210 -208
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import { Icon as TablerIcon } from '@tabler/icons-react';
3
2
  /**
4
3
  * CommandPalette -- Keyboard-driven command palette (Ctrl+K / Cmd+K).
5
4
  *
@@ -11,7 +10,7 @@ export interface CommandItem {
11
10
  id: string;
12
11
  label: string;
13
12
  description?: string;
14
- icon?: TablerIcon;
13
+ icon?: React.ReactNode;
15
14
  shortcut?: string;
16
15
  onSelect: () => void;
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/composed/command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAU9B,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAQ7D,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAMD,QAAA,MAAM,cAAc,4FA0RnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/composed/command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAMD,QAAA,MAAM,cAAc,4FAuRnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { jsx as s, jsxs as a } from "react/jsx-runtime";
3
3
  import * as r from "react";
4
- import { Dialog as E, DialogPortal as A, DialogOverlay as M, DialogContentRaw as R, DialogTitle as L, DialogDescription as S } from "../ui/dialog.js";
5
- import { IconSearch as K, IconCornerDownLeft as g, IconArrowUp as P, IconArrowDown as q } from "@tabler/icons-react";
4
+ import { Dialog as I, DialogPortal as E, DialogOverlay as A, DialogContentRaw as M, DialogTitle as R, DialogDescription as L } from "../ui/dialog.js";
5
+ import { IconSearch as S, IconCornerDownLeft as g, IconArrowUp as K, IconArrowDown as P } from "@tabler/icons-react";
6
6
  import { cn as u } from "../ui/lib/utils.js";
7
- import { VisuallyHidden as z } from "../ui/visually-hidden.js";
8
- const O = r.forwardRef(
7
+ import { VisuallyHidden as q } from "../ui/visually-hidden.js";
8
+ const z = r.forwardRef(
9
9
  function({
10
10
  groups: p = [],
11
- placeholder: k = "Search or jump to...",
11
+ placeholder: w = "Search or jump to...",
12
12
  onSearch: x,
13
- emptyMessage: v = "No results found."
14
- }, D) {
13
+ emptyMessage: k = "No results found."
14
+ }, v) {
15
15
  const [f, n] = r.useState(!1), [i, b] = r.useState(""), [m, c] = r.useState(0), y = r.useRef(null), N = r.useRef(null), l = r.useMemo(() => {
16
16
  if (!i.trim()) return p;
17
17
  const t = i.toLowerCase();
@@ -39,7 +39,7 @@ const O = r.forwardRef(
39
39
  (t = y.current) == null || t.focus();
40
40
  }));
41
41
  }, [f]);
42
- const C = (t) => {
42
+ const D = (t) => {
43
43
  switch (t.key) {
44
44
  case "ArrowDown": {
45
45
  t.preventDefault(), c(
@@ -72,7 +72,7 @@ const O = r.forwardRef(
72
72
  );
73
73
  t == null || t.scrollIntoView({ block: "nearest" });
74
74
  }, [m]);
75
- const I = (t) => {
75
+ const C = (t) => {
76
76
  b(t), c(0), x == null || x(t);
77
77
  }, j = r.useMemo(() => {
78
78
  const t = /* @__PURE__ */ new Map();
@@ -82,17 +82,17 @@ const O = r.forwardRef(
82
82
  t.set(o.id, e++);
83
83
  return t;
84
84
  }, [l]);
85
- return /* @__PURE__ */ s(E, { open: f, onOpenChange: n, children: /* @__PURE__ */ a(A, { children: [
85
+ return /* @__PURE__ */ s(I, { open: f, onOpenChange: n, children: /* @__PURE__ */ a(E, { children: [
86
86
  /* @__PURE__ */ s(
87
- M,
87
+ A,
88
88
  {
89
89
  className: "fixed inset-0 z-overlay bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
90
90
  }
91
91
  ),
92
92
  /* @__PURE__ */ a(
93
- R,
93
+ M,
94
94
  {
95
- ref: D,
95
+ ref: v,
96
96
  className: u(
97
97
  "fixed left-1/2 top-[20%] z-modal w-full max-w-[560px] -translate-x-1/2",
98
98
  "overflow-hidden rounded-ds-xl border border-border bg-layer-01 shadow-05",
@@ -102,15 +102,15 @@ const O = r.forwardRef(
102
102
  "data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2",
103
103
  "data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2"
104
104
  ),
105
- onKeyDown: C,
105
+ onKeyDown: D,
106
106
  children: [
107
- /* @__PURE__ */ a(z, { children: [
108
- /* @__PURE__ */ s(L, { children: "Command Palette" }),
109
- /* @__PURE__ */ s(S, { children: "Search or jump to pages, projects, tasks, and actions" })
107
+ /* @__PURE__ */ a(q, { children: [
108
+ /* @__PURE__ */ s(R, { children: "Command Palette" }),
109
+ /* @__PURE__ */ s(L, { children: "Search or jump to pages, projects, tasks, and actions" })
110
110
  ] }),
111
111
  /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-04 border-b border-border px-ds-05 py-ds-04", children: [
112
112
  /* @__PURE__ */ s(
113
- K,
113
+ S,
114
114
  {
115
115
  className: "h-ico-sm w-ico-sm shrink-0 text-text-placeholder",
116
116
  stroke: 1.5
@@ -121,8 +121,8 @@ const O = r.forwardRef(
121
121
  {
122
122
  ref: y,
123
123
  value: i,
124
- onChange: (t) => I(t.target.value),
125
- placeholder: k,
124
+ onChange: (t) => C(t.target.value),
125
+ placeholder: w,
126
126
  className: u(
127
127
  "flex-1 bg-transparent text-ds-base text-text-primary outline-none",
128
128
  "placeholder:text-text-placeholder"
@@ -140,11 +140,11 @@ const O = r.forwardRef(
140
140
  ref: N,
141
141
  className: "max-h-[320px] overflow-y-auto px-ds-03 py-ds-03",
142
142
  children: [
143
- l.length === 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-center py-ds-07", children: /* @__PURE__ */ s("p", { className: "text-ds-md text-text-placeholder", children: v }) }),
143
+ l.length === 0 && /* @__PURE__ */ s("div", { className: "flex items-center justify-center py-ds-07", children: /* @__PURE__ */ s("p", { className: "text-ds-md text-text-placeholder", children: k }) }),
144
144
  l.map((t) => /* @__PURE__ */ a("div", { className: "mb-ds-02", children: [
145
145
  /* @__PURE__ */ s("div", { className: "px-ds-03 pb-ds-02 pt-ds-03", children: /* @__PURE__ */ s("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: t.label }) }),
146
146
  t.items.map((e) => {
147
- const d = j.get(e.id) ?? 0, o = d === m, w = e.icon;
147
+ const d = j.get(e.id) ?? 0, o = d === m;
148
148
  return /* @__PURE__ */ a(
149
149
  "button",
150
150
  {
@@ -159,13 +159,7 @@ const O = r.forwardRef(
159
159
  o ? "bg-layer-03 text-text-primary" : "text-text-secondary hover:bg-layer-02"
160
160
  ),
161
161
  children: [
162
- w && /* @__PURE__ */ s(
163
- w,
164
- {
165
- className: "h-ico-sm w-ico-sm shrink-0 text-text-placeholder",
166
- stroke: 1.5
167
- }
168
- ),
162
+ e.icon && /* @__PURE__ */ s("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0 text-text-placeholder", "aria-hidden": "true", children: e.icon }),
169
163
  /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col", children: [
170
164
  /* @__PURE__ */ s("span", { className: "text-ds-md", children: e.label }),
171
165
  e.description && /* @__PURE__ */ s("span", { className: "text-ds-sm text-text-placeholder", children: e.description })
@@ -190,8 +184,8 @@ const O = r.forwardRef(
190
184
  /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-05 border-t border-border px-ds-05 py-ds-03", children: [
191
185
  /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02b", children: [
192
186
  /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-01", children: [
193
- /* @__PURE__ */ s("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-border bg-layer-02", children: /* @__PURE__ */ s(P, { className: "h-ds-03 w-ds-03 text-text-placeholder", stroke: 2 }) }),
194
- /* @__PURE__ */ s("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-border bg-layer-02", children: /* @__PURE__ */ s(q, { className: "h-ds-03 w-ds-03 text-text-placeholder", stroke: 2 }) })
187
+ /* @__PURE__ */ s("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-border bg-layer-02", children: /* @__PURE__ */ s(K, { className: "h-ds-03 w-ds-03 text-text-placeholder", stroke: 2 }) }),
188
+ /* @__PURE__ */ s("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-border bg-layer-02", children: /* @__PURE__ */ s(P, { className: "h-ds-03 w-ds-03 text-text-placeholder", stroke: 2 }) })
195
189
  ] }),
196
190
  /* @__PURE__ */ s("span", { className: "text-ds-xs text-text-placeholder", children: "Navigate" })
197
191
  ] }),
@@ -210,7 +204,7 @@ const O = r.forwardRef(
210
204
  ] }) });
211
205
  }
212
206
  );
213
- O.displayName = "CommandPalette";
207
+ z.displayName = "CommandPalette";
214
208
  export {
215
- O as CommandPalette
209
+ z as CommandPalette
216
210
  };
@@ -1,5 +1,10 @@
1
1
  "use client";
2
2
  import * as React from 'react';
3
+ export interface CalendarEvent {
4
+ date: Date;
5
+ color?: string;
6
+ label?: string;
7
+ }
3
8
  export interface CalendarGridProps {
4
9
  currentMonth: Date;
5
10
  selected?: Date | null;
@@ -17,6 +22,8 @@ export interface CalendarGridProps {
17
22
  hidePrevNav?: boolean;
18
23
  /** Hide the next-month navigation arrow */
19
24
  hideNextNav?: boolean;
25
+ /** Events to display as dot indicators on dates */
26
+ events?: CalendarEvent[];
20
27
  }
21
28
  export declare const CalendarGrid: React.ForwardRefExoticComponent<CalendarGridProps & React.RefAttributes<HTMLDivElement>>;
22
29
  //# sourceMappingURL=calendar-grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-grid.d.ts","sourceRoot":"","sources":["../../../src/composed/date-picker/calendar-grid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuB9B,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,IAAI,CAAA;IAClB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;IACrC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACnC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAA;IACvC,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,eAAO,MAAM,YAAY,0FA6NxB,CAAA"}
1
+ {"version":3,"file":"calendar-grid.d.ts","sourceRoot":"","sources":["../../../src/composed/date-picker/calendar-grid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuB9B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,IAAI,CAAA;IAClB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;IACrC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACnC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAA;IACvC,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,aAAa,EAAE,CAAA;CACzB;AAED,eAAO,MAAM,YAAY,0FAyPxB,CAAA"}
@@ -1,127 +1,136 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as i } from "react/jsx-runtime";
3
- import * as g from "react";
4
- import { startOfMonth as v, endOfMonth as S, startOfWeek as V, endOfWeek as X, addDays as f, subMonths as Z, format as m, addMonths as _, isSameMonth as D, isSameDay as y, lastDayOfMonth as H, isBefore as k, startOfDay as W, isAfter as M, isWithinInterval as T } from "date-fns";
5
- import { IconChevronLeft as ee, IconChevronRight as te } from "@tabler/icons-react";
6
- import { cn as G } from "../../ui/lib/utils.js";
7
- const se = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], re = g.forwardRef(
2
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
3
+ import * as M from "react";
4
+ import { format as l, startOfMonth as k, endOfMonth as ee, startOfWeek as te, endOfWeek as se, addDays as m, subMonths as re, addMonths as ne, isSameMonth as T, isSameDay as x, lastDayOfMonth as oe, isBefore as N, startOfDay as G, isAfter as g, isWithinInterval as L } from "date-fns";
5
+ import { IconChevronLeft as ae, IconChevronRight as ie } from "@tabler/icons-react";
6
+ import { cn as B } from "../../ui/lib/utils.js";
7
+ const de = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], ce = M.forwardRef(
8
8
  function({
9
- currentMonth: a,
10
- selected: N,
9
+ currentMonth: i,
10
+ selected: R,
11
11
  rangeStart: n,
12
12
  rangeEnd: d,
13
- hoverDate: l,
14
- onSelect: R,
13
+ hoverDate: u,
14
+ onSelect: j,
15
15
  onHover: c,
16
- onMonthChange: x,
17
- onHeaderClick: j,
16
+ onMonthChange: h,
17
+ onHeaderClick: C,
18
18
  disabledDates: b,
19
19
  minDate: A,
20
- maxDate: C,
21
- hidePrevNav: K,
22
- hideNextNav: L
23
- }, q) {
24
- const h = g.useRef(null), B = v(a), F = S(a), P = V(B), U = X(F), E = [];
25
- let p = P;
26
- for (; p <= U; )
27
- E.push(p), p = f(p, 1);
28
- const I = (e) => !!(b != null && b(e) || A && k(e, W(A)) || C && M(e, W(C))), Y = (e) => {
20
+ maxDate: E,
21
+ hidePrevNav: q,
22
+ hideNextNav: F,
23
+ events: w
24
+ }, P) {
25
+ const v = M.useRef(null), U = M.useMemo(() => {
26
+ const e = /* @__PURE__ */ new Map();
27
+ if (!w) return e;
28
+ for (const o of w) {
29
+ const t = l(o.date, "yyyy-MM-dd"), s = e.get(t) ?? [];
30
+ s.push(o), e.set(t, s);
31
+ }
32
+ return e;
33
+ }, [w]), Y = k(i), $ = ee(i), z = te(Y), J = se($), D = [];
34
+ let p = z;
35
+ for (; p <= J; )
36
+ D.push(p), p = m(p, 1);
37
+ const I = (e) => !!(b != null && b(e) || A && N(e, G(A)) || E && g(e, G(E))), Q = (e) => {
29
38
  if (n && d) {
30
- const o = k(n, d) ? n : d, t = M(d, n) ? d : n;
31
- return T(e, { start: o, end: t });
39
+ const o = N(n, d) ? n : d, t = g(d, n) ? d : n;
40
+ return L(e, { start: o, end: t });
32
41
  }
33
- if (n && l) {
34
- const o = k(n, l) ? n : l, t = M(l, n) ? l : n;
35
- return T(e, { start: o, end: t });
42
+ if (n && u) {
43
+ const o = N(n, u) ? n : u, t = g(u, n) ? u : n;
44
+ return L(e, { start: o, end: t });
36
45
  }
37
46
  return !1;
38
- }, $ = (e) => !!(n && y(e, n) || d && y(e, d)), z = (e) => {
39
- if (!h.current) return;
40
- const o = m(e, "yyyy-MM-dd"), t = h.current.querySelector(
47
+ }, S = (e) => !!(n && x(e, n) || d && x(e, d)), V = (e) => {
48
+ if (!v.current) return;
49
+ const o = l(e, "yyyy-MM-dd"), t = v.current.querySelector(
41
50
  `[data-date="${o}"]`
42
51
  );
43
- t ? t.focus() : x(v(e));
44
- }, J = (e) => {
52
+ t ? t.focus() : h(k(e));
53
+ }, X = (e) => {
45
54
  const t = e.target.getAttribute("data-date");
46
55
  if (!t) return;
47
56
  const s = /* @__PURE__ */ new Date(t + "T00:00:00");
48
57
  let r = null;
49
58
  switch (e.key) {
50
59
  case "ArrowLeft":
51
- r = f(s, -1);
60
+ r = m(s, -1);
52
61
  break;
53
62
  case "ArrowRight":
54
- r = f(s, 1);
63
+ r = m(s, 1);
55
64
  break;
56
65
  case "ArrowUp":
57
- r = f(s, -7);
66
+ r = m(s, -7);
58
67
  break;
59
68
  case "ArrowDown":
60
- r = f(s, 7);
69
+ r = m(s, 7);
61
70
  break;
62
71
  case "Home":
63
- r = v(s);
72
+ r = k(s);
64
73
  break;
65
74
  case "End":
66
- r = H(s);
75
+ r = oe(s);
67
76
  break;
68
77
  case "Enter":
69
78
  case " ": {
70
- e.preventDefault(), !I(s) && D(s, a) && R(s);
79
+ e.preventDefault(), !I(s) && T(s, i) && j(s);
71
80
  return;
72
81
  }
73
82
  default:
74
83
  return;
75
84
  }
76
- r && (e.preventDefault(), z(r));
85
+ r && (e.preventDefault(), V(r));
77
86
  };
78
- return /* @__PURE__ */ w("div", { ref: q, className: "w-[252px]", children: [
79
- /* @__PURE__ */ w("div", { className: "flex items-center justify-between px-ds-02 pb-ds-04", children: [
80
- K ? /* @__PURE__ */ i("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ i(
87
+ return /* @__PURE__ */ y("div", { ref: P, className: "w-[252px]", children: [
88
+ /* @__PURE__ */ y("div", { className: "flex items-center justify-between px-ds-02 pb-ds-04", children: [
89
+ q ? /* @__PURE__ */ a("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ a(
81
90
  "button",
82
91
  {
83
92
  type: "button",
84
- onClick: () => x(Z(a, 1)),
93
+ onClick: () => h(re(i, 1)),
85
94
  className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-text-placeholder transition-colors duration-fast-01 ease-productive-standard hover:bg-field hover:text-text-secondary",
86
95
  "aria-label": "Previous month",
87
- children: /* @__PURE__ */ i(ee, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
96
+ children: /* @__PURE__ */ a(ae, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
88
97
  }
89
98
  ),
90
- /* @__PURE__ */ i(
99
+ /* @__PURE__ */ a(
91
100
  "button",
92
101
  {
93
102
  type: "button",
94
- onClick: j,
95
- className: G(
103
+ onClick: C,
104
+ className: B(
96
105
  "text-ds-md font-semibold text-text-primary",
97
- j && "cursor-pointer rounded-ds-md px-ds-02 transition-colors duration-fast-01 ease-productive-standard hover:bg-field"
106
+ C && "cursor-pointer rounded-ds-md px-ds-02 transition-colors duration-fast-01 ease-productive-standard hover:bg-field"
98
107
  ),
99
108
  "aria-label": "Switch to month/year view",
100
- children: m(a, "MMMM yyyy")
109
+ children: l(i, "MMMM yyyy")
101
110
  }
102
111
  ),
103
- L ? /* @__PURE__ */ i("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ i(
112
+ F ? /* @__PURE__ */ a("span", { className: "h-ds-xs-plus w-ds-xs-plus" }) : /* @__PURE__ */ a(
104
113
  "button",
105
114
  {
106
115
  type: "button",
107
- onClick: () => x(_(a, 1)),
116
+ onClick: () => h(ne(i, 1)),
108
117
  className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-text-placeholder transition-colors duration-fast-01 ease-productive-standard hover:bg-field hover:text-text-secondary",
109
118
  "aria-label": "Next month",
110
- children: /* @__PURE__ */ i(te, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
119
+ children: /* @__PURE__ */ a(ie, { className: "h-ico-sm w-ico-sm", stroke: 1.5 })
111
120
  }
112
121
  )
113
122
  ] }),
114
- /* @__PURE__ */ w(
123
+ /* @__PURE__ */ y(
115
124
  "div",
116
125
  {
117
- ref: h,
126
+ ref: v,
118
127
  className: "grid grid-cols-7 gap-0",
119
128
  role: "grid",
120
129
  tabIndex: 0,
121
130
  "aria-label": "Calendar",
122
- onKeyDown: J,
131
+ onKeyDown: X,
123
132
  children: [
124
- se.map((e) => /* @__PURE__ */ i(
133
+ de.map((e) => /* @__PURE__ */ a(
125
134
  "div",
126
135
  {
127
136
  role: "columnheader",
@@ -130,34 +139,45 @@ const se = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], re = g.forwardRef(
130
139
  },
131
140
  e
132
141
  )),
133
- E.map((e, o) => {
134
- const t = D(e, a), s = I(e), r = N && y(e, N), O = Y(e), u = $(e), Q = y(e, /* @__PURE__ */ new Date());
135
- return /* @__PURE__ */ i(
142
+ D.map((e, o) => {
143
+ const t = T(e, i), s = I(e), r = R && x(e, R), O = Q(e), f = S(e), Z = x(e, /* @__PURE__ */ new Date()), W = l(e, "yyyy-MM-dd"), K = U.get(W) ?? [];
144
+ return /* @__PURE__ */ y(
136
145
  "button",
137
146
  {
138
147
  type: "button",
139
148
  role: "gridcell",
140
- "data-date": m(e, "yyyy-MM-dd"),
149
+ "data-date": W,
141
150
  tabIndex: t && !s ? 0 : -1,
142
151
  disabled: !t || s,
143
152
  onClick: () => {
144
- t && !s && R(e);
153
+ t && !s && j(e);
145
154
  },
146
155
  onMouseEnter: () => c == null ? void 0 : c(e),
147
156
  onMouseLeave: () => c == null ? void 0 : c(null),
148
- "aria-label": m(e, "EEEE, MMMM d, yyyy"),
149
- "aria-selected": r || u || void 0,
157
+ "aria-label": l(e, "EEEE, MMMM d, yyyy"),
158
+ "aria-selected": r || f || void 0,
150
159
  "aria-disabled": !t || s || void 0,
151
- className: G(
152
- "flex h-ds-sm w-ds-sm-plus items-center justify-center rounded-ds-md text-ds-md font-body transition-colors duration-fast-01 ease-productive-standard",
160
+ className: B(
161
+ "relative flex h-ds-sm w-ds-sm-plus items-center justify-center rounded-ds-md text-ds-md font-body transition-colors duration-fast-01 ease-productive-standard",
153
162
  !t && "pointer-events-none opacity-0",
154
163
  t && s && "opacity-[0.38] pointer-events-none cursor-not-allowed",
155
- t && !s && !r && !u && !O && "text-text-primary hover:bg-field",
156
- O && !u && "rounded-ds-none bg-field text-text-primary",
157
- (r || u) && "bg-interactive text-text-on-color hover:bg-interactive-hover",
158
- Q && !r && !u && !s && "font-semibold text-interactive"
164
+ t && !s && !r && !f && !O && "text-text-primary hover:bg-field",
165
+ O && !f && "rounded-ds-none bg-field text-text-primary",
166
+ (r || f) && "bg-interactive text-text-on-color hover:bg-interactive-hover",
167
+ Z && !r && !f && !s && "font-semibold text-interactive"
159
168
  ),
160
- children: m(e, "d")
169
+ children: [
170
+ l(e, "d"),
171
+ K.length > 0 && /* @__PURE__ */ a("span", { className: "flex gap-px justify-center absolute bottom-[2px] left-0 right-0", children: K.slice(0, 3).map((_, H) => /* @__PURE__ */ a(
172
+ "span",
173
+ {
174
+ "data-event-dot": !0,
175
+ className: "h-[4px] w-[4px] rounded-ds-full",
176
+ style: { backgroundColor: _.color ?? "var(--color-interactive)" }
177
+ },
178
+ H
179
+ )) })
180
+ ]
161
181
  },
162
182
  o
163
183
  );
@@ -168,7 +188,7 @@ const se = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], re = g.forwardRef(
168
188
  ] });
169
189
  }
170
190
  );
171
- re.displayName = "CalendarGrid";
191
+ ce.displayName = "CalendarGrid";
172
192
  export {
173
- re as CalendarGrid
193
+ ce as CalendarGrid
174
194
  };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  export { CalendarGrid } from './calendar-grid';
3
- export type { CalendarGridProps } from './calendar-grid';
3
+ export type { CalendarGridProps, CalendarEvent } from './calendar-grid';
4
4
  export { DatePicker } from './date-picker';
5
5
  export type { DatePickerProps } from './date-picker';
6
6
  export { DateRangePicker } from './date-range-picker';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composed/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composed/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
@@ -1,7 +1,6 @@
1
- import { Icon as TablerIcon } from '@tabler/icons-react';
2
1
  import * as React from 'react';
3
2
  export interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
4
- icon?: TablerIcon;
3
+ icon?: React.ReactNode;
5
4
  title: string;
6
5
  description?: string;
7
6
  action?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/composed/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAG7D,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,UAAU,wFA+Df,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/composed/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAcD,QAAA,MAAM,UAAU,wFAkEf,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1,72 +1,83 @@
1
- import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
- import * as c from "react";
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import * as n from "react";
3
3
  import { cn as t } from "../ui/lib/utils.js";
4
- import { IconInbox as n } from "@tabler/icons-react";
5
- const f = c.forwardRef(
4
+ const h = ({ className: c }) => /* @__PURE__ */ e(
5
+ "svg",
6
+ {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "0 0 32 32",
9
+ fill: "currentColor",
10
+ className: c,
11
+ "aria-hidden": "true",
12
+ children: /* @__PURE__ */ e("path", { d: "M25.97,21.39c-0.9-1.85,0.08-3.95-1.72-5.39c1.76-1.44,0.8-3.55,1.69-5.39c0.05-0.12,0.04-0.25-0.02-0.35c-0.06-0.1-0.16-0.18-0.29-0.19c-2.05-0.15-3.35-2.04-5.5-1.21c-0.39-2.21-2.7-2.44-3.84-4.13c-0.08-0.1-0.19-0.16-0.31-0.16c-0.12,0-0.23,0.05-0.31,0.16c-1.14,1.69-3.43,1.92-3.82,4.13c-2.14-0.83-3.47,1.07-5.52,1.21c-0.13,0.01-0.23,0.09-0.29,0.19c-0.06,0.1-0.07,0.23-0.02,0.35c0.9,1.85-0.08,3.95,1.72,5.39c-1.76,1.44-0.8,3.55-1.69,5.39C6,21.51,6.02,21.64,6.07,21.74c0.06,0.1,0.16,0.18,0.29,0.19c2.05,0.15,3.38,2.06,5.52,1.23c0.39,2.21,2.67,2.43,3.82,4.12c0.08,0.1,0.19,0.16,0.31,0.16c0.12,0,0.23-0.05,0.31-0.16c1.14-1.69,3.42-1.92,3.81-4.13c2.14,0.83,3.48-1.07,5.53-1.22c0.13-0.01,0.23-0.09,0.29-0.19C26.01,21.64,26.02,21.51,25.97,21.39z" })
13
+ }
14
+ ), f = n.forwardRef(
6
15
  ({
7
- icon: m = n,
16
+ icon: c,
8
17
  title: a,
9
18
  description: d,
10
19
  action: l,
11
- compact: e = !1,
20
+ compact: s = !1,
12
21
  className: i,
13
- ...x
14
- }, o) => /* @__PURE__ */ r(
15
- "div",
16
- {
17
- ref: o,
18
- className: t(
19
- "flex flex-col items-center justify-center text-center",
20
- e ? "gap-ds-04 py-ds-07" : "gap-ds-05 py-ds-10",
21
- i
22
- ),
23
- ...x,
24
- children: [
25
- /* @__PURE__ */ s(
26
- "div",
27
- {
28
- className: t(
29
- "flex items-center justify-center rounded-ds-xl bg-layer-02",
30
- e ? "h-ds-md w-ds-md" : "h-ds-lg w-ds-lg"
22
+ ...m
23
+ }, o) => {
24
+ const x = c ?? /* @__PURE__ */ e(
25
+ h,
26
+ {
27
+ className: t(
28
+ "text-text-placeholder",
29
+ s ? "h-ico-md w-ico-md" : "h-ico-lg w-ico-lg"
30
+ )
31
+ }
32
+ );
33
+ return /* @__PURE__ */ r(
34
+ "div",
35
+ {
36
+ ref: o,
37
+ className: t(
38
+ "flex flex-col items-center justify-center text-center",
39
+ s ? "gap-ds-04 py-ds-07" : "gap-ds-05 py-ds-10",
40
+ i
41
+ ),
42
+ ...m,
43
+ children: [
44
+ /* @__PURE__ */ e(
45
+ "div",
46
+ {
47
+ className: t(
48
+ "flex items-center justify-center rounded-ds-xl bg-layer-02",
49
+ s ? "h-ds-md w-ds-md" : "h-ds-lg w-ds-lg"
50
+ ),
51
+ children: x
52
+ }
53
+ ),
54
+ /* @__PURE__ */ r("div", { className: "flex max-w-[280px] flex-col gap-ds-02", children: [
55
+ /* @__PURE__ */ e(
56
+ "h3",
57
+ {
58
+ className: t(
59
+ "text-text-primary",
60
+ s ? "text-ds-md font-semibold" : "text-ds-base font-semibold"
61
+ ),
62
+ children: a
63
+ }
31
64
  ),
32
- children: /* @__PURE__ */ s(
33
- m,
65
+ d && /* @__PURE__ */ e(
66
+ "p",
34
67
  {
35
68
  className: t(
36
69
  "text-text-placeholder",
37
- e ? "h-ico-md w-ico-md" : "h-ico-lg w-ico-lg"
70
+ s ? "text-ds-sm" : "text-ds-md"
38
71
  ),
39
- stroke: 1.5
72
+ children: d
40
73
  }
41
74
  )
42
- }
43
- ),
44
- /* @__PURE__ */ r("div", { className: "flex max-w-[280px] flex-col gap-ds-02", children: [
45
- /* @__PURE__ */ s(
46
- "h3",
47
- {
48
- className: t(
49
- "text-text-primary",
50
- e ? "text-ds-md font-semibold" : "text-ds-base font-semibold"
51
- ),
52
- children: a
53
- }
54
- ),
55
- d && /* @__PURE__ */ s(
56
- "p",
57
- {
58
- className: t(
59
- "text-text-placeholder",
60
- e ? "text-ds-sm" : "text-ds-md"
61
- ),
62
- children: d
63
- }
64
- )
65
- ] }),
66
- l && /* @__PURE__ */ s("div", { className: "mt-ds-02", children: l })
67
- ]
68
- }
69
- )
75
+ ] }),
76
+ l && /* @__PURE__ */ e("div", { className: "mt-ds-02", children: l })
77
+ ]
78
+ }
79
+ );
80
+ }
70
81
  );
71
82
  f.displayName = "EmptyState";
72
83
  export {