@askrjs/themes 0.0.11 → 0.0.13
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 +5 -5
- package/THEMING.md +2 -2
- package/dist/components/_internal/block-layout.d.ts +1 -2
- package/dist/components/_internal/block-layout.js +1 -3
- package/dist/components/_internal/block-layout.js.map +1 -1
- package/dist/components/_internal/classes.js +0 -2
- package/dist/components/_internal/jsx.js +9 -3
- package/dist/components/_internal/jsx.js.map +1 -1
- package/dist/components/_internal/merge-props.js +0 -2
- package/dist/components/_internal/pathname.js +0 -2
- package/dist/components/_internal/style.js +0 -2
- package/dist/components/alert/alert.d.ts +1 -3
- package/dist/components/alert/alert.js +0 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +1 -3
- package/dist/components/alert/index.d.ts +2 -1
- package/dist/components/aside/aside.d.ts +1 -3
- package/dist/components/aside/aside.js +0 -2
- package/dist/components/aside/aside.types.d.ts +2 -2
- package/dist/components/aside/index.d.ts +2 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +1 -3
- package/dist/components/aspect-ratio/aspect-ratio.js +2 -6
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +1 -3
- package/dist/components/aspect-ratio/index.d.ts +2 -1
- package/dist/components/badge/badge.d.ts +1 -3
- package/dist/components/badge/badge.js +2 -6
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/badge.types.d.ts +1 -3
- package/dist/components/badge/index.d.ts +2 -1
- package/dist/components/block/block.d.ts +1 -3
- package/dist/components/block/block.js +2 -6
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/block/block.types.d.ts +2 -4
- package/dist/components/block/index.d.ts +2 -1
- package/dist/components/brand/brand.d.ts +1 -3
- package/dist/components/brand/brand.js +4 -7
- package/dist/components/brand/brand.js.map +1 -1
- package/dist/components/brand/brand.types.d.ts +1 -3
- package/dist/components/brand/index.d.ts +2 -1
- package/dist/components/button-group/button-group.d.ts +1 -3
- package/dist/components/button-group/button-group.js +0 -2
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/button-group/button-group.types.d.ts +1 -3
- package/dist/components/button-group/index.d.ts +2 -1
- package/dist/components/card/card.d.ts +1 -3
- package/dist/components/card/card.js +0 -2
- package/dist/components/card/card.types.d.ts +1 -3
- package/dist/components/card/index.d.ts +2 -1
- package/dist/components/catalog.d.ts +1 -3
- package/dist/components/catalog.js +2 -3
- package/dist/components/catalog.js.map +1 -1
- package/dist/components/close/close.d.ts +1 -3
- package/dist/components/close/close.js +0 -2
- package/dist/components/close/close.types.d.ts +1 -3
- package/dist/components/close/index.d.ts +2 -1
- package/dist/components/container/container.d.ts +1 -3
- package/dist/components/container/container.js +0 -2
- package/dist/components/container/container.types.d.ts +2 -2
- package/dist/components/container/index.d.ts +2 -1
- package/dist/components/empty-state/empty-state.d.ts +1 -3
- package/dist/components/empty-state/empty-state.js +0 -2
- package/dist/components/empty-state/empty-state.types.d.ts +2 -2
- package/dist/components/empty-state/index.d.ts +2 -1
- package/dist/components/field/field.d.ts +1 -3
- package/dist/components/field/field.js +0 -2
- package/dist/components/field/field.types.d.ts +1 -3
- package/dist/components/field/index.d.ts +2 -1
- package/dist/components/footer/footer.d.ts +1 -3
- package/dist/components/footer/footer.js +0 -2
- package/dist/components/footer/footer.types.d.ts +2 -3
- package/dist/components/footer/index.d.ts +2 -1
- package/dist/components/grid/grid.d.ts +1 -3
- package/dist/components/grid/grid.js +2 -7
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid/grid.types.d.ts +1 -3
- package/dist/components/grid/index.d.ts +2 -1
- package/dist/components/header/header.d.ts +1 -3
- package/dist/components/header/header.js +0 -2
- package/dist/components/header/header.types.d.ts +2 -2
- package/dist/components/header/index.d.ts +2 -1
- package/dist/components/input-group/index.d.ts +2 -1
- package/dist/components/input-group/input-group.d.ts +1 -3
- package/dist/components/input-group/input-group.js +2 -6
- package/dist/components/input-group/input-group.js.map +1 -1
- package/dist/components/input-group/input-group.types.d.ts +1 -3
- package/dist/components/main/index.d.ts +2 -1
- package/dist/components/main/main.d.ts +1 -3
- package/dist/components/main/main.js +0 -2
- package/dist/components/main/main.types.d.ts +2 -2
- package/dist/components/nav/index.d.ts +2 -1
- package/dist/components/nav/nav.d.ts +1 -3
- package/dist/components/nav/nav.js +22 -17
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/nav.types.d.ts +1 -3
- package/dist/components/navbar/index.d.ts +3 -1
- package/dist/components/navbar/navbar.d.ts +1 -3
- package/dist/components/navbar/navbar.js +9 -10
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.types.d.ts +2 -3
- package/dist/components/overlays/dropdown-content.d.ts +1 -3
- package/dist/components/overlays/dropdown-content.js +0 -2
- package/dist/components/page/index.d.ts +2 -1
- package/dist/components/page/page.d.ts +1 -3
- package/dist/components/page/page.js +0 -2
- package/dist/components/page/page.types.d.ts +2 -2
- package/dist/components/page-header/index.d.ts +2 -1
- package/dist/components/page-header/page-header.d.ts +1 -3
- package/dist/components/page-header/page-header.js +0 -2
- package/dist/components/page-header/page-header.types.d.ts +2 -2
- package/dist/components/section/index.d.ts +2 -1
- package/dist/components/section/section.d.ts +1 -3
- package/dist/components/section/section.js +0 -2
- package/dist/components/section/section.types.d.ts +2 -2
- package/dist/components/separator/index.d.ts +2 -1
- package/dist/components/separator/separator.d.ts +1 -3
- package/dist/components/separator/separator.js +2 -6
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/separator/separator.types.d.ts +1 -3
- package/dist/components/sidebar/index.d.ts +2 -1
- package/dist/components/sidebar/sidebar.d.ts +2 -4
- package/dist/components/sidebar/sidebar.js +5 -10
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.types.d.ts +2 -2
- package/dist/components/skeleton/index.d.ts +2 -1
- package/dist/components/skeleton/skeleton.d.ts +1 -3
- package/dist/components/skeleton/skeleton.js +8 -10
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +1 -3
- package/dist/components/spinner/index.d.ts +2 -1
- package/dist/components/spinner/spinner.d.ts +1 -3
- package/dist/components/spinner/spinner.js +0 -2
- package/dist/components/spinner/spinner.types.d.ts +1 -3
- package/dist/components/stat/index.d.ts +2 -1
- package/dist/components/stat/stat.d.ts +1 -3
- package/dist/components/stat/stat.js +0 -2
- package/dist/components/stat/stat.types.d.ts +1 -3
- package/dist/components/text/index.d.ts +2 -1
- package/dist/components/text/text.d.ts +1 -3
- package/dist/components/text/text.js +2 -7
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/text/text.types.d.ts +1 -3
- package/dist/components/theme/index.d.ts +2 -1
- package/dist/components/theme/theme.d.ts +5 -7
- package/dist/components/theme/theme.js +102 -72
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +2 -1
- package/dist/components/toolbar/toolbar.d.ts +1 -3
- package/dist/components/toolbar/toolbar.js +0 -2
- package/dist/components/toolbar/toolbar.types.d.ts +2 -2
- package/dist/components.d.ts +34 -4
- package/dist/components.js +4 -4
- package/dist/controls.d.ts +4 -0
- package/dist/core.d.ts +18 -2
- package/dist/navs.d.ts +1 -0
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/surfaces.d.ts +8 -0
- package/dist/theme.d.ts +3 -2
- package/dist/theme.js +2 -2
- package/dist/themes/default/index.css +3 -3
- package/package.json +39 -16
- package/src/components/_internal/jsx.ts +11 -0
- package/src/components/alert/alert.tsx +1 -1
- package/src/components/aspect-ratio/aspect-ratio.tsx +2 -1
- package/src/components/badge/badge.tsx +2 -1
- package/src/components/block/block.tsx +2 -2
- package/src/components/brand/brand.tsx +3 -3
- package/src/components/button-group/button-group.tsx +1 -1
- package/src/components/catalog.tsx +3 -1
- package/src/components/grid/grid.tsx +2 -2
- package/src/components/input-group/input-group.tsx +3 -2
- package/src/components/nav/nav.tsx +25 -19
- package/src/components/navbar/navbar.tsx +22 -14
- package/src/components/separator/separator.tsx +2 -1
- package/src/components/sidebar/index.ts +1 -1
- package/src/components/sidebar/sidebar.tsx +7 -7
- package/src/components/skeleton/skeleton.tsx +8 -10
- package/src/components/text/text.tsx +2 -2
- package/src/components/theme/index.ts +4 -4
- package/src/components/theme/theme.tsx +135 -99
- package/src/components.ts +4 -4
- package/src/overlays.ts +3 -3
- package/src/theme.ts +4 -4
- package/src/themes/default/styles/display/coverage.css +1 -1
- package/src/themes/default/styles/overlays/toast.css +1 -1
- package/src/themes/default/styles/shell/sidebar.css +1 -1
- package/templates/theme/styles/display/coverage.css +1 -1
- package/templates/theme/styles/overlays/toast.css +1 -1
- package/templates/theme/styles/shell/sidebar.css +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BlockSpace, ResponsiveValue } from "../_internal/block-layout.js";
|
|
2
2
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
|
|
4
3
|
//#region src/components/grid/grid.types.d.ts
|
|
5
4
|
type GridElement = "div" | "section" | "ul";
|
|
6
5
|
type GridColumns = number | string;
|
|
@@ -15,5 +14,4 @@ type GridProps<TElement extends GridElement = "div"> = GridIntrinsicProps<TEleme
|
|
|
15
14
|
ref?: Ref<HTMLElement>;
|
|
16
15
|
};
|
|
17
16
|
//#endregion
|
|
18
|
-
export { GridAlign, GridColumns, GridElement, GridProps };
|
|
19
|
-
//# sourceMappingURL=grid.types.d.ts.map
|
|
17
|
+
export { GridAlign, GridColumns, GridElement, GridProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BlockElementProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
//#region src/components/header/header.types.d.ts
|
|
3
4
|
type HeaderProps = Omit<BlockElementProps<"header">, "as" | "sticky"> & {
|
|
4
5
|
position?: "sticky" | "static";
|
|
5
6
|
sticky?: boolean;
|
|
6
7
|
};
|
|
7
8
|
//#endregion
|
|
8
|
-
export { HeaderProps };
|
|
9
|
-
//# sourceMappingURL=header.types.d.ts.map
|
|
9
|
+
export { HeaderProps };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { InputGroupOrientation, InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps } from "./input-group.types.js";
|
|
2
|
-
import { InputGroup, InputGroupText } from "./input-group.js";
|
|
2
|
+
import { InputGroup, InputGroupText } from "./input-group.js";
|
|
3
|
+
export { InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps } from "./input-group.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/input-group/input-group.d.ts
|
|
4
3
|
declare function InputGroup(props: InputGroupProps): JSX.Element;
|
|
5
4
|
declare function InputGroupText(props: InputGroupTextProps): JSX.Element;
|
|
6
5
|
declare function InputGroupText(props: InputGroupTextAsChildProps): JSX.Element;
|
|
7
6
|
//#endregion
|
|
8
|
-
export { InputGroup, InputGroupText };
|
|
9
|
-
//# sourceMappingURL=input-group.d.ts.map
|
|
7
|
+
export { InputGroup, InputGroupText };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { classes } from "../_internal/classes.js";
|
|
2
|
+
import { intrinsicElement } from "../_internal/jsx.js";
|
|
2
3
|
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
4
|
import { Slot } from "@askrjs/askr/foundations";
|
|
4
5
|
import { mergeProps } from "@askrjs/askr/foundations/utilities";
|
|
@@ -28,12 +29,7 @@ function InputGroupText(props) {
|
|
|
28
29
|
...finalProps,
|
|
29
30
|
children
|
|
30
31
|
});
|
|
31
|
-
return
|
|
32
|
-
...finalProps,
|
|
33
|
-
children
|
|
34
|
-
});
|
|
32
|
+
return intrinsicElement("span", finalProps, children);
|
|
35
33
|
}
|
|
36
34
|
//#endregion
|
|
37
35
|
export { InputGroup, InputGroupText };
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=input-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.js","names":[],"sources":["../../../src/components/input-group/input-group.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"@askrjs/askr/foundations/utilities\";\nimport { classes } from \"../_internal/classes\";\nimport type {\n InputGroupProps,\n InputGroupTextAsChildProps,\n InputGroupTextProps,\n} from \"./input-group.types\";\n\nexport function InputGroup(props: InputGroupProps): JSX.Element {\n const {\n attached = true,\n children,\n class: className,\n orientation = \"horizontal\",\n ref,\n role,\n ...rest\n } = props;\n\n return (\n <div\n {...rest}\n ref={ref}\n class={classes(\n \"input-group\",\n orientation === \"vertical\" ? \"input-group-vertical\" : undefined,\n className,\n )}\n data-attached={attached ? \"true\" : \"false\"}\n data-orientation={orientation}\n data-slot=\"input-group\"\n role={role ?? \"group\"}\n >\n {children}\n </div>\n );\n}\n\nexport function InputGroupText(props: InputGroupTextProps): JSX.Element;\nexport function InputGroupText(props: InputGroupTextAsChildProps): JSX.Element;\nexport function InputGroupText(\n props: InputGroupTextProps | InputGroupTextAsChildProps,\n): JSX.Element {\n const { asChild, children, ref, class: className, ...rest } = props;\n const finalProps = mergeProps(rest, {\n class: classes(\"input-group-text\", className),\n ref,\n \"data-slot\": \"input-group-text\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return
|
|
1
|
+
{"version":3,"file":"input-group.js","names":[],"sources":["../../../src/components/input-group/input-group.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"@askrjs/askr/foundations/utilities\";\nimport { classes } from \"../_internal/classes\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type {\n InputGroupProps,\n InputGroupTextAsChildProps,\n InputGroupTextProps,\n} from \"./input-group.types\";\n\nexport function InputGroup(props: InputGroupProps): JSX.Element {\n const {\n attached = true,\n children,\n class: className,\n orientation = \"horizontal\",\n ref,\n role,\n ...rest\n } = props;\n\n return (\n <div\n {...rest}\n ref={ref}\n class={classes(\n \"input-group\",\n orientation === \"vertical\" ? \"input-group-vertical\" : undefined,\n className,\n )}\n data-attached={attached ? \"true\" : \"false\"}\n data-orientation={orientation}\n data-slot=\"input-group\"\n role={(role ?? \"group\") as string}\n >\n {children}\n </div>\n );\n}\n\nexport function InputGroupText(props: InputGroupTextProps): JSX.Element;\nexport function InputGroupText(props: InputGroupTextAsChildProps): JSX.Element;\nexport function InputGroupText(\n props: InputGroupTextProps | InputGroupTextAsChildProps,\n): JSX.Element {\n const { asChild, children, ref, class: className, ...rest } = props;\n const finalProps = mergeProps(rest, {\n class: classes(\"input-group-text\", className),\n ref,\n \"data-slot\": \"input-group-text\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"span\", finalProps, children);\n}\n"],"mappings":";;;;;;AAUA,SAAgB,WAAW,OAAqC;CAC9D,MAAM,EACJ,WAAW,MACX,UACA,OAAO,WACP,cAAc,cACd,KACA,MACA,GAAG,SACD;CAEJ,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,OAAO,QACL,eACA,gBAAgB,aAAa,yBAAyB,KAAA,GACtD,SACF;EACA,iBAAe,WAAW,SAAS;EACnC,oBAAkB;EAClB,aAAU;EACV,MAAO,QAAQ;EAEd;CACE,CAAA;AAET;AAIA,SAAgB,eACd,OACa;CACb,MAAM,EAAE,SAAS,UAAU,KAAK,OAAO,WAAW,GAAG,SAAS;CAC9D,MAAM,aAAa,WAAW,MAAM;EAClC,OAAO,QAAQ,oBAAoB,SAAS;EAC5C;EACA,aAAa;CACf,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAAW,CAAA;CAG5D,OAAO,iBAAiB,QAAQ,YAAY,QAAQ;AACtD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSXElement } from "@askrjs/askr/foundations";
|
|
2
2
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
|
-
|
|
4
3
|
//#region src/components/input-group/input-group.types.d.ts
|
|
5
4
|
type InputGroupOrientation = "horizontal" | "vertical";
|
|
6
5
|
type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
|
|
@@ -22,5 +21,4 @@ type InputGroupTextAsChildProps = SpanProps & {
|
|
|
22
21
|
ref?: Ref<unknown>;
|
|
23
22
|
};
|
|
24
23
|
//#endregion
|
|
25
|
-
export { InputGroupOrientation, InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps };
|
|
26
|
-
//# sourceMappingURL=input-group.types.d.ts.map
|
|
24
|
+
export { InputGroupOrientation, InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockElementProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
//#region src/components/main/main.types.d.ts
|
|
3
4
|
type MainProps = Omit<BlockElementProps<"main">, "as">;
|
|
4
5
|
//#endregion
|
|
5
|
-
export { MainProps };
|
|
6
|
-
//# sourceMappingURL=main.types.d.ts.map
|
|
6
|
+
export { MainProps };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { NavItemAsChildProps, NavItemProps, NavLinkProps, PillProps, PillsAsChildProps, PillsProps, TabProps, TabsAsChildProps, TabsProps } from "./nav.types.js";
|
|
2
|
-
import { NavItem, NavLink, Pill, Pills, Tab, Tabs } from "./nav.js";
|
|
2
|
+
import { NavItem, NavLink, Pill, Pills, Tab, Tabs } from "./nav.js";
|
|
3
|
+
export { NavItem, type NavItemAsChildProps, type NavItemProps, NavLink, type NavLinkProps, Pill, type PillProps, Pills, type PillsAsChildProps, type PillsProps, Tab, type TabProps, Tabs, type TabsAsChildProps, type TabsProps };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NavItemAsChildProps, NavItemProps, NavLinkProps, PillProps, PillsAsChildProps, PillsProps, TabProps, TabsAsChildProps, TabsProps } from "./nav.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/nav/nav.d.ts
|
|
4
3
|
declare function Tabs(props: TabsProps): JSX.Element;
|
|
5
4
|
declare function Tabs(props: TabsAsChildProps): JSX.Element;
|
|
@@ -11,5 +10,4 @@ declare function NavItem(props: NavItemProps): JSX.Element;
|
|
|
11
10
|
declare function NavItem(props: NavItemAsChildProps): JSX.Element;
|
|
12
11
|
declare function NavLink(props: NavLinkProps): JSX.Element;
|
|
13
12
|
//#endregion
|
|
14
|
-
export { NavItem, NavLink, Pill, Pills, Tab, Tabs };
|
|
15
|
-
//# sourceMappingURL=nav.d.ts.map
|
|
13
|
+
export { NavItem, NavLink, Pill, Pills, Tab, Tabs };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { classes } from "../_internal/classes.js";
|
|
2
2
|
import { mergeProps } from "../_internal/merge-props.js";
|
|
3
|
+
import { intrinsicElement } from "../_internal/jsx.js";
|
|
3
4
|
import { Block } from "../block/block.js";
|
|
4
5
|
import { resolvePathname } from "../_internal/pathname.js";
|
|
5
6
|
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
6
7
|
import { Slot } from "@askrjs/askr/foundations";
|
|
7
8
|
import { Link, currentRoute, navigate } from "@askrjs/askr/router";
|
|
8
9
|
//#region src/components/nav/nav.tsx
|
|
10
|
+
const LayoutBlock = Block;
|
|
9
11
|
function normalizePathname(pathname) {
|
|
10
12
|
return pathname.endsWith("/") && pathname !== "/" ? pathname.slice(0, -1) : pathname;
|
|
11
13
|
}
|
|
@@ -42,13 +44,12 @@ function renderNavSet(props, slot) {
|
|
|
42
44
|
...finalProps,
|
|
43
45
|
children
|
|
44
46
|
});
|
|
45
|
-
return
|
|
46
|
-
...finalProps,
|
|
47
|
-
children
|
|
48
|
-
});
|
|
47
|
+
return intrinsicElement("nav", finalProps, children);
|
|
49
48
|
}
|
|
50
49
|
function renderRoutedLink(props, slot, options = {}) {
|
|
51
|
-
const { active, children, href, onClick, ref, class: className, match = "prefix", target, ...rest } = props;
|
|
50
|
+
const { active, children, href: suppliedHref, to, onClick, ref, class: className, match = "prefix", target, ...rest } = props;
|
|
51
|
+
const href = to?.href ?? suppliedHref;
|
|
52
|
+
if (!href) throw new Error("Nav link requires href or to.");
|
|
52
53
|
const resolvedSlot = (options.inheritSlot && typeof rest["data-slot"] === "string" ? String(rest["data-slot"]) : void 0) ?? slot;
|
|
53
54
|
const inheritedNavClass = slot === "nav-item" && resolvedSlot !== "nav-item" ? "nav-item" : void 0;
|
|
54
55
|
const { "data-slot": _dataSlot, ...childRest } = rest;
|
|
@@ -60,8 +61,12 @@ function renderRoutedLink(props, slot, options = {}) {
|
|
|
60
61
|
"aria-current": "page",
|
|
61
62
|
"data-active": "true"
|
|
62
63
|
} : { "data-active": void 0 };
|
|
63
|
-
const
|
|
64
|
-
const childProps = {
|
|
64
|
+
const rendersRouterLink = targetPathname !== null && !target && typeof onClick !== "function";
|
|
65
|
+
const childProps = to ? {
|
|
66
|
+
...childRest,
|
|
67
|
+
to,
|
|
68
|
+
target
|
|
69
|
+
} : {
|
|
65
70
|
...childRest,
|
|
66
71
|
href,
|
|
67
72
|
target
|
|
@@ -72,21 +77,23 @@ function renderRoutedLink(props, slot, options = {}) {
|
|
|
72
77
|
event.preventDefault();
|
|
73
78
|
navigate(href);
|
|
74
79
|
};
|
|
75
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
+
return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
76
81
|
asChild: true,
|
|
77
82
|
paddingX: "sm",
|
|
78
83
|
paddingY: "xs",
|
|
79
84
|
radius: resolvedSlot === "pill" ? "round" : "md",
|
|
80
85
|
background: isActive && options.activeBackground ? "selected" : void 0,
|
|
81
86
|
ref,
|
|
82
|
-
|
|
87
|
+
className: classes(options.className, inheritedNavClass, className),
|
|
83
88
|
"data-slot": resolvedSlot,
|
|
84
89
|
...activeProps,
|
|
85
|
-
children:
|
|
90
|
+
children: rendersRouterLink ? /* @__PURE__ */ jsx(Link, {
|
|
86
91
|
...childProps,
|
|
87
92
|
children
|
|
88
93
|
}) : /* @__PURE__ */ jsx("a", {
|
|
89
|
-
...
|
|
94
|
+
...childRest,
|
|
95
|
+
href,
|
|
96
|
+
target,
|
|
90
97
|
onClick: handleClick,
|
|
91
98
|
children
|
|
92
99
|
})
|
|
@@ -109,7 +116,7 @@ function Pill(props) {
|
|
|
109
116
|
}
|
|
110
117
|
function NavItem(props) {
|
|
111
118
|
const { asChild, active = false, children, ref, class: className, match: _match, ...rest } = props;
|
|
112
|
-
if (asChild) return /* @__PURE__ */ jsx(
|
|
119
|
+
if (asChild) return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
113
120
|
asChild: true,
|
|
114
121
|
paddingX: "sm",
|
|
115
122
|
paddingY: "xs",
|
|
@@ -117,12 +124,12 @@ function NavItem(props) {
|
|
|
117
124
|
background: active ? "selected" : void 0,
|
|
118
125
|
...rest,
|
|
119
126
|
ref,
|
|
120
|
-
|
|
127
|
+
className,
|
|
121
128
|
"data-active": active ? "true" : void 0,
|
|
122
129
|
"data-slot": "nav-item",
|
|
123
130
|
children
|
|
124
131
|
});
|
|
125
|
-
return /* @__PURE__ */ jsx(
|
|
132
|
+
return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
126
133
|
as: "a",
|
|
127
134
|
paddingX: "sm",
|
|
128
135
|
paddingY: "xs",
|
|
@@ -130,7 +137,7 @@ function NavItem(props) {
|
|
|
130
137
|
background: active ? "selected" : void 0,
|
|
131
138
|
...rest,
|
|
132
139
|
ref,
|
|
133
|
-
|
|
140
|
+
className,
|
|
134
141
|
"data-active": active ? "true" : void 0,
|
|
135
142
|
"data-slot": "nav-item",
|
|
136
143
|
children
|
|
@@ -144,5 +151,3 @@ function NavLink(props) {
|
|
|
144
151
|
}
|
|
145
152
|
//#endregion
|
|
146
153
|
export { NavItem, NavLink, Pill, Pills, Tab, Tabs };
|
|
147
|
-
|
|
148
|
-
//# sourceMappingURL=nav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav.js","names":[],"sources":["../../../src/components/nav/nav.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { currentRoute, Link, navigate } from \"@askrjs/askr/router\";\nimport { Block } from \"../block\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { resolvePathname } from \"../_internal/pathname\";\nimport type {\n NavItemAsChildProps,\n NavItemProps,\n NavLinkProps,\n PillProps,\n PillsAsChildProps,\n PillsProps,\n TabProps,\n TabsAsChildProps,\n TabsProps,\n} from \"./nav.types\";\n\nfunction normalizePathname(pathname: string): string {\n return pathname.endsWith(\"/\") && pathname !== \"/\" ? pathname.slice(0, -1) : pathname;\n}\n\nfunction getCurrentPathname(): string | null {\n if (typeof window === \"undefined\") {\n return null;\n }\n\n return normalizePathname(window.location.pathname || \"/\");\n}\n\nfunction getReactiveCurrentPathname(): string | null {\n try {\n return normalizePathname(currentRoute().path || \"/\");\n } catch {\n return getCurrentPathname();\n }\n}\n\nfunction isActiveNavLink(\n currentPathname: string,\n targetPathname: string,\n match: NavLinkProps[\"match\"] = \"prefix\",\n): boolean {\n if (targetPathname === \"/\") {\n return currentPathname === \"/\";\n }\n\n if (match === \"exact\") {\n return currentPathname === targetPathname;\n }\n\n return currentPathname === targetPathname || currentPathname.startsWith(`${targetPathname}/`);\n}\n\nfunction shouldHandleClientNavigation(\n event: MouseEvent,\n target: string | undefined,\n targetPathname: string | null,\n): boolean {\n if (targetPathname === null || target) {\n return false;\n }\n\n return (\n !event.defaultPrevented &&\n (event.button ?? 0) === 0 &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.shiftKey\n );\n}\n\nfunction renderNavSet(\n props: TabsProps | TabsAsChildProps | PillsProps | PillsAsChildProps,\n slot: \"tabs\" | \"pills\",\n): JSX.Element {\n const className = \"class\" in props ? props.class : undefined;\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(slot, className),\n \"data-slot\": slot,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return <nav {...finalProps}>{children}</nav>;\n}\n\nfunction renderRoutedLink(\n props: NavLinkProps | TabProps | PillProps,\n slot: \"nav-item\" | \"tab\" | \"pill\",\n options: { activeBackground?: boolean; className?: string; inheritSlot?: boolean } = {},\n): JSX.Element {\n const {\n active,\n children,\n href,\n onClick,\n ref,\n class: className,\n match = \"prefix\",\n target,\n ...rest\n } = props as NavLinkProps & { onClick?: (event: MouseEvent) => void };\n const inheritedSlot =\n options.inheritSlot && typeof (rest as Record<string, unknown>)[\"data-slot\"] === \"string\"\n ? String((rest as Record<string, unknown>)[\"data-slot\"])\n : undefined;\n const resolvedSlot = (inheritedSlot ?? slot) as \"nav-item\" | \"tab\" | \"pill\";\n const inheritedNavClass =\n slot === \"nav-item\" && resolvedSlot !== \"nav-item\" ? \"nav-item\" : undefined;\n const { \"data-slot\": _dataSlot, ...childRest } = rest as Record<string, unknown>;\n void _dataSlot;\n const currentPathname = getReactiveCurrentPathname();\n const targetPathname = resolvePathname(href);\n const routeActive =\n currentPathname !== null &&\n targetPathname !== null &&\n isActiveNavLink(currentPathname, targetPathname, match);\n const isActive = active ?? routeActive;\n const activeProps = isActive\n ? {\n \"aria-current\": \"page\" as const,\n \"data-active\": \"true\" as const,\n }\n : {\n \"data-active\": undefined,\n };\n const useRouterLink = targetPathname !== null && !target && typeof onClick !== \"function\";\n const childProps = {\n ...childRest,\n href,\n target,\n };\n const handleClick = (event: MouseEvent) => {\n onClick?.(event);\n\n if (!shouldHandleClientNavigation(event, target, targetPathname)) {\n return;\n }\n\n event.preventDefault();\n navigate(href);\n };\n\n return (\n <Block\n asChild\n paddingX=\"sm\"\n paddingY=\"xs\"\n radius={resolvedSlot === \"pill\" ? \"round\" : \"md\"}\n background={isActive && options.activeBackground ? \"selected\" : undefined}\n ref={ref}\n class={classes(options.className, inheritedNavClass, className)}\n data-slot={resolvedSlot}\n {...activeProps}\n >\n {useRouterLink ? (\n <Link {...childProps}>{children}</Link>\n ) : (\n <a {...childProps} onClick={handleClick}>\n {children}\n </a>\n )}\n </Block>\n );\n}\n\nexport function Tabs(props: TabsProps): JSX.Element;\nexport function Tabs(props: TabsAsChildProps): JSX.Element;\nexport function Tabs(props: TabsProps | TabsAsChildProps): JSX.Element {\n return renderNavSet(props, \"tabs\");\n}\n\nexport function Pills(props: PillsProps): JSX.Element;\nexport function Pills(props: PillsAsChildProps): JSX.Element;\nexport function Pills(props: PillsProps | PillsAsChildProps): JSX.Element {\n return renderNavSet(props, \"pills\");\n}\n\nexport function Tab(props: TabProps): JSX.Element {\n return renderRoutedLink(props, \"tab\", { className: \"tab\" });\n}\n\nexport function Pill(props: PillProps): JSX.Element {\n return renderRoutedLink(props, \"pill\", { activeBackground: true, className: \"pill\" });\n}\n\nexport function NavItem(props: NavItemProps): JSX.Element;\nexport function NavItem(props: NavItemAsChildProps): JSX.Element;\nexport function NavItem(props: NavItemProps | NavItemAsChildProps): JSX.Element {\n const {\n asChild,\n active = false,\n children,\n ref,\n class: className,\n match: _match,\n ...rest\n } = props as (NavItemProps | NavItemAsChildProps) & { match?: unknown };\n void _match;\n\n if (asChild) {\n return (\n <Block\n asChild\n paddingX=\"sm\"\n paddingY=\"xs\"\n radius=\"md\"\n background={active ? \"selected\" : undefined}\n {...rest}\n ref={ref}\n class={className}\n data-active={active ? \"true\" : undefined}\n data-slot=\"nav-item\"\n >\n {children}\n </Block>\n );\n }\n\n return (\n <Block\n as=\"a\"\n paddingX=\"sm\"\n paddingY=\"xs\"\n radius=\"md\"\n background={active ? \"selected\" : undefined}\n {...rest}\n ref={ref}\n class={className}\n data-active={active ? \"true\" : undefined}\n data-slot=\"nav-item\"\n >\n {children}\n </Block>\n );\n}\n\nexport function NavLink(props: NavLinkProps): JSX.Element {\n return renderRoutedLink(props, \"nav-item\", { activeBackground: true, inheritSlot: true });\n}\n"],"mappings":";;;;;;;;AAkBA,SAAS,kBAAkB,UAA0B;CACnD,OAAO,SAAS,SAAS,GAAG,KAAK,aAAa,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;AAC9E;AAEA,SAAS,qBAAoC;CAC3C,IAAI,OAAO,WAAW,aACpB,OAAO;CAGT,OAAO,kBAAkB,OAAO,SAAS,YAAY,GAAG;AAC1D;AAEA,SAAS,6BAA4C;CACnD,IAAI;EACF,OAAO,kBAAkB,aAAa,CAAC,CAAC,QAAQ,GAAG;CACrD,QAAQ;EACN,OAAO,mBAAmB;CAC5B;AACF;AAEA,SAAS,gBACP,iBACA,gBACA,QAA+B,UACtB;CACT,IAAI,mBAAmB,KACrB,OAAO,oBAAoB;CAG7B,IAAI,UAAU,SACZ,OAAO,oBAAoB;CAG7B,OAAO,oBAAoB,kBAAkB,gBAAgB,WAAW,GAAG,eAAe,EAAE;AAC9F;AAEA,SAAS,6BACP,OACA,QACA,gBACS;CACT,IAAI,mBAAmB,QAAQ,QAC7B,OAAO;CAGT,OACE,CAAC,MAAM,qBACN,MAAM,UAAU,OAAO,KACxB,CAAC,MAAM,UACP,CAAC,MAAM,WACP,CAAC,MAAM,WACP,CAAC,MAAM;AAEX;AAEA,SAAS,aACP,OACA,MACa;CACb,MAAM,YAAY,WAAW,QAAQ,MAAM,QAAQ,KAAA;CACnD,MAAM,EAAE,SAAS,UAAU,KAAK,GAAG,SAAS;CAC5C,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,MAAM,SAAS;EAC9B,aAAa;CACf,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAA0B,CAAA;CAG3E,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAa;CAAc,CAAA;AAC7C;AAEA,SAAS,iBACP,OACA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OAAoD;CACxE,OAAO,aAAa,OAAO,OAAO;AACpC;AAEA,SAAgB,IAAI,OAA8B;CAChD,OAAO,iBAAiB,OAAO,OAAO,EAAE,WAAW,MAAM,CAAC;AAC5D;AAEA,SAAgB,KAAK,OAA+B;CAClD,OAAO,iBAAiB,OAAO,QAAQ;EAAE,kBAAkB;EAAM,WAAW;CAAO,CAAC;AACtF;AAIA,SAAgB,QAAQ,OAAwD;CAC9E,MAAM,EACJ,SACA,SAAS,OACT,UACA,KACA,OAAO,WACP,OAAO,QACP,GAAG,SACD;CAGJ,IAAI,SACF,OACE,oBAAC,OAAD;EACE,SAAA;EACA,UAAS;EACT,UAAS;EACT,QAAO;EACP,YAAY,SAAS,aAAa,KAAA;EAClC,GAAI;EACC;EACL,OAAO;EACP,eAAa,SAAS,SAAS,KAAA;EAC/B,aAAU;EAET;CACI,CAAA;CAIX,OACE,oBAAC,OAAD;EACE,IAAG;EACH,UAAS;EACT,UAAS;EACT,QAAO;EACP,YAAY,SAAS,aAAa,KAAA;EAClC,GAAI;EACC;EACL,OAAO;EACP,eAAa,SAAS,SAAS,KAAA;EAC/B,aAAU;EAET;CACI,CAAA;AAEX;AAEA,SAAgB,QAAQ,OAAkC;CACxD,OAAO,iBAAiB,OAAO,YAAY;EAAE,kBAAkB;EAAM,aAAa;CAAK,CAAC;AAC1F"}
|
|
1
|
+
{"version":3,"file":"nav.js","names":[],"sources":["../../../src/components/nav/nav.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { currentRoute, Link, navigate } from \"@askrjs/askr/router\";\nimport { Block } from \"../block\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport { resolvePathname } from \"../_internal/pathname\";\nimport type {\n NavItemAsChildProps,\n NavItemProps,\n NavLinkProps,\n PillProps,\n PillsAsChildProps,\n PillsProps,\n TabProps,\n TabsAsChildProps,\n TabsProps,\n} from \"./nav.types\";\n\nconst LayoutBlock = Block as (props: Record<string, unknown>) => JSX.Element;\n\nfunction normalizePathname(pathname: string): string {\n return pathname.endsWith(\"/\") && pathname !== \"/\" ? pathname.slice(0, -1) : pathname;\n}\n\nfunction getCurrentPathname(): string | null {\n if (typeof window === \"undefined\") {\n return null;\n }\n\n return normalizePathname(window.location.pathname || \"/\");\n}\n\nfunction getReactiveCurrentPathname(): string | null {\n try {\n return normalizePathname(currentRoute().path || \"/\");\n } catch {\n return getCurrentPathname();\n }\n}\n\nfunction isActiveNavLink(\n currentPathname: string,\n targetPathname: string,\n match: NavLinkProps[\"match\"] = \"prefix\",\n): boolean {\n if (targetPathname === \"/\") {\n return currentPathname === \"/\";\n }\n\n if (match === \"exact\") {\n return currentPathname === targetPathname;\n }\n\n return currentPathname === targetPathname || currentPathname.startsWith(`${targetPathname}/`);\n}\n\nfunction shouldHandleClientNavigation(\n event: MouseEvent,\n target: string | undefined,\n targetPathname: string | null,\n): boolean {\n if (targetPathname === null || target) {\n return false;\n }\n\n return (\n !event.defaultPrevented &&\n (event.button ?? 0) === 0 &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.shiftKey\n );\n}\n\nfunction renderNavSet(\n props: TabsProps | TabsAsChildProps | PillsProps | PillsAsChildProps,\n slot: \"tabs\" | \"pills\",\n): JSX.Element {\n const className = \"class\" in props ? props.class : undefined;\n const { asChild, children, ref, ...rest } = props;\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(slot, className),\n \"data-slot\": slot,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return intrinsicElement(\"nav\", finalProps, children);\n}\n\nfunction renderRoutedLink(\n props: NavLinkProps | TabProps | PillProps,\n slot: \"nav-item\" | \"tab\" | \"pill\",\n options: { activeBackground?: boolean; className?: string; inheritSlot?: boolean } = {},\n): JSX.Element {\n const {\n active,\n children,\n href: suppliedHref,\n to,\n onClick,\n ref,\n class: className,\n match = \"prefix\",\n target,\n ...rest\n } = props as NavLinkProps & { onClick?: (event: MouseEvent) => void };\n const href = to?.href ?? suppliedHref;\n if (!href) {\n throw new Error(\"Nav link requires href or to.\");\n }\n const inheritedSlot =\n options.inheritSlot && typeof (rest as Record<string, unknown>)[\"data-slot\"] === \"string\"\n ? String((rest as Record<string, unknown>)[\"data-slot\"])\n : undefined;\n const resolvedSlot = (inheritedSlot ?? slot) as \"nav-item\" | \"tab\" | \"pill\";\n const inheritedNavClass =\n slot === \"nav-item\" && resolvedSlot !== \"nav-item\" ? \"nav-item\" : undefined;\n const { \"data-slot\": _dataSlot, ...childRest } = rest as Record<string, unknown>;\n void _dataSlot;\n const currentPathname = getReactiveCurrentPathname();\n const targetPathname = resolvePathname(href);\n const routeActive =\n currentPathname !== null &&\n targetPathname !== null &&\n isActiveNavLink(currentPathname, targetPathname, match);\n const isActive = active ?? routeActive;\n const activeProps = isActive\n ? {\n \"aria-current\": \"page\" as const,\n \"data-active\": \"true\" as const,\n }\n : {\n \"data-active\": undefined,\n };\n const rendersRouterLink = targetPathname !== null && !target && typeof onClick !== \"function\";\n const childProps: NavLinkProps = to\n ? ({ ...childRest, to, target } as NavLinkProps)\n : ({ ...childRest, href, target } as NavLinkProps);\n const handleClick = (event: MouseEvent) => {\n onClick?.(event);\n\n if (!shouldHandleClientNavigation(event, target, targetPathname)) {\n return;\n }\n\n event.preventDefault();\n navigate(href);\n };\n\n return (\n <LayoutBlock\n asChild\n paddingX=\"sm\"\n paddingY=\"xs\"\n radius={resolvedSlot === \"pill\" ? \"round\" : \"md\"}\n background={isActive && options.activeBackground ? \"selected\" : undefined}\n ref={ref}\n className={classes(options.className, inheritedNavClass, className)}\n data-slot={resolvedSlot}\n {...activeProps}\n >\n {rendersRouterLink ? (\n <Link {...childProps}>{children}</Link>\n ) : (\n <a {...childRest} href={href} target={target} onClick={handleClick}>\n {children}\n </a>\n )}\n </LayoutBlock>\n );\n}\n\nexport function Tabs(props: TabsProps): JSX.Element;\nexport function Tabs(props: TabsAsChildProps): JSX.Element;\nexport function Tabs(props: TabsProps | TabsAsChildProps): JSX.Element {\n return renderNavSet(props, \"tabs\");\n}\n\nexport function Pills(props: PillsProps): JSX.Element;\nexport function Pills(props: PillsAsChildProps): JSX.Element;\nexport function Pills(props: PillsProps | PillsAsChildProps): JSX.Element {\n return renderNavSet(props, \"pills\");\n}\n\nexport function Tab(props: TabProps): JSX.Element {\n return renderRoutedLink(props, \"tab\", { className: \"tab\" });\n}\n\nexport function Pill(props: PillProps): JSX.Element {\n return renderRoutedLink(props, \"pill\", { activeBackground: true, className: \"pill\" });\n}\n\nexport function NavItem(props: NavItemProps): JSX.Element;\nexport function NavItem(props: NavItemAsChildProps): JSX.Element;\nexport function NavItem(props: NavItemProps | NavItemAsChildProps): JSX.Element {\n const {\n asChild,\n active = false,\n children,\n ref,\n class: className,\n match: _match,\n ...rest\n } = props as (NavItemProps | NavItemAsChildProps) & { match?: unknown };\n void _match;\n\n if (asChild) {\n return (\n <LayoutBlock\n asChild\n paddingX=\"sm\"\n paddingY=\"xs\"\n radius=\"md\"\n background={active ? \"selected\" : undefined}\n {...rest}\n ref={ref}\n className={className}\n data-active={active ? \"true\" : undefined}\n data-slot=\"nav-item\"\n >\n {children}\n </LayoutBlock>\n );\n }\n\n return (\n <LayoutBlock\n as=\"a\"\n paddingX=\"sm\"\n paddingY=\"xs\"\n radius=\"md\"\n background={active ? \"selected\" : undefined}\n {...rest}\n ref={ref}\n className={className}\n data-active={active ? \"true\" : undefined}\n data-slot=\"nav-item\"\n >\n {children}\n </LayoutBlock>\n );\n}\n\nexport function NavLink(props: NavLinkProps): JSX.Element {\n return renderRoutedLink(props, \"nav-item\", { activeBackground: true, inheritSlot: true });\n}\n"],"mappings":";;;;;;;;;AAmBA,MAAM,cAAc;AAEpB,SAAS,kBAAkB,UAA0B;CACnD,OAAO,SAAS,SAAS,GAAG,KAAK,aAAa,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;AAC9E;AAEA,SAAS,qBAA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AE,WAAW,MAAM,CAAC;AAC5D;AAEA,SAAgB,KAAK,OAA+B;CAClD,OAAO,iBAAiB,OAAO,QAAQ;EAAE,kBAAkB;EAAM,WAAW;CAAO,CAAC;AACtF;AAIA,SAAgB,QAAQ,OAAwD;CAC9E,MAAM,EACJ,SACA,SAAS,OACT,UACA,KACA,OAAO,WACP,OAAO,QACP,GAAG,SACD;CAGJ,IAAI,SACF,OACE,oBAAC,aAAD;EACE,SAAA;EACA,UAAS;EACT,UAAS;EACT,QAAO;EACP,YAAY,SAAS,aAAa,KAAA;EAClC,GAAI;EACC;EACM;EACX,eAAa,SAAS,SAAS,KAAA;EAC/B,aAAU;EAET;CACU,CAAA;CAIjB,OACE,oBAAC,aAAD;EACE,IAAG;EACH,UAAS;EACT,UAAS;EACT,QAAO;EACP,YAAY,SAAS,aAAa,KAAA;EAClC,GAAI;EACC;EACM;EACX,eAAa,SAAS,SAAS,KAAA;EAC/B,aAAU;EAET;CACU,CAAA;AAEjB;AAEA,SAAgB,QAAQ,OAAkC;CACxD,OAAO,iBAAiB,OAAO,YAAY;EAAE,kBAAkB;EAAM,aAAa;CAAK,CAAC;AAC1F"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { JSXElement } from "@askrjs/askr/foundations";
|
|
2
2
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
3
3
|
import { LinkProps } from "@askrjs/askr/router";
|
|
4
|
-
|
|
5
4
|
//#region src/components/nav/nav.types.d.ts
|
|
6
5
|
type NavLinkMatch = "prefix" | "exact";
|
|
7
6
|
type TabsOwnProps = {
|
|
@@ -48,5 +47,4 @@ type NavLinkProps = LinkProps & NavLinkOwnProps;
|
|
|
48
47
|
type TabProps = LinkProps & NavLinkOwnProps;
|
|
49
48
|
type PillProps = LinkProps & NavLinkOwnProps;
|
|
50
49
|
//#endregion
|
|
51
|
-
export { NavItemAsChildProps, NavItemProps, NavLinkProps, PillProps, PillsAsChildProps, PillsProps, TabProps, TabsAsChildProps, TabsProps };
|
|
52
|
-
//# sourceMappingURL=nav.types.d.ts.map
|
|
50
|
+
export { NavItemAsChildProps, NavItemOwnProps, NavItemProps, NavLinkMatch, NavLinkOwnProps, NavLinkProps, PillProps, PillsAsChildProps, PillsOwnProps, PillsProps, TabProps, TabsAsChildProps, TabsOwnProps, TabsProps };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarCollapseBreakpoint, NavbarProps } from "./navbar.types.js";
|
|
2
2
|
import { NavBrand, NavDropdown, NavGroup, Navbar } from "./navbar.js";
|
|
3
3
|
import { NavItemAsChildProps, NavItemProps, NavLinkProps } from "../nav/nav.types.js";
|
|
4
|
-
import { NavItem, NavLink } from "../nav/nav.js";
|
|
4
|
+
import { NavItem, NavLink } from "../nav/nav.js";
|
|
5
|
+
import "../nav/index.js";
|
|
6
|
+
export { NavBrand, type NavBrandProps, NavDropdown, type NavDropdownProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, NavLink, type NavLinkProps, Navbar, type NavbarCollapseBreakpoint, type NavbarProps };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarProps } from "./navbar.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/navbar/navbar.d.ts
|
|
4
3
|
declare function Navbar(props: NavbarProps): JSX.Element;
|
|
5
4
|
declare function NavBrand(props: NavBrandProps): JSX.Element;
|
|
6
5
|
declare function NavGroup(props: NavGroupProps): JSX.Element;
|
|
7
6
|
declare function NavDropdown(props: NavDropdownProps): JSX.Element;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { NavBrand, NavDropdown, NavGroup, Navbar };
|
|
10
|
-
//# sourceMappingURL=navbar.d.ts.map
|
|
8
|
+
export { NavBrand, NavDropdown, NavGroup, Navbar };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { classes } from "../_internal/classes.js";
|
|
2
|
+
import { isJsxElement, toChildArray } from "../_internal/jsx.js";
|
|
2
3
|
import { Block } from "../block/block.js";
|
|
3
4
|
import { DropdownContent as DropdownContent$1 } from "../overlays/dropdown-content.js";
|
|
4
|
-
import { isJsxElement, toChildArray } from "../_internal/jsx.js";
|
|
5
5
|
import { Dropdown, DropdownTrigger } from "@askrjs/ui";
|
|
6
6
|
import { jsx, jsxs } from "@askrjs/askr/jsx-runtime";
|
|
7
7
|
//#region src/components/navbar/navbar.tsx
|
|
8
8
|
const ASKR_FRAGMENT = Symbol.for("askr.fragment");
|
|
9
|
+
const LayoutBlock = Block;
|
|
9
10
|
function flattenNavbarChildren(children) {
|
|
10
11
|
return toChildArray(children).flatMap((child) => {
|
|
11
12
|
if (isJsxElement(child) && child.type === ASKR_FRAGMENT) return flattenNavbarChildren(child.props?.children);
|
|
@@ -23,7 +24,7 @@ function hasRenderableChildren(children) {
|
|
|
23
24
|
}
|
|
24
25
|
function Navbar(props) {
|
|
25
26
|
const { breakpoint, children, collapseAt = breakpoint ?? false, collapseIcon, collapseLabel = "Menu", ...rest } = props;
|
|
26
|
-
if (!collapseAt) return /* @__PURE__ */ jsx(
|
|
27
|
+
if (!collapseAt) return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
27
28
|
as: "nav",
|
|
28
29
|
direction: "row",
|
|
29
30
|
align: "center",
|
|
@@ -45,7 +46,7 @@ function Navbar(props) {
|
|
|
45
46
|
"data-slot": "navbar-toggle-label",
|
|
46
47
|
children: collapseLabel
|
|
47
48
|
})]
|
|
48
|
-
}), /* @__PURE__ */ jsx(
|
|
49
|
+
}), /* @__PURE__ */ jsx(LayoutBlock, {
|
|
49
50
|
direction: "row",
|
|
50
51
|
align: "center",
|
|
51
52
|
gap: "md",
|
|
@@ -54,7 +55,7 @@ function Navbar(props) {
|
|
|
54
55
|
children: navChildren
|
|
55
56
|
})]
|
|
56
57
|
}) : null;
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
+
return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
58
59
|
as: "nav",
|
|
59
60
|
direction: "row",
|
|
60
61
|
align: "center",
|
|
@@ -68,7 +69,7 @@ function Navbar(props) {
|
|
|
68
69
|
}
|
|
69
70
|
function NavBrand(props) {
|
|
70
71
|
const { children, ...rest } = props;
|
|
71
|
-
return /* @__PURE__ */ jsx(
|
|
72
|
+
return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
72
73
|
direction: "row",
|
|
73
74
|
align: "center",
|
|
74
75
|
gap: "sm",
|
|
@@ -80,7 +81,7 @@ function NavBrand(props) {
|
|
|
80
81
|
}
|
|
81
82
|
function NavGroup(props) {
|
|
82
83
|
const { align, children, label, title = label, ...rest } = props;
|
|
83
|
-
return /* @__PURE__ */ jsxs(
|
|
84
|
+
return /* @__PURE__ */ jsxs(LayoutBlock, {
|
|
84
85
|
align,
|
|
85
86
|
gap: "sm",
|
|
86
87
|
...rest,
|
|
@@ -89,7 +90,7 @@ function NavGroup(props) {
|
|
|
89
90
|
children: [title !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
90
91
|
"data-slot": "nav-group-label",
|
|
91
92
|
children: title
|
|
92
|
-
}) : null, /* @__PURE__ */ jsx(
|
|
93
|
+
}) : null, /* @__PURE__ */ jsx(LayoutBlock, {
|
|
93
94
|
gap: "xs",
|
|
94
95
|
"data-slot": "nav-group-body",
|
|
95
96
|
children
|
|
@@ -98,7 +99,7 @@ function NavGroup(props) {
|
|
|
98
99
|
}
|
|
99
100
|
function NavDropdown(props) {
|
|
100
101
|
const { align = "end", children, label, side = "bottom", sideOffset = 6, ...rest } = props;
|
|
101
|
-
return /* @__PURE__ */ jsx(
|
|
102
|
+
return /* @__PURE__ */ jsx(LayoutBlock, {
|
|
102
103
|
direction: "row",
|
|
103
104
|
align: "center",
|
|
104
105
|
"data-slot": "nav-dropdown",
|
|
@@ -121,5 +122,3 @@ function NavDropdown(props) {
|
|
|
121
122
|
}
|
|
122
123
|
//#endregion
|
|
123
124
|
export { NavBrand, NavDropdown, NavGroup, Navbar };
|
|
124
|
-
|
|
125
|
-
//# sourceMappingURL=navbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.js","names":["DropdownContent"],"sources":["../../../src/components/navbar/navbar.tsx"],"sourcesContent":["import { Dropdown, DropdownTrigger } from \"@askrjs/ui\";\nimport { Block } from \"../block\";\nimport { classes } from \"../_internal/classes\";\nimport { isJsxElement, toChildArray } from \"../_internal/jsx\";\nimport { DropdownContent } from \"../overlays/dropdown-content\";\nimport type { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarProps } from \"./navbar.types\";\n\nconst ASKR_FRAGMENT = Symbol.for(\"askr.fragment\");\n\nfunction flattenNavbarChildren(children: unknown): unknown[] {\n return toChildArray(children).flatMap((child) => {\n if (isJsxElement(child) && child.type === ASKR_FRAGMENT) {\n return flattenNavbarChildren(child.props?.children);\n }\n\n return [child];\n });\n}\n\nfunction isNavBrandChild(child: unknown): boolean {\n return (\n isJsxElement(child) && (child.type === NavBrand || child.props?.[\"data-slot\"] === \"nav-brand\")\n );\n}\n\nfunction hasRenderableChildren(children: readonly unknown[]): boolean {\n return children.some((child) => {\n if (Array.isArray(child)) {\n return hasRenderableChildren(child);\n }\n\n return child !== undefined && child !== null && typeof child !== \"boolean\";\n });\n}\n\nexport function Navbar(props: NavbarProps): JSX.Element {\n const {\n breakpoint,\n children,\n collapseAt = breakpoint ?? false,\n collapseIcon,\n collapseLabel = \"Menu\",\n ...rest\n } = props;\n\n if (!collapseAt) {\n return (\n <
|
|
1
|
+
{"version":3,"file":"navbar.js","names":["DropdownContent"],"sources":["../../../src/components/navbar/navbar.tsx"],"sourcesContent":["import { Dropdown, DropdownTrigger } from \"@askrjs/ui\";\nimport { Block } from \"../block\";\nimport { classes } from \"../_internal/classes\";\nimport { isJsxElement, toChildArray } from \"../_internal/jsx\";\nimport { DropdownContent } from \"../overlays/dropdown-content\";\nimport type { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarProps } from \"./navbar.types\";\n\nconst ASKR_FRAGMENT = Symbol.for(\"askr.fragment\");\nconst LayoutBlock = Block as (props: Record<string, unknown>) => JSX.Element;\n\nfunction flattenNavbarChildren(children: unknown): unknown[] {\n return toChildArray(children).flatMap((child) => {\n if (isJsxElement(child) && child.type === ASKR_FRAGMENT) {\n return flattenNavbarChildren(child.props?.children);\n }\n\n return [child];\n });\n}\n\nfunction isNavBrandChild(child: unknown): boolean {\n return (\n isJsxElement(child) && (child.type === NavBrand || child.props?.[\"data-slot\"] === \"nav-brand\")\n );\n}\n\nfunction hasRenderableChildren(children: readonly unknown[]): boolean {\n return children.some((child) => {\n if (Array.isArray(child)) {\n return hasRenderableChildren(child);\n }\n\n return child !== undefined && child !== null && typeof child !== \"boolean\";\n });\n}\n\nexport function Navbar(props: NavbarProps): JSX.Element {\n const {\n breakpoint,\n children,\n collapseAt = breakpoint ?? false,\n collapseIcon,\n collapseLabel = \"Menu\",\n ...rest\n } = props;\n\n if (!collapseAt) {\n return (\n <LayoutBlock\n as=\"nav\"\n direction=\"row\"\n align=\"center\"\n gap=\"md\"\n width=\"full\"\n {...rest}\n data-slot=\"navbar\"\n >\n {children}\n </LayoutBlock>\n );\n }\n\n const navbarChildren = flattenNavbarChildren(children);\n const brandChildren = navbarChildren.filter(isNavBrandChild);\n const navChildren = navbarChildren.filter((child) => !isNavBrandChild(child));\n const hasNavContent = hasRenderableChildren(navChildren);\n const content = (\n <LayoutBlock direction=\"row\" align=\"center\" gap=\"md\" width=\"full\" data-slot=\"navbar-content\">\n {navChildren}\n </LayoutBlock>\n );\n const collapse = hasNavContent ? (\n <details data-slot=\"navbar-collapse\">\n <summary aria-label={collapseLabel} data-slot=\"navbar-toggle\">\n {collapseIcon}\n <span data-slot=\"navbar-toggle-label\">{collapseLabel}</span>\n </summary>\n {content}\n </details>\n ) : null;\n\n return (\n <LayoutBlock\n as=\"nav\"\n direction=\"row\"\n align=\"center\"\n gap=\"md\"\n width=\"full\"\n {...rest}\n data-collapse-at={collapseAt}\n data-slot=\"navbar\"\n >\n {[...brandChildren, collapse]}\n </LayoutBlock>\n );\n}\n\nexport function NavBrand(props: NavBrandProps): JSX.Element {\n const { children, ...rest } = props;\n\n return (\n <LayoutBlock\n direction=\"row\"\n align=\"center\"\n gap=\"sm\"\n shrink={false}\n {...rest}\n data-slot=\"nav-brand\"\n >\n {children}\n </LayoutBlock>\n );\n}\n\nexport function NavGroup(props: NavGroupProps): JSX.Element {\n const { align, children, label, title = label, ...rest } = props;\n\n return (\n <LayoutBlock align={align} gap=\"sm\" {...rest} data-align={align} data-slot=\"nav-group\">\n {title !== undefined ? <div data-slot=\"nav-group-label\">{title}</div> : null}\n <LayoutBlock gap=\"xs\" data-slot=\"nav-group-body\">\n {children}\n </LayoutBlock>\n </LayoutBlock>\n );\n}\n\nexport function NavDropdown(props: NavDropdownProps): JSX.Element {\n const { align = \"end\", children, label, side = \"bottom\", sideOffset = 6, ...rest } = props;\n\n return (\n <LayoutBlock direction=\"row\" align=\"center\" data-slot=\"nav-dropdown\">\n <Dropdown {...rest}>\n <DropdownTrigger class={classes(\"nav-item\")} data-slot=\"nav-dropdown-trigger\">\n {label}\n </DropdownTrigger>\n <DropdownContent\n align={align}\n class={classes(\"dropdown-content\")}\n data-slot=\"nav-dropdown-content\"\n side={side}\n sideOffset={sideOffset}\n >\n {children}\n </DropdownContent>\n </Dropdown>\n </LayoutBlock>\n );\n}\n"],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,OAAO,IAAI,eAAe;AAChD,MAAM,cAAc;AAEpB,SAAS,sBAAsB,UAA8B;CAC3D,OAAO,aAAa,QAAQ,CAAC,CAAC,SAAS,UAAU;EAC/C,IAAI,aAAa,KAAK,KAAK,MAAM,SAAS,eACxC,OAAO,sBAAsB,MAAM,OAAO,QAAQ;EAGpD,OAAO,CAAC,KAAK;CACf,CAAC;AACH;AAEA,SAAS,gBAAgB,OAAyB;CAChD,OACE,aAAa,KAAK,MAAM,MAAM,SAAS,YAAY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AEjB;AAEA,SAAgB,SAAS,OAAmC;CAC1D,MAAM,EAAE,OAAO,UAAU,OAAO,QAAQ,OAAO,GAAG,SAAS;CAE3D,OACE,qBAAC,aAAD;EAAoB;EAAO,KAAI;EAAK,GAAI;EAAM,cAAY;EAAO,aAAU;YAA3E,CACG,UAAU,KAAA,IAAY,oBAAC,OAAD;GAAK,aAAU;aAAmB;EAAW,CAAA,IAAI,MACxE,oBAAC,aAAD;GAAa,KAAI;GAAK,aAAU;GAC7B;EACU,CAAA,CACF;;AAEjB;AAEA,SAAgB,YAAY,OAAsC;CAChE,MAAM,EAAE,QAAQ,OAAO,UAAU,OAAO,OAAO,UAAU,aAAa,GAAG,GAAG,SAAS;CAErF,OACE,oBAAC,aAAD;EAAa,WAAU;EAAM,OAAM;EAAS,aAAU;YACpD,qBAAC,UAAD;GAAU,GAAI;aAAd,CACE,oBAAC,iBAAD;IAAiB,OAAO,QAAQ,UAAU;IAAG,aAAU;cACpD;GACc,CAAA,GACjB,oBAACA,mBAAD;IACS;IACP,OAAO,QAAQ,kBAAkB;IACjC,aAAU;IACJ;IACM;IAEX;GACc,CAAA,CACT;;CACC,CAAA;AAEjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockAsChildProps, BlockDivProps, BlockElementProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
import { DropdownContentOwnProps, DropdownProps } from "@askrjs/ui";
|
|
3
|
-
|
|
4
4
|
//#region src/components/navbar/navbar.types.d.ts
|
|
5
5
|
type NavbarCollapseBreakpoint = "sm" | "md" | "lg" | "xl";
|
|
6
6
|
type NavbarProps = Omit<BlockElementProps<"nav">, "as" | "direction" | "align"> & {
|
|
@@ -19,5 +19,4 @@ type NavDropdownProps = Omit<DropdownProps, "children"> & Pick<DropdownContentOw
|
|
|
19
19
|
children?: unknown;
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
|
-
export { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarCollapseBreakpoint, NavbarProps };
|
|
23
|
-
//# sourceMappingURL=navbar.types.d.ts.map
|
|
22
|
+
export { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarCollapseBreakpoint, NavbarProps };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DropdownContentAsChildProps, DropdownContentProps } from "@askrjs/ui";
|
|
2
|
-
|
|
3
2
|
//#region src/components/overlays/dropdown-content.d.ts
|
|
4
3
|
declare function DropdownContent$1(props: DropdownContentProps): JSX.Element | null;
|
|
5
4
|
declare function DropdownContent$1(props: DropdownContentAsChildProps): JSX.Element | null;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { DropdownContent$1 as DropdownContent };
|
|
8
|
-
//# sourceMappingURL=dropdown-content.d.ts.map
|
|
6
|
+
export { DropdownContent$1 as DropdownContent };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { PageHeaderProps } from "./page-header.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/page-header/page-header.d.ts
|
|
4
3
|
declare function PageHeader(props: PageHeaderProps): JSX.Element;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { PageHeader };
|
|
7
|
-
//# sourceMappingURL=page-header.d.ts.map
|
|
5
|
+
export { PageHeader };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BlockDivProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
//#region src/components/page-header/page-header.types.d.ts
|
|
3
4
|
type PageHeaderProps = BlockDivProps & {
|
|
4
5
|
title: unknown;
|
|
@@ -6,5 +7,4 @@ type PageHeaderProps = BlockDivProps & {
|
|
|
6
7
|
actions?: unknown;
|
|
7
8
|
};
|
|
8
9
|
//#endregion
|
|
9
|
-
export { PageHeaderProps };
|
|
10
|
-
//# sourceMappingURL=page-header.types.d.ts.map
|
|
10
|
+
export { PageHeaderProps };
|