@atom-learning/components 3.14.0 → 3.15.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.
@@ -0,0 +1,8 @@
1
+ import * as ToggleGroup from '@radix-ui/react-toggle-group';
2
+ import * as React from 'react';
3
+ declare type RootType = {
4
+ disableDeselect?: boolean;
5
+ };
6
+ declare type ToggleGroupRootProps = React.ComponentProps<typeof ToggleGroup.Root> & RootType;
7
+ export declare const ToggleGroupRoot: React.ForwardRefExoticComponent<ToggleGroupRootProps>;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import*as g from"@radix-ui/react-toggle-group";import*as l from"react";const m=l.forwardRef(({disableDeselect:a=!1,onValueChange:t,defaultValue:o,...r},n)=>{const[u,f]=l.useState(o),s=e=>{a&&(e===""||(e==null?void 0:e.length)===0)||(f(e),t==null||t(e))};return l.createElement(g.Root,{ref:n,onValueChange:s,value:u,...r})});export{m as ToggleGroupRoot};
2
+ //# sourceMappingURL=ToggleGroupRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleGroupRoot.js","sources":["../../../../src/utilities/radix-overrides/toggle-group/ToggleGroupRoot.tsx"],"sourcesContent":["import * as ToggleGroup from '@radix-ui/react-toggle-group'\nimport * as React from 'react'\n\ntype RootType = {\n disableDeselect?: boolean\n}\n\ntype ToggleGroupRootProps = React.ComponentProps<typeof ToggleGroup.Root> &\n RootType\n\nexport const ToggleGroupRoot: React.ForwardRefExoticComponent<ToggleGroupRootProps> =\n React.forwardRef(\n (\n { disableDeselect = false, onValueChange, defaultValue, ...rest },\n ref\n ) => {\n const [internalValue, setInternalValue] =\n React.useState<ToggleGroupRootProps['value']>(defaultValue)\n const handleValueChange: ToggleGroupRootProps['onValueChange'] = (\n newValue\n ) => {\n if (disableDeselect && (newValue === '' || newValue?.length === 0))\n return\n setInternalValue(newValue)\n onValueChange?.(newValue)\n }\n\n return (\n // eslint-disable-next-line\n // @ts-ignore Radix types complain on properties depending on whether `type=\"single\"` or `\"multiple\"`. Works correctly so muting.\n <ToggleGroup.Root\n ref={ref}\n onValueChange={handleValueChange}\n value={internalValue}\n {...rest}\n />\n )\n }\n )\n"],"names":["ToggleGroupRoot","React","disableDeselect","onValueChange","defaultValue","rest","ref","internalValue","setInternalValue","handleValueChange","newValue","ToggleGroup"],"mappings":"uEAUO,MAAMA,EACXC,EAAM,WACJ,CACE,CAAE,gBAAAC,EAAkB,GAAO,cAAAC,EAAe,aAAAC,KAAiBC,CAAK,EAChEC,IACG,CACH,KAAM,CAACC,EAAeC,CAAgB,EACpCP,EAAM,SAAwCG,CAAY,EACtDK,EACJC,GACG,CACCR,IAAoBQ,IAAa,KAAMA,GAAA,KAAAA,OAAAA,EAAU,UAAW,KAEhEF,EAAiBE,CAAQ,EACzBP,GAAA,MAAAA,EAAgBO,CAAAA,EAClB,EAEA,OAGET,EAAA,cAACU,EAAY,KAAZ,CACC,IAAKL,EACL,cAAeG,EACf,MAAOF,EACN,GAAGF,CAAAA,CACN,CAEJ,CACF"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const ToggleGroup: {
3
+ Root: import("react").ForwardRefExoticComponent<((import("@radix-ui/react-toggle-group").ToggleGroupSingleProps | import("@radix-ui/react-toggle-group").ToggleGroupMultipleProps) & import("react").RefAttributes<HTMLDivElement>) & {
4
+ disableDeselect?: boolean | undefined;
5
+ }>;
6
+ };
@@ -0,0 +1,2 @@
1
+ import{ToggleGroupRoot as o}from"./ToggleGroupRoot.js";const r={Root:o};export{r as ToggleGroup};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utilities/radix-overrides/toggle-group/index.ts"],"sourcesContent":["import { ToggleGroupRoot } from './ToggleGroupRoot'\n\nexport const ToggleGroup = {\n Root: ToggleGroupRoot\n}\n"],"names":["ToggleGroup","ToggleGroupRoot"],"mappings":"6DAEaA,EAAc,CACzB,KAAMC,CACR"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "dist/index.cjs.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "module": "dist/index.js",
7
- "version": "3.14.0",
7
+ "version": "3.15.0",
8
8
  "description": "",
9
9
  "files": [
10
10
  "dist"