@rafal.lemieszewski/tide-ui 0.41.4 → 0.43.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/index.d.ts +6 -2
- package/dist/components/ui/activity-log.d.ts +61 -0
- package/dist/components/ui/attributes-list.d.ts +94 -0
- package/dist/components/ui/avatar-group.d.ts +16 -0
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/fixture-status.d.ts +2 -0
- package/dist/components/ui/icon.d.ts +1 -0
- package/dist/index.cjs.js +1694 -1694
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +15154 -14773
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/components/ui/timeline.d.ts +0 -58
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
|
|
@@ -4,6 +4,8 @@ export { Chart, generateChartColors, createChartConfig, chartColorSchemes } from
|
|
|
4
4
|
export type { ChartProps, ChartConfig, ChartDataPoint, ChartType, ChartColorScheme } from './ui/chart';
|
|
5
5
|
export { Avatar, AvatarImage, AvatarFallback, avatarVariants, avatarFallbackVariants } from './ui/avatar';
|
|
6
6
|
export type { AvatarProps, AvatarFallbackProps } from './ui/avatar';
|
|
7
|
+
export { AvatarGroup } from './ui/avatar-group';
|
|
8
|
+
export type { AvatarGroupProps, AvatarGroupSize } from './ui/avatar-group';
|
|
7
9
|
export { Badge } from './ui/badge';
|
|
8
10
|
export type { BadgeProps } from './ui/badge';
|
|
9
11
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './ui/collapsible';
|
|
@@ -27,8 +29,10 @@ export type { FixtureStatusProps, StatusValue, StatusConfig } from './ui/fixture
|
|
|
27
29
|
export { Switch } from './ui/switch';
|
|
28
30
|
export { Textarea } from './ui/textarea';
|
|
29
31
|
export type { TextareaProps } from './ui/textarea';
|
|
30
|
-
export {
|
|
31
|
-
export type {
|
|
32
|
+
export { ActivityLog, ActivityLogItem, ActivityLogSeparator, ActivityLogHeader, ActivityLogContent, ActivityLogDescription, ActivityLogTime, ActivityLogChevron, ActivityLogValue, } from './ui/activity-log';
|
|
33
|
+
export type { ActivityLogProps, ActivityLogItemProps, ActivityLogSeparatorProps, ActivityLogHeaderProps, ActivityLogContentProps, ActivityLogDescriptionProps, ActivityLogTimeProps, ActivityLogChevronProps, ActivityLogValueProps, } from './ui/activity-log';
|
|
34
|
+
export { AttributesList, AttributesSeparator, AttributesGroup, AttributesItem, AttributesRow, AttributesLabel, AttributesValue, AttributesContent, AttributesChevron, } from './ui/attributes-list';
|
|
35
|
+
export type { AttributesListProps, AttributesSeparatorProps, AttributesGroupProps, AttributesItemProps, AttributesRowProps, AttributesLabelProps, AttributesValueProps, AttributesContentProps, AttributesChevronProps, } from './ui/attributes-list';
|
|
32
36
|
export { Editable, EditablePreview, EditableInput, EditableDisplay, EditableField } from './ui/editable';
|
|
33
37
|
export type { EditableProps, EditablePreviewProps, EditableInputProps } from './ui/editable';
|
|
34
38
|
export { FormField, FormLabel, FormControl, FormHelperText, FormErrorMessage } from './ui/form-field';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CollapsibleContent } from './collapsible';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ActivityLogProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Time threshold in milliseconds. If the time difference between consecutive
|
|
6
|
+
* ActivityLogItem timestamps exceeds this value, a ActivityLogSeparator will be
|
|
7
|
+
* automatically inserted between them.
|
|
8
|
+
*/
|
|
9
|
+
separatorThreshold?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const ActivityLog: React.ForwardRefExoticComponent<ActivityLogProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export interface ActivityLogItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/**
|
|
14
|
+
* Whether this timeline item can be expanded/collapsed
|
|
15
|
+
*/
|
|
16
|
+
collapsible?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Default open state for uncontrolled collapsible items
|
|
19
|
+
*/
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Controlled open state
|
|
23
|
+
*/
|
|
24
|
+
open?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when open state changes
|
|
27
|
+
*/
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Timestamp for this activity log item (used for automatic separator insertion)
|
|
31
|
+
*/
|
|
32
|
+
timestamp?: Date | number | string;
|
|
33
|
+
}
|
|
34
|
+
declare const ActivityLogItem: React.ForwardRefExoticComponent<ActivityLogItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export interface ActivityLogSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
36
|
+
}
|
|
37
|
+
declare const ActivityLogSeparator: React.ForwardRefExoticComponent<ActivityLogSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export interface ActivityLogHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
/**
|
|
40
|
+
* If true, the header will render as a CollapsibleTrigger
|
|
41
|
+
* This is automatically set when ActivityLogItem has collapsible={true}
|
|
42
|
+
*/
|
|
43
|
+
asCollapsibleTrigger?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare const ActivityLogHeader: React.ForwardRefExoticComponent<ActivityLogHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
export interface ActivityLogContentProps extends React.ComponentPropsWithoutRef<typeof CollapsibleContent> {
|
|
47
|
+
}
|
|
48
|
+
declare const ActivityLogContent: React.ForwardRefExoticComponent<ActivityLogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export interface ActivityLogDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
|
+
}
|
|
51
|
+
declare const ActivityLogDescription: React.ForwardRefExoticComponent<ActivityLogDescriptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
export interface ActivityLogTimeProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
53
|
+
}
|
|
54
|
+
declare const ActivityLogTime: React.ForwardRefExoticComponent<ActivityLogTimeProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
55
|
+
export interface ActivityLogChevronProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
56
|
+
}
|
|
57
|
+
declare const ActivityLogChevron: React.ForwardRefExoticComponent<ActivityLogChevronProps & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export interface ActivityLogValueProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
59
|
+
}
|
|
60
|
+
declare const ActivityLogValue: React.ForwardRefExoticComponent<ActivityLogValueProps & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
export { ActivityLog, ActivityLogItem, ActivityLogSeparator, ActivityLogHeader, ActivityLogContent, ActivityLogDescription, ActivityLogTime, ActivityLogChevron, ActivityLogValue, };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CollapsibleContent } from './collapsible';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface AttributesListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Label for the "View all" button that shows hidden items
|
|
6
|
+
* @default "More details"
|
|
7
|
+
*/
|
|
8
|
+
showHiddenLabel?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Label for the "View less" button that hides hidden items
|
|
11
|
+
* @default "Less details"
|
|
12
|
+
*/
|
|
13
|
+
hideLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Default visibility state for hidden items
|
|
16
|
+
*/
|
|
17
|
+
defaultShowHidden?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const AttributesList: React.ForwardRefExoticComponent<AttributesListProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export interface AttributesSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
}
|
|
22
|
+
declare const AttributesSeparator: React.ForwardRefExoticComponent<AttributesSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export interface AttributesGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
24
|
+
/**
|
|
25
|
+
* Section label/header
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Label for the "View all" button that shows hidden items
|
|
30
|
+
* @default "More details"
|
|
31
|
+
*/
|
|
32
|
+
showHiddenLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Label for the "View less" button that hides hidden items
|
|
35
|
+
* @default "Less details"
|
|
36
|
+
*/
|
|
37
|
+
hideLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Default visibility state for hidden items
|
|
40
|
+
*/
|
|
41
|
+
defaultShowHidden?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare const AttributesGroup: React.ForwardRefExoticComponent<AttributesGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export interface AttributesItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
45
|
+
/**
|
|
46
|
+
* Whether this item can be expanded/collapsed
|
|
47
|
+
*/
|
|
48
|
+
collapsible?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Default open state for uncontrolled collapsible items
|
|
51
|
+
*/
|
|
52
|
+
defaultOpen?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Controlled open state
|
|
55
|
+
*/
|
|
56
|
+
open?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Callback when open state changes
|
|
59
|
+
*/
|
|
60
|
+
onOpenChange?: (open: boolean) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Whether this item should be hidden until "View all" is clicked
|
|
63
|
+
*/
|
|
64
|
+
hidden?: boolean;
|
|
65
|
+
}
|
|
66
|
+
declare const AttributesItem: React.ForwardRefExoticComponent<AttributesItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export interface AttributesRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
68
|
+
/**
|
|
69
|
+
* If true, the row will render as a CollapsibleTrigger
|
|
70
|
+
* This is automatically set when AttributesItem has collapsible={true}
|
|
71
|
+
*/
|
|
72
|
+
asCollapsibleTrigger?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Optional external link configuration
|
|
75
|
+
*/
|
|
76
|
+
externalLink?: {
|
|
77
|
+
href: string;
|
|
78
|
+
label: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
declare const AttributesRow: React.ForwardRefExoticComponent<AttributesRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
82
|
+
export interface AttributesLabelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
83
|
+
}
|
|
84
|
+
declare const AttributesLabel: React.ForwardRefExoticComponent<AttributesLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
85
|
+
export interface AttributesValueProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
86
|
+
}
|
|
87
|
+
declare const AttributesValue: React.ForwardRefExoticComponent<AttributesValueProps & React.RefAttributes<HTMLDivElement>>;
|
|
88
|
+
export interface AttributesContentProps extends React.ComponentPropsWithoutRef<typeof CollapsibleContent> {
|
|
89
|
+
}
|
|
90
|
+
declare const AttributesContent: React.ForwardRefExoticComponent<AttributesContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
export interface AttributesChevronProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
92
|
+
}
|
|
93
|
+
declare const AttributesChevron: React.ForwardRefExoticComponent<AttributesChevronProps & React.RefAttributes<HTMLDivElement>>;
|
|
94
|
+
export { AttributesList, AttributesSeparator, AttributesGroup, AttributesItem, AttributesRow, AttributesLabel, AttributesValue, AttributesContent, AttributesChevron, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const avatarGroupOverlapClasses: {
|
|
3
|
+
readonly xxs: "-ml-[6px]";
|
|
4
|
+
readonly xs: "-ml-[var(--space-xsm)]";
|
|
5
|
+
readonly sm: "-ml-[var(--space-sm)]";
|
|
6
|
+
readonly md: "-ml-[var(--space-md)]";
|
|
7
|
+
readonly lg: "-ml-[var(--space-lg)]";
|
|
8
|
+
readonly xl: "-ml-[var(--space-lg)]";
|
|
9
|
+
};
|
|
10
|
+
export type AvatarGroupSize = keyof typeof avatarGroupOverlapClasses;
|
|
11
|
+
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
/** Size of avatars in the group (determines overlap amount) */
|
|
13
|
+
size?: AvatarGroupSize;
|
|
14
|
+
}
|
|
15
|
+
declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { AvatarGroup };
|
|
@@ -3,11 +3,11 @@ import * as React from "react";
|
|
|
3
3
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
4
|
declare const avatarVariants: (props?: ({
|
|
5
5
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
6
|
-
|
|
6
|
+
type?: "user" | "organization" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
declare const avatarFallbackVariants: (props?: ({
|
|
9
9
|
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
|
-
|
|
10
|
+
type?: "user" | "organization" | null | undefined;
|
|
11
11
|
variant?: "success" | "warning" | "magenta" | "violet" | "information" | "error" | null | undefined;
|
|
12
12
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
13
|
interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
|
|
@@ -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)]";
|