@tamagui/toggle-group 1.141.5 → 1.142.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.
Files changed (41) hide show
  1. package/dist/cjs/Toggle.cjs +23 -15
  2. package/dist/cjs/Toggle.js +20 -15
  3. package/dist/cjs/Toggle.js.map +2 -2
  4. package/dist/cjs/Toggle.native.js +26 -17
  5. package/dist/cjs/Toggle.native.js.map +1 -1
  6. package/dist/cjs/ToggleGroup.cjs +46 -36
  7. package/dist/cjs/ToggleGroup.js +82 -87
  8. package/dist/cjs/ToggleGroup.js.map +2 -2
  9. package/dist/cjs/ToggleGroup.native.js +48 -36
  10. package/dist/cjs/ToggleGroup.native.js.map +1 -1
  11. package/dist/esm/Toggle.js +20 -15
  12. package/dist/esm/Toggle.js.map +2 -2
  13. package/dist/esm/Toggle.mjs +23 -15
  14. package/dist/esm/Toggle.mjs.map +1 -1
  15. package/dist/esm/Toggle.native.js +26 -17
  16. package/dist/esm/Toggle.native.js.map +1 -1
  17. package/dist/esm/ToggleGroup.js +84 -95
  18. package/dist/esm/ToggleGroup.js.map +1 -1
  19. package/dist/esm/ToggleGroup.mjs +48 -38
  20. package/dist/esm/ToggleGroup.mjs.map +1 -1
  21. package/dist/esm/ToggleGroup.native.js +50 -38
  22. package/dist/esm/ToggleGroup.native.js.map +1 -1
  23. package/dist/jsx/Toggle.js +20 -15
  24. package/dist/jsx/Toggle.js.map +2 -2
  25. package/dist/jsx/Toggle.mjs +23 -15
  26. package/dist/jsx/Toggle.mjs.map +1 -1
  27. package/dist/jsx/Toggle.native.js +26 -17
  28. package/dist/jsx/Toggle.native.js.map +1 -1
  29. package/dist/jsx/ToggleGroup.js +84 -95
  30. package/dist/jsx/ToggleGroup.js.map +1 -1
  31. package/dist/jsx/ToggleGroup.mjs +48 -38
  32. package/dist/jsx/ToggleGroup.mjs.map +1 -1
  33. package/dist/jsx/ToggleGroup.native.js +48 -36
  34. package/dist/jsx/ToggleGroup.native.js.map +1 -1
  35. package/package.json +15 -15
  36. package/src/Toggle.tsx +23 -25
  37. package/src/ToggleGroup.tsx +136 -140
  38. package/types/Toggle.d.ts +10 -14
  39. package/types/Toggle.d.ts.map +1 -1
  40. package/types/ToggleGroup.d.ts +165 -9
  41. package/types/ToggleGroup.d.ts.map +1 -1
@@ -9,18 +9,12 @@ import { useGetThemedIcon } from '@tamagui/helpers-tamagui'
9
9
  import { RovingFocusGroup } from '@tamagui/roving-focus'
10
10
  import { useControllableState } from '@tamagui/use-controllable-state'
11
11
  import { useDirection } from '@tamagui/use-direction'
12
- import type { FontSizeTokens, GetProps, SizeTokens } from '@tamagui/web'
13
- import {
14
- createStyledContext,
15
- getVariableValue,
16
- styled,
17
- usePropsAndStyle,
18
- useTheme,
19
- } from '@tamagui/web'
12
+ import type { FontSizeTokens, GetProps, SizeTokens, TamaguiElement } from '@tamagui/web'
13
+ import { createStyledContext, getVariableValue, styled, useTheme } from '@tamagui/web'
20
14
  import React from 'react'
21
15
 
22
16
  import type { ToggleProps } from './Toggle'
23
- import { Toggle, ToggleFrame } from './Toggle'
17
+ import { Toggle, ToggleFrame, context as ToggleContext } from './Toggle'
24
18
 
25
19
  const TOGGLE_GROUP_NAME = 'ToggleGroup'
26
20
 
@@ -34,14 +28,12 @@ const TOGGLE_GROUP_CONTEXT = 'ToggleGroup'
34
28
 
35
29
  type ToggleGroupItemContextValue = { disabled?: boolean }
36
30
 
37
- const { Provider: ToggleGroupItemProvider, useStyledContext: useToggleGroupItemContext } =
31
+ const { Provider: ToggleGroupItemProvider } =
38
32
  createStyledContext<ToggleGroupItemContextValue>()
39
33
 
40
34
  const { Provider: ToggleGroupContext, useStyledContext: useToggleGroupContext } =
41
35
  createStyledContext<ToggleGroupContextValue>()
42
36
 
43
- type ToggleGroupItemElement = ToggleGroupItemImplElement
44
-
45
37
  type ToggleGroupItemProps = GetProps<typeof ToggleFrame> & {
46
38
  value: string
47
39
  id?: string
@@ -51,60 +43,66 @@ type ToggleGroupItemProps = GetProps<typeof ToggleFrame> & {
51
43
  * Used to disable passing styles down to children.
52
44
  */
53
45
  disablePassStyles?: boolean
46
+ toggledStyle?: Record<string, any>
47
+ color?: string
54
48
  }
55
- const ToggleGroupItem = ToggleFrame.extractable(
56
- React.forwardRef<ToggleGroupItemElement, ToggleGroupItemProps>(
57
- (props: ScopedProps<ToggleGroupItemProps>, forwardedRef) => {
58
- const [_, { color }] = usePropsAndStyle(props)
59
- const { disablePassStyles, ...rest } = props
60
- const valueContext = useToggleGroupValueContext(props.__scopeToggleGroup)
61
- const context = useToggleGroupContext(props.__scopeToggleGroup)
62
- const pressed = valueContext?.value.includes(props.value)
63
- const disabled = context.disabled || props.disabled || false
64
- const groupItemProps = useGroupItem({ disabled })
65
- const size = props.size ?? context.size
66
-
67
- const sizeProps: Record<string, any> = props.unstyled
68
- ? {}
69
- : {
70
- width: undefined,
71
- height: undefined,
72
- padding: getVariableValue(size) * 0.6,
73
- }
74
-
75
- const iconSize =
76
- (typeof size === 'number' ? size * 0.7 : getFontSize(size as FontSizeTokens)) *
77
- 1.2
78
-
79
- const theme = useTheme()
80
- const getThemedIcon = useGetThemedIcon({
81
- size: iconSize,
82
- color: color ?? theme.color,
83
- })
84
-
85
- const childrens = React.Children.toArray(props.children)
86
- const children = childrens.map((child) => {
87
- if (props.disablePassStyles || !React.isValidElement(child)) {
88
- return child
49
+ const ToggleGroupItem = ToggleFrame.styleable<ScopedProps<ToggleGroupItemProps>>(
50
+ (props, forwardedRef) => {
51
+ const valueContext = useToggleGroupValueContext(props.__scopeToggleGroup)
52
+ const context = useToggleGroupContext(props.__scopeToggleGroup)
53
+ const toggleContext = ToggleContext.useStyledContext(props.__scopeToggleGroup)
54
+ const pressed = valueContext?.value.includes(props.value)
55
+ const toggledStyle = props.toggledStyle || toggleContext.toggledStyle
56
+ const color = (props as any).color || toggleContext.color
57
+
58
+ const { disablePassStyles, toggledStyle: _, ...rest } = props
59
+ const disabled = context.disabled || props.disabled || false
60
+ const groupItemProps = useGroupItem({ disabled })
61
+ const size = props.size ?? context.size
62
+
63
+ const sizeProps: Record<string, any> = props.unstyled
64
+ ? {}
65
+ : {
66
+ width: undefined,
67
+ height: undefined,
68
+ padding: getVariableValue(size) * 0.6,
89
69
  }
90
- return React.cloneElement(getThemedIcon(child), { active: pressed } as any)
91
- })
92
-
93
- const commonProps = { pressed, disabled, ...sizeProps, ...rest, children }
94
-
95
- const inner = (
96
- <ToggleGroupItemImpl
97
- {...commonProps}
98
- ref={forwardedRef}
99
- // focusable={!disabled}
100
- tabIndex={disabled ? -1 : 0}
101
- disabled={disabled}
102
- {...groupItemProps}
103
- />
104
- )
105
-
106
- return (
107
- <ToggleGroupItemProvider scope={props.__scopeToggleGroup}>
70
+
71
+ const iconSize =
72
+ (typeof size === 'number' ? size * 0.7 : getFontSize(size as FontSizeTokens)) * 1.2
73
+
74
+ const theme = useTheme()
75
+ const toggledColor = (toggledStyle as Record<string, any>)?.color
76
+ const activeColor = pressed && toggledColor ? toggledColor : color
77
+ const getThemedIcon = useGetThemedIcon({
78
+ size: iconSize,
79
+ color: activeColor || theme.color,
80
+ })
81
+
82
+ const childrens = React.Children.toArray(props.children)
83
+ const children = childrens.map((child) => {
84
+ if (props.disablePassStyles || !React.isValidElement(child)) {
85
+ return child
86
+ }
87
+ return React.cloneElement(getThemedIcon(child), { active: pressed } as any)
88
+ })
89
+
90
+ const commonProps = { pressed, disabled, ...sizeProps, ...rest, children }
91
+
92
+ const inner = (
93
+ <ToggleGroupItemImpl
94
+ {...commonProps}
95
+ ref={forwardedRef}
96
+ // focusable={!disabled}
97
+ tabIndex={disabled ? -1 : 0}
98
+ disabled={disabled}
99
+ {...groupItemProps}
100
+ />
101
+ )
102
+
103
+ return (
104
+ <ToggleGroupItemProvider scope={props.__scopeToggleGroup}>
105
+ <ToggleContext.Provider color={color} toggledStyle={toggledStyle}>
108
106
  {context.rovingFocus ? (
109
107
  <RovingFocusGroup.Item
110
108
  asChild="except-style"
@@ -117,16 +115,15 @@ const ToggleGroupItem = ToggleFrame.extractable(
117
115
  ) : (
118
116
  inner
119
117
  )}
120
- </ToggleGroupItemProvider>
121
- )
122
- }
123
- )
118
+ </ToggleContext.Provider>
119
+ </ToggleGroupItemProvider>
120
+ )
121
+ }
124
122
  )
125
123
  ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME
126
124
 
127
125
  /* -----------------------------------------------------------------------------------------------*/
128
126
 
129
- type ToggleGroupItemImplElement = React.ElementRef<typeof Toggle>
130
127
  type ToggleGroupItemImplProps = Omit<
131
128
  ToggleProps,
132
129
  'defaultPressed' | 'onPressedChange' | 'size'
@@ -139,9 +136,9 @@ type ToggleGroupItemImplProps = Omit<
139
136
  }
140
137
 
141
138
  const ToggleGroupItemImpl = React.forwardRef<
142
- ToggleGroupItemImplElement,
139
+ TamaguiElement,
143
140
  ScopedProps<ToggleGroupItemImplProps>
144
- >((props: ScopedProps<ToggleGroupItemImplProps>, forwardedRef) => {
141
+ >((props, forwardedRef) => {
145
142
  const { __scopeToggleGroup, value, ...itemProps } = props
146
143
 
147
144
  const valueContext = useToggleGroupValueContext(__scopeToggleGroup)
@@ -174,8 +171,6 @@ const ToggleGroupItemImpl = React.forwardRef<
174
171
 
175
172
  type ScopedProps<P> = P & { __scopeToggleGroup?: string }
176
173
 
177
- type ToggleGroupElement = ToggleGroupImplSingleElement | ToggleGroupImplMultipleElement
178
-
179
174
  interface ToggleGroupSingleProps extends ToggleGroupImplSingleProps {
180
175
  type: 'single'
181
176
  }
@@ -187,7 +182,7 @@ interface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {
187
182
  type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps
188
183
 
189
184
  const ToggleGroup = withStaticProperties(
190
- React.forwardRef<ToggleGroupElement, ScopedProps<ToggleGroupProps>>(
185
+ React.forwardRef<TamaguiElement, ScopedProps<ToggleGroupProps>>(
191
186
  (props, forwardedRef) => {
192
187
  const { type, ...toggleGroupProps } = props
193
188
 
@@ -237,7 +232,6 @@ const {
237
232
  useStyledContext: useToggleGroupValueContext,
238
233
  } = createStyledContext<ToggleGroupValueContextValue>()
239
234
 
240
- type ToggleGroupImplSingleElement = ToggleGroupImplElement
241
235
  interface ToggleGroupImplSingleProps extends ToggleGroupImplProps {
242
236
  /**
243
237
  * The controlled stateful value of the item that is pressed.
@@ -259,7 +253,7 @@ interface ToggleGroupImplSingleProps extends ToggleGroupImplProps {
259
253
  }
260
254
 
261
255
  const ToggleGroupImplSingle = React.forwardRef<
262
- ToggleGroupImplSingleElement,
256
+ TamaguiElement,
263
257
  ScopedProps<ToggleGroupImplSingleProps>
264
258
  >((props: ScopedProps<ToggleGroupImplSingleProps>, forwardedRef) => {
265
259
  const {
@@ -293,7 +287,6 @@ const ToggleGroupImplSingle = React.forwardRef<
293
287
  )
294
288
  })
295
289
 
296
- type ToggleGroupImplMultipleElement = ToggleGroupImplElement
297
290
  interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
298
291
  /**
299
292
  * The controlled stateful value of the items that are pressed.
@@ -312,7 +305,7 @@ interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
312
305
  }
313
306
 
314
307
  const ToggleGroupImplMultiple = React.forwardRef<
315
- ToggleGroupImplMultipleElement,
308
+ TamaguiElement,
316
309
  ToggleGroupImplMultipleProps
317
310
  >((props: ScopedProps<ToggleGroupImplMultipleProps>, forwardedRef) => {
318
311
  const {
@@ -365,8 +358,6 @@ type ToggleGroupContextValue = {
365
358
  }
366
359
 
367
360
  type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup>
368
- type TamaguiElement = HTMLElement
369
- type ToggleGroupImplElement = TamaguiElement
370
361
 
371
362
  const ToggleGroupImplElementFrame = styled(Group, {
372
363
  name: TOGGLE_GROUP_NAME,
@@ -401,76 +392,81 @@ type ToggleGroupImplProps = GetProps<typeof ToggleGroupImplElementFrame> &
401
392
  dir?: RovingFocusGroupProps['dir']
402
393
  loop?: RovingFocusGroupProps['loop']
403
394
  sizeAdjust?: number
395
+ toggledStyle?: Record<string, any>
396
+ color?: string
404
397
  }
405
398
 
406
- const ToggleGroupImpl = ToggleGroupImplElementFrame.extractable(
407
- React.forwardRef<ToggleGroupImplElement, ToggleGroupImplProps>(
408
- (props: ScopedProps<ToggleGroupImplProps>, forwardedRef) => {
409
- const {
410
- __scopeToggleGroup,
411
- disabled = false,
412
- orientation = 'horizontal',
413
- dir,
414
- rovingFocus = true,
415
- loop = true,
416
- unstyled = false,
417
- size: sizeProp = '$true',
418
- sizeAdjust = 0,
419
- ...toggleGroupProps
420
- } = props
421
- const direction = useDirection(dir)
422
- const commonProps: ToggleGroupImplProps = {
423
- role: 'group',
424
- dir: direction,
425
- ...toggleGroupProps,
426
- }
427
- const adjustedSize = getVariableValue(
428
- getSize(sizeProp, {
429
- shift: sizeAdjust,
430
- })
431
- )
432
- const size = Math.round(adjustedSize * 0.45)
433
-
434
- return (
435
- <ToggleGroupContext
436
- scope={__scopeToggleGroup}
437
- rovingFocus={rovingFocus}
438
- disabled={disabled}
439
- size={size}
440
- >
441
- {rovingFocus ? (
442
- <RovingFocusGroup
443
- asChild="except-style"
444
- __scopeRovingFocusGroup={__scopeToggleGroup || TOGGLE_GROUP_CONTEXT}
445
- orientation={orientation}
446
- dir={direction}
447
- loop={loop}
448
- >
449
- <ToggleGroupImplElementFrame
450
- aria-orientation={orientation}
451
- orientation={orientation}
452
- axis={orientation}
453
- ref={forwardedRef}
454
- data-disabled={disabled ? '' : undefined}
455
- unstyled={unstyled}
456
- {...commonProps}
457
- />
458
- </RovingFocusGroup>
459
- ) : (
399
+ const ToggleGroupImpl = ToggleGroupImplElementFrame.styleable<
400
+ TamaguiElement,
401
+ ToggleGroupImplProps
402
+ >((props: ScopedProps<ToggleGroupImplProps>, forwardedRef) => {
403
+ const {
404
+ __scopeToggleGroup,
405
+ disabled = false,
406
+ orientation = 'horizontal',
407
+ dir,
408
+ rovingFocus = true,
409
+ loop = true,
410
+ unstyled = false,
411
+ size: sizeProp = '$true',
412
+ sizeAdjust = 0,
413
+ toggledStyle,
414
+ color,
415
+ ...toggleGroupProps
416
+ } = props
417
+ const direction = useDirection(dir)
418
+ const commonProps: ToggleGroupImplProps = {
419
+ role: 'group',
420
+ dir: direction,
421
+ ...toggleGroupProps,
422
+ }
423
+ const adjustedSize = getVariableValue(
424
+ getSize(sizeProp, {
425
+ shift: sizeAdjust,
426
+ })
427
+ )
428
+ const size = Math.round(adjustedSize * 0.45)
429
+
430
+ return (
431
+ <ToggleGroupContext
432
+ scope={__scopeToggleGroup}
433
+ rovingFocus={rovingFocus}
434
+ disabled={disabled}
435
+ size={size}
436
+ >
437
+ <ToggleContext.Provider color={color} toggledStyle={toggledStyle}>
438
+ {rovingFocus ? (
439
+ <RovingFocusGroup
440
+ asChild="except-style"
441
+ __scopeRovingFocusGroup={__scopeToggleGroup || TOGGLE_GROUP_CONTEXT}
442
+ orientation={orientation}
443
+ dir={direction}
444
+ loop={loop}
445
+ >
460
446
  <ToggleGroupImplElementFrame
461
447
  aria-orientation={orientation}
462
- ref={forwardedRef}
463
448
  orientation={orientation}
449
+ // axis={orientation}
450
+ ref={forwardedRef}
464
451
  data-disabled={disabled ? '' : undefined}
465
452
  unstyled={unstyled}
466
453
  {...commonProps}
467
454
  />
468
- )}
469
- </ToggleGroupContext>
470
- )
471
- }
455
+ </RovingFocusGroup>
456
+ ) : (
457
+ <ToggleGroupImplElementFrame
458
+ aria-orientation={orientation}
459
+ ref={forwardedRef}
460
+ orientation={orientation}
461
+ data-disabled={disabled ? '' : undefined}
462
+ unstyled={unstyled}
463
+ {...commonProps}
464
+ />
465
+ )}
466
+ </ToggleContext.Provider>
467
+ </ToggleGroupContext>
472
468
  )
473
- )
469
+ })
474
470
 
475
471
  export { ToggleGroup }
476
472
  export type {
package/types/Toggle.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- import type { GetProps } from '@tamagui/web';
1
+ import type { GetProps, TamaguiElement } from '@tamagui/web';
2
2
  import * as React from 'react';
3
3
  export declare const context: import("@tamagui/web").StyledContext<{
4
4
  color: string;
5
+ toggledStyle: null | Record<string, any>;
5
6
  }>;
6
- type TamaguiButtonElement = HTMLButtonElement;
7
- export type ToggleElement = TamaguiButtonElement;
8
- export declare const ToggleFrame: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
9
- color?: import("@tamagui/web").ColorTokens | undefined;
7
+ export declare const ToggleFrame: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
10
8
  elevation?: number | import("@tamagui/web").SizeTokens | undefined;
11
9
  inset?: number | import("@tamagui/web").SizeTokens | {
12
10
  top?: number;
@@ -26,8 +24,8 @@ export declare const ToggleFrame: import("@tamagui/web").TamaguiComponent<import
26
24
  radiused?: boolean | undefined;
27
25
  padded?: boolean | undefined;
28
26
  chromeless?: boolean | "all" | undefined;
29
- unstyled?: boolean | undefined;
30
27
  active?: boolean | undefined;
28
+ unstyled?: boolean | undefined;
31
29
  orientation?: "horizontal" | "vertical" | undefined;
32
30
  }, import("@tamagui/web").StaticConfigPublic>;
33
31
  type ToggleFrameProps = GetProps<typeof ToggleFrame>;
@@ -37,10 +35,10 @@ type ToggleItemExtraProps = {
37
35
  pressed?: boolean;
38
36
  defaultPressed?: boolean;
39
37
  onPressedChange?(pressed: boolean): void;
38
+ toggledStyle?: Record<string, any>;
40
39
  };
41
40
  export type ToggleProps = ToggleFrameProps & ToggleItemExtraProps;
42
- export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "color" | "elevation" | keyof import("@tamagui/web").StackStyleBase | "transparent" | "fullscreen" | "circular" | "hoverTheme" | "pressTheme" | "focusTheme" | "elevate" | "bordered" | "backgrounded" | "radiused" | "padded" | "chromeless" | "unstyled" | "active" | "orientation"> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & {
43
- color?: import("@tamagui/web").ColorTokens | undefined;
41
+ export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, "elevation" | keyof import("@tamagui/web").StackStyleBase | "transparent" | "fullscreen" | "circular" | "hoverTheme" | "pressTheme" | "focusTheme" | "elevate" | "bordered" | "backgrounded" | "radiused" | "padded" | "chromeless" | "active" | "unstyled" | "orientation"> & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & {
44
42
  elevation?: number | import("@tamagui/web").SizeTokens | undefined;
45
43
  inset?: number | import("@tamagui/web").SizeTokens | {
46
44
  top?: number;
@@ -60,11 +58,10 @@ export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@tamag
60
58
  radiused?: boolean | undefined;
61
59
  padded?: boolean | undefined;
62
60
  chromeless?: boolean | "all" | undefined;
63
- unstyled?: boolean | undefined;
64
61
  active?: boolean | undefined;
62
+ unstyled?: boolean | undefined;
65
63
  orientation?: "horizontal" | "vertical" | undefined;
66
64
  } & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & {
67
- color?: import("@tamagui/web").ColorTokens | undefined;
68
65
  elevation?: number | import("@tamagui/web").SizeTokens | undefined;
69
66
  inset?: number | import("@tamagui/web").SizeTokens | {
70
67
  top?: number;
@@ -84,11 +81,10 @@ export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@tamag
84
81
  radiused?: boolean | undefined;
85
82
  padded?: boolean | undefined;
86
83
  chromeless?: boolean | "all" | undefined;
87
- unstyled?: boolean | undefined;
88
84
  active?: boolean | undefined;
85
+ unstyled?: boolean | undefined;
89
86
  orientation?: "horizontal" | "vertical" | undefined;
90
87
  } & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> & import("@tamagui/web").WithMediaProps<import("@tamagui/web").WithThemeShorthandsAndPseudos<import("@tamagui/web").StackStyleBase, {
91
- color?: import("@tamagui/web").ColorTokens | undefined;
92
88
  elevation?: number | import("@tamagui/web").SizeTokens | undefined;
93
89
  inset?: number | import("@tamagui/web").SizeTokens | {
94
90
  top?: number;
@@ -108,9 +104,9 @@ export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@tamag
108
104
  radiused?: boolean | undefined;
109
105
  padded?: boolean | undefined;
110
106
  chromeless?: boolean | "all" | undefined;
111
- unstyled?: boolean | undefined;
112
107
  active?: boolean | undefined;
108
+ unstyled?: boolean | undefined;
113
109
  orientation?: "horizontal" | "vertical" | undefined;
114
- }>> & ToggleItemExtraProps & React.RefAttributes<HTMLButtonElement>>;
110
+ }>> & ToggleItemExtraProps & React.RefAttributes<TamaguiElement>>;
115
111
  export {};
116
112
  //# sourceMappingURL=Toggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../src/Toggle.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,eAAO,MAAM,OAAO;;EAElB,CAAA;AAQF,KAAK,oBAAoB,GAAG,iBAAiB,CAAA;AAE7C,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAA;AAEhD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;6CAqEtB,CAAA;AAEF,KAAK,gBAAgB,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEpD,KAAK,oBAAoB,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,oBAAoB,CAAA;AAEjE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oEAmClB,CAAA"}
1
+ {"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../src/Toggle.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,eAAO,MAAM,OAAO;;kBAEI,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;EAChD,CAAA;AAQF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;6CAqEtB,CAAA;AAEF,KAAK,gBAAgB,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEpD,KAAK,oBAAoB,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,oBAAoB,CAAA;AAEjE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iEAmClB,CAAA"}