tonkean-tcltext 1.0.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 +114 -0
- package/dist/components/ButtonToken.d.ts +17 -0
- package/dist/components/ButtonToken.d.ts.map +1 -0
- package/dist/components/ButtonToken.js +234 -0
- package/dist/components/ButtonToken.js.map +1 -0
- package/dist/components/ColorSelectToken.d.ts +17 -0
- package/dist/components/ColorSelectToken.d.ts.map +1 -0
- package/dist/components/ColorSelectToken.js +499 -0
- package/dist/components/ColorSelectToken.js.map +1 -0
- package/dist/components/ColorSwatch.d.ts +9 -0
- package/dist/components/ColorSwatch.d.ts.map +1 -0
- package/dist/components/ColorSwatch.js +12 -0
- package/dist/components/ColorSwatch.js.map +1 -0
- package/dist/components/IconItem.d.ts +17 -0
- package/dist/components/IconItem.d.ts.map +1 -0
- package/dist/components/IconItem.js +64 -0
- package/dist/components/IconItem.js.map +1 -0
- package/dist/components/InputToken.d.ts +15 -0
- package/dist/components/InputToken.d.ts.map +1 -0
- package/dist/components/InputToken.js +203 -0
- package/dist/components/InputToken.js.map +1 -0
- package/dist/components/MultiSelectToken.d.ts +18 -0
- package/dist/components/MultiSelectToken.d.ts.map +1 -0
- package/dist/components/MultiSelectToken.js +568 -0
- package/dist/components/MultiSelectToken.js.map +1 -0
- package/dist/components/NumericInputToken.d.ts +16 -0
- package/dist/components/NumericInputToken.d.ts.map +1 -0
- package/dist/components/NumericInputToken.js +322 -0
- package/dist/components/NumericInputToken.js.map +1 -0
- package/dist/components/SelectToken.d.ts +18 -0
- package/dist/components/SelectToken.d.ts.map +1 -0
- package/dist/components/SelectToken.js +357 -0
- package/dist/components/SelectToken.js.map +1 -0
- package/dist/components/TCLText.d.ts +28 -0
- package/dist/components/TCLText.d.ts.map +1 -0
- package/dist/components/TCLText.js +89 -0
- package/dist/components/TCLText.js.map +1 -0
- package/dist/components/hooks/useTooltipOnTruncation.d.ts +20 -0
- package/dist/components/hooks/useTooltipOnTruncation.d.ts.map +1 -0
- package/dist/components/hooks/useTooltipOnTruncation.js +62 -0
- package/dist/components/hooks/useTooltipOnTruncation.js.map +1 -0
- package/dist/components/iconLibrary.d.ts +3 -0
- package/dist/components/iconLibrary.d.ts.map +1 -0
- package/dist/components/iconLibrary.js +58 -0
- package/dist/components/iconLibrary.js.map +1 -0
- package/dist/components/iconLoader.d.ts +5 -0
- package/dist/components/iconLoader.d.ts.map +1 -0
- package/dist/components/iconLoader.js +113 -0
- package/dist/components/iconLoader.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/tokens/buttons.json +198 -0
- package/dist/tokens/colors.json +93 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +6 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/inputs.json +304 -0
- package/dist/tokens/types.d.ts +9 -0
- package/dist/tokens/types.d.ts.map +1 -0
- package/dist/tokens/types.js +2 -0
- package/dist/tokens/types.js.map +1 -0
- package/dist/tokens/typography.json +37 -0
- package/package.json +59 -0
- package/src/styles/tokens.css +274 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { inputs, colors, typography } from '../tokens';
|
|
4
|
+
import { loadAllIcons } from './iconLoader';
|
|
5
|
+
// Load all icons once at module level
|
|
6
|
+
const allIconsCache = loadAllIcons();
|
|
7
|
+
// Helper function to resolve color references from tokens
|
|
8
|
+
const resolveColor = (colorRef) => {
|
|
9
|
+
if (colorRef.startsWith('#') || colorRef === 'transparent' || colorRef === 'none') {
|
|
10
|
+
return colorRef;
|
|
11
|
+
}
|
|
12
|
+
const parts = colorRef.split('.');
|
|
13
|
+
if (parts.length === 2) {
|
|
14
|
+
const [category, shade] = parts;
|
|
15
|
+
const colorCategory = colors.colors[category];
|
|
16
|
+
if (colorCategory && typeof colorCategory === 'object') {
|
|
17
|
+
const colorValue = colorCategory[shade];
|
|
18
|
+
if (colorValue) {
|
|
19
|
+
return colorValue;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return colorRef;
|
|
24
|
+
};
|
|
25
|
+
// Helper function to resolve border string
|
|
26
|
+
const resolveBorder = (border) => {
|
|
27
|
+
if (border === 'none' || border === 'transparent') {
|
|
28
|
+
return border;
|
|
29
|
+
}
|
|
30
|
+
return border.replace(/(\w+\.\w+)/g, (match) => resolveColor(match));
|
|
31
|
+
};
|
|
32
|
+
// Helper function to find color token reference from hex value
|
|
33
|
+
const findColorToken = (hexColor) => {
|
|
34
|
+
if (!hexColor.startsWith('#')) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// Normalize hex color (uppercase, handle 3-digit hex)
|
|
38
|
+
const normalizedHex = hexColor.toUpperCase();
|
|
39
|
+
// Search through all color categories and shades
|
|
40
|
+
const colorCategories = Object.keys(colors.colors);
|
|
41
|
+
for (const category of colorCategories) {
|
|
42
|
+
const colorCategory = colors.colors[category];
|
|
43
|
+
if (colorCategory && typeof colorCategory === 'object') {
|
|
44
|
+
const shades = Object.keys(colorCategory);
|
|
45
|
+
for (const shade of shades) {
|
|
46
|
+
const colorValue = colorCategory[shade];
|
|
47
|
+
if (colorValue && colorValue.toUpperCase() === normalizedHex) {
|
|
48
|
+
return `${category}.${shade}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
};
|
|
55
|
+
// Helper function to darken a hex color
|
|
56
|
+
const darkenHexColor = (hex, percent = 15) => {
|
|
57
|
+
if (!hex.startsWith('#')) {
|
|
58
|
+
return hex;
|
|
59
|
+
}
|
|
60
|
+
// Remove # if present
|
|
61
|
+
const hexWithoutHash = hex.replace('#', '');
|
|
62
|
+
// Parse RGB values
|
|
63
|
+
const r = parseInt(hexWithoutHash.substring(0, 2), 16);
|
|
64
|
+
const g = parseInt(hexWithoutHash.substring(2, 4), 16);
|
|
65
|
+
const b = parseInt(hexWithoutHash.substring(4, 6), 16);
|
|
66
|
+
// Darken by reducing RGB values
|
|
67
|
+
const darkenedR = Math.max(0, Math.floor(r * (1 - percent / 100)));
|
|
68
|
+
const darkenedG = Math.max(0, Math.floor(g * (1 - percent / 100)));
|
|
69
|
+
const darkenedB = Math.max(0, Math.floor(b * (1 - percent / 100)));
|
|
70
|
+
// Convert back to hex
|
|
71
|
+
const toHex = (n) => {
|
|
72
|
+
const hex = n.toString(16);
|
|
73
|
+
return hex.length === 1 ? '0' + hex : hex;
|
|
74
|
+
};
|
|
75
|
+
return `#${toHex(darkenedR)}${toHex(darkenedG)}${toHex(darkenedB)}`;
|
|
76
|
+
};
|
|
77
|
+
// Helper function to get the next darker shade of a color
|
|
78
|
+
const getDarkerShade = (colorRef) => {
|
|
79
|
+
if (colorRef.startsWith('#') || colorRef === 'transparent' || colorRef === 'none') {
|
|
80
|
+
// If it's a hex color, try to find the token first
|
|
81
|
+
const token = findColorToken(colorRef);
|
|
82
|
+
if (token) {
|
|
83
|
+
return getDarkerShade(token);
|
|
84
|
+
}
|
|
85
|
+
return colorRef;
|
|
86
|
+
}
|
|
87
|
+
const parts = colorRef.split('.');
|
|
88
|
+
if (parts.length === 2) {
|
|
89
|
+
const [category, shade] = parts;
|
|
90
|
+
if (category === 'basic') {
|
|
91
|
+
return colorRef;
|
|
92
|
+
}
|
|
93
|
+
const shadeLevels = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'];
|
|
94
|
+
const currentIndex = shadeLevels.indexOf(shade);
|
|
95
|
+
if (currentIndex !== -1 && currentIndex < shadeLevels.length - 1) {
|
|
96
|
+
const nextShade = shadeLevels[currentIndex + 1];
|
|
97
|
+
return `${category}.${nextShade}`;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return colorRef;
|
|
101
|
+
};
|
|
102
|
+
// Helper function to get hover border
|
|
103
|
+
const getHoverBorder = (border) => {
|
|
104
|
+
if (border === 'none' || border === 'transparent') {
|
|
105
|
+
return border;
|
|
106
|
+
}
|
|
107
|
+
return border.replace(/(\w+\.\w+)/g, (match) => {
|
|
108
|
+
const darkerShade = getDarkerShade(match);
|
|
109
|
+
return resolveColor(darkerShade);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
// Helper function to resolve typography values
|
|
113
|
+
const resolveTypography = {
|
|
114
|
+
fontFamily: (family = 'roboto') => {
|
|
115
|
+
const fontFamily = typography.typography.fontFamilies[family];
|
|
116
|
+
return Array.isArray(fontFamily) ? fontFamily.join(', ') : fontFamily;
|
|
117
|
+
},
|
|
118
|
+
fontSize: (size) => {
|
|
119
|
+
return typography.typography.fontSizes[size];
|
|
120
|
+
},
|
|
121
|
+
fontWeight: (weight) => {
|
|
122
|
+
return typography.typography.fontWeights[weight];
|
|
123
|
+
},
|
|
124
|
+
lineHeight: (height) => {
|
|
125
|
+
return typography.typography.lineHeights[height];
|
|
126
|
+
},
|
|
127
|
+
letterSpacing: (spacing) => {
|
|
128
|
+
return typography.typography.letterSpacing[spacing];
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
export const ColorSelectToken = ({ state, showLabel = false, label = 'Select Status', placeholder = 'Select Status', value, selectedColor, options = [], onSelect, }) => {
|
|
132
|
+
const [isOpen, setIsOpen] = useState(state === 'open');
|
|
133
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
134
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
135
|
+
const [selectedValue, setSelectedValue] = useState(value || '');
|
|
136
|
+
const [currentColor, setCurrentColor] = useState(selectedColor || null);
|
|
137
|
+
const selectRef = useRef(null);
|
|
138
|
+
// Sync internal state with props (for controlled component behavior in Docs)
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
if (state === 'open') {
|
|
141
|
+
setIsOpen(true);
|
|
142
|
+
}
|
|
143
|
+
else if (state !== 'open' && !onSelect) {
|
|
144
|
+
// Only sync closed state if component is not interactive (no onSelect handler)
|
|
145
|
+
setIsOpen(false);
|
|
146
|
+
}
|
|
147
|
+
}, [state, onSelect]);
|
|
148
|
+
// Sync selected value and color with props
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (value !== undefined) {
|
|
151
|
+
setSelectedValue(value);
|
|
152
|
+
}
|
|
153
|
+
}, [value]);
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
if (selectedColor !== undefined) {
|
|
156
|
+
setCurrentColor(selectedColor);
|
|
157
|
+
}
|
|
158
|
+
}, [selectedColor]);
|
|
159
|
+
// Map state to token state
|
|
160
|
+
const getTokenState = () => {
|
|
161
|
+
if (state === 'disabled')
|
|
162
|
+
return 'disabled';
|
|
163
|
+
if (state === 'open' || isOpen)
|
|
164
|
+
return 'open';
|
|
165
|
+
if (state === 'focus' || isFocused)
|
|
166
|
+
return 'open'; // Use 'open' token for focus (purple border)
|
|
167
|
+
if (state === 'filled' && selectedValue)
|
|
168
|
+
return 'selected';
|
|
169
|
+
return 'default';
|
|
170
|
+
};
|
|
171
|
+
const tokenState = getTokenState();
|
|
172
|
+
const typeTokens = inputs.inputs.types.singleSelector;
|
|
173
|
+
const stateTokens = typeTokens[tokenState];
|
|
174
|
+
const sizeTokens = inputs.inputs.sizes.regular;
|
|
175
|
+
if (!stateTokens) {
|
|
176
|
+
return _jsxs("div", { children: ["Invalid state: ", tokenState] });
|
|
177
|
+
}
|
|
178
|
+
// Resolve colors from token references
|
|
179
|
+
const defaultBackground = resolveColor(stateTokens.background);
|
|
180
|
+
// Use selected color as background if a color is selected, otherwise use default
|
|
181
|
+
const resolvedBackground = currentColor && selectedValue ? resolveColor(currentColor) : defaultBackground;
|
|
182
|
+
const resolvedText = resolveColor(stateTokens.text);
|
|
183
|
+
const resolvedPlaceholder = resolveColor(stateTokens.placeholder || stateTokens.text);
|
|
184
|
+
const resolvedBorder = resolveBorder(stateTokens.border);
|
|
185
|
+
const resolvedIcon = resolveColor(stateTokens.icon || stateTokens.text);
|
|
186
|
+
// Get chevron icons
|
|
187
|
+
const chevronDown = allIconsCache.find(icon => icon.name === 'chevron-down');
|
|
188
|
+
const chevronUp = allIconsCache.find(icon => icon.name === 'chevron-up');
|
|
189
|
+
// Get X icon for clearing selection (try multiple possible names)
|
|
190
|
+
const xIcon = allIconsCache.find(icon => icon.name === 'x' ||
|
|
191
|
+
icon.name === 'x-close' ||
|
|
192
|
+
icon.name === 'x-circle' ||
|
|
193
|
+
icon.name === 'x-square');
|
|
194
|
+
// Determine if should show placeholder or value
|
|
195
|
+
const isDisabled = state === 'disabled';
|
|
196
|
+
const showPlaceholder = !selectedValue;
|
|
197
|
+
// Use white text when a color is selected for better contrast
|
|
198
|
+
const textColor = (currentColor && selectedValue)
|
|
199
|
+
? resolveColor('basic.white')
|
|
200
|
+
: (showPlaceholder ? resolvedPlaceholder : resolvedText);
|
|
201
|
+
const displayText = selectedValue || placeholder;
|
|
202
|
+
// Get active state tokens for focus styling (use 'open' state which has gray.600 border like input 'active')
|
|
203
|
+
const activeStateTokens = typeTokens['open'];
|
|
204
|
+
const activeBorder = activeStateTokens ? resolveBorder(activeStateTokens.border) : resolvedBorder;
|
|
205
|
+
// Calculate hover border (one shade darker) - same approach as InputToken
|
|
206
|
+
const shouldShowHover = !isDisabled && stateTokens.border !== 'none' && stateTokens.border !== 'transparent';
|
|
207
|
+
const hoverBorder = shouldShowHover ? getHoverBorder(stateTokens.border) : resolvedBorder;
|
|
208
|
+
// Determine border color: focus > hover > selected color darker shade > default
|
|
209
|
+
const getBorderColor = () => {
|
|
210
|
+
// If a color is selected, use one shade darker for the border
|
|
211
|
+
if (currentColor && selectedValue && !isDisabled) {
|
|
212
|
+
// Still respect focus state
|
|
213
|
+
if ((state === 'focus' || isFocused) && activeStateTokens) {
|
|
214
|
+
return activeBorder;
|
|
215
|
+
}
|
|
216
|
+
const colorToken = findColorToken(currentColor);
|
|
217
|
+
if (colorToken) {
|
|
218
|
+
// Found matching token, get next darker shade
|
|
219
|
+
const darkerShadeToken = getDarkerShade(colorToken);
|
|
220
|
+
const darkerShadeColor = resolveColor(darkerShadeToken);
|
|
221
|
+
return `1px solid ${darkerShadeColor}`;
|
|
222
|
+
}
|
|
223
|
+
else if (currentColor.startsWith('#')) {
|
|
224
|
+
// Custom hex color, darken it directly
|
|
225
|
+
const darkerColor = darkenHexColor(currentColor, 15);
|
|
226
|
+
return `1px solid ${darkerColor}`;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Default behavior for focus/hover/default
|
|
230
|
+
if ((state === 'focus' || isFocused) && !isDisabled && activeStateTokens) {
|
|
231
|
+
return activeBorder;
|
|
232
|
+
}
|
|
233
|
+
if ((state === 'hover' || isHovered) && shouldShowHover) {
|
|
234
|
+
return hoverBorder;
|
|
235
|
+
}
|
|
236
|
+
return resolvedBorder;
|
|
237
|
+
};
|
|
238
|
+
// Handle click outside to close dropdown (only when component is interactive)
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
// Only add event listeners if component is interactive (has onSelect handler)
|
|
241
|
+
if (!onSelect) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const handleClickOutside = (event) => {
|
|
245
|
+
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
246
|
+
setIsOpen(false);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
if (isOpen) {
|
|
250
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
251
|
+
}
|
|
252
|
+
return () => {
|
|
253
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
254
|
+
};
|
|
255
|
+
}, [isOpen, onSelect]);
|
|
256
|
+
const selectContainerStyle = {
|
|
257
|
+
width: '100%',
|
|
258
|
+
position: 'relative',
|
|
259
|
+
display: 'flex',
|
|
260
|
+
alignItems: 'center',
|
|
261
|
+
padding: `${sizeTokens.padding.vertical} ${sizeTokens.padding.horizontal}`,
|
|
262
|
+
fontSize: resolveTypography.fontSize('base'),
|
|
263
|
+
minHeight: sizeTokens.minHeight,
|
|
264
|
+
borderRadius: inputs.inputs.borderRadius,
|
|
265
|
+
border: getBorderColor(),
|
|
266
|
+
backgroundColor: resolvedBackground,
|
|
267
|
+
color: textColor,
|
|
268
|
+
fontFamily: resolveTypography.fontFamily('roboto'),
|
|
269
|
+
fontWeight: resolveTypography.fontWeight('regular'),
|
|
270
|
+
lineHeight: resolveTypography.lineHeight('normal'),
|
|
271
|
+
letterSpacing: resolveTypography.letterSpacing('normal'),
|
|
272
|
+
cursor: isDisabled ? 'not-allowed' : (onSelect ? 'pointer' : 'default'),
|
|
273
|
+
opacity: isDisabled ? 0.6 : 1,
|
|
274
|
+
gap: '8px',
|
|
275
|
+
boxSizing: 'border-box',
|
|
276
|
+
transition: 'border-color 0.2s ease',
|
|
277
|
+
};
|
|
278
|
+
const handleSelectClick = () => {
|
|
279
|
+
// Only allow interaction if component has onSelect handler (is interactive)
|
|
280
|
+
if (!isDisabled && onSelect) {
|
|
281
|
+
setIsOpen(!isOpen);
|
|
282
|
+
setIsFocused(true);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
const handleOptionClick = (optionLabel, optionColor) => {
|
|
286
|
+
setSelectedValue(optionLabel);
|
|
287
|
+
setCurrentColor(optionColor);
|
|
288
|
+
setIsOpen(false);
|
|
289
|
+
setIsFocused(false);
|
|
290
|
+
if (onSelect) {
|
|
291
|
+
onSelect(optionLabel, optionColor);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
const handleClearClick = (e) => {
|
|
295
|
+
e.stopPropagation(); // Prevent opening dropdown
|
|
296
|
+
setSelectedValue('');
|
|
297
|
+
setCurrentColor(null);
|
|
298
|
+
setIsFocused(false);
|
|
299
|
+
if (onSelect) {
|
|
300
|
+
onSelect('', '');
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
const renderColorBox = (color, size = 16, isSelected = false) => {
|
|
304
|
+
if (!color)
|
|
305
|
+
return null;
|
|
306
|
+
const resolvedColorValue = resolveColor(color);
|
|
307
|
+
return (_jsx("div", { style: {
|
|
308
|
+
width: `${size}px`,
|
|
309
|
+
height: `${size}px`,
|
|
310
|
+
backgroundColor: resolvedColorValue,
|
|
311
|
+
borderRadius: inputs.inputs.borderRadius,
|
|
312
|
+
flexShrink: 0,
|
|
313
|
+
border: isSelected ? `1px solid ${resolvedColorValue}` : 'none',
|
|
314
|
+
} }));
|
|
315
|
+
};
|
|
316
|
+
const renderChevron = () => {
|
|
317
|
+
const chevronIcon = (isOpen || state === 'open' || state === 'focus') ? chevronUp : chevronDown;
|
|
318
|
+
if (!chevronIcon)
|
|
319
|
+
return null;
|
|
320
|
+
// Use white color for chevron when a status is selected, otherwise use resolved icon color
|
|
321
|
+
const chevronColor = (currentColor && selectedValue)
|
|
322
|
+
? resolveColor('basic.white')
|
|
323
|
+
: resolvedIcon;
|
|
324
|
+
// Process SVG string similar to other icons
|
|
325
|
+
if (chevronIcon.svg) {
|
|
326
|
+
let processedSvg = chevronIcon.svg;
|
|
327
|
+
const chevronSize = 16;
|
|
328
|
+
// Update width and height attributes
|
|
329
|
+
processedSvg = processedSvg.replace(/width="[^"]*"/gi, `width="${chevronSize}"`);
|
|
330
|
+
processedSvg = processedSvg.replace(/height="[^"]*"/gi, `height="${chevronSize}"`);
|
|
331
|
+
// If SVG doesn't have width/height, add them
|
|
332
|
+
if (!processedSvg.match(/width\s*=/i)) {
|
|
333
|
+
processedSvg = processedSvg.replace(/<svg([^>]*?)>/i, (match, attrs) => `<svg${attrs} width="${chevronSize}" height="${chevronSize}">`);
|
|
334
|
+
}
|
|
335
|
+
// Replace currentColor with chevron color (white when selected, otherwise icon color)
|
|
336
|
+
processedSvg = processedSvg.replace(/stroke="currentColor"/gi, `stroke="${chevronColor}"`);
|
|
337
|
+
processedSvg = processedSvg.replace(/fill="currentColor"/gi, `fill="${chevronColor}"`);
|
|
338
|
+
// Set stroke-width to 2px for all stroke elements
|
|
339
|
+
processedSvg = processedSvg.replace(/stroke-width="[^"]*"/gi, 'stroke-width="2"');
|
|
340
|
+
processedSvg = processedSvg.replace(/strokeWidth="[^"]*"/gi, 'strokeWidth="2"');
|
|
341
|
+
// Add stroke-width="2" to all elements that have stroke but no stroke-width
|
|
342
|
+
processedSvg = processedSvg.replace(/(<(path|line|polyline|polygon|circle|ellipse|rect)[^>]*stroke="[^"]*"[^>]*?)(?![^>]*stroke-width)(?![^>]*strokeWidth)([^>]*>)/gi, (match, before, tag, after) => {
|
|
343
|
+
return `${before} stroke-width="2"${after}`;
|
|
344
|
+
});
|
|
345
|
+
return (_jsx("span", { style: {
|
|
346
|
+
width: `${chevronSize}px`,
|
|
347
|
+
height: `${chevronSize}px`,
|
|
348
|
+
display: 'inline-flex',
|
|
349
|
+
alignItems: 'center',
|
|
350
|
+
justifyContent: 'center',
|
|
351
|
+
flexShrink: 0,
|
|
352
|
+
color: chevronColor,
|
|
353
|
+
lineHeight: 0,
|
|
354
|
+
}, dangerouslySetInnerHTML: { __html: processedSvg } }));
|
|
355
|
+
}
|
|
356
|
+
if (chevronIcon.component) {
|
|
357
|
+
return (_jsx("span", { style: {
|
|
358
|
+
width: '16px',
|
|
359
|
+
height: '16px',
|
|
360
|
+
display: 'inline-flex',
|
|
361
|
+
alignItems: 'center',
|
|
362
|
+
justifyContent: 'center',
|
|
363
|
+
flexShrink: 0,
|
|
364
|
+
color: chevronColor,
|
|
365
|
+
}, children: React.cloneElement(chevronIcon.component, {
|
|
366
|
+
width: 16,
|
|
367
|
+
height: 16,
|
|
368
|
+
style: { color: chevronColor },
|
|
369
|
+
}) }));
|
|
370
|
+
}
|
|
371
|
+
return null;
|
|
372
|
+
};
|
|
373
|
+
const renderXIcon = () => {
|
|
374
|
+
// Only show clear button if component is interactive
|
|
375
|
+
if (!xIcon || !selectedValue || isDisabled || !onSelect)
|
|
376
|
+
return null;
|
|
377
|
+
// Use white color for X icon when a status is selected
|
|
378
|
+
const xIconColor = resolveColor('basic.white');
|
|
379
|
+
// Process SVG string similar to other icons
|
|
380
|
+
if (xIcon.svg) {
|
|
381
|
+
let processedSvg = xIcon.svg;
|
|
382
|
+
const xIconSize = 16;
|
|
383
|
+
// Update width and height attributes
|
|
384
|
+
processedSvg = processedSvg.replace(/width="[^"]*"/gi, `width="${xIconSize}"`);
|
|
385
|
+
processedSvg = processedSvg.replace(/height="[^"]*"/gi, `height="${xIconSize}"`);
|
|
386
|
+
// If SVG doesn't have width/height, add them
|
|
387
|
+
if (!processedSvg.match(/width\s*=/i)) {
|
|
388
|
+
processedSvg = processedSvg.replace(/<svg([^>]*?)>/i, (match, attrs) => `<svg${attrs} width="${xIconSize}" height="${xIconSize}">`);
|
|
389
|
+
}
|
|
390
|
+
// Replace currentColor and any existing stroke/fill colors with X icon color (white)
|
|
391
|
+
processedSvg = processedSvg.replace(/stroke="currentColor"/gi, `stroke="${xIconColor}"`);
|
|
392
|
+
processedSvg = processedSvg.replace(/fill="currentColor"/gi, `fill="${xIconColor}"`);
|
|
393
|
+
processedSvg = processedSvg.replace(/stroke="[^"]*"/gi, `stroke="${xIconColor}"`);
|
|
394
|
+
processedSvg = processedSvg.replace(/fill="[^"]*"/gi, `fill="${xIconColor}"`);
|
|
395
|
+
// Set stroke-width to 2px for all stroke elements
|
|
396
|
+
processedSvg = processedSvg.replace(/stroke-width="[^"]*"/gi, 'stroke-width="2"');
|
|
397
|
+
processedSvg = processedSvg.replace(/strokeWidth="[^"]*"/gi, 'strokeWidth="2"');
|
|
398
|
+
// Add stroke-width="2" to all elements that have stroke but no stroke-width
|
|
399
|
+
processedSvg = processedSvg.replace(/(<(path|line|polyline|polygon|circle|ellipse|rect)[^>]*stroke="[^"]*"[^>]*?)(?![^>]*stroke-width)(?![^>]*strokeWidth)([^>]*>)/gi, (match, before, tag, after) => {
|
|
400
|
+
return `${before} stroke-width="2"${after}`;
|
|
401
|
+
});
|
|
402
|
+
return (_jsx("span", { onClick: handleClearClick, style: {
|
|
403
|
+
width: `${xIconSize}px`,
|
|
404
|
+
height: `${xIconSize}px`,
|
|
405
|
+
display: 'inline-flex',
|
|
406
|
+
alignItems: 'center',
|
|
407
|
+
justifyContent: 'center',
|
|
408
|
+
flexShrink: 0,
|
|
409
|
+
color: xIconColor,
|
|
410
|
+
lineHeight: 0,
|
|
411
|
+
cursor: 'pointer',
|
|
412
|
+
marginRight: '4px',
|
|
413
|
+
}, dangerouslySetInnerHTML: { __html: processedSvg } }));
|
|
414
|
+
}
|
|
415
|
+
if (xIcon.component) {
|
|
416
|
+
return (_jsx("span", { onClick: handleClearClick, style: {
|
|
417
|
+
width: '16px',
|
|
418
|
+
height: '16px',
|
|
419
|
+
display: 'inline-flex',
|
|
420
|
+
alignItems: 'center',
|
|
421
|
+
justifyContent: 'center',
|
|
422
|
+
flexShrink: 0,
|
|
423
|
+
color: xIconColor,
|
|
424
|
+
cursor: 'pointer',
|
|
425
|
+
marginRight: '4px',
|
|
426
|
+
}, children: React.cloneElement(xIcon.component, {
|
|
427
|
+
width: 16,
|
|
428
|
+
height: 16,
|
|
429
|
+
style: { color: xIconColor },
|
|
430
|
+
}) }));
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
433
|
+
};
|
|
434
|
+
// Resolve colors for dropdown from tokens
|
|
435
|
+
const dropdownBg = resolveColor('basic.white');
|
|
436
|
+
const dropdownBorder = resolveColor('gray.300');
|
|
437
|
+
const dropdownStyle = {
|
|
438
|
+
position: 'absolute',
|
|
439
|
+
top: '100%',
|
|
440
|
+
left: 0,
|
|
441
|
+
right: 0,
|
|
442
|
+
marginTop: '2px',
|
|
443
|
+
backgroundColor: dropdownBg,
|
|
444
|
+
border: `1px solid ${dropdownBorder}`,
|
|
445
|
+
borderRadius: inputs.inputs.borderRadius,
|
|
446
|
+
boxShadow: '0px 1px 4px 0px rgba(0, 0, 0, 0.1)',
|
|
447
|
+
zIndex: 1000,
|
|
448
|
+
overflow: 'hidden',
|
|
449
|
+
};
|
|
450
|
+
// Resolve colors for dropdown options from tokens
|
|
451
|
+
const optionBorderColor = resolveColor('gray.200'); // Light border between options
|
|
452
|
+
const optionHoverBg = resolveColor('gray.100'); // One level up from gray.50 for hover
|
|
453
|
+
const optionTextColor = resolveColor('gray.700');
|
|
454
|
+
const optionBg = resolveColor('basic.white');
|
|
455
|
+
const optionStyle = {
|
|
456
|
+
padding: '12px',
|
|
457
|
+
margin: '2px',
|
|
458
|
+
display: 'flex',
|
|
459
|
+
alignItems: 'center',
|
|
460
|
+
gap: '8px',
|
|
461
|
+
cursor: 'pointer',
|
|
462
|
+
borderBottom: 'none',
|
|
463
|
+
borderRadius: inputs.inputs.borderRadius,
|
|
464
|
+
fontFamily: resolveTypography.fontFamily('roboto'),
|
|
465
|
+
fontSize: resolveTypography.fontSize('base'),
|
|
466
|
+
fontWeight: resolveTypography.fontWeight('regular'),
|
|
467
|
+
color: optionTextColor,
|
|
468
|
+
backgroundColor: optionBg,
|
|
469
|
+
transition: 'background-color 0.15s ease',
|
|
470
|
+
};
|
|
471
|
+
const lastOptionStyle = {
|
|
472
|
+
...optionStyle,
|
|
473
|
+
};
|
|
474
|
+
return (_jsxs("div", { style: { marginBottom: '1rem', width: '100%', maxWidth: '400px' }, ref: selectRef, children: [showLabel && (_jsx("div", { style: {
|
|
475
|
+
fontSize: resolveTypography.fontSize('sm'),
|
|
476
|
+
color: resolveColor('gray.700'),
|
|
477
|
+
marginBottom: '0.5rem',
|
|
478
|
+
fontWeight: resolveTypography.fontWeight('medium'),
|
|
479
|
+
fontFamily: resolveTypography.fontFamily('roboto'),
|
|
480
|
+
lineHeight: resolveTypography.lineHeight('normal'),
|
|
481
|
+
letterSpacing: resolveTypography.letterSpacing('normal'),
|
|
482
|
+
}, children: label })), _jsxs("div", { style: { position: 'relative' }, children: [_jsxs("div", { style: selectContainerStyle, onClick: handleSelectClick, onMouseEnter: () => shouldShowHover && onSelect && setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [!selectedValue && currentColor && renderColorBox(currentColor, 16, true), _jsx("div", { style: {
|
|
483
|
+
flex: 1,
|
|
484
|
+
minWidth: 0,
|
|
485
|
+
fontSize: resolveTypography.fontSize('base'),
|
|
486
|
+
fontFamily: resolveTypography.fontFamily('roboto'),
|
|
487
|
+
fontWeight: resolveTypography.fontWeight('regular'),
|
|
488
|
+
lineHeight: resolveTypography.lineHeight('normal'),
|
|
489
|
+
color: textColor,
|
|
490
|
+
display: 'flex',
|
|
491
|
+
alignItems: 'center',
|
|
492
|
+
marginTop: selectedValue ? '0' : '-1px', // Move text up slightly to align with color box only when no selection
|
|
493
|
+
}, children: displayText }), renderXIcon(), renderChevron()] }), (isOpen || state === 'open') && options.length > 0 && (_jsx("div", { style: dropdownStyle, children: options.map((option, index) => (_jsxs("div", { style: index === options.length - 1 ? lastOptionStyle : optionStyle, onClick: () => handleOptionClick(option.label, option.color), onMouseEnter: (e) => {
|
|
494
|
+
e.currentTarget.style.backgroundColor = optionHoverBg;
|
|
495
|
+
}, onMouseLeave: (e) => {
|
|
496
|
+
e.currentTarget.style.backgroundColor = optionBg;
|
|
497
|
+
}, children: [renderColorBox(option.color, 16, true), _jsx("span", { children: option.label })] }, index))) }))] })] }));
|
|
498
|
+
};
|
|
499
|
+
//# sourceMappingURL=ColorSelectToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorSelectToken.js","sourceRoot":"","sources":["../../src/components/ColorSelectToken.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C,sCAAsC;AACtC,MAAM,aAAa,GAAG,YAAY,EAAE,CAAC;AAErC,0DAA0D;AAC1D,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAU,EAAE;IAChD,IAAI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AAC;AAE1B,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0BlD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const ColorSwatch = ({ name, value, cssVar }) => {
|
|
3
|
+
return (_jsxs("div", { style: { marginBottom: '1rem' }, children: [_jsx("div", { style: {
|
|
4
|
+
width: '100%',
|
|
5
|
+
height: '80px',
|
|
6
|
+
backgroundColor: value,
|
|
7
|
+
borderRadius: '8px',
|
|
8
|
+
marginBottom: '0.5rem',
|
|
9
|
+
border: '1px solid #e5e7eb',
|
|
10
|
+
} }), _jsxs("div", { style: { fontSize: '0.875rem' }, children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '0.25rem' }, children: name }), _jsx("div", { style: { color: '#6b7280', fontFamily: 'monospace', fontSize: '0.75rem' }, children: value }), cssVar && (_jsx("div", { style: { color: '#6b7280', fontFamily: 'monospace', fontSize: '0.75rem' }, children: cssVar }))] })] }));
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ColorSwatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorSwatch.js","sourceRoot":"","sources":["../../src/components/ColorSwatch.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;IACjF,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,aAClC,cACE,KAAK,EAAE;oBACL,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,MAAM;oBACd,eAAe,EAAE,KAAK;oBACtB,YAAY,EAAE,KAAK;oBACnB,YAAY,EAAE,QAAQ;oBACtB,MAAM,EAAE,mBAAmB;iBAC5B,GACD,EACF,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,aAClC,cAAK,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,YAAG,IAAI,GAAO,EACtE,cAAK,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAC3E,KAAK,GACF,EACL,MAAM,IAAI,CACT,cAAK,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,YAC3E,MAAM,GACH,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IconData {
|
|
3
|
+
name: string;
|
|
4
|
+
friendlyName: string;
|
|
5
|
+
component?: React.ReactNode;
|
|
6
|
+
svg?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
category?: string;
|
|
9
|
+
}
|
|
10
|
+
interface IconItemProps {
|
|
11
|
+
icon: IconData;
|
|
12
|
+
size?: number;
|
|
13
|
+
showDetails?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const IconItem: React.FC<IconItemProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=IconItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconItem.d.ts","sourceRoot":"","sources":["../../src/components/IconItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwG5C,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
export const IconItem = ({ icon, size = 24, showDetails = true }) => {
|
|
4
|
+
const [copied, setCopied] = useState(false);
|
|
5
|
+
const handleCopy = async () => {
|
|
6
|
+
try {
|
|
7
|
+
await navigator.clipboard.writeText(icon.name);
|
|
8
|
+
setCopied(true);
|
|
9
|
+
setTimeout(() => setCopied(false), 2000);
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
console.error('Failed to copy icon name:', err);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (_jsxs("div", { style: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
padding: '1.5rem',
|
|
20
|
+
border: '1px solid #e5e7eb',
|
|
21
|
+
borderRadius: '8px',
|
|
22
|
+
backgroundColor: '#ffffff',
|
|
23
|
+
transition: 'all 0.2s ease',
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
minHeight: '100px',
|
|
26
|
+
}, onMouseEnter: (e) => {
|
|
27
|
+
e.currentTarget.style.borderColor = '#3b82f6';
|
|
28
|
+
e.currentTarget.style.boxShadow = '0 4px 6px -1px rgba(0, 0, 0, 0.1)';
|
|
29
|
+
}, onMouseLeave: (e) => {
|
|
30
|
+
e.currentTarget.style.borderColor = '#e5e7eb';
|
|
31
|
+
e.currentTarget.style.boxShadow = 'none';
|
|
32
|
+
}, onClick: handleCopy, title: `Click to copy: ${icon.name}`, children: [_jsx("div", { style: {
|
|
33
|
+
width: `${size}px`,
|
|
34
|
+
height: `${size}px`,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
marginBottom: '1rem',
|
|
39
|
+
color: '#1f2937',
|
|
40
|
+
flexShrink: 0,
|
|
41
|
+
}, children: icon.component ? (_jsx("div", { style: { width: '100%', height: '100%' }, children: icon.component })) : icon.svg ? (_jsx("div", { dangerouslySetInnerHTML: {
|
|
42
|
+
__html: icon.svg.replace(/<svg([^>]*)>/, '<svg$1 style="width: 100%; height: 100%; display: block;">')
|
|
43
|
+
}, style: {
|
|
44
|
+
width: '100%',
|
|
45
|
+
height: '100%',
|
|
46
|
+
} })) : (_jsx("div", { style: {
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '100%',
|
|
49
|
+
border: '2px dashed #d1d5db',
|
|
50
|
+
borderRadius: '4px',
|
|
51
|
+
display: 'flex',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
fontSize: '0.75rem',
|
|
55
|
+
color: '#9ca3af',
|
|
56
|
+
}, children: "Icon" })) }), showDetails && (_jsx("div", { style: { textAlign: 'center', width: '100%' }, children: _jsx("div", { style: {
|
|
57
|
+
fontSize: '0.75rem',
|
|
58
|
+
color: copied ? '#10b981' : '#6b7280',
|
|
59
|
+
fontFamily: 'monospace',
|
|
60
|
+
wordBreak: 'break-word',
|
|
61
|
+
transition: 'color 0.2s ease',
|
|
62
|
+
}, children: copied ? '✓ Copied!' : icon.name }) }))] }));
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=IconItem.js.map
|