@hanzogui/toggle-group 3.0.2 → 7.0.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 (66) hide show
  1. package/package.json +20 -19
  2. package/src/Toggle.tsx +3 -3
  3. package/src/ToggleGroup.tsx +6 -6
  4. package/types/Toggle.d.ts +18 -18
  5. package/types/ToggleGroup.d.ts +41 -41
  6. package/types/context.d.ts +1 -1
  7. package/types/types.d.ts +1 -1
  8. package/dist/cjs/Toggle.cjs +0 -145
  9. package/dist/cjs/Toggle.native.js +0 -154
  10. package/dist/cjs/Toggle.native.js.map +0 -1
  11. package/dist/cjs/ToggleGroup.cjs +0 -229
  12. package/dist/cjs/ToggleGroup.native.js +0 -252
  13. package/dist/cjs/ToggleGroup.native.js.map +0 -1
  14. package/dist/cjs/context.cjs +0 -32
  15. package/dist/cjs/context.native.js +0 -37
  16. package/dist/cjs/context.native.js.map +0 -1
  17. package/dist/cjs/index.cjs +0 -28
  18. package/dist/cjs/index.native.js +0 -31
  19. package/dist/cjs/index.native.js.map +0 -1
  20. package/dist/cjs/types.cjs +0 -16
  21. package/dist/cjs/types.native.js +0 -19
  22. package/dist/cjs/types.native.js.map +0 -1
  23. package/dist/esm/Toggle.mjs +0 -110
  24. package/dist/esm/Toggle.mjs.map +0 -1
  25. package/dist/esm/Toggle.native.js +0 -116
  26. package/dist/esm/Toggle.native.js.map +0 -1
  27. package/dist/esm/ToggleGroup.mjs +0 -195
  28. package/dist/esm/ToggleGroup.mjs.map +0 -1
  29. package/dist/esm/ToggleGroup.native.js +0 -215
  30. package/dist/esm/ToggleGroup.native.js.map +0 -1
  31. package/dist/esm/context.mjs +0 -8
  32. package/dist/esm/context.mjs.map +0 -1
  33. package/dist/esm/context.native.js +0 -10
  34. package/dist/esm/context.native.js.map +0 -1
  35. package/dist/esm/index.js +0 -4
  36. package/dist/esm/index.js.map +0 -1
  37. package/dist/esm/index.mjs +0 -4
  38. package/dist/esm/index.mjs.map +0 -1
  39. package/dist/esm/index.native.js +0 -4
  40. package/dist/esm/index.native.js.map +0 -1
  41. package/dist/esm/types.mjs +0 -2
  42. package/dist/esm/types.mjs.map +0 -1
  43. package/dist/esm/types.native.js +0 -2
  44. package/dist/esm/types.native.js.map +0 -1
  45. package/dist/jsx/Toggle.mjs +0 -110
  46. package/dist/jsx/Toggle.mjs.map +0 -1
  47. package/dist/jsx/Toggle.native.js +0 -154
  48. package/dist/jsx/Toggle.native.js.map +0 -1
  49. package/dist/jsx/ToggleGroup.mjs +0 -195
  50. package/dist/jsx/ToggleGroup.mjs.map +0 -1
  51. package/dist/jsx/ToggleGroup.native.js +0 -252
  52. package/dist/jsx/ToggleGroup.native.js.map +0 -1
  53. package/dist/jsx/context.mjs +0 -8
  54. package/dist/jsx/context.mjs.map +0 -1
  55. package/dist/jsx/context.native.js +0 -37
  56. package/dist/jsx/context.native.js.map +0 -1
  57. package/dist/jsx/index.js +0 -4
  58. package/dist/jsx/index.js.map +0 -1
  59. package/dist/jsx/index.mjs +0 -4
  60. package/dist/jsx/index.mjs.map +0 -1
  61. package/dist/jsx/index.native.js +0 -31
  62. package/dist/jsx/index.native.js.map +0 -1
  63. package/dist/jsx/types.mjs +0 -2
  64. package/dist/jsx/types.mjs.map +0 -1
  65. package/dist/jsx/types.native.js +0 -19
  66. package/dist/jsx/types.native.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/toggle-group",
3
- "version": "3.0.2",
3
+ "version": "7.0.0",
4
4
  "source": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -30,31 +30,32 @@
30
30
  "access": "public"
31
31
  },
32
32
  "scripts": {
33
- "build": "hanzo-gui-build",
34
- "watch": "hanzo-gui-build --watch",
35
- "clean": "hanzo-gui-build clean",
36
- "clean:build": "hanzo-gui-build clean:build"
33
+ "build": "hanzogui-build",
34
+ "watch": "hanzogui-build --watch",
35
+ "clean": "hanzogui-build clean",
36
+ "clean:build": "hanzogui-build clean:build"
37
37
  },
38
38
  "dependencies": {
39
- "@hanzogui/constants": "3.0.1",
40
- "@hanzogui/create-context": "3.0.1",
41
- "@hanzogui/focusable": "3.0.1",
42
- "@hanzogui/get-token": "3.0.1",
43
- "@hanzogui/helpers": "3.0.1",
44
- "@hanzogui/roving-focus": "3.0.1",
45
- "@hanzogui/sizable-context": "3.0.1",
46
- "@hanzogui/stacks": "3.0.1",
47
- "@hanzogui/use-controllable-state": "3.0.1",
48
- "@hanzogui/use-direction": "3.0.1",
49
- "@hanzogui/font-size": "3.0.1",
50
- "@hanzogui/web": "3.0.1"
39
+ "@hanzogui/constants": "^7.0.0",
40
+ "@hanzogui/create-context": "^7.0.0",
41
+ "@hanzogui/focusable": "^7.0.0",
42
+ "@hanzogui/get-token": "^7.0.0",
43
+ "@hanzogui/helpers": "^7.0.0",
44
+ "@hanzogui/component-helpers": "^7.0.0",
45
+ "@hanzogui/roving-focus": "^7.0.0",
46
+ "@hanzogui/sizable-context": "^7.0.0",
47
+ "@hanzogui/stacks": "^7.0.0",
48
+ "@hanzogui/use-controllable-state": "^7.0.0",
49
+ "@hanzogui/use-direction": "^7.0.0",
50
+ "@hanzogui/font-size": "^7.0.0",
51
+ "@hanzogui/web": "^7.0.0"
51
52
  },
52
53
  "devDependencies": {
53
- "@hanzogui/build": "3.0.1",
54
+ "@hanzogui/build": "^7.0.0",
54
55
  "react": ">=19"
55
56
  },
56
57
  "peerDependencies": {
57
58
  "react": ">=19"
58
59
  },
59
60
  "module:jsx": "dist/jsx"
60
- }
61
+ }
package/src/Toggle.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { composeEventHandlers } from '@hanzogui/helpers'
2
2
  import { useControllableState } from '@hanzogui/use-controllable-state'
3
- import type { GetProps, GuiElement, ViewStyle } from '@hanzogui/web'
3
+ import type { GetProps, HanzoguiElement, ViewStyle } from '@hanzogui/web'
4
4
  import { styled, View } from '@hanzogui/web'
5
5
  import * as React from 'react'
6
6
  import { context } from './context'
@@ -74,7 +74,7 @@ export const ToggleFrame = styled(
74
74
  } as const,
75
75
 
76
76
  defaultVariants: {
77
- unstyled: process.env.HANZO_GUI_HEADLESS === '1',
77
+ unstyled: process.env.HANZOGUI_HEADLESS === '1',
78
78
  },
79
79
  },
80
80
  {
@@ -99,7 +99,7 @@ type ToggleItemExtraProps = {
99
99
 
100
100
  export type ToggleProps = ToggleFrameProps & ToggleItemExtraProps
101
101
 
102
- export const Toggle = React.forwardRef<GuiElement, ToggleProps>(
102
+ export const Toggle = React.forwardRef<HanzoguiElement, ToggleProps>(
103
103
  function Toggle(props, forwardedRef) {
104
104
  const {
105
105
  active: activeProp,
@@ -4,7 +4,7 @@ import { withStaticProperties } from '@hanzogui/helpers'
4
4
  import { RovingFocusGroup } from '@hanzogui/roving-focus'
5
5
  import { useControllableState } from '@hanzogui/use-controllable-state'
6
6
  import { useDirection } from '@hanzogui/use-direction'
7
- import type { GetProps, GuiElement } from '@hanzogui/web'
7
+ import type { GetProps, HanzoguiElement } from '@hanzogui/web'
8
8
  import { createStyledContext, styled, View } from '@hanzogui/web'
9
9
  import React from 'react'
10
10
 
@@ -82,7 +82,7 @@ type ToggleGroupItemImplProps = Omit<ToggleProps, 'defaultActive' | 'onActiveCha
82
82
  }
83
83
 
84
84
  const ToggleGroupItemImpl = React.forwardRef<
85
- GuiElement,
85
+ HanzoguiElement,
86
86
  ScopedProps<ToggleGroupItemImplProps>
87
87
  >((props, forwardedRef) => {
88
88
  const { __scopeToggleGroup, value, ...itemProps } = props
@@ -123,7 +123,7 @@ interface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {
123
123
  type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps
124
124
 
125
125
  const ToggleGroup = withStaticProperties(
126
- React.forwardRef<GuiElement, ScopedProps<ToggleGroupProps>>(
126
+ React.forwardRef<HanzoguiElement, ScopedProps<ToggleGroupProps>>(
127
127
  (props, forwardedRef) => {
128
128
  const { type, ...toggleGroupProps } = props
129
129
 
@@ -183,7 +183,7 @@ interface ToggleGroupImplSingleProps extends ToggleGroupImplProps {
183
183
  }
184
184
 
185
185
  const ToggleGroupImplSingle = React.forwardRef<
186
- GuiElement,
186
+ HanzoguiElement,
187
187
  ScopedProps<ToggleGroupImplSingleProps>
188
188
  >((props: ScopedProps<ToggleGroupImplSingleProps>, forwardedRef) => {
189
189
  const {
@@ -231,7 +231,7 @@ interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
231
231
  }
232
232
 
233
233
  const ToggleGroupImplMultiple = React.forwardRef<
234
- GuiElement,
234
+ HanzoguiElement,
235
235
  ToggleGroupImplMultipleProps
236
236
  >((props: ScopedProps<ToggleGroupImplMultipleProps>, forwardedRef) => {
237
237
  const {
@@ -297,7 +297,7 @@ type ToggleGroupImplProps = GetProps<typeof ToggleGroupFrame> & {
297
297
  color?: string
298
298
  }
299
299
 
300
- const ToggleGroupImpl = ToggleGroupFrame.styleable<GuiElement, ToggleGroupImplProps>(
300
+ const ToggleGroupImpl = ToggleGroupFrame.styleable<HanzoguiElement, ToggleGroupImplProps>(
301
301
  (props: ScopedProps<ToggleGroupImplProps>, forwardedRef) => {
302
302
  const {
303
303
  __scopeToggleGroup,
package/types/Toggle.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import type { GetProps, GuiElement, ViewStyle } from '@gui/web';
1
+ import type { GetProps, HanzoguiElement, ViewStyle } from '@hanzogui/web';
2
2
  import * as React from 'react';
3
- export declare const ToggleFrame: import("@gui/web").GuiComponent<import("@gui/web").TamaDefer, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase & {
4
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
3
+ export declare const ToggleFrame: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase & {
4
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
5
5
  accept: {
6
6
  readonly activeStyle: "style";
7
7
  };
8
8
  }>> | undefined;
9
9
  }, {
10
10
  unstyled?: boolean | undefined;
11
- size?: number | import("@gui/web").SizeTokens | undefined;
11
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
12
12
  defaultActiveStyle?: boolean | undefined;
13
13
  }, {
14
14
  accept: {
@@ -27,48 +27,48 @@ type ToggleItemExtraProps = {
27
27
  activeTheme?: string | null;
28
28
  };
29
29
  export type ToggleProps = ToggleFrameProps & ToggleItemExtraProps;
30
- export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@gui/web").StackNonStyleProps, "unstyled" | keyof import("@gui/web").StackStyleBase | "size" | "activeStyle" | "defaultActiveStyle"> & import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
31
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
30
+ export declare const Toggle: React.ForwardRefExoticComponent<Omit<import("@hanzogui/web").StackNonStyleProps, "unstyled" | keyof import("@hanzogui/web").StackStyleBase | "size" | "activeStyle" | "defaultActiveStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
31
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
32
32
  accept: {
33
33
  readonly activeStyle: "style";
34
34
  };
35
35
  }>> | undefined;
36
36
  }> & {
37
37
  unstyled?: boolean | undefined;
38
- size?: number | import("@gui/web").SizeTokens | undefined;
38
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
39
39
  defaultActiveStyle?: boolean | undefined;
40
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
41
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
40
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
41
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
42
42
  accept: {
43
43
  readonly activeStyle: "style";
44
44
  };
45
45
  }>> | undefined;
46
- }>> & import("@gui/web").WithPseudoProps<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
47
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
46
+ }>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
47
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
48
48
  accept: {
49
49
  readonly activeStyle: "style";
50
50
  };
51
51
  }>> | undefined;
52
52
  }> & {
53
53
  unstyled?: boolean | undefined;
54
- size?: number | import("@gui/web").SizeTokens | undefined;
54
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
55
55
  defaultActiveStyle?: boolean | undefined;
56
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
57
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
56
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
57
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
58
58
  accept: {
59
59
  readonly activeStyle: "style";
60
60
  };
61
61
  }>> | undefined;
62
- }>>> & import("@gui/web").WithMediaProps<import("@gui/web").WithThemeShorthandsAndPseudos<import("@gui/web").StackStyleBase & {
63
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
62
+ }>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
63
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
64
64
  accept: {
65
65
  readonly activeStyle: "style";
66
66
  };
67
67
  }>> | undefined;
68
68
  }, {
69
69
  unstyled?: boolean | undefined;
70
- size?: number | import("@gui/web").SizeTokens | undefined;
70
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
71
71
  defaultActiveStyle?: boolean | undefined;
72
- }>> & ToggleItemExtraProps & React.RefAttributes<GuiElement>>;
72
+ }>> & ToggleItemExtraProps & React.RefAttributes<HanzoguiElement>>;
73
73
  export {};
74
74
  //# sourceMappingURL=Toggle.d.ts.map
@@ -1,5 +1,5 @@
1
- import { RovingFocusGroup } from '@gui/roving-focus';
2
- import type { GetProps, GuiElement } from '@gui/web';
1
+ import { RovingFocusGroup } from '@hanzogui/roving-focus';
2
+ import type { GetProps, HanzoguiElement } from '@hanzogui/web';
3
3
  import React from 'react';
4
4
  import { ToggleFrame } from './Toggle';
5
5
  type ToggleGroupItemProps = GetProps<typeof ToggleFrame> & {
@@ -17,74 +17,74 @@ interface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {
17
17
  type: 'multiple';
18
18
  }
19
19
  type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;
20
- declare const ToggleGroup: React.ForwardRefExoticComponent<ScopedProps<ToggleGroupProps> & React.RefAttributes<GuiElement>> & {
21
- Item: import("@gui/web").GuiComponent<Omit<import("@gui/web").GetFinalProps<import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase & {
22
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
20
+ declare const ToggleGroup: React.ForwardRefExoticComponent<ScopedProps<ToggleGroupProps> & React.RefAttributes<HanzoguiElement>> & {
21
+ Item: import("@hanzogui/web").HanzoguiComponent<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase & {
22
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
23
23
  accept: {
24
24
  readonly activeStyle: "style";
25
25
  };
26
26
  }>> | undefined;
27
27
  }, {
28
28
  unstyled?: boolean | undefined;
29
- size?: number | import("@gui/web").SizeTokens | undefined;
29
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
30
30
  defaultActiveStyle?: boolean | undefined;
31
- }>, "theme" | "debug" | "style" | `$${string}` | `$${number}` | import("@gui/web").GroupMediaKeys | `$theme-${string}` | `$theme-${number}` | "render" | "hitSlop" | "children" | "target" | "htmlFor" | "asChild" | "dangerouslySetInnerHTML" | "disabled" | "className" | "themeShallow" | "unstyled" | "id" | "group" | "untilMeasured" | "componentName" | "tabIndex" | "role" | "disableOptimization" | "forceStyle" | "disableClassName" | "animatedBy" | "onFocus" | "onBlur" | "onPointerCancel" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "needsOffscreenAlphaCompositing" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMoveCapture" | "onPointerCancelCapture" | "onPointerDownCapture" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | keyof import("@gui/web").StackStyleBase | "onPress" | "onLongPress" | "onPressIn" | "onPressOut" | "onMouseEnter" | "onMouseLeave" | "onMouseDown" | "onMouseUp" | "onMouseMove" | "onMouseOver" | "onMouseOut" | "onClick" | "onDoubleClick" | "onContextMenu" | "onWheel" | "onKeyDown" | "onKeyUp" | "onChange" | "onInput" | "onBeforeInput" | "onScroll" | "onCopy" | "onCut" | "onPaste" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop" | "size" | "activeStyle" | "value" | "defaultActiveStyle" | keyof import("@gui/web").WithPseudoProps<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
32
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
31
+ }>, "theme" | "debug" | "style" | `$${string}` | `$${number}` | import("@hanzogui/web").GroupMediaKeys | `$theme-${string}` | `$theme-${number}` | "render" | "hitSlop" | "children" | "target" | "htmlFor" | "asChild" | "dangerouslySetInnerHTML" | "disabled" | "className" | "themeShallow" | "unstyled" | "id" | "group" | "untilMeasured" | "componentName" | "tabIndex" | "role" | "disableOptimization" | "forceStyle" | "disableClassName" | "animatedBy" | "onFocus" | "onBlur" | "onPointerCancel" | "onPointerDown" | "onPointerMove" | "onPointerUp" | "needsOffscreenAlphaCompositing" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMoveCapture" | "onPointerCancelCapture" | "onPointerDownCapture" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | keyof import("@hanzogui/web").StackStyleBase | "onPress" | "onLongPress" | "onPressIn" | "onPressOut" | "onMouseEnter" | "onMouseLeave" | "onMouseDown" | "onMouseUp" | "onMouseMove" | "onMouseOver" | "onMouseOut" | "onClick" | "onDoubleClick" | "onContextMenu" | "onWheel" | "onKeyDown" | "onKeyUp" | "onChange" | "onInput" | "onBeforeInput" | "onScroll" | "onCopy" | "onCut" | "onPaste" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop" | "size" | "activeStyle" | "value" | "defaultActiveStyle" | keyof import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
32
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
33
33
  accept: {
34
34
  readonly activeStyle: "style";
35
35
  };
36
36
  }>> | undefined;
37
37
  }> & {
38
38
  unstyled?: boolean | undefined;
39
- size?: number | import("@gui/web").SizeTokens | undefined;
39
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
40
40
  defaultActiveStyle?: boolean | undefined;
41
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
42
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
41
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
42
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
43
43
  accept: {
44
44
  readonly activeStyle: "style";
45
45
  };
46
46
  }>> | undefined;
47
- }>>> | "__scopeToggleGroup"> & Omit<import("@gui/web").StackNonStyleProps, "unstyled" | keyof import("@gui/web").StackStyleBase | "size" | "activeStyle" | "defaultActiveStyle"> & import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
48
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
47
+ }>>> | "__scopeToggleGroup"> & Omit<import("@hanzogui/web").StackNonStyleProps, "unstyled" | keyof import("@hanzogui/web").StackStyleBase | "size" | "activeStyle" | "defaultActiveStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
48
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
49
49
  accept: {
50
50
  readonly activeStyle: "style";
51
51
  };
52
52
  }>> | undefined;
53
53
  }> & {
54
54
  unstyled?: boolean | undefined;
55
- size?: number | import("@gui/web").SizeTokens | undefined;
55
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
56
56
  defaultActiveStyle?: boolean | undefined;
57
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
58
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
57
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
58
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
59
59
  accept: {
60
60
  readonly activeStyle: "style";
61
61
  };
62
62
  }>> | undefined;
63
- }>> & import("@gui/web").WithPseudoProps<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
64
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
63
+ }>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
64
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
65
65
  accept: {
66
66
  readonly activeStyle: "style";
67
67
  };
68
68
  }>> | undefined;
69
69
  }> & {
70
70
  unstyled?: boolean | undefined;
71
- size?: number | import("@gui/web").SizeTokens | undefined;
71
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
72
72
  defaultActiveStyle?: boolean | undefined;
73
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
74
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
73
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
74
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
75
75
  accept: {
76
76
  readonly activeStyle: "style";
77
77
  };
78
78
  }>> | undefined;
79
- }>>> & import("@gui/web").WithMediaProps<import("@gui/web").WithThemeShorthandsAndPseudos<import("@gui/web").StackStyleBase & {
80
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
79
+ }>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
80
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
81
81
  accept: {
82
82
  readonly activeStyle: "style";
83
83
  };
84
84
  }>> | undefined;
85
85
  }, {
86
86
  unstyled?: boolean | undefined;
87
- size?: number | import("@gui/web").SizeTokens | undefined;
87
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
88
88
  defaultActiveStyle?: boolean | undefined;
89
89
  }>> & {
90
90
  value: string;
@@ -92,47 +92,47 @@ declare const ToggleGroup: React.ForwardRefExoticComponent<ScopedProps<ToggleGro
92
92
  disabled?: boolean;
93
93
  } & {
94
94
  __scopeToggleGroup?: string;
95
- }, GuiElement, import("@gui/web").StackNonStyleProps & Omit<import("@gui/web").StackNonStyleProps, "unstyled" | keyof import("@gui/web").StackStyleBase | "size" | "activeStyle" | "defaultActiveStyle"> & import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
96
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
95
+ }, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps & Omit<import("@hanzogui/web").StackNonStyleProps, "unstyled" | keyof import("@hanzogui/web").StackStyleBase | "size" | "activeStyle" | "defaultActiveStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
96
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
97
97
  accept: {
98
98
  readonly activeStyle: "style";
99
99
  };
100
100
  }>> | undefined;
101
101
  }> & {
102
102
  unstyled?: boolean | undefined;
103
- size?: number | import("@gui/web").SizeTokens | undefined;
103
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
104
104
  defaultActiveStyle?: boolean | undefined;
105
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
106
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
105
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
106
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
107
107
  accept: {
108
108
  readonly activeStyle: "style";
109
109
  };
110
110
  }>> | undefined;
111
- }>> & import("@gui/web").WithPseudoProps<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
112
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
111
+ }>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
112
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
113
113
  accept: {
114
114
  readonly activeStyle: "style";
115
115
  };
116
116
  }>> | undefined;
117
117
  }> & {
118
118
  unstyled?: boolean | undefined;
119
- size?: number | import("@gui/web").SizeTokens | undefined;
119
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
120
120
  defaultActiveStyle?: boolean | undefined;
121
- } & import("@gui/web").WithShorthands<import("@gui/web").WithThemeValues<import("@gui/web").StackStyleBase & {
122
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
121
+ } & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
122
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
123
123
  accept: {
124
124
  readonly activeStyle: "style";
125
125
  };
126
126
  }>> | undefined;
127
- }>>> & import("@gui/web").WithMediaProps<import("@gui/web").WithThemeShorthandsAndPseudos<import("@gui/web").StackStyleBase & {
128
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
127
+ }>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
128
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
129
129
  accept: {
130
130
  readonly activeStyle: "style";
131
131
  };
132
132
  }>> | undefined;
133
133
  }, {
134
134
  unstyled?: boolean | undefined;
135
- size?: number | import("@gui/web").SizeTokens | undefined;
135
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
136
136
  defaultActiveStyle?: boolean | undefined;
137
137
  }>> & {
138
138
  value: string;
@@ -140,15 +140,15 @@ declare const ToggleGroup: React.ForwardRefExoticComponent<ScopedProps<ToggleGro
140
140
  disabled?: boolean;
141
141
  } & {
142
142
  __scopeToggleGroup?: string;
143
- }, import("@gui/web").StackStyleBase & {
144
- readonly activeStyle?: Partial<import("@gui/web").InferStyleProps<import("@gui/web").GuiComponent<import("@gui/web").ViewProps, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, {}>, {
143
+ }, import("@hanzogui/web").StackStyleBase & {
144
+ readonly activeStyle?: Partial<import("@hanzogui/web").InferStyleProps<import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").ViewProps, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, {}>, {
145
145
  accept: {
146
146
  readonly activeStyle: "style";
147
147
  };
148
148
  }>> | undefined;
149
149
  }, {
150
150
  unstyled?: boolean | undefined;
151
- size?: number | import("@gui/web").SizeTokens | undefined;
151
+ size?: number | import("@hanzogui/web").SizeTokens | undefined;
152
152
  defaultActiveStyle?: boolean | undefined;
153
153
  }, {
154
154
  accept: {
@@ -176,7 +176,7 @@ interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
176
176
  disableDeactivation?: never;
177
177
  }
178
178
  type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup>;
179
- declare const ToggleGroupFrame: import("@gui/web").GuiComponent<import("@gui/web").TamaDefer, GuiElement, import("@gui/web").StackNonStyleProps, import("@gui/web").StackStyleBase, {}, import("@gui/web").StaticConfigPublic>;
179
+ declare const ToggleGroupFrame: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {}, import("@hanzogui/web").StaticConfigPublic>;
180
180
  type ToggleGroupImplProps = GetProps<typeof ToggleGroupFrame> & {
181
181
  orientation?: 'horizontal' | 'vertical';
182
182
  rovingFocus?: boolean;
@@ -1,4 +1,4 @@
1
- export declare const context: import("@gui/web").StyledContext<{
1
+ export declare const context: import("@hanzogui/web").StyledContext<{
2
2
  color: string;
3
3
  active: boolean;
4
4
  }>;
package/types/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ViewStyle } from '@gui/web';
1
+ import type { ViewStyle } from '@hanzogui/web';
2
2
  export type ToggleStylesBase = ViewStyle & {
3
3
  color?: string;
4
4
  };
@@ -1,145 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
32
- var Toggle_exports = {};
33
- __export(Toggle_exports, {
34
- Toggle: () => Toggle,
35
- ToggleFrame: () => ToggleFrame
36
- });
37
- module.exports = __toCommonJS(Toggle_exports);
38
- var import_gui_helpers = require("@hanzogui/helpers"),
39
- import_gui_use_controllable_state = require("@hanzogui/use-controllable-state"),
40
- import_gui_web = require("@hanzogui/web"),
41
- React = __toESM(require("react"), 1),
42
- import_context = require("./context.cjs"),
43
- import_jsx_runtime = require("react/jsx-runtime");
44
- const NAME = "Toggle",
45
- ToggleFrame = (0, import_gui_web.styled)(import_gui_web.View, {
46
- name: NAME,
47
- render: "button",
48
- context: import_context.context,
49
- variants: {
50
- unstyled: {
51
- false: {
52
- size: "$true",
53
- alignItems: "center",
54
- justifyContent: "center",
55
- display: "flex",
56
- backgroundColor: "$background",
57
- borderColor: "$borderColor",
58
- borderWidth: 1,
59
- margin: -1,
60
- hoverStyle: {
61
- backgroundColor: "$backgroundHover",
62
- borderColor: "$borderColorHover"
63
- },
64
- pressStyle: {
65
- backgroundColor: "$backgroundPress",
66
- borderColor: "$borderColorPress"
67
- },
68
- focusVisibleStyle: {
69
- outlineColor: "$outlineColor",
70
- outlineWidth: 2,
71
- outlineStyle: "solid",
72
- zIndex: 10
73
- }
74
- }
75
- },
76
- size: {
77
- "...size": (val, {
78
- tokens
79
- }) => {
80
- if (val) return {
81
- width: tokens.size[val],
82
- height: tokens.size[val]
83
- };
84
- },
85
- ":number": val => ({
86
- width: val,
87
- height: val
88
- })
89
- },
90
- defaultActiveStyle: {
91
- true: {
92
- backgroundColor: "$backgroundActive",
93
- hoverStyle: {
94
- backgroundColor: "$backgroundActive"
95
- },
96
- focusStyle: {
97
- backgroundColor: "$backgroundActive"
98
- }
99
- }
100
- }
101
- },
102
- defaultVariants: {
103
- unstyled: process.env.HANZO_GUI_HEADLESS === "1"
104
- }
105
- }, {
106
- accept: {
107
- activeStyle: "style"
108
- }
109
- }),
110
- Toggle = React.forwardRef(function (props, forwardedRef) {
111
- const {
112
- active: activeProp,
113
- activeStyle,
114
- defaultActive = !1,
115
- onActiveChange,
116
- activeTheme,
117
- unstyled = !1,
118
- ...buttonProps
119
- } = props,
120
- [active = !1, setActive] = (0, import_gui_use_controllable_state.useControllableState)({
121
- prop: activeProp,
122
- onChange: onActiveChange,
123
- defaultProp: defaultActive
124
- });
125
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToggleFrame, {
126
- theme: activeTheme ?? null,
127
- "aria-pressed": active,
128
- "data-state": active ? "on" : "off",
129
- "data-disabled": props.disabled ? "" : void 0,
130
- unstyled,
131
- ...(active && !activeStyle && !unstyled && {
132
- defaultActiveStyle: !0
133
- }),
134
- ...(active && activeStyle && {
135
- ...activeStyle,
136
- hoverStyle: activeStyle,
137
- focusStyle: activeStyle
138
- }),
139
- ...buttonProps,
140
- ref: forwardedRef,
141
- onPress: (0, import_gui_helpers.composeEventHandlers)(props.onPress ?? void 0, () => {
142
- props.disabled || setActive(prev => !prev);
143
- })
144
- });
145
- });