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,182 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, TextInput, TouchableOpacity, View, Modal, Pressable, ViewStyle } from 'react-native';
|
|
4
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
5
|
+
import FluentGlass from './FluentGlass';
|
|
6
|
+
import FluentGlassDatePicker from './FluentGlassDatePicker';
|
|
7
|
+
import useTheme from '../theme/useTheme';
|
|
8
|
+
|
|
9
|
+
type DateFormat = 'mm/dd/yyyy' | 'dd/mm/yyyy';
|
|
10
|
+
|
|
11
|
+
export interface FluentGlassDateInputProps {
|
|
12
|
+
value?: Date;
|
|
13
|
+
onChange?: (date: Date) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
format?: DateFormat;
|
|
16
|
+
style?: ViewStyle;
|
|
17
|
+
accessibilityLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* FluentGlassDateInput (Molécula)
|
|
22
|
+
* Hybrid date input: type manually OR tap the calendar icon to open FluentGlassDatePicker.
|
|
23
|
+
*/
|
|
24
|
+
export default function FluentGlassDateInput({
|
|
25
|
+
value,
|
|
26
|
+
onChange,
|
|
27
|
+
placeholder = 'dd/mm/yyyy',
|
|
28
|
+
format = 'dd/mm/yyyy',
|
|
29
|
+
style,
|
|
30
|
+
accessibilityLabel,
|
|
31
|
+
}: FluentGlassDateInputProps) {
|
|
32
|
+
const theme = useTheme();
|
|
33
|
+
const COLORS = theme.colors;
|
|
34
|
+
const typography = theme.typography;
|
|
35
|
+
|
|
36
|
+
const [pickerVisible, setPickerVisible] = useState(false);
|
|
37
|
+
const [textValue, setTextValue] = useState(value ? formatDate(value, format) : '');
|
|
38
|
+
|
|
39
|
+
// Format a Date into string
|
|
40
|
+
function formatDate(date: Date, fmt: DateFormat): string {
|
|
41
|
+
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return '';
|
|
42
|
+
const dd = String(date.getDate()).padStart(2, '0');
|
|
43
|
+
const mm = String(date.getMonth() + 1).padStart(2, '0');
|
|
44
|
+
const yyyy = date.getFullYear();
|
|
45
|
+
return fmt === 'dd/mm/yyyy' ? `${dd}/${mm}/${yyyy}` : `${mm}/${dd}/${yyyy}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Parse text into a Date (returns null if invalid)
|
|
49
|
+
function parseDate(text: string, fmt: DateFormat): Date | null {
|
|
50
|
+
const parts = text.split('/');
|
|
51
|
+
if (parts.length !== 3) return null;
|
|
52
|
+
let day: string, month: string, year: string;
|
|
53
|
+
if (fmt === 'dd/mm/yyyy') {
|
|
54
|
+
[day, month, year] = parts;
|
|
55
|
+
} else {
|
|
56
|
+
[month, day, year] = parts;
|
|
57
|
+
}
|
|
58
|
+
const d = parseInt(day, 10);
|
|
59
|
+
const m = parseInt(month, 10);
|
|
60
|
+
const y = parseInt(year, 10);
|
|
61
|
+
if (isNaN(d) || isNaN(m) || isNaN(y)) return null;
|
|
62
|
+
if (m < 1 || m > 12 || d < 1 || d > 31 || y < 1900) return null;
|
|
63
|
+
const date = new Date(y, m - 1, d);
|
|
64
|
+
if (date.getMonth() !== m - 1) return null; // overflow check
|
|
65
|
+
return date;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// When user finishes typing (blur), try to parse the manual entry
|
|
69
|
+
const handleBlur = useCallback(() => {
|
|
70
|
+
const parsed = parseDate(textValue, format);
|
|
71
|
+
if (parsed && onChange) {
|
|
72
|
+
onChange(parsed);
|
|
73
|
+
}
|
|
74
|
+
}, [textValue, format, onChange]);
|
|
75
|
+
|
|
76
|
+
// When text changes, auto-insert slashes
|
|
77
|
+
const handleChangeText = useCallback((raw: string) => {
|
|
78
|
+
// Strip non-digit characters
|
|
79
|
+
const digits = raw.replace(/\D/g, '');
|
|
80
|
+
// Auto-format with slashes
|
|
81
|
+
let formatted = '';
|
|
82
|
+
for (let i = 0; i < digits.length && i < 8; i++) {
|
|
83
|
+
if (i === 2 || i === 4) formatted += '/';
|
|
84
|
+
formatted += digits[i];
|
|
85
|
+
}
|
|
86
|
+
setTextValue(formatted);
|
|
87
|
+
}, []);
|
|
88
|
+
|
|
89
|
+
// When user picks from the calendar popup
|
|
90
|
+
const handlePickerSelect = useCallback((date: Date) => {
|
|
91
|
+
setTextValue(formatDate(date, format));
|
|
92
|
+
setPickerVisible(false);
|
|
93
|
+
if (onChange) onChange(date);
|
|
94
|
+
}, [format, onChange]);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<View style={style}>
|
|
98
|
+
<FluentGlass
|
|
99
|
+
style={styles.container}
|
|
100
|
+
intensity={15}
|
|
101
|
+
borderRadius={12}
|
|
102
|
+
borderOpacity={0.15}
|
|
103
|
+
>
|
|
104
|
+
<View style={styles.innerContainer}>
|
|
105
|
+
<TextInput
|
|
106
|
+
style={[styles.input, { outlineStyle: 'none' as any, color: COLORS.textPrimary, fontFamily: typography.regular }]}
|
|
107
|
+
value={textValue}
|
|
108
|
+
onChangeText={handleChangeText}
|
|
109
|
+
onBlur={handleBlur}
|
|
110
|
+
placeholder={placeholder}
|
|
111
|
+
placeholderTextColor={COLORS.textSecondary}
|
|
112
|
+
keyboardType="numeric"
|
|
113
|
+
maxLength={10}
|
|
114
|
+
accessibilityLabel={accessibilityLabel ?? placeholder ?? 'Date'}
|
|
115
|
+
/>
|
|
116
|
+
|
|
117
|
+
<TouchableOpacity
|
|
118
|
+
onPress={() => setPickerVisible(true)}
|
|
119
|
+
style={styles.iconButton}
|
|
120
|
+
hitSlop={10}
|
|
121
|
+
accessibilityRole="button"
|
|
122
|
+
accessibilityLabel="Open date picker"
|
|
123
|
+
>
|
|
124
|
+
<Ionicons name="calendar-outline" size={20} color={COLORS.textSecondary} />
|
|
125
|
+
</TouchableOpacity>
|
|
126
|
+
</View>
|
|
127
|
+
</FluentGlass>
|
|
128
|
+
|
|
129
|
+
{/* Calendar Popup */}
|
|
130
|
+
<Modal
|
|
131
|
+
visible={pickerVisible}
|
|
132
|
+
transparent
|
|
133
|
+
animationType="fade"
|
|
134
|
+
onRequestClose={() => setPickerVisible(false)}
|
|
135
|
+
>
|
|
136
|
+
<Pressable
|
|
137
|
+
style={[styles.overlay, { backgroundColor: COLORS.overlay }]}
|
|
138
|
+
onPress={() => setPickerVisible(false)}
|
|
139
|
+
>
|
|
140
|
+
<Pressable
|
|
141
|
+
style={styles.pickerPopup}
|
|
142
|
+
onPress={(e) => e.stopPropagation()}
|
|
143
|
+
>
|
|
144
|
+
<FluentGlassDatePicker
|
|
145
|
+
value={value || new Date()}
|
|
146
|
+
onChange={handlePickerSelect}
|
|
147
|
+
/>
|
|
148
|
+
</Pressable>
|
|
149
|
+
</Pressable>
|
|
150
|
+
</Modal>
|
|
151
|
+
</View>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const styles = StyleSheet.create({
|
|
156
|
+
container: {
|
|
157
|
+
minHeight: 50,
|
|
158
|
+
},
|
|
159
|
+
innerContainer: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
flexDirection: 'row',
|
|
162
|
+
alignItems: 'center',
|
|
163
|
+
},
|
|
164
|
+
input: {
|
|
165
|
+
flex: 1,
|
|
166
|
+
height: '100%',
|
|
167
|
+
paddingHorizontal: 16,
|
|
168
|
+
fontSize: 16,
|
|
169
|
+
},
|
|
170
|
+
iconButton: {
|
|
171
|
+
padding: 12,
|
|
172
|
+
marginRight: 4,
|
|
173
|
+
},
|
|
174
|
+
overlay: {
|
|
175
|
+
flex: 1,
|
|
176
|
+
justifyContent: 'center',
|
|
177
|
+
alignItems: 'center',
|
|
178
|
+
},
|
|
179
|
+
pickerPopup: {
|
|
180
|
+
// Let the DatePicker define its own width (300)
|
|
181
|
+
},
|
|
182
|
+
});
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import React, { useState, useMemo } from 'react';
|
|
2
|
+
import { StyleSheet, View, Text, TouchableOpacity, Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import FluentGlass from './FluentGlass';
|
|
4
|
+
import useTheme from '../theme/useTheme';
|
|
5
|
+
import { moderateScale } from '../utils/responsive';
|
|
6
|
+
|
|
7
|
+
export interface FluentGlassDatePickerProps {
|
|
8
|
+
value?: Date;
|
|
9
|
+
onChange?: (date: Date) => void;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function FluentGlassDatePicker({ value = new Date(),
|
|
14
|
+
onChange,
|
|
15
|
+
style, }: FluentGlassDatePickerProps) {
|
|
16
|
+
const { colors, typography } = useTheme();
|
|
17
|
+
|
|
18
|
+
// Current visible month/year
|
|
19
|
+
const [currentMonth, setCurrentMonth] = useState(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
20
|
+
|
|
21
|
+
// Helpers to navigate months
|
|
22
|
+
const handlePrevMonth = () => {
|
|
23
|
+
setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const handleNextMonth = () => {
|
|
27
|
+
setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Calendar generation logic
|
|
31
|
+
const { days, blanks } = useMemo(() => {
|
|
32
|
+
const year = currentMonth.getFullYear();
|
|
33
|
+
const month = currentMonth.getMonth();
|
|
34
|
+
|
|
35
|
+
// 0 = Sunday, 1 = Monday, etc.
|
|
36
|
+
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
37
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
38
|
+
|
|
39
|
+
// Array of empty slots before the 1st
|
|
40
|
+
const blanksArray = Array.from({ length: firstDayOfMonth }, (_, i) => i);
|
|
41
|
+
// Array of actual days
|
|
42
|
+
const daysArray = Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
|
43
|
+
|
|
44
|
+
return { days: daysArray, blanks: blanksArray };
|
|
45
|
+
}, [currentMonth]);
|
|
46
|
+
|
|
47
|
+
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
48
|
+
const headerText = `${monthNames[currentMonth.getMonth()]} ${currentMonth.getFullYear()}`;
|
|
49
|
+
|
|
50
|
+
// Helper to check if a day is the currently selected date
|
|
51
|
+
const isSelected = (day: number) => {
|
|
52
|
+
return (
|
|
53
|
+
value.getDate() === day &&
|
|
54
|
+
value.getMonth() === currentMonth.getMonth() &&
|
|
55
|
+
value.getFullYear() === currentMonth.getFullYear()
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const handleSelectDay = (day: number) => {
|
|
60
|
+
if (onChange) {
|
|
61
|
+
onChange(new Date(currentMonth.getFullYear(), currentMonth.getMonth(), day));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleToday = () => {
|
|
66
|
+
const today = new Date();
|
|
67
|
+
setCurrentMonth(new Date(today.getFullYear(), today.getMonth(), 1));
|
|
68
|
+
if (onChange) {
|
|
69
|
+
onChange(today);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<FluentGlass
|
|
75
|
+
style={[styles.container, style]}
|
|
76
|
+
intensity={25}
|
|
77
|
+
borderRadius={24}
|
|
78
|
+
borderOpacity={0.2}
|
|
79
|
+
tint="dark"
|
|
80
|
+
>
|
|
81
|
+
<View style={styles.calendarProps}>
|
|
82
|
+
|
|
83
|
+
{/* ── Header ── */}
|
|
84
|
+
<View style={styles.header}>
|
|
85
|
+
<TouchableOpacity onPress={handlePrevMonth} style={styles.navButton} hitSlop={10} accessibilityRole="button" accessibilityLabel="Previous month">
|
|
86
|
+
<Text style={[styles.navIcon, { color: colors.textSecondary, fontFamily: typography.regular }]}>‹</Text>
|
|
87
|
+
</TouchableOpacity>
|
|
88
|
+
|
|
89
|
+
<Text style={[styles.headerTitle, { color: colors.textPrimary, fontFamily: typography.bold }]}>{headerText}</Text>
|
|
90
|
+
|
|
91
|
+
<TouchableOpacity onPress={handleNextMonth} style={styles.navButton} hitSlop={10} accessibilityRole="button" accessibilityLabel="Next month">
|
|
92
|
+
<Text style={[styles.navIcon, { color: colors.textSecondary, fontFamily: typography.regular }]}>›</Text>
|
|
93
|
+
</TouchableOpacity>
|
|
94
|
+
</View>
|
|
95
|
+
|
|
96
|
+
{/* ── Days of Week ── */}
|
|
97
|
+
<View style={styles.weekRow}>
|
|
98
|
+
{['S', 'M', 'T', 'W', 'T', 'F', 'S'].map((day, ix) => (
|
|
99
|
+
<View key={ix} style={styles.dayCell}>
|
|
100
|
+
<Text style={[styles.weekText, { color: colors.textSecondary, fontFamily: typography.bold }]}>{day}</Text>
|
|
101
|
+
</View>
|
|
102
|
+
))}
|
|
103
|
+
</View>
|
|
104
|
+
|
|
105
|
+
{/* ── Days Grid ── */}
|
|
106
|
+
<View style={styles.daysGrid}>
|
|
107
|
+
{/* Blanks */}
|
|
108
|
+
{blanks.map(blank => (
|
|
109
|
+
<View key={`blank-${blank}`} style={styles.dayCell} />
|
|
110
|
+
))}
|
|
111
|
+
|
|
112
|
+
{/* Actual Days */}
|
|
113
|
+
{days.map(day => {
|
|
114
|
+
const selected = isSelected(day);
|
|
115
|
+
return (
|
|
116
|
+
<Pressable
|
|
117
|
+
key={day}
|
|
118
|
+
style={styles.dayCell}
|
|
119
|
+
onPress={() => handleSelectDay(day)}
|
|
120
|
+
accessibilityRole="button"
|
|
121
|
+
accessibilityState={{ selected: isSelected(day) }}
|
|
122
|
+
>
|
|
123
|
+
{selected ? (
|
|
124
|
+
<View style={styles.selectedCircle}>
|
|
125
|
+
<FluentGlass intensity={40} borderRadius={16} tint="light" style={StyleSheet.absoluteFillObject} />
|
|
126
|
+
<Text style={[styles.dayText, styles.selectedDayText, { color: colors.textPrimary, fontFamily: typography.extraBold }]}>{day}</Text>
|
|
127
|
+
</View>
|
|
128
|
+
) : (
|
|
129
|
+
<Text style={[styles.dayText, { color: colors.textSecondary, fontFamily: typography.semiBold }]}>{day}</Text>
|
|
130
|
+
)}
|
|
131
|
+
</Pressable>
|
|
132
|
+
);
|
|
133
|
+
})}
|
|
134
|
+
</View>
|
|
135
|
+
|
|
136
|
+
{/* ── Today Button ── */}
|
|
137
|
+
<TouchableOpacity style={[styles.todayButton, { borderColor: colors.border, backgroundColor: colors.borderSubtle }]} onPress={handleToday} activeOpacity={0.7} accessibilityRole="button" accessibilityLabel="Go to today">
|
|
138
|
+
<Text style={[styles.todayText, { color: colors.accent, fontFamily: typography.bold }]}>Hoy</Text>
|
|
139
|
+
</TouchableOpacity>
|
|
140
|
+
|
|
141
|
+
</View>
|
|
142
|
+
</FluentGlass>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const styles = StyleSheet.create({
|
|
147
|
+
container: {
|
|
148
|
+
width: '100%',
|
|
149
|
+
maxWidth: 360,
|
|
150
|
+
alignSelf: 'center',
|
|
151
|
+
},
|
|
152
|
+
calendarProps: {
|
|
153
|
+
padding: 20,
|
|
154
|
+
},
|
|
155
|
+
header: {
|
|
156
|
+
flexDirection: 'row',
|
|
157
|
+
justifyContent: 'space-between',
|
|
158
|
+
alignItems: 'center',
|
|
159
|
+
marginBottom: 20,
|
|
160
|
+
},
|
|
161
|
+
headerTitle: {
|
|
162
|
+
fontSize: 18,
|
|
163
|
+
fontWeight: 'bold',
|
|
164
|
+
letterSpacing: 0.5,
|
|
165
|
+
},
|
|
166
|
+
navButton: {
|
|
167
|
+
width: moderateScale(36),
|
|
168
|
+
height: moderateScale(36),
|
|
169
|
+
alignItems: 'center',
|
|
170
|
+
justifyContent: 'center',
|
|
171
|
+
},
|
|
172
|
+
navIcon: {
|
|
173
|
+
fontSize: 24,
|
|
174
|
+
fontWeight: '300',
|
|
175
|
+
lineHeight: 28,
|
|
176
|
+
},
|
|
177
|
+
weekRow: {
|
|
178
|
+
flexDirection: 'row',
|
|
179
|
+
marginBottom: 10,
|
|
180
|
+
},
|
|
181
|
+
weekText: {
|
|
182
|
+
fontSize: 13,
|
|
183
|
+
fontWeight: '700',
|
|
184
|
+
textAlign: 'center',
|
|
185
|
+
},
|
|
186
|
+
daysGrid: {
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
flexWrap: 'wrap',
|
|
189
|
+
},
|
|
190
|
+
dayCell: {
|
|
191
|
+
width: '14.28%', // 100% / 7
|
|
192
|
+
height: 38,
|
|
193
|
+
justifyContent: 'center',
|
|
194
|
+
alignItems: 'center',
|
|
195
|
+
},
|
|
196
|
+
dayText: {
|
|
197
|
+
fontSize: 15,
|
|
198
|
+
fontWeight: '600',
|
|
199
|
+
},
|
|
200
|
+
selectedCircle: {
|
|
201
|
+
width: moderateScale(32),
|
|
202
|
+
height: moderateScale(32),
|
|
203
|
+
borderRadius: moderateScale(16),
|
|
204
|
+
justifyContent: 'center',
|
|
205
|
+
alignItems: 'center',
|
|
206
|
+
overflow: 'hidden',
|
|
207
|
+
},
|
|
208
|
+
selectedDayText: {
|
|
209
|
+
fontWeight: '800',
|
|
210
|
+
},
|
|
211
|
+
todayButton: {
|
|
212
|
+
marginTop: 14,
|
|
213
|
+
alignSelf: 'center',
|
|
214
|
+
paddingVertical: 8,
|
|
215
|
+
paddingHorizontal: 28,
|
|
216
|
+
borderRadius: 12,
|
|
217
|
+
borderWidth: 1,
|
|
218
|
+
},
|
|
219
|
+
todayText: {
|
|
220
|
+
fontSize: 14,
|
|
221
|
+
fontWeight: '700',
|
|
222
|
+
letterSpacing: 0.5,
|
|
223
|
+
},
|
|
224
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View, Text, Pressable } from 'react-native';
|
|
4
|
+
import Animated, {
|
|
5
|
+
useSharedValue,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
withSpring,
|
|
8
|
+
withTiming,
|
|
9
|
+
} from 'react-native-reanimated';
|
|
10
|
+
import FluentGlass from './FluentGlass';
|
|
11
|
+
import FluentGlassButton from './FluentGlassButton';
|
|
12
|
+
import useTheme from '../theme/useTheme';
|
|
13
|
+
|
|
14
|
+
export interface FluentGlassDialogProps {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
onConfirm?: () => void;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
confirmText?: string;
|
|
21
|
+
cancelText?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* FluentGlassDialog (Component)
|
|
26
|
+
* Central alert/confirmation modal.
|
|
27
|
+
* Uses absolute positioning instead of Modal to avoid
|
|
28
|
+
* BlurView initialisation flicker.
|
|
29
|
+
*/
|
|
30
|
+
export default function FluentGlassDialog({
|
|
31
|
+
visible,
|
|
32
|
+
onClose,
|
|
33
|
+
title,
|
|
34
|
+
description,
|
|
35
|
+
onConfirm,
|
|
36
|
+
confirmText = 'Confirm',
|
|
37
|
+
cancelText = 'Cancel',
|
|
38
|
+
}: FluentGlassDialogProps) {
|
|
39
|
+
const theme = useTheme();
|
|
40
|
+
const COLORS = theme.colors;
|
|
41
|
+
const typography = theme.typography;
|
|
42
|
+
|
|
43
|
+
const scale = useSharedValue(0.8);
|
|
44
|
+
const opacity = useSharedValue(0);
|
|
45
|
+
const [mounted, setMounted] = React.useState(false);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (visible) {
|
|
49
|
+
setMounted(true);
|
|
50
|
+
// Small delay so React commits the mount frame (opacity 0) first
|
|
51
|
+
requestAnimationFrame(() => {
|
|
52
|
+
scale.value = withSpring(1);
|
|
53
|
+
opacity.value = withTiming(1, { duration: 200 });
|
|
54
|
+
});
|
|
55
|
+
} else if (mounted) {
|
|
56
|
+
scale.value = withTiming(0.85, { duration: 180 });
|
|
57
|
+
opacity.value = withTiming(0, { duration: 180 });
|
|
58
|
+
const timer: ReturnType<typeof setTimeout> = setTimeout(() => {
|
|
59
|
+
setMounted(false);
|
|
60
|
+
scale.value = 0.8;
|
|
61
|
+
opacity.value = 0;
|
|
62
|
+
}, 220);
|
|
63
|
+
return () => clearTimeout(timer);
|
|
64
|
+
}
|
|
65
|
+
}, [visible]);
|
|
66
|
+
|
|
67
|
+
const backdropStyle = useAnimatedStyle(() => ({
|
|
68
|
+
opacity: opacity.value,
|
|
69
|
+
}));
|
|
70
|
+
|
|
71
|
+
const cardStyle = useAnimatedStyle(() => ({
|
|
72
|
+
opacity: opacity.value,
|
|
73
|
+
transform: [{ scale: scale.value }],
|
|
74
|
+
}));
|
|
75
|
+
|
|
76
|
+
if (!mounted) return null;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<View style={styles.root} pointerEvents={visible ? 'auto' : 'none'} accessibilityViewIsModal={true}>
|
|
80
|
+
{/* Backdrop */}
|
|
81
|
+
<Animated.View style={[styles.backdrop, { backgroundColor: COLORS.overlay }, backdropStyle]}>
|
|
82
|
+
<Pressable style={StyleSheet.absoluteFill} onPress={onClose} accessibilityRole="button" accessibilityLabel="Close dialog" />
|
|
83
|
+
</Animated.View>
|
|
84
|
+
|
|
85
|
+
{/* Dialog */}
|
|
86
|
+
<Animated.View style={[styles.dialogContainer, cardStyle]}>
|
|
87
|
+
<FluentGlass
|
|
88
|
+
style={styles.modalGlass}
|
|
89
|
+
intensity={25}
|
|
90
|
+
borderRadius={20}
|
|
91
|
+
>
|
|
92
|
+
<View style={styles.innerContent}>
|
|
93
|
+
<Text style={[styles.title, { color: COLORS.textPrimary, fontFamily: typography.bold }]} accessibilityRole="header">{title}</Text>
|
|
94
|
+
{description && <Text style={[styles.description, { color: COLORS.textSecondary, fontFamily: typography.regular }]}>{description}</Text>}
|
|
95
|
+
|
|
96
|
+
<View style={styles.footer}>
|
|
97
|
+
<FluentGlassButton
|
|
98
|
+
title={cancelText}
|
|
99
|
+
variant="secondary"
|
|
100
|
+
onPress={onClose}
|
|
101
|
+
style={{ flex: 1, marginRight: 8 }}
|
|
102
|
+
/>
|
|
103
|
+
<FluentGlassButton
|
|
104
|
+
title={confirmText}
|
|
105
|
+
variant="primary"
|
|
106
|
+
onPress={onConfirm}
|
|
107
|
+
style={{ flex: 1, marginLeft: 8 }}
|
|
108
|
+
/>
|
|
109
|
+
</View>
|
|
110
|
+
</View>
|
|
111
|
+
</FluentGlass>
|
|
112
|
+
</Animated.View>
|
|
113
|
+
</View>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
root: {
|
|
119
|
+
...StyleSheet.absoluteFillObject,
|
|
120
|
+
zIndex: 9999,
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
padding: 20,
|
|
124
|
+
},
|
|
125
|
+
backdrop: {
|
|
126
|
+
...StyleSheet.absoluteFillObject,
|
|
127
|
+
},
|
|
128
|
+
dialogContainer: {
|
|
129
|
+
width: '100%',
|
|
130
|
+
maxWidth: 400,
|
|
131
|
+
},
|
|
132
|
+
modalGlass: {
|
|
133
|
+
width: '100%',
|
|
134
|
+
overflow: 'hidden',
|
|
135
|
+
},
|
|
136
|
+
innerContent: {
|
|
137
|
+
padding: 24,
|
|
138
|
+
},
|
|
139
|
+
title: {
|
|
140
|
+
fontSize: 20,
|
|
141
|
+
fontWeight: 'bold',
|
|
142
|
+
marginBottom: 8,
|
|
143
|
+
},
|
|
144
|
+
description: {
|
|
145
|
+
fontSize: 16,
|
|
146
|
+
marginBottom: 24,
|
|
147
|
+
lineHeight: 22,
|
|
148
|
+
},
|
|
149
|
+
footer: {
|
|
150
|
+
flexDirection: 'row',
|
|
151
|
+
justifyContent: 'space-between',
|
|
152
|
+
},
|
|
153
|
+
});
|