@atom-learning/components 3.12.7 → 3.12.8

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/CHANGELOG.md CHANGED
@@ -1,9 +1,11 @@
1
- ## [3.12.7](https://github.com/Atom-Learning/components/compare/v3.12.6...v3.12.7) (2024-02-22)
1
+ ## [3.12.8](https://github.com/Atom-Learning/components/compare/v3.12.7...v3.12.8) (2024-03-04)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * make the children prop optional on the Stepper.StepForward component ([12253da](https://github.com/Atom-Learning/components/commit/12253da35404f813a0428268a9479fa86a100259))
6
+ * add stale githubaction ([f0868d3](https://github.com/Atom-Learning/components/commit/f0868d3ec97629b29c846bcb18db4b26f1eab62e))
7
+ * ensure isAllChecked is correctly calculated ([b1c6170](https://github.com/Atom-Learning/components/commit/b1c6170527c0bf41f7ee0153f8408cb3fe3eb555))
8
+ * snapshots ([b3b892e](https://github.com/Atom-Learning/components/commit/b3b892ed0274950100120dc11a7fcf8b803aa461))
7
9
 
8
10
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
9
11
 
@@ -1,2 +1,2 @@
1
- import*as t from"react";import{Checkbox as u}from"../checkbox/Checkbox.js";import{CheckboxGroupMountedContext as i}from"./context/CheckboxGroupMounted.context.js";import{CheckboxGroupCheckedContext as k}from"./context/CheckboxGroupChecked.context.js";const a=({onCheckedChange:n,title:r="all",...h})=>{const{checked:c,handleItemCheckedChange:C}=t.useContext(k),{mounted:o}=t.useContext(i),m=e=>{o.forEach(d=>{C(e,d)}),n==null||n(e)},l=(()=>o.every(e=>c.includes(e))?!0:o.some(e=>c.includes(e))?"indeterminate":!1)();return t.createElement(u,{onCheckedChange:m,checked:l,title:r,...h})};export{a as CheckboxGroupAllItem};
1
+ import*as n from"react";import{Checkbox as u}from"../checkbox/Checkbox.js";import{CheckboxGroupMountedContext as i}from"./context/CheckboxGroupMounted.context.js";import{CheckboxGroupCheckedContext as k}from"./context/CheckboxGroupChecked.context.js";const a=({onCheckedChange:r,title:c="all",...h})=>{const{checked:o,handleItemCheckedChange:m}=n.useContext(k),{mounted:t}=n.useContext(i),C=e=>{t.forEach(d=>{m(e,d)}),r==null||r(e)},l=(()=>!o.length||!t.length?!1:t.every(e=>o.includes(e))?!0:t.some(e=>o.includes(e))?"indeterminate":!1)();return n.createElement(u,{onCheckedChange:C,checked:l,title:c,...h})};export{a as CheckboxGroupAllItem};
2
2
  //# sourceMappingURL=CheckboxGroupAllItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxGroupAllItem.js","sources":["../../../src/components/checkbox-group/CheckboxGroupAllItem.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Checkbox } from '../checkbox'\nimport {\n CheckboxGroupCheckedContext,\n CheckboxGroupMountedContext\n} from './CheckboxGroup.context'\n\ntype CheckboxGroupAllItemProps = Omit<\n React.ComponentProps<typeof Checkbox>,\n 'checked' | 'defaultChecked'\n>\n\nexport const CheckboxGroupAllItem = ({\n onCheckedChange,\n title = 'all',\n ...rest\n}: CheckboxGroupAllItemProps): JSX.Element => {\n const {\n checked: checkedItems,\n handleItemCheckedChange: handleItemCheckedChangeContext\n } = React.useContext(CheckboxGroupCheckedContext)\n const { mounted: mountedItems } = React.useContext(\n CheckboxGroupMountedContext\n )\n\n const handleItemCheckedChange = (newChecked) => {\n mountedItems.forEach((value) => {\n handleItemCheckedChangeContext(newChecked, value)\n })\n onCheckedChange?.(newChecked)\n }\n\n const isAllChecked = (() => {\n if (mountedItems.every((mountedItem) => checkedItems.includes(mountedItem)))\n return true\n\n if (mountedItems.some((mountedItem) => checkedItems.includes(mountedItem)))\n return 'indeterminate'\n\n return false\n })()\n\n return (\n <Checkbox\n onCheckedChange={handleItemCheckedChange}\n checked={isAllChecked}\n title={title}\n {...rest}\n />\n )\n}\n"],"names":["CheckboxGroupAllItem","onCheckedChange","title","rest","checkedItems","handleItemCheckedChangeContext","React","CheckboxGroupCheckedContext","mountedItems","CheckboxGroupMountedContext","handleItemCheckedChange","newChecked","value","isAllChecked","mountedItem","Checkbox"],"mappings":"2PAaO,MAAMA,EAAuB,CAAC,CACnC,gBAAAC,EACA,MAAAC,EAAQ,SACLC,CACL,IAA8C,CAC5C,KAAM,CACJ,QAASC,EACT,wBAAyBC,CAC3B,EAAIC,EAAM,WAAWC,CAA2B,EAC1C,CAAE,QAASC,CAAa,EAAIF,EAAM,WACtCG,CACF,EAEMC,EAA2BC,GAAe,CAC9CH,EAAa,QAASI,GAAU,CAC9BP,EAA+BM,EAAYC,CAAK,CAClD,CAAC,EACDX,GAAA,MAAAA,EAAkBU,CAAAA,CACpB,EAEME,GAAgB,IAChBL,EAAa,MAAOM,GAAgBV,EAAa,SAASU,CAAW,CAAC,EACjE,GAELN,EAAa,KAAMM,GAAgBV,EAAa,SAASU,CAAW,CAAC,EAChE,gBAEF,MAGT,OACER,EAAA,cAACS,EAAA,CACC,gBAAiBL,EACjB,QAASG,EACT,MAAOX,EACN,GAAGC,CAAAA,CACN,CAEJ"}
1
+ {"version":3,"file":"CheckboxGroupAllItem.js","sources":["../../../src/components/checkbox-group/CheckboxGroupAllItem.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Checkbox } from '../checkbox'\nimport {\n CheckboxGroupCheckedContext,\n CheckboxGroupMountedContext\n} from './CheckboxGroup.context'\n\ntype CheckboxGroupAllItemProps = Omit<\n React.ComponentProps<typeof Checkbox>,\n 'checked' | 'defaultChecked'\n>\n\nexport const CheckboxGroupAllItem = ({\n onCheckedChange,\n title = 'all',\n ...rest\n}: CheckboxGroupAllItemProps): JSX.Element => {\n const {\n checked: checkedItems,\n handleItemCheckedChange: handleItemCheckedChangeContext\n } = React.useContext(CheckboxGroupCheckedContext)\n const { mounted: mountedItems } = React.useContext(\n CheckboxGroupMountedContext\n )\n\n const handleItemCheckedChange = (newChecked) => {\n mountedItems.forEach((value) => {\n handleItemCheckedChangeContext(newChecked, value)\n })\n onCheckedChange?.(newChecked)\n }\n\n const isAllChecked = (() => {\n if (!checkedItems.length || !mountedItems.length) return false\n\n if (mountedItems.every((mountedItem) => checkedItems.includes(mountedItem)))\n return true\n\n if (mountedItems.some((mountedItem) => checkedItems.includes(mountedItem)))\n return 'indeterminate'\n\n return false\n })()\n\n return (\n <Checkbox\n onCheckedChange={handleItemCheckedChange}\n checked={isAllChecked}\n title={title}\n {...rest}\n />\n )\n}\n"],"names":["CheckboxGroupAllItem","onCheckedChange","title","rest","checkedItems","handleItemCheckedChangeContext","React","CheckboxGroupCheckedContext","mountedItems","CheckboxGroupMountedContext","handleItemCheckedChange","newChecked","value","isAllChecked","mountedItem","Checkbox"],"mappings":"2PAaa,MAAAA,EAAuB,CAAC,CACnC,gBAAAC,EACA,MAAAC,EAAQ,SACLC,CACL,IAA8C,CAC5C,KAAM,CACJ,QAASC,EACT,wBAAyBC,CAC3B,EAAIC,EAAM,WAAWC,CAA2B,EAC1C,CAAE,QAASC,CAAa,EAAIF,EAAM,WACtCG,CACF,EAEMC,EAA2BC,GAAe,CAC9CH,EAAa,QAASI,GAAU,CAC9BP,EAA+BM,EAAYC,CAAK,CAClD,CAAC,EACDX,GAAA,MAAAA,EAAkBU,CAAAA,CACpB,EAEME,GAAgB,IAChB,CAACT,EAAa,QAAU,CAACI,EAAa,OAAe,GAErDA,EAAa,MAAOM,GAAgBV,EAAa,SAASU,CAAW,CAAC,EACjE,GAELN,EAAa,KAAMM,GAAgBV,EAAa,SAASU,CAAW,CAAC,EAChE,gBAEF,IAAA,EAGT,OACER,EAAA,cAACS,EAAA,CACC,gBAAiBL,EACjB,QAASG,EACT,MAAOX,EACN,GAAGC,CAAAA,CACN,CAEJ"}