@nurix/ui-component-library 1.1.2 → 1.1.3-stage.101
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 +95 -0
- package/dist/index.d.mts +1969 -12
- package/dist/index.d.ts +1969 -12
- package/dist/index.js +13523 -88
- package/dist/index.mjs +13462 -70
- package/dist/styles.css +2753 -0
- package/package.json +33 -6
package/README.md
CHANGED
|
@@ -1 +1,96 @@
|
|
|
1
1
|
# lego-land
|
|
2
|
+
|
|
3
|
+
## Theming docs
|
|
4
|
+
|
|
5
|
+
See `docs/THEMING.md`.
|
|
6
|
+
|
|
7
|
+
## Using in a consumer app
|
|
8
|
+
|
|
9
|
+
### 1) Ensure Tailwind keeps (and understands) the library classes
|
|
10
|
+
|
|
11
|
+
Your app must:
|
|
12
|
+
|
|
13
|
+
- include this package in Tailwind `content` so classnames are not purged
|
|
14
|
+
- map semantic colors to CSS variables, like this repo’s `tailwind.config.ts`
|
|
15
|
+
|
|
16
|
+
Example `tailwind.config.ts` in your consumer app:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import type { Config } from "tailwindcss";
|
|
20
|
+
|
|
21
|
+
const config: Config = {
|
|
22
|
+
content: [
|
|
23
|
+
"./src/**/*.{ts,tsx}",
|
|
24
|
+
"./node_modules/@nurix/ui-component-library/dist/**/*.{js,mjs}",
|
|
25
|
+
],
|
|
26
|
+
theme: {
|
|
27
|
+
extend: {
|
|
28
|
+
colors: {
|
|
29
|
+
border: "hsl(var(--border))",
|
|
30
|
+
input: "hsl(var(--input))",
|
|
31
|
+
ring: "hsl(var(--ring))",
|
|
32
|
+
background: "hsl(var(--background))",
|
|
33
|
+
foreground: "hsl(var(--foreground))",
|
|
34
|
+
primary: {
|
|
35
|
+
DEFAULT: "hsl(var(--primary))",
|
|
36
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
37
|
+
},
|
|
38
|
+
secondary: {
|
|
39
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
40
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
41
|
+
},
|
|
42
|
+
destructive: {
|
|
43
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
44
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
45
|
+
},
|
|
46
|
+
muted: {
|
|
47
|
+
DEFAULT: "hsl(var(--muted))",
|
|
48
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
49
|
+
},
|
|
50
|
+
accent: {
|
|
51
|
+
DEFAULT: "hsl(var(--accent))",
|
|
52
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
53
|
+
},
|
|
54
|
+
popover: {
|
|
55
|
+
DEFAULT: "hsl(var(--popover))",
|
|
56
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
57
|
+
},
|
|
58
|
+
card: {
|
|
59
|
+
DEFAULT: "hsl(var(--card))",
|
|
60
|
+
foreground: "hsl(var(--card-foreground))",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
borderRadius: {
|
|
64
|
+
lg: "var(--radius)",
|
|
65
|
+
md: "calc(var(--radius) - 2px)",
|
|
66
|
+
sm: "calc(var(--radius) - 4px)",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default config;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2) Wrap with the theme provider
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import {
|
|
79
|
+
NurixThemeProvider,
|
|
80
|
+
Button,
|
|
81
|
+
Input,
|
|
82
|
+
Switch,
|
|
83
|
+
} from "@nurix/ui-component-library";
|
|
84
|
+
|
|
85
|
+
export function Example() {
|
|
86
|
+
return (
|
|
87
|
+
<NurixThemeProvider defaultTheme="dark">
|
|
88
|
+
<div className="flex flex-col gap-4">
|
|
89
|
+
<Button variant="secondary">Click</Button>
|
|
90
|
+
<Input label="Title" placeholder="Email" supportingText="Help text" />
|
|
91
|
+
<Switch defaultChecked />
|
|
92
|
+
</div>
|
|
93
|
+
</NurixThemeProvider>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|