@shopgate/engage 7.32.0-beta.6 → 7.32.0-beta.7
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/account/components/Profile/ProfileAddressCard.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressCard.js +1 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts +2 -2
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts.map +1 -1
- package/cart/components/CartItems/CartItems.js +8 -10
- package/cart/components/CartItems/CartItemsSubstitution.js +3 -2
- package/components/Card/Card.d.ts +27 -0
- package/components/Card/Card.d.ts.map +1 -0
- package/components/Card/Card.js +57 -0
- package/components/Card/index.d.ts +4 -0
- package/components/Card/index.d.ts.map +1 -0
- package/components/Card/index.js +2 -0
- package/components/Card/spec.d.ts +2 -0
- package/components/Card/spec.d.ts.map +1 -0
- package/components/Card/spec.js +128 -0
- package/components/Card/useCardAppearance.d.ts +11 -0
- package/components/Card/useCardAppearance.d.ts.map +1 -0
- package/components/Card/useCardAppearance.js +22 -0
- package/components/Paper/Paper.d.ts +49 -0
- package/components/Paper/Paper.d.ts.map +1 -0
- package/components/Paper/Paper.js +64 -0
- package/components/Paper/index.d.ts +3 -0
- package/components/Paper/index.d.ts.map +1 -0
- package/components/Paper/index.js +1 -0
- package/components/Paper/spec.d.ts +2 -0
- package/components/Paper/spec.d.ts.map +1 -0
- package/components/Paper/spec.js +131 -0
- package/components/RadioCard/RadioCard.d.ts.map +1 -1
- package/components/RadioCard/RadioCard.js +2 -1
- package/components/index.d.ts +4 -1
- package/components/index.d.ts.map +1 -1
- package/components/index.js +3 -2
- package/favorites/components/Item/Item.d.ts +1 -1
- package/orders/components/OrderHistory/OrderHistoryList.d.ts.map +1 -1
- package/orders/components/OrderHistory/OrderHistoryList.js +8 -9
- package/orders/components/OrderHistory/OrderHistoryTable.d.ts.map +1 -1
- package/orders/components/OrderHistory/OrderHistoryTable.js +4 -0
- package/package.json +7 -7
- package/product/components/ProductCard/index.js +27 -14
- package/product/components/ProductGrid/components/Item/components/ItemDetails/index.js +6 -3
- package/product/components/ProductGrid/components/Item/components/ItemName/index.js +5 -1
- package/product/components/ProductGrid/components/Item/components/ItemName/spec.js +19 -1
- package/product/components/ProductGrid/components/Item/index.js +9 -1
- package/product/components/ProductSlider/index.js +4 -2
- package/product/components/RelationsSlider/RelationsSliderContent.js +3 -2
- package/product/components/RelationsSlider/constants.d.ts +3 -0
- package/product/components/RelationsSlider/constants.d.ts.map +1 -0
- package/product/components/RelationsSlider/constants.js +2 -1
- package/product/components/RelationsSlider/hooks.d.ts +6 -0
- package/product/components/RelationsSlider/hooks.d.ts.map +1 -0
- package/product/components/RelationsSlider/hooks.js +34 -0
- package/settings/action-creators/appSettings.d.ts +3 -3
- package/settings/action-creators/appSettings.d.ts.map +1 -1
- package/settings/reducers/appSettings.d.ts.map +1 -1
- package/settings/reducers/appSettings.js +31 -17
- package/settings/reducers/index.d.ts +1 -1
- package/settings/selectors/appSettings.d.ts +32 -0
- package/settings/selectors/appSettings.d.ts.map +1 -1
- package/settings/selectors/appSettings.js +21 -1
- package/settings/types/appSettings.d.ts +48 -0
- package/settings/types/appSettings.d.ts.map +1 -1
- package/styles/index.d.ts +1 -1
- package/styles/index.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.d.ts +50 -0
- package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.js +50 -0
- package/styles/theme/createTheme/createCssVarsForColorSchemeThemes.d.ts.map +1 -1
- package/styles/theme/createTheme/createCssVarsForColorSchemeThemes.js +5 -1
- package/styles/theme/createTheme/createPalette.types.d.ts +4 -0
- package/styles/theme/createTheme/createPalette.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createPalette.types.js +5 -1
- package/styles/theme/createTheme/createShape.d.ts +4 -0
- package/styles/theme/createTheme/createShape.d.ts.map +1 -1
- package/styles/theme/createTheme/createShape.js +2 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.js +2 -1
- package/styles/theme/createTheme/shadows.d.ts +11 -1
- package/styles/theme/createTheme/shadows.d.ts.map +1 -1
- package/styles/theme/createTheme/shadows.js +41 -7
- package/styles/theme/createTheme/types.d.ts +5 -1
- package/styles/theme/createTheme/types.d.ts.map +1 -1
- package/styles/theme/index.d.ts +1 -0
- package/styles/theme/index.d.ts.map +1 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _merge from "lodash/merge";
|
|
2
|
-
import _cloneDeep from "lodash/cloneDeep";
|
|
3
|
-
import { produce } from 'immer';
|
|
4
2
|
import { RECEIVE_APP_SETTINGS } from "../constants/appSettings";
|
|
5
3
|
import { DEFAULT_IMAGE_FILL_COLOR, DEFAULT_IMAGE_FILL_TRANSPARENT, DEFAULT_IMAGE_QUALITY, DEFAULT_SHOW_INNER_SHADOW } from "../constants/imageSettings";
|
|
6
4
|
// Deliberately not exported from the "helpers" barrel - they normalize values on their way into
|
|
@@ -45,6 +43,22 @@ export const DEFAULT_APP_SETTINGS = {
|
|
|
45
43
|
},
|
|
46
44
|
rating: {
|
|
47
45
|
showEmptyStars: false
|
|
46
|
+
},
|
|
47
|
+
card: {
|
|
48
|
+
productName: {
|
|
49
|
+
maxLines: 3
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
tile: {
|
|
53
|
+
productName: {
|
|
54
|
+
maxLines: 3
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
cards: {
|
|
59
|
+
style: 'shadow',
|
|
60
|
+
shadow: {
|
|
61
|
+
size: 'medium'
|
|
48
62
|
}
|
|
49
63
|
},
|
|
50
64
|
images: {
|
|
@@ -70,35 +84,35 @@ export const DEFAULT_APP_SETTINGS = {
|
|
|
70
84
|
*/
|
|
71
85
|
const appSettings = (state, action = {
|
|
72
86
|
type: ''
|
|
73
|
-
}) =>
|
|
87
|
+
}) => {
|
|
74
88
|
if (isReceiveAppSettingsAction(action)) {
|
|
75
89
|
const {
|
|
76
90
|
images
|
|
77
91
|
} = action.settings ?? {};
|
|
78
92
|
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
draft.images.product = _cloneDeep(DEFAULT_APP_SETTINGS.images.product);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Deep merged so a partial payload keeps the defaults for whatever the source omits.
|
|
88
|
-
_merge(draft, {
|
|
93
|
+
// Merged over the defaults rather than over the current state, so a field an incoming payload
|
|
94
|
+
// omits falls back to its default instead of keeping the value of an earlier one. The admin
|
|
95
|
+
// preview needs that: it stops sending a shadow size once the card style isn't `shadow`, and it
|
|
96
|
+
// clears a whole branch by sending a null.
|
|
97
|
+
const nextState = _merge({}, DEFAULT_APP_SETTINGS, {
|
|
89
98
|
...action.settings,
|
|
99
|
+
// A cleared branch is mapped to undefined, which merge skips, so the defaults it started from
|
|
100
|
+
// stay in place. A null would be written into the slice like any other value.
|
|
90
101
|
images: images === null ? undefined : {
|
|
91
102
|
...images,
|
|
92
103
|
product: images?.product ?? undefined
|
|
93
104
|
}
|
|
105
|
+
}, {
|
|
106
|
+
isHydrated: true
|
|
94
107
|
});
|
|
95
108
|
|
|
96
109
|
// Converted on the way in, so the slice holds wire ready values and every image url does not
|
|
97
110
|
// pay for it. Unconditional, because an empty string or a null reaches here like any other
|
|
98
111
|
// value - both converters are idempotent.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
nextState.images.fillColor = toThumborColor(nextState.images.fillColor);
|
|
113
|
+
nextState.images.quality = toImageQuality(nextState.images.quality);
|
|
114
|
+
return nextState;
|
|
102
115
|
}
|
|
103
|
-
|
|
116
|
+
return state ?? DEFAULT_APP_SETTINGS;
|
|
117
|
+
};
|
|
104
118
|
export default appSettings;
|
|
@@ -5,7 +5,7 @@ export declare const settings: import("redux").Reducer<{
|
|
|
5
5
|
appSettings: import("../types/appSettings").AppSettingsSlice;
|
|
6
6
|
}, ({
|
|
7
7
|
type: string;
|
|
8
|
-
settings: import("../types/appSettings").AppSettings
|
|
8
|
+
settings: import("../types/appSettings").DeepPartial<import("../types/appSettings").AppSettings>;
|
|
9
9
|
} | import("redux").UnknownAction) | import("redux").Action<string>, Partial<{
|
|
10
10
|
config: Object | undefined;
|
|
11
11
|
shopSettings: Object | undefined;
|
|
@@ -87,4 +87,36 @@ export declare const getImageSettings: ((state: AppSettingsState) => import("../
|
|
|
87
87
|
}> & {
|
|
88
88
|
clearCache: () => void;
|
|
89
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* Selects the max number of lines a product card name is clamped to.
|
|
92
|
+
*/
|
|
93
|
+
export declare const getProductCardNameMaxLines: ((state: AppSettingsState) => number) & import("reselect").OutputSelectorFields<(args_0: AppSettingsSlice) => number, {
|
|
94
|
+
clearCache: () => void;
|
|
95
|
+
}> & {
|
|
96
|
+
clearCache: () => void;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Selects the max number of lines a product tile name is clamped to.
|
|
100
|
+
*/
|
|
101
|
+
export declare const getProductTileNameMaxLines: ((state: AppSettingsState) => number) & import("reselect").OutputSelectorFields<(args_0: AppSettingsSlice) => number, {
|
|
102
|
+
clearCache: () => void;
|
|
103
|
+
}> & {
|
|
104
|
+
clearCache: () => void;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Selects the themed card settings (style and shadow size).
|
|
108
|
+
*/
|
|
109
|
+
export declare const getCardSettings: ((state: AppSettingsState) => import("../types/appSettings").CardSettings) & import("reselect").OutputSelectorFields<(args_0: AppSettingsSlice) => import("../types/appSettings").CardSettings, {
|
|
110
|
+
clearCache: () => void;
|
|
111
|
+
}> & {
|
|
112
|
+
clearCache: () => void;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Selects the effective card shadow size. `none` unless the shadow style is selected.
|
|
116
|
+
*/
|
|
117
|
+
export declare const getCardShadowSize: ((state: AppSettingsState) => import("../../styles").ShadowSize) & import("reselect").OutputSelectorFields<(args_0: import("../types/appSettings").CardSettings) => import("../../styles").ShadowSize, {
|
|
118
|
+
clearCache: () => void;
|
|
119
|
+
}> & {
|
|
120
|
+
clearCache: () => void;
|
|
121
|
+
};
|
|
90
122
|
//# sourceMappingURL=appSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/selectors/appSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG/E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,gBAAgB,KAAG,gBACR,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;CAGrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;CAG7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;CAGjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;CAGzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAG5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/selectors/appSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG/E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,gBAAgB,KAAG,gBACR,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;CAGrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;CAG7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;CAGjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;CAGzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAGnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAG5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;CAGtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;CAGtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAG3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;CAG7B,CAAC"}
|
|
@@ -45,4 +45,24 @@ export const getShowEmptyRatingStars = createSelector(getAppSettingsState, appSe
|
|
|
45
45
|
/**
|
|
46
46
|
* Selects the image settings.
|
|
47
47
|
*/
|
|
48
|
-
export const getImageSettings = createSelector(getAppSettingsState, appSettings => appSettings.images);
|
|
48
|
+
export const getImageSettings = createSelector(getAppSettingsState, appSettings => appSettings.images);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Selects the max number of lines a product card name is clamped to.
|
|
52
|
+
*/
|
|
53
|
+
export const getProductCardNameMaxLines = createSelector(getAppSettingsState, appSettings => appSettings.product.card.productName.maxLines);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Selects the max number of lines a product tile name is clamped to.
|
|
57
|
+
*/
|
|
58
|
+
export const getProductTileNameMaxLines = createSelector(getAppSettingsState, appSettings => appSettings.product.tile.productName.maxLines);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Selects the themed card settings (style and shadow size).
|
|
62
|
+
*/
|
|
63
|
+
export const getCardSettings = createSelector(getAppSettingsState, appSettings => appSettings.cards);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Selects the effective card shadow size. `none` unless the shadow style is selected.
|
|
67
|
+
*/
|
|
68
|
+
export const getCardShadowSize = createSelector(getCardSettings, cards => cards.style === 'shadow' ? cards.shadow.size : 'none');
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type { ShadowSize } from '@shopgate/engage/styles/theme';
|
|
2
|
+
export type { ShadowSize };
|
|
3
|
+
/**
|
|
4
|
+
* Recursively optional variant of `T`. The settings sources send only what a merchant configured,
|
|
5
|
+
* and the admin preview additionally prunes the fields its visibility conditions hide.
|
|
6
|
+
*/
|
|
7
|
+
export type DeepPartial<T> = {
|
|
8
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
9
|
+
};
|
|
1
10
|
export interface AppSettingsState {
|
|
2
11
|
settings: {
|
|
3
12
|
appSettings: AppSettingsSlice;
|
|
@@ -23,6 +32,20 @@ export type ProductColumns = PerScreenSize;
|
|
|
23
32
|
export interface ProductGridSettings {
|
|
24
33
|
columns: ProductColumns;
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Name-clamping shared by the card and tile product surfaces.
|
|
37
|
+
*/
|
|
38
|
+
export interface ProductNameSettings {
|
|
39
|
+
/** Max number of lines the product name is clamped to before an ellipsis. */
|
|
40
|
+
maxLines: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Drop shadow of the card surface.
|
|
44
|
+
*/
|
|
45
|
+
export interface ShadowSettings {
|
|
46
|
+
/** Which preset elevation to draw. `none` renders no shadow at all. */
|
|
47
|
+
size: ShadowSize;
|
|
48
|
+
}
|
|
26
49
|
/**
|
|
27
50
|
* Number of slides to render side by side, keyed by screen size. Fractional values are allowed.
|
|
28
51
|
*/
|
|
@@ -49,6 +72,25 @@ export interface ProductSettings {
|
|
|
49
72
|
grid: ProductGridSettings;
|
|
50
73
|
slider: ProductSliderSettings;
|
|
51
74
|
rating: ProductRatingSettings;
|
|
75
|
+
/** Product cards (sliders, relations, live shopping). */
|
|
76
|
+
card: {
|
|
77
|
+
productName: ProductNameSettings;
|
|
78
|
+
};
|
|
79
|
+
/** Product grid tiles. */
|
|
80
|
+
tile: {
|
|
81
|
+
productName: ProductNameSettings;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The visual style of the card surface.
|
|
86
|
+
*/
|
|
87
|
+
export type CardStyle = 'shadow' | 'border' | 'flat';
|
|
88
|
+
/**
|
|
89
|
+
* Settings for the themed card surface (checkout sections, address cards, sliders).
|
|
90
|
+
*/
|
|
91
|
+
export interface CardSettings {
|
|
92
|
+
style: CardStyle;
|
|
93
|
+
shadow: ShadowSettings;
|
|
52
94
|
}
|
|
53
95
|
/**
|
|
54
96
|
* An aspect ratio expressed as width and height parts. Only the proportion matters -
|
|
@@ -171,7 +213,13 @@ export interface AppSettings {
|
|
|
171
213
|
* Settings for images that are served through the image service.
|
|
172
214
|
*/
|
|
173
215
|
images: ImageSettings;
|
|
216
|
+
cards: CardSettings;
|
|
174
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* What a settings source actually sends. Every field is optional, so the reducer fills the gaps
|
|
220
|
+
* from its defaults instead of leaving consumers with undefined.
|
|
221
|
+
*/
|
|
222
|
+
export type AppSettingsPayload = DeepPartial<AppSettings>;
|
|
175
223
|
/**
|
|
176
224
|
* The stored app settings slice. Extends the raw {@link AppSettings} values
|
|
177
225
|
* with metadata that is derived by the reducer rather than supplied by a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/types/appSettings.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE;QACR,WAAW,EAAE,gBAAgB,CAAC;KAC/B,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AA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,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
package/styles/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './helpers';
|
|
2
|
-
export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, withTheme, type Theme, type ColorSchemeName, type PaletteColorsWithMain, type WithThemeProps, } from './theme';
|
|
2
|
+
export { ThemeProvider, createTheme, useActiveBreakpoint, useMediaQuery, useResponsiveValue, useTheme, useColorScheme, withTheme, type Theme, type ShadowSize, type ColorSchemeName, type PaletteColorsWithMain, type WithThemeProps, } from './theme';
|
|
3
3
|
export { makeStyles, withStyles, useStyles, css, cx, tss, GlobalStyles, injectGlobal, keyframes, } from './tss';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/styles/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,SAAS,EACT,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,GAAG,EACH,EAAE,EACF,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,SAAS,EACT,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,GAAG,EACH,EAAE,EACF,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,OAAO,CAAC"}
|
|
@@ -203,6 +203,31 @@ export declare const componentsSchema: {
|
|
|
203
203
|
readonly height: "";
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
|
+
readonly cards: {
|
|
207
|
+
readonly vars: {
|
|
208
|
+
readonly backgroundColor: "";
|
|
209
|
+
readonly borderWidth: "";
|
|
210
|
+
readonly borderColor: "";
|
|
211
|
+
readonly border: "";
|
|
212
|
+
readonly shadowColor: "";
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
readonly productCard: {
|
|
216
|
+
readonly vars: {
|
|
217
|
+
readonly padding: "";
|
|
218
|
+
readonly textPadding: "";
|
|
219
|
+
readonly imagePadding: "";
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
readonly tiles: {
|
|
223
|
+
readonly vars: {
|
|
224
|
+
readonly backgroundColor: "";
|
|
225
|
+
readonly padding: "";
|
|
226
|
+
readonly textPadding: "";
|
|
227
|
+
readonly textPaddingTop: "";
|
|
228
|
+
readonly imagePadding: "";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
206
231
|
};
|
|
207
232
|
/**
|
|
208
233
|
* Default component tokens.
|
|
@@ -313,6 +338,31 @@ export declare const componentsDefaults: {
|
|
|
313
338
|
height: number;
|
|
314
339
|
};
|
|
315
340
|
};
|
|
341
|
+
cards: {
|
|
342
|
+
vars: {
|
|
343
|
+
backgroundColor: (t: Theme) => string;
|
|
344
|
+
borderWidth: number;
|
|
345
|
+
borderColor: string;
|
|
346
|
+
border: string;
|
|
347
|
+
shadowColor: (t: Theme) => string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
productCard: {
|
|
351
|
+
vars: {
|
|
352
|
+
padding: number;
|
|
353
|
+
textPadding: number;
|
|
354
|
+
imagePadding: number;
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
tiles: {
|
|
358
|
+
vars: {
|
|
359
|
+
backgroundColor: string;
|
|
360
|
+
padding: number;
|
|
361
|
+
textPadding: number;
|
|
362
|
+
textPaddingTop: string;
|
|
363
|
+
imagePadding: number;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
316
366
|
};
|
|
317
367
|
/** Internal defaults type (must cover full schema). */
|
|
318
368
|
export type ComponentsDefaults = ComponentsOverrideFromSchema<typeof componentsSchema, Theme>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponents.types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createComponents.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE3C;;;GAGG;AACH,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,IAClC,MAAM,GACN,MAAM,GACN,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,CAAC,OAAO,IACtC,OAAO,SAAS,IAAI,GAAG,MAAM,GAC3B,OAAO,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,oBAAoB,CAAC,CAAC,CAAC,EAAE,GACzE,OAAO,SAAS,MA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gB
|
|
1
|
+
{"version":3,"file":"createComponents.types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createComponents.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE3C;;;GAGG;AACH,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,IAClC,MAAM,GACN,MAAM,GACN,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,CAAC,OAAO,IACtC,OAAO,SAAS,IAAI,GAAG,MAAM,GAC3B,OAAO,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,oBAAoB,CAAC,CAAC,CAAC,EAAE,GACzE,OAAO,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CAAE,GACnF,MAAM,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,4BAA4B,CAAC,OAAO,EAAE,MAAM,IACtD,OAAO,SAAS,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,GAChD,OAAO,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,4BAA4B,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,GACzF,OAAO,SAAS,MAAM,GACtB;KAAG,CAAC,IAAI,MAAM,OAAO,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;CAAE,GAC1E,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAEhC;;;;;;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OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAG/D,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -190,6 +190,31 @@ export const componentsSchema = {
|
|
|
190
190
|
vars: {
|
|
191
191
|
height: ''
|
|
192
192
|
}
|
|
193
|
+
},
|
|
194
|
+
cards: {
|
|
195
|
+
vars: {
|
|
196
|
+
backgroundColor: '',
|
|
197
|
+
borderWidth: '',
|
|
198
|
+
borderColor: '',
|
|
199
|
+
border: '',
|
|
200
|
+
shadowColor: ''
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
productCard: {
|
|
204
|
+
vars: {
|
|
205
|
+
padding: '',
|
|
206
|
+
textPadding: '',
|
|
207
|
+
imagePadding: ''
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
tiles: {
|
|
211
|
+
vars: {
|
|
212
|
+
backgroundColor: '',
|
|
213
|
+
padding: '',
|
|
214
|
+
textPadding: '',
|
|
215
|
+
textPaddingTop: '',
|
|
216
|
+
imagePadding: ''
|
|
217
|
+
}
|
|
193
218
|
}
|
|
194
219
|
};
|
|
195
220
|
|
|
@@ -301,6 +326,31 @@ export const componentsDefaults = {
|
|
|
301
326
|
vars: {
|
|
302
327
|
height: 48
|
|
303
328
|
}
|
|
329
|
+
},
|
|
330
|
+
cards: {
|
|
331
|
+
vars: {
|
|
332
|
+
backgroundColor: t => t.palette.background.surface,
|
|
333
|
+
borderWidth: 0,
|
|
334
|
+
borderColor: 'transparent',
|
|
335
|
+
border: 'var(--sg-components-cards-borderWidth) solid var(--sg-components-cards-borderColor)',
|
|
336
|
+
shadowColor: t => t.palette.shadow
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
productCard: {
|
|
340
|
+
vars: {
|
|
341
|
+
padding: 0,
|
|
342
|
+
textPadding: 16,
|
|
343
|
+
imagePadding: 0
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
tiles: {
|
|
347
|
+
vars: {
|
|
348
|
+
backgroundColor: 'transparent',
|
|
349
|
+
padding: 0,
|
|
350
|
+
textPadding: 8,
|
|
351
|
+
textPaddingTop: 'max(var(--sg-components-tiles-textPadding), 16px)',
|
|
352
|
+
imagePadding: 0
|
|
353
|
+
}
|
|
304
354
|
}
|
|
305
355
|
};
|
|
306
356
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCssVarsForColorSchemeThemes.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createCssVarsForColorSchemeThemes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,KAAK,EACV,iBAAiB,EAAE,SAAS,EAAmB,YAAY,EAC5D,MAAM,SAAS,CAAC;AAEjB,KAAK,wCAAwC,GAAG;IAC9C,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAEvC,MAAM,MAAM,4CAA4C,GAAG;IACzD;;;OAGG;IACH,YAAY,EAAE,SAAS,GAAG;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IAC9C;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;CAC7C,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,iCAAiC,CACvD,YAAY,EAAE,iBAAiB,EAC/B,OAAO,EAAE,wCAAwC,GAChD,4CAA4C,
|
|
1
|
+
{"version":3,"file":"createCssVarsForColorSchemeThemes.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createCssVarsForColorSchemeThemes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,KAAK,EACV,iBAAiB,EAAE,SAAS,EAAmB,YAAY,EAC5D,MAAM,SAAS,CAAC;AAEjB,KAAK,wCAAwC,GAAG;IAC9C,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAEvC,MAAM,MAAM,4CAA4C,GAAG;IACzD;;;OAGG;IACH,YAAY,EAAE,SAAS,GAAG;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IAC9C;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;CAC7C,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,iCAAiC,CACvD,YAAY,EAAE,iBAAiB,EAC/B,OAAO,EAAE,wCAAwC,GAChD,4CAA4C,CAgH9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
1
2
|
import "core-js/modules/es.array.reduce.js";
|
|
2
3
|
import merge from 'lodash/merge';
|
|
3
4
|
import omit from 'lodash/omit';
|
|
@@ -35,7 +36,10 @@ export default function createCssVarsForColorSchemeThemes(colorSchemes, options)
|
|
|
35
36
|
varsWithDefaults,
|
|
36
37
|
varNames
|
|
37
38
|
} = cssVarsColorAugmentation(cssVarsParser(rest, {
|
|
38
|
-
prefix: cssVarPrefix
|
|
39
|
+
prefix: cssVarPrefix,
|
|
40
|
+
// Keep as literal strings, not `:root` vars, so their inline `var(--sg-palette-shadow)`
|
|
41
|
+
// resolves on the element using the shadow (recolorable) instead of freezing against `:root`.
|
|
42
|
+
shouldSkipGeneratingVar: keys => ['shadows', 'shadowSizes'].includes(keys[0])
|
|
39
43
|
// @ts-expect-error - We are sure about the type here
|
|
40
44
|
}), rest, cssVarPrefix);
|
|
41
45
|
|
|
@@ -151,6 +151,10 @@ export declare const paletteSchema: {
|
|
|
151
151
|
readonly disabled: "#808080";
|
|
152
152
|
readonly disabledBackground: "#CCCCCC";
|
|
153
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* Color for the box-shadow.
|
|
156
|
+
*/
|
|
157
|
+
readonly shadow: "#000000";
|
|
154
158
|
};
|
|
155
159
|
/**
|
|
156
160
|
* Additional settings for the palette
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPalette.types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createPalette.types.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GACjB,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GACxD,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,KAAK,6BAA6B,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAA;AAEpE,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,KAAK,iBAAiB,CAAC,CAAC,IACtB,CAAC,SAAS,IAAI,GAAG,MAAM,GACrB,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAChE,CAAC,SAAS,MAA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version":3,"file":"createPalette.types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createPalette.types.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GACjB,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GACxD,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,KAAK,6BAA6B,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAA;AAEpE,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,KAAK,iBAAiB,CAAC,CAAC,IACtB,CAAC,SAAS,IAAI,GAAG,MAAM,GACrB,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAChE,CAAC,SAAS,MAAM,GAChB,CAAC,MAAM,SAAS,MAAM,CAAC,GACrB,6BAA6B,GAC7B;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,GAC9C,MAAM,CAAC;AAEX;;;;;;;;;;GAUG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAC3B,CAAC,SAAS,IAAI,GAAG,MAAM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AG,iBAAiB,CAAC,OAAO,aAAa,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createShape.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createShape.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"createShape.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createShape.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAO1C;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,GAAE,YAAiB,GAAG,KAAK,CAKrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createThemeFromColorScheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createThemeFromColorScheme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAcpE;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,MAAM,EACb,aAAa,MAAM,GAAG,MAAM,KAC3B,MAAkH,CAAC;AAEtH;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,KACZ,MAA4D,CAAC;AAEhE;;;;GAIG;AACH,QAAA,MAAM,0BAA0B,GAAI,aAAa,kBAAkB,KAAG,
|
|
1
|
+
{"version":3,"file":"createThemeFromColorScheme.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/createThemeFromColorScheme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAcpE;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,MAAM,EACb,aAAa,MAAM,GAAG,MAAM,KAC3B,MAAkH,CAAC;AAEtH;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,MAAM,EACb,cAAa,MAAM,GAAG,MAAY,KACjC,MAAuF,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,KACZ,MAA4D,CAAC;AAEhE;;;;GAIG;AACH,QAAA,MAAM,0BAA0B,GAAI,aAAa,kBAAkB,KAAG,gBA4BrE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import createPalette from "./createPalette";
|
|
|
2
2
|
import createTypography from "./createTypography";
|
|
3
3
|
import createComponents from "./createComponents";
|
|
4
4
|
import createShape from "./createShape";
|
|
5
|
-
import shadows from "./shadows";
|
|
5
|
+
import shadows, { shadowSizes } from "./shadows";
|
|
6
6
|
/**
|
|
7
7
|
* Calculates the percentage value for a given coefficient, which can be a number or a string representing a CSS calculation.
|
|
8
8
|
* @param coefficient The coefficient to convert, either a number or a string.
|
|
@@ -69,6 +69,7 @@ const createThemeFromColorScheme = colorScheme => {
|
|
|
69
69
|
components,
|
|
70
70
|
shape,
|
|
71
71
|
shadows,
|
|
72
|
+
shadowSizes,
|
|
72
73
|
alpha,
|
|
73
74
|
lighten,
|
|
74
75
|
darken,
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The elevations the admin offers. Offset, blur and spread are not configurable — a shop picks
|
|
3
|
+
* one of these presets so the surfaces stay visually consistent, and only the color is free.
|
|
4
|
+
*/
|
|
5
|
+
export type ShadowSize = 'none' | 'low' | 'medium' | 'strong';
|
|
6
|
+
export declare const SHADOW_COLOR_VAR = "--sg-palette-shadow";
|
|
7
|
+
declare const shadows: readonly ["none", ...string[]];
|
|
2
8
|
export type Shadows = typeof shadows;
|
|
9
|
+
/**
|
|
10
|
+
* The finished shadow for each size the admin offers, for a single `theme.shadowSizes[size]` lookup.
|
|
11
|
+
*/
|
|
12
|
+
export declare const shadowSizes: Record<ShadowSize, string>;
|
|
3
13
|
export default shadows;
|
|
4
14
|
//# sourceMappingURL=shadows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadows.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/shadows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shadows.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/shadows.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AA+D9D,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,QAAA,MAAM,OAAO,gCAMH,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAA;AAEpC;;GAEG;AACH,eAAO,MAAM,WAAW,EAEnB,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAEhC,eAAe,OAAO,CAAC"}
|
|
@@ -1,10 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// Share of the shadow color each of the three layers is drawn with, in percent.
|
|
2
|
+
const shadowKeyUmbraPercent = 20;
|
|
3
|
+
const shadowKeyPenumbraPercent = 14;
|
|
4
|
+
const shadowAmbientShadowPercent = 12;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The elevations the admin offers. Offset, blur and spread are not configurable — a shop picks
|
|
8
|
+
* one of these presets so the surfaces stay visually consistent, and only the color is free.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Elevation from the scale below used for each shadow size the admin offers. Keeping the mapping
|
|
13
|
+
* next to the scale means a size never introduces geometry of its own.
|
|
14
|
+
*/
|
|
15
|
+
const SHADOW_SIZE_ELEVATIONS = {
|
|
16
|
+
none: 0,
|
|
17
|
+
low: 2,
|
|
18
|
+
medium: 4,
|
|
19
|
+
strong: 8
|
|
20
|
+
};
|
|
7
21
|
|
|
22
|
+
// Offset-x, offset-y, blur and spread of the three layers that make up one elevation, starting at
|
|
23
|
+
// elevation 1 (elevation 0 draws no shadow at all).
|
|
8
24
|
// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss
|
|
9
|
-
const
|
|
25
|
+
const elevationGeometries = [[0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0], [0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0], [0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0], [0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0], [0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0], [0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0], [0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1], [0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2], [0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2], [0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3], [0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3], [0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4], [0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4], [0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4], [0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5], [0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5], [0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5], [0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6], [0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6], [0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7], [0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7], [0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7], [0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8], [0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8]];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Builds one elevation from its geometry.
|
|
29
|
+
* @param px The twelve lengths of the elevation's three layers.
|
|
30
|
+
* @param renderColor Renders the color of a layer from the share of the shadow color it is drawn
|
|
31
|
+
* with, in percent.
|
|
32
|
+
* @returns A box-shadow value.
|
|
33
|
+
*/
|
|
34
|
+
function createShadow(px, renderColor) {
|
|
35
|
+
const layer = (offset, percent) => `${px[offset]}px ${px[offset + 1]}px ${px[offset + 2]}px ${px[offset + 3]}px ` + `${renderColor(percent)}`;
|
|
36
|
+
return [layer(0, shadowKeyUmbraPercent), layer(4, shadowKeyPenumbraPercent), layer(8, shadowAmbientShadowPercent)].join(',');
|
|
37
|
+
}
|
|
38
|
+
export const SHADOW_COLOR_VAR = '--sg-palette-shadow';
|
|
39
|
+
const shadows = ['none'].concat(elevationGeometries.map(geometry => createShadow(geometry, percent => `rgb(from var(${SHADOW_COLOR_VAR}) r g b / ${percent / 100})`)));
|
|
40
|
+
/**
|
|
41
|
+
* The finished shadow for each size the admin offers, for a single `theme.shadowSizes[size]` lookup.
|
|
42
|
+
*/
|
|
43
|
+
export const shadowSizes = Object.fromEntries(Object.entries(SHADOW_SIZE_ELEVATIONS).map(([size, elevation]) => [size, shadows[elevation]]));
|
|
10
44
|
export default shadows;
|
|
@@ -10,7 +10,7 @@ import type { ApplyStyles } from './applyStyles';
|
|
|
10
10
|
import type { GetColorSchemeSelector, ActiveColorSchemeSwitcher } from './helpers';
|
|
11
11
|
import type { CreateCssVarsForColorSchemeThemesReturnValue } from './createCssVarsForColorSchemeThemes';
|
|
12
12
|
import type { Shape, ShapeOptions } from './createShape';
|
|
13
|
-
import type { Shadows } from './shadows';
|
|
13
|
+
import type { Shadows, ShadowSize } from './shadows';
|
|
14
14
|
export type { Breakpoint } from './createBreakpoints';
|
|
15
15
|
export type { PaletteColorsWithMain } from './createPalette';
|
|
16
16
|
export declare const COLOR_SCHEME_NAMES: readonly ["light", "dark"];
|
|
@@ -94,6 +94,10 @@ export interface BaseTheme {
|
|
|
94
94
|
* Pre-defined shadow styles for different elevation levels, following Material Design guidelines.
|
|
95
95
|
*/
|
|
96
96
|
shadows: Shadows;
|
|
97
|
+
/**
|
|
98
|
+
* The finished box-shadow size (`none` | `low` | `medium` | `strong`)
|
|
99
|
+
*/
|
|
100
|
+
shadowSizes: Record<ShadowSize, string>;
|
|
97
101
|
/**
|
|
98
102
|
* Adds an alpha value to a color, returning a new color string with the applied alpha.
|
|
99
103
|
* @param color The color to modify.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../styles/theme/createTheme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB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