@radix-ui/react-toggle 1.1.17 → 1.1.18
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +2 -2
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -19,5 +19,6 @@ interface ToggleProps extends PrimitiveButtonProps {
|
|
|
19
19
|
onPressedChange?(pressed: boolean): void;
|
|
20
20
|
}
|
|
21
21
|
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
declare const Root: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
23
|
|
|
23
|
-
export {
|
|
24
|
+
export { Root, Toggle, type ToggleProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ interface ToggleProps extends PrimitiveButtonProps {
|
|
|
19
19
|
onPressedChange?(pressed: boolean): void;
|
|
20
20
|
}
|
|
21
21
|
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
declare const Root: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
23
|
|
|
23
|
-
export {
|
|
24
|
+
export { Root, Toggle, type ToggleProps };
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
32
|
// src/index.ts
|
|
33
33
|
var index_exports = {};
|
|
34
34
|
__export(index_exports, {
|
|
35
|
-
Root: () =>
|
|
35
|
+
Root: () => Root,
|
|
36
36
|
Toggle: () => Toggle
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -71,4 +71,5 @@ var Toggle = /* @__PURE__ */ React.forwardRef(
|
|
|
71
71
|
);
|
|
72
72
|
}, "Toggle")
|
|
73
73
|
);
|
|
74
|
+
var Root = Toggle;
|
|
74
75
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/toggle.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\nexport {\n Toggle,\n //\n Root,\n} from './toggle';\nexport type { ToggleProps } from './toggle';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Toggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Toggle';\n\ntype ToggleElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface ToggleProps extends PrimitiveButtonProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?(pressed: boolean): void;\n}\n\nconst Toggle = /* @__PURE__ */ React.forwardRef<ToggleElement, ToggleProps>(\n function Toggle(props, forwardedRef) {\n const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;\n\n const [pressed, setPressed] = useControllableState({\n prop: pressedProp,\n onChange: onPressedChange,\n defaultProp: defaultPressed ?? false,\n caller: NAME,\n });\n\n return (\n <Primitive.button\n type=\"button\"\n aria-pressed={pressed}\n data-state={pressed ? 'on' : 'off'}\n data-disabled={props.disabled ? '' : undefined}\n {...buttonProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => {\n if (!props.disabled) {\n setPressed(!pressed);\n }\n })}\n />\n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n Toggle,\n //\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,0CAAqC;AACrC,6BAA0B;AAuCpB;AAjCN,IAAM,OAAO;AAqBb,IAAM,SAAyB,gBAAM;AAAA,EACnC,gCAASA,QAAO,OAAO,cAAc;AACnC,UAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,GAAG,YAAY,IAAI;AAElF,UAAM,CAAC,SAAS,UAAU,QAAI,0DAAqB;AAAA,MACjD,MAAM;AAAA,MACN,UAAU;AAAA,MACV,aAAa,kBAAkB;AAAA,MAC/B,QAAQ;AAAA,IACV,CAAC;AAED,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACL,gBAAc;AAAA,QACd,cAAY,UAAU,OAAO;AAAA,QAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,QACpC,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,uCAAqB,MAAM,SAAS,MAAM;AACjD,cAAI,CAAC,MAAM,UAAU;AACnB,uBAAW,CAAC,OAAO;AAAA,UACrB;AAAA,QACF,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ,GAzBA;AA0BF;",
|
|
4
|
+
"sourcesContent": ["'use client';\nexport {\n Toggle,\n //\n Root,\n} from './toggle';\nexport type { ToggleProps } from './toggle';\n", "import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Toggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Toggle';\n\ntype ToggleElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface ToggleProps extends PrimitiveButtonProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?(pressed: boolean): void;\n}\n\nconst Toggle = /* @__PURE__ */ React.forwardRef<ToggleElement, ToggleProps>(\n function Toggle(props, forwardedRef) {\n const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;\n\n const [pressed, setPressed] = useControllableState({\n prop: pressedProp,\n onChange: onPressedChange,\n defaultProp: defaultPressed ?? false,\n caller: NAME,\n });\n\n return (\n <Primitive.button\n type=\"button\"\n aria-pressed={pressed}\n data-state={pressed ? 'on' : 'off'}\n data-disabled={props.disabled ? '' : undefined}\n {...buttonProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => {\n if (!props.disabled) {\n setPressed(!pressed);\n }\n })}\n />\n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = Toggle;\n\nexport {\n Toggle,\n //\n Root,\n};\nexport type { ToggleProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,0CAAqC;AACrC,6BAA0B;AAuCpB;AAjCN,IAAM,OAAO;AAqBb,IAAM,SAAyB,gBAAM;AAAA,EACnC,gCAASA,QAAO,OAAO,cAAc;AACnC,UAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,GAAG,YAAY,IAAI;AAElF,UAAM,CAAC,SAAS,UAAU,QAAI,0DAAqB;AAAA,MACjD,MAAM;AAAA,MACN,UAAU;AAAA,MACV,aAAa,kBAAkB;AAAA,MAC/B,QAAQ;AAAA,IACV,CAAC;AAED,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACL,gBAAc;AAAA,QACd,cAAY,UAAU,OAAO;AAAA,QAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,QACpC,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,uCAAqB,MAAM,SAAS,MAAM;AACjD,cAAI,CAAC,MAAM,UAAU;AACnB,uBAAW,CAAC,OAAO;AAAA,UACrB;AAAA,QACF,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ,GAzBA;AA0BF;AAIA,IAAM,OAAO;",
|
|
6
6
|
"names": ["Toggle"]
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/toggle.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Toggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Toggle';\n\ntype ToggleElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface ToggleProps extends PrimitiveButtonProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?(pressed: boolean): void;\n}\n\nconst Toggle = /* @__PURE__ */ React.forwardRef<ToggleElement, ToggleProps>(\n function Toggle(props, forwardedRef) {\n const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;\n\n const [pressed, setPressed] = useControllableState({\n prop: pressedProp,\n onChange: onPressedChange,\n defaultProp: defaultPressed ?? false,\n caller: NAME,\n });\n\n return (\n <Primitive.button\n type=\"button\"\n aria-pressed={pressed}\n data-state={pressed ? 'on' : 'off'}\n data-disabled={props.disabled ? '' : undefined}\n {...buttonProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => {\n if (!props.disabled) {\n setPressed(!pressed);\n }\n })}\n />\n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n Toggle,\n //\n
|
|
5
|
-
"mappings": ";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AAuCpB;AAjCN,IAAM,OAAO;AAqBb,IAAM,SAAyB,gBAAM;AAAA,EACnC,gCAASA,QAAO,OAAO,cAAc;AACnC,UAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,GAAG,YAAY,IAAI;AAElF,UAAM,CAAC,SAAS,UAAU,IAAI,qBAAqB;AAAA,MACjD,MAAM;AAAA,MACN,UAAU;AAAA,MACV,aAAa,kBAAkB;AAAA,MAC/B,QAAQ;AAAA,IACV,CAAC;AAED,WACE;AAAA,MAAC,UAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACL,gBAAc;AAAA,QACd,cAAY,UAAU,OAAO;AAAA,QAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,QACpC,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,SAAS,qBAAqB,MAAM,SAAS,MAAM;AACjD,cAAI,CAAC,MAAM,UAAU;AACnB,uBAAW,CAAC,OAAO;AAAA,UACrB;AAAA,QACF,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ,GAzBA;AA0BF;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Toggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Toggle';\n\ntype ToggleElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface ToggleProps extends PrimitiveButtonProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?(pressed: boolean): void;\n}\n\nconst Toggle = /* @__PURE__ */ React.forwardRef<ToggleElement, ToggleProps>(\n function Toggle(props, forwardedRef) {\n const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;\n\n const [pressed, setPressed] = useControllableState({\n prop: pressedProp,\n onChange: onPressedChange,\n defaultProp: defaultPressed ?? false,\n caller: NAME,\n });\n\n return (\n <Primitive.button\n type=\"button\"\n aria-pressed={pressed}\n data-state={pressed ? 'on' : 'off'}\n data-disabled={props.disabled ? '' : undefined}\n {...buttonProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => {\n if (!props.disabled) {\n setPressed(!pressed);\n }\n })}\n />\n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = Toggle;\n\nexport {\n Toggle,\n //\n Root,\n};\nexport type { ToggleProps };\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AAuCpB;AAjCN,IAAM,OAAO;AAqBb,IAAM,SAAyB,gBAAM;AAAA,EACnC,gCAASA,QAAO,OAAO,cAAc;AACnC,UAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,GAAG,YAAY,IAAI;AAElF,UAAM,CAAC,SAAS,UAAU,IAAI,qBAAqB;AAAA,MACjD,MAAM;AAAA,MACN,UAAU;AAAA,MACV,aAAa,kBAAkB;AAAA,MAC/B,QAAQ;AAAA,IACV,CAAC;AAED,WACE;AAAA,MAAC,UAAU;AAAA,MAAV;AAAA,QACC,MAAK;AAAA,QACL,gBAAc;AAAA,QACd,cAAY,UAAU,OAAO;AAAA,QAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,QACpC,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,SAAS,qBAAqB,MAAM,SAAS,MAAM;AACjD,cAAI,CAAC,MAAM,UAAU;AACnB,uBAAW,CAAC,OAAO;AAAA,UACrB;AAAA,QACF,CAAC;AAAA;AAAA,IACH;AAAA,EAEJ,GAzBA;AA0BF;AAIA,IAAM,OAAO;",
|
|
6
6
|
"names": ["Toggle"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-toggle",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@radix-ui/primitive": "1.1.7",
|
|
15
|
-
"@radix-ui/react-
|
|
16
|
-
"@radix-ui/react-
|
|
15
|
+
"@radix-ui/react-primitive": "2.1.10",
|
|
16
|
+
"@radix-ui/react-use-controllable-state": "1.2.6"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/react": "^19.2.
|
|
20
|
-
"@types/react-dom": "^19.2.
|
|
21
|
-
"react": "^19.2.
|
|
22
|
-
"react-dom": "^19.2.
|
|
19
|
+
"@types/react": "^19.2.2",
|
|
20
|
+
"@types/react-dom": "^19.2.2",
|
|
21
|
+
"react": "^19.2.0",
|
|
22
|
+
"react-dom": "^19.2.0",
|
|
23
23
|
"typescript": "^5.9.3",
|
|
24
24
|
"@repo/builder": "0.0.0",
|
|
25
25
|
"@repo/typescript-config": "0.0.0"
|