@devalok/shilp-sutra 0.1.0 → 0.2.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.
- package/dist/composed/avatar-group.d.ts +1 -0
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +1 -0
- package/dist/composed/command-palette.d.ts +1 -0
- package/dist/composed/command-palette.js +4 -3
- package/dist/composed/date-picker/calendar-grid.d.ts +1 -0
- package/dist/composed/date-picker/calendar-grid.js +1 -0
- package/dist/composed/date-picker/date-picker.d.ts +1 -0
- package/dist/composed/date-picker/date-picker.js +1 -0
- package/dist/composed/date-picker/date-range-picker.d.ts +1 -0
- package/dist/composed/date-picker/date-range-picker.js +1 -0
- package/dist/composed/date-picker/date-time-picker.d.ts +1 -0
- package/dist/composed/date-picker/date-time-picker.js +1 -0
- package/dist/composed/date-picker/index.d.ts +1 -0
- package/dist/composed/date-picker/month-picker.d.ts +1 -0
- package/dist/composed/date-picker/month-picker.js +1 -0
- package/dist/composed/date-picker/presets.d.ts +1 -0
- package/dist/composed/date-picker/presets.js +1 -0
- package/dist/composed/date-picker/time-picker.d.ts +1 -0
- package/dist/composed/date-picker/time-picker.js +2 -1
- package/dist/composed/date-picker/use-calendar.d.ts +1 -0
- package/dist/composed/date-picker/use-calendar.d.ts.map +1 -1
- package/dist/composed/date-picker/use-calendar.js +1 -0
- package/dist/composed/date-picker/year-picker.d.ts +1 -0
- package/dist/composed/date-picker/year-picker.js +1 -0
- package/dist/composed/empty-state.js +1 -1
- package/dist/composed/error-boundary.d.ts +1 -0
- package/dist/composed/error-boundary.js +2 -1
- package/dist/composed/global-loading.d.ts +1 -0
- package/dist/composed/global-loading.js +1 -0
- package/dist/composed/index.d.ts +15 -0
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +1 -0
- package/dist/composed/lib/string-utils.d.ts +1 -0
- package/dist/composed/lib/string-utils.d.ts.map +1 -1
- package/dist/composed/lib/string-utils.js +7 -4
- package/dist/composed/loading-skeleton.js +32 -32
- package/dist/composed/member-picker.d.ts +1 -0
- package/dist/composed/member-picker.js +1 -0
- package/dist/composed/page-skeletons.js +38 -38
- package/dist/composed/rich-text-editor.d.ts +1 -0
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +47 -44
- package/dist/composed/status-badge.js +6 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/use-color-mode.d.ts +1 -0
- package/dist/hooks/use-color-mode.d.ts.map +1 -1
- package/dist/hooks/use-color-mode.js +9 -8
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +1 -0
- package/dist/hooks/use-toast.d.ts +1 -0
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +3 -2
- package/dist/primitives/react-accordion.d.ts +114 -0
- package/dist/primitives/react-alert-dialog.d.ts +51 -0
- package/dist/primitives/react-aspect-ratio.d.ts +11 -0
- package/dist/primitives/react-avatar.d.ts +24 -0
- package/dist/primitives/react-checkbox.d.ts +50 -0
- package/dist/primitives/react-collapsible.d.ts +33 -0
- package/dist/primitives/react-context-menu.d.ts +96 -0
- package/dist/primitives/react-dialog.d.ts +103 -0
- package/dist/primitives/react-dropdown-menu.d.ts +97 -0
- package/dist/primitives/react-hover-card.d.ts +79 -0
- package/dist/primitives/react-label.d.ts +10 -0
- package/dist/primitives/react-menu.d.ts +169 -0
- package/dist/primitives/react-menubar.d.ts +115 -0
- package/dist/primitives/react-navigation-menu.d.ts +126 -0
- package/dist/primitives/react-popover.d.ts +85 -0
- package/dist/primitives/react-progress.d.ts +19 -0
- package/dist/primitives/react-radio-group.d.ts +58 -0
- package/dist/primitives/react-roving-focus.d.ts +49 -0
- package/dist/primitives/react-select.d.ts +137 -0
- package/dist/primitives/react-separator.d.ts +21 -0
- package/dist/primitives/react-slider.d.ts +75 -0
- package/dist/primitives/react-switch.d.ts +21 -0
- package/dist/primitives/react-tabs.d.ts +56 -0
- package/dist/primitives/react-toast.d.ts +120 -0
- package/dist/primitives/react-toggle-group.d.ts +75 -0
- package/dist/primitives/react-toggle.d.ts +24 -0
- package/dist/primitives/react-tooltip.d.ts +101 -0
- package/dist/primitives/react-visually-hidden.d.ts +22 -0
- package/dist/shell/app-command-palette.d.ts +3 -3
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +2 -1
- package/dist/shell/bottom-navbar.d.ts +1 -0
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +40 -37
- package/dist/shell/index.d.ts +14 -2
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +16 -12
- package/dist/shell/link-context.d.ts +12 -0
- package/dist/shell/link-context.d.ts.map +1 -0
- package/dist/shell/link-context.js +19 -0
- package/dist/shell/notification-center.d.ts +1 -0
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +21 -19
- package/dist/shell/notification-preferences.d.ts +3 -3
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +14 -13
- package/dist/shell/sidebar.d.ts +1 -0
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +32 -30
- package/dist/shell/top-bar.d.ts +1 -0
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +35 -30
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +32 -2
- package/dist/ui/accordion.d.ts +2 -1
- package/dist/ui/accordion.js +1 -0
- package/dist/ui/alert-dialog.d.ts +2 -1
- package/dist/ui/alert-dialog.js +1 -0
- package/dist/ui/alert.d.ts +1 -0
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +2 -1
- package/dist/ui/aspect-ratio.d.ts +2 -1
- package/dist/ui/aspect-ratio.js +1 -0
- package/dist/ui/autocomplete.d.ts +1 -0
- package/dist/ui/autocomplete.js +35 -34
- package/dist/ui/avatar.d.ts +2 -1
- package/dist/ui/avatar.js +13 -12
- package/dist/ui/badge.d.ts +1 -0
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +4 -3
- package/dist/ui/banner.d.ts +1 -0
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +1 -0
- package/dist/ui/breadcrumb.d.ts +1 -0
- package/dist/ui/breadcrumb.js +1 -0
- package/dist/ui/button-group.d.ts +1 -0
- package/dist/ui/button-group.js +1 -0
- package/dist/ui/button.d.ts +1 -0
- package/dist/ui/button.js +2 -1
- package/dist/ui/card.d.ts +1 -0
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +2 -1
- package/dist/ui/charts/_internal/animation.d.ts +1 -0
- package/dist/ui/charts/_internal/animation.d.ts.map +1 -1
- package/dist/ui/charts/_internal/animation.js +1 -0
- package/dist/ui/charts/_internal/axes.d.ts +1 -0
- package/dist/ui/charts/_internal/axes.d.ts.map +1 -1
- package/dist/ui/charts/_internal/axes.js +1 -0
- package/dist/ui/charts/_internal/colors.d.ts +1 -0
- package/dist/ui/charts/_internal/colors.js +1 -0
- package/dist/ui/charts/_internal/grid-lines.d.ts +1 -0
- package/dist/ui/charts/_internal/grid-lines.js +1 -0
- package/dist/ui/charts/_internal/legend.d.ts +1 -0
- package/dist/ui/charts/_internal/legend.js +1 -0
- package/dist/ui/charts/_internal/scales.d.ts +1 -0
- package/dist/ui/charts/_internal/tooltip.d.ts +1 -0
- package/dist/ui/charts/_internal/tooltip.d.ts.map +1 -1
- package/dist/ui/charts/_internal/tooltip.js +1 -0
- package/dist/ui/charts/_internal/types.d.ts +1 -0
- package/dist/ui/charts/_internal/types.js +1 -0
- package/dist/ui/charts/area-chart.d.ts +1 -0
- package/dist/ui/charts/area-chart.js +1 -0
- package/dist/ui/charts/bar-chart.d.ts +1 -0
- package/dist/ui/charts/bar-chart.js +2 -1
- package/dist/ui/charts/chart-container.d.ts +1 -0
- package/dist/ui/charts/chart-container.js +12 -11
- package/dist/ui/charts/gauge-chart.d.ts +1 -0
- package/dist/ui/charts/gauge-chart.js +1 -0
- package/dist/ui/charts/index.d.ts +1 -0
- package/dist/ui/charts/line-chart.d.ts +1 -0
- package/dist/ui/charts/line-chart.js +2 -1
- package/dist/ui/charts/pie-chart.d.ts +1 -0
- package/dist/ui/charts/pie-chart.js +1 -0
- package/dist/ui/charts/radar-chart.d.ts +1 -0
- package/dist/ui/charts/radar-chart.js +21 -20
- package/dist/ui/charts/sparkline.d.ts +1 -0
- package/dist/ui/charts/sparkline.js +1 -0
- package/dist/ui/checkbox.d.ts +2 -1
- package/dist/ui/checkbox.js +1 -0
- package/dist/ui/chip.d.ts +1 -0
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +35 -36
- package/dist/ui/code.js +13 -13
- package/dist/ui/collapsible.d.ts +2 -1
- package/dist/ui/collapsible.js +1 -0
- package/dist/ui/combobox.d.ts +1 -0
- package/dist/ui/combobox.js +2 -1
- package/dist/ui/context-menu.d.ts +2 -1
- package/dist/ui/context-menu.js +2 -1
- package/dist/ui/data-table-toolbar.d.ts +1 -0
- package/dist/ui/data-table-toolbar.js +1 -0
- package/dist/ui/data-table.d.ts +1 -0
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +79 -78
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.js +1 -0
- package/dist/ui/dropdown-menu.d.ts +2 -1
- package/dist/ui/dropdown-menu.js +23 -22
- package/dist/ui/file-upload.d.ts +1 -0
- package/dist/ui/file-upload.js +60 -59
- package/dist/ui/form.d.ts +1 -0
- package/dist/ui/form.js +1 -0
- package/dist/ui/hover-card.d.ts +2 -1
- package/dist/ui/hover-card.js +1 -0
- package/dist/ui/icon-button.d.ts +1 -0
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button.js +1 -0
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/input-otp.d.ts +1 -0
- package/dist/ui/input-otp.js +2 -1
- package/dist/ui/input.d.ts +2 -1
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +1 -0
- package/dist/ui/label.d.ts +2 -1
- package/dist/ui/label.js +1 -0
- package/dist/ui/lib/slot.d.ts +1 -0
- package/dist/ui/lib/use-reduced-motion.d.ts +1 -0
- package/dist/ui/lib/use-reduced-motion.js +1 -0
- package/dist/ui/lib/use-ripple.d.ts +1 -0
- package/dist/ui/lib/use-ripple.js +1 -0
- package/dist/ui/link.d.ts +1 -0
- package/dist/ui/link.js +1 -0
- package/dist/ui/menubar.d.ts +2 -1
- package/dist/ui/menubar.js +23 -22
- package/dist/ui/navigation-menu.d.ts +2 -1
- package/dist/ui/navigation-menu.js +7 -6
- package/dist/ui/number-input.d.ts +1 -0
- package/dist/ui/number-input.js +2 -1
- package/dist/ui/pagination.d.ts +1 -0
- package/dist/ui/pagination.js +1 -0
- package/dist/ui/popover.d.ts +2 -1
- package/dist/ui/popover.js +1 -0
- package/dist/ui/progress.d.ts +2 -1
- package/dist/ui/progress.js +1 -0
- package/dist/ui/radio.d.ts +2 -1
- package/dist/ui/radio.js +1 -0
- package/dist/ui/search-input.d.ts +6 -5
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +11 -10
- package/dist/ui/segmented-control.d.ts +1 -0
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +4 -4
- package/dist/ui/select.d.ts +2 -1
- package/dist/ui/select.js +3 -2
- package/dist/ui/separator.d.ts +2 -1
- package/dist/ui/separator.js +1 -0
- package/dist/ui/sheet.d.ts +2 -1
- package/dist/ui/sheet.js +1 -0
- package/dist/ui/sidebar.d.ts +1 -0
- package/dist/ui/sidebar.js +53 -52
- package/dist/ui/slider.d.ts +2 -1
- package/dist/ui/slider.js +1 -0
- package/dist/ui/stack.d.ts +2 -2
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/stack.js +51 -21
- package/dist/ui/stat-card.d.ts +4 -1
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +22 -21
- package/dist/ui/stepper.d.ts +1 -0
- package/dist/ui/stepper.js +26 -25
- package/dist/ui/switch.d.ts +2 -1
- package/dist/ui/switch.js +1 -0
- package/dist/ui/table.js +12 -12
- package/dist/ui/tabs.d.ts +2 -1
- package/dist/ui/tabs.js +1 -0
- package/dist/ui/text.d.ts +1 -1
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/textarea.d.ts +1 -0
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +2 -0
- package/dist/ui/toast.d.ts +2 -1
- package/dist/ui/toast.js +2 -1
- package/dist/ui/toaster.d.ts +1 -0
- package/dist/ui/toaster.js +1 -0
- package/dist/ui/toggle-group.d.ts +2 -1
- package/dist/ui/toggle-group.js +1 -0
- package/dist/ui/toggle.d.ts +2 -1
- package/dist/ui/toggle.js +1 -0
- package/dist/ui/tooltip.d.ts +2 -1
- package/dist/ui/tooltip.js +1 -0
- package/dist/ui/transitions.d.ts +1 -0
- package/dist/ui/transitions.js +1 -0
- package/dist/ui/tree-view/index.d.ts +1 -0
- package/dist/ui/tree-view/tree-item.d.ts +1 -0
- package/dist/ui/tree-view/tree-item.js +2 -1
- package/dist/ui/tree-view/tree-view.d.ts +1 -0
- package/dist/ui/tree-view/tree-view.js +1 -0
- package/dist/ui/tree-view/use-tree.d.ts +1 -0
- package/dist/ui/tree-view/use-tree.js +1 -0
- package/package.json +97 -24
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as a, Fragment as v, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import * as N from "react";
|
|
4
|
+
import { useState as g } from "react";
|
|
5
|
+
import { useLink as f } from "./link-context.js";
|
|
6
|
+
import { IconX as y, IconDots as w } from "@tabler/icons-react";
|
|
6
7
|
import { cn as s } from "../ui/lib/utils.js";
|
|
7
|
-
function
|
|
8
|
+
function k({
|
|
8
9
|
item: r,
|
|
9
|
-
isActive:
|
|
10
|
-
onClick:
|
|
10
|
+
isActive: o,
|
|
11
|
+
onClick: d
|
|
11
12
|
}) {
|
|
13
|
+
const i = f();
|
|
12
14
|
return /* @__PURE__ */ t(
|
|
13
|
-
|
|
15
|
+
i,
|
|
14
16
|
{
|
|
15
17
|
href: r.href,
|
|
16
|
-
onClick:
|
|
18
|
+
onClick: d,
|
|
17
19
|
"aria-label": r.title,
|
|
18
|
-
"aria-current":
|
|
20
|
+
"aria-current": o ? "page" : void 0,
|
|
19
21
|
className: s(
|
|
20
22
|
"flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm",
|
|
21
|
-
|
|
23
|
+
o ? "font-semibold text-interactive" : "text-text-helper"
|
|
22
24
|
),
|
|
23
25
|
children: /* @__PURE__ */ a("div", { className: "relative flex w-full flex-col items-center gap-ds-02", children: [
|
|
24
26
|
/* @__PURE__ */ t(
|
|
@@ -26,7 +28,7 @@ function w({
|
|
|
26
28
|
{
|
|
27
29
|
className: s(
|
|
28
30
|
"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-interactive p-0 transition-opacity duration-slow-01",
|
|
29
|
-
|
|
31
|
+
o ? "opacity-100" : "opacity-0"
|
|
30
32
|
),
|
|
31
33
|
"aria-hidden": "true"
|
|
32
34
|
}
|
|
@@ -37,28 +39,28 @@ function w({
|
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
41
|
}
|
|
40
|
-
const
|
|
42
|
+
const M = N.forwardRef(
|
|
41
43
|
({
|
|
42
44
|
currentPath: r = "/",
|
|
43
|
-
user:
|
|
44
|
-
primaryItems:
|
|
45
|
-
moreItems:
|
|
45
|
+
user: o,
|
|
46
|
+
primaryItems: d = [],
|
|
47
|
+
moreItems: i = [],
|
|
46
48
|
className: p,
|
|
47
49
|
...x
|
|
48
50
|
}, h) => {
|
|
49
|
-
const [
|
|
51
|
+
const b = f(), [l, n] = g(!1), c = (e, u = !1) => u || e === "/" ? r === e : r.startsWith(e), m = i.some(
|
|
50
52
|
(e) => c(e.href, e.exact)
|
|
51
53
|
);
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
+
return o ? /* @__PURE__ */ a(v, { children: [
|
|
55
|
+
l && /* @__PURE__ */ a(
|
|
54
56
|
"div",
|
|
55
57
|
{
|
|
56
58
|
role: "button",
|
|
57
59
|
tabIndex: 0,
|
|
58
60
|
className: "fixed inset-0 z-overlay md:hidden",
|
|
59
|
-
onClick: () =>
|
|
61
|
+
onClick: () => n(!1),
|
|
60
62
|
onKeyDown: (e) => {
|
|
61
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
63
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), n(!1));
|
|
62
64
|
},
|
|
63
65
|
children: [
|
|
64
66
|
/* @__PURE__ */ t("div", { className: "absolute inset-0 bg-overlay" }),
|
|
@@ -74,18 +76,18 @@ const k = v.forwardRef(
|
|
|
74
76
|
/* @__PURE__ */ t(
|
|
75
77
|
"button",
|
|
76
78
|
{
|
|
77
|
-
onClick: () =>
|
|
79
|
+
onClick: () => n(!1),
|
|
78
80
|
"aria-label": "Close more menu",
|
|
79
81
|
className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-full hover:bg-layer-02",
|
|
80
|
-
children: /* @__PURE__ */ t(
|
|
82
|
+
children: /* @__PURE__ */ t(y, { className: "h-ico-sm w-ico-sm text-text-secondary", "aria-hidden": "true" })
|
|
81
83
|
}
|
|
82
84
|
)
|
|
83
85
|
] }),
|
|
84
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-03", children:
|
|
85
|
-
|
|
86
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-03", children: i.map((e) => /* @__PURE__ */ a(
|
|
87
|
+
b,
|
|
86
88
|
{
|
|
87
89
|
href: e.href,
|
|
88
|
-
onClick: () =>
|
|
90
|
+
onClick: () => n(!1),
|
|
89
91
|
className: s(
|
|
90
92
|
"flex flex-col items-center gap-ds-02b rounded-ds-xl p-ds-04 text-ds-sm transition-colors",
|
|
91
93
|
c(e.href, e.exact) ? "bg-layer-02 text-interactive" : "text-text-helper hover:bg-layer-02"
|
|
@@ -114,23 +116,24 @@ const k = v.forwardRef(
|
|
|
114
116
|
p
|
|
115
117
|
),
|
|
116
118
|
children: [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
d.map((e) => /* @__PURE__ */ t(
|
|
120
|
+
k,
|
|
119
121
|
{
|
|
120
122
|
item: e,
|
|
121
123
|
isActive: c(e.href, e.exact)
|
|
122
124
|
},
|
|
123
125
|
e.href
|
|
124
126
|
)),
|
|
125
|
-
|
|
127
|
+
i.length > 0 && /* @__PURE__ */ t(
|
|
126
128
|
"button",
|
|
127
129
|
{
|
|
128
|
-
|
|
130
|
+
type: "button",
|
|
131
|
+
onClick: () => n(!l),
|
|
129
132
|
"aria-label": "More navigation options",
|
|
130
|
-
"aria-expanded":
|
|
133
|
+
"aria-expanded": l,
|
|
131
134
|
className: s(
|
|
132
135
|
"flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm",
|
|
133
|
-
|
|
136
|
+
l || m ? "font-semibold text-interactive" : "text-text-helper"
|
|
134
137
|
),
|
|
135
138
|
children: /* @__PURE__ */ a("div", { className: "relative flex w-full flex-col items-center gap-ds-02", children: [
|
|
136
139
|
/* @__PURE__ */ t(
|
|
@@ -138,12 +141,12 @@ const k = v.forwardRef(
|
|
|
138
141
|
{
|
|
139
142
|
className: s(
|
|
140
143
|
"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-interactive p-0 transition-opacity duration-slow-01",
|
|
141
|
-
|
|
144
|
+
l || m ? "opacity-100" : "opacity-0"
|
|
142
145
|
),
|
|
143
146
|
"aria-hidden": "true"
|
|
144
147
|
}
|
|
145
148
|
),
|
|
146
|
-
/* @__PURE__ */ t("div", { className: "p-ds-03", children: /* @__PURE__ */ t(
|
|
149
|
+
/* @__PURE__ */ t("div", { className: "p-ds-03", children: /* @__PURE__ */ t(w, { className: "h-ico-md w-ico-md", "aria-hidden": "true" }) }),
|
|
147
150
|
/* @__PURE__ */ t("span", { className: "text-center", children: "More" })
|
|
148
151
|
] })
|
|
149
152
|
}
|
|
@@ -154,7 +157,7 @@ const k = v.forwardRef(
|
|
|
154
157
|
] }) : null;
|
|
155
158
|
}
|
|
156
159
|
);
|
|
157
|
-
|
|
160
|
+
M.displayName = "BottomNavbar";
|
|
158
161
|
export {
|
|
159
|
-
|
|
162
|
+
M as BottomNavbar
|
|
160
163
|
};
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* @module @devalok/shilp-sutra/shell
|
|
4
|
+
*
|
|
5
|
+
* Application shell components: sidebar, top bar, bottom nav, notifications, and command palette.
|
|
6
|
+
* All shell components require client-side React ("use client").
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { AppSidebar } from '@devalok/shilp-sutra/shell/sidebar'
|
|
10
|
+
* import { TopBar } from '@devalok/shilp-sutra/shell/top-bar'
|
|
11
|
+
*/
|
|
12
|
+
export { LinkProvider, useLink } from './link-context';
|
|
1
13
|
export { AppSidebar, type NavItem, type NavGroup, type SidebarUser, type AppSidebarProps, } from './sidebar';
|
|
2
14
|
export { TopBar, type TopBarUser, type TopBarProps, } from './top-bar';
|
|
3
15
|
export { BottomNavbar, type BottomNavItem, type BottomNavbarUser, type BottomNavbarProps, } from './bottom-navbar';
|
|
4
16
|
export { NotificationCenter, type Notification, type NotificationCenterProps, } from './notification-center';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
17
|
+
export { NotificationPreferences, type NotificationPreference, type NotificationProject, type NotificationPreferencesProps, } from './notification-preferences';
|
|
18
|
+
export { AppCommandPalette, type SearchResult, type AppCommandPaletteUser, type AppCommandPaletteProps, } from './app-command-palette';
|
|
7
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EACL,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,MAAM,EACN,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAA"}
|
package/dist/shell/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { LinkProvider as e, useLink as t } from "./link-context.js";
|
|
3
|
+
import { AppSidebar as f } from "./sidebar.js";
|
|
4
|
+
import { TopBar as m } from "./top-bar.js";
|
|
5
|
+
import { BottomNavbar as n } from "./bottom-navbar.js";
|
|
6
|
+
import { NotificationCenter as c } from "./notification-center.js";
|
|
7
|
+
import { NotificationPreferences as N } from "./notification-preferences.js";
|
|
8
|
+
import { AppCommandPalette as b } from "./app-command-palette.js";
|
|
7
9
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
b as AppCommandPalette,
|
|
11
|
+
f as AppSidebar,
|
|
12
|
+
n as BottomNavbar,
|
|
13
|
+
e as LinkProvider,
|
|
14
|
+
c as NotificationCenter,
|
|
15
|
+
N as NotificationPreferences,
|
|
16
|
+
m as TopBar,
|
|
17
|
+
t as useLink
|
|
14
18
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type LinkComponent = React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
4
|
+
href: string;
|
|
5
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
6
|
+
export declare function LinkProvider({ component, children, }: {
|
|
7
|
+
component: LinkComponent;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function useLink(): LinkComponent;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=link-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-context.d.ts","sourceRoot":"","sources":["../../src/shell/link-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,KAAK,aAAa,GAAG,KAAK,CAAC,yBAAyB,CAClD,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAC1G,CAAA;AAWD,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,2CAEA;AAED,wBAAgB,OAAO,kBAEtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
const o = n.forwardRef(({ href: t, ...e }, a) => /* @__PURE__ */ r("a", { ref: a, href: t, ...e }));
|
|
5
|
+
o.displayName = "DefaultLink";
|
|
6
|
+
const i = n.createContext(o);
|
|
7
|
+
function f({
|
|
8
|
+
component: t,
|
|
9
|
+
children: e
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ r(i.Provider, { value: t, children: e });
|
|
12
|
+
}
|
|
13
|
+
function s() {
|
|
14
|
+
return n.useContext(i);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
f as LinkProvider,
|
|
18
|
+
s as useLink
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-center.d.ts","sourceRoot":"","sources":["../../src/shell/notification-center.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAmB9B,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAA;IACvC,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EA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AAM,GAAG,IAAI,CAAA;IACpE,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAgLD,QAAA,MAAM,kBAAkB,mGA4KvB,CAAA;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as s, jsx as t, Fragment as S } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { useRef as
|
|
3
|
+
import * as $ from "react";
|
|
4
|
+
import { useRef as k, useCallback as f } from "react";
|
|
4
5
|
import { Popover as P, PopoverTrigger as Y, PopoverContent as _ } from "../ui/popover.js";
|
|
5
6
|
import { Tooltip as Q, TooltipTrigger as U, TooltipContent as B } from "../ui/tooltip.js";
|
|
6
7
|
import { IconBell as G, IconChecks as H, IconInbox as K } from "@tabler/icons-react";
|
|
7
8
|
import { cn as x } from "../ui/lib/utils.js";
|
|
8
9
|
function L(e) {
|
|
9
|
-
const l = Date.now(), a = new Date(e).getTime(), d = l - a, c = Math.floor(d / 1e3),
|
|
10
|
-
return c < 60 ? "just now" :
|
|
10
|
+
const l = Date.now(), a = new Date(e).getTime(), d = l - a, c = Math.floor(d / 1e3), i = Math.floor(c / 60), n = Math.floor(i / 60), m = Math.floor(n / 24);
|
|
11
|
+
return c < 60 ? "just now" : i < 60 ? `${i}m ago` : n < 24 ? `${n}h ago` : m < 7 ? `${m}d ago` : new Date(e).toLocaleDateString(void 0, {
|
|
11
12
|
day: "numeric",
|
|
12
13
|
month: "short"
|
|
13
14
|
});
|
|
@@ -67,7 +68,7 @@ function z({
|
|
|
67
68
|
"span",
|
|
68
69
|
{
|
|
69
70
|
className: x(
|
|
70
|
-
"h-
|
|
71
|
+
"h-[8px] w-[8px] rounded-ds-full",
|
|
71
72
|
g[e.tier] || g.INFO,
|
|
72
73
|
e.isRead && "opacity-[0.38]"
|
|
73
74
|
)
|
|
@@ -93,41 +94,41 @@ function z({
|
|
|
93
94
|
] })
|
|
94
95
|
] })
|
|
95
96
|
] }),
|
|
96
|
-
!e.isRead && /* @__PURE__ */ t("div", { className: "mt-ds-02b shrink-0", children: /* @__PURE__ */ t("span", { className: "block h-
|
|
97
|
+
!e.isRead && /* @__PURE__ */ t("div", { className: "mt-ds-02b shrink-0", children: /* @__PURE__ */ t("span", { className: "block h-[8px] w-[8px] rounded-ds-full bg-interactive" }) })
|
|
97
98
|
]
|
|
98
99
|
}
|
|
99
100
|
);
|
|
100
101
|
}
|
|
101
|
-
const J =
|
|
102
|
+
const J = $.forwardRef(
|
|
102
103
|
({
|
|
103
104
|
notifications: e = [],
|
|
104
105
|
unreadCount: l,
|
|
105
106
|
open: a,
|
|
106
107
|
onOpenChange: d,
|
|
107
108
|
isLoading: c = !1,
|
|
108
|
-
hasMore:
|
|
109
|
+
hasMore: i = !1,
|
|
109
110
|
onFetchMore: n,
|
|
110
|
-
onMarkRead:
|
|
111
|
+
onMarkRead: m,
|
|
111
112
|
onMarkAllRead: b,
|
|
112
113
|
onNavigate: h,
|
|
113
114
|
getNotificationRoute: w,
|
|
114
115
|
className: v,
|
|
115
116
|
...j
|
|
116
117
|
}, T) => {
|
|
117
|
-
const y =
|
|
118
|
+
const y = k(null), o = l ?? e.filter((r) => !r.isRead).length, I = w ?? q, R = f(
|
|
118
119
|
(r) => {
|
|
119
120
|
d == null || d(!1), h == null || h(r);
|
|
120
121
|
},
|
|
121
122
|
[h, d]
|
|
122
123
|
), E = f(
|
|
123
124
|
(r) => {
|
|
124
|
-
|
|
125
|
+
m == null || m(r);
|
|
125
126
|
},
|
|
126
|
-
[
|
|
127
|
+
[m]
|
|
127
128
|
), C = f(() => {
|
|
128
129
|
const r = y.current;
|
|
129
|
-
!r || c || !
|
|
130
|
-
}, [c,
|
|
130
|
+
!r || c || !i || r.scrollTop + r.clientHeight >= r.scrollHeight - 50 && (n == null || n());
|
|
131
|
+
}, [c, i, n]), D = e.reduce(
|
|
131
132
|
(r, u) => {
|
|
132
133
|
const p = O(u.createdAt);
|
|
133
134
|
return r[p] || (r[p] = []), r[p].push(u), r;
|
|
@@ -141,13 +142,14 @@ const J = k.forwardRef(
|
|
|
141
142
|
{
|
|
142
143
|
...j,
|
|
143
144
|
ref: T,
|
|
145
|
+
"aria-label": o > 0 ? `Notifications, ${o} unread` : "Notifications",
|
|
144
146
|
className: x(
|
|
145
147
|
"relative flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-border bg-layer-02 text-text-secondary transition-colors hover:bg-layer-03",
|
|
146
148
|
v
|
|
147
149
|
),
|
|
148
150
|
children: [
|
|
149
|
-
/* @__PURE__ */ t(G, { className: "h-ico-sm w-ico-sm" }),
|
|
150
|
-
|
|
151
|
+
/* @__PURE__ */ t(G, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" }),
|
|
152
|
+
o > 0 && /* @__PURE__ */ t("span", { className: "absolute -right-ds-01 -top-ds-01 flex h-4 min-w-4 items-center justify-center rounded-ds-full bg-interactive px-ds-02 text-ds-xs font-semibold text-text-on-color", children: o > 99 ? "99+" : o })
|
|
151
153
|
]
|
|
152
154
|
}
|
|
153
155
|
) }) }),
|
|
@@ -163,9 +165,9 @@ const J = k.forwardRef(
|
|
|
163
165
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b border-border px-ds-05 py-ds-04", children: [
|
|
164
166
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
165
167
|
/* @__PURE__ */ t("h3", { className: "text-ds-md font-semibold text-text-primary", children: "Notifications" }),
|
|
166
|
-
|
|
168
|
+
o > 0 && /* @__PURE__ */ t("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-ds-full bg-interactive/10 px-ds-02b text-ds-sm font-semibold text-interactive", children: o })
|
|
167
169
|
] }),
|
|
168
|
-
|
|
170
|
+
o > 0 && b && /* @__PURE__ */ s(
|
|
169
171
|
"button",
|
|
170
172
|
{
|
|
171
173
|
type: "button",
|
|
@@ -185,7 +187,7 @@ const J = k.forwardRef(
|
|
|
185
187
|
onScroll: C,
|
|
186
188
|
className: "max-h-[420px] overflow-y-auto",
|
|
187
189
|
children: [
|
|
188
|
-
e.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center px-ds-05 py-
|
|
190
|
+
e.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center px-ds-05 py-ds-09", children: [
|
|
189
191
|
/* @__PURE__ */ t("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-layer-02", children: /* @__PURE__ */ t(K, { className: "h-ico-lg w-ico-lg text-text-placeholder" }) }),
|
|
190
192
|
/* @__PURE__ */ t("p", { className: "mt-ds-04 text-ds-md text-text-placeholder", children: "No notifications yet" }),
|
|
191
193
|
/* @__PURE__ */ t("p", { className: "mt-ds-02 text-ds-sm text-text-placeholder", children: "You're all caught up!" })
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
export interface NotificationPreference {
|
|
2
3
|
id: string;
|
|
3
4
|
userId?: string;
|
|
@@ -33,9 +34,8 @@ export interface NotificationPreferencesProps {
|
|
|
33
34
|
/** Additional className */
|
|
34
35
|
className?: string;
|
|
35
36
|
}
|
|
36
|
-
declare function NotificationPreferences({ preferences, projects, isLoading, onSave, onToggleMute, onUpdateTier, onDelete, className, }: NotificationPreferencesProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
declare namespace NotificationPreferences {
|
|
37
|
+
export declare function NotificationPreferences({ preferences, projects, isLoading, onSave, onToggleMute, onUpdateTier, onDelete, className, }: NotificationPreferencesProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare namespace NotificationPreferences {
|
|
38
39
|
var displayName: string;
|
|
39
40
|
}
|
|
40
|
-
export default NotificationPreferences;
|
|
41
41
|
//# sourceMappingURL=notification-preferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-preferences.d.ts","sourceRoot":"","sources":["../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
{"version":3,"file":"notification-preferences.d.ts","sourceRoot":"","sources":["../../src/shell/notification-preferences.tsx"],"names":[],"mappings":"AAiCA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,4BAA4B;IAC3C,+BAA+B;IAC/B,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAA;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAA;IAChC,8BAA8B;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE;QACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,KAAK,EAAE,OAAO,CAAA;KACf,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3E,gDAAgD;IAChD,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,MAAM,KACZ,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzD,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAqBD,wBAAgB,uBAAuB,CAAC,EACtC,WAAgB,EAChB,QAAa,EACb,SAAiB,EACjB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,EAAE,4BAA4B,2CA6O9B;yBAtPe,uBAAuB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as t, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
2
3
|
import { useState as c } from "react";
|
|
3
4
|
import { Button as b } from "../ui/button.js";
|
|
@@ -20,12 +21,12 @@ function te({
|
|
|
20
21
|
projects: v = [],
|
|
21
22
|
isLoading: L = !1,
|
|
22
23
|
onSave: C,
|
|
23
|
-
onToggleMute:
|
|
24
|
-
onUpdateTier:
|
|
24
|
+
onToggleMute: x,
|
|
25
|
+
onUpdateTier: u,
|
|
25
26
|
onDelete: p,
|
|
26
27
|
className: T
|
|
27
28
|
}) {
|
|
28
|
-
const [E,
|
|
29
|
+
const [E, s] = c(!1), [N, g] = c("global"), [I, w] = c("IN_APP"), [y, A] = c("INFO"), [P, j] = c(!1), [S, O] = c(!1), R = async () => {
|
|
29
30
|
if (C) {
|
|
30
31
|
O(!0);
|
|
31
32
|
try {
|
|
@@ -34,7 +35,7 @@ function te({
|
|
|
34
35
|
channel: I,
|
|
35
36
|
minTier: y,
|
|
36
37
|
muted: P
|
|
37
|
-
}),
|
|
38
|
+
}), s(!1), F();
|
|
38
39
|
} catch (l) {
|
|
39
40
|
console.error("[Preferences] Failed to save:", l);
|
|
40
41
|
} finally {
|
|
@@ -45,7 +46,7 @@ function te({
|
|
|
45
46
|
g("global"), w("IN_APP"), A("INFO"), j(!1);
|
|
46
47
|
}, H = (l) => {
|
|
47
48
|
if (!l) return "Global (all projects)";
|
|
48
|
-
const n = v.find((
|
|
49
|
+
const n = v.find((a) => a.id === l);
|
|
49
50
|
return (n == null ? void 0 : n.title) || "Unknown project";
|
|
50
51
|
};
|
|
51
52
|
return /* @__PURE__ */ t(B, { children: [
|
|
@@ -57,7 +58,7 @@ function te({
|
|
|
57
58
|
{
|
|
58
59
|
size: "sm",
|
|
59
60
|
variant: "secondary",
|
|
60
|
-
onClick: () =>
|
|
61
|
+
onClick: () => s(!0),
|
|
61
62
|
children: [
|
|
62
63
|
/* @__PURE__ */ e(Z, { className: "mr-ds-02b h-ico-sm w-ico-sm" }),
|
|
63
64
|
"Add Rule"
|
|
@@ -66,7 +67,7 @@ function te({
|
|
|
66
67
|
)
|
|
67
68
|
] }),
|
|
68
69
|
/* @__PURE__ */ e(Y, { children: L ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-ds-07", children: /* @__PURE__ */ e("div", { className: "h-ico-md w-ico-md animate-spin rounded-ds-full border-2 border-border border-t-interactive" }) }) : f.length === 0 ? /* @__PURE__ */ e("div", { className: "py-ds-07 text-center", children: /* @__PURE__ */ e("p", { className: "text-ds-md text-text-placeholder", children: "No custom preferences set. All notifications are delivered by default." }) }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: f.map((l, n) => {
|
|
69
|
-
const
|
|
70
|
+
const a = _[l.channel] || _.IN_APP, M = a.icon;
|
|
70
71
|
return /* @__PURE__ */ t(
|
|
71
72
|
"div",
|
|
72
73
|
{
|
|
@@ -77,14 +78,14 @@ function te({
|
|
|
77
78
|
children: [
|
|
78
79
|
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-layer-02", children: /* @__PURE__ */ e(M, { className: "h-ico-sm w-ico-sm text-text-secondary" }) }),
|
|
79
80
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
|
|
80
|
-
/* @__PURE__ */ e("p", { className: "text-ds-md font-medium text-text-primary", children:
|
|
81
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md font-medium text-text-primary", children: a.label }),
|
|
81
82
|
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-placeholder", children: H(l.projectId) })
|
|
82
83
|
] }),
|
|
83
84
|
/* @__PURE__ */ t(
|
|
84
85
|
d,
|
|
85
86
|
{
|
|
86
87
|
value: l.minTier,
|
|
87
|
-
onValueChange: (r) =>
|
|
88
|
+
onValueChange: (r) => u == null ? void 0 : u(l, r),
|
|
88
89
|
children: [
|
|
89
90
|
/* @__PURE__ */ e(o, { className: "h-ds-xs-plus w-[130px] text-ds-sm", children: /* @__PURE__ */ e(m, {}) }),
|
|
90
91
|
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([r, V]) => /* @__PURE__ */ e(i, { value: r, children: V }, r)) })
|
|
@@ -97,7 +98,7 @@ function te({
|
|
|
97
98
|
k,
|
|
98
99
|
{
|
|
99
100
|
checked: !l.muted,
|
|
100
|
-
onCheckedChange: () =>
|
|
101
|
+
onCheckedChange: () => x == null ? void 0 : x(l)
|
|
101
102
|
}
|
|
102
103
|
)
|
|
103
104
|
] }),
|
|
@@ -116,7 +117,7 @@ function te({
|
|
|
116
117
|
);
|
|
117
118
|
}) }) })
|
|
118
119
|
] }),
|
|
119
|
-
/* @__PURE__ */ e(D, { open: E, onOpenChange:
|
|
120
|
+
/* @__PURE__ */ e(D, { open: E, onOpenChange: s, children: /* @__PURE__ */ t(z, { className: "sm:max-w-md", children: [
|
|
120
121
|
/* @__PURE__ */ t(q, { children: [
|
|
121
122
|
/* @__PURE__ */ e(J, { children: "Add Notification Rule" }),
|
|
122
123
|
/* @__PURE__ */ e(K, { children: "Customize how you receive notifications for a specific channel and project." })
|
|
@@ -159,7 +160,7 @@ function te({
|
|
|
159
160
|
{
|
|
160
161
|
variant: "ghost",
|
|
161
162
|
onClick: () => {
|
|
162
|
-
|
|
163
|
+
s(!1), F();
|
|
163
164
|
},
|
|
164
165
|
children: "Cancel"
|
|
165
166
|
}
|
|
@@ -179,5 +180,5 @@ function te({
|
|
|
179
180
|
}
|
|
180
181
|
te.displayName = "NotificationPreferences";
|
|
181
182
|
export {
|
|
182
|
-
te as
|
|
183
|
+
te as NotificationPreferences
|
|
183
184
|
};
|
package/dist/shell/sidebar.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/sidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/sidebar.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAsB9B,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACjD,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IACzB,kEAAkE;IAClE,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,yDAAyD;IACzD,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,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