fluentglass 0.2.6
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/LICENSE +21 -0
- package/README.md +169 -0
- package/lib/commonjs/assets/fonts/Inter-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/lib/commonjs/components/FluentGlass.js +94 -0
- package/lib/commonjs/components/FluentGlass.js.map +1 -0
- package/lib/commonjs/components/FluentGlassAlert.js +126 -0
- package/lib/commonjs/components/FluentGlassAlert.js.map +1 -0
- package/lib/commonjs/components/FluentGlassBadge.js +124 -0
- package/lib/commonjs/components/FluentGlassBadge.js.map +1 -0
- package/lib/commonjs/components/FluentGlassBarChart.js +287 -0
- package/lib/commonjs/components/FluentGlassBarChart.js.map +1 -0
- package/lib/commonjs/components/FluentGlassBreadcrumb.js +155 -0
- package/lib/commonjs/components/FluentGlassBreadcrumb.js.map +1 -0
- package/lib/commonjs/components/FluentGlassButton.js +175 -0
- package/lib/commonjs/components/FluentGlassButton.js.map +1 -0
- package/lib/commonjs/components/FluentGlassCalendarWidget.js +73 -0
- package/lib/commonjs/components/FluentGlassCalendarWidget.js.map +1 -0
- package/lib/commonjs/components/FluentGlassCard.js +195 -0
- package/lib/commonjs/components/FluentGlassCard.js.map +1 -0
- package/lib/commonjs/components/FluentGlassCheckbox.js +121 -0
- package/lib/commonjs/components/FluentGlassCheckbox.js.map +1 -0
- package/lib/commonjs/components/FluentGlassClockWidget.js +80 -0
- package/lib/commonjs/components/FluentGlassClockWidget.js.map +1 -0
- package/lib/commonjs/components/FluentGlassCodeBlock.js +239 -0
- package/lib/commonjs/components/FluentGlassCodeBlock.js.map +1 -0
- package/lib/commonjs/components/FluentGlassContainer.js +52 -0
- package/lib/commonjs/components/FluentGlassContainer.js.map +1 -0
- package/lib/commonjs/components/FluentGlassCrossfade.js +118 -0
- package/lib/commonjs/components/FluentGlassCrossfade.js.map +1 -0
- package/lib/commonjs/components/FluentGlassDateInput.js +176 -0
- package/lib/commonjs/components/FluentGlassDateInput.js.map +1 -0
- package/lib/commonjs/components/FluentGlassDatePicker.js +271 -0
- package/lib/commonjs/components/FluentGlassDatePicker.js.map +1 -0
- package/lib/commonjs/components/FluentGlassDialog.js +169 -0
- package/lib/commonjs/components/FluentGlassDialog.js.map +1 -0
- package/lib/commonjs/components/FluentGlassDock.js +187 -0
- package/lib/commonjs/components/FluentGlassDock.js.map +1 -0
- package/lib/commonjs/components/FluentGlassDropdown.js +349 -0
- package/lib/commonjs/components/FluentGlassDropdown.js.map +1 -0
- package/lib/commonjs/components/FluentGlassEmailInput.js +43 -0
- package/lib/commonjs/components/FluentGlassEmailInput.js.map +1 -0
- package/lib/commonjs/components/FluentGlassInput.js +83 -0
- package/lib/commonjs/components/FluentGlassInput.js.map +1 -0
- package/lib/commonjs/components/FluentGlassLabeledInput.js +64 -0
- package/lib/commonjs/components/FluentGlassLabeledInput.js.map +1 -0
- package/lib/commonjs/components/FluentGlassLayout.js +106 -0
- package/lib/commonjs/components/FluentGlassLayout.js.map +1 -0
- package/lib/commonjs/components/FluentGlassPasswordInput.js +60 -0
- package/lib/commonjs/components/FluentGlassPasswordInput.js.map +1 -0
- package/lib/commonjs/components/FluentGlassPopover.js +75 -0
- package/lib/commonjs/components/FluentGlassPopover.js.map +1 -0
- package/lib/commonjs/components/FluentGlassResponsiveRow.js +74 -0
- package/lib/commonjs/components/FluentGlassResponsiveRow.js.map +1 -0
- package/lib/commonjs/components/FluentGlassScrollArea.js +101 -0
- package/lib/commonjs/components/FluentGlassScrollArea.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSegmentedControl.js +126 -0
- package/lib/commonjs/components/FluentGlassSegmentedControl.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSelect.js +155 -0
- package/lib/commonjs/components/FluentGlassSelect.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSeparator.js +62 -0
- package/lib/commonjs/components/FluentGlassSeparator.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSheet.js +189 -0
- package/lib/commonjs/components/FluentGlassSheet.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSidebar.js +358 -0
- package/lib/commonjs/components/FluentGlassSidebar.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSimpleCard.js +56 -0
- package/lib/commonjs/components/FluentGlassSimpleCard.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSkeleton.js +52 -0
- package/lib/commonjs/components/FluentGlassSkeleton.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSlider.js +197 -0
- package/lib/commonjs/components/FluentGlassSlider.js.map +1 -0
- package/lib/commonjs/components/FluentGlassStatWidget.js +133 -0
- package/lib/commonjs/components/FluentGlassStatWidget.js.map +1 -0
- package/lib/commonjs/components/FluentGlassStatusIndicator.js +89 -0
- package/lib/commonjs/components/FluentGlassStatusIndicator.js.map +1 -0
- package/lib/commonjs/components/FluentGlassSwitch.js +126 -0
- package/lib/commonjs/components/FluentGlassSwitch.js.map +1 -0
- package/lib/commonjs/components/FluentGlassTable.js +163 -0
- package/lib/commonjs/components/FluentGlassTable.js.map +1 -0
- package/lib/commonjs/components/FluentGlassTag.js +109 -0
- package/lib/commonjs/components/FluentGlassTag.js.map +1 -0
- package/lib/commonjs/components/FluentGlassTextInput.js +90 -0
- package/lib/commonjs/components/FluentGlassTextInput.js.map +1 -0
- package/lib/commonjs/components/FluentGlassTimeline.js +334 -0
- package/lib/commonjs/components/FluentGlassTimeline.js.map +1 -0
- package/lib/commonjs/components/FluentGlassWeatherWidget.js +72 -0
- package/lib/commonjs/components/FluentGlassWeatherWidget.js.map +1 -0
- package/lib/commonjs/components/index.js +308 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/fonts.js +33 -0
- package/lib/commonjs/fonts.js.map +1 -0
- package/lib/commonjs/hooks/useBreakpoint.js +57 -0
- package/lib/commonjs/hooks/useBreakpoint.js.map +1 -0
- package/lib/commonjs/index.js +462 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/theme/FluentGlassProvider.js +84 -0
- package/lib/commonjs/theme/FluentGlassProvider.js.map +1 -0
- package/lib/commonjs/theme/defaultTheme.js +55 -0
- package/lib/commonjs/theme/defaultTheme.js.map +1 -0
- package/lib/commonjs/theme/resolvers.js +118 -0
- package/lib/commonjs/theme/resolvers.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +239 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/theme/typography.js +50 -0
- package/lib/commonjs/theme/typography.js.map +1 -0
- package/lib/commonjs/theme/useTheme.js +22 -0
- package/lib/commonjs/theme/useTheme.js.map +1 -0
- package/lib/commonjs/types/components.js +6 -0
- package/lib/commonjs/types/components.js.map +1 -0
- package/lib/commonjs/types/theme.js +6 -0
- package/lib/commonjs/types/theme.js.map +1 -0
- package/lib/commonjs/utils/colors.js +59 -0
- package/lib/commonjs/utils/colors.js.map +1 -0
- package/lib/commonjs/utils/responsive.js +126 -0
- package/lib/commonjs/utils/responsive.js.map +1 -0
- package/lib/module/assets/fonts/Inter-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/lib/module/components/FluentGlass.js +89 -0
- package/lib/module/components/FluentGlass.js.map +1 -0
- package/lib/module/components/FluentGlassAlert.js +121 -0
- package/lib/module/components/FluentGlassAlert.js.map +1 -0
- package/lib/module/components/FluentGlassBadge.js +119 -0
- package/lib/module/components/FluentGlassBadge.js.map +1 -0
- package/lib/module/components/FluentGlassBarChart.js +281 -0
- package/lib/module/components/FluentGlassBarChart.js.map +1 -0
- package/lib/module/components/FluentGlassBreadcrumb.js +150 -0
- package/lib/module/components/FluentGlassBreadcrumb.js.map +1 -0
- package/lib/module/components/FluentGlassButton.js +169 -0
- package/lib/module/components/FluentGlassButton.js.map +1 -0
- package/lib/module/components/FluentGlassCalendarWidget.js +68 -0
- package/lib/module/components/FluentGlassCalendarWidget.js.map +1 -0
- package/lib/module/components/FluentGlassCard.js +190 -0
- package/lib/module/components/FluentGlassCard.js.map +1 -0
- package/lib/module/components/FluentGlassCheckbox.js +115 -0
- package/lib/module/components/FluentGlassCheckbox.js.map +1 -0
- package/lib/module/components/FluentGlassClockWidget.js +74 -0
- package/lib/module/components/FluentGlassClockWidget.js.map +1 -0
- package/lib/module/components/FluentGlassCodeBlock.js +233 -0
- package/lib/module/components/FluentGlassCodeBlock.js.map +1 -0
- package/lib/module/components/FluentGlassContainer.js +47 -0
- package/lib/module/components/FluentGlassContainer.js.map +1 -0
- package/lib/module/components/FluentGlassCrossfade.js +112 -0
- package/lib/module/components/FluentGlassCrossfade.js.map +1 -0
- package/lib/module/components/FluentGlassDateInput.js +170 -0
- package/lib/module/components/FluentGlassDateInput.js.map +1 -0
- package/lib/module/components/FluentGlassDatePicker.js +265 -0
- package/lib/module/components/FluentGlassDatePicker.js.map +1 -0
- package/lib/module/components/FluentGlassDialog.js +163 -0
- package/lib/module/components/FluentGlassDialog.js.map +1 -0
- package/lib/module/components/FluentGlassDock.js +181 -0
- package/lib/module/components/FluentGlassDock.js.map +1 -0
- package/lib/module/components/FluentGlassDropdown.js +343 -0
- package/lib/module/components/FluentGlassDropdown.js.map +1 -0
- package/lib/module/components/FluentGlassEmailInput.js +38 -0
- package/lib/module/components/FluentGlassEmailInput.js.map +1 -0
- package/lib/module/components/FluentGlassInput.js +78 -0
- package/lib/module/components/FluentGlassInput.js.map +1 -0
- package/lib/module/components/FluentGlassLabeledInput.js +59 -0
- package/lib/module/components/FluentGlassLabeledInput.js.map +1 -0
- package/lib/module/components/FluentGlassLayout.js +101 -0
- package/lib/module/components/FluentGlassLayout.js.map +1 -0
- package/lib/module/components/FluentGlassPasswordInput.js +54 -0
- package/lib/module/components/FluentGlassPasswordInput.js.map +1 -0
- package/lib/module/components/FluentGlassPopover.js +70 -0
- package/lib/module/components/FluentGlassPopover.js.map +1 -0
- package/lib/module/components/FluentGlassResponsiveRow.js +71 -0
- package/lib/module/components/FluentGlassResponsiveRow.js.map +1 -0
- package/lib/module/components/FluentGlassScrollArea.js +95 -0
- package/lib/module/components/FluentGlassScrollArea.js.map +1 -0
- package/lib/module/components/FluentGlassSegmentedControl.js +120 -0
- package/lib/module/components/FluentGlassSegmentedControl.js.map +1 -0
- package/lib/module/components/FluentGlassSelect.js +149 -0
- package/lib/module/components/FluentGlassSelect.js.map +1 -0
- package/lib/module/components/FluentGlassSeparator.js +57 -0
- package/lib/module/components/FluentGlassSeparator.js.map +1 -0
- package/lib/module/components/FluentGlassSheet.js +183 -0
- package/lib/module/components/FluentGlassSheet.js.map +1 -0
- package/lib/module/components/FluentGlassSidebar.js +351 -0
- package/lib/module/components/FluentGlassSidebar.js.map +1 -0
- package/lib/module/components/FluentGlassSimpleCard.js +51 -0
- package/lib/module/components/FluentGlassSimpleCard.js.map +1 -0
- package/lib/module/components/FluentGlassSkeleton.js +46 -0
- package/lib/module/components/FluentGlassSkeleton.js.map +1 -0
- package/lib/module/components/FluentGlassSlider.js +191 -0
- package/lib/module/components/FluentGlassSlider.js.map +1 -0
- package/lib/module/components/FluentGlassStatWidget.js +128 -0
- package/lib/module/components/FluentGlassStatWidget.js.map +1 -0
- package/lib/module/components/FluentGlassStatusIndicator.js +84 -0
- package/lib/module/components/FluentGlassStatusIndicator.js.map +1 -0
- package/lib/module/components/FluentGlassSwitch.js +122 -0
- package/lib/module/components/FluentGlassSwitch.js.map +1 -0
- package/lib/module/components/FluentGlassTable.js +158 -0
- package/lib/module/components/FluentGlassTable.js.map +1 -0
- package/lib/module/components/FluentGlassTag.js +103 -0
- package/lib/module/components/FluentGlassTag.js.map +1 -0
- package/lib/module/components/FluentGlassTextInput.js +85 -0
- package/lib/module/components/FluentGlassTextInput.js.map +1 -0
- package/lib/module/components/FluentGlassTimeline.js +327 -0
- package/lib/module/components/FluentGlassTimeline.js.map +1 -0
- package/lib/module/components/FluentGlassWeatherWidget.js +67 -0
- package/lib/module/components/FluentGlassWeatherWidget.js.map +1 -0
- package/lib/module/components/index.js +45 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/fonts.js +26 -0
- package/lib/module/fonts.js.map +1 -0
- package/lib/module/hooks/useBreakpoint.js +54 -0
- package/lib/module/hooks/useBreakpoint.js.map +1 -0
- package/lib/module/index.js +30 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/theme/FluentGlassProvider.js +77 -0
- package/lib/module/theme/FluentGlassProvider.js.map +1 -0
- package/lib/module/theme/defaultTheme.js +51 -0
- package/lib/module/theme/defaultTheme.js.map +1 -0
- package/lib/module/theme/resolvers.js +110 -0
- package/lib/module/theme/resolvers.js.map +1 -0
- package/lib/module/theme/tokens.js +235 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/theme/typography.js +45 -0
- package/lib/module/theme/typography.js.map +1 -0
- package/lib/module/theme/useTheme.js +18 -0
- package/lib/module/theme/useTheme.js.map +1 -0
- package/lib/module/types/components.js +4 -0
- package/lib/module/types/components.js.map +1 -0
- package/lib/module/types/theme.js +4 -0
- package/lib/module/types/theme.js.map +1 -0
- package/lib/module/utils/colors.js +55 -0
- package/lib/module/utils/colors.js.map +1 -0
- package/lib/module/utils/responsive.js +116 -0
- package/lib/module/utils/responsive.js.map +1 -0
- package/lib/typescript/components/FluentGlass.d.ts +25 -0
- package/lib/typescript/components/FluentGlass.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassAlert.d.ts +13 -0
- package/lib/typescript/components/FluentGlassAlert.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassBadge.d.ts +22 -0
- package/lib/typescript/components/FluentGlassBadge.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassBarChart.d.ts +30 -0
- package/lib/typescript/components/FluentGlassBarChart.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassBreadcrumb.d.ts +22 -0
- package/lib/typescript/components/FluentGlassBreadcrumb.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassButton.d.ts +27 -0
- package/lib/typescript/components/FluentGlassButton.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassCalendarWidget.d.ts +13 -0
- package/lib/typescript/components/FluentGlassCalendarWidget.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassCard.d.ts +30 -0
- package/lib/typescript/components/FluentGlassCard.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassCheckbox.d.ts +14 -0
- package/lib/typescript/components/FluentGlassCheckbox.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassClockWidget.d.ts +11 -0
- package/lib/typescript/components/FluentGlassClockWidget.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassCodeBlock.d.ts +11 -0
- package/lib/typescript/components/FluentGlassCodeBlock.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassContainer.d.ts +22 -0
- package/lib/typescript/components/FluentGlassContainer.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassCrossfade.d.ts +24 -0
- package/lib/typescript/components/FluentGlassCrossfade.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassDateInput.d.ts +18 -0
- package/lib/typescript/components/FluentGlassDateInput.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassDatePicker.d.ts +9 -0
- package/lib/typescript/components/FluentGlassDatePicker.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassDialog.d.ts +18 -0
- package/lib/typescript/components/FluentGlassDialog.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassDock.d.ts +19 -0
- package/lib/typescript/components/FluentGlassDock.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassDropdown.d.ts +23 -0
- package/lib/typescript/components/FluentGlassDropdown.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassEmailInput.d.ts +17 -0
- package/lib/typescript/components/FluentGlassEmailInput.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassInput.d.ts +12 -0
- package/lib/typescript/components/FluentGlassInput.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassLabeledInput.d.ts +19 -0
- package/lib/typescript/components/FluentGlassLabeledInput.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassLayout.d.ts +11 -0
- package/lib/typescript/components/FluentGlassLayout.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassPasswordInput.d.ts +15 -0
- package/lib/typescript/components/FluentGlassPasswordInput.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassPopover.d.ts +17 -0
- package/lib/typescript/components/FluentGlassPopover.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassResponsiveRow.d.ts +25 -0
- package/lib/typescript/components/FluentGlassResponsiveRow.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassScrollArea.d.ts +16 -0
- package/lib/typescript/components/FluentGlassScrollArea.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSegmentedControl.d.ts +15 -0
- package/lib/typescript/components/FluentGlassSegmentedControl.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSelect.d.ts +23 -0
- package/lib/typescript/components/FluentGlassSelect.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSeparator.d.ts +13 -0
- package/lib/typescript/components/FluentGlassSeparator.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSheet.d.ts +11 -0
- package/lib/typescript/components/FluentGlassSheet.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSidebar.d.ts +44 -0
- package/lib/typescript/components/FluentGlassSidebar.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSimpleCard.d.ts +19 -0
- package/lib/typescript/components/FluentGlassSimpleCard.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSkeleton.d.ts +14 -0
- package/lib/typescript/components/FluentGlassSkeleton.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSlider.d.ts +31 -0
- package/lib/typescript/components/FluentGlassSlider.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassStatWidget.d.ts +17 -0
- package/lib/typescript/components/FluentGlassStatWidget.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassStatusIndicator.d.ts +16 -0
- package/lib/typescript/components/FluentGlassStatusIndicator.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassSwitch.d.ts +13 -0
- package/lib/typescript/components/FluentGlassSwitch.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassTable.d.ts +50 -0
- package/lib/typescript/components/FluentGlassTable.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassTag.d.ts +18 -0
- package/lib/typescript/components/FluentGlassTag.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassTextInput.d.ts +21 -0
- package/lib/typescript/components/FluentGlassTextInput.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassTimeline.d.ts +27 -0
- package/lib/typescript/components/FluentGlassTimeline.d.ts.map +1 -0
- package/lib/typescript/components/FluentGlassWeatherWidget.d.ts +13 -0
- package/lib/typescript/components/FluentGlassWeatherWidget.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +43 -0
- package/lib/typescript/components/index.d.ts.map +1 -0
- package/lib/typescript/fonts.d.ts +13 -0
- package/lib/typescript/fonts.d.ts.map +1 -0
- package/lib/typescript/hooks/useBreakpoint.d.ts +26 -0
- package/lib/typescript/hooks/useBreakpoint.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +18 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/theme/FluentGlassProvider.d.ts +21 -0
- package/lib/typescript/theme/FluentGlassProvider.d.ts.map +1 -0
- package/lib/typescript/theme/defaultTheme.d.ts +10 -0
- package/lib/typescript/theme/defaultTheme.d.ts.map +1 -0
- package/lib/typescript/theme/resolvers.d.ts +55 -0
- package/lib/typescript/theme/resolvers.d.ts.map +1 -0
- package/lib/typescript/theme/tokens.d.ts +27 -0
- package/lib/typescript/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/theme/typography.d.ts +27 -0
- package/lib/typescript/theme/typography.d.ts.map +1 -0
- package/lib/typescript/theme/useTheme.d.ts +12 -0
- package/lib/typescript/theme/useTheme.d.ts.map +1 -0
- package/lib/typescript/types/components.d.ts +32 -0
- package/lib/typescript/types/components.d.ts.map +1 -0
- package/lib/typescript/types/theme.d.ts +79 -0
- package/lib/typescript/types/theme.d.ts.map +1 -0
- package/lib/typescript/utils/colors.d.ts +3 -0
- package/lib/typescript/utils/colors.d.ts.map +1 -0
- package/lib/typescript/utils/responsive.d.ts +62 -0
- package/lib/typescript/utils/responsive.d.ts.map +1 -0
- package/package.json +90 -0
- package/src/assets/fonts/Inter-Black.ttf +0 -0
- package/src/assets/fonts/Inter-Bold.ttf +0 -0
- package/src/assets/fonts/Inter-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter-Medium.ttf +0 -0
- package/src/assets/fonts/Inter-Regular.ttf +0 -0
- package/src/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/src/components/FluentGlass.tsx +103 -0
- package/src/components/FluentGlassAlert.tsx +126 -0
- package/src/components/FluentGlassBadge.tsx +109 -0
- package/src/components/FluentGlassBarChart.tsx +295 -0
- package/src/components/FluentGlassBreadcrumb.tsx +173 -0
- package/src/components/FluentGlassButton.tsx +169 -0
- package/src/components/FluentGlassCalendarWidget.tsx +55 -0
- package/src/components/FluentGlassCard.tsx +186 -0
- package/src/components/FluentGlassCheckbox.tsx +138 -0
- package/src/components/FluentGlassClockWidget.tsx +61 -0
- package/src/components/FluentGlassCodeBlock.tsx +241 -0
- package/src/components/FluentGlassContainer.tsx +63 -0
- package/src/components/FluentGlassCrossfade.tsx +122 -0
- package/src/components/FluentGlassDateInput.tsx +182 -0
- package/src/components/FluentGlassDatePicker.tsx +224 -0
- package/src/components/FluentGlassDialog.tsx +153 -0
- package/src/components/FluentGlassDock.tsx +194 -0
- package/src/components/FluentGlassDropdown.tsx +382 -0
- package/src/components/FluentGlassEmailInput.tsx +46 -0
- package/src/components/FluentGlassInput.tsx +77 -0
- package/src/components/FluentGlassLabeledInput.tsx +63 -0
- package/src/components/FluentGlassLayout.tsx +89 -0
- package/src/components/FluentGlassPasswordInput.tsx +59 -0
- package/src/components/FluentGlassPopover.tsx +74 -0
- package/src/components/FluentGlassResponsiveRow.tsx +76 -0
- package/src/components/FluentGlassScrollArea.tsx +110 -0
- package/src/components/FluentGlassSegmentedControl.tsx +140 -0
- package/src/components/FluentGlassSelect.tsx +139 -0
- package/src/components/FluentGlassSeparator.tsx +54 -0
- package/src/components/FluentGlassSheet.tsx +183 -0
- package/src/components/FluentGlassSidebar.tsx +349 -0
- package/src/components/FluentGlassSimpleCard.tsx +59 -0
- package/src/components/FluentGlassSkeleton.tsx +69 -0
- package/src/components/FluentGlassSlider.tsx +202 -0
- package/src/components/FluentGlassStatWidget.tsx +107 -0
- package/src/components/FluentGlassStatusIndicator.tsx +82 -0
- package/src/components/FluentGlassSwitch.tsx +130 -0
- package/src/components/FluentGlassTable.tsx +145 -0
- package/src/components/FluentGlassTag.tsx +98 -0
- package/src/components/FluentGlassTextInput.tsx +87 -0
- package/src/components/FluentGlassTimeline.tsx +335 -0
- package/src/components/FluentGlassWeatherWidget.tsx +54 -0
- package/src/components/index.ts +42 -0
- package/src/fonts.ts +24 -0
- package/src/hooks/useBreakpoint.ts +55 -0
- package/src/index.ts +97 -0
- package/src/theme/FluentGlassProvider.tsx +82 -0
- package/src/theme/defaultTheme.ts +44 -0
- package/src/theme/resolvers.ts +115 -0
- package/src/theme/tokens.ts +200 -0
- package/src/theme/typography.ts +41 -0
- package/src/theme/useTheme.ts +17 -0
- package/src/types/components.ts +47 -0
- package/src/types/theme.ts +82 -0
- package/src/utils/colors.ts +55 -0
- package/src/utils/responsive.ts +110 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { BlurView } from 'expo-blur';
|
|
4
|
+
import useTheme from '../theme/useTheme';
|
|
5
|
+
import { resolveColorScheme, resolveBlur, resolveRadius, resolveBackwardCompat } from '../theme/resolvers';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* FluentGlass (Atom)
|
|
9
|
+
* The fundamental building block for the FluentGlass Core.
|
|
10
|
+
* Provides the "glass" material with configurable intensity and border.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} colorScheme - 'default' | 'dark' | 'deep' | 'light' | 'success' | 'error' | 'warning' | 'info'
|
|
13
|
+
* @param {string} blur - 'none' | 'subtle' | 'medium' | 'strong' | 'max'
|
|
14
|
+
* @param {string} radius - 'none' | 'sm' | 'md' | 'lg' | 'pill'
|
|
15
|
+
* @param {number} borderOpacity - Border opacity (0-1)
|
|
16
|
+
*
|
|
17
|
+
* Legacy props (backward compat): tint, intensity, borderRadius
|
|
18
|
+
*/
|
|
19
|
+
import { ViewProps, StyleProp, ViewStyle } from 'react-native';
|
|
20
|
+
import { FluentGlassBaseProps } from '../types/components';
|
|
21
|
+
|
|
22
|
+
export interface FluentGlassProps extends FluentGlassBaseProps {
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
borderOpacity?: number;
|
|
26
|
+
intensity?: number;
|
|
27
|
+
tint?: string;
|
|
28
|
+
borderRadius?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function FluentGlass({
|
|
32
|
+
children,
|
|
33
|
+
style,
|
|
34
|
+
// New standardized props
|
|
35
|
+
colorScheme,
|
|
36
|
+
blur,
|
|
37
|
+
radius,
|
|
38
|
+
// Legacy props (backward compat)
|
|
39
|
+
intensity,
|
|
40
|
+
tint,
|
|
41
|
+
borderOpacity = 0.2,
|
|
42
|
+
borderRadius,
|
|
43
|
+
// Accessibility props
|
|
44
|
+
accessible,
|
|
45
|
+
accessibilityRole,
|
|
46
|
+
accessibilityLabel,
|
|
47
|
+
accessibilityHint,
|
|
48
|
+
accessibilityState,
|
|
49
|
+
accessibilityValue,
|
|
50
|
+
accessibilityViewIsModal,
|
|
51
|
+
}: FluentGlassProps) {
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
|
|
54
|
+
// Resolve backward compatibility
|
|
55
|
+
const compat = resolveBackwardCompat({ tint, intensity, colorScheme, blur });
|
|
56
|
+
const resolvedColorScheme = compat.colorScheme || theme.defaults.colorScheme;
|
|
57
|
+
const resolvedBlur = compat.blur || theme.defaults.blur;
|
|
58
|
+
|
|
59
|
+
const colorConfig = resolveColorScheme(theme, resolvedColorScheme);
|
|
60
|
+
const blurConfig = resolveBlur(theme, resolvedBlur);
|
|
61
|
+
const resolvedRadius = borderRadius ?? resolveRadius(theme, radius || 'lg');
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<View
|
|
65
|
+
accessible={accessible}
|
|
66
|
+
accessibilityRole={accessibilityRole}
|
|
67
|
+
accessibilityLabel={accessibilityLabel}
|
|
68
|
+
accessibilityHint={accessibilityHint}
|
|
69
|
+
accessibilityState={accessibilityState}
|
|
70
|
+
accessibilityValue={accessibilityValue}
|
|
71
|
+
accessibilityViewIsModal={accessibilityViewIsModal}
|
|
72
|
+
style={[
|
|
73
|
+
styles.container,
|
|
74
|
+
{
|
|
75
|
+
borderRadius: resolvedRadius,
|
|
76
|
+
borderColor: colorConfig.border || theme.colors.border,
|
|
77
|
+
backgroundColor: colorConfig.bg,
|
|
78
|
+
},
|
|
79
|
+
style,
|
|
80
|
+
]}
|
|
81
|
+
>
|
|
82
|
+
<BlurView
|
|
83
|
+
intensity={blurConfig.intensity}
|
|
84
|
+
tint={colorConfig.tint}
|
|
85
|
+
style={styles.blur}
|
|
86
|
+
>
|
|
87
|
+
{children}
|
|
88
|
+
</BlurView>
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const styles = StyleSheet.create({
|
|
94
|
+
container: {
|
|
95
|
+
overflow: 'hidden',
|
|
96
|
+
borderWidth: 1,
|
|
97
|
+
},
|
|
98
|
+
blur: {
|
|
99
|
+
flex: 1,
|
|
100
|
+
width: '100%',
|
|
101
|
+
height: '100%',
|
|
102
|
+
},
|
|
103
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View, Text, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import FluentGlass from './FluentGlass';
|
|
4
|
+
import useTheme from '../theme/useTheme';
|
|
5
|
+
import { resolveSize, resolveColorScheme, resolveRadius, resolveBackwardCompat } from '../theme/resolvers';
|
|
6
|
+
import { FluentGlassBaseProps } from '../types/components';
|
|
7
|
+
|
|
8
|
+
export interface FluentGlassAlertProps extends FluentGlassBaseProps {
|
|
9
|
+
/** Legacy prop mapped to colorScheme */
|
|
10
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
11
|
+
title?: string;
|
|
12
|
+
message?: string;
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const ALERT_ICONS: Record<string, string> = {
|
|
17
|
+
success: '✓',
|
|
18
|
+
error: '✕',
|
|
19
|
+
warning: '⚠',
|
|
20
|
+
info: 'ℹ',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default function FluentGlassAlert({ // New standardized props
|
|
24
|
+
colorScheme,
|
|
25
|
+
size,
|
|
26
|
+
blur,
|
|
27
|
+
radius,
|
|
28
|
+
// Legacy props
|
|
29
|
+
type = 'info',
|
|
30
|
+
title,
|
|
31
|
+
message,
|
|
32
|
+
style,
|
|
33
|
+
accessibilityLabel, }: FluentGlassAlertProps) {
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
|
|
36
|
+
// Resolve backward compat: type → colorScheme
|
|
37
|
+
const compat = resolveBackwardCompat({ type, colorScheme, blur });
|
|
38
|
+
const resolvedScheme = compat.colorScheme || 'info';
|
|
39
|
+
const colorConfig = resolveColorScheme(theme, resolvedScheme);
|
|
40
|
+
const sizeConfig = resolveSize(theme, size || theme.defaults.size);
|
|
41
|
+
const resolvedRadius = resolveRadius(theme, radius || 'md');
|
|
42
|
+
|
|
43
|
+
const icon = ALERT_ICONS[resolvedScheme] || ALERT_ICONS.info;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<FluentGlass
|
|
47
|
+
style={[
|
|
48
|
+
styles.container,
|
|
49
|
+
{
|
|
50
|
+
backgroundColor: colorConfig.bg,
|
|
51
|
+
borderColor: colorConfig.border,
|
|
52
|
+
},
|
|
53
|
+
style,
|
|
54
|
+
]}
|
|
55
|
+
colorScheme="dark"
|
|
56
|
+
blur={compat.blur || 'subtle'}
|
|
57
|
+
borderRadius={resolvedRadius}
|
|
58
|
+
borderOpacity={0}
|
|
59
|
+
accessible={true}
|
|
60
|
+
accessibilityRole="alert"
|
|
61
|
+
accessibilityLabel={accessibilityLabel ?? [title, message].filter(Boolean).join('. ')}
|
|
62
|
+
>
|
|
63
|
+
<View style={[styles.content, { padding: sizeConfig.paddingHorizontal, gap: (sizeConfig.gap ?? 0) + 4 }]}>
|
|
64
|
+
{/* Icon Circle */}
|
|
65
|
+
<View
|
|
66
|
+
style={[
|
|
67
|
+
styles.iconCircle,
|
|
68
|
+
{
|
|
69
|
+
backgroundColor: `${colorConfig.solid}22`,
|
|
70
|
+
borderColor: colorConfig.solid,
|
|
71
|
+
width: sizeConfig.minHeight * 0.75,
|
|
72
|
+
height: sizeConfig.minHeight * 0.75,
|
|
73
|
+
borderRadius: sizeConfig.minHeight * 0.375,
|
|
74
|
+
},
|
|
75
|
+
]}
|
|
76
|
+
>
|
|
77
|
+
<Text style={[styles.icon, { color: colorConfig.solid, fontSize: sizeConfig.fontSize - 1, fontFamily: theme.typography.extraBold }]}>
|
|
78
|
+
{icon}
|
|
79
|
+
</Text>
|
|
80
|
+
</View>
|
|
81
|
+
|
|
82
|
+
{/* Text */}
|
|
83
|
+
<View style={styles.textArea}>
|
|
84
|
+
{title ? (
|
|
85
|
+
<Text style={[styles.title, { color: theme.colors.textPrimary, fontSize: sizeConfig.fontSize, fontFamily: theme.typography.bold }]}>
|
|
86
|
+
{title}
|
|
87
|
+
</Text>
|
|
88
|
+
) : null}
|
|
89
|
+
{message ? (
|
|
90
|
+
<Text style={[styles.message, { color: theme.colors.textSecondary, fontSize: sizeConfig.fontSize - 2 }]}>
|
|
91
|
+
{message}
|
|
92
|
+
</Text>
|
|
93
|
+
) : null}
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
96
|
+
</FluentGlass>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const styles = StyleSheet.create({
|
|
101
|
+
container: {
|
|
102
|
+
borderWidth: 1,
|
|
103
|
+
},
|
|
104
|
+
content: {
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
},
|
|
108
|
+
iconCircle: {
|
|
109
|
+
borderWidth: 1.5,
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
},
|
|
113
|
+
icon: {
|
|
114
|
+
fontWeight: '800',
|
|
115
|
+
},
|
|
116
|
+
textArea: {
|
|
117
|
+
flex: 1,
|
|
118
|
+
},
|
|
119
|
+
title: {
|
|
120
|
+
fontWeight: '700',
|
|
121
|
+
},
|
|
122
|
+
message: {
|
|
123
|
+
marginTop: 2,
|
|
124
|
+
lineHeight: 18,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import FluentGlass from './FluentGlass';
|
|
4
|
+
import useTheme from '../theme/useTheme';
|
|
5
|
+
import { resolveSize, resolveColorScheme, resolveBackwardCompat } from '../theme/resolvers';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* FluentGlassBadge (Atom)
|
|
9
|
+
* Glassmorphism badge with variants: default, secondary, outline, destructive.
|
|
10
|
+
* Pill-shaped, compact label for status or categorization.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} size - 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
13
|
+
* @param {string} colorScheme - 'default' | 'info' | 'success' | 'error' | 'warning'
|
|
14
|
+
* @param {string} radius - border radius
|
|
15
|
+
*/
|
|
16
|
+
import { ViewStyle, TextStyle, StyleProp } from 'react-native';
|
|
17
|
+
import { FluentGlassBaseProps } from '../types/components';
|
|
18
|
+
|
|
19
|
+
export interface FluentGlassBadgeProps extends FluentGlassBaseProps {
|
|
20
|
+
label: string | number;
|
|
21
|
+
variant?: 'default' | 'secondary' | 'outline' | 'destructive' | string;
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
textStyle?: StyleProp<TextStyle>;
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default function FluentGlassBadge({
|
|
28
|
+
label,
|
|
29
|
+
variant, // mapped via backward compat
|
|
30
|
+
style,
|
|
31
|
+
textStyle,
|
|
32
|
+
icon,
|
|
33
|
+
// New standardized props
|
|
34
|
+
size,
|
|
35
|
+
colorScheme,
|
|
36
|
+
radius = 'pill',
|
|
37
|
+
}: FluentGlassBadgeProps) {
|
|
38
|
+
const theme = useTheme();
|
|
39
|
+
const sizeConfig = resolveSize(theme, size || 'xs');
|
|
40
|
+
const compat = resolveBackwardCompat({ variant, colorScheme });
|
|
41
|
+
const resolvedScheme = compat.colorScheme || 'default';
|
|
42
|
+
const colorConfig = resolveColorScheme(theme, resolvedScheme);
|
|
43
|
+
|
|
44
|
+
const isOutline = variant === 'outline';
|
|
45
|
+
|
|
46
|
+
if (isOutline) {
|
|
47
|
+
return (
|
|
48
|
+
<View
|
|
49
|
+
accessible={true}
|
|
50
|
+
accessibilityLabel={String(label)}
|
|
51
|
+
style={[
|
|
52
|
+
styles.outlineContainer,
|
|
53
|
+
{ height: sizeConfig.minHeight, paddingHorizontal: sizeConfig.paddingHorizontal, borderColor: colorConfig.border || theme.colors.border },
|
|
54
|
+
style
|
|
55
|
+
]}>
|
|
56
|
+
{icon ? <View style={[styles.iconContainer, { marginRight: sizeConfig.gap }]}>{icon}</View> : null}
|
|
57
|
+
<Text style={[styles.text, { color: theme.colors.textSecondary, fontSize: sizeConfig.fontSize, fontFamily: theme.typography.medium }, textStyle]}>
|
|
58
|
+
{label}
|
|
59
|
+
</Text>
|
|
60
|
+
</View>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<FluentGlass
|
|
66
|
+
accessible={true}
|
|
67
|
+
accessibilityLabel={String(label)}
|
|
68
|
+
style={[styles.container, { height: sizeConfig.minHeight }, style]}
|
|
69
|
+
colorScheme={resolvedScheme}
|
|
70
|
+
blur="none"
|
|
71
|
+
radius={radius}
|
|
72
|
+
borderOpacity={0.25}
|
|
73
|
+
>
|
|
74
|
+
<View style={[styles.content, { paddingHorizontal: sizeConfig.paddingHorizontal, gap: sizeConfig.gap }]}>
|
|
75
|
+
{icon ? <View style={styles.iconContainer}>{icon}</View> : null}
|
|
76
|
+
<Text style={[styles.text, { color: colorConfig.text || theme.colors.textPrimary, fontSize: sizeConfig.fontSize, fontFamily: theme.typography.medium }, textStyle]}>
|
|
77
|
+
{label}
|
|
78
|
+
</Text>
|
|
79
|
+
</View>
|
|
80
|
+
</FluentGlass>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const styles = StyleSheet.create({
|
|
85
|
+
container: {
|
|
86
|
+
alignSelf: 'flex-start',
|
|
87
|
+
justifyContent: 'center',
|
|
88
|
+
},
|
|
89
|
+
content: {
|
|
90
|
+
flex: 1,
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
justifyContent: 'center',
|
|
94
|
+
},
|
|
95
|
+
outlineContainer: {
|
|
96
|
+
alignSelf: 'flex-start',
|
|
97
|
+
borderRadius: 20,
|
|
98
|
+
borderWidth: 1,
|
|
99
|
+
flexDirection: 'row',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
},
|
|
103
|
+
text: {
|
|
104
|
+
fontWeight: '500',
|
|
105
|
+
},
|
|
106
|
+
iconContainer: {
|
|
107
|
+
// margin normally handled by flex gap
|
|
108
|
+
},
|
|
109
|
+
});
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View, Text } from 'react-native';
|
|
4
|
+
import Animated, {
|
|
5
|
+
useSharedValue,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
withSpring,
|
|
8
|
+
withDelay,
|
|
9
|
+
} from 'react-native-reanimated';
|
|
10
|
+
import FluentGlass from './FluentGlass';
|
|
11
|
+
import useTheme from '../theme/useTheme';
|
|
12
|
+
import { moderateScale } from '../utils/responsive';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* FluentGlassBarChart (Component)
|
|
16
|
+
* Glassmorphism bar chart with animated glass bars.
|
|
17
|
+
*
|
|
18
|
+
* Props:
|
|
19
|
+
* data - Array of { label, value, color? }
|
|
20
|
+
* title - Optional chart title
|
|
21
|
+
* height - Chart area height (default 180)
|
|
22
|
+
* showGrid - Show horizontal grid lines (default true)
|
|
23
|
+
* showValues - Show value labels on bars (default true)
|
|
24
|
+
* style - Container style override
|
|
25
|
+
* style - Container style override
|
|
26
|
+
*/
|
|
27
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
28
|
+
|
|
29
|
+
export interface BarChartData {
|
|
30
|
+
label: string;
|
|
31
|
+
value: number;
|
|
32
|
+
color?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FluentGlassBarChartProps {
|
|
36
|
+
data?: BarChartData[];
|
|
37
|
+
title?: string;
|
|
38
|
+
height?: number;
|
|
39
|
+
showGrid?: boolean;
|
|
40
|
+
showValues?: boolean;
|
|
41
|
+
style?: StyleProp<ViewStyle>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ─── Animated Glass Bar ───
|
|
45
|
+
function Bar({ value, maxValue, color, label, index, height, showValue }: { value: number, maxValue: number, color: string, label: string, index: number, height: number, showValue: boolean }) {
|
|
46
|
+
const barHeight = useSharedValue(0);
|
|
47
|
+
const targetHeight = maxValue > 0 ? (value / maxValue) * height : 0;
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
barHeight.value = withDelay(
|
|
51
|
+
index * 80,
|
|
52
|
+
withSpring(targetHeight, {
|
|
53
|
+
mass: 0.6,
|
|
54
|
+
damping: 14,
|
|
55
|
+
stiffness: 100,
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
}, [value, maxValue]);
|
|
59
|
+
|
|
60
|
+
const animatedBarStyle = useAnimatedStyle(() => ({
|
|
61
|
+
height: barHeight.value,
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
// Create glass-like rgba from the color
|
|
65
|
+
const glassBase = hexToRgba(color, 0.35);
|
|
66
|
+
const glassBorder = hexToRgba(color, 0.5);
|
|
67
|
+
const glassHighlight = hexToRgba(color, 0.6);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<View style={styles.barColumn}>
|
|
71
|
+
{/* Bar container */}
|
|
72
|
+
<View style={[styles.barTrack, { height }]}>
|
|
73
|
+
<Animated.View
|
|
74
|
+
style={[
|
|
75
|
+
styles.bar,
|
|
76
|
+
{
|
|
77
|
+
backgroundColor: glassBase,
|
|
78
|
+
borderColor: glassBorder,
|
|
79
|
+
},
|
|
80
|
+
animatedBarStyle,
|
|
81
|
+
]}
|
|
82
|
+
>
|
|
83
|
+
{/* Top highlight stripe — brighter glass edge */}
|
|
84
|
+
<View style={[styles.barHighlight, { backgroundColor: glassHighlight }]} />
|
|
85
|
+
|
|
86
|
+
{/* Inner sheen — vertical reflection */}
|
|
87
|
+
<View style={[styles.barSheen, { backgroundColor: hexToRgba(color, 0.12) }]} />
|
|
88
|
+
</Animated.View>
|
|
89
|
+
</View>
|
|
90
|
+
</View>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ─── Hex → RGBA helper ───
|
|
95
|
+
function hexToRgba(hex: string, alpha: number) {
|
|
96
|
+
const clean = hex.replace('#', '');
|
|
97
|
+
const r = parseInt(clean.substring(0, 2), 16);
|
|
98
|
+
const g = parseInt(clean.substring(2, 4), 16);
|
|
99
|
+
const b = parseInt(clean.substring(4, 6), 16);
|
|
100
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ─── Grid Lines (5 lines: 0%, 25%, 50%, 75%, 100%) ───
|
|
104
|
+
function GridLines({ height, borderSubtle }: { height: number; borderSubtle?: string }) {
|
|
105
|
+
const percentages = [0, 0.25, 0.5, 0.75, 1];
|
|
106
|
+
return (
|
|
107
|
+
<View style={[StyleSheet.absoluteFill, { height }]}>
|
|
108
|
+
{percentages.map((pct, i) => (
|
|
109
|
+
<View
|
|
110
|
+
key={i}
|
|
111
|
+
style={[
|
|
112
|
+
styles.gridLine,
|
|
113
|
+
{ bottom: pct * height, backgroundColor: borderSubtle },
|
|
114
|
+
]}
|
|
115
|
+
/>
|
|
116
|
+
))}
|
|
117
|
+
</View>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default function FluentGlassBarChart({
|
|
122
|
+
data = [],
|
|
123
|
+
title,
|
|
124
|
+
height = 180,
|
|
125
|
+
showGrid = true,
|
|
126
|
+
showValues = true,
|
|
127
|
+
style,
|
|
128
|
+
}: FluentGlassBarChartProps) {
|
|
129
|
+
const theme = useTheme();
|
|
130
|
+
const COLORS = theme.colors;
|
|
131
|
+
const typography = theme.typography;
|
|
132
|
+
|
|
133
|
+
const maxValue = Math.max(...data.map((d) => d.value), 1);
|
|
134
|
+
|
|
135
|
+
// Default colors cycle
|
|
136
|
+
const defaultColors = [
|
|
137
|
+
COLORS.accent, // Cyan
|
|
138
|
+
COLORS.positive, // Emerald
|
|
139
|
+
COLORS.purple, // Purple
|
|
140
|
+
COLORS.warning, // Amber
|
|
141
|
+
COLORS.negative, // Red
|
|
142
|
+
COLORS.secondary, // Blue
|
|
143
|
+
COLORS.pink, // Pink
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<FluentGlass
|
|
148
|
+
accessible={true}
|
|
149
|
+
accessibilityRole="summary"
|
|
150
|
+
accessibilityLabel={title ? `Bar chart: ${title}` : 'Bar chart'}
|
|
151
|
+
style={[styles.container, style]}
|
|
152
|
+
intensity={18}
|
|
153
|
+
borderRadius={16}
|
|
154
|
+
borderOpacity={0.2}
|
|
155
|
+
>
|
|
156
|
+
{/* ── Title section ── */}
|
|
157
|
+
{title && (
|
|
158
|
+
<View style={[styles.titleSection, { borderBottomColor: COLORS.borderSubtle }]}>
|
|
159
|
+
<Text style={[styles.title, { color: COLORS.textPrimary, fontFamily: typography.bold }]}>{title}</Text>
|
|
160
|
+
</View>
|
|
161
|
+
)}
|
|
162
|
+
|
|
163
|
+
{/* ── Chart section ── */}
|
|
164
|
+
<View style={styles.chartSection}>
|
|
165
|
+
{/* Values row */}
|
|
166
|
+
{showValues && (
|
|
167
|
+
<View style={styles.valuesRow}>
|
|
168
|
+
{data.map((item, index) => (
|
|
169
|
+
<Text key={index} style={[styles.barValue, { color: COLORS.textSecondary, fontFamily: typography.semiBold }]}>
|
|
170
|
+
{item.value}
|
|
171
|
+
</Text>
|
|
172
|
+
))}
|
|
173
|
+
</View>
|
|
174
|
+
)}
|
|
175
|
+
|
|
176
|
+
{/* Bars area */}
|
|
177
|
+
<View style={styles.chartArea}>
|
|
178
|
+
{showGrid && <GridLines height={height} borderSubtle={COLORS.borderSubtle} />}
|
|
179
|
+
|
|
180
|
+
<View style={[styles.barsRow, { height }]}>
|
|
181
|
+
{data.map((item, index) => (
|
|
182
|
+
<Bar
|
|
183
|
+
key={index}
|
|
184
|
+
value={item.value}
|
|
185
|
+
maxValue={maxValue}
|
|
186
|
+
color={item.color || defaultColors[index % defaultColors.length]}
|
|
187
|
+
label={item.label}
|
|
188
|
+
index={index}
|
|
189
|
+
height={height}
|
|
190
|
+
showValue={false}
|
|
191
|
+
/>
|
|
192
|
+
))}
|
|
193
|
+
</View>
|
|
194
|
+
</View>
|
|
195
|
+
|
|
196
|
+
{/* Labels row */}
|
|
197
|
+
<View style={styles.labelsRow}>
|
|
198
|
+
{data.map((item, index) => (
|
|
199
|
+
<Text key={index} style={[styles.barLabel, { color: COLORS.textSecondary, fontFamily: typography.medium }]} numberOfLines={1}>
|
|
200
|
+
{item.label}
|
|
201
|
+
</Text>
|
|
202
|
+
))}
|
|
203
|
+
</View>
|
|
204
|
+
</View>
|
|
205
|
+
</FluentGlass>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const styles = StyleSheet.create({
|
|
210
|
+
container: {},
|
|
211
|
+
// Title — own section with separator
|
|
212
|
+
titleSection: {
|
|
213
|
+
paddingHorizontal: 18,
|
|
214
|
+
paddingTop: 16,
|
|
215
|
+
paddingBottom: 14,
|
|
216
|
+
borderBottomWidth: 1,
|
|
217
|
+
},
|
|
218
|
+
title: {
|
|
219
|
+
fontSize: moderateScale(16),
|
|
220
|
+
fontWeight: '700',
|
|
221
|
+
},
|
|
222
|
+
// Chart section
|
|
223
|
+
chartSection: {
|
|
224
|
+
padding: 18,
|
|
225
|
+
},
|
|
226
|
+
valuesRow: {
|
|
227
|
+
flexDirection: 'row',
|
|
228
|
+
justifyContent: 'space-around',
|
|
229
|
+
marginBottom: 6,
|
|
230
|
+
gap: 8,
|
|
231
|
+
},
|
|
232
|
+
chartArea: {
|
|
233
|
+
position: 'relative',
|
|
234
|
+
},
|
|
235
|
+
barsRow: {
|
|
236
|
+
flexDirection: 'row',
|
|
237
|
+
alignItems: 'flex-end',
|
|
238
|
+
justifyContent: 'space-around',
|
|
239
|
+
gap: 8,
|
|
240
|
+
},
|
|
241
|
+
labelsRow: {
|
|
242
|
+
flexDirection: 'row',
|
|
243
|
+
justifyContent: 'space-around',
|
|
244
|
+
marginTop: 8,
|
|
245
|
+
gap: 8,
|
|
246
|
+
},
|
|
247
|
+
barColumn: {
|
|
248
|
+
flex: 1,
|
|
249
|
+
alignItems: 'center',
|
|
250
|
+
},
|
|
251
|
+
barTrack: {
|
|
252
|
+
width: '100%',
|
|
253
|
+
justifyContent: 'flex-end',
|
|
254
|
+
alignItems: 'center',
|
|
255
|
+
},
|
|
256
|
+
// Glass bar
|
|
257
|
+
bar: {
|
|
258
|
+
width: '72%',
|
|
259
|
+
borderRadius: 8,
|
|
260
|
+
borderTopLeftRadius: 10,
|
|
261
|
+
borderTopRightRadius: 10,
|
|
262
|
+
minHeight: 4,
|
|
263
|
+
overflow: 'hidden',
|
|
264
|
+
borderWidth: 1,
|
|
265
|
+
},
|
|
266
|
+
barHighlight: {
|
|
267
|
+
height: 3,
|
|
268
|
+
width: '100%',
|
|
269
|
+
},
|
|
270
|
+
barSheen: {
|
|
271
|
+
position: 'absolute',
|
|
272
|
+
top: 0,
|
|
273
|
+
left: '50%',
|
|
274
|
+
width: '50%',
|
|
275
|
+
height: '100%',
|
|
276
|
+
},
|
|
277
|
+
barValue: {
|
|
278
|
+
flex: 1,
|
|
279
|
+
fontSize: moderateScale(11, 0.3),
|
|
280
|
+
fontWeight: '600',
|
|
281
|
+
textAlign: 'center',
|
|
282
|
+
},
|
|
283
|
+
barLabel: {
|
|
284
|
+
flex: 1,
|
|
285
|
+
fontSize: moderateScale(11, 0.3),
|
|
286
|
+
fontWeight: '500',
|
|
287
|
+
textAlign: 'center',
|
|
288
|
+
},
|
|
289
|
+
gridLine: {
|
|
290
|
+
position: 'absolute',
|
|
291
|
+
left: 0,
|
|
292
|
+
right: 0,
|
|
293
|
+
height: 1,
|
|
294
|
+
},
|
|
295
|
+
});
|