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,138 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, Text, Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import Animated, {
|
|
5
|
+
useSharedValue,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
withSpring,
|
|
8
|
+
interpolateColor,
|
|
9
|
+
} from 'react-native-reanimated';
|
|
10
|
+
import useTheme from '../theme/useTheme';
|
|
11
|
+
|
|
12
|
+
export interface FluentGlassCheckboxProps {
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
onToggle?: (value: boolean) => void;
|
|
15
|
+
label?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
size?: number;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const CHECK_SPRING = {
|
|
22
|
+
mass: 0.4,
|
|
23
|
+
damping: 10,
|
|
24
|
+
stiffness: 200,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default function FluentGlassCheckbox({ checked = false,
|
|
28
|
+
onToggle,
|
|
29
|
+
label,
|
|
30
|
+
disabled = false,
|
|
31
|
+
size = 24,
|
|
32
|
+
style,
|
|
33
|
+
accessibilityLabel, }: FluentGlassCheckboxProps & { accessibilityLabel?: string }) {
|
|
34
|
+
const theme = useTheme();
|
|
35
|
+
const COLORS = theme.colors;
|
|
36
|
+
const typography = theme.typography;
|
|
37
|
+
|
|
38
|
+
const progress = useSharedValue(checked ? 1 : 0);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
progress.value = withSpring(checked ? 1 : 0, CHECK_SPRING);
|
|
42
|
+
}, [checked]);
|
|
43
|
+
|
|
44
|
+
// Circle background animates from transparent glass to accent
|
|
45
|
+
const circleStyle = useAnimatedStyle(() => {
|
|
46
|
+
const backgroundColor = interpolateColor(
|
|
47
|
+
progress.value,
|
|
48
|
+
[0, 1],
|
|
49
|
+
[COLORS.border, COLORS.accent]
|
|
50
|
+
);
|
|
51
|
+
const borderColor = interpolateColor(
|
|
52
|
+
progress.value,
|
|
53
|
+
[0, 1],
|
|
54
|
+
[COLORS.textSecondary, COLORS.accent]
|
|
55
|
+
);
|
|
56
|
+
return {
|
|
57
|
+
backgroundColor,
|
|
58
|
+
borderColor,
|
|
59
|
+
transform: [{ scale: 0.9 + (progress.value * 0.1) }], // subtle pop
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Checkmark scales in/out
|
|
64
|
+
const checkStyle = useAnimatedStyle(() => ({
|
|
65
|
+
opacity: progress.value,
|
|
66
|
+
transform: [{ scale: progress.value }],
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
const handlePress = () => {
|
|
70
|
+
if (!disabled && onToggle) {
|
|
71
|
+
onToggle(!checked);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const checkSize = size * 0.5; // Checkmark relative to circle
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Pressable
|
|
79
|
+
onPress={handlePress}
|
|
80
|
+
style={[styles.wrapper, disabled && styles.wrapperDisabled, style]}
|
|
81
|
+
hitSlop={6}
|
|
82
|
+
accessibilityRole="checkbox"
|
|
83
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
84
|
+
accessibilityState={{ checked: !!checked, disabled: !!disabled }}
|
|
85
|
+
>
|
|
86
|
+
{/* Circle */}
|
|
87
|
+
<Animated.View
|
|
88
|
+
style={[
|
|
89
|
+
styles.circle,
|
|
90
|
+
{ width: size, height: size, borderRadius: size / 2 },
|
|
91
|
+
circleStyle,
|
|
92
|
+
]}
|
|
93
|
+
>
|
|
94
|
+
{/* Checkmark */}
|
|
95
|
+
<Animated.Text
|
|
96
|
+
style={[
|
|
97
|
+
styles.check,
|
|
98
|
+
{ fontSize: checkSize, color: COLORS.white, fontFamily: typography.bold },
|
|
99
|
+
checkStyle,
|
|
100
|
+
]}
|
|
101
|
+
>
|
|
102
|
+
✓
|
|
103
|
+
</Animated.Text>
|
|
104
|
+
</Animated.View>
|
|
105
|
+
|
|
106
|
+
{/* Label */}
|
|
107
|
+
{label ? (
|
|
108
|
+
<Text style={[styles.label, { color: COLORS.textPrimary, fontFamily: typography.medium }, disabled && { color: COLORS.textSecondary }]}>
|
|
109
|
+
{label}
|
|
110
|
+
</Text>
|
|
111
|
+
) : null}
|
|
112
|
+
</Pressable>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
wrapper: {
|
|
118
|
+
flexDirection: 'row',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
},
|
|
121
|
+
wrapperDisabled: {
|
|
122
|
+
opacity: 0.4,
|
|
123
|
+
},
|
|
124
|
+
circle: {
|
|
125
|
+
borderWidth: 1.5,
|
|
126
|
+
alignItems: 'center',
|
|
127
|
+
justifyContent: 'center',
|
|
128
|
+
},
|
|
129
|
+
check: {
|
|
130
|
+
fontWeight: '700',
|
|
131
|
+
marginTop: -1, // Optical alignment
|
|
132
|
+
},
|
|
133
|
+
label: {
|
|
134
|
+
fontSize: 15,
|
|
135
|
+
fontWeight: '500',
|
|
136
|
+
marginLeft: 12,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View, Text, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import FluentGlass from './FluentGlass';
|
|
5
|
+
import useTheme from '../theme/useTheme';
|
|
6
|
+
import { moderateScale } from '../utils/responsive';
|
|
7
|
+
|
|
8
|
+
export interface FluentGlassClockWidgetProps {
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* FluentGlassClockWidget (Atom/Molecule)
|
|
14
|
+
* Dashboard widget displaying current time.
|
|
15
|
+
*/
|
|
16
|
+
export default function FluentGlassClockWidget({ style }: FluentGlassClockWidgetProps) {
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
const COLORS = theme.colors;
|
|
19
|
+
const typography = theme.typography;
|
|
20
|
+
|
|
21
|
+
const [time, setTime] = useState(new Date());
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const timer: ReturnType<typeof setInterval> = setInterval(() => setTime(new Date()), 60000);
|
|
25
|
+
return () => clearInterval(timer);
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const timeString = time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<FluentGlass accessible={true} accessibilityLabel={`Time: ${timeString}`} style={[styles.card, style]} intensity={25} borderRadius={20}>
|
|
32
|
+
<View style={styles.content}>
|
|
33
|
+
<Text style={[styles.label, { color: COLORS.textSecondary, fontFamily: typography.medium }]}>TIME</Text>
|
|
34
|
+
<Text style={[styles.bigValue, { color: COLORS.textPrimary, fontFamily: typography.regular }]}>{timeString}</Text>
|
|
35
|
+
</View>
|
|
36
|
+
</FluentGlass>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const styles = StyleSheet.create({
|
|
41
|
+
card: {
|
|
42
|
+
flex: 1,
|
|
43
|
+
minWidth: 100,
|
|
44
|
+
maxWidth: 140,
|
|
45
|
+
aspectRatio: 1,
|
|
46
|
+
},
|
|
47
|
+
content: {
|
|
48
|
+
flex: 1,
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
},
|
|
52
|
+
label: {
|
|
53
|
+
fontSize: 12,
|
|
54
|
+
textTransform: 'uppercase',
|
|
55
|
+
marginBottom: 4,
|
|
56
|
+
},
|
|
57
|
+
bigValue: {
|
|
58
|
+
fontSize: moderateScale(28),
|
|
59
|
+
fontWeight: '300',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { StyleSheet, Text, View, Pressable, ScrollView, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import * as Clipboard from 'expo-clipboard';
|
|
4
|
+
import FluentGlass from './FluentGlass';
|
|
5
|
+
import useTheme from '../theme/useTheme';
|
|
6
|
+
|
|
7
|
+
export interface FluentGlassCodeBlockProps {
|
|
8
|
+
code?: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
showLineNumbers?: boolean;
|
|
11
|
+
onCopy?: (code: string) => void;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface TokenColors {
|
|
16
|
+
tag: string;
|
|
17
|
+
attribute: string;
|
|
18
|
+
string: string;
|
|
19
|
+
keyword: string;
|
|
20
|
+
comment: string;
|
|
21
|
+
punctuation: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Token {
|
|
26
|
+
text: string;
|
|
27
|
+
color: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Simple regex-based tokenizer (good enough for display, not a full parser)
|
|
31
|
+
function tokenize(line: string, TOKEN_COLORS: TokenColors): Token[] {
|
|
32
|
+
const tokens = [];
|
|
33
|
+
// Pattern priority: comments, strings, tags, keywords, rest
|
|
34
|
+
const regex =
|
|
35
|
+
/(\/\/.*$|\/\*.*?\*\/)|("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')|(<\/?[\w.-]+|>|\/>)|(className|import|export|from|const|let|var|function|return|default|if|else|true|false|null|undefined)/g;
|
|
36
|
+
|
|
37
|
+
let lastIndex = 0;
|
|
38
|
+
let match;
|
|
39
|
+
|
|
40
|
+
while ((match = regex.exec(line)) !== null) {
|
|
41
|
+
// Text before the match
|
|
42
|
+
if (match.index > lastIndex) {
|
|
43
|
+
tokens.push({ text: line.slice(lastIndex, match.index), color: TOKEN_COLORS.text });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (match[1]) {
|
|
47
|
+
tokens.push({ text: match[0], color: TOKEN_COLORS.comment });
|
|
48
|
+
} else if (match[2]) {
|
|
49
|
+
tokens.push({ text: match[0], color: TOKEN_COLORS.string });
|
|
50
|
+
} else if (match[3]) {
|
|
51
|
+
tokens.push({ text: match[0], color: TOKEN_COLORS.tag });
|
|
52
|
+
} else if (match[4]) {
|
|
53
|
+
tokens.push({ text: match[0], color: TOKEN_COLORS.keyword });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
lastIndex = match.index + match[0].length;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Remaining text
|
|
60
|
+
if (lastIndex < line.length) {
|
|
61
|
+
tokens.push({ text: line.slice(lastIndex), color: TOKEN_COLORS.text });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (tokens.length === 0) {
|
|
65
|
+
tokens.push({ text: line || ' ', color: TOKEN_COLORS.text });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return tokens;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default function FluentGlassCodeBlock({ code = '',
|
|
72
|
+
language = 'CODE',
|
|
73
|
+
showLineNumbers = true,
|
|
74
|
+
onCopy,
|
|
75
|
+
style, }: FluentGlassCodeBlockProps) {
|
|
76
|
+
const theme = useTheme();
|
|
77
|
+
const colors = theme.colors;
|
|
78
|
+
|
|
79
|
+
// Basic token colors matching a dark IDE theme — uses theme colors
|
|
80
|
+
const TOKEN_COLORS = {
|
|
81
|
+
tag: '#06B6D4', // Cyan — HTML tags, JSX
|
|
82
|
+
attribute: '#94A3B8', // Slate — attribute names
|
|
83
|
+
string: '#FBBF24', // Amber — string values
|
|
84
|
+
keyword: '#C084FC', // Purple — keywords
|
|
85
|
+
comment: '#4B5563', // Gray — comments
|
|
86
|
+
punctuation: '#94A3B8',
|
|
87
|
+
text: colors.textPrimary,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const lines = code.split('\n');
|
|
91
|
+
const lineNumWidth = String(lines.length).length * 10 + 12;
|
|
92
|
+
const [copied, setCopied] = useState(false);
|
|
93
|
+
|
|
94
|
+
const handleCopy = useCallback(async () => {
|
|
95
|
+
if (onCopy) {
|
|
96
|
+
onCopy(code);
|
|
97
|
+
} else {
|
|
98
|
+
await Clipboard.setStringAsync(code);
|
|
99
|
+
}
|
|
100
|
+
setCopied(true);
|
|
101
|
+
setTimeout(() => setCopied(false), 2000);
|
|
102
|
+
}, [code, onCopy]);
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<FluentGlass
|
|
106
|
+
accessibilityLabel="Code block"
|
|
107
|
+
style={[styles.container, style]}
|
|
108
|
+
intensity={15}
|
|
109
|
+
tint="dark"
|
|
110
|
+
borderRadius={16}
|
|
111
|
+
borderOpacity={0.2}
|
|
112
|
+
>
|
|
113
|
+
<View style={styles.inner}>
|
|
114
|
+
{/* Header bar */}
|
|
115
|
+
<View style={styles.header}>
|
|
116
|
+
{/* Language badge */}
|
|
117
|
+
<View style={[styles.badge, { backgroundColor: colors.borderSubtle, borderColor: colors.border }]}>
|
|
118
|
+
<Text style={[styles.badgeText, { color: colors.textPrimary, fontFamily: theme.typography.bold }]}>
|
|
119
|
+
{language.toUpperCase()}
|
|
120
|
+
</Text>
|
|
121
|
+
</View>
|
|
122
|
+
|
|
123
|
+
{/* Action buttons */}
|
|
124
|
+
<View style={styles.actions}>
|
|
125
|
+
<Pressable
|
|
126
|
+
onPress={handleCopy}
|
|
127
|
+
hitSlop={8}
|
|
128
|
+
style={styles.actionBtn}
|
|
129
|
+
accessibilityRole="button"
|
|
130
|
+
accessibilityLabel="Copy code"
|
|
131
|
+
>
|
|
132
|
+
<Text style={styles.actionIcon}>{copied ? '✅' : '📋'}</Text>
|
|
133
|
+
</Pressable>
|
|
134
|
+
</View>
|
|
135
|
+
</View>
|
|
136
|
+
|
|
137
|
+
{/* Separator */}
|
|
138
|
+
<View style={[styles.separator, { backgroundColor: colors.borderSubtle }]} />
|
|
139
|
+
|
|
140
|
+
{/* Code area */}
|
|
141
|
+
<ScrollView
|
|
142
|
+
horizontal
|
|
143
|
+
showsHorizontalScrollIndicator={false}
|
|
144
|
+
bounces={false}
|
|
145
|
+
>
|
|
146
|
+
<View style={styles.codeArea}>
|
|
147
|
+
{lines.map((line, i) => (
|
|
148
|
+
<View key={i} style={styles.lineRow}>
|
|
149
|
+
{/* Line number */}
|
|
150
|
+
{showLineNumbers ? (
|
|
151
|
+
<Text
|
|
152
|
+
style={[
|
|
153
|
+
styles.lineNum,
|
|
154
|
+
{ width: lineNumWidth, color: colors.textSecondary },
|
|
155
|
+
]}
|
|
156
|
+
>
|
|
157
|
+
{i + 1}
|
|
158
|
+
</Text>
|
|
159
|
+
) : null}
|
|
160
|
+
|
|
161
|
+
{/* Tokenized code */}
|
|
162
|
+
<Text style={[styles.codeLine, { color: colors.textPrimary }]}>
|
|
163
|
+
{tokenize(line, TOKEN_COLORS).map((token, j) => (
|
|
164
|
+
<Text
|
|
165
|
+
key={j}
|
|
166
|
+
style={{ color: token.color }}
|
|
167
|
+
>
|
|
168
|
+
{token.text}
|
|
169
|
+
</Text>
|
|
170
|
+
))}
|
|
171
|
+
</Text>
|
|
172
|
+
</View>
|
|
173
|
+
))}
|
|
174
|
+
</View>
|
|
175
|
+
</ScrollView>
|
|
176
|
+
</View>
|
|
177
|
+
</FluentGlass>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const styles = StyleSheet.create({
|
|
182
|
+
container: {
|
|
183
|
+
overflow: 'hidden',
|
|
184
|
+
},
|
|
185
|
+
inner: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
},
|
|
188
|
+
header: {
|
|
189
|
+
flexDirection: 'row',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'space-between',
|
|
192
|
+
paddingHorizontal: 12,
|
|
193
|
+
paddingTop: 10,
|
|
194
|
+
paddingBottom: 8,
|
|
195
|
+
},
|
|
196
|
+
badge: {
|
|
197
|
+
borderRadius: 6,
|
|
198
|
+
paddingHorizontal: 10,
|
|
199
|
+
paddingVertical: 4,
|
|
200
|
+
borderWidth: 1,
|
|
201
|
+
},
|
|
202
|
+
badgeText: {
|
|
203
|
+
fontSize: 11,
|
|
204
|
+
fontWeight: '700',
|
|
205
|
+
letterSpacing: 0.5,
|
|
206
|
+
},
|
|
207
|
+
actions: {
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
gap: 8,
|
|
210
|
+
},
|
|
211
|
+
actionBtn: {
|
|
212
|
+
padding: 4,
|
|
213
|
+
},
|
|
214
|
+
actionIcon: {
|
|
215
|
+
fontSize: 16,
|
|
216
|
+
},
|
|
217
|
+
separator: {
|
|
218
|
+
height: 1,
|
|
219
|
+
marginHorizontal: 0,
|
|
220
|
+
},
|
|
221
|
+
codeArea: {
|
|
222
|
+
paddingVertical: 12,
|
|
223
|
+
paddingRight: 16,
|
|
224
|
+
},
|
|
225
|
+
lineRow: {
|
|
226
|
+
flexDirection: 'row',
|
|
227
|
+
minHeight: 22,
|
|
228
|
+
},
|
|
229
|
+
lineNum: {
|
|
230
|
+
fontSize: 13,
|
|
231
|
+
fontFamily: 'monospace',
|
|
232
|
+
textAlign: 'right',
|
|
233
|
+
marginRight: 16,
|
|
234
|
+
paddingLeft: 12,
|
|
235
|
+
},
|
|
236
|
+
codeLine: {
|
|
237
|
+
fontSize: 13,
|
|
238
|
+
fontFamily: 'monospace',
|
|
239
|
+
flex: 1,
|
|
240
|
+
},
|
|
241
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import useTheme from '../theme/useTheme';
|
|
4
|
+
import { resolveColorScheme, resolveRadius, resolveBackwardCompat } from '../theme/resolvers';
|
|
5
|
+
import { FluentGlassColorScheme, FluentGlassRadius } from '../types/components';
|
|
6
|
+
|
|
7
|
+
export interface FluentGlassContainerProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
colorScheme?: FluentGlassColorScheme | string;
|
|
10
|
+
radius?: FluentGlassRadius | string;
|
|
11
|
+
/** @deprecated Use colorScheme instead */
|
|
12
|
+
tint?: string;
|
|
13
|
+
padding?: number;
|
|
14
|
+
/** @deprecated Use radius instead */
|
|
15
|
+
borderRadius?: number;
|
|
16
|
+
borderOpacity?: number;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* FluentGlassContainer (Atom)
|
|
22
|
+
* Section-level glass wrapper for layout depth.
|
|
23
|
+
* Uses plain View (no BlurView) to avoid nested-blur artifacts.
|
|
24
|
+
*/
|
|
25
|
+
export default function FluentGlassContainer({ children,
|
|
26
|
+
colorScheme,
|
|
27
|
+
radius,
|
|
28
|
+
tint = 'light',
|
|
29
|
+
padding = 16,
|
|
30
|
+
borderRadius,
|
|
31
|
+
borderOpacity = 0.15,
|
|
32
|
+
style, }: FluentGlassContainerProps) {
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
|
|
35
|
+
const compat = resolveBackwardCompat({ tint, colorScheme });
|
|
36
|
+
const resolvedScheme = compat.colorScheme || 'light';
|
|
37
|
+
const colorConfig = resolveColorScheme(theme, resolvedScheme);
|
|
38
|
+
const resolvedRadius = borderRadius ?? resolveRadius(theme, radius || 'lg');
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<View
|
|
42
|
+
style={[
|
|
43
|
+
styles.container,
|
|
44
|
+
{
|
|
45
|
+
padding,
|
|
46
|
+
borderRadius: resolvedRadius,
|
|
47
|
+
backgroundColor: colorConfig.bg,
|
|
48
|
+
borderColor: colorConfig.border || theme.colors.border,
|
|
49
|
+
},
|
|
50
|
+
style,
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const styles = StyleSheet.create({
|
|
59
|
+
container: {
|
|
60
|
+
minHeight: 40,
|
|
61
|
+
borderWidth: 1,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import Animated, {
|
|
4
|
+
useSharedValue,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
withTiming,
|
|
7
|
+
withSpring,
|
|
8
|
+
runOnJS,
|
|
9
|
+
Easing,
|
|
10
|
+
} from 'react-native-reanimated';
|
|
11
|
+
import useTheme from '../theme/useTheme';
|
|
12
|
+
|
|
13
|
+
export interface FluentGlassCrossfadeProps {
|
|
14
|
+
activeKey: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
fadeOutDuration?: number;
|
|
17
|
+
fadeInDuration?: number;
|
|
18
|
+
translateY?: number;
|
|
19
|
+
style?: StyleProp<ViewStyle>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* FluentGlassCrossfade
|
|
24
|
+
*
|
|
25
|
+
* Universal animated content switcher. Crossfades between children
|
|
26
|
+
* with a fade + translateY spring animation.
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* <FluentGlassCrossfade activeKey="home">
|
|
30
|
+
* <HomeScreen key="home" />
|
|
31
|
+
* <SettingsScreen key="settings" />
|
|
32
|
+
* </FluentGlassCrossfade>
|
|
33
|
+
*/
|
|
34
|
+
export default function FluentGlassCrossfade({
|
|
35
|
+
activeKey,
|
|
36
|
+
children,
|
|
37
|
+
fadeOutDuration,
|
|
38
|
+
fadeInDuration,
|
|
39
|
+
translateY: translateYAmount,
|
|
40
|
+
style,
|
|
41
|
+
}: FluentGlassCrossfadeProps) {
|
|
42
|
+
const theme = useTheme();
|
|
43
|
+
const crossfadeConfig = theme.animations?.crossfade || {};
|
|
44
|
+
const springConfig = theme.animations?.spring?.snappy || { mass: 0.4, damping: 14, stiffness: 160 };
|
|
45
|
+
|
|
46
|
+
// Merge props with theme defaults
|
|
47
|
+
const outDuration = fadeOutDuration ?? crossfadeConfig.fadeOutDuration ?? 120;
|
|
48
|
+
const inDuration = fadeInDuration ?? crossfadeConfig.fadeInDuration ?? 200;
|
|
49
|
+
const shiftY = translateYAmount ?? crossfadeConfig.translateY ?? 6;
|
|
50
|
+
|
|
51
|
+
const [currentKey, setCurrentKey] = useState(activeKey);
|
|
52
|
+
const [containerHeight, setContainerHeight] = useState(0);
|
|
53
|
+
const isTransitioning = useRef(false);
|
|
54
|
+
|
|
55
|
+
const opacity = useSharedValue(1);
|
|
56
|
+
const translateY = useSharedValue(0);
|
|
57
|
+
|
|
58
|
+
const commitSwitch = useCallback((newKey: string) => {
|
|
59
|
+
setCurrentKey(newKey);
|
|
60
|
+
isTransitioning.current = false;
|
|
61
|
+
// Delay fade-in to next frame so React commit doesn't block animation
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
opacity.value = withTiming(1, { duration: inDuration, easing: Easing.out(Easing.quad) });
|
|
64
|
+
translateY.value = withSpring(0, springConfig);
|
|
65
|
+
});
|
|
66
|
+
}, [inDuration, springConfig]);
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (activeKey !== currentKey && !isTransitioning.current) {
|
|
70
|
+
isTransitioning.current = true;
|
|
71
|
+
|
|
72
|
+
// Fade out
|
|
73
|
+
opacity.value = withTiming(0, {
|
|
74
|
+
duration: outDuration,
|
|
75
|
+
easing: Easing.in(Easing.quad),
|
|
76
|
+
}, (finished) => {
|
|
77
|
+
if (finished) {
|
|
78
|
+
runOnJS(commitSwitch)(activeKey);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
translateY.value = withTiming(shiftY, { duration: outDuration });
|
|
82
|
+
}
|
|
83
|
+
}, [activeKey]);
|
|
84
|
+
|
|
85
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
86
|
+
opacity: opacity.value,
|
|
87
|
+
transform: [{ translateY: translateY.value }],
|
|
88
|
+
}));
|
|
89
|
+
|
|
90
|
+
// Find active child by key
|
|
91
|
+
// React.Children.toArray prefixes keys with ".$/", ".$", or "."
|
|
92
|
+
// We strip all prefixes to compare raw keys
|
|
93
|
+
const childArray = React.Children.toArray(children) as React.ReactElement[];
|
|
94
|
+
const stripKeyPrefix = (key: string | null) => key?.replace(/^\.\$/, '').replace(/^\./, '');
|
|
95
|
+
const activeChild = childArray.find(child => stripKeyPrefix(child.key) === String(currentKey))
|
|
96
|
+
|| childArray[0];
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<View style={[styles.container, containerHeight > 0 && { minHeight: containerHeight }, style]}>
|
|
100
|
+
<Animated.View
|
|
101
|
+
style={[styles.content, animatedStyle]}
|
|
102
|
+
onLayout={(e) => {
|
|
103
|
+
const h = e.nativeEvent.layout.height;
|
|
104
|
+
if (h > containerHeight) setContainerHeight(h);
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{activeChild}
|
|
108
|
+
</Animated.View>
|
|
109
|
+
</View>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const styles = StyleSheet.create({
|
|
114
|
+
container: {
|
|
115
|
+
width: '100%',
|
|
116
|
+
flex: 1,
|
|
117
|
+
},
|
|
118
|
+
content: {
|
|
119
|
+
width: '100%',
|
|
120
|
+
flex: 1,
|
|
121
|
+
},
|
|
122
|
+
});
|