@alfadocs/ui-kit 0.42.0 → 0.44.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/_chunks/{ar-Cn_NxqkN.js → ar-DEz65ZJW.js} +2 -2
- package/dist/_chunks/bmi-calculator-DFPWL2OJ.js +273 -0
- package/dist/_chunks/{booking-4mCw3Mpl.js → booking-CtLwaxkK.js} +4 -4
- package/dist/_chunks/{calculator-dialog-B74fqpFZ.js → calculator-dialog-D-nfvteH.js} +2 -2
- package/dist/_chunks/{chart-Cbt0_sKv.js → chart-Cg3e9EH9.js} +101 -99
- package/dist/_chunks/{cycle-calculator-DsZbyzX6.js → cycle-calculator-ChHBcjet.js} +65 -56
- package/dist/_chunks/{date-picker-CvQfs6Xh.js → date-picker-Bq7xhMA-.js} +109 -108
- package/dist/_chunks/date-picker-variants-DLi1Va_e.js +3238 -0
- package/dist/_chunks/{date-range-picker-U9fn1g9d.js → date-range-picker-DcXuI9y7.js} +20 -19
- package/dist/_chunks/{date-time-picker-Cva0ZCWw.js → date-time-picker-RimumeLR.js} +18 -17
- package/dist/_chunks/{de-BMM2H7Bs.js → de-bTBGdjPS.js} +2 -2
- package/dist/_chunks/dialog-BTpZV6It.js +223 -0
- package/dist/_chunks/{due-date-calculator-s_CBgaFs.js → due-date-calculator-CYXKLoof.js} +65 -45
- package/dist/_chunks/{editable-currency-cell-renderer-BhUkRiPZ.js → editable-currency-cell-renderer-9jqwDv5x.js} +2 -2
- package/dist/_chunks/{el-BYPonAaK.js → el-BWG5RXxa.js} +6 -6
- package/dist/_chunks/{es-CMkVCQ4F.js → es-DfO_G435.js} +2 -2
- package/dist/_chunks/{fr-BcuWxqft.js → fr-BTn24bs8.js} +2 -2
- package/dist/_chunks/{gestation-BXEgDGmP.js → gestation-mWF4AXea.js} +3 -3
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
- package/dist/_chunks/{header-CTZWX-tm.js → header-Ce1Br27u.js} +70 -75
- package/dist/_chunks/{hi-wkq_rQAh.js → hi-Dj3oYd84.js} +2 -2
- package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
- package/dist/_chunks/{isSameWeek-Bim5ftRd.js → isSameWeek-HfxKk6Lz.js} +2 -2
- package/dist/_chunks/{it-GiQrQ9p4.js → it-Y85ofIQQ.js} +7 -7
- package/dist/_chunks/{ja-qfYg3Rua.js → ja-CQ7J6YoA.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-kVAVycz_.js → marketplace-app-shell-Dc5cTIt8.js} +186 -149
- package/dist/_chunks/{nl-xOogO4sZ.js → nl-D9kHCmp3.js} +2 -2
- package/dist/_chunks/{patient-shell-lDX3wwu6.js → patient-shell-CnT4L8gn.js} +2 -2
- package/dist/_chunks/{pl-GnOW6eGK.js → pl-B3Smqpkr.js} +3 -3
- package/dist/_chunks/{pregnancy-weight-gain-B7kBK-ZR.js → pregnancy-weight-gain-C5YhfYnL.js} +60 -50
- package/dist/_chunks/{pt-_bV5b5RW.js → pt-D3J-1c_7.js} +6 -6
- package/dist/_chunks/{ro-BEcyh5Nj.js → ro-BKAbbEA3.js} +2 -2
- package/dist/_chunks/{ru-Bi86hqMf.js → ru-BeG8f0Ep.js} +3 -3
- package/dist/_chunks/{sign-document-QHfcNKFj.js → sign-document-B-3k_0LO.js} +165 -137
- package/dist/_chunks/{sq-BujHSAWu.js → sq-_hRPaeUy.js} +6 -6
- package/dist/_chunks/subDays-Dv7q9S7u.js +8 -0
- package/dist/_chunks/{sv-C8AeDrTA.js → sv-g009fSpe.js} +2 -2
- package/dist/_chunks/{tab-bar-C4II-7ej.js → tab-bar-Xetknddo.js} +53 -34
- package/dist/_chunks/{tr-CMSs_Vgf.js → tr-OKUOuhMW.js} +2 -2
- package/dist/_chunks/{unit-converter-D1UrEUxa.js → unit-converter-Ds9jalbN.js} +78 -67
- package/dist/_chunks/{zh-CN-eXB-PFu4.js → zh-CN-De4zwEhx.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/calendar-class-names.d.ts +8 -0
- package/dist/components/_shared/index.d.ts +2 -0
- package/dist/components/_shared/insert-result.d.ts +149 -4
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/chart/chart.d.ts +10 -0
- package/dist/components/chart/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts +0 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.d.ts +0 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/sign-document/sign-document.d.ts +12 -0
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/tab-bar/index.d.ts +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tab-bar/tab-bar.d.ts +44 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +6 -0
- package/dist/index.js +504 -502
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +57 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1411 -2
- package/package.json +1 -1
- package/dist/_chunks/bmi-calculator-D4juUcyF.js +0 -219
- package/dist/_chunks/dialog-Cee13rHU.js +0 -215
- package/dist/_chunks/gestational-age-calculator-CWOG3bkI.js +0 -178
- package/dist/_chunks/insert-result-DtQQeSSf.js +0 -227
- package/dist/_chunks/react-day-picker-CdtIiKjx.js +0 -3174
- package/dist/_chunks/subDays-_T9YeKPX.js +0 -8
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* its own i18n; the only kit-owned strings reuse existing translated `ui.*`
|
|
24
24
|
* keys (sidebar label, skip link, menu button).
|
|
25
25
|
*/
|
|
26
|
-
import { type ReactNode } from 'react';
|
|
26
|
+
import { type MouseEvent, type ReactNode } from 'react';
|
|
27
27
|
import { type SidebarMode } from '../../components/sidebar';
|
|
28
28
|
export interface MarketplaceNavItem {
|
|
29
29
|
id: string;
|
|
@@ -36,7 +36,39 @@ export interface MarketplaceNavItem {
|
|
|
36
36
|
badgeCount?: number;
|
|
37
37
|
/** Mark the item as the current page (`aria-current='page'`). */
|
|
38
38
|
isActive?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Optional click handler threaded onto the nav link's `<a>`. The lightweight
|
|
41
|
+
* alternative to `renderLink`: intercept a same-origin click (call
|
|
42
|
+
* `event.preventDefault()`) and route client-side without a full page load —
|
|
43
|
+
* no router `<Link>` needed. Applies to both the standalone sidebar item and
|
|
44
|
+
* the embedded tab. When `renderLink` is supplied it's handed through to the
|
|
45
|
+
* consumer's link element instead.
|
|
46
|
+
*/
|
|
47
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Props the shell hands to `renderLink` for each nav item. The consumer returns
|
|
51
|
+
* their router's `<Link to={href}>` carrying the same `className` (the kit's
|
|
52
|
+
* active styling) and `aria-current` (`'page'` on the active item) so a tab /
|
|
53
|
+
* sidebar-item click is a client-side route change, not a full page reload.
|
|
54
|
+
*/
|
|
55
|
+
export interface MarketplaceRenderLinkProps {
|
|
56
|
+
/** The item's destination — feed it to your router's `to` / `href`. */
|
|
57
|
+
href: string;
|
|
58
|
+
/** The kit's classes — apply verbatim to the link element. */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Icon + label + badge — render as the link's children. */
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
/** `'page'` on the active item, otherwise omitted — forward to the link. */
|
|
63
|
+
'aria-current'?: 'page';
|
|
39
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Render a nav item through the consumer's router instead of the kit's own
|
|
67
|
+
* `<a>`. Returned by the consumer; the shell forwards `href`, the kit's
|
|
68
|
+
* `className`, the item children, and `aria-current` so the active styling and
|
|
69
|
+
* the `aria-current="page"` marker survive a client-side route change.
|
|
70
|
+
*/
|
|
71
|
+
export type MarketplaceRenderLink = (props: MarketplaceRenderLinkProps) => ReactNode;
|
|
40
72
|
export interface MarketplaceAppUser {
|
|
41
73
|
/** Display name — drives the avatar initials + the account-menu header. */
|
|
42
74
|
name: string;
|
|
@@ -64,6 +96,30 @@ export interface MarketplaceAppShellProps {
|
|
|
64
96
|
productHref?: string;
|
|
65
97
|
/** Sidebar nav items, in order. */
|
|
66
98
|
nav: MarketplaceNavItem[];
|
|
99
|
+
/**
|
|
100
|
+
* Render nav items (and the brand lockup) through the consumer's router so a
|
|
101
|
+
* tab / item click is a client-side route change with **no full-page reload
|
|
102
|
+
* or session flash**. Wire it to your router's `<Link>`:
|
|
103
|
+
*
|
|
104
|
+
* ```tsx
|
|
105
|
+
* import { Link } from '@tanstack/react-router';
|
|
106
|
+
* <MarketplaceAppShell
|
|
107
|
+
* nav={nav}
|
|
108
|
+
* renderLink={({ href, className, children, ...rest }) => (
|
|
109
|
+
* <Link to={href} className={className} {...rest}>{children}</Link>
|
|
110
|
+
* )}
|
|
111
|
+
* />
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* Threaded to the standalone sidebar items, the embedded top tab strip, and
|
|
115
|
+
* the brand lockup. The kit forwards the same `className` + `aria-current` so
|
|
116
|
+
* the active styling and the `aria-current="page"` marker survive in both
|
|
117
|
+
* modes. Omit it to render the plain `<a href>` exactly as before — non-routed
|
|
118
|
+
* consumers are byte-for-byte unaffected. A per-item `onClick` (a
|
|
119
|
+
* click-interceptor shim) is the lighter alternative when you don't want to
|
|
120
|
+
* thread a router `<Link>`.
|
|
121
|
+
*/
|
|
122
|
+
renderLink?: MarketplaceRenderLink;
|
|
67
123
|
/** The signed-in user shown in the account menu. */
|
|
68
124
|
user: MarketplaceAppUser;
|
|
69
125
|
/** Consumer-localised chrome labels owned by the shell. */
|