@conscia-labs/design-system 1.0.2 → 1.0.3
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/README.md +35 -1
- package/dist/{chunk-YAJUTCGD.js → chunk-HAJMOT3P.js} +22 -12
- package/dist/chunk-HAJMOT3P.js.map +1 -0
- package/dist/{chunk-WEI3PU4A.js → chunk-LPUWW7XF.js} +2 -2
- package/dist/{chunk-H5ORBU5O.js → chunk-QP3SEL2Z.js} +12 -8
- package/dist/chunk-QP3SEL2Z.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/patterns/index.js +2 -2
- package/dist/primitives/index.d.ts +10 -3
- package/dist/primitives/index.js +2 -2
- package/dist/standalone.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-H5ORBU5O.js.map +0 -1
- package/dist/chunk-YAJUTCGD.js.map +0 -1
- /package/dist/{chunk-WEI3PU4A.js.map → chunk-LPUWW7XF.js.map} +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The shared React component library for building clear, consistent, and accessibl
|
|
|
6
6
|
|
|
7
7
|
> **Package:** available publicly as [`@conscia-labs/design-system`](https://www.npmjs.com/package/@conscia-labs/design-system).
|
|
8
8
|
>
|
|
9
|
-
> **
|
|
9
|
+
> **Current release:** `1.0.3` is the latest stable v1 release.
|
|
10
10
|
>
|
|
11
11
|
> **Migration:** upgrading an application to v1? Follow the [Design System v1 Migration Guide](https://github.com/conscia-labs/design-system/blob/main/docs/design-system-v1-migration.md).
|
|
12
12
|
|
|
@@ -694,6 +694,40 @@ Use `SearchableSelect` when users need to find an item in a longer list by label
|
|
|
694
694
|
Both `FormSelect` and `SearchableSelect` contribute a named value to a native
|
|
695
695
|
HTML form when their `name` prop is provided.
|
|
696
696
|
|
|
697
|
+
### Nested overlays
|
|
698
|
+
|
|
699
|
+
Portaled controls can be used inside `Dialog` and `Sheet` without clipping
|
|
700
|
+
their popup. The popup Positioner is mounted in a Base UI portal and uses the
|
|
701
|
+
shared overlay layer hierarchy:
|
|
702
|
+
|
|
703
|
+
| Layer | Components | z-index |
|
|
704
|
+
| --- | --- | ---: |
|
|
705
|
+
| Modal | `Dialog`, `Sheet`, `AlertDialog` | 40 |
|
|
706
|
+
| Popup | `Select`, `Popover`, `SearchableSelect`, `DropdownMenu` | 50 |
|
|
707
|
+
| Transient | `Toast`, `Tooltip` | 100 |
|
|
708
|
+
|
|
709
|
+
Base UI `Select` is modal by default, so `FormSelect` preserves that default
|
|
710
|
+
for backwards compatibility. Set `modal={false}` when a `Select` or
|
|
711
|
+
`FormSelect` is nested in a modal surface so it does not add a second backdrop,
|
|
712
|
+
focus boundary, or inert page state. `SearchableSelect` also exposes `modal`
|
|
713
|
+
and preserves Combobox's current non-modal default:
|
|
714
|
+
|
|
715
|
+
```tsx
|
|
716
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
717
|
+
<DialogContent>
|
|
718
|
+
<DialogBody className="overflow-y-auto">
|
|
719
|
+
<FormSelect modal={false} name="vendor" options={vendorOptions} />
|
|
720
|
+
<SearchableSelect modal={false} name="model" options={modelOptions} onValueChange={setModel} />
|
|
721
|
+
</DialogBody>
|
|
722
|
+
</DialogContent>
|
|
723
|
+
</Dialog>
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
`Select`, `Popover`, and `DropdownMenu` already forward their Base UI root
|
|
727
|
+
props, including `modal`. Use the same `modal={false}` setting for those
|
|
728
|
+
controls when they are nested. No consuming-app z-index override or portal
|
|
729
|
+
adapter is required.
|
|
730
|
+
|
|
697
731
|
## Semantic color
|
|
698
732
|
|
|
699
733
|
Color communicates meaning rather than palette choice:
|
|
@@ -13030,6 +13030,15 @@ var SelectSeparator = ListboxSeparator;
|
|
|
13030
13030
|
|
|
13031
13031
|
// src/primitives/select.tsx
|
|
13032
13032
|
import { CheckIcon as CheckIcon2, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
13033
|
+
|
|
13034
|
+
// src/primitives/overlay-layers.ts
|
|
13035
|
+
var overlayLayers = {
|
|
13036
|
+
modal: "z-40",
|
|
13037
|
+
popup: "z-50",
|
|
13038
|
+
transient: "z-[100]"
|
|
13039
|
+
};
|
|
13040
|
+
|
|
13041
|
+
// src/primitives/select.tsx
|
|
13033
13042
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
13034
13043
|
function collectItems(children) {
|
|
13035
13044
|
const items = [];
|
|
@@ -13058,7 +13067,7 @@ function SelectTrigger3({ className, size: size4 = "default", children, ...props
|
|
|
13058
13067
|
] });
|
|
13059
13068
|
}
|
|
13060
13069
|
function SelectContent({ className, children, ...props }) {
|
|
13061
|
-
return /* @__PURE__ */ jsx4(index_parts_exports2.Portal, { children: /* @__PURE__ */ jsx4(index_parts_exports2.Positioner, { children: /* @__PURE__ */ jsx4(index_parts_exports2.Popup, { "data-slot": "select-content", className: cn("bg-surface-floating text-text-primary relative
|
|
13070
|
+
return /* @__PURE__ */ jsx4(index_parts_exports2.Portal, { children: /* @__PURE__ */ jsx4(index_parts_exports2.Positioner, { "data-slot": "select-positioner", className: overlayLayers.popup, children: /* @__PURE__ */ jsx4(index_parts_exports2.Popup, { "data-slot": "select-content", className: cn("bg-surface-floating text-text-primary relative max-h-[var(--available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none data-open:animate-in data-closed:animate-out", className), ...props, children }) }) });
|
|
13062
13071
|
}
|
|
13063
13072
|
function SelectItem3({ className, children, ...props }) {
|
|
13064
13073
|
return /* @__PURE__ */ jsxs(index_parts_exports2.Item, { "data-slot": "select-item", className: cn("ds-type-menu-item data-highlighted:bg-surface-muted relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-50", className), ...props, children: [
|
|
@@ -13794,12 +13803,12 @@ function DialogPortal3({ ...props }) {
|
|
|
13794
13803
|
return /* @__PURE__ */ jsx5(index_parts_exports3.Portal, { "data-slot": "dialog-portal", ...props });
|
|
13795
13804
|
}
|
|
13796
13805
|
function DialogOverlay({ className, ...props }) {
|
|
13797
|
-
return /* @__PURE__ */ jsx5(index_parts_exports3.Backdrop, { "data-slot": "dialog-overlay", className: cn("fixed inset-0
|
|
13806
|
+
return /* @__PURE__ */ jsx5(index_parts_exports3.Backdrop, { "data-slot": "dialog-overlay", className: cn("fixed inset-0", overlayLayers.modal, "bg-black/50 data-open:animate-in data-closed:animate-out", className), ...props });
|
|
13798
13807
|
}
|
|
13799
13808
|
function DialogContent({ className, children, showCloseButton = true, size: size4 = "default", closeLabel = "Close", ...props }) {
|
|
13800
13809
|
return /* @__PURE__ */ jsxs2(DialogPortal3, { children: [
|
|
13801
13810
|
/* @__PURE__ */ jsx5(DialogOverlay, {}),
|
|
13802
|
-
/* @__PURE__ */ jsx5(index_parts_exports3.Viewport, { className: "fixed inset-0
|
|
13811
|
+
/* @__PURE__ */ jsx5(index_parts_exports3.Viewport, { className: cn("fixed inset-0 flex items-center justify-center p-4", overlayLayers.modal), children: /* @__PURE__ */ jsxs2(index_parts_exports3.Popup, { "data-slot": "dialog-content", "data-size": size4, className: cn("relative grid max-h-[min(42rem,calc(100vh-2rem))] w-full max-w-[calc(100%-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-5 overflow-hidden rounded-lg border bg-canvas p-5 text-text-primary shadow-lg outline-none sm:p-6", "data-[size=small]:max-w-sm data-[size=default]:max-w-lg data-[size=large]:max-w-3xl", className), ...props, children: [
|
|
13803
13812
|
children,
|
|
13804
13813
|
showCloseButton ? /* @__PURE__ */ jsxs2(index_parts_exports3.Close, { "data-slot": "dialog-close", className: "absolute right-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus focus:ring-offset-2 focus:ring-offset-canvas disabled:pointer-events-none [&_svg]:size-4", children: [
|
|
13805
13814
|
/* @__PURE__ */ jsx5(XIcon, {}),
|
|
@@ -17534,14 +17543,14 @@ function SheetClose({ ...props }) {
|
|
|
17534
17543
|
}
|
|
17535
17544
|
var sideClasses = { top: "inset-x-0 top-0 max-h-[90vh] border-b", right: "right-0 top-0 h-full max-w-md border-l sm:max-w-lg", bottom: "inset-x-0 bottom-0 max-h-[90vh] border-t", left: "left-0 top-0 h-full max-w-md border-r sm:max-w-lg" };
|
|
17536
17545
|
function SheetOverlay({ className, ...props }) {
|
|
17537
|
-
return /* @__PURE__ */ jsx9(index_parts_exports4.Backdrop, { "data-slot": "sheet-overlay", className: cn("fixed inset-0
|
|
17546
|
+
return /* @__PURE__ */ jsx9(index_parts_exports4.Backdrop, { "data-slot": "sheet-overlay", className: cn("fixed inset-0", overlayLayers.modal, "bg-black/50 data-open:animate-in data-closed:animate-out", className), ...props });
|
|
17538
17547
|
}
|
|
17539
17548
|
function SheetContent({ className, children, side: sideProp, closeLabel = "Close", ...props }) {
|
|
17540
17549
|
const contextSide = React116.useContext(SheetSideContext);
|
|
17541
17550
|
const side = sideProp ?? contextSide;
|
|
17542
17551
|
return /* @__PURE__ */ jsxs3(SheetPortal, { children: [
|
|
17543
17552
|
/* @__PURE__ */ jsx9(SheetOverlay, {}),
|
|
17544
|
-
/* @__PURE__ */ jsx9(index_parts_exports4.Viewport, { className: "fixed inset-0
|
|
17553
|
+
/* @__PURE__ */ jsx9(index_parts_exports4.Viewport, { className: cn("fixed inset-0 pointer-events-none", overlayLayers.modal), children: /* @__PURE__ */ jsxs3(index_parts_exports4.Popup, { "data-slot": "sheet-content", className: cn("pointer-events-auto absolute flex w-full flex-col gap-6 bg-canvas p-6 text-text-primary shadow-lg outline-none data-open:animate-in data-closed:animate-out", sideClasses[side], className), ...props, children: [
|
|
17545
17554
|
children,
|
|
17546
17555
|
/* @__PURE__ */ jsxs3(index_parts_exports4.Close, { "data-slot": "sheet-close", className: "absolute right-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus focus:ring-offset-2 focus:ring-offset-canvas [&_svg]:size-4", children: [
|
|
17547
17556
|
/* @__PURE__ */ jsx9(XIcon2, {}),
|
|
@@ -18784,9 +18793,9 @@ function TooltipTrigger3({ ...props }) {
|
|
|
18784
18793
|
return /* @__PURE__ */ jsx10(index_parts_exports5.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
18785
18794
|
}
|
|
18786
18795
|
function TooltipContent({ className, sideOffset = 6, side, align, children, ...props }) {
|
|
18787
|
-
return /* @__PURE__ */ jsx10(index_parts_exports5.Portal, { children: /* @__PURE__ */ jsx10(index_parts_exports5.Positioner, { sideOffset, side, align, children: /* @__PURE__ */ jsxs4(index_parts_exports5.Popup, { role: "tooltip", "data-slot": "tooltip-content", className: cn("
|
|
18796
|
+
return /* @__PURE__ */ jsx10(index_parts_exports5.Portal, { children: /* @__PURE__ */ jsx10(index_parts_exports5.Positioner, { className: overlayLayers.transient, sideOffset, side, align, children: /* @__PURE__ */ jsxs4(index_parts_exports5.Popup, { role: "tooltip", "data-slot": "tooltip-content", className: cn("w-fit rounded-md bg-text-primary px-3 py-1.5 text-balance text-xs text-canvas shadow-[var(--ds-shadow-floating)]", className), ...props, children: [
|
|
18788
18797
|
children,
|
|
18789
|
-
/* @__PURE__ */ jsx10(index_parts_exports5.Arrow, { className: "
|
|
18798
|
+
/* @__PURE__ */ jsx10(index_parts_exports5.Arrow, { className: "size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-text-primary fill-text-primary" })
|
|
18790
18799
|
] }) }) });
|
|
18791
18800
|
}
|
|
18792
18801
|
|
|
@@ -18834,12 +18843,12 @@ function AlertDialogPortal({ ...props }) {
|
|
|
18834
18843
|
return /* @__PURE__ */ jsx11(index_parts_exports6.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
18835
18844
|
}
|
|
18836
18845
|
function AlertDialogOverlay({ className, ...props }) {
|
|
18837
|
-
return /* @__PURE__ */ jsx11(index_parts_exports6.Backdrop, { "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0
|
|
18846
|
+
return /* @__PURE__ */ jsx11(index_parts_exports6.Backdrop, { "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0", overlayLayers.modal, "bg-black/50 data-open:animate-in data-closed:animate-out", className), ...props });
|
|
18838
18847
|
}
|
|
18839
18848
|
function AlertDialogContent({ className, children, ...props }) {
|
|
18840
18849
|
return /* @__PURE__ */ jsxs5(AlertDialogPortal, { children: [
|
|
18841
18850
|
/* @__PURE__ */ jsx11(AlertDialogOverlay, {}),
|
|
18842
|
-
/* @__PURE__ */ jsx11(index_parts_exports6.Viewport, { className: "fixed inset-0
|
|
18851
|
+
/* @__PURE__ */ jsx11(index_parts_exports6.Viewport, { className: cn("fixed inset-0 flex items-center justify-center p-4", overlayLayers.modal), children: /* @__PURE__ */ jsxs5(index_parts_exports6.Popup, { "data-slot": "alert-dialog-content", className: cn("relative grid w-full max-w-[calc(100%-2rem)] gap-5 rounded-lg border bg-canvas p-5 text-text-primary shadow-lg outline-none sm:max-w-lg sm:p-6", className), ...props, children: [
|
|
18843
18852
|
children,
|
|
18844
18853
|
/* @__PURE__ */ jsx11(index_parts_exports6.Close, { "aria-label": "Close", className: "absolute right-4 top-4 rounded-xs opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus [&_svg]:size-4", children: /* @__PURE__ */ jsx11(XIcon3, {}) })
|
|
18845
18854
|
] }) })
|
|
@@ -23198,13 +23207,13 @@ function DropdownMenuSubTrigger({ className, children, ...props }) {
|
|
|
23198
23207
|
] });
|
|
23199
23208
|
}
|
|
23200
23209
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
23201
|
-
return /* @__PURE__ */ jsx16(index_parts_exports9.Portal, { children: /* @__PURE__ */ jsx16(index_parts_exports9.Positioner, { children: /* @__PURE__ */ jsx16(index_parts_exports9.Popup, { "data-slot": "dropdown-menu-sub-content", className: cn("
|
|
23210
|
+
return /* @__PURE__ */ jsx16(index_parts_exports9.Portal, { children: /* @__PURE__ */ jsx16(index_parts_exports9.Positioner, { "data-slot": "dropdown-menu-sub-positioner", className: overlayLayers.popup, children: /* @__PURE__ */ jsx16(index_parts_exports9.Popup, { "data-slot": "dropdown-menu-sub-content", className: cn("min-w-56 overflow-hidden rounded-md border bg-surface-floating p-1 text-text-primary shadow-[var(--ds-shadow-floating)]", className), ...props }) }) });
|
|
23202
23211
|
}
|
|
23203
23212
|
function DropdownMenuTrigger({ ...props }) {
|
|
23204
23213
|
return /* @__PURE__ */ jsx16(index_parts_exports9.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
23205
23214
|
}
|
|
23206
23215
|
function DropdownMenuContent({ className, sideOffset = 4, side, align, ...props }) {
|
|
23207
|
-
return /* @__PURE__ */ jsx16(index_parts_exports9.Portal, { children: /* @__PURE__ */ jsx16(index_parts_exports9.Positioner, { sideOffset, side, align, children: /* @__PURE__ */ jsx16(index_parts_exports9.Popup, { "data-slot": "dropdown-menu-content", className: cn("
|
|
23216
|
+
return /* @__PURE__ */ jsx16(index_parts_exports9.Portal, { children: /* @__PURE__ */ jsx16(index_parts_exports9.Positioner, { "data-slot": "dropdown-menu-positioner", className: overlayLayers.popup, sideOffset, side, align, children: /* @__PURE__ */ jsx16(index_parts_exports9.Popup, { "data-slot": "dropdown-menu-content", className: cn("min-w-40 overflow-hidden rounded-md border bg-surface-floating p-1 text-text-primary shadow-[var(--ds-shadow-floating)]", className), ...props }) }) });
|
|
23208
23217
|
}
|
|
23209
23218
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
23210
23219
|
return /* @__PURE__ */ jsx16(index_parts_exports9.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("ds-type-menu-item data-[variant=destructive]:text-danger-foreground data-highlighted:bg-surface-muted relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset=true]:pl-8", className), ...props });
|
|
@@ -26626,6 +26635,7 @@ export {
|
|
|
26626
26635
|
useAnchoredPopupScrollLock,
|
|
26627
26636
|
useToolbarRootContext,
|
|
26628
26637
|
COMPOSITE_KEYS,
|
|
26638
|
+
overlayLayers,
|
|
26629
26639
|
Select,
|
|
26630
26640
|
SelectGroup3 as SelectGroup,
|
|
26631
26641
|
SelectValue3 as SelectValue,
|
|
@@ -26716,4 +26726,4 @@ export {
|
|
|
26716
26726
|
DropdownMenuLabel,
|
|
26717
26727
|
DropdownMenuSeparator
|
|
26718
26728
|
};
|
|
26719
|
-
//# sourceMappingURL=chunk-
|
|
26729
|
+
//# sourceMappingURL=chunk-HAJMOT3P.js.map
|