@majoo-ui/react 2.0.1 → 2.1.0-rc.1
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/charts.esm.js +3 -1453
- package/colors/Colors.esm.js +93 -0
- package/components/accordion/Accordion.esm.js +109 -0
- package/components/alertDialog/AlertDialog.esm.js +440 -0
- package/components/avatar/Avatar.esm.js +83 -0
- package/components/badge/Badge.esm.js +255 -0
- package/components/banner/Banner.esm.js +341 -0
- package/components/barChart/BarChart.esm.js +212 -0
- package/components/breadcrumb/Breadcrumb.esm.js +65 -0
- package/components/breadcrumb/index.esm.js +19 -0
- package/components/button/Button.esm.js +331 -0
- package/components/buttonGroup/ButtonGroup.esm.js +350 -0
- package/components/card/Card.esm.js +236 -0
- package/components/chart/assets/data_kosong.png.esm.js +3 -0
- package/components/chart/lineChart/LineChart.esm.js +358 -0
- package/components/chart/lineChart/components/Comparator.esm.js +82 -0
- package/components/chart/lineChart/components/ComparatorController.esm.js +112 -0
- package/components/chart/lineChart/components/ComparatorItem.esm.js +104 -0
- package/components/chart/lineChart/components/ProductList.esm.js +78 -0
- package/components/chart/lineChart/components/TitleLegend.esm.js +107 -0
- package/components/chart/lineChart/components/Tooltip.esm.js +90 -0
- package/components/chart/utils/index.esm.js +109 -0
- package/components/checkboxTable/CheckboxTable.esm.js +287 -0
- package/components/colorPicker/ColorPicker.esm.js +342 -0
- package/components/colorPicker/InputColorPicker.esm.js +120 -0
- package/components/colorPicker/assets/img_colormap.gif.esm.js +3 -0
- package/components/colorPicker/components/ColorFields.esm.js +144 -0
- package/components/colorPicker/components/ColorMap.esm.js +1188 -0
- package/components/contentEditor/ContentEditor.esm.js +251 -0
- package/components/contentEditor/assets/Inline-code-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Link-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/List-bulleted-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/List-numbered-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Redo-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-bold-filled.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-clear-format-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-italic-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-strikethrough-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-underline-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Undo-outline.svg.esm.js +3 -0
- package/components/contextMenu/ContextMenu.esm.js +298 -0
- package/components/datePicker/AdvancedOption.esm.js +37 -0
- package/components/datePicker/CustomDatePicker.esm.js +121 -0
- package/components/datePicker/DatePicker.esm.js +244 -0
- package/components/datePicker/DatePickerMulti.esm.js +70 -0
- package/components/datePicker/InputDatePicker.esm.js +290 -0
- package/components/datePicker/InputDateRangePicker.esm.js +174 -0
- package/components/datePicker/components/Calendar.esm.js +654 -0
- package/components/datePicker/components/CalendarMulti.esm.js +407 -0
- package/components/datePicker/components/CalendarTimePicker.esm.js +104 -0
- package/components/datePicker/components/DateNumber.esm.js +89 -0
- package/components/datePicker/components/MobileCalendar.esm.js +522 -0
- package/components/datePicker/state/reducer.esm.js +286 -0
- package/components/datePicker/timePicker/InputTimePicker.esm.js +205 -0
- package/components/datePicker/timePicker/TimePicker.esm.js +481 -0
- package/components/devicePreview/DevicePreview.esm.js +631 -0
- package/components/devicePreview/deviceFrame/android-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/android-wide-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-email.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-notification.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-sms.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-whatsapp.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/desktop-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/iphone-transparant.png.esm.js +3 -0
- package/components/dialog/Dialog.esm.js +106 -0
- package/components/drawer/Drawer.esm.js +294 -0
- package/components/dropdownMenu/DropdownMenu.esm.js +281 -0
- package/components/editableTable/EditableMobile.esm.js +361 -0
- package/components/editableTable/EditableTable.esm.js +618 -0
- package/components/editableTable/transition.esm.js +37 -0
- package/components/form/components/FormGroup/FormGroup.esm.js +142 -0
- package/components/form/components/FormHelper/Helper.esm.js +50 -0
- package/components/form/components/FormLabel/Label.esm.js +90 -0
- package/components/form/components/InputAddon/InputAddon.esm.js +105 -0
- package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +60 -0
- package/components/form/components/InputCheckbox/InputCheckbox.esm.js +129 -0
- package/components/form/components/InputCheckbox/icon/CheckOutline.esm.js +33 -0
- package/components/form/components/InputCheckbox/icon/MinusOutline.esm.js +33 -0
- package/components/form/components/InputCombobox/InputCombobox.esm.js +169 -0
- package/components/form/components/InputCounter/InputCounter.esm.js +226 -0
- package/components/form/components/InputCreatable/InputCreatable.esm.js +229 -0
- package/components/form/components/InputDateRange/InputDateRange.esm.js +46 -0
- package/components/form/components/InputElement/InputElement.esm.js +35 -0
- package/components/form/components/InputGroup/InputGroup.esm.js +188 -0
- package/components/form/components/InputLetter/InputLetter.esm.js +68 -0
- package/components/form/components/InputNumber/InputNumber.esm.js +248 -0
- package/components/form/components/InputNumber/NumberFormat.esm.js +1263 -0
- package/components/form/components/InputOTP/InputOTP.esm.js +70 -0
- package/components/form/components/InputRadio/InputRadio.esm.js +273 -0
- package/components/form/components/InputRadio/InputRadioGroup.esm.js +35 -0
- package/components/form/components/InputRadio/context.esm.js +5 -0
- package/components/form/components/InputResourceList/InputResourceList.esm.js +429 -0
- package/components/form/components/InputSearchbox/CloseFilled.esm.js +34 -0
- package/components/form/components/InputSearchbox/InputSearchbox.esm.js +90 -0
- package/components/form/components/InputSearchbox/SearchOutline.esm.js +26 -0
- package/components/form/components/InputSelect/InputSelect.esm.js +964 -0
- package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +1388 -0
- package/components/form/components/InputSelectCheck/OptionGroupItem.esm.js +39 -0
- package/components/form/components/InputSelectCheck/icon/CheckOutline.esm.js +33 -0
- package/components/form/components/InputSelectTag/InputSelectTag.esm.js +62 -0
- package/components/form/components/InputSignature/InputSignature.esm.js +122 -0
- package/components/form/components/InputSignature/SignatureModal.esm.js +67 -0
- package/components/form/components/InputSwitch/InputSwitch.esm.js +96 -0
- package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +136 -0
- package/components/form/components/InputTags/InputTags.esm.js +268 -0
- package/components/form/components/InputText/InputText.esm.js +197 -0
- package/components/form/components/InputTextArea/InputTextArea.esm.js +77 -0
- package/components/heading/Heading.esm.js +64 -0
- package/components/iconButton/IconButton.esm.js +71 -0
- package/components/image/Image.esm.js +141 -0
- package/components/link/Link.esm.js +59 -0
- package/components/loadingBar/LoadingBar.esm.js +113 -0
- package/components/mapPicker/InputMapPicker.esm.js +160 -0
- package/components/mapPicker/MapPicker.esm.js +122 -0
- package/components/mapPicker/MapPicker.styles.esm.js +70 -0
- package/components/mapPicker/assets/images/Mapsicle.png.esm.js +3 -0
- package/components/mapPicker/components/AddressCard.esm.js +25 -0
- package/components/mapPicker/components/ButtonSelect.esm.js +46 -0
- package/components/mapPicker/components/ChangeView.esm.js +20 -0
- package/components/mapPicker/components/InputSearch.esm.js +74 -0
- package/components/mapPicker/components/MarkerIcon.esm.js +22 -0
- package/components/mapPicker/components/MarkerSvg.esm.js +62 -0
- package/components/mapPicker/components/ZoomControls.esm.js +36 -0
- package/components/mapPicker/hooks/useMapSearch.esm.js +161 -0
- package/components/modalDialog/ModalDialog.esm.js +247 -0
- package/components/notificationBadge/NotificationBadge.esm.js +149 -0
- package/components/pageDialog/PageDialog.esm.js +291 -0
- package/components/pageDialog/logo.svg.esm.js +3 -0
- package/components/pagination/Pagination.esm.js +94 -0
- package/components/pagination/PaginationButton.esm.js +346 -0
- package/components/pagination/PaginationInfo.esm.js +146 -0
- package/components/paper/Paper.esm.js +76 -0
- package/components/paragraph/Paragraph.esm.js +52 -0
- package/components/pieChart/PieChart.esm.js +287 -0
- package/components/popover/Popover.esm.js +142 -0
- package/components/progress/Progress.esm.js +170 -0
- package/components/progressIndicator/ProgressIndicator.esm.js +287 -0
- package/components/scrollSync/ScrollSync.esm.js +172 -0
- package/components/scrollSync/ScrollSyncNode.esm.js +87 -0
- package/components/scrollSync/utils.esm.js +9 -0
- package/components/separator/Separator.esm.js +43 -0
- package/components/skeleton/Skeleton.esm.js +131 -0
- package/components/slider/Slider.esm.js +345 -0
- package/components/stepWizard/StepWizard.esm.js +451 -0
- package/components/stepWizard/index.esm.js +14 -0
- package/components/table/MobileTable.esm.js +415 -0
- package/components/table/Table.esm.js +1472 -0
- package/components/table/components/columns/DateColumn.esm.js +26 -0
- package/components/table/components/columns/DecimalColumn.esm.js +36 -0
- package/components/table/components/columns/PriceColumn.esm.js +57 -0
- package/components/table/components/columns/RowDraggableColumn.esm.js +24 -0
- package/components/table/components/columns/RowExpanderColumn.esm.js +32 -0
- package/components/table/components/columns/RowExpanderMultipleColumn.esm.js +24 -0
- package/components/table/components/columns/RowMenuColumn.esm.js +101 -0
- package/components/table/components/columns/RowSelectionCallbackColumn.esm.js +38 -0
- package/components/table/components/columns/RowSelectionColumn.esm.js +34 -0
- package/components/table/images/img-emptydata.webp.esm.js +3 -0
- package/components/table/images/img-emptysearchdata.webp.esm.js +3 -0
- package/components/tableOfContent/TableOfContent.esm.js +267 -0
- package/components/tableOfContent/index.esm.js +18 -0
- package/components/tableOfContent/transition.esm.js +38 -0
- package/components/tabs/Tabs.esm.js +282 -0
- package/components/tag/Tag.esm.js +161 -0
- package/components/tagList/TagList.esm.js +90 -0
- package/components/tagStatus/TagStatus.esm.js +134 -0
- package/components/text/Text.esm.js +140 -0
- package/components/toast/Toast.esm.js +297 -0
- package/components/toast/ToastContainer.esm.js +73 -0
- package/components/toast/context/ToastContext.esm.js +5 -0
- package/components/toast/context/ToastProvider.esm.js +96 -0
- package/components/tooltip/Tooltip.esm.js +175 -0
- package/components/upload/Upload.esm.js +1103 -0
- package/components/upload/utils/canvasPreview.esm.js +39 -0
- package/components/upload/utils/imgPreview.esm.js +21 -0
- package/config/stitches.config.esm.js +216 -0
- package/editor.esm.js +1 -264
- package/hooks/useListOption/useListOption.esm.js +56 -0
- package/hooks/useToggle/useToggle.esm.js +8 -0
- package/index.esm.js +106 -42293
- package/layout/box/Box.esm.js +24 -0
- package/layout/flex/Flex.esm.js +135 -0
- package/layout/grid/Grid.esm.js +270 -0
- package/layout/pageContainer/PageContainer.esm.js +60 -0
- package/majoo-provider/MajooProvider.esm.js +42 -0
- package/majoo-provider/ThemeProvider.esm.js +41 -0
- package/majoo-provider/globalStyles.esm.js +242 -0
- package/majoo-provider/styles/modern-normalize.esm.js +95 -0
- package/map.esm.js +2 -734
- package/package.json +8 -4
- package/utils/calendar.esm.js +26 -0
- package/utils/element.esm.js +21 -0
- package/utils/object.esm.js +12 -0
- package/utils/request.esm.js +74 -0
- package/utils/strings.esm.js +6 -0
- package/{useMediaQuery.esm.js → utils/useMediaQuery.esm.js} +1 -1
- package/utils/useNavigatorOnline.esm.js +19 -0
- package/utils/variant.esm.js +12 -0
- package/wrapper/ConditionalWrapper.esm.js +9 -0
- package/ModalDialog.esm.js +0 -2669
- package/Separator.esm.js +0 -3002
- package/stitches.config.esm.js +0 -2284
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import 'core-js/modules/es.iterator.constructor.js';
|
|
2
|
+
import 'core-js/modules/es.iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/es.iterator.for-each.js';
|
|
4
|
+
import 'core-js/modules/es.iterator.map.js';
|
|
5
|
+
import 'core-js/modules/es.set.difference.v2.js';
|
|
6
|
+
import 'core-js/modules/es.set.intersection.v2.js';
|
|
7
|
+
import 'core-js/modules/es.set.is-disjoint-from.v2.js';
|
|
8
|
+
import 'core-js/modules/es.set.is-subset-of.v2.js';
|
|
9
|
+
import 'core-js/modules/es.set.is-superset-of.v2.js';
|
|
10
|
+
import 'core-js/modules/es.set.symmetric-difference.v2.js';
|
|
11
|
+
import 'core-js/modules/es.set.union.v2.js';
|
|
12
|
+
import { globalCss } from '../config/stitches.config.esm.js';
|
|
13
|
+
import { normalize } from './styles/modern-normalize.esm.js';
|
|
14
|
+
|
|
15
|
+
// System fonts and fonts not available on Google Fonts - these should not be loaded
|
|
16
|
+
const SYSTEM_FONTS = new Set([
|
|
17
|
+
// Generic font families
|
|
18
|
+
'sans-serif', 'serif', 'monospace', 'cursive', 'fantasy', 'system-ui', 'ui-monospace', 'ui-sans-serif', 'ui-serif', 'ui-rounded',
|
|
19
|
+
// CSS keywords
|
|
20
|
+
'inherit', 'initial', 'unset', 'revert',
|
|
21
|
+
// Windows system fonts
|
|
22
|
+
'arial', 'helvetica', 'verdana', 'georgia', 'times new roman', 'times', 'courier new', 'courier', 'segoe ui', 'tahoma', 'trebuchet ms', 'lucida console', 'consolas', 'impact', 'comic sans ms',
|
|
23
|
+
// macOS system fonts
|
|
24
|
+
'-apple-system', 'blinkmacsystemfont', 'helvetica neue', 'san francisco', 'sf pro', 'sf pro display', 'sf pro text', 'sf mono', 'sfmono-regular', '.sfnstext-regular', '.sfns-regular', 'menlo', 'monaco', 'avenir', 'avenir next',
|
|
25
|
+
// Linux system fonts
|
|
26
|
+
'ubuntu', 'cantarell', 'droid sans', 'fira sans', 'oxygen', 'dejavu sans', 'liberation sans', 'liberation mono',
|
|
27
|
+
// Premium/Paid fonts (not on Google Fonts)
|
|
28
|
+
'operator mono', 'fira code retina', 'firacode-retina', 'andale mono', 'source code pro', 'jetbrains mono', 'sf mono']);
|
|
29
|
+
|
|
30
|
+
// Track fonts that have been loaded or attempted to avoid duplicate requests
|
|
31
|
+
const loadedFonts = new Set();
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Extracts font family names from a CSS font-family string.
|
|
35
|
+
* @param {string} fontFamilyString - CSS font-family value (e.g., 'inter, "Open Sans", Arial')
|
|
36
|
+
* @returns {string[]} - Array of font family names (lowercase)
|
|
37
|
+
*/
|
|
38
|
+
function parseFontFamilies(fontFamilyString) {
|
|
39
|
+
return fontFamilyString.split(',').map(font => font.trim().replace(/["']/g, '').toLowerCase()).filter(font => font.length > 0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Converts a font family name to Google Fonts URL format.
|
|
44
|
+
* e.g., "nunito sans" -> "Nunito+Sans"
|
|
45
|
+
* @param {string} fontFamily - Font family name (lowercase)
|
|
46
|
+
* @returns {string} - URL-formatted font name
|
|
47
|
+
*/
|
|
48
|
+
function toGoogleFontsName(fontFamily) {
|
|
49
|
+
return fontFamily.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('+');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Loads a single font from Google Fonts if not already loaded.
|
|
54
|
+
* @param {string} fontFamily - Font family name (lowercase)
|
|
55
|
+
*/
|
|
56
|
+
function loadFont(fontFamily) {
|
|
57
|
+
if (typeof document === 'undefined') return;
|
|
58
|
+
|
|
59
|
+
// Skip system fonts
|
|
60
|
+
if (SYSTEM_FONTS.has(fontFamily)) return;
|
|
61
|
+
|
|
62
|
+
// Skip if already attempted to load
|
|
63
|
+
if (loadedFonts.has(fontFamily)) return;
|
|
64
|
+
|
|
65
|
+
// Convert font name to Google Fonts format
|
|
66
|
+
const googleFontName = toGoogleFontsName(fontFamily);
|
|
67
|
+
|
|
68
|
+
// Check if a similar font URL is already in the document
|
|
69
|
+
const existingLink = document.querySelector(`link[href*="family=${googleFontName}"]`);
|
|
70
|
+
if (existingLink) {
|
|
71
|
+
loadedFonts.add(fontFamily);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Mark as attempted before loading (to prevent duplicate requests)
|
|
76
|
+
loadedFonts.add(fontFamily);
|
|
77
|
+
|
|
78
|
+
// Use common weight range for flexibility
|
|
79
|
+
const fontUrl = `https://fonts.googleapis.com/css2?family=${googleFontName}:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap`;
|
|
80
|
+
const link = document.createElement('link');
|
|
81
|
+
link.rel = 'stylesheet';
|
|
82
|
+
link.href = fontUrl;
|
|
83
|
+
// Silently fail if font doesn't exist on Google Fonts
|
|
84
|
+
link.onerror = () => {
|
|
85
|
+
/* noop: font is optional */
|
|
86
|
+
};
|
|
87
|
+
document.head.appendChild(link);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Loads missing fonts from Google Fonts.
|
|
92
|
+
* @param {string[]} requiredFonts - Array of font family names to check and load
|
|
93
|
+
*/
|
|
94
|
+
function loadMissingFonts(requiredFonts) {
|
|
95
|
+
requiredFonts.forEach(font => loadFont(font));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Scans an element for font-family styles and loads missing fonts.
|
|
100
|
+
* @param {Element} element - DOM element to scan
|
|
101
|
+
*/
|
|
102
|
+
function scanElementForFonts(element) {
|
|
103
|
+
if (!element || !element.style) return;
|
|
104
|
+
const fontFamily = element.style.fontFamily || window.getComputedStyle(element).fontFamily;
|
|
105
|
+
if (fontFamily) {
|
|
106
|
+
const fonts = parseFontFamilies(fontFamily);
|
|
107
|
+
fonts.forEach(font => {
|
|
108
|
+
if (!loadedFonts.has(font) && !SYSTEM_FONTS.has(font)) {
|
|
109
|
+
loadFont(font);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Observes the DOM for elements with font-family styles and auto-loads missing fonts.
|
|
117
|
+
* This enables automatic font loading when content from DB uses fonts not yet loaded.
|
|
118
|
+
*/
|
|
119
|
+
function observeDOMForMissingFonts() {
|
|
120
|
+
if (typeof document === 'undefined' || typeof MutationObserver === 'undefined') return;
|
|
121
|
+
|
|
122
|
+
// Initial scan of existing elements
|
|
123
|
+
const allElements = document.querySelectorAll('*');
|
|
124
|
+
allElements.forEach(scanElementForFonts);
|
|
125
|
+
|
|
126
|
+
// Observe for new elements or style changes
|
|
127
|
+
const observer = new MutationObserver(mutations => {
|
|
128
|
+
mutations.forEach(mutation => {
|
|
129
|
+
// Handle added nodes
|
|
130
|
+
if (mutation.addedNodes) {
|
|
131
|
+
mutation.addedNodes.forEach(node => {
|
|
132
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
133
|
+
scanElementForFonts(node);
|
|
134
|
+
// Also scan children
|
|
135
|
+
const children = node.querySelectorAll ? node.querySelectorAll('*') : [];
|
|
136
|
+
children.forEach(scanElementForFonts);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Handle style attribute changes
|
|
141
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
|
|
142
|
+
scanElementForFonts(mutation.target);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
observer.observe(document.body, {
|
|
147
|
+
childList: true,
|
|
148
|
+
subtree: true,
|
|
149
|
+
attributes: true,
|
|
150
|
+
attributeFilter: ['style']
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const applyGlobalStyles = (additionaStyles, theme) => {
|
|
154
|
+
// Auto-load missing fonts used in the main font family
|
|
155
|
+
const mainFonts = parseFontFamilies(theme?.fonts?.main?.value || 'inter, "Open Sans", Arial, sans-serif');
|
|
156
|
+
loadMissingFonts(mainFonts);
|
|
157
|
+
const globalStyles = globalCss({
|
|
158
|
+
...normalize
|
|
159
|
+
}, {
|
|
160
|
+
// Use raw font value from theme if available, so consumer themes
|
|
161
|
+
// (created via createTheme) correctly override the default font.
|
|
162
|
+
// Falling back to '$main' token for the default theme.
|
|
163
|
+
'html,body,#root': {
|
|
164
|
+
width: '100%',
|
|
165
|
+
height: '100%',
|
|
166
|
+
fontFamily: theme?.fonts?.main?.value || '$main'
|
|
167
|
+
},
|
|
168
|
+
'h1,h2,h3,h4,h5,h6,p': {
|
|
169
|
+
margin: '0'
|
|
170
|
+
},
|
|
171
|
+
a: {
|
|
172
|
+
color: 'inherit',
|
|
173
|
+
textDecoration: 'none'
|
|
174
|
+
},
|
|
175
|
+
img: {
|
|
176
|
+
display: 'block',
|
|
177
|
+
maxWidth: '100%'
|
|
178
|
+
},
|
|
179
|
+
// '.noscroll': { overflow: 'hidden' },
|
|
180
|
+
'.noselect': {
|
|
181
|
+
userSelect: 'none'
|
|
182
|
+
},
|
|
183
|
+
'.full-size': {
|
|
184
|
+
height: '100%',
|
|
185
|
+
width: '100%'
|
|
186
|
+
},
|
|
187
|
+
'.full-size-layout': {
|
|
188
|
+
height: '100%',
|
|
189
|
+
minHeight: '100vh',
|
|
190
|
+
width: '100%'
|
|
191
|
+
},
|
|
192
|
+
'.drag-handle': {
|
|
193
|
+
cursor: 'move',
|
|
194
|
+
display: 'inline-block',
|
|
195
|
+
'&::before': {
|
|
196
|
+
content: "'......'",
|
|
197
|
+
display: 'inline-block',
|
|
198
|
+
width: '10px',
|
|
199
|
+
wordBreak: 'break-word',
|
|
200
|
+
whiteSpace: 'normal',
|
|
201
|
+
letterSpacing: '2px',
|
|
202
|
+
lineHeight: '4.5px',
|
|
203
|
+
textAlign: 'center',
|
|
204
|
+
height: '18px'
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
'[data-reach-skip-link]': {
|
|
208
|
+
border: '0',
|
|
209
|
+
clip: 'rect(0 0 0 0)',
|
|
210
|
+
height: '1px',
|
|
211
|
+
width: '1px',
|
|
212
|
+
margin: '-1px',
|
|
213
|
+
padding: '0',
|
|
214
|
+
overflow: 'hidden',
|
|
215
|
+
position: 'absolute'
|
|
216
|
+
},
|
|
217
|
+
'[data-reach-skip-link]:focus': {
|
|
218
|
+
padding: '1rem',
|
|
219
|
+
position: 'fixed',
|
|
220
|
+
top: '10px',
|
|
221
|
+
left: '10px',
|
|
222
|
+
background: 'white',
|
|
223
|
+
zIndex: 100,
|
|
224
|
+
width: 'auto',
|
|
225
|
+
height: 'auto',
|
|
226
|
+
clip: 'auto'
|
|
227
|
+
}
|
|
228
|
+
}, {
|
|
229
|
+
...additionaStyles
|
|
230
|
+
});
|
|
231
|
+
globalStyles();
|
|
232
|
+
|
|
233
|
+
// Start observing DOM for missing fonts after styles are applied
|
|
234
|
+
if (typeof document !== 'undefined' && document.body) {
|
|
235
|
+
observeDOMForMissingFonts();
|
|
236
|
+
} else if (typeof document !== 'undefined') {
|
|
237
|
+
// Wait for DOM to be ready
|
|
238
|
+
document.addEventListener('DOMContentLoaded', observeDOMForMissingFonts);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export { applyGlobalStyles };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const normalize = {
|
|
2
|
+
'*,::before,::after': {
|
|
3
|
+
boxSizing: 'border-box'
|
|
4
|
+
},
|
|
5
|
+
html: {
|
|
6
|
+
lineHeight: 1.15,
|
|
7
|
+
WebkitTextSizeAdjust: '100%',
|
|
8
|
+
MozTabSize: '4',
|
|
9
|
+
tabSize: 4
|
|
10
|
+
},
|
|
11
|
+
body: {
|
|
12
|
+
margin: '0',
|
|
13
|
+
fontFamily: "system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji'"
|
|
14
|
+
},
|
|
15
|
+
hr: {
|
|
16
|
+
height: '0',
|
|
17
|
+
color: 'inherit'
|
|
18
|
+
},
|
|
19
|
+
'abbr[title]': {
|
|
20
|
+
textDecoration: 'underline dotted'
|
|
21
|
+
},
|
|
22
|
+
'b,strong': {
|
|
23
|
+
fontWeight: 'bolder'
|
|
24
|
+
},
|
|
25
|
+
'code,kbd,samp,pre': {
|
|
26
|
+
fontFamily: "ui-monospace,SFMono-Regular,Consolas,'Liberation Mono',Menlo,monospace",
|
|
27
|
+
fontSize: '1em'
|
|
28
|
+
},
|
|
29
|
+
small: {
|
|
30
|
+
fontSize: '80%'
|
|
31
|
+
},
|
|
32
|
+
'sub,sup': {
|
|
33
|
+
fontSize: '75%',
|
|
34
|
+
lineHeight: 0,
|
|
35
|
+
position: 'relative',
|
|
36
|
+
verticalAlign: 'baseline'
|
|
37
|
+
},
|
|
38
|
+
sub: {
|
|
39
|
+
bottom: '-0.25em'
|
|
40
|
+
},
|
|
41
|
+
sup: {
|
|
42
|
+
top: '-0.5em'
|
|
43
|
+
},
|
|
44
|
+
table: {
|
|
45
|
+
textIndent: '0',
|
|
46
|
+
borderColor: 'inherit'
|
|
47
|
+
},
|
|
48
|
+
'button,input,optgroup,select,textarea': {
|
|
49
|
+
fontFamily: 'inherit',
|
|
50
|
+
fontSize: '100%',
|
|
51
|
+
lineHeight: 1.15,
|
|
52
|
+
margin: '0'
|
|
53
|
+
},
|
|
54
|
+
'button,select': {
|
|
55
|
+
textTransform: 'none'
|
|
56
|
+
},
|
|
57
|
+
"button,[type='button'],[type='reset'],[type='submit']": {
|
|
58
|
+
WebkitAppearance: 'button'
|
|
59
|
+
},
|
|
60
|
+
'::-moz-focus-inner': {
|
|
61
|
+
borderStyle: 'none',
|
|
62
|
+
padding: '0'
|
|
63
|
+
},
|
|
64
|
+
':-moz-focusring': {
|
|
65
|
+
outline: '1px dotted ButtonText'
|
|
66
|
+
},
|
|
67
|
+
':-moz-ui-invalid': {
|
|
68
|
+
boxShadow: 'none'
|
|
69
|
+
},
|
|
70
|
+
legend: {
|
|
71
|
+
padding: '0'
|
|
72
|
+
},
|
|
73
|
+
progress: {
|
|
74
|
+
verticalAlign: 'baseline'
|
|
75
|
+
},
|
|
76
|
+
'::-webkit-inner-spin-button,::-webkit-outer-spin-button': {
|
|
77
|
+
height: 'auto'
|
|
78
|
+
},
|
|
79
|
+
"[type='search']": {
|
|
80
|
+
WebkitAppearance: 'textfield',
|
|
81
|
+
outlineOffset: '-2px'
|
|
82
|
+
},
|
|
83
|
+
'::-webkit-search-decoration': {
|
|
84
|
+
WebkitAppearance: 'none'
|
|
85
|
+
},
|
|
86
|
+
'::-webkit-file-upload-button': {
|
|
87
|
+
WebkitAppearance: 'button',
|
|
88
|
+
font: 'inherit'
|
|
89
|
+
},
|
|
90
|
+
summary: {
|
|
91
|
+
display: 'list-item'
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export { normalize };
|