@puzzle-ui/ui 0.3.0 → 0.5.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/README.md +70 -70
- package/dist/components/actions/button/button.css +5 -2
- package/dist/components/actions/button-group/button-group.css +16 -17
- package/dist/components/data-display/badge/badge.css +15 -2
- package/dist/components/data-display/badge/index.cjs +13 -2
- package/dist/components/data-display/badge/index.cjs.map +1 -1
- package/dist/components/data-display/badge/index.d.cts +7 -2
- package/dist/components/data-display/badge/index.d.ts +7 -2
- package/dist/components/data-display/badge/index.js +13 -2
- package/dist/components/data-display/badge/index.js.map +1 -1
- package/dist/components/data-display/empty-state/empty-state.css +128 -0
- package/dist/components/data-display/empty-state/empty-state.utils.cjs +6 -0
- package/dist/components/data-display/empty-state/empty-state.utils.cjs.map +1 -0
- package/dist/components/data-display/empty-state/empty-state.utils.js +6 -0
- package/dist/components/data-display/empty-state/empty-state.utils.js.map +1 -0
- package/dist/components/data-display/empty-state/index.cjs +49 -0
- package/dist/components/data-display/empty-state/index.cjs.map +1 -0
- package/dist/components/data-display/empty-state/index.d.cts +19 -0
- package/dist/components/data-display/empty-state/index.d.ts +19 -0
- package/dist/components/data-display/empty-state/index.js +44 -0
- package/dist/components/data-display/empty-state/index.js.map +1 -0
- package/dist/components/data-display/rating/index.cjs +84 -0
- package/dist/components/data-display/rating/index.cjs.map +1 -0
- package/dist/components/data-display/rating/index.d.cts +3 -0
- package/dist/components/data-display/rating/index.d.ts +3 -0
- package/dist/components/data-display/rating/index.js +84 -0
- package/dist/components/data-display/rating/index.js.map +1 -0
- package/dist/components/data-display/rating/rating.css +72 -0
- package/dist/components/data-display/rating/rating.types.d.cts +15 -0
- package/dist/components/data-display/rating/rating.types.d.ts +15 -0
- package/dist/components/data-display/rating/rating.utils.cjs +27 -0
- package/dist/components/data-display/rating/rating.utils.cjs.map +1 -0
- package/dist/components/data-display/rating/rating.utils.js +25 -0
- package/dist/components/data-display/rating/rating.utils.js.map +1 -0
- package/dist/components/editors/text-editor/editor.cjs.map +1 -1
- package/dist/components/editors/text-editor/editor.js.map +1 -1
- package/dist/components/editors/text-editor/text-document.cjs.map +1 -1
- package/dist/components/editors/text-editor/text-document.js.map +1 -1
- package/dist/components/editors/text-editor/text-parser.cjs.map +1 -1
- package/dist/components/editors/text-editor/text-parser.js.map +1 -1
- package/dist/components/editors/text-editor/text-renderer.cjs.map +1 -1
- package/dist/components/editors/text-editor/text-renderer.js.map +1 -1
- package/dist/components/forms/autocomplete/index.cjs.map +1 -1
- package/dist/components/forms/autocomplete/index.js.map +1 -1
- package/dist/components/forms/checkbox/checkbox.css +2 -10
- package/dist/components/forms/color-picker/color-picker.css +351 -0
- package/dist/components/forms/color-picker/color-picker.types.d.cts +25 -0
- package/dist/components/forms/color-picker/color-picker.types.d.ts +25 -0
- package/dist/components/forms/color-picker/color-picker.utils.cjs +116 -0
- package/dist/components/forms/color-picker/color-picker.utils.cjs.map +1 -0
- package/dist/components/forms/color-picker/color-picker.utils.js +109 -0
- package/dist/components/forms/color-picker/color-picker.utils.js.map +1 -0
- package/dist/components/forms/color-picker/index.cjs +340 -0
- package/dist/components/forms/color-picker/index.cjs.map +1 -0
- package/dist/components/forms/color-picker/index.d.cts +3 -0
- package/dist/components/forms/color-picker/index.d.ts +3 -0
- package/dist/components/forms/color-picker/index.js +340 -0
- package/dist/components/forms/color-picker/index.js.map +1 -0
- package/dist/components/forms/file-upload/file-upload.utils.cjs.map +1 -1
- package/dist/components/forms/file-upload/file-upload.utils.js.map +1 -1
- package/dist/components/forms/input/number-input.js +5 -5
- package/dist/components/forms/input/number-input.js.map +1 -1
- package/dist/components/forms/input-group/index.d.cts +3 -0
- package/dist/components/forms/input-group/index.d.ts +3 -0
- package/dist/components/forms/input-group/input-group.cjs +18 -0
- package/dist/components/forms/input-group/input-group.cjs.map +1 -0
- package/dist/components/forms/input-group/input-group.css +62 -0
- package/dist/components/forms/input-group/input-group.d.cts +7 -0
- package/dist/components/forms/input-group/input-group.d.ts +7 -0
- package/dist/components/forms/input-group/input-group.js +18 -0
- package/dist/components/forms/input-group/input-group.js.map +1 -0
- package/dist/components/forms/input-group/input-group.types.d.cts +7 -0
- package/dist/components/forms/input-group/input-group.types.d.ts +7 -0
- package/dist/components/forms/input-group/input-group.utils.cjs +5 -0
- package/dist/components/forms/input-group/input-group.utils.cjs.map +1 -0
- package/dist/components/forms/input-group/input-group.utils.js +5 -0
- package/dist/components/forms/input-group/input-group.utils.js.map +1 -0
- package/dist/components/forms/radio-group/index.d.cts +2 -1
- package/dist/components/forms/radio-group/index.d.ts +2 -1
- package/dist/components/forms/select/index.cjs.map +1 -1
- package/dist/components/forms/select/index.js.map +1 -1
- package/dist/components/forms/slider/index.cjs +1 -1
- package/dist/components/forms/slider/index.cjs.map +1 -1
- package/dist/components/forms/slider/index.js +1 -1
- package/dist/components/forms/slider/index.js.map +1 -1
- package/dist/components/forms/stepper/index.d.cts +4 -2
- package/dist/components/forms/stepper/index.d.ts +4 -2
- package/dist/components/forms/time-picker/index.cjs +108 -0
- package/dist/components/forms/time-picker/index.cjs.map +1 -0
- package/dist/components/forms/time-picker/index.d.cts +3 -0
- package/dist/components/forms/time-picker/index.d.ts +3 -0
- package/dist/components/forms/time-picker/index.js +108 -0
- package/dist/components/forms/time-picker/index.js.map +1 -0
- package/dist/components/forms/time-picker/time-picker.css +166 -0
- package/dist/components/forms/time-picker/time-picker.types.d.cts +34 -0
- package/dist/components/forms/time-picker/time-picker.types.d.ts +34 -0
- package/dist/components/forms/time-picker/time-picker.utils.cjs +25 -0
- package/dist/components/forms/time-picker/time-picker.utils.cjs.map +1 -0
- package/dist/components/forms/time-picker/time-picker.utils.js +24 -0
- package/dist/components/forms/time-picker/time-picker.utils.js.map +1 -0
- package/dist/components/forms/token-input/index.cjs +189 -0
- package/dist/components/forms/token-input/index.cjs.map +1 -0
- package/dist/components/forms/token-input/index.d.cts +3 -0
- package/dist/components/forms/token-input/index.d.ts +3 -0
- package/dist/components/forms/token-input/index.js +189 -0
- package/dist/components/forms/token-input/index.js.map +1 -0
- package/dist/components/forms/token-input/token-input.css +145 -0
- package/dist/components/forms/token-input/token-input.types.d.cts +48 -0
- package/dist/components/forms/token-input/token-input.types.d.ts +48 -0
- package/dist/components/forms/token-input/token-input.utils.cjs +30 -0
- package/dist/components/forms/token-input/token-input.utils.cjs.map +1 -0
- package/dist/components/forms/token-input/token-input.utils.js +24 -0
- package/dist/components/forms/token-input/token-input.utils.js.map +1 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.css +14 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.utils.cjs +11 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.utils.cjs.map +1 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.utils.js +11 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio.utils.js.map +1 -0
- package/dist/components/layout/aspect-ratio/index.cjs +16 -0
- package/dist/components/layout/aspect-ratio/index.cjs.map +1 -0
- package/dist/components/layout/aspect-ratio/index.d.cts +11 -0
- package/dist/components/layout/aspect-ratio/index.d.ts +11 -0
- package/dist/components/layout/aspect-ratio/index.js +16 -0
- package/dist/components/layout/aspect-ratio/index.js.map +1 -0
- package/dist/components/layout/container/container.css +1 -0
- package/dist/components/layout/page-layout/page-layout.css +1 -0
- package/dist/components/layout/resizable-panels/index.cjs +1 -1
- package/dist/components/layout/resizable-panels/index.cjs.map +1 -1
- package/dist/components/layout/resizable-panels/index.js +1 -1
- package/dist/components/layout/resizable-panels/index.js.map +1 -1
- package/dist/components/layout/resizable-panels/resizable-panels.utils.cjs.map +1 -1
- package/dist/components/layout/resizable-panels/resizable-panels.utils.js.map +1 -1
- package/dist/components/layout/scroll-area/index.cjs +27 -0
- package/dist/components/layout/scroll-area/index.cjs.map +1 -0
- package/dist/components/layout/scroll-area/index.d.cts +15 -0
- package/dist/components/layout/scroll-area/index.d.ts +15 -0
- package/dist/components/layout/scroll-area/index.js +27 -0
- package/dist/components/layout/scroll-area/index.js.map +1 -0
- package/dist/components/layout/scroll-area/scroll-area.css +25 -0
- package/dist/components/layout/scroll-area/scroll-area.utils.cjs +8 -0
- package/dist/components/layout/scroll-area/scroll-area.utils.cjs.map +1 -0
- package/dist/components/layout/scroll-area/scroll-area.utils.d.cts +2 -0
- package/dist/components/layout/scroll-area/scroll-area.utils.d.ts +2 -0
- package/dist/components/layout/scroll-area/scroll-area.utils.js +8 -0
- package/dist/components/layout/scroll-area/scroll-area.utils.js.map +1 -0
- package/dist/components/layout/section/index.cjs +10 -4
- package/dist/components/layout/section/index.cjs.map +1 -1
- package/dist/components/layout/section/index.d.cts +1 -1
- package/dist/components/layout/section/index.d.ts +1 -1
- package/dist/components/layout/section/index.js +11 -5
- package/dist/components/layout/section/index.js.map +1 -1
- package/dist/components/layout/section/section.css +9 -3
- package/dist/components/layout/section/types.d.cts +5 -5
- package/dist/components/layout/section/types.d.ts +5 -5
- package/dist/components/layout/separator/index.cjs +18 -0
- package/dist/components/layout/separator/index.cjs.map +1 -0
- package/dist/components/layout/separator/index.d.cts +17 -0
- package/dist/components/layout/separator/index.d.ts +17 -0
- package/dist/components/layout/separator/index.js +18 -0
- package/dist/components/layout/separator/index.js.map +1 -0
- package/dist/components/layout/separator/separator.css +15 -0
- package/dist/components/layout/separator/separator.utils.cjs +11 -0
- package/dist/components/layout/separator/separator.utils.cjs.map +1 -0
- package/dist/components/layout/separator/separator.utils.d.cts +2 -0
- package/dist/components/layout/separator/separator.utils.d.ts +2 -0
- package/dist/components/layout/separator/separator.utils.js +11 -0
- package/dist/components/layout/separator/separator.utils.js.map +1 -0
- package/dist/components/layout/stack/index.cjs +18 -2
- package/dist/components/layout/stack/index.cjs.map +1 -1
- package/dist/components/layout/stack/index.d.cts +8 -6
- package/dist/components/layout/stack/index.d.ts +8 -6
- package/dist/components/layout/stack/index.js +18 -2
- package/dist/components/layout/stack/index.js.map +1 -1
- package/dist/components/layout/stack/stack.css +118 -138
- package/dist/components/navigation/accordion/index.cjs.map +1 -1
- package/dist/components/navigation/accordion/index.js.map +1 -1
- package/dist/components/navigation/carousel/index.cjs +5 -2
- package/dist/components/navigation/carousel/index.cjs.map +1 -1
- package/dist/components/navigation/carousel/index.js +5 -2
- package/dist/components/navigation/carousel/index.js.map +1 -1
- package/dist/components/navigation/pagination/index.cjs +146 -0
- package/dist/components/navigation/pagination/index.cjs.map +1 -0
- package/dist/components/navigation/pagination/index.d.cts +3 -0
- package/dist/components/navigation/pagination/index.d.ts +3 -0
- package/dist/components/navigation/pagination/index.js +146 -0
- package/dist/components/navigation/pagination/index.js.map +1 -0
- package/dist/components/navigation/pagination/pagination.css +134 -0
- package/dist/components/navigation/pagination/pagination.types.d.cts +38 -0
- package/dist/components/navigation/pagination/pagination.types.d.ts +38 -0
- package/dist/components/navigation/pagination/pagination.utils.cjs +54 -0
- package/dist/components/navigation/pagination/pagination.utils.cjs.map +1 -0
- package/dist/components/navigation/pagination/pagination.utils.js +53 -0
- package/dist/components/navigation/pagination/pagination.utils.js.map +1 -0
- package/dist/components/navigation/tabs/index.d.cts +3 -2
- package/dist/components/navigation/tabs/index.d.ts +3 -2
- package/dist/components/navigation/tree-view/index.cjs.map +1 -1
- package/dist/components/navigation/tree-view/index.js.map +1 -1
- package/dist/components/overlays/context-menu/context-menu.css +151 -0
- package/dist/components/overlays/context-menu/context-menu.types.d.cts +69 -0
- package/dist/components/overlays/context-menu/context-menu.types.d.ts +69 -0
- package/dist/components/overlays/context-menu/context-menu.utils.cjs +46 -0
- package/dist/components/overlays/context-menu/context-menu.utils.cjs.map +1 -0
- package/dist/components/overlays/context-menu/context-menu.utils.js +40 -0
- package/dist/components/overlays/context-menu/context-menu.utils.js.map +1 -0
- package/dist/components/overlays/context-menu/index.cjs +830 -0
- package/dist/components/overlays/context-menu/index.cjs.map +1 -0
- package/dist/components/overlays/context-menu/index.d.cts +42 -0
- package/dist/components/overlays/context-menu/index.d.ts +42 -0
- package/dist/components/overlays/context-menu/index.js +818 -0
- package/dist/components/overlays/context-menu/index.js.map +1 -0
- package/dist/components/overlays/dropdown-menu/dropdown-menu-content.cjs.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu-content.js.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.utils.cjs.map +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.utils.js.map +1 -1
- package/dist/components/typography/heading.cjs +6 -2
- package/dist/components/typography/heading.cjs.map +1 -1
- package/dist/components/typography/heading.d.cts +3 -2
- package/dist/components/typography/heading.d.ts +3 -2
- package/dist/components/typography/heading.js +6 -2
- package/dist/components/typography/heading.js.map +1 -1
- package/dist/components/typography/text.cjs +6 -2
- package/dist/components/typography/text.cjs.map +1 -1
- package/dist/components/typography/text.d.cts +3 -2
- package/dist/components/typography/text.d.ts +3 -2
- package/dist/components/typography/text.js +6 -2
- package/dist/components/typography/text.js.map +1 -1
- package/dist/components/utilities/preview/index.cjs +89 -21
- package/dist/components/utilities/preview/index.cjs.map +1 -1
- package/dist/components/utilities/preview/index.d.cts +6 -2
- package/dist/components/utilities/preview/index.d.ts +6 -2
- package/dist/components/utilities/preview/index.js +89 -21
- package/dist/components/utilities/preview/index.js.map +1 -1
- package/dist/components/utilities/preview/preview.css +26 -11
- package/dist/components/utilities/transition/index.d.cts +1 -1
- package/dist/components/utilities/transition/index.d.ts +1 -1
- package/dist/index.cjs +136 -97
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +12 -1
- package/package.json +7 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SeparatorOrientation } from "./separator.utils.js";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
type SeparatorProps = Omit<ComponentPropsWithRef<"div">, "children" | "role" | "aria-orientation"> & {
|
|
4
|
+
/**
|
|
5
|
+
* The orientation of the separator.
|
|
6
|
+
* @default "horizontal"
|
|
7
|
+
*/
|
|
8
|
+
orientation?: SeparatorOrientation;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the separator is purely decorative.
|
|
11
|
+
* Decorative separators are hidden from assistive technology.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
decorative?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const Separator: ({ orientation, decorative, className, ref, ...props }: SeparatorProps) => import("react").JSX.Element;
|
|
17
|
+
export { Separator, type SeparatorOrientation, type SeparatorProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getSeparatorSemantics } from "./separator.utils.js";
|
|
2
|
+
import "./separator.css";
|
|
3
|
+
import { cn } from "@puzzle-ui/core";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/layout/separator/index.tsx
|
|
6
|
+
const Separator = ({ orientation = "horizontal", decorative = true, className, ref, ...props }) => {
|
|
7
|
+
const semantics = getSeparatorSemantics(orientation, decorative);
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
...props,
|
|
10
|
+
...semantics,
|
|
11
|
+
ref,
|
|
12
|
+
className: cn("puzzle-separator", className),
|
|
13
|
+
"data-orientation": orientation
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export { Separator };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/layout/separator/index.tsx"],"sourcesContent":["import { cn } from \"@puzzle-ui/core\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { getSeparatorSemantics } from \"./separator.utils\";\nimport type { SeparatorOrientation } from \"./separator.utils\";\nimport \"./separator.css\";\n\ntype SeparatorProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"children\" | \"role\" | \"aria-orientation\"\n> & {\n /**\n * The orientation of the separator.\n * @default \"horizontal\"\n */\n orientation?: SeparatorOrientation;\n\n /**\n * Whether the separator is purely decorative.\n * Decorative separators are hidden from assistive technology.\n * @default true\n */\n decorative?: boolean;\n};\n\nconst Separator = ({\n orientation = \"horizontal\",\n decorative = true,\n className,\n ref,\n ...props\n}: SeparatorProps) => {\n const semantics = getSeparatorSemantics(orientation, decorative);\n\n return (\n <div\n {...props}\n {...semantics}\n ref={ref}\n className={cn(\"puzzle-separator\", className)}\n data-orientation={orientation}\n />\n );\n};\n\nexport { Separator, type SeparatorProps, type SeparatorOrientation };\n"],"mappings":";;;;;AAwBA,MAAM,aAAa,EACjB,cAAc,cACd,aAAa,MACb,WACA,KACA,GAAG,YACiB;CACpB,MAAM,YAAY,sBAAsB,aAAa,UAAU;CAE/D,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,GAAI;EACC;EACL,WAAW,GAAG,oBAAoB,SAAS;EAC3C,oBAAkB;CACnB,CAAA;AAEL"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.puzzle-separator {
|
|
2
|
+
background-color: var(--puzzle-color-border);
|
|
3
|
+
flex-shrink: 0;
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.puzzle-separator[data-orientation="horizontal"] {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--puzzle-border-width, 1px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.puzzle-separator[data-orientation="vertical"] {
|
|
13
|
+
width: var(--puzzle-border-width, 1px);
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/components/layout/separator/separator.utils.ts
|
|
2
|
+
const getSeparatorSemantics = (orientation, decorative) => {
|
|
3
|
+
if (decorative) return { role: "none" };
|
|
4
|
+
return {
|
|
5
|
+
role: "separator",
|
|
6
|
+
...orientation === "vertical" ? { "aria-orientation": "vertical" } : {}
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
exports.getSeparatorSemantics = getSeparatorSemantics;
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=separator.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.utils.cjs","names":[],"sources":["../../../../src/components/layout/separator/separator.utils.ts"],"sourcesContent":["type SeparatorOrientation = \"horizontal\" | \"vertical\";\n\ntype SeparatorSemantics =\n | {\n role: \"none\";\n \"aria-orientation\"?: undefined;\n }\n | {\n role: \"separator\";\n \"aria-orientation\"?: \"vertical\";\n };\n\nconst getSeparatorSemantics = (\n orientation: SeparatorOrientation,\n decorative: boolean,\n): SeparatorSemantics => {\n if (decorative) {\n return {\n role: \"none\",\n };\n }\n\n return {\n role: \"separator\",\n ...(orientation === \"vertical\"\n ? { \"aria-orientation\": \"vertical\" as const }\n : {}),\n };\n};\n\nexport {\n getSeparatorSemantics,\n type SeparatorOrientation,\n type SeparatorSemantics,\n};\n"],"mappings":";AAYA,MAAM,yBACJ,aACA,eACuB;CACvB,IAAI,YACF,OAAO,EACL,MAAM,OACR;CAGF,OAAO;EACL,MAAM;EACN,GAAI,gBAAgB,aAChB,EAAE,oBAAoB,WAAoB,IAC1C,CAAC;CACP;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/components/layout/separator/separator.utils.ts
|
|
2
|
+
const getSeparatorSemantics = (orientation, decorative) => {
|
|
3
|
+
if (decorative) return { role: "none" };
|
|
4
|
+
return {
|
|
5
|
+
role: "separator",
|
|
6
|
+
...orientation === "vertical" ? { "aria-orientation": "vertical" } : {}
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export { getSeparatorSemantics };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=separator.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.utils.js","names":[],"sources":["../../../../src/components/layout/separator/separator.utils.ts"],"sourcesContent":["type SeparatorOrientation = \"horizontal\" | \"vertical\";\n\ntype SeparatorSemantics =\n | {\n role: \"none\";\n \"aria-orientation\"?: undefined;\n }\n | {\n role: \"separator\";\n \"aria-orientation\"?: \"vertical\";\n };\n\nconst getSeparatorSemantics = (\n orientation: SeparatorOrientation,\n decorative: boolean,\n): SeparatorSemantics => {\n if (decorative) {\n return {\n role: \"none\",\n };\n }\n\n return {\n role: \"separator\",\n ...(orientation === \"vertical\"\n ? { \"aria-orientation\": \"vertical\" as const }\n : {}),\n };\n};\n\nexport {\n getSeparatorSemantics,\n type SeparatorOrientation,\n type SeparatorSemantics,\n};\n"],"mappings":";AAYA,MAAM,yBACJ,aACA,eACuB;CACvB,IAAI,YACF,OAAO,EACL,MAAM,OACR;CAGF,OAAO;EACL,MAAM;EACN,GAAI,gBAAgB,aAChB,EAAE,oBAAoB,WAAoB,IAC1C,CAAC;CACP;AACF"}
|
|
@@ -3,7 +3,7 @@ let _puzzle_ui_core = require("@puzzle-ui/core");
|
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
// src/components/layout/stack/index.tsx
|
|
6
|
-
const Stack = ({ as: Component = "div", direction = "col", alignH, alignV, wrap = "
|
|
6
|
+
const Stack = ({ as: Component = "div", direction = "col", alignH, alignV, wrap = "wrap", gap = "md", divider, reverse = false, children, className, ...props }) => {
|
|
7
7
|
const directions = typeof direction === "string" ? { mobile: direction } : {
|
|
8
8
|
...direction,
|
|
9
9
|
mobile: direction.mobile ?? "col"
|
|
@@ -13,7 +13,23 @@ const Stack = ({ as: Component = "div", direction = "col", alignH, alignV, wrap
|
|
|
13
13
|
return value ? [`direction-${breakpoint}-${value}`] : [];
|
|
14
14
|
});
|
|
15
15
|
const hasAlignment = alignH !== void 0 || alignV !== void 0;
|
|
16
|
-
const
|
|
16
|
+
const responsiveAlignH = typeof alignH === "string" ? { mobile: alignH } : {
|
|
17
|
+
...alignH,
|
|
18
|
+
mobile: alignH?.mobile ?? "start"
|
|
19
|
+
};
|
|
20
|
+
const responsiveAlignV = typeof alignV === "string" ? { mobile: alignV } : {
|
|
21
|
+
...alignV,
|
|
22
|
+
mobile: alignV?.mobile ?? "start"
|
|
23
|
+
};
|
|
24
|
+
const responsiveAlignHClasses = _puzzle_ui_core.BREAKPOINTS.flatMap((breakpoint) => {
|
|
25
|
+
const value = responsiveAlignH[breakpoint];
|
|
26
|
+
return value ? [`align-h-${breakpoint}-${value}`] : [];
|
|
27
|
+
});
|
|
28
|
+
const responsiveAlignVClasses = _puzzle_ui_core.BREAKPOINTS.flatMap((breakpoint) => {
|
|
29
|
+
const value = responsiveAlignV[breakpoint];
|
|
30
|
+
return value ? [`align-v-${breakpoint}-${value}`] : [];
|
|
31
|
+
});
|
|
32
|
+
const classes = (0, _puzzle_ui_core.cn)("puzzle-stack", ...directionClasses, reverse && "reverse", wrap, `gap-${gap}`, ...responsiveAlignHClasses, ...responsiveAlignVClasses, hasAlignment && "has-alignment", className);
|
|
17
33
|
const childrenWithDividers = divider ? react.Children.toArray(children).flatMap((child, index, arr) => {
|
|
18
34
|
if (index === arr.length - 1) return [child];
|
|
19
35
|
const dividerKey = `stack-divider-${(0, react.isValidElement)(child) ? child.key : index}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["BREAKPOINTS","cn","Children","isValidElement","cloneElement","createElement","Fragment"],"sources":["../../../../src/components/layout/stack/index.tsx"],"sourcesContent":["import { BREAKPOINTS, cn } from \"@puzzle-ui/core\";\nimport {\n Children,\n cloneElement,\n createElement,\n Fragment,\n isValidElement,\n type ComponentPropsWithRef,\n type ElementType,\n type ReactNode,\n} from \"react\";\nimport type { ResponsiveValue } from \"@puzzle-ui/core\";\nimport \"./stack.css\";\n\ntype StackDirection = \"row\" | \"col\";\ntype ResponsiveDirection = ResponsiveValue<StackDirection>;\n\ntype StackMainAlignment =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"stretch\"\n | \"around\"\n | \"between\"\n | \"evenly\";\n\ntype StackCrossAlignment = \"start\" | \"center\" | \"end\" | \"stretch\";\n\ntype StackRowProps = {\n direction: \"row\";\n alignH?:
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["BREAKPOINTS","cn","Children","isValidElement","cloneElement","createElement","Fragment"],"sources":["../../../../src/components/layout/stack/index.tsx"],"sourcesContent":["import { BREAKPOINTS, cn } from \"@puzzle-ui/core\";\nimport {\n Children,\n cloneElement,\n createElement,\n Fragment,\n isValidElement,\n type ComponentPropsWithRef,\n type ElementType,\n type ReactNode,\n} from \"react\";\nimport type { ResponsiveConfig, ResponsiveValue } from \"@puzzle-ui/core\";\nimport \"./stack.css\";\n\ntype StackDirection = \"row\" | \"col\";\ntype ResponsiveDirection = ResponsiveValue<StackDirection>;\n\ntype StackMainAlignment =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"stretch\"\n | \"around\"\n | \"between\"\n | \"evenly\";\n\ntype StackCrossAlignment = \"start\" | \"center\" | \"end\" | \"stretch\";\n\ntype ResponsiveMainAlignment = ResponsiveValue<StackMainAlignment>;\ntype ResponsiveCrossAlignment = ResponsiveValue<StackCrossAlignment>;\n\ntype StackRowProps = {\n direction: \"row\";\n alignH?: ResponsiveMainAlignment;\n alignV?: ResponsiveCrossAlignment;\n};\n\ntype StackColProps = {\n direction?: \"col\";\n alignH?: ResponsiveCrossAlignment;\n alignV?: ResponsiveMainAlignment;\n};\n\ntype StackResponsiveProps = {\n direction: ResponsiveDirection;\n alignH?: ResponsiveMainAlignment;\n alignV?: ResponsiveMainAlignment;\n};\n\ntype StackOwnProps<C extends ElementType> = {\n as?: C;\n wrap?: \"wrap\" | \"nowrap\" | \"wrap-reverse\";\n gap?: \"0\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n divider?: ReactNode;\n reverse?: boolean;\n} & (StackRowProps | StackColProps | StackResponsiveProps);\n\ntype StackProps<C extends ElementType = \"div\"> = StackOwnProps<C> &\n Omit<ComponentPropsWithRef<C>, keyof StackOwnProps<C> | \"as\">;\n\nconst Stack = ({\n as: Component = \"div\",\n direction = \"col\",\n alignH,\n alignV,\n wrap = \"wrap\",\n gap = \"md\",\n divider,\n reverse = false,\n children,\n className,\n ...props\n}: StackProps<ElementType>) => {\n const directions: ResponsiveConfig<StackDirection> =\n typeof direction === \"string\"\n ? { mobile: direction }\n : {\n ...direction,\n mobile: direction.mobile ?? \"col\",\n };\n\n const directionClasses = BREAKPOINTS.flatMap((breakpoint) => {\n const value = directions[breakpoint];\n\n return value ? [`direction-${breakpoint}-${value}`] : [];\n });\n\n const hasAlignment = alignH !== undefined || alignV !== undefined;\n\n const responsiveAlignH: ResponsiveConfig<StackMainAlignment> =\n typeof alignH === \"string\"\n ? { mobile: alignH }\n : { ...alignH, mobile: alignH?.mobile ?? \"start\" };\n const responsiveAlignV: ResponsiveConfig<StackMainAlignment> =\n typeof alignV === \"string\"\n ? { mobile: alignV }\n : { ...alignV, mobile: alignV?.mobile ?? \"start\" };\n const responsiveAlignHClasses = BREAKPOINTS.flatMap((breakpoint) => {\n const value = responsiveAlignH[breakpoint];\n\n return value ? [`align-h-${breakpoint}-${value}`] : [];\n });\n\n const responsiveAlignVClasses = BREAKPOINTS.flatMap((breakpoint) => {\n const value = responsiveAlignV[breakpoint];\n\n return value ? [`align-v-${breakpoint}-${value}`] : [];\n });\n\n const classes = cn(\n \"puzzle-stack\",\n ...directionClasses,\n reverse && \"reverse\",\n wrap,\n `gap-${gap}`,\n ...responsiveAlignHClasses,\n ...responsiveAlignVClasses,\n hasAlignment && \"has-alignment\",\n className,\n );\n\n const childrenWithDividers = divider\n ? Children.toArray(children).flatMap((child, index, arr) => {\n if (index === arr.length - 1) {\n return [child];\n }\n\n // Children keep the keys assigned by Children.toArray; only dividers get new ones.\n const dividerKey = `stack-divider-${isValidElement(child) ? child.key : index}`;\n const clonedDivider = isValidElement(divider)\n ? cloneElement(divider, { key: dividerKey })\n : createElement(Fragment, { key: dividerKey }, divider);\n\n return [child, clonedDivider];\n })\n : children;\n\n return (\n <Component className={classes} {...props}>\n {childrenWithDividers}\n </Component>\n );\n};\n\nexport {\n Stack,\n type StackProps,\n type ResponsiveDirection,\n type StackMainAlignment,\n type StackCrossAlignment,\n};\n"],"mappings":";;;;;AA4DA,MAAM,SAAS,EACb,IAAI,YAAY,OAChB,YAAY,OACZ,QACA,QACA,OAAO,QACP,MAAM,MACN,SACA,UAAU,OACV,UACA,WACA,GAAG,YAC0B;CAC7B,MAAM,aACJ,OAAO,cAAc,WACjB,EAAE,QAAQ,UAAU,IACpB;EACE,GAAG;EACH,QAAQ,UAAU,UAAU;CAC9B;CAEN,MAAM,mBAAmBA,gBAAAA,YAAY,SAAS,eAAe;EAC3D,MAAM,QAAQ,WAAW;EAEzB,OAAO,QAAQ,CAAC,aAAa,WAAW,GAAG,OAAO,IAAI,CAAC;CACzD,CAAC;CAED,MAAM,eAAe,WAAW,KAAA,KAAa,WAAW,KAAA;CAExD,MAAM,mBACJ,OAAO,WAAW,WACd,EAAE,QAAQ,OAAO,IACjB;EAAE,GAAG;EAAQ,QAAQ,QAAQ,UAAU;CAAQ;CACrD,MAAM,mBACJ,OAAO,WAAW,WACd,EAAE,QAAQ,OAAO,IACjB;EAAE,GAAG;EAAQ,QAAQ,QAAQ,UAAU;CAAQ;CACrD,MAAM,0BAA0BA,gBAAAA,YAAY,SAAS,eAAe;EAClE,MAAM,QAAQ,iBAAiB;EAE/B,OAAO,QAAQ,CAAC,WAAW,WAAW,GAAG,OAAO,IAAI,CAAC;CACvD,CAAC;CAED,MAAM,0BAA0BA,gBAAAA,YAAY,SAAS,eAAe;EAClE,MAAM,QAAQ,iBAAiB;EAE/B,OAAO,QAAQ,CAAC,WAAW,WAAW,GAAG,OAAO,IAAI,CAAC;CACvD,CAAC;CAED,MAAM,WAAA,GAAUC,gBAAAA,GAAAA,CACd,gBACA,GAAG,kBACH,WAAW,WACX,MACA,OAAO,OACP,GAAG,yBACH,GAAG,yBACH,gBAAgB,iBAChB,SACF;CAEA,MAAM,uBAAuB,UACzBC,MAAAA,SAAS,QAAQ,QAAQ,CAAC,CAAC,SAAS,OAAO,OAAO,QAAQ;EACxD,IAAI,UAAU,IAAI,SAAS,GACzB,OAAO,CAAC,KAAK;EAIf,MAAM,aAAa,kBAAA,GAAiBC,MAAAA,eAAAA,CAAe,KAAK,IAAI,MAAM,MAAM;EAKxE,OAAO,CAAC,QAAA,GAJcA,MAAAA,eAAAA,CAAe,OAAO,KAAA,GACxCC,MAAAA,aAAAA,CAAa,SAAS,EAAE,KAAK,WAAW,CAAC,KAAA,GACzCC,MAAAA,cAAAA,CAAcC,MAAAA,UAAU,EAAE,KAAK,WAAW,GAAG,OAAO,CAE5B;CAC9B,CAAC,IACD;CAEJ,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAW,WAAW;EAAS,GAAI;EAChC,UAAA;CACQ,CAAA;AAEf"}
|
|
@@ -4,20 +4,22 @@ type StackDirection = "row" | "col";
|
|
|
4
4
|
type ResponsiveDirection = ResponsiveValue<StackDirection>;
|
|
5
5
|
type StackMainAlignment = "start" | "center" | "end" | "stretch" | "around" | "between" | "evenly";
|
|
6
6
|
type StackCrossAlignment = "start" | "center" | "end" | "stretch";
|
|
7
|
+
type ResponsiveMainAlignment = ResponsiveValue<StackMainAlignment>;
|
|
8
|
+
type ResponsiveCrossAlignment = ResponsiveValue<StackCrossAlignment>;
|
|
7
9
|
type StackRowProps = {
|
|
8
10
|
direction: "row";
|
|
9
|
-
alignH?:
|
|
10
|
-
alignV?:
|
|
11
|
+
alignH?: ResponsiveMainAlignment;
|
|
12
|
+
alignV?: ResponsiveCrossAlignment;
|
|
11
13
|
};
|
|
12
14
|
type StackColProps = {
|
|
13
15
|
direction?: "col";
|
|
14
|
-
alignH?:
|
|
15
|
-
alignV?:
|
|
16
|
+
alignH?: ResponsiveCrossAlignment;
|
|
17
|
+
alignV?: ResponsiveMainAlignment;
|
|
16
18
|
};
|
|
17
19
|
type StackResponsiveProps = {
|
|
18
20
|
direction: ResponsiveDirection;
|
|
19
|
-
alignH?:
|
|
20
|
-
alignV?:
|
|
21
|
+
alignH?: ResponsiveMainAlignment;
|
|
22
|
+
alignV?: ResponsiveMainAlignment;
|
|
21
23
|
};
|
|
22
24
|
type StackOwnProps<C extends ElementType> = {
|
|
23
25
|
as?: C;
|
|
@@ -4,20 +4,22 @@ type StackDirection = "row" | "col";
|
|
|
4
4
|
type ResponsiveDirection = ResponsiveValue<StackDirection>;
|
|
5
5
|
type StackMainAlignment = "start" | "center" | "end" | "stretch" | "around" | "between" | "evenly";
|
|
6
6
|
type StackCrossAlignment = "start" | "center" | "end" | "stretch";
|
|
7
|
+
type ResponsiveMainAlignment = ResponsiveValue<StackMainAlignment>;
|
|
8
|
+
type ResponsiveCrossAlignment = ResponsiveValue<StackCrossAlignment>;
|
|
7
9
|
type StackRowProps = {
|
|
8
10
|
direction: "row";
|
|
9
|
-
alignH?:
|
|
10
|
-
alignV?:
|
|
11
|
+
alignH?: ResponsiveMainAlignment;
|
|
12
|
+
alignV?: ResponsiveCrossAlignment;
|
|
11
13
|
};
|
|
12
14
|
type StackColProps = {
|
|
13
15
|
direction?: "col";
|
|
14
|
-
alignH?:
|
|
15
|
-
alignV?:
|
|
16
|
+
alignH?: ResponsiveCrossAlignment;
|
|
17
|
+
alignV?: ResponsiveMainAlignment;
|
|
16
18
|
};
|
|
17
19
|
type StackResponsiveProps = {
|
|
18
20
|
direction: ResponsiveDirection;
|
|
19
|
-
alignH?:
|
|
20
|
-
alignV?:
|
|
21
|
+
alignH?: ResponsiveMainAlignment;
|
|
22
|
+
alignV?: ResponsiveMainAlignment;
|
|
21
23
|
};
|
|
22
24
|
type StackOwnProps<C extends ElementType> = {
|
|
23
25
|
as?: C;
|
|
@@ -3,7 +3,7 @@ import { BREAKPOINTS, cn } from "@puzzle-ui/core";
|
|
|
3
3
|
import { Children, Fragment, cloneElement, createElement, isValidElement } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
// src/components/layout/stack/index.tsx
|
|
6
|
-
const Stack = ({ as: Component = "div", direction = "col", alignH, alignV, wrap = "
|
|
6
|
+
const Stack = ({ as: Component = "div", direction = "col", alignH, alignV, wrap = "wrap", gap = "md", divider, reverse = false, children, className, ...props }) => {
|
|
7
7
|
const directions = typeof direction === "string" ? { mobile: direction } : {
|
|
8
8
|
...direction,
|
|
9
9
|
mobile: direction.mobile ?? "col"
|
|
@@ -13,7 +13,23 @@ const Stack = ({ as: Component = "div", direction = "col", alignH, alignV, wrap
|
|
|
13
13
|
return value ? [`direction-${breakpoint}-${value}`] : [];
|
|
14
14
|
});
|
|
15
15
|
const hasAlignment = alignH !== void 0 || alignV !== void 0;
|
|
16
|
-
const
|
|
16
|
+
const responsiveAlignH = typeof alignH === "string" ? { mobile: alignH } : {
|
|
17
|
+
...alignH,
|
|
18
|
+
mobile: alignH?.mobile ?? "start"
|
|
19
|
+
};
|
|
20
|
+
const responsiveAlignV = typeof alignV === "string" ? { mobile: alignV } : {
|
|
21
|
+
...alignV,
|
|
22
|
+
mobile: alignV?.mobile ?? "start"
|
|
23
|
+
};
|
|
24
|
+
const responsiveAlignHClasses = BREAKPOINTS.flatMap((breakpoint) => {
|
|
25
|
+
const value = responsiveAlignH[breakpoint];
|
|
26
|
+
return value ? [`align-h-${breakpoint}-${value}`] : [];
|
|
27
|
+
});
|
|
28
|
+
const responsiveAlignVClasses = BREAKPOINTS.flatMap((breakpoint) => {
|
|
29
|
+
const value = responsiveAlignV[breakpoint];
|
|
30
|
+
return value ? [`align-v-${breakpoint}-${value}`] : [];
|
|
31
|
+
});
|
|
32
|
+
const classes = cn("puzzle-stack", ...directionClasses, reverse && "reverse", wrap, `gap-${gap}`, ...responsiveAlignHClasses, ...responsiveAlignVClasses, hasAlignment && "has-alignment", className);
|
|
17
33
|
const childrenWithDividers = divider ? Children.toArray(children).flatMap((child, index, arr) => {
|
|
18
34
|
if (index === arr.length - 1) return [child];
|
|
19
35
|
const dividerKey = `stack-divider-${isValidElement(child) ? child.key : index}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/layout/stack/index.tsx"],"sourcesContent":["import { BREAKPOINTS, cn } from \"@puzzle-ui/core\";\nimport {\n Children,\n cloneElement,\n createElement,\n Fragment,\n isValidElement,\n type ComponentPropsWithRef,\n type ElementType,\n type ReactNode,\n} from \"react\";\nimport type { ResponsiveValue } from \"@puzzle-ui/core\";\nimport \"./stack.css\";\n\ntype StackDirection = \"row\" | \"col\";\ntype ResponsiveDirection = ResponsiveValue<StackDirection>;\n\ntype StackMainAlignment =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"stretch\"\n | \"around\"\n | \"between\"\n | \"evenly\";\n\ntype StackCrossAlignment = \"start\" | \"center\" | \"end\" | \"stretch\";\n\ntype StackRowProps = {\n direction: \"row\";\n alignH?:
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/layout/stack/index.tsx"],"sourcesContent":["import { BREAKPOINTS, cn } from \"@puzzle-ui/core\";\nimport {\n Children,\n cloneElement,\n createElement,\n Fragment,\n isValidElement,\n type ComponentPropsWithRef,\n type ElementType,\n type ReactNode,\n} from \"react\";\nimport type { ResponsiveConfig, ResponsiveValue } from \"@puzzle-ui/core\";\nimport \"./stack.css\";\n\ntype StackDirection = \"row\" | \"col\";\ntype ResponsiveDirection = ResponsiveValue<StackDirection>;\n\ntype StackMainAlignment =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"stretch\"\n | \"around\"\n | \"between\"\n | \"evenly\";\n\ntype StackCrossAlignment = \"start\" | \"center\" | \"end\" | \"stretch\";\n\ntype ResponsiveMainAlignment = ResponsiveValue<StackMainAlignment>;\ntype ResponsiveCrossAlignment = ResponsiveValue<StackCrossAlignment>;\n\ntype StackRowProps = {\n direction: \"row\";\n alignH?: ResponsiveMainAlignment;\n alignV?: ResponsiveCrossAlignment;\n};\n\ntype StackColProps = {\n direction?: \"col\";\n alignH?: ResponsiveCrossAlignment;\n alignV?: ResponsiveMainAlignment;\n};\n\ntype StackResponsiveProps = {\n direction: ResponsiveDirection;\n alignH?: ResponsiveMainAlignment;\n alignV?: ResponsiveMainAlignment;\n};\n\ntype StackOwnProps<C extends ElementType> = {\n as?: C;\n wrap?: \"wrap\" | \"nowrap\" | \"wrap-reverse\";\n gap?: \"0\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n divider?: ReactNode;\n reverse?: boolean;\n} & (StackRowProps | StackColProps | StackResponsiveProps);\n\ntype StackProps<C extends ElementType = \"div\"> = StackOwnProps<C> &\n Omit<ComponentPropsWithRef<C>, keyof StackOwnProps<C> | \"as\">;\n\nconst Stack = ({\n as: Component = \"div\",\n direction = \"col\",\n alignH,\n alignV,\n wrap = \"wrap\",\n gap = \"md\",\n divider,\n reverse = false,\n children,\n className,\n ...props\n}: StackProps<ElementType>) => {\n const directions: ResponsiveConfig<StackDirection> =\n typeof direction === \"string\"\n ? { mobile: direction }\n : {\n ...direction,\n mobile: direction.mobile ?? \"col\",\n };\n\n const directionClasses = BREAKPOINTS.flatMap((breakpoint) => {\n const value = directions[breakpoint];\n\n return value ? [`direction-${breakpoint}-${value}`] : [];\n });\n\n const hasAlignment = alignH !== undefined || alignV !== undefined;\n\n const responsiveAlignH: ResponsiveConfig<StackMainAlignment> =\n typeof alignH === \"string\"\n ? { mobile: alignH }\n : { ...alignH, mobile: alignH?.mobile ?? \"start\" };\n const responsiveAlignV: ResponsiveConfig<StackMainAlignment> =\n typeof alignV === \"string\"\n ? { mobile: alignV }\n : { ...alignV, mobile: alignV?.mobile ?? \"start\" };\n const responsiveAlignHClasses = BREAKPOINTS.flatMap((breakpoint) => {\n const value = responsiveAlignH[breakpoint];\n\n return value ? [`align-h-${breakpoint}-${value}`] : [];\n });\n\n const responsiveAlignVClasses = BREAKPOINTS.flatMap((breakpoint) => {\n const value = responsiveAlignV[breakpoint];\n\n return value ? [`align-v-${breakpoint}-${value}`] : [];\n });\n\n const classes = cn(\n \"puzzle-stack\",\n ...directionClasses,\n reverse && \"reverse\",\n wrap,\n `gap-${gap}`,\n ...responsiveAlignHClasses,\n ...responsiveAlignVClasses,\n hasAlignment && \"has-alignment\",\n className,\n );\n\n const childrenWithDividers = divider\n ? Children.toArray(children).flatMap((child, index, arr) => {\n if (index === arr.length - 1) {\n return [child];\n }\n\n // Children keep the keys assigned by Children.toArray; only dividers get new ones.\n const dividerKey = `stack-divider-${isValidElement(child) ? child.key : index}`;\n const clonedDivider = isValidElement(divider)\n ? cloneElement(divider, { key: dividerKey })\n : createElement(Fragment, { key: dividerKey }, divider);\n\n return [child, clonedDivider];\n })\n : children;\n\n return (\n <Component className={classes} {...props}>\n {childrenWithDividers}\n </Component>\n );\n};\n\nexport {\n Stack,\n type StackProps,\n type ResponsiveDirection,\n type StackMainAlignment,\n type StackCrossAlignment,\n};\n"],"mappings":";;;;;AA4DA,MAAM,SAAS,EACb,IAAI,YAAY,OAChB,YAAY,OACZ,QACA,QACA,OAAO,QACP,MAAM,MACN,SACA,UAAU,OACV,UACA,WACA,GAAG,YAC0B;CAC7B,MAAM,aACJ,OAAO,cAAc,WACjB,EAAE,QAAQ,UAAU,IACpB;EACE,GAAG;EACH,QAAQ,UAAU,UAAU;CAC9B;CAEN,MAAM,mBAAmB,YAAY,SAAS,eAAe;EAC3D,MAAM,QAAQ,WAAW;EAEzB,OAAO,QAAQ,CAAC,aAAa,WAAW,GAAG,OAAO,IAAI,CAAC;CACzD,CAAC;CAED,MAAM,eAAe,WAAW,KAAA,KAAa,WAAW,KAAA;CAExD,MAAM,mBACJ,OAAO,WAAW,WACd,EAAE,QAAQ,OAAO,IACjB;EAAE,GAAG;EAAQ,QAAQ,QAAQ,UAAU;CAAQ;CACrD,MAAM,mBACJ,OAAO,WAAW,WACd,EAAE,QAAQ,OAAO,IACjB;EAAE,GAAG;EAAQ,QAAQ,QAAQ,UAAU;CAAQ;CACrD,MAAM,0BAA0B,YAAY,SAAS,eAAe;EAClE,MAAM,QAAQ,iBAAiB;EAE/B,OAAO,QAAQ,CAAC,WAAW,WAAW,GAAG,OAAO,IAAI,CAAC;CACvD,CAAC;CAED,MAAM,0BAA0B,YAAY,SAAS,eAAe;EAClE,MAAM,QAAQ,iBAAiB;EAE/B,OAAO,QAAQ,CAAC,WAAW,WAAW,GAAG,OAAO,IAAI,CAAC;CACvD,CAAC;CAED,MAAM,UAAU,GACd,gBACA,GAAG,kBACH,WAAW,WACX,MACA,OAAO,OACP,GAAG,yBACH,GAAG,yBACH,gBAAgB,iBAChB,SACF;CAEA,MAAM,uBAAuB,UACzB,SAAS,QAAQ,QAAQ,CAAC,CAAC,SAAS,OAAO,OAAO,QAAQ;EACxD,IAAI,UAAU,IAAI,SAAS,GACzB,OAAO,CAAC,KAAK;EAIf,MAAM,aAAa,iBAAiB,eAAe,KAAK,IAAI,MAAM,MAAM;EAKxE,OAAO,CAAC,OAJc,eAAe,OAAO,IACxC,aAAa,SAAS,EAAE,KAAK,WAAW,CAAC,IACzC,cAAc,UAAU,EAAE,KAAK,WAAW,GAAG,OAAO,CAE5B;CAC9B,CAAC,IACD;CAEJ,OACE,oBAAC,WAAD;EAAW,WAAW;EAAS,GAAI;EAChC,UAAA;CACQ,CAAA;AAEf"}
|