@ngrok/mantle 0.84.1 → 0.84.2
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 +14 -10
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/{alert-Blmunr_D.d.ts → alert-DCVfviBx.d.ts} +18 -3
- package/dist/alert-DtBQuuuP.js +1 -0
- package/dist/alert-center.d.ts +15 -6
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +58 -37
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/alternate-announcement-BkH4bOKp.js +1 -0
- package/dist/anchor-Cqu4GPPV.js +1 -0
- package/dist/anchor.d.ts +15 -15
- package/dist/anchor.js +1 -1
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +3 -1
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +17 -8
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-B52_vczK.js +1 -0
- package/dist/{button-DjsmeoJ2.d.ts → button-B5i9n7Qp.d.ts} +19 -7
- package/dist/button-CaM-ZAH5.js +1 -0
- package/dist/{button-DwFvQWu4.js → button-DGsTE3P2.js} +1 -1
- package/dist/{button-CRCNRnk6.d.ts → button-DO53OA70.d.ts} +2 -2
- package/dist/{button-YkYZ0ymH.js → button-Wn-yt0c_.js} +1 -1
- package/dist/{button-C39M5h4K.d.ts → button-crUf0hbR.d.ts} +19 -2
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +20 -4
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +10 -6
- package/dist/card.js +1 -1
- package/dist/centered-layout.js +1 -1
- package/dist/chart-B_rZqf8a.js +2 -0
- package/dist/checkbox-Gg6nGUnR.js +1 -0
- package/dist/checkbox.js +1 -1
- package/dist/choice-CT_AdesL.js +1 -0
- package/dist/{choice-zOjixuj7.d.ts → choice-PESu-9s8.d.ts} +36 -12
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/{code-block-Dj9otiLi.js → code-block-BE3Q0iAo.js} +2 -2
- package/dist/code-block.d.ts +26 -2
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +19 -2
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +32 -13
- package/dist/command.js +1 -1
- package/dist/compose-refs-DdUwopIY.js +1 -0
- package/dist/{cx-IiQEAKf5.js → cx-0HCjnNv1.js} +1 -1
- package/dist/cx.d.ts +3 -3
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +114 -61
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +43 -9
- package/dist/description-list.js +1 -1
- package/dist/{dialog-u8PtHYES.d.ts → dialog-B8YvfyIo.d.ts} +5 -3
- package/dist/{dialog-CSUE-jw8.js → dialog-CA-1Z0Np.js} +1 -1
- package/dist/{dialog-CEk0L7M7.d.ts → dialog-CtLI_uex.d.ts} +5 -3
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpsUJGbn.d.ts → dropdown-menu-BYapTV0f.d.ts} +8 -5
- package/dist/dropdown-menu-BkPBh_8y.d.ts +1 -0
- package/dist/{dropdown-menu-Cy7mLIpJ.js → dropdown-menu-lxHsgLiw.js} +1 -1
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +4 -4
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +91 -38
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +9 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +15 -18
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +11 -3
- package/dist/hover-card.js +1 -1
- package/dist/{icon-k4E9yNWD.d.ts → icon-BmJ57Tgh.d.ts} +10 -0
- package/dist/icon-CGKaq_tV.js +1 -0
- package/dist/icon-U24NfYv7.js +1 -0
- package/dist/icon-w0HUe7tr.d.ts +42 -0
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/{icons-DEVx1oP9.js → icons-Cie4gcrm.js} +1 -1
- package/dist/icons.d.ts +7 -13
- package/dist/icons.js +1 -1
- package/dist/{in-view-gxyc9Q1_.d.ts → in-view-Ch5vJtWo.d.ts} +10 -5
- package/dist/input-BhykQSvJ.js +1 -0
- package/dist/input-DQyN6gN0.js +1 -0
- package/dist/input.d.ts +22 -10
- package/dist/input.js +1 -1
- package/dist/{kbd-B9qmYaW8.js → kbd-4_0Y_8rx.js} +1 -1
- package/dist/kbd.d.ts +15 -9
- package/dist/kbd.js +1 -1
- package/dist/{label-C6YH9skg.d.ts → label-Bnfe9YJ6.d.ts} +3 -1
- package/dist/label-BqIp6kFx.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-BTcQpd4K.js +1 -0
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/{list-7w5k3HiN.js → list-Bo1mExIg.js} +1 -1
- package/dist/list.d.ts +37 -14
- package/dist/list.js +1 -1
- package/dist/live-region-CV7kykeo.js +1 -0
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +4 -2
- package/dist/main.js +1 -1
- package/dist/media-object.d.ts +5 -12
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +45 -13
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +9 -3
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +165 -19
- package/dist/pagination.js +1 -1
- package/dist/{popover-D6x6Bq-G.js → popover-Bp-9B3GR.js} +1 -1
- package/dist/{popover-DDuw1UaJ.d.ts → popover-s2LhmzfQ.d.ts} +8 -4
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/primitive-CejGAoGb.js +1 -0
- package/dist/progress.d.ts +65 -31
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -4
- package/dist/qr-code.js +1 -1
- package/dist/radio-group-HDVxTNPi.js +1 -0
- package/dist/radio-group.d.ts +50 -25
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-UagMFl_U.js +1 -0
- package/dist/sandboxed-on-click.d.ts +8 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.js +1 -1
- package/dist/select-Dov9H2CX.js +1 -0
- package/dist/{select-DkFkSYBP.d.ts → select-ouAW88jx.d.ts} +30 -9
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +64 -20
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-CNDs98Dv.d.ts → separator-Bo4nY_3M.d.ts} +13 -2
- package/dist/{separator-D1K7DSTv.js → separator-Da8lDnio.js} +1 -1
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/{sheet-2AQT0DNu.js → sheet-C6UGAvRk.js} +1 -1
- package/dist/sheet.d.ts +5 -5
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +7 -6
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-paJOgf-f.js +1 -0
- package/dist/skeleton.d.ts +5 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +9 -6
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +7 -3
- package/dist/slider.js +1 -1
- package/dist/{slot-CxM7jdFi.js → slot-C3gII_9c.js} +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +8 -3
- package/dist/split-button.js +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-D51ZtV4U.d.ts → table-DEI-qvSC.d.ts} +25 -12
- package/dist/table-EZNW3nFk.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-DN-Et3A_.js +1 -0
- package/dist/theme-switcher.d.ts +24 -12
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +18 -4
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +8 -3
- package/dist/toast.js +1 -1
- package/dist/tooltip-CkAibjBb.js +1 -0
- package/dist/{tooltip-BKWK5c7_.d.ts → tooltip-DA41fxe5.d.ts} +7 -1
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{use-breakpoint-Dqu12Szq.js → use-breakpoint-BhJ_3El2.js} +1 -1
- package/dist/use-is-apple-platform-CMPzIYjz.js +1 -0
- package/dist/use-matches-media-query-DCBT6iNA.js +1 -0
- package/dist/use-prefers-reduced-motion-DHYDQk1h.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.js +1 -1
- package/package.json +3 -3
- package/dist/alert-D8StKSjK.js +0 -1
- package/dist/anchor-BjyGV6tB.js +0 -1
- package/dist/button-BCk0KpWb.js +0 -1
- package/dist/button-DiDlvAOp.js +0 -1
- package/dist/chart-DVt4hvnu.js +0 -2
- package/dist/checkbox-0EoxOyMA.js +0 -1
- package/dist/choice-BKkfjjAd.js +0 -1
- package/dist/compose-refs-BdBMM9ga.js +0 -1
- package/dist/dropdown-menu-CNaaABck.d.ts +0 -1
- package/dist/icon-CX_gj6sW.d.ts +0 -25
- package/dist/icon-d-nMCfAI.js +0 -1
- package/dist/icon-lZ48P8Nn.js +0 -1
- package/dist/input-BnlpQF0c.js +0 -1
- package/dist/input-CXmS0OFN.js +0 -1
- package/dist/label-D-D11mlp.js +0 -1
- package/dist/layer-container-CglTh9-6.js +0 -1
- package/dist/primitive-BSBmlRyy.js +0 -1
- package/dist/select-B52tWHOB.js +0 -1
- package/dist/skeleton-D86Gsflk.js +0 -1
- package/dist/table-C_Nm_RSV.js +0 -1
- package/dist/theme-CVfq037P.js +0 -1
- package/dist/tooltip-BZRRJgpm.js +0 -1
- package/dist/use-is-apple-platform-Cxwrb86L.js +0 -1
- package/dist/use-matches-media-query-Bd_GhhVd.js +0 -1
- package/dist/use-prefers-reduced-motion-Bk5zAfHY.js +0 -1
package/dist/qr-code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-C3gII_9c.js";import{createContext as n,useContext as r,useMemo as i}from"react";import a from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";import{encode as s}from"uqr";const c=n(null);function l(e,t){a(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),a(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function u(){let e=r(c);return a(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function d(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const f={Root:({value:n,ecc:r=`L`,pixelSize:a=10,quietZone:u=4,asChild:f,className:p,children:m,ref:h,...g})=>{l(a,u);let _=i(()=>s(n,{ecc:r,border:u}),[n,r,u]),v=i(()=>d(_.data,a),[_,a]),y=i(()=>({path:v,dimension:_.size*a}),[v,_.size,a]),b=f?t:`div`;return o(c.Provider,{value:y,children:o(b,{ref:h,...g,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})},Frame:({"aria-label":t,"aria-labelledby":n,className:r,children:i,ref:a,...s})=>{let{dimension:c}=u();return o(`svg`,{ref:a,...s,role:`img`,"aria-label":t??(n==null?`QR code`:void 0),"aria-labelledby":n,"data-slot":`qr-code-frame`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${c} ${c}`,shapeRendering:`crispEdges`,className:e(`block size-48`,r),children:i})},Pattern:({className:t,ref:n,...r})=>{let{path:i}=u();return o(`path`,{ref:n,...r,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})},Overlay:({asChild:n,className:r,ref:i,...a})=>o(n?t:`div`,{ref:i,...a,"data-slot":`qr-code-overlay`,className:e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,r)})};export{f as QrCode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e}from"react";const t=e(null);export{t};
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -12,10 +12,9 @@ type RadioGroupProps$1 = PropsWithChildren<Omit<RadioGroupProps, "as" | "childre
|
|
|
12
12
|
* The recommended Field composition is `Field.Set` + `Field.Legend` + `RadioGroup.Root`,
|
|
13
13
|
* which uses fieldset semantics so all radios share a single accessible name from the
|
|
14
14
|
* legend. As an alternative, when individual items render inside a `Field.Control`,
|
|
15
|
-
* each item picks up `aria-invalid` and `aria-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* will not be associated automatically in that alternative composition.
|
|
15
|
+
* each item picks up `aria-invalid`, `aria-errormessage`, and `aria-describedby` from
|
|
16
|
+
* `FieldControlContext`. Inside any item, a `Choice.Title` names the option through
|
|
17
|
+
* `aria-labelledby` and a `Choice.Description` describes it through `aria-describedby`.
|
|
19
18
|
*
|
|
20
19
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouproot
|
|
21
20
|
*
|
|
@@ -52,9 +51,11 @@ type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
|
52
51
|
* Must be a child of `RadioGroup`.
|
|
53
52
|
*
|
|
54
53
|
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
55
|
-
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid
|
|
56
|
-
* `aria-errormessage
|
|
57
|
-
*
|
|
54
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid`,
|
|
55
|
+
* `aria-errormessage`, and `aria-describedby` from `FieldControlContext`. A
|
|
56
|
+
* `Choice.Title` inside the item names it through `aria-labelledby`, and a
|
|
57
|
+
* `Choice.Description` describes it through `aria-describedby`. The option's
|
|
58
|
+
* accessible name is then the title alone.
|
|
58
59
|
*
|
|
59
60
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupitem
|
|
60
61
|
*
|
|
@@ -68,9 +69,14 @@ type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
|
68
69
|
* </RadioGroup.Root>
|
|
69
70
|
* ```
|
|
70
71
|
*/
|
|
71
|
-
declare const Item: ({ children, className, ref, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
72
|
+
declare const Item: ({ as: tag, children, className, ref, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
72
73
|
type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
73
74
|
children?: ReactNode | ((context: RadioStateContextValue) => ReactNode);
|
|
75
|
+
/**
|
|
76
|
+
* Never rendered. `Choice.Indicator` injects the field's `name` for a
|
|
77
|
+
* control, and a `<div>` has no `name` attribute.
|
|
78
|
+
*/
|
|
79
|
+
name?: string;
|
|
74
80
|
};
|
|
75
81
|
/**
|
|
76
82
|
* The selection indicator for any radio item.
|
|
@@ -90,7 +96,7 @@ type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
90
96
|
* </RadioGroup.Item>
|
|
91
97
|
* ```
|
|
92
98
|
*/
|
|
93
|
-
declare const Indicator: ({ children, className, ...props }: RadioIndicatorProps) => import("react").JSX.Element;
|
|
99
|
+
declare const Indicator: ({ children, className, name: _name, ...props }: RadioIndicatorProps) => import("react").JSX.Element;
|
|
94
100
|
/**
|
|
95
101
|
* A group of radio list items. Use RadioGroup.ListItem as direct children.
|
|
96
102
|
*
|
|
@@ -120,9 +126,11 @@ type RadioListItemProps = RadioItemProps;
|
|
|
120
126
|
* A radio list item that is used inside a `RadioGroup.List`.
|
|
121
127
|
*
|
|
122
128
|
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
123
|
-
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid
|
|
124
|
-
* `aria-errormessage
|
|
125
|
-
*
|
|
129
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid`,
|
|
130
|
+
* `aria-errormessage`, and `aria-describedby` from `FieldControlContext`. A
|
|
131
|
+
* `Choice.Title` inside the item names it through `aria-labelledby`, and a
|
|
132
|
+
* `Choice.Description` describes it through `aria-describedby`. The option's
|
|
133
|
+
* accessible name is then the title alone.
|
|
126
134
|
*
|
|
127
135
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouplistitem
|
|
128
136
|
*
|
|
@@ -146,16 +154,18 @@ type RadioListItemProps = RadioItemProps;
|
|
|
146
154
|
* </RadioGroup.Root>
|
|
147
155
|
* ```
|
|
148
156
|
*/
|
|
149
|
-
declare const ListItem: ({ children, className, ref, ...props }: RadioListItemProps) => import("react").JSX.Element;
|
|
157
|
+
declare const ListItem: ({ as: tag, children, className, ref, ...props }: RadioListItemProps) => import("react").JSX.Element;
|
|
150
158
|
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;
|
|
151
159
|
type RadioCardProps = RadioItemProps;
|
|
152
160
|
/**
|
|
153
161
|
* A radio card item. Use it as a child of `RadioGroup`
|
|
154
162
|
*
|
|
155
163
|
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
156
|
-
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid
|
|
157
|
-
* `aria-errormessage
|
|
158
|
-
*
|
|
164
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid`,
|
|
165
|
+
* `aria-errormessage`, and `aria-describedby` from `FieldControlContext`. A
|
|
166
|
+
* `Choice.Title` inside the item names it through `aria-labelledby`, and a
|
|
167
|
+
* `Choice.Description` describes it through `aria-describedby`. The option's
|
|
168
|
+
* accessible name is then the title alone.
|
|
159
169
|
*
|
|
160
170
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupcard
|
|
161
171
|
*
|
|
@@ -179,7 +189,7 @@ type RadioCardProps = RadioItemProps;
|
|
|
179
189
|
* </RadioGroup.Root>
|
|
180
190
|
* ```
|
|
181
191
|
*/
|
|
182
|
-
declare const Card: ({ children, className, ref, ...props }: RadioCardProps) => import("react").JSX.Element;
|
|
192
|
+
declare const Card: ({ as: tag, children, className, ref, ...props }: RadioCardProps) => import("react").JSX.Element;
|
|
183
193
|
/**
|
|
184
194
|
* The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.
|
|
185
195
|
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
@@ -224,9 +234,11 @@ type RadioButtonProps = RadioItemProps;
|
|
|
224
234
|
* A radio button that is used inside a `RadioGroup.ButtonGroup`.
|
|
225
235
|
*
|
|
226
236
|
* When rendered inside `Field.Control` (an alternative to the recommended
|
|
227
|
-
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid
|
|
228
|
-
* `aria-errormessage
|
|
229
|
-
*
|
|
237
|
+
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid`,
|
|
238
|
+
* `aria-errormessage`, and `aria-describedby` from `FieldControlContext`. A
|
|
239
|
+
* `Choice.Title` inside the item names it through `aria-labelledby`, and a
|
|
240
|
+
* `Choice.Description` describes it through `aria-describedby`. The option's
|
|
241
|
+
* accessible name is then the title alone.
|
|
230
242
|
*
|
|
231
243
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupbutton
|
|
232
244
|
*
|
|
@@ -239,11 +251,14 @@ type RadioButtonProps = RadioItemProps;
|
|
|
239
251
|
* </RadioGroup.ButtonGroup>
|
|
240
252
|
* ```
|
|
241
253
|
*/
|
|
242
|
-
declare const Button: ({ children, className, ref, ...props }: RadioButtonProps) => import("react").JSX.Element;
|
|
254
|
+
declare const Button: ({ as: tag, children, className, ref, ...props }: RadioButtonProps) => import("react").JSX.Element;
|
|
243
255
|
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
244
256
|
/**
|
|
245
257
|
* A sandbox container for input elements composed within radio group items.
|
|
246
|
-
*
|
|
258
|
+
* A click inside it still selects the radio, then focus returns to the input.
|
|
259
|
+
* Keys other than Enter and Tab stop here, so typing does not move the
|
|
260
|
+
* selection. When the item is disabled or unchecked, the input leaves the tab
|
|
261
|
+
* order.
|
|
247
262
|
*
|
|
248
263
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupinputsandbox
|
|
249
264
|
*
|
|
@@ -377,7 +392,12 @@ declare const RadioGroup: {
|
|
|
377
392
|
*/
|
|
378
393
|
readonly Card: typeof Card;
|
|
379
394
|
/**
|
|
380
|
-
* The selection indicator for any radio item.
|
|
395
|
+
* The selection indicator for any radio item.
|
|
396
|
+
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
397
|
+
* By default, it's a circle that changes color when checked.
|
|
398
|
+
* You can customize the indicator by passing children:
|
|
399
|
+
* - a different component
|
|
400
|
+
* - a render-props function that receives the radio state context and should return a component.
|
|
381
401
|
*
|
|
382
402
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupindicator
|
|
383
403
|
*
|
|
@@ -391,7 +411,11 @@ declare const RadioGroup: {
|
|
|
391
411
|
*/
|
|
392
412
|
readonly Indicator: typeof Indicator;
|
|
393
413
|
/**
|
|
394
|
-
* A sandbox container for input elements composed within radio group items.
|
|
414
|
+
* A sandbox container for input elements composed within radio group items.
|
|
415
|
+
* A click inside it still selects the radio, then focus returns to the input.
|
|
416
|
+
* Keys other than Enter and Tab stop here, so typing does not move the
|
|
417
|
+
* selection. When the item is disabled or unchecked, the input leaves the tab
|
|
418
|
+
* order.
|
|
395
419
|
*
|
|
396
420
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupinputsandbox
|
|
397
421
|
*
|
|
@@ -495,7 +519,8 @@ declare const RadioGroup: {
|
|
|
495
519
|
*/
|
|
496
520
|
readonly ListItem: typeof ListItem;
|
|
497
521
|
/**
|
|
498
|
-
*
|
|
522
|
+
* A group of radio items. It manages the state of the children radios. Unstyled and simple.
|
|
523
|
+
* Used as the root component for grouping related radio items where only one can be selected.
|
|
499
524
|
*
|
|
500
525
|
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouproot
|
|
501
526
|
*
|
package/dist/radio-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-C3gII_9c.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-B1wqeZr4.js";import{t as i}from"./radio-group-HDVxTNPi.js";import{t as a}from"./input-DQyN6gN0.js";import{Children as o,cloneElement as s,createContext as c,isValidElement as l,useCallback as u,useContext as d,useMemo as f,useRef as p,useState as m}from"react";import{jsx as h}from"react/jsx-runtime";import{Radio as g,RadioGroup as _}from"@headlessui/react";const v=({ref:e,...t})=>h(_,{"data-slot":`radio-group`,...t,ref:e}),y=c({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1});function b(e){let t=e.filter(e=>e!=null&&e!==``);return t.length>0?t.join(` `):void 0}function x(){let[e,t]=m([]);return[e,u(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}const S=({children:e,ref:t,tag:n=`div`,...a})=>{let o=d(r),[s,c]=x(),[l,u]=x(),p=f(()=>({registerLabelId:c,registerDescriptionId:u}),[c,u]);return h(n,{...a,...o?{"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,"aria-labelledby":b(s),"aria-describedby":b([o?.[`aria-describedby`],...l]),ref:t,children:h(i.Provider,{value:p,children:e})})},C=({as:t,children:n,className:r,ref:i,...a})=>h(g,{"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`,`not-has-data-[radio-default-indicator]:focus-visible:ring-focus-accent not-has-data-[radio-default-indicator]:focus-visible:ring-4 not-has-data-[radio-default-indicator]:focus-visible:rounded-md`,r),...a,as:S,tag:t,ref:i,children:e=>h(y.Provider,{value:e,children:n})}),w=({checked:t,disabled:n,focus:r,hover:i})=>h(`span`,{"data-radio-default-indicator":``,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&&h(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),T={Button:({as:t,children:n,className:r,ref:i,...a})=>h(g,{"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`,r),...a,as:S,tag:t,ref:i,children:e=>h(y.Provider,{value:e,children:n})}),ButtonGroup:({className:e,ref:t,...r})=>h(v,{"data-slot":`radio-group-button-group`,className:n(`flex flex-row flex-nowrap -space-x-px`,e),...r,ref:t}),Card:({as:e,children:t,className:r,ref:i,...a})=>h(g,{"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`,r),...a,as:S,tag:e,ref:i,children:e=>h(y.Provider,{value:e,children:t})}),Indicator:({children:t,className:n,name:r,...i})=>{let a=d(y);return h(`div`,{"data-slot":`radio-group-indicator`,className:e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,n),...i,children:t==null?h(w,{...a}):typeof t==`function`?t(a):t})},InputSandbox:({children:e,onClick:t,onKeyDown:n,...r})=>{let i=p(null),c=d(y),u=o.only(e),f=c.disabled||!c.checked;return h(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:i,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;a(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...r,children:l(u)?s(u,{disabled:c.disabled||u.props.disabled,tabIndex:f?-1:u.props.tabIndex}):null})},Item:C,ItemContent:({asChild:e=!1,children:r,className:i,...a})=>{let o=d(y);return h(e?t:`div`,{"data-slot":`radio-group-item-content`,className:n(`min-w-0 flex-1`,o.disabled&&`opacity-50`,i),...a,children:r})},List:({className:e,ref:t,...r})=>h(v,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...r,ref:t}),ListItem:({as:t,children:n,className:r,ref:i,...a})=>h(g,{"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`,r),...a,as:S,tag:t,ref:i,children:e=>h(y.Provider,{value:e,children:n})}),Root:v};export{T as RadioGroup};
|
package/dist/sandbar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
-
import { r as ButtonProps } from "./button-
|
|
3
|
+
import { r as ButtonProps } from "./button-B5i9n7Qp.js";
|
|
4
4
|
import { ComponentProps, ReactNode, Ref } from "react";
|
|
5
5
|
//#region src/components/sandbar/sandbar.d.ts
|
|
6
6
|
/**
|
package/dist/sandbar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-DdUwopIY.js";import{t as n}from"./cx-0HCjnNv1.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./slot-C3gII_9c.js";import{t as a}from"./button-DGsTE3P2.js";import{t as o}from"./alternate-announcement-BkH4bOKp.js";import{t as s}from"./use-prefers-reduced-motion-DHYDQk1h.js";import{createContext as c,useCallback as l,useContext as u,useEffect as d,useId as f,useImperativeHandle as p,useMemo as m,useRef as h,useState as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as ee}from"react/jsx-runtime";const y=`Unsaved changes`,b=1e3,x=[{transform:`translateX(0)`},{transform:`translateX(-8px)`},{transform:`translateX(8px)`},{transform:`translateX(-6px)`},{transform:`translateX(6px)`},{transform:`translateX(-3px)`},{transform:`translateX(3px)`},{transform:`translateX(0)`}],S=c(null);function C(e){let t=u(S);return _(t,`${e} must be rendered as a child of <Sandbar.Root>.`),t}const w={Root:({"aria-label":e,"aria-labelledby":i,children:a,className:c,"data-slot":u,handleRef:f,onTransitionEnd:_,open:C,ref:w,...T})=>{let[E,D]=g(C?`open`:`closed`),[O,k]=g(``),[A,j]=g(``),[M,N]=g(null),P=h(null),F=h(null),I=t(F,w),L=h(null),R=h(void 0),z=h(void 0),B=h(void 0),V=h(!1),te=h(!1),H=h(!1),U=h(null),W=h(null),G=h(C),K=h(E),q=l(e=>{k(o(e,V)),window.clearTimeout(R.current),R.current=window.setTimeout(()=>{k(``)},b)},[]),J=l(e=>{j(o(e,te)),window.clearTimeout(z.current),z.current=window.setTimeout(()=>{j(``)},b)},[]),Y=l(e=>(N(e),()=>{N(t=>t===e?null:t)}),[]),X=l(({button:e,isSaving:t})=>{let n=H.current;if(H.current=t,!t||n||(q(`Saving changes…`),e==null||!e.matches(`:disabled`)))return;let r=document.activeElement,i=r===e,a=r===document.body&&W.current===e;(i||a)&&F.current?.focus({preventScroll:!0})},[q]),Z=l(e=>{J(e?.announcement??`You have unsaved changes. Save or discard them before leaving.`);let t=F.current;if(t==null||s()||typeof t.animate!=`function`)return;L.current!=null&&(L.current.cancel(),L.current=null);let n=t.animate(x,{duration:400,easing:`ease-in-out`});n.finished.catch(()=>{}),n.onfinish=()=>{L.current=null},L.current=n},[J]);p(f,()=>({shake:Z}),[Z]);let ne=m(()=>({announceAssertive:J,registerMessage:Y,reportSaving:X}),[J,Y,X]);d(()=>{D(C?e=>e===`open`||e===`opening`?e:e===`closing`?`open`:`opening`:e=>e===`closed`?e:e===`opening`?`closed`:`closing`)},[C]),d(()=>{if(E!==`opening`)return;let e=window.requestAnimationFrame(()=>{e=window.requestAnimationFrame(()=>{D(e=>e===`opening`?`open`:e)})});return()=>{window.cancelAnimationFrame(e)}},[E]),d(()=>{if(E!==`closing`)return;let e=window.setTimeout(()=>{D(`closed`)},400);return()=>{window.clearTimeout(e)}},[E]),d(()=>{let t=G.current;if(G.current=C,!C){t&&(window.clearTimeout(R.current),k(``));return}if(t)return;let n=(F.current?.querySelector(`[data-slot~="sandbar-message"]`))?.textContent?.trim();q(n||e||y)},[q,e,C]),d(()=>{let e=K.current;if(K.current=E,E!==`closed`||e!==`closing`)return;let t=P.current,n=document.activeElement,r=t!=null&&n instanceof HTMLElement&&t.contains(n),i=n===document.body&&W.current!=null,a=U.current;U.current=null,W.current=null,(r||i)&&a!=null&&a.isConnected&&!a.matches(`:disabled`)&&(typeof a.checkVisibility!=`function`||a.checkVisibility())&&a.focus()},[E]),d(()=>()=>{window.clearTimeout(R.current),window.clearTimeout(z.current),B.current!=null&&window.cancelAnimationFrame(B.current),L.current?.cancel()},[]);let re=e=>{let t=P.current,n=e.relatedTarget;t!=null&&(n==null||!t.contains(n))&&n instanceof HTMLElement&&(U.current=n),e.target instanceof HTMLElement&&(W.current=e.target)},ie=e=>{if(e.relatedTarget!=null){let t=P.current;(t==null||!t.contains(e.relatedTarget))&&(W.current=null);return}let t=e.target;t instanceof HTMLElement&&(B.current!=null&&window.cancelAnimationFrame(B.current),B.current=window.requestAnimationFrame(()=>{B.current=void 0;let e=F.current;e==null||e.hidden||(!t.isConnected||t.matches(`:disabled`)||t.hidden)&&document.activeElement===document.body&&e.focus({preventScroll:!0})}))},ae=e=>{_?.(e),e.target===e.currentTarget&&(e.propertyName===`opacity`||e.propertyName===`translate`)&&D(e=>e===`closing`?`closed`:e)},Q=i??(e==null&&M!=null?M:void 0),oe=Q==null?e??y:e,$=E===`closed`,se=$||E===`closing`;return v(S.Provider,{value:ne,children:ee(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex justify-center px-4 sm:bottom-10`,onBlur:ie,onFocus:re,ref:P,children:[v(`div`,{"aria-atomic":`true`,"aria-live":`polite`,className:`sr-only`,role:`status`,children:O}),v(`div`,{className:`sr-only`,role:`alert`,children:A}),v(`div`,{className:n(`invert-theme pointer-events-auto flex w-fit max-w-full flex-wrap items-center justify-center gap-x-4 gap-y-2 rounded-2xl border border-transparent bg-base px-4 py-3 text-strong shadow-lg`,`max-h-[60svh] overflow-y-auto`,`focus:outline-hidden`,`[&[hidden]]:hidden`,`transition-[opacity,translate] ease-out`,`data-state-open:duration-400`,`data-state-closed:pointer-events-none data-state-closed:opacity-0 data-state-closed:duration-200 motion-safe:data-state-closed:translate-y-[calc(100%+2.5rem)]`,`data-state-closed:ease-[cubic-bezier(0.4,0,1,1),cubic-bezier(0,0,0.2,1)]`,c),...T,"aria-label":oe,"aria-labelledby":Q,"data-slot":r(u,`sandbar`),"data-state":E===`open`?`open`:`closed`,hidden:$?!0:void 0,inert:se?!0:void 0,onTransitionEnd:ae,ref:I,role:`group`,tabIndex:-1,children:a})]})})},Message:({asChild:a,className:o,"data-slot":s,id:c,ref:l,...u})=>{let{registerMessage:d}=C(`Sandbar.Message`),p=f(),m=c??p,g=h(null),_=t(g,l);return e(()=>d(g.current?.id||m),[m,d]),v(a?i:`p`,{className:n(`text-sm font-sans`,o),id:m,...u,"data-slot":r(s,`sandbar-message`),ref:_})},Actions:({asChild:e,className:t,"data-slot":a,...o})=>v(e?i:`div`,{className:n(`flex flex-wrap items-center justify-center gap-2`,t),...o,"data-slot":r(a,`sandbar-actions`)}),SaveButton:({appearance:n=`filled`,children:i,"data-slot":o,intent:s=`neutral`,isLoading:c=!1,ref:l,...u})=>{let{reportSaving:d}=C(`Sandbar.SaveButton`),f=h(null),p=t(f,l);return e(()=>{d({button:f.current,isSaving:!!c})},[c,d]),e(()=>()=>{d({button:null,isSaving:!1})},[d]),v(a,{appearance:n,intent:s,isLoading:c,ref:p,...u,"data-slot":r(o,`sandbar-save-button`),children:i})},DiscardButton:({appearance:e=`outlined`,children:t,"data-slot":n,intent:i=`neutral`,...o})=>v(a,{appearance:e,intent:i,...o,"data-slot":r(n,`sandbar-discard-button`),children:t})};export{w as Sandbar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./slot-C3gII_9c.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})=>{let l=i?e:`div`,{role:u,...d}=n({allowClickEventDefault:r,onClick:o});return t(l,{ref:s,...c,...d,...!i&&{role:u},children:a})};export{n,r as t};
|
|
@@ -23,6 +23,9 @@ type EventProps = BaseProps & {
|
|
|
23
23
|
* Props for the sandboxed onClick container. Spread this on the element you want
|
|
24
24
|
* to prevent the click event from bubbling out of.
|
|
25
25
|
*
|
|
26
|
+
* If the element already has a role, take only `onClick`: `role="presentation"`
|
|
27
|
+
* on a `<td>` removes the cell from the table.
|
|
28
|
+
*
|
|
26
29
|
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click
|
|
27
30
|
*/
|
|
28
31
|
declare const sandboxedOnClickProps: ({ allowClickEventDefault, onClick }?: EventProps) => {
|
|
@@ -41,6 +44,11 @@ type Props = ComponentProps<"div"> & WithAsChild & BaseProps;
|
|
|
41
44
|
/**
|
|
42
45
|
* A container that prevents the click event from bubbling out of it.
|
|
43
46
|
*
|
|
47
|
+
* The default `<div>` carries `role="presentation"`, because it exists only to
|
|
48
|
+
* catch bubbled clicks. With `asChild`, the child keeps its own role and gets
|
|
49
|
+
* only the sandboxed `onClick`: a presentational role on a link or button is a
|
|
50
|
+
* conflict that user agents ignore.
|
|
51
|
+
*
|
|
44
52
|
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click
|
|
45
53
|
*
|
|
46
54
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e,t}from"./sandboxed-on-click-UagMFl_U.js";export{t as SandboxedOnClick,e as sandboxedOnClickProps};
|
package/dist/scatter-plot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-B_rZqf8a.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,...e}),Point:e=>a(`ScatterPlot.Point`,`scatter`,e),Grid:e=>n(`ScatterPlot.Grid`,e),XAxis:e=>t(`ScatterPlot.XAxis`,e),YAxis:e=>r(`ScatterPlot.YAxis`,e),ReferenceLine:t=>e(`ScatterPlot.ReferenceLine`,t),Tooltip:e=>s(`ScatterPlot.Tooltip`,e),Legend:e=>l(i,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),CopyButton:e=>l(c,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...e})};export{u as ScatterPlot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./compose-refs-DdUwopIY.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./icon-CGKaq_tV.js";import{r}from"./layer-container-BTcQpd4K.js";import{a as i,r as a}from"./field-Bpptk_9t.js";import{t as o}from"./field-B1wqeZr4.js";import{n as s}from"./separator-Da8lDnio.js";import{CaretDownIcon as c}from"@phosphor-icons/react/CaretDown";import{createContext 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 _=l({}),v=({"aria-invalid":e,children:t,id:n,validation:r,onBlur:i,onValueChange:a,onChange:o,ref:s,...c})=>{let l=d(()=>({"aria-invalid":e,id:n,validation:r,onBlur:i,ref:s}),[e,n,r,i,s]);return f(g.Root,{...c,onValueChange:e=>{o?.(e),a?.(e)},children:f(_.Provider,{value:l,children:t})})},y=({className:e,ref:n,...r})=>f(g.Group,{ref:n,"data-slot":`select-group`,className:t(`space-y-px`,e),...r}),b=g.Value,x=({"aria-invalid":r,className:s,children:l,id:d,onBlur:m,ref:h,validation:v,...y})=>{let b=u(_),x=u(o),S=e(h,b.ref),C=i(),w=x?x[`aria-invalid`]:b[`aria-invalid`]??r,T=b.validation??v??C,{ariaInvalid:E,validation:D}=a({"aria-invalid":w,validation:T}),O=x?x.id:b.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`,s),"data-validation":D||void 0,id:O,ref:S,...y,onBlur:e=>{m?.(e),b.onBlur?.(e)},...x?{"aria-describedby":x[`aria-describedby`],"aria-errormessage":x[`aria-errormessage`]}:void 0,"aria-invalid":E,children:[l,f(g.Icon,{asChild:!0,children:f(n,{svg:f(c,{weight:`bold`}),className:`size-4`})})]})},S=({className:e,ref:r,...i})=>f(g.ScrollUpButton,{ref:r,className:t(`flex cursor-default items-center justify-center py-1`,e),...i,children:f(n,{svg:f(h,{weight:`bold`}),className:`size-4`})}),C=({className:e,ref:r,...i})=>f(g.ScrollDownButton,{ref:r,className:t(`flex cursor-default items-center justify-center py-1`,e),...i,children:f(n,{svg:f(c,{weight:`bold`}),className:`size-4`})}),w={Root:v,Content:({className:e,children:n,position:i=`popper`,ref:a,width:o=`trigger`,...s})=>{let c=r();return f(g.Portal,{container:c,children:p(g.Content,{ref:a,"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`,i===`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)`,o===`trigger`&&`w-(--radix-select-trigger-width)`,e),position:i,...s,children:[f(S,{}),f(g.Viewport,{className:t(`p-1 space-y-px`,i===`popper`&&`h-(--radix-select-trigger-height) w-full`),children:n}),f(C,{})]})})},Group:y,Item:({className:e,children:r,icon:i,ref:a,...o})=>p(g.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&&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`})})]}),Label:({className:e,ref:n,...r})=>f(g.Label,{ref:n,"data-slot":`select-label`,className:t(`px-2 py-1.5 text-sm font-medium`,e),...r}),Separator:({className:e,ref:n,...r})=>f(s,{ref:n,"data-slot":`select-separator`,className:t(`-mx-1 my-1 h-px w-auto`,e),...r}),Trigger:x,Value:b};export{w as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as WithValidation } from "./field-7QeiTFwl.js";
|
|
2
|
-
import { n as Separator } from "./separator-
|
|
2
|
+
import { n as Separator } from "./separator-Bo4nY_3M.js";
|
|
3
3
|
import { ComponentProps, FocusEvent, PropsWithChildren, ReactNode, Ref, SelectHTMLAttributes } from "react";
|
|
4
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
5
|
//#region src/components/select/select.d.ts
|
|
@@ -14,8 +14,8 @@ type SelectProps = PropsWithChildren & {
|
|
|
14
14
|
id?: string;
|
|
15
15
|
name?: string;
|
|
16
16
|
/**
|
|
17
|
-
* Event handler called when
|
|
18
|
-
*
|
|
17
|
+
* Event handler called when the trigger button blurs. Runs after any
|
|
18
|
+
* `onBlur` passed on `Select.Trigger`.
|
|
19
19
|
*/
|
|
20
20
|
onBlur?: (event: FocusEvent<HTMLButtonElement>) => void;
|
|
21
21
|
/**
|
|
@@ -45,7 +45,7 @@ type SelectProps = PropsWithChildren & {
|
|
|
45
45
|
* ambient `validation` from `Field.Item`. Note: rendered `Field.Errors` /
|
|
46
46
|
* `Field.ErrorList` set `aria-invalid="true"` on the trigger via
|
|
47
47
|
* `Field.Control`'s wiring, which still forces the trigger into the error
|
|
48
|
-
* state
|
|
48
|
+
* state; suppress the inferred error by passing `validation` on `Field.Item`
|
|
49
49
|
* if a non-error `Select.Root` state needs to win in that case.
|
|
50
50
|
*
|
|
51
51
|
* `Select.Content` renders at Tailwind `z-50`, Mantle's float tier. When
|
|
@@ -144,7 +144,7 @@ type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & WithA
|
|
|
144
144
|
* </Select.Root>
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
declare const Trigger: ({ "aria-invalid": ariaInValidProp, className, children, id: propId, ref, validation: propValidation, ...props }: SelectTriggerProps) => import("react").JSX.Element;
|
|
147
|
+
declare const Trigger: ({ "aria-invalid": ariaInValidProp, className, children, id: propId, onBlur, ref, validation: propValidation, ...props }: SelectTriggerProps) => import("react").JSX.Element;
|
|
148
148
|
type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & {
|
|
149
149
|
/**
|
|
150
150
|
* The width of the content. Defaults to the width of the trigger.
|
|
@@ -155,7 +155,9 @@ type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & {
|
|
|
155
155
|
};
|
|
156
156
|
/**
|
|
157
157
|
* The component that pops out when the select is open as a portal adjacent to the trigger button.
|
|
158
|
-
* It contains a scrolling viewport of the select items.
|
|
158
|
+
* It contains a scrolling viewport of the select items. `position` defaults to
|
|
159
|
+
* `"popper"`, so the list opens below the trigger instead of over the selected
|
|
160
|
+
* item.
|
|
159
161
|
*
|
|
160
162
|
* `Select.Content` renders at Tailwind `z-50`, Mantle's float tier. When
|
|
161
163
|
* composed inside an open `Dialog`, `AlertDialog`, or `Sheet`, it portals into
|
|
@@ -220,13 +222,17 @@ declare const Content: ({ className, children, position, ref, width, ...props }:
|
|
|
220
222
|
*/
|
|
221
223
|
declare const Label: ({ className, ref, ...props }: ComponentProps<typeof SelectPrimitive.Label>) => import("react").JSX.Element;
|
|
222
224
|
type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & {
|
|
225
|
+
/**
|
|
226
|
+
* An optional icon rendered before the item text.
|
|
227
|
+
*/
|
|
223
228
|
icon?: ReactNode;
|
|
224
229
|
};
|
|
225
230
|
/**
|
|
226
231
|
* An option within a select menu. Similar to an html `<option>` element.
|
|
227
232
|
* Has a required `value` prop. When a user selects this item, `Select.Root`
|
|
228
233
|
* passes that value to its `onValueChange` handler.
|
|
229
|
-
* Displays the children as the option's text.
|
|
234
|
+
* Displays the children as the option's text. Pass `icon` to render an icon
|
|
235
|
+
* before the text.
|
|
230
236
|
*
|
|
231
237
|
* @see https://mantle.ngrok.com/components/forms/select#selectitem
|
|
232
238
|
*
|
|
@@ -343,6 +349,14 @@ declare const Select: {
|
|
|
343
349
|
* and search/filtering is unnecessary. For larger lists or async/searchable data, use
|
|
344
350
|
* Combobox. For picking multiple options, use MultiSelect.
|
|
345
351
|
*
|
|
352
|
+
* Pass `validation` here when the entire select has an explicit state. That
|
|
353
|
+
* root state is forwarded to `Select.Trigger` and takes precedence over the
|
|
354
|
+
* ambient `validation` from `Field.Item`. Note: rendered `Field.Errors` /
|
|
355
|
+
* `Field.ErrorList` set `aria-invalid="true"` on the trigger via
|
|
356
|
+
* `Field.Control`'s wiring, which still forces the trigger into the error
|
|
357
|
+
* state; suppress the inferred error by passing `validation` on `Field.Item`
|
|
358
|
+
* if a non-error `Select.Root` state needs to win in that case.
|
|
359
|
+
*
|
|
346
360
|
* `Select.Content` renders at Tailwind `z-50`, Mantle's float tier. When
|
|
347
361
|
* composed inside an open `Dialog`, `AlertDialog`, or `Sheet`, it portals into
|
|
348
362
|
* that overlay's positioner and paints above the overlay that owns it. Outside
|
|
@@ -378,7 +392,9 @@ declare const Select: {
|
|
|
378
392
|
readonly Root: typeof Root;
|
|
379
393
|
/**
|
|
380
394
|
* The component that pops out when the select is open as a portal adjacent to the trigger button.
|
|
381
|
-
* It contains a scrolling viewport of the select items.
|
|
395
|
+
* It contains a scrolling viewport of the select items. `position` defaults to
|
|
396
|
+
* `"popper"`, so the list opens below the trigger instead of over the selected
|
|
397
|
+
* item.
|
|
382
398
|
*
|
|
383
399
|
* `Select.Content` renders at Tailwind `z-50`, Mantle's float tier. When
|
|
384
400
|
* composed inside an open `Dialog`, `AlertDialog`, or `Sheet`, it portals into
|
|
@@ -447,7 +463,8 @@ declare const Select: {
|
|
|
447
463
|
* An option within a select menu. Similar to an html `<option>` element.
|
|
448
464
|
* Has a required `value` prop. When a user selects this item, `Select.Root`
|
|
449
465
|
* passes that value to its `onValueChange` handler.
|
|
450
|
-
* Displays the children as the option's text.
|
|
466
|
+
* Displays the children as the option's text. Pass `icon` to render an icon
|
|
467
|
+
* before the text.
|
|
451
468
|
*
|
|
452
469
|
* @see https://mantle.ngrok.com/components/forms/select#selectitem
|
|
453
470
|
*
|
|
@@ -535,6 +552,10 @@ declare const Select: {
|
|
|
535
552
|
readonly Separator: typeof SelectSeparatorComponent;
|
|
536
553
|
/**
|
|
537
554
|
* The button that toggles the select. The Select.Content will position itself adjacent to the trigger.
|
|
555
|
+
* When composing with `Field.Item`, wrap `Select.Root` in `Field.Control`:
|
|
556
|
+
* the generated `id`, `name`, and `aria-invalid` flow onto `Select.Root` (so
|
|
557
|
+
* the hidden form input gets the field name), and the trigger reads
|
|
558
|
+
* `aria-describedby` / `aria-errormessage` from `FieldControlContext`.
|
|
538
559
|
*
|
|
539
560
|
* @see https://mantle.ngrok.com/components/forms/select#selecttrigger
|
|
540
561
|
*
|
package/dist/select.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Select } from "./select-
|
|
1
|
+
import { t as Select } from "./select-ouAW88jx.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-Dov9H2CX.js";export{e as Select};
|