@capillarytech/blaze-ui 2.0.2 → 2.0.3
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 +34 -7
- package/dist/CapAlert/CapAlert.d.ts +1 -1
- package/dist/CapAlert/__snapshots__/CapAlert.test.tsx.snap +48 -0
- package/dist/CapAlert/index.js +1 -1
- package/dist/CapAlert/index.js.map +1 -1
- package/dist/CapDivider/CapDivider.d.ts +12 -6
- package/dist/CapDivider/CapDivider.d.ts.map +1 -1
- package/dist/CapDivider/__snapshots__/CapDivider.test.tsx.snap +69 -6
- package/dist/CapDivider/index.js +13 -9
- package/dist/CapDivider/index.js.map +1 -1
- package/dist/CapDropdown/index.js +4 -4
- package/dist/CapDropdown/index.js.map +1 -1
- package/dist/CapInput/Number.d.ts +1 -2
- package/dist/CapInput/Number.d.ts.map +1 -1
- package/dist/CapInput/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -55
- package/dist/index.js.map +1 -1
- package/dist/utils/fonts.d.ts +8 -8
- package/dist/utils/fonts.d.ts.map +1 -1
- package/dist/utils/getCapThemeConfig.d.ts +7 -0
- package/dist/utils/getCapThemeConfig.d.ts.map +1 -1
- package/dist/utils/index.d.ts +10 -10
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +17391 -214
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/styles.d.ts +2 -2
- package/package.json +2 -2
package/dist/utils/fonts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Font configuration for
|
|
2
|
+
* Font configuration for Cap UI
|
|
3
3
|
* Centralized font management for consistent typography across applications
|
|
4
4
|
*/
|
|
5
5
|
export interface FontConfig {
|
|
@@ -11,7 +11,7 @@ export interface FontConfig {
|
|
|
11
11
|
robotoWeights?: number[];
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Loads
|
|
14
|
+
* Loads Cap UI fonts into the document head
|
|
15
15
|
*
|
|
16
16
|
* This function should be called once when your application initializes.
|
|
17
17
|
* It's safe to call multiple times - it will check if fonts are already loaded.
|
|
@@ -20,19 +20,19 @@ export interface FontConfig {
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* import {
|
|
23
|
+
* import { loadCapUIFonts } from '@capillarytech/blaze-ui';
|
|
24
24
|
*
|
|
25
25
|
* // Load all fonts (default)
|
|
26
|
-
*
|
|
26
|
+
* loadCapUIFonts();
|
|
27
27
|
*
|
|
28
28
|
* // Load only Roboto with custom weights
|
|
29
|
-
*
|
|
29
|
+
* loadCapUIFonts({
|
|
30
30
|
* loadMaterialIcons: false,
|
|
31
31
|
* robotoWeights: [400, 500, 700]
|
|
32
32
|
* });
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare const
|
|
35
|
+
export declare const loadCapUIFonts: (config?: FontConfig) => void;
|
|
36
36
|
/**
|
|
37
37
|
* Creates HTML link tags for fonts (useful for SSR or static HTML)
|
|
38
38
|
*
|
|
@@ -42,8 +42,8 @@ export declare const loadBlazeUIFonts: (config?: FontConfig) => void;
|
|
|
42
42
|
* @example
|
|
43
43
|
* ```html
|
|
44
44
|
* <!-- In your HTML head -->
|
|
45
|
-
* ${
|
|
45
|
+
* ${getCapUIFontLinks().join('\n')}
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
export declare const
|
|
48
|
+
export declare const getCapUIFontLinks: (config?: FontConfig) => string[];
|
|
49
49
|
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../components/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AA4FD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../components/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AA4FD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,SAAQ,UAAe,KAAG,IAUxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAQ,UAAe,KAAG,MAAM,EAkBjE,CAAC"}
|
|
@@ -4,6 +4,13 @@ import { ThemeConfig } from 'antd-v5';
|
|
|
4
4
|
* This function maps Capillary design tokens to Ant Design tokens,
|
|
5
5
|
* eliminating the need for SCSS overrides.
|
|
6
6
|
*
|
|
7
|
+
* **⚠️ Accessibility Note:**
|
|
8
|
+
* This function converts rem values to px for Ant Design theme tokens.
|
|
9
|
+
* This means Ant Design components will not scale with user browser font size settings,
|
|
10
|
+
* while Cap UI components (which use rem) will scale. This creates inconsistent
|
|
11
|
+
* behavior and violates WCAG 2.1 SC 1.4.4 (Resize text). Consider using rem values
|
|
12
|
+
* directly in theme config when Ant Design v6 supports it, or use CSS custom properties.
|
|
13
|
+
*
|
|
7
14
|
* @param options - Optional theme configuration overrides
|
|
8
15
|
* @returns Ant Design ThemeConfig object
|
|
9
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCapThemeConfig.d.ts","sourceRoot":"","sources":["../../components/utils/getCapThemeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"getCapThemeConfig.d.ts","sourceRoot":"","sources":["../../components/utils/getCapThemeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAmEtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAsP7E"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ export * from './fonts';
|
|
|
4
4
|
export type { FontConfig } from './fonts';
|
|
5
5
|
export { getCapThemeConfig } from './getCapThemeConfig';
|
|
6
6
|
/**
|
|
7
|
-
* Configuration for
|
|
7
|
+
* Configuration for Cap UI initialization
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface CapUIConfig extends FontConfig {
|
|
10
10
|
/** Base font size for rem calculations (default: '14px') */
|
|
11
11
|
baseFontSize?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Loads
|
|
14
|
+
* Loads Cap UI fonts and base styles (sanitize.css) together
|
|
15
15
|
*
|
|
16
16
|
* This is a convenience function that loads both fonts and base styles in one call.
|
|
17
17
|
* It should be called once when your application initializes.
|
|
@@ -20,26 +20,26 @@ export interface BlazeUIConfig extends FontConfig {
|
|
|
20
20
|
* - Webpack will typically deduplicate it if both resolve to the same module path in node_modules
|
|
21
21
|
* - However, if you want to avoid any potential duplication, import fonts separately:
|
|
22
22
|
* ```typescript
|
|
23
|
-
* import {
|
|
24
|
-
*
|
|
23
|
+
* import { loadCapUIFonts } from '@capillarytech/blaze-ui/utils';
|
|
24
|
+
* loadCapUIFonts();
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
-
* @param config -
|
|
27
|
+
* @param config - Cap UI configuration options
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```typescript
|
|
31
|
-
* import {
|
|
31
|
+
* import { loadCapUI } from '@capillarytech/blaze-ui/utils';
|
|
32
32
|
*
|
|
33
33
|
* // Load everything with default base font size (14px)
|
|
34
|
-
*
|
|
34
|
+
* loadCapUI();
|
|
35
35
|
*
|
|
36
36
|
* // Load with custom font configuration and base font size
|
|
37
|
-
*
|
|
37
|
+
* loadCapUI({
|
|
38
38
|
* loadMaterialIcons: false,
|
|
39
39
|
* robotoWeights: [400, 500, 700],
|
|
40
40
|
* baseFontSize: '16px'
|
|
41
41
|
* });
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
export declare const
|
|
44
|
+
export declare const loadCapUI: (config?: CapUIConfig) => void;
|
|
45
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,UAAU,CAAC;AAElB,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,UAAU,CAAC;AAElB,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,SAAS,GAAI,SAAQ,WAAgB,KAAG,IAWpD,CAAC"}
|