@kushagradhawan/kookie-ui 0.1.6 → 0.1.7
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/components/toggle-icon-button.d.ts +20 -19
- package/dist/cjs/components/toggle-icon-button.d.ts.map +1 -1
- package/dist/cjs/components/toggle-icon-button.js +1 -1
- package/dist/cjs/components/toggle-icon-button.js.map +3 -3
- package/dist/esm/components/toggle-icon-button.d.ts +20 -19
- package/dist/esm/components/toggle-icon-button.d.ts.map +1 -1
- package/dist/esm/components/toggle-icon-button.js +1 -1
- package/dist/esm/components/toggle-icon-button.js.map +2 -2
- package/package.json +1 -1
- package/src/components/toggle-icon-button.tsx +34 -61
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
interface ToggleIconButtonProps {
|
|
7
|
-
pressed?: boolean;
|
|
8
|
-
onPressedChange?: (pressed: boolean) => void;
|
|
9
|
-
defaultPressed?: boolean;
|
|
2
|
+
import { Toggle } from 'radix-ui';
|
|
3
|
+
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
4
|
+
type ToggleProps = React.ComponentPropsWithoutRef<typeof Toggle.Root>;
|
|
5
|
+
type AccessibilityProps = {
|
|
10
6
|
'aria-label': string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
'aria-labelledby'?: never;
|
|
8
|
+
} | {
|
|
9
|
+
'aria-label'?: never;
|
|
10
|
+
'aria-labelledby': string;
|
|
11
|
+
} | {
|
|
12
|
+
'aria-label'?: never;
|
|
13
|
+
'aria-labelledby'?: never;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
interface ToggleIconButtonProps extends Omit<BaseButtonProps, 'as'> {
|
|
17
|
+
pressed?: ToggleProps['pressed'];
|
|
18
|
+
onPressedChange?: ToggleProps['onPressedChange'];
|
|
19
|
+
defaultPressed?: ToggleProps['defaultPressed'];
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
type ToggleIconButtonPropsWithAccessibility = ToggleIconButtonProps & AccessibilityProps;
|
|
22
|
+
declare const ToggleIconButton: React.ForwardRefExoticComponent<ToggleIconButtonPropsWithAccessibility & React.RefAttributes<HTMLButtonElement>>;
|
|
22
23
|
export { ToggleIconButton };
|
|
23
|
-
export type { ToggleIconButtonProps };
|
|
24
|
+
export type { ToggleIconButtonPropsWithAccessibility as ToggleIconButtonProps };
|
|
24
25
|
//# sourceMappingURL=toggle-icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle-icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAKlE,KAAK,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AAGtE,KAAK,kBAAkB,GACnB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAAE,GACnD;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAGnF,UAAU,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC;IACjE,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;CAChD;AAGD,KAAK,sCAAsC,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAEzF,QAAA,MAAM,gBAAgB,kHAcpB,CAAC;AAGH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,sCAAsC,IAAI,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.create;var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var t in o)n(e,t,{get:o[t],enumerable:!0})},g=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of u(o))!B.call(e,s)&&s!==t&&n(e,s,{get:()=>o[s],enumerable:!(r=d(o,s))||r.enumerable});return e};var T=(e,o,t)=>(t=e!=null?c(P(e)):{},g(o||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e)),b=e=>g(n({},"__esModule",{value:!0}),e);var f={};y(f,{ToggleIconButton:()=>a});module.exports=b(f);var l=T(require("react")),i=require("radix-ui"),p=require("./icon-button.js"),I=require("./_internal/base-button.js");const a=l.forwardRef(({pressed:e,onPressedChange:o,defaultPressed:t,...r},s)=>l.createElement(i.Toggle.Root,{pressed:e,onPressedChange:o,defaultPressed:t,asChild:!0},l.createElement(p.IconButton,{...r,ref:s})));a.displayName="ToggleIconButton";
|
|
2
2
|
//# sourceMappingURL=toggle-icon-button.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/toggle-icon-button.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { IconButton } from './icon-button.js';\nimport
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,oBACvBC,EAA2B,
|
|
6
|
-
"names": ["toggle_icon_button_exports", "__export", "ToggleIconButton", "__toCommonJS", "React", "import_radix_ui", "import_icon_button", "pressed", "onPressedChange", "defaultPressed", "iconButtonProps", "forwardedRef"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { IconButton } from './icon-button.js';\nimport { BaseButton } from './_internal/base-button.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ToggleIconButtonElement = React.ElementRef<typeof BaseButton>;\n\n// Extract toggle-specific props from Radix Toggle\ntype ToggleProps = React.ComponentPropsWithoutRef<typeof Toggle.Root>;\n\n// Required accessibility props for icon buttons (same as IconButton)\ntype AccessibilityProps =\n | { 'aria-label': string; 'aria-labelledby'?: never }\n | { 'aria-label'?: never; 'aria-labelledby': string }\n | { 'aria-label'?: never; 'aria-labelledby'?: never; children: React.ReactNode };\n\n// Combine BaseButton props with Toggle-specific props and accessibility requirements\ninterface ToggleIconButtonProps extends Omit<BaseButtonProps, 'as'> {\n pressed?: ToggleProps['pressed'];\n onPressedChange?: ToggleProps['onPressedChange'];\n defaultPressed?: ToggleProps['defaultPressed'];\n}\n\n// Intersection with accessibility props\ntype ToggleIconButtonPropsWithAccessibility = ToggleIconButtonProps & AccessibilityProps;\n\nconst ToggleIconButton = React.forwardRef<\n ToggleIconButtonElement,\n ToggleIconButtonPropsWithAccessibility\n>(({ pressed, onPressedChange, defaultPressed, ...iconButtonProps }, forwardedRef) => {\n return (\n <Toggle.Root\n pressed={pressed}\n onPressedChange={onPressedChange}\n defaultPressed={defaultPressed}\n asChild\n >\n <IconButton {...iconButtonProps} ref={forwardedRef} />\n </Toggle.Root>\n );\n});\nToggleIconButton.displayName = 'ToggleIconButton';\n\nexport { ToggleIconButton };\nexport type { ToggleIconButtonPropsWithAccessibility as ToggleIconButtonProps };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,oBACvBC,EAA2B,4BAC3BC,EAA2B,sCAwB3B,MAAML,EAAmBE,EAAM,WAG7B,CAAC,CAAE,QAAAI,EAAS,gBAAAC,EAAiB,eAAAC,EAAgB,GAAGC,CAAgB,EAAGC,IAEjER,EAAA,cAAC,SAAO,KAAP,CACC,QAASI,EACT,gBAAiBC,EACjB,eAAgBC,EAChB,QAAO,IAEPN,EAAA,cAAC,cAAY,GAAGO,EAAiB,IAAKC,EAAc,CACtD,CAEH,EACDV,EAAiB,YAAc",
|
|
6
|
+
"names": ["toggle_icon_button_exports", "__export", "ToggleIconButton", "__toCommonJS", "React", "import_radix_ui", "import_icon_button", "import_base_button", "pressed", "onPressedChange", "defaultPressed", "iconButtonProps", "forwardedRef"]
|
|
7
7
|
}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
interface ToggleIconButtonProps {
|
|
7
|
-
pressed?: boolean;
|
|
8
|
-
onPressedChange?: (pressed: boolean) => void;
|
|
9
|
-
defaultPressed?: boolean;
|
|
2
|
+
import { Toggle } from 'radix-ui';
|
|
3
|
+
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
4
|
+
type ToggleProps = React.ComponentPropsWithoutRef<typeof Toggle.Root>;
|
|
5
|
+
type AccessibilityProps = {
|
|
10
6
|
'aria-label': string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
'aria-labelledby'?: never;
|
|
8
|
+
} | {
|
|
9
|
+
'aria-label'?: never;
|
|
10
|
+
'aria-labelledby': string;
|
|
11
|
+
} | {
|
|
12
|
+
'aria-label'?: never;
|
|
13
|
+
'aria-labelledby'?: never;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
interface ToggleIconButtonProps extends Omit<BaseButtonProps, 'as'> {
|
|
17
|
+
pressed?: ToggleProps['pressed'];
|
|
18
|
+
onPressedChange?: ToggleProps['onPressedChange'];
|
|
19
|
+
defaultPressed?: ToggleProps['defaultPressed'];
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
type ToggleIconButtonPropsWithAccessibility = ToggleIconButtonProps & AccessibilityProps;
|
|
22
|
+
declare const ToggleIconButton: React.ForwardRefExoticComponent<ToggleIconButtonPropsWithAccessibility & React.RefAttributes<HTMLButtonElement>>;
|
|
22
23
|
export { ToggleIconButton };
|
|
23
|
-
export type { ToggleIconButtonProps };
|
|
24
|
+
export type { ToggleIconButtonPropsWithAccessibility as ToggleIconButtonProps };
|
|
24
25
|
//# sourceMappingURL=toggle-icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle-icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAKlE,KAAK,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AAGtE,KAAK,kBAAkB,GACnB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAAE,GACnD;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAGnF,UAAU,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC;IACjE,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;CAChD;AAGD,KAAK,sCAAsC,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAEzF,QAAA,MAAM,gBAAgB,kHAcpB,CAAC;AAGH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,sCAAsC,IAAI,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{Toggle as a}from"radix-ui";import{IconButton as g}from"./icon-button.js";import"./_internal/base-button.js";const o=e.forwardRef(({pressed:t,onPressedChange:s,defaultPressed:r,...n},l)=>e.createElement(a.Root,{pressed:t,onPressedChange:s,defaultPressed:r,asChild:!0},e.createElement(g,{...n,ref:l})));o.displayName="ToggleIconButton";export{o as ToggleIconButton};
|
|
2
2
|
//# sourceMappingURL=toggle-icon-button.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/toggle-icon-button.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { IconButton } from './icon-button.js';\nimport
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAS,UAAAC,MAAc,WACvB,OAAS,cAAAC,MAAkB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { IconButton } from './icon-button.js';\nimport { BaseButton } from './_internal/base-button.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ToggleIconButtonElement = React.ElementRef<typeof BaseButton>;\n\n// Extract toggle-specific props from Radix Toggle\ntype ToggleProps = React.ComponentPropsWithoutRef<typeof Toggle.Root>;\n\n// Required accessibility props for icon buttons (same as IconButton)\ntype AccessibilityProps =\n | { 'aria-label': string; 'aria-labelledby'?: never }\n | { 'aria-label'?: never; 'aria-labelledby': string }\n | { 'aria-label'?: never; 'aria-labelledby'?: never; children: React.ReactNode };\n\n// Combine BaseButton props with Toggle-specific props and accessibility requirements\ninterface ToggleIconButtonProps extends Omit<BaseButtonProps, 'as'> {\n pressed?: ToggleProps['pressed'];\n onPressedChange?: ToggleProps['onPressedChange'];\n defaultPressed?: ToggleProps['defaultPressed'];\n}\n\n// Intersection with accessibility props\ntype ToggleIconButtonPropsWithAccessibility = ToggleIconButtonProps & AccessibilityProps;\n\nconst ToggleIconButton = React.forwardRef<\n ToggleIconButtonElement,\n ToggleIconButtonPropsWithAccessibility\n>(({ pressed, onPressedChange, defaultPressed, ...iconButtonProps }, forwardedRef) => {\n return (\n <Toggle.Root\n pressed={pressed}\n onPressedChange={onPressedChange}\n defaultPressed={defaultPressed}\n asChild\n >\n <IconButton {...iconButtonProps} ref={forwardedRef} />\n </Toggle.Root>\n );\n});\nToggleIconButton.displayName = 'ToggleIconButton';\n\nexport { ToggleIconButton };\nexport type { ToggleIconButtonPropsWithAccessibility as ToggleIconButtonProps };\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAS,UAAAC,MAAc,WACvB,OAAS,cAAAC,MAAkB,mBAC3B,MAA2B,6BAwB3B,MAAMC,EAAmBH,EAAM,WAG7B,CAAC,CAAE,QAAAI,EAAS,gBAAAC,EAAiB,eAAAC,EAAgB,GAAGC,CAAgB,EAAGC,IAEjER,EAAA,cAACC,EAAO,KAAP,CACC,QAASG,EACT,gBAAiBC,EACjB,eAAgBC,EAChB,QAAO,IAEPN,EAAA,cAACE,EAAA,CAAY,GAAGK,EAAiB,IAAKC,EAAc,CACtD,CAEH,EACDL,EAAiB,YAAc",
|
|
6
6
|
"names": ["React", "Toggle", "IconButton", "ToggleIconButton", "pressed", "onPressedChange", "defaultPressed", "iconButtonProps", "forwardedRef"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,73 +1,46 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Toggle } from 'radix-ui';
|
|
3
3
|
import { IconButton } from './icon-button.js';
|
|
4
|
+
import { BaseButton } from './_internal/base-button.js';
|
|
4
5
|
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
type ButtonVariant = 'classic' | 'solid' | 'soft' | 'surface' | 'outline' | 'ghost';
|
|
8
|
-
type ButtonSize = '1' | '2' | '3' | '4';
|
|
9
|
-
type ButtonColor =
|
|
10
|
-
| 'gray'
|
|
11
|
-
| 'gold'
|
|
12
|
-
| 'bronze'
|
|
13
|
-
| 'brown'
|
|
14
|
-
| 'yellow'
|
|
15
|
-
| 'amber'
|
|
16
|
-
| 'orange'
|
|
17
|
-
| 'tomato'
|
|
18
|
-
| 'red'
|
|
19
|
-
| 'ruby'
|
|
20
|
-
| 'crimson'
|
|
21
|
-
| 'pink'
|
|
22
|
-
| 'plum'
|
|
23
|
-
| 'purple'
|
|
24
|
-
| 'violet'
|
|
25
|
-
| 'iris'
|
|
26
|
-
| 'indigo'
|
|
27
|
-
| 'blue'
|
|
28
|
-
| 'cyan'
|
|
29
|
-
| 'teal'
|
|
30
|
-
| 'jade'
|
|
31
|
-
| 'green'
|
|
32
|
-
| 'grass'
|
|
33
|
-
| 'lime'
|
|
34
|
-
| 'mint'
|
|
35
|
-
| 'sky';
|
|
36
|
-
type ButtonRadius = 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
7
|
+
type ToggleIconButtonElement = React.ElementRef<typeof BaseButton>;
|
|
37
8
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
9
|
+
// Extract toggle-specific props from Radix Toggle
|
|
10
|
+
type ToggleProps = React.ComponentPropsWithoutRef<typeof Toggle.Root>;
|
|
11
|
+
|
|
12
|
+
// Required accessibility props for icon buttons (same as IconButton)
|
|
13
|
+
type AccessibilityProps =
|
|
14
|
+
| { 'aria-label': string; 'aria-labelledby'?: never }
|
|
15
|
+
| { 'aria-label'?: never; 'aria-labelledby': string }
|
|
16
|
+
| { 'aria-label'?: never; 'aria-labelledby'?: never; children: React.ReactNode };
|
|
17
|
+
|
|
18
|
+
// Combine BaseButton props with Toggle-specific props and accessibility requirements
|
|
19
|
+
interface ToggleIconButtonProps extends Omit<BaseButtonProps, 'as'> {
|
|
20
|
+
pressed?: ToggleProps['pressed'];
|
|
21
|
+
onPressedChange?: ToggleProps['onPressedChange'];
|
|
22
|
+
defaultPressed?: ToggleProps['defaultPressed'];
|
|
52
23
|
}
|
|
53
24
|
|
|
54
|
-
|
|
25
|
+
// Intersection with accessibility props
|
|
26
|
+
type ToggleIconButtonPropsWithAccessibility = ToggleIconButtonProps & AccessibilityProps;
|
|
55
27
|
|
|
56
|
-
const ToggleIconButton = React.forwardRef<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
);
|
|
28
|
+
const ToggleIconButton = React.forwardRef<
|
|
29
|
+
ToggleIconButtonElement,
|
|
30
|
+
ToggleIconButtonPropsWithAccessibility
|
|
31
|
+
>(({ pressed, onPressedChange, defaultPressed, ...iconButtonProps }, forwardedRef) => {
|
|
32
|
+
return (
|
|
33
|
+
<Toggle.Root
|
|
34
|
+
pressed={pressed}
|
|
35
|
+
onPressedChange={onPressedChange}
|
|
36
|
+
defaultPressed={defaultPressed}
|
|
37
|
+
asChild
|
|
38
|
+
>
|
|
39
|
+
<IconButton {...iconButtonProps} ref={forwardedRef} />
|
|
40
|
+
</Toggle.Root>
|
|
41
|
+
);
|
|
42
|
+
});
|
|
70
43
|
ToggleIconButton.displayName = 'ToggleIconButton';
|
|
71
44
|
|
|
72
45
|
export { ToggleIconButton };
|
|
73
|
-
export type { ToggleIconButtonProps };
|
|
46
|
+
export type { ToggleIconButtonPropsWithAccessibility as ToggleIconButtonProps };
|