@ngrok/mantle 0.79.3 → 0.81.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 +158 -19
- package/dist/accordion.js +1 -1
- package/dist/agent.json +5 -1
- package/dist/alert-dialog.d.ts +465 -32
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +116 -14
- package/dist/alert.js +1 -1
- package/dist/anchor-DfeXTpKW.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/area-chart.d.ts +504 -0
- package/dist/area-chart.js +1 -0
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +491 -0
- package/dist/bar-chart.js +1 -0
- package/dist/breadcrumb.d.ts +196 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-BAno7KIU.js +1 -0
- package/dist/{index-BSAizFod.d.ts → button-C-gMbPso.d.ts} +5 -5
- package/dist/{icon-button-BvQvT790.d.ts → button-C7vAl6lS.d.ts} +22 -63
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-DARFK2KJ.d.ts} +4 -4
- package/dist/button-DjpEKt2X.js +1 -0
- package/dist/button-DvHMWAPl.js +1 -0
- package/dist/button.d.ts +5 -5
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +131 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +209 -8
- package/dist/centered-layout.js +1 -1
- package/dist/chart-BROa2gqt.js +2 -0
- package/dist/chart-BcOC6Qj0.d.ts +275 -0
- package/dist/checkbox-0EoxOyMA.js +1 -0
- package/dist/checkbox.d.ts +13 -11
- package/dist/checkbox.js +1 -1
- package/dist/choice-BHwFSSyv.js +1 -0
- package/dist/choice-BNRQXszu.d.ts +254 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +242 -52
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +3 -2
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +171 -16
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +279 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +28 -6
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +67 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-BM4wPCft.d.ts +24 -0
- package/dist/dialog-DWZWd5Jt.js +1 -0
- package/dist/dialog.d.ts +226 -35
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-DZg-Cd69.d.ts} +137 -32
- package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
- package/dist/dropdown-menu-RyDWoKHx.js +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +7 -22
- package/dist/empty.js +1 -1
- package/dist/field-B1wqeZr4.js +1 -0
- package/dist/field.d.ts +568 -47
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +0 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +3 -4
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +48 -7
- package/dist/hover-card.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → icon-CX_gj6sW.d.ts} +2 -2
- package/dist/icon-d-nMCfAI.js +1 -0
- package/dist/{icon-Cevjo93X.d.ts → icon-k4E9yNWD.d.ts} +2 -2
- package/dist/icon-lZ48P8Nn.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → icons-B_DDQcVD.js} +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → icons-CF1lbWtp.js} +1 -1
- package/dist/icons-DLCs1hLP.js +1 -0
- package/dist/icons.d.ts +7 -15
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-BnlpQF0c.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-BuYDU6CF.d.ts} +42 -2
- package/dist/input.d.ts +5 -56
- package/dist/input.js +1 -1
- package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
- package/dist/label-D-D11mlp.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +490 -0
- package/dist/line-chart.js +1 -0
- package/dist/list-51KQvENW.js +1 -0
- package/dist/list.d.ts +135 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +5 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/mantle-dark-high-contrast.css +17 -0
- package/dist/mantle-dark.css +13 -0
- package/dist/mantle-light-high-contrast.css +15 -0
- package/dist/mantle.css +29 -0
- package/dist/media-object.d.ts +18 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +282 -24
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +118 -6
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +61 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CE4OlWkd.d.ts +208 -0
- package/dist/popover-CQ9s7jG5.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-trJDqIXJ.js +1 -0
- package/dist/progress.d.ts +2 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +101 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +110 -35
- package/dist/radio-group.js +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +495 -0
- package/dist/scatter-plot.js +1 -0
- package/dist/select-0z7HVS6r.d.ts +579 -0
- package/dist/select-BCHWvmyC.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +225 -298
- package/dist/selectable-list.js +1 -1
- package/dist/separator-B5UmkVRL.d.ts +75 -0
- package/dist/separator-bpE_kooz.js +1 -0
- package/dist/separator.d.ts +1 -52
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +285 -38
- package/dist/sheet.js +1 -1
- package/dist/skeleton-CsbUHbBA.js +1 -0
- package/dist/skeleton.d.ts +4 -7
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +24 -4
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/{index-Rv8RL7xy.d.ts → slot-BtwKJTLq.d.ts} +1 -1
- package/dist/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +14 -14
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +10 -7
- package/dist/switch.js +1 -1
- package/dist/table-Bo0vNxIJ.d.ts +848 -0
- package/dist/table-CGxJwtbL.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +124 -25
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-C26-Xolp.js +1 -0
- package/dist/theme-switcher.d.ts +105 -33
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +54 -15
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +86 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +50 -5
- package/dist/tooltip.js +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +9 -3
- package/dist/anchor-C_tjSVy6.js +0 -1
- package/dist/as-child-CYEVu1WY.d.ts +0 -23
- package/dist/button-5t6-JS_I.js +0 -1
- package/dist/button-ClC60Nzg.js +0 -1
- package/dist/checkbox-DJ2xl7Rc.js +0 -1
- package/dist/choice-DOdyNzFC.js +0 -1
- package/dist/compose-refs-Cjf2gfB8.js +0 -1
- package/dist/dialog-vxLIvB8M.js +0 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
- package/dist/field-context-BR01g789.js +0 -1
- package/dist/icon-CDtYjF_H.js +0 -1
- package/dist/icon-button-DV2-GZHf.js +0 -1
- package/dist/index-g2rfwNCH.d.ts +0 -1
- package/dist/input-Ct1YOqSy.js +0 -1
- package/dist/label-BMlHW_2D.js +0 -1
- package/dist/popover-D5WxxnBY.js +0 -1
- package/dist/primitive-C64-m48O.d.ts +0 -13
- package/dist/primitive-IKruV2iB.js +0 -1
- package/dist/select-Bwt2YduR.d.ts +0 -345
- package/dist/select-D-5u0Blc.js +0 -1
- package/dist/separator-kBnnv3Cw.js +0 -1
- package/dist/skeleton-Bu3tgNcW.js +0 -1
- package/dist/slot-DmPrjM7N.js +0 -1
- package/dist/svg-only-DDx6FtJd.js +0 -1
- package/dist/table-CPH2md2-.js +0 -1
- package/dist/table-CwFHXC-G.d.ts +0 -414
- package/dist/theme-D3MDng6U.js +0 -1
- package/dist/theme-provider-C9zpDyJW.js +0 -1
- package/dist/toast-BsCjaMVS.js +0 -1
- package/dist/virtual-DZMBu7Ch.js +0 -1
- /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
- /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
- /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
- /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
- /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
- /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
- /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
package/dist/qr-code.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/components/qr-code/qr-code.d.ts
|
|
4
4
|
/**
|
|
@@ -29,21 +29,117 @@ type QrCodeRootProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
29
29
|
*/
|
|
30
30
|
quietZone?: number;
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* The root container of a QR code. Encodes `value` (via the dependency-free
|
|
34
|
+
* `uqr` encoder) and renders a positioned white tile around the QR `Frame`,
|
|
35
|
+
* sharing the encoded path with the other parts via context.
|
|
36
|
+
*
|
|
37
|
+
* Set the error correction level via `ecc`. When you place a logo in an
|
|
38
|
+
* `Overlay`, use `ecc="H"` so the covered modules can still be recovered by a
|
|
39
|
+
* scanner. Tighten the surrounding whitespace with `quietZone` (defaults to the
|
|
40
|
+
* spec-recommended `4` light modules).
|
|
41
|
+
*
|
|
42
|
+
* The default styling is black modules on a white tile in every theme (never
|
|
43
|
+
* theme-aware tokens). Consumers can override those styles, but inverting a QR
|
|
44
|
+
* code's colors makes it unreliable for many scanners.
|
|
45
|
+
*
|
|
46
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
51
|
+
* <QrCode.Frame>
|
|
52
|
+
* <QrCode.Pattern />
|
|
53
|
+
* </QrCode.Frame>
|
|
54
|
+
* <QrCode.Overlay>
|
|
55
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
56
|
+
* </QrCode.Overlay>
|
|
57
|
+
* </QrCode.Root>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare const Root: ({ value, ecc, pixelSize, quietZone, asChild, className, children, ref, ...props }: QrCodeRootProps) => import("react").JSX.Element;
|
|
32
61
|
/**
|
|
33
62
|
* Props for `QrCode.Frame`, the fixed SVG element that sizes the encoded QR
|
|
34
63
|
* pattern with its `viewBox`.
|
|
35
64
|
*/
|
|
36
65
|
type QrCodeFrameProps = ComponentProps<"svg">;
|
|
66
|
+
/**
|
|
67
|
+
* The `svg` frame that holds the QR `Pattern`. Defaults to a square `size-48`
|
|
68
|
+
* and scales the encoded pattern to fit via its `viewBox`, so resize the whole
|
|
69
|
+
* code by passing a different size to `className` (e.g. `className="size-64"`).
|
|
70
|
+
*
|
|
71
|
+
* Does not support `asChild`: the QR pattern must live inside an `svg`, so the
|
|
72
|
+
* frame element is fixed and cannot be swapped.
|
|
73
|
+
*
|
|
74
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
79
|
+
* <QrCode.Frame>
|
|
80
|
+
* <QrCode.Pattern />
|
|
81
|
+
* </QrCode.Frame>
|
|
82
|
+
* <QrCode.Overlay>
|
|
83
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
84
|
+
* </QrCode.Overlay>
|
|
85
|
+
* </QrCode.Root>
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
declare const Frame: ({ className, children, ref, ...props }: QrCodeFrameProps) => import("react").JSX.Element;
|
|
37
89
|
/**
|
|
38
90
|
* Props for `QrCode.Pattern`, the fixed SVG `path` element that renders the
|
|
39
91
|
* encoded dark modules.
|
|
40
92
|
*/
|
|
41
93
|
type QrCodePatternProps = ComponentProps<"path">;
|
|
94
|
+
/**
|
|
95
|
+
* The encoded QR modules, rendered as a single `path` inside the `Frame`.
|
|
96
|
+
* Defaults to black fill (`fill-static-black`) so the code stays scannable in
|
|
97
|
+
* every theme.
|
|
98
|
+
*
|
|
99
|
+
* Does not support `asChild`: the modules are a fixed `path` and cannot be
|
|
100
|
+
* swapped for another element.
|
|
101
|
+
*
|
|
102
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
107
|
+
* <QrCode.Frame>
|
|
108
|
+
* <QrCode.Pattern />
|
|
109
|
+
* </QrCode.Frame>
|
|
110
|
+
* <QrCode.Overlay>
|
|
111
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
112
|
+
* </QrCode.Overlay>
|
|
113
|
+
* </QrCode.Root>
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
declare const Pattern: ({ className, ref, ...props }: QrCodePatternProps) => import("react").JSX.Element;
|
|
42
117
|
/**
|
|
43
118
|
* Props for `QrCode.Overlay`, the optional centered logo container rendered on
|
|
44
119
|
* top of the QR pattern.
|
|
45
120
|
*/
|
|
46
121
|
type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
122
|
+
/**
|
|
123
|
+
* An overlay centered on top of the QR code, typically holding a brand logo
|
|
124
|
+
* (e.g. `NgrokLettermarkIcon`). Renders a white, rounded "punch-out" so the
|
|
125
|
+
* logo stays legible over the modules beneath it. Because the overlay hides the
|
|
126
|
+
* center modules, use a higher `ecc` (e.g. `"H"`) on the `Root`.
|
|
127
|
+
*
|
|
128
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
133
|
+
* <QrCode.Frame>
|
|
134
|
+
* <QrCode.Pattern />
|
|
135
|
+
* </QrCode.Frame>
|
|
136
|
+
* <QrCode.Overlay>
|
|
137
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
138
|
+
* </QrCode.Overlay>
|
|
139
|
+
* </QrCode.Root>
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
declare const Overlay: ({ asChild, className, ref, ...props }: QrCodeOverlayProps) => import("react").JSX.Element;
|
|
47
143
|
/**
|
|
48
144
|
* A QR code. Compose `QrCode.Root` with a `QrCode.Frame` wrapping a
|
|
49
145
|
* `QrCode.Pattern`, and optionally a `QrCode.Overlay` for a centered logo.
|
|
@@ -95,7 +191,7 @@ declare const QrCode: {
|
|
|
95
191
|
* </QrCode.Root>
|
|
96
192
|
* ```
|
|
97
193
|
*/
|
|
98
|
-
readonly Root:
|
|
194
|
+
readonly Root: typeof Root;
|
|
99
195
|
/**
|
|
100
196
|
* The `svg` frame that holds the QR `Pattern`. Defaults to `size-48`; resize
|
|
101
197
|
* the whole code by passing a different size to `className`.
|
|
@@ -114,7 +210,7 @@ declare const QrCode: {
|
|
|
114
210
|
* </QrCode.Root>
|
|
115
211
|
* ```
|
|
116
212
|
*/
|
|
117
|
-
readonly Frame:
|
|
213
|
+
readonly Frame: typeof Frame;
|
|
118
214
|
/**
|
|
119
215
|
* The encoded QR modules, rendered as a `path` inside the `Frame`. Defaults
|
|
120
216
|
* to black fill so the code stays scannable in every theme.
|
|
@@ -133,7 +229,7 @@ declare const QrCode: {
|
|
|
133
229
|
* </QrCode.Root>
|
|
134
230
|
* ```
|
|
135
231
|
*/
|
|
136
|
-
readonly Pattern:
|
|
232
|
+
readonly Pattern: typeof Pattern;
|
|
137
233
|
/**
|
|
138
234
|
* An overlay centered on top of the QR code, typically holding a brand logo.
|
|
139
235
|
* Renders a white rounded "punch-out" so the logo stays legible. Use a higher
|
|
@@ -153,7 +249,7 @@ declare const QrCode: {
|
|
|
153
249
|
* </QrCode.Root>
|
|
154
250
|
* ```
|
|
155
251
|
*/
|
|
156
|
-
readonly Overlay:
|
|
252
|
+
readonly Overlay: typeof Overlay;
|
|
157
253
|
};
|
|
158
254
|
//#endregion
|
|
159
255
|
export { QrCode, type QrCodeErrorCorrection, type QrCodeFrameProps, type QrCodeOverlayProps, type QrCodePatternProps, type QrCodeRootProps };
|
package/dist/qr-code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{createContext as n,useContext as r,useMemo as i}from"react";import a from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";import{encode as s}from"uqr";const c=n(null);function l(e,t){a(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),a(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function u(){let e=r(c);return a(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function d(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const f={Root:({value:n,ecc:r=`L`,pixelSize:a=10,quietZone:u=4,asChild:f,className:p,children:m,ref:h,...g})=>{l(a,u);let _=i(()=>s(n,{ecc:r,border:u}),[n,r,u]),v=i(()=>d(_.data,a),[_,a]),y=i(()=>({path:v,dimension:_.size*a}),[v,_.size,a]),b=f?t:`div`;return o(c.Provider,{value:y,children:o(b,{ref:h,...g,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})},Frame:({className:t,children:n,ref:r,...i})=>{let{dimension:a}=u();return o(`svg`,{ref:r,...i,"data-slot":`qr-code-frame`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${a} ${a}`,shapeRendering:`crispEdges`,className:e(`block size-48`,t),children:n})},Pattern:({className:t,ref:n,...r})=>{let{path:i}=u();return o(`path`,{ref:n,...r,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})},Overlay:({asChild:n,className:r,ref:i,...a})=>o(n?t:`div`,{ref:i,...a,"data-slot":`qr-code-overlay`,className:e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,r)})};export{f as QrCode};
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { HTMLAttributes, ReactNode } from "react";
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { HTMLAttributes, PropsWithChildren, ReactNode, Ref } from "react";
|
|
3
3
|
import { RadioGroupProps, RadioProps } from "@headlessui/react";
|
|
4
4
|
//#region src/components/radio-group/radio-group.d.ts
|
|
5
|
+
type RadioGroupProps$1 = PropsWithChildren<Omit<RadioGroupProps, "as" | "children">> & {
|
|
6
|
+
ref?: Ref<HTMLElement>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A group of radio items. It manages the state of the children radios. Unstyled and simple.
|
|
10
|
+
* Used as the root component for grouping related radio items where only one can be selected.
|
|
11
|
+
*
|
|
12
|
+
* The recommended Field composition is `Field.Set` + `Field.Legend` + `RadioGroup.Root`,
|
|
13
|
+
* which uses fieldset semantics so all radios share a single accessible name from the
|
|
14
|
+
* legend. As an alternative, when individual items render inside a `Field.Control`,
|
|
15
|
+
* each item picks up `aria-invalid` and `aria-errormessage` from `FieldControlContext`.
|
|
16
|
+
* Note: `aria-describedby` is owned by Headless UI's Radio primitive and does not
|
|
17
|
+
* propagate through `FieldControlContext`, so helper text wired via `Field.Description`
|
|
18
|
+
* will not be associated automatically in that alternative composition.
|
|
19
|
+
*
|
|
20
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouproot
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <RadioGroup.Root value={value} onChange={setValue}>
|
|
25
|
+
* <RadioGroup.Item value="option1">
|
|
26
|
+
* <RadioGroup.Indicator />
|
|
27
|
+
* <span>Option 1</span>
|
|
28
|
+
* </RadioGroup.Item>
|
|
29
|
+
* <RadioGroup.Item value="option2">
|
|
30
|
+
* <RadioGroup.Indicator />
|
|
31
|
+
* <span>Option 2</span>
|
|
32
|
+
* </RadioGroup.Item>
|
|
33
|
+
* </RadioGroup.Root>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const Root: ({ ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
5
37
|
/**
|
|
6
38
|
* The shape of the radio state context.
|
|
7
39
|
*/
|
|
@@ -12,6 +44,31 @@ type RadioStateContextValue = {
|
|
|
12
44
|
focus: boolean;
|
|
13
45
|
hover: boolean;
|
|
14
46
|
};
|
|
47
|
+
type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
48
|
+
ref?: Ref<HTMLDivElement>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A simple radio item that can be used inside a radio group. The "conventional" use-case.
|
|
52
|
+
* Must be a child of `RadioGroup`.
|
|
53
|
+
*
|
|
54
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
55
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
56
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
57
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
58
|
+
*
|
|
59
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupitem
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <RadioGroup.Root value={value} onChange={setValue}>
|
|
64
|
+
* <RadioGroup.Item value="option1">
|
|
65
|
+
* <RadioGroup.Indicator />
|
|
66
|
+
* <span>Option 1</span>
|
|
67
|
+
* </RadioGroup.Item>
|
|
68
|
+
* </RadioGroup.Root>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare const Item: ({ children, className, ref, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
15
72
|
type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
16
73
|
children?: ReactNode | ((context: RadioStateContextValue) => ReactNode);
|
|
17
74
|
};
|
|
@@ -33,28 +90,60 @@ type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
33
90
|
* </RadioGroup.Item>
|
|
34
91
|
* ```
|
|
35
92
|
*/
|
|
36
|
-
declare const Indicator: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
93
|
+
declare const Indicator: ({ children, className, ...props }: RadioIndicatorProps) => import("react").JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* A group of radio list items. Use RadioGroup.ListItem as direct children.
|
|
96
|
+
*/
|
|
97
|
+
declare const List: ({ className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
98
|
+
type RadioListItemProps = RadioItemProps;
|
|
99
|
+
/**
|
|
100
|
+
* A radio list item that is used inside a `RadioGroup.List`.
|
|
101
|
+
*
|
|
102
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
103
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
104
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
105
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
106
|
+
*/
|
|
107
|
+
declare const ListItem: ({ children, className, ref, ...props }: RadioListItemProps) => import("react").JSX.Element;
|
|
40
108
|
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;
|
|
109
|
+
type RadioCardProps = RadioItemProps;
|
|
110
|
+
/**
|
|
111
|
+
* A radio card item. Use it as a child of `RadioGroup`
|
|
112
|
+
*
|
|
113
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
114
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
115
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
116
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
117
|
+
*/
|
|
118
|
+
declare const Card: ({ children, className, ref, ...props }: RadioCardProps) => import("react").JSX.Element;
|
|
41
119
|
/**
|
|
42
120
|
* The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.
|
|
43
121
|
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
44
122
|
*/
|
|
45
|
-
declare const ItemContent: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
123
|
+
declare const ItemContent: ({ asChild, children, className, ...props }: RadioItemContentProps) => import("react").JSX.Element;
|
|
124
|
+
/**
|
|
125
|
+
* An inline group of radio buttons. Use RadioGroup.Button as direct children.
|
|
126
|
+
* Renders the radio group itself (it wraps `Root`) — use it *in place of*
|
|
127
|
+
* `RadioGroup.Root`, never nested inside one, or the buttons bind to an
|
|
128
|
+
* inner, uncontrolled group and outer `value`/`onChange` props are ignored.
|
|
129
|
+
*/
|
|
130
|
+
declare const ButtonGroup: ({ className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
131
|
+
type RadioButtonProps = RadioItemProps;
|
|
132
|
+
/**
|
|
133
|
+
* A radio button that is used inside a `RadioGroup.ButtonGroup`.
|
|
134
|
+
*
|
|
135
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
136
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
137
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
138
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
139
|
+
*/
|
|
140
|
+
declare const Button: ({ children, className, ref, ...props }: RadioButtonProps) => import("react").JSX.Element;
|
|
49
141
|
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
50
142
|
/**
|
|
51
143
|
* A sandbox container for input elements composed within radio group items.
|
|
52
144
|
* It prevents the default behavior of the radio group when clicking on the input element or accepting keyboard input.
|
|
53
145
|
*/
|
|
54
|
-
declare const InputSandbox: {
|
|
55
|
-
({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps): import("react").JSX.Element;
|
|
56
|
-
displayName: string;
|
|
57
|
-
};
|
|
146
|
+
declare const InputSandbox: ({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps) => import("react").JSX.Element;
|
|
58
147
|
/**
|
|
59
148
|
* A group of radio items. It manages the state of the children radios.
|
|
60
149
|
*
|
|
@@ -114,9 +203,7 @@ declare const RadioGroup: {
|
|
|
114
203
|
* </RadioGroup.ButtonGroup>
|
|
115
204
|
* ```
|
|
116
205
|
*/
|
|
117
|
-
readonly Button:
|
|
118
|
-
children?: ReactNode | undefined;
|
|
119
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
206
|
+
readonly Button: typeof Button;
|
|
120
207
|
/**
|
|
121
208
|
* An inline group of radio buttons. Use RadioGroup.Button as direct children for horizontal radio layouts.
|
|
122
209
|
* Renders the radio group itself — use it in place of `RadioGroup.Root`, never nested inside one.
|
|
@@ -133,9 +220,7 @@ declare const RadioGroup: {
|
|
|
133
220
|
* </RadioGroup.ButtonGroup>
|
|
134
221
|
* ```
|
|
135
222
|
*/
|
|
136
|
-
readonly ButtonGroup:
|
|
137
|
-
children?: ReactNode | undefined;
|
|
138
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
223
|
+
readonly ButtonGroup: typeof ButtonGroup;
|
|
139
224
|
/**
|
|
140
225
|
* A radio card item with enhanced styling. Use it as a child of RadioGroup for card-based radio options.
|
|
141
226
|
*
|
|
@@ -161,9 +246,7 @@ declare const RadioGroup: {
|
|
|
161
246
|
* </RadioGroup.Root>
|
|
162
247
|
* ```
|
|
163
248
|
*/
|
|
164
|
-
readonly Card:
|
|
165
|
-
children?: ReactNode | undefined;
|
|
166
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
249
|
+
readonly Card: typeof Card;
|
|
167
250
|
/**
|
|
168
251
|
* The selection indicator for any radio item. Shows the checked state with customizable appearance.
|
|
169
252
|
*
|
|
@@ -212,9 +295,7 @@ declare const RadioGroup: {
|
|
|
212
295
|
* </RadioGroup.Item>
|
|
213
296
|
* ```
|
|
214
297
|
*/
|
|
215
|
-
readonly Item:
|
|
216
|
-
children?: ReactNode | undefined;
|
|
217
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
298
|
+
readonly Item: typeof Item;
|
|
218
299
|
/**
|
|
219
300
|
* The content wrapper for any radio item. Use it to wrap labels, descriptions, or content of a radio item.
|
|
220
301
|
*
|
|
@@ -257,9 +338,7 @@ declare const RadioGroup: {
|
|
|
257
338
|
* </RadioGroup.Root>
|
|
258
339
|
* ```
|
|
259
340
|
*/
|
|
260
|
-
readonly List:
|
|
261
|
-
children?: ReactNode | undefined;
|
|
262
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
341
|
+
readonly List: typeof List;
|
|
263
342
|
/**
|
|
264
343
|
* A radio list item that is used inside a RadioGroup.List for connected list-style radio options.
|
|
265
344
|
*
|
|
@@ -285,9 +364,7 @@ declare const RadioGroup: {
|
|
|
285
364
|
* </RadioGroup.Root>
|
|
286
365
|
* ```
|
|
287
366
|
*/
|
|
288
|
-
readonly ListItem:
|
|
289
|
-
children?: ReactNode | undefined;
|
|
290
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
367
|
+
readonly ListItem: typeof ListItem;
|
|
291
368
|
/**
|
|
292
369
|
* The root radio group component. Manages the state of the children radios where only one can be selected.
|
|
293
370
|
*
|
|
@@ -303,9 +380,7 @@ declare const RadioGroup: {
|
|
|
303
380
|
* </RadioGroup.Root>
|
|
304
381
|
* ```
|
|
305
382
|
*/
|
|
306
|
-
readonly Root:
|
|
307
|
-
children?: ReactNode | undefined;
|
|
308
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
383
|
+
readonly Root: typeof Root;
|
|
309
384
|
};
|
|
310
385
|
//#endregion
|
|
311
386
|
export { RadioGroup };
|
package/dist/radio-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-B1wqeZr4.js";import{t as i}from"./input-CXmS0OFN.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useRef as u}from"react";import{jsx as d}from"react/jsx-runtime";import{Radio as f,RadioGroup as p}from"@headlessui/react";const m=({ref:e,...t})=>d(p,{"data-slot":`radio-group`,...t,ref:e}),h=s({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),g=({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{"data-slot":`radio-group-item`,className:e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,n),as:`div`,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:e=>d(h.Provider,{value:e,children:t})})},_=({checked:t,disabled:n,focus:r,hover:i})=>d(`span`,{className:e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,n&&`cursor-default opacity-50`,t&&`border-accent-600 bg-accent-600`,r&&!n&&`border-accent-600 ring-focus-accent ring-4`,i&&`border-accent-600`),children:t&&d(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),v={Button:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-button`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},ButtonGroup:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-button-group`,className:n(`flex flex-row flex-nowrap -space-x-px`,e),...r,ref:t}),Card:({children:e,className:t,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-card`,className:n(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,t),...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:t=>d(h.Provider,{value:t,children:e})})},Indicator:({children:t,className:n,...r})=>{let i=l(h);return d(`div`,{"data-slot":`radio-group-indicator`,className:e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,n),...r,children:t==null?d(_,{...i}):typeof t==`function`?t(i):t})},InputSandbox:({children:e,onClick:t,onKeyDown:n,...r})=>{let s=u(null),f=l(h),p=a.only(e),m=f.disabled||!f.checked;return d(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:s,onKeyDown:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}switch(e.key){case`Enter`:case`Tab`:break;default:e.stopPropagation()}n?.(e)},onClick:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}let n=e.target;i(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...r,children:c(p)?o(p,{disabled:f.disabled||p.props.disabled,tabIndex:m?-1:p.props.tabIndex}):null})},Item:g,ItemContent:({asChild:e=!1,children:r,className:i,...a})=>{let o=l(h);return d(e?t:`div`,{"data-slot":`radio-group-item-content`,className:n(`min-w-0 flex-1`,o.disabled&&`opacity-50`,i),...a,children:r})},List:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...r,ref:t}),ListItem:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-list-item`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},Root:m};export{v as RadioGroup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { ComponentProps, MouseEventHandler } from "react";
|
|
3
3
|
//#region src/components/sandboxed-on-click/sandboxed-on-click.d.ts
|
|
4
4
|
type BaseProps = {
|
|
@@ -58,6 +58,6 @@ type Props = ComponentProps<"div"> & WithAsChild & BaseProps;
|
|
|
58
58
|
* </TableRow>
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
declare const SandboxedOnClick:
|
|
61
|
+
declare const SandboxedOnClick: ({ allowClickEventDefault, asChild, children, onClick, ref, ...props }: Props) => import("react").JSX.Element;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { SandboxedOnClick, sandboxedOnClickProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./slot-
|
|
1
|
+
import{t as e}from"./slot-CDk0Bb9z.js";import{jsx as t}from"react/jsx-runtime";const n=({allowClickEventDefault:e=!1,onClick:t}={})=>({role:`presentation`,onClick:n=>{n.stopPropagation(),e||n.preventDefault(),t?.(n)}}),r=({allowClickEventDefault:r=!1,asChild:i=!1,children:a,onClick:o,ref:s,...c})=>t(i?e:`div`,{ref:s,...c,...n({allowClickEventDefault:r,onClick:o}),children:a});export{r as SandboxedOnClick,n as sandboxedOnClickProps};
|