@middag-io/react 0.10.3 → 0.11.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.
@@ -31676,8 +31676,137 @@ function vH() {
31676
31676
  })] });
31677
31677
  }
31678
31678
  //#endregion
31679
+ //#region src/base/shell/HostProductShell.tsx
31680
+ function yH({ children: e }) {
31681
+ let { t } = n(), { toggleSidebar: r, open: i, setOpenMobile: a } = iw(), { props: o } = nt(), s = o.contract?.page ?? {
31682
+ key: "unknown",
31683
+ title: "",
31684
+ breadcrumbs: [],
31685
+ actions: []
31686
+ }, c = z(() => {
31687
+ a(!0);
31688
+ }, [a]), l = z(() => {
31689
+ r();
31690
+ }, [r]);
31691
+ return /* @__PURE__ */ U(V, { children: [
31692
+ /* @__PURE__ */ H("a", {
31693
+ href: "#middag-main-content",
31694
+ className: "sr-only focus:not-sr-only focus:absolute focus:z-[300] focus:bg-background focus:px-4 focus:py-2 focus:text-sm",
31695
+ children: t("middag.ui.shell.skip_to_content")
31696
+ }),
31697
+ /* @__PURE__ */ U(ow, {
31698
+ "aria-label": t("middag.ui.sidebar.nav_label"),
31699
+ collapsible: "offcanvas",
31700
+ className: "border-sidebar-border bg-sidebar border-r",
31701
+ children: [
31702
+ /* @__PURE__ */ H(uw, {
31703
+ className: "border-sidebar-border border-b px-4 py-3",
31704
+ children: /* @__PURE__ */ H("p", {
31705
+ className: "text-sidebar-foreground text-sm font-semibold",
31706
+ children: "MIDDAG"
31707
+ })
31708
+ }),
31709
+ /* @__PURE__ */ H(Js, { children: /* @__PURE__ */ H(Xw, {}) }),
31710
+ /* @__PURE__ */ H(dw, {
31711
+ className: "border-sidebar-border mt-auto border-t px-3 py-2",
31712
+ children: /* @__PURE__ */ H(qC, {
31713
+ delayDuration: 300,
31714
+ children: /* @__PURE__ */ U("div", {
31715
+ className: "flex items-center justify-between",
31716
+ children: [/* @__PURE__ */ U(JC, { children: [/* @__PURE__ */ H(YC, {
31717
+ asChild: !0,
31718
+ children: /* @__PURE__ */ U("button", {
31719
+ onClick: l,
31720
+ className: "text-muted-foreground hover:bg-sidebar-hover hover:text-sidebar-foreground flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1.5 text-xs transition-colors",
31721
+ type: "button",
31722
+ children: [/* @__PURE__ */ H("span", {
31723
+ className: "text-base leading-none",
31724
+ children: "«"
31725
+ }), /* @__PURE__ */ H("span", { children: t("middag.ui.sidebar.collapse") })]
31726
+ })
31727
+ }), /* @__PURE__ */ H(XC, {
31728
+ side: "top",
31729
+ children: t("middag.ui.sidebar.collapse")
31730
+ })] }), /* @__PURE__ */ H("div", {
31731
+ className: "flex items-center gap-0.5",
31732
+ children: /* @__PURE__ */ H(vH, {})
31733
+ })]
31734
+ })
31735
+ })
31736
+ })
31737
+ ]
31738
+ }),
31739
+ /* @__PURE__ */ U("div", {
31740
+ className: "product-shell__content flex min-h-screen flex-1 flex-col overflow-hidden",
31741
+ children: [
31742
+ /* @__PURE__ */ H(Js, { children: /* @__PURE__ */ H(ST, {
31743
+ page: s,
31744
+ onMobileMenuClick: c
31745
+ }) }),
31746
+ s.filterTabs && s.filterTabs.length > 0 && /* @__PURE__ */ H(NT, {
31747
+ tabs: s.filterTabs,
31748
+ activeTab: s.activeFilterTab
31749
+ }),
31750
+ /* @__PURE__ */ U("div", {
31751
+ className: "flex min-h-0 flex-1",
31752
+ children: [/* @__PURE__ */ H("main", {
31753
+ id: "middag-main-content",
31754
+ className: "min-w-0 flex-1 overflow-auto p-6",
31755
+ "aria-live": "polite",
31756
+ "aria-busy": "false",
31757
+ children: e
31758
+ }), /* @__PURE__ */ H(IT, {})]
31759
+ })
31760
+ ]
31761
+ }),
31762
+ !i && /* @__PURE__ */ H(qC, {
31763
+ delayDuration: 300,
31764
+ children: /* @__PURE__ */ U("div", {
31765
+ className: "fixed bottom-3 z-30 flex items-center gap-1.5",
31766
+ style: { left: "calc(var(--host-sidebar-width, 0px) + 12px)" },
31767
+ children: [/* @__PURE__ */ U(JC, { children: [/* @__PURE__ */ H(YC, {
31768
+ asChild: !0,
31769
+ children: /* @__PURE__ */ H("button", {
31770
+ onClick: l,
31771
+ className: "bg-sidebar border-sidebar-border text-muted-foreground hover:text-sidebar-foreground hover:bg-sidebar-hover flex h-9 w-9 items-center justify-center rounded-lg border shadow-md transition-colors",
31772
+ "aria-label": t("middag.ui.sidebar.expand"),
31773
+ type: "button",
31774
+ children: /* @__PURE__ */ H("span", {
31775
+ className: "text-base leading-none",
31776
+ children: "»"
31777
+ })
31778
+ })
31779
+ }), /* @__PURE__ */ H(XC, {
31780
+ side: "top",
31781
+ children: t("middag.ui.sidebar.expand")
31782
+ })] }), /* @__PURE__ */ H("div", {
31783
+ className: "bg-sidebar border-sidebar-border rounded-lg border shadow-md",
31784
+ children: /* @__PURE__ */ H(vH, {})
31785
+ })]
31786
+ })
31787
+ }),
31788
+ /* @__PURE__ */ H(hl, {
31789
+ position: "bottom-right",
31790
+ richColors: !0
31791
+ })
31792
+ ] });
31793
+ }
31794
+ function bH({ children: e }) {
31795
+ return Je(() => {
31796
+ AT();
31797
+ }, []), /* @__PURE__ */ H(aw, {
31798
+ defaultOpen: !0,
31799
+ style: {
31800
+ "--sidebar-width": "260px",
31801
+ "--sidebar-width-icon": "60px"
31802
+ },
31803
+ className: "bg-background text-foreground flex min-h-screen",
31804
+ children: /* @__PURE__ */ H(yH, { children: e })
31805
+ });
31806
+ }
31807
+ //#endregion
31679
31808
  //#region src/base/shell/partials/CommandPalette.tsx
31680
- function yH({ items: e, onSelect: t }) {
31809
+ function xH({ items: e, onSelect: t }) {
31681
31810
  let { t: r } = n(), [i, a] = B(!1), [o, s] = B(""), [c, l] = B(0), u = Qe(null);
31682
31811
  Je(() => {
31683
31812
  let e = (e) => {
@@ -31811,16 +31940,16 @@ function yH({ items: e, onSelect: t }) {
31811
31940
  }
31812
31941
  //#endregion
31813
31942
  //#region src/base/shell/partials/HelpContext.tsx
31814
- var bH = Ue({
31943
+ var SH = Ue({
31815
31944
  help: null,
31816
31945
  isOpen: !1,
31817
31946
  setHelp: () => {},
31818
31947
  toggle: () => {},
31819
31948
  close: () => {}
31820
31949
  });
31821
- function xH({ children: e }) {
31950
+ function CH({ children: e }) {
31822
31951
  let [t, n] = B(null), [r, i] = B(!1), a = z(() => i((e) => !e), []), o = z(() => i(!1), []);
31823
- return /* @__PURE__ */ H(bH.Provider, {
31952
+ return /* @__PURE__ */ H(SH.Provider, {
31824
31953
  value: {
31825
31954
  help: t,
31826
31955
  isOpen: r,
@@ -31831,13 +31960,13 @@ function xH({ children: e }) {
31831
31960
  children: e
31832
31961
  });
31833
31962
  }
31834
- function SH() {
31835
- return qe(bH);
31963
+ function wH() {
31964
+ return qe(SH);
31836
31965
  }
31837
31966
  //#endregion
31838
31967
  //#region src/base/shell/partials/HelpPanel.tsx
31839
- function CH() {
31840
- let { t: e } = n(), { help: t, isOpen: r, close: i } = SH(), a = r && t !== null;
31968
+ function TH() {
31969
+ let { t: e } = n(), { help: t, isOpen: r, close: i } = wH(), a = r && t !== null;
31841
31970
  return Je(() => {
31842
31971
  if (!a) return;
31843
31972
  let e = (e) => {
@@ -31929,103 +32058,103 @@ function CH() {
31929
32058
  }
31930
32059
  //#endregion
31931
32060
  //#region src/assets/lottie/index.ts
31932
- var wH = "/lottie";
31933
- function TH(e, t) {
31934
- return t.map((t) => `${wH}/${e}/${t}`);
32061
+ var EH = "/lottie";
32062
+ function DH(e, t) {
32063
+ return t.map((t) => `${EH}/${e}/${t}`);
31935
32064
  }
31936
- var EH = {
31937
- loading: TH("loading", [
32065
+ var OH = {
32066
+ loading: DH("loading", [
31938
32067
  "spinner-1.json",
31939
32068
  "spinner-2.json",
31940
32069
  "spinner-3.json"
31941
32070
  ]),
31942
- success: TH("success", [
32071
+ success: DH("success", [
31943
32072
  "check-1.json",
31944
32073
  "check-2.json",
31945
32074
  "check-3.json"
31946
32075
  ]),
31947
- error: TH("error", [
32076
+ error: DH("error", [
31948
32077
  "warning-1.json",
31949
32078
  "warning-2.json",
31950
32079
  "warning-3.json"
31951
32080
  ]),
31952
- emptyState: TH("empty-state", [
32081
+ emptyState: DH("empty-state", [
31953
32082
  "empty-1.json",
31954
32083
  "empty-2.json",
31955
32084
  "empty-3.json"
31956
32085
  ]),
31957
- notFound: TH("not-found", [
32086
+ notFound: DH("not-found", [
31958
32087
  "404-1.json",
31959
32088
  "404-2.json",
31960
32089
  "404-3.json"
31961
32090
  ]),
31962
- search: TH("search", [
32091
+ search: DH("search", [
31963
32092
  "search-1.json",
31964
32093
  "search-2.json",
31965
32094
  "search-3.json"
31966
32095
  ]),
31967
- upload: TH("upload", [
32096
+ upload: DH("upload", [
31968
32097
  "upload-1.json",
31969
32098
  "upload-2.json",
31970
32099
  "upload-3.json"
31971
32100
  ]),
31972
- notification: TH("notification", [
32101
+ notification: DH("notification", [
31973
32102
  "bell-1.json",
31974
32103
  "bell-2.json",
31975
32104
  "bell-3.json"
31976
32105
  ]),
31977
- email: TH("email", [
32106
+ email: DH("email", [
31978
32107
  "mail-1.json",
31979
32108
  "mail-2.json",
31980
32109
  "mail-3.json"
31981
32110
  ]),
31982
- settings: TH("settings", [
32111
+ settings: DH("settings", [
31983
32112
  "gear-1.json",
31984
32113
  "gear-2.json",
31985
32114
  "gear-3.json"
31986
32115
  ]),
31987
- user: TH("user", [
32116
+ user: DH("user", [
31988
32117
  "profile-1.json",
31989
32118
  "profile-2.json",
31990
32119
  "profile-3.json"
31991
32120
  ]),
31992
- dashboard: TH("dashboard", [
32121
+ dashboard: DH("dashboard", [
31993
32122
  "analytics-1.json",
31994
32123
  "analytics-2.json",
31995
32124
  "analytics-3.json"
31996
32125
  ]),
31997
- calendar: TH("calendar", ["schedule-1.json", "schedule-2.json"]),
31998
- security: TH("security", [
32126
+ calendar: DH("calendar", ["schedule-1.json", "schedule-2.json"]),
32127
+ security: DH("security", [
31999
32128
  "lock-1.json",
32000
32129
  "lock-2.json",
32001
32130
  "lock-3.json"
32002
32131
  ]),
32003
- payment: TH("payment", [
32132
+ payment: DH("payment", [
32004
32133
  "wallet-1.json",
32005
32134
  "wallet-2.json",
32006
32135
  "wallet-3.json"
32007
32136
  ]),
32008
- cloud: TH("cloud", ["cloud-1.json", "cloud-2.json"]),
32009
- connection: TH("connection", [
32137
+ cloud: DH("cloud", ["cloud-1.json", "cloud-2.json"]),
32138
+ connection: DH("connection", [
32010
32139
  "network-1.json",
32011
32140
  "network-2.json",
32012
32141
  "network-3.json"
32013
32142
  ]),
32014
- celebration: TH("celebration", [
32143
+ celebration: DH("celebration", [
32015
32144
  "confetti-1.json",
32016
32145
  "confetti-2.json",
32017
32146
  "confetti-3.json"
32018
32147
  ]),
32019
- onboarding: TH("onboarding", [
32148
+ onboarding: DH("onboarding", [
32020
32149
  "welcome-1.json",
32021
32150
  "welcome-2.json",
32022
32151
  "welcome-3.json"
32023
32152
  ]),
32024
- maintenance: TH("maintenance", [
32153
+ maintenance: DH("maintenance", [
32025
32154
  "construction-1.json",
32026
32155
  "construction-2.json",
32027
32156
  "construction-3.json"
32028
32157
  ])
32029
32158
  };
32030
32159
  //#endregion
32031
- export { RV as ActionGridBlock, NO as ActivityTimelineBlock, wT as AdminShell, vH as AppearanceToggle, QV as AuthProvider, eH as Can, tH as Cannot, _V as CardGridBlock, yH as CommandPalette, bc as ContractPage, VT as DashboardLayout, mO as DenseTableBlock, AO as DetailPanelBlock, hO as EmptyStateBlock, Ws as ErrorReporterProvider, nH as FlashProvider, pV as FormPanelBlock, CH as HelpPanel, xH as HelpProvider, i as I18nProvider, IT as InlineInspector, zs as InspectorProvider, r as LIB_UI_DEFAULTS, vc as LazyBlock, BV as LinkListBlock, gV as MarkdownPanelBlock, WT as MasterDetailLayout, wO as MetricCardBlock, Js as NavErrorBoundary, NT as PageFilterTabs, ST as PageHeader, RT as ProductShell, cH as ProgressProvider, iH as ScopeProvider, ow as Sidebar, fw as SidebarContent, dw as SidebarFooter, pw as SidebarGroup, uw as SidebarHeader, lw as SidebarInset, mw as SidebarMenu, _w as SidebarMenuButton, hw as SidebarMenuItem, Xw as SidebarNav, aw as SidebarProvider, cw as SidebarRail, sw as SidebarTrigger, UT as SplitLayout, HT as StackLayout, kO as StatusStripBlock, HV as TabbedPanelBlock, hl as Toaster, JC as Tooltip, XC as TooltipContent, qC as TooltipProvider, YC as TooltipTrigger, KT as WizardLayout, UV as WorkflowProgressBlock, sl as applyTheme, As as blockRegistry, ll as cycleAppearance, MT as destroyHostHeaderHeight, al as getEffectiveTheme, ol as getStoredAppearance, dl as initDir, AT as initHostHeaderHeight, yc as isLazyBlock, ks as layoutRegistry, XV as localePtBR, XV as ptBR, EH as lottie, fl as onSystemThemeChange, Es as pageContractSchema, Ns as registerBlock, YV as registerDefaults, Ms as registerLayout, js as registerShell, Is as resolveBlock, Fs as resolveLayout, Ps as resolveShell, cl as setAppearance, jT as setHostHeaderHeight, Os as shellRegistry, ul as toggleDir, $V as useAuth, Gs as useErrorReporter, SH as useHelp, Rs as useInspector, hH as useIsDark, aH as useScope, oH as useScopeKey, iw as useSidebar, n as useTranslation, Ds as validatePageContract };
32160
+ export { RV as ActionGridBlock, NO as ActivityTimelineBlock, wT as AdminShell, vH as AppearanceToggle, QV as AuthProvider, eH as Can, tH as Cannot, _V as CardGridBlock, xH as CommandPalette, bc as ContractPage, VT as DashboardLayout, mO as DenseTableBlock, AO as DetailPanelBlock, hO as EmptyStateBlock, Ws as ErrorReporterProvider, nH as FlashProvider, pV as FormPanelBlock, TH as HelpPanel, CH as HelpProvider, bH as HostProductShell, i as I18nProvider, IT as InlineInspector, zs as InspectorProvider, r as LIB_UI_DEFAULTS, vc as LazyBlock, BV as LinkListBlock, gV as MarkdownPanelBlock, WT as MasterDetailLayout, wO as MetricCardBlock, Js as NavErrorBoundary, NT as PageFilterTabs, ST as PageHeader, RT as ProductShell, cH as ProgressProvider, iH as ScopeProvider, ow as Sidebar, fw as SidebarContent, dw as SidebarFooter, pw as SidebarGroup, uw as SidebarHeader, lw as SidebarInset, mw as SidebarMenu, _w as SidebarMenuButton, hw as SidebarMenuItem, Xw as SidebarNav, aw as SidebarProvider, cw as SidebarRail, sw as SidebarTrigger, UT as SplitLayout, HT as StackLayout, kO as StatusStripBlock, HV as TabbedPanelBlock, hl as Toaster, JC as Tooltip, XC as TooltipContent, qC as TooltipProvider, YC as TooltipTrigger, KT as WizardLayout, UV as WorkflowProgressBlock, sl as applyTheme, As as blockRegistry, ll as cycleAppearance, MT as destroyHostHeaderHeight, al as getEffectiveTheme, ol as getStoredAppearance, dl as initDir, AT as initHostHeaderHeight, yc as isLazyBlock, ks as layoutRegistry, XV as localePtBR, XV as ptBR, OH as lottie, fl as onSystemThemeChange, Es as pageContractSchema, Ns as registerBlock, YV as registerDefaults, Ms as registerLayout, js as registerShell, Is as resolveBlock, Fs as resolveLayout, Ps as resolveShell, cl as setAppearance, jT as setHostHeaderHeight, Os as shellRegistry, ul as toggleDir, $V as useAuth, Gs as useErrorReporter, wH as useHelp, Rs as useInspector, hH as useIsDark, aH as useScope, oH as useScopeKey, iw as useSidebar, n as useTranslation, Ds as validatePageContract };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middag-io/react",
3
- "version": "0.10.3",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "MIDDAG shared React UI library for Moodle, WordPress and other Inertia hosts",
6
6
  "repository": {