@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,6 @@
|
|
|
1
1
|
import { BlockElementProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
//#region src/components/section/section.types.d.ts
|
|
3
4
|
type SectionProps = Omit<BlockElementProps<"section">, "as">;
|
|
4
5
|
//#endregion
|
|
5
|
-
export { SectionProps };
|
|
6
|
-
//# sourceMappingURL=section.types.d.ts.map
|
|
6
|
+
export { SectionProps };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { SeparatorAsChildProps, SeparatorNativeProps, SeparatorOwnProps, SeparatorProps } from "./separator.types.js";
|
|
2
|
-
import { Separator } from "./separator.js";
|
|
2
|
+
import { Separator } from "./separator.js";
|
|
3
|
+
export { Separator, type SeparatorAsChildProps, type SeparatorNativeProps, type SeparatorOwnProps, type SeparatorProps };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { SeparatorAsChildProps, SeparatorNativeProps } from "./separator.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/separator/separator.d.ts
|
|
4
3
|
declare function Separator(props: SeparatorNativeProps): JSX.Element;
|
|
5
4
|
declare function Separator(props: SeparatorAsChildProps): JSX.Element;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { Separator };
|
|
8
|
-
//# sourceMappingURL=separator.d.ts.map
|
|
6
|
+
export { Separator };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mergeProps } from "../_internal/merge-props.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
|
//#region src/components/separator/separator.tsx
|
|
@@ -16,12 +17,7 @@ function Separator(props) {
|
|
|
16
17
|
...finalProps,
|
|
17
18
|
children
|
|
18
19
|
});
|
|
19
|
-
return
|
|
20
|
-
...finalProps,
|
|
21
|
-
children
|
|
22
|
-
});
|
|
20
|
+
return intrinsicElement("div", finalProps, children);
|
|
23
21
|
}
|
|
24
22
|
//#endregion
|
|
25
23
|
export { Separator };
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=separator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/separator/separator.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type { SeparatorAsChildProps, SeparatorNativeProps } from \"./separator.types\";\n\nexport function Separator(props: SeparatorNativeProps): JSX.Element;\nexport function Separator(props: SeparatorAsChildProps): JSX.Element;\nexport function Separator(props: SeparatorNativeProps | SeparatorAsChildProps) {\n const { asChild, children, decorative = false, orientation = \"horizontal\", ref, ...rest } = props;\n\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"separator\",\n \"data-orientation\": orientation,\n role: decorative ? \"presentation\" : \"separator\",\n \"aria-orientation\": decorative ? undefined : orientation,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/separator/separator.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type { SeparatorAsChildProps, SeparatorNativeProps } from \"./separator.types\";\n\nexport function Separator(props: SeparatorNativeProps): JSX.Element;\nexport function Separator(props: SeparatorAsChildProps): JSX.Element;\nexport function Separator(props: SeparatorNativeProps | SeparatorAsChildProps) {\n const { asChild, children, decorative = false, orientation = \"horizontal\", ref, ...rest } = props;\n\n const finalProps = mergeProps(rest, {\n ref,\n \"data-slot\": \"separator\",\n \"data-orientation\": orientation,\n role: decorative ? \"presentation\" : \"separator\",\n \"aria-orientation\": decorative ? undefined : orientation,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"div\", finalProps, children);\n}\n"],"mappings":";;;;;AAOA,SAAgB,UAAU,OAAqD;CAC7E,MAAM,EAAE,SAAS,UAAU,aAAa,OAAO,cAAc,cAAc,KAAK,GAAG,SAAS;CAE5F,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,aAAa;EACb,oBAAoB;EACpB,MAAM,aAAa,iBAAiB;EACpC,oBAAoB,aAAa,KAAA,IAAY;CAC/C,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAAW,CAAA;CAG5D,OAAO,iBAAiB,OAAO,YAAY,QAAQ;AACrD"}
|
|
@@ -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/separator/separator.types.d.ts
|
|
5
4
|
type SeparatorOwnProps = {
|
|
6
5
|
decorative?: boolean;
|
|
@@ -18,5 +17,4 @@ type SeparatorAsChildProps = SeparatorOwnProps & {
|
|
|
18
17
|
};
|
|
19
18
|
type SeparatorProps = SeparatorNativeProps | SeparatorAsChildProps;
|
|
20
19
|
//#endregion
|
|
21
|
-
export { SeparatorAsChildProps, SeparatorNativeProps, SeparatorOwnProps, SeparatorProps };
|
|
22
|
-
//# sourceMappingURL=separator.types.d.ts.map
|
|
20
|
+
export { SeparatorAsChildProps, SeparatorNativeProps, SeparatorOwnProps, SeparatorProps };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { SidebarButtonProps, SidebarCollapsible, SidebarPartProps, SidebarProps, SidebarSide, SidebarTooltipSide, SidebarVariant } from "./sidebar.types.js";
|
|
2
|
-
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem,
|
|
2
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger } from "./sidebar.js";
|
|
3
|
+
export { Sidebar, type SidebarButtonProps, type SidebarCollapsible, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, type SidebarPartProps, type SidebarProps, SidebarRail, SidebarScope, type SidebarSide, type SidebarTooltipSide, SidebarTrigger, type SidebarVariant };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SidebarButtonProps, SidebarPartProps, SidebarProps } from "./sidebar.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/sidebar/sidebar.d.ts
|
|
4
3
|
declare function Sidebar(props: SidebarProps): JSX.Element;
|
|
5
|
-
declare function
|
|
4
|
+
declare function SidebarScope(props: SidebarPartProps): JSX.Element;
|
|
6
5
|
declare function SidebarInset(props: SidebarPartProps): JSX.Element;
|
|
7
6
|
declare function SidebarContent(props: SidebarPartProps): JSX.Element;
|
|
8
7
|
declare function SidebarHeader(props: SidebarPartProps): JSX.Element;
|
|
@@ -18,5 +17,4 @@ declare function SidebarMenuBadge(props: SidebarPartProps): JSX.Element;
|
|
|
18
17
|
declare function SidebarRail(props: SidebarPartProps): JSX.Element;
|
|
19
18
|
declare function SidebarTrigger(props: SidebarButtonProps): JSX.Element;
|
|
20
19
|
//#endregion
|
|
21
|
-
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem,
|
|
22
|
-
//# sourceMappingURL=sidebar.d.ts.map
|
|
20
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger };
|
|
@@ -1,5 +1,6 @@
|
|
|
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 { jsx } from "@askrjs/askr/jsx-runtime";
|
|
5
6
|
import { Slot } from "@askrjs/askr/foundations";
|
|
@@ -12,7 +13,6 @@ function sidebarTooltipProps(tooltip, tooltipSide) {
|
|
|
12
13
|
}
|
|
13
14
|
function sidebarPart(props, slot, element = "div") {
|
|
14
15
|
const { as, asChild, children, class: className, ...rest } = props;
|
|
15
|
-
const Element = as ?? element;
|
|
16
16
|
const finalProps = mergeProps(rest, {
|
|
17
17
|
class: className,
|
|
18
18
|
"data-slot": slot
|
|
@@ -22,10 +22,7 @@ function sidebarPart(props, slot, element = "div") {
|
|
|
22
22
|
...finalProps,
|
|
23
23
|
children
|
|
24
24
|
});
|
|
25
|
-
return
|
|
26
|
-
...finalProps,
|
|
27
|
-
children
|
|
28
|
-
});
|
|
25
|
+
return intrinsicElement(String(as ?? element), finalProps, children);
|
|
29
26
|
}
|
|
30
27
|
function Sidebar(props) {
|
|
31
28
|
const { children, collapsible = "offcanvas", side = "left", variant = "sidebar", width = "sidebar", shrink = false, ...rest } = props;
|
|
@@ -45,8 +42,8 @@ function Sidebar(props) {
|
|
|
45
42
|
children
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
function
|
|
49
|
-
return sidebarPart(props, "sidebar-
|
|
45
|
+
function SidebarScope(props) {
|
|
46
|
+
return sidebarPart(props, "sidebar-scope");
|
|
50
47
|
}
|
|
51
48
|
function SidebarInset(props) {
|
|
52
49
|
return sidebarPart(props, "sidebar-inset", "main");
|
|
@@ -127,6 +124,4 @@ function SidebarTrigger(props) {
|
|
|
127
124
|
});
|
|
128
125
|
}
|
|
129
126
|
//#endregion
|
|
130
|
-
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem,
|
|
131
|
-
|
|
132
|
-
//# sourceMappingURL=sidebar.js.map
|
|
127
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","names":[],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { Block } from \"../block\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type {\n SidebarButtonProps,\n SidebarPartProps,\n SidebarProps,\n SidebarTooltipSide,\n} from \"./sidebar.types\";\n\nfunction sidebarTooltipProps(\n tooltip: string | undefined,\n tooltipSide: SidebarTooltipSide | undefined,\n): Record<string, string | undefined> {\n return {\n \"data-tooltip\": tooltip,\n \"data-tooltip-side\": tooltip ? tooltipSide : undefined,\n };\n}\n\nfunction sidebarPart(\n props: SidebarPartProps,\n slot: string,\n element: keyof JSX.IntrinsicElements = \"div\",\n): JSX.Element {\n const { as, asChild, children, class: className, ...rest } = props;\n const
|
|
1
|
+
{"version":3,"file":"sidebar.js","names":[],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { Block } from \"../block\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type {\n SidebarButtonProps,\n SidebarPartProps,\n SidebarProps,\n SidebarTooltipSide,\n} from \"./sidebar.types\";\n\nfunction sidebarTooltipProps(\n tooltip: string | undefined,\n tooltipSide: SidebarTooltipSide | undefined,\n): Record<string, string | undefined> {\n return {\n \"data-tooltip\": tooltip,\n \"data-tooltip-side\": tooltip ? tooltipSide : undefined,\n };\n}\n\nfunction sidebarPart(\n props: SidebarPartProps,\n slot: string,\n element: keyof JSX.IntrinsicElements = \"div\",\n): JSX.Element {\n const { as, asChild, children, class: className, ...rest } = props;\n const finalProps = mergeProps(rest, {\n class: 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(String(as ?? element), finalProps, children);\n}\n\nexport function Sidebar(props: SidebarProps): JSX.Element {\n const {\n children,\n collapsible = \"offcanvas\",\n side = \"left\",\n variant = \"sidebar\",\n width = \"sidebar\",\n shrink = false,\n ...rest\n } = props;\n\n return (\n <Block\n as=\"aside\"\n width={width}\n shrink={shrink}\n minHeight=\"screen\"\n padding=\"md\"\n gap=\"lg\"\n borderRight={true}\n {...rest}\n data-collapsible={collapsible}\n data-side={side}\n data-slot=\"sidebar\"\n data-variant={variant}\n >\n {children}\n </Block>\n );\n}\n\nexport function SidebarScope(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-scope\");\n}\n\nexport function SidebarInset(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-inset\", \"main\");\n}\n\nexport function SidebarContent(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-content\");\n}\n\nexport function SidebarHeader(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-header\");\n}\n\nexport function SidebarFooter(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-footer\");\n}\n\nexport function SidebarGroup(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-group\");\n}\n\nexport function SidebarGroupLabel(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-group-label\");\n}\n\nexport function SidebarGroupContent(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-group-content\");\n}\n\nexport function SidebarMenu(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-menu\", \"ul\");\n}\n\nexport function SidebarMenuItem(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-menu-item\", \"li\");\n}\n\nexport function SidebarMenuButton(props: SidebarButtonProps): JSX.Element {\n const {\n active,\n asChild,\n children,\n class: className,\n size,\n tooltip,\n tooltipSide,\n type = \"button\",\n variant,\n ...rest\n } = props;\n const finalProps = mergeProps(rest, {\n class: classes(className),\n \"data-active\": active ? \"true\" : undefined,\n \"data-size\": size && size !== \"default\" ? size : undefined,\n \"data-slot\": \"sidebar-menu-button\",\n ...sidebarTooltipProps(tooltip, tooltipSide),\n \"data-variant\": variant && variant !== \"default\" ? variant : undefined,\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children as JSX.Element} />;\n }\n\n return (\n <button type={type as \"button\" | \"submit\" | \"reset\" | undefined} {...finalProps}>\n {children}\n </button>\n );\n}\n\nexport function SidebarMenuAction(props: SidebarButtonProps): JSX.Element {\n const { children, class: className, tooltip, tooltipSide, type = \"button\", ...rest } = props;\n return (\n <button\n type={type as \"button\" | \"submit\" | \"reset\" | undefined}\n {...mergeProps(rest, {\n class: classes(className),\n \"data-slot\": \"sidebar-menu-action\",\n ...sidebarTooltipProps(tooltip, tooltipSide),\n })}\n >\n {children}\n </button>\n );\n}\n\nexport function SidebarMenuBadge(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-menu-badge\", \"span\");\n}\n\nexport function SidebarRail(props: SidebarPartProps): JSX.Element {\n return sidebarPart(props, \"sidebar-rail\", \"button\");\n}\n\nexport function SidebarTrigger(props: SidebarButtonProps): JSX.Element {\n const { children, class: className, tooltip, tooltipSide, type = \"button\", ...rest } = props;\n return (\n <button\n type={type as \"button\" | \"submit\" | \"reset\" | undefined}\n {...mergeProps(rest, {\n class: classes(\"btn btn-ghost btn-icon\", className),\n \"data-slot\": \"sidebar-trigger\",\n ...sidebarTooltipProps(tooltip, tooltipSide),\n })}\n >\n {children}\n </button>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BlockElementProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
//#region src/components/sidebar/sidebar.types.d.ts
|
|
3
4
|
type SidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
4
5
|
type SidebarSide = "left" | "right";
|
|
@@ -24,5 +25,4 @@ type SidebarButtonProps = JSX.IntrinsicElements["button"] & {
|
|
|
24
25
|
variant?: "default" | "outline";
|
|
25
26
|
};
|
|
26
27
|
//#endregion
|
|
27
|
-
export { SidebarButtonProps, SidebarCollapsible, SidebarPartProps, SidebarProps, SidebarSide, SidebarTooltipSide, SidebarVariant };
|
|
28
|
-
//# sourceMappingURL=sidebar.types.d.ts.map
|
|
28
|
+
export { SidebarButtonProps, SidebarCollapsible, SidebarPartProps, SidebarProps, SidebarSide, SidebarTooltipSide, SidebarVariant };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { SkeletonAsChildProps, SkeletonProps } from "./skeleton.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/skeleton/skeleton.d.ts
|
|
4
3
|
declare function Skeleton(props: SkeletonProps): JSX.Element;
|
|
5
4
|
declare function Skeleton(props: SkeletonAsChildProps): JSX.Element;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { Skeleton };
|
|
8
|
-
//# sourceMappingURL=skeleton.d.ts.map
|
|
6
|
+
export { Skeleton };
|
|
@@ -2,6 +2,7 @@ import { classes } from "../_internal/classes.js";
|
|
|
2
2
|
import { mergeProps } from "../_internal/merge-props.js";
|
|
3
3
|
import { styleDeclarationsToClass } from "../_internal/style.js";
|
|
4
4
|
import { mergeLayoutStyles } from "../_internal/block-layout.js";
|
|
5
|
+
import { intrinsicElement } from "../_internal/jsx.js";
|
|
5
6
|
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
6
7
|
import { Slot } from "@askrjs/askr/foundations";
|
|
7
8
|
//#region src/components/skeleton/skeleton.tsx
|
|
@@ -11,12 +12,14 @@ function resolveSkeletonDimension(value) {
|
|
|
11
12
|
}
|
|
12
13
|
function Skeleton(props) {
|
|
13
14
|
const { asChild, children, class: classProp, className, height, ref, style, width, ...rest } = props;
|
|
15
|
+
const dimensions = {};
|
|
16
|
+
const blockSize = resolveSkeletonDimension(height);
|
|
17
|
+
const inlineSize = resolveSkeletonDimension(width);
|
|
18
|
+
if (blockSize !== void 0) dimensions.blockSize = blockSize;
|
|
19
|
+
if (inlineSize !== void 0) dimensions.inlineSize = inlineSize;
|
|
14
20
|
const finalProps = mergeProps(rest, {
|
|
15
21
|
ref,
|
|
16
|
-
class: classes(classProp, className, styleDeclarationsToClass(mergeLayoutStyles(
|
|
17
|
-
blockSize: resolveSkeletonDimension(height),
|
|
18
|
-
inlineSize: resolveSkeletonDimension(width)
|
|
19
|
-
}, style))),
|
|
22
|
+
class: classes(classProp, className, styleDeclarationsToClass(mergeLayoutStyles(dimensions, style))),
|
|
20
23
|
"data-slot": "skeleton",
|
|
21
24
|
"data-skeleton": "true",
|
|
22
25
|
"aria-hidden": "true"
|
|
@@ -26,12 +29,7 @@ function Skeleton(props) {
|
|
|
26
29
|
...finalProps,
|
|
27
30
|
children
|
|
28
31
|
});
|
|
29
|
-
return
|
|
30
|
-
...finalProps,
|
|
31
|
-
children
|
|
32
|
-
});
|
|
32
|
+
return intrinsicElement("div", finalProps, children);
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
35
|
export { Skeleton };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","names":[],"sources":["../../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeLayoutStyles } from \"../_internal/block-layout\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport type { SkeletonAsChildProps, SkeletonProps } from \"./skeleton.types\";\n\nfunction resolveSkeletonDimension(value: string | number | undefined): string | undefined {\n if (typeof value === \"number\") return `${value}px`;\n return value;\n}\n\nexport function Skeleton(props: SkeletonProps): JSX.Element;\nexport function Skeleton(props: SkeletonAsChildProps): JSX.Element;\nexport function Skeleton(props: SkeletonProps | SkeletonAsChildProps) {\n const {\n asChild,\n children,\n class: classProp,\n className,\n height,\n ref,\n style,\n width,\n ...rest\n } = props as (SkeletonProps | SkeletonAsChildProps) & {\n class?: unknown;\n className?: unknown;\n style?: unknown;\n };\n const
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":[],"sources":["../../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["import { Slot } from \"@askrjs/askr/foundations\";\nimport { mergeLayoutStyles } from \"../_internal/block-layout\";\nimport { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport { styleDeclarationsToClass } from \"../_internal/style\";\nimport type { SkeletonAsChildProps, SkeletonProps } from \"./skeleton.types\";\n\nfunction resolveSkeletonDimension(value: string | number | undefined): string | undefined {\n if (typeof value === \"number\") return `${value}px`;\n return value;\n}\n\nexport function Skeleton(props: SkeletonProps): JSX.Element;\nexport function Skeleton(props: SkeletonAsChildProps): JSX.Element;\nexport function Skeleton(props: SkeletonProps | SkeletonAsChildProps) {\n const {\n asChild,\n children,\n class: classProp,\n className,\n height,\n ref,\n style,\n width,\n ...rest\n } = props as (SkeletonProps | SkeletonAsChildProps) & {\n class?: unknown;\n className?: unknown;\n style?: unknown;\n };\n const dimensions: Record<string, string | number> = {};\n const blockSize = resolveSkeletonDimension(height);\n const inlineSize = resolveSkeletonDimension(width);\n if (blockSize !== undefined) dimensions.blockSize = blockSize;\n if (inlineSize !== undefined) dimensions.inlineSize = inlineSize;\n const layoutClass = styleDeclarationsToClass(mergeLayoutStyles(dimensions, style));\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(classProp, className, layoutClass),\n \"data-slot\": \"skeleton\",\n \"data-skeleton\": \"true\",\n \"aria-hidden\": \"true\",\n });\n\n if (asChild) {\n return <Slot asChild {...finalProps} children={children} />;\n }\n\n return intrinsicElement(\"div\", finalProps, children);\n}\n"],"mappings":";;;;;;;;AAQA,SAAS,yBAAyB,OAAwD;CACxF,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM;CAC/C,OAAO;AACT;AAIA,SAAgB,SAAS,OAA6C;CACpE,MAAM,EACJ,SACA,UACA,OAAO,WACP,WACA,QACA,KACA,OACA,OACA,GAAG,SACD;CAKJ,MAAM,aAA8C,CAAC;CACrD,MAAM,YAAY,yBAAyB,MAAM;CACjD,MAAM,aAAa,yBAAyB,KAAK;CACjD,IAAI,cAAc,KAAA,GAAW,WAAW,YAAY;CACpD,IAAI,eAAe,KAAA,GAAW,WAAW,aAAa;CAEtD,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,WAAW,WAHR,yBAAyB,kBAAkB,YAAY,KAAK,CAG/B,CAAC;EAChD,aAAa;EACb,iBAAiB;EACjB,eAAe;CACjB,CAAC;CAED,IAAI,SACF,OAAO,oBAAC,MAAD;EAAM,SAAA;EAAQ,GAAI;EAAsB;CAAW,CAAA;CAG5D,OAAO,iBAAiB,OAAO,YAAY,QAAQ;AACrD"}
|
|
@@ -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/skeleton/skeleton.types.d.ts
|
|
5
4
|
type SkeletonOwnProps = {
|
|
6
5
|
children?: unknown;
|
|
@@ -17,5 +16,4 @@ type SkeletonAsChildProps = SkeletonOwnProps & {
|
|
|
17
16
|
ref?: Ref<unknown>;
|
|
18
17
|
};
|
|
19
18
|
//#endregion
|
|
20
|
-
export { SkeletonAsChildProps, SkeletonOwnProps, SkeletonProps };
|
|
21
|
-
//# sourceMappingURL=skeleton.types.d.ts.map
|
|
19
|
+
export { SkeletonAsChildProps, SkeletonOwnProps, SkeletonProps };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ProgressCircleProps } from "@askrjs/ui";
|
|
2
|
-
|
|
3
2
|
//#region src/components/spinner/spinner.types.d.ts
|
|
4
3
|
type SpinnerSize = "sm" | "md" | "lg";
|
|
5
4
|
type SpinnerOwnProps = Omit<ProgressCircleProps, "value" | "getValueLabel"> & {
|
|
@@ -8,5 +7,4 @@ type SpinnerOwnProps = Omit<ProgressCircleProps, "value" | "getValueLabel"> & {
|
|
|
8
7
|
};
|
|
9
8
|
type SpinnerProps = SpinnerOwnProps;
|
|
10
9
|
//#endregion
|
|
11
|
-
export { SpinnerOwnProps, SpinnerProps, SpinnerSize };
|
|
12
|
-
//# sourceMappingURL=spinner.types.d.ts.map
|
|
10
|
+
export { SpinnerOwnProps, SpinnerProps, SpinnerSize };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { StatDescriptionProps, StatLabelProps, StatProps, StatValueProps } from "./stat.types.js";
|
|
2
|
-
import { Stat, StatDescription, StatLabel, StatValue } from "./stat.js";
|
|
2
|
+
import { Stat, StatDescription, StatLabel, StatValue } from "./stat.js";
|
|
3
|
+
export { Stat, StatDescription, type StatDescriptionProps, StatLabel, type StatLabelProps, type StatProps, StatValue, type StatValueProps };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { StatDescriptionProps, StatLabelProps, StatProps, StatValueProps } from "./stat.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/stat/stat.d.ts
|
|
4
3
|
declare function Stat(props: StatProps): JSX.Element;
|
|
5
4
|
declare function StatLabel(props: StatLabelProps): JSX.Element;
|
|
6
5
|
declare function StatValue(props: StatValueProps): JSX.Element;
|
|
7
6
|
declare function StatDescription(props: StatDescriptionProps): JSX.Element;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { Stat, StatDescription, StatLabel, StatValue };
|
|
10
|
-
//# sourceMappingURL=stat.d.ts.map
|
|
8
|
+
export { Stat, StatDescription, StatLabel, StatValue };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
|
-
|
|
3
2
|
//#region src/components/stat/stat.types.d.ts
|
|
4
3
|
type DivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref">;
|
|
5
4
|
type ParagraphProps = Omit<JSX.IntrinsicElements["p"], "children" | "ref">;
|
|
@@ -20,5 +19,4 @@ type StatDescriptionProps = ParagraphProps & {
|
|
|
20
19
|
ref?: Ref<HTMLParagraphElement>;
|
|
21
20
|
};
|
|
22
21
|
//#endregion
|
|
23
|
-
export { StatDescriptionProps, StatLabelProps, StatProps, StatValueProps };
|
|
24
|
-
//# sourceMappingURL=stat.types.d.ts.map
|
|
22
|
+
export { StatDescriptionProps, StatLabelProps, StatProps, StatValueProps };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { TextElement, TextFont, TextNumeric, TextProps, TextSize, TextTone, TextWeight, TextWrap } from "./text.types.js";
|
|
2
|
-
import { Text } from "./text.js";
|
|
2
|
+
import { Text } from "./text.js";
|
|
3
|
+
export { Text, type TextElement, type TextFont, type TextNumeric, type TextProps, type TextSize, type TextTone, type TextWeight, type TextWrap };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { TextElement, TextProps } from "./text.types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/components/text/text.d.ts
|
|
4
3
|
declare function Text<TElement extends TextElement = "p">(props: TextProps<TElement>): JSX.Element;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { Text };
|
|
7
|
-
//# sourceMappingURL=text.d.ts.map
|
|
5
|
+
export { Text };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { classes } from "../_internal/classes.js";
|
|
2
2
|
import { mergeProps } from "../_internal/merge-props.js";
|
|
3
|
-
import {
|
|
3
|
+
import { intrinsicElement } from "../_internal/jsx.js";
|
|
4
4
|
//#region src/components/text/text.tsx
|
|
5
5
|
const DEFAULT_ELEMENT = "p";
|
|
6
6
|
function Text(props) {
|
|
@@ -17,12 +17,7 @@ function Text(props) {
|
|
|
17
17
|
"data-wrap": wrap,
|
|
18
18
|
"data-truncate": truncate ? "true" : void 0
|
|
19
19
|
});
|
|
20
|
-
return
|
|
21
|
-
...finalProps,
|
|
22
|
-
children
|
|
23
|
-
});
|
|
20
|
+
return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);
|
|
24
21
|
}
|
|
25
22
|
//#endregion
|
|
26
23
|
export { Text };
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../../src/components/text/text.tsx"],"sourcesContent":["import { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport type { TextElement, TextProps } from \"./text.types\";\n\nconst DEFAULT_ELEMENT = \"p\";\n\nexport function Text<TElement extends TextElement = \"p\">(props: TextProps<TElement>): JSX.Element {\n const {\n as,\n size = \"md\",\n tone = \"default\",\n weight,\n font,\n numeric,\n wrap,\n truncate,\n children,\n class: classProp,\n className,\n ref,\n ...rest\n } = props as TextProps<TextElement> & { class?: unknown; className?: unknown };\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"text\", classProp, className),\n \"data-slot\": \"text\",\n \"data-size\": size,\n \"data-tone\": tone,\n \"data-weight\": weight,\n \"data-font\": font && font !== \"body\" ? font : undefined,\n \"data-numeric\": numeric && numeric !== \"normal\" ? numeric : undefined,\n \"data-wrap\": wrap,\n \"data-truncate\": truncate ? \"true\" : undefined,\n });\n\n
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../../src/components/text/text.tsx"],"sourcesContent":["import { classes } from \"../_internal/classes\";\nimport { mergeProps } from \"../_internal/merge-props\";\nimport { intrinsicElement } from \"../_internal/jsx\";\nimport type { TextElement, TextProps } from \"./text.types\";\n\nconst DEFAULT_ELEMENT = \"p\";\n\nexport function Text<TElement extends TextElement = \"p\">(props: TextProps<TElement>): JSX.Element {\n const {\n as,\n size = \"md\",\n tone = \"default\",\n weight,\n font,\n numeric,\n wrap,\n truncate,\n children,\n class: classProp,\n className,\n ref,\n ...rest\n } = props as TextProps<TextElement> & { class?: unknown; className?: unknown };\n\n const finalProps = mergeProps(rest, {\n ref,\n class: classes(\"text\", classProp, className),\n \"data-slot\": \"text\",\n \"data-size\": size,\n \"data-tone\": tone,\n \"data-weight\": weight,\n \"data-font\": font && font !== \"body\" ? font : undefined,\n \"data-numeric\": numeric && numeric !== \"normal\" ? numeric : undefined,\n \"data-wrap\": wrap,\n \"data-truncate\": truncate ? \"true\" : undefined,\n });\n\n return intrinsicElement(as ?? DEFAULT_ELEMENT, finalProps, children);\n}\n"],"mappings":";;;;AAKA,MAAM,kBAAkB;AAExB,SAAgB,KAAyC,OAAyC;CAChG,MAAM,EACJ,IACA,OAAO,MACP,OAAO,WACP,QACA,MACA,SACA,MACA,UACA,UACA,OAAO,WACP,WACA,KACA,GAAG,SACD;CAEJ,MAAM,aAAa,WAAW,MAAM;EAClC;EACA,OAAO,QAAQ,QAAQ,WAAW,SAAS;EAC3C,aAAa;EACb,aAAa;EACb,aAAa;EACb,eAAe;EACf,aAAa,QAAQ,SAAS,SAAS,OAAO,KAAA;EAC9C,gBAAgB,WAAW,YAAY,WAAW,UAAU,KAAA;EAC5D,aAAa;EACb,iBAAiB,WAAW,SAAS,KAAA;CACvC,CAAC;CAED,OAAO,iBAAiB,MAAM,iBAAiB,YAAY,QAAQ;AACrE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Ref } from "@askrjs/askr/foundations/utilities";
|
|
2
|
-
|
|
3
2
|
//#region src/components/text/text.types.d.ts
|
|
4
3
|
type TextElement = "p" | "span" | "div" | "strong";
|
|
5
4
|
type TextSize = "sm" | "md" | "lg";
|
|
@@ -22,5 +21,4 @@ type TextProps<TElement extends TextElement = "p"> = TextIntrinsicProps<TElement
|
|
|
22
21
|
ref?: Ref<HTMLElement>;
|
|
23
22
|
};
|
|
24
23
|
//#endregion
|
|
25
|
-
export { TextElement, TextFont, TextNumeric, TextProps, TextSize, TextTone, TextWeight, TextWrap };
|
|
26
|
-
//# sourceMappingURL=text.types.d.ts.map
|
|
24
|
+
export { TextElement, TextFont, TextNumeric, TextProps, TextSize, TextTone, TextWeight, TextWrap };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, CatThemeName, DEFAULT_THEME_OPTIONS,
|
|
1
|
+
import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, CatThemeName, DEFAULT_THEME_OPTIONS, ThemeName, ThemeOption, ThemePicker, ThemePickerProps, ThemeScope, ThemeScopeProps, ThemeScopeValue, ThemeToggle, ThemeToggleProps, ThemeToggleRenderContext, theme } from "./theme.js";
|
|
2
|
+
export { CAT_THEME_NAMES, CAT_THEME_OPTIONS, type CatThemeName, DEFAULT_THEME_OPTIONS, type ThemeName, type ThemeOption, ThemePicker, type ThemePickerProps, ThemeScope, type ThemeScopeProps, type ThemeScopeValue, ThemeToggle, type ThemeToggleProps, type ThemeToggleRenderContext, theme };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonNativeProps, PressEvent } from "@askrjs/ui";
|
|
2
|
-
|
|
3
2
|
//#region src/components/theme/theme.d.ts
|
|
4
3
|
declare const CAT_THEME_NAMES: readonly ["tabby", "ginger", "tuxedo", "calico", "torty"];
|
|
5
4
|
type CatThemeName = (typeof CAT_THEME_NAMES)[number];
|
|
@@ -8,13 +7,13 @@ type ThemeOption = {
|
|
|
8
7
|
value: ThemeName;
|
|
9
8
|
label: string;
|
|
10
9
|
};
|
|
11
|
-
type
|
|
10
|
+
type ThemeScopeValue = {
|
|
12
11
|
theme: () => ThemeName;
|
|
13
12
|
setTheme: (theme: ThemeName) => void;
|
|
14
13
|
themes: readonly ThemeOption[];
|
|
15
14
|
storageKey: string;
|
|
16
15
|
};
|
|
17
|
-
type
|
|
16
|
+
type ThemeScopeProps = {
|
|
18
17
|
children?: unknown;
|
|
19
18
|
defaultTheme?: ThemeName;
|
|
20
19
|
themes?: readonly ThemeOption[];
|
|
@@ -38,10 +37,9 @@ type ThemeToggleProps = Omit<ButtonNativeProps, "children" | "onPress"> & {
|
|
|
38
37
|
};
|
|
39
38
|
declare const DEFAULT_THEME_OPTIONS: readonly ThemeOption[];
|
|
40
39
|
declare const CAT_THEME_OPTIONS: readonly ThemeOption[];
|
|
41
|
-
declare function
|
|
42
|
-
declare function
|
|
40
|
+
declare function theme(): ThemeScopeValue;
|
|
41
|
+
declare function ThemeScope(props: ThemeScopeProps): JSX.Element;
|
|
43
42
|
declare function ThemePicker(props: ThemePickerProps): JSX.Element;
|
|
44
43
|
declare function ThemeToggle(props: ThemeToggleProps): JSX.Element;
|
|
45
44
|
//#endregion
|
|
46
|
-
export { CAT_THEME_NAMES, CAT_THEME_OPTIONS, CatThemeName, DEFAULT_THEME_OPTIONS,
|
|
47
|
-
//# sourceMappingURL=theme.d.ts.map
|
|
45
|
+
export { CAT_THEME_NAMES, CAT_THEME_OPTIONS, CatThemeName, DEFAULT_THEME_OPTIONS, ThemeName, ThemeOption, ThemePicker, ThemePickerProps, ThemeScope, ThemeScopeProps, ThemeScopeValue, ThemeToggle, ThemeToggleProps, ThemeToggleRenderContext, theme };
|