@charcoal-ui/react 5.4.4 → 5.5.0-beta.1

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use client";import{SSRProvider as e}from"@react-aria/ssr";import*as t from"react";import n,{Children as r,Fragment as i,createContext as a,forwardRef as o,isValidElement as s,memo as c,useCallback as l,useContext as u,useEffect as d,useImperativeHandle as f,useMemo as p,useRef as m,useState as h,version as g}from"react";import{DismissButton as _,Overlay as v,OverlayProvider as y,ariaHideOutside as b,useOverlay as x,useOverlayFocusContain as S,usePopover as C}from"@react-aria/overlays";import{jsx as w,jsxs as T}from"react/jsx-runtime";import E from"warning";import"@charcoal-ui/icons";import{mergeRefs as D,useId as O,useObjectRef as k}from"@react-aria/utils";import{useVisuallyHidden as A}from"@react-aria/visually-hidden";import{animated as j,easings as M,useTransition as N}from"react-spring";import{useDialog as P}from"@react-aria/dialog";import{useRadioGroupState as F}from"@react-stately/radio";import{useRadio as I,useRadioGroup as L}from"@react-aria/radio";import{c as R}from"react-compiler-runtime";function ee(e){let t=parseInt(g.split(`.`)[0],10);return Number.isFinite(t)?t>=e:!1}const z=ee(18)?i:e;function te({children:e}){return w(z,{children:w(y,{children:e})})}const B=`charcoal-theme`,V=`theme`,ne=new RegExp(/^(\w|-)+$/);function H(e){if(!ne.test(e))throw Error(`Unexpected key :${e}, expect: /^(\\w|-)+$/`)}const re=(e=V)=>t=>{H(e),t===void 0?delete document.documentElement.dataset[e]:document.documentElement.dataset[e]=t};function ie(e,t){return`:root[data-${t??V}='${e}']`}function ae(e){return`@media (prefers-color-scheme: ${e})`}function oe({key:e=B,setter:t=re()}={}){let[n,,r]=ce(e);d(()=>{n!==void 0&&t(r?void 0:n)},[t,r,n])}function se(e=B){return localStorage.getItem(e)}const ce=(e=B)=>{H(e);let t=fe(`(prefers-color-scheme: dark)`),n=t===void 0?void 0:t?`dark`:`light`,[r,i,a]=le(e);return[!a||n===void 0?void 0:r??n,i,r===void 0]};function le(e,t){let[n,r]=h(!1),[i,a]=h(),o=p(()=>t?.(),[t]);d(()=>(c(),window.addEventListener(`storage`,s),()=>{window.removeEventListener(`storage`,s)}));let s=t=>{t.storageArea===localStorage&&t.key===e&&c()},c=()=>{let t=localStorage.getItem(e);a((t===null?null:ue(t))??o),r(!0)};return[i??o,t=>{if(t===void 0)localStorage.removeItem(e);else{let n=de(t);localStorage.setItem(e,n)}let n=new StorageEvent(`storage`,{bubbles:!0,cancelable:!1,key:e,url:location.href,storageArea:localStorage});dispatchEvent(n)},n]}function ue(e){try{return JSON.parse(e)}catch{return e}}function de(e){return typeof e==`string`?e:JSON.stringify(e)}function fe(e){let[t,n]=h();return d(()=>{let t=window.matchMedia(e),r=()=>{n(t.matches)};return t.addEventListener(`change`,r),n(t.matches),()=>{t.removeEventListener(`change`,r)}},[e]),t}function pe({localStorageKey:e=U.localStorageKey,rootAttribute:t=U.rootAttribute}=U){return H(e),H(t),`'use strict';
1
+ "use client";import{SSRProvider as e}from"@react-aria/ssr";import*as t from"react";import n,{Children as r,Fragment as i,createContext as a,forwardRef as o,isValidElement as s,memo as c,useCallback as l,useContext as u,useEffect as d,useImperativeHandle as f,useMemo as p,useRef as m,useState as h,version as g}from"react";import{DismissButton as _,Overlay as v,OverlayProvider as y,ariaHideOutside as b,useOverlay as x,useOverlayFocusContain as S,usePopover as C}from"@react-aria/overlays";import{jsx as w,jsxs as T}from"react/jsx-runtime";import E from"warning";import"@charcoal-ui/icons";import{mergeRefs as D,useId as O,useObjectRef as k}from"@react-aria/utils";import{useVisuallyHidden as A}from"@react-aria/visually-hidden";import{animated as j,easings as M,useTransition as N}from"@react-spring/web";import{useDialog as P}from"@react-aria/dialog";import{useRadioGroupState as F}from"@react-stately/radio";import{useRadio as I,useRadioGroup as L}from"@react-aria/radio";import{c as R}from"react-compiler-runtime";function ee(e){let t=parseInt(g.split(`.`)[0],10);return Number.isFinite(t)?t>=e:!1}const z=ee(18)?i:e;function te({children:e}){return w(z,{children:w(y,{children:e})})}const B=`charcoal-theme`,V=`theme`,ne=new RegExp(/^(\w|-)+$/);function H(e){if(!ne.test(e))throw Error(`Unexpected key :${e}, expect: /^(\\w|-)+$/`)}const re=(e=V)=>t=>{H(e),t===void 0?delete document.documentElement.dataset[e]:document.documentElement.dataset[e]=t};function ie(e,t){return`:root[data-${t??V}='${e}']`}function ae(e){return`@media (prefers-color-scheme: ${e})`}function oe({key:e=B,setter:t=re()}={}){let[n,,r]=ce(e);d(()=>{n!==void 0&&t(r?void 0:n)},[t,r,n])}function se(e=B){return localStorage.getItem(e)}const ce=(e=B)=>{H(e);let t=fe(`(prefers-color-scheme: dark)`),n=t===void 0?void 0:t?`dark`:`light`,[r,i,a]=le(e);return[!a||n===void 0?void 0:r??n,i,r===void 0]};function le(e,t){let[n,r]=h(!1),[i,a]=h(),o=p(()=>t?.(),[t]);d(()=>(c(),window.addEventListener(`storage`,s),()=>{window.removeEventListener(`storage`,s)}));let s=t=>{t.storageArea===localStorage&&t.key===e&&c()},c=()=>{let t=localStorage.getItem(e);a((t===null?null:ue(t))??o),r(!0)};return[i??o,t=>{if(t===void 0)localStorage.removeItem(e);else{let n=de(t);localStorage.setItem(e,n)}let n=new StorageEvent(`storage`,{bubbles:!0,cancelable:!1,key:e,url:location.href,storageArea:localStorage});dispatchEvent(n)},n]}function ue(e){try{return JSON.parse(e)}catch{return e}}function de(e){return typeof e==`string`?e:JSON.stringify(e)}function fe(e){let[t,n]=h();return d(()=>{let t=window.matchMedia(e),r=()=>{n(t.matches)};return t.addEventListener(`change`,r),n(t.matches),()=>{t.removeEventListener(`change`,r)}},[e]),t}function pe({localStorageKey:e=U.localStorageKey,rootAttribute:t=U.rootAttribute}=U){return H(e),H(t),`'use strict';
2
2
  (function () {
3
3
  var localStorageKey = '${e}'
4
4
  var rootAttribute = '${t}'