@skalar-saas/design-system 0.1.160 → 0.2.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 +83 -68
- package/dist/design-system.css +1 -1
- package/dist/{index-jPW4J51n.cjs → index-CvxKpepD.cjs} +2 -2
- package/dist/{index-jPW4J51n.cjs.map → index-CvxKpepD.cjs.map} +1 -1
- package/dist/{index-DpOd1Khq.js → index-D9aA2m7f.js} +2 -2
- package/dist/{index-DpOd1Khq.js.map → index-D9aA2m7f.js.map} +1 -1
- package/dist/{index-wbeGpWS7.js → index-DYdvRd97.js} +6343 -6105
- package/dist/index-DYdvRd97.js.map +1 -0
- package/dist/{index-CFw7Locn.cjs → index-Ymrs1TGO.cjs} +40 -40
- package/dist/index-Ymrs1TGO.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +300 -297
- package/dist/shared/ui/ActivityFeed/ActivityFeed.d.ts +44 -0
- package/dist/shared/ui/ActivityFeed/index.d.ts +2 -0
- package/dist/shared/ui/AlertCallout/AlertCallout.d.ts +37 -0
- package/dist/shared/ui/AlertCallout/index.d.ts +2 -0
- package/dist/shared/ui/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/shared/ui/DateRangePicker/DateRangePicker.stories.d.ts +1 -1
- package/dist/shared/ui/OptionsEditor/OptionsEditor.d.ts +32 -0
- package/dist/shared/ui/OptionsEditor/index.d.ts +1 -0
- package/dist/shared/ui/Planner/Planner.d.ts +11 -1
- package/dist/shared/ui/Planner/index.d.ts +1 -1
- package/dist/shared/ui/Stepper/Stepper.d.ts +25 -15
- package/dist/shared/ui/Switcher/Switcher.d.ts +5 -1
- package/package.json +116 -117
- package/src/styles/theme.css +536 -536
- package/tailwind.preset.js +278 -278
- package/dist/index-CFw7Locn.cjs.map +0 -1
- package/dist/index-wbeGpWS7.js.map +0 -1
- package/src/README.md +0 -110
- package/src/styles/README.md +0 -81
package/src/README.md
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# Shared Icons
|
|
2
|
-
|
|
3
|
-
This directory contains reusable SVG icon components for the project.
|
|
4
|
-
|
|
5
|
-
## Structure
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
src/shared/icons/
|
|
9
|
-
├── ChatIcon.tsx # Individual icon component
|
|
10
|
-
├── AICommentaryIcon.tsx # Individual icon component
|
|
11
|
-
├── index.ts # Barrel export
|
|
12
|
-
└── README.md # This file
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Source Files
|
|
16
|
-
|
|
17
|
-
All SVG source files are located in `/public/icons/`.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
### Importing Icons
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
// Import single icon
|
|
25
|
-
import { ChatIcon } from '@/shared/icons';
|
|
26
|
-
|
|
27
|
-
// Import multiple icons
|
|
28
|
-
import { ChatIcon, AICommentaryIcon } from '@/shared/icons';
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Using in Components
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
// Default size (20px)
|
|
35
|
-
<ChatIcon />
|
|
36
|
-
|
|
37
|
-
// Custom size
|
|
38
|
-
<ChatIcon size={24} />
|
|
39
|
-
|
|
40
|
-
// With custom class
|
|
41
|
-
<ChatIcon className="text-blue-500" />
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Adding a New Icon
|
|
45
|
-
|
|
46
|
-
1. **Save the SVG** to `/public/icons/` with a descriptive name (e.g., `iconsax-new-icon.svg`)
|
|
47
|
-
|
|
48
|
-
2. **Create the component file** in this directory:
|
|
49
|
-
```tsx
|
|
50
|
-
// NewIcon.tsx
|
|
51
|
-
import React from 'react';
|
|
52
|
-
|
|
53
|
-
export interface NewIconProps {
|
|
54
|
-
size?: number;
|
|
55
|
-
className?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const NewIcon = ({ size = 20, className }: NewIconProps) => (
|
|
59
|
-
<svg
|
|
60
|
-
width={size}
|
|
61
|
-
height={size}
|
|
62
|
-
viewBox="0 0 20 20"
|
|
63
|
-
fill="none"
|
|
64
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
65
|
-
className={className}
|
|
66
|
-
>
|
|
67
|
-
{/* SVG paths here - use fill="currentColor" for theme compatibility */}
|
|
68
|
-
</svg>
|
|
69
|
-
);
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
3. **Export in index.ts**:
|
|
73
|
-
```tsx
|
|
74
|
-
export { NewIcon } from './NewIcon';
|
|
75
|
-
export type { NewIconProps } from './NewIcon';
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Naming Convention
|
|
79
|
-
|
|
80
|
-
- Component name: PascalCase (e.g., `ChatIcon`, `AICommentaryIcon`)
|
|
81
|
-
- File name: Same as component name (e.g., `ChatIcon.tsx`)
|
|
82
|
-
- SVG source: kebab-case in `/public/icons/` (e.g., `iconsax-chat.svg`)
|
|
83
|
-
|
|
84
|
-
## Best Practices
|
|
85
|
-
|
|
86
|
-
1. **Use `currentColor`** for fill/stroke to inherit text color from parent
|
|
87
|
-
2. **Accept `size` prop** for flexible sizing (default: 20px)
|
|
88
|
-
3. **Accept `className` prop** for styling flexibility
|
|
89
|
-
4. **Preserve viewBox** from original SVG for correct scaling
|
|
90
|
-
5. **Export TypeScript types** alongside components
|
|
91
|
-
6. **Document the icon** with JSDoc comments
|
|
92
|
-
|
|
93
|
-
## Theme Compatibility
|
|
94
|
-
|
|
95
|
-
All icons use `fill="currentColor"` to automatically adapt to the theme's text color. This allows icons to change color based on:
|
|
96
|
-
- Parent component text color
|
|
97
|
-
- Hover states
|
|
98
|
-
- Active/inactive states
|
|
99
|
-
- Dark/light mode (when implemented)
|
|
100
|
-
|
|
101
|
-
Example:
|
|
102
|
-
```tsx
|
|
103
|
-
<div className="text-blue-500">
|
|
104
|
-
<ChatIcon /> {/* Will be blue */}
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div className="text-red-500 hover:text-red-700">
|
|
108
|
-
<ChatIcon /> {/* Will be red, darker on hover */}
|
|
109
|
-
</div>
|
|
110
|
-
```
|
package/src/styles/README.md
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# CSS Files - IMPORTANT
|
|
2
|
-
|
|
3
|
-
## 📁 Files Overview
|
|
4
|
-
|
|
5
|
-
### `globals.css` - PRODUCTION (DO NOT MODIFY)
|
|
6
|
-
- **Purpose**: Used in production builds (npm package)
|
|
7
|
-
- **Status**: Legacy file, will be replaced eventually
|
|
8
|
-
- **Rule**: ⛔ **NEVER MODIFY THIS FILE**
|
|
9
|
-
|
|
10
|
-
### `globals_new.css` - DEVELOPMENT (CORRECT TOKENS)
|
|
11
|
-
- **Purpose**: New token system based on Figma design
|
|
12
|
-
- **Status**: Active development, used in Storybook
|
|
13
|
-
- **Contains**: Clean semantic tokens (36 tokens per theme)
|
|
14
|
-
- **Rule**: ✅ This is the source of truth for new components
|
|
15
|
-
- **Rule**: ⚠️ Only modify if updating tokens from Figma
|
|
16
|
-
|
|
17
|
-
### `globals_old_backup.css` - BACKUP
|
|
18
|
-
- **Purpose**: Backup of old globals.css
|
|
19
|
-
- **Rule**: ⛔ DO NOT MODIFY OR DELETE
|
|
20
|
-
|
|
21
|
-
## 🔧 Usage
|
|
22
|
-
|
|
23
|
-
### Storybook (Development)
|
|
24
|
-
Uses `globals_new.css` - configured in `.storybook/preview.ts`
|
|
25
|
-
|
|
26
|
-
### Production Build (npm)
|
|
27
|
-
Uses `globals.css` - configured in build process
|
|
28
|
-
|
|
29
|
-
## 🎨 Token System
|
|
30
|
-
|
|
31
|
-
The `globals_new.css` file contains:
|
|
32
|
-
- **36 semantic tokens** for light theme
|
|
33
|
-
- **36 semantic tokens** for dark theme
|
|
34
|
-
- Based directly on Figma design
|
|
35
|
-
- No invented color scales (primary-50, primary-100, etc.)
|
|
36
|
-
|
|
37
|
-
### Token Categories:
|
|
38
|
-
- Primitive colors: `--black`, `--white`
|
|
39
|
-
- Surfaces: `--surface-bg`, `--surface-1` to `--surface-4`
|
|
40
|
-
- Text emphasis: `--text-disabled`, `--placeholder`, `--low-em`, `--med-em`, `--high-em`
|
|
41
|
-
- Brand: `--brand-primary-main`, `--brand-secondary-main`, etc.
|
|
42
|
-
- Status colors: Warning, Success, Info, Danger (with `-em`, `-main`, `-accent-*` variants)
|
|
43
|
-
- Spacing: `--spacing-0` to `--spacing-26`
|
|
44
|
-
|
|
45
|
-
## 🚨 Critical Rules
|
|
46
|
-
|
|
47
|
-
1. **NEVER modify `globals.css`** - It's used in production
|
|
48
|
-
2. **Only modify `globals_new.css` if:**
|
|
49
|
-
- Updating tokens from Figma design
|
|
50
|
-
- Adding new tokens approved by design team
|
|
51
|
-
3. **When migrating components:**
|
|
52
|
-
- Update component to use new semantic tokens
|
|
53
|
-
- Test in both light and dark modes
|
|
54
|
-
- DO NOT modify the CSS files
|
|
55
|
-
|
|
56
|
-
## 📋 Migration Process
|
|
57
|
-
|
|
58
|
-
1. Components use `globals.css` (old) in production
|
|
59
|
-
2. New components are built with `globals_new.css` tokens
|
|
60
|
-
3. Old components are gradually migrated to new tokens
|
|
61
|
-
4. When all components are migrated: `globals_new.css` → `globals.css`
|
|
62
|
-
5. Delete `globals_old_backup.css`
|
|
63
|
-
|
|
64
|
-
## 💡 Quick Reference
|
|
65
|
-
|
|
66
|
-
**Need to add a new component?**
|
|
67
|
-
→ Use tokens from `globals_new.css`
|
|
68
|
-
|
|
69
|
-
**Found a component with old tokens (primary-900, gray-500, etc.)?**
|
|
70
|
-
→ Migrate it to use semantic tokens (success-main, surface-3, etc.)
|
|
71
|
-
|
|
72
|
-
**Want to change a color?**
|
|
73
|
-
→ DON'T! Check with design team first, update Figma, then update `globals_new.css`
|
|
74
|
-
|
|
75
|
-
**Storybook showing wrong colors?**
|
|
76
|
-
→ Check that `.storybook/preview.ts` imports `globals_new.css`
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
**Last updated**: Nov 2025
|
|
81
|
-
**Token system version**: 1.0 (Figma-based semantic tokens)
|