@tamagui/select 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Select.js +86 -11
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/SelectContent.js +3 -0
- package/dist/cjs/SelectContent.js.map +1 -1
- package/dist/cjs/SelectViewport.js +3 -0
- package/dist/cjs/SelectViewport.js.map +1 -1
- package/dist/esm/Select.js +88 -12
- package/dist/esm/Select.js.map +1 -1
- package/dist/esm/Select.mjs +88 -12
- package/dist/esm/Select.mjs.map +1 -1
- package/dist/esm/SelectContent.js +3 -0
- package/dist/esm/SelectContent.js.map +1 -1
- package/dist/esm/SelectContent.mjs +3 -0
- package/dist/esm/SelectContent.mjs.map +1 -1
- package/dist/esm/SelectViewport.js +3 -0
- package/dist/esm/SelectViewport.js.map +1 -1
- package/dist/esm/SelectViewport.mjs +3 -0
- package/dist/esm/SelectViewport.mjs.map +1 -1
- package/dist/jsx/Select.js +84 -12
- package/dist/jsx/Select.js.map +1 -1
- package/dist/jsx/Select.mjs +84 -12
- package/dist/jsx/Select.mjs.map +1 -1
- package/dist/jsx/SelectContent.js +3 -0
- package/dist/jsx/SelectContent.js.map +1 -1
- package/dist/jsx/SelectContent.mjs +3 -0
- package/dist/jsx/SelectContent.mjs.map +1 -1
- package/dist/jsx/SelectViewport.js +3 -0
- package/dist/jsx/SelectViewport.js.map +1 -1
- package/dist/jsx/SelectViewport.mjs +3 -0
- package/dist/jsx/SelectViewport.mjs.map +1 -1
- package/package.json +16 -16
- package/src/Select.tsx +138 -37
- package/src/SelectContent.tsx +4 -0
- package/src/SelectViewport.tsx +4 -0
- package/src/types.tsx +7 -1
- package/types/Select.d.ts.map +1 -1
- package/types/SelectContent.d.ts.map +1 -1
- package/types/SelectViewport.d.ts.map +1 -1
- package/types/types.d.ts +7 -1
- package/types/types.d.ts.map +1 -1
package/src/Select.tsx
CHANGED
|
@@ -3,17 +3,19 @@ import { useComposedRefs } from '@tamagui/compose-refs'
|
|
|
3
3
|
import {
|
|
4
4
|
GetProps,
|
|
5
5
|
TamaguiElement,
|
|
6
|
+
getVariableValue,
|
|
6
7
|
isWeb,
|
|
7
8
|
styled,
|
|
8
9
|
useGet,
|
|
9
10
|
useIsomorphicLayoutEffect,
|
|
10
11
|
withStaticProperties,
|
|
11
12
|
} from '@tamagui/core'
|
|
13
|
+
import { getSpace } from '@tamagui/helpers-tamagui'
|
|
12
14
|
import { ListItem, ListItemProps } from '@tamagui/list-item'
|
|
13
15
|
import { PortalHost } from '@tamagui/portal'
|
|
14
16
|
import { Separator } from '@tamagui/separator'
|
|
15
17
|
import { ControlledSheet, SheetController } from '@tamagui/sheet'
|
|
16
|
-
import { XStack, YStack } from '@tamagui/stacks'
|
|
18
|
+
import { ThemeableStack, XStack, YStack } from '@tamagui/stacks'
|
|
17
19
|
import { Paragraph, SizableText } from '@tamagui/text'
|
|
18
20
|
import { useControllableState } from '@tamagui/use-controllable-state'
|
|
19
21
|
import * as React from 'react'
|
|
@@ -47,12 +49,15 @@ export const SelectTrigger = React.forwardRef<TamaguiElement, SelectTriggerProps
|
|
|
47
49
|
'aria-labelledby': ariaLabelledby,
|
|
48
50
|
...triggerProps
|
|
49
51
|
} = props
|
|
52
|
+
|
|
50
53
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect)
|
|
51
54
|
// const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange)
|
|
52
55
|
// const getItems = useCollection(__scopeSelect)
|
|
53
56
|
// const labelId = useLabelContext(context.trigger)
|
|
54
57
|
const labelledBy = ariaLabelledby // || labelId
|
|
55
58
|
|
|
59
|
+
if (context.shouldRenderWebNative) return null
|
|
60
|
+
|
|
56
61
|
return (
|
|
57
62
|
<ListItem
|
|
58
63
|
componentName={TRIGGER_NAME}
|
|
@@ -275,28 +280,32 @@ export const SelectItem = React.forwardRef<TamaguiElement, SelectItemProps>(
|
|
|
275
280
|
textId={textId || ''}
|
|
276
281
|
isSelected={isSelected}
|
|
277
282
|
>
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
283
|
+
{context.shouldRenderWebNative ? (
|
|
284
|
+
<option value={value}>{props.children}</option>
|
|
285
|
+
) : (
|
|
286
|
+
<ListItem
|
|
287
|
+
tag="div"
|
|
288
|
+
backgrounded
|
|
289
|
+
pressTheme
|
|
290
|
+
hoverTheme
|
|
291
|
+
cursor="default"
|
|
292
|
+
outlineWidth={0}
|
|
293
|
+
componentName={ITEM_NAME}
|
|
294
|
+
ref={composedRefs}
|
|
295
|
+
aria-labelledby={textId}
|
|
296
|
+
aria-selected={isSelected}
|
|
297
|
+
data-state={isSelected ? 'active' : 'inactive'}
|
|
298
|
+
aria-disabled={disabled || undefined}
|
|
299
|
+
data-disabled={disabled ? '' : undefined}
|
|
300
|
+
tabIndex={disabled ? undefined : -1}
|
|
301
|
+
size={context.size}
|
|
302
|
+
focusStyle={{
|
|
303
|
+
backgroundColor: '$backgroundHover',
|
|
304
|
+
}}
|
|
305
|
+
{...itemProps}
|
|
306
|
+
{...selectItemProps}
|
|
307
|
+
/>
|
|
308
|
+
)}
|
|
300
309
|
</SelectItemContextProvider>
|
|
301
310
|
)
|
|
302
311
|
}
|
|
@@ -321,11 +330,10 @@ const SelectItemText = React.forwardRef<TamaguiElement, SelectItemTextProps>(
|
|
|
321
330
|
(props: ScopedProps<SelectItemTextProps>, forwardedRef) => {
|
|
322
331
|
const { __scopeSelect, className, ...itemTextProps } = props
|
|
323
332
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect)
|
|
324
|
-
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect)
|
|
325
333
|
const ref = React.useRef<TamaguiElement | null>(null)
|
|
326
334
|
const composedRefs = useComposedRefs(forwardedRef, ref)
|
|
335
|
+
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect)
|
|
327
336
|
const isSelected = Boolean(itemContext.isSelected && context.valueNode)
|
|
328
|
-
|
|
329
337
|
const contents = React.useMemo(
|
|
330
338
|
() => (
|
|
331
339
|
<SelectItemTextFrame
|
|
@@ -348,6 +356,7 @@ const SelectItemText = React.forwardRef<TamaguiElement, SelectItemTextProps>(
|
|
|
348
356
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
349
357
|
}, [isSelected, contents])
|
|
350
358
|
|
|
359
|
+
if (context.shouldRenderWebNative) return <>{props.children}</>
|
|
351
360
|
return (
|
|
352
361
|
<>
|
|
353
362
|
{contents}
|
|
@@ -388,7 +397,10 @@ type SelectItemIndicatorProps = GetProps<typeof SelectItemIndicatorFrame>
|
|
|
388
397
|
const SelectItemIndicator = React.forwardRef<TamaguiElement, SelectItemIndicatorProps>(
|
|
389
398
|
(props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {
|
|
390
399
|
const { __scopeSelect, ...itemIndicatorProps } = props
|
|
400
|
+
const context = useSelectContext(ITEM_INDICATOR_NAME, __scopeSelect)
|
|
391
401
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect)
|
|
402
|
+
|
|
403
|
+
if (context.shouldRenderWebNative) return null
|
|
392
404
|
return itemContext.isSelected ? (
|
|
393
405
|
<SelectItemIndicatorFrame aria-hidden {...itemIndicatorProps} ref={forwardedRef} />
|
|
394
406
|
) : null
|
|
@@ -413,14 +425,80 @@ export const SelectGroupFrame = styled(YStack, {
|
|
|
413
425
|
width: '100%',
|
|
414
426
|
})
|
|
415
427
|
|
|
428
|
+
const NativeSelectTextFrame = styled(SizableText, {
|
|
429
|
+
tag: 'select',
|
|
430
|
+
backgroundColor: '$background',
|
|
431
|
+
borderColor: '$borderColor',
|
|
432
|
+
hoverStyle: {
|
|
433
|
+
backgroundColor: '$backgroundHover',
|
|
434
|
+
},
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
const NativeSelectFrame = styled(ThemeableStack, {
|
|
438
|
+
name: 'NativeSelect',
|
|
439
|
+
|
|
440
|
+
bordered: true,
|
|
441
|
+
userSelect: 'none',
|
|
442
|
+
outlineWidth: 0,
|
|
443
|
+
paddingRight: 10,
|
|
444
|
+
|
|
445
|
+
variants: {
|
|
446
|
+
size: {
|
|
447
|
+
'...size': (val, extras) => {
|
|
448
|
+
const { tokens } = extras
|
|
449
|
+
const paddingHorizontal = getVariableValue(tokens.space[val])
|
|
450
|
+
|
|
451
|
+
return {
|
|
452
|
+
borderRadius: tokens.radius[val] ?? val,
|
|
453
|
+
minHeight: tokens.size[val],
|
|
454
|
+
paddingRight: paddingHorizontal + 20,
|
|
455
|
+
paddingLeft: paddingHorizontal,
|
|
456
|
+
paddingVertical: getSpace(val, -2),
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
} as const,
|
|
461
|
+
|
|
462
|
+
defaultVariants: {
|
|
463
|
+
size: '$2',
|
|
464
|
+
},
|
|
465
|
+
})
|
|
466
|
+
|
|
416
467
|
type SelectGroupProps = GetProps<typeof SelectGroupFrame>
|
|
417
468
|
|
|
418
469
|
const SelectGroup = React.forwardRef<TamaguiElement, SelectGroupProps>(
|
|
419
470
|
(props: ScopedProps<SelectGroupProps>, forwardedRef) => {
|
|
420
471
|
const { __scopeSelect, ...groupProps } = props
|
|
421
472
|
const groupId = React.useId()
|
|
422
|
-
|
|
423
|
-
|
|
473
|
+
|
|
474
|
+
const context = useSelectContext(GROUP_NAME, __scopeSelect)
|
|
475
|
+
const size = context.size ?? '$true'
|
|
476
|
+
const nativeSelectRef = React.useRef<HTMLSelectElement>(null)
|
|
477
|
+
|
|
478
|
+
const content = (function () {
|
|
479
|
+
if (context.shouldRenderWebNative) {
|
|
480
|
+
return (
|
|
481
|
+
// @ts-expect-error until we support typing based on tag
|
|
482
|
+
<NativeSelectFrame asChild size={size} value={context.value}>
|
|
483
|
+
<NativeSelectTextFrame
|
|
484
|
+
// @ts-ignore it's ok since tag="select"
|
|
485
|
+
onChange={(event: React.ChangeEvent<HTMLSelectElement>) => {
|
|
486
|
+
context.onChange(event.currentTarget.value)
|
|
487
|
+
}}
|
|
488
|
+
size={size}
|
|
489
|
+
ref={nativeSelectRef}
|
|
490
|
+
style={{
|
|
491
|
+
color: 'var(--color)',
|
|
492
|
+
// @ts-ignore
|
|
493
|
+
appearance: 'none',
|
|
494
|
+
}}
|
|
495
|
+
>
|
|
496
|
+
{props.children}
|
|
497
|
+
</NativeSelectTextFrame>
|
|
498
|
+
</NativeSelectFrame>
|
|
499
|
+
)
|
|
500
|
+
}
|
|
501
|
+
return (
|
|
424
502
|
<SelectGroupFrame
|
|
425
503
|
// @ts-ignore
|
|
426
504
|
role="group"
|
|
@@ -428,6 +506,11 @@ const SelectGroup = React.forwardRef<TamaguiElement, SelectGroupProps>(
|
|
|
428
506
|
{...groupProps}
|
|
429
507
|
ref={forwardedRef}
|
|
430
508
|
/>
|
|
509
|
+
)
|
|
510
|
+
})()
|
|
511
|
+
return (
|
|
512
|
+
<SelectGroupContextProvider scope={__scopeSelect} id={groupId || ''}>
|
|
513
|
+
{content}
|
|
431
514
|
</SelectGroupContextProvider>
|
|
432
515
|
)
|
|
433
516
|
}
|
|
@@ -448,6 +531,11 @@ const SelectLabel = React.forwardRef<TamaguiElement, SelectLabelProps>(
|
|
|
448
531
|
const { __scopeSelect, ...labelProps } = props
|
|
449
532
|
const context = useSelectContext(LABEL_NAME, __scopeSelect)
|
|
450
533
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect)
|
|
534
|
+
|
|
535
|
+
if (context.shouldRenderWebNative) {
|
|
536
|
+
return null
|
|
537
|
+
}
|
|
538
|
+
|
|
451
539
|
return (
|
|
452
540
|
<ListItem
|
|
453
541
|
tag="div"
|
|
@@ -510,6 +598,7 @@ export const Select = withStaticProperties(
|
|
|
510
598
|
(props: ScopedProps<SelectProps>) => {
|
|
511
599
|
const {
|
|
512
600
|
__scopeSelect,
|
|
601
|
+
native,
|
|
513
602
|
children,
|
|
514
603
|
open: openProp,
|
|
515
604
|
defaultOpen,
|
|
@@ -562,6 +651,12 @@ export const Select = withStaticProperties(
|
|
|
562
651
|
activeIndexRef.current = activeIndex
|
|
563
652
|
})
|
|
564
653
|
|
|
654
|
+
const shouldRenderWebNative =
|
|
655
|
+
isWeb &&
|
|
656
|
+
(native === true ||
|
|
657
|
+
native === 'web' ||
|
|
658
|
+
(Array.isArray(native) && native.includes('web')))
|
|
659
|
+
|
|
565
660
|
return (
|
|
566
661
|
<AdaptProvider>
|
|
567
662
|
<SelectProvider
|
|
@@ -590,18 +685,24 @@ export const Select = withStaticProperties(
|
|
|
590
685
|
setSelectedIndex={setSelectedIndex}
|
|
591
686
|
value={value}
|
|
592
687
|
open={open}
|
|
688
|
+
native={native}
|
|
689
|
+
shouldRenderWebNative={shouldRenderWebNative}
|
|
593
690
|
>
|
|
594
691
|
<SelectSheetController onOpenChange={setOpen} __scopeSelect={__scopeSelect}>
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
692
|
+
{shouldRenderWebNative ? (
|
|
693
|
+
children
|
|
694
|
+
) : (
|
|
695
|
+
<SelectImpl
|
|
696
|
+
activeIndexRef={activeIndexRef}
|
|
697
|
+
listContentRef={listContentRef}
|
|
698
|
+
selectedIndexRef={selectedIndexRef}
|
|
699
|
+
{...props}
|
|
700
|
+
open={open}
|
|
701
|
+
value={value}
|
|
702
|
+
>
|
|
703
|
+
{children}
|
|
704
|
+
</SelectImpl>
|
|
705
|
+
)}
|
|
605
706
|
</SelectSheetController>
|
|
606
707
|
</SelectProvider>
|
|
607
708
|
</AdaptProvider>
|
package/src/SelectContent.tsx
CHANGED
package/src/SelectViewport.tsx
CHANGED
|
@@ -43,6 +43,10 @@ export const SelectViewport = React.forwardRef<TamaguiElement, SelectViewportPro
|
|
|
43
43
|
const context = useSelectContext(VIEWPORT_NAME, __scopeSelect)
|
|
44
44
|
const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint)
|
|
45
45
|
|
|
46
|
+
if (context.shouldRenderWebNative) {
|
|
47
|
+
return <>{children}</>
|
|
48
|
+
}
|
|
49
|
+
|
|
46
50
|
if (breakpointActive || !isWeb) {
|
|
47
51
|
return (
|
|
48
52
|
<PortalItem hostName={`${context.scopeKey}SheetContents`}>
|
package/src/types.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContextData, FloatingContext, ReferenceType } from '@floating-ui/react'
|
|
2
|
-
import type { SizeTokens } from '@tamagui/core'
|
|
2
|
+
import type { NativePlatform, NativeValue, SizeTokens } from '@tamagui/core'
|
|
3
3
|
import type { Scope } from '@tamagui/create-context'
|
|
4
4
|
import type { ThemeableStackProps, YStackProps } from '@tamagui/stacks'
|
|
5
5
|
import type { DispatchWithoutAction, HTMLProps, MutableRefObject, ReactNode } from 'react'
|
|
@@ -27,6 +27,10 @@ export interface SelectProps {
|
|
|
27
27
|
name?: string
|
|
28
28
|
autoComplete?: string
|
|
29
29
|
size?: SizeTokens
|
|
30
|
+
/**
|
|
31
|
+
* If passed, will render a native component instead of the custom one. Currently only `web` is supported.
|
|
32
|
+
*/
|
|
33
|
+
native?: NativeValue<'web'>
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
export interface SelectContextValue {
|
|
@@ -76,6 +80,8 @@ export interface SelectContextValue {
|
|
|
76
80
|
getFloatingProps: (userProps?: HTMLProps<HTMLElement> | undefined) => any
|
|
77
81
|
getItemProps: (userProps?: HTMLProps<HTMLElement> | undefined) => any
|
|
78
82
|
}
|
|
83
|
+
native?: NativeValue
|
|
84
|
+
shouldRenderWebNative: boolean
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
export type SelectViewportProps = ThemeableStackProps & {
|
package/types/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,EAOf,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAY,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAO5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,EAAE,WAAW,EAAmB,WAAW,EAAE,MAAM,SAAS,CAAA;AAYnE,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAA;AAE9C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAgDzB,CAAA;AAgED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKrB,CAAA;AAiBF,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,UAAU,wFAgItB,CAAA;AAUD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9B,CAAA;AAkGF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3B,CAAA;AAqGF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAA;AAgC5C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1B,CAAA;AAoCF,eAAO,MAAM,MAAM,WACT,YAAY,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA3elB,MAAM,SAAS;;;;;;;;;;;;;;sBAAf,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAf,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAf,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4mB9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectContent.d.ts","sourceRoot":"","sources":["../src/SelectContent.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAc,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAS5C,eAAO,MAAM,aAAa,4DAKvB,kBAAkB,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"SelectContent.d.ts","sourceRoot":"","sources":["../src/SelectContent.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAc,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAS5C,eAAO,MAAM,aAAa,4DAKvB,kBAAkB,GAAG,eAAe,uBAmCtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectViewport.d.ts","sourceRoot":"","sources":["../src/SelectViewport.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAS,MAAM,eAAe,CAAA;AAIrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB9B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SelectViewport.d.ts","sourceRoot":"","sources":["../src/SelectViewport.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAS,MAAM,eAAe,CAAA;AAIrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB9B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAyD1B,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContextData, FloatingContext, ReferenceType } from '@floating-ui/react';
|
|
2
|
-
import type { SizeTokens } from '@tamagui/core';
|
|
2
|
+
import type { NativeValue, SizeTokens } from '@tamagui/core';
|
|
3
3
|
import type { Scope } from '@tamagui/create-context';
|
|
4
4
|
import type { ThemeableStackProps, YStackProps } from '@tamagui/stacks';
|
|
5
5
|
import type { DispatchWithoutAction, HTMLProps, MutableRefObject, ReactNode } from 'react';
|
|
@@ -25,6 +25,10 @@ export interface SelectProps {
|
|
|
25
25
|
name?: string;
|
|
26
26
|
autoComplete?: string;
|
|
27
27
|
size?: SizeTokens;
|
|
28
|
+
/**
|
|
29
|
+
* If passed, will render a native component instead of the custom one. Currently only `web` is supported.
|
|
30
|
+
*/
|
|
31
|
+
native?: NativeValue<'web'>;
|
|
28
32
|
}
|
|
29
33
|
export interface SelectContextValue {
|
|
30
34
|
dir?: Direction;
|
|
@@ -69,6 +73,8 @@ export interface SelectContextValue {
|
|
|
69
73
|
getFloatingProps: (userProps?: HTMLProps<HTMLElement> | undefined) => any;
|
|
70
74
|
getItemProps: (userProps?: HTMLProps<HTMLElement> | undefined) => any;
|
|
71
75
|
};
|
|
76
|
+
native?: NativeValue;
|
|
77
|
+
shouldRenderWebNative: boolean;
|
|
72
78
|
}
|
|
73
79
|
export type SelectViewportProps = ThemeableStackProps & {
|
|
74
80
|
size?: SizeTokens;
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,KAAK,EAAkB,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE1F,MAAM,MAAM,SAAS,GAAG,KAA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