plass-ui 1.0.3 → 1.2.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 (122) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.md +2 -0
  3. package/dist/components/avatar/PlAvatar.js +1 -1
  4. package/dist/components/avatar-group/PlAvatarGroup.d.ts +47 -0
  5. package/dist/components/avatar-group/PlAvatarGroup.js +1 -0
  6. package/dist/components/avatar-group/index.d.ts +2 -0
  7. package/dist/components/avatar-group/index.js +1 -0
  8. package/dist/components/checkbox/PlCheckbox.d.ts +3 -1
  9. package/dist/components/checkbox/PlCheckbox.js +1 -1
  10. package/dist/components/color-picker/PlColorPicker.d.ts +88 -0
  11. package/dist/components/color-picker/PlColorPicker.js +1 -0
  12. package/dist/components/color-picker/index.d.ts +2 -0
  13. package/dist/components/color-picker/index.js +1 -0
  14. package/dist/components/combobox/PlCombobox.d.ts +4 -2
  15. package/dist/components/combobox/PlCombobox.js +1 -1
  16. package/dist/components/command-palette/PlCommandPalette.d.ts +89 -0
  17. package/dist/components/command-palette/PlCommandPalette.js +1 -0
  18. package/dist/components/command-palette/index.d.ts +2 -0
  19. package/dist/components/command-palette/index.js +1 -0
  20. package/dist/components/divider/PlDivider.js +1 -1
  21. package/dist/components/drawer/PlDrawer.d.ts +4 -2
  22. package/dist/components/drawer/PlDrawer.js +1 -1
  23. package/dist/components/fieldset/PlFieldset.d.ts +35 -0
  24. package/dist/components/fieldset/PlFieldset.js +1 -0
  25. package/dist/components/fieldset/index.d.ts +2 -0
  26. package/dist/components/fieldset/index.js +1 -0
  27. package/dist/components/footer/PlFooter.d.ts +90 -0
  28. package/dist/components/footer/PlFooter.js +1 -0
  29. package/dist/components/footer/index.d.ts +2 -0
  30. package/dist/components/footer/index.js +1 -0
  31. package/dist/components/form/PlForm.d.ts +61 -0
  32. package/dist/components/form/PlForm.js +1 -0
  33. package/dist/components/form/index.d.ts +2 -0
  34. package/dist/components/form/index.js +1 -0
  35. package/dist/components/header/PlHeader.d.ts +124 -0
  36. package/dist/components/header/PlHeader.js +1 -0
  37. package/dist/components/header/index.d.ts +2 -0
  38. package/dist/components/header/index.js +1 -0
  39. package/dist/components/menu/PlMenu.d.ts +4 -2
  40. package/dist/components/menu/PlMenu.js +1 -1
  41. package/dist/components/menubar/PlMenubar.d.ts +60 -0
  42. package/dist/components/menubar/PlMenubar.js +1 -0
  43. package/dist/components/menubar/index.d.ts +2 -0
  44. package/dist/components/menubar/index.js +1 -0
  45. package/dist/components/modal/PlModal.d.ts +4 -2
  46. package/dist/components/modal/PlModal.js +1 -1
  47. package/dist/components/navigation-menu/PlNavigationMenu.d.ts +103 -0
  48. package/dist/components/navigation-menu/PlNavigationMenu.js +1 -0
  49. package/dist/components/navigation-menu/index.d.ts +2 -0
  50. package/dist/components/navigation-menu/index.js +1 -0
  51. package/dist/components/number-field/PlNumberField.d.ts +4 -2
  52. package/dist/components/number-field/PlNumberField.js +1 -1
  53. package/dist/components/otp-field/PlOtpField.d.ts +3 -1
  54. package/dist/components/otp-field/PlOtpField.js +1 -1
  55. package/dist/components/overlay/PlOverlay.d.ts +4 -2
  56. package/dist/components/overlay/PlOverlay.js +1 -1
  57. package/dist/components/page-layout/PlPageLayout.d.ts +139 -0
  58. package/dist/components/page-layout/PlPageLayout.js +1 -0
  59. package/dist/components/page-layout/index.d.ts +2 -0
  60. package/dist/components/page-layout/index.js +1 -0
  61. package/dist/components/radio-group/PlRadioGroup.d.ts +3 -1
  62. package/dist/components/radio-group/PlRadioGroup.js +1 -1
  63. package/dist/components/scroll-zone/PlScrollZone.d.ts +35 -15
  64. package/dist/components/scroll-zone/PlScrollZone.js +1 -1
  65. package/dist/components/select/PlSelect.d.ts +3 -1
  66. package/dist/components/select/PlSelect.js +1 -1
  67. package/dist/components/sidebar/PlSidebar.d.ts +141 -0
  68. package/dist/components/sidebar/PlSidebar.js +1 -0
  69. package/dist/components/sidebar/PlSidebarTrigger.d.ts +34 -0
  70. package/dist/components/sidebar/PlSidebarTrigger.js +1 -0
  71. package/dist/components/sidebar/index.d.ts +4 -0
  72. package/dist/components/sidebar/index.js +1 -0
  73. package/dist/components/switch/PlSwitch.d.ts +3 -1
  74. package/dist/components/switch/PlSwitch.js +1 -1
  75. package/dist/components/text-field/PlTextField.d.ts +3 -1
  76. package/dist/components/text-field/PlTextField.js +1 -1
  77. package/dist/components/text-link/PlTextLink.d.ts +11 -2
  78. package/dist/components/text-link/PlTextLink.js +1 -1
  79. package/dist/components/toast/PlToast.d.ts +10 -0
  80. package/dist/components/toast/PlToast.js +1 -1
  81. package/dist/components/toggle/PlToggle.d.ts +55 -0
  82. package/dist/components/toggle/PlToggle.js +1 -0
  83. package/dist/components/toggle/PlToggleGroup.d.ts +48 -0
  84. package/dist/components/toggle/PlToggleGroup.js +1 -0
  85. package/dist/components/toggle/index.d.ts +4 -0
  86. package/dist/components/toggle/index.js +1 -0
  87. package/dist/components/transfer/PlTransfer.d.ts +55 -0
  88. package/dist/components/transfer/PlTransfer.js +1 -0
  89. package/dist/components/transfer/index.d.ts +2 -0
  90. package/dist/components/transfer/index.js +1 -0
  91. package/dist/css/avatar-group.css +2 -0
  92. package/dist/css/color-picker.css +2 -0
  93. package/dist/css/command-palette.css +2 -0
  94. package/dist/css/fieldset.css +2 -0
  95. package/dist/css/footer.css +2 -0
  96. package/dist/css/form.css +2 -0
  97. package/dist/css/header.css +2 -0
  98. package/dist/css/menubar.css +2 -0
  99. package/dist/css/navigation-menu.css +2 -0
  100. package/dist/css/page-layout.css +2 -0
  101. package/dist/css/sidebar.css +2 -0
  102. package/dist/css/toggle.css +2 -0
  103. package/dist/css/transfer.css +2 -0
  104. package/dist/index.d.ts +13 -0
  105. package/dist/index.js +1 -1
  106. package/dist/internal/avatar-group.d.ts +25 -0
  107. package/dist/internal/avatar-group.js +2 -0
  108. package/dist/internal/color.d.ts +109 -0
  109. package/dist/internal/color.js +1 -0
  110. package/dist/internal/link.d.ts +18 -0
  111. package/dist/internal/link.js +1 -0
  112. package/dist/internal/page-layout.d.ts +140 -0
  113. package/dist/internal/page-layout.js +1 -0
  114. package/dist/internal/picker.d.ts +4 -2
  115. package/dist/internal/picker.js +1 -1
  116. package/dist/internal/search.d.ts +31 -0
  117. package/dist/internal/search.js +1 -0
  118. package/dist/internal/styles.d.ts +9 -0
  119. package/dist/internal/styles.js +1 -1
  120. package/dist/styles.css +1 -1
  121. package/dist/types.d.ts +72 -0
  122. package/package.json +3 -3
@@ -0,0 +1,140 @@
1
+ import * as React from 'react';
2
+ import type { PlassBreakpoint, PlassSide } from '../types.js';
3
+ /**
4
+ * The vocabulary a page's structure is written in, and the context the four
5
+ * components that build one share.
6
+ *
7
+ * It lives here for the reason `menu.ts` does rather than the reason
8
+ * `button-group.ts` does: five components read it — `PlPageLayout`, `PlHeader`,
9
+ * `PlFooter`, `PlSidebar` and `PlSidebarTrigger` — and every one of them is
10
+ * also usable on its own. Keeping the context in the layout's own file would
11
+ * make a header import a layout it may never be inside.
12
+ *
13
+ * Nothing here draws anything. The arrangement is flexbox and media queries,
14
+ * both of which CSS states better than JavaScript can; what needs a context is
15
+ * the handful of facts a slot cannot work out from where it sits — how wide the
16
+ * window has to be before a sidebar stops being a column, and whether a drawer
17
+ * is open.
18
+ */
19
+ /** Which end of the band a sidebar takes. Logical, so it flips under RTL. */
20
+ export type PlassSidebarSide = 'start' | 'end';
21
+ /** The two slots a layout measures, because a sidebar has to start below them. */
22
+ export type PlPageLayoutSlot = 'header' | 'footer';
23
+ /**
24
+ * How far across a header or a footer reaches.
25
+ *
26
+ * - `full` — the whole width, with the sidebars beginning underneath it. The
27
+ * arrangement of a website: one bar across the top, and the page below it.
28
+ * - `content` — only the column between the sidebars, which run the full height
29
+ * of the window beside it. The arrangement of an application: the navigation
30
+ * is the outermost thing on the screen and the bar belongs to the view.
31
+ *
32
+ * There is no third value, because there is no third arrangement: what is being
33
+ * decided is which of the two takes the corner.
34
+ */
35
+ export type PlPageLayoutSpan = 'full' | 'content';
36
+ /**
37
+ * What scrolls.
38
+ *
39
+ * - `page` — the document does, the way a website does. The header and the
40
+ * sidebars hold their place with `position: sticky`, the browser's own
41
+ * address bar hides on a phone, and the scroll position is restored on a back
42
+ * navigation. This is the default, and it is what almost every page wants.
43
+ * - `content` — the layout takes exactly the height of the window and only the
44
+ * region between the header and the footer scrolls, the way an application
45
+ * does. Reach for it when the page is a workspace rather than a document.
46
+ */
47
+ export type PlPageLayoutScroll = 'page' | 'content';
48
+ /**
49
+ * The width below which a sidebar stops being part of the layout and becomes a
50
+ * drawer that is opened, or `none` to keep it a column at every width.
51
+ *
52
+ * `xs` is the breakpoint whose floor is `0`, so nothing is ever below it — it
53
+ * means the same as `none`, and is accepted only because `PlassBreakpoint` has
54
+ * five values everywhere else in the library.
55
+ */
56
+ export type PlPageLayoutCollapse = PlassBreakpoint | 'none';
57
+ export interface PlPageLayoutContextValue {
58
+ /**
59
+ * Whether there is a `PlPageLayout` above at all.
60
+ *
61
+ * A header, a footer and a sidebar all render perfectly well without one —
62
+ * they are a bar, a bar and a panel. What they cannot do on their own is
63
+ * agree with each other about where they sit, which is the whole of what a
64
+ * layout adds and the reason a component has to be able to tell.
65
+ */
66
+ present: boolean;
67
+ /**
68
+ * Hands the layout the element filling one of its slots.
69
+ *
70
+ * The layout measures it and writes its height onto its own root as a custom
71
+ * property, because a sidebar that holds its place has to start below a
72
+ * header whose height only the header knows. A callback rather than a
73
+ * `querySelector`, so a bar rendered through `render={<MyBar />}` is found as
74
+ * reliably as one that is not.
75
+ */
76
+ register: (slot: PlPageLayoutSlot, node: HTMLElement | null) => void;
77
+ /** Where the sidebars stop being columns. */
78
+ collapseBelow: PlPageLayoutCollapse;
79
+ /** Whether each sidebar's drawer is open. Only meaningful while it is collapsed. */
80
+ open: Record<PlassSidebarSide, boolean>;
81
+ setOpen: (side: PlassSidebarSide, open: boolean) => void;
82
+ /** How the page scrolls, which decides how a sidebar holds its place. */
83
+ scroll: PlPageLayoutScroll;
84
+ }
85
+ export declare const PlPageLayoutContext: React.Context<PlPageLayoutContextValue>;
86
+ /**
87
+ * Which end of the band the sidebar being rendered right now takes.
88
+ *
89
+ * A second, one-value context rather than a field on the one above, because it
90
+ * is the one fact that differs *between* two sidebars in the same layout: the
91
+ * layout wraps each slot in its own provider, so a sidebar handed to the
92
+ * trailing slot needs no `side` prop of its own to know where it is. `null` is
93
+ * "nobody said", which a standalone sidebar reads as `start`.
94
+ */
95
+ export declare const PlassSidebarSideContext: React.Context<PlassSidebarSide | null>;
96
+ /**
97
+ * The same five widths as Tailwind variants, for the parts of this that are
98
+ * decided in CSS rather than in JavaScript.
99
+ *
100
+ * Written out per breakpoint because Tailwind only ever sees class names that
101
+ * appear literally in the source — the same reason every table in
102
+ * `internal/styles.ts` is a `Record` of complete strings.
103
+ *
104
+ * `collapsedOnlyClasses` hides something at and above the breakpoint, which is
105
+ * what a sidebar's own trigger wants: the hamburger exists exactly while the
106
+ * column does not. `expandedOnlyClasses` hides it below, which is what the
107
+ * column wants for the one paint between the server's HTML arriving and
108
+ * JavaScript finding out how wide the window is — without it a phone draws the
109
+ * sidebar full width and then throws it away.
110
+ */
111
+ export declare const collapsedOnlyClasses: Record<PlPageLayoutCollapse, string>;
112
+ export declare const expandedOnlyClasses: Record<PlPageLayoutCollapse, string>;
113
+ /**
114
+ * Whether the window is currently narrower than the breakpoint a sidebar
115
+ * collapses at.
116
+ *
117
+ * `useSyncExternalStore` rather than an effect and a `useState`, for the one
118
+ * reason that matters here: it has a server snapshot, and the server's answer
119
+ * has to be "not collapsed". A collapsed sidebar is a `PlDrawer`, a drawer is a
120
+ * portal, and a portal rendered into `document.body` on the server is not a
121
+ * thing — so the markup that ships is the column, and the classes above are
122
+ * what keep that column off a narrow screen until this hook can say otherwise.
123
+ */
124
+ export declare function useCollapsed(breakpoint: PlPageLayoutCollapse): boolean;
125
+ /**
126
+ * `start` and `end` as the two sides a `PlDrawer` speaks.
127
+ *
128
+ * A sidebar says which end of the band it takes, because that is a layout
129
+ * question and a layout flips under RTL on its own. A drawer is attached to an
130
+ * edge of the *window*, which `PlassSide` names physically for the same reason
131
+ * a tooltip above a button is above it in every writing direction — so the two
132
+ * have to be translated, and the document's own direction is what translates
133
+ * them.
134
+ *
135
+ * Read during render rather than in an effect, which is safe here for a
136
+ * narrower reason than it looks: the only caller is a sidebar that has already
137
+ * collapsed, and collapsing is a client-side answer. There is no server render
138
+ * of this to disagree with.
139
+ */
140
+ export declare function drawerSide(side: PlassSidebarSide): PlassSide;
@@ -0,0 +1 @@
1
+ "use client";import*as e from"react";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);const n={xs:null,sm:"(width < 40rem)",md:"(width < 48rem)",lg:"(width < 64rem)",xl:"(width < 80rem)"};export const collapsedOnlyClasses={none:"hidden",xs:"hidden",sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"};export const expandedOnlyClasses={none:"",xs:"",sm:"max-sm:hidden",md:"max-md:hidden",lg:"max-lg:hidden",xl:"max-xl:hidden"};export function useCollapsed(t){const d="none"===t?null:n[t],o=e.useCallback(e=>{if(!d||"undefined"==typeof window||!window.matchMedia)return()=>{};const n=window.matchMedia(d);return n.addEventListener("change",e),()=>n.removeEventListener("change",e)},[d]),i=e.useCallback(()=>!(!d||"undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches,[d]);return e.useSyncExternalStore(o,i,()=>!1)}export function drawerSide(e){const n="undefined"!=typeof document&&"rtl"===getComputedStyle(document.documentElement).direction;return"start"===e?n?"right":"left":n?"left":"right"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { PlassPickerLabels } from './calendar.js';
3
- import type { PlassColor, PlassElevation, PlassSize, PlassStyleProps } from '../types.js';
3
+ import type { PlassColor, PlassElevation, PlassFieldClassNames, 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.
@@ -59,6 +59,8 @@ export interface PlassPickerShellProps extends PlassStyleProps, Omit<React.Compo
59
59
  invalid?: boolean;
60
60
  /** The glyph before the value — a calendar or a clock. */
61
61
  startIcon?: React.ReactNode;
62
+ /** Classes on the parts a `className` does not reach. */
63
+ classNames?: PlassFieldClassNames;
62
64
  /** Stretches to the width of the container. */
63
65
  fullWidth?: boolean;
64
66
  /** Unavailable. */
@@ -102,7 +104,7 @@ interface InternalShellProps extends PlassPickerShellProps {
102
104
  * and the way `invalid` re-points the whole colour family at `danger` so the
103
105
  * edge, the ring and the message turn over together.
104
106
  */
105
- export declare function PickerShell({ variant, size, color, density, elevation, label, description, error, invalid, startIcon, fullWidth, disabled, readOnly, required, id, className, style, display, samples, empty, clearable, onClear, open, onOpenChange, labels, hiddenValues, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
107
+ 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, hiddenValues, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
106
108
  /**
107
109
  * The row of shortcuts under a picker's panel.
108
110
  *
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{Field as a}from"@base-ui/react/field";import{Popover as r}from"@base-ui/react/popover";import{CloseIcon as t}from"./icons.js";import{WidthSizer as i}from"./sizer.js";import{chipRemoveClasses as n,controlHeightClasses as o,controlTextLeadingClasses as p,cx as d,disabledClasses as c,fieldReadOnlyClasses as u,fieldRestClasses as m,focusWithinRingClasses as f,gapClasses as h,glassClasses as g,iconClasses as x,metaTextClasses as b,paddingXClasses as v,radiusClasses as y,stackGapClasses as N,surfaceSlots as P,transitionClasses as j}from"./styles.js";export function popupSlots(e,l){return{...P(e,l),"--p-fill":`var(--plass-${e}-fill)`,"--p-on-solid":`var(--plass-${e}-on-solid)`}}const w=/* @__PURE__ */["group relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",j,f,x].join(" ");export const pickerPopupClasses=/* @__PURE__ */[g,"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"};export function PickerShell({variant:f="glass",size:g="md",color:x="primary",density:j="default",elevation:k=0,label:C,description:$,error:z,invalid:O,startIcon:F,fullWidth:R=!1,disabled:S=!1,readOnly:q=!1,required:D=!1,id:I,className:_,style:B,display:E,samples:L,empty:T,clearable:V=!1,onClear:W,open:A,onOpenChange:G,labels:H,hiddenValues:J,children:K,triggerRef:M,...Q}){const U=s.useId(),X=I??`${U}-trigger`,Y=`${U}-label`,Z=`${U}-description`,ee=`${U}-error`,le=null!=z&&!1!==z&&""!==z,se=O??le,ae=se?"danger":x,re=S||q,te=[$?Z:null,le?ee:null].filter(Boolean).join(" ")||void 0;return l(a.Root,{disabled:S,invalid:se,className:d("flex-col align-top",N[g],R?"flex w-full":"inline-flex",_),style:{...P(ae,k),...B},...Q,children:[C?e(a.Label,{id:Y,htmlFor:X,className:d(b[g],"font-semibold",S?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:C}):null,l(r.Root,{open:A,onOpenChange:e=>G(e),children:[l("span",{className:d(w,o[g],p[g],y[g],h[g],v[j][g],S?c[f]:q?u[f]:m[f]),children:[l(r.Trigger,{id:X,ref:M,disabled:S,"aria-labelledby":C?Y:void 0,"aria-describedby":te,"aria-required":D||void 0,"aria-invalid":se||void 0,className:d("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",h[g],"[outline:none]",re?"cursor-default":"cursor-pointer"),children:[F?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:F}):null,l("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{className:d("w-full truncate",T?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:E}),e(i,{samples:L??[]})]})]}),!V||T||re?null:e("button",{type:"button","aria-label":H.clear,className:d(n,"text-(--plass-muted-fg)"),onClick:e=>{e.stopPropagation(),W()},children:e(t,{})})]}),e(r.Portal,{children:e(r.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",sideOffset:6,align:"start",children:e(r.Popup,{initialFocus:!1,className:d(pickerPopupClasses,y[g],popupPaddingClasses[g],p[g]),style:popupSlots(ae,3),children:K})})})]}),$?e(a.Description,{id:Z,className:d(b[g],"text-(--plass-muted-fg)"),children:$}):null,le?e(a.Error,{id:ee,match:!0,className:d(b[g],"text-(--p-accent)"),children:z}):null,J?.map((l,s)=>e("input",{type:"hidden",name:l.name,value:l.value},s))]})}export function PickerFooter({size:l,children:s}){return e("div",{className:d("flex items-center justify-end border-t pt-1.5","[border-color:var(--plass-divider)]",h[l]),children:s})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--plass-divider)"})}
1
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{Field as a}from"@base-ui/react/field";import{Popover as r}from"@base-ui/react/popover";import{CloseIcon as t}from"./icons.js";import{WidthSizer as i}from"./sizer.js";import{chipRemoveClasses as n,controlHeightClasses as o,controlTextLeadingClasses as p,cx as d,disabledClasses as c,fieldReadOnlyClasses as u,fieldRestClasses as m,focusWithinRingClasses as f,gapClasses as h,glassClasses as g,iconClasses as x,metaTextClasses as b,paddingXClasses as v,radiusClasses as y,stackGapClasses as N,surfaceSlots as P,transitionClasses as j}from"./styles.js";export function popupSlots(e,l){return{...P(e,l),"--p-fill":`var(--plass-${e}-fill)`,"--p-on-solid":`var(--plass-${e}-on-solid)`}}const w=/* @__PURE__ */["group relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",j,f,x].join(" ");export const pickerPopupClasses=/* @__PURE__ */[g,"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"};export function PickerShell({variant:f="glass",size:g="md",color:x="primary",density:j="default",elevation:k=0,label:C,description:$,error:z,invalid:O,startIcon:F,fullWidth:R=!1,disabled:S=!1,readOnly:q=!1,required:D=!1,id:I,className:_,classNames:B,style:E,display:L,samples:T,empty:V,clearable:W=!1,onClear:A,open:G,onOpenChange:H,labels:J,hiddenValues:K,children:M,triggerRef:Q,...U}){const X=s.useId(),Y=I??`${X}-trigger`,Z=`${X}-label`,ee=`${X}-description`,le=`${X}-error`,se=null!=z&&!1!==z&&""!==z,ae=O??se,re=ae?"danger":x,te=S||q,ie=[$?ee:null,se?le:null].filter(Boolean).join(" ")||void 0;return l(a.Root,{disabled:S,invalid:ae,className:d("flex-col align-top",N[g],R?"flex w-full":"inline-flex",_),style:{...P(re,k),...E},...U,children:[C?e(a.Label,{id:Z,htmlFor:Y,className:d(b[g],"font-semibold",S?"text-(--plass-muted-fg)":"text-(--plass-fg)",B?.label),children:C}):null,l(r.Root,{open:G,onOpenChange:e=>H(e),children:[l("span",{className:d(w,o[g],p[g],y[g],h[g],v[j][g],S?c[f]:q?u[f]:m[f],B?.control),children:[l(r.Trigger,{id:Y,ref:Q,disabled:S,"aria-labelledby":C?Z:void 0,"aria-describedby":ie,"aria-required":D||void 0,"aria-invalid":ae||void 0,className:d("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",h[g],"[outline:none]",te?"cursor-default":"cursor-pointer"),children:[F?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:F}):null,l("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{className:d("w-full truncate",V?"text-(--plass-muted-fg)":"text-(--plass-fg)"),children:L}),e(i,{samples:T??[]})]})]}),!W||V||te?null:e("button",{type:"button","aria-label":J.clear,className:d(n,"text-(--plass-muted-fg)"),onClick:e=>{e.stopPropagation(),A()},children:e(t,{})})]}),e(r.Portal,{children:e(r.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",sideOffset:6,align:"start",children:e(r.Popup,{initialFocus:!1,className:d(pickerPopupClasses,y[g],popupPaddingClasses[g],p[g]),style:popupSlots(re,3),children:M})})})]}),$?e(a.Description,{id:ee,className:d(b[g],"text-(--plass-muted-fg)",B?.description),children:$}):null,se?e(a.Error,{id:le,match:!0,className:d(b[g],"text-(--p-accent)",B?.error),children:z}):null,K?.map((l,s)=>e("input",{type:"hidden",name:l.name,value:l.value},s))]})}export function PickerFooter({size:l,children:s}){return e("div",{className:d("flex items-center justify-end border-t pt-1.5","[border-color:var(--plass-divider)]",h[l]),children:s})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--plass-divider)"})}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * What "this matches what I typed" means, once.
3
+ *
4
+ * Two components let a reader type at a list of their own — `PlTransfer` and
5
+ * `PlCommandPalette` — and a `matches` in each of them is two answers to one
6
+ * question. They would disagree, and not because anybody chose: a reader who
7
+ * has learned what the filter in one part of a product does has learned the
8
+ * wrong thing about the rest of it.
9
+ *
10
+ * It is also where the fixed cost of typing lives. `String.prototype.normalize`
11
+ * is the expensive call here by a wide margin, so the shape of this is folding
12
+ * a haystack **once** and a needle **once** rather than folding both on every
13
+ * comparison — which is what a `matches(item, query)` signature quietly asks
14
+ * for, and what would put a `normalize` on every row on every keystroke.
15
+ */
16
+ /**
17
+ * A value as something a query can be matched against.
18
+ *
19
+ * Case-folded and stripped of combining marks, so `jose` finds `José` and
20
+ * `SEOUL` finds `Seoul`. `NFD` splits an accented letter into the letter and
21
+ * its accent and the range then deletes the accent; a search field is the one
22
+ * place where losing that distinction is the point.
23
+ *
24
+ * Anything that is not a primitive folds to the empty string. What a reader
25
+ * sees came out of the caller's own rendering, and guessing at the text inside
26
+ * a React element is how a list ends up not finding a row that is on the
27
+ * screen — a row that wants to be searchable says so in a string.
28
+ */
29
+ export declare function searchText(value: unknown): string;
30
+ /** Every string a row can be found by, folded once and joined into one haystack. */
31
+ export declare function searchHaystack(values: readonly unknown[]): string;
@@ -0,0 +1 @@
1
+ const e=/[\u0300-\u036f]/g;export function searchText(t){return null==t||"object"==typeof t?"":String(t).normalize("NFD").replace(e,"").toLowerCase()}export function searchHaystack(e){return e.map(searchText).join("\0")}
@@ -365,6 +365,15 @@ export declare const sheetRestClasses: Record<PlassVariant, string>;
365
365
  export declare const fieldRestClasses: Record<PlassVariant, string>;
366
366
  /** The same three, held still. */
367
367
  export declare const fieldReadOnlyClasses: Record<PlassVariant, string>;
368
+ /**
369
+ * A length a caller may have written as a bare number.
370
+ *
371
+ * Turns `2` into `2px` and leaves `'0.5rem'` alone, which is the one conversion
372
+ * every prop that accepts a CSS length needs — a divider's thickness, a page
373
+ * layout's height, a sidebar's width. Here rather than in each of them because
374
+ * three copies of two lines are three copies that can disagree about `0`.
375
+ */
376
+ export declare function toLength(value: number | string | undefined): string | undefined;
368
377
  /** `false`, `null`, `undefined` and `''` all mean "this slot is not filled". */
369
378
  export declare function hasContent(node: React.ReactNode): boolean;
370
379
  /** Joins class name fragments, dropping the empty ones. */
@@ -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-1.5",sm:"size-1.5",md:"size-2",lg:"size-2",xl:"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]","[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__ */["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full","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,a){const r="solid"===a;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 disabledClasses={solid:/* @__PURE__ */["cursor-not-allowed text-(--p-on-solid) [background-image:var(--p-fill)]","opacity-50 saturate-[0.35] shadow-none"].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)]","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)","[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 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-1.5",sm:"size-1.5",md:"size-2",lg:"size-2",xl:"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]","[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__ */["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full","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,a){const r="solid"===a;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 disabledClasses={solid:/* @__PURE__ */["cursor-not-allowed text-(--p-on-solid) [background-image:var(--p-fill)]","opacity-50 saturate-[0.35] shadow-none"].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)]","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)","[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(" ")}