react-restyle-components 0.4.23 → 0.4.25
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/lib/src/core-components/src/components/AlertBanner/AlertBanner.d.ts +4 -0
- package/lib/src/core-components/src/components/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/AlertBanner.js +45 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.d.ts +27 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.js +233 -0
- package/lib/src/core-components/src/components/AlertBanner/index.d.ts +3 -0
- package/lib/src/core-components/src/components/AlertBanner/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/index.js +2 -0
- package/lib/src/core-components/src/components/AlertBanner/types.d.ts +46 -0
- package/lib/src/core-components/src/components/AlertBanner/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/types.js +10 -0
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Badge/Badge.d.ts +33 -33
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.d.ts +28 -0
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.js +83 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.d.ts +44 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.js +370 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.d.ts +4 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.js +3 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.d.ts +14 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.js +3 -0
- package/lib/src/core-components/src/components/Button/Button.spec.js +1 -1
- package/lib/src/core-components/src/components/Button/button.component.js +1 -1
- package/lib/src/core-components/src/components/Chip/Chip.d.ts +5 -0
- package/lib/src/core-components/src/components/Chip/Chip.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/Chip.js +64 -0
- package/lib/src/core-components/src/components/Chip/elements.d.ts +27 -0
- package/lib/src/core-components/src/components/Chip/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/elements.js +253 -0
- package/lib/src/core-components/src/components/Chip/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Chip/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/index.js +2 -0
- package/lib/src/core-components/src/components/Chip/types.d.ts +54 -0
- package/lib/src/core-components/src/components/Chip/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/types.js +4 -0
- package/lib/src/core-components/src/components/Divider/Divider.d.ts +4 -0
- package/lib/src/core-components/src/components/Divider/Divider.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/Divider.js +25 -0
- package/lib/src/core-components/src/components/Divider/elements.d.ts +22 -0
- package/lib/src/core-components/src/components/Divider/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/elements.js +103 -0
- package/lib/src/core-components/src/components/Divider/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Divider/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/index.js +2 -0
- package/lib/src/core-components/src/components/Divider/types.d.ts +30 -0
- package/lib/src/core-components/src/components/Divider/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/types.js +4 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.d.ts +6 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.js +147 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.d.ts +12 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.js +89 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.d.ts +49 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.js +409 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.d.ts +4 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.js +3 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.d.ts +173 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.js +28 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.d.ts +65 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.js +193 -0
- package/lib/src/core-components/src/components/Icon/Icon.js +1 -1
- package/lib/src/core-components/src/components/Masonry/Masonry.d.ts +7 -0
- package/lib/src/core-components/src/components/Masonry/Masonry.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/Masonry.js +73 -0
- package/lib/src/core-components/src/components/Masonry/elements.d.ts +31 -0
- package/lib/src/core-components/src/components/Masonry/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/elements.js +122 -0
- package/lib/src/core-components/src/components/Masonry/hooks.d.ts +21 -0
- package/lib/src/core-components/src/components/Masonry/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/hooks.js +100 -0
- package/lib/src/core-components/src/components/Masonry/index.d.ts +4 -0
- package/lib/src/core-components/src/components/Masonry/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/index.js +3 -0
- package/lib/src/core-components/src/components/Masonry/types.d.ts +117 -0
- package/lib/src/core-components/src/components/Masonry/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/types.js +1 -0
- package/lib/src/core-components/src/components/Picker/color-picker-modal/color-picker-modal.component.js +1 -1
- package/lib/src/core-components/src/components/Skeleton/Skeleton.d.ts +8 -0
- package/lib/src/core-components/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/Skeleton.js +51 -0
- package/lib/src/core-components/src/components/Skeleton/elements.d.ts +33 -0
- package/lib/src/core-components/src/components/Skeleton/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/elements.js +238 -0
- package/lib/src/core-components/src/components/Skeleton/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Skeleton/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/index.js +2 -0
- package/lib/src/core-components/src/components/Skeleton/types.d.ts +80 -0
- package/lib/src/core-components/src/components/Skeleton/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/types.js +4 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.d.ts +4 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.js +128 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.d.ts +57 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.js +299 -0
- package/lib/src/core-components/src/components/SpeedDial/index.d.ts +3 -0
- package/lib/src/core-components/src/components/SpeedDial/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/index.js +2 -0
- package/lib/src/core-components/src/components/SpeedDial/types.d.ts +149 -0
- package/lib/src/core-components/src/components/SpeedDial/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/types.js +3 -0
- package/lib/src/core-components/src/components/Switch/Switch.d.ts +4 -0
- package/lib/src/core-components/src/components/Switch/Switch.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/Switch.js +26 -0
- package/lib/src/core-components/src/components/Switch/elements.d.ts +33 -0
- package/lib/src/core-components/src/components/Switch/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/elements.js +167 -0
- package/lib/src/core-components/src/components/Switch/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Switch/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/index.js +2 -0
- package/lib/src/core-components/src/components/Switch/types.d.ts +32 -0
- package/lib/src/core-components/src/components/Switch/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/types.js +3 -0
- package/lib/src/core-components/src/components/Table/Table.d.ts +7 -0
- package/lib/src/core-components/src/components/Table/Table.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/Table.js +695 -0
- package/lib/src/core-components/src/components/Table/elements.d.ts +89 -0
- package/lib/src/core-components/src/components/Table/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/elements.js +611 -0
- package/lib/src/core-components/src/components/Table/filters.d.ts +23 -0
- package/lib/src/core-components/src/components/Table/filters.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/filters.js +181 -0
- package/lib/src/core-components/src/components/Table/hooks.d.ts +107 -0
- package/lib/src/core-components/src/components/Table/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/hooks.js +451 -0
- package/lib/src/core-components/src/components/Table/index.d.ts +5 -0
- package/lib/src/core-components/src/components/Table/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/index.js +4 -0
- package/lib/src/core-components/src/components/Table/types.d.ts +635 -0
- package/lib/src/core-components/src/components/Table/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/types.js +1 -0
- package/lib/src/core-components/src/components/Toast/Toast.d.ts +5 -0
- package/lib/src/core-components/src/components/Toast/Toast.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/Toast.js +50 -0
- package/lib/src/core-components/src/components/Toast/elements.d.ts +28 -0
- package/lib/src/core-components/src/components/Toast/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/elements.js +272 -0
- package/lib/src/core-components/src/components/Toast/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Toast/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/index.js +2 -0
- package/lib/src/core-components/src/components/Toast/types.d.ts +52 -0
- package/lib/src/core-components/src/components/Toast/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/types.js +9 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.d.ts +7 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.js +200 -0
- package/lib/src/core-components/src/components/Tooltip/elements.d.ts +19 -0
- package/lib/src/core-components/src/components/Tooltip/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/elements.js +195 -0
- package/lib/src/core-components/src/components/Tooltip/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Tooltip/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/index.js +2 -0
- package/lib/src/core-components/src/components/Tooltip/types.d.ts +81 -17
- package/lib/src/core-components/src/components/Tooltip/types.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Tooltip/types.js +17 -1
- package/lib/src/core-components/src/components/Tooltip/utils.d.ts +26 -0
- package/lib/src/core-components/src/components/Tooltip/utils.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/utils.js +140 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.d.ts +5 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.js +303 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.d.ts +74 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.js +494 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.d.ts +57 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.js +252 -0
- package/lib/src/core-components/src/components/TreeSelect/index.d.ts +4 -0
- package/lib/src/core-components/src/components/TreeSelect/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/index.js +3 -0
- package/lib/src/core-components/src/components/TreeSelect/types.d.ts +205 -0
- package/lib/src/core-components/src/components/TreeSelect/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/types.js +1 -0
- package/lib/src/core-components/src/components/index.d.ts +13 -1
- package/lib/src/core-components/src/components/index.d.ts.map +1 -1
- package/lib/src/core-components/src/components/index.js +14 -1
- package/lib/src/core-components/src/core-components/CoreButton/CoreButton.d.ts +2 -2
- package/lib/src/core-components/src/tc.global.css +14 -3
- package/lib/src/core-components/src/tc.module.css +2 -2
- package/package.json +1 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts +0 -29
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts.map +0 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.js +0 -10
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
/** Responsive breakpoint configuration */
|
|
3
|
+
export interface MasonryBreakpoints {
|
|
4
|
+
/** Extra small screens (default) */
|
|
5
|
+
xs?: number;
|
|
6
|
+
/** Small screens (≥640px) */
|
|
7
|
+
sm?: number;
|
|
8
|
+
/** Medium screens (≥768px) */
|
|
9
|
+
md?: number;
|
|
10
|
+
/** Large screens (≥1024px) */
|
|
11
|
+
lg?: number;
|
|
12
|
+
/** Extra large screens (≥1280px) */
|
|
13
|
+
xl?: number;
|
|
14
|
+
/** 2XL screens (≥1536px) */
|
|
15
|
+
'2xl'?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Masonry item data structure */
|
|
18
|
+
export interface MasonryItem {
|
|
19
|
+
/** Unique identifier */
|
|
20
|
+
id: string | number;
|
|
21
|
+
/** Content to render */
|
|
22
|
+
content?: React.ReactNode;
|
|
23
|
+
/** Force item to specific column (0-indexed) */
|
|
24
|
+
column?: number;
|
|
25
|
+
/** Image source (for image items) */
|
|
26
|
+
src?: string;
|
|
27
|
+
/** Image alt text */
|
|
28
|
+
alt?: string;
|
|
29
|
+
/** Fixed height (optional) */
|
|
30
|
+
height?: number | string;
|
|
31
|
+
/** Additional data */
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
34
|
+
/** Custom class names */
|
|
35
|
+
export interface MasonryClassNames {
|
|
36
|
+
/** Root container */
|
|
37
|
+
root?: string;
|
|
38
|
+
/** Column container */
|
|
39
|
+
column?: string;
|
|
40
|
+
/** Individual item wrapper */
|
|
41
|
+
item?: string;
|
|
42
|
+
/** Image element */
|
|
43
|
+
image?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Custom styles */
|
|
46
|
+
export interface MasonryStyles {
|
|
47
|
+
/** Root container */
|
|
48
|
+
root?: CSSProperties;
|
|
49
|
+
/** Column container */
|
|
50
|
+
column?: CSSProperties;
|
|
51
|
+
/** Individual item wrapper */
|
|
52
|
+
item?: CSSProperties;
|
|
53
|
+
/** Image element */
|
|
54
|
+
image?: CSSProperties;
|
|
55
|
+
}
|
|
56
|
+
/** Render item function */
|
|
57
|
+
export type MasonryRenderItem<T extends MasonryItem = MasonryItem> = (item: T, index: number, columnIndex: number) => React.ReactNode;
|
|
58
|
+
/** Image load handler */
|
|
59
|
+
export type MasonryImageLoadHandler = (item: MasonryItem, naturalWidth: number, naturalHeight: number) => void;
|
|
60
|
+
export interface MasonryProps<T extends MasonryItem = MasonryItem> {
|
|
61
|
+
/** Array of items to render */
|
|
62
|
+
items: T[];
|
|
63
|
+
/** Number of columns (number for fixed, object for responsive) */
|
|
64
|
+
columns?: number | MasonryBreakpoints;
|
|
65
|
+
/** Gap between items in pixels (number for fixed, object for responsive) */
|
|
66
|
+
gutter?: number | MasonryBreakpoints;
|
|
67
|
+
/** Custom render function for each item */
|
|
68
|
+
renderItem?: MasonryRenderItem<T>;
|
|
69
|
+
/** Enable sequential ordering (items placed in order, not balanced) */
|
|
70
|
+
sequential?: boolean;
|
|
71
|
+
/** Animation duration in ms */
|
|
72
|
+
animationDuration?: number;
|
|
73
|
+
/** Enable fade-in animation */
|
|
74
|
+
animated?: boolean;
|
|
75
|
+
/** Stagger delay between items in ms */
|
|
76
|
+
staggerDelay?: number;
|
|
77
|
+
/** Custom class names */
|
|
78
|
+
classNames?: MasonryClassNames;
|
|
79
|
+
/** Custom styles */
|
|
80
|
+
styles?: MasonryStyles;
|
|
81
|
+
/** Additional className for root */
|
|
82
|
+
className?: string;
|
|
83
|
+
/** Additional style for root */
|
|
84
|
+
style?: CSSProperties;
|
|
85
|
+
/** Called when an image loads */
|
|
86
|
+
onImageLoad?: MasonryImageLoadHandler;
|
|
87
|
+
/** Called when layout updates */
|
|
88
|
+
onLayoutComplete?: () => void;
|
|
89
|
+
/** Minimum item height */
|
|
90
|
+
minItemHeight?: number;
|
|
91
|
+
/** Default column for items without specified column */
|
|
92
|
+
defaultColumn?: number;
|
|
93
|
+
/** Loading placeholder */
|
|
94
|
+
loadingPlaceholder?: React.ReactNode;
|
|
95
|
+
/** Empty state content */
|
|
96
|
+
emptyState?: React.ReactNode;
|
|
97
|
+
}
|
|
98
|
+
/** Image item props */
|
|
99
|
+
export interface MasonryImageProps {
|
|
100
|
+
/** Image source */
|
|
101
|
+
src: string;
|
|
102
|
+
/** Alt text */
|
|
103
|
+
alt?: string;
|
|
104
|
+
/** Additional className */
|
|
105
|
+
className?: string;
|
|
106
|
+
/** Additional style */
|
|
107
|
+
style?: CSSProperties;
|
|
108
|
+
/** Load handler */
|
|
109
|
+
onLoad?: (e: React.SyntheticEvent<HTMLImageElement>) => void;
|
|
110
|
+
/** Error handler */
|
|
111
|
+
onError?: (e: React.SyntheticEvent<HTMLImageElement>) => void;
|
|
112
|
+
/** Object fit */
|
|
113
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
114
|
+
/** Border radius */
|
|
115
|
+
borderRadius?: string | number;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Masonry/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAE3C,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,wBAAwB;IACxB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,sBAAsB;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,yBAAyB;AACzB,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,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
|
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useCallback, useRef, useState, useEffect } from 'react';
|
|
3
3
|
import { HexColorPicker } from 'react-colorful';
|
|
4
4
|
import { useClickOutside } from '../../../hooks';
|
|
5
|
-
import { TooltipProvider, Tooltip } from '../../Tooltip
|
|
5
|
+
import { TooltipProvider, Tooltip } from '../../Tooltip';
|
|
6
6
|
import { DEFAULT_BG_COLOR, DEFAULT_TEXT_COLOR, STANDARD_COLORS, } from '../../../helpers/constants';
|
|
7
7
|
import './color-picker-modal.css';
|
|
8
8
|
export const ColorPickerModal = ({ color, isVisible = false, testId = 'color-picker', tooltip = '', tooltipSide = 'bottom', onChange, onNoFill, onClose, }) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SkeletonProps, SkeletonGroupProps, SkeletonTextProps, SkeletonAvatarProps, SkeletonCardProps } from './types';
|
|
3
|
+
export declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const SkeletonGroup: React.ForwardRefExoticComponent<SkeletonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const SkeletonText: React.ForwardRefExoticComponent<SkeletonTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const SkeletonAvatar: React.ForwardRefExoticComponent<SkeletonAvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const SkeletonCard: React.ForwardRefExoticComponent<SkeletonCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Skeleton/Skeleton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AASjD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,QAAQ,sFAuFpB,CAAC;AAIF,eAAO,MAAM,aAAa,2FA6BzB,CAAC;AAKF,eAAO,MAAM,YAAY,0FA2CxB,CAAC;AAKF,eAAO,MAAM,cAAc,4FA+B1B,CAAC;AAKF,eAAO,MAAM,YAAY,0FAoFxB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useMemo } from 'react';
|
|
4
|
+
import { SkeletonElement, SkeletonWrapper, SkeletonGroupContainer, SkeletonCardContainer, SkeletonTextContainer, avatarSizes, } from './elements';
|
|
5
|
+
// Size presets for base Skeleton
|
|
6
|
+
const sizePresets = {
|
|
7
|
+
xs: { width: 40, height: 12 },
|
|
8
|
+
sm: { width: 80, height: 16 },
|
|
9
|
+
md: { width: 120, height: 20 },
|
|
10
|
+
lg: { width: 180, height: 24 },
|
|
11
|
+
xl: { width: 240, height: 32 },
|
|
12
|
+
};
|
|
13
|
+
export const Skeleton = forwardRef(function SkeletonComponent(props, ref) {
|
|
14
|
+
const { width, height, variant = 'rectangular', animation = 'shimmer', size = 'md', count = 1, gap = '10px', duration = 1500, borderRadius, theme = 'light', stagger = false, responsive = false, aspectRatio, className, style, ...rest } = props;
|
|
15
|
+
// Determine dimensions
|
|
16
|
+
const finalWidth = width ?? sizePresets[size].width;
|
|
17
|
+
const finalHeight = height ?? sizePresets[size].height;
|
|
18
|
+
const elements = useMemo(() => Array(count)
|
|
19
|
+
.fill(null)
|
|
20
|
+
.map((_, index) => index), [count]);
|
|
21
|
+
if (count === 1) {
|
|
22
|
+
return (_jsx(SkeletonElement, { ref: ref, "$width": finalWidth, "$height": finalHeight, "$variant": variant, "$animation": animation, "$duration": duration, "$borderRadius": borderRadius, "$theme": theme, "$responsive": responsive, "$aspectRatio": aspectRatio, "aria-busy": "true", "aria-live": "polite", "aria-label": "Loading...", role: "progressbar", "data-testid": "skeleton", className: className, style: style, ...rest }));
|
|
23
|
+
}
|
|
24
|
+
return (_jsx(SkeletonWrapper, { ref: ref, "$gap": gap, "$direction": "column", "data-testid": "skeleton-wrapper", className: className, ...rest, children: elements.map((key) => (_jsx(SkeletonElement, { "$width": finalWidth, "$height": finalHeight, "$variant": variant, "$animation": animation, "$duration": duration, "$borderRadius": borderRadius, "$theme": theme, "$responsive": responsive, "$aspectRatio": aspectRatio, "$staggerIndex": stagger ? key : undefined, "aria-busy": "true", role: "progressbar" }, key))) }));
|
|
25
|
+
});
|
|
26
|
+
Skeleton.displayName = 'Skeleton';
|
|
27
|
+
export const SkeletonGroup = forwardRef(function SkeletonGroupComponent(props, ref) {
|
|
28
|
+
const { children, direction = 'column', gap = '12px', align = 'stretch', wrap = false, responsive = false, className, ...rest } = props;
|
|
29
|
+
return (_jsx(SkeletonGroupContainer, { ref: ref, "$direction": direction, "$gap": gap, "$align": align, "$wrap": wrap, "$responsive": responsive, "data-testid": "skeleton-group", className: className, ...rest, children: children }));
|
|
30
|
+
});
|
|
31
|
+
SkeletonGroup.displayName = 'SkeletonGroup';
|
|
32
|
+
// Preset: Text lines skeleton
|
|
33
|
+
export const SkeletonText = forwardRef(function SkeletonTextComponent(props, ref) {
|
|
34
|
+
const { lines = 3, lastLineWidth = '60%', gap = '10px', animation = 'shimmer', theme = 'light', className, ...rest } = props;
|
|
35
|
+
const lineElements = useMemo(() => Array(lines).fill(null).map((_, i) => i), [lines]);
|
|
36
|
+
return (_jsx(SkeletonTextContainer, { ref: ref, "$gap": gap, "data-testid": "skeleton-text", className: className, ...rest, children: lineElements.map((index) => (_jsx(SkeletonElement, { "$width": index === lines - 1 ? lastLineWidth : '100%', "$height": 16, "$variant": "text", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false, "$staggerIndex": index, "aria-busy": "true", role: "progressbar" }, index))) }));
|
|
37
|
+
});
|
|
38
|
+
SkeletonText.displayName = 'SkeletonText';
|
|
39
|
+
// Preset: Avatar skeleton
|
|
40
|
+
export const SkeletonAvatar = forwardRef(function SkeletonAvatarComponent(props, ref) {
|
|
41
|
+
const { size = 'md', animation = 'shimmer', theme = 'light', className, ...rest } = props;
|
|
42
|
+
const avatarSize = avatarSizes[size];
|
|
43
|
+
return (_jsx(SkeletonElement, { ref: ref, "$width": avatarSize, "$height": avatarSize, "$variant": "avatar", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false, "aria-busy": "true", "aria-label": "Loading avatar...", role: "progressbar", "data-testid": "skeleton-avatar", className: className, ...rest }));
|
|
44
|
+
});
|
|
45
|
+
SkeletonAvatar.displayName = 'SkeletonAvatar';
|
|
46
|
+
// Preset: Card skeleton
|
|
47
|
+
export const SkeletonCard = forwardRef(function SkeletonCardComponent(props, ref) {
|
|
48
|
+
const { hasImage = true, imageHeight = 180, textLines = 3, hasActions = true, animation = 'shimmer', theme = 'light', className, ...rest } = props;
|
|
49
|
+
return (_jsxs(SkeletonCardContainer, { ref: ref, "$theme": theme, "data-testid": "skeleton-card", className: className, ...rest, children: [hasImage && (_jsx(SkeletonElement, { "$width": "100%", "$height": imageHeight, "$variant": "rounded", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false, style: { marginBottom: 16 } })), _jsxs(SkeletonGroup, { gap: "10px", style: { marginBottom: hasActions ? 16 : 0 }, children: [_jsx(SkeletonElement, { "$width": "70%", "$height": 20, "$variant": "text", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false }), Array(textLines - 1).fill(null).map((_, i) => (_jsx(SkeletonElement, { "$width": i === textLines - 2 ? '50%' : '90%', "$height": 14, "$variant": "text", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false, "$staggerIndex": i + 1 }, i)))] }), hasActions && (_jsxs(SkeletonGroup, { direction: "row", gap: "10px", children: [_jsx(SkeletonElement, { "$width": 80, "$height": 36, "$variant": "button", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false }), _jsx(SkeletonElement, { "$width": 80, "$height": 36, "$variant": "button", "$animation": animation, "$duration": 1500, "$theme": theme, "$responsive": false })] }))] }));
|
|
50
|
+
});
|
|
51
|
+
SkeletonCard.displayName = 'SkeletonCard';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SkeletonVariant, SkeletonAnimation, SkeletonSize, SkeletonTheme } from './types';
|
|
3
|
+
export declare const avatarSizes: Record<SkeletonSize, string>;
|
|
4
|
+
export declare const SkeletonElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
5
|
+
$width: string | number;
|
|
6
|
+
$height: string | number;
|
|
7
|
+
$variant: SkeletonVariant;
|
|
8
|
+
$animation: SkeletonAnimation;
|
|
9
|
+
$duration: number;
|
|
10
|
+
$borderRadius?: string | undefined;
|
|
11
|
+
$theme: SkeletonTheme;
|
|
12
|
+
$responsive: boolean;
|
|
13
|
+
$aspectRatio?: string | undefined;
|
|
14
|
+
$staggerIndex?: number | undefined;
|
|
15
|
+
}>> & string;
|
|
16
|
+
export declare const SkeletonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
17
|
+
$gap: string;
|
|
18
|
+
$direction: 'row' | 'column';
|
|
19
|
+
}>> & string;
|
|
20
|
+
export declare const SkeletonGroupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
21
|
+
$direction: 'row' | 'column';
|
|
22
|
+
$gap: string;
|
|
23
|
+
$align: 'start' | 'center' | 'end' | 'stretch';
|
|
24
|
+
$wrap: boolean;
|
|
25
|
+
$responsive: boolean;
|
|
26
|
+
}>> & string;
|
|
27
|
+
export declare const SkeletonCardContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
28
|
+
$theme: SkeletonTheme;
|
|
29
|
+
}>> & string;
|
|
30
|
+
export declare const SkeletonTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
|
+
$gap: string;
|
|
32
|
+
}>> & string;
|
|
33
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Skeleton/elements.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAuExF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAMpD,CAAC;AAoFF,eAAO,MAAM,eAAe;YAClB,MAAM,GAAG,MAAM;aACd,MAAM,GAAG,MAAM;cACd,eAAe;gBACb,iBAAiB;eAClB,MAAM;;YAET,aAAa;iBACR,OAAO;;;YA+CrB,CAAC;AAEF,eAAO,MAAM,eAAe;UACpB,MAAM;gBACA,KAAK,GAAG,QAAQ;YAK7B,CAAC;AAEF,eAAO,MAAM,sBAAsB;gBACrB,KAAK,GAAG,QAAQ;UACtB,MAAM;YACJ,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS;WACvC,OAAO;iBACD,OAAO;YA0BrB,CAAC;AAEF,eAAO,MAAM,qBAAqB;YACxB,aAAa;YAYtB,CAAC;AAEF,eAAO,MAAM,qBAAqB;UAC1B,MAAM;YAKb,CAAC"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { styled, css, keyframes } from 'styled-components';
|
|
2
|
+
import { tokens } from '../../utils/designTokens';
|
|
3
|
+
import { breakpoints } from '../../utils/abstracts';
|
|
4
|
+
// Animations
|
|
5
|
+
const pulse = keyframes `
|
|
6
|
+
0%, 100% {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
}
|
|
9
|
+
50% {
|
|
10
|
+
opacity: 0.4;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
const wave = keyframes `
|
|
14
|
+
0% {
|
|
15
|
+
transform: translateX(-100%);
|
|
16
|
+
}
|
|
17
|
+
50% {
|
|
18
|
+
transform: translateX(100%);
|
|
19
|
+
}
|
|
20
|
+
100% {
|
|
21
|
+
transform: translateX(100%);
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const shimmer = keyframes `
|
|
25
|
+
0% {
|
|
26
|
+
background-position: -200% 0;
|
|
27
|
+
}
|
|
28
|
+
100% {
|
|
29
|
+
background-position: 200% 0;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const glow = keyframes `
|
|
33
|
+
0%, 100% {
|
|
34
|
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
|
|
35
|
+
opacity: 0.8;
|
|
36
|
+
}
|
|
37
|
+
50% {
|
|
38
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
|
|
39
|
+
opacity: 1;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
// Theme colors
|
|
43
|
+
const getThemeColors = (theme) => {
|
|
44
|
+
if (theme === 'dark') {
|
|
45
|
+
return {
|
|
46
|
+
base: '#374151',
|
|
47
|
+
highlight: '#4b5563',
|
|
48
|
+
wave: 'rgba(255, 255, 255, 0.1)',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// light or auto (defaults to light)
|
|
52
|
+
return {
|
|
53
|
+
base: '#e5e7eb',
|
|
54
|
+
highlight: '#f3f4f6',
|
|
55
|
+
wave: 'rgba(255, 255, 255, 0.6)',
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
// Size presets
|
|
59
|
+
const sizePresets = {
|
|
60
|
+
xs: { width: '40px', height: '12px' },
|
|
61
|
+
sm: { width: '80px', height: '16px' },
|
|
62
|
+
md: { width: '120px', height: '20px' },
|
|
63
|
+
lg: { width: '180px', height: '24px' },
|
|
64
|
+
xl: { width: '240px', height: '32px' },
|
|
65
|
+
};
|
|
66
|
+
// Avatar size presets
|
|
67
|
+
export const avatarSizes = {
|
|
68
|
+
xs: '24px',
|
|
69
|
+
sm: '32px',
|
|
70
|
+
md: '48px',
|
|
71
|
+
lg: '64px',
|
|
72
|
+
xl: '96px',
|
|
73
|
+
};
|
|
74
|
+
const getAnimationStyles = (animation, duration, theme) => {
|
|
75
|
+
const colors = getThemeColors(theme);
|
|
76
|
+
switch (animation) {
|
|
77
|
+
case 'pulse':
|
|
78
|
+
return css `
|
|
79
|
+
animation: ${pulse} ${duration}ms cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
80
|
+
`;
|
|
81
|
+
case 'wave':
|
|
82
|
+
return css `
|
|
83
|
+
position: relative;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
|
|
86
|
+
&::after {
|
|
87
|
+
content: '';
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: 0;
|
|
90
|
+
left: 0;
|
|
91
|
+
right: 0;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
background: linear-gradient(
|
|
94
|
+
90deg,
|
|
95
|
+
transparent 0%,
|
|
96
|
+
${colors.wave} 50%,
|
|
97
|
+
transparent 100%
|
|
98
|
+
);
|
|
99
|
+
animation: ${wave} ${duration}ms ease-in-out infinite;
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
case 'shimmer':
|
|
103
|
+
return css `
|
|
104
|
+
background: linear-gradient(
|
|
105
|
+
90deg,
|
|
106
|
+
${colors.base} 0%,
|
|
107
|
+
${colors.highlight} 20%,
|
|
108
|
+
${colors.highlight} 40%,
|
|
109
|
+
${colors.base} 100%
|
|
110
|
+
);
|
|
111
|
+
background-size: 400% 100%;
|
|
112
|
+
animation: ${shimmer} ${duration}ms linear infinite;
|
|
113
|
+
`;
|
|
114
|
+
case 'glow':
|
|
115
|
+
return css `
|
|
116
|
+
animation: ${glow} ${duration}ms ease-in-out infinite;
|
|
117
|
+
`;
|
|
118
|
+
case 'none':
|
|
119
|
+
default:
|
|
120
|
+
return css ``;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const getVariantStyles = (variant, borderRadius) => {
|
|
124
|
+
switch (variant) {
|
|
125
|
+
case 'circular':
|
|
126
|
+
case 'avatar':
|
|
127
|
+
return css `
|
|
128
|
+
border-radius: 50%;
|
|
129
|
+
`;
|
|
130
|
+
case 'text':
|
|
131
|
+
return css `
|
|
132
|
+
border-radius: 6px;
|
|
133
|
+
`;
|
|
134
|
+
case 'button':
|
|
135
|
+
return css `
|
|
136
|
+
border-radius: ${tokens.borderRadius050 || '6px'};
|
|
137
|
+
`;
|
|
138
|
+
case 'badge':
|
|
139
|
+
return css `
|
|
140
|
+
border-radius: 9999px;
|
|
141
|
+
`;
|
|
142
|
+
case 'rounded':
|
|
143
|
+
return css `
|
|
144
|
+
border-radius: ${borderRadius || tokens.borderRadius100 || '12px'};
|
|
145
|
+
`;
|
|
146
|
+
case 'rectangular':
|
|
147
|
+
default:
|
|
148
|
+
return css `
|
|
149
|
+
border-radius: 4px;
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
export const SkeletonElement = styled.div `
|
|
154
|
+
display: block;
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
background-color: ${({ $animation, $theme }) => {
|
|
157
|
+
const colors = getThemeColors($theme);
|
|
158
|
+
return $animation === 'shimmer' ? 'transparent' : colors.base;
|
|
159
|
+
}};
|
|
160
|
+
width: ${({ $width }) => (typeof $width === 'number' ? `${$width}px` : $width)};
|
|
161
|
+
height: ${({ $height, $aspectRatio }) => $aspectRatio ? 'auto' : (typeof $height === 'number' ? `${$height}px` : $height)};
|
|
162
|
+
|
|
163
|
+
${({ $aspectRatio }) => $aspectRatio &&
|
|
164
|
+
css `
|
|
165
|
+
aspect-ratio: ${$aspectRatio};
|
|
166
|
+
`}
|
|
167
|
+
|
|
168
|
+
${({ $variant, $borderRadius }) => getVariantStyles($variant, $borderRadius)}
|
|
169
|
+
${({ $animation, $duration, $theme }) => getAnimationStyles($animation, $duration, $theme)}
|
|
170
|
+
|
|
171
|
+
/* Stagger animation */
|
|
172
|
+
${({ $staggerIndex }) => $staggerIndex !== undefined &&
|
|
173
|
+
css `
|
|
174
|
+
animation-delay: ${$staggerIndex * 100}ms;
|
|
175
|
+
`}
|
|
176
|
+
|
|
177
|
+
/* Responsive */
|
|
178
|
+
${({ $responsive }) => $responsive &&
|
|
179
|
+
css `
|
|
180
|
+
${breakpoints.sm} {
|
|
181
|
+
width: 100%;
|
|
182
|
+
}
|
|
183
|
+
`}
|
|
184
|
+
|
|
185
|
+
/* Accessibility - reduce motion */
|
|
186
|
+
@media (prefers-reduced-motion: reduce) {
|
|
187
|
+
animation: none;
|
|
188
|
+
|
|
189
|
+
&::after {
|
|
190
|
+
animation: none;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
`;
|
|
194
|
+
export const SkeletonWrapper = styled.div `
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: ${({ $direction }) => $direction};
|
|
197
|
+
gap: ${({ $gap }) => $gap};
|
|
198
|
+
`;
|
|
199
|
+
export const SkeletonGroupContainer = styled.div `
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-direction: ${({ $direction }) => $direction};
|
|
202
|
+
gap: ${({ $gap }) => $gap};
|
|
203
|
+
align-items: ${({ $align }) => $align === 'start' ? 'flex-start' :
|
|
204
|
+
$align === 'end' ? 'flex-end' :
|
|
205
|
+
$align === 'stretch' ? 'stretch' : 'center'};
|
|
206
|
+
|
|
207
|
+
${({ $wrap }) => $wrap &&
|
|
208
|
+
css `
|
|
209
|
+
flex-wrap: wrap;
|
|
210
|
+
`}
|
|
211
|
+
|
|
212
|
+
/* Responsive stacking */
|
|
213
|
+
${({ $responsive, $direction }) => $responsive &&
|
|
214
|
+
$direction === 'row' &&
|
|
215
|
+
css `
|
|
216
|
+
${breakpoints.sm} {
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
align-items: stretch;
|
|
219
|
+
}
|
|
220
|
+
`}
|
|
221
|
+
`;
|
|
222
|
+
export const SkeletonCardContainer = styled.div `
|
|
223
|
+
background: ${({ $theme }) => $theme === 'dark' ? '#1f2937' : '#ffffff'};
|
|
224
|
+
border-radius: ${tokens.borderRadius100 || '12px'};
|
|
225
|
+
padding: 16px;
|
|
226
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
227
|
+
border: 1px solid ${({ $theme }) => $theme === 'dark' ? '#374151' : '#f3f4f6'};
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
|
|
230
|
+
${breakpoints.sm} {
|
|
231
|
+
padding: 12px;
|
|
232
|
+
}
|
|
233
|
+
`;
|
|
234
|
+
export const SkeletonTextContainer = styled.div `
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-direction: column;
|
|
237
|
+
gap: ${({ $gap }) => $gap};
|
|
238
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Skeleton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const SKELETON_VARIANTS: readonly ["rectangular", "circular", "text", "rounded", "button", "avatar", "badge"];
|
|
3
|
+
export type SkeletonVariant = (typeof SKELETON_VARIANTS)[number];
|
|
4
|
+
export declare const SKELETON_ANIMATIONS: readonly ["pulse", "wave", "shimmer", "glow", "none"];
|
|
5
|
+
export type SkeletonAnimation = (typeof SKELETON_ANIMATIONS)[number];
|
|
6
|
+
export declare const SKELETON_SIZES: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
7
|
+
export type SkeletonSize = (typeof SKELETON_SIZES)[number];
|
|
8
|
+
export declare const SKELETON_THEMES: readonly ["light", "dark", "auto"];
|
|
9
|
+
export type SkeletonTheme = (typeof SKELETON_THEMES)[number];
|
|
10
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** Width of the skeleton */
|
|
12
|
+
width?: string | number;
|
|
13
|
+
/** Height of the skeleton */
|
|
14
|
+
height?: string | number;
|
|
15
|
+
/** Shape variant */
|
|
16
|
+
variant?: SkeletonVariant;
|
|
17
|
+
/** Animation type */
|
|
18
|
+
animation?: SkeletonAnimation;
|
|
19
|
+
/** Preset size (overridden by width/height) */
|
|
20
|
+
size?: SkeletonSize;
|
|
21
|
+
/** Number of skeleton elements to render */
|
|
22
|
+
count?: number;
|
|
23
|
+
/** Gap between multiple elements */
|
|
24
|
+
gap?: string;
|
|
25
|
+
/** Animation duration in ms */
|
|
26
|
+
duration?: number;
|
|
27
|
+
/** Border radius for rounded variant */
|
|
28
|
+
borderRadius?: string;
|
|
29
|
+
/** Theme mode */
|
|
30
|
+
theme?: SkeletonTheme;
|
|
31
|
+
/** Stagger animation delay for multiple elements */
|
|
32
|
+
stagger?: boolean;
|
|
33
|
+
/** Make responsive (width: 100%) on mobile */
|
|
34
|
+
responsive?: boolean;
|
|
35
|
+
/** Aspect ratio for responsive elements */
|
|
36
|
+
aspectRatio?: string;
|
|
37
|
+
/** Additional class name */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SkeletonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
/** Children skeleton elements */
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
/** Layout direction */
|
|
44
|
+
direction?: 'row' | 'column';
|
|
45
|
+
/** Gap between elements */
|
|
46
|
+
gap?: string;
|
|
47
|
+
/** Align items */
|
|
48
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
49
|
+
/** Wrap items */
|
|
50
|
+
wrap?: boolean;
|
|
51
|
+
/** Responsive stack on mobile */
|
|
52
|
+
responsive?: boolean;
|
|
53
|
+
/** Additional class name */
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SkeletonTextProps extends Omit<SkeletonProps, 'variant'> {
|
|
57
|
+
/** Number of text lines */
|
|
58
|
+
lines?: number;
|
|
59
|
+
/** Last line width percentage */
|
|
60
|
+
lastLineWidth?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SkeletonAvatarProps extends Omit<SkeletonProps, 'variant' | 'width' | 'height'> {
|
|
63
|
+
/** Avatar size preset */
|
|
64
|
+
size?: SkeletonSize;
|
|
65
|
+
}
|
|
66
|
+
export interface SkeletonCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
67
|
+
/** Show image placeholder */
|
|
68
|
+
hasImage?: boolean;
|
|
69
|
+
/** Image height */
|
|
70
|
+
imageHeight?: string | number;
|
|
71
|
+
/** Number of text lines */
|
|
72
|
+
textLines?: number;
|
|
73
|
+
/** Show action buttons */
|
|
74
|
+
hasActions?: boolean;
|
|
75
|
+
/** Animation type */
|
|
76
|
+
animation?: SkeletonAnimation;
|
|
77
|
+
/** Theme mode */
|
|
78
|
+
theme?: SkeletonTheme;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE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9B,iBAAiB;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const SKELETON_VARIANTS = ['rectangular', 'circular', 'text', 'rounded', 'button', 'avatar', 'badge'];
|
|
2
|
+
export const SKELETON_ANIMATIONS = ['pulse', 'wave', 'shimmer', 'glow', 'none'];
|
|
3
|
+
export const SKELETON_SIZES = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
4
|
+
export const SKELETON_THEMES = ['light', 'dark', 'auto'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpeedDial.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/SpeedDial/SpeedDial.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,EAAC,cAAc,EAAkB,MAAM,SAAS,CAAC;AAiBxD,eAAO,MAAM,SAAS,uFA0UrB,CAAC"}
|