@mesob/ui 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert-dialog.js +14 -14
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/app-breadcrumbs-context.d.ts +19 -0
- package/dist/components/app-breadcrumbs-context.js +19 -0
- package/dist/components/app-breadcrumbs-context.js.map +1 -0
- package/dist/components/app-breadcrumbs.d.ts +5 -14
- package/dist/components/app-breadcrumbs.js +5 -7
- package/dist/components/app-breadcrumbs.js.map +1 -1
- package/dist/components/app-header-actions.js +70 -70
- package/dist/components/app-header-actions.js.map +1 -1
- package/dist/components/app-sidebar.js +57 -59
- package/dist/components/app-sidebar.js.map +1 -1
- package/dist/components/button.js +4 -4
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +12 -12
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/carousel.js +14 -14
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/data-table/index.js +57 -57
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/entity/index.js +177 -177
- package/dist/components/entity/index.js.map +1 -1
- package/dist/components/input-group.js +15 -15
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/page/index.js +21 -21
- package/dist/components/page/index.js.map +1 -1
- package/dist/components/pagination.js +12 -12
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/section/index.js +15 -15
- package/dist/components/section/index.js.map +1 -1
- package/dist/components/shell.js +37 -42
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sidebar-context.d.ts +19 -0
- package/dist/components/sidebar-context.js +17 -0
- package/dist/components/sidebar-context.js.map +1 -0
- package/dist/components/sidebar.d.ts +2 -15
- package/dist/components/sidebar.js +67 -70
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/spotlight-search.js +38 -38
- package/dist/components/spotlight-search.js.map +1 -1
- package/dist/components/theme-toggle.js +8 -8
- package/dist/components/theme-toggle.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ function cn(...inputs) {
|
|
|
10
10
|
// src/components/button.tsx
|
|
11
11
|
import { Slot } from "@radix-ui/react-slot";
|
|
12
12
|
import { cva } from "class-variance-authority";
|
|
13
|
-
import { jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
var buttonVariants = cva(
|
|
15
15
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
16
16
|
{
|
|
@@ -49,17 +49,17 @@ function Button({
|
|
|
49
49
|
...props
|
|
50
50
|
}) {
|
|
51
51
|
const Comp = asChild ? Slot : "button";
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
53
|
Comp,
|
|
54
54
|
{
|
|
55
55
|
"data-slot": "button",
|
|
56
56
|
className: cn(buttonVariants({ variant, size, className })),
|
|
57
57
|
...props,
|
|
58
|
-
children: [
|
|
58
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
59
|
leftIcon,
|
|
60
60
|
children,
|
|
61
61
|
rightIcon
|
|
62
|
-
]
|
|
62
|
+
] })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
}
|
|
@@ -67,7 +67,7 @@ function Button({
|
|
|
67
67
|
// src/components/theme-toggle.tsx
|
|
68
68
|
import { IconMoon, IconSun } from "@tabler/icons-react";
|
|
69
69
|
import { useTheme } from "next-themes";
|
|
70
|
-
import { jsx, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
70
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
71
71
|
function ThemeToggle({ className }) {
|
|
72
72
|
const { resolvedTheme, setTheme, theme } = useTheme();
|
|
73
73
|
const isDark = (theme ?? resolvedTheme) === "dark";
|
|
@@ -81,9 +81,9 @@ function ThemeToggle({ className }) {
|
|
|
81
81
|
className: cn("relative", className),
|
|
82
82
|
onClick: () => setTheme(isDark ? "light" : "dark"),
|
|
83
83
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ jsx2(IconSun, { className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
85
|
+
/* @__PURE__ */ jsx2(IconMoon, { className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" }),
|
|
86
|
+
/* @__PURE__ */ jsx2("span", { className: "sr-only", children: "Toggle theme" })
|
|
87
87
|
]
|
|
88
88
|
}
|
|
89
89
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/theme-toggle.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n outline:\n 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\ntype ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n };\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n leftIcon,\n rightIcon,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n >\n {leftIcon}\n
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/theme-toggle.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n outline:\n 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\ntype ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n };\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n leftIcon,\n rightIcon,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {leftIcon}\n {children}\n {rightIcon}\n </>\n )}\n </Comp>\n );\n}\n\nexport { Button, buttonVariants };\n","'use client';\n\nimport { Button } from '@mesob/ui/components/button';\nimport { cn } from '@mesob/ui/lib/utils';\nimport { IconMoon, IconSun } from '@tabler/icons-react';\nimport { useTheme } from 'next-themes';\n\ntype ThemeToggleProps = {\n className?: string;\n};\n\nexport function ThemeToggle({ className }: ThemeToggleProps) {\n const { resolvedTheme, setTheme, theme } = useTheme();\n const isDark = (theme ?? resolvedTheme) === 'dark';\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n aria-label=\"Toggle theme\"\n className={cn('relative', className)}\n onClick={() => setTheme(isDark ? 'light' : 'dark')}\n >\n <IconSun className=\"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <IconMoon className=\"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n <span className=\"sr-only\">Toggle theme</span>\n </Button>\n );\n}\n"],"mappings":";;;AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,SAAS,YAAY;AACrB,SAAS,WAA8B;AAwDnC,SAQI,UARJ,KAQI,YARJ;AArDJ,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF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