@ngrok/mantle 0.79.3 → 0.80.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 +169 -12
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +496 -30
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +129 -9
- package/dist/alert.js +1 -1
- package/dist/anchor-_2meGDfj.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +214 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-5WsvzIQ6.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-BPMwa2jN.d.ts} +3 -3
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +146 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +224 -8
- package/dist/centered-layout.js +1 -1
- package/dist/checkbox-Cq17y0-R.js +1 -0
- package/dist/checkbox.d.ts +12 -10
- package/dist/checkbox.js +1 -1
- package/dist/choice-Cc8dA5r8.js +1 -0
- package/dist/choice-Ct0KK8jw.d.ts +269 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +270 -50
- package/dist/code-block.js +6 -6
- package/dist/code.d.ts +3 -2
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +190 -11
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +285 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +33 -5
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +79 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-CQ2C6vkE.js +1 -0
- package/dist/dialog.d.ts +239 -18
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-CSCDdA3K.js +1 -0
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-CoyozLzy.d.ts} +170 -29
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +596 -45
- 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 +54 -4
- package/dist/hover-card.js +1 -1
- package/dist/{icon-Cevjo93X.d.ts → icon-BDqpcZ-n.d.ts} +1 -1
- package/dist/icon-CGgMKpJg.js +1 -0
- package/dist/{icon-button-BvQvT790.d.ts → icon-button-C1AfGnQx.d.ts} +6 -60
- package/dist/icon-button-DiOhreJD.js +1 -0
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +5 -13
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/index-B8mIWKIU.d.ts +211 -0
- package/dist/{index-Rv8RL7xy.d.ts → index-BtwKJTLq.d.ts} +1 -1
- package/dist/{index-BSAizFod.d.ts → index-C2jj8U4a.d.ts} +5 -5
- package/dist/index-CdPXa9h1.d.ts +1 -0
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-CVyAVbim.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-DV9M6K4v.d.ts} +42 -2
- package/dist/input.d.ts +4 -55
- 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/list.d.ts +150 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/media-object.d.ts +27 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +312 -15
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +129 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +70 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CBMADtjV.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-CJRIlrLz.d.ts +31 -0
- package/dist/primitive-DCPHJsRs.js +1 -0
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +113 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +128 -23
- 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/select-SR_9-bxA.js +1 -0
- package/dist/select-idm1jy7y.d.ts +600 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +252 -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 +295 -21
- 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/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → sort-B_DDQcVD.js} +1 -1
- package/dist/split-button.d.ts +28 -13
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → svg-only-CdI_v82i.d.ts} +1 -1
- package/dist/svg-only-d-nMCfAI.js +1 -0
- package/dist/switch.d.ts +9 -6
- package/dist/switch.js +1 -1
- package/dist/table-DUSvU_Jw.d.ts +875 -0
- package/dist/table-GDkapNFi.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +135 -21
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-provider-BftkIiZn.js +1 -0
- package/dist/theme-switcher.d.ts +110 -29
- package/dist/theme-switcher.js +1 -1
- package/dist/theme-wVnzzx2F.js +1 -0
- package/dist/theme.d.ts +53 -14
- package/dist/theme.js +1 -1
- package/dist/toast-DKgMRv4F.js +1 -0
- package/dist/toast.d.ts +98 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +28 -1
- package/dist/tooltip.js +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → traffic-policy-file-CF1lbWtp.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/virtual-UrzmaSQm.js +1 -0
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +3 -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/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/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,129 @@ 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: {
|
|
61
|
+
({ value, ecc, pixelSize, quietZone, asChild, className, children, ref, ...props }: QrCodeRootProps): import("react").JSX.Element;
|
|
62
|
+
displayName: string;
|
|
63
|
+
};
|
|
32
64
|
/**
|
|
33
65
|
* Props for `QrCode.Frame`, the fixed SVG element that sizes the encoded QR
|
|
34
66
|
* pattern with its `viewBox`.
|
|
35
67
|
*/
|
|
36
68
|
type QrCodeFrameProps = ComponentProps<"svg">;
|
|
69
|
+
/**
|
|
70
|
+
* The `svg` frame that holds the QR `Pattern`. Defaults to a square `size-48`
|
|
71
|
+
* and scales the encoded pattern to fit via its `viewBox`, so resize the whole
|
|
72
|
+
* code by passing a different size to `className` (e.g. `className="size-64"`).
|
|
73
|
+
*
|
|
74
|
+
* Does not support `asChild`: the QR pattern must live inside an `svg`, so the
|
|
75
|
+
* frame element is fixed and cannot be swapped.
|
|
76
|
+
*
|
|
77
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
82
|
+
* <QrCode.Frame>
|
|
83
|
+
* <QrCode.Pattern />
|
|
84
|
+
* </QrCode.Frame>
|
|
85
|
+
* <QrCode.Overlay>
|
|
86
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
87
|
+
* </QrCode.Overlay>
|
|
88
|
+
* </QrCode.Root>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare const Frame: {
|
|
92
|
+
({ className, children, ref, ...props }: QrCodeFrameProps): import("react").JSX.Element;
|
|
93
|
+
displayName: string;
|
|
94
|
+
};
|
|
37
95
|
/**
|
|
38
96
|
* Props for `QrCode.Pattern`, the fixed SVG `path` element that renders the
|
|
39
97
|
* encoded dark modules.
|
|
40
98
|
*/
|
|
41
99
|
type QrCodePatternProps = ComponentProps<"path">;
|
|
100
|
+
/**
|
|
101
|
+
* The encoded QR modules, rendered as a single `path` inside the `Frame`.
|
|
102
|
+
* Defaults to black fill (`fill-static-black`) so the code stays scannable in
|
|
103
|
+
* every theme.
|
|
104
|
+
*
|
|
105
|
+
* Does not support `asChild`: the modules are a fixed `path` and cannot be
|
|
106
|
+
* swapped for another element.
|
|
107
|
+
*
|
|
108
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```tsx
|
|
112
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
113
|
+
* <QrCode.Frame>
|
|
114
|
+
* <QrCode.Pattern />
|
|
115
|
+
* </QrCode.Frame>
|
|
116
|
+
* <QrCode.Overlay>
|
|
117
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
118
|
+
* </QrCode.Overlay>
|
|
119
|
+
* </QrCode.Root>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
declare const Pattern: {
|
|
123
|
+
({ className, ref, ...props }: QrCodePatternProps): import("react").JSX.Element;
|
|
124
|
+
displayName: string;
|
|
125
|
+
};
|
|
42
126
|
/**
|
|
43
127
|
* Props for `QrCode.Overlay`, the optional centered logo container rendered on
|
|
44
128
|
* top of the QR pattern.
|
|
45
129
|
*/
|
|
46
130
|
type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
131
|
+
/**
|
|
132
|
+
* An overlay centered on top of the QR code, typically holding a brand logo
|
|
133
|
+
* (e.g. `NgrokLettermarkIcon`). Renders a white, rounded "punch-out" so the
|
|
134
|
+
* logo stays legible over the modules beneath it. Because the overlay hides the
|
|
135
|
+
* center modules, use a higher `ecc` (e.g. `"H"`) on the `Root`.
|
|
136
|
+
*
|
|
137
|
+
* @see https://mantle.ngrok.com/components/data-display/qr-code
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```tsx
|
|
141
|
+
* <QrCode.Root value="https://ngrok.com" ecc="H">
|
|
142
|
+
* <QrCode.Frame>
|
|
143
|
+
* <QrCode.Pattern />
|
|
144
|
+
* </QrCode.Frame>
|
|
145
|
+
* <QrCode.Overlay>
|
|
146
|
+
* <NgrokLettermarkIcon className="size-7" />
|
|
147
|
+
* </QrCode.Overlay>
|
|
148
|
+
* </QrCode.Root>
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
declare const Overlay: {
|
|
152
|
+
({ asChild, className, ref, ...props }: QrCodeOverlayProps): import("react").JSX.Element;
|
|
153
|
+
displayName: string;
|
|
154
|
+
};
|
|
47
155
|
/**
|
|
48
156
|
* A QR code. Compose `QrCode.Root` with a `QrCode.Frame` wrapping a
|
|
49
157
|
* `QrCode.Pattern`, and optionally a `QrCode.Overlay` for a centered logo.
|
|
@@ -95,7 +203,7 @@ declare const QrCode: {
|
|
|
95
203
|
* </QrCode.Root>
|
|
96
204
|
* ```
|
|
97
205
|
*/
|
|
98
|
-
readonly Root:
|
|
206
|
+
readonly Root: typeof Root;
|
|
99
207
|
/**
|
|
100
208
|
* The `svg` frame that holds the QR `Pattern`. Defaults to `size-48`; resize
|
|
101
209
|
* the whole code by passing a different size to `className`.
|
|
@@ -114,7 +222,7 @@ declare const QrCode: {
|
|
|
114
222
|
* </QrCode.Root>
|
|
115
223
|
* ```
|
|
116
224
|
*/
|
|
117
|
-
readonly Frame:
|
|
225
|
+
readonly Frame: typeof Frame;
|
|
118
226
|
/**
|
|
119
227
|
* The encoded QR modules, rendered as a `path` inside the `Frame`. Defaults
|
|
120
228
|
* to black fill so the code stays scannable in every theme.
|
|
@@ -133,7 +241,7 @@ declare const QrCode: {
|
|
|
133
241
|
* </QrCode.Root>
|
|
134
242
|
* ```
|
|
135
243
|
*/
|
|
136
|
-
readonly Pattern:
|
|
244
|
+
readonly Pattern: typeof Pattern;
|
|
137
245
|
/**
|
|
138
246
|
* An overlay centered on top of the QR code, typically holding a brand logo.
|
|
139
247
|
* Renders a white rounded "punch-out" so the logo stays legible. Use a higher
|
|
@@ -153,7 +261,7 @@ declare const QrCode: {
|
|
|
153
261
|
* </QrCode.Root>
|
|
154
262
|
* ```
|
|
155
263
|
*/
|
|
156
|
-
readonly Overlay:
|
|
264
|
+
readonly Overlay: typeof Overlay;
|
|
157
265
|
};
|
|
158
266
|
//#endregion
|
|
159
267
|
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=({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})})};f.displayName=`QrCode`;const p=({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})};p.displayName=`QrCodeFrame`;const m=({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)})};m.displayName=`QrCodePattern`;const h=({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)});h.displayName=`QrCodeOverlay`;const g={Root:f,Frame:p,Pattern:m,Overlay:h};export{g as QrCode};
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -1,7 +1,42 @@
|
|
|
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: {
|
|
37
|
+
({ ref, ...props }: RadioGroupProps$1): import("react").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
5
40
|
/**
|
|
6
41
|
* The shape of the radio state context.
|
|
7
42
|
*/
|
|
@@ -12,6 +47,34 @@ type RadioStateContextValue = {
|
|
|
12
47
|
focus: boolean;
|
|
13
48
|
hover: boolean;
|
|
14
49
|
};
|
|
50
|
+
type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
51
|
+
ref?: Ref<HTMLDivElement>;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* A simple radio item that can be used inside a radio group. The "conventional" use-case.
|
|
55
|
+
* Must be a child of `RadioGroup`.
|
|
56
|
+
*
|
|
57
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
58
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
59
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
60
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
61
|
+
*
|
|
62
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupitem
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <RadioGroup.Root value={value} onChange={setValue}>
|
|
67
|
+
* <RadioGroup.Item value="option1">
|
|
68
|
+
* <RadioGroup.Indicator />
|
|
69
|
+
* <span>Option 1</span>
|
|
70
|
+
* </RadioGroup.Item>
|
|
71
|
+
* </RadioGroup.Root>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare const Item: {
|
|
75
|
+
({ children, className, ref, ...props }: RadioItemProps): import("react").JSX.Element;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
15
78
|
type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
16
79
|
children?: ReactNode | ((context: RadioStateContextValue) => ReactNode);
|
|
17
80
|
};
|
|
@@ -37,7 +100,40 @@ declare const Indicator: {
|
|
|
37
100
|
({ children, className, ...props }: RadioIndicatorProps): import("react").JSX.Element;
|
|
38
101
|
displayName: string;
|
|
39
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* A group of radio list items. Use RadioGroup.ListItem as direct children.
|
|
105
|
+
*/
|
|
106
|
+
declare const List: {
|
|
107
|
+
({ className, ref, ...props }: RadioGroupProps$1): import("react").JSX.Element;
|
|
108
|
+
displayName: string;
|
|
109
|
+
};
|
|
110
|
+
type RadioListItemProps = RadioItemProps;
|
|
111
|
+
/**
|
|
112
|
+
* A radio list item that is used inside a `RadioGroup.List`.
|
|
113
|
+
*
|
|
114
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
115
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
116
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
117
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
118
|
+
*/
|
|
119
|
+
declare const ListItem: {
|
|
120
|
+
({ children, className, ref, ...props }: RadioListItemProps): import("react").JSX.Element;
|
|
121
|
+
displayName: string;
|
|
122
|
+
};
|
|
40
123
|
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;
|
|
124
|
+
type RadioCardProps = RadioItemProps;
|
|
125
|
+
/**
|
|
126
|
+
* A radio card item. Use it as a child of `RadioGroup`
|
|
127
|
+
*
|
|
128
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
129
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
130
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
131
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
132
|
+
*/
|
|
133
|
+
declare const Card: {
|
|
134
|
+
({ children, className, ref, ...props }: RadioCardProps): import("react").JSX.Element;
|
|
135
|
+
displayName: string;
|
|
136
|
+
};
|
|
41
137
|
/**
|
|
42
138
|
* The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.
|
|
43
139
|
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
@@ -46,6 +142,29 @@ declare const ItemContent: {
|
|
|
46
142
|
({ asChild, children, className, ...props }: RadioItemContentProps): import("react").JSX.Element;
|
|
47
143
|
displayName: string;
|
|
48
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* An inline group of radio buttons. Use RadioGroup.Button as direct children.
|
|
147
|
+
* Renders the radio group itself (it wraps `Root`) — use it *in place of*
|
|
148
|
+
* `RadioGroup.Root`, never nested inside one, or the buttons bind to an
|
|
149
|
+
* inner, uncontrolled group and outer `value`/`onChange` props are ignored.
|
|
150
|
+
*/
|
|
151
|
+
declare const ButtonGroup: {
|
|
152
|
+
({ className, ref, ...props }: RadioGroupProps$1): import("react").JSX.Element;
|
|
153
|
+
displayName: string;
|
|
154
|
+
};
|
|
155
|
+
type RadioButtonProps = RadioItemProps;
|
|
156
|
+
/**
|
|
157
|
+
* A radio button that is used inside a `RadioGroup.ButtonGroup`.
|
|
158
|
+
*
|
|
159
|
+
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
160
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
161
|
+
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
162
|
+
* by Headless UI's Radio primitive and does not propagate.
|
|
163
|
+
*/
|
|
164
|
+
declare const Button: {
|
|
165
|
+
({ children, className, ref, ...props }: RadioButtonProps): import("react").JSX.Element;
|
|
166
|
+
displayName: string;
|
|
167
|
+
};
|
|
49
168
|
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
50
169
|
/**
|
|
51
170
|
* A sandbox container for input elements composed within radio group items.
|
|
@@ -114,9 +233,7 @@ declare const RadioGroup: {
|
|
|
114
233
|
* </RadioGroup.ButtonGroup>
|
|
115
234
|
* ```
|
|
116
235
|
*/
|
|
117
|
-
readonly Button:
|
|
118
|
-
children?: ReactNode | undefined;
|
|
119
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
236
|
+
readonly Button: typeof Button;
|
|
120
237
|
/**
|
|
121
238
|
* An inline group of radio buttons. Use RadioGroup.Button as direct children for horizontal radio layouts.
|
|
122
239
|
* Renders the radio group itself — use it in place of `RadioGroup.Root`, never nested inside one.
|
|
@@ -133,9 +250,7 @@ declare const RadioGroup: {
|
|
|
133
250
|
* </RadioGroup.ButtonGroup>
|
|
134
251
|
* ```
|
|
135
252
|
*/
|
|
136
|
-
readonly ButtonGroup:
|
|
137
|
-
children?: ReactNode | undefined;
|
|
138
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
253
|
+
readonly ButtonGroup: typeof ButtonGroup;
|
|
139
254
|
/**
|
|
140
255
|
* A radio card item with enhanced styling. Use it as a child of RadioGroup for card-based radio options.
|
|
141
256
|
*
|
|
@@ -161,9 +276,7 @@ declare const RadioGroup: {
|
|
|
161
276
|
* </RadioGroup.Root>
|
|
162
277
|
* ```
|
|
163
278
|
*/
|
|
164
|
-
readonly Card:
|
|
165
|
-
children?: ReactNode | undefined;
|
|
166
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
279
|
+
readonly Card: typeof Card;
|
|
167
280
|
/**
|
|
168
281
|
* The selection indicator for any radio item. Shows the checked state with customizable appearance.
|
|
169
282
|
*
|
|
@@ -212,9 +325,7 @@ declare const RadioGroup: {
|
|
|
212
325
|
* </RadioGroup.Item>
|
|
213
326
|
* ```
|
|
214
327
|
*/
|
|
215
|
-
readonly Item:
|
|
216
|
-
children?: ReactNode | undefined;
|
|
217
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
328
|
+
readonly Item: typeof Item;
|
|
218
329
|
/**
|
|
219
330
|
* The content wrapper for any radio item. Use it to wrap labels, descriptions, or content of a radio item.
|
|
220
331
|
*
|
|
@@ -257,9 +368,7 @@ declare const RadioGroup: {
|
|
|
257
368
|
* </RadioGroup.Root>
|
|
258
369
|
* ```
|
|
259
370
|
*/
|
|
260
|
-
readonly List:
|
|
261
|
-
children?: ReactNode | undefined;
|
|
262
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
371
|
+
readonly List: typeof List;
|
|
263
372
|
/**
|
|
264
373
|
* A radio list item that is used inside a RadioGroup.List for connected list-style radio options.
|
|
265
374
|
*
|
|
@@ -285,9 +394,7 @@ declare const RadioGroup: {
|
|
|
285
394
|
* </RadioGroup.Root>
|
|
286
395
|
* ```
|
|
287
396
|
*/
|
|
288
|
-
readonly ListItem:
|
|
289
|
-
children?: ReactNode | undefined;
|
|
290
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
397
|
+
readonly ListItem: typeof ListItem;
|
|
291
398
|
/**
|
|
292
399
|
* The root radio group component. Manages the state of the children radios where only one can be selected.
|
|
293
400
|
*
|
|
@@ -303,9 +410,7 @@ declare const RadioGroup: {
|
|
|
303
410
|
* </RadioGroup.Root>
|
|
304
411
|
* ```
|
|
305
412
|
*/
|
|
306
|
-
readonly Root:
|
|
307
|
-
children?: ReactNode | undefined;
|
|
308
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
413
|
+
readonly Root: typeof Root;
|
|
309
414
|
};
|
|
310
415
|
//#endregion
|
|
311
416
|
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-context-BR01g789.js";import{t as i}from"./is-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});m.displayName=`RadioGroup`;const 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})})};g.displayName=`RadioItem`;const _=({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=({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})};v.displayName=`RadioIndicator`;const y=({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...r,ref:t});y.displayName=`RadioGroupList`;const b=({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})})};b.displayName=`RadioListItem`;const x=({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})})};x.displayName=`RadioCard`;const S=({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})};S.displayName=`RadioItemContent`;const C=({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});C.displayName=`RadioButtonGroup`;const w=({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})})};w.displayName=`RadioButton`;const T=({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})};T.displayName=`RadioInputSandbox`;const E={Button:w,ButtonGroup:C,Card:x,Indicator:v,InputSandbox:T,Item:g,ItemContent:S,List:y,ListItem:b,Root:m};export{E 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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CGgMKpJg.js";import{a as r,r as i}from"./validation-Bpptk_9t.js";import{t as a}from"./field-context-BR01g789.js";import{n as o}from"./separator-bpE_kooz.js";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l,useMemo as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CheckIcon as p}from"@phosphor-icons/react/Check";import{CaretUpIcon as m}from"@phosphor-icons/react/CaretUp";import*as h from"@radix-ui/react-select";const g=c({}),_=({"aria-invalid":e,children:t,id:n,validation:r,onBlur:i,onValueChange:a,onChange:o,ref:s,...c})=>{let l=u(()=>({"aria-invalid":e,id:n,validation:r,onBlur:i,ref:s}),[e,n,r,i,s]);return d(h.Root,{...c,onValueChange:e=>{o?.(e),a?.(e)},children:d(g.Provider,{value:l,children:t})})};_.displayName=`Select`;const v=({className:e,ref:n,...r})=>d(h.Group,{ref:n,"data-slot":`select-group`,className:t(`space-y-px`,e),...r});v.displayName=`SelectGroup`;const y=h.Value;y.displayName=`SelectValue`;const b=({"aria-invalid":o,className:c,children:u,id:p,ref:m,validation:_,...v})=>{let y=l(g),b=l(a),x=r(),{ariaInvalid:S,validation:C}=i({"aria-invalid":b?b[`aria-invalid`]:y[`aria-invalid`]??o,validation:y.validation??_??x}),w=b?b.id:y.id??p;return f(h.Trigger,{"data-slot":`select-trigger`,className:t(`h-9 text-sm`,`border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,c),"data-validation":C||void 0,id:w,ref:e(m,y.ref),...v,...b?{"aria-describedby":b[`aria-describedby`],"aria-errormessage":b[`aria-errormessage`]}:void 0,"aria-invalid":S,children:[u,d(h.Icon,{asChild:!0,children:d(n,{svg:d(s,{weight:`bold`}),className:`size-4`})})]})};b.displayName=`SelectTrigger`;const x=({className:e,ref:r,...i})=>d(h.ScrollUpButton,{ref:r,className:t(`flex cursor-default items-center justify-center py-1`,e),...i,children:d(n,{svg:d(m,{weight:`bold`}),className:`size-4`})}),S=({className:e,ref:r,...i})=>d(h.ScrollDownButton,{ref:r,className:t(`flex cursor-default items-center justify-center py-1`,e),...i,children:d(n,{svg:d(s,{weight:`bold`}),className:`size-4`})}),C=({className:e,children:n,position:r=`popper`,ref:i,width:a=`trigger`,...o})=>d(h.Portal,{children:f(h.Content,{ref:i,"data-slot":`select-content`,className:t(`border-popover 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 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,r===`popper`&&`data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)`,a===`trigger`&&`w-(--radix-select-trigger-width)`,e),position:r,...o,children:[d(x,{}),d(h.Viewport,{className:t(`p-1 space-y-px`,r===`popper`&&`h-(--radix-select-trigger-height) w-full`),children:n}),d(S,{})]})});C.displayName=`SelectContent`;const w=({className:e,ref:n,...r})=>d(h.Label,{ref:n,"data-slot":`select-label`,className:t(`px-2 py-1.5 text-sm font-medium`,e),...r});w.displayName=`SelectLabel`;const T=({className:e,children:r,icon:i,ref:a,...o})=>f(h.Item,{ref:a,"data-slot":`select-item`,className:t(`relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden`,`focus:bg-active-menu-item`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`data-state-checked:bg-selected-menu-item`,`focus:data-state-checked:bg-active-selected-menu-item`,e),...o,children:[i&&d(n,{svg:i}),d(h.ItemText,{children:r}),d(h.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:d(n,{svg:d(p,{weight:`bold`}),className:`size-4 text-accent-600`})})]});T.displayName=`SelectItem`;const E=({className:e,ref:n,...r})=>d(o,{ref:n,"data-slot":`select-separator`,className:t(`-mx-1 my-1 h-px w-auto`,e),...r});E.displayName=`SelectSeparator`;const D={Root:_,Content:C,Group:v,Item:T,Label:w,Separator:E,Trigger:b,Value:y};export{D as t};
|