plass-ui 1.5.0 → 1.7.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.
Files changed (183) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/README.md +29 -7
  3. package/dist/components/accordion/PlAccordion.d.ts +13 -0
  4. package/dist/components/accordion/PlAccordion.js +1 -1
  5. package/dist/components/accordion/index.d.ts +1 -1
  6. package/dist/components/alert/PlAlert.js +1 -1
  7. package/dist/components/animate-counter/PlAnimateCounter.js +1 -1
  8. package/dist/components/animate-float/PlAnimateFloat.js +1 -1
  9. package/dist/components/animate-headline/PlAnimateHeadline.d.ts +10 -1
  10. package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +11 -1
  11. package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
  12. package/dist/components/animate-scramble/PlAnimateScramble.js +1 -1
  13. package/dist/components/animate-split/PlAnimateSplit.js +1 -1
  14. package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
  15. package/dist/components/app-logo/PlAppLogo.js +1 -1
  16. package/dist/components/area-chart/PlAreaChart.d.ts +35 -6
  17. package/dist/components/area-chart/PlAreaChart.js +1 -1
  18. package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
  19. package/dist/components/avatar/PlAvatar.js +1 -1
  20. package/dist/components/back-top/PlBackTop.d.ts +6 -0
  21. package/dist/components/back-top/PlBackTop.js +1 -1
  22. package/dist/components/badge/PlBadge.js +1 -1
  23. package/dist/components/bar-chart/PlBarChart.d.ts +54 -2
  24. package/dist/components/bar-chart/PlBarChart.js +1 -1
  25. package/dist/components/blockquote/PlBlockquote.d.ts +2 -2
  26. package/dist/components/blockquote/PlBlockquote.js +1 -1
  27. package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
  28. package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
  29. package/dist/components/button/PlButton.d.ts +7 -0
  30. package/dist/components/button/PlButton.js +1 -1
  31. package/dist/components/calendar/PlCalendar.js +1 -1
  32. package/dist/components/card/PlCard.d.ts +7 -4
  33. package/dist/components/carousel/PlCarousel.d.ts +14 -4
  34. package/dist/components/carousel/PlCarousel.js +1 -1
  35. package/dist/components/chat-bubble/PlChatBubble.js +1 -1
  36. package/dist/components/checkbox/PlCheckbox.js +1 -1
  37. package/dist/components/chip/PlChip.d.ts +2 -1
  38. package/dist/components/chip/PlChip.js +1 -1
  39. package/dist/components/collapsible/PlCollapsible.d.ts +11 -0
  40. package/dist/components/collapsible/PlCollapsible.js +1 -1
  41. package/dist/components/color-picker/PlColorPicker.d.ts +21 -2
  42. package/dist/components/color-picker/PlColorPicker.js +1 -1
  43. package/dist/components/combobox/PlCombobox.d.ts +18 -6
  44. package/dist/components/combobox/PlCombobox.js +1 -1
  45. package/dist/components/command-palette/PlCommandPalette.js +1 -1
  46. package/dist/components/confirm/PlConfirmProvider.js +1 -1
  47. package/dist/components/data-table/PlDataTable.d.ts +13 -2
  48. package/dist/components/data-table/PlDataTable.js +1 -1
  49. package/dist/components/date-picker/PlDatePicker.js +1 -1
  50. package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
  51. package/dist/components/drawer/PlDrawer.js +1 -1
  52. package/dist/components/empty/PlEmpty.js +1 -1
  53. package/dist/components/fieldset/PlFieldset.js +1 -1
  54. package/dist/components/file-picker/PlFilePicker.d.ts +20 -2
  55. package/dist/components/file-picker/PlFilePicker.js +1 -1
  56. package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +5 -0
  57. package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -1
  58. package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
  59. package/dist/components/footer/PlFooter.d.ts +3 -1
  60. package/dist/components/gallery/PlGallery.js +1 -1
  61. package/dist/components/gauge-chart/PlGaugeChart.js +1 -1
  62. package/dist/components/header/PlHeader.d.ts +4 -2
  63. package/dist/components/header/PlHeader.js +1 -1
  64. package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -1
  65. package/dist/components/highlight/PlHighlight.d.ts +10 -3
  66. package/dist/components/hover-card/PlHoverCard.js +1 -1
  67. package/dist/components/how-to-steps/PlHowToSteps.js +1 -1
  68. package/dist/components/image/PlImage.js +1 -1
  69. package/dist/components/line-chart/PlLineChart.d.ts +32 -6
  70. package/dist/components/line-chart/PlLineChart.js +1 -1
  71. package/dist/components/list/PlList.js +1 -1
  72. package/dist/components/menu/PlMenu.js +1 -1
  73. package/dist/components/mockup/PlMockup.d.ts +5 -0
  74. package/dist/components/mockup/PlMockup.js +1 -1
  75. package/dist/components/modal/PlModal.js +1 -1
  76. package/dist/components/navigation-menu/PlNavigationMenu.d.ts +4 -3
  77. package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
  78. package/dist/components/number-field/PlNumberField.d.ts +14 -4
  79. package/dist/components/number-field/PlNumberField.js +1 -1
  80. package/dist/components/otp-field/PlOtpField.d.ts +9 -1
  81. package/dist/components/otp-field/PlOtpField.js +1 -1
  82. package/dist/components/overlay/PlOverlay.js +1 -1
  83. package/dist/components/page-layout/PlPageLayout.d.ts +14 -3
  84. package/dist/components/page-layout/PlPageLayout.js +1 -1
  85. package/dist/components/pagination/PlPagination.js +1 -1
  86. package/dist/components/panes/PlPanes.js +1 -1
  87. package/dist/components/pie-chart/PlPieChart.d.ts +26 -1
  88. package/dist/components/pie-chart/PlPieChart.js +1 -1
  89. package/dist/components/pill/PlPill.js +1 -1
  90. package/dist/components/popconfirm/PlPopconfirm.d.ts +8 -1
  91. package/dist/components/popconfirm/PlPopconfirm.js +1 -1
  92. package/dist/components/popover/PlPopover.js +1 -1
  93. package/dist/components/progress-box/PlProgressBox.js +1 -1
  94. package/dist/components/progress-circular/PlProgressCircular.js +1 -1
  95. package/dist/components/progress-linear/PlProgressLinear.js +1 -1
  96. package/dist/components/radio-group/PlRadioGroup.js +1 -1
  97. package/dist/components/rating/PlRating.js +1 -1
  98. package/dist/components/scatter-chart/PlScatterChart.js +1 -1
  99. package/dist/components/scroll-area/PlScrollArea.js +1 -1
  100. package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
  101. package/dist/components/select/PlSelect.d.ts +11 -2
  102. package/dist/components/select/PlSelect.js +1 -1
  103. package/dist/components/sidebar/PlSidebar.js +1 -1
  104. package/dist/components/slider/PlSlider.js +1 -1
  105. package/dist/components/sparkline/PlSparkline.js +1 -1
  106. package/dist/components/stepper/PlStepper.js +1 -1
  107. package/dist/components/switch/PlSwitch.js +1 -1
  108. package/dist/components/table/PlTable.d.ts +11 -1
  109. package/dist/components/table/PlTable.js +1 -1
  110. package/dist/components/tabs/PlTabs.d.ts +18 -1
  111. package/dist/components/tabs/PlTabs.js +1 -1
  112. package/dist/components/text-field/PlTextField.d.ts +13 -5
  113. package/dist/components/text-field/PlTextField.js +1 -1
  114. package/dist/components/text-link/PlTextLink.js +1 -1
  115. package/dist/components/timeline/PlTimeline.js +1 -1
  116. package/dist/components/timeline-chart/PlTimelineChart.js +1 -1
  117. package/dist/components/toast/PlToast.js +1 -1
  118. package/dist/components/toggle/PlToggle.js +1 -1
  119. package/dist/components/tooltip/PlTooltip.d.ts +4 -0
  120. package/dist/components/tooltip/PlTooltip.js +1 -1
  121. package/dist/components/tour/PlTour.js +1 -1
  122. package/dist/components/transfer/PlTransfer.d.ts +5 -2
  123. package/dist/components/transfer/PlTransfer.js +1 -1
  124. package/dist/components/tree/PlTree.js +1 -1
  125. package/dist/components/tree-select/PlTreeSelect.js +1 -1
  126. package/dist/components/typography/PlTypography.js +1 -1
  127. package/dist/components/window-pane/PlWindowPane.d.ts +16 -6
  128. package/dist/components/window-pane/PlWindowPane.js +1 -1
  129. package/dist/internal/animate.d.ts +0 -25
  130. package/dist/internal/animate.js +1 -1
  131. package/dist/internal/bottom-bar.d.ts +29 -0
  132. package/dist/internal/bottom-bar.js +1 -0
  133. package/dist/internal/calendar.js +1 -1
  134. package/dist/internal/chart-frame.d.ts +90 -27
  135. package/dist/internal/chart-frame.js +1 -1
  136. package/dist/internal/chart-line.d.ts +11 -6
  137. package/dist/internal/chart-line.js +1 -1
  138. package/dist/internal/chart.d.ts +158 -1
  139. package/dist/internal/chart.js +1 -1
  140. package/dist/internal/defaults.d.ts +14 -1
  141. package/dist/internal/focusable.d.ts +10 -0
  142. package/dist/internal/focusable.js +1 -1
  143. package/dist/internal/form.d.ts +29 -0
  144. package/dist/internal/form.js +1 -1
  145. package/dist/internal/glow.d.ts +47 -1
  146. package/dist/internal/glow.js +1 -1
  147. package/dist/internal/icons.d.ts +24 -0
  148. package/dist/internal/icons.js +1 -1
  149. package/dist/internal/labels.d.ts +35 -0
  150. package/dist/internal/labels.js +1 -1
  151. package/dist/internal/loading.d.ts +13 -0
  152. package/dist/internal/loading.js +1 -0
  153. package/dist/internal/mockup.js +1 -1
  154. package/dist/internal/notch.d.ts +137 -0
  155. package/dist/internal/notch.js +1 -0
  156. package/dist/internal/picker.d.ts +15 -3
  157. package/dist/internal/picker.js +1 -1
  158. package/dist/internal/progress.d.ts +17 -6
  159. package/dist/internal/progress.js +1 -1
  160. package/dist/internal/sizer.d.ts +12 -11
  161. package/dist/internal/sizer.js +1 -1
  162. package/dist/internal/steps.d.ts +0 -15
  163. package/dist/internal/steps.js +1 -1
  164. package/dist/internal/styles.d.ts +135 -8
  165. package/dist/internal/styles.js +1 -1
  166. package/dist/internal/table-scroll.d.ts +42 -0
  167. package/dist/internal/table-scroll.js +1 -0
  168. package/dist/internal/table.js +1 -1
  169. package/dist/internal/text.d.ts +8 -5
  170. package/dist/internal/window.js +1 -1
  171. package/dist/locales/de.js +1 -1
  172. package/dist/locales/es.js +1 -1
  173. package/dist/locales/fr.js +1 -1
  174. package/dist/locales/ja.js +1 -1
  175. package/dist/locales/ko.js +1 -1
  176. package/dist/locales/zh-Hans.js +1 -1
  177. package/dist/provider/PlassProvider.d.ts +4 -3
  178. package/dist/provider/PlassProvider.js +1 -1
  179. package/dist/styles.css +1 -1
  180. package/dist/tailwind.css +461 -46
  181. package/dist/tokens.css +461 -46
  182. package/dist/types.d.ts +270 -11
  183. package/package.json +1 -1
@@ -40,6 +40,8 @@ export interface PlassLabels {
40
40
  empty: string;
41
41
  /** Marks a step, or anything else, that may be left out. */
42
42
  optional: string;
43
+ /** Why a control that has taken a press is not answering another one yet. */
44
+ loading: string;
43
45
  /** The trail's landmark, and the button that opens the steps it folded away. */
44
46
  breadcrumb: string;
45
47
  breadcrumbExpand: string;
@@ -47,6 +49,10 @@ export interface PlassLabels {
47
49
  carousel: string;
48
50
  carouselPrevious: string;
49
51
  carouselNext: string;
52
+ /** The button that starts a reel advancing on its own, and the same button
53
+ * once it is advancing, which stops it. */
54
+ carouselPlay: string;
55
+ carouselStop: string;
50
56
  /** What a slide is, said after its name: one slide's `aria-roledescription`.
51
57
  * The reel's own is `carousel`. */
52
58
  slide: string;
@@ -54,10 +60,24 @@ export interface PlassLabels {
54
60
  gallery: string;
55
61
  /** What a drawing of numbers is called when the caller has not named it. */
56
62
  chart: string;
63
+ /**
64
+ * The category a chart folds its smallest ones into. Not a name for any of
65
+ * them — it is what is left once the ones worth drawing have been drawn.
66
+ */
67
+ chartOther: string;
68
+ /**
69
+ * "And this many more": on a chart legend with more series than it shows, and
70
+ * under a command palette with more matches than it draws.
71
+ */
72
+ chartMore: (count: number) => string;
73
+ /** And the way back, once they are all showing. */
74
+ chartFewer: string;
57
75
  minimize: string;
58
76
  maximize: string;
59
77
  restore: string;
60
78
  resizeWindow: string;
79
+ /** The title bar of a window that can be dragged, as the keyboard reaches it. */
80
+ moveWindow: string;
61
81
  /** The palette's landmark and the placeholder in its field. */
62
82
  commandPalette: string;
63
83
  commandPalettePlaceholder: string;
@@ -160,8 +180,23 @@ export interface PlassLabels {
160
180
  addCustom: (query: string) => string;
161
181
  /** One slot of a code field, named by its place in the row. */
162
182
  otpSlot: (index: number, count: number) => string;
183
+ /** The tick over one of a transfer's lists, given the name of the list. */
184
+ transferSelectAll: (list: string) => string;
163
185
  /** What a transfer says once rows have moved, given how many and the list. */
164
186
  transferMoved: (count: number, list: string) => string;
187
+ /**
188
+ * Why a file picker turned files away, one line per reason and given how many
189
+ * were turned away for it.
190
+ *
191
+ * Grouped by reason rather than named one file at a time, because the batch
192
+ * that goes wrong is usually the big one — a folder dropped on a picker with
193
+ * a `maxFiles` of five is ninety-five lines saying the same thing. What the
194
+ * limit itself *is* belongs in `hint`, which is where a picker already says
195
+ * what it accepts, so these do not repeat it.
196
+ */
197
+ filesRejectedType: (count: number) => string;
198
+ filesRejectedSize: (count: number) => string;
199
+ filesRejectedCount: (count: number) => string;
165
200
  }
166
201
  /**
167
202
  * English, and the reason the library needs no setup to read.
@@ -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";import{loadingLabel as o}from"./loading.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",loading:o,breadcrumb:"Breadcrumb",breadcrumbExpand:"Show the hidden steps",carousel:"Carousel",carouselPrevious:"Previous slide",carouselNext:"Next slide",carouselPlay:"Start slide show",carouselStop:"Stop slide show",slide:"slide",commandPalette:"Command palette",commandPalettePlaceholder:"Search commands",gallery:"Gallery",chart:"Chart",chartOther:"Other",chartMore:e=>`${e} more`,chartFewer:"Show fewer",minimize:"Minimize",maximize:"Maximize",restore:"Restore",resizeWindow:"Resize window",moveWindow:"Move 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}`,transferSelectAll:e=>`Select all in ${e}`,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,13 @@
1
+ /**
2
+ * The English for the label set's `loading`, on its own.
3
+ *
4
+ * `PlButton` says this one word and nothing else from the set, and a button is
5
+ * the one component nearly every page imports. Reading it through `useLabels`
6
+ * would put all of the English in `labels.ts` into every bundle that has a
7
+ * button in it, and so would importing it from there: the set is shared with
8
+ * code a bundler splits off, and it moves the whole module into the shared
9
+ * chunk. So the word lives here, the button takes a provider's word from
10
+ * `useDefaults` and falls back to this, and the set reads it from here too so
11
+ * the two cannot disagree.
12
+ */
13
+ export declare const loadingLabel = "Loading";
@@ -0,0 +1 @@
1
+ export const loadingLabel="Loading";
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";const i={desktop:["macos","windows","linux"],tablet:["ipados","android"],mobile:["ios","android"]};export function resolveOs(e,t){const a=i[e];return t&&a.includes(t)?t:"ios"===t&&"tablet"===e?"ipados":"ipados"===t&&"mobile"===e?"ios":a[0]}export function defaultNotch(e,t){return"mobile"!==e?"none":"android"===t?"punch-hole":"dynamic-island"}export const resolutions={mobile:{xs:{width:320,height:568},sm:{width:360,height:780},md:{width:390,height:844},lg:{width:414,height:896},xl:{width:430,height:932}},tablet:{xs:{width:744,height:1133},sm:{width:768,height:1024},md:{width:820,height:1180},lg:{width:834,height:1194},xl:{width:1024,height:1366}},desktop:{xs:{width:1024,height:640},sm:{width:1280,height:800},md:{width:1440,height:900},lg:{width:1680,height:1050},xl:{width:1920,height:1200}}};const a={mobile:{thin:{bezel:{x:8,top:8,bottom:8},frameRadius:50,screenRadius:42},standard:{bezel:{x:13,top:13,bottom:13},frameRadius:56,screenRadius:43},thick:{bezel:{x:16,top:62,bottom:62},frameRadius:40,screenRadius:4}},tablet:{thin:{bezel:{x:12,top:12,bottom:12},frameRadius:34,screenRadius:22},standard:{bezel:{x:20,top:20,bottom:20},frameRadius:42,screenRadius:22},thick:{bezel:{x:28,top:74,bottom:74},frameRadius:36,screenRadius:4}},desktop:{thin:{bezel:{x:8,top:8,bottom:8},frameRadius:12,screenRadius:4},standard:{bezel:{x:13,top:13,bottom:30},frameRadius:16,screenRadius:4},thick:{bezel:{x:22,top:22,bottom:62},frameRadius:18,screenRadius:3}}},s={mobile:42,tablet:24,desktop:8};export function mockupMetrics(e){const{device:t,size:i,resolution:r,orientation:d,bezel:h,hardware:n}=e,o=r??resolutions[t][i],l="desktop"!==t&&"landscape"===d,c=l?{width:o.height,height:o.width}:o;if("none"===h)return{screen:c,bezel:{x:0,top:0,bottom:0},body:{...c},frame:{...c},frameRadius:s[t],screenRadius:s[t],stand:null,base:null};const u=a[t][h],p=l?{x:u.bezel.top,top:u.bezel.x,bottom:u.bezel.x}:u.bezel,g="desktop"===t&&"laptop"===n,m=g?{...p,bottom:p.top}:p,x={width:c.width+2*m.x,height:c.height+m.top+m.bottom};if("desktop"!==t)return{screen:c,bezel:m,body:x,frame:{...x},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:null,base:null};if(g){const e={width:Math.round(1.075*x.width),height:Math.round(.035*x.height),lipWidth:Math.round(.12*x.width)};return{screen:c,bezel:m,body:x,frame:{width:e.width,height:x.height+e.height},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:null,base:e}}const f={neckWidth:Math.round(.11*x.width),neckHeight:Math.round(.09*x.height),footWidth:Math.round(.28*x.width),footHeight:Math.round(.018*x.height)};return{screen:c,bezel:m,body:x,frame:{width:x.width,height:x.height+f.neckHeight+f.footHeight},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:f,base:null}}export const finishSlots={graphite:{"--p-shell":"#2b2f38","--p-shell-edge":"rgb(255 255 255 / 0.16)","--p-shell-shade":"#181b22"},silver:{"--p-shell":"#cfd2d7","--p-shell-edge":"rgb(255 255 255 / 0.75)","--p-shell-shade":"#9ca1a9"},white:{"--p-shell":"#f3f4f6","--p-shell-edge":"rgb(255 255 255 / 0.9)","--p-shell-shade":"#c1c4ca"}};export const shellClasses="bg-(--p-shell) [box-shadow:inset_0_1px_0_var(--p-shell-edge),inset_0_0_0_1px_var(--p-shell-shade)]";export const elevationFilters=["none","drop-shadow(0 1px 2px var(--plass-shadow-ambient))","drop-shadow(0 2px 4px var(--plass-shadow-ambient)) drop-shadow(0 8px 12px var(--plass-shadow-ambient))","drop-shadow(0 4px 6px var(--plass-shadow-ambient)) drop-shadow(0 18px 28px var(--plass-shadow-ambient))"];export function PlMockupCutout({notch:t,screen:i,landscape:a}){if("none"===t)return null;const s=a?i.height:i.width,r={position:"absolute",background:"oklch(12% 0.006 262)",pointerEvents:"none",zIndex:20},d="plass-mockup-cutout";if("punch-hole"===t){const t=Math.max(16,Math.round(.07*s)),i=Math.round(.55*t);return e("div",{"aria-hidden":"true",className:d,style:{...r,width:t,height:t,borderRadius:"50%",...a?{left:i,top:"50%",marginTop:-t/2}:{top:i,left:"50%",marginLeft:-t/2}}})}if("dynamic-island"===t){const t=Math.max(96,Math.round(.32*s)),i=Math.round(.29*t),h=Math.round(.32*i);return e("div",{"aria-hidden":"true",className:d,style:{...r,borderRadius:i,...a?{left:h,top:"50%",width:i,height:t,marginTop:-t/2}:{top:h,left:"50%",width:t,height:i,marginLeft:-t/2}}})}const h=Math.max(120,Math.round(.42*s)),n=Math.round(.23*h),o=Math.round(.6*n);return e("div",{"aria-hidden":"true",className:d,style:{...r,...a?{left:0,top:"50%",width:n,height:h,marginTop:-h/2,borderRadius:`0 ${o}px ${o}px 0`}:{top:0,left:"50%",width:h,height:n,marginLeft:-h/2,borderRadius:`0 0 ${o}px ${o}px`}}})}const r="relative z-10 flex shrink-0 items-center [background:color-mix(in_oklab,var(--plass-surface)_88%,transparent)]",d="font-medium text-(--plass-fg) tabular-nums";function Tile({width:t,height:i,radius:a,tone:s="muted"}){return e("div",{style:{width:t,height:i??t,borderRadius:a,background:"accent"===s?"var(--p-accent)":"faint"===s?"color-mix(in oklab, var(--plass-fg) 12%, transparent)":"color-mix(in oklab, var(--plass-fg) 26%, transparent)"}})}function Tiles({count:t,size:i,radius:a,gap:s,accent:r=!1}){return e("div",{className:"flex items-center",style:{gap:s},children:Array.from({length:t},(t,s)=>e(Tile,{width:i,radius:a,tone:r&&0===s?"accent":"muted"},s))})}function SignalGlyph({height:i}){return t("svg",{viewBox:"0 0 17 11",height:i,width:17*i/11,fill:"currentColor","aria-hidden":"true",children:[e("rect",{y:"7.5",width:"3",height:"3.5",rx:"1"}),e("rect",{x:"4.7",y:"5",width:"3",height:"6",rx:"1"}),e("rect",{x:"9.4",y:"2.5",width:"3",height:"8.5",rx:"1"}),e("rect",{x:"14",width:"3",height:"11",rx:"1",opacity:"0.35"})]})}function WifiGlyph({height:i}){return t("svg",{viewBox:"0 0 16 12",height:i,width:16*i/12,fill:"none","aria-hidden":"true",children:[e("path",{d:"M1 4.2a10.5 10.5 0 0 1 14 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),e("path",{d:"M3.6 7a6.8 6.8 0 0 1 8.8 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),e("circle",{cx:"8",cy:"10.2",r:"1.6",fill:"currentColor"})]})}function BatteryGlyph({height:i}){return t("svg",{viewBox:"0 0 25 12",height:i,width:25*i/12,fill:"none","aria-hidden":"true",children:[e("rect",{x:"0.7",y:"0.7",width:"20.6",height:"10.6",rx:"3.2",stroke:"currentColor",strokeWidth:"1.3",opacity:"0.45"}),e("rect",{x:"2.6",y:"2.6",width:"12.8",height:"6.8",rx:"1.8",fill:"currentColor"}),e("rect",{x:"22.8",y:"4",width:"1.8",height:"4",rx:"0.9",fill:"currentColor",opacity:"0.45"})]})}function StatusGlyphs({height:i,gap:a}){return t("div",{className:"flex items-center text-(--plass-fg)",style:{gap:a},children:[e(SignalGlyph,{height:i}),e(WifiGlyph,{height:i}),e(BatteryGlyph,{height:i})]})}function NavGlyphs({size:i,gap:a}){return t("div",{className:"flex items-center justify-center text-(--plass-fg)",style:{gap:a,opacity:.72},children:[e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("path",{d:"M10 3 5 8l5 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("circle",{cx:"8",cy:"8",r:"5",stroke:"currentColor",strokeWidth:"1.6"})}),e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("rect",{x:"3.5",y:"3.5",width:"9",height:"9",rx:"1.6",stroke:"currentColor",strokeWidth:"1.6"})})]})}function StartGlyph({size:i}){return t("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"currentColor","aria-hidden":"true",children:[e("rect",{x:"1",y:"1",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"9",y:"1",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"1",y:"9",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.4"})]})}export function mockupChrome(i){const{os:a,notch:s,landscape:h,time:n}=i;if("ios"===a||"ipados"===a){const i="ipados"===a,o=i?30:i||h||"none"===s||"punch-hole"===s?44:54;return{top:{size:o,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:o,paddingInline:i?22:26},children:[e("span",{className:`${d} text-[15px]`,children:n}),e(StatusGlyphs,{height:i?11:12,gap:6})]})},bottom:{size:i?22:34,node:e("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:i?22:34,background:"transparent"},children:e("div",{style:{width:i?220:140,height:5,borderRadius:3,background:"color-mix(in oklab, var(--plass-fg) 55%, transparent)"}})})}}}return"android"===a?{top:{size:34,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:34,paddingInline:18},children:[e("span",{className:`${d} text-[13px]`,children:n}),e(StatusGlyphs,{height:11,gap:5})]})},bottom:{size:48,node:e("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:48},children:e(NavGlyphs,{size:20,gap:72})})}}:"macos"===a?{top:{size:28,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:28,paddingInline:16},children:[t("div",{className:"flex items-center",style:{gap:16},children:[e(Tile,{width:13,radius:4}),e(Tile,{width:34,height:7,radius:4}),e(Tile,{width:26,height:7,radius:4,tone:"faint"}),e(Tile,{width:30,height:7,radius:4,tone:"faint"}),e(Tile,{width:22,height:7,radius:4,tone:"faint"})]}),t("div",{className:"flex items-center",style:{gap:14},children:[e(Tile,{width:11,radius:3,tone:"faint"}),e(Tile,{width:11,radius:3,tone:"faint"}),e("span",{className:`${d} text-[13px]`,children:n})]})]})},bottom:{size:78,node:e("div",{"aria-hidden":"true",className:"flex shrink-0 items-end justify-center",style:{height:78},children:t("div",{className:`${r} [box-shadow:var(--plass-shadow-2),var(--plass-gloss-glass)]`,style:{gap:10,padding:8,marginBottom:10,borderRadius:22},children:[e(Tiles,{count:5,size:52,radius:14,gap:10,accent:!0}),e("div",{style:{width:1,height:44,background:"color-mix(in oklab, var(--plass-fg) 16%, transparent)"}}),e(Tiles,{count:2,size:52,radius:14,gap:10})]})})}}:"windows"===a?{bottom:{size:52,node:t("div",{"aria-hidden":"true",className:`${r} justify-center [border-block-start:1px_solid_var(--plass-border)]`,style:{height:52,paddingInline:16},children:[t("div",{className:"flex items-center",style:{gap:10},children:[e("div",{className:"text-(--plass-fg)",style:{opacity:.7},children:e(StartGlyph,{size:22})}),e(Tiles,{count:6,size:30,radius:8,gap:10,accent:!0})]}),t("div",{className:"absolute flex items-center",style:{insetInlineEnd:16,gap:12},children:[e(Tile,{width:11,radius:3,tone:"faint"}),e(Tile,{width:11,radius:3,tone:"faint"}),e("span",{className:`${d} text-[12px]`,children:n})]})]})}}:{top:{size:34,node:t("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:34,paddingInline:14},children:[e("div",{className:"absolute",style:{insetInlineStart:14},children:e(Tile,{width:52,height:9,radius:5})}),e("span",{className:`${d} text-[13px]`,children:n}),t("div",{className:"absolute flex items-center",style:{insetInlineEnd:14,gap:10},children:[e(Tile,{width:10,radius:3,tone:"faint"}),e(Tile,{width:10,radius:3,tone:"faint"}),e(Tile,{width:10,radius:3,tone:"faint"})]})]})},start:{size:66,node:t("div",{"aria-hidden":"true",className:`${r} flex-col justify-start [border-inline-end:1px_solid_var(--plass-border)]`,style:{width:66,height:"100%",gap:10,paddingBlock:12},children:[e(Tile,{width:44,radius:12,tone:"accent"}),e(Tile,{width:44,radius:12}),e(Tile,{width:44,radius:12}),e(Tile,{width:44,radius:12})]})}}}
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";const i={desktop:["macos","windows","linux"],tablet:["ipados","android"],mobile:["ios","android"]};export function resolveOs(e,t){const a=i[e];return t&&a.includes(t)?t:"ios"===t&&"tablet"===e?"ipados":"ipados"===t&&"mobile"===e?"ios":a[0]}export function defaultNotch(e,t){return"mobile"!==e?"none":"android"===t?"punch-hole":"dynamic-island"}export const resolutions={mobile:{xs:{width:320,height:568},sm:{width:360,height:780},md:{width:390,height:844},lg:{width:414,height:896},xl:{width:430,height:932}},tablet:{xs:{width:744,height:1133},sm:{width:768,height:1024},md:{width:820,height:1180},lg:{width:834,height:1194},xl:{width:1024,height:1366}},desktop:{xs:{width:1024,height:640},sm:{width:1280,height:800},md:{width:1440,height:900},lg:{width:1680,height:1050},xl:{width:1920,height:1200}}};const a={mobile:{thin:{bezel:{x:8,top:8,bottom:8},frameRadius:50,screenRadius:42},standard:{bezel:{x:13,top:13,bottom:13},frameRadius:56,screenRadius:43},thick:{bezel:{x:16,top:62,bottom:62},frameRadius:40,screenRadius:4}},tablet:{thin:{bezel:{x:12,top:12,bottom:12},frameRadius:34,screenRadius:22},standard:{bezel:{x:20,top:20,bottom:20},frameRadius:42,screenRadius:22},thick:{bezel:{x:28,top:74,bottom:74},frameRadius:36,screenRadius:4}},desktop:{thin:{bezel:{x:8,top:8,bottom:8},frameRadius:12,screenRadius:4},standard:{bezel:{x:13,top:13,bottom:30},frameRadius:16,screenRadius:4},thick:{bezel:{x:22,top:22,bottom:62},frameRadius:18,screenRadius:3}}},s={mobile:42,tablet:24,desktop:8};export function mockupMetrics(e){const{device:t,size:i,resolution:r,orientation:d,bezel:h,hardware:n}=e,o=r??resolutions[t][i],l="desktop"!==t&&"landscape"===d,c=l?{width:o.height,height:o.width}:o;if("none"===h)return{screen:c,bezel:{x:0,top:0,bottom:0},body:{...c},frame:{...c},frameRadius:s[t],screenRadius:s[t],stand:null,base:null};const u=a[t][h],p=l?{x:u.bezel.top,top:u.bezel.x,bottom:u.bezel.x}:u.bezel,g="desktop"===t&&"laptop"===n,m=g?{...p,bottom:p.top}:p,x={width:c.width+2*m.x,height:c.height+m.top+m.bottom};if("desktop"!==t)return{screen:c,bezel:m,body:x,frame:{...x},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:null,base:null};if(g){const e={width:Math.round(1.075*x.width),height:Math.round(.035*x.height),lipWidth:Math.round(.12*x.width)};return{screen:c,bezel:m,body:x,frame:{width:e.width,height:x.height+e.height},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:null,base:e}}const f={neckWidth:Math.round(.11*x.width),neckHeight:Math.round(.09*x.height),footWidth:Math.round(.28*x.width),footHeight:Math.round(.018*x.height)};return{screen:c,bezel:m,body:x,frame:{width:x.width,height:x.height+f.neckHeight+f.footHeight},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:f,base:null}}export const finishSlots={graphite:{"--p-shell":"#2b2f38","--p-shell-edge":"rgb(255 255 255 / 0.16)","--p-shell-shade":"#181b22"},silver:{"--p-shell":"#cfd2d7","--p-shell-edge":"rgb(255 255 255 / 0.75)","--p-shell-shade":"#9ca1a9"},white:{"--p-shell":"#f3f4f6","--p-shell-edge":"rgb(255 255 255 / 0.9)","--p-shell-shade":"#c1c4ca"}};export const shellClasses="bg-(--p-shell) [box-shadow:inset_0_1px_0_var(--p-shell-edge),inset_0_0_0_1px_var(--p-shell-shade)]";export const elevationFilters=["none","drop-shadow(0 1px 2px var(--plass-shadow-ambient))","drop-shadow(0 2px 4px var(--plass-shadow-ambient)) drop-shadow(0 8px 12px var(--plass-shadow-ambient))","drop-shadow(0 4px 6px var(--plass-shadow-ambient)) drop-shadow(0 18px 28px var(--plass-shadow-ambient))"];export function PlMockupCutout({notch:t,screen:i,landscape:a}){if("none"===t)return null;const s=a?i.height:i.width,r={position:"absolute",background:"oklch(12% 0.006 262)",pointerEvents:"none",zIndex:20},d="plass-mockup-cutout";if("punch-hole"===t){const t=Math.max(16,Math.round(.07*s)),i=Math.round(.55*t);return e("div",{"aria-hidden":"true",className:d,style:{...r,width:t,height:t,borderRadius:"50%",...a?{left:i,top:"50%",marginTop:-t/2}:{top:i,left:"50%",marginLeft:-t/2}}})}if("dynamic-island"===t){const t=Math.max(96,Math.round(.32*s)),i=Math.round(.29*t),h=Math.round(.32*i);return e("div",{"aria-hidden":"true",className:d,style:{...r,borderRadius:i,...a?{left:h,top:"50%",width:i,height:t,marginTop:-t/2}:{top:h,left:"50%",width:t,height:i,marginLeft:-t/2}}})}const h=Math.max(120,Math.round(.42*s)),n=Math.round(.23*h),o=Math.round(.6*n);return e("div",{"aria-hidden":"true",className:d,style:{...r,...a?{left:0,top:"50%",width:n,height:h,marginTop:-h/2,borderRadius:`0 ${o}px ${o}px 0`}:{top:0,left:"50%",width:h,height:n,marginLeft:-h/2,borderRadius:`0 0 ${o}px ${o}px`}}})}const r="relative z-10 flex shrink-0 items-center [background:color-mix(in_oklab,var(--plass-surface)_88%,transparent)]",d="font-medium text-(--plass-fg) tabular-nums";function Tile({width:t,height:i,radius:a,tone:s="muted"}){return e("div",{style:{width:t,height:i??t,borderRadius:a,background:"accent"===s?"var(--p-accent)":"faint"===s?"color-mix(in oklab, var(--plass-fg) 12%, transparent)":"color-mix(in oklab, var(--plass-fg) 26%, transparent)"}})}function Tiles({count:t,size:i,radius:a,gap:s,accent:r=!1}){return e("div",{className:"flex items-center",style:{gap:s},children:Array.from({length:t},(t,s)=>e(Tile,{width:i,radius:a,tone:r&&0===s?"accent":"muted"},s))})}function SignalGlyph({height:i}){return t("svg",{viewBox:"0 0 17 11",height:i,width:17*i/11,fill:"currentColor","aria-hidden":"true",children:[e("rect",{y:"7.5",width:"3",height:"3.5",rx:"1"}),e("rect",{x:"4.7",y:"5",width:"3",height:"6",rx:"1"}),e("rect",{x:"9.4",y:"2.5",width:"3",height:"8.5",rx:"1"}),e("rect",{x:"14",width:"3",height:"11",rx:"1",opacity:"0.35"})]})}function WifiGlyph({height:i}){return t("svg",{viewBox:"0 0 16 12",height:i,width:16*i/12,fill:"none","aria-hidden":"true",children:[e("path",{d:"M1 4.2a10.5 10.5 0 0 1 14 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),e("path",{d:"M3.6 7a6.8 6.8 0 0 1 8.8 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),e("circle",{cx:"8",cy:"10.2",r:"1.6",fill:"currentColor"})]})}function BatteryGlyph({height:i}){return t("svg",{viewBox:"0 0 25 12",height:i,width:25*i/12,fill:"none","aria-hidden":"true",children:[e("rect",{x:"0.7",y:"0.7",width:"20.6",height:"10.6",rx:"3.2",stroke:"currentColor",strokeWidth:"1.3",opacity:"0.45"}),e("rect",{x:"2.6",y:"2.6",width:"12.8",height:"6.8",rx:"1.8",fill:"currentColor"}),e("rect",{x:"22.8",y:"4",width:"1.8",height:"4",rx:"0.9",fill:"currentColor",opacity:"0.45"})]})}function StatusGlyphs({height:i,gap:a}){return t("div",{className:"flex items-center text-(--plass-fg)",style:{gap:a},children:[e(SignalGlyph,{height:i}),e(WifiGlyph,{height:i}),e(BatteryGlyph,{height:i})]})}function NavGlyphs({size:i,gap:a}){return t("div",{className:"flex items-center justify-center text-(--plass-fg)",style:{gap:a,opacity:.72},children:[e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("path",{d:"M10 3 5 8l5 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("circle",{cx:"8",cy:"8",r:"5",stroke:"currentColor",strokeWidth:"1.6"})}),e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("rect",{x:"3.5",y:"3.5",width:"9",height:"9",rx:"1.6",stroke:"currentColor",strokeWidth:"1.6"})})]})}function StartGlyph({size:i}){return t("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"currentColor","aria-hidden":"true",className:"block",children:[e("rect",{x:"1",y:"1",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"9",y:"1",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"1",y:"9",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.4"})]})}export function mockupChrome(i){const{os:a,notch:s,landscape:h,time:n}=i;if("ios"===a||"ipados"===a){const i="ipados"===a,o=i?30:i||h||"none"===s||"punch-hole"===s?44:54;return{top:{size:o,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:o,paddingInline:i?22:26},children:[e("span",{className:`${d} text-[15px]`,children:n}),e(StatusGlyphs,{height:i?11:12,gap:6})]})},bottom:{size:i?22:34,node:e("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:i?22:34,background:"transparent"},children:e("div",{style:{width:i?220:140,height:5,borderRadius:3,background:"color-mix(in oklab, var(--plass-fg) 55%, transparent)"}})})}}}return"android"===a?{top:{size:34,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:34,paddingInline:18},children:[e("span",{className:`${d} text-[13px]`,children:n}),e(StatusGlyphs,{height:11,gap:5})]})},bottom:{size:48,node:e("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:48},children:e(NavGlyphs,{size:20,gap:72})})}}:"macos"===a?{top:{size:28,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:28,paddingInline:16},children:[t("div",{className:"flex items-center",style:{gap:16},children:[e(Tile,{width:13,radius:4}),e(Tile,{width:34,height:7,radius:4}),e(Tile,{width:26,height:7,radius:4,tone:"faint"}),e(Tile,{width:30,height:7,radius:4,tone:"faint"}),e(Tile,{width:22,height:7,radius:4,tone:"faint"})]}),t("div",{className:"flex items-center",style:{gap:14},children:[e(Tile,{width:11,radius:3,tone:"faint"}),e(Tile,{width:11,radius:3,tone:"faint"}),e("span",{className:`${d} text-[13px]`,children:n})]})]})},bottom:{size:78,node:e("div",{"aria-hidden":"true",className:"flex shrink-0 items-end justify-center",style:{height:78},children:t("div",{className:`${r} [box-shadow:var(--plass-shadow-2),var(--plass-gloss-glass)]`,style:{gap:10,padding:8,marginBottom:10,borderRadius:22},children:[e(Tiles,{count:5,size:52,radius:14,gap:10,accent:!0}),e("div",{style:{width:1,height:44,background:"color-mix(in oklab, var(--plass-fg) 16%, transparent)"}}),e(Tiles,{count:2,size:52,radius:14,gap:10})]})})}}:"windows"===a?{bottom:{size:52,node:t("div",{"aria-hidden":"true",className:`${r} justify-center [border-block-start:1px_solid_var(--plass-border)]`,style:{height:52,paddingInline:16},children:[t("div",{className:"flex items-center",style:{gap:10},children:[e("div",{className:"text-(--plass-fg)",style:{opacity:.7},children:e(StartGlyph,{size:22})}),e(Tiles,{count:6,size:30,radius:8,gap:10,accent:!0})]}),t("div",{className:"absolute flex items-center",style:{insetInlineEnd:16,gap:12},children:[e(Tile,{width:11,radius:3,tone:"faint"}),e(Tile,{width:11,radius:3,tone:"faint"}),e("span",{className:`${d} text-[12px]`,children:n})]})]})}}:{top:{size:34,node:t("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:34,paddingInline:14},children:[e("div",{className:"absolute",style:{insetInlineStart:14},children:e(Tile,{width:52,height:9,radius:5})}),e("span",{className:`${d} text-[13px]`,children:n}),t("div",{className:"absolute flex items-center",style:{insetInlineEnd:14,gap:10},children:[e(Tile,{width:10,radius:3,tone:"faint"}),e(Tile,{width:10,radius:3,tone:"faint"}),e(Tile,{width:10,radius:3,tone:"faint"})]})]})},start:{size:66,node:t("div",{"aria-hidden":"true",className:`${r} flex-col justify-start [border-inline-end:1px_solid_var(--plass-border)]`,style:{width:66,height:"100%",gap:10,paddingBlock:12},children:[e(Tile,{width:44,radius:12,tone:"accent"}),e(Tile,{width:44,radius:12}),e(Tile,{width:44,radius:12}),e(Tile,{width:44,radius:12})]})}}}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * The label in the field's own top edge — `labelPlacement="notch"`, and the
3
+ * `float` that rests inside the field until it is wanted there.
4
+ *
5
+ * One module because every field-shaped control in the library draws the same
6
+ * notch: a PlTextField, a PlSelect's trigger, a PlCombobox, a PlNumberField, a
7
+ * PlFilePicker's drop zone and every picker that goes through `internal/picker`
8
+ * have to be indistinguishable along their top edge or a form looks like two
9
+ * forms stacked on each other.
10
+ *
11
+ * **The cut is real.** A `<legend>` takes a segment out of its `<fieldset>`'s
12
+ * border, and that is the only way to open a gap in a line without knowing what
13
+ * is behind it. The usual trick — a label with the page's own background colour
14
+ * painted over the border — cannot work here twice over: a library that does
15
+ * not paint the page has no idea what colour it is, and a Plass field is
16
+ * translucent, so a patch of flat colour would read as a patch of flat colour.
17
+ *
18
+ * **The fieldset is a sibling of the control rather than the control itself.**
19
+ * Half the shells this is drawn on are `<button>`s — a Select's trigger, a file
20
+ * picker's drop zone — and a button cannot contain a fieldset. So the frame
21
+ * below wraps the shell, the shell is drawn exactly as it always was, and the
22
+ * edge is laid over it with its own border. The shell's own border goes
23
+ * transparent for the length of it; `notchShellStyle` is that one declaration,
24
+ * written inline because it has to beat a `hover:` and a `disabled` rule that
25
+ * are already in the class string.
26
+ *
27
+ * **A `float` label is the same legend.** It comes down into the field by its
28
+ * own position and font size, and the legend folds to nothing under it so the
29
+ * edge closes over where the gap was. What decides that it rests is a relation
30
+ * between the frame's focus, the control's emptiness and whether a popup is
31
+ * open, which is plain CSS in `styles.css` under "The float label" rather than
32
+ * a state this component holds: an input says it is empty through
33
+ * `:placeholder-shown` before any script has run, and so does a select's
34
+ * trigger through `data-placeholder`. This file hands that stylesheet its
35
+ * numbers and its hooks.
36
+ */
37
+ import * as React from 'react';
38
+ import type { PlassDensity, PlassFieldLabelPlacement, PlassSize, PlassVariant } from '../types.js';
39
+ /**
40
+ * The hook a resting label reads the control's emptiness through, on the
41
+ * element that has one to give: an `<input>`, whose `:placeholder-shown` says
42
+ * so, or a select's trigger, whose `data-placeholder` does. An input with no
43
+ * placeholder of its own is given a blank one, since `:placeholder-shown`
44
+ * never matches an input that has none.
45
+ */
46
+ export declare const floatControlClassName = "plass-float-control";
47
+ /**
48
+ * What a resting label stands in for, which steps aside while the label is
49
+ * there: the placeholder written in a trigger, a picker's words for nothing
50
+ * chosen. An input's own placeholder is reached through the control's
51
+ * `::placeholder` instead.
52
+ */
53
+ export declare const floatPlaceholderClassName = "plass-float-placeholder";
54
+ /**
55
+ * What the shell gives up while the edge is drawing for it.
56
+ *
57
+ * Inline rather than a class: every field's shell already carries a
58
+ * `border-color` at rest, another on hover, another on focus and another when
59
+ * disabled, and a utility added on top of those would be one more declaration
60
+ * of the same property at the same specificity — whichever of them Tailwind
61
+ * happened to emit last would win. The border itself stays, transparent, so the
62
+ * control's inside is the same size it was.
63
+ */
64
+ export declare const notchShellStyle: React.CSSProperties;
65
+ /**
66
+ * What a control's `labelPlacement` comes to once its label and its start are
67
+ * known.
68
+ *
69
+ * `notched` is whether the edge is cut at all: for `notch` and for `float`, and
70
+ * only where there is a label, since a notch with nothing in it is a gap in the
71
+ * edge for no reason. `float` is whether the label may also come down into the
72
+ * control, which it cannot where the control draws something at its start —
73
+ * `startTaken` — because that is where it would rest.
74
+ */
75
+ export declare function resolveNotch(placement: PlassFieldLabelPlacement, label: React.ReactNode, startTaken: boolean): {
76
+ notched: boolean;
77
+ float: boolean;
78
+ };
79
+ export interface FieldNotchProps {
80
+ /**
81
+ * Whether to draw one at all. `false` renders the shell and nothing else, so
82
+ * a call site wraps its control once and unconditionally rather than writing
83
+ * the whole thing out twice — which is what keeps the two placements from
84
+ * drifting into two controls.
85
+ */
86
+ notched: boolean;
87
+ size: PlassSize;
88
+ density: PlassDensity;
89
+ variant: PlassVariant;
90
+ /** Unavailable — the edge dims with the control. */
91
+ disabled?: boolean;
92
+ /** Shown but not editable — the edge stays and stops answering. */
93
+ readOnly?: boolean;
94
+ /**
95
+ * The whole edge, when it is not a field's hairline — width, style, colour and
96
+ * every state, replacing the three maps above.
97
+ *
98
+ * A PlFilePicker's drop zone is the one caller that needs it: its edge is 2px
99
+ * and dashed in all three variants, and it has a state no field has, a file
100
+ * being dragged over the box. Passed as one resolved string rather than added
101
+ * to the maps, for the reason every component in this library resolves its own
102
+ * states with an if/else — two utilities for one property at one specificity
103
+ * are settled by the order Tailwind happened to emit them in.
104
+ */
105
+ edgeClassName?: string;
106
+ /**
107
+ * The label comes down into the control while it is empty and idle —
108
+ * `labelPlacement="float"` on a control with nothing drawn at its start.
109
+ * The caller decides both halves of that, since only it knows what its start
110
+ * holds, and passes `notched` as well: a floating label is in the notch for
111
+ * as long as it is not resting.
112
+ */
113
+ float?: boolean;
114
+ /**
115
+ * Whether the control holds nothing, from a component that knows and has no
116
+ * control that can say so itself — a picker's trigger. Left out, the control
117
+ * marked with `floatControlClassName` says it.
118
+ */
119
+ empty?: boolean;
120
+ /**
121
+ * The element that names the control, ready to render: a `Field.Label` for a
122
+ * field that has one, or the `<span>` an `aria-labelledby` points at. The
123
+ * same element the stacked placement renders, so the two cannot drift.
124
+ */
125
+ label: React.ReactNode;
126
+ /** The control's shell, drawn exactly as it is without a notch. */
127
+ children: React.ReactNode;
128
+ }
129
+ /**
130
+ * Lays the notched edge over a control's shell.
131
+ *
132
+ * The frame is what the edge is positioned against and what hover and focus are
133
+ * read from, so the shell has to be inside it — and the shell is rendered
134
+ * untouched, which is the point: a notch is a decision about the label, not a
135
+ * second way of drawing a field.
136
+ */
137
+ export declare function FieldNotch({ notched, size, density, variant, disabled, readOnly, edgeClassName, float, empty, 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 t,hasContent as l,metaTextClasses as a,radiusClasses as p,transitionClasses as s}from"./styles.js";const n={xs:"-top-[5px]",sm:"-top-[5.5px]",md:"-top-[6px]",lg:"-top-[6.5px]",xl:"-top-[7px]"},c={xs:"mt-[5px]",sm:"mt-[5.5px]",md:"mt-[6px]",lg:"mt-[6.5px]",xl:"mt-[7px]"},m={default:{xs:"ms-[calc(0.5rem_-_var(--p-notch-grow,0px))]",sm:"ms-[calc(0.625rem_-_var(--p-notch-grow,0px))]",md:"ms-[calc(0.75rem_-_var(--p-notch-grow,0px))]",lg:"ms-[calc(1.25rem_-_var(--p-notch-grow,0px))]",xl:"ms-[calc(1.5rem_-_var(--p-notch-grow,0px))]"},compact:{xs:"ms-[calc(0.5rem_-_var(--p-notch-grow,0px))]",sm:"ms-[calc(0.625rem_-_var(--p-notch-grow,0px))]",md:"ms-[calc(0.75rem_-_var(--p-notch-grow,0px))]",lg:"ms-[calc(0.875rem_-_var(--p-notch-grow,0px))]",xl:"ms-[calc(1rem_-_var(--p-notch-grow,0px))]"}},d={xs:"px-0.5",sm:"px-0.5",md:"px-1",lg:"px-1",xl:"px-1"},i={xs:"[--p-notch-pad:0.125rem] [--p-notch-leading:0.625rem] [--p-float-y:0.75rem] [--p-float-text:0.6875rem]",sm:"[--p-notch-pad:0.125rem] [--p-notch-leading:0.6875rem] [--p-float-y:1rem] [--p-float-text:0.8125rem]",md:"[--p-notch-pad:0.25rem] [--p-notch-leading:0.75rem] [--p-float-y:1.25rem] [--p-float-text:0.875rem]",lg:"[--p-notch-pad:0.25rem] [--p-notch-leading:0.8125rem] [--p-float-y:1.5rem] [--p-float-text:1rem]",xl:"[--p-notch-pad:0.25rem] [--p-notch-leading:0.875rem] [--p-float-y:1.75rem] [--p-float-text:1.125rem]"},x={default:{xs:"",sm:"",md:"",lg:"",xl:""},compact:{xs:"[--p-float-x:-0.25rem]",sm:"[--p-float-x:-0.25rem]",md:"[--p-float-x:-0.375rem]",lg:"[--p-float-x:-0.25rem]",xl:"[--p-float-x:-0.25rem]"}};export const floatControlClassName="plass-float-control";export const floatPlaceholderClassName="plass-float-placeholder";const f={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(" ")},g={solid:"border border-transparent",glass:"border [border-color:var(--plass-border)]",ghost:"border border-transparent"},h={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"},b=/* @__PURE__ */["group-has-[:focus-visible]/field:[border-width:2px]","group-has-[:focus-visible]/field:[--p-notch-grow:1px]","group-has-[:focus-visible]/field:forced-colors:[border-color:Highlight]"].join(" ");export const notchShellStyle={borderColor:"transparent"};export function resolveNotch(r,o,e){const t="top"!==r&&l(o);return{notched:t,float:t&&"float"===r&&!e}}export function FieldNotch({notched:l,size:v,density:u,variant:_,disabled:w=!1,readOnly:y=!1,edgeClassName:j,float:N=!1,empty:C,label:$,children:F}){return l?e("div",{className:t("group/field relative flex w-full",c[v],N&&`plass-notch-float ${i[v]} ${x[u][v]}`),"data-empty":N&&C||void 0,children:[F,o("fieldset",{role:"presentation",className:t("pointer-events-none absolute inset-x-0 bottom-0 m-0 min-w-0 p-0",n[v],p[v],s,j??(w?h[_]:y?g[_]:`${f[_]} ${b}`)),children:o("legend",{className:t("pointer-events-auto font-semibold leading-none",a[v],m[u][v],N?"px-0":d[v],w?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:$})})]}):o(r,{children:F})}
@@ -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.
@@ -31,6 +31,9 @@ import type { PlassColor, PlassElevation, PlassFieldClassNames, PlassSize, Plass
31
31
  * filled token in the library that has to be found without being read, which is
32
32
  * the day you picked. So the sheet stays clear glass and the family arrives in
33
33
  * the two fill slots the chosen cell reads.
34
+ *
35
+ * A `PlCalendar` is the same sheet set on the page instead of in a popup, and
36
+ * takes the same slots for the same reason.
34
37
  */
35
38
  export declare function popupSlots(color: PlassColor, elevation: PlassElevation): React.CSSProperties;
36
39
  /**
@@ -84,8 +87,17 @@ export interface PlassPickerShellProps extends PlassStyleProps, Omit<React.Compo
84
87
  * @default 0
85
88
  */
86
89
  elevation?: PlassElevation;
87
- /** Label above the trigger. */
90
+ /** The name of what the control holds. */
88
91
  label?: React.ReactNode;
92
+ /**
93
+ * Where the `label` goes — above the trigger, in its top edge, or inside it
94
+ * where the value would be written until the trigger is focused, open or
95
+ * holds a value. A trigger that draws a glyph at its start keeps a `float`
96
+ * label in the edge, because the glyph is where it would rest.
97
+ * Falls back to the nearest `PlassProvider`, then to `top`.
98
+ * @default 'top'
99
+ */
100
+ labelPlacement?: PlassFieldLabelPlacement;
89
101
  /** Helper text below it. */
90
102
  description?: React.ReactNode;
91
103
  /** Error message below. Its presence also turns the control invalid. */
@@ -141,7 +153,7 @@ interface InternalShellProps extends PlassPickerShellProps {
141
153
  * and the way `invalid` re-points the whole colour family at `danger` so the
142
154
  * edge, the ring and the message turn over together.
143
155
  */
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;
156
+ export declare function PickerShell({ variant, size, color, density, elevation, label, labelPlacement: labelPlacementProp, description, error, invalid, startIcon, fullWidth, disabled: disabledProp, readOnly, required, id, className, classNames, style, display, samples, empty, clearable, onClear, open, onOpenChange, labels, name, formValue, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
145
157
  /**
146
158
  * The row of shortcuts under a picker's panel.
147
159
  *
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as a from"react";import{Field as t}from"@base-ui/react/field";import{Popover as l}from"@base-ui/react/popover";import{FormControl as r,leaveFormControl as i}from"./form.js";import{CloseIcon as o}from"./icons.js";import{WidthSizer as n}from"./sizer.js";import{chipRemoveClasses as d,controlHeightClasses as p,controlTextLeadingClasses as c,cx as u,disabledClasses as m,fieldReadOnlyClasses as f,fieldRestClasses as h,focusWithinRingClasses as g,gapClasses as x,glassClasses as b,iconClasses as v,metaTextClasses as y,paddingXClasses as N,radiusClasses as w,stackGapClasses as j,surfaceSlots as k,transitionClasses as P}from"./styles.js";export function popupSlots(e,s){return{...k(e,s),"--p-fill":`var(--plass-${e}-fill)`,"--p-on-solid":`var(--plass-${e}-on-solid)`}}const $=/* @__PURE__ */["group relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",P,g,v].join(" ");export const pickerPopupClasses=/* @__PURE__ */[b,"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 C=/* @__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:a,size:t}){return e(a,{className:C,children:s("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:g="glass",size:b="md",color:v="primary",density:P="default",elevation:C=0,label:z,description:B,error:I,invalid:O,startIcon:R,fullWidth:q=!1,disabled:D=!1,readOnly:E=!1,required:F=!1,id:S,className:L,classNames:M,style:V,display:W,samples:_,empty:A,clearable:T=!1,onClear:G,open:H,onOpenChange:J,labels:K,name:Q,formValue:U,children:X,triggerRef:Y,...Z}){const ee=a.useId(),se=S??`${ee}-trigger`,ae=`${ee}-label`,te=`${ee}-value`,le=`${ee}-description`,re=`${ee}-error`,ie=null!=I&&!1!==I&&""!==I,oe=O??ie,ne=oe?"danger":v,de=D||E,pe=a.useRef(null);return s(t.Root,{disabled:D,invalid:oe,className:u("flex-col align-top",j[b],q?"flex w-full":"inline-flex",L),style:{...k(ne,C),...V},...Z,children:[z?e(t.Label,{id:ae,htmlFor:se,className:u(y[b],"font-semibold",D?"text-(--plass-muted-fg)":"text-(--plass-fg)",M?.label),children:z}):null,s(l.Root,{open:H,onOpenChange:e=>J(e),children:[s("span",{className:u($,p[b],c[b],w[b],x[b],N[P][b],D?m[g]:E?f[g]:h[g],M?.control),children:[e(t.Validity,{children:({validity:a})=>{const t=!1===a.valid,r=[B?le:null,ie||t&&!D&&!0!==O?re:null].filter(Boolean).join(" ")||void 0;return s(l.Trigger,{id:se,ref:Y,disabled:D,"aria-labelledby":z?`${ae} ${te}`:void 0,"aria-describedby":r,"aria-required":F||void 0,"aria-invalid":oe||t||void 0,onBlur:()=>{H||i(pe.current)},className:u("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",x[b],"[outline:none]",de?"cursor-default":"cursor-pointer"),children:[R?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:R}):null,s("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{id:te,className:u("w-full truncate",A?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:W}),q?null:e(n,{samples:_??[]})]})]})}}),!T||A||de?null:e("button",{type:"button","aria-label":K.clear,className:u(d,"text-(--plass-muted-fg)"),onClick:e=>{e.stopPropagation(),G()},children:e(o,{})})]}),e(l.Portal,{children:e(l.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",sideOffset:6,align:"start",children:e(l.Popup,{initialFocus:!1,className:u(pickerPopupClasses,w[b],popupPaddingClasses[b],c[b]),style:popupSlots(ne,3),children:X})})})]}),B?e(t.Description,{id:le,className:u(y[b],"text-(--plass-muted-fg)",M?.description),children:B}):null,e(t.Error,ie?{id:re,match:!0,className:u(y[b],"text-(--p-accent)",M?.error),children:I}:{id:re,className:u(y[b],"text-(--p-accent)",M?.error)}),e(r,{ref:pe,name:Q,value:U,required:F&&!E,disabled:D,standIn:()=>pe.current?.ownerDocument.getElementById(se)})]})}export function PickerFooter({size:s,children:a}){return e("div",{className:u("flex items-center justify-end border-t pt-1.5","[border-color:var(--plass-divider)]",x[s]),children:a})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--plass-divider)"})}
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Field as s}from"@base-ui/react/field";import{Popover as a}from"@base-ui/react/popover";import{FormControl as r,leaveFormControl as i,useDisabled as o,useFieldsetDisabled as n}from"./form.js";import{glowPointerMove as d}from"./glow.js";import{CloseIcon as p}from"./icons.js";import{WidthSizer as c}from"./sizer.js";import{textOf as m}from"./text.js";import{FieldNotch as u,floatPlaceholderClassName as f,notchShellStyle as h,resolveNotch as g}from"./notch.js";import{useDefaults as x}from"./defaults.js";import{chipRemoveClasses as b,controlHeightClasses as v,controlTextLeadingClasses as y,cx as N,disabledClasses as w,fieldDescriptionClasses as j,fieldReadOnlyClasses as P,fieldRestClasses as k,fieldSlots as $,focusWithinRingClasses as z,gapClasses as C,glassClasses as B,hasContent as D,iconClasses as E,metaTextClasses as I,paddingXClasses as O,radiusClasses as R,stackGapClasses as S,surfaceSlots as q,transitionClasses as F}from"./styles.js";export function popupSlots(e,t){return{...q(e,t),"--p-fill":`var(--plass-${e}-fill)`,"--p-on-solid":`var(--plass-${e}-on-solid)`}}const M=/* @__PURE__ */["relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",F,E].join(" "),L=z;export const pickerPopupClasses=/* @__PURE__ */[B,"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)]","motion-reduce:[transition-duration:0ms]","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 T=/* @__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:l,size:s}){return e(l,{className:T,children:t("svg",{width:s,height:s/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:z="glass",size:B="md",color:E="primary",density:q="default",elevation:F=0,label:T,labelPlacement:V,description:W,error:_,invalid:A,startIcon:G,fullWidth:H=!1,disabled:J=!1,readOnly:K=!1,required:Q=!1,id:U,className:X,classNames:Y,style:Z,display:ee,samples:te,empty:le,clearable:se=!1,onClear:ae,open:re,onOpenChange:ie,labels:oe,name:ne,formValue:de,children:pe,triggerRef:ce,...me}){const ue=l.useId(),fe=U??`${ue}-trigger`,he=`${ue}-label`,ge=`${ue}-value`,xe=`${ue}-description`,be=`${ue}-error`,ve=x(),ye=V??ve.labelPlacement??"top",{notched:Ne,float:we}=g(ye,T,D(G)),je=null!=_&&!1!==_&&""!==_,Pe=A??je,ke=Pe?"danger":E,[$e,ze]=l.useState(null),Ce=n($e),Be=o(J)||Ce,De=!Be&&!K,Ee=Be||K,Ie=l.useRef(null),Oe=e(s.Label,{id:he,htmlFor:fe,className:N(I[B],"font-semibold",Be?"text-(--plass-muted-fg)":"text-(--plass-fg)",Y?.label),children:T});return t(s.Root,{ref:ze,disabled:Be,invalid:Pe,className:N("flex-col align-top",S[B],H?"flex w-full":"inline-flex",X),style:{...$(ke,F),...Z},...me,children:[D(T)&&!Ne?Oe:null,t(a.Root,{open:re,onOpenChange:e=>ie(e),children:[e(u,{notched:Ne,size:B,density:q,variant:z,disabled:Be,readOnly:K,float:we,empty:le,label:Oe,children:t("span",{style:Ne?h:void 0,onPointerMove:d(De),className:N(M,Ne?"":L,v[B],y[B],R[B],C[B],O[q][B],Be?w[z]:K?P[z]:k[z],De?"plass-glow":"",Y?.control),children:[e(s.Validity,{children:({validity:l})=>{const s=!1===l.valid,r=[W?xe:null,je||s&&!Be&&!0!==A?be:null].filter(Boolean).join(" ")||void 0;return t(a.Trigger,{id:fe,ref:ce,disabled:Be,"aria-labelledby":T?`${he} ${ge}`:void 0,"aria-describedby":r,"aria-required":Q||void 0,"aria-invalid":Pe||s||void 0,onBlur:()=>{re||i(Ie.current)},className:N("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",C[B],"[outline:none]",Ee?"cursor-default":"cursor-pointer"),children:[G?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:G}):null,t("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{id:ge,className:N("w-full truncate",le?"text-(--plass-muted-fg)":"text-(--plass-fg)",we&&f),children:ee}),H?null:e(c,{samples:we?[...te??[],m(T)].filter(Boolean):te??[]})]})]})}}),!se||le||Ee?null:e("button",{type:"button","aria-label":oe.clear,className:N(b,"text-(--plass-muted-fg)"),onClick:e=>{e.stopPropagation();const t=e.currentTarget,l=t.ownerDocument.activeElement===t;ae(),l&&t.ownerDocument.getElementById(fe)?.focus()},children:e(p,{})})]})}),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:N(pickerPopupClasses,R[B],popupPaddingClasses[B],y[B]),style:popupSlots(ke,3),children:pe})})})]}),W?e(s.Description,{id:xe,className:N(j(B),Y?.description),children:W}):null,e(s.Error,je?{id:be,match:!0,className:N(I[B],"text-(--p-accent)",Y?.error),children:_}:{id:be,className:N(I[B],"text-(--p-accent)",Y?.error)}),e(r,{ref:Ie,name:ne,value:de,required:Q&&!K,disabled:Be,standIn:()=>Ie.current?.ownerDocument.getElementById(fe)})]})}export function PickerFooter({size:t,children:l}){return e("div",{className:N("flex items-center justify-end border-t pt-1.5","[border-color:var(--plass-divider)]",C[t]),children:l})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--plass-divider)"})}
@@ -128,7 +128,7 @@ export declare const trackClasses = "bg-(--plass-track) forced-colors:border for
128
128
  */
129
129
  export declare const fillClasses = "[background-image:var(--p-fill)] forced-colors:[background-color:Highlight] forced-colors:[border-color:Highlight] forced-colors:[color:HighlightText]";
130
130
  /** The bar's own duration, one step slower than a control's, so a fill reads as travel. */
131
- export declare const fillTransitionClasses = "[transition:width_var(--plass-duration-slow)_var(--plass-ease)]";
131
+ export declare const fillTransitionClasses = "[transition:width_var(--plass-duration-slow)_var(--plass-ease)] motion-reduce:[transition-duration:0ms]";
132
132
  /**
133
133
  * `value` as a fraction of the range, or `null` when there is nothing to say.
134
134
  *
@@ -137,16 +137,27 @@ export declare const fillTransitionClasses = "[transition:width_var(--plass-dura
137
137
  * one request finished twice is a worse bug than a bar that sits full.
138
138
  */
139
139
  export declare function progressFraction(value: number | null | undefined, min: number, max: number): number | null;
140
+ /**
141
+ * The value Base UI is handed: `value` clamped into the range, or `null`
142
+ * wherever `progressFraction` has nothing to say.
143
+ *
144
+ * Base UI clamps a finite value itself, but it reads one that is not finite as
145
+ * indeterminate, where `progressFraction` clamps `Infinity` to full. Handed the
146
+ * raw value, it would leave the fill, the value attributes and the text
147
+ * disagreeing about one number: a bar with neither a fill nor the sweep, and
148
+ * "100%" beside it. Handed this, all three read the fraction.
149
+ */
150
+ export declare function progressValue(value: number | null | undefined, min: number, max: number): number | null;
140
151
  /**
141
152
  * What the value reads as, both on screen and to a screen reader.
142
153
  *
143
154
  * Without `format` it is a percentage of the range rather than of 100 — "3%"
144
155
  * for step 3 of 4 is worse than saying nothing — written in `locale`, so a page
145
- * in German reads "75 %". Base UI's own default is that percentage too, but it
146
- * reads a value that is not finite as indeterminate where `progressFraction`
147
- * clamps it, so the percentage is written here from the fraction. A caller who
148
- * passed `format` gets Base UI's formatted string, in the same `locale`, because
149
- * at that point they have said what the number means.
156
+ * in German reads "75 %". Base UI's own default is that percentage too, and it
157
+ * is written here from the fraction all the same, so the words cannot read a
158
+ * different number from the fill. A caller who passed `format` gets Base UI's
159
+ * formatted string of `progressValue`, in the same `locale`, because at that
160
+ * point they have said what the number means.
150
161
  */
151
162
  export declare function progressText(fraction: number | null, formatted: string | null, hasFormat: boolean, locale: string | undefined): string | null;
152
163
  /**
@@ -1 +1 @@
1
- import{numberFormatter as s}from"./format.js";import{forcedFieldEdgeClasses as r,forcedFillClasses as e}from"./styles.js";export function progressSlots(s){return{"--p-fill":`var(--plass-${s}-fill)`,"--p-solid":`var(--plass-${s}-solid)`,"--p-solid-to":`var(--plass-${s}-solid-to)`,"--p-accent":`var(--plass-${s}-accent)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-press":`var(--plass-${s}-soft-press)`}}export const barThicknessClasses={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"};export const ringDiameters={xs:14,sm:16,md:20,lg:26,xl:32};export const ringStrokes={xs:1.5,sm:1.75,md:2,lg:2.5,xl:3};export const plateSizeClasses={xs:"size-2",sm:"size-2.5",md:"size-3",lg:"size-4",xl:"size-5"};export const plateRadiusClasses={xs:"rounded-[0.1875rem]",sm:"rounded-[0.25rem]",md:"rounded-[0.28125rem]",lg:"rounded-[0.375rem]",xl:"rounded-[0.4375rem]"};export const plateGapClasses={xs:"gap-1",sm:"gap-1",md:"gap-1.5",lg:"gap-1.5",xl:"gap-2"};export const trackClasses=`bg-(--plass-track) ${r}`;export const fillClasses=`[background-image:var(--p-fill)] ${e}`;export const fillTransitionClasses="[transition:width_var(--plass-duration-slow)_var(--plass-ease)]";export function progressFraction(s,r,e){return null==s||Number.isNaN(s)||e<=r?null:Math.min(1,Math.max(0,(s-r)/(e-r)))}const t={style:"percent"};export function progressText(r,e,o,l){return null===r?null:o?e:s(l,t).format(r)}export function progressAriaText(s,r,e){if(null!==s)return t=>progressText(s,t,r,e)??""}
1
+ import{numberFormatter as s}from"./format.js";import{forcedFieldEdgeClasses as r,forcedFillClasses as t}from"./styles.js";export function progressSlots(s){return{"--p-fill":`var(--plass-${s}-fill)`,"--p-solid":`var(--plass-${s}-solid)`,"--p-solid-to":`var(--plass-${s}-solid-to)`,"--p-accent":`var(--plass-${s}-accent)`,"--p-soft":`var(--plass-${s}-soft)`,"--p-soft-press":`var(--plass-${s}-soft-press)`}}export const barThicknessClasses={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"};export const ringDiameters={xs:14,sm:16,md:20,lg:26,xl:32};export const ringStrokes={xs:1.5,sm:1.75,md:2,lg:2.5,xl:3};export const plateSizeClasses={xs:"size-2",sm:"size-2.5",md:"size-3",lg:"size-4",xl:"size-5"};export const plateRadiusClasses={xs:"rounded-[0.1875rem]",sm:"rounded-[0.25rem]",md:"rounded-[0.28125rem]",lg:"rounded-[0.375rem]",xl:"rounded-[0.4375rem]"};export const plateGapClasses={xs:"gap-1",sm:"gap-1",md:"gap-1.5",lg:"gap-1.5",xl:"gap-2"};export const trackClasses=`bg-(--plass-track) ${r}`;export const fillClasses=`[background-image:var(--p-fill)] ${t}`;export const fillTransitionClasses="[transition:width_var(--plass-duration-slow)_var(--plass-ease)] motion-reduce:[transition-duration:0ms]";export function progressFraction(s,r,t){return null==s||Number.isNaN(s)||t<=r?null:Math.min(1,Math.max(0,(s-r)/(t-r)))}export function progressValue(s,r,t){return null==s||null===progressFraction(s,r,t)?null:Math.min(t,Math.max(r,s))}const e={style:"percent"};export function progressText(r,t,o,l){return null===r?null:o?t:s(l,e).format(r)}export function progressAriaText(s,r,t){if(null!==s)return e=>progressText(s,e,r,t)??""}
@@ -1,4 +1,3 @@
1
- import type * as React from 'react';
2
1
  /**
3
2
  * Holds a control open at the width of the widest thing it could ever say.
4
3
  *
@@ -18,15 +17,17 @@ import type * as React from 'react';
18
17
  * and a box that is not laid out reserves nothing.
19
18
  * - **Not read out.** `aria-hidden`, or a screen reader would announce every
20
19
  * value the control might hold before the one it does.
21
- * - **Not text.** A string sample is drawn as generated content off a data
22
- * attribute rather than as a text node. `content: attr(…)` lays out exactly
23
- * like text, so it reserves the same width — but it leaves nothing for
24
- * `getByText` or a screen reader's find-in-page to trip over, and a caller's
25
- * test asking for the option they selected keeps finding one element rather
26
- * than two. Only a sample that is not a string — an option whose label is a
27
- * node — has to be rendered for real, because there is nothing to put in an
28
- * attribute.
20
+ * - **Not text.** A sample is drawn as generated content off a data attribute
21
+ * rather than as a text node. `content: attr(…)` lays out exactly like text,
22
+ * so it reserves the same width — but it leaves nothing for `getByText` or a
23
+ * screen reader's find-in-page to trip over, and a caller's test asking for
24
+ * the option they selected keeps finding one element rather than two.
25
+ *
26
+ * Which is why a sample is a string and never a node. A label that is a node
27
+ * reaches here as its text, through `textOf`: laid out for real, a list of
28
+ * countries with a flag in each would ask for every flag to hold one field
29
+ * open, and a picture carries no width a reader could not do without.
29
30
  */
30
31
  export declare function WidthSizer({ samples }: {
31
- samples: readonly React.ReactNode[];
32
- }): React.JSX.Element | null;
32
+ samples: readonly string[];
33
+ }): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";export function WidthSizer({samples:a}){return 0===a.length?null:e("span",{"aria-hidden":"true",className:"invisible h-0 min-h-0 overflow-hidden",children:a.map((a,n)=>"string"==typeof a?e("span",{"data-sample":a,className:"block whitespace-nowrap before:content-[attr(data-sample)]"},`${n}:${a}`):e("span",{className:"block whitespace-nowrap",children:a},n))})}
1
+ import{jsx as e}from"react/jsx-runtime";export function WidthSizer({samples:a}){return 0===a.length?null:e("span",{"aria-hidden":"true",className:"invisible h-0 min-h-0 overflow-hidden",children:a.map((a,n)=>e("span",{"data-sample":a,className:"block whitespace-nowrap before:content-[attr(data-sample)]"},`${n}:${a}`))})}
@@ -40,21 +40,6 @@ export type PlassStepConnector = 'solid' | 'dashed' | 'dotted' | 'none';
40
40
  export declare const bulletSizeValues: Record<PlassSize, string>;
41
41
  /** Between the bullet column and the content beside it. */
42
42
  export declare const bulletGapClasses: Record<PlassSize, string>;
43
- /**
44
- * The bullet at each of the three states.
45
- *
46
- * Every one of them is a different axis, never a different opacity: `complete`
47
- * is the family's gradient, `current` is that gradient with a halo of the soft
48
- * tint around it, and `upcoming` is a hairline ring on the page's own surface. A
49
- * reader who cannot tell the colours apart still has a filled shape, a haloed
50
- * shape and an empty one.
51
- *
52
- * There is no gloss line on the two filled ones, for the reason a filled
53
- * `PlButton` has none — the gradient is the form. The `upcoming` ring is drawn
54
- * in the neutral hairline rather than the sheet's white one, the same call a
55
- * checkbox's edge makes: a bullet is small enough that its edge *is* the object,
56
- * and white light on a translucent pane disappears on a light card.
57
- */
58
43
  export declare const bulletStatusClasses: Record<PlassStepStatus, string>;
59
44
  /**
60
45
  * The line *after* a step, which is what makes it the step's own property: a
@@ -1 +1 @@
1
- import{forcedFillClasses as e}from"./styles.js";export const bulletSizeValues={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.875rem"};export const bulletGapClasses={xs:"gap-2",sm:"gap-2.5",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const bulletStatusClasses={complete:`[background-image:var(--p-fill)] text-(--p-on-solid) ${e}`,current:`[background-image:var(--p-fill)] text-(--p-on-solid) [box-shadow:0_0_0_0.25rem_var(--p-soft)] ${e} forced-colors:[outline:2px_solid_Highlight] forced-colors:[outline-offset:2px]`,upcoming:"border-2 bg-(--plass-surface) text-(--plass-muted-fg) [border-color:var(--plass-border)]"};export const connectorColorClasses={complete:"[border-color:var(--p-line-hover)]",current:"[border-color:var(--plass-border)]",upcoming:"[border-color:var(--plass-border)]"};export const connectorStyleClasses={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",none:""};export const titleStatusClasses={complete:"text-(--plass-fg)",current:"text-(--p-accent)",upcoming:"text-(--plass-muted-fg)"};export function statusAt(e,o){return null===o?"upcoming":e<o?"complete":e===o?"current":"upcoming"}
1
+ import{forcedFillClasses as e}from"./styles.js";export const bulletSizeValues={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.875rem"};export const bulletGapClasses={xs:"gap-2",sm:"gap-2.5",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};const o="plass-fill relative";export const bulletStatusClasses={complete:`${o} [--p-fill-on:1] text-(--p-on-solid) ${e}`,current:`${o} [--p-fill-on:1] text-(--p-on-solid) [box-shadow:0_0_0_0.25rem_var(--p-soft)] ${e} forced-colors:[outline:2px_solid_Highlight] forced-colors:[outline-offset:2px]`,upcoming:`${o} [--p-fill-edge:2px] border-2 bg-(--plass-surface) text-(--plass-muted-fg) [border-color:var(--plass-border)]`};export const connectorColorClasses={complete:"[border-color:var(--p-line-hover)]",current:"[border-color:var(--plass-border)]",upcoming:"[border-color:var(--plass-border)]"};export const connectorStyleClasses={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",none:""};export const titleStatusClasses={complete:"text-(--plass-fg)",current:"text-(--p-accent)",upcoming:"text-(--plass-muted-fg)"};export function statusAt(e,o){return null===o?"upcoming":e<o?"complete":e===o?"current":"upcoming"}