@flikk/ui 1.0.0-beta.20 → 1.0.0-beta.22
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/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.theme.js +3 -3
- package/dist/components/ai/PromptSuggestions/PromptSuggestion.theme.js +1 -1
- package/dist/components/ai/StreamingResponse/StreamingResponse.theme.js +4 -4
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +6 -6
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +2 -2
- package/dist/components/charts/DonutChart/DonutChart.theme.js +2 -2
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.theme.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +2 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +2 -2
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +4 -4
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Avatar/Avatar.theme.js +10 -10
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +1 -1
- package/dist/components/core/Badge/Badge.js +2 -12
- package/dist/components/core/Badge/Badge.theme.js +2 -2
- package/dist/components/core/Button/Button.theme.js +6 -6
- package/dist/components/core/ButtonGroup/ButtonGroup.theme.js +1 -1
- package/dist/components/core/Calendar/Calendar.theme.js +5 -5
- package/dist/components/core/Card/Card.theme.js +2 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +4 -4
- package/dist/components/core/Drawer/Drawer.animations.js +5 -4
- package/dist/components/core/Drawer/Drawer.theme.js +2 -2
- package/dist/components/core/Dropdown/Dropdown.theme.js +1 -1
- package/dist/components/core/Empty/Empty.theme.js +2 -2
- package/dist/components/core/Icon/Icon.d.ts +3 -0
- package/dist/components/core/Icon/Icon.js +70 -0
- package/dist/components/core/Icon/Icon.theme.d.ts +2 -0
- package/dist/components/core/Icon/Icon.theme.js +19 -0
- package/dist/components/core/Icon/Icon.types.d.ts +32 -0
- package/dist/components/core/{FileTypeIcon → Icon/data}/fileTypes.d.ts +1 -1
- package/dist/components/core/Icon/data/paymentMethods.d.ts +27 -0
- package/dist/components/core/Icon/data/paymentMethods.js +169 -0
- package/dist/components/core/Icon/index.d.ts +4 -0
- package/dist/components/core/Kbd/Kbd.theme.js +2 -2
- package/dist/components/core/MenuItem/MenuItem.theme.js +2 -2
- package/dist/components/core/Message/Message.theme.js +6 -6
- package/dist/components/core/Modal/Modal.animations.js +3 -1
- package/dist/components/core/Modal/Modal.theme.js +2 -2
- package/dist/components/core/Modal/ModalBody.js +7 -8
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +2 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +2 -2
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.theme.js +3 -3
- package/dist/components/core/Progress/Progress.theme.js +2 -2
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tag/Tag.theme.js +2 -2
- package/dist/components/core/Toast/Toast.theme.js +2 -2
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +1 -2
- package/dist/components/core/index.js +2 -2
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +2 -2
- package/dist/components/data-display/Feed/Feed.theme.js +1 -1
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +2 -2
- package/dist/components/data-display/KPI/KPI.theme.js +9 -9
- package/dist/components/data-display/Metric/Metric.theme.js +9 -9
- package/dist/components/data-display/Table/Table.animations.js +16 -10
- package/dist/components/data-display/Table/Table.filterUtils.js +8 -1
- package/dist/components/data-display/Table/Table.js +10 -14
- package/dist/components/data-display/Table/Table.theme.js +3 -3
- package/dist/components/data-display/Table/Table.types.d.ts +2 -0
- package/dist/components/data-display/Table/TableActions.js +3 -3
- package/dist/components/data-display/Table/TableActionsMenu.js +2 -3
- package/dist/components/data-display/Table/TableCell.js +6 -3
- package/dist/components/data-display/Table/TableDeclarative.js +5 -7
- package/dist/components/data-display/Table/TableHeader.js +5 -2
- package/dist/components/data-display/Table/TablePagination.js +2 -6
- package/dist/components/data-display/Table/TableRow.js +2 -6
- package/dist/components/data-display/Table/index.js +1 -0
- package/dist/components/effects/Animated/Animated.animations.js +29 -10
- package/dist/components/effects/Animated/Animated.d.ts +2 -2
- package/dist/components/effects/Animated/Animated.js +4 -3
- package/dist/components/effects/Animated/AnimatedItem.d.ts +1 -1
- package/dist/components/effects/Animated/AnimatedItem.js +5 -4
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +50 -21
- package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -7
- package/dist/components/forms/ColorPicker/ColorPicker.d.ts +5 -9
- package/dist/components/forms/ColorPicker/ColorPicker.js +126 -22
- package/dist/components/forms/ColorPicker/ColorPicker.theme.js +9 -6
- package/dist/components/forms/ColorPicker/ColorPicker.types.d.ts +99 -0
- package/dist/components/forms/ColorPicker/ColorPicker2DCanvas.js +43 -6
- package/dist/components/forms/ColorPicker/ColorPickerBody.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerContext.d.ts +4 -0
- package/dist/components/forms/ColorPicker/ColorPickerContext.js +12 -0
- package/dist/components/forms/ColorPicker/ColorPickerEyeDropper.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerFormatSelector.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerGradient.d.ts +7 -0
- package/dist/components/forms/ColorPicker/ColorPickerGradient.js +186 -0
- package/dist/components/forms/ColorPicker/ColorPickerHeader.d.ts +14 -0
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +31 -0
- package/dist/components/forms/ColorPicker/ColorPickerImage.d.ts +6 -0
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +154 -0
- package/dist/components/forms/ColorPicker/ColorPickerInput.d.ts +0 -4
- package/dist/components/forms/ColorPicker/ColorPickerInput.js +53 -61
- package/dist/components/forms/ColorPicker/ColorPickerPresets.js +13 -12
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.d.ts +3 -0
- package/dist/components/forms/ColorPicker/ColorPickerSavedColors.js +69 -0
- package/dist/components/forms/ColorPicker/ColorPickerSliders.d.ts +1 -2
- package/dist/components/forms/ColorPicker/ColorPickerSliders.js +84 -23
- package/dist/components/forms/ColorPicker/ColorPickerSwatch.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerSwatch.js +10 -9
- package/dist/components/forms/ColorPicker/ColorPickerTrigger.js +7 -3
- package/dist/components/forms/ColorPicker/index.d.ts +8 -2
- package/dist/components/forms/CronInput/CronInput.theme.js +8 -8
- package/dist/components/forms/DatePicker/DatePicker.theme.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +3 -3
- package/dist/components/forms/FileUpload/FileUpload.theme.js +4 -4
- package/dist/components/forms/FileUpload/FileUploadProgress.js +3 -3
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +2 -2
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/Input/Input.js +3 -3
- package/dist/components/forms/Input/Input.theme.js +1 -1
- package/dist/components/forms/Input/Input.types.d.ts +2 -0
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
- package/dist/components/forms/Mention/Mention.theme.js +3 -3
- package/dist/components/forms/Radio/Radio.animations.js +6 -2
- package/dist/components/forms/Radio/Radio.js +1 -1
- package/dist/components/forms/Radio/Radio.theme.js +11 -11
- package/dist/components/forms/Radio/Radio.types.d.ts +1 -0
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +1 -1
- package/dist/components/forms/Select/Select.theme.js +1 -1
- package/dist/components/forms/SelectableCard/SelectableCard.js +42 -27
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +15 -25
- package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +16 -3
- package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +1 -0
- package/dist/components/forms/SelectableCard/SelectableCardContext.js +4 -7
- package/dist/components/forms/SelectableCard/SelectableCardGroup.js +31 -10
- package/dist/components/forms/SelectableCard/index.d.ts +1 -1
- package/dist/components/forms/Signature/Signature.theme.js +1 -1
- package/dist/components/forms/Slider/Slider.theme.js +3 -3
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +2 -2
- package/dist/components/forms/forms.theme.js +6 -6
- package/dist/components/forms/index.js +6 -1
- package/dist/components/layout/FormLayout/FormLayout.theme.js +2 -2
- package/dist/hooks/useOverlay.d.ts +2 -0
- package/dist/hooks/useOverlay.js +34 -4
- package/dist/index.js +8 -3
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/src/global.scss +1 -1
- package/src/styles/theme.css +1 -1
- package/dist/bg/bg/1.jpg +0 -0
- package/dist/bg/bg/10.jpg +0 -0
- package/dist/bg/bg/11.jpg +0 -0
- package/dist/bg/bg/14.jpg +0 -0
- package/dist/bg/bg/15.jpg +0 -0
- package/dist/bg/bg/16.jpg +0 -0
- package/dist/bg/bg/17.jpg +0 -0
- package/dist/bg/bg/18.jpg +0 -0
- package/dist/bg/bg/19.jpg +0 -0
- package/dist/bg/bg/2.jpg +0 -0
- package/dist/bg/bg/20.jpg +0 -0
- package/dist/bg/bg/21.jpg +0 -0
- package/dist/bg/bg/22.jpg +0 -0
- package/dist/bg/bg/23.jpg +0 -0
- package/dist/bg/bg/24.jpg +0 -0
- package/dist/bg/bg/3.jpg +0 -0
- package/dist/bg/bg/4.jpg +0 -0
- package/dist/bg/bg/5.jpg +0 -0
- package/dist/bg/bg/6.jpg +0 -0
- package/dist/bg/bg/7.jpg +0 -0
- package/dist/bg/bg/8.jpg +0 -0
- package/dist/bg/bg/9.jpg +0 -0
- package/dist/components/core/FileTypeIcon/FileTypeIcon.d.ts +0 -3
- package/dist/components/core/FileTypeIcon/FileTypeIcon.js +0 -33
- package/dist/components/core/FileTypeIcon/FileTypeIcon.theme.d.ts +0 -2
- package/dist/components/core/FileTypeIcon/FileTypeIcon.theme.js +0 -12
- package/dist/components/core/FileTypeIcon/FileTypeIcon.types.d.ts +0 -19
- package/dist/components/core/FileTypeIcon/index.d.ts +0 -2
- package/dist/components/core/SocialIcon/SocialIcon.d.ts +0 -3
- package/dist/components/core/SocialIcon/SocialIcon.js +0 -30
- package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +0 -2
- package/dist/components/core/SocialIcon/SocialIcon.theme.js +0 -12
- package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +0 -18
- package/dist/components/core/SocialIcon/index.d.ts +0 -2
- /package/dist/components/core/{FileTypeIcon → Icon/data}/fileTypes.js +0 -0
- /package/dist/components/core/{SocialIcon → Icon/data}/platforms.d.ts +0 -0
- /package/dist/components/core/{SocialIcon → Icon/data}/platforms.js +0 -0
|
@@ -3,8 +3,8 @@ const codeBlockTheme = {
|
|
|
3
3
|
header: "flex items-center justify-between px-3 py-1.5 bg-[var(--color-background-secondary)] border-b border-[var(--color-border)]",
|
|
4
4
|
headerLeft: "flex items-center gap-2 min-w-0 flex-1 ",
|
|
5
5
|
headerRight: "flex items-center gap-2 flex-shrink-0",
|
|
6
|
-
filename: "text-
|
|
7
|
-
languageLabel: "text-
|
|
6
|
+
filename: "text-sm font-medium text-[var(--color-text-secondary)] truncate",
|
|
7
|
+
languageLabel: "text-xs uppercase tracking-wider font-semibold text-[var(--color-text-muted)]",
|
|
8
8
|
codeWrapper: "overflow-x-auto",
|
|
9
9
|
lineNumber: "text-[var(--color-text-muted)] select-none text-right tabular-nums min-w-[2.5rem] pr-4 opacity-50",
|
|
10
10
|
highlightedLine: " -mx-4 px-4 bg-[var(--color-primary-50)] border-l-2 border-l-[var(--color-primary)] dark:bg-[var(--color-neutral-400)]/5 dark:border-l-[var(--color-neutral-200)]",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const promptInputTheme = {
|
|
2
2
|
baseStyle: "rounded-[var(--card-radius)] border-[1px] border-[var(--color-border)] flex flex-col gap-2 shadow-real-md p-4 outline-2 outline-[var(--color-border)]/30 bg-white dark:bg-[var(--color-background-secondary)] ",
|
|
3
|
-
textareaStyle: "w-full bg-transparent text-
|
|
3
|
+
textareaStyle: "w-full bg-transparent text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] focus:outline-none resize-none overflow-y-auto transition-[height] duration-200 ease-in-out",
|
|
4
4
|
footerStyle: "flex justify-between items-end",
|
|
5
5
|
actionsStyle: "flex gap-1",
|
|
6
6
|
submitButtonStyle: "rounded-full",
|
|
7
7
|
dropzoneStyle: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 rounded-[var(--card-radius)] border-2 border-dashed border-[var(--color-primary)] bg-[var(--color-primary-200)]/80 backdrop-blur-sm dark:bg-[var(--color-primary-900)]/80",
|
|
8
|
-
dropzoneTitleStyle: "text-
|
|
9
|
-
dropzoneSubtitleStyle: "text-
|
|
8
|
+
dropzoneTitleStyle: "text-sm font-medium text-[var(--color-primary)]",
|
|
9
|
+
dropzoneSubtitleStyle: "text-xs text-[var(--color-primary)]/70",
|
|
10
10
|
dropzoneActionsStyle: "flex items-center gap-3 mt-1",
|
|
11
11
|
voiceRecorderStyle: "",
|
|
12
12
|
states: {
|
|
@@ -2,7 +2,7 @@ const promptSuggestionTheme = {
|
|
|
2
2
|
baseStyle: "inline-flex items-center gap-2 py-1 px-3 rounded-[var(--card-radius)] " +
|
|
3
3
|
"bg-[var(--color-surface)] " +
|
|
4
4
|
"border border-[var(--color-border)] " +
|
|
5
|
-
"text-
|
|
5
|
+
"text-sm text-[var(--color-text-primary)] " +
|
|
6
6
|
"cursor-pointer transition-all duration-300 " +
|
|
7
7
|
"hover:bg-[var(--color-background-secondary)] " +
|
|
8
8
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)]",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const streamingResponseTheme = {
|
|
2
2
|
errorContainerStyle: "flex items-start gap-3 rounded-[var(--radius-base)] border border-[var(--color-danger-200)] bg-[var(--color-danger-50)] px-4 py-3",
|
|
3
|
-
errorTitleStyle: "text-
|
|
4
|
-
errorMessageStyle: "text-
|
|
5
|
-
errorRetryButtonStyle: "mt-2 text-
|
|
6
|
-
loadingContainerStyle: "flex items-center gap-2 text-[var(--color-text-placeholder)] text-
|
|
3
|
+
errorTitleStyle: "text-sm font-medium text-[var(--color-danger)]",
|
|
4
|
+
errorMessageStyle: "text-sm text-[var(--color-text-secondary)] mt-1",
|
|
5
|
+
errorRetryButtonStyle: "mt-2 text-sm font-medium text-[var(--color-danger)] hover:text-[var(--color-danger-700)] transition-colors",
|
|
6
|
+
loadingContainerStyle: "flex items-center gap-2 text-[var(--color-text-placeholder)] text-sm",
|
|
7
7
|
loadingDotStyle: "w-1.5 h-1.5 rounded-full bg-current animate-pulse",
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -8,19 +8,19 @@ const tokenCounterTheme = {
|
|
|
8
8
|
progressBarStyle: "h-full bg-[var(--color-primary)] transition-all duration-200",
|
|
9
9
|
sizes: {
|
|
10
10
|
sm: {
|
|
11
|
-
container: "text-
|
|
11
|
+
container: "text-xs",
|
|
12
12
|
icon: "size-3",
|
|
13
|
-
text: "text-
|
|
13
|
+
text: "text-xs",
|
|
14
14
|
},
|
|
15
15
|
md: {
|
|
16
|
-
container: "text-
|
|
16
|
+
container: "text-sm",
|
|
17
17
|
icon: "size-4",
|
|
18
|
-
text: "text-
|
|
18
|
+
text: "text-sm",
|
|
19
19
|
},
|
|
20
20
|
lg: {
|
|
21
|
-
container: "text-
|
|
21
|
+
container: "text-base",
|
|
22
22
|
icon: "size-5",
|
|
23
|
-
text: "text-
|
|
23
|
+
text: "text-base",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -18,8 +18,8 @@ const activityRingsTheme = {
|
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
centerText: {
|
|
21
|
-
label: "text-
|
|
22
|
-
suffix: "text-
|
|
21
|
+
label: "text-xl font-semibold text-[var(--color-text-primary)]",
|
|
22
|
+
suffix: "text-sm font-normal text-[var(--color-text-secondary)]/80",
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -10,8 +10,8 @@ const donutChartTheme = {
|
|
|
10
10
|
progress: "text-[var(--color-primary)] transition-all duration-300",
|
|
11
11
|
// Text styling
|
|
12
12
|
text: {
|
|
13
|
-
label: "text-
|
|
14
|
-
subtitle: "text-
|
|
13
|
+
label: "text-xl font-bold text-[var(--color-text-primary)] transition-colors duration-300 tracking-tight",
|
|
14
|
+
subtitle: "text-sm text-[var(--color-text-secondary)] mt-1 transition-colors duration-300",
|
|
15
15
|
},
|
|
16
16
|
// Default color palette (CSS variables for dark mode support)
|
|
17
17
|
// Note: These are resolved at runtime via getComputedStyle
|
|
@@ -8,7 +8,7 @@ const multiSegmentDonutChartTheme = {
|
|
|
8
8
|
track: "text-[var(--color-border)]",
|
|
9
9
|
// Legend styling
|
|
10
10
|
legend: {
|
|
11
|
-
container: "flex flex-col gap-2 text-
|
|
11
|
+
container: "flex flex-col gap-2 text-sm",
|
|
12
12
|
item: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity",
|
|
13
13
|
label: "text-[var(--color-text-primary)] font-medium",
|
|
14
14
|
value: "text-[var(--color-text-secondary)] ml-auto",
|
|
@@ -10,7 +10,7 @@ const heatmapTheme = {
|
|
|
10
10
|
// Base cell styles (individual cells add opacity via inline styles)
|
|
11
11
|
cellBaseStyle: "relative w-full h-full cursor-pointer border border-transparent transition-all duration-500 animate-[flicker_0.6s_ease-out_forwards]",
|
|
12
12
|
// Axis labels using CSS variables for dark mode support
|
|
13
|
-
axisLabelStyle: "text-
|
|
13
|
+
axisLabelStyle: "text-xs text-[var(--color-text-secondary)] font-medium select-none",
|
|
14
14
|
// Legend using correct CSS variables
|
|
15
15
|
legendStyle: "w-full space-y-1.5 mt-3",
|
|
16
16
|
};
|
|
@@ -13,11 +13,11 @@ const radarChartTheme = {
|
|
|
13
13
|
// Axis spoke stroke color (gray-300 equivalent)
|
|
14
14
|
axisColor: "#d1d5db",
|
|
15
15
|
// Axis label classes (applied to <text> elements via className)
|
|
16
|
-
labelStyle: "text-
|
|
16
|
+
labelStyle: "text-xs fill-[#6b7280] select-none",
|
|
17
17
|
// Legend container
|
|
18
18
|
legendStyle: "flex flex-wrap items-center justify-center gap-x-6 gap-y-2",
|
|
19
19
|
// Individual legend item
|
|
20
|
-
legendItemStyle: "flex items-center gap-2 text-
|
|
20
|
+
legendItemStyle: "flex items-center gap-2 text-sm",
|
|
21
21
|
// Colored dot in legend
|
|
22
22
|
legendDotStyle: "w-2.5 h-2.5 rounded-full shrink-0",
|
|
23
23
|
// Legend label text
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
const scatterPlotTheme = {
|
|
5
5
|
containerStyle: 'relative inline-flex flex-col items-center w-full',
|
|
6
6
|
svgStyle: 'overflow-visible',
|
|
7
|
-
emptyStateStyle: 'flex items-center justify-center h-full text-[var(--color-text-muted)] text-
|
|
7
|
+
emptyStateStyle: 'flex items-center justify-center h-full text-[var(--color-text-muted)] text-sm',
|
|
8
8
|
// Grid styles
|
|
9
9
|
gridLineStyle: 'stroke-[var(--color-border)]',
|
|
10
10
|
// Axis styles
|
|
@@ -17,7 +17,7 @@ const scatterPlotTheme = {
|
|
|
17
17
|
legendContainerStyle: 'flex flex-wrap gap-3 mt-4 justify-center',
|
|
18
18
|
legendItemStyle: 'flex items-center gap-2',
|
|
19
19
|
legendDotStyle: 'w-3 h-3 rounded-full',
|
|
20
|
-
legendLabelStyle: 'text-
|
|
20
|
+
legendLabelStyle: 'text-sm text-[var(--color-text-secondary)]',
|
|
21
21
|
// Default category colors using CSS variables
|
|
22
22
|
colors: [
|
|
23
23
|
'var(--color-primary)',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Uses fixed Tailwind styling for consistency across charts
|
|
4
4
|
*/
|
|
5
5
|
const chartTextTheme = {
|
|
6
|
-
baseStyle: "transition-all duration-200 text-
|
|
6
|
+
baseStyle: "transition-all duration-200 text-xs text-[var(--color-text-secondary)]/80 fill-[var(--color-text-secondary)]/80 font-medium select-none",
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { chartTextTheme };
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
const chartTooltipTheme = {
|
|
7
7
|
baseStyle: "fixed z-50 text-[var(--color-text-primary)] rounded-[var(--tooltip-radius)] px-3 py-2 shadow-lg pointer-events-none glass-effect",
|
|
8
|
-
contentStyle: "whitespace-nowrap text-
|
|
8
|
+
contentStyle: "whitespace-nowrap text-sm",
|
|
9
9
|
multiSeriesContainerStyle: "text-left",
|
|
10
|
-
categoryStyle: "text-
|
|
10
|
+
categoryStyle: "text-xs font-semibold mb-1 text-[var(--color-text-primary)]",
|
|
11
11
|
seriesContainerStyle: "space-y-0.5",
|
|
12
12
|
seriesRowStyle: "flex items-center justify-between gap-3",
|
|
13
13
|
dotStyle: "size-2 rounded-[calc(var(--radius-base)*0.75)]",
|
|
14
|
-
labelStyle: "text-
|
|
15
|
-
valueStyle: "text-
|
|
14
|
+
labelStyle: "text-xs opacity-90 text-[var(--color-text-secondary)]",
|
|
15
|
+
valueStyle: "text-xs font-semibold text-[var(--color-text-primary)]",
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export { chartTooltipTheme };
|
|
@@ -6,7 +6,7 @@ import { semanticTextColors } from '../../../utils/colorUtils.js';
|
|
|
6
6
|
*/
|
|
7
7
|
const alertTheme = {
|
|
8
8
|
// Base styles applied to all alerts
|
|
9
|
-
baseStyle: "relative flex items-start gap-3 rounded-[var(--alert-radius)] p-4 text-
|
|
9
|
+
baseStyle: "relative flex items-start gap-3 rounded-[var(--alert-radius)] p-4 text-sm border border-[var(--color-border)] backdrop-blur-md bg-white dark:bg-[var(--color-background-secondary)]/80",
|
|
10
10
|
// Visual style variants (structure only, no colors)
|
|
11
11
|
variants: {
|
|
12
12
|
default: "",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const avatarTheme = {
|
|
2
2
|
baseStyle: "relative inline-flex items-center justify-center overflow-hidden bg-[var(--color-surface)] text-[var(--color-text-primary)] font-bold tracking-tighter rounded-[var(--avatar-radius)] border border-[var(--color-border)] transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2",
|
|
3
3
|
sizes: {
|
|
4
|
-
xs: "size-[var(--avatar-size-xs)] text-
|
|
5
|
-
sm: "size-[var(--avatar-size-sm)] text-
|
|
6
|
-
md: "size-[var(--avatar-size-md)] text-
|
|
7
|
-
lg: "size-[var(--avatar-size-lg)] text-
|
|
8
|
-
xl: "size-[var(--avatar-size-xl)] text-
|
|
4
|
+
xs: "size-[var(--avatar-size-xs)] text-xs",
|
|
5
|
+
sm: "size-[var(--avatar-size-sm)] text-xs",
|
|
6
|
+
md: "size-[var(--avatar-size-md)] text-sm",
|
|
7
|
+
lg: "size-[var(--avatar-size-lg)] text-sm",
|
|
8
|
+
xl: "size-[var(--avatar-size-xl)] text-sm",
|
|
9
9
|
},
|
|
10
10
|
statuses: {
|
|
11
11
|
online: "bg-[var(--color-success)]",
|
|
@@ -17,11 +17,11 @@ const avatarTheme = {
|
|
|
17
17
|
titleStyle: "font-medium leading-tight text-[var(--color-text-primary)] truncate",
|
|
18
18
|
subtitleStyle: "leading-tight text-[var(--color-text-muted)] truncate",
|
|
19
19
|
textSizes: {
|
|
20
|
-
xs: "text-
|
|
21
|
-
sm: "text-
|
|
22
|
-
md: "text-
|
|
23
|
-
lg: "text-
|
|
24
|
-
xl: "text-
|
|
20
|
+
xs: "text-xs",
|
|
21
|
+
sm: "text-xs",
|
|
22
|
+
md: "text-sm",
|
|
23
|
+
lg: "text-sm",
|
|
24
|
+
xl: "text-sm",
|
|
25
25
|
},
|
|
26
26
|
gapSizes: {
|
|
27
27
|
xs: "gap-1.5",
|
|
@@ -11,7 +11,7 @@ const avatarGroupTheme = {
|
|
|
11
11
|
loose: "-ml-2 z-10",
|
|
12
12
|
},
|
|
13
13
|
// Overflow avatar styles
|
|
14
|
-
overflowAvatarStyle: "bg-[var(--color-surface)] text-[var(--color-text-secondary)] font-semibold text-
|
|
14
|
+
overflowAvatarStyle: "bg-[var(--color-surface)] text-[var(--color-text-secondary)] font-semibold text-xs flex items-center justify-center size-7",
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { avatarGroupTheme };
|
|
@@ -139,20 +139,10 @@ const Badge = React__default.memo(React__default.forwardRef(({ children, variant
|
|
|
139
139
|
const renderLeftContent = () => {
|
|
140
140
|
var _a, _b, _c;
|
|
141
141
|
if (avatar) {
|
|
142
|
-
|
|
143
|
-
const avatarMargin = pill
|
|
144
|
-
? {
|
|
145
|
-
sm: "-ml-1.5",
|
|
146
|
-
md: "-ml-1.5",
|
|
147
|
-
}[size]
|
|
148
|
-
: {
|
|
149
|
-
sm: "-ml-1.5",
|
|
150
|
-
md: "-ml-1",
|
|
151
|
-
}[size];
|
|
152
|
-
return (jsx("span", { className: cn("inline-flex items-center justify-center shrink-0 overflow-hidden", (_a = theme.avatarSizes) === null || _a === void 0 ? void 0 : _a[size], avatarMargin, pill ? "rounded-full" : "rounded-md"), children: jsx(Avatar, { src: avatar.src, name: avatar.name, fallback: (_b = avatar.fallback) !== null && _b !== void 0 ? _b : jsx(UserIcon, { className: "size-2.5" }), initialsCount: avatar.initialsCount, size: "xs", className: cn("!size-full border-0", pill ? "rounded-full" : "rounded-md ring-0") }) }));
|
|
142
|
+
return (jsx("span", { className: cn("inline-flex items-center justify-center shrink-0 overflow-hidden [&_div]:!size-full", (_a = theme.avatarSizes) === null || _a === void 0 ? void 0 : _a[size], pill ? "rounded-full -ml-2" : "rounded-full -ml-1.5"), children: jsx(Avatar, { src: avatar.src, name: avatar.name, fallback: (_b = avatar.fallback) !== null && _b !== void 0 ? _b : jsx(UserIcon, { className: "size-2.5" }), initialsCount: avatar.initialsCount, size: "xs", className: cn("!size-full border-0", pill ? "rounded-full" : "rounded-md ring-0") }) }));
|
|
153
143
|
}
|
|
154
144
|
if (iconStart) {
|
|
155
|
-
return (jsx("span", { className: cn("inline-flex items-center justify-center flex-shrink-0", (_c = theme.iconSizes) === null || _c === void 0 ? void 0 : _c[size]), "aria-hidden": "true", children: iconStart }));
|
|
145
|
+
return (jsx("span", { className: cn("inline-flex items-center justify-center flex-shrink-0 -ml-1", (_c = theme.iconSizes) === null || _c === void 0 ? void 0 : _c[size]), "aria-hidden": "true", children: iconStart }));
|
|
156
146
|
}
|
|
157
147
|
if (withDot) {
|
|
158
148
|
if (shouldAnimate) {
|
|
@@ -62,8 +62,8 @@ const badgeTheme = {
|
|
|
62
62
|
},
|
|
63
63
|
// Flat size structure (no nested objects)
|
|
64
64
|
sizes: {
|
|
65
|
-
sm: "text-
|
|
66
|
-
md: "text-
|
|
65
|
+
sm: "text-xs px-1.5 py-0.25 gap-1",
|
|
66
|
+
md: "text-sm px-2 py-0.25 gap-1",
|
|
67
67
|
},
|
|
68
68
|
// Additional padding for pill shape
|
|
69
69
|
pillSizes: {
|
|
@@ -152,19 +152,19 @@ const buttonTheme = {
|
|
|
152
152
|
// Size variants
|
|
153
153
|
sizes: {
|
|
154
154
|
sm: {
|
|
155
|
-
default: "font-semibold min-h-[var(--button-min-h-sm)] px-[var(--button-px-sm)] py-[var(--button-py-sm)] text-
|
|
155
|
+
default: "font-semibold min-h-[var(--button-min-h-sm)] px-[var(--button-px-sm)] py-[var(--button-py-sm)] text-sm",
|
|
156
156
|
iconOnly: "size-[var(--button-icon-size-sm)] p-[var(--button-icon-p-sm)]",
|
|
157
|
-
link: "font-semibold p-0 text-
|
|
157
|
+
link: "font-semibold p-0 text-sm h-fit",
|
|
158
158
|
},
|
|
159
159
|
md: {
|
|
160
|
-
default: "font-semibold min-h-[var(--button-min-h-md)] px-[var(--button-px-md)] py-[var(--button-py-md)] text-
|
|
160
|
+
default: "font-semibold min-h-[var(--button-min-h-md)] px-[var(--button-px-md)] py-[var(--button-py-md)] text-sm",
|
|
161
161
|
iconOnly: "size-[var(--button-icon-size-md)] p-[var(--button-icon-p-md)]",
|
|
162
|
-
link: "font-semibold p-0 text-
|
|
162
|
+
link: "font-semibold p-0 text-sm h-fit",
|
|
163
163
|
},
|
|
164
164
|
lg: {
|
|
165
|
-
default: "font-semibold min-h-[var(--button-min-h-lg)] px-[var(--button-px-lg)] py-[var(--button-py-lg)] text-
|
|
165
|
+
default: "font-semibold min-h-[var(--button-min-h-lg)] px-[var(--button-px-lg)] py-[var(--button-py-lg)] text-base",
|
|
166
166
|
iconOnly: "size-[var(--button-icon-size-lg)] p-[var(--button-icon-p-lg)]",
|
|
167
|
-
link: "font-semibold p-0 text-
|
|
167
|
+
link: "font-semibold p-0 text-base h-fit",
|
|
168
168
|
},
|
|
169
169
|
},
|
|
170
170
|
// State styles
|
|
@@ -44,7 +44,7 @@ const buttonGroupTheme = {
|
|
|
44
44
|
vertical: "h-px self-stretch",
|
|
45
45
|
},
|
|
46
46
|
// Text styles for ButtonGroupText component
|
|
47
|
-
textStyles: "px-3 py-2 text-
|
|
47
|
+
textStyles: "px-3 py-2 text-sm text-[var(--color-text-primary)] flex items-center",
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
export { buttonGroupTheme };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
const calendarTheme = {
|
|
6
6
|
baseStyle: "select-none w-full bg-white dark:bg-[var(--color-neutral-900)]",
|
|
7
7
|
headerStyle: "flex items-center justify-between mb-4",
|
|
8
|
-
titleStyle: "text-
|
|
8
|
+
titleStyle: "text-sm font-semibold text-[var(--color-text-primary)] " + "",
|
|
9
9
|
headerDropdownsStyle: "grid grid-cols-2 items-center gap-2 flex-1 justify-center mx-3",
|
|
10
10
|
navButtonStyle: "inline-flex items-center justify-center size-8 rounded-[calc(var(--radius-base)*0.75)] border-0 bg-transparent " +
|
|
11
11
|
"text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-primary-50)] " +
|
|
@@ -15,7 +15,7 @@ const calendarTheme = {
|
|
|
15
15
|
"dark:text-[var(--color-neutral-500)] dark:hover:text-[var(--color-neutral-200)] dark:hover:bg-[var(--color-neutral-800)] " +
|
|
16
16
|
"dark:focus-visible:ring-offset-[var(--color-neutral-900)]",
|
|
17
17
|
weekdaysStyle: "grid grid-cols-7 mb-2",
|
|
18
|
-
weekdayStyle: "flex items-center justify-center h-8 text-
|
|
18
|
+
weekdayStyle: "flex items-center justify-center h-8 text-xs font-medium text-[var(--color-text-muted)] " +
|
|
19
19
|
"dark:text-[var(--color-neutral-500)]",
|
|
20
20
|
daysGridStyle: "grid grid-cols-7 gap-y-0.5 gap-x-0",
|
|
21
21
|
rangeCellStyle: "bg-[var(--color-primary-50)]/70 " +
|
|
@@ -49,9 +49,9 @@ const calendarTheme = {
|
|
|
49
49
|
// Focus offset for dark mode
|
|
50
50
|
"dark:focus-visible:ring-offset-[var(--color-neutral-900)]",
|
|
51
51
|
dayButtonSizes: {
|
|
52
|
-
sm: "size-8 text-
|
|
53
|
-
md: "size-10 text-
|
|
54
|
-
lg: "size-12 text-
|
|
52
|
+
sm: "size-8 text-sm",
|
|
53
|
+
md: "size-10 text-sm",
|
|
54
|
+
lg: "size-12 text-base",
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const cardTheme = {
|
|
2
2
|
baseStyle: "rounded-[var(--card-radius)] overflow-hidden bg-white border border-[var(--color-border)] shadow-xs dark:bg-[var(--color-background-secondary)]",
|
|
3
3
|
headerStyle: "flex flex-col p-6",
|
|
4
|
-
titleStyle: "text-
|
|
5
|
-
subtitleStyle: "text-
|
|
4
|
+
titleStyle: "text-base font-semibold leading-none text-[var(--color-text-primary)]",
|
|
5
|
+
subtitleStyle: "text-sm text-[var(--color-text-muted)] mt-1.5",
|
|
6
6
|
bodyStyle: "p-6 pt-0 first:pt-6",
|
|
7
7
|
footerStyle: "flex items-center p-6 pt-0 first:pt-6",
|
|
8
8
|
};
|
|
@@ -8,12 +8,12 @@ const commandPaletteTheme = {
|
|
|
8
8
|
// Dark mode
|
|
9
9
|
"dark:ring-black/30",
|
|
10
10
|
searchWrapper: "border-b border-[var(--color-border)] px-4 py-3 " + "",
|
|
11
|
-
searchInput: "w-full px-0 py-0 text-
|
|
11
|
+
searchInput: "w-full px-0 py-0 text-sm bg-transparent border-none outline-none " +
|
|
12
12
|
"text-[var(--color-text-primary)] placeholder:text-[var(--color-text-placeholder)] " +
|
|
13
13
|
"focus:outline-none focus:ring-0 " +
|
|
14
14
|
// Dark mode
|
|
15
15
|
"dark:text-[var(--color-neutral-200)] dark:placeholder:text-[var(--color-neutral-500)]",
|
|
16
|
-
groupLabel: "px-4 py-1 text-
|
|
16
|
+
groupLabel: "px-4 py-1 text-xs font-semibold text-[var(--color-text-muted)]/50 uppercase " +
|
|
17
17
|
"dark:text-[var(--color-neutral-500)]",
|
|
18
18
|
commandItem: "flex items-center gap-3 px-4 py-2 rounded-[var(--radius-base)] cursor-pointer transition-colors " +
|
|
19
19
|
"hover:bg-[var(--color-primary)] " +
|
|
@@ -23,9 +23,9 @@ const commandPaletteTheme = {
|
|
|
23
23
|
// Dark mode - adjust hover state
|
|
24
24
|
"dark:text-[var(--color-neutral-200)] dark:hover:bg-[var(--color-primary-600)] " +
|
|
25
25
|
"dark:data-[highlighted=true]:bg-[var(--color-primary-600)]",
|
|
26
|
-
emptyState: "px-4 py-12 text-center text-
|
|
26
|
+
emptyState: "px-4 py-12 text-center text-sm text-[var(--color-text-muted)] " +
|
|
27
27
|
"dark:text-[var(--color-neutral-500)]",
|
|
28
|
-
footer: "border-t border-[var(--color-border)] px-4 py-2 text-
|
|
28
|
+
footer: "border-t border-[var(--color-border)] px-4 py-2 text-xs text-[var(--color-text-muted)]font-medium",
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export { commandPaletteTheme };
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
const drawerOverlayAnimations = {
|
|
5
5
|
initial: {
|
|
6
6
|
opacity: 0,
|
|
7
|
+
willChange: "opacity",
|
|
7
8
|
},
|
|
8
9
|
animate: {
|
|
9
10
|
opacity: 1,
|
|
@@ -26,7 +27,7 @@ const drawerOverlayAnimations = {
|
|
|
26
27
|
const getDrawerContentAnimations = (position) => {
|
|
27
28
|
const animations = {
|
|
28
29
|
left: {
|
|
29
|
-
initial: { x: "-100%" },
|
|
30
|
+
initial: { x: "-100%", willChange: "transform" },
|
|
30
31
|
animate: {
|
|
31
32
|
x: 0,
|
|
32
33
|
transition: {
|
|
@@ -45,7 +46,7 @@ const getDrawerContentAnimations = (position) => {
|
|
|
45
46
|
},
|
|
46
47
|
},
|
|
47
48
|
right: {
|
|
48
|
-
initial: { x: "100%" },
|
|
49
|
+
initial: { x: "100%", willChange: "transform" },
|
|
49
50
|
animate: {
|
|
50
51
|
x: 0,
|
|
51
52
|
transition: {
|
|
@@ -64,7 +65,7 @@ const getDrawerContentAnimations = (position) => {
|
|
|
64
65
|
},
|
|
65
66
|
},
|
|
66
67
|
top: {
|
|
67
|
-
initial: { y: "-100%" },
|
|
68
|
+
initial: { y: "-100%", willChange: "transform" },
|
|
68
69
|
animate: {
|
|
69
70
|
y: 0,
|
|
70
71
|
transition: {
|
|
@@ -83,7 +84,7 @@ const getDrawerContentAnimations = (position) => {
|
|
|
83
84
|
},
|
|
84
85
|
},
|
|
85
86
|
bottom: {
|
|
86
|
-
initial: { y: "100%" },
|
|
87
|
+
initial: { y: "100%", willChange: "transform" },
|
|
87
88
|
animate: {
|
|
88
89
|
y: 0,
|
|
89
90
|
transition: {
|
|
@@ -8,8 +8,8 @@ const drawerTheme = {
|
|
|
8
8
|
inner: "h-full flex flex-col",
|
|
9
9
|
header: "flex items-start justify-between p-4 border-b border-[var(--color-border)] shrink-0 text-[var(--color-text-primary)] gap-4",
|
|
10
10
|
headerContent: "flex items-start gap-3 flex-1 min-w-0",
|
|
11
|
-
title: "text-
|
|
12
|
-
subtitle: "text-
|
|
11
|
+
title: "text-base font-semibold leading-6 text-[var(--color-text-primary)]",
|
|
12
|
+
subtitle: "text-sm text-[var(--color-text-secondary)] mt-0.5",
|
|
13
13
|
body: "flex-1 overflow-y-auto p-4",
|
|
14
14
|
footer: "flex items-center justify-end gap-3 p-4 py-3 border-t border-[var(--color-border)] shrink-0 " +
|
|
15
15
|
"",
|
|
@@ -9,7 +9,7 @@ const dropdownTheme = {
|
|
|
9
9
|
itemDangerStyle: menuItemTheme.dangerStyle,
|
|
10
10
|
itemFocusStyle: menuItemTheme.focusStyle,
|
|
11
11
|
// Section title styling
|
|
12
|
-
sectionTitleStyle: "px-2 py-1.5 text-
|
|
12
|
+
sectionTitleStyle: "px-2 py-1.5 text-xs font-semibold text-[var(--color-text-muted)] uppercase tracking-tight",
|
|
13
13
|
// Section container styling
|
|
14
14
|
sectionStyle: "py-1",
|
|
15
15
|
// Separator between sections
|
|
@@ -5,9 +5,9 @@ const emptyTheme = {
|
|
|
5
5
|
// Base container styles - customizable spacing, colors, and layout
|
|
6
6
|
baseStyle: "flex flex-col items-center justify-center text-center w-full max-w-md mx-auto space-y-3 py-12 px-6 ",
|
|
7
7
|
// Title text styles - customizable typography and colors
|
|
8
|
-
titleStyle: "text-
|
|
8
|
+
titleStyle: "text-base font-semibold text-[var(--color-text-primary)]",
|
|
9
9
|
// Description text styles - customizable typography and colors
|
|
10
|
-
subtitleStyle: "text-
|
|
10
|
+
subtitleStyle: "text-sm text-[var(--color-text-muted)]",
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { emptyTheme };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { iconTheme } from './Icon.theme.js';
|
|
5
|
+
import { paymentMethods } from './data/paymentMethods.js';
|
|
6
|
+
import { platforms } from './data/platforms.js';
|
|
7
|
+
import { fileTypes } from './data/fileTypes.js';
|
|
8
|
+
|
|
9
|
+
function renderPaymentIcon(icon, size, colorMode, className, theme, ref, props) {
|
|
10
|
+
var _a;
|
|
11
|
+
const method = paymentMethods[icon];
|
|
12
|
+
const dimensions = typeof size === 'number'
|
|
13
|
+
? { width: size, height: Math.round(size * (2 / 3)) }
|
|
14
|
+
: ((_a = theme.paymentSizes[size]) !== null && _a !== void 0 ? _a : { width: 60, height: 40 });
|
|
15
|
+
return (jsx("svg", { ref: ref, xmlns: "http://www.w3.org/2000/svg", viewBox: method.viewBox, width: dimensions.width, height: dimensions.height, role: "img", "aria-label": `${method.label} icon`, "data-icon": icon, "data-color-mode": colorMode, "data-size": size, className: cn(theme.baseStyle, className), ...props, children: method.shapes.map((shape, i) => {
|
|
16
|
+
if (shape.type === 'rect') {
|
|
17
|
+
const fill = colorMode === 'color' ? shape.fill : 'transparent';
|
|
18
|
+
const stroke = colorMode === 'color' ? shape.stroke : (shape.stroke ? 'currentColor' : undefined);
|
|
19
|
+
return (jsx("rect", { x: shape.x, y: shape.y, width: shape.width, height: shape.height, rx: shape.rx, fill: fill, stroke: stroke, strokeWidth: shape.strokeWidth }, i));
|
|
20
|
+
}
|
|
21
|
+
return (jsx("path", { d: shape.d, fill: colorMode === 'color' ? shape.fill : 'currentColor', fillRule: shape.fillRule, clipRule: shape.clipRule }, i));
|
|
22
|
+
}) }));
|
|
23
|
+
}
|
|
24
|
+
function renderSocialIcon(icon, size, colorMode, className, theme, ref, props) {
|
|
25
|
+
var _a;
|
|
26
|
+
const platform = platforms[icon];
|
|
27
|
+
const resolvedSize = typeof size === 'number' ? size : (_a = theme.squareSizes[size]) !== null && _a !== void 0 ? _a : 24;
|
|
28
|
+
const fill = colorMode === 'color' ? platform.brandColor : 'currentColor';
|
|
29
|
+
return (jsx("svg", { ref: ref, xmlns: "http://www.w3.org/2000/svg", viewBox: platform.viewBox, width: resolvedSize, height: resolvedSize, fill: fill, role: "img", "aria-label": `${platform.label} icon`, "data-icon": icon, "data-color-mode": colorMode, "data-size": size, className: cn(theme.baseStyle, className), ...props, children: platform.shapes.map((shape, i) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return (jsx("path", { d: shape.d, fill: colorMode === 'color' ? ((_a = shape.fill) !== null && _a !== void 0 ? _a : undefined) : undefined }, i));
|
|
32
|
+
}) }));
|
|
33
|
+
}
|
|
34
|
+
function renderFileTypeIcon(icon, size, colorMode, className, theme, ref, props) {
|
|
35
|
+
var _a;
|
|
36
|
+
const fileType = fileTypes[icon];
|
|
37
|
+
const resolvedSize = typeof size === 'number' ? size : (_a = theme.squareSizes[size]) !== null && _a !== void 0 ? _a : 24;
|
|
38
|
+
const strokeColor = colorMode === 'color' ? '#D5D7DA' : 'currentColor';
|
|
39
|
+
const strokeOpacity = colorMode === 'color' ? 1 : 0.3;
|
|
40
|
+
const badgeColor = colorMode === 'color' ? fileType.color : 'currentColor';
|
|
41
|
+
const labelText = fileType.label;
|
|
42
|
+
const badgeWidth = Math.round(labelText.length * 6 + 8);
|
|
43
|
+
const badgeX = 1;
|
|
44
|
+
const textX = badgeX + badgeWidth / 2;
|
|
45
|
+
return (jsxs("svg", { ref: ref, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 40 40", width: resolvedSize, height: resolvedSize, fill: "none", role: "img", "aria-label": `${fileType.label} file`, "data-icon": icon, "data-color-mode": colorMode, "data-size": size, className: cn(theme.baseStyle, className), ...props, children: [jsx("path", { d: "M11 0.75H27C27.1212 0.75 27.2375 0.798088 27.3232 0.883789L38.1162 11.6768C38.2019 11.7625 38.25 11.8788 38.25 12V36C38.25 37.7949 36.7949 39.25 35 39.25H11C9.20507 39.25 7.75 37.7949 7.75 36V4C7.75 2.20507 9.20508 0.75 11 0.75Z", stroke: strokeColor, strokeWidth: "1.5", opacity: strokeOpacity }), jsx("path", { d: "M27 0.5V8C27 10.2091 28.7909 12 31 12H38.5", stroke: strokeColor, strokeWidth: "1.5", opacity: strokeOpacity }), jsx("rect", { x: badgeX, y: 18, width: badgeWidth, height: 16, rx: 2, fill: badgeColor, opacity: colorMode === 'color' ? 1 : 0.15 }), jsx("text", { x: textX, y: 26, textAnchor: "middle", dominantBaseline: "central", fill: colorMode === 'color' ? 'white' : 'currentColor', fontSize: 9.5, fontWeight: 700, fontFamily: "Arial, Helvetica, sans-serif", letterSpacing: 0.3, children: labelText })] }));
|
|
46
|
+
}
|
|
47
|
+
const Icon = React__default.forwardRef(({ icon, size = 'md', colorMode = 'color', className, theme: customTheme, ...props }, ref) => {
|
|
48
|
+
const theme = {
|
|
49
|
+
...iconTheme,
|
|
50
|
+
...customTheme,
|
|
51
|
+
paymentSizes: { ...iconTheme.paymentSizes, ...customTheme === null || customTheme === void 0 ? void 0 : customTheme.paymentSizes },
|
|
52
|
+
squareSizes: { ...iconTheme.squareSizes, ...customTheme === null || customTheme === void 0 ? void 0 : customTheme.squareSizes },
|
|
53
|
+
};
|
|
54
|
+
if (icon in paymentMethods) {
|
|
55
|
+
return renderPaymentIcon(icon, size, colorMode, className, theme, ref, props);
|
|
56
|
+
}
|
|
57
|
+
if (icon in platforms) {
|
|
58
|
+
return renderSocialIcon(icon, size, colorMode, className, theme, ref, props);
|
|
59
|
+
}
|
|
60
|
+
if (icon in fileTypes) {
|
|
61
|
+
return renderFileTypeIcon(icon, size, colorMode, className, theme, ref, props);
|
|
62
|
+
}
|
|
63
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
64
|
+
console.warn(`[Icon]: Unknown icon "${icon}".`);
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
});
|
|
68
|
+
Icon.displayName = 'Icon';
|
|
69
|
+
|
|
70
|
+
export { Icon };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const iconTheme = {
|
|
2
|
+
baseStyle: 'inline-block shrink-0',
|
|
3
|
+
paymentSizes: {
|
|
4
|
+
xs: { width: 36, height: 24 },
|
|
5
|
+
sm: { width: 48, height: 32 },
|
|
6
|
+
md: { width: 60, height: 40 },
|
|
7
|
+
lg: { width: 90, height: 60 },
|
|
8
|
+
xl: { width: 120, height: 80 },
|
|
9
|
+
},
|
|
10
|
+
squareSizes: {
|
|
11
|
+
xs: 16,
|
|
12
|
+
sm: 20,
|
|
13
|
+
md: 24,
|
|
14
|
+
lg: 32,
|
|
15
|
+
xl: 40,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { iconTheme };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type PaymentIconName = 'visa' | 'mastercard' | 'amex' | 'applepay' | 'paypal';
|
|
3
|
+
export type SocialIconName = 'github' | 'x' | 'linkedin' | 'instagram' | 'facebook' | 'youtube' | 'discord' | 'dribbble' | 'tiktok' | 'reddit' | 'twitch' | 'slack' | 'medium' | 'pinterest' | 'snapchat' | 'whatsapp' | 'telegram' | 'google' | 'apple';
|
|
4
|
+
export type FileTypeName = 'pdf' | 'doc' | 'docx' | 'txt' | 'xls' | 'xlsx' | 'csv' | 'ppt' | 'mp3' | 'wav' | 'mp4' | 'mov' | 'jpg' | 'png' | 'svg' | 'gif' | 'zip' | 'rar';
|
|
5
|
+
export type IconName = PaymentIconName | SocialIconName | FileTypeName;
|
|
6
|
+
export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
/** 'color' — uses brand/category colors. 'mono' — uses currentColor. */
|
|
8
|
+
export type IconColorMode = 'color' | 'mono';
|
|
9
|
+
export interface IconDimensions {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface IconTheme {
|
|
14
|
+
baseStyle: string;
|
|
15
|
+
/** Non-square dimensions for payment icons */
|
|
16
|
+
paymentSizes: Record<IconSize, IconDimensions>;
|
|
17
|
+
/** Square size (single number) for social and file-type icons */
|
|
18
|
+
squareSizes: Record<IconSize, number>;
|
|
19
|
+
}
|
|
20
|
+
export interface IconThemeOverrides {
|
|
21
|
+
baseStyle?: string;
|
|
22
|
+
paymentSizes?: Partial<Record<IconSize, IconDimensions>>;
|
|
23
|
+
squareSizes?: Partial<Record<IconSize, number>>;
|
|
24
|
+
}
|
|
25
|
+
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
26
|
+
icon: IconName;
|
|
27
|
+
/** Named size preset or custom pixel value. Payment icons scale at 3:2 ratio; others are square. */
|
|
28
|
+
size?: IconSize | number;
|
|
29
|
+
colorMode?: IconColorMode;
|
|
30
|
+
className?: string;
|
|
31
|
+
theme?: IconThemeOverrides;
|
|
32
|
+
}
|