@radix-ui/react-toggle 1.1.8 → 1.1.9-rc.1746560904918
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.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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.
|
|
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 = React.forwardRef<ToggleElement, ToggleProps>((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\nToggle.displayName = NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = Toggle;\n\nexport {\n Toggle,\n //\n Root,\n};\nexport type { ToggleProps };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAAqC;AACrC,0CAAqC;AACrC,6BAA0B;AAsCtB;AAhCJ,IAAM,OAAO;AAqBb,IAAM,SAAe,iBAAuC,CAAC,OAAO,iBAAiB;AACnF,QAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,GAAG,YAAY,IAAI;AAElF,QAAM,CAAC,SAAS,UAAU,QAAI,0DAAqB;AAAA,IACjD,MAAM;AAAA,IACN,UAAU;AAAA,IACV,aAAa,kBAAkB;AAAA,IAC/B,QAAQ;AAAA,EACV,CAAC;AAED,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACC,MAAK;AAAA,MACL,gBAAc;AAAA,MACd,cAAY,UAAU,OAAO;AAAA,MAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,MACpC,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,aAAS,uCAAqB,MAAM,SAAS,MAAM;AACjD,YAAI,CAAC,MAAM,UAAU;AACnB,qBAAW,CAAC,OAAO;AAAA,QACrB;AAAA,MACF,CAAC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,OAAO,cAAc;AAIrB,IAAM,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
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.
|
|
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 = React.forwardRef<ToggleElement, ToggleProps>((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\nToggle.displayName = NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = Toggle;\n\nexport {\n Toggle,\n //\n Root,\n};\nexport type { ToggleProps };\n"],
|
|
5
5
|
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AAsCtB;AAhCJ,IAAM,OAAO;AAqBb,IAAM,SAAe,iBAAuC,CAAC,OAAO,iBAAiB;AACnF,QAAM,EAAE,SAAS,aAAa,gBAAgB,iBAAiB,GAAG,YAAY,IAAI;AAElF,QAAM,CAAC,SAAS,UAAU,IAAI,qBAAqB;AAAA,IACjD,MAAM;AAAA,IACN,UAAU;AAAA,IACV,aAAa,kBAAkB;AAAA,IAC/B,QAAQ;AAAA,EACV,CAAC;AAED,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACC,MAAK;AAAA,MACL,gBAAc;AAAA,MACd,cAAY,UAAU,OAAO;AAAA,MAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,MACpC,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,SAAS,qBAAqB,MAAM,SAAS,MAAM;AACjD,YAAI,CAAC,MAAM,UAAU;AACnB,qBAAW,CAAC,OAAO;AAAA,QACrB;AAAA,MACF,CAAC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,OAAO,cAAc;AAIrB,IAAM,OAAO;",
|
|
6
6
|
"names": []
|
|
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.9-rc.1746560904918",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@radix-ui/primitive": "1.1.2",
|
|
15
|
-
"@radix-ui/react-primitive": "2.1.
|
|
15
|
+
"@radix-ui/react-primitive": "2.1.3-rc.1746560904918",
|
|
16
16
|
"@radix-ui/react-use-controllable-state": "1.2.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|