@variocube/app-ui 1.14.0
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/README.md +65 -0
- package/esm/AppShell/AppShell.d.ts +12 -0
- package/esm/AppShell/AppShell.js +92 -0
- package/esm/AppShell/AppShell.js.map +1 -0
- package/esm/AppShell/index.d.ts +1 -0
- package/esm/AppShell/index.js +2 -0
- package/esm/AppShell/index.js.map +1 -0
- package/esm/ErrorAlert.d.ts +12 -0
- package/esm/ErrorAlert.js +61 -0
- package/esm/ErrorAlert.js.map +1 -0
- package/esm/Input/ActionsMenu.d.ts +9 -0
- package/esm/Input/ActionsMenu.js +29 -0
- package/esm/Input/ActionsMenu.js.map +1 -0
- package/esm/Input/Checkbox.d.ts +9 -0
- package/esm/Input/Checkbox.js +23 -0
- package/esm/Input/Checkbox.js.map +1 -0
- package/esm/Input/EmailSenderField.d.ts +8 -0
- package/esm/Input/EmailSenderField.js +71 -0
- package/esm/Input/EmailSenderField.js.map +1 -0
- package/esm/Input/NumberField.d.ts +10 -0
- package/esm/Input/NumberField.js +94 -0
- package/esm/Input/NumberField.js.map +1 -0
- package/esm/Input/RadioGroup.d.ts +12 -0
- package/esm/Input/RadioGroup.js +20 -0
- package/esm/Input/RadioGroup.js.map +1 -0
- package/esm/Input/Select.d.ts +11 -0
- package/esm/Input/Select.js +19 -0
- package/esm/Input/Select.js.map +1 -0
- package/esm/Input/Selector.d.ts +10 -0
- package/esm/Input/Selector.js +19 -0
- package/esm/Input/Selector.js.map +1 -0
- package/esm/Input/Switch.d.ts +9 -0
- package/esm/Input/Switch.js +23 -0
- package/esm/Input/Switch.js.map +1 -0
- package/esm/Input/TextField.d.ts +7 -0
- package/esm/Input/TextField.js +58 -0
- package/esm/Input/TextField.js.map +1 -0
- package/esm/Input/UrlUploadField.d.ts +9 -0
- package/esm/Input/UrlUploadField.js +43 -0
- package/esm/Input/UrlUploadField.js.map +1 -0
- package/esm/Input/index.d.ts +9 -0
- package/esm/Input/index.js +10 -0
- package/esm/Input/index.js.map +1 -0
- package/esm/LanguageSwitcher/LanguageSwitcher.d.ts +14 -0
- package/esm/LanguageSwitcher/LanguageSwitcher.js +20 -0
- package/esm/LanguageSwitcher/LanguageSwitcher.js.map +1 -0
- package/esm/LanguageSwitcher/index.d.ts +1 -0
- package/esm/LanguageSwitcher/index.js +2 -0
- package/esm/LanguageSwitcher/index.js.map +1 -0
- package/esm/Paging/Paging.d.ts +40 -0
- package/esm/Paging/Paging.js +43 -0
- package/esm/Paging/Paging.js.map +1 -0
- package/esm/Paging/index.d.ts +1 -0
- package/esm/Paging/index.js +2 -0
- package/esm/Paging/index.js.map +1 -0
- package/esm/VCThemeProvider/JetbrainsMonoFont.d.ts +5 -0
- package/esm/VCThemeProvider/JetbrainsMonoFont.js +52 -0
- package/esm/VCThemeProvider/JetbrainsMonoFont.js.map +1 -0
- package/esm/VCThemeProvider/RobotoFont.d.ts +7 -0
- package/esm/VCThemeProvider/RobotoFont.js +49 -0
- package/esm/VCThemeProvider/RobotoFont.js.map +1 -0
- package/esm/VCThemeProvider/ThemeModeSwitcher.d.ts +2 -0
- package/esm/VCThemeProvider/ThemeModeSwitcher.js +14 -0
- package/esm/VCThemeProvider/ThemeModeSwitcher.js.map +1 -0
- package/esm/VCThemeProvider/VCThemeProvider.d.ts +25 -0
- package/esm/VCThemeProvider/VCThemeProvider.js +173 -0
- package/esm/VCThemeProvider/VCThemeProvider.js.map +1 -0
- package/esm/VCThemeProvider/code-colors.d.ts +108 -0
- package/esm/VCThemeProvider/code-colors.js +26 -0
- package/esm/VCThemeProvider/code-colors.js.map +1 -0
- package/esm/VCThemeProvider/index.d.ts +5 -0
- package/esm/VCThemeProvider/index.js +6 -0
- package/esm/VCThemeProvider/index.js.map +1 -0
- package/esm/audit/AuditChanges.d.ts +9 -0
- package/esm/audit/AuditChanges.js +43 -0
- package/esm/audit/AuditChanges.js.map +1 -0
- package/esm/audit/AuditTimeline.d.ts +6 -0
- package/esm/audit/AuditTimeline.js +13 -0
- package/esm/audit/AuditTimeline.js.map +1 -0
- package/esm/audit/AuditTimelineItem.d.ts +10 -0
- package/esm/audit/AuditTimelineItem.js +27 -0
- package/esm/audit/AuditTimelineItem.js.map +1 -0
- package/esm/audit/index.d.ts +4 -0
- package/esm/audit/index.js +5 -0
- package/esm/audit/index.js.map +1 -0
- package/esm/audit/types.d.ts +42 -0
- package/esm/audit/types.js +2 -0
- package/esm/audit/types.js.map +1 -0
- package/esm/breadcrumbs.d.ts +6 -0
- package/esm/breadcrumbs.js +13 -0
- package/esm/breadcrumbs.js.map +1 -0
- package/esm/code/Code.d.ts +10 -0
- package/esm/code/Code.js +19 -0
- package/esm/code/Code.js.map +1 -0
- package/esm/code/CodeBlock.d.ts +4 -0
- package/esm/code/CodeBlock.js +6 -0
- package/esm/code/CodeBlock.js.map +1 -0
- package/esm/code/Json.d.ts +4 -0
- package/esm/code/Json.js +60 -0
- package/esm/code/Json.js.map +1 -0
- package/esm/code/index.d.ts +3 -0
- package/esm/code/index.js +4 -0
- package/esm/code/index.js.map +1 -0
- package/esm/confirm/ConfirmButton.d.ts +16 -0
- package/esm/confirm/ConfirmButton.js +29 -0
- package/esm/confirm/ConfirmButton.js.map +1 -0
- package/esm/confirm/ConfirmDialog.d.ts +16 -0
- package/esm/confirm/ConfirmDialog.js +35 -0
- package/esm/confirm/ConfirmDialog.js.map +1 -0
- package/esm/confirm/ConfirmIconButton.d.ts +14 -0
- package/esm/confirm/ConfirmIconButton.js +29 -0
- package/esm/confirm/ConfirmIconButton.js.map +1 -0
- package/esm/confirm/ConfirmMenuItem.d.ts +15 -0
- package/esm/confirm/ConfirmMenuItem.js +31 -0
- package/esm/confirm/ConfirmMenuItem.js.map +1 -0
- package/esm/confirm/index.d.ts +4 -0
- package/esm/confirm/index.js +5 -0
- package/esm/confirm/index.js.map +1 -0
- package/esm/container/ContainerLayout.d.ts +8 -0
- package/esm/container/ContainerLayout.js +20 -0
- package/esm/container/ContainerLayout.js.map +1 -0
- package/esm/container/ContainerSettingsContext.d.ts +12 -0
- package/esm/container/ContainerSettingsContext.js +46 -0
- package/esm/container/ContainerSettingsContext.js.map +1 -0
- package/esm/container/ContainerWidthControl.d.ts +6 -0
- package/esm/container/ContainerWidthControl.js +12 -0
- package/esm/container/ContainerWidthControl.js.map +1 -0
- package/esm/container/index.d.ts +3 -0
- package/esm/container/index.js +4 -0
- package/esm/container/index.js.map +1 -0
- package/esm/content-table/ContentTable.d.ts +25 -0
- package/esm/content-table/ContentTable.js +87 -0
- package/esm/content-table/ContentTable.js.map +1 -0
- package/esm/content-table/UndrawEmpty.d.ts +2 -0
- package/esm/content-table/UndrawEmpty.js +71 -0
- package/esm/content-table/UndrawEmpty.js.map +1 -0
- package/esm/content-table/index.d.ts +1 -0
- package/esm/content-table/index.js +2 -0
- package/esm/content-table/index.js.map +1 -0
- package/esm/country/countries.d.ts +34 -0
- package/esm/country/countries.js +266 -0
- package/esm/country/countries.js.map +1 -0
- package/esm/country/country-select.d.ts +8 -0
- package/esm/country/country-select.js +18 -0
- package/esm/country/country-select.js.map +1 -0
- package/esm/country/index.d.ts +5 -0
- package/esm/country/index.js +6 -0
- package/esm/country/index.js.map +1 -0
- package/esm/country/locale-select.d.ts +9 -0
- package/esm/country/locale-select.js +15 -0
- package/esm/country/locale-select.js.map +1 -0
- package/esm/country/locales.d.ts +10 -0
- package/esm/country/locales.js +190 -0
- package/esm/country/locales.js.map +1 -0
- package/esm/country/phone-prefix-select.d.ts +9 -0
- package/esm/country/phone-prefix-select.js +18 -0
- package/esm/country/phone-prefix-select.js.map +1 -0
- package/esm/cube/BoxFeatures.d.ts +11 -0
- package/esm/cube/BoxFeatures.js +40 -0
- package/esm/cube/BoxFeatures.js.map +1 -0
- package/esm/cube/BoxMaintenanceChip.d.ts +9 -0
- package/esm/cube/BoxMaintenanceChip.js +15 -0
- package/esm/cube/BoxMaintenanceChip.js.map +1 -0
- package/esm/cube/BoxNumber.d.ts +6 -0
- package/esm/cube/BoxNumber.js +6 -0
- package/esm/cube/BoxNumber.js.map +1 -0
- package/esm/cube/BoxType.d.ts +7 -0
- package/esm/cube/BoxType.js +21 -0
- package/esm/cube/BoxType.js.map +1 -0
- package/esm/cube/CubeConnectedChip.d.ts +9 -0
- package/esm/cube/CubeConnectedChip.js +22 -0
- package/esm/cube/CubeConnectedChip.js.map +1 -0
- package/esm/cube/LockStatusChip.d.ts +11 -0
- package/esm/cube/LockStatusChip.js +40 -0
- package/esm/cube/LockStatusChip.js.map +1 -0
- package/esm/cube/UtilizationBar.d.ts +11 -0
- package/esm/cube/UtilizationBar.js +38 -0
- package/esm/cube/UtilizationBar.js.map +1 -0
- package/esm/cube/accessibility.d.ts +48 -0
- package/esm/cube/accessibility.js +242 -0
- package/esm/cube/accessibility.js.map +1 -0
- package/esm/cube/index.d.ts +8 -0
- package/esm/cube/index.js +9 -0
- package/esm/cube/index.js.map +1 -0
- package/esm/data-table/DataTable.d.ts +63 -0
- package/esm/data-table/DataTable.js +124 -0
- package/esm/data-table/DataTable.js.map +1 -0
- package/esm/data-table/DataTableColumnSettings.d.ts +10 -0
- package/esm/data-table/DataTableColumnSettings.js +98 -0
- package/esm/data-table/DataTableColumnSettings.js.map +1 -0
- package/esm/data-table/DataTableHeader.d.ts +2 -0
- package/esm/data-table/DataTableHeader.js +6 -0
- package/esm/data-table/DataTableHeader.js.map +1 -0
- package/esm/data-table/DataTableToolbar.d.ts +2 -0
- package/esm/data-table/DataTableToolbar.js +6 -0
- package/esm/data-table/DataTableToolbar.js.map +1 -0
- package/esm/data-table/index.d.ts +8 -0
- package/esm/data-table/index.js +9 -0
- package/esm/data-table/index.js.map +1 -0
- package/esm/data-table/useDataTableColumnStorage.d.ts +5 -0
- package/esm/data-table/useDataTableColumnStorage.js +20 -0
- package/esm/data-table/useDataTableColumnStorage.js.map +1 -0
- package/esm/data-table/useDataTableStorage.d.ts +16 -0
- package/esm/data-table/useDataTableStorage.js +19 -0
- package/esm/data-table/useDataTableStorage.js.map +1 -0
- package/esm/data-table/useSpringPage.d.ts +6 -0
- package/esm/data-table/useSpringPage.js +18 -0
- package/esm/data-table/useSpringPage.js.map +1 -0
- package/esm/data-table/useSpringPageable.d.ts +9 -0
- package/esm/data-table/useSpringPageable.js +10 -0
- package/esm/data-table/useSpringPageable.js.map +1 -0
- package/esm/date-pickers/PlainAdapterCommon.d.ts +31 -0
- package/esm/date-pickers/PlainAdapterCommon.js +97 -0
- package/esm/date-pickers/PlainAdapterCommon.js.map +1 -0
- package/esm/date-pickers/PlainDateAdapter.d.ts +30 -0
- package/esm/date-pickers/PlainDateAdapter.js +114 -0
- package/esm/date-pickers/PlainDateAdapter.js.map +1 -0
- package/esm/date-pickers/PlainDatePicker.d.ts +21 -0
- package/esm/date-pickers/PlainDatePicker.js +26 -0
- package/esm/date-pickers/PlainDatePicker.js.map +1 -0
- package/esm/date-pickers/PlainDatePicker.spec.d.ts +1 -0
- package/esm/date-pickers/PlainDatePicker.spec.js +15 -0
- package/esm/date-pickers/PlainDatePicker.spec.js.map +1 -0
- package/esm/date-pickers/PlainDateTimeAdapter.d.ts +30 -0
- package/esm/date-pickers/PlainDateTimeAdapter.js +114 -0
- package/esm/date-pickers/PlainDateTimeAdapter.js.map +1 -0
- package/esm/date-pickers/PlainDateTimePicker.d.ts +20 -0
- package/esm/date-pickers/PlainDateTimePicker.js +26 -0
- package/esm/date-pickers/PlainDateTimePicker.js.map +1 -0
- package/esm/date-pickers/PlainDateTimePicker.spec.d.ts +1 -0
- package/esm/date-pickers/PlainDateTimePicker.spec.js +15 -0
- package/esm/date-pickers/PlainDateTimePicker.spec.js.map +1 -0
- package/esm/date-pickers/PlainTimeAdapter.d.ts +58 -0
- package/esm/date-pickers/PlainTimeAdapter.js +194 -0
- package/esm/date-pickers/PlainTimeAdapter.js.map +1 -0
- package/esm/date-pickers/PlainTimePicker.d.ts +16 -0
- package/esm/date-pickers/PlainTimePicker.js +24 -0
- package/esm/date-pickers/PlainTimePicker.js.map +1 -0
- package/esm/date-pickers/PlainTimePicker.spec.d.ts +1 -0
- package/esm/date-pickers/PlainTimePicker.spec.js +15 -0
- package/esm/date-pickers/PlainTimePicker.spec.js.map +1 -0
- package/esm/date-pickers/TemporalAdapter.d.ts +18 -0
- package/esm/date-pickers/TemporalAdapter.js +109 -0
- package/esm/date-pickers/TemporalAdapter.js.map +1 -0
- package/esm/date-pickers/TimezoneSelect.d.ts +9 -0
- package/esm/date-pickers/TimezoneSelect.js +357 -0
- package/esm/date-pickers/TimezoneSelect.js.map +1 -0
- package/esm/date-pickers/getFormatString.d.ts +11 -0
- package/esm/date-pickers/getFormatString.js +26 -0
- package/esm/date-pickers/getFormatString.js.map +1 -0
- package/esm/date-pickers/index.d.ts +5 -0
- package/esm/date-pickers/index.js +6 -0
- package/esm/date-pickers/index.js.map +1 -0
- package/esm/date-pickers/parse.d.ts +4 -0
- package/esm/date-pickers/parse.js +66 -0
- package/esm/date-pickers/parse.js.map +1 -0
- package/esm/date-pickers/timeframe-picker.d.ts +46 -0
- package/esm/date-pickers/timeframe-picker.js +120 -0
- package/esm/date-pickers/timeframe-picker.js.map +1 -0
- package/esm/date-pickers/useLocale.d.ts +1 -0
- package/esm/date-pickers/useLocale.js +6 -0
- package/esm/date-pickers/useLocale.js.map +1 -0
- package/esm/date-pickers/useRenderInput.d.ts +4 -0
- package/esm/date-pickers/useRenderInput.js +8 -0
- package/esm/date-pickers/useRenderInput.js.map +1 -0
- package/esm/fetch.d.ts +51 -0
- package/esm/fetch.js +138 -0
- package/esm/fetch.js.map +1 -0
- package/esm/filter/Filter.d.ts +38 -0
- package/esm/filter/Filter.js +72 -0
- package/esm/filter/Filter.js.map +1 -0
- package/esm/filter/index.d.ts +1 -0
- package/esm/filter/index.js +2 -0
- package/esm/filter/index.js.map +1 -0
- package/esm/formats/CompactFormat.d.ts +22 -0
- package/esm/formats/CompactFormat.js +21 -0
- package/esm/formats/CompactFormat.js.map +1 -0
- package/esm/formats/CompactFormat.spec.d.ts +1 -0
- package/esm/formats/CompactFormat.spec.js +22 -0
- package/esm/formats/CompactFormat.spec.js.map +1 -0
- package/esm/formats/CurrencyFormat.d.ts +39 -0
- package/esm/formats/CurrencyFormat.js +25 -0
- package/esm/formats/CurrencyFormat.js.map +1 -0
- package/esm/formats/CurrencyFormat.spec.d.ts +1 -0
- package/esm/formats/CurrencyFormat.spec.js +22 -0
- package/esm/formats/CurrencyFormat.spec.js.map +1 -0
- package/esm/formats/DecimalFormat.d.ts +29 -0
- package/esm/formats/DecimalFormat.js +22 -0
- package/esm/formats/DecimalFormat.js.map +1 -0
- package/esm/formats/DecimalFormat.spec.d.ts +1 -0
- package/esm/formats/DecimalFormat.spec.js +22 -0
- package/esm/formats/DecimalFormat.spec.js.map +1 -0
- package/esm/formats/DurationFormat.d.ts +23 -0
- package/esm/formats/DurationFormat.js +35 -0
- package/esm/formats/DurationFormat.js.map +1 -0
- package/esm/formats/DurationFormat.spec.d.ts +1 -0
- package/esm/formats/DurationFormat.spec.js +52 -0
- package/esm/formats/DurationFormat.spec.js.map +1 -0
- package/esm/formats/RelativeTemporalFormat.d.ts +22 -0
- package/esm/formats/RelativeTemporalFormat.js +57 -0
- package/esm/formats/RelativeTemporalFormat.js.map +1 -0
- package/esm/formats/RelativeTemporalFormat.spec.d.ts +1 -0
- package/esm/formats/RelativeTemporalFormat.spec.js +77 -0
- package/esm/formats/RelativeTemporalFormat.spec.js.map +1 -0
- package/esm/formats/SwitchableTemporalFormat.d.ts +5 -0
- package/esm/formats/SwitchableTemporalFormat.js +11 -0
- package/esm/formats/SwitchableTemporalFormat.js.map +1 -0
- package/esm/formats/TemporalFormat.d.ts +27 -0
- package/esm/formats/TemporalFormat.js +19 -0
- package/esm/formats/TemporalFormat.js.map +1 -0
- package/esm/formats/TemporalFormat.spec.d.ts +1 -0
- package/esm/formats/TemporalFormat.spec.js +87 -0
- package/esm/formats/TemporalFormat.spec.js.map +1 -0
- package/esm/formats/TemporalRangeFormat.d.ts +30 -0
- package/esm/formats/TemporalRangeFormat.js +17 -0
- package/esm/formats/TemporalRangeFormat.js.map +1 -0
- package/esm/formats/TemporalRangeFormat.spec.d.ts +1 -0
- package/esm/formats/TemporalRangeFormat.spec.js +87 -0
- package/esm/formats/TemporalRangeFormat.spec.js.map +1 -0
- package/esm/formats/index.d.ts +8 -0
- package/esm/formats/index.js +9 -0
- package/esm/formats/index.js.map +1 -0
- package/esm/formats/types.d.ts +2 -0
- package/esm/formats/types.js +2 -0
- package/esm/formats/types.js.map +1 -0
- package/esm/formats/useDateTimeFormat.d.ts +2 -0
- package/esm/formats/useDateTimeFormat.js +7 -0
- package/esm/formats/useDateTimeFormat.js.map +1 -0
- package/esm/formats/useNumberFormat.d.ts +1 -0
- package/esm/formats/useNumberFormat.js +6 -0
- package/esm/formats/useNumberFormat.js.map +1 -0
- package/esm/formats/useRelativeTimeFormat.d.ts +1 -0
- package/esm/formats/useRelativeTimeFormat.js +6 -0
- package/esm/formats/useRelativeTimeFormat.js.map +1 -0
- package/esm/forms/EditForm.d.ts +13 -0
- package/esm/forms/EditForm.js +22 -0
- package/esm/forms/EditForm.js.map +1 -0
- package/esm/forms/SearchForm.d.ts +7 -0
- package/esm/forms/SearchForm.js +36 -0
- package/esm/forms/SearchForm.js.map +1 -0
- package/esm/forms/SubmitButton.d.ts +9 -0
- package/esm/forms/SubmitButton.js +28 -0
- package/esm/forms/SubmitButton.js.map +1 -0
- package/esm/forms/index.d.ts +4 -0
- package/esm/forms/index.js +5 -0
- package/esm/forms/index.js.map +1 -0
- package/esm/forms/useFormSubmit.d.ts +12 -0
- package/esm/forms/useFormSubmit.js +28 -0
- package/esm/forms/useFormSubmit.js.map +1 -0
- package/esm/getNavigatorLanguages.d.ts +5 -0
- package/esm/getNavigatorLanguages.js +11 -0
- package/esm/getNavigatorLanguages.js.map +1 -0
- package/esm/getSupportedFormatLocale.d.ts +19 -0
- package/esm/getSupportedFormatLocale.js +21 -0
- package/esm/getSupportedFormatLocale.js.map +1 -0
- package/esm/help/HelpButton.d.ts +12 -0
- package/esm/help/HelpButton.js +74 -0
- package/esm/help/HelpButton.js.map +1 -0
- package/esm/help/HelpDrawer.d.ts +3 -0
- package/esm/help/HelpDrawer.js +48 -0
- package/esm/help/HelpDrawer.js.map +1 -0
- package/esm/help/HelpSettingsContext.d.ts +26 -0
- package/esm/help/HelpSettingsContext.js +94 -0
- package/esm/help/HelpSettingsContext.js.map +1 -0
- package/esm/help/index.d.ts +3 -0
- package/esm/help/index.js +4 -0
- package/esm/help/index.js.map +1 -0
- package/esm/icons.d.ts +21 -0
- package/esm/icons.js +22 -0
- package/esm/icons.js.map +1 -0
- package/esm/index.d.ts +34 -0
- package/esm/index.js +35 -0
- package/esm/index.js.map +1 -0
- package/esm/layout/ErrorBoundary.d.ts +46 -0
- package/esm/layout/ErrorBoundary.js +186 -0
- package/esm/layout/ErrorBoundary.js.map +1 -0
- package/esm/layout/NotFound.d.ts +9 -0
- package/esm/layout/NotFound.js +26 -0
- package/esm/layout/NotFound.js.map +1 -0
- package/esm/layout/NotFoundSvg.d.ts +2 -0
- package/esm/layout/NotFoundSvg.js +37 -0
- package/esm/layout/NotFoundSvg.js.map +1 -0
- package/esm/layout/UserNav.d.ts +15 -0
- package/esm/layout/UserNav.js +50 -0
- package/esm/layout/UserNav.js.map +1 -0
- package/esm/layout/index.d.ts +5 -0
- package/esm/layout/index.js +6 -0
- package/esm/layout/index.js.map +1 -0
- package/esm/layout/layout-context.d.ts +9 -0
- package/esm/layout/layout-context.js +23 -0
- package/esm/layout/layout-context.js.map +1 -0
- package/esm/layout/page-title.d.ts +7 -0
- package/esm/layout/page-title.js +41 -0
- package/esm/layout/page-title.js.map +1 -0
- package/esm/list/List.d.ts +14 -0
- package/esm/list/List.js +25 -0
- package/esm/list/List.js.map +1 -0
- package/esm/list/SkeletonListItem.d.ts +14 -0
- package/esm/list/SkeletonListItem.js +11 -0
- package/esm/list/SkeletonListItem.js.map +1 -0
- package/esm/list/index.d.ts +1 -0
- package/esm/list/index.js +2 -0
- package/esm/list/index.js.map +1 -0
- package/esm/localization.d.ts +140 -0
- package/esm/localization.js +200 -0
- package/esm/localization.js.map +1 -0
- package/esm/logo/Logo.d.ts +7 -0
- package/esm/logo/Logo.js +29 -0
- package/esm/logo/Logo.js.map +1 -0
- package/esm/logo/VCAppLogo.d.ts +7 -0
- package/esm/logo/VCAppLogo.js +28 -0
- package/esm/logo/VCAppLogo.js.map +1 -0
- package/esm/logo/VCLogo.d.ts +4 -0
- package/esm/logo/VCLogo.js +33 -0
- package/esm/logo/VCLogo.js.map +1 -0
- package/esm/logo/VCLogoIcon.d.ts +4 -0
- package/esm/logo/VCLogoIcon.js +36 -0
- package/esm/logo/VCLogoIcon.js.map +1 -0
- package/esm/logo/index.d.ts +4 -0
- package/esm/logo/index.js +5 -0
- package/esm/logo/index.js.map +1 -0
- package/esm/splash/index.d.ts +3 -0
- package/esm/splash/index.js +37 -0
- package/esm/splash/index.js.map +1 -0
- package/esm/spring.d.ts +14 -0
- package/esm/spring.js +2 -0
- package/esm/spring.js.map +1 -0
- package/esm/storage/MemoryStorage.d.ts +7 -0
- package/esm/storage/MemoryStorage.js +18 -0
- package/esm/storage/MemoryStorage.js.map +1 -0
- package/esm/storage/index.d.ts +2 -0
- package/esm/storage/index.js +3 -0
- package/esm/storage/index.js.map +1 -0
- package/esm/storage/storage.d.ts +16 -0
- package/esm/storage/storage.js +87 -0
- package/esm/storage/storage.js.map +1 -0
- package/esm/storage/useStorage.d.ts +1 -0
- package/esm/storage/useStorage.js +29 -0
- package/esm/storage/useStorage.js.map +1 -0
- package/esm/tabs/Tabs.d.ts +10 -0
- package/esm/tabs/Tabs.js +95 -0
- package/esm/tabs/Tabs.js.map +1 -0
- package/esm/tabs/index.d.ts +1 -0
- package/esm/tabs/index.js +2 -0
- package/esm/tabs/index.js.map +1 -0
- package/esm/temporal/index.d.ts +2 -0
- package/esm/temporal/index.js +3 -0
- package/esm/temporal/index.js.map +1 -0
- package/esm/temporal/parse.d.ts +4 -0
- package/esm/temporal/parse.js +25 -0
- package/esm/temporal/parse.js.map +1 -0
- package/esm/temporal/polyfill.d.ts +34 -0
- package/esm/temporal/polyfill.js +10 -0
- package/esm/temporal/polyfill.js.map +1 -0
- package/esm/utils/defined.d.ts +1 -0
- package/esm/utils/defined.js +4 -0
- package/esm/utils/defined.js.map +1 -0
- package/esm/utils/index.d.ts +3 -0
- package/esm/utils/index.js +4 -0
- package/esm/utils/index.js.map +1 -0
- package/esm/utils/useFlag.d.ts +1 -0
- package/esm/utils/useFlag.js +9 -0
- package/esm/utils/useFlag.js.map +1 -0
- package/esm/utils/useIsMounted.d.ts +1 -0
- package/esm/utils/useIsMounted.js +12 -0
- package/esm/utils/useIsMounted.js.map +1 -0
- package/esm/view/View.d.ts +9 -0
- package/esm/view/View.js +22 -0
- package/esm/view/View.js.map +1 -0
- package/esm/view/ViewHeader.d.ts +10 -0
- package/esm/view/ViewHeader.js +15 -0
- package/esm/view/ViewHeader.js.map +1 -0
- package/esm/view/index.d.ts +2 -0
- package/esm/view/index.js +3 -0
- package/esm/view/index.js.map +1 -0
- package/package.json +72 -0
- package/src/AppShell/AppShell.tsx +165 -0
- package/src/AppShell/index.tsx +1 -0
- package/src/ErrorAlert.tsx +71 -0
- package/src/Input/ActionsMenu.tsx +102 -0
- package/src/Input/Checkbox.tsx +33 -0
- package/src/Input/EmailSenderField.tsx +64 -0
- package/src/Input/NumberField.tsx +127 -0
- package/src/Input/RadioGroup.tsx +37 -0
- package/src/Input/Select.tsx +33 -0
- package/src/Input/Selector.tsx +21 -0
- package/src/Input/Switch.tsx +33 -0
- package/src/Input/TextField.tsx +69 -0
- package/src/Input/UrlUploadField.tsx +84 -0
- package/src/Input/index.ts +9 -0
- package/src/LanguageSwitcher/LanguageSwitcher.tsx +63 -0
- package/src/LanguageSwitcher/index.ts +1 -0
- package/src/Paging/Paging.ts +77 -0
- package/src/Paging/index.ts +1 -0
- package/src/VCThemeProvider/JetbrainsMonoFont.tsx +55 -0
- package/src/VCThemeProvider/RobotoFont.tsx +52 -0
- package/src/VCThemeProvider/ThemeModeSwitcher.tsx +23 -0
- package/src/VCThemeProvider/VCThemeProvider.tsx +232 -0
- package/src/VCThemeProvider/code-colors.ts +34 -0
- package/src/VCThemeProvider/files.d.ts +2 -0
- package/src/VCThemeProvider/index.ts +5 -0
- package/src/audit/AuditChanges.tsx +82 -0
- package/src/audit/AuditTimeline.tsx +25 -0
- package/src/audit/AuditTimelineItem.tsx +75 -0
- package/src/audit/index.ts +4 -0
- package/src/audit/types.ts +46 -0
- package/src/breadcrumbs.tsx +27 -0
- package/src/code/Code.tsx +53 -0
- package/src/code/CodeBlock.tsx +15 -0
- package/src/code/Json.tsx +73 -0
- package/src/code/index.ts +3 -0
- package/src/confirm/ConfirmButton.tsx +69 -0
- package/src/confirm/ConfirmDialog.tsx +68 -0
- package/src/confirm/ConfirmIconButton.tsx +62 -0
- package/src/confirm/ConfirmMenuItem.tsx +66 -0
- package/src/confirm/index.ts +4 -0
- package/src/container/ContainerLayout.tsx +40 -0
- package/src/container/ContainerSettingsContext.tsx +77 -0
- package/src/container/ContainerWidthControl.tsx +20 -0
- package/src/container/index.ts +3 -0
- package/src/content-table/ContentTable.tsx +214 -0
- package/src/content-table/UndrawEmpty.tsx +285 -0
- package/src/content-table/index.ts +1 -0
- package/src/country/countries.ts +268 -0
- package/src/country/country-select.tsx +48 -0
- package/src/country/index.ts +5 -0
- package/src/country/locale-select.tsx +43 -0
- package/src/country/locales.ts +192 -0
- package/src/country/phone-prefix-select.tsx +50 -0
- package/src/cube/BoxFeatures.tsx +91 -0
- package/src/cube/BoxMaintenanceChip.tsx +33 -0
- package/src/cube/BoxNumber.tsx +10 -0
- package/src/cube/BoxType.tsx +22 -0
- package/src/cube/CubeConnectedChip.tsx +16 -0
- package/src/cube/LockStatusChip.tsx +54 -0
- package/src/cube/UtilizationBar.tsx +94 -0
- package/src/cube/accessibility.tsx +422 -0
- package/src/cube/index.tsx +8 -0
- package/src/data-table/DataTable.tsx +338 -0
- package/src/data-table/DataTableColumnSettings.tsx +204 -0
- package/src/data-table/DataTableHeader.tsx +10 -0
- package/src/data-table/DataTableToolbar.tsx +10 -0
- package/src/data-table/index.tsx +8 -0
- package/src/data-table/useDataTableColumnStorage.ts +26 -0
- package/src/data-table/useDataTableStorage.ts +43 -0
- package/src/data-table/useSpringPage.ts +21 -0
- package/src/data-table/useSpringPageable.ts +25 -0
- package/src/date-pickers/PlainAdapterCommon.ts +125 -0
- package/src/date-pickers/PlainDateAdapter.spec.ts +50 -0
- package/src/date-pickers/PlainDateAdapter.ts +139 -0
- package/src/date-pickers/PlainDatePicker.spec.tsx +22 -0
- package/src/date-pickers/PlainDatePicker.tsx +73 -0
- package/src/date-pickers/PlainDateTimeAdapter.spec.ts +50 -0
- package/src/date-pickers/PlainDateTimeAdapter.ts +140 -0
- package/src/date-pickers/PlainDateTimePicker.spec.tsx +22 -0
- package/src/date-pickers/PlainDateTimePicker.tsx +65 -0
- package/src/date-pickers/PlainTimeAdapter.ts +247 -0
- package/src/date-pickers/PlainTimePicker.spec.tsx +22 -0
- package/src/date-pickers/PlainTimePicker.tsx +45 -0
- package/src/date-pickers/TemporalAdapter.ts +150 -0
- package/src/date-pickers/TimezoneSelect.tsx +387 -0
- package/src/date-pickers/getFormatString.ts +38 -0
- package/src/date-pickers/index.ts +5 -0
- package/src/date-pickers/parse.spec.ts +43 -0
- package/src/date-pickers/parse.ts +72 -0
- package/src/date-pickers/timeframe-picker.tsx +202 -0
- package/src/date-pickers/useLocale.ts +6 -0
- package/src/date-pickers/useRenderInput.tsx +20 -0
- package/src/fetch.spec.ts +85 -0
- package/src/fetch.ts +165 -0
- package/src/filter/Filter.tsx +194 -0
- package/src/filter/index.ts +1 -0
- package/src/formats/CompactFormat.spec.tsx +25 -0
- package/src/formats/CompactFormat.tsx +48 -0
- package/src/formats/CurrencyFormat.spec.tsx +25 -0
- package/src/formats/CurrencyFormat.tsx +77 -0
- package/src/formats/DecimalFormat.spec.tsx +25 -0
- package/src/formats/DecimalFormat.tsx +59 -0
- package/src/formats/DurationFormat.spec.tsx +57 -0
- package/src/formats/DurationFormat.tsx +72 -0
- package/src/formats/RelativeTemporalFormat.spec.tsx +84 -0
- package/src/formats/RelativeTemporalFormat.tsx +86 -0
- package/src/formats/SwitchableTemporalFormat.tsx +17 -0
- package/src/formats/TemporalFormat.spec.tsx +110 -0
- package/src/formats/TemporalFormat.tsx +58 -0
- package/src/formats/TemporalRangeFormat.spec.tsx +159 -0
- package/src/formats/TemporalRangeFormat.tsx +62 -0
- package/src/formats/index.ts +8 -0
- package/src/formats/types.ts +4 -0
- package/src/formats/useDateTimeFormat.ts +7 -0
- package/src/formats/useNumberFormat.ts +6 -0
- package/src/formats/useRelativeTimeFormat.ts +6 -0
- package/src/forms/EditForm.tsx +69 -0
- package/src/forms/SearchForm.tsx +51 -0
- package/src/forms/SubmitButton.tsx +34 -0
- package/src/forms/index.ts +4 -0
- package/src/forms/useFormSubmit.tsx +28 -0
- package/src/getNavigatorLanguages.ts +11 -0
- package/src/getSupportedFormatLocale.ts +24 -0
- package/src/help/HelpButton.tsx +134 -0
- package/src/help/HelpDrawer.tsx +65 -0
- package/src/help/HelpSettingsContext.tsx +178 -0
- package/src/help/index.ts +3 -0
- package/src/icons.ts +23 -0
- package/src/index.ts +34 -0
- package/src/layout/ErrorBoundary.tsx +232 -0
- package/src/layout/NotFound.tsx +51 -0
- package/src/layout/NotFoundSvg.tsx +172 -0
- package/src/layout/UserNav.tsx +107 -0
- package/src/layout/index.ts +5 -0
- package/src/layout/layout-context.tsx +40 -0
- package/src/layout/page-title.tsx +33 -0
- package/src/list/List.tsx +40 -0
- package/src/list/SkeletonListItem.tsx +50 -0
- package/src/list/index.tsx +1 -0
- package/src/localization.tsx +404 -0
- package/src/logo/Logo.tsx +35 -0
- package/src/logo/VCAppLogo.tsx +28 -0
- package/src/logo/VCLogo.tsx +56 -0
- package/src/logo/VCLogoIcon.tsx +55 -0
- package/src/logo/V_C_LOGO.svg +1 -0
- package/src/logo/V_C_LOGO_ICON.svg +1 -0
- package/src/logo/V_C_LOGO_ICON_WHITE.svg +1 -0
- package/src/logo/V_C_LOGO_WHITE.svg +1 -0
- package/src/logo/index.tsx +4 -0
- package/src/splash/index.tsx +34 -0
- package/src/splash/template.html +86 -0
- package/src/spring.ts +15 -0
- package/src/storage/MemoryStorage.ts +21 -0
- package/src/storage/index.ts +2 -0
- package/src/storage/storage.ts +97 -0
- package/src/storage/useStorage.ts +35 -0
- package/src/tabs/Tabs.tsx +187 -0
- package/src/tabs/index.ts +1 -0
- package/src/temporal/index.ts +2 -0
- package/src/temporal/parse.ts +29 -0
- package/src/temporal/polyfill.ts +36 -0
- package/src/utils/defined.ts +4 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/useFlag.ts +9 -0
- package/src/utils/useIsMounted.ts +12 -0
- package/src/view/View.tsx +22 -0
- package/src/view/ViewHeader.tsx +35 -0
- package/src/view/index.ts +2 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import React, { createContext, PropsWithChildren, useCallback, useContext, useMemo } from "react";
|
|
2
|
+
import { createTheme, CssBaseline, decomposeColor, PaletteMode, ThemeOptions, ThemeProvider, useMediaQuery } from "@mui/material";
|
|
3
|
+
import { useStorage } from "../storage";
|
|
4
|
+
import { RobotoFont } from "./RobotoFont";
|
|
5
|
+
import deepmerge from "deepmerge";
|
|
6
|
+
import { JetbrainsMonoFont } from "./JetbrainsMonoFont";
|
|
7
|
+
|
|
8
|
+
const DEFAULT_PRIMARY = "#ff6a00";
|
|
9
|
+
const DEFAULT_SECONDARY = "#009dd8";
|
|
10
|
+
|
|
11
|
+
const SUCCESS = {
|
|
12
|
+
light: "#429945",
|
|
13
|
+
dark: "#58cc5c"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const WARNING = {
|
|
17
|
+
light: "#ccaa00",
|
|
18
|
+
dark: "#e6bf00"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ERROR = {
|
|
22
|
+
light: "#aa0000",
|
|
23
|
+
dark: "#e62e2e"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const INFO = {
|
|
27
|
+
light: "#082480",
|
|
28
|
+
dark: "#294fcc"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const BACKGROUND = {
|
|
32
|
+
light: "#fffaf7",
|
|
33
|
+
dark: "#15161a"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const PAPER = {
|
|
37
|
+
light: "#ffffff",
|
|
38
|
+
dark: "#282b33"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const TEXT = {
|
|
42
|
+
light: "#282b33",
|
|
43
|
+
dark: "#fdfaf7"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface ThemeContextValue {
|
|
47
|
+
mode: PaletteMode;
|
|
48
|
+
setMode: (mode: PaletteMode) => any;
|
|
49
|
+
customLogo?: CustomLogo;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CustomLogo {
|
|
53
|
+
paddingX?: number | null;
|
|
54
|
+
paddingY?: number | null;
|
|
55
|
+
url: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const ThemeContext = createContext<ThemeContextValue>({
|
|
59
|
+
mode: "light",
|
|
60
|
+
setMode: () => void 0,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export interface Branding {
|
|
64
|
+
colorPrimary?: string;
|
|
65
|
+
colorSecondary?: string;
|
|
66
|
+
muiThemeOptions?: ThemeOptions;
|
|
67
|
+
logoPaddingX?: number | null;
|
|
68
|
+
logoPaddingY?: number | null;
|
|
69
|
+
logoLightUrl?: string;
|
|
70
|
+
logoDarkUrl?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface VCThemeProviderProps {
|
|
74
|
+
branding?: Branding;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function VCThemeProvider({ branding, children }: PropsWithChildren<VCThemeProviderProps>) {
|
|
78
|
+
|
|
79
|
+
// Determine default mode based on user preference
|
|
80
|
+
const userPrefersDark = useMediaQuery("(prefers-color-scheme: dark)");
|
|
81
|
+
const defaultMode = useMemo(() => userPrefersDark ? "dark" : "light", [userPrefersDark]);
|
|
82
|
+
|
|
83
|
+
// Allow overriding the default mode
|
|
84
|
+
const [modeOverride, setModeOverride] = useStorage<PaletteMode | null>("variocube-palette-mode", null);
|
|
85
|
+
|
|
86
|
+
// Select actual mode to use
|
|
87
|
+
const mode = useMemo(() => modeOverride ?? defaultMode, [modeOverride, defaultMode]);
|
|
88
|
+
|
|
89
|
+
// Allows setting the mode override. Clears the storage item if the default mode is set.
|
|
90
|
+
const setMode = useCallback((newMode: PaletteMode) => {
|
|
91
|
+
setModeOverride(newMode != defaultMode ? newMode : null);
|
|
92
|
+
}, [defaultMode]);
|
|
93
|
+
|
|
94
|
+
const {
|
|
95
|
+
colorPrimary,
|
|
96
|
+
colorSecondary,
|
|
97
|
+
logoLightUrl,
|
|
98
|
+
logoDarkUrl,
|
|
99
|
+
logoPaddingX,
|
|
100
|
+
logoPaddingY,
|
|
101
|
+
} = branding ?? {};
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
const theme = useMemo(() => {
|
|
105
|
+
|
|
106
|
+
const themeOptions: ThemeOptions = {
|
|
107
|
+
palette: {
|
|
108
|
+
mode,
|
|
109
|
+
primary: {
|
|
110
|
+
main: sanitizeColor(colorPrimary, DEFAULT_PRIMARY),
|
|
111
|
+
},
|
|
112
|
+
secondary: {
|
|
113
|
+
main: sanitizeColor(colorSecondary, DEFAULT_SECONDARY),
|
|
114
|
+
},
|
|
115
|
+
success: {
|
|
116
|
+
main: SUCCESS[mode],
|
|
117
|
+
},
|
|
118
|
+
warning: {
|
|
119
|
+
main: WARNING[mode],
|
|
120
|
+
},
|
|
121
|
+
error: {
|
|
122
|
+
main: ERROR[mode],
|
|
123
|
+
},
|
|
124
|
+
info: {
|
|
125
|
+
main: INFO[mode],
|
|
126
|
+
},
|
|
127
|
+
text: {
|
|
128
|
+
primary: TEXT[mode],
|
|
129
|
+
},
|
|
130
|
+
background: {
|
|
131
|
+
default: BACKGROUND[mode],
|
|
132
|
+
paper: PAPER[mode]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
typography: {
|
|
136
|
+
h1: {
|
|
137
|
+
fontSize: 46,
|
|
138
|
+
fontWeight: 300,
|
|
139
|
+
},
|
|
140
|
+
h2: {
|
|
141
|
+
fontSize: 29,
|
|
142
|
+
fontWeight: 500,
|
|
143
|
+
},
|
|
144
|
+
h3: {
|
|
145
|
+
fontSize: 24,
|
|
146
|
+
fontWeight: 500,
|
|
147
|
+
},
|
|
148
|
+
h4: {
|
|
149
|
+
fontSize: 20,
|
|
150
|
+
fontWeight: 500,
|
|
151
|
+
},
|
|
152
|
+
h5: {
|
|
153
|
+
fontSize: 18,
|
|
154
|
+
fontWeight: 500,
|
|
155
|
+
},
|
|
156
|
+
h6: {
|
|
157
|
+
fontSize: 18,
|
|
158
|
+
fontWeight: 500,
|
|
159
|
+
},
|
|
160
|
+
overline: {
|
|
161
|
+
fontWeight: 500,
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
components: {
|
|
165
|
+
MuiLink: {
|
|
166
|
+
defaultProps: {
|
|
167
|
+
underline: "hover"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
MuiPaper: {
|
|
171
|
+
styleOverrides: {
|
|
172
|
+
root: {
|
|
173
|
+
backgroundImage: "unset"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return createTheme(deepmerge(themeOptions, branding?.muiThemeOptions || {}));
|
|
180
|
+
}, [mode, branding]);
|
|
181
|
+
|
|
182
|
+
const customLogo = useMemo(() => {
|
|
183
|
+
const logoUrl = mode == "light" ? (logoLightUrl || logoDarkUrl) : (logoDarkUrl || logoLightUrl);
|
|
184
|
+
if (logoUrl) {
|
|
185
|
+
return {
|
|
186
|
+
url: logoUrl,
|
|
187
|
+
paddingX: logoPaddingX,
|
|
188
|
+
paddingY: logoPaddingY
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}, [logoLightUrl, logoDarkUrl, mode, logoPaddingX, logoPaddingY]);
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<ThemeProvider theme={theme}>
|
|
195
|
+
<ThemeContext.Provider value={{mode, setMode, customLogo}}>
|
|
196
|
+
<CssBaseline />
|
|
197
|
+
<RobotoFont />
|
|
198
|
+
<JetbrainsMonoFont />
|
|
199
|
+
{children}
|
|
200
|
+
</ThemeContext.Provider>
|
|
201
|
+
</ThemeProvider>
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function sanitizeColor(color: string | undefined, fallback: string) {
|
|
206
|
+
try {
|
|
207
|
+
if (color) {
|
|
208
|
+
decomposeColor(color);
|
|
209
|
+
return color;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
}
|
|
214
|
+
return fallback;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function usePaletteMode() {
|
|
218
|
+
const value = useContext(ThemeContext);
|
|
219
|
+
if (!value) {
|
|
220
|
+
throw new Error("Could not find theme context. Are you missing a VCThemeProvider in your component tree?");
|
|
221
|
+
}
|
|
222
|
+
const {mode, setMode} = value;
|
|
223
|
+
return {mode, setMode};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function useCustomLogo() {
|
|
227
|
+
const value = useContext(ThemeContext);
|
|
228
|
+
if (!value) {
|
|
229
|
+
throw new Error("Could not find theme context. Are you missing a VCThemeProvider in your component tree?");
|
|
230
|
+
}
|
|
231
|
+
return value.customLogo;
|
|
232
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {useTheme} from "@mui/material";
|
|
2
|
+
import {green, grey, lightBlue, orange, purple, teal} from "@mui/material/colors";
|
|
3
|
+
|
|
4
|
+
export const CodeColors = {
|
|
5
|
+
literal: orange,
|
|
6
|
+
number: lightBlue,
|
|
7
|
+
string: green,
|
|
8
|
+
key: purple,
|
|
9
|
+
punctuation: grey,
|
|
10
|
+
className: teal,
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
type TokenType = keyof typeof CodeColors;
|
|
14
|
+
|
|
15
|
+
export function useThemeShade() {
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
return theme.palette.mode == "light" ? 700 : 300;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function useCodeColors() {
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const shade = useThemeShade();
|
|
23
|
+
const colors = Object.entries(CodeColors)
|
|
24
|
+
.map(([key, value]) => [key as TokenType, value[shade]] as const)
|
|
25
|
+
.reduce((acc, [key, value]) => {
|
|
26
|
+
acc[key] = value;
|
|
27
|
+
return acc;
|
|
28
|
+
}, {} as Record<TokenType, string>);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
...colors,
|
|
32
|
+
keyword: theme.palette.primary.main,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {Add, ChangeCircleOutlined, Remove} from "@mui/icons-material";
|
|
2
|
+
import {Box, Chip, List, ListItem, ListItemIcon, ListItemText, Stack} from "@mui/material";
|
|
3
|
+
import React, {Fragment} from "react";
|
|
4
|
+
import {AppAuditLogEntry, JsonPatch, JsonPatchItem} from "./types";
|
|
5
|
+
import {Code} from "../code/Code";
|
|
6
|
+
import {CodeBlock} from "../code/CodeBlock";
|
|
7
|
+
import {Json} from "../code/Json";
|
|
8
|
+
|
|
9
|
+
export function AuditChanges({data, patch}: Pick<AppAuditLogEntry, "data" | "patch">) {
|
|
10
|
+
return (
|
|
11
|
+
<Stack spacing={2}>
|
|
12
|
+
{patch && <AuditPatch patch={patch} />}
|
|
13
|
+
{data && <AuditData data={data}/>}
|
|
14
|
+
</Stack>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function AuditPatch({patch}: { patch: JsonPatch }) {
|
|
19
|
+
return (
|
|
20
|
+
<List dense disablePadding>
|
|
21
|
+
{patch.map(item => (
|
|
22
|
+
<ListItem disablePadding>
|
|
23
|
+
<ListItemIcon>
|
|
24
|
+
<Chip
|
|
25
|
+
icon={getIcon(item.op)}
|
|
26
|
+
label={item.path}
|
|
27
|
+
sx={{
|
|
28
|
+
fontFamily: "Jetbrains Mono"
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
</ListItemIcon>
|
|
32
|
+
<ListItemText
|
|
33
|
+
primary={
|
|
34
|
+
<Box pl={1}>
|
|
35
|
+
{item.op == "replace" && (
|
|
36
|
+
<Fragment>
|
|
37
|
+
<Box sx={{color: "success"}}>
|
|
38
|
+
<Value value={item.value}/>
|
|
39
|
+
</Box>
|
|
40
|
+
<Box color="error">
|
|
41
|
+
<s>
|
|
42
|
+
<Value value={item.fromValue}/>
|
|
43
|
+
</s>
|
|
44
|
+
</Box>
|
|
45
|
+
</Fragment>
|
|
46
|
+
)}
|
|
47
|
+
{item.op == "add" && (
|
|
48
|
+
<div>
|
|
49
|
+
<Value value={item.value}/>
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
52
|
+
</Box>
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
</ListItem>
|
|
56
|
+
))}
|
|
57
|
+
</List>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function AuditData({data}: {data: any}) {
|
|
62
|
+
return (
|
|
63
|
+
<CodeBlock><Json data={data}/></CodeBlock>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getIcon(op: JsonPatchItem["op"]) {
|
|
68
|
+
switch (op) {
|
|
69
|
+
case "add": return <Add/>;
|
|
70
|
+
case "remove": return <Remove/>;
|
|
71
|
+
case "replace": return <ChangeCircleOutlined/>;
|
|
72
|
+
default: return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function Value({value}: { value: any }) {
|
|
77
|
+
return (
|
|
78
|
+
<Code>
|
|
79
|
+
{JSON.stringify(value, null, 4)}
|
|
80
|
+
</Code>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, {PropsWithChildren} from "react";
|
|
2
|
+
import {Timeline} from "@mui/lab";
|
|
3
|
+
import {AuditTimelineItemSkeleton} from "./AuditTimelineItem";
|
|
4
|
+
|
|
5
|
+
interface AuditTimelineProps {
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function AuditTimeline({loading, children}: PropsWithChildren<AuditTimelineProps>) {
|
|
10
|
+
if (loading) {
|
|
11
|
+
return (
|
|
12
|
+
<Timeline>
|
|
13
|
+
<AuditTimelineItemSkeleton/>
|
|
14
|
+
<AuditTimelineItemSkeleton/>
|
|
15
|
+
<AuditTimelineItemSkeleton/>
|
|
16
|
+
</Timeline>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
return (
|
|
20
|
+
<Timeline>
|
|
21
|
+
{children}
|
|
22
|
+
</Timeline>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, {ReactNode} from "react";
|
|
2
|
+
import {
|
|
3
|
+
TimelineConnector,
|
|
4
|
+
TimelineContent,
|
|
5
|
+
TimelineDot,
|
|
6
|
+
TimelineItem,
|
|
7
|
+
TimelineOppositeContent,
|
|
8
|
+
TimelineSeparator
|
|
9
|
+
} from "@mui/lab";
|
|
10
|
+
import {Box, Skeleton, Stack, Typography, useMediaQuery, useTheme} from "@mui/material";
|
|
11
|
+
|
|
12
|
+
export interface AuditTimelineItemProps {
|
|
13
|
+
created: ReactNode;
|
|
14
|
+
actor: ReactNode;
|
|
15
|
+
connector?: boolean;
|
|
16
|
+
message: ReactNode;
|
|
17
|
+
changes: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function AuditTimelineItem(props: AuditTimelineItemProps) {
|
|
21
|
+
const {
|
|
22
|
+
created,
|
|
23
|
+
actor,
|
|
24
|
+
connector = true,
|
|
25
|
+
message,
|
|
26
|
+
changes,
|
|
27
|
+
} = props;
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
const sm = useMediaQuery(theme.breakpoints.down("sm"));
|
|
30
|
+
|
|
31
|
+
const createdAndActor = (
|
|
32
|
+
<Stack spacing={1}>
|
|
33
|
+
<Box color="text.secondary">{created}</Box>
|
|
34
|
+
<Box color="text.primary">{actor}</Box>
|
|
35
|
+
</Stack>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<TimelineItem>
|
|
40
|
+
{sm
|
|
41
|
+
? <TimelineOppositeContent sx={{flex: 0, padding: 0}}/>
|
|
42
|
+
: <TimelineOppositeContent>{createdAndActor}</TimelineOppositeContent>
|
|
43
|
+
}
|
|
44
|
+
<TimelineSeparator>
|
|
45
|
+
<TimelineDot/>
|
|
46
|
+
{connector && (
|
|
47
|
+
<TimelineConnector/>
|
|
48
|
+
)}
|
|
49
|
+
</TimelineSeparator>
|
|
50
|
+
<TimelineContent>
|
|
51
|
+
<Stack spacing={1}>
|
|
52
|
+
<Typography variant="h6" sx={{transform: "translateY(-1px)"}}>
|
|
53
|
+
{message}
|
|
54
|
+
</Typography>
|
|
55
|
+
{sm && createdAndActor}
|
|
56
|
+
<Typography variant="body2">
|
|
57
|
+
{changes}
|
|
58
|
+
</Typography>
|
|
59
|
+
</Stack>
|
|
60
|
+
</TimelineContent>
|
|
61
|
+
</TimelineItem>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function AuditTimelineItemSkeleton() {
|
|
66
|
+
return (
|
|
67
|
+
<AuditTimelineItem
|
|
68
|
+
connector
|
|
69
|
+
created={<Skeleton/>}
|
|
70
|
+
actor={<Skeleton/>}
|
|
71
|
+
message={<Skeleton/>}
|
|
72
|
+
changes={<Skeleton variant="rounded" height="150px"/>}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
export interface AppAuditLogEntry {
|
|
3
|
+
created: string;
|
|
4
|
+
tenantId: string | null;
|
|
5
|
+
cubeId: string | null;
|
|
6
|
+
boxNumber: string | null;
|
|
7
|
+
occupancyId: string | null;
|
|
8
|
+
source: string | null;
|
|
9
|
+
level: string;
|
|
10
|
+
message: string;
|
|
11
|
+
referenceType: string | null;
|
|
12
|
+
referenceId: string | null;
|
|
13
|
+
type: string;
|
|
14
|
+
userId: string | null;
|
|
15
|
+
data?: any;
|
|
16
|
+
patch?: JsonPatch;
|
|
17
|
+
actor: string | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type JsonPatch = Array<JsonPatchItem>;
|
|
21
|
+
|
|
22
|
+
export type JsonPatchItem = AddPatch | RemovePatch | ReplacePatch | MovePatch | CopyPatch;
|
|
23
|
+
|
|
24
|
+
export interface Patch {
|
|
25
|
+
path: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AddPatch extends Patch {
|
|
28
|
+
op: "add";
|
|
29
|
+
value: any;
|
|
30
|
+
}
|
|
31
|
+
export interface RemovePatch extends Patch {
|
|
32
|
+
op: "remove";
|
|
33
|
+
}
|
|
34
|
+
export interface ReplacePatch extends Patch {
|
|
35
|
+
op: "replace";
|
|
36
|
+
value: any;
|
|
37
|
+
fromValue: any;
|
|
38
|
+
}
|
|
39
|
+
export interface MovePatch extends Patch {
|
|
40
|
+
op: "move";
|
|
41
|
+
from: string;
|
|
42
|
+
}
|
|
43
|
+
export interface CopyPatch extends Patch {
|
|
44
|
+
op: "copy";
|
|
45
|
+
from: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, {PropsWithChildren} from "react";
|
|
2
|
+
import {Breadcrumbs as MuiBreadcrumbs, Link, LinkProps, Typography} from "@mui/material";
|
|
3
|
+
import {ChevronRightIcon} from "./icons";
|
|
4
|
+
import {LinkTypeMap} from "@mui/material/Link/Link";
|
|
5
|
+
|
|
6
|
+
export function Breadcrumbs({children}: PropsWithChildren<{}>) {
|
|
7
|
+
return (
|
|
8
|
+
<MuiBreadcrumbs separator={<ChevronRightIcon fontSize="small"/>}>
|
|
9
|
+
{children}
|
|
10
|
+
</MuiBreadcrumbs>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function BreadcrumbLink<
|
|
15
|
+
D extends React.ElementType = LinkTypeMap['defaultComponent'],
|
|
16
|
+
P = {}
|
|
17
|
+
>(props: LinkProps<D, P>) {
|
|
18
|
+
return (
|
|
19
|
+
<Link color="inherit" {...props}/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function BreadcrumbItem({children}: PropsWithChildren<{}>) {
|
|
24
|
+
return (
|
|
25
|
+
<Typography color="textPrimary">{children}</Typography>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {darken, lighten, Typography, TypographyProps, useTheme} from "@mui/material";
|
|
2
|
+
import React, {PropsWithChildren} from "react";
|
|
3
|
+
|
|
4
|
+
export interface CodeProps {
|
|
5
|
+
variant?: TypographyProps["variant"];
|
|
6
|
+
color?: TypographyProps["color"];
|
|
7
|
+
display?: TypographyProps["display"];
|
|
8
|
+
px?: TypographyProps["px"];
|
|
9
|
+
py?: TypographyProps["py"];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function Code(props: PropsWithChildren<CodeProps>) {
|
|
13
|
+
const {
|
|
14
|
+
variant,
|
|
15
|
+
color,
|
|
16
|
+
display,
|
|
17
|
+
px = "0.25em",
|
|
18
|
+
py = 0,
|
|
19
|
+
children,
|
|
20
|
+
} = props;
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
|
|
23
|
+
const backgroundColor = theme.palette.mode == "light"
|
|
24
|
+
? darken(theme.palette.background.default, 0.04)
|
|
25
|
+
: theme.palette.background.paper;
|
|
26
|
+
|
|
27
|
+
const backgroundColorOnPaper = theme.palette.mode == "light"
|
|
28
|
+
? darken(theme.palette.background.default, 0.025)
|
|
29
|
+
: lighten(theme.palette.background.paper, 0.1);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Typography
|
|
33
|
+
component="code"
|
|
34
|
+
display={display}
|
|
35
|
+
color={color}
|
|
36
|
+
variant={variant}
|
|
37
|
+
fontFamily="Jetbrains Mono"
|
|
38
|
+
fontSize={variant ? undefined : "inherit"}
|
|
39
|
+
px={px}
|
|
40
|
+
py={py}
|
|
41
|
+
whiteSpace="break-spaces"
|
|
42
|
+
borderRadius="0.25em"
|
|
43
|
+
sx={{
|
|
44
|
+
bgcolor: backgroundColor,
|
|
45
|
+
".MuiPaper-root &": {
|
|
46
|
+
bgcolor: backgroundColorOnPaper,
|
|
47
|
+
},
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</Typography>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {Code, CodeProps} from "./Code";
|
|
2
|
+
import React, {PropsWithChildren} from "react";
|
|
3
|
+
|
|
4
|
+
export type CodeBlockProps = PropsWithChildren<Omit<CodeProps, "block">>;
|
|
5
|
+
|
|
6
|
+
export function CodeBlock(props: CodeBlockProps) {
|
|
7
|
+
return (
|
|
8
|
+
<Code
|
|
9
|
+
display="block"
|
|
10
|
+
px="0.5em"
|
|
11
|
+
py="0.25em"
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {Box} from "@mui/material";
|
|
2
|
+
import jsonLexer, {LexerTokens} from "json-lexer";
|
|
3
|
+
import React, {Fragment, useMemo} from "react";
|
|
4
|
+
import {useCodeColors} from "../VCThemeProvider";
|
|
5
|
+
|
|
6
|
+
export function Json({data}: { data: any }) {
|
|
7
|
+
const tokens = useMemo(() => {
|
|
8
|
+
const jsonString = JSON.stringify(data, null, 4);
|
|
9
|
+
return detectKeys(jsonLexer(jsonString));
|
|
10
|
+
}, [data]);
|
|
11
|
+
|
|
12
|
+
const colors = useCodeColors();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Fragment>
|
|
16
|
+
{tokens.map(({type, value, raw}) => {
|
|
17
|
+
switch (type) {
|
|
18
|
+
case "punctuator":
|
|
19
|
+
return raw;
|
|
20
|
+
case "whitespace":
|
|
21
|
+
return raw;
|
|
22
|
+
case "literal":
|
|
23
|
+
return <Box component="span" color={colors.literal}>{raw}</Box>;
|
|
24
|
+
case "number":
|
|
25
|
+
return <Box component="span" color={colors.number}>{raw}</Box>;
|
|
26
|
+
case "string":
|
|
27
|
+
return <Box component="span" color={colors.string}>{raw}</Box>;
|
|
28
|
+
case "key":
|
|
29
|
+
return <Box component="span" color={colors.key}>{value}</Box>;
|
|
30
|
+
}
|
|
31
|
+
})}
|
|
32
|
+
</Fragment>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type NodeType = "array" | "object";
|
|
37
|
+
|
|
38
|
+
function detectKeys(tokens: LexerTokens) {
|
|
39
|
+
const tree: NodeType[] = [];
|
|
40
|
+
let nextStringIsKey = false;
|
|
41
|
+
|
|
42
|
+
return tokens.map(token => {
|
|
43
|
+
if (token.type == "string" && nextStringIsKey) {
|
|
44
|
+
return {
|
|
45
|
+
...token,
|
|
46
|
+
type: "key",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (token.type == "punctuator") {
|
|
50
|
+
switch (token.value) {
|
|
51
|
+
case "{":
|
|
52
|
+
tree.push("object");
|
|
53
|
+
nextStringIsKey = true;
|
|
54
|
+
break;
|
|
55
|
+
case "[":
|
|
56
|
+
tree.push("array");
|
|
57
|
+
break;
|
|
58
|
+
case "}":
|
|
59
|
+
case "]":
|
|
60
|
+
tree.pop();
|
|
61
|
+
nextStringIsKey = tree[tree.length - 1] == "object";
|
|
62
|
+
break;
|
|
63
|
+
case ":":
|
|
64
|
+
nextStringIsKey = false;
|
|
65
|
+
break;
|
|
66
|
+
case ",":
|
|
67
|
+
nextStringIsKey = tree[tree.length - 1] == "object";
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return token;
|
|
72
|
+
});
|
|
73
|
+
}
|