@ngrok/mantle 0.76.11 → 0.78.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/accordion.d.ts +63 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +7 -1
- package/dist/alert-dialog.d.ts +19 -26
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +16 -24
- package/dist/alert.js +1 -1
- package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
- package/dist/anchor.d.ts +3 -4
- package/dist/anchor.js +1 -1
- package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
- package/dist/badge.d.ts +5 -56
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +212 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/browser-only-CPH56Xw_.js +1 -0
- package/dist/browser-only.d.ts +2 -6
- package/dist/browser-only.js +1 -1
- package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
- package/dist/button-AS5Ir3DE.js +1 -0
- package/dist/{button-mfYak6Rx.d.ts → button-Bw9MpShl.d.ts} +26 -8
- package/dist/button.d.ts +5 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -8
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -8
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +147 -0
- package/dist/centered-layout.js +1 -0
- package/dist/checkbox-DJ2xl7Rc.js +1 -0
- package/dist/checkbox.d.ts +11 -9
- package/dist/checkbox.js +1 -1
- package/dist/choice-DOdyNzFC.js +1 -0
- package/dist/choice.d.ts +253 -0
- package/dist/choice.js +1 -0
- package/dist/code-block.d.ts +5 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +4 -5
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +40 -19
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +60 -38
- package/dist/command.js +1 -1
- package/dist/{copy-to-clipboard-Baw30q9O.js → copy-to-clipboard-BsCQ9m6K.js} +1 -1
- package/dist/cx-IiQEAKf5.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-slot-CChfb_cv.d.ts +17 -0
- package/dist/data-table.d.ts +45 -131
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +7 -7
- package/dist/description-list.js +1 -1
- package/dist/{dialog-Cp0S2jsG.js → dialog-DVDFVT_-.js} +1 -1
- package/dist/dialog.d.ts +155 -48
- package/dist/dialog.js +1 -1
- package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
- package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
- package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DT30TQzL.d.ts} +21 -24
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +133 -53
- package/dist/empty.js +1 -1
- package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
- package/dist/field.d.ts +24 -36
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +2 -9
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +139 -81
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +34 -14
- package/dist/hover-card.js +1 -1
- package/dist/icon-CDtYjF_H.js +1 -0
- package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
- package/dist/{icon-button-DiX9iZ9n.js → icon-button-CxVsZ2N1.js} +1 -1
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-DuRSCsPh.d.ts} +5 -6
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +7 -19
- package/dist/icons.js +1 -1
- package/dist/{in-view-BC3wmz-a.d.ts → in-view-nkSOdED2.d.ts} +21 -10
- package/dist/index-BnI3OppC.d.ts +1 -0
- package/dist/{index-CTU6apE6.d.ts → index-CDwfBOAA.d.ts} +5 -4
- package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
- package/dist/index-Rv8RL7xy.d.ts +25 -0
- package/dist/input-Ct1YOqSy.js +1 -0
- package/dist/input.d.ts +10 -56
- package/dist/input.js +1 -1
- package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
- package/dist/kbd.d.ts +3 -8
- package/dist/kbd.js +1 -1
- package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
- package/dist/label-v2-bv98k.d.ts +69 -0
- package/dist/label.d.ts +1 -68
- package/dist/label.js +1 -1
- package/dist/list.d.ts +295 -0
- package/dist/list.js +1 -0
- package/dist/llms.txt +7 -1
- package/dist/main.d.ts +4 -27
- package/dist/main.js +1 -1
- package/dist/mantle.css +6 -6
- package/dist/media-object.d.ts +6 -7
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +80 -33
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +7 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -22
- package/dist/pagination.js +1 -1
- package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
- package/dist/popover.d.ts +6 -7
- package/dist/popover.js +1 -1
- package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
- package/dist/{primitive-BFUir4UB.js → primitive-wm7Wk-gy.js} +1 -1
- package/dist/progress.d.ts +55 -46
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -9
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +71 -60
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
- package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +4 -8
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
- package/dist/{select-xfyY5Vt1.js → select-D-5u0Blc.js} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +725 -0
- package/dist/selectable-list.js +1 -0
- package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
- package/dist/separator.d.ts +6 -37
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +231 -47
- package/dist/sheet.js +1 -1
- package/dist/sizes-Dje_rwKc.d.ts +29 -0
- package/dist/skeleton-Bu3tgNcW.js +1 -0
- package/dist/skeleton.d.ts +2 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +4 -34
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +2 -21
- package/dist/slider.js +1 -1
- package/dist/slot-DmPrjM7N.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +20 -12
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
- package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
- package/dist/switch.d.ts +6 -3
- package/dist/switch.js +1 -1
- package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
- package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +29 -15
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -3
- package/dist/text-area.js +1 -1
- package/dist/theme-D8kZCOzM.js +1 -0
- package/dist/theme-provider-Djj_jBo6.js +1 -0
- package/dist/theme-switcher.d.ts +45 -0
- package/dist/theme-switcher.js +1 -0
- package/dist/theme.d.ts +15 -101
- package/dist/theme.js +1 -1
- package/dist/{toast-Bwno5LUs.js → toast-RkhbliFh.js} +1 -1
- package/dist/toast.d.ts +13 -37
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +10 -44
- package/dist/tooltip.js +1 -1
- package/dist/types-C19IR7jf.d.ts +48 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-copy-to-clipboard-DqQ0_N3E.js +1 -0
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- package/dist/utils.js +1 -1
- package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
- package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
- package/dist/virtual-DZMBu7Ch.js +1 -0
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
- package/package.json +79 -344
- package/dist/browser-only-BSl_hruR.js +0 -1
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/cx-C1UYP5We.js +0 -1
- package/dist/icon-SUx16Sl3.js +0 -1
- package/dist/index-CJbKEKr2.d.ts +0 -20
- package/dist/slot-DT_E5BQx.js +0 -1
- package/dist/theme-provider-BNFS3Acf.js +0 -1
- package/dist/use-copy-to-clipboard-BLpquU9d.js +0 -1
- package/dist/use-prefers-reduced-motion-CWIoFA6W.js +0 -1
package/dist/theme.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./themes-CYNpplwN.js";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/theme/mantle-style-sheets.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Browser-accessible URLs for mantle's three lazy-loaded theme stylesheets.
|
|
@@ -155,14 +154,7 @@ declare function fixMediaScriptContent(forceTheme?: ResolvedTheme): string;
|
|
|
155
154
|
* </head>
|
|
156
155
|
* ```
|
|
157
156
|
*/
|
|
158
|
-
declare function MantleStyleSheets({
|
|
159
|
-
darkCssUrl,
|
|
160
|
-
lightHighContrastCssUrl,
|
|
161
|
-
darkHighContrastCssUrl,
|
|
162
|
-
forceTheme,
|
|
163
|
-
nonce,
|
|
164
|
-
ssrCookie
|
|
165
|
-
}: MantleStyleSheetsProps): import("react").JSX.Element;
|
|
157
|
+
declare function MantleStyleSheets({ darkCssUrl, lightHighContrastCssUrl, darkHighContrastCssUrl, forceTheme, nonce, ssrCookie }: MantleStyleSheetsProps): import("react").JSX.Element;
|
|
166
158
|
declare namespace MantleStyleSheets {
|
|
167
159
|
var displayName: string;
|
|
168
160
|
}
|
|
@@ -176,7 +168,7 @@ type ThemeProviderProps = PropsWithChildren;
|
|
|
176
168
|
/**
|
|
177
169
|
* ThemeProvider is a React Context Provider that provides the current theme and a function to set the theme.
|
|
178
170
|
*
|
|
179
|
-
* @see https://mantle.ngrok.com/components/theme
|
|
171
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#themeprovider
|
|
180
172
|
*
|
|
181
173
|
* @example
|
|
182
174
|
* ```tsx
|
|
@@ -185,9 +177,7 @@ type ThemeProviderProps = PropsWithChildren;
|
|
|
185
177
|
* </ThemeProvider>
|
|
186
178
|
* ```
|
|
187
179
|
*/
|
|
188
|
-
declare function ThemeProvider({
|
|
189
|
-
children
|
|
190
|
-
}: ThemeProviderProps): import("react").JSX.Element;
|
|
180
|
+
declare function ThemeProvider({ children }: ThemeProviderProps): import("react").JSX.Element;
|
|
191
181
|
declare namespace ThemeProvider {
|
|
192
182
|
var displayName: string;
|
|
193
183
|
}
|
|
@@ -201,33 +191,14 @@ declare function useTheme(): ThemeProviderState;
|
|
|
201
191
|
* Read the theme and applied theme from the `<html>` element.
|
|
202
192
|
*/
|
|
203
193
|
declare function readThemeFromHtmlElement(): {
|
|
204
|
-
appliedTheme: "
|
|
205
|
-
theme: "
|
|
194
|
+
appliedTheme: "dark" | "dark-high-contrast" | "light" | "light-high-contrast" | undefined;
|
|
195
|
+
theme: "dark" | "dark-high-contrast" | "light" | "light-high-contrast" | "system" | undefined;
|
|
206
196
|
};
|
|
207
197
|
/**
|
|
208
198
|
* If the theme is "system", it will resolve the theme based on the user's media query preferences, otherwise it will return the theme as is.
|
|
209
199
|
* This will mirror the result that gets applied to the <html> element.
|
|
210
200
|
*/
|
|
211
|
-
declare function useAppliedTheme(): "
|
|
212
|
-
/**
|
|
213
|
-
* determineThemeFromMediaQuery returns the theme that should be used based on the user's media query preferences.
|
|
214
|
-
* @private
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```tsx
|
|
218
|
-
* const theme = determineThemeFromMediaQuery({
|
|
219
|
-
* prefersDarkMode: true,
|
|
220
|
-
* prefersHighContrast: false
|
|
221
|
-
* });
|
|
222
|
-
* // Returns: "dark"
|
|
223
|
-
*
|
|
224
|
-
* const themeWithContrast = determineThemeFromMediaQuery({
|
|
225
|
-
* prefersDarkMode: false,
|
|
226
|
-
* prefersHighContrast: true
|
|
227
|
-
* });
|
|
228
|
-
* // Returns: "light-high-contrast"
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
201
|
+
declare function useAppliedTheme(): "dark" | "dark-high-contrast" | "light" | "light-high-contrast";
|
|
231
202
|
/**
|
|
232
203
|
* preventWrongThemeFlashScriptContent generates a script that prevents the wrong theme from flashing on initial page load.
|
|
233
204
|
* It checks cookies for a stored theme, and if none is found, it sets the default theme.
|
|
@@ -244,44 +215,10 @@ type PreventWrongThemeFlashScriptProps = {
|
|
|
244
215
|
*/
|
|
245
216
|
nonce?: string;
|
|
246
217
|
};
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
* This is the preferred building block for SSR apps. Pair it with
|
|
252
|
-
* {@link preloadFontLink} HTTP `Link` headers in your server entry so font fetches
|
|
253
|
-
* begin before HTML is parsed. For client-only apps without header control, pair
|
|
254
|
-
* it with {@link PreloadFont} elements in `<head>` instead.
|
|
255
|
-
*
|
|
256
|
-
* Place this as early as possible in the `<head>`.
|
|
257
|
-
*
|
|
258
|
-
* @example
|
|
259
|
-
* ```tsx
|
|
260
|
-
* // entry.server.tsx — send font preloads as HTTP headers (preferred for SSR)
|
|
261
|
-
* headers.set("Link", [
|
|
262
|
-
* `<${assetsCdnOrigin}>; rel=preconnect; crossorigin`,
|
|
263
|
-
* preloadFontLink("roobert"),
|
|
264
|
-
* preloadFontLink("jetbrains-mono"),
|
|
265
|
-
* ].join(", "));
|
|
266
|
-
*
|
|
267
|
-
* // root.tsx — only the FOUC script in <head>
|
|
268
|
-
* <head>
|
|
269
|
-
* <PreventWrongThemeFlashScript nonce={nonce} />
|
|
270
|
-
* </head>
|
|
271
|
-
* ```
|
|
272
|
-
*
|
|
273
|
-
* @param nonce - Optional CSP nonce to allowlist the inline script under a strict CSP.
|
|
274
|
-
* @returns {JSX.Element} A script tag injected before first paint.
|
|
275
|
-
* @see preloadFontLink
|
|
276
|
-
* @see PreloadFont
|
|
277
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
|
|
278
|
-
*/
|
|
279
|
-
declare const PreventWrongThemeFlashScript: {
|
|
280
|
-
({
|
|
281
|
-
nonce
|
|
282
|
-
}: PreventWrongThemeFlashScriptProps): import("react").JSX.Element;
|
|
283
|
-
displayName: string;
|
|
284
|
-
};
|
|
218
|
+
declare function PreventWrongThemeFlashScript({ nonce }: PreventWrongThemeFlashScriptProps): import("react").JSX.Element;
|
|
219
|
+
declare namespace PreventWrongThemeFlashScript {
|
|
220
|
+
var displayName: string;
|
|
221
|
+
}
|
|
285
222
|
type InitialThemeProps = {
|
|
286
223
|
className: string;
|
|
287
224
|
"data-applied-theme": ResolvedTheme;
|
|
@@ -319,9 +256,7 @@ type GetStoredThemeOptions = {
|
|
|
319
256
|
* @example
|
|
320
257
|
* getStoredTheme({ cookie: "" }) // DEFAULT_THEME
|
|
321
258
|
*/
|
|
322
|
-
declare function getStoredTheme({
|
|
323
|
-
cookie
|
|
324
|
-
}: GetStoredThemeOptions): Theme;
|
|
259
|
+
declare function getStoredTheme({ cookie }: GetStoredThemeOptions): Theme;
|
|
325
260
|
/**
|
|
326
261
|
* Extract just the mantle theme cookie from a raw `Cookie` header string.
|
|
327
262
|
*
|
|
@@ -414,30 +349,9 @@ type PreloadFontProps = {
|
|
|
414
349
|
* ```
|
|
415
350
|
*/
|
|
416
351
|
declare function preloadFontLink(name: CoreFontName): string;
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
* fonts. Include it as early as possible in the document `<head>`.
|
|
422
|
-
*
|
|
423
|
-
* @remarks
|
|
424
|
-
* For best performance, pair this with preconnect/dns-prefetch hints to the CDN.
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```tsx
|
|
428
|
-
* <head>
|
|
429
|
-
* <link rel="preconnect" href={assetsCdnOrigin} crossOrigin="anonymous" />
|
|
430
|
-
* <link rel="dns-prefetch" href={assetsCdnOrigin} />
|
|
431
|
-
* <PreloadFont name="roobert" />
|
|
432
|
-
* <PreloadFont name="jetbrains-mono" />
|
|
433
|
-
* </head>
|
|
434
|
-
* ```
|
|
435
|
-
*/
|
|
436
|
-
declare const PreloadFont: {
|
|
437
|
-
({
|
|
438
|
-
name
|
|
439
|
-
}: PreloadFontProps): import("react").JSX.Element;
|
|
440
|
-
displayName: string;
|
|
441
|
-
};
|
|
352
|
+
declare function PreloadFont({ name }: PreloadFontProps): import("react").JSX.Element;
|
|
353
|
+
declare namespace PreloadFont {
|
|
354
|
+
var displayName: string;
|
|
355
|
+
}
|
|
442
356
|
//#endregion
|
|
443
357
|
export { $resolvedTheme, $theme, type CoreFontName, MantleStyleSheets, type MantleStyleSheetsProps, type MantleThemeCssUrls, PreloadFont, PreventWrongThemeFlashScript, type ResolvedTheme, type Theme, ThemeProvider, assetsCdnOrigin, extractThemeCookie, fixMediaScriptContent, fontHref, getStoredTheme, isResolvedTheme, isTheme, mantleStyleSheetUrls, preloadFontLink, preventWrongThemeFlashScriptContent, readThemeFromHtmlElement, resolvedThemes, themes, useAppliedTheme, useInitialHtmlThemeProps, useTheme };
|
package/dist/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./theme-provider-
|
|
1
|
+
import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./theme-provider-Djj_jBo6.js";import{useEffect as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";const y=`mantle-dark-styles`,b=`mantle-light-high-contrast-styles`,x=`mantle-dark-high-contrast-styles`,S=`(prefers-color-scheme: dark)`,C=`(prefers-contrast: more) and (prefers-color-scheme: light)`,w=`(prefers-contrast: more) and (prefers-color-scheme: dark)`;function T(e,t){let n=t??e;return{dark:n===`dark`?`all`:S,lightHighContrast:n===`light-high-contrast`?`all`:C,darkHighContrast:n===`dark-high-contrast`?`all`:w}}function E(e){return e}function D(e){let{darkLinkId:t,lightHcLinkId:n,darkHcLinkId:r,mediaDark:i,mediaLightHc:a,mediaDarkHc:o,forceTheme:s}=e,c=document.documentElement.dataset.appliedTheme,l=s??c,u=document.getElementById(t),d=document.getElementById(n),f=document.getElementById(r);u&&(u.media=l===`dark`?`all`:i),d&&(d.media=l===`light-high-contrast`?`all`:a),f&&(f.media=l===`dark-high-contrast`?`all`:o)}function O(e){let t={darkLinkId:y,lightHcLinkId:b,darkHcLinkId:x,mediaDark:S,mediaLightHc:C,mediaDarkHc:w,forceTheme:e};return`(${D.toString()})(${JSON.stringify(t)})`}function k({darkCssUrl:e,lightHighContrastCssUrl:t,darkHighContrastCssUrl:n,forceTheme:i,nonce:o,ssrCookie:s}){h(()=>{function e(){let e=document.documentElement.dataset.appliedTheme;return r(e)?e:void 0}function t(){let{dark:t,lightHighContrast:n,darkHighContrast:r}=T(e(),i),a=document.getElementById(y),o=document.getElementById(b),s=document.getElementById(x);a&&(a.media=t),o&&(o.media=n),s&&(s.media=r)}t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-applied-theme`]}),()=>{n.disconnect()}},[i]);let c=s==null?void 0:a({cookie:s}),l=c===`system`?void 0:c,{dark:u,lightHighContrast:d,darkHighContrast:f}=T(l,i);return v(g,{children:[(!i||i===`dark`)&&_(`link`,{rel:`stylesheet`,id:y,href:e,media:u,suppressHydrationWarning:!0}),(!i||i===`light-high-contrast`)&&_(`link`,{rel:`stylesheet`,id:b,href:t,media:d,suppressHydrationWarning:!0}),(!i||i===`dark-high-contrast`)&&_(`link`,{rel:`stylesheet`,id:x,href:n,media:f,suppressHydrationWarning:!0}),!i&&l==null&&_(`script`,{dangerouslySetInnerHTML:{__html:O(i)},nonce:o,suppressHydrationWarning:!0})]})}k.displayName=`MantleStyleSheets`;const A=`https://assets.ngrok.com`,j=`${A}/fonts`,M={roobert:`/roobert/roobert-proportional-vf.woff2`,"jetbrains-mono":`/jetbrains/jetbrainsmono-wght.woff2`,"jetbrains-mono-italic":`/jetbrains/jetbrainsmono-italic-wght.woff2`,"family-regular":`/family/family-regular.woff2`,"family-italic":`/family/family-italic.woff2`};function N(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${j}${t}`}function P(e){return`<${N(M[e])}>; rel=preload; as=font; type="font/woff2"; crossorigin`}const F=({name:e})=>_(`link`,{rel:`preload`,href:N(M[e]),as:`font`,type:`font/woff2`,crossOrigin:`anonymous`});F.displayName=`PreloadFont`;export{m as $resolvedTheme,n as $theme,k as MantleStyleSheets,F as PreloadFont,p as PreventWrongThemeFlashScript,c as ThemeProvider,A as assetsCdnOrigin,d as extractThemeCookie,O as fixMediaScriptContent,N as fontHref,a as getStoredTheme,r as isResolvedTheme,u as isTheme,E as mantleStyleSheetUrls,P as preloadFontLink,e as preventWrongThemeFlashScriptContent,l as readThemeFromHtmlElement,s as resolvedThemes,i as themes,f as useAppliedTheme,t as useInitialHtmlThemeProps,o as useTheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{s as r}from"./theme-provider-Djj_jBo6.js";import{createContext as i,forwardRef as a,useContext as o,useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{WarningIcon as f}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as p}from"@phosphor-icons/react/WarningDiamond";import*as m from"sonner";const h=({className:t,containerAriaLabel:n,dir:i,duration_ms:a=4e3,position:o=`top-center`,style:s})=>{let l=r();return c(m.Toaster,{"data-slot":`toaster`,className:e(`toaster overlay-prompt pointer-events-auto *:duration-200`,t),containerAriaLabel:n,dir:i,duration:a,gap:12,position:o??`top-center`,style:s,theme:l,toastOptions:{unstyled:!0}})};h.displayName=`Toaster`;const g=i(``);function _(e,t){let n=t?.duration_ms;return typeof n==`number`&&n<=0&&(n=1/0),m.toast.custom(t=>c(g.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const v=i({priority:`info`}),y=a(({asChild:t,children:r,className:i,priority:a,...o},u)=>{let d=t?n:`div`,f=s(()=>({priority:a}),[a]);return c(v.Provider,{value:f,children:l(d,{"data-slot":`toast`,className:e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,i),ref:u,...o,children:[c(E,{priority:a}),r]})})});y.displayName=`Toast`;const b=a(({className:n,svg:r,...i},a)=>{let s=o(v);switch(s.priority){case`danger`:return c(t,{"data-slot":`toast-icon`,className:e(`text-danger-600`,n),ref:a,svg:r??c(f,{weight:`fill`}),...i});case`warning`:return c(t,{"data-slot":`toast-icon`,className:e(`text-warning-600`,n),ref:a,svg:r??c(p,{weight:`fill`}),...i});case`success`:return c(t,{"data-slot":`toast-icon`,className:e(`text-success-600`,n),ref:a,svg:r??c(u,{weight:`fill`}),...i});case`info`:return c(t,{"data-slot":`toast-icon`,className:e(`text-accent-600`,n),ref:a,svg:c(d,{weight:`fill`}),...i});default:throw Error(`Unreachable Case: ${s.priority}`)}});b.displayName=`ToastIcon`;const x=a(({asChild:t,className:r,onClick:i,...a},s)=>{let l=o(g);return c(t?n:`button`,{"data-slot":`toast-action`,className:e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,r),onClick:e=>{i?.(e),!e.defaultPrevented&&m.toast.dismiss(l)},ref:s,...a})});x.displayName=`ToastAction`;const S=a(({asChild:t,className:r,...i},a)=>c(t?n:`p`,{"data-slot":`toast-message`,className:e(`text-strong flex-1 text-sm font-body`,r),ref:a,...i}));S.displayName=`ToastMessage`;const C={Root:y,Action:x,Icon:b,Message:S};function w(e){e.target instanceof Element&&e.target.closest(`.overlay-prompt`)&&e.preventDefault()}const T={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function E({className:t,priority:n,...r}){return c(`div`,{"aria-hidden":!0,className:e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,T[n],t),...r})}export{w as i,h as n,_ as r,C as t};
|
package/dist/toast.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { t as WithStyleProps } from "./with-style-props-
|
|
3
|
-
import { n as SvgOnlyProps } from "./svg-only-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
3
|
+
import { n as SvgOnlyProps } from "./svg-only-BFeFS1aa.js";
|
|
4
4
|
import { ComponentProps, ReactNode } from "react";
|
|
5
5
|
import * as ToastPrimitive from "sonner";
|
|
6
|
-
|
|
7
6
|
//#region src/components/toast/toast.d.ts
|
|
8
7
|
type ToasterPrimitiveProps = ComponentProps<typeof ToastPrimitive.Toaster>;
|
|
9
8
|
type ToasterProps = WithStyleProps & Pick<ToasterPrimitiveProps, "containerAriaLabel" | "dir" | "position"> & {
|
|
@@ -14,33 +13,10 @@ type ToasterProps = WithStyleProps & Pick<ToasterPrimitiveProps, "containerAriaL
|
|
|
14
13
|
*/
|
|
15
14
|
duration_ms?: number;
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* root level of the app.
|
|
22
|
-
*
|
|
23
|
-
* @see https://mantle.ngrok.com/components/toast#toaster
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* <Toaster
|
|
28
|
-
* position="top-right"
|
|
29
|
-
* duration_ms={5000}
|
|
30
|
-
* />
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
declare const Toaster: {
|
|
34
|
-
({
|
|
35
|
-
className,
|
|
36
|
-
containerAriaLabel,
|
|
37
|
-
dir,
|
|
38
|
-
duration_ms,
|
|
39
|
-
position,
|
|
40
|
-
style
|
|
41
|
-
}: ToasterProps): import("react").JSX.Element;
|
|
42
|
-
displayName: string;
|
|
43
|
-
};
|
|
16
|
+
declare function Toaster({ className, containerAriaLabel, dir, duration_ms, position, style }: ToasterProps): import("react").JSX.Element;
|
|
17
|
+
declare namespace Toaster {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
44
20
|
type MakeToastOptions = {
|
|
45
21
|
/**
|
|
46
22
|
* Time in milliseconds that should elapse before automatically closing the toast.
|
|
@@ -58,7 +34,7 @@ type MakeToastOptions = {
|
|
|
58
34
|
* Create a toast. Provide a `<Toast.Root>` component as the `children` to be rendered
|
|
59
35
|
* inside the `<Toaster />` section.
|
|
60
36
|
*
|
|
61
|
-
* @see https://mantle.ngrok.com/components/toast#maketoast
|
|
37
|
+
* @see https://mantle.ngrok.com/components/feedback/toast#maketoast
|
|
62
38
|
*
|
|
63
39
|
* @example
|
|
64
40
|
* ```tsx
|
|
@@ -94,7 +70,7 @@ type ToastMessageProps = ComponentProps<"p"> & WithAsChild;
|
|
|
94
70
|
* A succinct message that is displayed temporarily. Toasts are used to provide
|
|
95
71
|
* feedback to the user without interrupting their workflow.
|
|
96
72
|
*
|
|
97
|
-
* @see https://mantle.ngrok.com/components/toast
|
|
73
|
+
* @see https://mantle.ngrok.com/components/feedback/toast
|
|
98
74
|
*
|
|
99
75
|
* @example
|
|
100
76
|
* Composition:
|
|
@@ -120,7 +96,7 @@ declare const Toast: {
|
|
|
120
96
|
/**
|
|
121
97
|
* A succinct message with a priority that is displayed temporarily.
|
|
122
98
|
*
|
|
123
|
-
* @see https://mantle.ngrok.com/components/toast#toastroot
|
|
99
|
+
* @see https://mantle.ngrok.com/components/feedback/toast#toastroot
|
|
124
100
|
*
|
|
125
101
|
* @example
|
|
126
102
|
* ```tsx
|
|
@@ -135,7 +111,7 @@ declare const Toast: {
|
|
|
135
111
|
/**
|
|
136
112
|
* A button that dismisses the toast when clicked.
|
|
137
113
|
*
|
|
138
|
-
* @see https://mantle.ngrok.com/components/toast#toastaction
|
|
114
|
+
* @see https://mantle.ngrok.com/components/feedback/toast#toastaction
|
|
139
115
|
*
|
|
140
116
|
* @example
|
|
141
117
|
* ```tsx
|
|
@@ -150,7 +126,7 @@ declare const Toast: {
|
|
|
150
126
|
/**
|
|
151
127
|
* An icon that visually represents the priority of the toast.
|
|
152
128
|
*
|
|
153
|
-
* @see https://mantle.ngrok.com/components/toast#toasticon
|
|
129
|
+
* @see https://mantle.ngrok.com/components/feedback/toast#toasticon
|
|
154
130
|
*
|
|
155
131
|
* @example
|
|
156
132
|
* ```tsx
|
|
@@ -164,7 +140,7 @@ declare const Toast: {
|
|
|
164
140
|
/**
|
|
165
141
|
* The message content of the toast.
|
|
166
142
|
*
|
|
167
|
-
* @see https://mantle.ngrok.com/components/toast#toastmessage
|
|
143
|
+
* @see https://mantle.ngrok.com/components/feedback/toast#toastmessage
|
|
168
144
|
*
|
|
169
145
|
* @example
|
|
170
146
|
* ```tsx
|
package/dist/toast.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./toast-
|
|
1
|
+
import{n as e,r as t,t as n}from"./toast-RkhbliFh.js";export{n as Toast,e as Toaster,t as makeToast};
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -1,38 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
-
|
|
4
3
|
//#region src/components/tooltip/tooltip.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* `Tooltip.Root` / `Tooltip.Trigger` / `Tooltip.Content` trees as usual.
|
|
10
|
-
*
|
|
11
|
-
* @see https://mantle.ngrok.com/components/tooltip#tooltipprovider
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* <TooltipProvider>
|
|
16
|
-
* <Tooltip.Root>
|
|
17
|
-
* <Tooltip.Trigger asChild>
|
|
18
|
-
* <Button type="button" appearance="outlined">
|
|
19
|
-
* Hover me
|
|
20
|
-
* </Button>
|
|
21
|
-
* </Tooltip.Trigger>
|
|
22
|
-
* <Tooltip.Content>
|
|
23
|
-
* This is a tooltip
|
|
24
|
-
* </Tooltip.Content>
|
|
25
|
-
* </Tooltip.Root>
|
|
26
|
-
* </TooltipProvider>
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const TooltipProvider: {
|
|
30
|
-
({
|
|
31
|
-
delayDuration,
|
|
32
|
-
...props
|
|
33
|
-
}: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>): import("react").JSX.Element;
|
|
34
|
-
displayName: string;
|
|
35
|
-
};
|
|
4
|
+
declare function TooltipProvider({ delayDuration, ...props }: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>): import("react").JSX.Element;
|
|
5
|
+
declare namespace TooltipProvider {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
36
8
|
/**
|
|
37
9
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
38
10
|
* This is the root, stateful component that manages the open/closed state of
|
|
@@ -43,7 +15,7 @@ declare const TooltipProvider: {
|
|
|
43
15
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
44
16
|
* layer renders on top.
|
|
45
17
|
*
|
|
46
|
-
* @see https://mantle.ngrok.com/components/tooltip#tooltiproot
|
|
18
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltiproot
|
|
47
19
|
*
|
|
48
20
|
* @example
|
|
49
21
|
* ```tsx
|
|
@@ -60,13 +32,10 @@ declare const TooltipProvider: {
|
|
|
60
32
|
* ```
|
|
61
33
|
*/
|
|
62
34
|
declare function Root(props: ComponentProps<typeof TooltipPrimitive.Root>): import("react").JSX.Element;
|
|
63
|
-
declare namespace Root {
|
|
64
|
-
var displayName: string;
|
|
65
|
-
}
|
|
66
35
|
/**
|
|
67
36
|
* The trigger button that opens the tooltip.
|
|
68
37
|
*
|
|
69
|
-
* @see https://mantle.ngrok.com/components/tooltip#tooltiptrigger
|
|
38
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltiptrigger
|
|
70
39
|
*
|
|
71
40
|
* @example
|
|
72
41
|
* ```tsx
|
|
@@ -83,9 +52,6 @@ declare namespace Root {
|
|
|
83
52
|
* ```
|
|
84
53
|
*/
|
|
85
54
|
declare function Trigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>): import("react").JSX.Element;
|
|
86
|
-
declare namespace Trigger {
|
|
87
|
-
var displayName: string;
|
|
88
|
-
}
|
|
89
55
|
/**
|
|
90
56
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
91
57
|
*
|
|
@@ -105,7 +71,7 @@ declare namespace Trigger {
|
|
|
105
71
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
106
72
|
* layer renders on top.
|
|
107
73
|
*
|
|
108
|
-
* @see https://mantle.ngrok.com/components/tooltip
|
|
74
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip
|
|
109
75
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
|
|
110
76
|
*
|
|
111
77
|
* @example
|
|
@@ -141,7 +107,7 @@ declare const Tooltip: {
|
|
|
141
107
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
142
108
|
* layer renders on top.
|
|
143
109
|
*
|
|
144
|
-
* @see https://mantle.ngrok.com/components/tooltip#tooltiproot
|
|
110
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltiproot
|
|
145
111
|
*
|
|
146
112
|
* @example
|
|
147
113
|
* ```tsx
|
|
@@ -165,7 +131,7 @@ declare const Tooltip: {
|
|
|
165
131
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
166
132
|
* layer renders on top.
|
|
167
133
|
*
|
|
168
|
-
* @see https://mantle.ngrok.com/components/tooltip#tooltipcontent
|
|
134
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltipcontent
|
|
169
135
|
*
|
|
170
136
|
* @example
|
|
171
137
|
* ```tsx
|
|
@@ -185,7 +151,7 @@ declare const Tooltip: {
|
|
|
185
151
|
/**
|
|
186
152
|
* The trigger button that opens the tooltip.
|
|
187
153
|
*
|
|
188
|
-
* @see https://mantle.ngrok.com/components/tooltip#tooltiptrigger
|
|
154
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltiptrigger
|
|
189
155
|
*
|
|
190
156
|
* @example
|
|
191
157
|
* ```tsx
|
package/dist/tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{forwardRef as t}from"react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"@radix-ui/react-tooltip";const a=({delayDuration:e=0,...t})=>n(i.Provider,{"data-slot":`tooltip-provider`,delayDuration:e??0,...t});a.displayName=`Tooltip.Provider`;function o(e){return n(i.Root,{"data-slot":`tooltip`,...e})}o.displayName=`Tooltip.Root`;function s(e){return n(i.Trigger,{"data-slot":`tooltip-trigger`,...e})}s.displayName=`Tooltip.Trigger`;const c=t(({children:t,className:a,sideOffset:o=4,...s},c)=>n(i.Portal,{children:r(i.Content,{className:e(`bg-tooltip text-tooltip animate-in fade-in-0 zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 z-50 max-w-72 overflow-visible wrap-break-word rounded-md px-3 py-1.5 text-sm font-sans shadow`,a),"data-slot":`tooltip-content`,ref:c,sideOffset:o,...s,children:[t,n(i.Arrow,{asChild:!0,children:n(`div`,{className:`bg-tooltip z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs`})})]})}));c.displayName=`Tooltip.Content`;const l={Root:o,Content:c,Trigger:s};export{l as Tooltip,a as TooltipProvider};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "./validation-7QeiTFwl.js";
|
|
2
|
+
//#region src/components/input/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what,
|
|
5
|
+
* if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete recalls
|
|
6
|
+
* previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a
|
|
7
|
+
* browser could integrate with a device's contacts list to autocomplete email addresses in an email input field.
|
|
8
|
+
*
|
|
9
|
+
* The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local,
|
|
10
|
+
* number, range, color, and password. This attribute has no effect on input types that do not return numeric or text
|
|
11
|
+
* data, being valid for all input types except checkbox, radio, file, or any of the button types.
|
|
12
|
+
*
|
|
13
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
|
|
14
|
+
*/
|
|
15
|
+
type AutoComplete = "off" | "on" | "name" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo";
|
|
16
|
+
type WithAutoComplete = {
|
|
17
|
+
/**
|
|
18
|
+
* (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what,
|
|
19
|
+
* if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete recalls
|
|
20
|
+
* previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a
|
|
21
|
+
* browser could integrate with a device's contacts list to autocomplete email addresses in an email input field.
|
|
22
|
+
*
|
|
23
|
+
* The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local,
|
|
24
|
+
* number, range, color, and password. This attribute has no effect on input types that do not return numeric or text
|
|
25
|
+
* data, being valid for all input types except checkbox, radio, file, or any of the button types.
|
|
26
|
+
*
|
|
27
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
|
|
28
|
+
*/
|
|
29
|
+
autoComplete?: AutoComplete;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A string specifying the type of control to render. For example, to create a checkbox, a value of `"checkbox"` is used.
|
|
33
|
+
* If omitted (or an unknown value is specified), the input type `"text"` is used, creating a plaintext input field.
|
|
34
|
+
*
|
|
35
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
|
|
36
|
+
*/
|
|
37
|
+
type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
|
|
38
|
+
type WithInputType = {
|
|
39
|
+
/**
|
|
40
|
+
* A string specifying the type of control to render. For example, to create a checkbox, a value of `"checkbox"` is used.
|
|
41
|
+
* If omitted (or an unknown value is specified), the input type `"text"` is used, creating a plaintext input field.
|
|
42
|
+
*
|
|
43
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
|
|
44
|
+
*/
|
|
45
|
+
type?: InputType;
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { WithInputType as i, InputType as n, WithAutoComplete as r, AutoComplete as t };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { a as Booleanish, i as DeepNonNullable, n as CssProperties, o as parseBooleanish, r as VariantProps, t as $cssProperties } from "./index-
|
|
3
|
-
import { t as WithStyleProps } from "./with-style-props-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { a as Booleanish, i as DeepNonNullable, n as CssProperties, o as parseBooleanish, r as VariantProps, t as $cssProperties } from "./index-D47aqlpz.js";
|
|
3
|
+
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
4
4
|
export { $cssProperties, type Booleanish, type CssProperties, type DeepNonNullable, type VariantProps, type WithAsChild, type WithStyleProps, parseBooleanish };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./copy-to-clipboard-BsCQ9m6K.js";function t(){return e}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./browser-only-CPH56Xw_.js";import{useEffect as t,useState as n}from"react";const r=`(prefers-reduced-motion: no-preference)`;function i(){return!e()||!window.matchMedia(r).matches}function a(){let[e,a]=n(!0);return t(()=>{let e=window.matchMedia(r);a(i());function t(e){a(!e.matches)}return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[]),e}export{a as n,i as t};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { _ as timeSortingDirections, a as AlphanumericSortingDirection, c as TimeSortingDirection, d as isSortingDirection, f as isSortingMode, g as timeSortingByDirection, h as sortingModes, i as $timeSortingDirection, l as alphanumericSortingDirections, m as sortingDirections, n as $sortingDirection, o as SortingDirection, p as isTimeSortingDirection, r as $sortingMode, s as SortingMode, t as $alphanumericSortingDirection, u as isAlphanumericSortingDirection } from "./direction-
|
|
2
|
-
import { a as composeRefs, i as inView, n as MarginType, r as ViewChangeHandler, s as copyToClipboard, t as InViewOptions } from "./in-view-
|
|
3
|
-
|
|
1
|
+
import { _ as timeSortingDirections, a as AlphanumericSortingDirection, c as TimeSortingDirection, d as isSortingDirection, f as isSortingMode, g as timeSortingByDirection, h as sortingModes, i as $timeSortingDirection, l as alphanumericSortingDirections, m as sortingDirections, n as $sortingDirection, o as SortingDirection, p as isTimeSortingDirection, r as $sortingMode, s as SortingMode, t as $alphanumericSortingDirection, u as isAlphanumericSortingDirection } from "./direction-BjU0bPST.js";
|
|
2
|
+
import { a as composeRefs, i as inView, n as MarginType, r as ViewChangeHandler, s as copyToClipboard, t as InViewOptions } from "./in-view-nkSOdED2.js";
|
|
4
3
|
//#region src/utils/sorting/compare.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Compare dates in newest-to-oldest (descending) order.
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./copy-to-clipboard-
|
|
1
|
+
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./copy-to-clipboard-BsCQ9m6K.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./direction-Wa9W2F61.js";import{t as h}from"./in-view-C2DpZ6s0.js";function g(e,t){return Math.sign(t.getTime()-e.getTime())}function _(e,t){return Math.sign(e.getTime()-t.getTime())}export{p as $alphanumericSortingDirection,c as $sortingDirection,d as $sortingMode,o as $timeSortingDirection,n as alphanumericSortingDirections,g as compareDatesNewestToOldest,_ as compareDatesOldestToNewest,e as composeRefs,t as copyToClipboard,h as inView,l as isAlphanumericSortingDirection,f as isSortingDirection,r as isSortingMode,s as isTimeSortingDirection,m as sortingDirections,i as sortingModes,a as timeSortingByDirection,u as timeSortingDirections};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AriaAttributes, ReactNode } from "react";
|
|
2
|
-
|
|
3
2
|
//#region src/components/field/validation.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The shared validation state vocabulary for Mantle form controls.
|
|
@@ -76,21 +75,17 @@ type ParsedValidation = {
|
|
|
76
75
|
*/
|
|
77
76
|
validation: ValidationState | undefined;
|
|
78
77
|
};
|
|
79
|
-
/**
|
|
80
|
-
* Provides a resolved field validation state to Mantle controls rendered
|
|
81
|
-
* inside a `Field.Item` or `Field.Control`.
|
|
82
|
-
*/
|
|
83
78
|
/**
|
|
84
79
|
* Returns `true` when an `aria-invalid` value represents an invalid control.
|
|
85
80
|
* ARIA treats any value except `false` as an invalid state, including
|
|
86
81
|
* `"grammar"` and `"spelling"`.
|
|
87
82
|
*/
|
|
88
|
-
declare const isAriaInvalid: (ariaInvalid: AriaInvalid | undefined) => ariaInvalid is
|
|
83
|
+
declare const isAriaInvalid: (ariaInvalid: AriaInvalid | undefined) => ariaInvalid is "grammar" | "spelling" | "true" | true;
|
|
89
84
|
/**
|
|
90
85
|
* Resolves a `validation` prop to a concrete validation state and normalizes
|
|
91
86
|
* `false` to `undefined` so it can be used directly with `data-validation`.
|
|
92
87
|
*/
|
|
93
|
-
declare const resolveValidation: (validation: ValidationProp | undefined) => "
|
|
88
|
+
declare const resolveValidation: (validation: ValidationProp | undefined) => "error" | "success" | "warning" | undefined;
|
|
94
89
|
/**
|
|
95
90
|
* Resolves the shared Mantle validation contract for form controls.
|
|
96
91
|
*
|
|
@@ -98,10 +93,6 @@ declare const resolveValidation: (validation: ValidationProp | undefined) => "su
|
|
|
98
93
|
* Otherwise, `validation="error"` maps to `aria-invalid=true`, and neutral
|
|
99
94
|
* controls receive `aria-invalid=false` unless `defaultAriaInvalid` is false.
|
|
100
95
|
*/
|
|
101
|
-
declare const parseValidation: ({
|
|
102
|
-
"aria-invalid": ariaInvalid,
|
|
103
|
-
defaultAriaInvalid,
|
|
104
|
-
validation: validationProp
|
|
105
|
-
}: ParseValidationOptions) => ParsedValidation;
|
|
96
|
+
declare const parseValidation: ({ "aria-invalid": ariaInvalid, defaultAriaInvalid, validation: validationProp }: ParseValidationOptions) => ParsedValidation;
|
|
106
97
|
//#endregion
|
|
107
98
|
export { ValidationState as a, parseValidation as c, ValidationProp as i, resolveValidation as l, ParsedValidation as n, WithValidation as o, Validation as r, isAriaInvalid as s, AriaInvalid as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as e,createElement as t,useContext as n}from"react";const r=e(void 0),i=({children:e,validation:n})=>t(r.Provider,{value:n},e),a=()=>n(r),o=e=>e!=null&&e!==!1&&e!==`false`,s=e=>(typeof e==`function`?e():e)||void 0,c=({"aria-invalid":e,defaultAriaInvalid:t=!0,validation:n})=>{let r=o(e)?`error`:s(n),i=e??(r===`error
|
|
1
|
+
import{createContext as e,createElement as t,useContext as n}from"react";const r=e(void 0),i=({children:e,validation:n})=>t(r.Provider,{value:n},e),a=()=>n(r),o=e=>e!=null&&e!==!1&&e!==`false`,s=e=>(typeof e==`function`?e():e)||void 0,c=({"aria-invalid":e,defaultAriaInvalid:t=!0,validation:n})=>{let r=o(e)?`error`:s(n),i=e??(r===`error`||!t&&void 0);return{isInvalid:o(i),ariaInvalid:i,validation:r}};export{a,s as i,o as n,c as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./slot-DmPrjM7N.js";import{Children as r,createContext as i,forwardRef as a,isValidElement as o,useCallback as s,useContext as c,useEffect as l,useId as u,useMemo as d,useRef as f,useState as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";import{useVirtualizer as g}from"@tanstack/react-virtual";const _=i(null);function v(e){let t=c(_);return m(t,`List.${e} must be composed inside List.Root / List.VirtualRoot (or a SelectableList viewport).`),t}const y=i(null),b=i(null);function x(e){return o(e)?e.props.disabled===!0:!1}function S({start:e,step:t,count:n,isItemDisabled:r}){for(let i=e;i>=0&&i<n;i+=t)if(!r(i))return i;return-1}const C=`a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])`;function w(e){let t=e.matches(C)?e:e.querySelector(C);return t instanceof HTMLElement?t:null}function T(e){let t=e instanceof Element?e.closest(`[data-index]`):null;if(t==null)return null;let n=Number(t.getAttribute(`data-index`));return!Number.isInteger(n)||n<0?null:{item:t,index:n}}function E(e,t){if(!(e instanceof Element))return!1;let n=e.closest(`a[href], button, input, select, textarea, label, [role="button"], [role="link"], [role="menuitem"], [contenteditable="true"]`);return n!=null&&t.contains(n)}function D({count:e,isItemDisabled:t,focusItemAt:n}){return{onKeyDown:r=>{if(r.target instanceof HTMLElement&&(r.target.isContentEditable||r.target.tagName===`INPUT`||r.target.tagName===`TEXTAREA`||r.target.tagName===`SELECT`)||r.altKey||r.ctrlKey||r.metaKey)return;let i=T(r.target);if(i==null)return;let a=-1,o=1;switch(r.key){case`ArrowDown`:o=1,a=S({start:i.index+1,step:o,count:e,isItemDisabled:t});break;case`ArrowUp`:o=-1,a=S({start:i.index-1,step:o,count:e,isItemDisabled:t});break;case`Home`:o=1,a=S({start:0,step:o,count:e,isItemDisabled:t});break;case`End`:o=-1,a=S({start:e-1,step:o,count:e,isItemDisabled:t});break;default:return}r.preventDefault(),a>=0&&a!==i.index&&n(a,o)}}}function O({count:e,enabled:t,isItemDisabled:n,onActivate:r,itemId:i,scrollToIndex:a}){let[o,s]=p(-1),c=f(!1),u=o>=e?e-1:o;if(l(()=>{o>=e&&s(e-1)},[o,e]),!t)return{activeIndex:-1,collectionProps:{}};let d=e=>n?.(e)??!1,m=(t,n)=>S({start:t,step:n,count:e,isItemDisabled:d}),h=e=>{e<0||(s(e),a(e))};return{activeIndex:u,collectionProps:{tabIndex:0,"aria-activedescendant":u>=0?i(u):void 0,onMouseDown:e=>{let t=T(e.target);if(t!=null&&!d(t.index)){s(t.index),c.current=!1;return}c.current=!0},onClick:e=>{if(e.defaultPrevented)return;let t=T(e.target);t==null||d(t.index)||E(e.target,t.item)||(s(t.index),r?.(t.index))},onFocus:t=>{if(t.target!==t.currentTarget){let e=T(t.target);e!=null&&!d(e.index)&&s(e.index),t.target instanceof HTMLElement&&t.target.tabIndex>=0||t.currentTarget.focus({preventScroll:!0}),c.current=!1;return}let n=c.current;c.current=!1,e>0&&!n&&s(e=>e<0?m(0,1):e)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s(-1),c.current=!1)},onKeyDown:t=>{if(t.target===t.currentTarget&&!(t.altKey||t.ctrlKey||t.metaKey))switch(c.current=!1,t.key){case`ArrowDown`:t.preventDefault(),h(m(u<0?0:u+1,1));break;case`ArrowUp`:t.preventDefault(),h(u<0?m(0,1):m(u-1,-1));break;case`Home`:t.preventDefault(),h(m(0,1));break;case`End`:t.preventDefault(),h(m(e-1,-1));break;case` `:case`Enter`:!t.repeat&&u>=0&&!d(u)&&(t.preventDefault(),r?.(u));break;default:break}}}}}function k({count:e,focusItemAt:t,isItemDisabled:n,onActivate:r,itemId:i,scrollToIndex:a,semantics:o}){let s=u(),c=d(()=>({semantics:o}),[o]),l=d(()=>i??(e=>`${s}-item-${e}`),[i,s]),{activeIndex:f,collectionProps:p}=O({count:e,enabled:o===`grid`,isItemDisabled:n,onActivate:r,itemId:l,scrollToIndex:a}),m=d(()=>({activeIndex:f,stampItemId:i==null?l:null}),[f,l,i]);return{collectionProps:o===`list`?D({count:e,isItemDisabled:n,focusItemAt:t}):p,gridNav:m,listContext:c}}function A({"aria-label":e,"aria-labelledby":n,"aria-multiselectable":r,children:i,className:a,collectionProps:o,gridNav:s,listContext:c,viewportProps:l,viewportRef:u}){return h(_.Provider,{value:c,children:h(b.Provider,{value:s,children:h(`div`,{ref:u,"data-slot":`list`,className:t(`border-popover bg-popover scrollbar overscroll-none overflow-x-hidden overflow-y-auto rounded-md border p-1`,a),...l,children:h(`div`,{"data-slot":`list-collection`,role:c.semantics===`grid`?`grid`:`list`,"aria-label":e,"aria-labelledby":n,"aria-multiselectable":r,className:`relative flex w-full flex-col gap-px outline-hidden`,...o,children:i})})})})}A.displayName=`ListPrimitiveShell`;const j=a(({asChild:r,children:i,className:a,disabled:o=!1,selected:s=!1,style:l,...u},d)=>{let{semantics:f}=v(`Item`),p=c(y),m=c(b),g=f===`grid`,_=r?n:`div`,x=p?.placement??null,S=p?.index,C=g&&m!=null&&S!=null&&m.activeIndex===S;return h(_,{ref:e(d,x?.measureRef??null),"data-slot":`list-item`,...u,id:g&&S!=null&&m?.stampItemId!=null?m.stampItemId(S):u.id,"data-index":S,"data-state":s?`selected`:`unselected`,"data-disabled":o||void 0,"data-active":C||void 0,role:g?`row`:`listitem`,"aria-selected":g?s:void 0,"aria-disabled":g&&o?!0:u[`aria-disabled`],"aria-rowindex":g?x?.posInSet:void 0,"aria-posinset":g?void 0:x?.posInSet,"aria-setsize":g?void 0:x?.setSize,className:t(`rounded-md data-[state=selected]:bg-selected-menu-item data-[active]:bg-active-menu-item data-[active]:data-[state=selected]:bg-active-selected-menu-item`,!o&&`hover:bg-active-menu-item hover:data-[state=selected]:bg-active-selected-menu-item`,!g&&!o&&`has-[:focus-visible]:bg-active-menu-item has-[:focus-visible]:data-[state=selected]:bg-active-selected-menu-item`,a),style:x?{...l,...x.style}:l,children:i})});j.displayName=`ListPrimitiveItem`;function M({children:e,index:t}){let n=d(()=>({index:t,placement:null}),[t]);return h(y.Provider,{value:n,children:e})}M.displayName=`ListPrimitivePlainItem`;const N=a(({"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,children:a,className:c,isItemDisabled:l,onActivate:u,itemId:p,semantics:m=`list`,...g},_)=>{let v=f(null),y=e(v,_),b=d(()=>r.toArray(a).filter(o),[a]),S=s(e=>{v.current?.querySelector(`[data-index="${e}"]`)?.scrollIntoView({block:`nearest`})},[]),C=s((e,t)=>{let n=v.current;if(n!=null)for(let r=e;r>=0&&r<b.length;r+=t){let e=n.querySelector(`[data-index="${r}"]`);if(e==null)continue;let t=w(e);if(t!=null){t.focus({preventScroll:!0}),e.scrollIntoView({block:`nearest`});return}}},[b.length]),{collectionProps:T,gridNav:E,listContext:D}=k({count:b.length,focusItemAt:C,isItemDisabled:l??(e=>x(b[e])),onActivate:u,itemId:p,scrollToIndex:S,semantics:m});return h(A,{"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,className:c,collectionProps:T,gridNav:E,listContext:D,viewportProps:g,viewportRef:y,children:b.map((e,t)=>h(M,{index:t,children:e},e.key??t))})});N.displayName=`ListPrimitiveRoot`;function P({virtualItem:e,count:t,measureRef:n}){return{posInSet:e.index+1,setSize:t,measureRef:n,style:{position:`absolute`,left:0,top:0,width:`100%`,transform:`translateY(${e.start}px)`}}}function F({children:e,count:t,measureRef:n,virtualItem:r}){let i=d(()=>({index:r.index,placement:P({virtualItem:r,count:t,measureRef:n})}),[r,t,n]);return h(y.Provider,{value:i,children:e})}F.displayName=`ListPrimitiveWindowedItem`;const I=a(({"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,children:a,className:c,estimateItemHeight:u=44,isItemDisabled:p,onActivate:m,overscan:_=8,itemId:v,semantics:y=`list`,...b},S)=>{let C=f(null),T=e(C,S),E=d(()=>r.toArray(a).filter(o),[a]),D=E.length,O=g({count:D,getScrollElement:()=>C.current,estimateSize:()=>u,getItemKey:e=>E[e]?.key??e,overscan:_,gap:1}),j=s(e=>O.scrollToIndex(e,{align:`auto`}),[O]),M=f(null);l(()=>()=>{M.current!=null&&cancelAnimationFrame(M.current)},[]);let{collectionProps:N,gridNav:P,listContext:I}=k({count:D,focusItemAt:s((e,t)=>{M.current!=null&&(cancelAnimationFrame(M.current),M.current=null);let n=e,r=0,i=()=>{M.current=null;let e=C.current;if(e==null||n<0||n>=D)return;O.scrollToIndex(n,{align:`auto`});let a=e.querySelector(`[data-index="${n}"]`);if(a!=null){let e=w(a);if(e!=null){e.focus({preventScroll:!0});return}n+=t,r=0}r+=1,r<10&&(M.current=requestAnimationFrame(i))};i()},[D,O]),isItemDisabled:p??(e=>x(E[e])),onActivate:m,itemId:v,scrollToIndex:j,semantics:y}),L=O.getVirtualItems(),R=L.some(e=>e.index===P.activeIndex);return h(A,{"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,className:c,collectionProps:{...N,"aria-activedescendant":R?N[`aria-activedescendant`]:void 0,"aria-rowcount":y===`grid`?D:void 0,style:{height:`${O.getTotalSize()}px`}},gridNav:P,listContext:I,viewportProps:b,viewportRef:T,children:L.map(e=>{let t=E[e.index];return t==null?null:h(F,{virtualItem:e,count:D,measureRef:O.measureElement,children:t},e.key)})})});I.displayName=`ListPrimitiveVirtualRoot`;export{j as n,N as r,I as t};
|
package/dist/well.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import "./index-D47aqlpz.js";
|
|
2
3
|
import { ComponentProps } from "react";
|
|
3
|
-
|
|
4
4
|
//#region src/components/well/well.d.ts
|
|
5
5
|
type WellProps = ComponentProps<"div"> & WithAsChild;
|
|
6
6
|
/**
|
|
@@ -12,7 +12,7 @@ type WellProps = ComponentProps<"div"> & WithAsChild;
|
|
|
12
12
|
* or your own component, forwarding all class names, `data-*` attributes, and
|
|
13
13
|
* the ref onto that child.
|
|
14
14
|
*
|
|
15
|
-
* @see https://mantle.ngrok.com/components/well
|
|
15
|
+
* @see https://mantle.ngrok.com/components/structure/well
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```tsx
|
package/dist/well.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=n(({asChild:n=!1,className:i,...a},o)=>r(n?t:`div`,{ref:o,"data-slot":`well`,className:e(`border-card-muted bg-base relative rounded-md border shadow-inner`,i),...a}));i.displayName=`Well`;export{i as Well};
|