pure-react-ui 1.4.7 → 1.5.1

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.
Files changed (35) hide show
  1. package/README.md +187 -1
  2. package/lib/components/Flex/Flex.css +106 -0
  3. package/lib/components/Flex/Flex.d.ts +14 -0
  4. package/lib/components/Flex/Flex.d.ts.map +1 -0
  5. package/lib/components/Flex/Flex.js +40 -0
  6. package/lib/components/Flex/Flex.js.map +1 -0
  7. package/lib/components/Icon/Icon.css +88 -0
  8. package/lib/components/Icon/Icon.d.ts +13 -0
  9. package/lib/components/Icon/Icon.d.ts.map +1 -0
  10. package/lib/components/Icon/Icon.js +26 -0
  11. package/lib/components/Icon/Icon.js.map +1 -0
  12. package/lib/components/Icon/icons.d.ts +198 -0
  13. package/lib/components/Icon/icons.d.ts.map +1 -0
  14. package/lib/components/Icon/icons.js +155 -0
  15. package/lib/components/Icon/icons.js.map +1 -0
  16. package/lib/components/Modal/Modal.css +333 -21
  17. package/lib/components/Modal/Modal.d.ts +7 -1
  18. package/lib/components/Modal/Modal.d.ts.map +1 -1
  19. package/lib/components/Modal/Modal.js +22 -6
  20. package/lib/components/Modal/Modal.js.map +1 -1
  21. package/lib/components/Space/Space.css +73 -0
  22. package/lib/components/Space/Space.d.ts +12 -0
  23. package/lib/components/Space/Space.d.ts.map +1 -0
  24. package/lib/components/Space/Space.js +33 -0
  25. package/lib/components/Space/Space.js.map +1 -0
  26. package/lib/components/Text/Text.css +240 -0
  27. package/lib/components/Text/Text.d.ts +16 -0
  28. package/lib/components/Text/Text.d.ts.map +1 -0
  29. package/lib/components/Text/Text.js +26 -0
  30. package/lib/components/Text/Text.js.map +1 -0
  31. package/lib/index.d.ts +9 -0
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +5 -0
  34. package/lib/index.js.map +1 -1
  35. package/package.json +5 -2
package/README.md CHANGED
@@ -77,11 +77,173 @@ import { Modal } from 'pure-react-ui';
77
77
  **Props:**
78
78
  - `isOpen`: boolean (required)
79
79
  - `onClose`: () => void (required)
80
- - `title`: string (optional)
80
+ - `title`: string | React.ReactNode (optional) - Modal title or custom header content
81
81
  - `size`: 'small' | 'medium' | 'large' | 'fullscreen' (default: 'medium')
82
+ - `position`: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' (default: 'center')
83
+ - `variant`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'gradient-primary' | 'gradient-success' | 'gradient-danger' | 'gradient-info' (default: 'default')
82
84
  - `closeOnOverlayClick`: boolean (default: true)
83
85
  - `closeOnEscape`: boolean (default: true)
84
86
  - `showCloseButton`: boolean (default: true)
87
+ - `scrollable`: boolean (default: true) - Enable scrolling for modal body
88
+ - `topMargin`: number | string (optional) - Custom top margin for modal
89
+ - `className`: string (optional) - Additional CSS classes
90
+ - `overlayClassName`: string (optional) - Additional CSS classes for overlay
91
+ - `headerClassName`: string (optional) - Additional CSS classes for header
92
+ - `bodyClassName`: string (optional) - Additional CSS classes for body
93
+
94
+ ### Icon
95
+
96
+ A comprehensive icon component library with 100+ SVG icons.
97
+
98
+ ```tsx
99
+ import { Icon } from 'pure-react-ui';
100
+
101
+ <Icon name="Home" size={24} color="#007bff" />
102
+ <Icon name="Search" size={32} onClick={handleClick} />
103
+ ```
104
+
105
+ **Props:**
106
+ - `name`: IconName (required) - Name of the icon to display
107
+ - `size`: number | string (default: 24) - Size of the icon
108
+ - `color`: string (default: 'currentColor') - Color of the icon
109
+ - `className`: string (optional) - Additional CSS classes
110
+ - `onClick`: () => void (optional) - Click handler (makes icon clickable)
111
+
112
+ **Available Icons:**
113
+
114
+ **Arrows & Navigation:**
115
+ ArrowLeft, ArrowRight, ArrowUp, ArrowDown, ArrowUpRight, ArrowDownRight, ChevronLeft, ChevronRight, ChevronUp, ChevronDown, DoubleChevronLeft, DoubleChevronRight, Home, Menu, Close, Search, Filter
116
+
117
+ **Actions:**
118
+ Plus, Minus, Check, X, Edit, Trash, Save, Download, Upload, Copy, Share
119
+
120
+ **Media:**
121
+ Play, Pause, Stop, VolumeUp, VolumeDown, VolumeOff, Image, Video, Camera
122
+
123
+ **Communication:**
124
+ Mail, Message, Phone, Bell, Notification
125
+
126
+ **Files:**
127
+ File, Folder, FolderOpen, FileText, FilePdf
128
+
129
+ **User:**
130
+ User, Users, UserPlus, UserMinus, Settings, Logout
131
+
132
+ **Status:**
133
+ CheckCircle, XCircle, AlertCircle, Info, Warning, Star, Heart, Bookmark
134
+
135
+ **Social:**
136
+ Facebook, Twitter, Instagram, Linkedin, Github, Youtube
137
+
138
+ **Technology:**
139
+ Wifi, Bluetooth, Battery, Zap, Lock, Unlock, Shield
140
+
141
+ **Shopping:**
142
+ ShoppingCart, ShoppingBag, CreditCard, Gift
143
+
144
+ **Time:**
145
+ Clock, Calendar, Timer
146
+
147
+ **Location:**
148
+ MapPin, Globe, Navigation
149
+
150
+ **Weather:**
151
+ Sun, Moon, Cloud
152
+
153
+ **Utility:**
154
+ Eye, EyeOff, Refresh, MoreVertical, MoreHorizontal, Grid, List
155
+
156
+ You can also import individual icons directly:
157
+ ```tsx
158
+ import { Home, Search, User } from 'pure-react-ui';
159
+
160
+ <Home size={24} color="#007bff" />
161
+ ```
162
+
163
+ ### Space
164
+
165
+ A layout component for adding consistent spacing between elements.
166
+
167
+ ```tsx
168
+ import { Space } from 'pure-react-ui';
169
+
170
+ <Space size="medium" direction="horizontal">
171
+ <Button>Button 1</Button>
172
+ <Button>Button 2</Button>
173
+ <Button>Button 3</Button>
174
+ </Space>
175
+
176
+ <Space size={20} direction="vertical" align="start">
177
+ <Card>Card 1</Card>
178
+ <Card>Card 2</Card>
179
+ </Space>
180
+ ```
181
+
182
+ **Props:**
183
+ - `size`: 'small' | 'medium' | 'large' | number (default: 'medium') - Spacing size between items
184
+ - `direction`: 'horizontal' | 'vertical' (default: 'horizontal') - Direction of spacing
185
+ - `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'center') - Alignment of items
186
+ - `wrap`: boolean (default: false) - Whether items should wrap to next line
187
+ - `className`: string (optional) - Additional CSS classes
188
+
189
+ ### Flex
190
+
191
+ A flexible container component based on CSS Flexbox.
192
+
193
+ ```tsx
194
+ import { Flex } from 'pure-react-ui';
195
+
196
+ <Flex direction="row" justify="between" align="center" gap="medium">
197
+ <Button>Left</Button>
198
+ <Button>Center</Button>
199
+ <Button>Right</Button>
200
+ </Flex>
201
+
202
+ <Flex direction="column" justify="start" align="stretch" gap={16}>
203
+ <Card>Card 1</Card>
204
+ <Card>Card 2</Card>
205
+ </Flex>
206
+ ```
207
+
208
+ **Props:**
209
+ - `direction`: 'row' | 'column' | 'row-reverse' | 'column-reverse' (default: 'row') - Flex direction
210
+ - `justify`: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' (default: 'start') - Justify content
211
+ - `align`: 'start' | 'end' | 'center' | 'baseline' | 'stretch' (default: 'start') - Align items
212
+ - `wrap`: boolean | 'wrap' | 'nowrap' | 'wrap-reverse' (default: false) - Flex wrap behavior
213
+ - `gap`: 'none' | 'small' | 'medium' | 'large' | number (default: 'none') - Gap between items
214
+ - `className`: string (optional) - Additional CSS classes
215
+ - `style`: React.CSSProperties (optional) - Additional inline styles
216
+
217
+ ### Text
218
+
219
+ A typography component for consistent text styling with various options.
220
+
221
+ ```tsx
222
+ import { Text } from 'pure-react-ui';
223
+
224
+ <Text as="h1" size="2xl" weight="bold" color="primary">
225
+ Heading Text
226
+ </Text>
227
+
228
+ <Text size="lg" color="muted" align="center">
229
+ Centered paragraph text
230
+ </Text>
231
+
232
+ <Text as="span" size="sm" decoration="underline" transform="uppercase">
233
+ Styled Text
234
+ </Text>
235
+ ```
236
+
237
+ **Props:**
238
+ - `as`: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'small' | 'strong' | 'em' | 'code' | 'pre' (default: 'p') - HTML element to render
239
+ - `size`: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' (default: 'md') - Font size
240
+ - `weight`: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' (default: 'normal') - Font weight
241
+ - `color`: 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'muted' (default: 'default') - Text color
242
+ - `align`: 'left' | 'center' | 'right' | 'justify' (default: 'left') - Text alignment
243
+ - `transform`: 'none' | 'uppercase' | 'lowercase' | 'capitalize' (default: 'none') - Text transform
244
+ - `decoration`: 'none' | 'underline' | 'line-through' | 'overline' (default: 'none') - Text decoration
245
+ - `truncate`: boolean (default: false) - Truncate text with ellipsis
246
+ - `className`: string (optional) - Additional CSS classes
85
247
 
86
248
  ## Styling
87
249
 
@@ -90,11 +252,35 @@ All components include their own CSS files and use CSS classes with the `pure-`
90
252
  - **Button**: `pure-button`, `pure-button--primary`, `pure-button--secondary`, etc.
91
253
  - **Card**: `pure-card`, `pure-card--hoverable`, `pure-card--shadow-medium`, etc.
92
254
  - **Modal**: `pure-modal`, `pure-modal__overlay`, `pure-modal__header`, etc.
255
+ - **Icon**: `pure-icon`, `pure-icon--clickable`, `pure-icon--small`, etc.
256
+ - **Space**: `pure-space`, `pure-space--horizontal`, `pure-space--vertical`, etc.
257
+ - **Flex**: `pure-flex`, `pure-flex--row`, `pure-flex--column`, etc.
258
+ - **Text**: `pure-text`, `pure-text--lg`, `pure-text--bold`, etc.
93
259
 
94
260
  Each component has its own CSS file located in:
95
261
  - `lib/components/Button/Button.css`
96
262
  - `lib/components/Card/Card.css`
97
263
  - `lib/components/Modal/Modal.css`
264
+ - `lib/components/Icon/Icon.css`
265
+ - `lib/components/Space/Space.css`
266
+ - `lib/components/Flex/Flex.css`
267
+ - `lib/components/Text/Text.css`
268
+
269
+ ## Examples
270
+
271
+ A complete example application is available in the `example` directory. To run it:
272
+
273
+ ```bash
274
+ # From the root directory, build the package first
275
+ npm run build
276
+
277
+ # Then navigate to example directory
278
+ cd example
279
+ npm install
280
+ npm run dev
281
+ ```
282
+
283
+ Or check out `EXAMPLES.md` for code examples and usage patterns.
98
284
 
99
285
  ## License
100
286
 
@@ -0,0 +1,106 @@
1
+ /* Pure Flex Component Styles */
2
+ .pure-flex {
3
+ display: flex;
4
+ flex-wrap: nowrap;
5
+ }
6
+
7
+ /* Direction Variants */
8
+ .pure-flex--row {
9
+ flex-direction: row;
10
+ }
11
+
12
+ .pure-flex--column {
13
+ flex-direction: column;
14
+ }
15
+
16
+ .pure-flex--row-reverse {
17
+ flex-direction: row-reverse;
18
+ }
19
+
20
+ .pure-flex--column-reverse {
21
+ flex-direction: column-reverse;
22
+ }
23
+
24
+ /* Justify Content */
25
+ .pure-flex--justify-start {
26
+ justify-content: flex-start;
27
+ }
28
+
29
+ .pure-flex--justify-end {
30
+ justify-content: flex-end;
31
+ }
32
+
33
+ .pure-flex--justify-center {
34
+ justify-content: center;
35
+ }
36
+
37
+ .pure-flex--justify-between {
38
+ justify-content: space-between;
39
+ }
40
+
41
+ .pure-flex--justify-around {
42
+ justify-content: space-around;
43
+ }
44
+
45
+ .pure-flex--justify-evenly {
46
+ justify-content: space-evenly;
47
+ }
48
+
49
+ /* Align Items */
50
+ .pure-flex--align-start {
51
+ align-items: flex-start;
52
+ }
53
+
54
+ .pure-flex--align-end {
55
+ align-items: flex-end;
56
+ }
57
+
58
+ .pure-flex--align-center {
59
+ align-items: center;
60
+ }
61
+
62
+ .pure-flex--align-baseline {
63
+ align-items: baseline;
64
+ }
65
+
66
+ .pure-flex--align-stretch {
67
+ align-items: stretch;
68
+ }
69
+
70
+ /* Wrap */
71
+ .pure-flex--wrap {
72
+ flex-wrap: wrap;
73
+ }
74
+
75
+ .pure-flex--nowrap {
76
+ flex-wrap: nowrap;
77
+ }
78
+
79
+ .pure-flex--wrap-reverse {
80
+ flex-wrap: wrap-reverse;
81
+ }
82
+
83
+ /* Gap */
84
+ .pure-flex--gap-none {
85
+ gap: 0;
86
+ }
87
+
88
+ .pure-flex--gap-small {
89
+ gap: 0.5rem;
90
+ }
91
+
92
+ .pure-flex--gap-medium {
93
+ gap: 1rem;
94
+ }
95
+
96
+ .pure-flex--gap-large {
97
+ gap: 1.5rem;
98
+ }
99
+
100
+ /* Responsive */
101
+ @media (max-width: 768px) {
102
+ .pure-flex--wrap {
103
+ flex-wrap: wrap;
104
+ }
105
+ }
106
+
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './Flex.css';
3
+ export interface FlexProps {
4
+ direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
5
+ justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
6
+ align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
7
+ wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
8
+ gap?: 'none' | 'small' | 'medium' | 'large' | number;
9
+ className?: string;
10
+ style?: React.CSSProperties;
11
+ children: React.ReactNode;
12
+ }
13
+ export declare const Flex: React.FC<FlexProps>;
14
+ //# sourceMappingURL=Flex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;IAChE,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC5D,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IACpD,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAwDpC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import './Flex.css';
3
+ export const Flex = ({ direction = 'row', justify = 'start', align = 'start', wrap = false, gap = 'none', className = '', style = {}, children }) => {
4
+ const baseClass = 'pure-flex';
5
+ const directionClass = `pure-flex--${direction}`;
6
+ const justifyClass = `pure-flex--justify-${justify}`;
7
+ const alignClass = `pure-flex--align-${align}`;
8
+ let wrapClass = '';
9
+ if (wrap === true) {
10
+ wrapClass = 'pure-flex--wrap';
11
+ }
12
+ else if (wrap === 'wrap') {
13
+ wrapClass = 'pure-flex--wrap';
14
+ }
15
+ else if (wrap === 'wrap-reverse') {
16
+ wrapClass = 'pure-flex--wrap-reverse';
17
+ }
18
+ else {
19
+ wrapClass = 'pure-flex--nowrap';
20
+ }
21
+ const combinedClassName = [
22
+ baseClass,
23
+ directionClass,
24
+ justifyClass,
25
+ alignClass,
26
+ wrapClass,
27
+ className
28
+ ].filter(Boolean).join(' ');
29
+ const gapValue = typeof gap === 'number' ? gap : undefined;
30
+ const gapClass = typeof gap === 'string' && gap !== 'none' ? `pure-flex--gap-${gap}` : '';
31
+ const combinedStyle = {
32
+ ...style,
33
+ };
34
+ if (gapValue !== undefined) {
35
+ combinedStyle.gap = `${gapValue}px`;
36
+ }
37
+ const finalClassName = [combinedClassName, gapClass].filter(Boolean).join(' ');
38
+ return (React.createElement("div", { className: finalClassName, style: combinedStyle }, children));
39
+ };
40
+ //# sourceMappingURL=Flex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.js","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,K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,CAAC;IAE1F,MAAM,aAAa,GAAwB;QACzC,GAAG,KAAK;KACT,CAAC;IAEF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,aAAa,CAAC,GAAG,GAAG,GAAG,QAAQ,IAAI,CAAC;IACtC,CAAC;IAED,MAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE/E,OAAO,CACL,6BACE,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,aAAa,IAEnB,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,88 @@
1
+ /* Pure Icon Component Styles */
2
+ .pure-icon {
3
+ display: inline-block;
4
+ vertical-align: middle;
5
+ flex-shrink: 0;
6
+ user-select: none;
7
+ }
8
+
9
+ .pure-icon--clickable {
10
+ cursor: pointer;
11
+ transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
12
+ }
13
+
14
+ .pure-icon--clickable:hover {
15
+ opacity: 0.8;
16
+ transform: scale(1.1);
17
+ }
18
+
19
+ .pure-icon--clickable:active {
20
+ transform: scale(0.95);
21
+ }
22
+
23
+ .pure-icon__wrapper {
24
+ display: inline-flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ cursor: pointer;
28
+ transition: opacity 0.2s ease-in-out;
29
+ }
30
+
31
+ .pure-icon__wrapper:hover {
32
+ opacity: 0.8;
33
+ }
34
+
35
+ .pure-icon__wrapper:focus {
36
+ outline: none;
37
+ border-radius: 0.25rem;
38
+ box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
39
+ }
40
+
41
+ .pure-icon__wrapper:focus:not(:focus-visible) {
42
+ box-shadow: none;
43
+ }
44
+
45
+ /* Size variants */
46
+ .pure-icon--small {
47
+ width: 16px;
48
+ height: 16px;
49
+ }
50
+
51
+ .pure-icon--medium {
52
+ width: 24px;
53
+ height: 24px;
54
+ }
55
+
56
+ .pure-icon--large {
57
+ width: 32px;
58
+ height: 32px;
59
+ }
60
+
61
+ /* Animation for loading/spinning icons */
62
+ .pure-icon--spin {
63
+ animation: pure-icon-spin 1s linear infinite;
64
+ }
65
+
66
+ @keyframes pure-icon-spin {
67
+ from {
68
+ transform: rotate(0deg);
69
+ }
70
+ to {
71
+ transform: rotate(360deg);
72
+ }
73
+ }
74
+
75
+ /* Pulse animation */
76
+ .pure-icon--pulse {
77
+ animation: pure-icon-pulse 2s ease-in-out infinite;
78
+ }
79
+
80
+ @keyframes pure-icon-pulse {
81
+ 0%, 100% {
82
+ opacity: 1;
83
+ }
84
+ 50% {
85
+ opacity: 0.5;
86
+ }
87
+ }
88
+
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { IconName, IconProps as BaseIconProps } from './icons';
3
+ import './Icon.css';
4
+ export interface IconProps extends BaseIconProps {
5
+ name: IconName;
6
+ size?: number | string;
7
+ color?: string;
8
+ className?: string;
9
+ onClick?: () => void;
10
+ }
11
+ export declare const Icon: React.FC<IconProps>;
12
+ export * from './icons';
13
+ //# sourceMappingURL=Icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,QAAQ,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAgDpC,CAAC;AAGF,cAAc,SAAS,CAAC"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { iconMap } from './icons';
3
+ import './Icon.css';
4
+ export const Icon = ({ name, size = 24, color = 'currentColor', className = '', onClick, ...props }) => {
5
+ const IconComponent = iconMap[name];
6
+ if (!IconComponent) {
7
+ console.warn(`Icon "${name}" not found`);
8
+ return null;
9
+ }
10
+ const baseClass = 'pure-icon';
11
+ const clickableClass = onClick ? 'pure-icon--clickable' : '';
12
+ const combinedClassName = [baseClass, clickableClass, className].filter(Boolean).join(' ');
13
+ const iconElement = (React.createElement(IconComponent, { size: size, color: color, className: combinedClassName, ...props }));
14
+ if (onClick) {
15
+ return (React.createElement("span", { className: "pure-icon__wrapper", onClick: onClick, role: "button", tabIndex: 0, onKeyDown: (e) => {
16
+ if (e.key === 'Enter' || e.key === ' ') {
17
+ e.preventDefault();
18
+ onClick();
19
+ }
20
+ } }, iconElement));
21
+ }
22
+ return iconElement;
23
+ };
24
+ // Export individual icons for direct use
25
+ export * from './icons';
26
+ //# sourceMappingURL=Icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAwC,MAAM,SAAS,CAAC;AACxE,OAAO,YAAY,CAAC;AAUpB,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,KAAK,GAAG,cAAc,EACtB,SAAS,GAAG,EAAE,EACd,OAAO,EACP,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,aAAa,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CA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