@charcoal-ui/react 6.0.0-rc.2 → 6.0.0-rc.4
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/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +44 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layered.css +44 -1
- package/dist/layered.css.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/css-variables.test.ts +1 -1
- package/src/__tests__/fixtures/legacy-v1-index.css +1836 -0
- package/src/__tests__/token-v1-compat.test.ts +118 -0
- package/src/__tests__/token-v1-remap.test.ts +133 -0
- package/src/components/Icon/index.tsx +2 -1
- package/src/components/Modal/__snapshots__/index.css.snap +1 -1
- package/src/components/Modal/index.css +1 -1
package/dist/index.css
CHANGED
|
@@ -421,6 +421,49 @@
|
|
|
421
421
|
grid-template-columns: 1fr;
|
|
422
422
|
grid-gap: 8px;
|
|
423
423
|
}
|
|
424
|
+
.charcoal-icon {
|
|
425
|
+
display: inline-flex;
|
|
426
|
+
width: var(--charcoal-icon-size);
|
|
427
|
+
height: var(--charcoal-icon-size);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
pixiv-icon:not(:defined) {
|
|
431
|
+
--pixiv-icon-base: 24px;
|
|
432
|
+
--pixiv-icon-scale: 1;
|
|
433
|
+
--pixiv-icon-size: calc(var(--pixiv-icon-base) * var(--pixiv-icon-scale));
|
|
434
|
+
|
|
435
|
+
display: inline-flex;
|
|
436
|
+
/* --charcoal-icon-size がセットされていればそれを優先、
|
|
437
|
+
なければ name / scale から導出した --pixiv-icon-size をフォールバック */
|
|
438
|
+
width: var(--charcoal-icon-size, var(--pixiv-icon-size));
|
|
439
|
+
height: var(--charcoal-icon-size, var(--pixiv-icon-size));
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
pixiv-icon:not(:defined)[name^='16/'] {
|
|
443
|
+
--pixiv-icon-base: 16px;
|
|
444
|
+
--pixiv-icon-size: 16px;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
pixiv-icon:not(:defined)[name^='24/'][scale='2'] {
|
|
448
|
+
--pixiv-icon-scale: 2;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
pixiv-icon:not(:defined)[name^='24/'][scale='3'] {
|
|
452
|
+
--pixiv-icon-scale: 3;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
pixiv-icon:not(:defined)[name^='32/'] {
|
|
456
|
+
--pixiv-icon-base: 32px;
|
|
457
|
+
--pixiv-icon-size: 32px;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
pixiv-icon:not(:defined)[name^='Inline/'] {
|
|
461
|
+
--pixiv-icon-base: 16px;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
pixiv-icon:not(:defined)[name^='Inline/'][scale='2'] {
|
|
465
|
+
--pixiv-icon-scale: 2;
|
|
466
|
+
}
|
|
424
467
|
.charcoal-multi-select {
|
|
425
468
|
display: grid;
|
|
426
469
|
grid-template-columns: auto 1fr;
|
|
@@ -956,7 +999,7 @@
|
|
|
956
999
|
padding: 40px 0;
|
|
957
1000
|
box-sizing: border-box;
|
|
958
1001
|
|
|
959
|
-
background-color: var(--charcoal-color-
|
|
1002
|
+
background-color: var(--charcoal-color-background-overlay);
|
|
960
1003
|
}
|
|
961
1004
|
|
|
962
1005
|
@media (max-width: 743px) {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import*as e from"react";import t,{Children as n,Fragment as r,createContext as i,forwardRef as a,isValidElement as o,memo as s,useCallback as c,useContext as l,useDebugValue as u,useEffect as d,useImperativeHandle as f,useLayoutEffect as p,useMemo as m,useRef as h,useState as g,useSyncExternalStore as _,version as v}from"react";import{SSRProvider as y}from"react-aria/SSRProvider";import{OverlayProvider as b}from"react-aria/private/overlays/useModal";import{jsx as x,jsxs as S}from"react/jsx-runtime";import C from"warning";import{calcActualSize as w}from"@charcoal-ui/icons";import
|
|
2
|
+
import*as e from"react";import t,{Children as n,Fragment as r,createContext as i,forwardRef as a,isValidElement as o,memo as s,useCallback as c,useContext as l,useDebugValue as u,useEffect as d,useImperativeHandle as f,useLayoutEffect as p,useMemo as m,useRef as h,useState as g,useSyncExternalStore as _,version as v}from"react";import{SSRProvider as y}from"react-aria/SSRProvider";import{OverlayProvider as b}from"react-aria/private/overlays/useModal";import{jsx as x,jsxs as S}from"react/jsx-runtime";import C from"warning";import{calcActualSize as w}from"@charcoal-ui/icons";import{useId as T}from"react-aria/useId";import{useVisuallyHidden as E}from"react-aria/VisuallyHidden";import{animated as D,easings as O,useTransition as k}from"@react-spring/web";import{useDialog as A}from"react-aria/useDialog";import{ariaHideOutside as j}from"react-aria/private/overlays/ariaHideOutside";import{useOverlayFocusContain as M}from"react-aria/private/overlays/Overlay";import{useOverlay as N}from"react-aria/useOverlay";import{DismissButton as P,Overlay as F}from"react-aria/Overlay";import{useObjectRef as I}from"react-aria/useObjectRef";import{usePopover as L}from"react-aria/usePopover";import{useRadio as R,useRadioGroup as ee}from"react-aria/useRadioGroup";import{useRadioGroupState as z}from"react-stately/useRadioGroupState";import{mergeProps as te,useFocusRing as ne,useKeyboard as B,useLink as V}from"react-aria";import{c as H}from"react-compiler-runtime";function U(e){let t=parseInt(v.split(`.`)[0],10);return Number.isFinite(t)?t>=e:!1}const W=U(18)?r:y;function re({children:e}){return x(W,{children:x(b,{children:e})})}const G=`charcoal-theme`,ie=`theme`,ae=new RegExp(/^(\w|-)+$/);function K(e){if(!ae.test(e))throw Error(`Unexpected key :${e}, expect: /^(\\w|-)+$/`)}const oe=(e=ie)=>t=>{K(e),t===void 0?delete document.documentElement.dataset[e]:document.documentElement.dataset[e]=t},se=oe();function ce(e,t){return`:root[data-${t??`theme`}='${e}']`}function le(e){return`@media (prefers-color-scheme: ${e})`}function ue({key:e=G,setter:t=se}={}){let[n,,r]=fe(e);d(()=>{n!==void 0&&t(r?void 0:n)},[t,r,n])}function de(e=G){return localStorage.getItem(e)}const fe=(e=G)=>{K(e);let t=ge(`(prefers-color-scheme: dark)`),n=t===void 0?void 0:t?`dark`:`light`,[r,i,a]=pe(e);return[!a||n===void 0?void 0:r??n,i,r===void 0]};function pe(e,t){let[n,r]=g(!1),[i,a]=g(),o=m(()=>t?.(),[t]),s=c(()=>{let t=localStorage.getItem(e);a((t===null?null:me(t))??o),r(!0)},[o,e]),l=c(t=>{t.storageArea===localStorage&&t.key===e&&s()},[s,e]);return d(()=>(s(),window.addEventListener(`storage`,l),()=>{window.removeEventListener(`storage`,l)}),[s,l]),[i??o,t=>{if(t===void 0)localStorage.removeItem(e);else{let n=he(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 me(e){try{return JSON.parse(e)}catch{return e}}function he(e){return typeof e==`string`?e:JSON.stringify(e)}function ge(e){let[t,n]=g();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 _e({localStorageKey:e=q.localStorageKey,rootAttribute:t=q.rootAttribute}=q){return K(e),K(t),`'use strict';
|
|
3
3
|
(function () {
|
|
4
4
|
var localStorageKey = '${e}'
|
|
5
5
|
var rootAttribute = '${t}'
|