@dexma/ui-components 8.0.42 → 8.0.45
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/{dist/fonts/LICENSE → FONT-LICENSE} +1 -1
- package/README.md +13 -18
- package/dist/lib/components/ConfigProvider/ConfigProvider.d.ts +1 -1
- package/dist/lib/utils/theme.d.ts +5 -4
- package/dist/ui-components.es.js +16810 -16789
- package/dist/ui-components.umd.js +399 -387
- package/package.json +9 -10
- package/dist/fonts/montserrat-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/montserrat-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/montserrat-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +0 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2015 Google LLC. All Rights Reserved.
|
|
2
2
|
|
|
3
3
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
4
|
This license is copied below, and is also available with a FAQ at:
|
package/README.md
CHANGED
|
@@ -53,21 +53,16 @@ You can find all the configuration in the theme file [theme.ts](https://github.c
|
|
|
53
53
|
|
|
54
54
|
## Typography
|
|
55
55
|
|
|
56
|
-
The platform font is **
|
|
57
|
-
other CDN) request at runtime.
|
|
56
|
+
The platform font is **Google Sans Flex**, embedded in this package — there is no font file to serve,
|
|
57
|
+
no loader rule to add and no Google Fonts (or any other CDN) request at runtime.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
`GlobalStyle` registers the font faces and applies the family; `ConfigProvider` passes it to the
|
|
60
|
+
antd-backed components. Render both once at the app root and every component, under any bundler,
|
|
61
|
+
renders the platform font. Changing the font is a new version of this package and a bump in the app.
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Without this import the UI silently renders the fallback system stack — everything works, but nothing
|
|
66
|
-
is Montserrat. `GlobalStyle` applies the font; `fonts.css` provides it. You need both.
|
|
67
|
-
|
|
68
|
-
The shipped subsets are `latin`, `latin-ext` (pl_PL) and `cyrillic` (bg_BG), each behind a
|
|
69
|
-
`unicode-range` so browsers only download what the locale needs. `zh_CN` is not covered by Montserrat
|
|
70
|
-
and intentionally falls through to the system CJK faces in the stack.
|
|
63
|
+
The embedded subsets are `latin` and `latin-ext` (pl_PL), each behind a `unicode-range` so the browser
|
|
64
|
+
only decodes what the locale needs. Google Sans Flex ships no Cyrillic or CJK subsets: `bg_BG` and
|
|
65
|
+
`zh_CN` intentionally fall through to the system faces in the stack.
|
|
71
66
|
|
|
72
67
|
Never write the font stack as a literal in an app. Where a style genuinely cannot inherit the page
|
|
73
68
|
font (shadow-DOM `::part()` rules, canvas/SVG text, server-rendered images), use the exported token:
|
|
@@ -80,11 +75,11 @@ const Styled = styled.div`
|
|
|
80
75
|
`;
|
|
81
76
|
```
|
|
82
77
|
|
|
83
|
-
The binaries come from `@fontsource-variable/
|
|
84
|
-
`scripts/buildFontConfig.mjs
|
|
85
|
-
platform font. Repositories that cannot consume this npm
|
|
86
|
-
anomaly-detection-dash-ui, detect-reports-generator) must
|
|
87
|
-
as this package's
|
|
78
|
+
The binaries come from `@fontsource-variable/google-sans-flex` (SIL OFL 1.1, text in `FONT-LICENSE`)
|
|
79
|
+
at build time via `scripts/buildFontConfig.mjs`, which embeds them as data URIs — that script's header
|
|
80
|
+
documents the checklist for changing the platform font. Repositories that cannot consume this npm
|
|
81
|
+
package (dexcell, grader-demo, is3frontend, anomaly-detection-dash-ui, detect-reports-generator) must
|
|
82
|
+
self-host the **same version** of the font as this package's devDependency, so rendering stays consistent.
|
|
88
83
|
|
|
89
84
|
## Installation
|
|
90
85
|
|
|
@@ -7,7 +7,7 @@ export type ConfigProviderProps = ComponentProps<typeof ConfigProviderAntd>;
|
|
|
7
7
|
* antd emits its own `font-family` on `.ant-*` class roots from `token.fontFamily` (default: a
|
|
8
8
|
* system stack), so antd-backed components do not inherit the family from `body`. Without this,
|
|
9
9
|
* every Table / Select / DatePicker would keep the old font while the rest of the app renders
|
|
10
|
-
*
|
|
10
|
+
* the platform font. antd merges tokens into nested providers, so mounting this once at an app root also
|
|
11
11
|
* covers the per-component providers inside the library.
|
|
12
12
|
*
|
|
13
13
|
* A caller-supplied `theme.token.fontFamily` still wins.
|
|
@@ -95,11 +95,12 @@ export declare const fontWeightSemiBold = 600;
|
|
|
95
95
|
export declare const fontWeightBold = 700;
|
|
96
96
|
/**
|
|
97
97
|
* The single definition of the platform type stack — never redeclare it in an app.
|
|
98
|
-
*
|
|
99
|
-
* `
|
|
100
|
-
* CJK glyphs, so zh_CN falls through to a proper
|
|
98
|
+
* The first family is the platform font, whose faces this package embeds and registers from
|
|
99
|
+
* `GlobalStyle` (see scripts/buildFontConfig.mjs), so consumers only need to render GlobalStyle.
|
|
100
|
+
* The CJK entries matter: the platform font has no CJK glyphs, so zh_CN falls through to a proper
|
|
101
|
+
* system face instead of the generic default; bg_BG does the same, as no Cyrillic subset ships.
|
|
101
102
|
*/
|
|
102
|
-
export declare const fontFamily = "\"
|
|
103
|
+
export declare const fontFamily = "\"Google Sans Flex\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
103
104
|
export declare const pxToRem: (px: number) => number;
|
|
104
105
|
export declare const iconSize = "1rem";
|
|
105
106
|
export declare const iconColor: string;
|