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,349 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View, Text, TouchableOpacity, ScrollView, Platform, Pressable } from 'react-native';
|
|
3
|
+
import Animated, {
|
|
4
|
+
useSharedValue,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
withSpring,
|
|
7
|
+
interpolate,
|
|
8
|
+
} from 'react-native-reanimated';
|
|
9
|
+
import FluentGlass from './FluentGlass';
|
|
10
|
+
import useTheme from '../theme/useTheme';
|
|
11
|
+
import useBreakpoint from '../hooks/useBreakpoint';
|
|
12
|
+
|
|
13
|
+
const NAV_ITEM_HEIGHT = 48;
|
|
14
|
+
const NAV_ITEM_GAP = 4;
|
|
15
|
+
|
|
16
|
+
/** Defaults exported for consumers to calculate marginLeft etc. */
|
|
17
|
+
export const SIDEBAR_DEFAULTS = {
|
|
18
|
+
width: 260,
|
|
19
|
+
margin: 16,
|
|
20
|
+
navItemHeight: NAV_ITEM_HEIGHT,
|
|
21
|
+
navItemGap: NAV_ITEM_GAP,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* FluentGlassSidebar
|
|
26
|
+
*
|
|
27
|
+
* Floating glass sidebar with animated slide, vertical nav indicator,
|
|
28
|
+
* and hamburger toggle. Responsive: floating on desktop, overlay on mobile.
|
|
29
|
+
*
|
|
30
|
+
* Usage:
|
|
31
|
+
* <FluentGlassSidebar
|
|
32
|
+
* routes={[{ id: 'home', label: 'Home', icon: '🏠' }]}
|
|
33
|
+
* activeRoute="home"
|
|
34
|
+
* onNavigate={setRoute}
|
|
35
|
+
* open={open}
|
|
36
|
+
* onToggle={toggle}
|
|
37
|
+
* />
|
|
38
|
+
*/
|
|
39
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
40
|
+
import { FluentGlassBaseProps } from '../types/components';
|
|
41
|
+
|
|
42
|
+
export interface SidebarRoute {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
icon?: string | React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface FluentGlassSidebarProps extends FluentGlassBaseProps {
|
|
49
|
+
routes?: SidebarRoute[];
|
|
50
|
+
activeRoute?: string;
|
|
51
|
+
onNavigate?: (id: string) => void;
|
|
52
|
+
open?: boolean;
|
|
53
|
+
onToggle?: () => void;
|
|
54
|
+
header?: React.ReactNode;
|
|
55
|
+
navHeader?: string;
|
|
56
|
+
width?: number;
|
|
57
|
+
margin?: number;
|
|
58
|
+
style?: StyleProp<ViewStyle>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default function FluentGlassSidebar({
|
|
62
|
+
routes = [],
|
|
63
|
+
activeRoute,
|
|
64
|
+
onNavigate,
|
|
65
|
+
open = true,
|
|
66
|
+
onToggle,
|
|
67
|
+
header,
|
|
68
|
+
navHeader,
|
|
69
|
+
width = SIDEBAR_DEFAULTS.width,
|
|
70
|
+
margin = SIDEBAR_DEFAULTS.margin,
|
|
71
|
+
colorScheme = 'default',
|
|
72
|
+
blur = 'medium',
|
|
73
|
+
radius = 'lg',
|
|
74
|
+
style,
|
|
75
|
+
}: FluentGlassSidebarProps) {
|
|
76
|
+
// Optional background and borders mapping
|
|
77
|
+
// We want the modal surface to feel like 'deep' glass by default,
|
|
78
|
+
// but users can specify 'light' or other schemas via the `colorScheme`
|
|
79
|
+
const theme = useTheme();
|
|
80
|
+
const { colors, typography } = theme;
|
|
81
|
+
const { isMobile } = useBreakpoint();
|
|
82
|
+
|
|
83
|
+
// Spring configs from theme
|
|
84
|
+
const sidebarSpring = theme.animations?.springs?.default || { mass: 0.6, damping: 16, stiffness: 140 };
|
|
85
|
+
const navSpring = theme.animations?.springs?.bouncy || { mass: 0.5, damping: 15, stiffness: 160 };
|
|
86
|
+
|
|
87
|
+
// Slide animation
|
|
88
|
+
const progress = useSharedValue(open ? 1 : 0);
|
|
89
|
+
React.useEffect(() => {
|
|
90
|
+
progress.value = withSpring(open ? 1 : 0, sidebarSpring);
|
|
91
|
+
}, [open]);
|
|
92
|
+
|
|
93
|
+
// Nav indicator
|
|
94
|
+
const activeIndex = routes.findIndex(r => r.id === activeRoute);
|
|
95
|
+
const navIndicatorY = useSharedValue(Math.max(0, activeIndex) * (NAV_ITEM_HEIGHT + NAV_ITEM_GAP));
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
if (activeIndex >= 0) {
|
|
98
|
+
navIndicatorY.value = withSpring(activeIndex * (NAV_ITEM_HEIGHT + NAV_ITEM_GAP), navSpring);
|
|
99
|
+
}
|
|
100
|
+
}, [activeIndex]);
|
|
101
|
+
|
|
102
|
+
// Animated styles
|
|
103
|
+
const sidebarAnimStyle = useAnimatedStyle(() => ({
|
|
104
|
+
transform: [
|
|
105
|
+
{ translateX: interpolate(progress.value, [0, 1], [-(width + margin * 2), 0]) },
|
|
106
|
+
],
|
|
107
|
+
opacity: interpolate(progress.value, [0, 0.3, 1], [0, 1, 1]),
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const navIndicatorStyle = useAnimatedStyle(() => ({
|
|
111
|
+
transform: [{ translateY: navIndicatorY.value }],
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
const backdropAnimStyle = useAnimatedStyle(() => ({
|
|
115
|
+
opacity: progress.value,
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<>
|
|
120
|
+
{/* Floating hamburger when sidebar is closed (desktop only) */}
|
|
121
|
+
{!isMobile && !open && (
|
|
122
|
+
<Pressable onPress={onToggle} style={[styles.floatingHamburger, { top: margin, left: margin, backgroundColor: `${colors.background}99`, borderColor: colors.border, shadowColor: colors.shadow }]} accessibilityRole="button" accessibilityLabel="Open navigation menu">
|
|
123
|
+
<Text style={[styles.floatingHamburgerText, { color: colors.textPrimary }]}>☰</Text>
|
|
124
|
+
</Pressable>
|
|
125
|
+
)}
|
|
126
|
+
|
|
127
|
+
{/* Mobile Backdrop */}
|
|
128
|
+
{isMobile && (
|
|
129
|
+
<Animated.View
|
|
130
|
+
style={[
|
|
131
|
+
{
|
|
132
|
+
position: 'absolute',
|
|
133
|
+
top: -margin,
|
|
134
|
+
bottom: -margin,
|
|
135
|
+
left: -margin,
|
|
136
|
+
right: -margin,
|
|
137
|
+
backgroundColor: colors.overlay,
|
|
138
|
+
zIndex: 5
|
|
139
|
+
},
|
|
140
|
+
backdropAnimStyle,
|
|
141
|
+
]}
|
|
142
|
+
pointerEvents={open ? 'auto' : 'none'}
|
|
143
|
+
>
|
|
144
|
+
<Pressable style={StyleSheet.absoluteFill} onPress={onToggle} accessibilityRole="button" accessibilityLabel="Close navigation menu" />
|
|
145
|
+
</Animated.View>
|
|
146
|
+
)}
|
|
147
|
+
|
|
148
|
+
{/* Sidebar */}
|
|
149
|
+
<Animated.View
|
|
150
|
+
style={[
|
|
151
|
+
styles.sidebarOuter,
|
|
152
|
+
{ top: margin, left: margin, bottom: margin, width },
|
|
153
|
+
isMobile && styles.sidebarOuterMobile,
|
|
154
|
+
sidebarAnimStyle,
|
|
155
|
+
style,
|
|
156
|
+
]}
|
|
157
|
+
>
|
|
158
|
+
<View style={[
|
|
159
|
+
styles.sidebarGlass,
|
|
160
|
+
{ backgroundColor: `${colors.background}8C`, borderColor: colors.border, shadowColor: colors.shadow }
|
|
161
|
+
]}>
|
|
162
|
+
{/* Header */}
|
|
163
|
+
<View style={[styles.sidebarHeader, { borderBottomColor: `${colors.textPrimary}1A` }]}>
|
|
164
|
+
<View style={{ flex: 1 }}>
|
|
165
|
+
{header}
|
|
166
|
+
</View>
|
|
167
|
+
{!isMobile && (
|
|
168
|
+
<Pressable onPress={onToggle} style={[styles.hamburgerBtn, { backgroundColor: `${colors.textPrimary}1A`, borderColor: colors.border }]} accessibilityRole="button" accessibilityLabel="Close navigation menu">
|
|
169
|
+
<Text style={[styles.hamburgerBtnText, { color: colors.textSecondary }]}>✕</Text>
|
|
170
|
+
</Pressable>
|
|
171
|
+
)}
|
|
172
|
+
</View>
|
|
173
|
+
|
|
174
|
+
{/* Navigation */}
|
|
175
|
+
<ScrollView style={styles.navContainer} showsVerticalScrollIndicator={false}>
|
|
176
|
+
{navHeader && (
|
|
177
|
+
<Text style={[styles.navHeaderText, { color: colors.textSecondary, fontFamily: typography.bold }]}>{navHeader}</Text>
|
|
178
|
+
)}
|
|
179
|
+
<View style={styles.navList}>
|
|
180
|
+
{/* Sliding indicator */}
|
|
181
|
+
<Animated.View
|
|
182
|
+
style={[
|
|
183
|
+
styles.navIndicator,
|
|
184
|
+
navIndicatorStyle,
|
|
185
|
+
{
|
|
186
|
+
backgroundColor: colors.accent + '12',
|
|
187
|
+
borderColor: colors.accent + '30',
|
|
188
|
+
},
|
|
189
|
+
]}
|
|
190
|
+
/>
|
|
191
|
+
|
|
192
|
+
{routes.map((route) => {
|
|
193
|
+
const isActive = activeRoute === route.id;
|
|
194
|
+
return (
|
|
195
|
+
<TouchableOpacity
|
|
196
|
+
key={route.id}
|
|
197
|
+
style={styles.navItem}
|
|
198
|
+
onPress={() => onNavigate?.(route.id)}
|
|
199
|
+
activeOpacity={0.7}
|
|
200
|
+
accessibilityRole="menuitem"
|
|
201
|
+
accessibilityLabel={route.label}
|
|
202
|
+
accessibilityState={{ selected: isActive }}
|
|
203
|
+
>
|
|
204
|
+
{route.icon && (
|
|
205
|
+
<Text style={[styles.navIcon, isActive && { color: colors.textPrimary, opacity: 1 }]}>
|
|
206
|
+
{route.icon}
|
|
207
|
+
</Text>
|
|
208
|
+
)}
|
|
209
|
+
<Text
|
|
210
|
+
style={[
|
|
211
|
+
styles.navText,
|
|
212
|
+
{ color: colors.textSecondary, fontFamily: typography.medium },
|
|
213
|
+
isActive && { color: colors.textPrimary, fontFamily: typography.semiBold },
|
|
214
|
+
]}
|
|
215
|
+
>
|
|
216
|
+
{route.label}
|
|
217
|
+
</Text>
|
|
218
|
+
</TouchableOpacity>
|
|
219
|
+
);
|
|
220
|
+
})}
|
|
221
|
+
</View>
|
|
222
|
+
</ScrollView>
|
|
223
|
+
</View>
|
|
224
|
+
</Animated.View>
|
|
225
|
+
</>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const styles = StyleSheet.create({
|
|
230
|
+
// Floating outer (positioning)
|
|
231
|
+
sidebarOuter: {
|
|
232
|
+
position: 'absolute',
|
|
233
|
+
zIndex: 50,
|
|
234
|
+
},
|
|
235
|
+
sidebarOuterMobile: {
|
|
236
|
+
zIndex: 10,
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
// Glass container
|
|
240
|
+
sidebarGlass: {
|
|
241
|
+
flex: 1,
|
|
242
|
+
borderRadius: 20,
|
|
243
|
+
borderWidth: 1,
|
|
244
|
+
overflow: 'hidden',
|
|
245
|
+
...Platform.select({
|
|
246
|
+
web: {
|
|
247
|
+
backdropFilter: 'blur(24px)',
|
|
248
|
+
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05)',
|
|
249
|
+
},
|
|
250
|
+
default: {
|
|
251
|
+
shadowOffset: { width: 0, height: 8 },
|
|
252
|
+
shadowOpacity: 0.4,
|
|
253
|
+
shadowRadius: 32,
|
|
254
|
+
elevation: 24,
|
|
255
|
+
},
|
|
256
|
+
}),
|
|
257
|
+
},
|
|
258
|
+
// Header
|
|
259
|
+
sidebarHeader: {
|
|
260
|
+
flexDirection: 'row',
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
paddingHorizontal: 20,
|
|
263
|
+
paddingTop: Platform.OS === 'web' ? 24 : 44,
|
|
264
|
+
paddingBottom: 20,
|
|
265
|
+
borderBottomWidth: 1,
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
// Hamburger inside sidebar
|
|
269
|
+
hamburgerBtn: {
|
|
270
|
+
width: 36,
|
|
271
|
+
height: 36,
|
|
272
|
+
justifyContent: 'center',
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
borderRadius: 10,
|
|
275
|
+
borderWidth: 1,
|
|
276
|
+
},
|
|
277
|
+
hamburgerBtnText: {
|
|
278
|
+
fontSize: 16,
|
|
279
|
+
lineHeight: 18,
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
// Floating hamburger (when closed)
|
|
283
|
+
floatingHamburger: {
|
|
284
|
+
position: 'absolute',
|
|
285
|
+
zIndex: 60,
|
|
286
|
+
width: 44,
|
|
287
|
+
height: 44,
|
|
288
|
+
borderRadius: 14,
|
|
289
|
+
borderWidth: 1,
|
|
290
|
+
justifyContent: 'center',
|
|
291
|
+
alignItems: 'center',
|
|
292
|
+
...Platform.select({
|
|
293
|
+
web: {
|
|
294
|
+
backdropFilter: 'blur(16px)',
|
|
295
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.3)',
|
|
296
|
+
},
|
|
297
|
+
default: {
|
|
298
|
+
shadowOffset: { width: 0, height: 4 },
|
|
299
|
+
shadowOpacity: 0.3,
|
|
300
|
+
shadowRadius: 16,
|
|
301
|
+
elevation: 16,
|
|
302
|
+
},
|
|
303
|
+
}),
|
|
304
|
+
},
|
|
305
|
+
floatingHamburgerText: {
|
|
306
|
+
fontSize: 20,
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
// Nav
|
|
310
|
+
navContainer: {
|
|
311
|
+
flex: 1,
|
|
312
|
+
paddingTop: 16,
|
|
313
|
+
},
|
|
314
|
+
navHeaderText: {
|
|
315
|
+
fontSize: 11,
|
|
316
|
+
letterSpacing: 1.5,
|
|
317
|
+
paddingHorizontal: 20,
|
|
318
|
+
marginBottom: 12,
|
|
319
|
+
},
|
|
320
|
+
navList: {
|
|
321
|
+
position: 'relative',
|
|
322
|
+
},
|
|
323
|
+
navIndicator: {
|
|
324
|
+
position: 'absolute',
|
|
325
|
+
top: 0,
|
|
326
|
+
left: 10,
|
|
327
|
+
right: 10,
|
|
328
|
+
height: NAV_ITEM_HEIGHT,
|
|
329
|
+
borderRadius: 12,
|
|
330
|
+
borderWidth: 1,
|
|
331
|
+
},
|
|
332
|
+
navItem: {
|
|
333
|
+
flexDirection: 'row',
|
|
334
|
+
alignItems: 'center',
|
|
335
|
+
height: NAV_ITEM_HEIGHT,
|
|
336
|
+
paddingHorizontal: 20,
|
|
337
|
+
marginHorizontal: 10,
|
|
338
|
+
marginBottom: NAV_ITEM_GAP,
|
|
339
|
+
borderRadius: 12,
|
|
340
|
+
},
|
|
341
|
+
navIcon: {
|
|
342
|
+
fontSize: 16,
|
|
343
|
+
marginRight: 12,
|
|
344
|
+
opacity: 0.7,
|
|
345
|
+
},
|
|
346
|
+
navText: {
|
|
347
|
+
fontSize: 15,
|
|
348
|
+
},
|
|
349
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import FluentGlass from './FluentGlass';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FluentGlassSimpleCard (Component)
|
|
7
|
+
* Standard container for content.
|
|
8
|
+
* Wraps FluentGlass with standard padding and structure.
|
|
9
|
+
*/
|
|
10
|
+
import { ViewStyle, StyleProp, ViewProps } from 'react-native';
|
|
11
|
+
import { FluentGlassBaseProps } from '../types/components';
|
|
12
|
+
|
|
13
|
+
export interface FluentGlassSimpleCardProps extends FluentGlassBaseProps, ViewProps {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
17
|
+
intensity?: number;
|
|
18
|
+
tint?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function FluentGlassSimpleCard({
|
|
22
|
+
children,
|
|
23
|
+
style,
|
|
24
|
+
contentStyle,
|
|
25
|
+
size,
|
|
26
|
+
colorScheme,
|
|
27
|
+
blur,
|
|
28
|
+
radius,
|
|
29
|
+
intensity, // legacy
|
|
30
|
+
tint, // legacy
|
|
31
|
+
...props
|
|
32
|
+
}: FluentGlassSimpleCardProps) {
|
|
33
|
+
return (
|
|
34
|
+
<FluentGlass
|
|
35
|
+
style={[styles.container, style]}
|
|
36
|
+
size={size}
|
|
37
|
+
colorScheme={colorScheme}
|
|
38
|
+
blur={blur}
|
|
39
|
+
radius={radius}
|
|
40
|
+
intensity={intensity}
|
|
41
|
+
tint={tint}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
<View style={[styles.content, contentStyle]}>
|
|
45
|
+
{children}
|
|
46
|
+
</View>
|
|
47
|
+
</FluentGlass>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
container: {
|
|
53
|
+
width: '100%',
|
|
54
|
+
marginVertical: 8,
|
|
55
|
+
},
|
|
56
|
+
content: {
|
|
57
|
+
padding: 16,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { DimensionValue, StyleSheet, View, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import Animated, {
|
|
4
|
+
useSharedValue,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
withRepeat,
|
|
7
|
+
withTiming,
|
|
8
|
+
withSequence,
|
|
9
|
+
} from 'react-native-reanimated';
|
|
10
|
+
import useTheme from '../theme/useTheme';
|
|
11
|
+
|
|
12
|
+
export interface FluentGlassSkeletonProps {
|
|
13
|
+
width?: number | string;
|
|
14
|
+
height?: number | string;
|
|
15
|
+
borderRadius?: number;
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* FluentGlassSkeleton (Component)
|
|
21
|
+
* Loading placeholder with a pulsing opacity animation.
|
|
22
|
+
*/
|
|
23
|
+
export default function FluentGlassSkeleton({ width,
|
|
24
|
+
height,
|
|
25
|
+
borderRadius = 8,
|
|
26
|
+
style, }: FluentGlassSkeletonProps) {
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
const COLORS = theme.colors;
|
|
29
|
+
|
|
30
|
+
const opacity = useSharedValue(0.3);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
opacity.value = withRepeat(
|
|
34
|
+
withSequence(
|
|
35
|
+
withTiming(0.6, { duration: 1000 }),
|
|
36
|
+
withTiming(0.3, { duration: 1000 })
|
|
37
|
+
),
|
|
38
|
+
-1,
|
|
39
|
+
true
|
|
40
|
+
);
|
|
41
|
+
}, []);
|
|
42
|
+
|
|
43
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
44
|
+
opacity: opacity.value,
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Animated.View
|
|
49
|
+
accessible={false}
|
|
50
|
+
style={[
|
|
51
|
+
styles.container,
|
|
52
|
+
{
|
|
53
|
+
width: width as DimensionValue,
|
|
54
|
+
height: height as DimensionValue,
|
|
55
|
+
borderRadius,
|
|
56
|
+
backgroundColor: COLORS.border,
|
|
57
|
+
},
|
|
58
|
+
animatedStyle,
|
|
59
|
+
style,
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const styles = StyleSheet.create({
|
|
66
|
+
container: {
|
|
67
|
+
// backgroundColor applied inline from useTheme()
|
|
68
|
+
},
|
|
69
|
+
});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import { LayoutChangeEvent, StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
|
+
import { FluentGlassBaseProps } from '../types/components';
|
|
4
|
+
import Animated, {
|
|
5
|
+
useSharedValue,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
runOnJS,
|
|
8
|
+
withTiming,
|
|
9
|
+
} from 'react-native-reanimated';
|
|
10
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
11
|
+
import useTheme from '../theme/useTheme';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* FluentGlassSlider (Molecule)
|
|
15
|
+
* Glassmorphism slider — fully driven by SharedValues for buttery drag.
|
|
16
|
+
*
|
|
17
|
+
* Variants:
|
|
18
|
+
* - basic: Just the track + thumb
|
|
19
|
+
* - labeled: Label on left, value display on right, track below
|
|
20
|
+
*/
|
|
21
|
+
export interface FluentGlassSliderProps extends FluentGlassBaseProps {
|
|
22
|
+
/** Current value of the slider. */
|
|
23
|
+
value?: number;
|
|
24
|
+
/** Callback fired when the user changes the value. */
|
|
25
|
+
onValueChange?: (value: number) => void;
|
|
26
|
+
/** Minimum value. */
|
|
27
|
+
min?: number;
|
|
28
|
+
/** Maximum value. */
|
|
29
|
+
max?: number;
|
|
30
|
+
/** Label text displayed above the track. */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** Whether to show the formatted value next to the label. */
|
|
33
|
+
showValue?: boolean;
|
|
34
|
+
/** Custom value formatter. */
|
|
35
|
+
formatValue?: (value: number) => string;
|
|
36
|
+
/** Additional styles for the wrapper. */
|
|
37
|
+
style?: ViewStyle;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const TRACK_HEIGHT = 6;
|
|
41
|
+
const THUMB_SIZE = 22;
|
|
42
|
+
|
|
43
|
+
export default function FluentGlassSlider({ value = 50,
|
|
44
|
+
onValueChange,
|
|
45
|
+
min = 0,
|
|
46
|
+
max = 100,
|
|
47
|
+
label,
|
|
48
|
+
showValue,
|
|
49
|
+
formatValue,
|
|
50
|
+
style,
|
|
51
|
+
accessibilityLabel, }: FluentGlassSliderProps) {
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
const COLORS = theme.colors;
|
|
54
|
+
|
|
55
|
+
const hasLabel = Boolean(label);
|
|
56
|
+
const shouldShowValue = showValue !== undefined ? showValue : hasLabel;
|
|
57
|
+
|
|
58
|
+
// SharedValues drive the UI on the native thread — no JS round-trips
|
|
59
|
+
const progress = useSharedValue((value - min) / (max - min));
|
|
60
|
+
const trackW = useSharedValue(0);
|
|
61
|
+
const startProgress = useSharedValue(0);
|
|
62
|
+
|
|
63
|
+
// Sync external value changes (e.g. programmatic updates)
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
progress.value = Math.max(0, Math.min(1, (value - min) / (max - min)));
|
|
66
|
+
}, [value, min, max, progress]);
|
|
67
|
+
|
|
68
|
+
const emitValue = useCallback((ratio: number) => {
|
|
69
|
+
if (onValueChange) {
|
|
70
|
+
const clamped = Math.max(0, Math.min(1, ratio));
|
|
71
|
+
onValueChange(Math.round(min + clamped * (max - min)));
|
|
72
|
+
}
|
|
73
|
+
}, [onValueChange, min, max]);
|
|
74
|
+
|
|
75
|
+
const panGesture = Gesture.Pan()
|
|
76
|
+
.onBegin(() => {
|
|
77
|
+
startProgress.value = progress.value;
|
|
78
|
+
})
|
|
79
|
+
.onUpdate((e) => {
|
|
80
|
+
'worklet';
|
|
81
|
+
if (trackW.value > 0) {
|
|
82
|
+
const delta = e.translationX / trackW.value;
|
|
83
|
+
const next = Math.max(0, Math.min(1, startProgress.value + delta));
|
|
84
|
+
progress.value = next;
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.onEnd(() => {
|
|
88
|
+
'worklet';
|
|
89
|
+
runOnJS(emitValue)(progress.value);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Tap on track to jump
|
|
93
|
+
const tapGesture = Gesture.Tap()
|
|
94
|
+
.onEnd((e) => {
|
|
95
|
+
'worklet';
|
|
96
|
+
if (trackW.value > 0) {
|
|
97
|
+
const next = Math.max(0, Math.min(1, e.x / trackW.value));
|
|
98
|
+
progress.value = withTiming(next, { duration: 150 });
|
|
99
|
+
runOnJS(emitValue)(next);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const composed = Gesture.Race(panGesture, tapGesture);
|
|
104
|
+
|
|
105
|
+
// Animated styles — run entirely on the UI thread
|
|
106
|
+
const thumbAnimStyle = useAnimatedStyle(() => ({
|
|
107
|
+
transform: [{ translateX: progress.value * trackW.value - THUMB_SIZE / 2 }],
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const filledAnimStyle = useAnimatedStyle(() => ({
|
|
111
|
+
width: progress.value * trackW.value,
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
const handleLayout = useCallback((e: LayoutChangeEvent) => {
|
|
115
|
+
trackW.value = e.nativeEvent.layout.width;
|
|
116
|
+
}, [trackW]);
|
|
117
|
+
|
|
118
|
+
const displayValue = formatValue
|
|
119
|
+
? formatValue(value)
|
|
120
|
+
: `${Math.round(value)}%`;
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<View
|
|
124
|
+
style={[styles.wrapper, style]}
|
|
125
|
+
accessibilityRole="adjustable"
|
|
126
|
+
accessibilityLabel={accessibilityLabel ?? label ?? 'Slider'}
|
|
127
|
+
accessibilityValue={{ min, max, now: Math.round(value) }}
|
|
128
|
+
>
|
|
129
|
+
{/* Label Row */}
|
|
130
|
+
{hasLabel ? (
|
|
131
|
+
<View style={styles.labelRow}>
|
|
132
|
+
<Text style={[styles.label, { color: COLORS.textPrimary, fontFamily: theme.typography.semiBold }]}>{label}</Text>
|
|
133
|
+
{shouldShowValue ? (
|
|
134
|
+
<Text style={[styles.valueText, { color: COLORS.textSecondary, fontFamily: theme.typography.semiBold }]}>{displayValue}</Text>
|
|
135
|
+
) : null}
|
|
136
|
+
</View>
|
|
137
|
+
) : null}
|
|
138
|
+
|
|
139
|
+
{/* Track */}
|
|
140
|
+
<GestureDetector gesture={composed}>
|
|
141
|
+
<Animated.View style={styles.trackContainer} onLayout={handleLayout}>
|
|
142
|
+
{/* Unfilled track (glass) */}
|
|
143
|
+
<View style={[styles.trackUnfilled, { backgroundColor: COLORS.border }]} />
|
|
144
|
+
|
|
145
|
+
{/* Filled track */}
|
|
146
|
+
<Animated.View style={[styles.trackFilled, filledAnimStyle, { backgroundColor: COLORS.accent }]} />
|
|
147
|
+
|
|
148
|
+
{/* Thumb */}
|
|
149
|
+
<Animated.View style={[styles.thumb, { backgroundColor: COLORS.white, shadowColor: COLORS.shadow }, thumbAnimStyle]} />
|
|
150
|
+
</Animated.View>
|
|
151
|
+
</GestureDetector>
|
|
152
|
+
</View>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const styles = StyleSheet.create({
|
|
157
|
+
wrapper: {
|
|
158
|
+
width: '100%',
|
|
159
|
+
},
|
|
160
|
+
labelRow: {
|
|
161
|
+
flexDirection: 'row',
|
|
162
|
+
justifyContent: 'space-between',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
marginBottom: 10,
|
|
165
|
+
},
|
|
166
|
+
label: {
|
|
167
|
+
fontSize: 14,
|
|
168
|
+
fontWeight: '600',
|
|
169
|
+
},
|
|
170
|
+
valueText: {
|
|
171
|
+
fontSize: 14,
|
|
172
|
+
fontWeight: '600',
|
|
173
|
+
},
|
|
174
|
+
trackContainer: {
|
|
175
|
+
height: THUMB_SIZE + 8,
|
|
176
|
+
justifyContent: 'center',
|
|
177
|
+
position: 'relative',
|
|
178
|
+
},
|
|
179
|
+
trackUnfilled: {
|
|
180
|
+
position: 'absolute',
|
|
181
|
+
left: 0,
|
|
182
|
+
right: 0,
|
|
183
|
+
height: TRACK_HEIGHT,
|
|
184
|
+
borderRadius: TRACK_HEIGHT / 2,
|
|
185
|
+
},
|
|
186
|
+
trackFilled: {
|
|
187
|
+
position: 'absolute',
|
|
188
|
+
left: 0,
|
|
189
|
+
height: TRACK_HEIGHT,
|
|
190
|
+
borderRadius: TRACK_HEIGHT / 2,
|
|
191
|
+
},
|
|
192
|
+
thumb: {
|
|
193
|
+
position: 'absolute',
|
|
194
|
+
width: THUMB_SIZE,
|
|
195
|
+
height: THUMB_SIZE,
|
|
196
|
+
borderRadius: THUMB_SIZE / 2,
|
|
197
|
+
shadowOffset: { width: 0, height: 2 },
|
|
198
|
+
shadowOpacity: 0.3,
|
|
199
|
+
shadowRadius: 4,
|
|
200
|
+
elevation: 5,
|
|
201
|
+
},
|
|
202
|
+
});
|