@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/progress.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
2
2
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
-
|
|
4
3
|
//#region src/components/progress/types.d.ts
|
|
5
4
|
type ValueType = number | "indeterminate";
|
|
6
5
|
//#endregion
|
|
@@ -44,14 +43,57 @@ type Props = SvgAttributes & {
|
|
|
44
43
|
*/
|
|
45
44
|
indeterminateRotationSpeed?: `animation-duration-${string}`;
|
|
46
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* A simple circular progress bar which shows the completion progress of a task.
|
|
48
|
+
*
|
|
49
|
+
* The indicator color is inherited via `currentColor`. Override the default
|
|
50
|
+
* (`accent-600`) by setting the `ProgressDonut.Indicator`'s text color.
|
|
51
|
+
*
|
|
52
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <ProgressDonut.Root value={60}>
|
|
57
|
+
* <ProgressDonut.Indicator />
|
|
58
|
+
* </ProgressDonut.Root>
|
|
59
|
+
*
|
|
60
|
+
* <ProgressDonut.Root value={60}>
|
|
61
|
+
* <ProgressDonut.Indicator color="text-danger-600" />
|
|
62
|
+
* </ProgressDonut.Root>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const Root$1: {
|
|
66
|
+
({ children, className, max: _max, strokeWidth: _strokeWidth, value: _value, indeterminateRotationSpeed, ...props }: Props): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
47
69
|
type ProgressDonutIndicatorProps = Omit<ComponentProps<"g">, "children">;
|
|
70
|
+
/**
|
|
71
|
+
* The indicator for the circular progress bar.
|
|
72
|
+
*
|
|
73
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut-indicator
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* <ProgressDonut.Root value={60}>
|
|
78
|
+
* <ProgressDonut.Indicator />
|
|
79
|
+
* </ProgressDonut.Root>
|
|
80
|
+
*
|
|
81
|
+
* <ProgressDonut.Root value={60}>
|
|
82
|
+
* <ProgressDonut.Indicator color="text-danger-600" />
|
|
83
|
+
* </ProgressDonut.Root>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
declare const Indicator$1: {
|
|
87
|
+
({ className, ...props }: ProgressDonutIndicatorProps): import("react").JSX.Element;
|
|
88
|
+
displayName: string;
|
|
89
|
+
};
|
|
48
90
|
/**
|
|
49
91
|
* A simple circular progress bar which shows the completion progress of a task.
|
|
50
92
|
*
|
|
51
93
|
* The indicator color is inherited via `currentColor`. Override the default
|
|
52
94
|
* (`accent-600`) by setting the `ProgressDonut.Indicator`'s text color.
|
|
53
95
|
*
|
|
54
|
-
* @see https://mantle.ngrok.com/components/progress
|
|
96
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut
|
|
55
97
|
*
|
|
56
98
|
* @example
|
|
57
99
|
* Composition:
|
|
@@ -78,7 +120,7 @@ declare const ProgressDonut: {
|
|
|
78
120
|
* The indicator color is inherited via `currentColor`. Override the default
|
|
79
121
|
* (`accent-600`) by setting the `ProgressDonut.Indicator`'s text color.
|
|
80
122
|
*
|
|
81
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-donut-root
|
|
123
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut-root
|
|
82
124
|
*
|
|
83
125
|
* @example
|
|
84
126
|
* ```tsx
|
|
@@ -91,22 +133,11 @@ declare const ProgressDonut: {
|
|
|
91
133
|
* </ProgressDonut.Root>
|
|
92
134
|
* ```
|
|
93
135
|
*/
|
|
94
|
-
readonly Root:
|
|
95
|
-
({
|
|
96
|
-
children,
|
|
97
|
-
className,
|
|
98
|
-
max: _max,
|
|
99
|
-
strokeWidth: _strokeWidth,
|
|
100
|
-
value: _value,
|
|
101
|
-
indeterminateRotationSpeed,
|
|
102
|
-
...props
|
|
103
|
-
}: Props): import("react").JSX.Element;
|
|
104
|
-
displayName: string;
|
|
105
|
-
};
|
|
136
|
+
readonly Root: typeof Root$1;
|
|
106
137
|
/**
|
|
107
138
|
* The indicator for the circular progress bar.
|
|
108
139
|
*
|
|
109
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-donut-indicator
|
|
140
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-donut#api-progress-donut-indicator
|
|
110
141
|
*
|
|
111
142
|
* @example
|
|
112
143
|
* ```tsx
|
|
@@ -119,13 +150,7 @@ declare const ProgressDonut: {
|
|
|
119
150
|
* </ProgressDonut.Root>
|
|
120
151
|
* ```
|
|
121
152
|
*/
|
|
122
|
-
readonly Indicator:
|
|
123
|
-
({
|
|
124
|
-
className,
|
|
125
|
-
...props
|
|
126
|
-
}: ProgressDonutIndicatorProps): import("react").JSX.Element;
|
|
127
|
-
displayName: string;
|
|
128
|
-
};
|
|
153
|
+
readonly Indicator: typeof Indicator$1;
|
|
129
154
|
};
|
|
130
155
|
//#endregion
|
|
131
156
|
//#region src/components/progress/progress-bar.d.ts
|
|
@@ -154,7 +179,7 @@ type RootProps = ComponentProps<"div"> & {
|
|
|
154
179
|
* A horizontal progress bar that shows the completion progress of a task.
|
|
155
180
|
* Use this component for linear progress indication.
|
|
156
181
|
*
|
|
157
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar
|
|
182
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar
|
|
158
183
|
*
|
|
159
184
|
* @example
|
|
160
185
|
* ```tsx
|
|
@@ -172,16 +197,7 @@ type RootProps = ComponentProps<"div"> & {
|
|
|
172
197
|
* </ProgressBar.Root>
|
|
173
198
|
* ```
|
|
174
199
|
*/
|
|
175
|
-
declare function Root({
|
|
176
|
-
className,
|
|
177
|
-
children,
|
|
178
|
-
max: _max,
|
|
179
|
-
value: _value,
|
|
180
|
-
...props
|
|
181
|
-
}: RootProps): import("react").JSX.Element;
|
|
182
|
-
declare namespace Root {
|
|
183
|
-
var displayName: string;
|
|
184
|
-
}
|
|
200
|
+
declare function Root({ className, children, max: _max, value: _value, ...props }: RootProps): import("react").JSX.Element;
|
|
185
201
|
type IndicatorProps = ComponentProps<typeof ProgressPrimitive.Indicator>;
|
|
186
202
|
/**
|
|
187
203
|
* Displays the progress indicator, which visually represents the completion progress of a task.
|
|
@@ -189,7 +205,7 @@ type IndicatorProps = ComponentProps<typeof ProgressPrimitive.Indicator>;
|
|
|
189
205
|
* The visual indicator that shows the actual progress within the progress bar.
|
|
190
206
|
* This component should be used inside a ProgressBar.Root component.
|
|
191
207
|
*
|
|
192
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar-indicator
|
|
208
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar-indicator
|
|
193
209
|
*
|
|
194
210
|
* @example
|
|
195
211
|
* ```tsx
|
|
@@ -203,21 +219,14 @@ type IndicatorProps = ComponentProps<typeof ProgressPrimitive.Indicator>;
|
|
|
203
219
|
* </ProgressBar.Root>
|
|
204
220
|
* ```
|
|
205
221
|
*/
|
|
206
|
-
declare function Indicator({
|
|
207
|
-
className,
|
|
208
|
-
style,
|
|
209
|
-
...props
|
|
210
|
-
}: IndicatorProps): import("react").JSX.Element;
|
|
211
|
-
declare namespace Indicator {
|
|
212
|
-
var displayName: string;
|
|
213
|
-
}
|
|
222
|
+
declare function Indicator({ className, style, ...props }: IndicatorProps): import("react").JSX.Element;
|
|
214
223
|
/**
|
|
215
224
|
* Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
|
|
216
225
|
*
|
|
217
226
|
* A horizontal progress bar that shows the completion progress of a task.
|
|
218
227
|
* Use this component for linear progress indication.
|
|
219
228
|
*
|
|
220
|
-
* @see https://mantle.ngrok.com/components/progress
|
|
229
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar
|
|
221
230
|
*
|
|
222
231
|
* @example
|
|
223
232
|
* Composition:
|
|
@@ -249,7 +258,7 @@ declare const ProgressBar: {
|
|
|
249
258
|
* A horizontal progress bar that shows the completion progress of a task.
|
|
250
259
|
* Use this component for linear progress indication.
|
|
251
260
|
*
|
|
252
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar
|
|
261
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar
|
|
253
262
|
*
|
|
254
263
|
* @example
|
|
255
264
|
* ```tsx
|
|
@@ -274,7 +283,7 @@ declare const ProgressBar: {
|
|
|
274
283
|
* The visual indicator that shows the actual progress within the progress bar.
|
|
275
284
|
* This component should be used inside a ProgressBar.Root component.
|
|
276
285
|
*
|
|
277
|
-
* @see https://mantle.ngrok.com/components/progress#api-progress-bar-indicator
|
|
286
|
+
* @see https://mantle.ngrok.com/components/feedback/progress-bar#api-progress-bar-indicator
|
|
278
287
|
*
|
|
279
288
|
* @example
|
|
280
289
|
* ```tsx
|
package/dist/progress.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./types-D85fCNV3.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{createContext as r,useContext as i,useId as a,useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@radix-ui/react-progress";function u(e,{min:t,max:n}){return Math.min(n,Math.max(t,e))}function d(e){return typeof e==`number`}function f(e,t){return d(e)&&!Number.isNaN(e)&&e<=t&&e>=0}function p(e){return d(e)&&!Number.isNaN(e)&&e>0}const m={max:100,strokeWidth:`0.25rem`,value:0},h=r(m),g=({children:n,className:r,max:i=100,strokeWidth:a=4,value:l,indeterminateRotationSpeed:u,...g})=>{let _=p(i)?i:100,v=f(l,_)?l:l==null?0:`indeterminate`,x=y(a??m.strokeWidth),S=d(v)?v:void 0,C=b(x),w=o(()=>({max:_,strokeWidth:x,value:v}),[_,x,v]);return s(h.Provider,{value:w,children:c(`svg`,{"data-slot":`progress-donut`,"aria-valuemax":_,"aria-valuemin":0,"aria-valuenow":S,className:e(`size-6 text-gray-200 dark:text-gray-300`,v===`indeterminate`&&[`animate-spin`,u??`animation-duration-[15s]`],r),"data-max":_,"data-min":0,"data-value":S,height:`100%`,role:`progressbar`,width:`100%`,...g,children:[s(`circle`,{className:`[r:var(--radius)]`,cx:`50%`,cy:`50%`,fill:`transparent`,stroke:`currentColor`,strokeWidth:x,style:t({"--radius":C})}),n]})})};g.displayName=`ProgressDonut`;const _=({className:r,...o})=>{let l=a(),u=i(h)??m,d=(u.value===`indeterminate`?.6:u.value/u.max)*100,f=y(u.strokeWidth),p=b(f);return c(`g`,{"data-slot":`progress-donut-indicator`,className:e(`text-accent-600`,r),...o,children:[u.value===`indeterminate`&&s(`defs`,{children:c(`linearGradient`,{id:l,children:[s(`stop`,{className:`stop-opacity-100 stop-color-current`,offset:`0%`}),s(`stop`,{className:`stop-opacity-0 stop-color-current`,offset:`95%`})]})}),s(`circle`,{className:n(`[r:var(--radius)]`,`origin-center`),cx:`50%`,cy:`50%`,fill:`transparent`,pathLength:100,stroke:u.value===`indeterminate`?`url(#${l})`:`currentColor`,strokeDasharray:100,strokeDashoffset:100-d,strokeLinecap:`round`,strokeWidth:f,style:t({"--radius":p}),transform:`rotate(-90)`})]})};_.displayName=`ProgressDonutIndicator`;const v={Root:g,Indicator:_};function y(e){let t=4;return e==null?t:(t=typeof e==`number`?e:e.endsWith(`rem`)?Number(e.replace(`rem`,``))*16:Number(e),u(Number.isNaN(t)?4:t,{min:1,max:12}))}function b(e){return`calc(50% - ${e/2}px)`}const x=r({max:100,value:0});function S({className:t,children:n,max:r=100,value:i,...a}){let c=p(r)?r:100,u=f(i,c)?i:i==null?0:`indeterminate`,m=d(u)?u:void 0,h=o(()=>({max:c,value:u}),[c,u]);return s(x.Provider,{value:h,children:s(l.Root,{"data-slot":`progress-bar`,className:e(`bg-base-hover dark:bg-base shadow-inner relative h-3 w-full overflow-hidden rounded-md`,t),value:m,max:c,...a,children:n})})}S.displayName=`Root`;function C({className:t,style:n,...r}){let a=i(x),{max:o}=a,c=(o-(a.value===`indeterminate`?0:a.value))/o*100;return s(l.Indicator,{"data-slot":`progress-bar-indicator`,className:e(`bg-accent-600 h-full w-full flex-1 transition-all`,t),style:{...n,transform:`translateX(-${c}%)`},...r})}C.displayName=`Indicator`;const w={Root:S,Indicator:C};export{w as ProgressBar,v as ProgressDonut};
|
package/dist/qr-code.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/qr-code/qr-code.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* QR error correction level — the share of the code that can be damaged or
|
|
@@ -13,12 +12,14 @@ type QrCodeErrorCorrection = "L" | "M" | "Q" | "H";
|
|
|
13
12
|
* value for child parts.
|
|
14
13
|
*/
|
|
15
14
|
type QrCodeRootProps = ComponentProps<"div"> & WithAsChild & {
|
|
16
|
-
/** The string to encode (e.g. a URL or `otpauth://` MFA URI). */
|
|
15
|
+
/** The string to encode (e.g. a URL or `otpauth://` MFA URI). */
|
|
16
|
+
value: string;
|
|
17
17
|
/**
|
|
18
18
|
* The error correction level. Defaults to `"L"`. Use `"H"` when an
|
|
19
19
|
* `Overlay` covers center modules so the code stays scannable.
|
|
20
20
|
*/
|
|
21
|
-
ecc?: QrCodeErrorCorrection;
|
|
21
|
+
ecc?: QrCodeErrorCorrection;
|
|
22
|
+
/** The pixel size of each module, affecting internal resolution. */
|
|
22
23
|
pixelSize?: number;
|
|
23
24
|
/**
|
|
24
25
|
* Width of the quiet zone — the light-module margin baked into the encoded
|
|
@@ -52,7 +53,7 @@ type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
|
52
53
|
* `Root` and `Overlay` support the `asChild` prop for polymorphic composition.
|
|
53
54
|
* `Frame` and `Pattern` render fixed SVG elements and do not.
|
|
54
55
|
*
|
|
55
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
56
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
59
|
* Composition:
|
|
@@ -80,7 +81,7 @@ declare const QrCode: {
|
|
|
80
81
|
* The root container of a QR code. Encodes `value` and renders a positioned
|
|
81
82
|
* white tile. Set `ecc` (e.g. `"H"` when using an `Overlay`).
|
|
82
83
|
*
|
|
83
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
84
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
84
85
|
*
|
|
85
86
|
* @example
|
|
86
87
|
* ```tsx
|
|
@@ -99,7 +100,7 @@ declare const QrCode: {
|
|
|
99
100
|
* The `svg` frame that holds the QR `Pattern`. Defaults to `size-48`; resize
|
|
100
101
|
* the whole code by passing a different size to `className`.
|
|
101
102
|
*
|
|
102
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
103
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
103
104
|
*
|
|
104
105
|
* @example
|
|
105
106
|
* ```tsx
|
|
@@ -118,7 +119,7 @@ declare const QrCode: {
|
|
|
118
119
|
* The encoded QR modules, rendered as a `path` inside the `Frame`. Defaults
|
|
119
120
|
* to black fill so the code stays scannable in every theme.
|
|
120
121
|
*
|
|
121
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
122
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
122
123
|
*
|
|
123
124
|
* @example
|
|
124
125
|
* ```tsx
|
|
@@ -138,7 +139,7 @@ declare const QrCode: {
|
|
|
138
139
|
* Renders a white rounded "punch-out" so the logo stays legible. Use a higher
|
|
139
140
|
* `ecc` on the `Root` when an overlay is present.
|
|
140
141
|
*
|
|
141
|
-
* @see https://mantle.ngrok.com/components/qr-code
|
|
142
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
142
143
|
*
|
|
143
144
|
* @example
|
|
144
145
|
* ```tsx
|
package/dist/qr-code.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{createContext as n,forwardRef as r,useContext as i,useMemo as a}from"react";import o from"tiny-invariant";import{jsx as s}from"react/jsx-runtime";import{encode as c}from"uqr";const l=n(null);function u(e,t){o(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),o(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function d(){let e=i(l);return o(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function f(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 p=r(({value:n,ecc:r=`L`,pixelSize:i=10,quietZone:o=4,asChild:d,className:p,children:m,...h},g)=>{u(i,o);let _=a(()=>c(n,{ecc:r,border:o}),[n,r,o]),v=a(()=>f(_.data,i),[_,i]),y=a(()=>({path:v,dimension:_.size*i}),[v,_.size,i]),b=d?t:`div`;return s(l.Provider,{value:y,children:s(b,{ref:g,...h,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})});p.displayName=`QrCode`;const m=r(({className:t,children:n,...r},i)=>{let{dimension:a}=d();return s(`svg`,{ref:i,...r,"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})});m.displayName=`QrCodeFrame`;const h=r(({className:t,...n},r)=>{let{path:i}=d();return s(`path`,{ref:r,...n,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})});h.displayName=`QrCodePattern`;const g=r(({asChild:n,className:r,...i},a)=>s(n?t:`div`,{ref:a,...i,"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)}));g.displayName=`QrCodeOverlay`;const _={Root:p,Frame:m,Pattern:h,Overlay:g};export{_ as QrCode};
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
import { RadioGroupProps, RadioProps } from "@headlessui/react";
|
|
4
|
-
|
|
5
4
|
//#region src/components/radio-group/radio-group.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* The shape of the radio state context.
|
|
@@ -16,12 +15,50 @@ type RadioStateContextValue = {
|
|
|
16
15
|
type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
17
16
|
children?: ReactNode | ((context: RadioStateContextValue) => ReactNode);
|
|
18
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* The selection indicator for any radio item.
|
|
20
|
+
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
21
|
+
* By default, it's a circle that changes color when checked.
|
|
22
|
+
* You can customize the indicator by passing children:
|
|
23
|
+
* - a different component
|
|
24
|
+
* - a render-props function that receives the radio state context and should return a component.
|
|
25
|
+
*
|
|
26
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupindicator
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <RadioGroup.Item value="option1">
|
|
31
|
+
* <RadioGroup.Indicator />
|
|
32
|
+
* <span>Option 1</span>
|
|
33
|
+
* </RadioGroup.Item>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const Indicator: {
|
|
37
|
+
({ children, className, ...props }: RadioIndicatorProps): import("react").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
19
40
|
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;
|
|
41
|
+
/**
|
|
42
|
+
* The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.
|
|
43
|
+
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
44
|
+
*/
|
|
45
|
+
declare const ItemContent: {
|
|
46
|
+
({ asChild, children, className, ...props }: RadioItemContentProps): import("react").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
20
49
|
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
50
|
+
/**
|
|
51
|
+
* A sandbox container for input elements composed within radio group items.
|
|
52
|
+
* It prevents the default behavior of the radio group when clicking on the input element or accepting keyboard input.
|
|
53
|
+
*/
|
|
54
|
+
declare const InputSandbox: {
|
|
55
|
+
({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps): import("react").JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
21
58
|
/**
|
|
22
59
|
* A group of radio items. It manages the state of the children radios.
|
|
23
60
|
*
|
|
24
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogrouproot
|
|
61
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouproot
|
|
25
62
|
*
|
|
26
63
|
* @example
|
|
27
64
|
* Composition:
|
|
@@ -50,7 +87,7 @@ type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
|
50
87
|
*
|
|
51
88
|
* @example
|
|
52
89
|
* ```tsx
|
|
53
|
-
* <RadioGroup value={value}
|
|
90
|
+
* <RadioGroup.Root value={value} onChange={setValue}>
|
|
54
91
|
* <RadioGroup.Item value="option1">
|
|
55
92
|
* <RadioGroup.Indicator />
|
|
56
93
|
* <span>Option 1</span>
|
|
@@ -59,24 +96,22 @@ type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
|
59
96
|
* <RadioGroup.Indicator />
|
|
60
97
|
* <span>Option 2</span>
|
|
61
98
|
* </RadioGroup.Item>
|
|
62
|
-
* </RadioGroup>
|
|
99
|
+
* </RadioGroup.Root>
|
|
63
100
|
* ```
|
|
64
101
|
*/
|
|
65
102
|
declare const RadioGroup: {
|
|
66
103
|
/**
|
|
67
104
|
* A radio button that is used inside a RadioGroup.ButtonGroup for inline grouped radio options.
|
|
68
105
|
*
|
|
69
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupbutton
|
|
106
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupbutton
|
|
70
107
|
*
|
|
71
108
|
* @example
|
|
72
109
|
* ```tsx
|
|
73
|
-
* <RadioGroup.
|
|
74
|
-
* <RadioGroup.
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* </RadioGroup.ButtonGroup>
|
|
79
|
-
* </RadioGroup.Root>
|
|
110
|
+
* <RadioGroup.ButtonGroup defaultValue="option1">
|
|
111
|
+
* <RadioGroup.Button value="option1">Option 1</RadioGroup.Button>
|
|
112
|
+
* <RadioGroup.Button value="option2">Option 2</RadioGroup.Button>
|
|
113
|
+
* <RadioGroup.Button value="option3">Option 3</RadioGroup.Button>
|
|
114
|
+
* </RadioGroup.ButtonGroup>
|
|
80
115
|
* ```
|
|
81
116
|
*/
|
|
82
117
|
readonly Button: import("react").ForwardRefExoticComponent<Omit<RadioProps, "children"> & {
|
|
@@ -84,28 +119,27 @@ declare const RadioGroup: {
|
|
|
84
119
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
85
120
|
/**
|
|
86
121
|
* An inline group of radio buttons. Use RadioGroup.Button as direct children for horizontal radio layouts.
|
|
122
|
+
* Renders the radio group itself — use it in place of `RadioGroup.Root`, never nested inside one.
|
|
87
123
|
*
|
|
88
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupbuttongroup
|
|
124
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupbuttongroup
|
|
89
125
|
*
|
|
90
126
|
* @example
|
|
91
127
|
* ```tsx
|
|
92
|
-
* <
|
|
93
|
-
*
|
|
94
|
-
* <RadioGroup.
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* </RadioGroup.ButtonGroup>
|
|
99
|
-
* </RadioGroup.Root>
|
|
128
|
+
* <Label id="size-label">Size</Label>
|
|
129
|
+
* <RadioGroup.ButtonGroup aria-labelledby="size-label" defaultValue="small">
|
|
130
|
+
* <RadioGroup.Button value="small">Small</RadioGroup.Button>
|
|
131
|
+
* <RadioGroup.Button value="medium">Medium</RadioGroup.Button>
|
|
132
|
+
* <RadioGroup.Button value="large">Large</RadioGroup.Button>
|
|
133
|
+
* </RadioGroup.ButtonGroup>
|
|
100
134
|
* ```
|
|
101
135
|
*/
|
|
102
|
-
readonly ButtonGroup: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "
|
|
136
|
+
readonly ButtonGroup: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "as" | "children"> & {
|
|
103
137
|
children?: ReactNode | undefined;
|
|
104
138
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
105
139
|
/**
|
|
106
140
|
* A radio card item with enhanced styling. Use it as a child of RadioGroup for card-based radio options.
|
|
107
141
|
*
|
|
108
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupcard
|
|
142
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupcard
|
|
109
143
|
*
|
|
110
144
|
* @example
|
|
111
145
|
* ```tsx
|
|
@@ -133,7 +167,7 @@ declare const RadioGroup: {
|
|
|
133
167
|
/**
|
|
134
168
|
* The selection indicator for any radio item. Shows the checked state with customizable appearance.
|
|
135
169
|
*
|
|
136
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupindicator
|
|
170
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupindicator
|
|
137
171
|
*
|
|
138
172
|
* @example
|
|
139
173
|
* ```tsx
|
|
@@ -143,18 +177,11 @@ declare const RadioGroup: {
|
|
|
143
177
|
* </RadioGroup.Item>
|
|
144
178
|
* ```
|
|
145
179
|
*/
|
|
146
|
-
readonly Indicator:
|
|
147
|
-
({
|
|
148
|
-
children,
|
|
149
|
-
className,
|
|
150
|
-
...props
|
|
151
|
-
}: RadioIndicatorProps): import("react").JSX.Element;
|
|
152
|
-
displayName: string;
|
|
153
|
-
};
|
|
180
|
+
readonly Indicator: typeof Indicator;
|
|
154
181
|
/**
|
|
155
182
|
* A sandbox container for input elements composed within radio group items. Prevents default radio behavior.
|
|
156
183
|
*
|
|
157
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupinputsandbox
|
|
184
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupinputsandbox
|
|
158
185
|
*
|
|
159
186
|
* @example
|
|
160
187
|
* ```tsx
|
|
@@ -171,19 +198,11 @@ declare const RadioGroup: {
|
|
|
171
198
|
* </RadioGroup.Root>
|
|
172
199
|
* ```
|
|
173
200
|
*/
|
|
174
|
-
readonly InputSandbox:
|
|
175
|
-
({
|
|
176
|
-
children,
|
|
177
|
-
onClick,
|
|
178
|
-
onKeyDown,
|
|
179
|
-
...props
|
|
180
|
-
}: RadioInputSandboxProps): import("react").JSX.Element;
|
|
181
|
-
displayName: string;
|
|
182
|
-
};
|
|
201
|
+
readonly InputSandbox: typeof InputSandbox;
|
|
183
202
|
/**
|
|
184
203
|
* A simple radio item that can be used inside a radio group. The conventional use-case for basic radio options.
|
|
185
204
|
*
|
|
186
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupitem
|
|
205
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupitem
|
|
187
206
|
*
|
|
188
207
|
* @example
|
|
189
208
|
* ```tsx
|
|
@@ -199,7 +218,7 @@ declare const RadioGroup: {
|
|
|
199
218
|
/**
|
|
200
219
|
* The content wrapper for any radio item. Use it to wrap labels, descriptions, or content of a radio item.
|
|
201
220
|
*
|
|
202
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogroupitemcontent
|
|
221
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupitemcontent
|
|
203
222
|
*
|
|
204
223
|
* @example
|
|
205
224
|
* ```tsx
|
|
@@ -214,19 +233,11 @@ declare const RadioGroup: {
|
|
|
214
233
|
* </RadioGroup.Root>
|
|
215
234
|
* ```
|
|
216
235
|
*/
|
|
217
|
-
readonly ItemContent:
|
|
218
|
-
({
|
|
219
|
-
asChild,
|
|
220
|
-
children,
|
|
221
|
-
className,
|
|
222
|
-
...props
|
|
223
|
-
}: RadioItemContentProps): import("react").JSX.Element;
|
|
224
|
-
displayName: string;
|
|
225
|
-
};
|
|
236
|
+
readonly ItemContent: typeof ItemContent;
|
|
226
237
|
/**
|
|
227
238
|
* A group of radio list items with connected borders. Use RadioGroup.ListItem as direct children.
|
|
228
239
|
*
|
|
229
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogrouplist
|
|
240
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouplist
|
|
230
241
|
*
|
|
231
242
|
* @example
|
|
232
243
|
* ```tsx
|
|
@@ -246,13 +257,13 @@ declare const RadioGroup: {
|
|
|
246
257
|
* </RadioGroup.Root>
|
|
247
258
|
* ```
|
|
248
259
|
*/
|
|
249
|
-
readonly List: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "
|
|
260
|
+
readonly List: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "as" | "children"> & {
|
|
250
261
|
children?: ReactNode | undefined;
|
|
251
262
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
252
263
|
/**
|
|
253
264
|
* A radio list item that is used inside a RadioGroup.List for connected list-style radio options.
|
|
254
265
|
*
|
|
255
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogrouplistitem
|
|
266
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouplistitem
|
|
256
267
|
*
|
|
257
268
|
* @example
|
|
258
269
|
* ```tsx
|
|
@@ -280,11 +291,11 @@ declare const RadioGroup: {
|
|
|
280
291
|
/**
|
|
281
292
|
* The root radio group component. Manages the state of the children radios where only one can be selected.
|
|
282
293
|
*
|
|
283
|
-
* @see https://mantle.ngrok.com/components/radio-group#radiogrouproot
|
|
294
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouproot
|
|
284
295
|
*
|
|
285
296
|
* @example
|
|
286
297
|
* ```tsx
|
|
287
|
-
* <RadioGroup.Root value={value}
|
|
298
|
+
* <RadioGroup.Root value={value} onChange={setValue}>
|
|
288
299
|
* <RadioGroup.Item value="option1">
|
|
289
300
|
* <RadioGroup.Indicator />
|
|
290
301
|
* <span>Option 1</span>
|
|
@@ -292,7 +303,7 @@ declare const RadioGroup: {
|
|
|
292
303
|
* </RadioGroup.Root>
|
|
293
304
|
* ```
|
|
294
305
|
*/
|
|
295
|
-
readonly Root: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "
|
|
306
|
+
readonly Root: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "as" | "children"> & {
|
|
296
307
|
children?: ReactNode | undefined;
|
|
297
308
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
298
309
|
};
|
package/dist/radio-group.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{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-context-BR01g789.js";import{t as i}from"./is-input-CXmS0OFN.js";import{Children as a,cloneElement as o,createContext as s,forwardRef as c,isValidElement as l,useContext as u,useRef as d}from"react";import{jsx as f}from"react/jsx-runtime";import{Radio as p,RadioGroup as m}from"@headlessui/react";const h=c((e,t)=>f(m,{"data-slot":`radio-group`,...e,ref:t}));h.displayName=`RadioGroup`;const g=s({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),_=c(({children:t,className:n,...i},a)=>{let o=u(r);return f(p,{"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`,...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:a,children:e=>f(g.Provider,{value:e,children:t})})});_.displayName=`RadioItem`;const v=({checked:t,disabled:n,focus:r,hover:i})=>f(`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&&f(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),y=({children:t,className:n,...r})=>{let i=u(g);return f(`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?f(v,{...i}):typeof t==`function`?t(i):t})};y.displayName=`RadioIndicator`;const b=c(({className:e,...t},r)=>f(h,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...t,ref:r}));b.displayName=`RadioGroupList`;const x=c(({children:t,className:n,...i},a)=>{let o=u(r);return f(p,{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:a,...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>f(g.Provider,{value:e,children:t})})});x.displayName=`RadioListItem`;const S=c(({children:e,className:t,...i},a)=>{let o=u(r);return f(p,{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),...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:a,children:t=>f(g.Provider,{value:t,children:e})})});S.displayName=`RadioCard`;const C=({asChild:e=!1,children:r,className:i,...a})=>{let o=u(g);return f(e?t:`div`,{"data-slot":`radio-group-item-content`,className:n(`min-w-0 flex-1`,o.disabled&&`opacity-50`,i),...a,children:r})};C.displayName=`RadioItemContent`;const w=c(({className:e,...t},r)=>f(h,{"data-slot":`radio-group-button-group`,className:n(`flex flex-row flex-nowrap -space-x-px`,e),...t,ref:r}));w.displayName=`RadioButtonGroup`;const T=c(({children:t,className:n,...i},a)=>{let o=u(r);return f(p,{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:a,...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>f(g.Provider,{value:e,children:t})})});T.displayName=`RadioButton`;const E=({children:e,onClick:t,onKeyDown:n,...r})=>{let s=d(null),c=u(g),p=a.only(e),m=c.disabled||!c.checked;return f(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:s,onKeyDown:e=>{if(c.disabled){e.stopPropagation(),e.preventDefault();return}switch(e.key){case`Enter`:case`Tab`:break;default:e.stopPropagation()}n?.(e)},onClick:e=>{if(c.disabled){e.stopPropagation(),e.preventDefault();return}let n=e.target;i(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...r,children:l(p)?o(p,{disabled:c.disabled||p.props.disabled,tabIndex:m?-1:p.props.tabIndex}):null})};E.displayName=`RadioInputSandbox`;const D={Button:T,ButtonGroup:w,Card:S,Indicator:y,InputSandbox:E,Item:_,ItemContent:C,List:b,ListItem:x,Root:h};export{D as RadioGroup};
|
package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts}
RENAMED
|
@@ -26,8 +26,10 @@ type FoldableRange = {
|
|
|
26
26
|
* IDs that are unique within the code block; the decorator URI-encodes
|
|
27
27
|
* them before rendering so spaces and quotes remain safe.
|
|
28
28
|
*/
|
|
29
|
-
id: string;
|
|
30
|
-
|
|
29
|
+
id: string;
|
|
30
|
+
/** 1-based line number of the line that contains the opening token. */
|
|
31
|
+
startLine: number;
|
|
32
|
+
/** 1-based line number of the line that contains the matching closing token. */
|
|
31
33
|
endLine: number;
|
|
32
34
|
};
|
|
33
35
|
/**
|
|
@@ -87,13 +89,7 @@ type DecorateHighlightedHtmlInput = {
|
|
|
87
89
|
* Wraps each line of Shiki-highlighted HTML in Mantle's line-number, fold,
|
|
88
90
|
* and line-highlight markup, producing the final HTML rendered by `CodeBlock.Code`.
|
|
89
91
|
*/
|
|
90
|
-
declare function decorateHighlightedHtml({
|
|
91
|
-
foldableRanges,
|
|
92
|
-
highlightLines,
|
|
93
|
-
html,
|
|
94
|
-
lineNumberStart,
|
|
95
|
-
showLineNumbers
|
|
96
|
-
}: DecorateHighlightedHtmlInput): string;
|
|
92
|
+
declare function decorateHighlightedHtml({ foldableRanges, highlightLines, html, lineNumberStart, showLineNumbers }: DecorateHighlightedHtmlInput): string;
|
|
97
93
|
//#endregion
|
|
98
94
|
//#region src/components/code-block/supported-languages.d.ts
|
|
99
95
|
/**
|
|
@@ -163,7 +159,8 @@ type FoldStrategy = "bracket" | "indentation" | "tag" | "none";
|
|
|
163
159
|
declare function foldStrategyFor(language: SupportedLanguage): FoldStrategy;
|
|
164
160
|
/** Input for {@link computeFoldRanges}. */
|
|
165
161
|
type ComputeFoldRangesInput = {
|
|
166
|
-
/** Resolved supported language; controls which strategy runs. */
|
|
162
|
+
/** Resolved supported language; controls which strategy runs. */
|
|
163
|
+
language: SupportedLanguage;
|
|
167
164
|
/**
|
|
168
165
|
* Tokens produced by Shiki for the same code that will be rendered.
|
|
169
166
|
* Must include scope explanations (i.e. tokenized with
|
|
@@ -186,10 +183,7 @@ type ComputeFoldRangesInput = {
|
|
|
186
183
|
* opener line survives so the gutter renders a single toggle even when
|
|
187
184
|
* multiple constructs open on the same line (`{"a":[`).
|
|
188
185
|
*/
|
|
189
|
-
declare function computeFoldRanges({
|
|
190
|
-
language,
|
|
191
|
-
tokens
|
|
192
|
-
}: ComputeFoldRangesInput): FoldableRange[];
|
|
186
|
+
declare function computeFoldRanges({ language, tokens }: ComputeFoldRangesInput): FoldableRange[];
|
|
193
187
|
//#endregion
|
|
194
188
|
//#region src/components/code-block/indentation.d.ts
|
|
195
189
|
declare const indentations: readonly ["tabs", "spaces"];
|
|
@@ -278,12 +272,14 @@ type MantleCodeBlockValue = {
|
|
|
278
272
|
"~lineNumberStart"?: number | undefined;
|
|
279
273
|
};
|
|
280
274
|
/** Maps each key starting with `OldPrefix` to `NewPrefix`, leaving other keys unchanged. */
|
|
281
|
-
type ReplacePrefix<T, OldPrefix extends string, NewPrefix extends string> = { [K in keyof T as K extends `${OldPrefix}${infer Rest}` ? `${NewPrefix}${Rest}` : K]: T[K] };
|
|
275
|
+
type ReplacePrefix<T, OldPrefix extends string, NewPrefix extends string> = { [K in keyof T as K extends `${OldPrefix}${infer Rest}` ? `${NewPrefix}${Rest}` : K]: T[K]; };
|
|
282
276
|
/** Public input shape for `createMantleCodeBlockValue`, with `~`-prefixed keys renamed to unprefixed. */
|
|
283
277
|
type MantleCodeBlockValueInput = ReplacePrefix<Omit<MantleCodeBlockValue, typeof mantleCodeBlockValueBrand>, "~", "">;
|
|
284
278
|
/** Options for configuring line numbers, highlights, and indentation in `mantleCode()`. */
|
|
285
279
|
type MantleCodeOptions = {
|
|
286
|
-
/** Line numbers or ranges to visually highlight in the code block. */
|
|
280
|
+
/** Line numbers or ranges to visually highlight in the code block. */
|
|
281
|
+
highlightLines?: (LineRange | number)[] | undefined;
|
|
282
|
+
/** The indentation style to use when normalizing the code string. */
|
|
287
283
|
indentation?: Indentation | undefined;
|
|
288
284
|
/**
|
|
289
285
|
* The starting line number when line numbers are displayed.
|
|
@@ -303,16 +299,7 @@ type MantleCodeOptions = {
|
|
|
303
299
|
* Only pass HTML produced by Shiki (via the Vite plugin or
|
|
304
300
|
* `createMantleServerSyntaxHighlighter`). Never pass unsanitized user input as `preHtml`.
|
|
305
301
|
*/
|
|
306
|
-
declare function createMantleCodeBlockValue({
|
|
307
|
-
preHtml,
|
|
308
|
-
preValToken,
|
|
309
|
-
preVals,
|
|
310
|
-
highlightLines,
|
|
311
|
-
lineNumberStart,
|
|
312
|
-
showLineNumbers,
|
|
313
|
-
code,
|
|
314
|
-
language
|
|
315
|
-
}: MantleCodeBlockValueInput): MantleCodeBlockValue;
|
|
302
|
+
declare function createMantleCodeBlockValue({ preHtml, preValToken, preVals, highlightLines, lineNumberStart, showLineNumbers, code, language }: MantleCodeBlockValueInput): MantleCodeBlockValue;
|
|
316
303
|
/**
|
|
317
304
|
* Tagged template literal for Shiki syntax highlighting.
|
|
318
305
|
*
|