plass-ui 1.5.0 → 1.6.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.
- package/CHANGELOG.md +60 -0
- package/README.md +27 -7
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +3 -0
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.js +1 -1
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +6 -0
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/blockquote/PlBlockquote.js +1 -1
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/color-picker/PlColorPicker.d.ts +19 -2
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +9 -3
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/date-picker/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/empty/PlEmpty.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +18 -2
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -1
- package/dist/components/highlight/PlHighlight.d.ts +10 -3
- package/dist/components/list/PlList.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +12 -4
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +9 -1
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/pie-chart/PlPieChart.js +1 -1
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.d.ts +8 -2
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +15 -5
- package/dist/components/text-field/PlTextField.js +1 -1
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.js +1 -1
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +3 -3
- package/dist/internal/animate.d.ts +0 -25
- package/dist/internal/animate.js +1 -1
- package/dist/internal/chart-frame.d.ts +2 -17
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +9 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/defaults.d.ts +14 -1
- package/dist/internal/glow.d.ts +15 -0
- package/dist/internal/glow.js +1 -1
- package/dist/internal/labels.d.ts +13 -0
- package/dist/internal/labels.js +1 -1
- package/dist/internal/notch.d.ts +83 -0
- package/dist/internal/notch.js +1 -0
- package/dist/internal/picker.d.ts +9 -3
- package/dist/internal/picker.js +1 -1
- package/dist/internal/styles.d.ts +21 -0
- package/dist/internal/styles.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/provider/PlassProvider.d.ts +4 -3
- package/dist/provider/PlassProvider.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +55 -4
- package/dist/tokens.css +55 -4
- package/dist/types.d.ts +55 -0
- package/package.json +1 -1
package/dist/internal/chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dateFormatter as t,numberFormatter as e}from"./format.js";export const plotHeights={xs:120,sm:160,md:220,lg:280,xl:360};export const sparklineHeights={xs:16,sm:20,md:28,lg:40,xl:56};export const lineWidths={xs:1.5,sm:1.75,md:2,lg:2.25,xl:2.5};export const markerRadii={xs:3,sm:3.5,md:4,lg:4.5,xl:5};export const chartFontSizes={xs:10,sm:11,md:12,lg:13,xl:14};export const barMaxThickness={xs:14,sm:18,md:24,lg:30,xl:36};export const barBandRatio={default:.62,compact:.82};export const markGap=2;export const barRadius=4;export const chartPalette=["var(--plass-chart-1)","var(--plass-chart-2)","var(--plass-chart-3)","var(--plass-chart-4)","var(--plass-chart-5)","var(--plass-chart-6)","var(--plass-chart-7)","var(--plass-chart-8)"];const n=new Set(["primary","secondary","success","warning","danger","info"]);export function resolveColor(t){return n.has(t)?`var(--plass-${t}-accent)`:t}export function seriesColor(t,e,n=chartPalette){return resolveColor(t?.color?t.color:n[e%n.length]??chartPalette[0])}export function dimmedByHover(t,e,n){return null!==t&&t!==e&&!0===n[t]}export function toValue(t){return null==t?{value:null}:"number"==typeof t?{value:Number.isFinite(t)?t:null}:(t=>"object"==typeof t&&null!==t)(t)?{value:null!==t.y&&Number.isFinite(t.y)?t.y:null,x:t.x,z:t.z,color:t.color?resolveColor(t.color):void 0,label:t.label}:{value:null}}export function toValues(t){return t.map(t=>t.data.map(toValue))}export function labelledPoints(t,e){if("none"===e)return()=>!1;if("all"===e)return()=>!0;if("last"===e){let e=-1;for(let n=t.length-1;n>=0;n--)if(null!==t[n].value){e=n;break}return t=>t===e}let n=1/0,r=-1/0;for(const e of t)null!==e.value&&(n=Math.min(n,e.value),r=Math.max(r,e.value));return e=>{const o=t[e].value;return null!==o&&(o===n||o===r)}}export function stackToFull(t,e){const n=toValues(t),r=[];for(const t of n)t.forEach((t,e)=>{r[e]=(r[e]??0)+Math.abs(t.value??0)});return t.map((t,o)=>({...t,data:n[o].map((t,n)=>{if(null===t.value)return null;const o=r[n];return{x:t.x,y:0===o?0:t.value/o*100,color:t.color,label:t.label??e(t.value)}})}))}export function toNumber(t){return t instanceof Date?Number.isFinite(t.getTime())?t.getTime():null:"number"==typeof t&&Number.isFinite(t)?t:null}export function pointX(t,e,n){return toNumber(t.x??n?.[e]??e)}export function categoriesAreDates(t,e){return(e?.some(t=>t instanceof Date)??!1)||t.some(t=>t.some(t=>t.x instanceof Date))}export function categoryExtent(t,e){let n=1/0,r=-1/0,o=!1;return t.forEach(t=>{t.forEach((t,a)=>{if(null===t.value)return;const i=pointX(t,a,e);null!==i&&(o=!0,n=Math.min(n,i),r=Math.max(r,i))})}),o?{min:n,max:r}:null}export function bubbleRadius(t,e,n,r){return e>0&&Number.isFinite(t)&&!(t<=0)?Math.max(r,Math.sqrt(Math.min(t,e)/e)*n):0===t?0:r}export function categoryCount(t){return t.reduce((t,e)=>Math.max(t,e.data.length),0)}export function categoryAt(t,e,n){if(e&&t<e.length)return e[t];for(const e of n){const n=e[t]?.x;if(void 0!==n)return n}return t}export function extentOf(t,e){let n=1/0,r=-1/0,o=!1;if(e){const e=t.reduce((t,e)=>Math.max(t,e.length),0);for(let a=0;a<e;a++){let e=0,i=0;for(const n of t){const t=n[a]?.value;null!=t&&(o=!0,t>=0?e+=t:i+=t)}n=Math.min(n,i),r=Math.max(r,e)}}else for(const e of t)for(const{value:t}of e)null!==t&&(o=!0,n=Math.min(n,t),r=Math.max(r,t));return o?{min:n,max:r}:null}function niceStep(t){const e=10**Math.floor(Math.log10(t)),n=t/e;return n<=1?e:n<=2?2*e:n<=5?5*e:10*e}export function valueScale(t,e={}){const{tickCount:n=5,includeZero:r=!0}=e;let o=e.min??(t?t.min:0),a=e.max??(t?t.max:1);if(r&&void 0===e.min&&(o=Math.min(o,0)),r&&void 0===e.max&&(a=Math.max(a,0)),a===o){const t=Math.abs(a)>0?.5*Math.abs(a):1,n=void 0===e.min,r=void 0===e.max;!n&&r||(o-=t),!r&&n||(a+=t)}const i=void 0!==e.min&&void 0!==e.max?function dividingStep(t,e){const n=10**Math.floor(Math.log10(t/Math.max(1,e)));let r=niceStep(t/Math.max(1,e)),o=1/0;for(const a of[.1,1,10])for(const i of[1,2,2.5,5]){const u=i*a*n,s=t/u,c=Math.round(s);if(c<1||Math.abs(s-c)>1e-9)continue;const l=Math.abs(c-e);l<o&&(o=l,r=u)}return r}(a-o,n):niceStep((a-o)/Math.max(1,n)),u=void 0!==e.min?o:Math.floor(o/i)*i,s=void 0!==e.max?a:Math.ceil(a/i)*i,c=s-u||1,l=[];for(let t=u;t<=s+1e-9*i;t+=i)l.push(Number(t.toFixed(12)));return{min:u,max:s,ticks:l,fraction:t=>(t-u)/c}}const r=1e3,o=6e4,a=36e5,i=24*a,u=[{unit:"second",count:1,size:r},{unit:"second",count:5,size:5e3},{unit:"second",count:15,size:15e3},{unit:"second",count:30,size:3e4},{unit:"minute",count:1,size:o},{unit:"minute",count:5,size:3e5},{unit:"minute",count:15,size:9e5},{unit:"minute",count:30,size:18e5},{unit:"hour",count:1,size:a},{unit:"hour",count:3,size:3*a},{unit:"hour",count:6,size:6*a},{unit:"hour",count:12,size:12*a},{unit:"day",count:1,size:i},{unit:"day",count:2,size:2*i},{unit:"week",count:1,size:7*i},{unit:"week",count:2,size:14*i},{unit:"month",count:1,size:30*i},{unit:"quarter",count:1,size:91*i},{unit:"month",count:6,size:182*i},{unit:"year",count:1,size:365*i}];function floorTime(t,e){const n=new Date(t);if("year"===e)return new Date(n.getFullYear(),0,1).getTime();if("quarter"===e)return new Date(n.getFullYear(),3*Math.floor(n.getMonth()/3),1).getTime();if("month"===e)return new Date(n.getFullYear(),n.getMonth(),1).getTime();if("week"===e){const t=new Date(n.getFullYear(),n.getMonth(),n.getDate());return t.setDate(t.getDate()-t.getDay()),t.getTime()}return"day"===e?new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime():"hour"===e?new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours()).getTime():"minute"===e?Math.floor(t/o)*o:Math.floor(t/r)*r}function addTime(t,e,n){const a=new Date(t);if("year"===e)a.setFullYear(a.getFullYear()+n);else if("quarter"===e)a.setMonth(a.getMonth()+3*n);else if("month"===e)a.setMonth(a.getMonth()+n);else if("week"===e)a.setDate(a.getDate()+7*n);else if("day"===e)a.setDate(a.getDate()+n);else{if("hour"!==e)return t+n*("minute"===e?o:r);a.setHours(a.getHours()+n)}return a.getTime()}const s={second:"minute",minute:"hour",hour:"day",day:"month",week:"week",month:"year",quarter:"year",year:"year"};export function timeScale(t,e={}){const{tickCount:n=6}=e;let r=e.min??t?.min??Date.parse("2000-01-01T00:00:00"),o=e.max??t?.max??r+i;o<=r&&(r-=i/2,o+=i/2);const a=o-r;let c=u[0],l=1/0;for(const t of u){const e=Math.abs(a/t.size-n);e<l&&(l=e,c=t)}const h=c.unit,m="year"===h?Math.max(1,Math.round(niceStep(a/n/(365*i)))):c.count,f=e.min??function alignTime(t,e,n){let r=floorTime(t,s[e]);if("year"===e&&n>1){const t=new Date(r).getFullYear();r=new Date(t-(t%n+n)%n,0,1).getTime()}for(let o=0;o<500;o++){const o=addTime(r,e,n);if(o>t)return r;r=o}return r}(r,h,m),$=[];let x=f;for(let t=0;t<500&&($.push(x),!(x>o));t++)x=addTime(x,h,m);const p=e.max??$[$.length-1],M=p-f||1;return{min:f,max:p,ticks:$.filter(t=>t>=f&&t<=p),unit:h,step:m,fraction:t=>(t-f)/M}}function timeParts(t,e,n=!1){if("second"===t||"minute"===t||"hour"===t){const r="second"===t?{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}:{hour:"2-digit",minute:"2-digit",hourCycle:"h23"};if(!n)return r;const o={month:"short",day:"numeric",...r};return e?{...o,year:"numeric"}:o}if("year"===t)return{year:"numeric"};const r="month"===t||"quarter"===t?{month:"short"}:{month:"short",day:"numeric"};return e?{...r,year:"numeric"}:r}export function timeNeedsDate(t,e){return!("second"!==e&&"minute"!==e&&"hour"!==e||t.length<2||floorTime(t[0],"day")===floorTime(t[t.length-1]-1,"day"))}export function formatTimeValue(e,n,r,o=!1){return t(r,timeParts(n,!0,o)).format(new Date(e))}export function formatTimeTicks(e,n,r){const o=new Set(e.map(t=>new Date(t).getFullYear())).size>1,a=timeNeedsDate(e,n);return e.map((e,i)=>t(r,timeParts(n,o||0===i,a)).format(new Date(e)))}export function tickStride(t,e,n){if(t<=1||e<=0)return 1;const r=Math.max(1,Math.floor(e/Math.max(1,n)));return Math.max(1,Math.ceil(t/r))}export function showsTick(t,e,n,r){return t%n===0||r&&t===e-1}export function fitsLast(t,e,n,r){const o=(t-1)%e;return o>0&&o*n>=r+8}export function textWidth(t,e){let n=0;for(const e of t)n+=/[ᄀ-ᇿ⺀-가-豈-︰-﹏]/.test(e)?1:.6;return n*e}export function truncate(t,e,n){if(e<=0||textWidth(t,n)<=e)return t;const r=e-textWidth("…",n);let o="",a=0;for(const e of t){const t=a+textWidth(e,n);if(t>r)break;a=t,o+=e}return o.length>0?`${o.trimEnd()}…`:"…"}export function fitCategoryLabels(t,e){const{horizontal:n,slot:r,fontSize:o,ticks:a}=e;return a||!n&&r-6<2.4*o?t:t.map(t=>truncate(t,n?150:r-6,o))}export function bandScale(t,e,n){const r=t>0?e/t:e;return{step:r,band:r*n,centre:t=>r*(t+.5)}}export function linePath(t,e){const n=[];let r=[];const flush=()=>{if(0!==r.length){if(1===r.length)n.push(`M${r[0].x} ${r[0].y}h0`);else if("step"===e){n.push(`M${r[0].x} ${r[0].y}`);for(let t=1;t<r.length;t++){const e=(r[t-1].x+r[t].x)/2;n.push(`H${e}V${r[t].y}H${r[t].x}`)}}else if("smooth"===e)n.push(`M${r[0].x} ${r[0].y}`),n.push(function monotonePath(t){const e=t.length,n=[];for(let r=0;r<e-1;r++){const e=t[r+1].x-t[r].x;n.push(0===e?0:(t[r+1].y-t[r].y)/e)}const r=[n[0]??0];for(let t=1;t<e-1;t++){const e=n[t-1],o=n[t];r.push(e*o<=0?0:2*e*o/(e+o))}r.push(n[e-2]??0);const o=[];for(let n=0;n<e-1;n++){const e=(t[n+1].x-t[n].x)/3;o.push(`C${t[n].x+e} ${t[n].y+r[n]*e} ${t[n+1].x-e} ${t[n+1].y-r[n+1]*e} ${t[n+1].x} ${t[n+1].y}`)}return o.join("")}(r));else{n.push(`M${r[0].x} ${r[0].y}`);for(let t=1;t<r.length;t++)n.push(`L${r[t].x} ${r[t].y}`)}r=[]}};for(const e of t)null===e?flush():r.push(e);return flush(),n.join("")}export function areaPath(t,e,n){const r=[];let o=0;const flush=a=>{const i=t.slice(o,a).filter(Boolean);if(0===i.length)return;const u="number"==typeof e?i.map(t=>({x:t.x,y:e})).reverse():e.slice(o,a).filter(Boolean).reverse();if(0===u.length)return;const s=linePath(i,n),c=linePath(u,n).replace(/^M/,"L");r.push(`${s}${c}Z`)};for(let e=0;e<t.length;e++)null===t[e]&&(flush(e),o=e+1);return flush(t.length),r.join("")}export function barPath(t,e,n,r,o,a){const i=Math.max(0,Math.min(o,n/2,r/2));if(0===i||n<=0||r<=0)return`M${t} ${e}h${n}v${r}h${-n}Z`;const arc=(t,e)=>`a${i} ${i} 0 0 1 ${t} ${e}`;return"up"===a?`M${t} ${e+r}V${e+i}${arc(i,-i)}H${t+n-i}${arc(i,i)}V${e+r}Z`:"down"===a?`M${t} ${e}H${t+n}V${e+r-i}${arc(-i,i)}H${t+i}${arc(-i,-i)}Z`:"right"===a?`M${t} ${e}H${t+n-i}${arc(i,i)}V${e+r-i}${arc(-i,i)}H${t}Z`:`M${t+n} ${e+r}H${t+i}${arc(-i,-i)}V${e+i}${arc(i,-i)}H${t+n}Z`}export const markShapes=["circle","square","triangle","diamond","cross"];const c={circle:1,square:.8862,triangle:1.5551,diamond:1.2533,cross:1.189};export function markPath(t,e,n,r){const o=Math.max(0,r)*c[t];if(0===o)return"";if("circle"===t)return`M${e-o} ${n}a${o} ${o} 0 1 0 ${2*o} 0a${o} ${o} 0 1 0 ${2*-o} 0Z`;if("square"===t)return`M${e-o} ${n-o}h${2*o}v${2*o}h${2*-o}Z`;if("diamond"===t)return`M${e} ${n-o}L${e+o} ${n}L${e} ${n+o}L${e-o} ${n}Z`;if("triangle"===t)return`M${[0,120,240].map(t=>{const r=(t-90)*Math.PI/180;return`${e+o*Math.cos(r)} ${n+o*Math.sin(r)}`}).join("L")}Z`;const a=o/3;return`M${e-a} ${n-o}h${2*a}v${o-a}h${o-a}v${2*a}h${-(o-a)}v${o-a}h${2*-a}v${-(o-a)}h${-(o-a)}v${2*-a}h${o-a}Z`}export function ringPath(t,e,n,r,o){const point=r=>{const o=(r-90)*Math.PI/180;return`${t+n*Math.cos(o)} ${e+n*Math.sin(o)}`};if(Math.abs(o-r)>=360){const t=r+180;return`M${point(r)}A${n} ${n} 0 1 1 ${point(t)}A${n} ${n} 0 1 1 ${point(r)}`}const a=Math.abs(o-r)>180?1:0;return`M${point(r)}A${n} ${n} 0 ${a} 1 ${point(o)}`}export function arcPath(t,e,n,r,o,a){const point=(n,r)=>{const o=(r-90)*Math.PI/180;return`${t+n*Math.cos(o)} ${e+n*Math.sin(o)}`};if(Math.abs(a-o)>=360){const t=o+180;return r>0?`M${point(n,o)}A${n} ${n} 0 1 1 ${point(n,t)}A${n} ${n} 0 1 1 ${point(n,o)}ZM${point(r,o)}A${r} ${r} 0 1 0 ${point(r,t)}A${r} ${r} 0 1 0 ${point(r,o)}Z`:`M${point(n,o)}A${n} ${n} 0 1 1 ${point(n,t)}A${n} ${n} 0 1 1 ${point(n,o)}Z`}const i=Math.abs(a-o)>180?1:0;return r<=0?`M${t} ${e}L${point(n,o)}A${n} ${n} 0 ${i} 1 ${point(n,a)}Z`:`M${point(n,o)}A${n} ${n} 0 ${i} 1 ${point(n,a)}L${point(r,a)}A${r} ${r} 0 ${i} 0 ${point(r,o)}Z`}export const rampSteps=5;export function rampStep(t,e,n,r,o=0){if("diverging"===r){const r=Math.max(Math.abs(n-o),Math.abs(o-e));if(!(r>0))return 2;const a=(t-o)/r;return Math.min(4,Math.max(0,2+Math.round(2*a)))}const a=n-e;return a>0?Math.min(4,Math.max(0,Math.floor((t-e)/a*5))):4}export function rampFill(t,e){return`var(--plass-chart-${"diverging"===e?"div":"seq"}-${t+1})`}export function rampInk(t,e){return`var(--plass-chart-${"diverging"===e?"div":"seq"}-on-${t+1})`}export function squarify(t,e,n){const r=t.reduce((t,e)=>t+Math.max(0,e),0);if(!(r>0)||e<=0||n<=0)return[];const o=e*n/r,a=t.map((t,e)=>({index:e,area:Math.max(0,t)*o})).filter(t=>t.area>0).sort((t,e)=>e.area-t.area),i=[];let u=0,s=0,c=e,l=n,h=[];const worst=t=>{const e=Math.min(c,l),n=t.reduce((t,e)=>t+e.area,0);if(!(n>0&&e>0))return 1/0;const r=t[0].area,o=t[t.length-1].area;return Math.max(e*e*r/(n*n),n*n/(e*e*o))},place=()=>{const t=h.reduce((t,e)=>t+e.area,0),e=Math.min(c,l),n=e>0?t/e:0,r=c>=l;let o=0;for(const t of h){const e=n>0?t.area/n:0;i.push(r?{index:t.index,x:u,y:s+o,width:n,height:e}:{index:t.index,x:u+o,y:s,width:e,height:n}),o+=e}r?(u+=n,c-=n):(s+=n,l-=n),h=[]};for(const t of a)0===h.length||worst([...h,t])<=worst(h)||place(),h.push(t);return h.length>0&&place(),i}const l={month:"short",day:"numeric"},h={notation:"compact",maximumFractionDigits:1},m={maximumFractionDigits:2};export function formatCategory(e,n){return e instanceof Date?t(n,l).format(e):String(e)}export function compactNumber(t,n){return Math.abs(t)>=1e4?e(n,h).format(t):e(n,m).format(t)}export function writeChartValue(t,n,r){return n?e(r,n).format(t):compactNumber(t,r)}
|
|
1
|
+
import{dateFormatter as t,numberFormatter as e}from"./format.js";export const plotHeights={xs:120,sm:160,md:220,lg:280,xl:360};export const sparklineHeights={xs:16,sm:20,md:28,lg:40,xl:56};export const lineWidths={xs:1.5,sm:1.75,md:2,lg:2.25,xl:2.5};export const lineDash="6 4";export const markerRadii={xs:3,sm:3.5,md:4,lg:4.5,xl:5};export const chartFontSizes={xs:10,sm:11,md:12,lg:13,xl:14};export const barMaxThickness={xs:14,sm:18,md:24,lg:30,xl:36};export const barBandRatio={default:.62,compact:.82};export const markGap=2;export const barRadius=4;export const chartPalette=["var(--plass-chart-1)","var(--plass-chart-2)","var(--plass-chart-3)","var(--plass-chart-4)","var(--plass-chart-5)","var(--plass-chart-6)","var(--plass-chart-7)","var(--plass-chart-8)"];const n=new Set(["primary","secondary","success","warning","danger","info"]);export function resolveColor(t){return n.has(t)?`var(--plass-${t}-accent)`:t}export function seriesColor(t,e,n=chartPalette){return resolveColor(t?.color?t.color:n[e%n.length]??chartPalette[0])}export function dimmedByHover(t,e,n){return null!==t&&t!==e&&!0===n[t]}export function toValue(t){return null==t?{value:null}:"number"==typeof t?{value:Number.isFinite(t)?t:null}:(t=>"object"==typeof t&&null!==t)(t)?{value:null!==t.y&&Number.isFinite(t.y)?t.y:null,x:t.x,z:t.z,color:t.color?resolveColor(t.color):void 0,label:t.label}:{value:null}}export function toValues(t){return t.map(t=>t.data.map(toValue))}export function labelledPoints(t,e){if("none"===e)return()=>!1;if("all"===e)return()=>!0;if("last"===e){let e=-1;for(let n=t.length-1;n>=0;n--)if(null!==t[n].value){e=n;break}return t=>t===e}let n=1/0,r=-1/0;for(const e of t)null!==e.value&&(n=Math.min(n,e.value),r=Math.max(r,e.value));return e=>{const o=t[e].value;return null!==o&&(o===n||o===r)}}export function stackToFull(t,e){const n=toValues(t),r=[];for(const t of n)t.forEach((t,e)=>{r[e]=(r[e]??0)+Math.abs(t.value??0)});return t.map((t,o)=>({...t,data:n[o].map((t,n)=>{if(null===t.value)return null;const o=r[n];return{x:t.x,y:0===o?0:t.value/o*100,color:t.color,label:t.label??e(t.value)}})}))}export function toNumber(t){return t instanceof Date?Number.isFinite(t.getTime())?t.getTime():null:"number"==typeof t&&Number.isFinite(t)?t:null}export function pointX(t,e,n){return toNumber(t.x??n?.[e]??e)}export function categoriesAreDates(t,e){return(e?.some(t=>t instanceof Date)??!1)||t.some(t=>t.some(t=>t.x instanceof Date))}export function categoryExtent(t,e){let n=1/0,r=-1/0,o=!1;return t.forEach(t=>{t.forEach((t,a)=>{if(null===t.value)return;const i=pointX(t,a,e);null!==i&&(o=!0,n=Math.min(n,i),r=Math.max(r,i))})}),o?{min:n,max:r}:null}export function bubbleRadius(t,e,n,r){return e>0&&Number.isFinite(t)&&!(t<=0)?Math.max(r,Math.sqrt(Math.min(t,e)/e)*n):0===t?0:r}export function categoryCount(t){return t.reduce((t,e)=>Math.max(t,e.data.length),0)}export function categoryAt(t,e,n){if(e&&t<e.length)return e[t];for(const e of n){const n=e[t]?.x;if(void 0!==n)return n}return t}export function extentOf(t,e){let n=1/0,r=-1/0,o=!1;if(e){const e=t.reduce((t,e)=>Math.max(t,e.length),0);for(let a=0;a<e;a++){let e=0,i=0;for(const n of t){const t=n[a]?.value;null!=t&&(o=!0,t>=0?e+=t:i+=t)}n=Math.min(n,i),r=Math.max(r,e)}}else for(const e of t)for(const{value:t}of e)null!==t&&(o=!0,n=Math.min(n,t),r=Math.max(r,t));return o?{min:n,max:r}:null}function niceStep(t){const e=10**Math.floor(Math.log10(t)),n=t/e;return n<=1?e:n<=2?2*e:n<=5?5*e:10*e}export function valueScale(t,e={}){const{tickCount:n=5,includeZero:r=!0}=e;let o=e.min??(t?t.min:0),a=e.max??(t?t.max:1);if(r&&void 0===e.min&&(o=Math.min(o,0)),r&&void 0===e.max&&(a=Math.max(a,0)),a===o){const t=Math.abs(a)>0?.5*Math.abs(a):1,n=void 0===e.min,r=void 0===e.max;!n&&r||(o-=t),!r&&n||(a+=t)}const i=void 0!==e.min&&void 0!==e.max?function dividingStep(t,e){const n=10**Math.floor(Math.log10(t/Math.max(1,e)));let r=niceStep(t/Math.max(1,e)),o=1/0;for(const a of[.1,1,10])for(const i of[1,2,2.5,5]){const u=i*a*n,s=t/u,c=Math.round(s);if(c<1||Math.abs(s-c)>1e-9)continue;const l=Math.abs(c-e);l<o&&(o=l,r=u)}return r}(a-o,n):niceStep((a-o)/Math.max(1,n)),u=void 0!==e.min?o:Math.floor(o/i)*i,s=void 0!==e.max?a:Math.ceil(a/i)*i,c=s-u||1,l=[];for(let t=u;t<=s+1e-9*i;t+=i)l.push(Number(t.toFixed(12)));return{min:u,max:s,ticks:l,fraction:t=>(t-u)/c}}const r=1e3,o=6e4,a=36e5,i=24*a,u=[{unit:"second",count:1,size:r},{unit:"second",count:5,size:5e3},{unit:"second",count:15,size:15e3},{unit:"second",count:30,size:3e4},{unit:"minute",count:1,size:o},{unit:"minute",count:5,size:3e5},{unit:"minute",count:15,size:9e5},{unit:"minute",count:30,size:18e5},{unit:"hour",count:1,size:a},{unit:"hour",count:3,size:3*a},{unit:"hour",count:6,size:6*a},{unit:"hour",count:12,size:12*a},{unit:"day",count:1,size:i},{unit:"day",count:2,size:2*i},{unit:"week",count:1,size:7*i},{unit:"week",count:2,size:14*i},{unit:"month",count:1,size:30*i},{unit:"quarter",count:1,size:91*i},{unit:"month",count:6,size:182*i},{unit:"year",count:1,size:365*i}];function floorTime(t,e){const n=new Date(t);if("year"===e)return new Date(n.getFullYear(),0,1).getTime();if("quarter"===e)return new Date(n.getFullYear(),3*Math.floor(n.getMonth()/3),1).getTime();if("month"===e)return new Date(n.getFullYear(),n.getMonth(),1).getTime();if("week"===e){const t=new Date(n.getFullYear(),n.getMonth(),n.getDate());return t.setDate(t.getDate()-t.getDay()),t.getTime()}return"day"===e?new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime():"hour"===e?new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours()).getTime():"minute"===e?Math.floor(t/o)*o:Math.floor(t/r)*r}function addTime(t,e,n){const a=new Date(t);if("year"===e)a.setFullYear(a.getFullYear()+n);else if("quarter"===e)a.setMonth(a.getMonth()+3*n);else if("month"===e)a.setMonth(a.getMonth()+n);else if("week"===e)a.setDate(a.getDate()+7*n);else if("day"===e)a.setDate(a.getDate()+n);else{if("hour"!==e)return t+n*("minute"===e?o:r);a.setHours(a.getHours()+n)}return a.getTime()}const s={second:"minute",minute:"hour",hour:"day",day:"month",week:"week",month:"year",quarter:"year",year:"year"};export function timeScale(t,e={}){const{tickCount:n=6}=e;let r=e.min??t?.min??Date.parse("2000-01-01T00:00:00"),o=e.max??t?.max??r+i;o<=r&&(r-=i/2,o+=i/2);const a=o-r;let c=u[0],l=1/0;for(const t of u){const e=Math.abs(a/t.size-n);e<l&&(l=e,c=t)}const h=c.unit,m="year"===h?Math.max(1,Math.round(niceStep(a/n/(365*i)))):c.count;let f=e.min??function alignTime(t,e,n){let r=floorTime(t,s[e]);if("year"===e&&n>1){const t=new Date(r).getFullYear();r=new Date(t-(t%n+n)%n,0,1).getTime()}for(let o=0;o<500;o++){const o=addTime(r,e,n);if(o>t)return r;r=o}return r}(r,h,m);const $=[];let x=f;for(let t=0;t<500&&($.push(x),!(x>o));t++)x=addTime(x,h,m);let p=e.max??$[$.length-1];p<=f&&(f-=i/2,p+=i/2);const M=p-f;return{min:f,max:p,ticks:$.filter(t=>t>=f&&t<=p),unit:h,step:m,fraction:t=>(t-f)/M}}function timeParts(t,e,n=!1){if("second"===t||"minute"===t||"hour"===t){const r="second"===t?{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}:{hour:"2-digit",minute:"2-digit",hourCycle:"h23"};if(!n)return r;const o={month:"short",day:"numeric",...r};return e?{...o,year:"numeric"}:o}if("year"===t)return{year:"numeric"};const r="month"===t||"quarter"===t?{month:"short"}:{month:"short",day:"numeric"};return e?{...r,year:"numeric"}:r}export function timeNeedsDate(t,e){return!("second"!==e&&"minute"!==e&&"hour"!==e||t.length<2||floorTime(t[0],"day")===floorTime(t[t.length-1]-1,"day"))}export function formatTimeValue(e,n,r,o=!1){return t(r,timeParts(n,!0,o)).format(new Date(e))}export function formatTimeTicks(e,n,r){const o=new Set(e.map(t=>new Date(t).getFullYear())).size>1,a=timeNeedsDate(e,n);return e.map((e,i)=>t(r,timeParts(n,o||0===i,a)).format(new Date(e)))}export function tickStride(t,e,n){if(t<=1||e<=0)return 1;const r=Math.max(1,Math.floor(e/Math.max(1,n)));return Math.max(1,Math.ceil(t/r))}export function showsTick(t,e,n,r){return t%n===0||r&&t===e-1}export function fitsLast(t,e,n,r){const o=(t-1)%e;return o>0&&o*n>=r+8}export function textWidth(t,e){let n=0;for(const e of t)n+=/[ᄀ-ᇿ⺀-가-豈-︰-﹏]/.test(e)?1:.6;return n*e}export function truncate(t,e,n){if(e<=0||textWidth(t,n)<=e)return t;const r=e-textWidth("…",n);let o="",a=0;for(const e of t){const t=a+textWidth(e,n);if(t>r)break;a=t,o+=e}return o.length>0?`${o.trimEnd()}…`:"…"}export function fitCategoryLabels(t,e){const{horizontal:n,slot:r,fontSize:o,ticks:a}=e;return a||!n&&r-6<2.4*o?t:t.map(t=>truncate(t,n?150:r-6,o))}export function bandScale(t,e,n){const r=t>0?e/t:e;return{step:r,band:r*n,centre:t=>r*(t+.5)}}export function linePath(t,e){const n=[];let r=[];const flush=()=>{if(0!==r.length){if(1===r.length)n.push(`M${r[0].x} ${r[0].y}h0`);else if("step"===e){n.push(`M${r[0].x} ${r[0].y}`);for(let t=1;t<r.length;t++){const e=(r[t-1].x+r[t].x)/2;n.push(`H${e}V${r[t].y}H${r[t].x}`)}}else if("smooth"===e)n.push(`M${r[0].x} ${r[0].y}`),n.push(function monotonePath(t){const e=t.length,n=[];for(let r=0;r<e-1;r++){const e=t[r+1].x-t[r].x;n.push(0===e?0:(t[r+1].y-t[r].y)/e)}const r=[n[0]??0];for(let t=1;t<e-1;t++){const e=n[t-1],o=n[t];r.push(e*o<=0?0:2*e*o/(e+o))}r.push(n[e-2]??0);const o=[];for(let n=0;n<e-1;n++){const e=(t[n+1].x-t[n].x)/3;o.push(`C${t[n].x+e} ${t[n].y+r[n]*e} ${t[n+1].x-e} ${t[n+1].y-r[n+1]*e} ${t[n+1].x} ${t[n+1].y}`)}return o.join("")}(r));else{n.push(`M${r[0].x} ${r[0].y}`);for(let t=1;t<r.length;t++)n.push(`L${r[t].x} ${r[t].y}`)}r=[]}};for(const e of t)null===e?flush():r.push(e);return flush(),n.join("")}export function areaPath(t,e,n){const r=[];let o=0;const flush=a=>{const i=t.slice(o,a).filter(Boolean);if(0===i.length)return;const u="number"==typeof e?i.map(t=>({x:t.x,y:e})).reverse():e.slice(o,a).filter(Boolean).reverse();if(0===u.length)return;const s=linePath(i,n),c=linePath(u,n).replace(/^M/,"L");r.push(`${s}${c}Z`)};for(let e=0;e<t.length;e++)null===t[e]&&(flush(e),o=e+1);return flush(t.length),r.join("")}export function barPath(t,e,n,r,o,a){const i=Math.max(0,Math.min(o,n/2,r/2));if(0===i||n<=0||r<=0)return`M${t} ${e}h${n}v${r}h${-n}Z`;const arc=(t,e)=>`a${i} ${i} 0 0 1 ${t} ${e}`;return"up"===a?`M${t} ${e+r}V${e+i}${arc(i,-i)}H${t+n-i}${arc(i,i)}V${e+r}Z`:"down"===a?`M${t} ${e}H${t+n}V${e+r-i}${arc(-i,i)}H${t+i}${arc(-i,-i)}Z`:"right"===a?`M${t} ${e}H${t+n-i}${arc(i,i)}V${e+r-i}${arc(-i,i)}H${t}Z`:`M${t+n} ${e+r}H${t+i}${arc(-i,-i)}V${e+i}${arc(i,-i)}H${t+n}Z`}export const markShapes=["circle","square","triangle","diamond","cross"];const c={circle:1,square:.8862,triangle:1.5551,diamond:1.2533,cross:1.189};export function markPath(t,e,n,r){const o=Math.max(0,r)*c[t];if(0===o)return"";if("circle"===t)return`M${e-o} ${n}a${o} ${o} 0 1 0 ${2*o} 0a${o} ${o} 0 1 0 ${2*-o} 0Z`;if("square"===t)return`M${e-o} ${n-o}h${2*o}v${2*o}h${2*-o}Z`;if("diamond"===t)return`M${e} ${n-o}L${e+o} ${n}L${e} ${n+o}L${e-o} ${n}Z`;if("triangle"===t)return`M${[0,120,240].map(t=>{const r=(t-90)*Math.PI/180;return`${e+o*Math.cos(r)} ${n+o*Math.sin(r)}`}).join("L")}Z`;const a=o/3;return`M${e-a} ${n-o}h${2*a}v${o-a}h${o-a}v${2*a}h${-(o-a)}v${o-a}h${2*-a}v${-(o-a)}h${-(o-a)}v${2*-a}h${o-a}Z`}export function ringPath(t,e,n,r,o){const point=r=>{const o=(r-90)*Math.PI/180;return`${t+n*Math.cos(o)} ${e+n*Math.sin(o)}`};if(Math.abs(o-r)>=360){const t=r+180;return`M${point(r)}A${n} ${n} 0 1 1 ${point(t)}A${n} ${n} 0 1 1 ${point(r)}`}const a=Math.abs(o-r)>180?1:0;return`M${point(r)}A${n} ${n} 0 ${a} 1 ${point(o)}`}export function arcPath(t,e,n,r,o,a){const point=(n,r)=>{const o=(r-90)*Math.PI/180;return`${t+n*Math.cos(o)} ${e+n*Math.sin(o)}`};if(Math.abs(a-o)>=360){const t=o+180;return r>0?`M${point(n,o)}A${n} ${n} 0 1 1 ${point(n,t)}A${n} ${n} 0 1 1 ${point(n,o)}ZM${point(r,o)}A${r} ${r} 0 1 0 ${point(r,t)}A${r} ${r} 0 1 0 ${point(r,o)}Z`:`M${point(n,o)}A${n} ${n} 0 1 1 ${point(n,t)}A${n} ${n} 0 1 1 ${point(n,o)}Z`}const i=Math.abs(a-o)>180?1:0;return r<=0?`M${t} ${e}L${point(n,o)}A${n} ${n} 0 ${i} 1 ${point(n,a)}Z`:`M${point(n,o)}A${n} ${n} 0 ${i} 1 ${point(n,a)}L${point(r,a)}A${r} ${r} 0 ${i} 0 ${point(r,o)}Z`}export const rampSteps=5;export function rampStep(t,e,n,r,o=0){if("diverging"===r){const r=Math.max(Math.abs(n-o),Math.abs(o-e));if(!(r>0))return 2;const a=(t-o)/r;return Math.min(4,Math.max(0,2+Math.round(2*a)))}const a=n-e;return a>0?Math.min(4,Math.max(0,Math.floor((t-e)/a*5))):4}export function rampFill(t,e){return`var(--plass-chart-${"diverging"===e?"div":"seq"}-${t+1})`}export function rampInk(t,e){return`var(--plass-chart-${"diverging"===e?"div":"seq"}-on-${t+1})`}export function squarify(t,e,n){const r=t.reduce((t,e)=>t+Math.max(0,e),0);if(!(r>0)||e<=0||n<=0)return[];const o=e*n/r,a=t.map((t,e)=>({index:e,area:Math.max(0,t)*o})).filter(t=>t.area>0).sort((t,e)=>e.area-t.area),i=[];let u=0,s=0,c=e,l=n,h=[];const worst=t=>{const e=Math.min(c,l),n=t.reduce((t,e)=>t+e.area,0);if(!(n>0&&e>0))return 1/0;const r=t[0].area,o=t[t.length-1].area;return Math.max(e*e*r/(n*n),n*n/(e*e*o))},place=()=>{const t=h.reduce((t,e)=>t+e.area,0),e=Math.min(c,l),n=e>0?t/e:0,r=c>=l;let o=0;for(const t of h){const e=n>0?t.area/n:0;i.push(r?{index:t.index,x:u,y:s+o,width:n,height:e}:{index:t.index,x:u+o,y:s,width:e,height:n}),o+=e}r?(u+=n,c-=n):(s+=n,l-=n),h=[]};for(const t of a)0===h.length||worst([...h,t])<=worst(h)||place(),h.push(t);return h.length>0&&place(),i}const l={month:"short",day:"numeric"},h={notation:"compact",maximumFractionDigits:1},m={maximumFractionDigits:2};export function formatCategory(e,n){return e instanceof Date?t(n,l).format(e):String(e)}export function compactNumber(t,n){return Math.abs(t)>=1e4?e(n,h).format(t):e(n,m).format(t)}export function writeChartValue(t,n,r){return n?e(r,n).format(t):compactNumber(t,r)}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import * as React from 'react';
|
|
32
32
|
import type { PlassLabels } from './labels.js';
|
|
33
33
|
import type { PlassDirection } from './direction.js';
|
|
34
|
-
import type { PlassColor, PlassDensity, PlassSize, PlassWeekday } from '../types.js';
|
|
34
|
+
import type { PlassColor, PlassDensity, PlassFieldLabelPlacement, PlassSize, PlassWeekday } from '../types.js';
|
|
35
35
|
/** Everything a `PlassProvider` can decide for the tree under it. */
|
|
36
36
|
export interface PlassDefaults {
|
|
37
37
|
/** The rung of the size ladder every component starts from. */
|
|
@@ -40,6 +40,19 @@ export interface PlassDefaults {
|
|
|
40
40
|
color?: PlassColor;
|
|
41
41
|
/** How tightly they pack their content. */
|
|
42
42
|
density?: PlassDensity;
|
|
43
|
+
/**
|
|
44
|
+
* Where a labelled control puts its label — above the box, or in the box's
|
|
45
|
+
* top edge.
|
|
46
|
+
*
|
|
47
|
+
* Here for the same reason `density` is: a product whose forms notch their
|
|
48
|
+
* labels notches all of them, and the decision is the application's rather
|
|
49
|
+
* than the field's. A component's own `labelPlacement` still wins, which is
|
|
50
|
+
* what a form with one field that genuinely cannot take a notch needs.
|
|
51
|
+
*
|
|
52
|
+
* `PlOtpField` is not reached by it: a row of separate boxes has no one edge
|
|
53
|
+
* to cut, so its label stays above the row whatever this says.
|
|
54
|
+
*/
|
|
55
|
+
labelPlacement?: PlassFieldLabelPlacement;
|
|
43
56
|
/** The BCP 47 tag the date and time components format and read against. */
|
|
44
57
|
locale?: string;
|
|
45
58
|
/** Which day their weeks start on, as `Date` counts them — Sunday is `0`. */
|
package/dist/internal/glow.d.ts
CHANGED
|
@@ -15,3 +15,18 @@ import type * as React from 'react';
|
|
|
15
15
|
* the position is read against the surface's own box instead.
|
|
16
16
|
*/
|
|
17
17
|
export declare function followPointer(event: React.PointerEvent<HTMLElement>): void;
|
|
18
|
+
/**
|
|
19
|
+
* `.plass-glow` and the `pointermove` that feeds it, composed with whatever
|
|
20
|
+
* handler the caller already passed.
|
|
21
|
+
*
|
|
22
|
+
* Every surface that carries the light needs the same three things: the class,
|
|
23
|
+
* `position: relative` for the two layers to hang off, and this handler. The
|
|
24
|
+
* class and `relative` are written into each component's own base classes,
|
|
25
|
+
* because Tailwind only generates what it has seen spelled out; the wiring is
|
|
26
|
+
* here, so that every call site does not grow its own copy of it.
|
|
27
|
+
*
|
|
28
|
+
* `undefined` comes back when the surface is not interactive and the caller
|
|
29
|
+
* passed nothing, which is what keeps a listener off an element that has no
|
|
30
|
+
* light to move.
|
|
31
|
+
*/
|
|
32
|
+
export declare function glowPointerMove<E extends HTMLElement>(lit: boolean, onPointerMove?: React.PointerEventHandler<E>): React.PointerEventHandler<E> | undefined;
|
package/dist/internal/glow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function followPointer(t){const e=t.currentTarget;let
|
|
1
|
+
export function followPointer(t){const e=t.currentTarget;let o=t.nativeEvent.offsetX,n=t.nativeEvent.offsetY;if(t.target!==e){const r=e.getBoundingClientRect();o=t.clientX-r.left,n=t.clientY-r.top}e.style.setProperty("--p-mx",`${o}px`),e.style.setProperty("--p-my",`${n}px`)}export function glowPointerMove(t,e){return t?t=>{followPointer(t),e?.(t)}:e}
|
|
@@ -162,6 +162,19 @@ export interface PlassLabels {
|
|
|
162
162
|
otpSlot: (index: number, count: number) => string;
|
|
163
163
|
/** What a transfer says once rows have moved, given how many and the list. */
|
|
164
164
|
transferMoved: (count: number, list: string) => string;
|
|
165
|
+
/**
|
|
166
|
+
* Why a file picker turned files away, one line per reason and given how many
|
|
167
|
+
* were turned away for it.
|
|
168
|
+
*
|
|
169
|
+
* Grouped by reason rather than named one file at a time, because the batch
|
|
170
|
+
* that goes wrong is usually the big one — a folder dropped on a picker with
|
|
171
|
+
* a `maxFiles` of five is ninety-five lines saying the same thing. What the
|
|
172
|
+
* limit itself *is* belongs in `hint`, which is where a picker already says
|
|
173
|
+
* what it accepts, so these do not repeat it.
|
|
174
|
+
*/
|
|
175
|
+
filesRejectedType: (count: number) => string;
|
|
176
|
+
filesRejectedSize: (count: number) => string;
|
|
177
|
+
filesRejectedCount: (count: number) => string;
|
|
165
178
|
}
|
|
166
179
|
/**
|
|
167
180
|
* English, and the reason the library needs no setup to read.
|
package/dist/internal/labels.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useDefaults as a}from"./defaults.js";export const defaultLabels={close:"Close",cancel:"Cancel",confirm:"Confirm",acknowledge:"OK",clear:"Clear",done:"Done",skip:"Skip",search:"Search",selectAll:"Select all",selectRow:"Select row",remove:"Remove",dismiss:"Dismiss",open:"Open",previous:"Previous",next:"Next",reveal:"Reveal",hide:"Hide",increase:"Increase",decrease:"Decrease",preview:"Preview",empty:"Nothing here",optional:"Optional",breadcrumb:"Breadcrumb",breadcrumbExpand:"Show the hidden steps",carousel:"Carousel",carouselPrevious:"Previous slide",carouselNext:"Next slide",slide:"slide",commandPalette:"Command palette",commandPalettePlaceholder:"Search commands",gallery:"Gallery",chart:"Chart",minimize:"Minimize",maximize:"Maximize",restore:"Restore",resizeWindow:"Resize window",overlay:"Overlay",notifications:"Notifications",pagination:"Pagination",paginationPrevious:"Previous page",paginationNext:"Next page",paginationFirst:"First page",paginationLast:"Last page",rating:"Rating",sidebar:"Sidebar",sidebarOpen:"Open sidebar",sidebarClose:"Close sidebar",sidebarResize:"Resize sidebar",skipToContent:"Skip to content",backToTop:"Back to top",onThisPage:"On this page",typing:"Typing…",messageSending:"Sending",messageSent:"Sent",messageDelivered:"Delivered",messageRead:"Read",messageFailed:"Not delivered",spoilerWarning:"This may contain spoilers",filePickerTitle:"Drop files here, or click to browse",newTab:"(opens in a new tab)",transferAvailable:"Available",transferSelected:"Selected",transferToSelected:"Move to selected",transferToAvailable:"Move to available",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",code:"Code",previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",thisMonth:"This month",thisYear:"This year",now:"Now",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End",paginationPage:e=>`Page ${e}`,paginationStatus:(e,a)=>`Page ${e} of ${a}`,ratingValue:(e,a)=>`${e.toLocaleString("en")} out of ${a}`,ratingNone:"No rating",carouselSlide:(e,a)=>`Slide ${e} of ${a}`,galleryItem:(e,a)=>`${e} of ${a}`,removeItem:e=>`Remove ${e}`,addCustom:e=>`Add “${e}”`,otpSlot:(e,a)=>`Character ${e} of ${a}`,transferMoved:(e,a)=>`${e} ${1===e?"item":"items"} moved to ${a}`};export function useLabels(){const{labels:o}=a();return e.useMemo(()=>o?{...defaultLabels,...o}:defaultLabels,[o])}
|
|
1
|
+
"use client";import*as e from"react";import{useDefaults as a}from"./defaults.js";export const defaultLabels={close:"Close",cancel:"Cancel",confirm:"Confirm",acknowledge:"OK",clear:"Clear",done:"Done",skip:"Skip",search:"Search",selectAll:"Select all",selectRow:"Select row",remove:"Remove",dismiss:"Dismiss",open:"Open",previous:"Previous",next:"Next",reveal:"Reveal",hide:"Hide",increase:"Increase",decrease:"Decrease",preview:"Preview",empty:"Nothing here",optional:"Optional",breadcrumb:"Breadcrumb",breadcrumbExpand:"Show the hidden steps",carousel:"Carousel",carouselPrevious:"Previous slide",carouselNext:"Next slide",slide:"slide",commandPalette:"Command palette",commandPalettePlaceholder:"Search commands",gallery:"Gallery",chart:"Chart",minimize:"Minimize",maximize:"Maximize",restore:"Restore",resizeWindow:"Resize window",overlay:"Overlay",notifications:"Notifications",pagination:"Pagination",paginationPrevious:"Previous page",paginationNext:"Next page",paginationFirst:"First page",paginationLast:"Last page",rating:"Rating",sidebar:"Sidebar",sidebarOpen:"Open sidebar",sidebarClose:"Close sidebar",sidebarResize:"Resize sidebar",skipToContent:"Skip to content",backToTop:"Back to top",onThisPage:"On this page",typing:"Typing…",messageSending:"Sending",messageSent:"Sent",messageDelivered:"Delivered",messageRead:"Read",messageFailed:"Not delivered",spoilerWarning:"This may contain spoilers",filePickerTitle:"Drop files here, or click to browse",newTab:"(opens in a new tab)",transferAvailable:"Available",transferSelected:"Selected",transferToSelected:"Move to selected",transferToAvailable:"Move to available",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",code:"Code",previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",thisMonth:"This month",thisYear:"This year",now:"Now",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End",paginationPage:e=>`Page ${e}`,paginationStatus:(e,a)=>`Page ${e} of ${a}`,ratingValue:(e,a)=>`${e.toLocaleString("en")} out of ${a}`,ratingNone:"No rating",carouselSlide:(e,a)=>`Slide ${e} of ${a}`,galleryItem:(e,a)=>`${e} of ${a}`,removeItem:e=>`Remove ${e}`,addCustom:e=>`Add “${e}”`,otpSlot:(e,a)=>`Character ${e} of ${a}`,transferMoved:(e,a)=>`${e} ${1===e?"item":"items"} moved to ${a}`,filesRejectedType:e=>`${e} ${1===e?"file is":"files are"} not an accepted type`,filesRejectedSize:e=>`${e} ${1===e?"file is":"files are"} too large`,filesRejectedCount:e=>`${e} ${1===e?"file":"files"} did not fit`};export function useLabels(){const{labels:o}=a();return e.useMemo(()=>o?{...defaultLabels,...o}:defaultLabels,[o])}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The label in the field's own top edge — `labelPlacement="notch"`.
|
|
3
|
+
*
|
|
4
|
+
* One module because every field-shaped control in the library draws the same
|
|
5
|
+
* notch: a PlTextField, a PlSelect's trigger, a PlCombobox, a PlNumberField, a
|
|
6
|
+
* PlFilePicker's drop zone and every picker that goes through `internal/picker`
|
|
7
|
+
* have to be indistinguishable along their top edge or a form looks like two
|
|
8
|
+
* forms stacked on each other.
|
|
9
|
+
*
|
|
10
|
+
* **The cut is real.** A `<legend>` takes a segment out of its `<fieldset>`'s
|
|
11
|
+
* border, and that is the only way to open a gap in a line without knowing what
|
|
12
|
+
* is behind it. The usual trick — a label with the page's own background colour
|
|
13
|
+
* painted over the border — cannot work here twice over: a library that does
|
|
14
|
+
* not paint the page has no idea what colour it is, and a Plass field is
|
|
15
|
+
* translucent, so a patch of flat colour would read as a patch of flat colour.
|
|
16
|
+
*
|
|
17
|
+
* **The fieldset is a sibling of the control rather than the control itself.**
|
|
18
|
+
* Half the shells this is drawn on are `<button>`s — a Select's trigger, a file
|
|
19
|
+
* picker's drop zone — and a button cannot contain a fieldset. So the frame
|
|
20
|
+
* below wraps the shell, the shell is drawn exactly as it always was, and the
|
|
21
|
+
* edge is laid over it with its own border. The shell's own border goes
|
|
22
|
+
* transparent for the length of it; `notchShellStyle` is that one declaration,
|
|
23
|
+
* written inline because it has to beat a `hover:` and a `disabled` rule that
|
|
24
|
+
* are already in the class string.
|
|
25
|
+
*/
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
import type { PlassDensity, PlassSize, PlassVariant } from '../types.js';
|
|
28
|
+
/**
|
|
29
|
+
* What the shell gives up while the edge is drawing for it.
|
|
30
|
+
*
|
|
31
|
+
* Inline rather than a class: every field's shell already carries a
|
|
32
|
+
* `border-color` at rest, another on hover, another on focus and another when
|
|
33
|
+
* disabled, and a utility added on top of those would be one more declaration
|
|
34
|
+
* of the same property at the same specificity — whichever of them Tailwind
|
|
35
|
+
* happened to emit last would win. The border itself stays, transparent, so the
|
|
36
|
+
* control's inside is the same size it was.
|
|
37
|
+
*/
|
|
38
|
+
export declare const notchShellStyle: React.CSSProperties;
|
|
39
|
+
export interface FieldNotchProps {
|
|
40
|
+
/**
|
|
41
|
+
* Whether to draw one at all. `false` renders the shell and nothing else, so
|
|
42
|
+
* a call site wraps its control once and unconditionally rather than writing
|
|
43
|
+
* the whole thing out twice — which is what keeps the two placements from
|
|
44
|
+
* drifting into two controls.
|
|
45
|
+
*/
|
|
46
|
+
notched: boolean;
|
|
47
|
+
size: PlassSize;
|
|
48
|
+
density: PlassDensity;
|
|
49
|
+
variant: PlassVariant;
|
|
50
|
+
/** Unavailable — the edge dims with the control. */
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/** Shown but not editable — the edge stays and stops answering. */
|
|
53
|
+
readOnly?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The whole edge, when it is not a field's hairline — width, style, colour and
|
|
56
|
+
* every state, replacing the three maps above.
|
|
57
|
+
*
|
|
58
|
+
* A PlFilePicker's drop zone is the one caller that needs it: its edge is 2px
|
|
59
|
+
* and dashed in all three variants, and it has a state no field has, a file
|
|
60
|
+
* being dragged over the box. Passed as one resolved string rather than added
|
|
61
|
+
* to the maps, for the reason every component in this library resolves its own
|
|
62
|
+
* states with an if/else — two utilities for one property at one specificity
|
|
63
|
+
* are settled by the order Tailwind happened to emit them in.
|
|
64
|
+
*/
|
|
65
|
+
edgeClassName?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The element that names the control, ready to render: a `Field.Label` for a
|
|
68
|
+
* field that has one, or the `<span>` an `aria-labelledby` points at. The
|
|
69
|
+
* same element the stacked placement renders, so the two cannot drift.
|
|
70
|
+
*/
|
|
71
|
+
label: React.ReactNode;
|
|
72
|
+
/** The control's shell, drawn exactly as it is without a notch. */
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Lays the notched edge over a control's shell.
|
|
77
|
+
*
|
|
78
|
+
* The frame is what the edge is positioned against and what hover and focus are
|
|
79
|
+
* read from, so the shell has to be inside it — and the shell is rendered
|
|
80
|
+
* untouched, which is the point: a notch is a decision about the label, not a
|
|
81
|
+
* second way of drawing a field.
|
|
82
|
+
*/
|
|
83
|
+
export declare function FieldNotch({ notched, size, density, variant, disabled, readOnly, edgeClassName, label, children }: FieldNotchProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as r,jsx as o,jsxs as e}from"react/jsx-runtime";import{cx as s,metaTextClasses as t,radiusClasses as l,transitionClasses as d}from"./styles.js";const a={xs:"-top-[5px]",sm:"-top-[5.5px]",md:"-top-[6px]",lg:"-top-[6.5px]",xl:"-top-[7px]"},i={xs:"mt-[5px]",sm:"mt-[5.5px]",md:"mt-[6px]",lg:"mt-[6.5px]",xl:"mt-[7px]"},n={default:{xs:"ms-2",sm:"ms-2.5",md:"ms-3",lg:"ms-5",xl:"ms-6"},compact:{xs:"ms-2",sm:"ms-2.5",md:"ms-3",lg:"ms-3.5",xl:"ms-4"}},p={xs:"px-0.5",sm:"px-0.5",md:"px-1",lg:"px-1",xl:"px-1"},m={solid:/* @__PURE__ */["border border-transparent","group-focus-within/field:[border-color:var(--p-ring)]"].join(" "),glass:/* @__PURE__ */["border [border-color:var(--plass-border)]","group-hover/field:[border-color:var(--p-line)]","group-focus-within/field:[border-color:var(--p-ring)]"].join(" "),ghost:/* @__PURE__ */["border border-transparent","group-focus-within/field:[border-color:var(--p-ring)]"].join(" ")},c={solid:"border border-transparent",glass:"border [border-color:var(--plass-border)]",ghost:"border border-transparent"},b={solid:"border border-transparent opacity-50",glass:/* @__PURE__ */["border [border-color:var(--plass-border)] opacity-50","forced-colors:[border-color:GrayText]"].join(" "),ghost:"border border-transparent opacity-50"},x=/* @__PURE__ */["group-has-[:focus-visible]/field:[border-width:2px]","group-has-[:focus-visible]/field:forced-colors:[border-color:Highlight]"].join(" ");export const notchShellStyle={borderColor:"transparent"};export function FieldNotch({notched:g,size:f,density:h,variant:u,disabled:v=!1,readOnly:j=!1,edgeClassName:y,label:w,children:N}){return g?e("div",{className:s("group/field relative flex w-full",i[f]),children:[N,o("fieldset",{role:"presentation",className:s("pointer-events-none absolute inset-x-0 bottom-0 m-0 min-w-0 p-0",a[f],l[f],d,y??(v?b[u]:j?c[u]:`${m[u]} ${x}`)),children:o("legend",{className:s("pointer-events-auto font-semibold leading-none",t[f],n[h][f],p[f],v?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:w})})]}):o(r,{children:N})}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PlassPickerLabels } from './calendar.js';
|
|
3
|
-
import type { PlassColor, PlassElevation, PlassFieldClassNames, PlassSize, PlassStyleProps } from '../types.js';
|
|
3
|
+
import type { PlassColor, PlassElevation, PlassFieldClassNames, PlassFieldLabelPlacement, PlassSize, PlassStyleProps } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* The shell all four pickers wear: a field-shaped trigger with a popup hanging
|
|
6
6
|
* off it.
|
|
@@ -84,8 +84,14 @@ export interface PlassPickerShellProps extends PlassStyleProps, Omit<React.Compo
|
|
|
84
84
|
* @default 0
|
|
85
85
|
*/
|
|
86
86
|
elevation?: PlassElevation;
|
|
87
|
-
/**
|
|
87
|
+
/** The name of what the control holds. */
|
|
88
88
|
label?: React.ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* Where the `label` goes — above the trigger, or in its top edge.
|
|
91
|
+
* Falls back to the nearest `PlassProvider`, then to `top`.
|
|
92
|
+
* @default 'top'
|
|
93
|
+
*/
|
|
94
|
+
labelPlacement?: PlassFieldLabelPlacement;
|
|
89
95
|
/** Helper text below it. */
|
|
90
96
|
description?: React.ReactNode;
|
|
91
97
|
/** Error message below. Its presence also turns the control invalid. */
|
|
@@ -141,7 +147,7 @@ interface InternalShellProps extends PlassPickerShellProps {
|
|
|
141
147
|
* and the way `invalid` re-points the whole colour family at `danger` so the
|
|
142
148
|
* edge, the ring and the message turn over together.
|
|
143
149
|
*/
|
|
144
|
-
export declare function PickerShell({ variant, size, color, density, elevation, label, description, error, invalid, startIcon, fullWidth, disabled, readOnly, required, id, className, classNames, style, display, samples, empty, clearable, onClear, open, onOpenChange, labels, name, formValue, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
|
|
150
|
+
export declare function PickerShell({ variant, size, color, density, elevation, label, labelPlacement: labelPlacementProp, description, error, invalid, startIcon, fullWidth, disabled, readOnly, required, id, className, classNames, style, display, samples, empty, clearable, onClear, open, onOpenChange, labels, name, formValue, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
|
|
145
151
|
/**
|
|
146
152
|
* The row of shortcuts under a picker's panel.
|
|
147
153
|
*
|
package/dist/internal/picker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{Field as t}from"@base-ui/react/field";import{Popover as a}from"@base-ui/react/popover";import{FormControl as r,leaveFormControl as i}from"./form.js";import{glowPointerMove as o}from"./glow.js";import{CloseIcon as n}from"./icons.js";import{WidthSizer as d}from"./sizer.js";import{FieldNotch as p,notchShellStyle as c}from"./notch.js";import{useDefaults as m}from"./defaults.js";import{chipRemoveClasses as u,controlHeightClasses as f,controlTextLeadingClasses as h,cx as g,disabledClasses as x,fieldReadOnlyClasses as b,fieldRestClasses as v,focusWithinRingClasses as y,gapClasses as N,glassClasses as j,hasContent as w,iconClasses as P,metaTextClasses as k,paddingXClasses as $,radiusClasses as z,stackGapClasses as C,surfaceSlots as O,transitionClasses as B}from"./styles.js";export function popupSlots(e,l){return{...O(e,l),"--p-fill":`var(--plass-${e}-fill)`,"--p-on-solid":`var(--plass-${e}-on-solid)`}}const I=/* @__PURE__ */["group relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",B,P].join(" "),R=y;export const pickerPopupClasses=/* @__PURE__ */[j,"border text-(--plass-fg) bg-(--plass-glass-press)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" ");export const popupPaddingClasses={xs:"p-1.5",sm:"p-2",md:"p-2.5",lg:"p-3",xl:"p-3.5"};const q=/* @__PURE__ */["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" ");export function PopupArrow({as:s,size:t}){return e(s,{className:q,children:l("svg",{width:t,height:t/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:[e("path",{d:"M0 0h10L5 5z",fill:"var(--plass-glass-press)"}),e("path",{d:"M0 0 5 5 10 0",fill:"none",stroke:"var(--plass-glass-line)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]})})}export function PickerShell({variant:y="glass",size:j="md",color:P="primary",density:B="default",elevation:q=0,label:D,labelPlacement:E,description:F,error:M,invalid:S,startIcon:L,fullWidth:V=!1,disabled:W=!1,readOnly:_=!1,required:A=!1,id:T,className:G,classNames:H,style:J,display:K,samples:Q,empty:U,clearable:X=!1,onClear:Y,open:Z,onOpenChange:ee,labels:le,name:se,formValue:te,children:ae,triggerRef:re,...ie}){const oe=s.useId(),ne=T??`${oe}-trigger`,de=`${oe}-label`,pe=`${oe}-value`,ce=`${oe}-description`,me=`${oe}-error`,ue=m(),fe="notch"===(E??ue.labelPlacement??"top")&&w(D),he=null!=M&&!1!==M&&""!==M,ge=S??he,xe=ge?"danger":P,be=!W&&!_,ve=W||_,ye=s.useRef(null),Ne=e(t.Label,{id:de,htmlFor:ne,className:g(k[j],"font-semibold",W?"text-(--plass-muted-fg)":"text-(--plass-fg)",H?.label),children:D});return l(t.Root,{disabled:W,invalid:ge,className:g("flex-col align-top",C[j],V?"flex w-full":"inline-flex",G),style:{...O(xe,q),...J},...ie,children:[w(D)&&!fe?Ne:null,l(a.Root,{open:Z,onOpenChange:e=>ee(e),children:[e(p,{notched:fe,size:j,density:B,variant:y,disabled:W,readOnly:_,label:Ne,children:l("span",{style:fe?c:void 0,onPointerMove:o(be),className:g(I,fe?"":R,f[j],h[j],z[j],N[j],$[B][j],W?x[y]:_?b[y]:v[y],be?"plass-glow":"",H?.control),children:[e(t.Validity,{children:({validity:s})=>{const t=!1===s.valid,r=[F?ce:null,he||t&&!W&&!0!==S?me:null].filter(Boolean).join(" ")||void 0;return l(a.Trigger,{id:ne,ref:re,disabled:W,"aria-labelledby":D?`${de} ${pe}`:void 0,"aria-describedby":r,"aria-required":A||void 0,"aria-invalid":ge||t||void 0,onBlur:()=>{Z||i(ye.current)},className:g("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",N[j],"[outline:none]",ve?"cursor-default":"cursor-pointer"),children:[L?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:L}):null,l("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{id:pe,className:g("w-full truncate",U?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:K}),V?null:e(d,{samples:Q??[]})]})]})}}),!X||U||ve?null:e("button",{type:"button","aria-label":le.clear,className:g(u,"text-(--plass-muted-fg)"),onClick:e=>{e.stopPropagation(),Y()},children:e(n,{})})]})}),e(a.Portal,{children:e(a.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",sideOffset:6,align:"start",children:e(a.Popup,{initialFocus:!1,className:g(pickerPopupClasses,z[j],popupPaddingClasses[j],h[j]),style:popupSlots(xe,3),children:ae})})})]}),F?e(t.Description,{id:ce,className:g("m-0",k[j],"text-(--plass-muted-fg)",H?.description),children:F}):null,e(t.Error,he?{id:me,match:!0,className:g(k[j],"text-(--p-accent)",H?.error),children:M}:{id:me,className:g(k[j],"text-(--p-accent)",H?.error)}),e(r,{ref:ye,name:se,value:te,required:A&&!_,disabled:W,standIn:()=>ye.current?.ownerDocument.getElementById(ne)})]})}export function PickerFooter({size:l,children:s}){return e("div",{className:g("flex items-center justify-end border-t pt-1.5","[border-color:var(--plass-divider)]",N[l]),children:s})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--plass-divider)"})}
|
|
@@ -292,6 +292,15 @@ export declare const iconClasses = "[&_svg]:pointer-events-none [&_svg]:size-[1.
|
|
|
292
292
|
* is invisible to a sighted reader and present to every other kind.
|
|
293
293
|
*/
|
|
294
294
|
export declare const srOnlyClasses = "absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";
|
|
295
|
+
/**
|
|
296
|
+
* The same clipped box, for a copy of text that is also drawn.
|
|
297
|
+
*
|
|
298
|
+
* A text effect draws its line and puts a second copy of it beside it for a
|
|
299
|
+
* screen reader, so a selection across the pair used to hand back the line
|
|
300
|
+
* twice. This one is left out of the selection: the drawn copy is the one a
|
|
301
|
+
* sighted reader can see, and the one they mean when they copy it.
|
|
302
|
+
*/
|
|
303
|
+
export declare const srOnlyCopyClasses = "absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)] select-none";
|
|
295
304
|
/**
|
|
296
305
|
* Every slot a control reads.
|
|
297
306
|
*
|
|
@@ -314,6 +323,18 @@ export declare function controlSlots(color: PlassColor, elevation: PlassElevatio
|
|
|
314
323
|
* own colours and tinting the sheet under them puts every one on a background
|
|
315
324
|
* it was not chosen against. The family shows up in the hairline, the focus
|
|
316
325
|
* ring and the caret, and the glass stays clear.
|
|
326
|
+
*
|
|
327
|
+
* The two interaction-light slots **are** here, and they are not an exception
|
|
328
|
+
* to that. A dye is what a surface is; the light is where the pointer is, and a
|
|
329
|
+
* field answering a pointer is as true a claim as a key answering one. They
|
|
330
|
+
* take the family's own tint in all three variants rather than switching on the
|
|
331
|
+
* variant as `controlSlots` does, because none of these three is a coloured
|
|
332
|
+
* fill: a `solid` field is the well, which is the glass at its most opaque, and
|
|
333
|
+
* white light on it is white light on a near-white sheet.
|
|
334
|
+
*
|
|
335
|
+
* Declaring them costs a surface that never lights up two custom properties and
|
|
336
|
+
* nothing else — both layers are `opacity: 0` until `.plass-glow` is on the
|
|
337
|
+
* element, and a surface without that class has no layers at all.
|
|
317
338
|
*/
|
|
318
339
|
export declare function surfaceSlots(color: PlassColor, elevation: PlassElevation): React.CSSProperties;
|
|
319
340
|
/**
|
package/dist/internal/styles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const radiusClasses={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-sm)",md:"rounded-(--plass-radius-md)",lg:"rounded-(--plass-radius-lg)",xl:"rounded-(--plass-radius-xl)"};export const controlHeightClasses={xs:"h-6",sm:"h-8",md:"h-10",lg:"h-12",xl:"h-14"};export const controlSquareClasses={xs:"w-6",sm:"w-8",md:"w-10",lg:"w-12",xl:"w-14"};export const controlTextClasses={xs:"text-[0.6875rem]",sm:"text-[0.8125rem]",md:"text-[0.875rem]",lg:"text-[1rem]",xl:"text-[1.125rem]"};export const controlTextLeadingClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.875rem]/[1.25rem]",lg:"text-[1rem]/[1.5rem]",xl:"text-[1.125rem]/[1.75rem]"};export const metaTextClasses={xs:"text-[0.625rem]",sm:"text-[0.6875rem]",md:"text-[0.75rem]",lg:"text-[0.8125rem]",xl:"text-[0.875rem]"};export const paddingXClasses={default:{xs:"px-2.5",sm:"px-3",md:"px-4",lg:"px-6",xl:"px-7"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3.5",xl:"px-4"}};export const iconSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-5",lg:"size-6",xl:"size-7"};export const tickSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-6"};export const tickRadiusClasses={xs:"rounded-[0.25rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"};export const tickDotClasses={xs:"size-0 data-[checked]:size-1.5",sm:"size-0 data-[checked]:size-1.5",md:"size-0 data-[checked]:size-2",lg:"size-0 data-[checked]:size-2",xl:"size-0 data-[checked]:size-2.5"};export const tickRowTextClasses=controlTextLeadingClasses;export const paddingXValues={default:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.5rem",xl:"1.75rem"},compact:{xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.875rem",xl:"1rem"}};export const gapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const stackGapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-1.5",lg:"gap-2",xl:"gap-2"};export const sheetPaddingXClasses={default:{xs:"px-2.5",sm:"px-3.5",md:"px-5",lg:"px-6",xl:"px-7"},compact:{xs:"px-2",sm:"px-2.5",md:"px-3.5",lg:"px-4",xl:"px-5"}};export const sheetPaddingYClasses={default:{xs:"py-2.5",sm:"py-3.5",md:"py-5",lg:"py-6",xl:"py-7"},compact:{xs:"py-2",sm:"py-2.5",md:"py-3.5",lg:"py-4",xl:"py-5"}};export const sheetTitleClasses={xs:"text-[0.75rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.9375rem]/[1.25rem]",lg:"text-[1.0625rem]/[1.5rem]",xl:"text-[1.25rem]/[1.75rem]"};export const sheetBodyClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.75rem]/[1.125rem]",md:"text-[0.8125rem]/[1.375rem]",lg:"text-[0.9375rem]/[1.5rem]",xl:"text-[1.0625rem]/[1.75rem]"};export const sheetSectionGapClasses={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const sheetLineClasses="border-t [border-color:var(--plass-divider)]";export const sheetHeaderGapClasses={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const glassClasses="[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]";export const transitionClasses=/* @__PURE__ */["[transition-property:background-color,background-image,border-color,box-shadow,color,filter,opacity]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ");export const focusRingClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:0px]";export const focusWithinRingClasses="has-[:focus-visible]:[outline:2px_solid_var(--p-ring)] has-[:focus-visible]:[outline-offset:0px]";export const focusRingInsetClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]";export const chipRemoveClasses=/* @__PURE__ */["relative ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full","before:absolute before:inset-[calc(50%-12px)]","size-[1.15em] cursor-pointer opacity-70","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","hover:opacity-100 focus-visible:opacity-100",focusRingClasses,"disabled:cursor-not-allowed"].join(" ");export const iconClasses="[&_svg]:pointer-events-none [&_svg]:size-[1.2em] [&_svg]:shrink-0";export const srOnlyClasses="absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";export function controlSlots(s,e,o){const r="solid"===o;return{"--p-fill":`var(--plass-${s}-fill)`,"--p-on-solid":`var(--plass-${s}-on-solid)`,"--p-accent":`var(--plass-${s}-accent)`,"--p-tint":`var(--plass-${s}-tint)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-glow":r?"var(--plass-glow-on-fill)":`var(--plass-${s}-soft)`,"--p-flash":r?"var(--plass-flash-on-fill)":`var(--plass-${s}-soft-hover)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`,"--p-lift":"0 6px 16px -4px var(--p-tint)","--p-lift-hover":"0 10px 24px -6px var(--p-tint)","--p-lift-press":"0 2px 6px -2px var(--p-tint)"}}export function surfaceSlots(s,e){return{"--p-accent":`var(--plass-${s}-accent)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`}}export const forcedEdgeClasses="forced-colors:border forced-colors:[border-color:ButtonText]";export const forcedFieldEdgeClasses="forced-colors:border forced-colors:[border-color:CanvasText]";export const forcedFillClasses="forced-colors:[background-color:Highlight] forced-colors:[border-color:Highlight] forced-colors:[color:HighlightText]";export const forcedCheckedClasses=/* @__PURE__ */["forced-colors:data-[checked]:[background-color:Highlight]","forced-colors:data-[checked]:[border-color:Highlight]","forced-colors:data-[checked]:[color:HighlightText]"].join(" ");export const forcedPressedClasses=/* @__PURE__ */["forced-colors:data-[pressed]:[background-color:Highlight]","forced-colors:data-[pressed]:[border-color:Highlight]","forced-colors:data-[pressed]:[color:HighlightText]"].join(" ");export const forcedCheckedTextClasses="forced-colors:data-[checked]:[color:HighlightText]";export const forcedHighlightedClasses=/* @__PURE__ */["forced-colors:data-[highlighted]:[background-color:Highlight]","forced-colors:data-[highlighted]:[color:HighlightText]","forced-colors:data-[highlighted]:**:[color:HighlightText]"].join(" ");export const forcedDisabledCheckedClasses=/* @__PURE__ */["forced-colors:border forced-colors:[border-color:GrayText]","forced-colors:data-[checked]:[background-color:GrayText]","forced-colors:data-[checked]:[color:Canvas]"].join(" ");export const disabledClasses={solid:/* @__PURE__ */["cursor-not-allowed text-(--p-on-solid) [background-image:var(--p-fill)]","opacity-50 saturate-[0.35] shadow-none","forced-colors:border forced-colors:[border-color:GrayText]"].join(" "),glass:/* @__PURE__ */[glassClasses,"cursor-not-allowed border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-border)]","opacity-50 saturate-[0.35] shadow-none"].join(" "),ghost:"cursor-not-allowed bg-transparent text-(--p-accent) opacity-50 saturate-[0.35]"};export const readOnlyFilterClasses="saturate-[0.55]";export const sheetRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-transparent"};export const fieldRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-well)]",forcedFieldEdgeClasses,"hover:bg-(--plass-glass-hover)","focus-within:bg-(--plass-glass-press)"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]","hover:bg-(--plass-glass-press) hover:[border-color:var(--p-line)]","focus-within:bg-(--plass-glass-press) focus-within:[border-color:var(--p-line-hover)]"].join(" "),ghost:/* @__PURE__ */["text-(--plass-fg) bg-transparent","hover:bg-(--p-soft)","focus-within:bg-(--p-soft-hover)"].join(" ")};export const fieldReadOnlyClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)",forcedFieldEdgeClasses,"[box-shadow:var(--plass-well)] saturate-[0.55]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--plass-gloss-glass)] saturate-[0.55]"].join(" "),ghost:"text-(--plass-fg) bg-transparent saturate-[0.55]"};export function toLength(s){return"number"==typeof s?`${s}px`:s}export function hasContent(s){return null!=s&&!1!==s&&""!==s}export function cx(...s){return s.filter(Boolean).join(" ")}
|
|
1
|
+
export const radiusClasses={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-sm)",md:"rounded-(--plass-radius-md)",lg:"rounded-(--plass-radius-lg)",xl:"rounded-(--plass-radius-xl)"};export const controlHeightClasses={xs:"h-6",sm:"h-8",md:"h-10",lg:"h-12",xl:"h-14"};export const controlSquareClasses={xs:"w-6",sm:"w-8",md:"w-10",lg:"w-12",xl:"w-14"};export const controlTextClasses={xs:"text-[0.6875rem]",sm:"text-[0.8125rem]",md:"text-[0.875rem]",lg:"text-[1rem]",xl:"text-[1.125rem]"};export const controlTextLeadingClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.875rem]/[1.25rem]",lg:"text-[1rem]/[1.5rem]",xl:"text-[1.125rem]/[1.75rem]"};export const metaTextClasses={xs:"text-[0.625rem]",sm:"text-[0.6875rem]",md:"text-[0.75rem]",lg:"text-[0.8125rem]",xl:"text-[0.875rem]"};export const paddingXClasses={default:{xs:"px-2.5",sm:"px-3",md:"px-4",lg:"px-6",xl:"px-7"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3.5",xl:"px-4"}};export const iconSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-5",lg:"size-6",xl:"size-7"};export const tickSizeClasses={xs:"size-3.5",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-6"};export const tickRadiusClasses={xs:"rounded-[0.25rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"};export const tickDotClasses={xs:"size-0 data-[checked]:size-1.5",sm:"size-0 data-[checked]:size-1.5",md:"size-0 data-[checked]:size-2",lg:"size-0 data-[checked]:size-2",xl:"size-0 data-[checked]:size-2.5"};export const tickRowTextClasses=controlTextLeadingClasses;export const paddingXValues={default:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.5rem",xl:"1.75rem"},compact:{xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.875rem",xl:"1rem"}};export const gapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const stackGapClasses={xs:"gap-1",sm:"gap-1.5",md:"gap-1.5",lg:"gap-2",xl:"gap-2"};export const sheetPaddingXClasses={default:{xs:"px-2.5",sm:"px-3.5",md:"px-5",lg:"px-6",xl:"px-7"},compact:{xs:"px-2",sm:"px-2.5",md:"px-3.5",lg:"px-4",xl:"px-5"}};export const sheetPaddingYClasses={default:{xs:"py-2.5",sm:"py-3.5",md:"py-5",lg:"py-6",xl:"py-7"},compact:{xs:"py-2",sm:"py-2.5",md:"py-3.5",lg:"py-4",xl:"py-5"}};export const sheetTitleClasses={xs:"text-[0.75rem]/[1rem]",sm:"text-[0.8125rem]/[1.125rem]",md:"text-[0.9375rem]/[1.25rem]",lg:"text-[1.0625rem]/[1.5rem]",xl:"text-[1.25rem]/[1.75rem]"};export const sheetBodyClasses={xs:"text-[0.6875rem]/[1rem]",sm:"text-[0.75rem]/[1.125rem]",md:"text-[0.8125rem]/[1.375rem]",lg:"text-[0.9375rem]/[1.5rem]",xl:"text-[1.0625rem]/[1.75rem]"};export const sheetSectionGapClasses={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const sheetLineClasses="border-t [border-color:var(--plass-divider)]";export const sheetHeaderGapClasses={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const glassClasses="[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]";export const transitionClasses=/* @__PURE__ */["[transition-property:background-color,background-image,border-color,box-shadow,color,filter,opacity]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ");export const focusRingClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:0px]";export const focusWithinRingClasses="has-[:focus-visible]:[outline:2px_solid_var(--p-ring)] has-[:focus-visible]:[outline-offset:0px]";export const focusRingInsetClasses="focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]";export const chipRemoveClasses=/* @__PURE__ */["relative ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full","before:absolute before:inset-[calc(50%-12px)]","size-[1.15em] cursor-pointer opacity-70","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","hover:opacity-100 focus-visible:opacity-100",focusRingClasses,"disabled:cursor-not-allowed"].join(" ");export const iconClasses="[&_svg]:pointer-events-none [&_svg]:size-[1.2em] [&_svg]:shrink-0";export const srOnlyClasses="absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";export const srOnlyCopyClasses=`${srOnlyClasses} select-none`;export function controlSlots(s,e,o){const r="solid"===o;return{"--p-fill":`var(--plass-${s}-fill)`,"--p-on-solid":`var(--plass-${s}-on-solid)`,"--p-accent":`var(--plass-${s}-accent)`,"--p-tint":`var(--plass-${s}-tint)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-glow":r?"var(--plass-glow-on-fill)":`var(--plass-${s}-soft)`,"--p-flash":r?"var(--plass-flash-on-fill)":`var(--plass-${s}-soft-hover)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`,"--p-lift":"0 6px 16px -4px var(--p-tint)","--p-lift-hover":"0 10px 24px -6px var(--p-tint)","--p-lift-press":"0 2px 6px -2px var(--p-tint)"}}export function surfaceSlots(s,e){return{"--p-accent":`var(--plass-${s}-accent)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-hover":`var(--plass-${s}-soft-hover)`,"--p-soft-press":`var(--plass-${s}-soft-press)`,"--p-line":`var(--plass-${s}-line)`,"--p-line-hover":`var(--plass-${s}-line-hover)`,"--p-ring":`var(--plass-${s}-ring)`,"--p-glow":`var(--plass-${s}-soft)`,"--p-flash":`var(--plass-${s}-soft-hover)`,"--p-elev":`var(--plass-shadow-${e})`,"--p-elev-hover":`var(--plass-shadow-${Math.min(e+1,4)})`,"--p-elev-press":`var(--plass-shadow-${Math.max(e-1,0)})`}}export const forcedEdgeClasses="forced-colors:border forced-colors:[border-color:ButtonText]";export const forcedFieldEdgeClasses="forced-colors:border forced-colors:[border-color:CanvasText]";export const forcedFillClasses="forced-colors:[background-color:Highlight] forced-colors:[border-color:Highlight] forced-colors:[color:HighlightText]";export const forcedCheckedClasses=/* @__PURE__ */["forced-colors:data-[checked]:[background-color:Highlight]","forced-colors:data-[checked]:[border-color:Highlight]","forced-colors:data-[checked]:[color:HighlightText]"].join(" ");export const forcedPressedClasses=/* @__PURE__ */["forced-colors:data-[pressed]:[background-color:Highlight]","forced-colors:data-[pressed]:[border-color:Highlight]","forced-colors:data-[pressed]:[color:HighlightText]"].join(" ");export const forcedCheckedTextClasses="forced-colors:data-[checked]:[color:HighlightText]";export const forcedHighlightedClasses=/* @__PURE__ */["forced-colors:data-[highlighted]:[background-color:Highlight]","forced-colors:data-[highlighted]:[color:HighlightText]","forced-colors:data-[highlighted]:**:[color:HighlightText]"].join(" ");export const forcedDisabledCheckedClasses=/* @__PURE__ */["forced-colors:border forced-colors:[border-color:GrayText]","forced-colors:data-[checked]:[background-color:GrayText]","forced-colors:data-[checked]:[color:Canvas]"].join(" ");export const disabledClasses={solid:/* @__PURE__ */["cursor-not-allowed text-(--p-on-solid) [background-image:var(--p-fill)]","opacity-50 saturate-[0.35] shadow-none","forced-colors:border forced-colors:[border-color:GrayText]"].join(" "),glass:/* @__PURE__ */[glassClasses,"cursor-not-allowed border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-border)]","opacity-50 saturate-[0.35] shadow-none"].join(" "),ghost:"cursor-not-allowed bg-transparent text-(--p-accent) opacity-50 saturate-[0.35]"};export const readOnlyFilterClasses="saturate-[0.55]";export const sheetRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-transparent"};export const fieldRestClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-well)]",forcedFieldEdgeClasses,"hover:bg-(--plass-glass-hover)","focus-within:bg-(--plass-glass-press)"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]","hover:bg-(--plass-glass-press) hover:[border-color:var(--p-line)]","focus-within:bg-(--plass-glass-press) focus-within:[border-color:var(--p-line-hover)]"].join(" "),ghost:/* @__PURE__ */["text-(--plass-fg) bg-transparent","hover:bg-(--p-soft)","focus-within:bg-(--p-soft-hover)"].join(" ")};export const fieldReadOnlyClasses={solid:/* @__PURE__ */[glassClasses,"text-(--plass-fg) bg-(--plass-glass-press)",forcedFieldEdgeClasses,"[box-shadow:var(--plass-well)] saturate-[0.55]"].join(" "),glass:/* @__PURE__ */[glassClasses,"border text-(--plass-fg) bg-(--plass-glass-hover)","[border-color:var(--plass-border)]","[box-shadow:var(--plass-gloss-glass)] saturate-[0.55]"].join(" "),ghost:"text-(--plass-fg) bg-transparent saturate-[0.55]"};export function toLength(s){return"number"==typeof s?`${s}px`:s}export function hasContent(s){return null!=s&&!1!==s&&""!==s}export function cx(...s){return s.filter(Boolean).join(" ")}
|
package/dist/locales/de.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const de={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",acknowledge:"OK",clear:"Leeren",done:"Fertig",skip:"Überspringen",search:"Suchen",selectAll:"Alle auswählen",selectRow:"Zeile auswählen",remove:"Entfernen",dismiss:"Ausblenden",open:"Öffnen",previous:"Zurück",next:"Weiter",reveal:"Anzeigen",hide:"Verbergen",increase:"Erhöhen",decrease:"Verringern",preview:"Vorschau",empty:"Nichts vorhanden",optional:"Optional",breadcrumb:"Navigationspfad",breadcrumbExpand:"Ausgeblendete Schritte anzeigen",carousel:"Karussell",carouselPrevious:"Vorheriges Bild",carouselNext:"Nächstes Bild",slide:"Bild",commandPalette:"Befehlspalette",commandPalettePlaceholder:"Befehle durchsuchen",gallery:"Galerie",chart:"Diagramm",minimize:"Minimieren",maximize:"Maximieren",restore:"Wiederherstellen",resizeWindow:"Fenstergröße ändern",overlay:"Overlay",notifications:"Benachrichtigungen",pagination:"Seitennavigation",paginationPrevious:"Vorherige Seite",paginationNext:"Nächste Seite",paginationFirst:"Erste Seite",paginationLast:"Letzte Seite",rating:"Bewertung",sidebar:"Seitenleiste",sidebarOpen:"Seitenleiste öffnen",sidebarClose:"Seitenleiste schließen",sidebarResize:"Breite der Seitenleiste ändern",skipToContent:"Zum Inhalt springen",backToTop:"Nach oben",onThisPage:"Auf dieser Seite",typing:"Schreibt …",messageSending:"Wird gesendet",messageSent:"Gesendet",messageDelivered:"Zugestellt",messageRead:"Gelesen",messageFailed:"Nicht zugestellt",spoilerWarning:"Kann Spoiler enthalten",filePickerTitle:"Dateien hier ablegen oder zum Durchsuchen klicken",newTab:"(wird in einem neuen Tab geöffnet)",transferAvailable:"Verfügbar",transferSelected:"Ausgewählt",transferToSelected:"Zu den ausgewählten verschieben",transferToAvailable:"Zu den verfügbaren verschieben",copy:"Kopieren",copied:"Kopiert",copyFailed:"Kopieren nicht möglich",raw:"Unformatiert",code:"Code",previousMonth:"Vorheriger Monat",nextMonth:"Nächster Monat",previousYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",previousYears:"Vorherige Jahre",nextYears:"Nächste Jahre",chooseMonth:"Monat wählen",chooseYear:"Jahr wählen",today:"Heute",thisMonth:"Dieser Monat",thisYear:"Dieses Jahr",now:"Jetzt",hour:"Stunde",minute:"Minute",second:"Sekunde",meridiem:"AM/PM",start:"Beginn",end:"Ende",paginationPage:e=>`Seite ${e}`,paginationStatus:(e,n)=>`Seite ${e} von ${n}`,ratingValue:(e,n)=>`${e.toLocaleString("de")} von ${n}`,ratingNone:"Keine Bewertung",carouselSlide:(e,n)=>`Bild ${e} von ${n}`,galleryItem:(e,n)=>`${e} von ${n}`,removeItem:e=>`${e} entfernen`,addCustom:e=>`„${e}“ hinzufügen`,otpSlot:(e,n)=>`Zeichen ${e} von ${n}`,transferMoved:(e,n)=>`${e} ${1===e?"Eintrag":"Einträge"} nach „${n}“ verschoben`};
|
|
1
|
+
export const de={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",acknowledge:"OK",clear:"Leeren",done:"Fertig",skip:"Überspringen",search:"Suchen",selectAll:"Alle auswählen",selectRow:"Zeile auswählen",remove:"Entfernen",dismiss:"Ausblenden",open:"Öffnen",previous:"Zurück",next:"Weiter",reveal:"Anzeigen",hide:"Verbergen",increase:"Erhöhen",decrease:"Verringern",preview:"Vorschau",empty:"Nichts vorhanden",optional:"Optional",breadcrumb:"Navigationspfad",breadcrumbExpand:"Ausgeblendete Schritte anzeigen",carousel:"Karussell",carouselPrevious:"Vorheriges Bild",carouselNext:"Nächstes Bild",slide:"Bild",commandPalette:"Befehlspalette",commandPalettePlaceholder:"Befehle durchsuchen",gallery:"Galerie",chart:"Diagramm",minimize:"Minimieren",maximize:"Maximieren",restore:"Wiederherstellen",resizeWindow:"Fenstergröße ändern",overlay:"Overlay",notifications:"Benachrichtigungen",pagination:"Seitennavigation",paginationPrevious:"Vorherige Seite",paginationNext:"Nächste Seite",paginationFirst:"Erste Seite",paginationLast:"Letzte Seite",rating:"Bewertung",sidebar:"Seitenleiste",sidebarOpen:"Seitenleiste öffnen",sidebarClose:"Seitenleiste schließen",sidebarResize:"Breite der Seitenleiste ändern",skipToContent:"Zum Inhalt springen",backToTop:"Nach oben",onThisPage:"Auf dieser Seite",typing:"Schreibt …",messageSending:"Wird gesendet",messageSent:"Gesendet",messageDelivered:"Zugestellt",messageRead:"Gelesen",messageFailed:"Nicht zugestellt",spoilerWarning:"Kann Spoiler enthalten",filePickerTitle:"Dateien hier ablegen oder zum Durchsuchen klicken",newTab:"(wird in einem neuen Tab geöffnet)",transferAvailable:"Verfügbar",transferSelected:"Ausgewählt",transferToSelected:"Zu den ausgewählten verschieben",transferToAvailable:"Zu den verfügbaren verschieben",copy:"Kopieren",copied:"Kopiert",copyFailed:"Kopieren nicht möglich",raw:"Unformatiert",code:"Code",previousMonth:"Vorheriger Monat",nextMonth:"Nächster Monat",previousYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",previousYears:"Vorherige Jahre",nextYears:"Nächste Jahre",chooseMonth:"Monat wählen",chooseYear:"Jahr wählen",today:"Heute",thisMonth:"Dieser Monat",thisYear:"Dieses Jahr",now:"Jetzt",hour:"Stunde",minute:"Minute",second:"Sekunde",meridiem:"AM/PM",start:"Beginn",end:"Ende",paginationPage:e=>`Seite ${e}`,paginationStatus:(e,n)=>`Seite ${e} von ${n}`,ratingValue:(e,n)=>`${e.toLocaleString("de")} von ${n}`,ratingNone:"Keine Bewertung",carouselSlide:(e,n)=>`Bild ${e} von ${n}`,galleryItem:(e,n)=>`${e} von ${n}`,removeItem:e=>`${e} entfernen`,addCustom:e=>`„${e}“ hinzufügen`,otpSlot:(e,n)=>`Zeichen ${e} von ${n}`,transferMoved:(e,n)=>`${e} ${1===e?"Eintrag":"Einträge"} nach „${n}“ verschoben`,filesRejectedType:e=>`${e} ${1===e?"Datei hat":"Dateien haben"} keinen zulässigen Typ`,filesRejectedSize:e=>`${e} ${1===e?"Datei ist":"Dateien sind"} zu groß`,filesRejectedCount:e=>`Für ${e} ${1===e?"Datei":"Dateien"} war kein Platz mehr`};
|
package/dist/locales/es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const es={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",acknowledge:"Aceptar",clear:"Borrar",done:"Hecho",skip:"Omitir",search:"Buscar",selectAll:"Seleccionar todo",selectRow:"Seleccionar fila",remove:"Quitar",dismiss:"Descartar",open:"Abrir",previous:"Anterior",next:"Siguiente",reveal:"Mostrar",hide:"Ocultar",increase:"Aumentar",decrease:"Disminuir",preview:"Vista previa",empty:"No hay nada aquí",optional:"Opcional",breadcrumb:"Ruta de navegación",breadcrumbExpand:"Mostrar los pasos ocultos",carousel:"Carrusel",carouselPrevious:"Diapositiva anterior",carouselNext:"Diapositiva siguiente",slide:"diapositiva",commandPalette:"Paleta de comandos",commandPalettePlaceholder:"Buscar comandos",gallery:"Galería",chart:"Gráfico",minimize:"Minimizar",maximize:"Maximizar",restore:"Restaurar",resizeWindow:"Redimensionar la ventana",overlay:"Capa",notifications:"Notificaciones",pagination:"Paginación",paginationPrevious:"Página anterior",paginationNext:"Página siguiente",paginationFirst:"Primera página",paginationLast:"Última página",rating:"Valoración",sidebar:"Barra lateral",sidebarOpen:"Abrir la barra lateral",sidebarClose:"Cerrar la barra lateral",sidebarResize:"Redimensionar la barra lateral",skipToContent:"Saltar al contenido",backToTop:"Volver arriba",onThisPage:"En esta página",typing:"Escribiendo…",messageSending:"Enviando",messageSent:"Enviado",messageDelivered:"Entregado",messageRead:"Leído",messageFailed:"No entregado",spoilerWarning:"Puede contener spoilers",filePickerTitle:"Suelta archivos aquí o haz clic para buscarlos",newTab:"(se abre en una pestaña nueva)",transferAvailable:"Disponibles",transferSelected:"Seleccionados",transferToSelected:"Mover a seleccionados",transferToAvailable:"Mover a disponibles",copy:"Copiar",copied:"Copiado",copyFailed:"No se pudo copiar",raw:"Sin formato",code:"Código",previousMonth:"Mes anterior",nextMonth:"Mes siguiente",previousYear:"Año anterior",nextYear:"Año siguiente",previousYears:"Años anteriores",nextYears:"Años siguientes",chooseMonth:"Elegir un mes",chooseYear:"Elegir un año",today:"Hoy",thisMonth:"Este mes",thisYear:"Este año",now:"Ahora",hour:"Hora",minute:"Minuto",second:"Segundo",meridiem:"a. m./p. m.",start:"Inicio",end:"Fin",paginationPage:e=>`Página ${e}`,paginationStatus:(e,a)=>`Página ${e} de ${a}`,ratingValue:(e,a)=>`${e.toLocaleString("es")} de ${a}`,ratingNone:"Sin valoración",carouselSlide:(e,a)=>`Diapositiva ${e} de ${a}`,galleryItem:(e,a)=>`${e} de ${a}`,removeItem:e=>`Quitar ${e}`,addCustom:e=>`Añadir «${e}»`,otpSlot:(e,a)=>`Carácter ${e} de ${a}`,transferMoved:(e,a)=>`${e} ${1===e?"elemento movido":"elementos movidos"} a «${a}
|
|
1
|
+
export const es={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",acknowledge:"Aceptar",clear:"Borrar",done:"Hecho",skip:"Omitir",search:"Buscar",selectAll:"Seleccionar todo",selectRow:"Seleccionar fila",remove:"Quitar",dismiss:"Descartar",open:"Abrir",previous:"Anterior",next:"Siguiente",reveal:"Mostrar",hide:"Ocultar",increase:"Aumentar",decrease:"Disminuir",preview:"Vista previa",empty:"No hay nada aquí",optional:"Opcional",breadcrumb:"Ruta de navegación",breadcrumbExpand:"Mostrar los pasos ocultos",carousel:"Carrusel",carouselPrevious:"Diapositiva anterior",carouselNext:"Diapositiva siguiente",slide:"diapositiva",commandPalette:"Paleta de comandos",commandPalettePlaceholder:"Buscar comandos",gallery:"Galería",chart:"Gráfico",minimize:"Minimizar",maximize:"Maximizar",restore:"Restaurar",resizeWindow:"Redimensionar la ventana",overlay:"Capa",notifications:"Notificaciones",pagination:"Paginación",paginationPrevious:"Página anterior",paginationNext:"Página siguiente",paginationFirst:"Primera página",paginationLast:"Última página",rating:"Valoración",sidebar:"Barra lateral",sidebarOpen:"Abrir la barra lateral",sidebarClose:"Cerrar la barra lateral",sidebarResize:"Redimensionar la barra lateral",skipToContent:"Saltar al contenido",backToTop:"Volver arriba",onThisPage:"En esta página",typing:"Escribiendo…",messageSending:"Enviando",messageSent:"Enviado",messageDelivered:"Entregado",messageRead:"Leído",messageFailed:"No entregado",spoilerWarning:"Puede contener spoilers",filePickerTitle:"Suelta archivos aquí o haz clic para buscarlos",newTab:"(se abre en una pestaña nueva)",transferAvailable:"Disponibles",transferSelected:"Seleccionados",transferToSelected:"Mover a seleccionados",transferToAvailable:"Mover a disponibles",copy:"Copiar",copied:"Copiado",copyFailed:"No se pudo copiar",raw:"Sin formato",code:"Código",previousMonth:"Mes anterior",nextMonth:"Mes siguiente",previousYear:"Año anterior",nextYear:"Año siguiente",previousYears:"Años anteriores",nextYears:"Años siguientes",chooseMonth:"Elegir un mes",chooseYear:"Elegir un año",today:"Hoy",thisMonth:"Este mes",thisYear:"Este año",now:"Ahora",hour:"Hora",minute:"Minuto",second:"Segundo",meridiem:"a. m./p. m.",start:"Inicio",end:"Fin",paginationPage:e=>`Página ${e}`,paginationStatus:(e,a)=>`Página ${e} de ${a}`,ratingValue:(e,a)=>`${e.toLocaleString("es")} de ${a}`,ratingNone:"Sin valoración",carouselSlide:(e,a)=>`Diapositiva ${e} de ${a}`,galleryItem:(e,a)=>`${e} de ${a}`,removeItem:e=>`Quitar ${e}`,addCustom:e=>`Añadir «${e}»`,otpSlot:(e,a)=>`Carácter ${e} de ${a}`,transferMoved:(e,a)=>`${e} ${1===e?"elemento movido":"elementos movidos"} a «${a}»`,filesRejectedType:e=>`${e} ${1===e?"archivo no tiene":"archivos no tienen"} un tipo admitido`,filesRejectedSize:e=>`${e} ${1===e?"archivo es demasiado grande":"archivos son demasiado grandes"}`,filesRejectedCount:e=>`No había sitio para ${e} ${1===e?"archivo":"archivos"}`};
|
package/dist/locales/fr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const fr={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",acknowledge:"OK",clear:"Effacer",done:"Terminé",skip:"Ignorer",search:"Rechercher",selectAll:"Tout sélectionner",selectRow:"Sélectionner la ligne",remove:"Retirer",dismiss:"Masquer",open:"Ouvrir",previous:"Précédent",next:"Suivant",reveal:"Afficher",hide:"Masquer",increase:"Augmenter",decrease:"Diminuer",preview:"Aperçu",empty:"Rien ici",optional:"Facultatif",breadcrumb:"Fil d’Ariane",breadcrumbExpand:"Afficher les étapes masquées",carousel:"Carrousel",carouselPrevious:"Diapositive précédente",carouselNext:"Diapositive suivante",slide:"diapositive",commandPalette:"Palette de commandes",commandPalettePlaceholder:"Rechercher une commande",gallery:"Galerie",chart:"Graphique",minimize:"Réduire",maximize:"Agrandir",restore:"Restaurer",resizeWindow:"Redimensionner la fenêtre",overlay:"Voile",notifications:"Notifications",pagination:"Pagination",paginationPrevious:"Page précédente",paginationNext:"Page suivante",paginationFirst:"Première page",paginationLast:"Dernière page",rating:"Note",sidebar:"Barre latérale",sidebarOpen:"Ouvrir la barre latérale",sidebarClose:"Fermer la barre latérale",sidebarResize:"Redimensionner la barre latérale",skipToContent:"Aller au contenu",backToTop:"Revenir en haut",onThisPage:"Sur cette page",typing:"Écrit…",messageSending:"Envoi en cours",messageSent:"Envoyé",messageDelivered:"Distribué",messageRead:"Lu",messageFailed:"Non distribué",spoilerWarning:"Peut contenir des spoilers",filePickerTitle:"Déposez des fichiers ici ou cliquez pour parcourir",newTab:"(s’ouvre dans un nouvel onglet)",transferAvailable:"Disponibles",transferSelected:"Sélectionnés",transferToSelected:"Déplacer vers les sélectionnés",transferToAvailable:"Déplacer vers les disponibles",copy:"Copier",copied:"Copié",copyFailed:"Copie impossible",raw:"Brut",code:"Code",previousMonth:"Mois précédent",nextMonth:"Mois suivant",previousYear:"Année précédente",nextYear:"Année suivante",previousYears:"Années précédentes",nextYears:"Années suivantes",chooseMonth:"Choisir un mois",chooseYear:"Choisir une année",today:"Aujourd’hui",thisMonth:"Ce mois-ci",thisYear:"Cette année",now:"Maintenant",hour:"Heure",minute:"Minute",second:"Seconde",meridiem:"AM/PM",start:"Début",end:"Fin",paginationPage:e=>`Page ${e}`,paginationStatus:(e,
|
|
1
|
+
export const fr={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",acknowledge:"OK",clear:"Effacer",done:"Terminé",skip:"Ignorer",search:"Rechercher",selectAll:"Tout sélectionner",selectRow:"Sélectionner la ligne",remove:"Retirer",dismiss:"Masquer",open:"Ouvrir",previous:"Précédent",next:"Suivant",reveal:"Afficher",hide:"Masquer",increase:"Augmenter",decrease:"Diminuer",preview:"Aperçu",empty:"Rien ici",optional:"Facultatif",breadcrumb:"Fil d’Ariane",breadcrumbExpand:"Afficher les étapes masquées",carousel:"Carrousel",carouselPrevious:"Diapositive précédente",carouselNext:"Diapositive suivante",slide:"diapositive",commandPalette:"Palette de commandes",commandPalettePlaceholder:"Rechercher une commande",gallery:"Galerie",chart:"Graphique",minimize:"Réduire",maximize:"Agrandir",restore:"Restaurer",resizeWindow:"Redimensionner la fenêtre",overlay:"Voile",notifications:"Notifications",pagination:"Pagination",paginationPrevious:"Page précédente",paginationNext:"Page suivante",paginationFirst:"Première page",paginationLast:"Dernière page",rating:"Note",sidebar:"Barre latérale",sidebarOpen:"Ouvrir la barre latérale",sidebarClose:"Fermer la barre latérale",sidebarResize:"Redimensionner la barre latérale",skipToContent:"Aller au contenu",backToTop:"Revenir en haut",onThisPage:"Sur cette page",typing:"Écrit…",messageSending:"Envoi en cours",messageSent:"Envoyé",messageDelivered:"Distribué",messageRead:"Lu",messageFailed:"Non distribué",spoilerWarning:"Peut contenir des spoilers",filePickerTitle:"Déposez des fichiers ici ou cliquez pour parcourir",newTab:"(s’ouvre dans un nouvel onglet)",transferAvailable:"Disponibles",transferSelected:"Sélectionnés",transferToSelected:"Déplacer vers les sélectionnés",transferToAvailable:"Déplacer vers les disponibles",copy:"Copier",copied:"Copié",copyFailed:"Copie impossible",raw:"Brut",code:"Code",previousMonth:"Mois précédent",nextMonth:"Mois suivant",previousYear:"Année précédente",nextYear:"Année suivante",previousYears:"Années précédentes",nextYears:"Années suivantes",chooseMonth:"Choisir un mois",chooseYear:"Choisir une année",today:"Aujourd’hui",thisMonth:"Ce mois-ci",thisYear:"Cette année",now:"Maintenant",hour:"Heure",minute:"Minute",second:"Seconde",meridiem:"AM/PM",start:"Début",end:"Fin",paginationPage:e=>`Page ${e}`,paginationStatus:(e,i)=>`Page ${e} sur ${i}`,ratingValue:(e,i)=>`${e.toLocaleString("fr")} sur ${i}`,ratingNone:"Aucune note",carouselSlide:(e,i)=>`Diapositive ${e} sur ${i}`,galleryItem:(e,i)=>`${e} sur ${i}`,removeItem:e=>`Retirer ${e}`,addCustom:e=>`Ajouter « ${e} »`,otpSlot:(e,i)=>`Caractère ${e} sur ${i}`,transferMoved:(e,i)=>`${e} ${1===e?"élément déplacé":"éléments déplacés"} vers « ${i} »`,filesRejectedType:e=>`${e} ${1===e?"fichier n'a pas":"fichiers n'ont pas"} un type accepté`,filesRejectedSize:e=>`${e} ${1===e?"fichier est trop volumineux":"fichiers sont trop volumineux"}`,filesRejectedCount:e=>`Il n'y avait plus de place pour ${e} ${1===e?"fichier":"fichiers"}`};
|
package/dist/locales/ja.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ja={close:"閉じる",cancel:"キャンセル",confirm:"確認",acknowledge:"OK",clear:"クリア",done:"完了",skip:"スキップ",search:"検索",selectAll:"すべて選択",selectRow:"行を選択",remove:"削除",dismiss:"閉じる",open:"開く",previous:"前へ",next:"次へ",reveal:"表示",hide:"非表示",increase:"増やす",decrease:"減らす",preview:"プレビュー",empty:"項目がありません",optional:"任意",breadcrumb:"パンくずリスト",breadcrumbExpand:"省略された階層を表示",carousel:"カルーセル",carouselPrevious:"前のスライド",carouselNext:"次のスライド",slide:"スライド",commandPalette:"コマンドパレット",commandPalettePlaceholder:"コマンドを検索",gallery:"ギャラリー",chart:"グラフ",minimize:"最小化",maximize:"最大化",restore:"元に戻す",resizeWindow:"ウィンドウのサイズを変更",overlay:"オーバーレイ",notifications:"通知",pagination:"ページ送り",paginationPrevious:"前のページ",paginationNext:"次のページ",paginationFirst:"最初のページ",paginationLast:"最後のページ",rating:"評価",sidebar:"サイドバー",sidebarOpen:"サイドバーを開く",sidebarClose:"サイドバーを閉じる",sidebarResize:"サイドバーの幅を変更",skipToContent:"本文へスキップ",backToTop:"ページの先頭へ",onThisPage:"このページの目次",typing:"入力中…",messageSending:"送信中",messageSent:"送信済み",messageDelivered:"配信済み",messageRead:"既読",messageFailed:"未配信",spoilerWarning:"ネタバレを含む可能性があります",filePickerTitle:"ここにファイルをドロップするか、クリックして選択",newTab:"(新しいタブで開きます)",transferAvailable:"未選択",transferSelected:"選択済み",transferToSelected:"選択済みへ移動",transferToAvailable:"未選択へ移動",copy:"コピー",copied:"コピーしました",copyFailed:"コピーできません",raw:"元のまま",code:"コード",previousMonth:"前の月",nextMonth:"次の月",previousYear:"前の年",nextYear:"次の年",previousYears:"前の年一覧",nextYears:"次の年一覧",chooseMonth:"月を選択",chooseYear:"年を選択",today:"今日",thisMonth:"今月",thisYear:"今年",now:"現在",hour:"時",minute:"分",second:"秒",meridiem:"午前/午後",start:"開始",end:"終了",paginationPage:e=>`${e}ページ`,paginationStatus:(e,a)=>`${a}ページ中${e}ページ`,ratingValue:(e,a)=>`${a}点中${e.toLocaleString("ja")}点`,ratingNone:"評価なし",carouselSlide:(e,a)=>`${a}枚中${e}枚目のスライド`,galleryItem:(e,a)=>`${a}枚中${e}枚目`,removeItem:e=>`${e}を削除`,addCustom:e=>`「${e}」を追加`,otpSlot:(e,a)=>`${a}桁中${e}桁目`,transferMoved:(e,a)=>`${e}件を「${a}
|
|
1
|
+
export const ja={close:"閉じる",cancel:"キャンセル",confirm:"確認",acknowledge:"OK",clear:"クリア",done:"完了",skip:"スキップ",search:"検索",selectAll:"すべて選択",selectRow:"行を選択",remove:"削除",dismiss:"閉じる",open:"開く",previous:"前へ",next:"次へ",reveal:"表示",hide:"非表示",increase:"増やす",decrease:"減らす",preview:"プレビュー",empty:"項目がありません",optional:"任意",breadcrumb:"パンくずリスト",breadcrumbExpand:"省略された階層を表示",carousel:"カルーセル",carouselPrevious:"前のスライド",carouselNext:"次のスライド",slide:"スライド",commandPalette:"コマンドパレット",commandPalettePlaceholder:"コマンドを検索",gallery:"ギャラリー",chart:"グラフ",minimize:"最小化",maximize:"最大化",restore:"元に戻す",resizeWindow:"ウィンドウのサイズを変更",overlay:"オーバーレイ",notifications:"通知",pagination:"ページ送り",paginationPrevious:"前のページ",paginationNext:"次のページ",paginationFirst:"最初のページ",paginationLast:"最後のページ",rating:"評価",sidebar:"サイドバー",sidebarOpen:"サイドバーを開く",sidebarClose:"サイドバーを閉じる",sidebarResize:"サイドバーの幅を変更",skipToContent:"本文へスキップ",backToTop:"ページの先頭へ",onThisPage:"このページの目次",typing:"入力中…",messageSending:"送信中",messageSent:"送信済み",messageDelivered:"配信済み",messageRead:"既読",messageFailed:"未配信",spoilerWarning:"ネタバレを含む可能性があります",filePickerTitle:"ここにファイルをドロップするか、クリックして選択",newTab:"(新しいタブで開きます)",transferAvailable:"未選択",transferSelected:"選択済み",transferToSelected:"選択済みへ移動",transferToAvailable:"未選択へ移動",copy:"コピー",copied:"コピーしました",copyFailed:"コピーできません",raw:"元のまま",code:"コード",previousMonth:"前の月",nextMonth:"次の月",previousYear:"前の年",nextYear:"次の年",previousYears:"前の年一覧",nextYears:"次の年一覧",chooseMonth:"月を選択",chooseYear:"年を選択",today:"今日",thisMonth:"今月",thisYear:"今年",now:"現在",hour:"時",minute:"分",second:"秒",meridiem:"午前/午後",start:"開始",end:"終了",paginationPage:e=>`${e}ページ`,paginationStatus:(e,a)=>`${a}ページ中${e}ページ`,ratingValue:(e,a)=>`${a}点中${e.toLocaleString("ja")}点`,ratingNone:"評価なし",carouselSlide:(e,a)=>`${a}枚中${e}枚目のスライド`,galleryItem:(e,a)=>`${a}枚中${e}枚目`,removeItem:e=>`${e}を削除`,addCustom:e=>`「${e}」を追加`,otpSlot:(e,a)=>`${a}桁中${e}桁目`,transferMoved:(e,a)=>`${e}件を「${a}」に移動しました`,filesRejectedType:e=>`${e}件は受け付けられない種類です`,filesRejectedSize:e=>`${e}件は大きすぎます`,filesRejectedCount:e=>`${e}件は入りきりませんでした`};
|
package/dist/locales/ko.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ko={close:"닫기",cancel:"취소",confirm:"확인",acknowledge:"확인",clear:"지우기",done:"완료",skip:"건너뛰기",search:"검색",selectAll:"전체 선택",selectRow:"행 선택",remove:"삭제",dismiss:"닫기",open:"열기",previous:"이전",next:"다음",reveal:"보기",hide:"숨기기",increase:"늘리기",decrease:"줄이기",preview:"미리 보기",empty:"항목 없음",optional:"선택 사항",breadcrumb:"탐색 경로",breadcrumbExpand:"숨겨진 단계 보기",carousel:"캐러셀",carouselPrevious:"이전 슬라이드",carouselNext:"다음 슬라이드",slide:"슬라이드",commandPalette:"명령 팔레트",commandPalettePlaceholder:"명령 검색",gallery:"갤러리",chart:"차트",minimize:"최소화",maximize:"최대화",restore:"이전 크기로",resizeWindow:"창 크기 조절",overlay:"오버레이",notifications:"알림",pagination:"페이지 이동",paginationPrevious:"이전 페이지",paginationNext:"다음 페이지",paginationFirst:"첫 페이지",paginationLast:"마지막 페이지",rating:"별점",sidebar:"사이드바",sidebarOpen:"사이드바 열기",sidebarClose:"사이드바 닫기",sidebarResize:"사이드바 크기 조절",skipToContent:"본문으로 건너뛰기",backToTop:"맨 위로",onThisPage:"이 페이지의 목차",typing:"입력 중…",messageSending:"보내는 중",messageSent:"보냄",messageDelivered:"전달됨",messageRead:"읽음",messageFailed:"전달되지 않음",spoilerWarning:"스포일러가 있을 수 있습니다",filePickerTitle:"파일을 여기에 놓거나 클릭해서 찾아보세요",newTab:"(새 탭에서 열림)",transferAvailable:"사용 가능",transferSelected:"선택됨",transferToSelected:"선택 목록으로 옮기기",transferToAvailable:"사용 가능 목록으로 옮기기",copy:"복사",copied:"복사됨",copyFailed:"복사할 수 없음",raw:"원본",code:"코드",previousMonth:"이전 달",nextMonth:"다음 달",previousYear:"이전 해",nextYear:"다음 해",previousYears:"이전 연도 목록",nextYears:"다음 연도 목록",chooseMonth:"월 선택",chooseYear:"연도 선택",today:"오늘",thisMonth:"이번 달",thisYear:"올해",now:"지금",hour:"시",minute:"분",second:"초",meridiem:"오전/오후",start:"시작",end:"종료",paginationPage:e=>`${e}페이지`,paginationStatus:(e,a)=>`${a}페이지 중 ${e}페이지`,ratingValue:(e,a)=>`${a}점 만점에 ${e.toLocaleString("ko")}점`,ratingNone:"별점 없음",carouselSlide:(e,a)=>`${a}개 중 ${e}번째 슬라이드`,galleryItem:(e,a)=>`${a}장 중 ${e}번째`,removeItem:e=>`${e} 삭제`,addCustom:e=>`“${e}” 추가`,otpSlot:(e,a)=>`${a}자리 중 ${e}번째`,transferMoved:(e,a)=>`‘${a}’ 목록으로 ${e}개를
|
|
1
|
+
export const ko={close:"닫기",cancel:"취소",confirm:"확인",acknowledge:"확인",clear:"지우기",done:"완료",skip:"건너뛰기",search:"검색",selectAll:"전체 선택",selectRow:"행 선택",remove:"삭제",dismiss:"닫기",open:"열기",previous:"이전",next:"다음",reveal:"보기",hide:"숨기기",increase:"늘리기",decrease:"줄이기",preview:"미리 보기",empty:"항목 없음",optional:"선택 사항",breadcrumb:"탐색 경로",breadcrumbExpand:"숨겨진 단계 보기",carousel:"캐러셀",carouselPrevious:"이전 슬라이드",carouselNext:"다음 슬라이드",slide:"슬라이드",commandPalette:"명령 팔레트",commandPalettePlaceholder:"명령 검색",gallery:"갤러리",chart:"차트",minimize:"최소화",maximize:"최대화",restore:"이전 크기로",resizeWindow:"창 크기 조절",overlay:"오버레이",notifications:"알림",pagination:"페이지 이동",paginationPrevious:"이전 페이지",paginationNext:"다음 페이지",paginationFirst:"첫 페이지",paginationLast:"마지막 페이지",rating:"별점",sidebar:"사이드바",sidebarOpen:"사이드바 열기",sidebarClose:"사이드바 닫기",sidebarResize:"사이드바 크기 조절",skipToContent:"본문으로 건너뛰기",backToTop:"맨 위로",onThisPage:"이 페이지의 목차",typing:"입력 중…",messageSending:"보내는 중",messageSent:"보냄",messageDelivered:"전달됨",messageRead:"읽음",messageFailed:"전달되지 않음",spoilerWarning:"스포일러가 있을 수 있습니다",filePickerTitle:"파일을 여기에 놓거나 클릭해서 찾아보세요",newTab:"(새 탭에서 열림)",transferAvailable:"사용 가능",transferSelected:"선택됨",transferToSelected:"선택 목록으로 옮기기",transferToAvailable:"사용 가능 목록으로 옮기기",copy:"복사",copied:"복사됨",copyFailed:"복사할 수 없음",raw:"원본",code:"코드",previousMonth:"이전 달",nextMonth:"다음 달",previousYear:"이전 해",nextYear:"다음 해",previousYears:"이전 연도 목록",nextYears:"다음 연도 목록",chooseMonth:"월 선택",chooseYear:"연도 선택",today:"오늘",thisMonth:"이번 달",thisYear:"올해",now:"지금",hour:"시",minute:"분",second:"초",meridiem:"오전/오후",start:"시작",end:"종료",paginationPage:e=>`${e}페이지`,paginationStatus:(e,a)=>`${a}페이지 중 ${e}페이지`,ratingValue:(e,a)=>`${a}점 만점에 ${e.toLocaleString("ko")}점`,ratingNone:"별점 없음",carouselSlide:(e,a)=>`${a}개 중 ${e}번째 슬라이드`,galleryItem:(e,a)=>`${a}장 중 ${e}번째`,removeItem:e=>`${e} 삭제`,addCustom:e=>`“${e}” 추가`,otpSlot:(e,a)=>`${a}자리 중 ${e}번째`,transferMoved:(e,a)=>`‘${a}’ 목록으로 ${e}개를 옮겼습니다`,filesRejectedType:e=>`${e}개는 받지 않는 형식입니다`,filesRejectedSize:e=>`${e}개는 너무 큽니다`,filesRejectedCount:e=>`${e}개는 더 담을 수 없습니다`};
|
package/dist/locales/zh-Hans.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const zhHans={close:"关闭",cancel:"取消",confirm:"确认",acknowledge:"确定",clear:"清除",done:"完成",skip:"跳过",search:"搜索",selectAll:"全选",selectRow:"选择该行",remove:"移除",dismiss:"关闭",open:"打开",previous:"上一个",next:"下一个",reveal:"显示",hide:"隐藏",increase:"增加",decrease:"减少",preview:"预览",empty:"暂无内容",optional:"可选",breadcrumb:"面包屑导航",breadcrumbExpand:"显示折叠的层级",carousel:"轮播",carouselPrevious:"上一张",carouselNext:"下一张",slide:"幻灯片",commandPalette:"命令面板",commandPalettePlaceholder:"搜索命令",gallery:"图库",chart:"图表",minimize:"最小化",maximize:"最大化",restore:"还原",resizeWindow:"调整窗口大小",overlay:"遮罩",notifications:"通知",pagination:"分页",paginationPrevious:"上一页",paginationNext:"下一页",paginationFirst:"第一页",paginationLast:"最后一页",rating:"评分",sidebar:"侧边栏",sidebarOpen:"打开侧边栏",sidebarClose:"关闭侧边栏",sidebarResize:"调整侧边栏宽度",skipToContent:"跳到主要内容",backToTop:"回到顶部",onThisPage:"本页目录",typing:"正在输入…",messageSending:"发送中",messageSent:"已发送",messageDelivered:"已送达",messageRead:"已读",messageFailed:"未送达",spoilerWarning:"可能包含剧透",filePickerTitle:"将文件拖到此处,或点击浏览",newTab:"(在新标签页中打开)",transferAvailable:"可选",transferSelected:"已选",transferToSelected:"移到已选",transferToAvailable:"移到可选",copy:"复制",copied:"已复制",copyFailed:"无法复制",raw:"原始",code:"代码",previousMonth:"上个月",nextMonth:"下个月",previousYear:"上一年",nextYear:"下一年",previousYears:"上一组年份",nextYears:"下一组年份",chooseMonth:"选择月份",chooseYear:"选择年份",today:"今天",thisMonth:"本月",thisYear:"今年",now:"此刻",hour:"时",minute:"分",second:"秒",meridiem:"上午/下午",start:"开始",end:"结束",paginationPage:e=>`第${e}页`,paginationStatus:(e,a)=>`第${e}页,共${a}页`,ratingValue:(e,a)=>`${e.toLocaleString("zh-Hans")}分,满分${a}分`,ratingNone:"未评分",carouselSlide:(e,a)=>`第${e}张,共${a}张`,galleryItem:(e,a)=>`第${e}张,共${a}张`,removeItem:e=>`移除${e}`,addCustom:e=>`添加“${e}”`,otpSlot:(e,a)=>`第${e}位,共${a}位`,transferMoved:(e,a)=>`已将${e}项移到“${a}
|
|
1
|
+
export const zhHans={close:"关闭",cancel:"取消",confirm:"确认",acknowledge:"确定",clear:"清除",done:"完成",skip:"跳过",search:"搜索",selectAll:"全选",selectRow:"选择该行",remove:"移除",dismiss:"关闭",open:"打开",previous:"上一个",next:"下一个",reveal:"显示",hide:"隐藏",increase:"增加",decrease:"减少",preview:"预览",empty:"暂无内容",optional:"可选",breadcrumb:"面包屑导航",breadcrumbExpand:"显示折叠的层级",carousel:"轮播",carouselPrevious:"上一张",carouselNext:"下一张",slide:"幻灯片",commandPalette:"命令面板",commandPalettePlaceholder:"搜索命令",gallery:"图库",chart:"图表",minimize:"最小化",maximize:"最大化",restore:"还原",resizeWindow:"调整窗口大小",overlay:"遮罩",notifications:"通知",pagination:"分页",paginationPrevious:"上一页",paginationNext:"下一页",paginationFirst:"第一页",paginationLast:"最后一页",rating:"评分",sidebar:"侧边栏",sidebarOpen:"打开侧边栏",sidebarClose:"关闭侧边栏",sidebarResize:"调整侧边栏宽度",skipToContent:"跳到主要内容",backToTop:"回到顶部",onThisPage:"本页目录",typing:"正在输入…",messageSending:"发送中",messageSent:"已发送",messageDelivered:"已送达",messageRead:"已读",messageFailed:"未送达",spoilerWarning:"可能包含剧透",filePickerTitle:"将文件拖到此处,或点击浏览",newTab:"(在新标签页中打开)",transferAvailable:"可选",transferSelected:"已选",transferToSelected:"移到已选",transferToAvailable:"移到可选",copy:"复制",copied:"已复制",copyFailed:"无法复制",raw:"原始",code:"代码",previousMonth:"上个月",nextMonth:"下个月",previousYear:"上一年",nextYear:"下一年",previousYears:"上一组年份",nextYears:"下一组年份",chooseMonth:"选择月份",chooseYear:"选择年份",today:"今天",thisMonth:"本月",thisYear:"今年",now:"此刻",hour:"时",minute:"分",second:"秒",meridiem:"上午/下午",start:"开始",end:"结束",paginationPage:e=>`第${e}页`,paginationStatus:(e,a)=>`第${e}页,共${a}页`,ratingValue:(e,a)=>`${e.toLocaleString("zh-Hans")}分,满分${a}分`,ratingNone:"未评分",carouselSlide:(e,a)=>`第${e}张,共${a}张`,galleryItem:(e,a)=>`第${e}张,共${a}张`,removeItem:e=>`移除${e}`,addCustom:e=>`添加“${e}”`,otpSlot:(e,a)=>`第${e}位,共${a}位`,transferMoved:(e,a)=>`已将${e}项移到“${a}”`,filesRejectedType:e=>`${e}个文件的类型不受支持`,filesRejectedSize:e=>`${e}个文件过大`,filesRejectedCount:e=>`还有${e}个文件放不下`};
|
|
@@ -18,8 +18,9 @@ export interface PlassProviderProps extends PlassDefaults {
|
|
|
18
18
|
* </PlassProvider>
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
-
* **It sets `size`, `color`, `density` and the date
|
|
22
|
-
* deliberately does not set `variant` or `elevation`.**
|
|
21
|
+
* **It sets `size`, `color`, `density`, `labelPlacement` and the date
|
|
22
|
+
* vocabulary, and it deliberately does not set `variant` or `elevation`.**
|
|
23
|
+
* Those two name what a
|
|
23
24
|
* surface is *made of* and how far off the page it sits, and both are decided
|
|
24
25
|
* per component by the design language rather than per application: a button is
|
|
25
26
|
* `solid` and rests on the sheet, a field is cut into it. One value for all of
|
|
@@ -36,4 +37,4 @@ export interface PlassProviderProps extends PlassDefaults {
|
|
|
36
37
|
* all still be running left to right under a right-to-left page. See
|
|
37
38
|
* `internal/direction.ts`.
|
|
38
39
|
*/
|
|
39
|
-
export declare function PlassProvider({ size, color, density, locale, weekStartsOn, labels, direction, children }: PlassProviderProps): React.JSX.Element;
|
|
40
|
+
export declare function PlassProvider({ size, color, density, labelPlacement, locale, weekStartsOn, labels, direction, children }: PlassProviderProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{DirectionProvider as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{DirectionProvider as t}from"@base-ui/react/direction-provider";import{DefaultsContext as i}from"../internal/defaults.js";import{useDocumentDirection as l}from"../internal/direction.js";export function PlassProvider({size:o,color:n,density:a,labelPlacement:s,locale:c,weekStartsOn:d,labels:m,direction:b,children:u}){const f=r.useContext(i),p=r.useMemo(()=>({size:o??f.size,color:n??f.color,density:a??f.density,labelPlacement:s??f.labelPlacement,locale:c??f.locale,weekStartsOn:d??f.weekStartsOn,labels:m&&f.labels?{...f.labels,...m}:m??f.labels,direction:b??f.direction}),[o,n,a,s,c,d,m,b,f]),P=l();return e(t,{direction:p.direction??P,children:e(i.Provider,{value:p,children:u})})}
|