@ngrok/mantle 0.77.0 → 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 +4 -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.d.ts +2 -6
- 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 +9 -11
- package/dist/checkbox.js +1 -1
- package/dist/{choice-D6S38dPs.js → choice-DOdyNzFC.js} +1 -1
- package/dist/choice.d.ts +16 -14
- package/dist/choice.js +1 -1
- 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/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-uyJcNks7.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 +13 -15
- 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-bItE1fkG.d.ts → in-view-nkSOdED2.d.ts} +1 -6
- 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-B3TS9yAP.js → input-Ct1YOqSy.js} +1 -1
- package/dist/input.d.ts +10 -11
- 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-PY0qM0G5.d.ts → label-v2-bv98k.d.ts} +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +18 -60
- package/dist/list.js +1 -1
- package/dist/llms.txt +4 -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-BuVqb6zf.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-Bxq_N-_o.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 +160 -146
- package/dist/selectable-list.js +1 -1
- 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 +4 -5
- 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-CZBWjXcP.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-CTam1uIW.d.ts → types-C19IR7jf.d.ts} +1 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- 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-PBNiHjMK.js → virtual-DZMBu7Ch.js} +1 -1
- 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 +17 -14
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/checkbox-Apow0ipK.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-C5XYi2-H.js +0 -1
- package/dist/use-prefers-reduced-motion-DBqNw1wB.js +0 -1
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
|
*
|
package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./booleanish-BfvnW6vy.js";const n=new Set([`bash`,`sh`,`shell`]);function r(e,t){return!(n.has(e)&&!t.trim().includes(`
|
|
2
2
|
`))}const i=Symbol(`MantleCodeBlockValue`);function a({preHtml:e,preValToken:t,preVals:n,highlightLines:r,lineNumberStart:a,showLineNumbers:o,code:s,language:c}){return{[i]:!0,language:c,code:s,"~preHtml":e,"~preValToken":t,"~preVals":n,"~highlightLines":r,"~lineNumberStart":a,"~showLineNumbers":o}}function o(e,t){let n=``;for(let r=0;r<e.length;r+=1)n+=e[r]??``,r<t.length&&(n+=String(t[r]));return n}function s(e,t={}){let{showLineNumbers:n,highlightLines:i,lineNumberStart:s}=t;return(t,...c)=>{let l=o(t,c);return a({language:e,code:l,preHtml:void 0,preVals:c.length>0?c:void 0,highlightLines:i,lineNumberStart:s,showLineNumbers:n??r(e,l)})}}function c(e){if(e.length<=1)return e;e.sort((e,t)=>e.startLine===t.startLine?t.endLine-e.endLine:e.startLine-t.startLine);let t=[],n=-1;for(let r of e)r.startLine!==n&&(t.push(r),n=r.startLine);return t}function l(e){let t=e.length;if(t===0)return[];let n=[],r=[],i=1,a=0;for(;a<t;){let o=e.charCodeAt(a);if(o===10){i+=1,a+=1;continue}if(o===13){i+=1,a+=1,a<t&&e.charCodeAt(a)===10&&(a+=1);continue}if(o===34){for(a+=1;a<t;){let t=e.charCodeAt(a);if(t===92){a+=2;continue}if(t===34){a+=1;break}if(t===10||t===13)break;a+=1}continue}if(o===123||o===91){n.push({opener:o,line:i}),a+=1;continue}if(o===125||o===93){let e=o===125?123:91,t=n[n.length-1];t?.opener===e?(n.pop(),t.line!==i&&r.push({id:String(t.line),startLine:t.line,endLine:i})):t!=null&&(n.length=0),a+=1;continue}a+=1}return c(r)}function u(...e){let t=new Set;for(let n of e)if(typeof n==`number`){if(!d(n))continue;let e=Math.floor(n);t.add(e)}else{let e=n.indexOf(`-`),r=n.slice(0,e),i=n.slice(e+1),a=Number.parseInt(r,10),o=Number.parseInt(i,10);if(!d(a)||!d(o)||(a>o&&([a,o]=[o,a]),o-a+1>1e3))continue;for(let e=a;e<=o;e++)t.add(e)}return t}const d=e=>e!=null&&!Number.isNaN(e)&&e>0&&Number.isFinite(e);function f(e){let t=e.length;for(;t>0&&(e.charCodeAt(t-1)===10||e.charCodeAt(t-1)===13);)--t;return t===e.length?e:e.slice(0,t)}function p(e){let t=f(e).replaceAll(`\r
|
|
3
3
|
`,`
|
|
4
4
|
`).replaceAll(`\r`,`
|
|
@@ -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, MouseEventHandler } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/sandboxed-on-click/sandboxed-on-click.d.ts
|
|
5
4
|
type BaseProps = {
|
|
6
5
|
/**
|
|
@@ -26,12 +25,9 @@ type EventProps = BaseProps & {
|
|
|
26
25
|
* Props for the sandboxed onClick container. Spread this on the element you want
|
|
27
26
|
* to prevent the click event from bubbling out of.
|
|
28
27
|
*
|
|
29
|
-
* @see https://mantle.ngrok.com/components/sandboxed-on-click#sandboxedonclick
|
|
28
|
+
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click#sandboxedonclick
|
|
30
29
|
*/
|
|
31
|
-
declare const sandboxedOnClickProps: ({
|
|
32
|
-
allowClickEventDefault,
|
|
33
|
-
onClick
|
|
34
|
-
}?: EventProps) => {
|
|
30
|
+
declare const sandboxedOnClickProps: ({ allowClickEventDefault, onClick }?: EventProps) => {
|
|
35
31
|
/**
|
|
36
32
|
* Marking an element with the role presentation indicates to assistive
|
|
37
33
|
* technology that this element should be ignored; it exists to support the
|
|
@@ -47,7 +43,7 @@ type Props = ComponentProps<"div"> & WithAsChild & BaseProps;
|
|
|
47
43
|
/**
|
|
48
44
|
* A container that prevents the click event from bubbling out of it.
|
|
49
45
|
*
|
|
50
|
-
* @see https://mantle.ngrok.com/components/sandboxed-on-click#sandboxedonclick
|
|
46
|
+
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click#sandboxedonclick
|
|
51
47
|
*
|
|
52
48
|
* @example
|
|
53
49
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./slot-
|
|
1
|
+
import{t as e}from"./slot-DmPrjM7N.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=({allowClickEventDefault:e=!1,onClick:t}={})=>({role:`presentation`,onClick:n=>{n.stopPropagation(),e||n.preventDefault(),t?.(n)}}),i=t(({allowClickEventDefault:t=!1,asChild:i=!1,children:a,onClick:o,...s},c)=>n(i?e:`div`,{ref:c,...s,...r({allowClickEventDefault:t,onClick:o}),children:a}));i.displayName=`SandboxedOnClick`;export{i as SandboxedOnClick,r as sandboxedOnClickProps};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { o as WithValidation } from "./validation-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
3
3
|
import { FocusEvent, ReactNode, SelectHTMLAttributes } from "react";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
|
-
|
|
6
5
|
//#region src/components/select/select.d.ts
|
|
7
6
|
type WithAriaInvalid = Pick<SelectHTMLAttributes<HTMLSelectElement>, "aria-invalid">;
|
|
8
7
|
/**
|
|
@@ -16,7 +15,7 @@ type WithAriaInvalid = Pick<SelectHTMLAttributes<HTMLSelectElement>, "aria-inval
|
|
|
16
15
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
17
16
|
* layer renders on top.
|
|
18
17
|
*
|
|
19
|
-
* @see https://mantle.ngrok.com/components/select
|
|
18
|
+
* @see https://mantle.ngrok.com/components/forms/select
|
|
20
19
|
*
|
|
21
20
|
* @example
|
|
22
21
|
* Composition:
|
|
@@ -66,7 +65,7 @@ declare const Select: {
|
|
|
66
65
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
67
66
|
* layer renders on top.
|
|
68
67
|
*
|
|
69
|
-
* @see https://mantle.ngrok.com/components/select#selectroot
|
|
68
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectroot
|
|
70
69
|
*
|
|
71
70
|
* @example
|
|
72
71
|
* ```tsx
|
|
@@ -126,7 +125,7 @@ declare const Select: {
|
|
|
126
125
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
127
126
|
* layer renders on top.
|
|
128
127
|
*
|
|
129
|
-
* @see https://mantle.ngrok.com/components/select#selectcontent
|
|
128
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectcontent
|
|
130
129
|
*
|
|
131
130
|
* @example
|
|
132
131
|
* ```tsx
|
|
@@ -163,7 +162,7 @@ declare const Select: {
|
|
|
163
162
|
* A group of related options within a select menu. Similar to an html `<optgroup>` element.
|
|
164
163
|
* Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.
|
|
165
164
|
*
|
|
166
|
-
* @see https://mantle.ngrok.com/components/select#selectgroup
|
|
165
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectgroup
|
|
167
166
|
*
|
|
168
167
|
* @example
|
|
169
168
|
* ```tsx
|
|
@@ -194,7 +193,7 @@ declare const Select: {
|
|
|
194
193
|
* Has a required `value` prop that will be passed to the `onChange` handler of the `Select` component when this item is selected.
|
|
195
194
|
* Displays the children as the option's text.
|
|
196
195
|
*
|
|
197
|
-
* @see https://mantle.ngrok.com/components/select#selectitem
|
|
196
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectitem
|
|
198
197
|
*
|
|
199
198
|
* @example
|
|
200
199
|
* ```tsx
|
|
@@ -225,7 +224,7 @@ declare const Select: {
|
|
|
225
224
|
/**
|
|
226
225
|
* Used to render the label of a group. It won't be focusable using arrow keys.
|
|
227
226
|
*
|
|
228
|
-
* @see https://mantle.ngrok.com/components/select#selectlabel
|
|
227
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectlabel
|
|
229
228
|
*
|
|
230
229
|
* @example
|
|
231
230
|
* ```tsx
|
|
@@ -254,7 +253,7 @@ declare const Select: {
|
|
|
254
253
|
/**
|
|
255
254
|
* Used to visually separate items or groups of items in the select content.
|
|
256
255
|
*
|
|
257
|
-
* @see https://mantle.ngrok.com/components/select#selectseparator
|
|
256
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectseparator
|
|
258
257
|
*
|
|
259
258
|
* @example
|
|
260
259
|
* ```tsx
|
|
@@ -286,7 +285,7 @@ declare const Select: {
|
|
|
286
285
|
/**
|
|
287
286
|
* The button that toggles the select. The Select.Content will position itself adjacent to the trigger.
|
|
288
287
|
*
|
|
289
|
-
* @see https://mantle.ngrok.com/components/select#selecttrigger
|
|
288
|
+
* @see https://mantle.ngrok.com/components/forms/select#selecttrigger
|
|
290
289
|
*
|
|
291
290
|
* @example
|
|
292
291
|
* ```tsx
|
|
@@ -315,7 +314,7 @@ declare const Select: {
|
|
|
315
314
|
/**
|
|
316
315
|
* The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.
|
|
317
316
|
*
|
|
318
|
-
* @see https://mantle.ngrok.com/components/select#selectvalue
|
|
317
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectvalue
|
|
319
318
|
*
|
|
320
319
|
* @example
|
|
321
320
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-
|
|
1
|
+
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./icon-CDtYjF_H.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-kBnnv3Cw.js";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,forwardRef as l,useContext as u,useMemo as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CheckIcon as m}from"@phosphor-icons/react/Check";import{CaretUpIcon as h}from"@phosphor-icons/react/CaretUp";import*as g from"@radix-ui/react-select";const _=c({}),v=l(({"aria-invalid":e,children:t,id:n,validation:r,onBlur:i,onValueChange:a,onChange:o,...s},c)=>{let l=d(()=>({"aria-invalid":e,id:n,validation:r,onBlur:i,ref:c}),[e,n,r,i,c]);return f(g.Root,{...s,onValueChange:e=>{o?.(e),a?.(e)},children:f(_.Provider,{value:l,children:t})})});v.displayName=`Select`;const y=l(({className:e,...n},r)=>f(g.Group,{ref:r,"data-slot":`select-group`,className:t(`space-y-px`,e),...n}));y.displayName=`SelectGroup`;const b=g.Value;b.displayName=`SelectValue`;const x=l(({"aria-invalid":o,className:c,children:l,id:d,validation:m,...h},v)=>{let y=u(_),b=u(a),x=r(),{ariaInvalid:S,validation:C}=i({"aria-invalid":b?b[`aria-invalid`]:y[`aria-invalid`]??o,validation:y.validation??m??x}),w=b?b.id:y.id??d;return p(g.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(v,y.ref),...h,...b?{"aria-describedby":b[`aria-describedby`],"aria-errormessage":b[`aria-errormessage`]}:void 0,"aria-invalid":S,children:[l,f(g.Icon,{asChild:!0,children:f(n,{svg:f(s,{weight:`bold`}),className:`size-4`})})]})});x.displayName=`SelectTrigger`;const S=l(({className:e,...r},i)=>f(g.ScrollUpButton,{ref:i,className:t(`flex cursor-default items-center justify-center py-1`,e),...r,children:f(n,{svg:f(h,{weight:`bold`}),className:`size-4`})}));S.displayName=`SelectScrollUpButton`;const C=l(({className:e,...r},i)=>f(g.ScrollDownButton,{ref:i,className:t(`flex cursor-default items-center justify-center py-1`,e),...r,children:f(n,{svg:f(s,{weight:`bold`}),className:`size-4`})}));C.displayName=`SelectScrollDownButton`;const w=l(({className:e,children:n,position:r=`popper`,width:i=`trigger`,...a},o)=>f(g.Portal,{children:p(g.Content,{ref:o,"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)`,i===`trigger`&&`w-(--radix-select-trigger-width)`,e),position:r,...a,children:[f(S,{}),f(g.Viewport,{className:t(`p-1 space-y-px`,r===`popper`&&`h-(--radix-select-trigger-height) w-full`),children:n}),f(C,{})]})}));w.displayName=`SelectContent`;const T=l(({className:e,...n},r)=>f(g.Label,{ref:r,"data-slot":`select-label`,className:t(`px-2 py-1.5 text-sm font-medium`,e),...n}));T.displayName=`SelectLabel`;const E=l(({className:e,children:r,icon:i,...a},o)=>p(g.Item,{ref:o,"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),...a,children:[i&&f(n,{svg:i}),f(g.ItemText,{children:r}),f(g.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:f(n,{svg:f(m,{weight:`bold`}),className:`size-4 text-accent-600`})})]}));E.displayName=`SelectItem`;const D=l(({className:e,...n},r)=>f(o,{ref:r,"data-slot":`select-separator`,className:t(`-mx-1 my-1 h-px w-auto`,e),...n}));D.displayName=`SelectSeparator`;const O={Root:v,Content:w,Group:y,Item:E,Label:T,Separator:D,Trigger:x,Value:b};export{O as t};
|
package/dist/select.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Select } from "./select-
|
|
1
|
+
import { t as Select } from "./select-Bwt2YduR.js";
|
|
2
2
|
export { Select };
|
package/dist/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./select-
|
|
1
|
+
import{t as e}from"./select-D-5u0Blc.js";export{e as Select};
|