@xsolla/xui-core 0.216.0 → 0.217.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/index.d.mts +79 -23
- package/index.d.ts +79 -23
- package/index.js +141 -37
- package/index.js.map +1 -1
- package/index.mjs +140 -37
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -25,6 +25,18 @@ interface TypographyVariant {
|
|
|
25
25
|
scaleStep?: string;
|
|
26
26
|
/** The line-height category: "display", "compact", or "text" */
|
|
27
27
|
lineHeightCategory?: "display" | "compact" | "text";
|
|
28
|
+
/**
|
|
29
|
+
* Tracking in px, as authored in Figma (negative values tighten).
|
|
30
|
+
* Only the display variants define it; omitted means "normal".
|
|
31
|
+
*/
|
|
32
|
+
letterSpacing?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Which Figma "Font" role this variant renders in — `display` (heading font),
|
|
35
|
+
* `compact` (body/UI font) or `text` (paragraph font). Defaults per variant
|
|
36
|
+
* family when omitted; B2C `display-sm` is the one display token that opts
|
|
37
|
+
* into the `compact` role.
|
|
38
|
+
*/
|
|
39
|
+
fontRole?: "display" | "compact" | "text";
|
|
28
40
|
}
|
|
29
41
|
interface TypographyBodyVariant extends TypographyVariant {
|
|
30
42
|
accent?: {
|
|
@@ -46,7 +58,15 @@ interface TypographyTokens {
|
|
|
46
58
|
h5: TypographyVariant;
|
|
47
59
|
};
|
|
48
60
|
basic: {
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated Figma models three display sizes. `display` is kept as an
|
|
63
|
+
* alias of `display-lg` for source compatibility — migrate consumers to
|
|
64
|
+
* `display-lg` / `display-md` / `display-sm`.
|
|
65
|
+
*/
|
|
49
66
|
display: TypographyVariant;
|
|
67
|
+
"display-lg": TypographyVariant;
|
|
68
|
+
"display-md": TypographyVariant;
|
|
69
|
+
"display-sm": TypographyVariant;
|
|
50
70
|
"body-lg": TypographyBodyVariant;
|
|
51
71
|
"body-md": TypographyBodyVariant;
|
|
52
72
|
"body-sm": TypographyBodyVariant;
|
|
@@ -3979,18 +3999,43 @@ declare const colors: {
|
|
|
3979
3999
|
};
|
|
3980
4000
|
type ThemeColors = typeof pentagramDark;
|
|
3981
4001
|
|
|
4002
|
+
/**
|
|
4003
|
+
* Primitive spacing scale. Mirrors Figma "Scale / spacing/*" variables.
|
|
4004
|
+
*
|
|
4005
|
+
* The numeric step name is the Figma contract — prefer it over inventing new
|
|
4006
|
+
* named aliases. The semantic `spacing` object below aliases the five steps
|
|
4007
|
+
* that already had names.
|
|
4008
|
+
*/
|
|
4009
|
+
declare const spacingScale: {
|
|
4010
|
+
readonly "25": 2;
|
|
4011
|
+
readonly "50": 4;
|
|
4012
|
+
readonly "75": 6;
|
|
4013
|
+
readonly "100": 8;
|
|
4014
|
+
readonly "150": 12;
|
|
4015
|
+
readonly "200": 16;
|
|
4016
|
+
readonly "250": 20;
|
|
4017
|
+
readonly "300": 24;
|
|
4018
|
+
readonly "350": 28;
|
|
4019
|
+
readonly "400": 32;
|
|
4020
|
+
readonly "450": 36;
|
|
4021
|
+
readonly "500": 40;
|
|
4022
|
+
readonly "600": 48;
|
|
4023
|
+
readonly "700": 56;
|
|
4024
|
+
readonly "800": 64;
|
|
4025
|
+
readonly "900": 72;
|
|
4026
|
+
};
|
|
3982
4027
|
declare const spacing: {
|
|
3983
|
-
xs:
|
|
3984
|
-
sm:
|
|
3985
|
-
md:
|
|
3986
|
-
lg:
|
|
3987
|
-
xl:
|
|
4028
|
+
xs: 4;
|
|
4029
|
+
sm: 8;
|
|
4030
|
+
md: 16;
|
|
4031
|
+
lg: 24;
|
|
4032
|
+
xl: 32;
|
|
3988
4033
|
/** @deprecated Use `sm` instead (same 8px). Kept for backwards compatibility. */
|
|
3989
|
-
s:
|
|
4034
|
+
s: 8;
|
|
3990
4035
|
/** @deprecated Use `md` instead (same 16px). Kept for backwards compatibility. */
|
|
3991
|
-
m:
|
|
4036
|
+
m: 16;
|
|
3992
4037
|
/** @deprecated Use `lg` instead (same 24px). Kept for backwards compatibility. */
|
|
3993
|
-
l:
|
|
4038
|
+
l: 24;
|
|
3994
4039
|
};
|
|
3995
4040
|
declare const radius: {
|
|
3996
4041
|
button: number;
|
|
@@ -4127,6 +4172,10 @@ declare const shape: {
|
|
|
4127
4172
|
readonly borderRadius: 2;
|
|
4128
4173
|
readonly borderWidth: 1;
|
|
4129
4174
|
};
|
|
4175
|
+
readonly xs: {
|
|
4176
|
+
readonly borderRadius: 2;
|
|
4177
|
+
readonly borderWidth: 1;
|
|
4178
|
+
};
|
|
4130
4179
|
};
|
|
4131
4180
|
readonly switch: {
|
|
4132
4181
|
readonly xl: {
|
|
@@ -4283,6 +4332,8 @@ declare const shape: {
|
|
|
4283
4332
|
};
|
|
4284
4333
|
readonly toast: {
|
|
4285
4334
|
readonly borderRadius: 4;
|
|
4335
|
+
/** Figma "toast/frame/border-width" is 0 — toast is borderless by design. */
|
|
4336
|
+
readonly borderWidth: 0;
|
|
4286
4337
|
};
|
|
4287
4338
|
readonly toggleButtonGroup: {
|
|
4288
4339
|
readonly xl: {
|
|
@@ -7116,14 +7167,14 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7116
7167
|
};
|
|
7117
7168
|
};
|
|
7118
7169
|
spacing: {
|
|
7119
|
-
xs:
|
|
7120
|
-
sm:
|
|
7121
|
-
md:
|
|
7122
|
-
lg:
|
|
7123
|
-
xl:
|
|
7124
|
-
s:
|
|
7125
|
-
m:
|
|
7126
|
-
l:
|
|
7170
|
+
xs: 4;
|
|
7171
|
+
sm: 8;
|
|
7172
|
+
md: 16;
|
|
7173
|
+
lg: 24;
|
|
7174
|
+
xl: 32;
|
|
7175
|
+
s: 8;
|
|
7176
|
+
m: 16;
|
|
7177
|
+
l: 24;
|
|
7127
7178
|
};
|
|
7128
7179
|
shape: {
|
|
7129
7180
|
readonly button: {
|
|
@@ -7223,6 +7274,10 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7223
7274
|
readonly borderRadius: 2;
|
|
7224
7275
|
readonly borderWidth: 1;
|
|
7225
7276
|
};
|
|
7277
|
+
readonly xs: {
|
|
7278
|
+
readonly borderRadius: 2;
|
|
7279
|
+
readonly borderWidth: 1;
|
|
7280
|
+
};
|
|
7226
7281
|
};
|
|
7227
7282
|
readonly switch: {
|
|
7228
7283
|
readonly xl: {
|
|
@@ -7379,6 +7434,7 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7379
7434
|
};
|
|
7380
7435
|
readonly toast: {
|
|
7381
7436
|
readonly borderRadius: 4;
|
|
7437
|
+
readonly borderWidth: 0;
|
|
7382
7438
|
};
|
|
7383
7439
|
readonly toggleButtonGroup: {
|
|
7384
7440
|
readonly xl: {
|
|
@@ -7911,31 +7967,31 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7911
7967
|
};
|
|
7912
7968
|
textarea: (size: "xl" | "lg" | "md" | "sm" | "xs") => {
|
|
7913
7969
|
height: number;
|
|
7914
|
-
padding:
|
|
7970
|
+
padding: 32;
|
|
7915
7971
|
fontSize: number;
|
|
7916
7972
|
iconSize: number;
|
|
7917
7973
|
radius: 8;
|
|
7918
7974
|
} | {
|
|
7919
7975
|
height: number;
|
|
7920
|
-
padding:
|
|
7976
|
+
padding: 24;
|
|
7921
7977
|
fontSize: number;
|
|
7922
7978
|
iconSize: number;
|
|
7923
7979
|
radius: 8;
|
|
7924
7980
|
} | {
|
|
7925
7981
|
height: number;
|
|
7926
|
-
padding:
|
|
7982
|
+
padding: 16;
|
|
7927
7983
|
fontSize: number;
|
|
7928
7984
|
iconSize: number;
|
|
7929
7985
|
radius: 6;
|
|
7930
7986
|
} | {
|
|
7931
7987
|
height: number;
|
|
7932
|
-
padding:
|
|
7988
|
+
padding: 8;
|
|
7933
7989
|
fontSize: number;
|
|
7934
7990
|
iconSize: number;
|
|
7935
7991
|
radius: 4;
|
|
7936
7992
|
} | {
|
|
7937
7993
|
height: number;
|
|
7938
|
-
padding:
|
|
7994
|
+
padding: 4;
|
|
7939
7995
|
fontSize: number;
|
|
7940
7996
|
iconSize: number;
|
|
7941
7997
|
radius: 4;
|
|
@@ -8773,7 +8829,7 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
8773
8829
|
triggerGap: number;
|
|
8774
8830
|
triggerMinHeight: number;
|
|
8775
8831
|
surfaceRadius: 4;
|
|
8776
|
-
cellRadius:
|
|
8832
|
+
cellRadius: 4;
|
|
8777
8833
|
iconSlotSize: number;
|
|
8778
8834
|
iconSlotRadius: 4;
|
|
8779
8835
|
chevronSize: number;
|
|
@@ -9014,4 +9070,4 @@ declare const ModalStackProvider: React.Provider<number>;
|
|
|
9014
9070
|
/** Returns the number of currently-open modals. */
|
|
9015
9071
|
declare const useModalStackDepth: () => number;
|
|
9016
9072
|
|
|
9017
|
-
export { type BreakpointKey, type ComponentSize, DISPLAY_SCALE_STEPS, type DesignSystemContextType, type DisplayScaleStep, FontLoader, LAYER_OFFSET, MOBILE_MAX_WIDTH, MODAL_LAYER_STEP, ModalIdContext, ModalStackProvider, OVERLAY_LAYER_BASE, OverlayLayerProvider, type ProductContext, type ResponsiveValue, SCALE_STEPS, type ScaleStep, TOAST_LAYER, type Theme, type ThemeColorScheme, type ThemeColors, type ThemeFonts, type ThemeMode, type ThemeOverrideProps, type ThemeShadow, type ThemeShape, type ThemeSizing, type ThemeSpacing, type ThemeTypographyRoles, type TypographyBodyVariant, TypographyStyleLoader, type TypographyTokens, type TypographyVariant, XUIProvider, breakpoints, colors, cssVar, defaultProductContext, fontFacesCSS, fontSize, fonts, generateTypographyCSS, getFonts, getTypographyTokens, getTypographyVariant, isAndroid, isIOS, isNative, isWeb, lineHeightCompact, lineHeightDisplay, lineHeightText, radius, radiusScale, responsiveTypographyScale, shadow, shape, spacing, stroke, themeConfig, typography, typographyTokens, useDesignSystem, useId, useModalId, useModalStackDepth, useOverlayLayer, useResolvedTheme };
|
|
9073
|
+
export { type BreakpointKey, type ComponentSize, DISPLAY_SCALE_STEPS, type DesignSystemContextType, type DisplayScaleStep, FontLoader, LAYER_OFFSET, MOBILE_MAX_WIDTH, MODAL_LAYER_STEP, ModalIdContext, ModalStackProvider, OVERLAY_LAYER_BASE, OverlayLayerProvider, type ProductContext, type ResponsiveValue, SCALE_STEPS, type ScaleStep, TOAST_LAYER, type Theme, type ThemeColorScheme, type ThemeColors, type ThemeFonts, type ThemeMode, type ThemeOverrideProps, type ThemeShadow, type ThemeShape, type ThemeSizing, type ThemeSpacing, type ThemeTypographyRoles, type TypographyBodyVariant, TypographyStyleLoader, type TypographyTokens, type TypographyVariant, XUIProvider, breakpoints, colors, cssVar, defaultProductContext, fontFacesCSS, fontSize, fonts, generateTypographyCSS, getFonts, getTypographyTokens, getTypographyVariant, isAndroid, isIOS, isNative, isWeb, lineHeightCompact, lineHeightDisplay, lineHeightText, radius, radiusScale, responsiveTypographyScale, shadow, shape, spacing, spacingScale, stroke, themeConfig, typography, typographyTokens, useDesignSystem, useId, useModalId, useModalStackDepth, useOverlayLayer, useResolvedTheme };
|
package/index.d.ts
CHANGED
|
@@ -25,6 +25,18 @@ interface TypographyVariant {
|
|
|
25
25
|
scaleStep?: string;
|
|
26
26
|
/** The line-height category: "display", "compact", or "text" */
|
|
27
27
|
lineHeightCategory?: "display" | "compact" | "text";
|
|
28
|
+
/**
|
|
29
|
+
* Tracking in px, as authored in Figma (negative values tighten).
|
|
30
|
+
* Only the display variants define it; omitted means "normal".
|
|
31
|
+
*/
|
|
32
|
+
letterSpacing?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Which Figma "Font" role this variant renders in — `display` (heading font),
|
|
35
|
+
* `compact` (body/UI font) or `text` (paragraph font). Defaults per variant
|
|
36
|
+
* family when omitted; B2C `display-sm` is the one display token that opts
|
|
37
|
+
* into the `compact` role.
|
|
38
|
+
*/
|
|
39
|
+
fontRole?: "display" | "compact" | "text";
|
|
28
40
|
}
|
|
29
41
|
interface TypographyBodyVariant extends TypographyVariant {
|
|
30
42
|
accent?: {
|
|
@@ -46,7 +58,15 @@ interface TypographyTokens {
|
|
|
46
58
|
h5: TypographyVariant;
|
|
47
59
|
};
|
|
48
60
|
basic: {
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated Figma models three display sizes. `display` is kept as an
|
|
63
|
+
* alias of `display-lg` for source compatibility — migrate consumers to
|
|
64
|
+
* `display-lg` / `display-md` / `display-sm`.
|
|
65
|
+
*/
|
|
49
66
|
display: TypographyVariant;
|
|
67
|
+
"display-lg": TypographyVariant;
|
|
68
|
+
"display-md": TypographyVariant;
|
|
69
|
+
"display-sm": TypographyVariant;
|
|
50
70
|
"body-lg": TypographyBodyVariant;
|
|
51
71
|
"body-md": TypographyBodyVariant;
|
|
52
72
|
"body-sm": TypographyBodyVariant;
|
|
@@ -3979,18 +3999,43 @@ declare const colors: {
|
|
|
3979
3999
|
};
|
|
3980
4000
|
type ThemeColors = typeof pentagramDark;
|
|
3981
4001
|
|
|
4002
|
+
/**
|
|
4003
|
+
* Primitive spacing scale. Mirrors Figma "Scale / spacing/*" variables.
|
|
4004
|
+
*
|
|
4005
|
+
* The numeric step name is the Figma contract — prefer it over inventing new
|
|
4006
|
+
* named aliases. The semantic `spacing` object below aliases the five steps
|
|
4007
|
+
* that already had names.
|
|
4008
|
+
*/
|
|
4009
|
+
declare const spacingScale: {
|
|
4010
|
+
readonly "25": 2;
|
|
4011
|
+
readonly "50": 4;
|
|
4012
|
+
readonly "75": 6;
|
|
4013
|
+
readonly "100": 8;
|
|
4014
|
+
readonly "150": 12;
|
|
4015
|
+
readonly "200": 16;
|
|
4016
|
+
readonly "250": 20;
|
|
4017
|
+
readonly "300": 24;
|
|
4018
|
+
readonly "350": 28;
|
|
4019
|
+
readonly "400": 32;
|
|
4020
|
+
readonly "450": 36;
|
|
4021
|
+
readonly "500": 40;
|
|
4022
|
+
readonly "600": 48;
|
|
4023
|
+
readonly "700": 56;
|
|
4024
|
+
readonly "800": 64;
|
|
4025
|
+
readonly "900": 72;
|
|
4026
|
+
};
|
|
3982
4027
|
declare const spacing: {
|
|
3983
|
-
xs:
|
|
3984
|
-
sm:
|
|
3985
|
-
md:
|
|
3986
|
-
lg:
|
|
3987
|
-
xl:
|
|
4028
|
+
xs: 4;
|
|
4029
|
+
sm: 8;
|
|
4030
|
+
md: 16;
|
|
4031
|
+
lg: 24;
|
|
4032
|
+
xl: 32;
|
|
3988
4033
|
/** @deprecated Use `sm` instead (same 8px). Kept for backwards compatibility. */
|
|
3989
|
-
s:
|
|
4034
|
+
s: 8;
|
|
3990
4035
|
/** @deprecated Use `md` instead (same 16px). Kept for backwards compatibility. */
|
|
3991
|
-
m:
|
|
4036
|
+
m: 16;
|
|
3992
4037
|
/** @deprecated Use `lg` instead (same 24px). Kept for backwards compatibility. */
|
|
3993
|
-
l:
|
|
4038
|
+
l: 24;
|
|
3994
4039
|
};
|
|
3995
4040
|
declare const radius: {
|
|
3996
4041
|
button: number;
|
|
@@ -4127,6 +4172,10 @@ declare const shape: {
|
|
|
4127
4172
|
readonly borderRadius: 2;
|
|
4128
4173
|
readonly borderWidth: 1;
|
|
4129
4174
|
};
|
|
4175
|
+
readonly xs: {
|
|
4176
|
+
readonly borderRadius: 2;
|
|
4177
|
+
readonly borderWidth: 1;
|
|
4178
|
+
};
|
|
4130
4179
|
};
|
|
4131
4180
|
readonly switch: {
|
|
4132
4181
|
readonly xl: {
|
|
@@ -4283,6 +4332,8 @@ declare const shape: {
|
|
|
4283
4332
|
};
|
|
4284
4333
|
readonly toast: {
|
|
4285
4334
|
readonly borderRadius: 4;
|
|
4335
|
+
/** Figma "toast/frame/border-width" is 0 — toast is borderless by design. */
|
|
4336
|
+
readonly borderWidth: 0;
|
|
4286
4337
|
};
|
|
4287
4338
|
readonly toggleButtonGroup: {
|
|
4288
4339
|
readonly xl: {
|
|
@@ -7116,14 +7167,14 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7116
7167
|
};
|
|
7117
7168
|
};
|
|
7118
7169
|
spacing: {
|
|
7119
|
-
xs:
|
|
7120
|
-
sm:
|
|
7121
|
-
md:
|
|
7122
|
-
lg:
|
|
7123
|
-
xl:
|
|
7124
|
-
s:
|
|
7125
|
-
m:
|
|
7126
|
-
l:
|
|
7170
|
+
xs: 4;
|
|
7171
|
+
sm: 8;
|
|
7172
|
+
md: 16;
|
|
7173
|
+
lg: 24;
|
|
7174
|
+
xl: 32;
|
|
7175
|
+
s: 8;
|
|
7176
|
+
m: 16;
|
|
7177
|
+
l: 24;
|
|
7127
7178
|
};
|
|
7128
7179
|
shape: {
|
|
7129
7180
|
readonly button: {
|
|
@@ -7223,6 +7274,10 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7223
7274
|
readonly borderRadius: 2;
|
|
7224
7275
|
readonly borderWidth: 1;
|
|
7225
7276
|
};
|
|
7277
|
+
readonly xs: {
|
|
7278
|
+
readonly borderRadius: 2;
|
|
7279
|
+
readonly borderWidth: 1;
|
|
7280
|
+
};
|
|
7226
7281
|
};
|
|
7227
7282
|
readonly switch: {
|
|
7228
7283
|
readonly xl: {
|
|
@@ -7379,6 +7434,7 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7379
7434
|
};
|
|
7380
7435
|
readonly toast: {
|
|
7381
7436
|
readonly borderRadius: 4;
|
|
7437
|
+
readonly borderWidth: 0;
|
|
7382
7438
|
};
|
|
7383
7439
|
readonly toggleButtonGroup: {
|
|
7384
7440
|
readonly xl: {
|
|
@@ -7911,31 +7967,31 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
7911
7967
|
};
|
|
7912
7968
|
textarea: (size: "xl" | "lg" | "md" | "sm" | "xs") => {
|
|
7913
7969
|
height: number;
|
|
7914
|
-
padding:
|
|
7970
|
+
padding: 32;
|
|
7915
7971
|
fontSize: number;
|
|
7916
7972
|
iconSize: number;
|
|
7917
7973
|
radius: 8;
|
|
7918
7974
|
} | {
|
|
7919
7975
|
height: number;
|
|
7920
|
-
padding:
|
|
7976
|
+
padding: 24;
|
|
7921
7977
|
fontSize: number;
|
|
7922
7978
|
iconSize: number;
|
|
7923
7979
|
radius: 8;
|
|
7924
7980
|
} | {
|
|
7925
7981
|
height: number;
|
|
7926
|
-
padding:
|
|
7982
|
+
padding: 16;
|
|
7927
7983
|
fontSize: number;
|
|
7928
7984
|
iconSize: number;
|
|
7929
7985
|
radius: 6;
|
|
7930
7986
|
} | {
|
|
7931
7987
|
height: number;
|
|
7932
|
-
padding:
|
|
7988
|
+
padding: 8;
|
|
7933
7989
|
fontSize: number;
|
|
7934
7990
|
iconSize: number;
|
|
7935
7991
|
radius: 4;
|
|
7936
7992
|
} | {
|
|
7937
7993
|
height: number;
|
|
7938
|
-
padding:
|
|
7994
|
+
padding: 4;
|
|
7939
7995
|
fontSize: number;
|
|
7940
7996
|
iconSize: number;
|
|
7941
7997
|
radius: 4;
|
|
@@ -8773,7 +8829,7 @@ declare const themeConfig: (mode?: ThemeMode, productContext?: ProductContext) =
|
|
|
8773
8829
|
triggerGap: number;
|
|
8774
8830
|
triggerMinHeight: number;
|
|
8775
8831
|
surfaceRadius: 4;
|
|
8776
|
-
cellRadius:
|
|
8832
|
+
cellRadius: 4;
|
|
8777
8833
|
iconSlotSize: number;
|
|
8778
8834
|
iconSlotRadius: 4;
|
|
8779
8835
|
chevronSize: number;
|
|
@@ -9014,4 +9070,4 @@ declare const ModalStackProvider: React.Provider<number>;
|
|
|
9014
9070
|
/** Returns the number of currently-open modals. */
|
|
9015
9071
|
declare const useModalStackDepth: () => number;
|
|
9016
9072
|
|
|
9017
|
-
export { type BreakpointKey, type ComponentSize, DISPLAY_SCALE_STEPS, type DesignSystemContextType, type DisplayScaleStep, FontLoader, LAYER_OFFSET, MOBILE_MAX_WIDTH, MODAL_LAYER_STEP, ModalIdContext, ModalStackProvider, OVERLAY_LAYER_BASE, OverlayLayerProvider, type ProductContext, type ResponsiveValue, SCALE_STEPS, type ScaleStep, TOAST_LAYER, type Theme, type ThemeColorScheme, type ThemeColors, type ThemeFonts, type ThemeMode, type ThemeOverrideProps, type ThemeShadow, type ThemeShape, type ThemeSizing, type ThemeSpacing, type ThemeTypographyRoles, type TypographyBodyVariant, TypographyStyleLoader, type TypographyTokens, type TypographyVariant, XUIProvider, breakpoints, colors, cssVar, defaultProductContext, fontFacesCSS, fontSize, fonts, generateTypographyCSS, getFonts, getTypographyTokens, getTypographyVariant, isAndroid, isIOS, isNative, isWeb, lineHeightCompact, lineHeightDisplay, lineHeightText, radius, radiusScale, responsiveTypographyScale, shadow, shape, spacing, stroke, themeConfig, typography, typographyTokens, useDesignSystem, useId, useModalId, useModalStackDepth, useOverlayLayer, useResolvedTheme };
|
|
9073
|
+
export { type BreakpointKey, type ComponentSize, DISPLAY_SCALE_STEPS, type DesignSystemContextType, type DisplayScaleStep, FontLoader, LAYER_OFFSET, MOBILE_MAX_WIDTH, MODAL_LAYER_STEP, ModalIdContext, ModalStackProvider, OVERLAY_LAYER_BASE, OverlayLayerProvider, type ProductContext, type ResponsiveValue, SCALE_STEPS, type ScaleStep, TOAST_LAYER, type Theme, type ThemeColorScheme, type ThemeColors, type ThemeFonts, type ThemeMode, type ThemeOverrideProps, type ThemeShadow, type ThemeShape, type ThemeSizing, type ThemeSpacing, type ThemeTypographyRoles, type TypographyBodyVariant, TypographyStyleLoader, type TypographyTokens, type TypographyVariant, XUIProvider, breakpoints, colors, cssVar, defaultProductContext, fontFacesCSS, fontSize, fonts, generateTypographyCSS, getFonts, getTypographyTokens, getTypographyVariant, isAndroid, isIOS, isNative, isWeb, lineHeightCompact, lineHeightDisplay, lineHeightText, radius, radiusScale, responsiveTypographyScale, shadow, shape, spacing, spacingScale, stroke, themeConfig, typography, typographyTokens, useDesignSystem, useId, useModalId, useModalStackDepth, useOverlayLayer, useResolvedTheme };
|
package/index.js
CHANGED
|
@@ -67,6 +67,7 @@ __export(index_exports, {
|
|
|
67
67
|
shadow: () => shadow,
|
|
68
68
|
shape: () => shape,
|
|
69
69
|
spacing: () => spacing,
|
|
70
|
+
spacingScale: () => spacingScale,
|
|
70
71
|
stroke: () => stroke,
|
|
71
72
|
themeConfig: () => themeConfig,
|
|
72
73
|
typography: () => typography,
|
|
@@ -2704,18 +2705,36 @@ var colors = {
|
|
|
2704
2705
|
};
|
|
2705
2706
|
|
|
2706
2707
|
// src/tokens/spacing.ts
|
|
2708
|
+
var spacingScale = {
|
|
2709
|
+
"25": 2,
|
|
2710
|
+
"50": 4,
|
|
2711
|
+
"75": 6,
|
|
2712
|
+
"100": 8,
|
|
2713
|
+
"150": 12,
|
|
2714
|
+
"200": 16,
|
|
2715
|
+
"250": 20,
|
|
2716
|
+
"300": 24,
|
|
2717
|
+
"350": 28,
|
|
2718
|
+
"400": 32,
|
|
2719
|
+
"450": 36,
|
|
2720
|
+
"500": 40,
|
|
2721
|
+
"600": 48,
|
|
2722
|
+
"700": 56,
|
|
2723
|
+
"800": 64,
|
|
2724
|
+
"900": 72
|
|
2725
|
+
};
|
|
2707
2726
|
var spacing = {
|
|
2708
|
-
xs:
|
|
2709
|
-
sm:
|
|
2710
|
-
md:
|
|
2711
|
-
lg:
|
|
2712
|
-
xl:
|
|
2727
|
+
xs: spacingScale["50"],
|
|
2728
|
+
sm: spacingScale["100"],
|
|
2729
|
+
md: spacingScale["200"],
|
|
2730
|
+
lg: spacingScale["300"],
|
|
2731
|
+
xl: spacingScale["400"],
|
|
2713
2732
|
/** @deprecated Use `sm` instead (same 8px). Kept for backwards compatibility. */
|
|
2714
|
-
s:
|
|
2733
|
+
s: spacingScale["100"],
|
|
2715
2734
|
/** @deprecated Use `md` instead (same 16px). Kept for backwards compatibility. */
|
|
2716
|
-
m:
|
|
2735
|
+
m: spacingScale["200"],
|
|
2717
2736
|
/** @deprecated Use `lg` instead (same 24px). Kept for backwards compatibility. */
|
|
2718
|
-
l:
|
|
2737
|
+
l: spacingScale["300"]
|
|
2719
2738
|
};
|
|
2720
2739
|
var radius = {
|
|
2721
2740
|
button: 4,
|
|
@@ -2780,7 +2799,8 @@ var shape = {
|
|
|
2780
2799
|
xl: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
2781
2800
|
lg: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
2782
2801
|
md: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
2783
|
-
sm: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] }
|
|
2802
|
+
sm: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] },
|
|
2803
|
+
xs: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] }
|
|
2784
2804
|
},
|
|
2785
2805
|
switch: {
|
|
2786
2806
|
xl: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
|
|
@@ -2843,7 +2863,9 @@ var shape = {
|
|
|
2843
2863
|
borderRadius: radiusScale["100"]
|
|
2844
2864
|
},
|
|
2845
2865
|
toast: {
|
|
2846
|
-
borderRadius: radiusScale["50"]
|
|
2866
|
+
borderRadius: radiusScale["50"],
|
|
2867
|
+
/** Figma "toast/frame/border-width" is 0 — toast is borderless by design. */
|
|
2868
|
+
borderWidth: 0
|
|
2847
2869
|
},
|
|
2848
2870
|
toggleButtonGroup: {
|
|
2849
2871
|
xl: { borderRadius: radiusScale["100"], borderWidth: stroke["1"] },
|
|
@@ -3002,6 +3024,92 @@ var responsiveTypographyScale = {
|
|
|
3002
3024
|
};
|
|
3003
3025
|
|
|
3004
3026
|
// src/tokens/typography.ts
|
|
3027
|
+
var displayVariants = {
|
|
3028
|
+
b2c: {
|
|
3029
|
+
"display-lg": {
|
|
3030
|
+
fontSize: fontSize["900"].common,
|
|
3031
|
+
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
3032
|
+
fontWeight: 700,
|
|
3033
|
+
scaleStep: "900",
|
|
3034
|
+
lineHeightCategory: "display",
|
|
3035
|
+
letterSpacing: -4,
|
|
3036
|
+
fontRole: "display"
|
|
3037
|
+
},
|
|
3038
|
+
"display-md": {
|
|
3039
|
+
fontSize: fontSize["850"].common,
|
|
3040
|
+
lineHeight: `${lineHeightDisplay["850"].common}px`,
|
|
3041
|
+
fontWeight: 700,
|
|
3042
|
+
scaleStep: "850",
|
|
3043
|
+
lineHeightCategory: "display",
|
|
3044
|
+
letterSpacing: -3,
|
|
3045
|
+
fontRole: "display"
|
|
3046
|
+
},
|
|
3047
|
+
"display-sm": {
|
|
3048
|
+
fontSize: fontSize["300"].common,
|
|
3049
|
+
lineHeight: `${lineHeightCompact["300"].common}px`,
|
|
3050
|
+
fontWeight: 500,
|
|
3051
|
+
scaleStep: "300",
|
|
3052
|
+
lineHeightCategory: "compact",
|
|
3053
|
+
fontRole: "compact"
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
3056
|
+
b2b: {
|
|
3057
|
+
"display-lg": {
|
|
3058
|
+
fontSize: fontSize["900"].common,
|
|
3059
|
+
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
3060
|
+
fontWeight: 300,
|
|
3061
|
+
scaleStep: "900",
|
|
3062
|
+
lineHeightCategory: "display",
|
|
3063
|
+
letterSpacing: -4,
|
|
3064
|
+
fontRole: "display"
|
|
3065
|
+
},
|
|
3066
|
+
"display-md": {
|
|
3067
|
+
fontSize: fontSize["850"].common,
|
|
3068
|
+
lineHeight: `${lineHeightDisplay["850"].common}px`,
|
|
3069
|
+
fontWeight: 300,
|
|
3070
|
+
scaleStep: "850",
|
|
3071
|
+
lineHeightCategory: "display",
|
|
3072
|
+
letterSpacing: -3,
|
|
3073
|
+
fontRole: "display"
|
|
3074
|
+
},
|
|
3075
|
+
"display-sm": {
|
|
3076
|
+
fontSize: fontSize["750"].common,
|
|
3077
|
+
lineHeight: `${lineHeightDisplay["750"].common}px`,
|
|
3078
|
+
fontWeight: 400,
|
|
3079
|
+
scaleStep: "750",
|
|
3080
|
+
lineHeightCategory: "display",
|
|
3081
|
+
fontRole: "display"
|
|
3082
|
+
}
|
|
3083
|
+
},
|
|
3084
|
+
corpsite: {
|
|
3085
|
+
"display-lg": {
|
|
3086
|
+
fontSize: fontSize["900"].common,
|
|
3087
|
+
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
3088
|
+
fontWeight: 300,
|
|
3089
|
+
scaleStep: "900",
|
|
3090
|
+
lineHeightCategory: "display",
|
|
3091
|
+
letterSpacing: -4,
|
|
3092
|
+
fontRole: "display"
|
|
3093
|
+
},
|
|
3094
|
+
"display-md": {
|
|
3095
|
+
fontSize: fontSize["850"].common,
|
|
3096
|
+
lineHeight: `${lineHeightDisplay["850"].common}px`,
|
|
3097
|
+
fontWeight: 300,
|
|
3098
|
+
scaleStep: "850",
|
|
3099
|
+
lineHeightCategory: "display",
|
|
3100
|
+
letterSpacing: -3,
|
|
3101
|
+
fontRole: "display"
|
|
3102
|
+
},
|
|
3103
|
+
"display-sm": {
|
|
3104
|
+
fontSize: fontSize["750"].common,
|
|
3105
|
+
lineHeight: `${lineHeightDisplay["750"].common}px`,
|
|
3106
|
+
fontWeight: 400,
|
|
3107
|
+
scaleStep: "750",
|
|
3108
|
+
lineHeightCategory: "display",
|
|
3109
|
+
fontRole: "display"
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
3005
3113
|
var typographyTokens = {
|
|
3006
3114
|
b2c: {
|
|
3007
3115
|
heading: {
|
|
@@ -3042,13 +3150,8 @@ var typographyTokens = {
|
|
|
3042
3150
|
}
|
|
3043
3151
|
},
|
|
3044
3152
|
basic: {
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
lineHeight: `${lineHeightDisplay["550"].common}px`,
|
|
3048
|
-
fontWeight: 800,
|
|
3049
|
-
scaleStep: "550",
|
|
3050
|
-
lineHeightCategory: "display"
|
|
3051
|
-
},
|
|
3153
|
+
...displayVariants.b2c,
|
|
3154
|
+
display: displayVariants.b2c["display-lg"],
|
|
3052
3155
|
"body-lg": {
|
|
3053
3156
|
fontSize: fontSize["175"].common,
|
|
3054
3157
|
lineHeight: `${lineHeightCompact["175"].common}px`,
|
|
@@ -3155,13 +3258,8 @@ var typographyTokens = {
|
|
|
3155
3258
|
}
|
|
3156
3259
|
},
|
|
3157
3260
|
basic: {
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
lineHeight: `${lineHeightDisplay["750"].common}px`,
|
|
3161
|
-
fontWeight: 400,
|
|
3162
|
-
scaleStep: "750",
|
|
3163
|
-
lineHeightCategory: "display"
|
|
3164
|
-
},
|
|
3261
|
+
...displayVariants.b2b,
|
|
3262
|
+
display: displayVariants.b2b["display-lg"],
|
|
3165
3263
|
"body-lg": {
|
|
3166
3264
|
fontSize: fontSize["175"].common,
|
|
3167
3265
|
lineHeight: `${lineHeightCompact["175"].common}px`,
|
|
@@ -3268,16 +3366,8 @@ var typographyTokens = {
|
|
|
3268
3366
|
}
|
|
3269
3367
|
},
|
|
3270
3368
|
basic: {
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
// display-lg (step 900) — the largest, matching Figma's primary display.
|
|
3274
|
-
display: {
|
|
3275
|
-
fontSize: fontSize["900"].common,
|
|
3276
|
-
lineHeight: `${lineHeightDisplay["900"].common}px`,
|
|
3277
|
-
fontWeight: 300,
|
|
3278
|
-
scaleStep: "900",
|
|
3279
|
-
lineHeightCategory: "display"
|
|
3280
|
-
},
|
|
3369
|
+
...displayVariants.corpsite,
|
|
3370
|
+
display: displayVariants.corpsite["display-lg"],
|
|
3281
3371
|
"body-lg": {
|
|
3282
3372
|
fontSize: fontSize["175"].common,
|
|
3283
3373
|
lineHeight: `${lineHeightCompact["175"].common}px`,
|
|
@@ -3355,8 +3445,18 @@ var getTypographyVariant = (productContext, variant) => {
|
|
|
3355
3445
|
if (variant in tokens.heading) {
|
|
3356
3446
|
return tokens.heading[variant];
|
|
3357
3447
|
}
|
|
3358
|
-
|
|
3359
|
-
|
|
3448
|
+
const displayVariantMap = {
|
|
3449
|
+
display: "display-lg",
|
|
3450
|
+
displayLg: "display-lg",
|
|
3451
|
+
displayMd: "display-md",
|
|
3452
|
+
displaySm: "display-sm",
|
|
3453
|
+
"display-lg": "display-lg",
|
|
3454
|
+
"display-md": "display-md",
|
|
3455
|
+
"display-sm": "display-sm"
|
|
3456
|
+
};
|
|
3457
|
+
const displayKey = displayVariantMap[variant];
|
|
3458
|
+
if (displayKey) {
|
|
3459
|
+
return tokens.basic[displayKey];
|
|
3360
3460
|
}
|
|
3361
3461
|
const bodyVariantMap = {
|
|
3362
3462
|
bodyLg: "body-lg",
|
|
@@ -5035,7 +5135,10 @@ var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
|
|
|
5035
5135
|
triggerGap: 12,
|
|
5036
5136
|
triggerMinHeight: 56,
|
|
5037
5137
|
surfaceRadius: radiusScale["50"],
|
|
5038
|
-
|
|
5138
|
+
// Must match surfaceRadius: the root clips with `overflow: hidden`, so a
|
|
5139
|
+
// larger cell radius makes the trigger cell's corners show through the
|
|
5140
|
+
// smaller root arc (XUITSD-55).
|
|
5141
|
+
cellRadius: radiusScale["50"],
|
|
5039
5142
|
iconSlotSize: 32,
|
|
5040
5143
|
iconSlotRadius: radiusScale["50"],
|
|
5041
5144
|
chevronSize: 24,
|
|
@@ -5282,6 +5385,7 @@ var useModalStackDepth = () => (0, import_react3.useContext)(ModalStackContext);
|
|
|
5282
5385
|
shadow,
|
|
5283
5386
|
shape,
|
|
5284
5387
|
spacing,
|
|
5388
|
+
spacingScale,
|
|
5285
5389
|
stroke,
|
|
5286
5390
|
themeConfig,
|
|
5287
5391
|
typography,
|