@olwiba/ui 0.0.44 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-AMWLSHD6.js +37 -0
- package/dist/chunk-AMWLSHD6.js.map +1 -0
- package/dist/index.d.ts +72 -5
- package/dist/index.js +71 -3
- package/dist/index.js.map +1 -1
- package/dist/mdx/index.js +1 -30
- package/dist/mdx/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/layout/AppContent.tsx +34 -0
- package/src/layout/AppGrid.tsx +48 -0
- package/src/layout/PublicPageFrame.tsx +42 -0
- package/src/layout/index.ts +6 -0
- package/dist/chunk-SUKTBILF.js +0 -11
- package/dist/chunk-SUKTBILF.js.map +0 -1
package/dist/mdx/index.js
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { useMDXComponent } from '@content-collections/mdx/react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var components = {
|
|
6
|
-
h1: ({ className, ...props }) => /* @__PURE__ */ jsx("h1", { className: cn("mt-8 scroll-m-20 text-3xl font-bold tracking-tight text-foreground first:mt-0", className), ...props }),
|
|
7
|
-
h2: ({ className, ...props }) => /* @__PURE__ */ jsx("h2", { className: cn("mt-10 scroll-m-20 text-2xl font-semibold tracking-tight text-foreground first:mt-0", className), ...props }),
|
|
8
|
-
h3: ({ className, ...props }) => /* @__PURE__ */ jsx("h3", { className: cn("mt-8 scroll-m-20 text-xl font-semibold tracking-tight text-foreground", className), ...props }),
|
|
9
|
-
h4: ({ className, ...props }) => /* @__PURE__ */ jsx("h4", { className: cn("mt-6 scroll-m-20 text-lg font-semibold tracking-tight text-foreground", className), ...props }),
|
|
10
|
-
p: ({ className, ...props }) => /* @__PURE__ */ jsx("p", { className: cn("leading-7 text-muted-foreground [&:not(:first-child)]:mt-6", className), ...props }),
|
|
11
|
-
ul: ({ className, ...props }) => /* @__PURE__ */ jsx("ul", { className: cn("my-6 ml-6 list-disc text-muted-foreground", className), ...props }),
|
|
12
|
-
ol: ({ className, ...props }) => /* @__PURE__ */ jsx("ol", { className: cn("my-6 ml-6 list-decimal text-muted-foreground", className), ...props }),
|
|
13
|
-
li: ({ className, ...props }) => /* @__PURE__ */ jsx("li", { className: cn("mt-2", className), ...props }),
|
|
14
|
-
blockquote: ({ className, ...props }) => /* @__PURE__ */ jsx("blockquote", { className: cn("mt-6 rounded-r-lg border-l-4 border-primary bg-muted py-4 pl-6 pr-4 italic text-muted-foreground", className), ...props }),
|
|
15
|
-
hr: (props) => /* @__PURE__ */ jsx("hr", { className: "my-8 border-border", ...props }),
|
|
16
|
-
img: ({ className, alt, ...props }) => /* @__PURE__ */ jsx("img", { className: cn("rounded-lg border shadow-sm", className), alt, ...props }),
|
|
17
|
-
pre: ({ className, ...props }) => /* @__PURE__ */ jsx("pre", { className: cn("mt-6 mb-4 overflow-x-auto rounded-lg bg-muted p-4 text-sm", className), ...props }),
|
|
18
|
-
code: ({ className, ...props }) => /* @__PURE__ */ jsx("code", { className: cn("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm text-foreground", className), ...props }),
|
|
19
|
-
table: ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: "my-6 w-full overflow-y-auto rounded-lg border border-border", children: /* @__PURE__ */ jsx("table", { className: cn("w-full", className), ...props }) }),
|
|
20
|
-
tr: ({ className, ...props }) => /* @__PURE__ */ jsx("tr", { className: cn("m-0 border-t border-border p-0 even:bg-muted", className), ...props }),
|
|
21
|
-
th: ({ className, ...props }) => /* @__PURE__ */ jsx("th", { className: cn("border border-border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right", className), ...props }),
|
|
22
|
-
td: ({ className, ...props }) => /* @__PURE__ */ jsx("td", { className: cn("border border-border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right", className), ...props }),
|
|
23
|
-
a: ({ className, ...props }) => /* @__PURE__ */ jsx("a", { className: cn("font-medium text-primary underline underline-offset-4 hover:text-primary/80", className), ...props })
|
|
24
|
-
};
|
|
25
|
-
function MdxContent({ code }) {
|
|
26
|
-
const MDXComponent = useMDXComponent(code);
|
|
27
|
-
return /* @__PURE__ */ jsx(MDXComponent, { components });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { MdxContent };
|
|
1
|
+
export { MdxContent } from '../chunk-AMWLSHD6.js';
|
|
31
2
|
//# sourceMappingURL=index.js.map
|
|
32
3
|
//# sourceMappingURL=index.js.map
|
package/dist/mdx/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -113,8 +113,8 @@ export { PostList, type PostListProps } from './blog/PostList';
|
|
|
113
113
|
export { ChangelogList, type ChangelogListProps } from './blog/ChangelogList';
|
|
114
114
|
export { ChangelogCard, type ChangelogCardProps } from './blog/ChangelogCard';
|
|
115
115
|
|
|
116
|
-
// ─── MDX
|
|
117
|
-
|
|
116
|
+
// ─── MDX ──────────────────────────────────────────────────────────────────────
|
|
117
|
+
export { MdxContent, type MdxContentProps } from './blog/MdxContent';
|
|
118
118
|
|
|
119
119
|
// ─── Hooks ────────────────────────────────────────────────────────────────────
|
|
120
120
|
export { useMounted } from './hooks/use-mounted';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cn } from '../lib/utils'
|
|
3
|
+
|
|
4
|
+
const spacingMap = {
|
|
5
|
+
sm: 'space-y-4',
|
|
6
|
+
md: 'space-y-6',
|
|
7
|
+
lg: 'space-y-8',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const maxWidthMap = {
|
|
11
|
+
none: '',
|
|
12
|
+
'screen-lg': 'mx-auto max-w-screen-lg',
|
|
13
|
+
'screen-xl': 'mx-auto max-w-screen-xl',
|
|
14
|
+
'screen-2xl': 'mx-auto max-w-screen-2xl',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface AppContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
spacing?: keyof typeof spacingMap
|
|
19
|
+
maxWidth?: keyof typeof maxWidthMap
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function AppContent({
|
|
23
|
+
spacing = 'md',
|
|
24
|
+
maxWidth = 'none',
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}: AppContentProps) {
|
|
29
|
+
return (
|
|
30
|
+
<div className={cn('p-6', maxWidthMap[maxWidth], spacingMap[spacing], className)} {...props}>
|
|
31
|
+
{children}
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cn } from '../lib/utils'
|
|
3
|
+
|
|
4
|
+
const columnsMap = {
|
|
5
|
+
1: 'grid-cols-1',
|
|
6
|
+
2: 'grid-cols-1 md:grid-cols-2',
|
|
7
|
+
3: 'grid-cols-1 md:grid-cols-2 xl:grid-cols-3',
|
|
8
|
+
4: 'grid-cols-1 md:grid-cols-2 xl:grid-cols-4',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const gapMap = {
|
|
12
|
+
sm: 'gap-3',
|
|
13
|
+
md: 'gap-4',
|
|
14
|
+
lg: 'gap-6',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const spanMap = {
|
|
18
|
+
1: 'md:col-span-1',
|
|
19
|
+
2: 'md:col-span-2',
|
|
20
|
+
3: 'xl:col-span-3',
|
|
21
|
+
4: 'xl:col-span-4',
|
|
22
|
+
full: 'col-span-full',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AppGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
columns?: keyof typeof columnsMap
|
|
27
|
+
gap?: keyof typeof gapMap
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function AppGrid({ columns = 3, gap = 'md', className, children, ...props }: AppGridProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn('grid', columnsMap[columns], gapMap[gap], className)} {...props}>
|
|
33
|
+
{children}
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AppGridCellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
span?: keyof typeof spanMap
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function AppGridCell({ span = 1, className, children, ...props }: AppGridCellProps) {
|
|
43
|
+
return (
|
|
44
|
+
<div className={cn(spanMap[span], className)} {...props}>
|
|
45
|
+
{children}
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cn } from '../lib/utils'
|
|
3
|
+
|
|
4
|
+
const surfaceMap = {
|
|
5
|
+
default: 'bg-background',
|
|
6
|
+
muted: 'bg-muted/50',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const spacingMap = {
|
|
10
|
+
sm: 'gap-4 p-4',
|
|
11
|
+
md: 'gap-5 p-4 sm:gap-6 sm:p-6',
|
|
12
|
+
lg: 'gap-6 p-4 sm:gap-8 sm:p-6',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const maxWidthMap = {
|
|
16
|
+
none: '',
|
|
17
|
+
'screen-xl': 'mx-auto max-w-screen-xl',
|
|
18
|
+
'screen-2xl': 'mx-auto max-w-screen-2xl',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PublicPageFrameProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
surface?: keyof typeof surfaceMap
|
|
23
|
+
spacing?: keyof typeof spacingMap
|
|
24
|
+
maxWidth?: keyof typeof maxWidthMap
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function PublicPageFrame({
|
|
28
|
+
surface = 'muted',
|
|
29
|
+
spacing = 'md',
|
|
30
|
+
maxWidth = 'none',
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}: PublicPageFrameProps) {
|
|
35
|
+
return (
|
|
36
|
+
<div className={cn('min-h-screen', surfaceMap[surface], className)} {...props}>
|
|
37
|
+
<div className={cn('flex flex-col', spacingMap[spacing], maxWidthMap[maxWidth])}>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
package/src/layout/index.ts
CHANGED
|
@@ -4,3 +4,9 @@ export { Stack } from './Stack'
|
|
|
4
4
|
export type { StackProps } from './Stack'
|
|
5
5
|
export { Section } from './Section'
|
|
6
6
|
export type { SectionProps } from './Section'
|
|
7
|
+
export { AppContent } from './AppContent'
|
|
8
|
+
export type { AppContentProps } from './AppContent'
|
|
9
|
+
export { AppGrid, AppGridCell } from './AppGrid'
|
|
10
|
+
export type { AppGridProps, AppGridCellProps } from './AppGrid'
|
|
11
|
+
export { PublicPageFrame } from './PublicPageFrame'
|
|
12
|
+
export type { PublicPageFrameProps } from './PublicPageFrame'
|
package/dist/chunk-SUKTBILF.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
// src/lib/utils.ts
|
|
5
|
-
function cn(...inputs) {
|
|
6
|
-
return twMerge(clsx(inputs));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { cn };
|
|
10
|
-
//# sourceMappingURL=chunk-SUKTBILF.js.map
|
|
11
|
-
//# sourceMappingURL=chunk-SUKTBILF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/utils.ts"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"chunk-SUKTBILF.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
|