pure-react-ui 1.4.6 → 1.5.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 +263 -47
- package/lib/components/Button/Button.css +170 -0
- package/lib/components/Button/Button.d.ts +11 -0
- package/lib/components/Button/Button.d.ts.map +1 -0
- package/lib/components/Button/Button.js +30 -0
- package/lib/components/Button/Button.js.map +1 -0
- package/lib/components/Card/Card.css +116 -0
- package/lib/components/Card/Card.d.ts +16 -0
- package/lib/components/Card/Card.d.ts.map +1 -0
- package/lib/components/Card/Card.js +29 -0
- package/lib/components/Card/Card.js.map +1 -0
- package/lib/components/Flex/Flex.css +106 -0
- package/lib/components/Flex/Flex.d.ts +14 -0
- package/lib/components/Flex/Flex.d.ts.map +1 -0
- package/lib/components/Flex/Flex.js +40 -0
- package/lib/components/Flex/Flex.js.map +1 -0
- package/lib/components/Icon/Icon.css +88 -0
- package/lib/components/Icon/Icon.d.ts +13 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -0
- package/lib/components/Icon/Icon.js +26 -0
- package/lib/components/Icon/Icon.js.map +1 -0
- package/lib/components/Icon/icons.d.ts +198 -0
- package/lib/components/Icon/icons.d.ts.map +1 -0
- package/lib/components/Icon/icons.js +155 -0
- package/lib/components/Icon/icons.js.map +1 -0
- package/lib/components/Modal/Modal.css +197 -0
- package/lib/components/Modal/Modal.d.ts +16 -0
- package/lib/components/Modal/Modal.d.ts.map +1 -0
- package/lib/components/Modal/Modal.js +45 -0
- package/lib/components/Modal/Modal.js.map +1 -0
- package/lib/components/Space/Space.css +73 -0
- package/lib/components/Space/Space.d.ts +12 -0
- package/lib/components/Space/Space.d.ts.map +1 -0
- package/lib/components/Space/Space.js +33 -0
- package/lib/components/Space/Space.js.map +1 -0
- package/lib/components/Text/Text.css +240 -0
- package/lib/components/Text/Text.d.ts +16 -0
- package/lib/components/Text/Text.d.ts.map +1 -0
- package/lib/components/Text/Text.js +26 -0
- package/lib/components/Text/Text.js.map +1 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/package.json +41 -58
- package/dist/components/Button/Button.d.ts +0 -5
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/Button.types.d.ts +0 -14
- package/dist/components/Button/Button.types.d.ts.map +0 -1
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Button/index.d.ts.map +0 -1
- package/dist/dist/index.css +0 -1
- package/dist/index.css +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.esm.css +0 -1
- package/dist/index.esm.js +0 -25
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -27
- package/dist/index.js.map +0 -1
- package/dist/setupTests.d.ts +0 -2
- package/dist/setupTests.d.ts.map +0 -1
- package/src/styles/index.css +0 -81
- package/src/styles/variables.css +0 -80
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pure React UI
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A pure React UI component library built with TypeScript. No external dependencies required (except React and ReactDOM as peer dependencies).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,57 +8,273 @@ A modern, accessible React UI component library with TypeScript support.
|
|
|
8
8
|
npm install pure-react-ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</PureButton>
|
|
24
|
-
|
|
25
|
-
<PureButton variant="secondary" size="lg" fullWidth>
|
|
26
|
-
Full Width Button
|
|
27
|
-
</PureButton>
|
|
28
|
-
|
|
29
|
-
<PureButton variant="outline" size="sm" loading>
|
|
30
|
-
Loading...
|
|
31
|
-
</PureButton>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default App;
|
|
11
|
+
## Components
|
|
12
|
+
|
|
13
|
+
### Button
|
|
14
|
+
|
|
15
|
+
A versatile button component with multiple variants and sizes.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Button } from 'pure-react-ui';
|
|
19
|
+
|
|
20
|
+
<Button variant="primary" size="medium" onClick={handleClick}>
|
|
21
|
+
Click Me
|
|
22
|
+
</Button>
|
|
37
23
|
```
|
|
38
24
|
|
|
39
|
-
|
|
25
|
+
**Props:**
|
|
26
|
+
- `variant`: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' (default: 'primary')
|
|
27
|
+
- `size`: 'small' | 'medium' | 'large' (default: 'medium')
|
|
28
|
+
- `fullWidth`: boolean (default: false)
|
|
29
|
+
- `loading`: boolean (default: false)
|
|
30
|
+
- All standard button HTML attributes
|
|
31
|
+
|
|
32
|
+
### Card
|
|
33
|
+
|
|
34
|
+
A flexible card component for displaying content.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Card } from 'pure-react-ui';
|
|
38
|
+
|
|
39
|
+
<Card
|
|
40
|
+
title="Card Title"
|
|
41
|
+
subtitle="Card Subtitle"
|
|
42
|
+
image="/path/to/image.jpg"
|
|
43
|
+
hoverable
|
|
44
|
+
shadow="medium"
|
|
45
|
+
>
|
|
46
|
+
Card content goes here
|
|
47
|
+
</Card>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Props:**
|
|
51
|
+
- `title`: string (optional)
|
|
52
|
+
- `subtitle`: string (optional)
|
|
53
|
+
- `image`: string (optional)
|
|
54
|
+
- `imageAlt`: string (optional)
|
|
55
|
+
- `footer`: React.ReactNode (optional)
|
|
56
|
+
- `hoverable`: boolean (default: false)
|
|
57
|
+
- `shadow`: 'none' | 'small' | 'medium' | 'large' (default: 'medium')
|
|
58
|
+
- `onClick`: () => void (optional)
|
|
59
|
+
|
|
60
|
+
### Modal
|
|
61
|
+
|
|
62
|
+
A modal dialog component with overlay and keyboard support.
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { Modal } from 'pure-react-ui';
|
|
66
|
+
|
|
67
|
+
<Modal
|
|
68
|
+
isOpen={isOpen}
|
|
69
|
+
onClose={() => setIsOpen(false)}
|
|
70
|
+
title="Modal Title"
|
|
71
|
+
size="medium"
|
|
72
|
+
>
|
|
73
|
+
Modal content goes here
|
|
74
|
+
</Modal>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Props:**
|
|
78
|
+
- `isOpen`: boolean (required)
|
|
79
|
+
- `onClose`: () => void (required)
|
|
80
|
+
- `title`: string (optional)
|
|
81
|
+
- `size`: 'small' | 'medium' | 'large' | 'fullscreen' (default: 'medium')
|
|
82
|
+
- `closeOnOverlayClick`: boolean (default: true)
|
|
83
|
+
- `closeOnEscape`: boolean (default: true)
|
|
84
|
+
- `showCloseButton`: boolean (default: true)
|
|
85
|
+
|
|
86
|
+
### Icon
|
|
87
|
+
|
|
88
|
+
A comprehensive icon component library with 100+ SVG icons.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { Icon } from 'pure-react-ui';
|
|
92
|
+
|
|
93
|
+
<Icon name="Home" size={24} color="#007bff" />
|
|
94
|
+
<Icon name="Search" size={32} onClick={handleClick} />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Props:**
|
|
98
|
+
- `name`: IconName (required) - Name of the icon to display
|
|
99
|
+
- `size`: number | string (default: 24) - Size of the icon
|
|
100
|
+
- `color`: string (default: 'currentColor') - Color of the icon
|
|
101
|
+
- `className`: string (optional) - Additional CSS classes
|
|
102
|
+
- `onClick`: () => void (optional) - Click handler (makes icon clickable)
|
|
103
|
+
|
|
104
|
+
**Available Icons:**
|
|
105
|
+
|
|
106
|
+
**Arrows & Navigation:**
|
|
107
|
+
ArrowLeft, ArrowRight, ArrowUp, ArrowDown, ArrowUpRight, ArrowDownRight, ChevronLeft, ChevronRight, ChevronUp, ChevronDown, DoubleChevronLeft, DoubleChevronRight, Home, Menu, Close, Search, Filter
|
|
108
|
+
|
|
109
|
+
**Actions:**
|
|
110
|
+
Plus, Minus, Check, X, Edit, Trash, Save, Download, Upload, Copy, Share
|
|
111
|
+
|
|
112
|
+
**Media:**
|
|
113
|
+
Play, Pause, Stop, VolumeUp, VolumeDown, VolumeOff, Image, Video, Camera
|
|
114
|
+
|
|
115
|
+
**Communication:**
|
|
116
|
+
Mail, Message, Phone, Bell, Notification
|
|
117
|
+
|
|
118
|
+
**Files:**
|
|
119
|
+
File, Folder, FolderOpen, FileText, FilePdf
|
|
120
|
+
|
|
121
|
+
**User:**
|
|
122
|
+
User, Users, UserPlus, UserMinus, Settings, Logout
|
|
123
|
+
|
|
124
|
+
**Status:**
|
|
125
|
+
CheckCircle, XCircle, AlertCircle, Info, Warning, Star, Heart, Bookmark
|
|
126
|
+
|
|
127
|
+
**Social:**
|
|
128
|
+
Facebook, Twitter, Instagram, Linkedin, Github, Youtube
|
|
129
|
+
|
|
130
|
+
**Technology:**
|
|
131
|
+
Wifi, Bluetooth, Battery, Zap, Lock, Unlock, Shield
|
|
132
|
+
|
|
133
|
+
**Shopping:**
|
|
134
|
+
ShoppingCart, ShoppingBag, CreditCard, Gift
|
|
135
|
+
|
|
136
|
+
**Time:**
|
|
137
|
+
Clock, Calendar, Timer
|
|
40
138
|
|
|
41
|
-
|
|
139
|
+
**Location:**
|
|
140
|
+
MapPin, Globe, Navigation
|
|
42
141
|
|
|
43
|
-
|
|
142
|
+
**Weather:**
|
|
143
|
+
Sun, Moon, Cloud
|
|
144
|
+
|
|
145
|
+
**Utility:**
|
|
146
|
+
Eye, EyeOff, Refresh, MoreVertical, MoreHorizontal, Grid, List
|
|
147
|
+
|
|
148
|
+
You can also import individual icons directly:
|
|
149
|
+
```tsx
|
|
150
|
+
import { Home, Search, User } from 'pure-react-ui';
|
|
151
|
+
|
|
152
|
+
<Home size={24} color="#007bff" />
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Space
|
|
156
|
+
|
|
157
|
+
A layout component for adding consistent spacing between elements.
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import { Space } from 'pure-react-ui';
|
|
161
|
+
|
|
162
|
+
<Space size="medium" direction="horizontal">
|
|
163
|
+
<Button>Button 1</Button>
|
|
164
|
+
<Button>Button 2</Button>
|
|
165
|
+
<Button>Button 3</Button>
|
|
166
|
+
</Space>
|
|
167
|
+
|
|
168
|
+
<Space size={20} direction="vertical" align="start">
|
|
169
|
+
<Card>Card 1</Card>
|
|
170
|
+
<Card>Card 2</Card>
|
|
171
|
+
</Space>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Props:**
|
|
175
|
+
- `size`: 'small' | 'medium' | 'large' | number (default: 'medium') - Spacing size between items
|
|
176
|
+
- `direction`: 'horizontal' | 'vertical' (default: 'horizontal') - Direction of spacing
|
|
177
|
+
- `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'center') - Alignment of items
|
|
178
|
+
- `wrap`: boolean (default: false) - Whether items should wrap to next line
|
|
179
|
+
- `className`: string (optional) - Additional CSS classes
|
|
180
|
+
|
|
181
|
+
### Flex
|
|
182
|
+
|
|
183
|
+
A flexible container component based on CSS Flexbox.
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import { Flex } from 'pure-react-ui';
|
|
187
|
+
|
|
188
|
+
<Flex direction="row" justify="between" align="center" gap="medium">
|
|
189
|
+
<Button>Left</Button>
|
|
190
|
+
<Button>Center</Button>
|
|
191
|
+
<Button>Right</Button>
|
|
192
|
+
</Flex>
|
|
193
|
+
|
|
194
|
+
<Flex direction="column" justify="start" align="stretch" gap={16}>
|
|
195
|
+
<Card>Card 1</Card>
|
|
196
|
+
<Card>Card 2</Card>
|
|
197
|
+
</Flex>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Props:**
|
|
201
|
+
- `direction`: 'row' | 'column' | 'row-reverse' | 'column-reverse' (default: 'row') - Flex direction
|
|
202
|
+
- `justify`: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' (default: 'start') - Justify content
|
|
203
|
+
- `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'start') - Align items
|
|
204
|
+
- `wrap`: boolean | 'wrap' | 'nowrap' | 'wrap-reverse' (default: false) - Flex wrap behavior
|
|
205
|
+
- `gap`: 'none' | 'small' | 'medium' | 'large' | number (default: 'none') - Gap between items
|
|
206
|
+
- `className`: string (optional) - Additional CSS classes
|
|
207
|
+
- `style`: React.CSSProperties (optional) - Additional inline styles
|
|
208
|
+
|
|
209
|
+
### Text
|
|
210
|
+
|
|
211
|
+
A typography component for consistent text styling with various options.
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
import { Text } from 'pure-react-ui';
|
|
215
|
+
|
|
216
|
+
<Text as="h1" size="2xl" weight="bold" color="primary">
|
|
217
|
+
Heading Text
|
|
218
|
+
</Text>
|
|
219
|
+
|
|
220
|
+
<Text size="lg" color="muted" align="center">
|
|
221
|
+
Centered paragraph text
|
|
222
|
+
</Text>
|
|
223
|
+
|
|
224
|
+
<Text as="span" size="sm" decoration="underline" transform="uppercase">
|
|
225
|
+
Styled Text
|
|
226
|
+
</Text>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Props:**
|
|
230
|
+
- `as`: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'small' | 'strong' | 'em' | 'code' | 'pre' (default: 'p') - HTML element to render
|
|
231
|
+
- `size`: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' (default: 'md') - Font size
|
|
232
|
+
- `weight`: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' (default: 'normal') - Font weight
|
|
233
|
+
- `color`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'muted' (default: 'default') - Text color
|
|
234
|
+
- `align`: 'left' | 'center' | 'right' | 'justify' (default: 'left') - Text alignment
|
|
235
|
+
- `transform`: 'none' | 'uppercase' | 'lowercase' | 'capitalize' (default: 'none') - Text transform
|
|
236
|
+
- `decoration`: 'none' | 'underline' | 'line-through' | 'overline' (default: 'none') - Text decoration
|
|
237
|
+
- `truncate`: boolean (default: false) - Truncate text with ellipsis
|
|
238
|
+
- `className`: string (optional) - Additional CSS classes
|
|
239
|
+
|
|
240
|
+
## Styling
|
|
241
|
+
|
|
242
|
+
All components include their own CSS files and use CSS classes with the `pure-` prefix. The CSS files are automatically imported with each component. You can also style them by targeting these classes:
|
|
243
|
+
|
|
244
|
+
- **Button**: `pure-button`, `pure-button--primary`, `pure-button--secondary`, etc.
|
|
245
|
+
- **Card**: `pure-card`, `pure-card--hoverable`, `pure-card--shadow-medium`, etc.
|
|
246
|
+
- **Modal**: `pure-modal`, `pure-modal__overlay`, `pure-modal__header`, etc.
|
|
247
|
+
- **Icon**: `pure-icon`, `pure-icon--clickable`, `pure-icon--small`, etc.
|
|
248
|
+
- **Space**: `pure-space`, `pure-space--horizontal`, `pure-space--vertical`, etc.
|
|
249
|
+
- **Flex**: `pure-flex`, `pure-flex--row`, `pure-flex--column`, etc.
|
|
250
|
+
- **Text**: `pure-text`, `pure-text--lg`, `pure-text--bold`, etc.
|
|
251
|
+
|
|
252
|
+
Each component has its own CSS file located in:
|
|
253
|
+
- `lib/components/Button/Button.css`
|
|
254
|
+
- `lib/components/Card/Card.css`
|
|
255
|
+
- `lib/components/Modal/Modal.css`
|
|
256
|
+
- `lib/components/Icon/Icon.css`
|
|
257
|
+
- `lib/components/Space/Space.css`
|
|
258
|
+
- `lib/components/Flex/Flex.css`
|
|
259
|
+
- `lib/components/Text/Text.css`
|
|
260
|
+
|
|
261
|
+
## Examples
|
|
262
|
+
|
|
263
|
+
A complete example application is available in the `example` directory. To run it:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# From the root directory, build the package first
|
|
267
|
+
npm run build
|
|
268
|
+
|
|
269
|
+
# Then navigate to example directory
|
|
270
|
+
cd example
|
|
271
|
+
npm install
|
|
272
|
+
npm run dev
|
|
273
|
+
```
|
|
44
274
|
|
|
45
|
-
|
|
275
|
+
Or check out `EXAMPLES.md` for code examples and usage patterns.
|
|
46
276
|
|
|
47
|
-
|
|
48
|
-
- `size`: 'sm' | 'md' | 'lg'
|
|
49
|
-
- `fullWidth`: boolean
|
|
50
|
-
- `loading`: boolean
|
|
51
|
-
- `disabled`: boolean
|
|
52
|
-
- `leftIcon`: ReactNode
|
|
53
|
-
- `rightIcon`: ReactNode
|
|
54
|
-
- Plus all standard button props
|
|
277
|
+
## License
|
|
55
278
|
|
|
56
|
-
|
|
279
|
+
MIT
|
|
57
280
|
|
|
58
|
-
- TypeScript support with full type definitions
|
|
59
|
-
- Accessible design with proper ARIA attributes
|
|
60
|
-
- CSS variables for easy theming
|
|
61
|
-
- Multiple variants and sizes
|
|
62
|
-
- Loading and disabled states
|
|
63
|
-
- Icon support
|
|
64
|
-
- Responsive design
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/* Pure Button Component Styles */
|
|
2
|
+
.pure-button {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
padding: 0.625rem 1.25rem;
|
|
8
|
+
font-size: 1rem;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
line-height: 1.5;
|
|
11
|
+
text-align: center;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
user-select: none;
|
|
17
|
+
border: 1px solid transparent;
|
|
18
|
+
border-radius: 0.375rem;
|
|
19
|
+
transition: all 0.2s ease-in-out;
|
|
20
|
+
background-color: #007bff;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pure-button:hover:not(.pure-button--disabled) {
|
|
26
|
+
background-color: #0056b3;
|
|
27
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
28
|
+
transform: translateY(-1px);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pure-button:active:not(.pure-button--disabled) {
|
|
32
|
+
transform: translateY(0);
|
|
33
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pure-button:focus {
|
|
37
|
+
outline: none;
|
|
38
|
+
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Variants */
|
|
42
|
+
.pure-button--primary {
|
|
43
|
+
background-color: #007bff;
|
|
44
|
+
color: #ffffff;
|
|
45
|
+
border-color: #007bff;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pure-button--primary:hover:not(.pure-button--disabled) {
|
|
49
|
+
background-color: #0056b3;
|
|
50
|
+
border-color: #0056b3;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pure-button--secondary {
|
|
54
|
+
background-color: #6c757d;
|
|
55
|
+
color: #ffffff;
|
|
56
|
+
border-color: #6c757d;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pure-button--secondary:hover:not(.pure-button--disabled) {
|
|
60
|
+
background-color: #545b62;
|
|
61
|
+
border-color: #545b62;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.pure-button--success {
|
|
65
|
+
background-color: #28a745;
|
|
66
|
+
color: #ffffff;
|
|
67
|
+
border-color: #28a745;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.pure-button--success:hover:not(.pure-button--disabled) {
|
|
71
|
+
background-color: #218838;
|
|
72
|
+
border-color: #218838;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.pure-button--danger {
|
|
76
|
+
background-color: #dc3545;
|
|
77
|
+
color: #ffffff;
|
|
78
|
+
border-color: #dc3545;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.pure-button--danger:hover:not(.pure-button--disabled) {
|
|
82
|
+
background-color: #c82333;
|
|
83
|
+
border-color: #c82333;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.pure-button--warning {
|
|
87
|
+
background-color: #ffc107;
|
|
88
|
+
color: #212529;
|
|
89
|
+
border-color: #ffc107;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pure-button--warning:hover:not(.pure-button--disabled) {
|
|
93
|
+
background-color: #e0a800;
|
|
94
|
+
border-color: #e0a800;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pure-button--info {
|
|
98
|
+
background-color: #17a2b8;
|
|
99
|
+
color: #ffffff;
|
|
100
|
+
border-color: #17a2b8;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.pure-button--info:hover:not(.pure-button--disabled) {
|
|
104
|
+
background-color: #138496;
|
|
105
|
+
border-color: #138496;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Sizes */
|
|
109
|
+
.pure-button--small {
|
|
110
|
+
padding: 0.375rem 0.75rem;
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.pure-button--medium {
|
|
115
|
+
padding: 0.625rem 1.25rem;
|
|
116
|
+
font-size: 1rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.pure-button--large {
|
|
120
|
+
padding: 0.875rem 1.75rem;
|
|
121
|
+
font-size: 1.125rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Full Width */
|
|
125
|
+
.pure-button--full-width {
|
|
126
|
+
width: 100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Loading State */
|
|
130
|
+
.pure-button--loading {
|
|
131
|
+
position: relative;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.pure-button__spinner {
|
|
136
|
+
display: inline-block;
|
|
137
|
+
width: 1rem;
|
|
138
|
+
height: 1rem;
|
|
139
|
+
border: 2px solid currentColor;
|
|
140
|
+
border-right-color: transparent;
|
|
141
|
+
border-radius: 50%;
|
|
142
|
+
animation: pure-button-spin 0.6s linear infinite;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes pure-button-spin {
|
|
146
|
+
to {
|
|
147
|
+
transform: rotate(360deg);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.pure-button__content {
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
gap: 0.5rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Disabled State */
|
|
158
|
+
.pure-button--disabled,
|
|
159
|
+
.pure-button:disabled {
|
|
160
|
+
opacity: 0.65;
|
|
161
|
+
cursor: not-allowed;
|
|
162
|
+
pointer-events: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.pure-button--disabled:hover,
|
|
166
|
+
.pure-button:disabled:hover {
|
|
167
|
+
transform: none;
|
|
168
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
169
|
+
}
|
|
170
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Button.css';
|
|
3
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
5
|
+
size?: 'small' | 'medium' | 'large';
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
11
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAChF,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAC9E,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+CxC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Button.css';
|
|
3
|
+
export const Button = ({ variant = 'primary', size = 'medium', fullWidth = false, loading = false, disabled, children, className = '', onClick, ...props }) => {
|
|
4
|
+
const baseClass = 'pure-button';
|
|
5
|
+
const variantClass = `pure-button--${variant}`;
|
|
6
|
+
const sizeClass = `pure-button--${size}`;
|
|
7
|
+
const fullWidthClass = fullWidth ? 'pure-button--full-width' : '';
|
|
8
|
+
const loadingClass = loading ? 'pure-button--loading' : '';
|
|
9
|
+
const disabledClass = (disabled || loading) ? 'pure-button--disabled' : '';
|
|
10
|
+
const combinedClassName = [
|
|
11
|
+
baseClass,
|
|
12
|
+
variantClass,
|
|
13
|
+
sizeClass,
|
|
14
|
+
fullWidthClass,
|
|
15
|
+
loadingClass,
|
|
16
|
+
disabledClass,
|
|
17
|
+
className
|
|
18
|
+
].filter(Boolean).join(' ');
|
|
19
|
+
const handleClick = (e) => {
|
|
20
|
+
if (disabled || loading) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
onClick?.(e);
|
|
25
|
+
};
|
|
26
|
+
return (React.createElement("button", { className: combinedClassName, disabled: disabled || loading, onClick: handleClick, ...props },
|
|
27
|
+
loading && React.createElement("span", { className: "pure-button__spinner" }),
|
|
28
|
+
React.createElement("span", { className: "pure-button__content" }, children)));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,CAAC;AAUtB,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC5C,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,QAAQ,EACf,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,OAAO,EACP,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,aAAa,CAAC;IAChC,MAAM,YAAY,GAAG,gBAAgB,OAAO,EAAE,CAAC;IAC/C,MAAM,SAAS,GAAG,gBAAgB,IAAI,EAAE,CAAC;IACzC,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,MAAM,aAAa,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;IAE3E,MAAM,iBAAiB,GAAG;QACxB,SAAS;QACT,YAAY;QACZ,SAAS;QACT,cAAc;QACd,YAAY;QACZ,aAAa;QACb,SAAS;KACV,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE5B,MAAM,WAAW,GAAG,CAAC,CAAsC,EAAE,EAAE;QAC7D,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;YACxB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QACD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACf,CAAC,CAAC;IAEF,OAAO,CACL,gCACE,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,OAAO,EAAE,WAAW,KAChB,KAAK;QAER,OAAO,IAAI,8BAAM,SAAS,EAAC,sBAAsB,GAAG;QACrD,8BAAM,SAAS,EAAC,sBAAsB,IAAE,QAAQ,CAAQ,CACjD,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* Pure Card Component Styles */
|
|
2
|
+
.pure-card {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
background-color: #ffffff;
|
|
6
|
+
border: 1px solid #e0e0e0;
|
|
7
|
+
border-radius: 0.5rem;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
transition: all 0.3s ease-in-out;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Shadow Variants */
|
|
13
|
+
.pure-card--shadow-none {
|
|
14
|
+
box-shadow: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pure-card--shadow-small {
|
|
18
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pure-card--shadow-medium {
|
|
22
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pure-card--shadow-large {
|
|
26
|
+
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Hoverable */
|
|
30
|
+
.pure-card--hoverable:hover {
|
|
31
|
+
transform: translateY(-4px);
|
|
32
|
+
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Clickable */
|
|
36
|
+
.pure-card--clickable {
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pure-card--clickable:active {
|
|
41
|
+
transform: translateY(-2px);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Image Container */
|
|
45
|
+
.pure-card__image-container {
|
|
46
|
+
width: 100%;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
background-color: #f5f5f5;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pure-card__image {
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: auto;
|
|
54
|
+
display: block;
|
|
55
|
+
object-fit: cover;
|
|
56
|
+
transition: transform 0.3s ease-in-out;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pure-card--hoverable:hover .pure-card__image {
|
|
60
|
+
transform: scale(1.05);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Header */
|
|
64
|
+
.pure-card__header {
|
|
65
|
+
padding: 1.25rem 1.5rem 0.75rem;
|
|
66
|
+
border-bottom: 1px solid #f0f0f0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.pure-card__title {
|
|
70
|
+
margin: 0 0 0.5rem 0;
|
|
71
|
+
font-size: 1.25rem;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
line-height: 1.4;
|
|
74
|
+
color: #212529;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.pure-card__subtitle {
|
|
78
|
+
margin: 0;
|
|
79
|
+
font-size: 0.875rem;
|
|
80
|
+
line-height: 1.5;
|
|
81
|
+
color: #6c757d;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Body */
|
|
85
|
+
.pure-card__body {
|
|
86
|
+
padding: 1.5rem;
|
|
87
|
+
flex: 1;
|
|
88
|
+
color: #495057;
|
|
89
|
+
line-height: 1.6;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Footer */
|
|
93
|
+
.pure-card__footer {
|
|
94
|
+
padding: 0.75rem 1.5rem;
|
|
95
|
+
border-top: 1px solid #f0f0f0;
|
|
96
|
+
background-color: #fafafa;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: flex-end;
|
|
100
|
+
gap: 0.5rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Responsive */
|
|
104
|
+
@media (max-width: 768px) {
|
|
105
|
+
.pure-card__header,
|
|
106
|
+
.pure-card__body,
|
|
107
|
+
.pure-card__footer {
|
|
108
|
+
padding-left: 1rem;
|
|
109
|
+
padding-right: 1rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.pure-card__title {
|
|
113
|
+
font-size: 1.125rem;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Card.css';
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
imageAlt?: string;
|
|
8
|
+
footer?: React.ReactNode;
|
|
9
|
+
hoverable?: boolean;
|
|
10
|
+
shadow?: 'none' | 'small' | 'medium' | 'large';
|
|
11
|
+
className?: string;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const Card: React.FC<CardProps>;
|
|
16
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsDpC,CAAC"}
|