@rafal.lemieszewski/tide-ui 0.41.4 → 0.42.0
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 +49 -17
- package/dist/components/ui/fixture-status.d.ts +2 -0
- package/dist/components/ui/icon.d.ts +1 -0
- package/dist/index.cjs.js +38 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11585 -11563
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -25,26 +25,12 @@ Make sure you have React 18+ installed:
|
|
|
25
25
|
npm install react@>=18.0.0 react-dom@>=18.0.0
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
### Setup Tailwind CSS
|
|
29
|
-
|
|
30
|
-
This library requires Tailwind CSS. Add the preset to your `tailwind.config.js`:
|
|
31
|
-
|
|
32
|
-
```javascript
|
|
33
|
-
module.exports = {
|
|
34
|
-
presets: [
|
|
35
|
-
// Add Tide UI preset here when available
|
|
36
|
-
],
|
|
37
|
-
content: [
|
|
38
|
-
"./src/**/*.{js,ts,jsx,tsx}",
|
|
39
|
-
"./node_modules/@rafal.lemieszewski/tide-ui/**/*.{js,ts,jsx,tsx}",
|
|
40
|
-
],
|
|
41
|
-
// ... rest of your config
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
28
|
## Quick Start
|
|
46
29
|
|
|
30
|
+
Import the CSS styles and components:
|
|
31
|
+
|
|
47
32
|
```typescript
|
|
33
|
+
import '@rafal.lemieszewski/tide-ui/styles'
|
|
48
34
|
import { Button, Card, CardContent, Badge } from '@rafal.lemieszewski/tide-ui'
|
|
49
35
|
|
|
50
36
|
function App() {
|
|
@@ -61,6 +47,52 @@ function App() {
|
|
|
61
47
|
}
|
|
62
48
|
```
|
|
63
49
|
|
|
50
|
+
## Styling & Customization
|
|
51
|
+
|
|
52
|
+
### CSS Variables
|
|
53
|
+
|
|
54
|
+
Override design tokens by customizing CSS variables:
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
:root {
|
|
58
|
+
--color-background-brand: #your-color;
|
|
59
|
+
--color-text-primary: #your-color;
|
|
60
|
+
/* See src/index.css for all available variables */
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### className Prop
|
|
65
|
+
|
|
66
|
+
All components accept a `className` prop for custom styling:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { Button } from '@rafal.lemieszewski/tide-ui'
|
|
70
|
+
|
|
71
|
+
// Using custom CSS classes
|
|
72
|
+
<Button className="my-custom-class">Custom Button</Button>
|
|
73
|
+
|
|
74
|
+
// Using inline styles
|
|
75
|
+
<Button style={{ backgroundColor: 'purple' }}>Purple Button</Button>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Tailwind Utility Classes
|
|
79
|
+
|
|
80
|
+
**For apps with Tailwind CSS installed:** You can use Tailwind utility classes to override component styles. Use the `!` prefix for guaranteed specificity:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
// Override background color
|
|
84
|
+
<Button className="!bg-purple-500 !hover:bg-purple-600">
|
|
85
|
+
Purple Button
|
|
86
|
+
</Button>
|
|
87
|
+
|
|
88
|
+
// Override spacing
|
|
89
|
+
<Card className="!p-8 !rounded-xl">
|
|
90
|
+
Custom Card
|
|
91
|
+
</Card>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Note:** Tailwind is not required. The library includes all necessary styles out-of-the-box.
|
|
95
|
+
|
|
64
96
|
## Available Components
|
|
65
97
|
|
|
66
98
|
### Core Components
|
|
@@ -23,6 +23,8 @@ export interface FixtureStatusProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
23
23
|
showObject?: boolean;
|
|
24
24
|
/** Whether the label color should match the icon color (default: true) */
|
|
25
25
|
coloredLabel?: boolean;
|
|
26
|
+
/** Whether to show only the icon with a tooltip (default: false) */
|
|
27
|
+
iconOnly?: boolean;
|
|
26
28
|
}
|
|
27
29
|
declare const FixtureStatus: React.ForwardRefExoticComponent<FixtureStatusProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
30
|
export { FixtureStatus, statusConfig };
|
|
@@ -16,6 +16,7 @@ declare const iconColors: {
|
|
|
16
16
|
readonly "brand-hover": "text-[var(--color-icon-brand-hover)]";
|
|
17
17
|
readonly "on-action": "text-[var(--color-icon-on-action)]";
|
|
18
18
|
readonly inverse: "text-[var(--color-icon-inverse)]";
|
|
19
|
+
readonly violet: "text-[var(--violet-500)]";
|
|
19
20
|
};
|
|
20
21
|
declare const iconSizes: {
|
|
21
22
|
readonly sm: "w-[var(--size-3xsm)] h-[var(--size-3xsm)]";
|