@cloudgrid-io/ui 0.41.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/confirm-delete-dialog.d.ts.map +1 -1
- package/dist/blocks/confirm-delete-dialog.js +5 -1
- package/dist/blocks/confirm-delete-dialog.js.map +1 -1
- package/dist/blocks/locked-section.d.ts +36 -9
- package/dist/blocks/locked-section.d.ts.map +1 -1
- package/dist/blocks/locked-section.js +31 -6
- package/dist/blocks/locked-section.js.map +1 -1
- package/dist/blocks/search-field.d.ts +24 -0
- package/dist/blocks/search-field.d.ts.map +1 -0
- package/dist/blocks/search-field.js +28 -0
- package/dist/blocks/search-field.js.map +1 -0
- package/dist/blocks/shelf.d.ts +24 -9
- package/dist/blocks/shelf.d.ts.map +1 -1
- package/dist/blocks/shelf.js +52 -15
- package/dist/blocks/shelf.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cloudgrid-cn.d.ts +14 -0
- package/dist/lib/cloudgrid-cn.d.ts.map +1 -1
- package/dist/lib/cloudgrid-cn.js +17 -0
- package/dist/lib/cloudgrid-cn.js.map +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +19 -0
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button.d.ts +4 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +97 -43
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/dialog.d.ts +52 -0
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +57 -5
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/drawer.d.ts +83 -11
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +137 -17
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/input-group.d.ts.map +1 -1
- package/dist/ui/input-group.js +7 -2
- package/dist/ui/input-group.js.map +1 -1
- package/dist/ui/input.d.ts +6 -1
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +61 -3
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +24 -6
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/select.d.ts +10 -0
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +11 -1
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/table.d.ts +27 -0
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +39 -6
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +1 -1
- package/dist/ui/textarea.d.ts +7 -0
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +8 -1
- package/dist/ui/textarea.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/dialog.js
CHANGED
|
@@ -52,21 +52,73 @@ function DialogClose({ ...props }) {
|
|
|
52
52
|
function DialogOverlay({ className, forceRender = true, ...props }) {
|
|
53
53
|
return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", forceRender: forceRender, className: cn("fixed inset-0 isolate z-50 scrim-overlay duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* The card: the CloudGrid 2026 Figma popup "New Vault Item" (ui#372, node
|
|
57
|
+
* 7537:8484, file 5ouhISIL0mwYGHurvCGoEO).
|
|
58
|
+
*
|
|
59
|
+
* ```
|
|
60
|
+
* .--------------------------------------------- 525 ---.
|
|
61
|
+
* | New Vault Item [x] | 24 top
|
|
62
|
+
* | | 24 gap
|
|
63
|
+
* | (the caller's content: a form, a line, a tile) |
|
|
64
|
+
* | |
|
|
65
|
+
* | [ Cancel ] [ Create Item ] | 24 bottom
|
|
66
|
+
* '------------------------------------------------------'
|
|
67
|
+
* 32 each side
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* White in a 1px `--cg-border-hairline`, radius 12 (`--cg-radius-md`), padding
|
|
71
|
+
* 24 top and bottom and 32 left and right, its rows 24 apart. 525 wide from `sm`
|
|
72
|
+
* up; on a phone it fills the width less a 16px gutter each side.
|
|
73
|
+
*
|
|
74
|
+
* The ground is `bg-popover`, the overlay ground (#230), not `bg-card`. The card
|
|
75
|
+
* portals to the document root, where both are white, but `--cg-surface-card` is
|
|
76
|
+
* transparent on the panel and a 4% wash on ink; `--popover` stays opaque in
|
|
77
|
+
* every scope, so the card cannot turn see-through if a page ever puts a dark
|
|
78
|
+
* scope on the root.
|
|
79
|
+
*
|
|
80
|
+
* It is capped at the window's height less 2rem and scrolls inside, because a
|
|
81
|
+
* centred fixed card with no cap pushes its top above the window on a short
|
|
82
|
+
* screen (a phone on its side, 812x375), where no scroll reaches it (#375).
|
|
83
|
+
*
|
|
84
|
+
* The close X is a 20px Phosphor X at the top right, its glyph level with the
|
|
85
|
+
* title and its right edge on the 32px content edge, level with the footer
|
|
86
|
+
* (Figma 7537:8601): `right-6.5` is 26px, and the 32px target centres the glyph
|
|
87
|
+
* 6px in, so 26 + 6 = 32. Named "Close", reachable by Tab, and a real
|
|
88
|
+
* `DialogPrimitive.Close`, so it closes exactly as Escape and the scrim do.
|
|
89
|
+
* `showCloseButton={false}` drops it, as before.
|
|
90
|
+
*
|
|
91
|
+
* Blocks override the card through `className` (tailwind-merge resolves the
|
|
92
|
+
* conflict): `ConfirmDeleteDialog` keeps its 24 padding and 448 width,
|
|
93
|
+
* `PluggedDialog` its own radius and 632 width.
|
|
94
|
+
*/
|
|
55
95
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
56
96
|
const modal = React.useContext(DialogModalContext);
|
|
57
|
-
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", "aria-modal": modal !== false ? true : undefined, className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-
|
|
97
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", "aria-modal": modal !== false ? true : undefined, className: cn("fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100svh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 overflow-y-auto rounded-md border border-hairline bg-popover px-8 py-6 text-body-sm text-ink duration-100 outline-none sm:max-w-131.25 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-5 right-6.5 text-ink", size: "icon" }), children: [_jsx(CloseIcon, { className: "size-5" }), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
58
98
|
}
|
|
99
|
+
/** The title and its line. `pr-8` keeps a long title clear of the close X. */
|
|
59
100
|
function DialogHeader({ className, ...props }) {
|
|
60
|
-
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props }));
|
|
101
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 pr-8", className), ...props }));
|
|
61
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* The actions row: right-aligned at every width, 8px apart, on the card itself.
|
|
105
|
+
* No grey band and no top rule (the shadcn footer had both; the Figma popup has
|
|
106
|
+
* neither).
|
|
107
|
+
*
|
|
108
|
+
* Documented use, from the Figma popup: Cancel is `variant="tertiary-soft"`, the
|
|
109
|
+
* main action is `variant="cta"` (the filled tertiary), both `size="xl"`: 40
|
|
110
|
+
* tall, radius 16, 20 each side, Manrope Bold 15 on a 15px line (the 2026 Button
|
|
111
|
+
* S, #382). `showCloseButton` adds a Close in the soft tertiary at that size.
|
|
112
|
+
*/
|
|
62
113
|
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
63
|
-
return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("
|
|
114
|
+
return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("flex flex-wrap items-center justify-end gap-2", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "tertiary-soft", size: "xl" }), children: "Close" }))] }));
|
|
64
115
|
}
|
|
116
|
+
/** The Figma popup's H4: Manrope Medium 22/1.2, ink. */
|
|
65
117
|
function DialogTitle({ className, ...props }) {
|
|
66
|
-
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("font-
|
|
118
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("m-0 font-ui text-heading-lg font-medium text-ink", className), ...props }));
|
|
67
119
|
}
|
|
68
120
|
function DialogDescription({ className, ...props }) {
|
|
69
|
-
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-body-sm text-
|
|
121
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("m-0 text-body-sm text-body *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-ink", className), ...props }));
|
|
70
122
|
}
|
|
71
123
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
72
124
|
//# sourceMappingURL=dialog.js.map
|
package/dist/ui/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/ui/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEj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GED
|
@@ -71,7 +71,55 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
71
71
|
*
|
|
72
72
|
* The popup is `w-full` under a `max-w-*` rung, so below 448px it simply fills
|
|
73
73
|
* the screen. No breakpoint prop, no phone variant, nothing for a caller to
|
|
74
|
-
* remember. #214 asks for exactly this.
|
|
74
|
+
* remember. #214 asks for exactly this. Since #399 "the screen" is the inset
|
|
75
|
+
* box: a card at 375 is 351 wide, 12 in from both sides, never wider than the
|
|
76
|
+
* window. The same 12 as the desktop inset, not a smaller phone one, so there is
|
|
77
|
+
* one number to remember and the card still reads as a card.
|
|
78
|
+
*
|
|
79
|
+
* ## The card (#399)
|
|
80
|
+
*
|
|
81
|
+
* The CloudGrid 2026 Figma draws every side panel as a floating card, not an
|
|
82
|
+
* edge sheet: "App final / Side panel", 01 Overview 11092:22206, 04 Preview
|
|
83
|
+
* 11092:23488 (the card 11092:23650) and the flow thumbnail 11092:24222. Measured
|
|
84
|
+
* off 11092:23650 in its 1600 x 1100 frame:
|
|
85
|
+
*
|
|
86
|
+
* inset 12 from the top, the bottom and the outer edge viewport p-3
|
|
87
|
+
* corner 12 rounded-md
|
|
88
|
+
* border 1px all round border border-line
|
|
89
|
+
* shadow 0 4px 14px #222222 at 6% shadow-raised
|
|
90
|
+
* (that is --cg-shadow-raised exactly; no new token)
|
|
91
|
+
* padding 24 top, 32 right, bottom and left the parts, below
|
|
92
|
+
* title 22/1.2 medium, 24 over the body the 2026 DialogTitle's
|
|
93
|
+
* close X a 20px glyph ending on the 32px content edge ghost `icon`, -mx-1.5
|
|
94
|
+
* actions 16 apart and 16 before the X gap-4
|
|
95
|
+
*
|
|
96
|
+
* So `form="card"` is the default on `right` and `left`. `form="sheet"` keeps
|
|
97
|
+
* the edge sheet this file drew before, class for class, for anything that wants
|
|
98
|
+
* it. `bottom` is always a sheet: a phone sheet is anchored to the edge it slides
|
|
99
|
+
* from, and nothing in the frames floats it.
|
|
100
|
+
*
|
|
101
|
+
* The inset is the viewport's padding, not the popup's margin, so `h-full` and
|
|
102
|
+
* `w-full` keep meaning "the box the card may use" at every rung. A press on that
|
|
103
|
+
* 12px gutter is a press on Base UI's `Dialog.Viewport`, which is an outside
|
|
104
|
+
* press, exactly as the scrim was.
|
|
105
|
+
*
|
|
106
|
+
* The parts read the form from context rather than from CSS ancestry, so a
|
|
107
|
+
* sheet opened inside a card (or a card inside a sheet) gets its own padding.
|
|
108
|
+
* Outside a `DrawerContent` the context is the sheet's, which is what the parts
|
|
109
|
+
* rendered before #399.
|
|
110
|
+
*
|
|
111
|
+
* The overlay follows the resolved form (#402). A card draws no overlay by
|
|
112
|
+
* default, as the Figma frames draw it and as Michal decided on #402: no backdrop
|
|
113
|
+
* is rendered at all, so the page is neither dimmed nor blurred. The edge sheet
|
|
114
|
+
* and every `bottom` drawer keep the Style Guide scrim (#368), and so do popups
|
|
115
|
+
* (`Dialog`). An explicit `overlay` wins either way: `overlay="scrim"` dims behind
|
|
116
|
+
* a card, `overlay="none"` drops it behind a sheet.
|
|
117
|
+
*
|
|
118
|
+
* Nothing else about the modal changes without the backdrop. An outside press
|
|
119
|
+
* still closes, because the press lands on the viewport; focus is still trapped;
|
|
120
|
+
* `aria-modal` is still set; the page still does not scroll behind it; and a
|
|
121
|
+
* `Dialog` opened over the card still brings its own scrim (see Stacking, below).
|
|
122
|
+
* Each is asserted on the default card in the e2e specs.
|
|
75
123
|
*
|
|
76
124
|
* ## Ground: opaque on every surface
|
|
77
125
|
*
|
|
@@ -142,6 +190,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
142
190
|
*/
|
|
143
191
|
declare const drawerViewportVariants: (props?: ({
|
|
144
192
|
side?: "bottom" | "left" | "right" | null | undefined;
|
|
193
|
+
form?: "card" | "sheet" | null | undefined;
|
|
145
194
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
146
195
|
/**
|
|
147
196
|
* The sheet itself.
|
|
@@ -153,7 +202,12 @@ declare const drawerViewportVariants: (props?: ({
|
|
|
153
202
|
declare const drawerPopupVariants: (props?: ({
|
|
154
203
|
side?: "bottom" | "left" | "right" | null | undefined;
|
|
155
204
|
size?: "lg" | "xl" | "md" | null | undefined;
|
|
205
|
+
form?: "card" | "sheet" | null | undefined;
|
|
156
206
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
207
|
+
/** The side drawer's two forms (#399). `bottom` is always a sheet. */
|
|
208
|
+
export type DrawerForm = "card" | "sheet";
|
|
209
|
+
/** Whether the drawer dims the page behind it (#399). */
|
|
210
|
+
export type DrawerOverlayMode = "scrim" | "none";
|
|
157
211
|
declare function Drawer({ modal, ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
|
|
158
212
|
declare function DrawerTrigger({ ...props }: DialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
159
213
|
declare function DrawerPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
|
|
@@ -168,11 +222,22 @@ declare function DrawerClose({ ...props }: DialogPrimitive.Close.Props): React.J
|
|
|
168
222
|
* tokens are declared at `:root` only and do not flip: a scrim composites over
|
|
169
223
|
* whatever is behind it, so it has no surface of its own.
|
|
170
224
|
*
|
|
225
|
+
* `DrawerContent` renders it behind a sheet and a `bottom` drawer by default, and
|
|
226
|
+
* behind a card only on `overlay="scrim"` (#402).
|
|
227
|
+
*
|
|
171
228
|
* `forceRender` because Base UI does not render a nested dialog's backdrop by
|
|
172
229
|
* default. See the stacking note in the component docblock.
|
|
173
230
|
*/
|
|
174
231
|
declare function DrawerOverlay({ className, forceRender, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
175
|
-
declare function DrawerContent({ side, size, container, className, children, ...props }: DialogPrimitive.Popup.Props & VariantProps<typeof drawerPopupVariants> & Pick<DialogPrimitive.Portal.Props, "container">
|
|
232
|
+
declare function DrawerContent({ side, size, form, overlay: overlayProp, container, className, children, ...props }: DialogPrimitive.Popup.Props & Omit<VariantProps<typeof drawerPopupVariants>, "form"> & Pick<DialogPrimitive.Portal.Props, "container"> & {
|
|
233
|
+
/** `card` floats inset 12 (#399, the default); `sheet` is the edge sheet. Ignored on `bottom`. */
|
|
234
|
+
form?: DrawerForm;
|
|
235
|
+
/**
|
|
236
|
+
* `scrim` dims and blurs the page (#368); `none` leaves it as it is. Left out,
|
|
237
|
+
* it follows the form (#402): `none` on a card, `scrim` on a sheet and on `bottom`.
|
|
238
|
+
*/
|
|
239
|
+
overlay?: DrawerOverlayMode;
|
|
240
|
+
}): React.JSX.Element;
|
|
176
241
|
/**
|
|
177
242
|
* The title row, with the close affordance built in.
|
|
178
243
|
*
|
|
@@ -201,7 +266,11 @@ declare function DrawerHeader({ title, description, closeLabel, showCloseButton,
|
|
|
201
266
|
showCloseButton?: boolean;
|
|
202
267
|
/** Controls in the title row, before the close button. */
|
|
203
268
|
actions?: React.ReactNode;
|
|
204
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* The title's face; see `DrawerTitle`. Left out, it follows the form: the UI
|
|
271
|
+
* face on a card, the display face on a sheet. "body" for the App page's
|
|
272
|
+
* sentence-case title.
|
|
273
|
+
*/
|
|
205
274
|
titleFace?: DrawerTitleFace;
|
|
206
275
|
}): React.JSX.Element;
|
|
207
276
|
/**
|
|
@@ -225,15 +294,18 @@ declare function DrawerBody({ className, ...props }: React.ComponentProps<"div">
|
|
|
225
294
|
*/
|
|
226
295
|
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
227
296
|
/**
|
|
228
|
-
* The title's face. `heading`
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* changes; size, leading and weight are the
|
|
297
|
+
* The title's face. `heading` is `font-heading`, the display face, Tanker, which
|
|
298
|
+
* is capitals by design. `body` is the brand's running-text face (`font-body`,
|
|
299
|
+
* Space Grotesk) in whatever case the words are written, which is what the App
|
|
300
|
+
* page v2 frames draw ("Creation Details", "Most used by", "Views over time";
|
|
301
|
+
* founder ruling 2026-10-19). `ui` is Manrope, the 2026 `DialogTitle`'s face
|
|
302
|
+
* (#372). Only the face changes; size, leading and weight are the form's.
|
|
303
|
+
*
|
|
304
|
+
* Left out, it follows the form: `ui` on a card, so a side card's title is the
|
|
305
|
+
* popup's H4 (Manrope Medium 22/1.2, ink); `heading` on a sheet, unchanged.
|
|
234
306
|
*/
|
|
235
|
-
export type DrawerTitleFace = "heading" | "body";
|
|
236
|
-
declare function DrawerTitle({ face, className, ...props }: DialogPrimitive.Title.Props & {
|
|
307
|
+
export type DrawerTitleFace = "heading" | "body" | "ui";
|
|
308
|
+
declare function DrawerTitle({ face: faceProp, className, ...props }: DialogPrimitive.Title.Props & {
|
|
237
309
|
face?: DrawerTitleFace;
|
|
238
310
|
}): React.JSX.Element;
|
|
239
311
|
declare function DrawerDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
|
package/dist/ui/drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/ui/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/ui/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,WAAW,CAAC,KAAK,qBAQnC;AAED,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,sBAAsB,GACvB,CAAA"}
|
package/dist/ui/drawer.js
CHANGED
|
@@ -76,7 +76,55 @@ import { CloseIcon } from "../blocks/icons.js";
|
|
|
76
76
|
*
|
|
77
77
|
* The popup is `w-full` under a `max-w-*` rung, so below 448px it simply fills
|
|
78
78
|
* the screen. No breakpoint prop, no phone variant, nothing for a caller to
|
|
79
|
-
* remember. #214 asks for exactly this.
|
|
79
|
+
* remember. #214 asks for exactly this. Since #399 "the screen" is the inset
|
|
80
|
+
* box: a card at 375 is 351 wide, 12 in from both sides, never wider than the
|
|
81
|
+
* window. The same 12 as the desktop inset, not a smaller phone one, so there is
|
|
82
|
+
* one number to remember and the card still reads as a card.
|
|
83
|
+
*
|
|
84
|
+
* ## The card (#399)
|
|
85
|
+
*
|
|
86
|
+
* The CloudGrid 2026 Figma draws every side panel as a floating card, not an
|
|
87
|
+
* edge sheet: "App final / Side panel", 01 Overview 11092:22206, 04 Preview
|
|
88
|
+
* 11092:23488 (the card 11092:23650) and the flow thumbnail 11092:24222. Measured
|
|
89
|
+
* off 11092:23650 in its 1600 x 1100 frame:
|
|
90
|
+
*
|
|
91
|
+
* inset 12 from the top, the bottom and the outer edge viewport p-3
|
|
92
|
+
* corner 12 rounded-md
|
|
93
|
+
* border 1px all round border border-line
|
|
94
|
+
* shadow 0 4px 14px #222222 at 6% shadow-raised
|
|
95
|
+
* (that is --cg-shadow-raised exactly; no new token)
|
|
96
|
+
* padding 24 top, 32 right, bottom and left the parts, below
|
|
97
|
+
* title 22/1.2 medium, 24 over the body the 2026 DialogTitle's
|
|
98
|
+
* close X a 20px glyph ending on the 32px content edge ghost `icon`, -mx-1.5
|
|
99
|
+
* actions 16 apart and 16 before the X gap-4
|
|
100
|
+
*
|
|
101
|
+
* So `form="card"` is the default on `right` and `left`. `form="sheet"` keeps
|
|
102
|
+
* the edge sheet this file drew before, class for class, for anything that wants
|
|
103
|
+
* it. `bottom` is always a sheet: a phone sheet is anchored to the edge it slides
|
|
104
|
+
* from, and nothing in the frames floats it.
|
|
105
|
+
*
|
|
106
|
+
* The inset is the viewport's padding, not the popup's margin, so `h-full` and
|
|
107
|
+
* `w-full` keep meaning "the box the card may use" at every rung. A press on that
|
|
108
|
+
* 12px gutter is a press on Base UI's `Dialog.Viewport`, which is an outside
|
|
109
|
+
* press, exactly as the scrim was.
|
|
110
|
+
*
|
|
111
|
+
* The parts read the form from context rather than from CSS ancestry, so a
|
|
112
|
+
* sheet opened inside a card (or a card inside a sheet) gets its own padding.
|
|
113
|
+
* Outside a `DrawerContent` the context is the sheet's, which is what the parts
|
|
114
|
+
* rendered before #399.
|
|
115
|
+
*
|
|
116
|
+
* The overlay follows the resolved form (#402). A card draws no overlay by
|
|
117
|
+
* default, as the Figma frames draw it and as Michal decided on #402: no backdrop
|
|
118
|
+
* is rendered at all, so the page is neither dimmed nor blurred. The edge sheet
|
|
119
|
+
* and every `bottom` drawer keep the Style Guide scrim (#368), and so do popups
|
|
120
|
+
* (`Dialog`). An explicit `overlay` wins either way: `overlay="scrim"` dims behind
|
|
121
|
+
* a card, `overlay="none"` drops it behind a sheet.
|
|
122
|
+
*
|
|
123
|
+
* Nothing else about the modal changes without the backdrop. An outside press
|
|
124
|
+
* still closes, because the press lands on the viewport; focus is still trapped;
|
|
125
|
+
* `aria-modal` is still set; the page still does not scroll behind it; and a
|
|
126
|
+
* `Dialog` opened over the card still brings its own scrim (see Stacking, below).
|
|
127
|
+
* Each is asserted on the default card in the e2e specs.
|
|
80
128
|
*
|
|
81
129
|
* ## Ground: opaque on every surface
|
|
82
130
|
*
|
|
@@ -152,9 +200,19 @@ const drawerViewportVariants = cva("fixed inset-0 z-50 flex", {
|
|
|
152
200
|
left: "justify-start",
|
|
153
201
|
bottom: "flex-col justify-end",
|
|
154
202
|
},
|
|
203
|
+
form: {
|
|
204
|
+
card: "",
|
|
205
|
+
sheet: "",
|
|
206
|
+
},
|
|
155
207
|
},
|
|
208
|
+
compoundVariants: [
|
|
209
|
+
// The card's 12px inset (#399): the box the card may fill, on the two
|
|
210
|
+
// sides that float. A bottom sheet stays on its edge.
|
|
211
|
+
{ side: ["right", "left"], form: "card", class: "p-3" },
|
|
212
|
+
],
|
|
156
213
|
defaultVariants: {
|
|
157
214
|
side: "right",
|
|
215
|
+
form: "card",
|
|
158
216
|
},
|
|
159
217
|
});
|
|
160
218
|
/**
|
|
@@ -172,8 +230,8 @@ const drawerPopupVariants = cva([
|
|
|
172
230
|
], {
|
|
173
231
|
variants: {
|
|
174
232
|
side: {
|
|
175
|
-
right: "h-full
|
|
176
|
-
left: "h-full
|
|
233
|
+
right: "h-full data-open:slide-in-from-right data-closed:slide-out-to-right",
|
|
234
|
+
left: "h-full data-open:slide-in-from-left data-closed:slide-out-to-left",
|
|
177
235
|
// 85svh, not 85vh: on a phone `vh` is measured against the largest
|
|
178
236
|
// viewport, so the sheet sits partly under the browser chrome while the
|
|
179
237
|
// URL bar is showing. `PlugSheet` has the same 85% and the older unit.
|
|
@@ -184,8 +242,18 @@ const drawerPopupVariants = cva([
|
|
|
184
242
|
lg: "max-w-lg",
|
|
185
243
|
xl: "max-w-6xl",
|
|
186
244
|
},
|
|
245
|
+
form: {
|
|
246
|
+
card: "",
|
|
247
|
+
sheet: "",
|
|
248
|
+
},
|
|
187
249
|
},
|
|
188
250
|
compoundVariants: [
|
|
251
|
+
// The card (#399): radius 12 and a 1px line on every edge, inside the
|
|
252
|
+
// viewport's 12px inset. `shadow-raised` is in the base already.
|
|
253
|
+
{ side: ["right", "left"], form: "card", class: "rounded-md border border-line" },
|
|
254
|
+
// The edge sheet, as it was: one rule on the edge that faces the page.
|
|
255
|
+
{ side: "right", form: "sheet", class: "border-l border-line" },
|
|
256
|
+
{ side: "left", form: "sheet", class: "border-r border-line" },
|
|
189
257
|
// A bottom sheet is full width. The rungs are the inline axis, and on this
|
|
190
258
|
// edge the inline axis is the whole screen.
|
|
191
259
|
{ side: "bottom", size: "md", class: "max-w-none" },
|
|
@@ -195,8 +263,47 @@ const drawerPopupVariants = cva([
|
|
|
195
263
|
defaultVariants: {
|
|
196
264
|
side: "right",
|
|
197
265
|
size: "md",
|
|
266
|
+
form: "card",
|
|
198
267
|
},
|
|
199
268
|
});
|
|
269
|
+
/**
|
|
270
|
+
* The parts' classes per form.
|
|
271
|
+
*
|
|
272
|
+
* `sheet` is what every part drew before #399, unchanged. `card` is the frame's
|
|
273
|
+
* 24 / 32 / 32 / 32: the header carries the 24 on top and the 24 down to the
|
|
274
|
+
* body, every part the 32 at the sides, and whichever part is last the 32 at
|
|
275
|
+
* the bottom (`last:pb-8` on the body, `pb-8` on a footer). The title row
|
|
276
|
+
* centres the title, the actions and the X on one line; the X is a 32px target
|
|
277
|
+
* pulled back 6px on each side so its 20px glyph ends on the content edge and
|
|
278
|
+
* sits 16 from the last action, as the frame draws it.
|
|
279
|
+
*/
|
|
280
|
+
const DRAWER_PARTS = {
|
|
281
|
+
card: {
|
|
282
|
+
header: "flex shrink-0 flex-col gap-2 px-8 pt-6 pb-6",
|
|
283
|
+
row: "flex items-center justify-between gap-4",
|
|
284
|
+
actions: "-my-1 ms-auto flex flex-wrap items-center justify-end gap-4",
|
|
285
|
+
close: "-mx-1.5 -my-1.5 text-ink",
|
|
286
|
+
glyph: "size-5",
|
|
287
|
+
title: "m-0 text-heading-lg font-medium text-ink",
|
|
288
|
+
body: "min-h-0 flex-1 overflow-y-auto px-8 pb-6 last:pb-8",
|
|
289
|
+
footer: "flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-hairline px-8 pt-4 pb-8",
|
|
290
|
+
},
|
|
291
|
+
sheet: {
|
|
292
|
+
header: "flex shrink-0 flex-col gap-2 px-6 pt-5 pb-4",
|
|
293
|
+
row: "flex items-start justify-between gap-3",
|
|
294
|
+
actions: "-mt-1 ms-auto flex flex-wrap items-center justify-end gap-3",
|
|
295
|
+
close: "-mt-1 -mr-1.5",
|
|
296
|
+
glyph: "",
|
|
297
|
+
title: "text-body-lg leading-none font-medium",
|
|
298
|
+
body: "min-h-0 flex-1 overflow-y-auto px-6 pb-5",
|
|
299
|
+
footer: "flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-hairline px-6 py-4",
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* The form the parts are inside. The sheet's outside a `DrawerContent`, so a
|
|
304
|
+
* part rendered on its own draws what it drew before #399.
|
|
305
|
+
*/
|
|
306
|
+
const DrawerFormContext = React.createContext("sheet");
|
|
200
307
|
/**
|
|
201
308
|
* The root's `modal`, handed to the popup so it can say `aria-modal` (#247).
|
|
202
309
|
* Same reason as `Dialog`'s: Base UI marks everything outside a modal drawer
|
|
@@ -226,15 +333,20 @@ function DrawerClose({ ...props }) {
|
|
|
226
333
|
* tokens are declared at `:root` only and do not flip: a scrim composites over
|
|
227
334
|
* whatever is behind it, so it has no surface of its own.
|
|
228
335
|
*
|
|
336
|
+
* `DrawerContent` renders it behind a sheet and a `bottom` drawer by default, and
|
|
337
|
+
* behind a card only on `overlay="scrim"` (#402).
|
|
338
|
+
*
|
|
229
339
|
* `forceRender` because Base UI does not render a nested dialog's backdrop by
|
|
230
340
|
* default. See the stacking note in the component docblock.
|
|
231
341
|
*/
|
|
232
342
|
function DrawerOverlay({ className, forceRender = true, ...props }) {
|
|
233
343
|
return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "drawer-overlay", forceRender: forceRender, className: cn("fixed inset-0 isolate z-50 scrim-overlay duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
234
344
|
}
|
|
235
|
-
function DrawerContent({ side = "right", size = "md", container, className, children, ...props }) {
|
|
345
|
+
function DrawerContent({ side = "right", size = "md", form = "card", overlay: overlayProp, container, className, children, ...props }) {
|
|
236
346
|
const modal = React.useContext(DrawerModalContext);
|
|
237
|
-
|
|
347
|
+
const resolved = side === "bottom" ? "sheet" : form;
|
|
348
|
+
const overlay = overlayProp ?? (resolved === "card" ? "none" : "scrim");
|
|
349
|
+
return (_jsxs(DrawerPortal, { container: container, children: [overlay === "scrim" ? _jsx(DrawerOverlay, {}) : null, _jsx(DialogPrimitive.Viewport, { className: drawerViewportVariants({ side, form: resolved }), children: _jsx(DialogPrimitive.Popup, { "data-slot": "drawer-content", "aria-modal": modal !== false ? true : undefined, "data-side": side, "data-size": size, "data-form": resolved, "data-overlay": overlay, className: cn(drawerPopupVariants({ side, size, form: resolved }), className), ...props, children: _jsx(DrawerFormContext.Provider, { value: resolved, children: children }) }) })] }));
|
|
238
350
|
}
|
|
239
351
|
/**
|
|
240
352
|
* The title row, with the close affordance built in.
|
|
@@ -256,12 +368,13 @@ function DrawerContent({ side = "right", size = "md", container, className, chil
|
|
|
256
368
|
* when the sheet is narrower than its contents. Leave it out and the header
|
|
257
369
|
* renders exactly what it did before.
|
|
258
370
|
*/
|
|
259
|
-
function DrawerHeader({ title, description, closeLabel = "Close", showCloseButton = true, actions, titleFace
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
371
|
+
function DrawerHeader({ title, description, closeLabel = "Close", showCloseButton = true, actions, titleFace, className, children, ...props }) {
|
|
372
|
+
const form = React.useContext(DrawerFormContext);
|
|
373
|
+
const p = DRAWER_PARTS[form];
|
|
374
|
+
return (_jsxs("div", { "data-slot": "drawer-header", className: cn(p.header, className), ...props, children: [_jsxs("div", { className: p.row, children: [_jsx(DrawerTitle, { face: titleFace, children: title }), actions ? (
|
|
375
|
+
// ms-auto keeps the row against the close glyph when it wraps; the
|
|
376
|
+
// negative block margin lets the controls share the title's line.
|
|
377
|
+
_jsx("div", { "data-slot": "drawer-actions", className: p.actions, children: actions })) : null, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "drawer-close", render: _jsx(Button, { variant: "ghost", size: form === "card" ? "icon" : "icon-sm", className: p.close }), children: [_jsx(CloseIcon, { className: p.glyph || undefined }), _jsx("span", { className: "sr-only", children: closeLabel })] }))] }), description ? _jsx(DrawerDescription, { children: description }) : null, children] }));
|
|
265
378
|
}
|
|
266
379
|
/**
|
|
267
380
|
* The scrolling half.
|
|
@@ -273,7 +386,8 @@ function DrawerHeader({ title, description, closeLabel = "Close", showCloseButto
|
|
|
273
386
|
* do.
|
|
274
387
|
*/
|
|
275
388
|
function DrawerBody({ className, ...props }) {
|
|
276
|
-
|
|
389
|
+
const form = React.useContext(DrawerFormContext);
|
|
390
|
+
return (_jsx("div", { "data-slot": "drawer-body", className: cn(DRAWER_PARTS[form].body, className), ...props }));
|
|
277
391
|
}
|
|
278
392
|
/**
|
|
279
393
|
* The pinned half.
|
|
@@ -285,12 +399,18 @@ function DrawerBody({ className, ...props }) {
|
|
|
285
399
|
* text reads as part of the text.
|
|
286
400
|
*/
|
|
287
401
|
function DrawerFooter({ className, ...props }) {
|
|
288
|
-
|
|
402
|
+
const form = React.useContext(DrawerFormContext);
|
|
403
|
+
return (_jsx("div", { "data-slot": "drawer-footer", className: cn(DRAWER_PARTS[form].footer, className), ...props }));
|
|
289
404
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
405
|
+
const TITLE_FACE = {
|
|
406
|
+
heading: "font-heading",
|
|
407
|
+
body: "font-body",
|
|
408
|
+
ui: "font-ui",
|
|
409
|
+
};
|
|
410
|
+
function DrawerTitle({ face: faceProp, className, ...props }) {
|
|
411
|
+
const form = React.useContext(DrawerFormContext);
|
|
412
|
+
const face = faceProp ?? (form === "card" ? "ui" : "heading");
|
|
413
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "drawer-title", "data-face": face === "heading" ? undefined : face, className: cn(TITLE_FACE[face], DRAWER_PARTS[form].title, className), ...props }));
|
|
294
414
|
}
|
|
295
415
|
function DrawerDescription({ className, ...props }) {
|
|
296
416
|
return (_jsx(DialogPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-caption text-body", className), ...props }));
|
package/dist/ui/drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/ui/drawer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C
|
|
1
|
+
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/ui/drawer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkLG;AAEH;;;;;;;GAOG;AACH,MA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"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAI7C,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAYvE;AAED,QAAA,MAAM,uBAAuB;;8EAmB5B,CAAA;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,qBAiB5E;AAED,QAAA,MAAM,wBAAwB;;8EAgB7B,CAAA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,IAAe,EACf,OAAiB,EACjB,IAAW,EACX,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,GAC3D,YAAY,CAAC,OAAO,wBAAwB,CAAC,GAAG;IAC9C,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;CACrC,qBAUF;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAU5E;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,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) {
|
|
|
52
52
|
return (_jsx("span", { className: cn("flex items-center gap-2 text-body-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
53
53
|
}
|
|
54
54
|
function InputGroupInput({ className, ...props }) {
|
|
55
|
-
return (_jsx(Input, { "data-slot": "input-group-control", className: cn(
|
|
55
|
+
return (_jsx(Input, { "data-slot": "input-group-control", className: cn(
|
|
56
|
+
// The group draws the box, so the control fills it and keeps the
|
|
57
|
+
// compact inset and placeholder it had before Input took the 2026
|
|
58
|
+
// field metrics (#384). Without `h-full` a 40px input hangs out of a
|
|
59
|
+
// 32px group (the Shelf search, the combobox).
|
|
60
|
+
"h-full flex-1 rounded-none border-0 bg-transparent px-2.5 py-1 shadow-none ring-0 placeholder:text-muted-foreground focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), ...props }));
|
|
56
61
|
}
|
|
57
62
|
function InputGroupTextarea({ className, ...props }) {
|
|
58
|
-
return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), ...props }));
|
|
63
|
+
return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn("min-h-16 flex-1 resize-none rounded-none border-0 bg-transparent px-2.5 py-2 shadow-none ring-0 placeholder:text-muted-foreground focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), ...props }));
|
|
59
64
|
}
|
|
60
65
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
61
66
|
//# sourceMappingURL=input-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.js","sourceRoot":"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":"AAAA,Y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O,CAAC,EAAE,KAAK,EAAE,CAAA;QAChE,CAAC,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,wBAAwB,GAAG,GAAG,CAClC,kDAAkD,EAClD;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,2FAA2F;YAC/F,EAAE,EAAE,EAAE;YACN,SAAS,EACP,6DAA6D;YAC/D,SAAS,EAAE,2BAA2B;SACvC;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,IAAI;KACX;CACF,CACF,CAAA;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,OAAO,EACjB,IAAI,GAAG,IAAI,EACX,GAAG,KAAK,EAIP;IACD,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAE,IAAI,eACC,IAAI,EACf,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CAAC,wBAAwB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KACxD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC;IAC3E,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,6HAA6H,EAC7H,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACL,KAAC,KAAK,iBACM,qBAAqB,EAC/B,SAAS,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"input-group.js","sourceRoot":"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACv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AA"}
|
package/dist/ui/input.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Input({ className, type, ...props }: React.ComponentProps<"input">
|
|
2
|
+
declare function Input({ className, type, leading, trailing, ...props }: React.ComponentProps<"input"> & {
|
|
3
|
+
/** A decorative mark before the text, 19px in (the search mark). */
|
|
4
|
+
leading?: React.ReactNode;
|
|
5
|
+
/** A mark or control after the text, 19px in (the show-secret Eye). */
|
|
6
|
+
trailing?: React.ReactNode;
|
|
7
|
+
}): React.JSX.Element;
|
|
3
8
|
export { Input };
|
|
4
9
|
//# sourceMappingURL=input.d.ts.map
|
package/dist/ui/input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgE9B,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;IACjC,oEAAoE;IACpE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,qBA2BA;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|