@ngrok/mantle 0.85.1 → 0.85.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/agent.json +1 -1
- package/dist/llms.txt +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/{select-ouAW88jx.d.ts → select-CKAiBEGt.d.ts} +223 -13
- package/dist/select-DCni0ZwA.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/package.json +1 -1
- package/dist/select-sOHUE2Bm.js +0 -1
package/dist/agent.json
CHANGED
package/dist/llms.txt
CHANGED
package/dist/pagination.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ButtonGroup } from "./button-DO53OA70.js";
|
|
2
|
-
import { t as Select } from "./select-
|
|
2
|
+
import { t as Select } from "./select-CKAiBEGt.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
//#region src/components/pagination/cursor-pagination.d.ts
|
|
5
5
|
/**
|
package/dist/pagination.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./button-pwkdtR3U.js";import{t as n}from"./button-BFpCB99R.js";import{n as r}from"./separator-D98be0gY.js";import{t as i}from"./select-
|
|
1
|
+
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./button-pwkdtR3U.js";import{t as n}from"./button-BFpCB99R.js";import{n as r}from"./separator-D98be0gY.js";import{t as i}from"./select-DCni0ZwA.js";import{c as a}from"react/compiler-runtime";import{createContext as o,useContext as s,useEffect as c,useRef as l,useState as u}from"react";import d from"tiny-invariant";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CaretRightIcon as m}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as h}from"@phosphor-icons/react/CaretLeft";const g=o(void 0),_=t=>{let n=a(24),r,i,o,s,c,l,p;n[0]===t?(r=n[1],i=n[2],o=n[3],s=n[4],c=n[5],l=n[6],p=n[7]):({className:i,children:r,defaultPageSize:o,onChangePageSize:s,pageSize:c,ref:p,...l}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=p);let m=c!=null,[h,_]=u(o),v=m?c:h;d(v!=null,"CursorPagination.Root requires either `defaultPageSize` or `pageSize`");let y;n[8]!==m||n[9]!==s?(y=e=>{m||_(e),s?.(e)},n[8]=m,n[9]=s,n[10]=y):y=n[10];let b;n[11]!==v||n[12]!==y?(b={pageSize:v,setPageSize:y},n[11]=v,n[12]=y,n[13]=b):b=n[13];let x=b,S;n[14]===i?S=n[15]:(S=e(`inline-flex items-center justify-between gap-2`,i),n[14]=i,n[15]=S);let C;n[16]!==r||n[17]!==l||n[18]!==p||n[19]!==S?(C=f(`div`,{"data-slot":`cursor-pagination`,className:S,ref:p,...l,children:r}),n[16]=r,n[17]=l,n[18]=p,n[19]=S,n[20]=C):C=n[20];let w;return n[21]!==x||n[22]!==C?(w=f(g.Provider,{value:x,children:C}),n[21]=x,n[22]=C,n[23]=w):w=n[23],w},v=e=>{let i=a(21),o,s,c,l,u,d;i[0]===e?(o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6]):({hasNextPage:o,hasPreviousPage:s,onNextPage:c,onPreviousPage:l,ref:d,...u}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d);let g=!s,_;i[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=f(h,{}),i[7]=_):_=i[7];let v;i[8]!==l||i[9]!==g?(v=f(t,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:g,icon:_,intent:`neutral`,label:`Previous page`,onClick:l,size:`sm`,type:`button`}),i[8]=l,i[9]=g,i[10]=v):v=i[10];let y;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=f(r,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),i[11]=y):y=i[11];let b=!o,x;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=f(m,{}),i[12]=x):x=i[12];let S;i[13]!==c||i[14]!==b?(S=f(t,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:b,icon:x,intent:`neutral`,label:`Next page`,onClick:c,size:`sm`,type:`button`}),i[13]=c,i[14]=b,i[15]=S):S=i[15];let C;return i[16]!==u||i[17]!==d||i[18]!==v||i[19]!==S?(C=p(n,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:d,...u,children:[v,y,S]}),i[16]=u,i[17]=d,i[18]=v,i[19]=S,i[20]=C):C=i[20],C},y=[5,10,20,50,100],b=t=>{let n=a(27),r,o,c,l,u;n[0]===t?(r=n[1],o=n[2],c=n[3],l=n[4],u=n[5]):({className:r,pageSizes:u,onChangePageSize:o,ref:c,...l}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=c,n[4]=l,n[5]=u);let m=u===void 0?y:u,h=s(g);d(h,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),d(m.includes(h.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`);let _=`${h.pageSize}`,v;n[6]!==h||n[7]!==o?(v=e=>{let t=Number.parseInt(e,10);d(!Number.isNaN(t),`CursorPageSizeSelect.pageSizes must contain only numbers`),h.setPageSize(t),o?.(t)},n[6]=h,n[7]=o,n[8]=v):v=n[8];let b;n[9]===r?b=n[10]:(b=e(`w-auto min-w-36`,r),n[9]=r,n[10]=b);let x;n[11]===h.pageSize?x=n[12]:(x=p(i.Value,{children:[h.pageSize,` per page`]}),n[11]=h.pageSize,n[12]=x);let S;n[13]!==c||n[14]!==l||n[15]!==b||n[16]!==x?(S=f(i.Trigger,{ref:c,"aria-label":`Items per page`,"data-slot":`cursor-pagination-page-size-select`,className:b,...l,children:x}),n[13]=c,n[14]=l,n[15]=b,n[16]=x,n[17]=S):S=n[17];let w;n[18]===m?w=n[19]:(w=m.map(C),n[18]=m,n[19]=w);let T;n[20]===w?T=n[21]:(T=f(i.Content,{width:`trigger`,children:w}),n[20]=w,n[21]=T);let E;return n[22]!==_||n[23]!==v||n[24]!==S||n[25]!==T?(E=p(i.Root,{value:_,onValueChange:v,children:[S,T]}),n[22]=_,n[23]=v,n[24]=S,n[25]=T,n[26]=E):E=n[26],E};function x(t){let n=a(9),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let o=s(g);d(o,`CursorPageSizeValue must be used as a child of a CursorPagination component`);let c;n[3]===r?c=n[4]:(c=e(`text-muted text-sm font-normal`,r),n[3]=r,n[4]=c);let l;return n[5]!==o.pageSize||n[6]!==i||n[7]!==c?(l=p(`span`,{"data-slot":`cursor-pagination-page-size-value`,className:c,...i,children:[o.pageSize,` per page`]}),n[5]=o.pageSize,n[6]=i,n[7]=c,n[8]=l):l=n[8],l}const S={Root:_,Buttons:v,PageSizeSelect:b,PageSizeValue:x};function C(e){return p(i.Item,{value:`${e}`,children:[e,` per page`]},e)}function w(e,t){return Math.max(1,Math.min(Number.isNaN(e)?1:Math.floor(e),t))}function T(e){let t=a(41),{defaultPage:n,listSize:r,onPageChange:i,page:o,pageSize:s,resetPageOnListSizeChange:d}=e,f=n===void 0?1:n,p=d===void 0||d,m=o!=null,[h,g]=u(f),[_,v]=u(s),y=Math.ceil(r/_),b=m?o:h,x=w(b,y),S=(x-1)*_,C=x>1,T=x<y,E;t[0]!==m||t[1]!==i||t[2]!==b?(E=e=>{e!==b&&(m||g(e),i?.(e))},t[0]=m,t[1]=i,t[2]=b,t[3]=E):E=t[3];let D=E,O=l(s),k=l(r),A,j;t[4]!==r||t[5]!==s||t[6]!==p||t[7]!==D?(A=()=>{let e=O.current!==s,t=k.current!==r;O.current=s,k.current=r,e&&v(s),(e||t&&p)&&D(1)},j=[r,s,p,D],t[4]=r,t[5]=s,t[6]=p,t[7]=D,t[8]=A,t[9]=j):(A=t[8],j=t[9]),c(A,j);let M;t[10]!==D||t[11]!==y?(M=function(e){D(w(e,y))},t[10]=D,t[11]=y,t[12]=M):M=t[12];let N=M,P;t[13]!==x||t[14]!==T||t[15]!==D?(P=function(){T&&D(x+1)},t[13]=x,t[14]=T,t[15]=D,t[16]=P):P=t[16];let F=P,I;t[17]!==x||t[18]!==C||t[19]!==D?(I=function(){C&&D(x-1)},t[17]=x,t[18]=C,t[19]=D,t[20]=I):I=t[20];let L=I,R;t[21]===D?R=t[22]:(R=function(e){v(e),D(1)},t[21]=D,t[22]=R);let z=R,B;t[23]!==D||t[24]!==y?(B=function(){D(w(y,y))},t[23]=D,t[24]=y,t[25]=B):B=t[25];let V=B,H;t[26]===D?H=t[27]:(H=function(){D(1)},t[26]=D,t[27]=H);let U=H,W;return t[28]!==x||t[29]!==_||t[30]!==U||t[31]!==V||t[32]!==N||t[33]!==T||t[34]!==C||t[35]!==F||t[36]!==S||t[37]!==L||t[38]!==z||t[39]!==y?(W={currentPage:x,goToFirstPage:U,goToLastPage:V,goToPage:N,hasNextPage:T,hasPreviousPage:C,nextPage:F,offset:S,pageSize:_,previousPage:L,setPageSize:z,totalPages:y},t[28]=x,t[29]=_,t[30]=U,t[31]=V,t[32]=N,t[33]=T,t[34]=C,t[35]=F,t[36]=S,t[37]=L,t[38]=z,t[39]=y,t[40]=W):W=t[40],W}function E(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{S as CursorPagination,E as getOffsetPaginatedSlice,T as useOffsetPagination};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
1
2
|
import { o as WithValidation } from "./field-7QeiTFwl.js";
|
|
2
3
|
import { n as Separator } from "./separator-Bo4nY_3M.js";
|
|
3
4
|
import { ComponentProps, FocusEvent, PropsWithChildren, ReactNode, Ref, SelectHTMLAttributes } from "react";
|
|
@@ -5,13 +6,40 @@ import * as SelectPrimitive from "@radix-ui/react-select";
|
|
|
5
6
|
//#region src/components/select/select.d.ts
|
|
6
7
|
type WithAriaInvalid = Pick<SelectHTMLAttributes<HTMLSelectElement>, "aria-invalid">;
|
|
7
8
|
type SelectProps = PropsWithChildren & {
|
|
9
|
+
/**
|
|
10
|
+
* The `autocomplete` attribute of the hidden native select.
|
|
11
|
+
*/
|
|
8
12
|
autoComplete?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the list is open on first render. Use for an uncontrolled open state.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
9
17
|
defaultOpen?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The value on first render. Use for an uncontrolled value.
|
|
20
|
+
*/
|
|
10
21
|
defaultValue?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The reading direction. When omitted, inherits from `DirectionProvider`.
|
|
24
|
+
*/
|
|
11
25
|
dir?: "ltr" | "rtl";
|
|
26
|
+
/**
|
|
27
|
+
* Whether the whole select is inert. The trigger stamps `data-disabled`.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
12
30
|
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The `id` of the form the hidden native select belongs to, when it sits
|
|
33
|
+
* outside that form.
|
|
34
|
+
*/
|
|
13
35
|
form?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The `id` of the trigger button. `Field.Control` sets it for you.
|
|
38
|
+
*/
|
|
14
39
|
id?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The name of the hidden native select, submitted with its owning form.
|
|
42
|
+
*/
|
|
15
43
|
name?: string;
|
|
16
44
|
/**
|
|
17
45
|
* Event handler called when the trigger button blurs. Runs after any
|
|
@@ -23,14 +51,30 @@ type SelectProps = PropsWithChildren & {
|
|
|
23
51
|
* @deprecated Use `onValueChange` instead.
|
|
24
52
|
*/
|
|
25
53
|
onChange?: (value: string) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Event handler called when the open state changes.
|
|
56
|
+
*/
|
|
26
57
|
onOpenChange?(open: boolean): void;
|
|
58
|
+
/**
|
|
59
|
+
* Event handler called when the value changes.
|
|
60
|
+
*/
|
|
27
61
|
onValueChange?(value: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* The controlled open state. Pair with `onOpenChange`.
|
|
64
|
+
*/
|
|
28
65
|
open?: boolean;
|
|
29
66
|
/**
|
|
30
67
|
* Ref for the trigger button.
|
|
31
68
|
*/
|
|
32
69
|
ref?: Ref<HTMLButtonElement>;
|
|
70
|
+
/**
|
|
71
|
+
* Whether a value is required before the owning form submits.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
33
74
|
required?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The controlled value. Pair with `onValueChange`.
|
|
77
|
+
*/
|
|
34
78
|
value?: string;
|
|
35
79
|
} & WithValidation & WithAriaInvalid;
|
|
36
80
|
/**
|
|
@@ -85,6 +129,10 @@ declare const Root: ({ "aria-invalid": _ariaInvalid, children, id, validation, o
|
|
|
85
129
|
* A group of related options within a select menu. Similar to an html `<optgroup>` element.
|
|
86
130
|
* Pair it with `Select.Label`, which gives the group its accessible name.
|
|
87
131
|
*
|
|
132
|
+
* | Data Attribute | Value | Description |
|
|
133
|
+
* | -------------- | ---------------- | --------------------- |
|
|
134
|
+
* | `data-slot` | `"select-group"` | On the group element. |
|
|
135
|
+
*
|
|
88
136
|
* @see https://mantle.ngrok.com/components/forms/select#selectgroup
|
|
89
137
|
*
|
|
90
138
|
* @example
|
|
@@ -110,15 +158,76 @@ declare const Root: ({ "aria-invalid": _ariaInvalid, children, id, validation, o
|
|
|
110
158
|
* </Select.Root>
|
|
111
159
|
* ```
|
|
112
160
|
*/
|
|
113
|
-
declare const Group: ({ className, ref, ...props }: ComponentProps<typeof SelectPrimitive.Group>) => import("react").JSX.Element;
|
|
114
|
-
type
|
|
161
|
+
declare const Group: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof SelectPrimitive.Group> & WithDataSlot) => import("react").JSX.Element;
|
|
162
|
+
type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value> & WithDataSlot;
|
|
163
|
+
/**
|
|
164
|
+
* The part that reflects the selected value. Renders the selected item's text
|
|
165
|
+
* by default. For more control, control the select and pass your own children.
|
|
166
|
+
* Do not style this part: under `Select.Content position="item-aligned"`, Radix
|
|
167
|
+
* measures its box to align the open list over the selected item. Pass
|
|
168
|
+
* `placeholder` for the text to show when the select has no value.
|
|
169
|
+
*
|
|
170
|
+
* **Structure.** `placeholder` renders inside a
|
|
171
|
+
* `<span data-slot="select-placeholder">`, your own `children` inside a
|
|
172
|
+
* `<span data-slot="select-value-label">`, and the selected item's text arrives
|
|
173
|
+
* inside the `select-item-label` span that `Select.Item` renders. Each span is
|
|
174
|
+
* `display: contents`, so it lays out nothing of its own. React removes one of
|
|
175
|
+
* those spans whenever the value changes, and an element removal cannot throw:
|
|
176
|
+
* a browser translation engine reparents text nodes, and a removal aimed at a
|
|
177
|
+
* reparented text node does.
|
|
178
|
+
*
|
|
179
|
+
* **`asChild` is not supported.** Radix hands its `Slot` a keyed Fragment, so
|
|
180
|
+
* your element receives none of the value's props and React warns. Pass
|
|
181
|
+
* `children` instead.
|
|
182
|
+
*
|
|
183
|
+
* | Data Attribute | Value | Description |
|
|
184
|
+
* | -------------- | ---------------------- | ----------------------------------------------------------------------------- |
|
|
185
|
+
* | `data-slot` | `"select-value"` | On the value element. |
|
|
186
|
+
* | `data-slot` | `"select-placeholder"` | On the `<span>` wrapping `placeholder`. Present only while there is no value. |
|
|
187
|
+
* | `data-slot` | `"select-value-label"` | On the `<span>` wrapping your `children`. Absent under `asChild`. |
|
|
188
|
+
*
|
|
189
|
+
* @see https://mantle.ngrok.com/components/forms/select#selectvalue
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```tsx
|
|
193
|
+
* <Select.Root>
|
|
194
|
+
* <Select.Trigger>
|
|
195
|
+
* <Select.Value placeholder="Select a fruit" />
|
|
196
|
+
* </Select.Trigger>
|
|
197
|
+
* <Select.Content>
|
|
198
|
+
* <Select.Group>
|
|
199
|
+
* <Select.Label>Fruits</Select.Label>
|
|
200
|
+
* <Select.Item value="apple">Apple</Select.Item>
|
|
201
|
+
* <Select.Item value="banana">Banana</Select.Item>
|
|
202
|
+
* <Select.Item value="cherry">Cherry</Select.Item>
|
|
203
|
+
* </Select.Group>
|
|
204
|
+
* <Select.Separator />
|
|
205
|
+
* <Select.Group>
|
|
206
|
+
* <Select.Label>Veggies</Select.Label>
|
|
207
|
+
* <Select.Item value="carrot">Carrot</Select.Item>
|
|
208
|
+
* <Select.Item value="cucumber">Cucumber</Select.Item>
|
|
209
|
+
* </Select.Group>
|
|
210
|
+
* </Select.Content>
|
|
211
|
+
* </Select.Root>
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
declare const Value: ({ asChild, children, "data-slot": dataSlot, placeholder, ref, ...props }: SelectValueProps) => import("react").JSX.Element;
|
|
215
|
+
type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & WithAriaInvalid & WithDataSlot & WithValidation;
|
|
115
216
|
/**
|
|
116
217
|
* The button that toggles the select. The Select.Content will position itself adjacent to the trigger.
|
|
117
|
-
* When composing with `Field.Item`, wrap `Select.Root` in `Field.Control
|
|
218
|
+
* When composing with `Field.Item`, wrap `Select.Root` in `Field.Control`:
|
|
118
219
|
* the generated `id`, `name`, and `aria-invalid` flow onto `Select.Root` (so
|
|
119
220
|
* the hidden form input gets the field name), and the trigger reads
|
|
120
221
|
* `aria-describedby` / `aria-errormessage` from `FieldControlContext`.
|
|
121
222
|
*
|
|
223
|
+
* | Data Attribute | Value | Description |
|
|
224
|
+
* | ------------------ | --------------------------------------- | -------------------------------------------------------------------- |
|
|
225
|
+
* | `data-slot` | `"select-trigger"` | On the trigger button. |
|
|
226
|
+
* | `data-state` | `"open"` \| `"closed"` | Whether the list is open. |
|
|
227
|
+
* | `data-placeholder` | present when there is no value | Presence-only. Style the placeholder text with `data-placeholder:`. |
|
|
228
|
+
* | `data-disabled` | present when disabled | Presence-only. The `disabled` prop on `Select.Root`. |
|
|
229
|
+
* | `data-validation` | `"success"` \| `"warning"` \| `"error"` | The resolved `validation` state. Omitted when there is none. |
|
|
230
|
+
*
|
|
122
231
|
* @see https://mantle.ngrok.com/components/forms/select#selecttrigger
|
|
123
232
|
*
|
|
124
233
|
* @example
|
|
@@ -144,11 +253,11 @@ type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & WithA
|
|
|
144
253
|
* </Select.Root>
|
|
145
254
|
* ```
|
|
146
255
|
*/
|
|
147
|
-
declare const Trigger: ({ "aria-invalid": ariaInValidProp, className, children, id: propId, onBlur, ref, validation: propValidation, ...props }: SelectTriggerProps) => import("react").JSX.Element;
|
|
148
|
-
type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & {
|
|
256
|
+
declare const Trigger: ({ "aria-invalid": ariaInValidProp, className, children, "data-slot": dataSlot, id: propId, onBlur, ref, validation: propValidation, ...props }: SelectTriggerProps) => import("react").JSX.Element;
|
|
257
|
+
type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & WithDataSlot & {
|
|
149
258
|
/**
|
|
150
259
|
* The width of the content. Defaults to the width of the trigger.
|
|
151
|
-
* If set to "content", the content takes its intrinsic width
|
|
260
|
+
* If set to "content", the content takes its intrinsic width: the width of the widest item.
|
|
152
261
|
* @default "trigger"
|
|
153
262
|
*/
|
|
154
263
|
width?: "trigger" | "content";
|
|
@@ -166,6 +275,13 @@ type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & {
|
|
|
166
275
|
* (`z-60`). When sibling floats share a container, the most recently mounted
|
|
167
276
|
* float paints on top.
|
|
168
277
|
*
|
|
278
|
+
* | Data Attribute | Value | Description |
|
|
279
|
+
* | -------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
|
|
280
|
+
* | `data-slot` | `"select-content"` | On the content element. |
|
|
281
|
+
* | `data-state` | `"open"` \| `"closed"` | Drives the open and close animations. |
|
|
282
|
+
* | `data-side` | `"top"` \| `"right"` \| `"bottom"` \| `"left"` | The side of the trigger the list opened on. `position="popper"` only. |
|
|
283
|
+
* | `data-align` | `"start"` \| `"center"` \| `"end"` | The alignment against the trigger. `position="popper"` only. |
|
|
284
|
+
*
|
|
169
285
|
* @see https://mantle.ngrok.com/components/forms/select#selectcontent
|
|
170
286
|
*
|
|
171
287
|
* @example
|
|
@@ -191,10 +307,14 @@ type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & {
|
|
|
191
307
|
* </Select.Root>
|
|
192
308
|
* ```
|
|
193
309
|
*/
|
|
194
|
-
declare const Content: ({ className, children, position, ref, width, ...props }: SelectContentProps) => import("react").JSX.Element;
|
|
310
|
+
declare const Content: ({ className, children, "data-slot": dataSlot, position, ref, width, ...props }: SelectContentProps) => import("react").JSX.Element;
|
|
195
311
|
/**
|
|
196
312
|
* Used to render the label of a group. It won't be focusable using arrow keys.
|
|
197
313
|
*
|
|
314
|
+
* | Data Attribute | Value | Description |
|
|
315
|
+
* | -------------- | ---------------- | --------------------------- |
|
|
316
|
+
* | `data-slot` | `"select-label"` | On the group label element. |
|
|
317
|
+
*
|
|
198
318
|
* @see https://mantle.ngrok.com/components/forms/select#selectlabel
|
|
199
319
|
*
|
|
200
320
|
* @example
|
|
@@ -220,8 +340,8 @@ declare const Content: ({ className, children, position, ref, width, ...props }:
|
|
|
220
340
|
* </Select.Root>
|
|
221
341
|
* ```
|
|
222
342
|
*/
|
|
223
|
-
declare const Label: ({ className, ref, ...props }: ComponentProps<typeof SelectPrimitive.Label>) => import("react").JSX.Element;
|
|
224
|
-
type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & {
|
|
343
|
+
declare const Label: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof SelectPrimitive.Label> & WithDataSlot) => import("react").JSX.Element;
|
|
344
|
+
type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & WithDataSlot & {
|
|
225
345
|
/**
|
|
226
346
|
* An optional icon rendered before the item text.
|
|
227
347
|
*/
|
|
@@ -234,6 +354,26 @@ type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & {
|
|
|
234
354
|
* Displays the children as the option's text. Pass `icon` to render an icon
|
|
235
355
|
* before the text.
|
|
236
356
|
*
|
|
357
|
+
* **Structure.** `children` render inside a `<span data-slot="select-item-label">`.
|
|
358
|
+
* Radix portals that span into `Select.Value` while the item is selected and
|
|
359
|
+
* removes it when the selection changes. The span exists so the node React
|
|
360
|
+
* removes is an element: a browser translation engine reparents text nodes,
|
|
361
|
+
* and a removal aimed at one throws. The span is `display: contents`, so it
|
|
362
|
+
* lays out nothing of its own in the list or in the trigger. To style it as a
|
|
363
|
+
* box, set a display of your own on it first.
|
|
364
|
+
*
|
|
365
|
+
* **Untranslatable labels.** When the label is an ID, a path, a filename, or a
|
|
366
|
+
* key, set `translate="no"` on the item. The attribute also rides on the label
|
|
367
|
+
* span, so the copy the trigger shows stays untranslated too.
|
|
368
|
+
*
|
|
369
|
+
* | Data Attribute | Value | Description |
|
|
370
|
+
* | ------------------ | ---------------------------- | -------------------------------------------------------------------- |
|
|
371
|
+
* | `data-slot` | `"select-item"` | On the option element. |
|
|
372
|
+
* | `data-slot` | `"select-item-label"` | On the `<span>` wrapping `children`, in the list and in the trigger. |
|
|
373
|
+
* | `data-state` | `"checked"` \| `"unchecked"` | Whether this item is the selected value. |
|
|
374
|
+
* | `data-highlighted` | present when highlighted | Presence-only. The item under the pointer or the keyboard focus. |
|
|
375
|
+
* | `data-disabled` | present when disabled | Presence-only. The `disabled` prop. |
|
|
376
|
+
*
|
|
237
377
|
* @see https://mantle.ngrok.com/components/forms/select#selectitem
|
|
238
378
|
*
|
|
239
379
|
* @example
|
|
@@ -259,10 +399,14 @@ type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & {
|
|
|
259
399
|
* </Select.Root>
|
|
260
400
|
* ```
|
|
261
401
|
*/
|
|
262
|
-
declare const Item: ({ className, children, icon, ref, ...props }: SelectItemProps) => import("react").JSX.Element;
|
|
402
|
+
declare const Item: ({ className, children, "data-slot": dataSlot, icon, ref, translate, ...props }: SelectItemProps) => import("react").JSX.Element;
|
|
263
403
|
/**
|
|
264
404
|
* Used to visually separate items or groups of items in the select content.
|
|
265
405
|
*
|
|
406
|
+
* | Data Attribute | Value | Description |
|
|
407
|
+
* | -------------- | -------------------- | ------------------------- |
|
|
408
|
+
* | `data-slot` | `"select-separator"` | On the separator element. |
|
|
409
|
+
*
|
|
266
410
|
* @see https://mantle.ngrok.com/components/forms/select#selectseparator
|
|
267
411
|
*
|
|
268
412
|
* @example
|
|
@@ -288,7 +432,7 @@ declare const Item: ({ className, children, icon, ref, ...props }: SelectItemPro
|
|
|
288
432
|
* </Select.Root>
|
|
289
433
|
* ```
|
|
290
434
|
*/
|
|
291
|
-
declare const SelectSeparatorComponent: ({ className, ref, ...props }: ComponentProps<typeof Separator>) => import("react").JSX.Element;
|
|
435
|
+
declare const SelectSeparatorComponent: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof Separator> & WithDataSlot) => import("react").JSX.Element;
|
|
292
436
|
/**
|
|
293
437
|
* Displays a list of options for the user to pick from—triggered by a button.
|
|
294
438
|
*
|
|
@@ -403,6 +547,13 @@ declare const Select: {
|
|
|
403
547
|
* (`z-60`). When sibling floats share a container, the most recently mounted
|
|
404
548
|
* float paints on top.
|
|
405
549
|
*
|
|
550
|
+
* | Data Attribute | Value | Description |
|
|
551
|
+
* | -------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
|
|
552
|
+
* | `data-slot` | `"select-content"` | On the content element. |
|
|
553
|
+
* | `data-state` | `"open"` \| `"closed"` | Drives the open and close animations. |
|
|
554
|
+
* | `data-side` | `"top"` \| `"right"` \| `"bottom"` \| `"left"` | The side of the trigger the list opened on. `position="popper"` only. |
|
|
555
|
+
* | `data-align` | `"start"` \| `"center"` \| `"end"` | The alignment against the trigger. `position="popper"` only. |
|
|
556
|
+
*
|
|
406
557
|
* @see https://mantle.ngrok.com/components/forms/select#selectcontent
|
|
407
558
|
*
|
|
408
559
|
* @example
|
|
@@ -433,6 +584,10 @@ declare const Select: {
|
|
|
433
584
|
* A group of related options within a select menu. Similar to an html `<optgroup>` element.
|
|
434
585
|
* Pair it with `Select.Label`, which gives the group its accessible name.
|
|
435
586
|
*
|
|
587
|
+
* | Data Attribute | Value | Description |
|
|
588
|
+
* | -------------- | ---------------- | --------------------- |
|
|
589
|
+
* | `data-slot` | `"select-group"` | On the group element. |
|
|
590
|
+
*
|
|
436
591
|
* @see https://mantle.ngrok.com/components/forms/select#selectgroup
|
|
437
592
|
*
|
|
438
593
|
* @example
|
|
@@ -466,6 +621,26 @@ declare const Select: {
|
|
|
466
621
|
* Displays the children as the option's text. Pass `icon` to render an icon
|
|
467
622
|
* before the text.
|
|
468
623
|
*
|
|
624
|
+
* **Structure.** `children` render inside a `<span data-slot="select-item-label">`.
|
|
625
|
+
* Radix portals that span into `Select.Value` while the item is selected and
|
|
626
|
+
* removes it when the selection changes. The span exists so the node React
|
|
627
|
+
* removes is an element: a browser translation engine reparents text nodes,
|
|
628
|
+
* and a removal aimed at one throws. The span is `display: contents`, so it
|
|
629
|
+
* lays out nothing of its own in the list or in the trigger. To style it as a
|
|
630
|
+
* box, set a display of your own on it first.
|
|
631
|
+
*
|
|
632
|
+
* **Untranslatable labels.** When the label is an ID, a path, a filename, or a
|
|
633
|
+
* key, set `translate="no"` on the item. The attribute also rides on the label
|
|
634
|
+
* span, so the copy the trigger shows stays untranslated too.
|
|
635
|
+
*
|
|
636
|
+
* | Data Attribute | Value | Description |
|
|
637
|
+
* | ------------------ | ---------------------------- | -------------------------------------------------------------------- |
|
|
638
|
+
* | `data-slot` | `"select-item"` | On the option element. |
|
|
639
|
+
* | `data-slot` | `"select-item-label"` | On the `<span>` wrapping `children`, in the list and in the trigger. |
|
|
640
|
+
* | `data-state` | `"checked"` \| `"unchecked"` | Whether this item is the selected value. |
|
|
641
|
+
* | `data-highlighted` | present when highlighted | Presence-only. The item under the pointer or the keyboard focus. |
|
|
642
|
+
* | `data-disabled` | present when disabled | Presence-only. The `disabled` prop. |
|
|
643
|
+
*
|
|
469
644
|
* @see https://mantle.ngrok.com/components/forms/select#selectitem
|
|
470
645
|
*
|
|
471
646
|
* @example
|
|
@@ -495,6 +670,10 @@ declare const Select: {
|
|
|
495
670
|
/**
|
|
496
671
|
* Used to render the label of a group. It won't be focusable using arrow keys.
|
|
497
672
|
*
|
|
673
|
+
* | Data Attribute | Value | Description |
|
|
674
|
+
* | -------------- | ---------------- | --------------------------- |
|
|
675
|
+
* | `data-slot` | `"select-label"` | On the group label element. |
|
|
676
|
+
*
|
|
498
677
|
* @see https://mantle.ngrok.com/components/forms/select#selectlabel
|
|
499
678
|
*
|
|
500
679
|
* @example
|
|
@@ -524,6 +703,10 @@ declare const Select: {
|
|
|
524
703
|
/**
|
|
525
704
|
* Used to visually separate items or groups of items in the select content.
|
|
526
705
|
*
|
|
706
|
+
* | Data Attribute | Value | Description |
|
|
707
|
+
* | -------------- | -------------------- | ------------------------- |
|
|
708
|
+
* | `data-slot` | `"select-separator"` | On the separator element. |
|
|
709
|
+
*
|
|
527
710
|
* @see https://mantle.ngrok.com/components/forms/select#selectseparator
|
|
528
711
|
*
|
|
529
712
|
* @example
|
|
@@ -557,6 +740,14 @@ declare const Select: {
|
|
|
557
740
|
* the hidden form input gets the field name), and the trigger reads
|
|
558
741
|
* `aria-describedby` / `aria-errormessage` from `FieldControlContext`.
|
|
559
742
|
*
|
|
743
|
+
* | Data Attribute | Value | Description |
|
|
744
|
+
* | ------------------ | --------------------------------------- | -------------------------------------------------------------------- |
|
|
745
|
+
* | `data-slot` | `"select-trigger"` | On the trigger button. |
|
|
746
|
+
* | `data-state` | `"open"` \| `"closed"` | Whether the list is open. |
|
|
747
|
+
* | `data-placeholder` | present when there is no value | Presence-only. Style the placeholder text with `data-placeholder:`. |
|
|
748
|
+
* | `data-disabled` | present when disabled | Presence-only. The `disabled` prop on `Select.Root`. |
|
|
749
|
+
* | `data-validation` | `"success"` \| `"warning"` \| `"error"` | The resolved `validation` state. Omitted when there is none. |
|
|
750
|
+
*
|
|
560
751
|
* @see https://mantle.ngrok.com/components/forms/select#selecttrigger
|
|
561
752
|
*
|
|
562
753
|
* @example
|
|
@@ -586,10 +777,29 @@ declare const Select: {
|
|
|
586
777
|
/**
|
|
587
778
|
* The part that reflects the selected value. Renders the selected item's text
|
|
588
779
|
* by default. For more control, control the select and pass your own children.
|
|
589
|
-
* Do not style this part
|
|
780
|
+
* Do not style this part: under `Select.Content position="item-aligned"`, Radix
|
|
590
781
|
* measures its box to align the open list over the selected item. Pass
|
|
591
782
|
* `placeholder` for the text to show when the select has no value.
|
|
592
783
|
*
|
|
784
|
+
* **Structure.** `placeholder` renders inside a
|
|
785
|
+
* `<span data-slot="select-placeholder">`, your own `children` inside a
|
|
786
|
+
* `<span data-slot="select-value-label">`, and the selected item's text arrives
|
|
787
|
+
* inside the `select-item-label` span that `Select.Item` renders. Each span is
|
|
788
|
+
* `display: contents`, so it lays out nothing of its own. React removes one of
|
|
789
|
+
* those spans whenever the value changes, and an element removal cannot throw:
|
|
790
|
+
* a browser translation engine reparents text nodes, and a removal aimed at a
|
|
791
|
+
* reparented text node does.
|
|
792
|
+
*
|
|
793
|
+
* **`asChild` is not supported.** Radix hands its `Slot` a keyed Fragment, so
|
|
794
|
+
* your element receives none of the value's props and React warns. Pass
|
|
795
|
+
* `children` instead.
|
|
796
|
+
*
|
|
797
|
+
* | Data Attribute | Value | Description |
|
|
798
|
+
* | -------------- | ---------------------- | ----------------------------------------------------------------------------- |
|
|
799
|
+
* | `data-slot` | `"select-value"` | On the value element. |
|
|
800
|
+
* | `data-slot` | `"select-placeholder"` | On the `<span>` wrapping `placeholder`. Present only while there is no value. |
|
|
801
|
+
* | `data-slot` | `"select-value-label"` | On the `<span>` wrapping your `children`. Absent under `asChild`. |
|
|
802
|
+
*
|
|
593
803
|
* @see https://mantle.ngrok.com/components/forms/select#selectvalue
|
|
594
804
|
*
|
|
595
805
|
* @example
|
|
@@ -615,7 +825,7 @@ declare const Select: {
|
|
|
615
825
|
* </Select.Root>
|
|
616
826
|
* ```
|
|
617
827
|
*/
|
|
618
|
-
readonly Value:
|
|
828
|
+
readonly Value: typeof Value;
|
|
619
829
|
};
|
|
620
830
|
//#endregion
|
|
621
831
|
export { Select as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./icon-BT8FnkkJ.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{r as i}from"./layer-container-R7aux3n8.js";import{a,r as o}from"./field-Bpptk_9t.js";import{t as s}from"./field-B1wqeZr4.js";import{n as c}from"./separator-D98be0gY.js";import{c as l}from"react/compiler-runtime";import{CaretDownIcon as u}from"@phosphor-icons/react/CaretDown";import{createContext as d,useContext as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{CheckIcon as h}from"@phosphor-icons/react/Check";import{CaretUpIcon as g}from"@phosphor-icons/react/CaretUp";import*as _ from"@radix-ui/react-select";const v=d({}),y=e=>{let t=l(26),n,r,i,a,o,s,c,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8],d=t[9]):({"aria-invalid":n,children:r,id:i,validation:d,onBlur:a,onValueChange:s,onChange:o,ref:u,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u,t[9]=d);let f;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==u||t[14]!==d?(f={"aria-invalid":n,id:i,validation:d,onBlur:a,ref:u},t[10]=n,t[11]=i,t[12]=a,t[13]=u,t[14]=d,t[15]=f):f=t[15];let m=f,h;t[16]!==o||t[17]!==s?(h=e=>{o?.(e),s?.(e)},t[16]=o,t[17]=s,t[18]=h):h=t[18];let g;t[19]!==r||t[20]!==m?(g=p(v.Provider,{value:m,children:r}),t[19]=r,t[20]=m,t[21]=g):g=t[21];let y;return t[22]!==c||t[23]!==h||t[24]!==g?(y=p(_.Root,{...c,onValueChange:h,children:g}),t[22]=c,t[23]=h,t[24]=g,t[25]=y):y=t[25],y},b=e=>{let n=l(14),i,a,o,s;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4]):({className:i,"data-slot":a,ref:s,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s);let c;n[5]===a?c=n[6]:(c=r(a,`select-group`),n[5]=a,n[6]=c);let u;n[7]===i?u=n[8]:(u=t(`space-y-px`,i),n[7]=i,n[8]=u);let d;return n[9]!==o||n[10]!==s||n[11]!==c||n[12]!==u?(d=p(_.Group,{ref:s,"data-slot":c,className:u,...o}),n[9]=o,n[10]=s,n[11]=c,n[12]=u,n[13]=d):d=n[13],d},x=e=>{let t=l(21),n,i,a,o,s,c;t[0]===e?(n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({asChild:n,children:i,"data-slot":a,placeholder:o,ref:c,...s}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let u;t[7]===a?u=t[8]:(u=r(a,`select-value`),t[7]=a,t[8]=u);let d;t[9]===o?d=t[10]:(d=o!=null&&p(`span`,{"data-slot":`select-placeholder`,className:`contents`,children:o}),t[9]=o,t[10]=d);let f;t[11]!==n||t[12]!==i?(f=n||i==null?i:p(`span`,{"data-slot":`select-value-label`,className:`contents`,children:i}),t[11]=n,t[12]=i,t[13]=f):f=t[13];let m;return t[14]!==n||t[15]!==s||t[16]!==c||t[17]!==u||t[18]!==d||t[19]!==f?(m=p(_.Value,{ref:c,asChild:n,"data-slot":u,placeholder:d,...s,children:f}),t[14]=n,t[15]=s,t[16]=c,t[17]=u,t[18]=d,t[19]=f,t[20]=m):m=t[20],m},S=i=>{let c=l(34),d,h,g,y,b,x,S,C,w;c[0]===i?(d=c[1],h=c[2],g=c[3],y=c[4],b=c[5],x=c[6],S=c[7],C=c[8],w=c[9]):({"aria-invalid":d,className:g,children:h,"data-slot":y,id:x,onBlur:b,ref:w,validation:S,...C}=i,c[0]=i,c[1]=d,c[2]=h,c[3]=g,c[4]=y,c[5]=b,c[6]=x,c[7]=S,c[8]=C,c[9]=w);let T=f(v),E=f(s),D=e(w,T.ref),O=a(),k=E?E[`aria-invalid`]:T[`aria-invalid`]??d,A=T.validation??S??O,j;c[10]!==k||c[11]!==A?(j=o({"aria-invalid":k,validation:A}),c[10]=k,c[11]=A,c[12]=j):j=c[12];let{ariaInvalid:M,validation:N}=j,P=E?E.id:T.id??x,F;c[13]===y?F=c[14]:(F=r(y,`select-trigger`),c[13]=y,c[14]=F);let I;c[15]===g?I=c[16]:(I=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`,g),c[15]=g,c[16]=I);let L=N||void 0,R;c[17]!==T||c[18]!==b?(R=e=>{b?.(e),T.onBlur?.(e)},c[17]=T,c[18]=b,c[19]=R):R=c[19];let z;c[20]===E?z=c[21]:(z=E?{"aria-describedby":E[`aria-describedby`],"aria-errormessage":E[`aria-errormessage`]}:void 0,c[20]=E,c[21]=z);let B;c[22]===Symbol.for(`react.memo_cache_sentinel`)?(B=p(_.Icon,{asChild:!0,children:p(n,{svg:p(u,{weight:`bold`}),className:`size-4`})}),c[22]=B):B=c[22];let V;return c[23]!==M||c[24]!==h||c[25]!==P||c[26]!==C||c[27]!==F||c[28]!==I||c[29]!==L||c[30]!==R||c[31]!==z||c[32]!==D?(V=m(_.Trigger,{"data-slot":F,className:I,"data-validation":L,id:P,ref:D,...C,onBlur:R,...z,"aria-invalid":M,children:[h,B]}),c[23]=M,c[24]=h,c[25]=P,c[26]=C,c[27]=F,c[28]=I,c[29]=L,c[30]=R,c[31]=z,c[32]=D,c[33]=V):V=c[33],V},C=e=>{let r=l(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let c;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(n,{svg:p(g,{weight:`bold`}),className:`size-4`}),r[6]=c):c=r[6];let u;return r[7]!==a||r[8]!==o||r[9]!==s?(u=p(_.ScrollUpButton,{ref:o,className:s,...a,children:c}),r[7]=a,r[8]=o,r[9]=s,r[10]=u):u=r[10],u},w=e=>{let r=l(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let c;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(n,{svg:p(u,{weight:`bold`}),className:`size-4`}),r[6]=c):c=r[6];let d;return r[7]!==a||r[8]!==o||r[9]!==s?(d=p(_.ScrollDownButton,{ref:o,className:s,...a,children:c}),r[7]=a,r[8]=o,r[9]=s,r[10]=d):d=r[10],d},T={Root:y,Content:e=>{let n=l(31),a,o,s,c,u,d,f;n[0]===e?(a=n[1],o=n[2],s=n[3],c=n[4],u=n[5],d=n[6],f=n[7]):({className:o,children:a,"data-slot":s,position:d,ref:u,width:f,...c}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s,n[4]=c,n[5]=u,n[6]=d,n[7]=f);let h=d===void 0?`popper`:d,g=f===void 0?`trigger`:f,v=i(),y;n[8]===s?y=n[9]:(y=r(s,`select-content`),n[8]=s,n[9]=y);let b=h===`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)`,x=g===`trigger`&&`w-(--radix-select-trigger-width)`,S;n[10]!==o||n[11]!==b||n[12]!==x?(S=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 motion-reduce:animate-none relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,b,x,o),n[10]=o,n[11]=b,n[12]=x,n[13]=S):S=n[13];let T;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=p(C,{}),n[14]=T):T=n[14];let E=h===`popper`&&`h-(--radix-select-trigger-height) w-full`,D;n[15]===E?D=n[16]:(D=t(`p-1 space-y-px`,E),n[15]=E,n[16]=D);let O;n[17]!==a||n[18]!==D?(O=p(_.Viewport,{className:D,children:a}),n[17]=a,n[18]=D,n[19]=O):O=n[19];let k;n[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=p(w,{}),n[20]=k):k=n[20];let A;n[21]!==h||n[22]!==c||n[23]!==u||n[24]!==O||n[25]!==y||n[26]!==S?(A=m(_.Content,{ref:u,"data-slot":y,className:S,position:h,...c,children:[T,O,k]}),n[21]=h,n[22]=c,n[23]=u,n[24]=O,n[25]=y,n[26]=S,n[27]=A):A=n[27];let j;return n[28]!==v||n[29]!==A?(j=p(_.Portal,{container:v,children:A}),n[28]=v,n[29]=A,n[30]=j):j=n[30],j},Group:b,Item:e=>{let i=l(26),a,o,s,c,u,d,f;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5],d=i[6],f=i[7]):({className:o,children:a,"data-slot":s,icon:c,ref:d,translate:f,...u}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u,i[6]=d,i[7]=f);let g;i[8]===s?g=i[9]:(g=r(s,`select-item`),i[8]=s,i[9]=g);let v;i[10]===o?v=i[11]:(v=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`,o),i[10]=o,i[11]=v);let y;i[12]===c?y=i[13]:(y=c&&p(n,{svg:c}),i[12]=c,i[13]=y);let b;i[14]!==a||i[15]!==f?(b=p(_.ItemText,{children:p(`span`,{"data-slot":`select-item-label`,className:`contents`,translate:f,children:a})}),i[14]=a,i[15]=f,i[16]=b):b=i[16];let x;i[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=p(_.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:p(n,{svg:p(h,{weight:`bold`}),className:`size-4 text-accent-600`})}),i[17]=x):x=i[17];let S;return i[18]!==u||i[19]!==d||i[20]!==g||i[21]!==v||i[22]!==y||i[23]!==b||i[24]!==f?(S=m(_.Item,{ref:d,"data-slot":g,translate:f,className:v,...u,children:[y,b,x]}),i[18]=u,i[19]=d,i[20]=g,i[21]=v,i[22]=y,i[23]=b,i[24]=f,i[25]=S):S=i[25],S},Label:e=>{let n=l(14),i,a,o,s;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4]):({className:i,"data-slot":a,ref:s,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s);let c;n[5]===a?c=n[6]:(c=r(a,`select-label`),n[5]=a,n[6]=c);let u;n[7]===i?u=n[8]:(u=t(`px-2 py-1.5 text-sm font-medium`,i),n[7]=i,n[8]=u);let d;return n[9]!==o||n[10]!==s||n[11]!==c||n[12]!==u?(d=p(_.Label,{ref:s,"data-slot":c,className:u,...o}),n[9]=o,n[10]=s,n[11]=c,n[12]=u,n[13]=d):d=n[13],d},Separator:e=>{let n=l(14),i,a,o,s;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4]):({className:i,"data-slot":a,ref:s,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s);let u;n[5]===a?u=n[6]:(u=r(a,`select-separator`),n[5]=a,n[6]=u);let d;n[7]===i?d=n[8]:(d=t(`-mx-1 my-1 h-px w-auto`,i),n[7]=i,n[8]=d);let f;return n[9]!==o||n[10]!==s||n[11]!==u||n[12]!==d?(f=p(c,{ref:s,"data-slot":u,className:d,...o}),n[9]=o,n[10]=s,n[11]=u,n[12]=d,n[13]=f):f=n[13],f},Trigger:S,Value:x};export{T 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-CKAiBEGt.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-DCni0ZwA.js";export{e as Select};
|
package/package.json
CHANGED
package/dist/select-sOHUE2Bm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./icon-BT8FnkkJ.js";import{r}from"./layer-container-R7aux3n8.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-D98be0gY.js";import{c}from"react/compiler-runtime";import{CaretDownIcon as l}from"@phosphor-icons/react/CaretDown";import{createContext as u,useContext 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 _=u({}),v=e=>{let t=c(26),n,r,i,a,o,s,l,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],d=t[9]):({"aria-invalid":n,children:r,id:i,validation:d,onBlur:a,onValueChange:s,onChange:o,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=d);let p;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==u||t[14]!==d?(p={"aria-invalid":n,id:i,validation:d,onBlur:a,ref:u},t[10]=n,t[11]=i,t[12]=a,t[13]=u,t[14]=d,t[15]=p):p=t[15];let m=p,h;t[16]!==o||t[17]!==s?(h=e=>{o?.(e),s?.(e)},t[16]=o,t[17]=s,t[18]=h):h=t[18];let v;t[19]!==r||t[20]!==m?(v=f(_.Provider,{value:m,children:r}),t[19]=r,t[20]=m,t[21]=v):v=t[21];let y;return t[22]!==l||t[23]!==h||t[24]!==v?(y=f(g.Root,{...l,onValueChange:h,children:v}),t[22]=l,t[23]=h,t[24]=v,t[25]=y):y=t[25],y},y=e=>{let n=c(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`space-y-px`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=f(g.Group,{ref:a,"data-slot":`select-group`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},b=g.Value,x=r=>{let s=c(30),u,m,h,v,y,b,x,S;s[0]===r?(u=s[1],m=s[2],h=s[3],v=s[4],y=s[5],b=s[6],x=s[7],S=s[8]):({"aria-invalid":u,className:h,children:m,id:y,onBlur:v,ref:S,validation:b,...x}=r,s[0]=r,s[1]=u,s[2]=m,s[3]=h,s[4]=v,s[5]=y,s[6]=b,s[7]=x,s[8]=S);let C=d(_),w=d(o),T=e(S,C.ref),E=i(),D=w?w[`aria-invalid`]:C[`aria-invalid`]??u,O=C.validation??b??E,k;s[9]!==D||s[10]!==O?(k=a({"aria-invalid":D,validation:O}),s[9]=D,s[10]=O,s[11]=k):k=s[11];let{ariaInvalid:A,validation:j}=k,M=w?w.id:C.id??y,N;s[12]===h?N=s[13]:(N=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`,h),s[12]=h,s[13]=N);let P=j||void 0,F;s[14]!==C||s[15]!==v?(F=e=>{v?.(e),C.onBlur?.(e)},s[14]=C,s[15]=v,s[16]=F):F=s[16];let I;s[17]===w?I=s[18]:(I=w?{"aria-describedby":w[`aria-describedby`],"aria-errormessage":w[`aria-errormessage`]}:void 0,s[17]=w,s[18]=I);let L;s[19]===Symbol.for(`react.memo_cache_sentinel`)?(L=f(g.Icon,{asChild:!0,children:f(n,{svg:f(l,{weight:`bold`}),className:`size-4`})}),s[19]=L):L=s[19];let R;return s[20]!==A||s[21]!==m||s[22]!==M||s[23]!==x||s[24]!==N||s[25]!==P||s[26]!==F||s[27]!==I||s[28]!==T?(R=p(g.Trigger,{"data-slot":`select-trigger`,className:N,"data-validation":P,id:M,ref:T,...x,onBlur:F,...I,"aria-invalid":A,children:[m,L]}),s[20]=A,s[21]=m,s[22]=M,s[23]=x,s[24]=N,s[25]=P,s[26]=F,s[27]=I,s[28]=T,s[29]=R):R=s[29],R},S=e=>{let r=c(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let l;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=f(n,{svg:f(h,{weight:`bold`}),className:`size-4`}),r[6]=l):l=r[6];let u;return r[7]!==a||r[8]!==o||r[9]!==s?(u=f(g.ScrollUpButton,{ref:o,className:s,...a,children:l}),r[7]=a,r[8]=o,r[9]=s,r[10]=u):u=r[10],u},C=e=>{let r=c(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let u;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=f(n,{svg:f(l,{weight:`bold`}),className:`size-4`}),r[6]=u):u=r[6];let d;return r[7]!==a||r[8]!==o||r[9]!==s?(d=f(g.ScrollDownButton,{ref:o,className:s,...a,children:u}),r[7]=a,r[8]=o,r[9]=s,r[10]=d):d=r[10],d},w={Root:v,Content:e=>{let n=c(27),i,a,o,s,l,u;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6]):({className:a,children:i,position:l,ref:s,width:u,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n[6]=u);let d=l===void 0?`popper`:l,m=u===void 0?`trigger`:u,h=r(),_=d===`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)`,v=m===`trigger`&&`w-(--radix-select-trigger-width)`,y;n[7]!==a||n[8]!==_||n[9]!==v?(y=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`,_,v,a),n[7]=a,n[8]=_,n[9]=v,n[10]=y):y=n[10];let b;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=f(S,{}),n[11]=b):b=n[11];let x=d===`popper`&&`h-(--radix-select-trigger-height) w-full`,w;n[12]===x?w=n[13]:(w=t(`p-1 space-y-px`,x),n[12]=x,n[13]=w);let T;n[14]!==i||n[15]!==w?(T=f(g.Viewport,{className:w,children:i}),n[14]=i,n[15]=w,n[16]=T):T=n[16];let E;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(E=f(C,{}),n[17]=E):E=n[17];let D;n[18]!==d||n[19]!==o||n[20]!==s||n[21]!==y||n[22]!==T?(D=p(g.Content,{ref:s,"data-slot":`select-content`,className:y,position:d,...o,children:[b,T,E]}),n[18]=d,n[19]=o,n[20]=s,n[21]=y,n[22]=T,n[23]=D):D=n[23];let O;return n[24]!==h||n[25]!==D?(O=f(g.Portal,{container:h,children:D}),n[24]=h,n[25]=D,n[26]=O):O=n[26],O},Group:y,Item:e=>{let r=c(19),i,a,o,s,l;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],l=r[5]):({className:a,children:i,icon:o,ref:l,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l);let u;r[6]===a?u=r[7]:(u=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`,a),r[6]=a,r[7]=u);let d;r[8]===o?d=r[9]:(d=o&&f(n,{svg:o}),r[8]=o,r[9]=d);let h;r[10]===i?h=r[11]:(h=f(g.ItemText,{children:i}),r[10]=i,r[11]=h);let _;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=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`})}),r[12]=_):_=r[12];let v;return r[13]!==s||r[14]!==l||r[15]!==u||r[16]!==d||r[17]!==h?(v=p(g.Item,{ref:l,"data-slot":`select-item`,className:u,...s,children:[d,h,_]}),r[13]=s,r[14]=l,r[15]=u,r[16]=d,r[17]=h,r[18]=v):v=r[18],v},Label:e=>{let n=c(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`px-2 py-1.5 text-sm font-medium`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=f(g.Label,{ref:a,"data-slot":`select-label`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},Separator:e=>{let n=c(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`-mx-1 my-1 h-px w-auto`,r),n[4]=r,n[5]=o);let l;return n[6]!==i||n[7]!==a||n[8]!==o?(l=f(s,{ref:a,"data-slot":`select-separator`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=l):l=n[9],l},Trigger:x,Value:b};export{w as t};
|