hazo_ui 2.2.2 → 2.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/README.md CHANGED
@@ -8,6 +8,41 @@ A set of UI components for common interaction elements in a SaaS app.
8
8
  npm install hazo_ui
9
9
  ```
10
10
 
11
+ ## Quick Setup (Required)
12
+
13
+ hazo_ui uses Tailwind CSS and CSS variables for styling. Follow these two steps:
14
+
15
+ ### Step 1: Import the CSS variables
16
+
17
+ Add to your app's entry point (e.g., `layout.tsx`, `_app.tsx`, or `main.tsx`):
18
+
19
+ ```tsx
20
+ import 'hazo_ui/styles.css';
21
+ ```
22
+
23
+ ### Step 2: Configure Tailwind
24
+
25
+ Update your `tailwind.config.ts`:
26
+
27
+ ```ts
28
+ import hazoUiPreset from 'hazo_ui/tailwind-preset';
29
+
30
+ export default {
31
+ presets: [hazoUiPreset],
32
+ content: [
33
+ './src/**/*.{js,ts,jsx,tsx}',
34
+ './node_modules/hazo_ui/dist/**/*.js', // Required: scan hazo_ui components
35
+ ],
36
+ // ... your other config
37
+ };
38
+ ```
39
+
40
+ That's it! The components will now render correctly with proper styling.
41
+
42
+ > **Note**: If you already have shadcn/ui configured with CSS variables, you may skip Step 1 as the variables are compatible.
43
+
44
+ ---
45
+
11
46
  ## Components
12
47
 
13
48
  ### Component Overview
@@ -0,0 +1,59 @@
1
+ /**
2
+ * hazo_ui CSS Variables and Base Styles
3
+ *
4
+ * Import this file in your app to get all required CSS variables:
5
+ * import 'hazo_ui/styles.css';
6
+ */
7
+
8
+ @layer base {
9
+ :root {
10
+ --background: 0 0% 100%;
11
+ --foreground: 222.2 84% 4.9%;
12
+ --card: 0 0% 100%;
13
+ --card-foreground: 222.2 84% 4.9%;
14
+ --popover: 0 0% 100%;
15
+ --popover-foreground: 222.2 84% 4.9%;
16
+ --primary: 222.2 47.4% 11.2%;
17
+ --primary-foreground: 210 40% 98%;
18
+ --secondary: 210 40% 96.1%;
19
+ --secondary-foreground: 222.2 47.4% 11.2%;
20
+ --muted: 210 40% 96.1%;
21
+ --muted-foreground: 215.4 16.3% 46.9%;
22
+ --accent: 210 40% 96.1%;
23
+ --accent-foreground: 222.2 47.4% 11.2%;
24
+ --destructive: 0 84.2% 60.2%;
25
+ --destructive-foreground: 210 40% 98%;
26
+ --border: 214.3 31.8% 91.4%;
27
+ --input: 214.3 31.8% 91.4%;
28
+ --ring: 222.2 84% 4.9%;
29
+ --radius: 0.5rem;
30
+ }
31
+
32
+ .dark {
33
+ --background: 222.2 84% 4.9%;
34
+ --foreground: 210 40% 98%;
35
+ --card: 222.2 84% 4.9%;
36
+ --card-foreground: 210 40% 98%;
37
+ --popover: 222.2 84% 4.9%;
38
+ --popover-foreground: 210 40% 98%;
39
+ --primary: 210 40% 98%;
40
+ --primary-foreground: 222.2 47.4% 11.2%;
41
+ --secondary: 217.2 32.6% 17.5%;
42
+ --secondary-foreground: 210 40% 98%;
43
+ --muted: 217.2 32.6% 17.5%;
44
+ --muted-foreground: 215 20.2% 65.1%;
45
+ --accent: 217.2 32.6% 17.5%;
46
+ --accent-foreground: 210 40% 98%;
47
+ --destructive: 0 62.8% 30.6%;
48
+ --destructive-foreground: 210 40% 98%;
49
+ --border: 217.2 32.6% 17.5%;
50
+ --input: 217.2 32.6% 17.5%;
51
+ --ring: 212.7 26.8% 83.9%;
52
+ }
53
+ }
54
+
55
+ @layer base {
56
+ * {
57
+ border-color: hsl(var(--border));
58
+ }
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_ui",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Set of UI components for common interaction elements in a SaaS app",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -10,12 +10,15 @@
10
10
  ".": {
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js",
13
- "require": "./dist/index.js"
13
+ "require": "./dist/index.cjs"
14
14
  },
15
+ "./styles.css": "./dist/styles.css",
16
+ "./tailwind-preset": "./tailwind.preset.js",
15
17
  "./package.json": "./package.json"
16
18
  },
17
19
  "files": [
18
20
  "dist",
21
+ "tailwind.preset.js",
19
22
  "README.md"
20
23
  ],
21
24
  "scripts": {
@@ -0,0 +1,86 @@
1
+ /**
2
+ * hazo_ui Tailwind CSS Preset
3
+ *
4
+ * Use this preset in your tailwind.config.js/ts:
5
+ *
6
+ * import hazoUiPreset from 'hazo_ui/tailwind-preset';
7
+ *
8
+ * export default {
9
+ * presets: [hazoUiPreset],
10
+ * content: [
11
+ * './src/**\/*.{js,ts,jsx,tsx}',
12
+ * './node_modules/hazo_ui/dist/**\/*.js',
13
+ * ],
14
+ * };
15
+ */
16
+
17
+ /** @type {import('tailwindcss').Config} */
18
+ module.exports = {
19
+ darkMode: ['class'],
20
+ theme: {
21
+ container: {
22
+ center: true,
23
+ padding: '2rem',
24
+ screens: {
25
+ '2xl': '1400px',
26
+ },
27
+ },
28
+ extend: {
29
+ colors: {
30
+ border: 'hsl(var(--border))',
31
+ input: 'hsl(var(--input))',
32
+ ring: 'hsl(var(--ring))',
33
+ background: 'hsl(var(--background))',
34
+ foreground: 'hsl(var(--foreground))',
35
+ primary: {
36
+ DEFAULT: 'hsl(var(--primary))',
37
+ foreground: 'hsl(var(--primary-foreground))',
38
+ },
39
+ secondary: {
40
+ DEFAULT: 'hsl(var(--secondary))',
41
+ foreground: 'hsl(var(--secondary-foreground))',
42
+ },
43
+ destructive: {
44
+ DEFAULT: 'hsl(var(--destructive))',
45
+ foreground: 'hsl(var(--destructive-foreground))',
46
+ },
47
+ muted: {
48
+ DEFAULT: 'hsl(var(--muted))',
49
+ foreground: 'hsl(var(--muted-foreground))',
50
+ },
51
+ accent: {
52
+ DEFAULT: 'hsl(var(--accent))',
53
+ foreground: 'hsl(var(--accent-foreground))',
54
+ },
55
+ popover: {
56
+ DEFAULT: 'hsl(var(--popover))',
57
+ foreground: 'hsl(var(--popover-foreground))',
58
+ },
59
+ card: {
60
+ DEFAULT: 'hsl(var(--card))',
61
+ foreground: 'hsl(var(--card-foreground))',
62
+ },
63
+ },
64
+ borderRadius: {
65
+ lg: 'var(--radius)',
66
+ md: 'calc(var(--radius) - 2px)',
67
+ sm: 'calc(var(--radius) - 4px)',
68
+ },
69
+ keyframes: {
70
+ 'accordion-down': {
71
+ from: { height: '0' },
72
+ to: { height: 'var(--radix-accordion-content-height)' },
73
+ },
74
+ 'accordion-up': {
75
+ from: { height: 'var(--radix-accordion-content-height)' },
76
+ to: { height: '0' },
77
+ },
78
+ },
79
+ animation: {
80
+ 'accordion-down': 'accordion-down 0.2s ease-out',
81
+ 'accordion-up': 'accordion-up 0.2s ease-out',
82
+ },
83
+ },
84
+ },
85
+ plugins: [require('tailwindcss-animate')],
86
+ };