@quadrokit/ui 0.2.0 → 0.2.2
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 +1 -1
- package/dist/components/{button.js → button.mjs} +1 -1
- package/dist/components/{card.js → card.mjs} +1 -1
- package/dist/components/{input.js → input.mjs} +1 -1
- package/dist/components/{label.js → label.mjs} +1 -1
- package/dist/components/{theme-toolbar.js → theme-toolbar.mjs} +3 -3
- package/dist/index.mjs +8 -0
- package/package.json +5 -5
- package/dist/index.js +0 -8
- /package/dist/lib/{utils.js → utils.mjs} +0 -0
- /package/dist/{tailwind-preset.js → tailwind-preset.mjs} +0 -0
- /package/dist/theme/{theme-provider.js → theme-provider.mjs} +0 -0
- /package/dist/theme/{themes.js → themes.mjs} +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Shared **React** UI for QuadroKit templates: Tailwind **preset**, global **CSS v
|
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
import preset from '@quadrokit/ui/tailwind-preset';
|
|
12
|
-
export default { presets: [preset], content: [/* your files */, '../../node_modules/@quadrokit/ui/dist/**/*.{js,ts,tsx}'] };
|
|
12
|
+
export default { presets: [preset], content: [/* your files */, '../../node_modules/@quadrokit/ui/dist/**/*.{mjs,js,ts,tsx}'] };
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
3. Import styles once (e.g. in `main.tsx`):
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import { cn } from '../lib/utils.
|
|
5
|
+
import { cn } from '../lib/utils.mjs';
|
|
6
6
|
const variants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { cn } from '../lib/utils.
|
|
3
|
+
import { cn } from '../lib/utils.mjs';
|
|
4
4
|
export const Card = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('rounded-xl border border-border bg-card text-card-foreground shadow-sm', className), ...props })));
|
|
5
5
|
Card.displayName = 'Card';
|
|
6
6
|
export const CardHeader = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex flex-col space-y-1.5 p-6', className), ...props })));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { cn } from '../lib/utils.
|
|
3
|
+
import { cn } from '../lib/utils.mjs';
|
|
4
4
|
export const Input = forwardRef(({ className, type, ...props }, ref) => {
|
|
5
5
|
return (_jsx("input", { type: type, className: cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className), ref: ref, ...props }));
|
|
6
6
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { cn } from '../lib/utils.
|
|
3
|
+
import { cn } from '../lib/utils.mjs';
|
|
4
4
|
export const Label = forwardRef(({ className, ...props }, ref) => (
|
|
5
5
|
// biome-ignore lint/a11y/noLabelWithoutControl: shadcn-style primitive; use htmlFor at call sites
|
|
6
6
|
_jsx("label", { ref: ref, className: cn('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70', className), ...props })));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from '../theme/theme-provider.
|
|
3
|
-
import { quadroThemes, themeLabels } from '../theme/themes.
|
|
4
|
-
import { Button } from './button.
|
|
2
|
+
import { useTheme } from '../theme/theme-provider.mjs';
|
|
3
|
+
import { quadroThemes, themeLabels } from '../theme/themes.mjs';
|
|
4
|
+
import { Button } from './button.mjs';
|
|
5
5
|
export function ThemeToolbar() {
|
|
6
6
|
const { preset, setPreset, colorMode, setColorMode, resolvedMode } = useTheme();
|
|
7
7
|
return (_jsxs("div", { className: "flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card/60 p-2 text-sm backdrop-blur", children: [_jsx("span", { className: "text-muted-foreground px-1", children: "Theme" }), quadroThemes.map((t) => (_jsx(Button, { type: "button", size: "sm", variant: preset === t ? 'default' : 'outline', onClick: () => setPreset(t), children: themeLabels[t] }, t))), _jsx("span", { className: "mx-2 hidden h-4 w-px bg-border sm:inline-block" }), _jsx("span", { className: "text-muted-foreground px-1", children: "Mode" }), [
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Button } from './components/button.mjs';
|
|
2
|
+
export { Card, CardContent, CardDescription, CardHeader, CardTitle, } from './components/card.mjs';
|
|
3
|
+
export { Input } from './components/input.mjs';
|
|
4
|
+
export { Label } from './components/label.mjs';
|
|
5
|
+
export { ThemeToolbar } from './components/theme-toolbar.mjs';
|
|
6
|
+
export { cn } from './lib/utils.mjs';
|
|
7
|
+
export { ThemeProvider, useTheme, } from './theme/theme-provider.mjs';
|
|
8
|
+
export { quadroThemes, themeLabels, } from './theme/themes.mjs';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quadrokit/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"./dist/styles.css"
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.
|
|
14
|
+
"import": "./dist/index.mjs"
|
|
15
15
|
},
|
|
16
16
|
"./styles.css": "./dist/styles.css",
|
|
17
17
|
"./tailwind-preset": {
|
|
18
18
|
"types": "./dist/tailwind-preset.d.ts",
|
|
19
|
-
"import": "./dist/tailwind-preset.
|
|
19
|
+
"import": "./dist/tailwind-preset.mjs"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsc -p tsconfig.build.json && cp src/styles.css dist/styles.css",
|
|
26
|
+
"build": "tsc -p tsconfig.build.json && bun ../../scripts/rename-dist-js-to-mjs.ts dist && cp src/styles.css dist/styles.css",
|
|
27
27
|
"prepublishOnly": "bun run build",
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
29
|
},
|
package/dist/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { Button } from './components/button.js';
|
|
2
|
-
export { Card, CardContent, CardDescription, CardHeader, CardTitle, } from './components/card.js';
|
|
3
|
-
export { Input } from './components/input.js';
|
|
4
|
-
export { Label } from './components/label.js';
|
|
5
|
-
export { ThemeToolbar } from './components/theme-toolbar.js';
|
|
6
|
-
export { cn } from './lib/utils.js';
|
|
7
|
-
export { ThemeProvider, useTheme, } from './theme/theme-provider.js';
|
|
8
|
-
export { quadroThemes, themeLabels, } from './theme/themes.js';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|