@sincpro/mobile-ui 0.7.2 → 1.0.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/README.md +7 -5
- package/dist/Actions/Actions.Button.d.ts +91 -91
- package/dist/Actions/Actions.Button.js +36 -43
- package/dist/Actions/Actions.FAB.js +5 -5
- package/dist/Actions/Actions.FilterButton.js +3 -3
- package/dist/Actions/Actions.IconButton.d.ts +31 -31
- package/dist/Actions/Actions.IconButton.js +4 -4
- package/dist/Actions/index.d.ts +11 -11
- package/dist/Actions/index.js +5 -5
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +1 -1
- package/dist/Dialog/BottomSheet/index.d.ts +1 -1
- package/dist/Dialog/BottomSheet/index.js +1 -1
- package/dist/Dialog/Confirmation.context.js +3 -3
- package/dist/Dialog/Dialog.ActionSheet.js +6 -6
- package/dist/Dialog/Dialog.Confirmation.js +4 -4
- package/dist/Dialog/Dialog.EditValue.js +4 -4
- package/dist/Dialog/Dialog.Sheet.js +6 -4
- package/dist/Dialog/index.d.ts +5 -5
- package/dist/Dialog/index.js +5 -5
- package/dist/Display/Display.Accordion.js +5 -5
- package/dist/Display/Display.Avatar.d.ts +30 -30
- package/dist/Display/Display.Avatar.js +2 -2
- package/dist/Display/Display.AvatarGroup.js +3 -3
- package/dist/Display/Display.Badge.d.ts +3 -3
- package/dist/Display/Display.Badge.js +1 -1
- package/dist/Display/Display.Card.d.ts +15 -15
- package/dist/Display/Display.Card.js +4 -4
- package/dist/Display/Display.Carousel.js +2 -2
- package/dist/Display/Display.Chip.d.ts +3 -3
- package/dist/Display/Display.Chip.js +12 -12
- package/dist/Display/Display.CircleButton.d.ts +1 -1
- package/dist/Display/Display.CircleButton.js +3 -3
- package/dist/Display/Display.CopyableText.js +2 -2
- package/dist/Display/Display.CountRecords.js +2 -2
- package/dist/Display/Display.DataTable.js +2 -2
- package/dist/Display/Display.Date.d.ts +1 -1
- package/dist/Display/Display.Date.js +5 -5
- package/dist/Display/Display.Divider.d.ts +24 -24
- package/dist/Display/Display.Divider.js +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +58 -39
- package/dist/Display/Display.GradientSurface.js +31 -15
- package/dist/Display/Display.Icon.d.ts +1 -1
- package/dist/Display/Display.Icon.js +1 -1
- package/dist/Display/Display.IconBadge.js +3 -3
- package/dist/Display/Display.Image.js +4 -4
- package/dist/Display/Display.KeyValue.js +2 -2
- package/dist/Display/Display.ListItem.js +5 -5
- package/dist/Display/Display.Logo.d.ts +3 -3
- package/dist/Display/Display.Logo.js +2 -2
- package/dist/Display/Display.MediaCard.js +4 -4
- package/dist/Display/Display.MediaEmbed.js +7 -7
- package/dist/Display/Display.MenuButton.d.ts +4 -4
- package/dist/Display/Display.MenuButton.js +6 -6
- package/dist/Display/Display.MenuCard.d.ts +1 -1
- package/dist/Display/Display.MenuCard.js +3 -3
- package/dist/Display/Display.MenuGrid.d.ts +1 -1
- package/dist/Display/Display.MenuGrid.js +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +2 -2
- package/dist/Display/Display.Pattern.d.ts +33 -12
- package/dist/Display/Display.Pattern.js +60 -14
- package/dist/Display/Display.PriceTag.js +2 -2
- package/dist/Display/Display.ProductCard.js +7 -7
- package/dist/Display/Display.Rating.js +3 -3
- package/dist/Display/Display.SearchHistory.js +6 -6
- package/dist/Display/Display.SectionHeader.js +4 -4
- package/dist/Display/Display.Stat.js +2 -2
- package/dist/Display/Display.StatCard.js +4 -4
- package/dist/Display/Display.StatusDot.js +3 -3
- package/dist/Display/Display.Story.js +3 -3
- package/dist/Display/Display.StoryTray.js +5 -5
- package/dist/Display/Display.StoryViewer.js +4 -4
- package/dist/Display/Display.SwipeableRow.js +4 -4
- package/dist/Display/Display.Tag.js +2 -2
- package/dist/Display/Display.Timeline.js +4 -4
- package/dist/Display/Display.Tooltip.js +3 -3
- package/dist/Display/index.d.ts +45 -45
- package/dist/Display/index.js +42 -42
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/ErrorBoundary.js +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +3 -3
- package/dist/Feedback/Feedback.Banner.js +5 -5
- package/dist/Feedback/Feedback.DomainSplashScreen.js +5 -4
- package/dist/Feedback/Feedback.Empty.js +3 -3
- package/dist/Feedback/Feedback.EmptyState.js +5 -5
- package/dist/Feedback/Feedback.Error.js +4 -4
- package/dist/Feedback/Feedback.Loading.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.js +2 -2
- package/dist/Feedback/Feedback.PermissionCard.js +5 -5
- package/dist/Feedback/Feedback.Progress.js +2 -2
- package/dist/Feedback/Feedback.ProgressCircle.js +1 -1
- package/dist/Feedback/Feedback.Skeleton.js +2 -2
- package/dist/Feedback/Feedback.Spinner.js +3 -3
- package/dist/Feedback/Feedback.Splash.d.ts +1 -1
- package/dist/Feedback/Feedback.Splash.js +7 -6
- package/dist/Feedback/Toast.context.js +7 -7
- package/dist/Feedback/index.d.ts +13 -13
- package/dist/Feedback/index.js +13 -13
- package/dist/Form/Form.Button.d.ts +2 -2
- package/dist/Form/Form.Button.js +1 -1
- package/dist/Form/Form.Checkbox.js +4 -4
- package/dist/Form/Form.ControlledCheckbox.js +1 -1
- package/dist/Form/Form.ControlledInput.js +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.js +1 -1
- package/dist/Form/Form.ControlledRadioButton.js +1 -1
- package/dist/Form/Form.DatePicker.js +5 -5
- package/dist/Form/Form.Dropdown.js +7 -7
- package/dist/Form/Form.FAB.d.ts +2 -2
- package/dist/Form/Form.FAB.js +1 -1
- package/dist/Form/Form.FilterButton.d.ts +2 -2
- package/dist/Form/Form.FilterButton.js +1 -1
- package/dist/Form/Form.FractionalQuantityInput.js +4 -4
- package/dist/Form/Form.IconButton.d.ts +2 -2
- package/dist/Form/Form.IconButton.js +1 -1
- package/dist/Form/Form.Input.js +4 -4
- package/dist/Form/Form.InputField.d.ts +1 -1
- package/dist/Form/Form.InputField.js +3 -3
- package/dist/Form/Form.MonetaryInput.js +5 -4
- package/dist/Form/Form.PasswordInput.d.ts +1 -1
- package/dist/Form/Form.PasswordInput.js +3 -3
- package/dist/Form/Form.PinInput.js +5 -5
- package/dist/Form/Form.QuantitySelector.js +3 -3
- package/dist/Form/Form.RadioButton.js +4 -4
- package/dist/Form/Form.SearchBar.js +4 -4
- package/dist/Form/Form.Select.js +6 -6
- package/dist/Form/Form.Slider.js +3 -3
- package/dist/Form/Form.Switch.js +4 -4
- package/dist/Form/Form.TextInput.js +3 -3
- package/dist/Form/index.d.ts +27 -27
- package/dist/Form/index.js +25 -25
- package/dist/Navigation/Navigation.AppBar.d.ts +5 -4
- package/dist/Navigation/Navigation.AppBar.js +10 -10
- package/dist/Navigation/Navigation.BottomNav.d.ts +1 -1
- package/dist/Navigation/Navigation.BottomNav.js +25 -16
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +1 -1
- package/dist/Navigation/Navigation.CollapsingHeader.js +3 -3
- package/dist/Navigation/Navigation.FloatingBar.js +2 -2
- package/dist/Navigation/Navigation.Header.js +6 -6
- package/dist/Navigation/Navigation.HeaderToolbar.js +5 -5
- package/dist/Navigation/Navigation.Menu.js +6 -6
- package/dist/Navigation/Navigation.MenuSection.js +2 -2
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.RowItem.js +2 -2
- package/dist/Navigation/Navigation.SearchBar.js +6 -6
- package/dist/Navigation/Navigation.SegmentedControl.js +4 -4
- package/dist/Navigation/Navigation.Steps.js +5 -5
- package/dist/Navigation/Navigation.TabIcon.js +2 -2
- package/dist/Navigation/Navigation.TabItem.js +2 -2
- package/dist/Navigation/Navigation.Tabs.js +5 -5
- package/dist/Navigation/index.d.ts +19 -19
- package/dist/Navigation/index.js +15 -15
- package/dist/Typography/Typography.Heading.d.ts +1 -1
- package/dist/Typography/Typography.Heading.js +1 -1
- package/dist/Typography/Typography.Text.d.ts +2 -2
- package/dist/Typography/Typography.Text.js +8 -6
- package/dist/Typography/index.d.ts +2 -2
- package/dist/Typography/index.js +2 -2
- package/dist/branding.d.ts +22 -0
- package/dist/branding.js +20 -3
- package/dist/icons/AddItemIcon.d.ts +1 -1
- package/dist/icons/ArrangeCircle.d.ts +1 -1
- package/dist/icons/ArrowDownIcon.d.ts +1 -1
- package/dist/icons/ArrowUpIcon.d.ts +1 -1
- package/dist/icons/BoxIcon.d.ts +1 -1
- package/dist/icons/BoxTimeIcon.d.ts +1 -1
- package/dist/icons/CalendarIcon.d.ts +1 -1
- package/dist/icons/CardIcon.d.ts +1 -1
- package/dist/icons/CashierIcon.d.ts +1 -1
- package/dist/icons/DuoIcon.d.ts +1 -1
- package/dist/icons/HomeIcon.d.ts +1 -1
- package/dist/icons/HomeIconOutlined.d.ts +1 -1
- package/dist/icons/LogoIcon.d.ts +1 -1
- package/dist/icons/MoneyReceiveIcon.d.ts +1 -1
- package/dist/icons/PinIcon.d.ts +1 -1
- package/dist/icons/PrinterIcon.d.ts +1 -1
- package/dist/icons/ProfileIcon.d.ts +1 -1
- package/dist/icons/SettingsIcon.d.ts +1 -1
- package/dist/icons/SinpeIcon.d.ts +1 -1
- package/dist/icons/ToggleOffIcon.d.ts +1 -1
- package/dist/icons/WalletMoneyIcon.d.ts +1 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.js +26 -24
- package/dist/layouts/AuthContainer.d.ts +5 -2
- package/dist/layouts/AuthContainer.js +6 -6
- package/dist/layouts/Container.js +1 -1
- package/dist/layouts/GradientContainer.js +1 -1
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.js +4 -4
- package/dist/primitives/AspectRatio.js +1 -1
- package/dist/primitives/BaseButton.d.ts +85 -85
- package/dist/primitives/BaseButton.js +34 -50
- package/dist/primitives/Box.js +1 -1
- package/dist/primitives/Pressable.js +1 -1
- package/dist/primitives/Row.js +1 -1
- package/dist/primitives/Stack.js +1 -1
- package/dist/primitives/index.d.ts +6 -6
- package/dist/primitives/index.js +6 -6
- package/dist/theme/active.d.ts +1 -1
- package/dist/theme/active.js +14 -1
- package/dist/theme/build.d.ts +33 -0
- package/dist/theme/build.js +118 -0
- package/dist/theme/color.d.ts +26 -0
- package/dist/theme/color.js +109 -0
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/contrast.d.ts +29 -0
- package/dist/theme/contrast.js +57 -0
- package/dist/theme/css-vars.d.ts +3 -1
- package/dist/theme/css-vars.js +29 -3
- package/dist/theme/dark.d.ts +3 -4
- package/dist/theme/dark.js +91 -48
- package/dist/theme/default.d.ts +5 -1
- package/dist/theme/default.js +89 -41
- package/dist/theme/define.d.ts +4 -1
- package/dist/theme/define.js +4 -1
- package/dist/theme/globals.css +61 -46
- package/dist/theme/index.d.ts +14 -10
- package/dist/theme/index.js +13 -9
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +2 -2
- package/dist/theme/types.d.ts +77 -16
- package/dist/theme/types.js +13 -3
- package/dist/theme/typography.d.ts +4 -4
- package/dist/theme/typography.js +26 -28
- package/dist/theme/useTheme.d.ts +1 -1
- package/dist/theme/useTheme.js +1 -1
- package/dist/theme/validate.d.ts +16 -0
- package/dist/theme/validate.js +200 -0
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +2 -2
- package/dist/views/AppSplashView.d.ts +2 -2
- package/dist/views/AppSplashView.js +3 -3
- package/dist/views/AuthFormView.d.ts +1 -1
- package/dist/views/AuthFormView.js +3 -3
- package/dist/views/FormViewV2.d.ts +2 -2
- package/dist/views/FormViewV2.js +9 -9
- package/dist/views/ListViewV2.d.ts +3 -3
- package/dist/views/ListViewV2.js +16 -16
- package/dist/views/Wizard/Wizard.context.js +1 -1
- package/dist/views/Wizard/Wizard.d.ts +1 -1
- package/dist/views/Wizard/Wizard.js +1 -1
- package/dist/views/Wizard/index.d.ts +4 -4
- package/dist/views/Wizard/index.js +2 -2
- package/dist/views/types/IFormView.d.ts +1 -1
- package/dist/views/types/IListView.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +2 -2
- package/dist/widgets/CircleButton.js +1 -1
- package/dist/widgets/GeoPermissionCard.js +3 -3
- package/dist/widgets/HomeHeader.js +3 -3
- package/dist/widgets/JSONViewer.js +2 -2
- package/dist/widgets/MenuCard.d.ts +2 -2
- package/dist/widgets/MenuCard.js +1 -1
- package/dist/widgets/MenuGrid.d.ts +3 -3
- package/dist/widgets/MenuGrid.js +1 -1
- package/dist/widgets/MenuSection.d.ts +2 -2
- package/dist/widgets/MenuSection.js +1 -1
- package/dist/widgets/PromoBanner.js +3 -3
- package/dist/widgets/PromoModal.js +3 -3
- package/dist/widgets/QuickActions.js +3 -3
- package/dist/widgets/ScreenHeader.js +2 -2
- package/dist/widgets/TimeZoneSelector.d.ts +1 -1
- package/dist/widgets/TimeZoneSelector.js +4 -4
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
- package/dist/widgets/TimeZoneSelectorModal.js +5 -5
- package/dist/widgets/index.d.ts +16 -16
- package/dist/widgets/index.js +10 -10
- package/package.json +56 -50
- package/tailwind.preset.js +19 -0
- package/dist/icons/icon_getters.d.ts +0 -6
- package/dist/icons/icon_getters.js +0 -23
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color primitives for theme derivation (HSL). Used by buildThemeFromBrand
|
|
3
|
+
* and container/tonal helpers — keeps brand math in one place.
|
|
4
|
+
*/
|
|
5
|
+
export function hexToRgb(hex) {
|
|
6
|
+
const h = hex.trim().replace(/^#/, "");
|
|
7
|
+
const full = h.length === 3
|
|
8
|
+
? h
|
|
9
|
+
.split("")
|
|
10
|
+
.map((c) => c + c)
|
|
11
|
+
.join("")
|
|
12
|
+
: h;
|
|
13
|
+
return {
|
|
14
|
+
r: Number.parseInt(full.slice(0, 2), 16),
|
|
15
|
+
g: Number.parseInt(full.slice(2, 4), 16),
|
|
16
|
+
b: Number.parseInt(full.slice(4, 6), 16),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function rgbToHex(r, g, b) {
|
|
20
|
+
const clamp = (n) => Math.max(0, Math.min(255, Math.round(n)));
|
|
21
|
+
return ("#" +
|
|
22
|
+
[clamp(r), clamp(g), clamp(b)]
|
|
23
|
+
.map((n) => n.toString(16).padStart(2, "0"))
|
|
24
|
+
.join("")
|
|
25
|
+
.toUpperCase());
|
|
26
|
+
}
|
|
27
|
+
export function hexToHsl(hex) {
|
|
28
|
+
const { r, g, b } = hexToRgb(hex);
|
|
29
|
+
const rn = r / 255;
|
|
30
|
+
const gn = g / 255;
|
|
31
|
+
const bn = b / 255;
|
|
32
|
+
const max = Math.max(rn, gn, bn);
|
|
33
|
+
const min = Math.min(rn, gn, bn);
|
|
34
|
+
const l = (max + min) / 2;
|
|
35
|
+
if (max === min)
|
|
36
|
+
return { h: 0, s: 0, l };
|
|
37
|
+
const d = max - min;
|
|
38
|
+
const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
39
|
+
let h = 0;
|
|
40
|
+
if (max === rn)
|
|
41
|
+
h = ((gn - bn) / d + (gn < bn ? 6 : 0)) / 6;
|
|
42
|
+
else if (max === gn)
|
|
43
|
+
h = ((bn - rn) / d + 2) / 6;
|
|
44
|
+
else
|
|
45
|
+
h = ((rn - gn) / d + 4) / 6;
|
|
46
|
+
return { h: h * 360, s, l };
|
|
47
|
+
}
|
|
48
|
+
export function hslToHex({ h, s, l }) {
|
|
49
|
+
const hh = ((h % 360) + 360) % 360;
|
|
50
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
51
|
+
const x = c * (1 - Math.abs(((hh / 60) % 2) - 1));
|
|
52
|
+
const m = l - c / 2;
|
|
53
|
+
let rn = 0;
|
|
54
|
+
let gn = 0;
|
|
55
|
+
let bn = 0;
|
|
56
|
+
if (hh < 60) {
|
|
57
|
+
rn = c;
|
|
58
|
+
gn = x;
|
|
59
|
+
}
|
|
60
|
+
else if (hh < 120) {
|
|
61
|
+
rn = x;
|
|
62
|
+
gn = c;
|
|
63
|
+
}
|
|
64
|
+
else if (hh < 180) {
|
|
65
|
+
gn = c;
|
|
66
|
+
bn = x;
|
|
67
|
+
}
|
|
68
|
+
else if (hh < 240) {
|
|
69
|
+
gn = x;
|
|
70
|
+
bn = c;
|
|
71
|
+
}
|
|
72
|
+
else if (hh < 300) {
|
|
73
|
+
rn = x;
|
|
74
|
+
bn = c;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
rn = c;
|
|
78
|
+
bn = x;
|
|
79
|
+
}
|
|
80
|
+
return rgbToHex((rn + m) * 255, (gn + m) * 255, (bn + m) * 255);
|
|
81
|
+
}
|
|
82
|
+
/** Mix two hex colors. `t=0` → a, `t=1` → b. */
|
|
83
|
+
export function mixHex(a, b, t) {
|
|
84
|
+
const A = hexToRgb(a);
|
|
85
|
+
const B = hexToRgb(b);
|
|
86
|
+
const u = Math.max(0, Math.min(1, t));
|
|
87
|
+
return rgbToHex(A.r + (B.r - A.r) * u, A.g + (B.g - A.g) * u, A.b + (B.b - A.b) * u);
|
|
88
|
+
}
|
|
89
|
+
/** Shift lightness in HSL. delta in [-1, 1] absolute L change. */
|
|
90
|
+
export function shiftLightness(hex, delta) {
|
|
91
|
+
const hsl = hexToHsl(hex);
|
|
92
|
+
return hslToHex({
|
|
93
|
+
...hsl,
|
|
94
|
+
l: Math.max(0, Math.min(1, hsl.l + delta)),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** Soft container fill + on-container ink (M3-style tonal pair). */
|
|
98
|
+
export function containerPair(seed, mode) {
|
|
99
|
+
if (mode === "light") {
|
|
100
|
+
return {
|
|
101
|
+
container: mixHex(seed, "#FFFFFF", 0.88),
|
|
102
|
+
onContainer: shiftLightness(seed, -0.22),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
container: mixHex(seed, "#000000", 0.72),
|
|
107
|
+
onContainer: mixHex(seed, "#FFFFFF", 0.45),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* Components that need access to theme tokens via hook.
|
|
7
7
|
* Estos son el 1% de casos donde className no es suficiente.
|
|
8
8
|
*/
|
|
9
|
-
export { ThemedActivityIndicator } from "
|
|
9
|
+
export { ThemedActivityIndicator } from "./ThemedActivityIndicator.js";
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* Components that need access to theme tokens via hook.
|
|
7
7
|
* Estos son el 1% de casos donde className no es suficiente.
|
|
8
8
|
*/
|
|
9
|
-
export { ThemedActivityIndicator } from "
|
|
9
|
+
export { ThemedActivityIndicator } from "./ThemedActivityIndicator.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 2.1 contrast helpers for theme authors.
|
|
3
|
+
* Used by `validateTheme` and by consumers building brand palettes.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseHex(hex: string): {
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function relativeLuminance(hex: string): number;
|
|
11
|
+
/** Contrast ratio between two sRGB hex colors (WCAG 2.1). */
|
|
12
|
+
export declare function contrastRatio(fg: string, bg: string): number;
|
|
13
|
+
export type ResolveOnColorOptions = {
|
|
14
|
+
/** Ink for light fills. Default `#FFFFFF`. */
|
|
15
|
+
light?: string;
|
|
16
|
+
/** Ink for dark/saturated fills. Default `#0A0A0A`. */
|
|
17
|
+
dark?: string;
|
|
18
|
+
/** Minimum contrast (AA body = 4.5). */
|
|
19
|
+
minRatio?: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Picks light or dark ink for text/icons on a filled surface so WCAG AA holds
|
|
23
|
+
* for any brand `primary` / `accent` / state color — not a hardcoded ink.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* text: { onPrimary: resolveOnColor("#C9A84C") } // → #0A0A0A
|
|
27
|
+
* text: { onPrimary: resolveOnColor("#0B1F4A") } // → #FFFFFF
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveOnColor(fill: string, options?: ResolveOnColorOptions): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 2.1 contrast helpers for theme authors.
|
|
3
|
+
* Used by `validateTheme` and by consumers building brand palettes.
|
|
4
|
+
*/
|
|
5
|
+
export function parseHex(hex) {
|
|
6
|
+
const h = hex.trim().replace(/^#/, "");
|
|
7
|
+
const full = h.length === 3
|
|
8
|
+
? h
|
|
9
|
+
.split("")
|
|
10
|
+
.map((c) => c + c)
|
|
11
|
+
.join("")
|
|
12
|
+
: h;
|
|
13
|
+
return {
|
|
14
|
+
r: Number.parseInt(full.slice(0, 2), 16),
|
|
15
|
+
g: Number.parseInt(full.slice(2, 4), 16),
|
|
16
|
+
b: Number.parseInt(full.slice(4, 6), 16),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function relativeLuminance(hex) {
|
|
20
|
+
const { r, g, b } = parseHex(hex);
|
|
21
|
+
const norm = (c) => {
|
|
22
|
+
const s = c / 255;
|
|
23
|
+
return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
24
|
+
};
|
|
25
|
+
return 0.2126 * norm(r) + 0.7152 * norm(g) + 0.0722 * norm(b);
|
|
26
|
+
}
|
|
27
|
+
/** Contrast ratio between two sRGB hex colors (WCAG 2.1). */
|
|
28
|
+
export function contrastRatio(fg, bg) {
|
|
29
|
+
const L1 = relativeLuminance(fg);
|
|
30
|
+
const L2 = relativeLuminance(bg);
|
|
31
|
+
return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05);
|
|
32
|
+
}
|
|
33
|
+
const DEFAULT_ON_LIGHT = "#FFFFFF";
|
|
34
|
+
const DEFAULT_ON_DARK = "#0A0A0A";
|
|
35
|
+
/**
|
|
36
|
+
* Picks light or dark ink for text/icons on a filled surface so WCAG AA holds
|
|
37
|
+
* for any brand `primary` / `accent` / state color — not a hardcoded ink.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* text: { onPrimary: resolveOnColor("#C9A84C") } // → #0A0A0A
|
|
41
|
+
* text: { onPrimary: resolveOnColor("#0B1F4A") } // → #FFFFFF
|
|
42
|
+
*/
|
|
43
|
+
export function resolveOnColor(fill, options = {}) {
|
|
44
|
+
const light = options.light ?? DEFAULT_ON_LIGHT;
|
|
45
|
+
const dark = options.dark ?? DEFAULT_ON_DARK;
|
|
46
|
+
const min = options.minRatio ?? 4.5;
|
|
47
|
+
const withLight = contrastRatio(light, fill);
|
|
48
|
+
const withDark = contrastRatio(dark, fill);
|
|
49
|
+
if (withLight >= min && withDark >= min) {
|
|
50
|
+
return withLight >= withDark ? light : dark;
|
|
51
|
+
}
|
|
52
|
+
if (withLight >= min)
|
|
53
|
+
return light;
|
|
54
|
+
if (withDark >= min)
|
|
55
|
+
return dark;
|
|
56
|
+
return withLight >= withDark ? light : dark;
|
|
57
|
+
}
|
package/dist/theme/css-vars.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ThemeTokens } from "
|
|
1
|
+
import type { ThemeTokens } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Deriva las CSS variables (tripletes RGB para `rgb(var(--x) / <alpha>)`) a
|
|
4
4
|
* partir del objeto de tokens tipado. Fuente ÚNICA: las clases (className) y el
|
|
5
5
|
* objeto JS (style) salen del mismo `ThemeTokens`, sin posibilidad de divergir.
|
|
6
|
+
*
|
|
7
|
+
* State / material opacities are emitted as unitless numbers (not RGB).
|
|
6
8
|
*/
|
|
7
9
|
export declare function themeToVars(t: ThemeTokens): Record<string, string>;
|
package/dist/theme/css-vars.js
CHANGED
|
@@ -6,15 +6,17 @@ function toRgbTriplet(color) {
|
|
|
6
6
|
.map((c) => c + c)
|
|
7
7
|
.join("")
|
|
8
8
|
: hex;
|
|
9
|
-
const r = parseInt(full.slice(0, 2), 16);
|
|
10
|
-
const g = parseInt(full.slice(2, 4), 16);
|
|
11
|
-
const b = parseInt(full.slice(4, 6), 16);
|
|
9
|
+
const r = Number.parseInt(full.slice(0, 2), 16);
|
|
10
|
+
const g = Number.parseInt(full.slice(2, 4), 16);
|
|
11
|
+
const b = Number.parseInt(full.slice(4, 6), 16);
|
|
12
12
|
return `${r} ${g} ${b}`;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Deriva las CSS variables (tripletes RGB para `rgb(var(--x) / <alpha>)`) a
|
|
16
16
|
* partir del objeto de tokens tipado. Fuente ÚNICA: las clases (className) y el
|
|
17
17
|
* objeto JS (style) salen del mismo `ThemeTokens`, sin posibilidad de divergir.
|
|
18
|
+
*
|
|
19
|
+
* State / material opacities are emitted as unitless numbers (not RGB).
|
|
18
20
|
*/
|
|
19
21
|
export function themeToVars(t) {
|
|
20
22
|
const rgb = toRgbTriplet;
|
|
@@ -29,6 +31,9 @@ export function themeToVars(t) {
|
|
|
29
31
|
"--bg-accent": rgb(t.bg.accent),
|
|
30
32
|
"--bg-hover": rgb(t.bg.hover),
|
|
31
33
|
"--bg-disabled": rgb(t.bg.disabled),
|
|
34
|
+
"--bg-container-lowest": rgb(t.bg.containerLowest),
|
|
35
|
+
"--bg-container": rgb(t.bg.container),
|
|
36
|
+
"--bg-container-high": rgb(t.bg.containerHigh),
|
|
32
37
|
"--text-primary": rgb(t.text.primary),
|
|
33
38
|
"--text-secondary": rgb(t.text.secondary),
|
|
34
39
|
"--text-tertiary": rgb(t.text.tertiary),
|
|
@@ -58,6 +63,27 @@ export function themeToVars(t) {
|
|
|
58
63
|
"--warning-light": rgb(t.warningLight),
|
|
59
64
|
"--danger-light": rgb(t.dangerLight),
|
|
60
65
|
"--info-light": rgb(t.infoLight),
|
|
66
|
+
"--container-primary": rgb(t.container.primary),
|
|
67
|
+
"--container-on-primary": rgb(t.container.onPrimary),
|
|
68
|
+
"--container-secondary": rgb(t.container.secondary),
|
|
69
|
+
"--container-on-secondary": rgb(t.container.onSecondary),
|
|
70
|
+
"--container-accent": rgb(t.container.accent),
|
|
71
|
+
"--container-on-accent": rgb(t.container.onAccent),
|
|
72
|
+
"--container-success": rgb(t.container.success),
|
|
73
|
+
"--container-on-success": rgb(t.container.onSuccess),
|
|
74
|
+
"--container-warning": rgb(t.container.warning),
|
|
75
|
+
"--container-on-warning": rgb(t.container.onWarning),
|
|
76
|
+
"--container-danger": rgb(t.container.danger),
|
|
77
|
+
"--container-on-danger": rgb(t.container.onDanger),
|
|
78
|
+
"--container-info": rgb(t.container.info),
|
|
79
|
+
"--container-on-info": rgb(t.container.onInfo),
|
|
80
|
+
"--state-hover": String(t.state.hover),
|
|
81
|
+
"--state-press": String(t.state.press),
|
|
82
|
+
"--state-focus": String(t.state.focus),
|
|
83
|
+
"--state-drag": String(t.state.drag),
|
|
84
|
+
"--material-blur": String(t.material.blur),
|
|
85
|
+
"--material-opacity": String(t.material.opacity),
|
|
86
|
+
"--material-border-opacity": String(t.material.borderOpacity),
|
|
61
87
|
"--ring": rgb(t.ring),
|
|
62
88
|
"--input": rgb(t.input),
|
|
63
89
|
};
|
package/dist/theme/dark.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ThemeTokens } from "
|
|
1
|
+
import type { ThemeTokens } from "./types.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Border/text tones shift to near-black warm neutrals (not blue-slate).
|
|
3
|
+
* Default dark theme. Companion to `DEFAULT_THEME`.
|
|
4
|
+
* Prefer `buildThemeFromBrand({ mode: "dark", ... })` for brand apps.
|
|
6
5
|
*/
|
|
7
6
|
export declare const DEFAULT_DARK_THEME: ThemeTokens;
|
package/dist/theme/dark.js
CHANGED
|
@@ -1,63 +1,102 @@
|
|
|
1
|
+
import { containerPair } from "./color.js";
|
|
2
|
+
import { resolveOnColor } from "./contrast.js";
|
|
3
|
+
/** Web UI dark palette. The same roles, measured on #181614. */
|
|
4
|
+
const PRIMARY = "#8FA9E8";
|
|
5
|
+
const SECONDARY = "#B0C3F1";
|
|
6
|
+
const ACCENT = "#C89B3C";
|
|
7
|
+
const SUCCESS = "#6FCF8B";
|
|
8
|
+
const WARNING = "#E3B341";
|
|
9
|
+
const DANGER = "#F08D7F";
|
|
10
|
+
const INFO = "#5CC4D8";
|
|
11
|
+
const INK = "#ECE8E1";
|
|
12
|
+
const MUTED = "#A39B90";
|
|
13
|
+
const primaryC = containerPair(PRIMARY, "dark");
|
|
14
|
+
const secondaryC = containerPair(SECONDARY, "dark");
|
|
15
|
+
const accentC = containerPair(ACCENT, "dark");
|
|
16
|
+
const successC = containerPair(SUCCESS, "dark");
|
|
17
|
+
const warningC = containerPair(WARNING, "dark");
|
|
18
|
+
const dangerC = containerPair(DANGER, "dark");
|
|
19
|
+
const infoC = containerPair(INFO, "dark");
|
|
1
20
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Border/text tones shift to near-black warm neutrals (not blue-slate).
|
|
21
|
+
* Default dark theme. Companion to `DEFAULT_THEME`.
|
|
22
|
+
* Prefer `buildThemeFromBrand({ mode: "dark", ... })` for brand apps.
|
|
5
23
|
*/
|
|
6
24
|
export const DEFAULT_DARK_THEME = {
|
|
7
|
-
name: "dark",
|
|
8
|
-
primary:
|
|
9
|
-
secondary:
|
|
10
|
-
accent:
|
|
25
|
+
name: "default-dark",
|
|
26
|
+
primary: PRIMARY,
|
|
27
|
+
secondary: SECONDARY,
|
|
28
|
+
accent: ACCENT,
|
|
11
29
|
bg: {
|
|
12
|
-
page: "#
|
|
13
|
-
card: "#
|
|
14
|
-
popover: "#
|
|
15
|
-
muted: "#
|
|
16
|
-
accent:
|
|
17
|
-
hover: "#
|
|
18
|
-
disabled: "#
|
|
19
|
-
inverse: "#
|
|
30
|
+
page: "#181614",
|
|
31
|
+
card: "#221F1C",
|
|
32
|
+
popover: "#221F1C",
|
|
33
|
+
muted: "#302C28",
|
|
34
|
+
accent: primaryC.container,
|
|
35
|
+
hover: "#2A2622",
|
|
36
|
+
disabled: "#302C28",
|
|
37
|
+
inverse: "#FAF9F7",
|
|
38
|
+
containerLowest: "#141210",
|
|
39
|
+
container: "#221F1C",
|
|
40
|
+
containerHigh: "#302C28",
|
|
20
41
|
},
|
|
21
42
|
text: {
|
|
22
|
-
primary:
|
|
23
|
-
secondary:
|
|
24
|
-
tertiary: "#
|
|
25
|
-
muted:
|
|
26
|
-
accent:
|
|
27
|
-
inverse: "#
|
|
28
|
-
disabled: "#
|
|
29
|
-
onPrimary:
|
|
30
|
-
onSecondary:
|
|
31
|
-
onAccent:
|
|
32
|
-
onDanger:
|
|
33
|
-
onSuccess:
|
|
43
|
+
primary: INK,
|
|
44
|
+
secondary: MUTED,
|
|
45
|
+
tertiary: "#8A8178",
|
|
46
|
+
muted: MUTED,
|
|
47
|
+
accent: PRIMARY,
|
|
48
|
+
inverse: "#0A0A0A",
|
|
49
|
+
disabled: "#8A8A8A",
|
|
50
|
+
onPrimary: resolveOnColor(PRIMARY),
|
|
51
|
+
onSecondary: resolveOnColor(SECONDARY),
|
|
52
|
+
onAccent: resolveOnColor(ACCENT),
|
|
53
|
+
onDanger: resolveOnColor(DANGER),
|
|
54
|
+
onSuccess: resolveOnColor(SUCCESS),
|
|
34
55
|
},
|
|
35
56
|
icon: {
|
|
36
|
-
primary:
|
|
37
|
-
secondary:
|
|
38
|
-
tertiary: "#
|
|
39
|
-
inverse: "#
|
|
40
|
-
disabled: "#
|
|
57
|
+
primary: INK,
|
|
58
|
+
secondary: MUTED,
|
|
59
|
+
tertiary: "#8A8178",
|
|
60
|
+
inverse: "#0A0A0A",
|
|
61
|
+
disabled: "#8A8A8A",
|
|
41
62
|
},
|
|
42
63
|
border: {
|
|
43
|
-
default: "#
|
|
44
|
-
light: "#
|
|
45
|
-
strong: "#
|
|
46
|
-
focus:
|
|
64
|
+
default: "#302C28",
|
|
65
|
+
light: "#221F1C",
|
|
66
|
+
strong: "#443F38",
|
|
67
|
+
focus: PRIMARY,
|
|
47
68
|
},
|
|
48
|
-
success:
|
|
49
|
-
warning:
|
|
50
|
-
danger:
|
|
51
|
-
info:
|
|
52
|
-
successLight:
|
|
53
|
-
warningLight:
|
|
54
|
-
dangerLight:
|
|
55
|
-
infoLight:
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
success: SUCCESS,
|
|
70
|
+
warning: WARNING,
|
|
71
|
+
danger: DANGER,
|
|
72
|
+
info: INFO,
|
|
73
|
+
successLight: successC.container,
|
|
74
|
+
warningLight: warningC.container,
|
|
75
|
+
dangerLight: dangerC.container,
|
|
76
|
+
infoLight: infoC.container,
|
|
77
|
+
container: {
|
|
78
|
+
primary: primaryC.container,
|
|
79
|
+
onPrimary: primaryC.onContainer,
|
|
80
|
+
secondary: secondaryC.container,
|
|
81
|
+
onSecondary: secondaryC.onContainer,
|
|
82
|
+
accent: accentC.container,
|
|
83
|
+
onAccent: accentC.onContainer,
|
|
84
|
+
success: successC.container,
|
|
85
|
+
onSuccess: successC.onContainer,
|
|
86
|
+
warning: warningC.container,
|
|
87
|
+
onWarning: warningC.onContainer,
|
|
88
|
+
danger: dangerC.container,
|
|
89
|
+
onDanger: dangerC.onContainer,
|
|
90
|
+
info: infoC.container,
|
|
91
|
+
onInfo: infoC.onContainer,
|
|
92
|
+
},
|
|
93
|
+
state: { hover: 0.1, press: 0.16, focus: 0.14, drag: 0.2 },
|
|
94
|
+
material: { blur: 28, opacity: 0.62, borderOpacity: 0.22 },
|
|
95
|
+
ring: PRIMARY,
|
|
96
|
+
input: "#302C28",
|
|
58
97
|
gradient: {
|
|
59
|
-
primary: ["#
|
|
60
|
-
accent: [
|
|
98
|
+
primary: ["#1C3765", PRIMARY],
|
|
99
|
+
accent: [ACCENT, "#DBB055"],
|
|
61
100
|
},
|
|
62
101
|
shadow: {
|
|
63
102
|
sm: {
|
|
@@ -82,4 +121,8 @@ export const DEFAULT_DARK_THEME = {
|
|
|
82
121
|
elevation: 7,
|
|
83
122
|
},
|
|
84
123
|
},
|
|
124
|
+
pattern: {
|
|
125
|
+
mode: "dark-pattern",
|
|
126
|
+
size: 56,
|
|
127
|
+
},
|
|
85
128
|
};
|
package/dist/theme/default.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import type { ThemeTokens } from "
|
|
1
|
+
import type { ThemeTokens } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default light theme. Sample values — not the framework identity.
|
|
4
|
+
* Prefer `buildThemeFromBrand` or `extendTheme` at app boot.
|
|
5
|
+
*/
|
|
2
6
|
export declare const DEFAULT_THEME: ThemeTokens;
|
package/dist/theme/default.js
CHANGED
|
@@ -1,64 +1,108 @@
|
|
|
1
|
+
import { containerPair } from "./color.js";
|
|
2
|
+
import { resolveOnColor } from "./contrast.js";
|
|
3
|
+
/** Web UI light palette. Gold is a fill, never a border or a label. */
|
|
4
|
+
const PRIMARY = "#2A4A85";
|
|
5
|
+
const SECONDARY = "#1C3765";
|
|
6
|
+
const ACCENT = "#C89B3C";
|
|
7
|
+
const SUCCESS = "#2F6B3C";
|
|
8
|
+
const WARNING = "#7E5E12";
|
|
9
|
+
const DANGER = "#9B3B30";
|
|
10
|
+
const INFO = "#0F5C6E";
|
|
11
|
+
const INK = "#1A1714";
|
|
12
|
+
const MUTED = "#6B6459";
|
|
13
|
+
const primaryC = containerPair(PRIMARY, "light");
|
|
14
|
+
const secondaryC = containerPair(SECONDARY, "light");
|
|
15
|
+
const accentC = containerPair(ACCENT, "light");
|
|
16
|
+
const successC = containerPair(SUCCESS, "light");
|
|
17
|
+
const warningC = containerPair(WARNING, "light");
|
|
18
|
+
const dangerC = containerPair(DANGER, "light");
|
|
19
|
+
const infoC = containerPair(INFO, "light");
|
|
20
|
+
/**
|
|
21
|
+
* Default light theme. Sample values — not the framework identity.
|
|
22
|
+
* Prefer `buildThemeFromBrand` or `extendTheme` at app boot.
|
|
23
|
+
*/
|
|
1
24
|
export const DEFAULT_THEME = {
|
|
2
|
-
name: "default",
|
|
3
|
-
primary:
|
|
4
|
-
secondary:
|
|
5
|
-
accent:
|
|
25
|
+
name: "default-light",
|
|
26
|
+
primary: PRIMARY,
|
|
27
|
+
secondary: SECONDARY,
|
|
28
|
+
accent: ACCENT,
|
|
6
29
|
bg: {
|
|
7
|
-
page: "#
|
|
30
|
+
page: "#FAF9F7",
|
|
8
31
|
card: "#FFFFFF",
|
|
9
32
|
popover: "#FFFFFF",
|
|
10
|
-
muted: "#
|
|
11
|
-
accent:
|
|
12
|
-
hover: "#
|
|
13
|
-
disabled: "#
|
|
14
|
-
inverse: "#
|
|
33
|
+
muted: "#F3F0EA",
|
|
34
|
+
accent: primaryC.container,
|
|
35
|
+
hover: "#EBE6DE",
|
|
36
|
+
disabled: "#E4DFD7",
|
|
37
|
+
inverse: "#181614",
|
|
38
|
+
containerLowest: "#FAF9F7",
|
|
39
|
+
container: "#F3F0EA",
|
|
40
|
+
containerHigh: "#E4DFD7",
|
|
15
41
|
},
|
|
16
42
|
text: {
|
|
17
|
-
primary:
|
|
18
|
-
secondary:
|
|
19
|
-
tertiary: "#
|
|
20
|
-
muted:
|
|
21
|
-
accent:
|
|
43
|
+
primary: INK,
|
|
44
|
+
secondary: MUTED,
|
|
45
|
+
tertiary: "#A39B90",
|
|
46
|
+
muted: MUTED,
|
|
47
|
+
accent: PRIMARY,
|
|
22
48
|
inverse: "#FFFFFF",
|
|
23
|
-
disabled: "#
|
|
49
|
+
disabled: "#A39B90",
|
|
24
50
|
onPrimary: "#FFFFFF",
|
|
25
51
|
onSecondary: "#FFFFFF",
|
|
26
|
-
onAccent: "#
|
|
27
|
-
onDanger:
|
|
28
|
-
onSuccess:
|
|
52
|
+
onAccent: "#1A1714",
|
|
53
|
+
onDanger: resolveOnColor(DANGER),
|
|
54
|
+
onSuccess: resolveOnColor(SUCCESS),
|
|
29
55
|
},
|
|
30
56
|
icon: {
|
|
31
|
-
primary:
|
|
32
|
-
secondary:
|
|
33
|
-
tertiary: "#
|
|
57
|
+
primary: INK,
|
|
58
|
+
secondary: MUTED,
|
|
59
|
+
tertiary: "#A39B90",
|
|
34
60
|
inverse: "#FFFFFF",
|
|
35
|
-
disabled: "#
|
|
61
|
+
disabled: "#A39B90",
|
|
36
62
|
},
|
|
37
63
|
border: {
|
|
38
|
-
default: "#
|
|
39
|
-
light: "#
|
|
40
|
-
strong: "#
|
|
41
|
-
focus:
|
|
64
|
+
default: "#E4DFD7",
|
|
65
|
+
light: "#F3F0EA",
|
|
66
|
+
strong: "#D5CEC2",
|
|
67
|
+
focus: PRIMARY,
|
|
42
68
|
},
|
|
43
|
-
success:
|
|
44
|
-
warning:
|
|
45
|
-
danger:
|
|
46
|
-
info:
|
|
47
|
-
successLight:
|
|
48
|
-
warningLight:
|
|
49
|
-
dangerLight:
|
|
50
|
-
infoLight:
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
success: SUCCESS,
|
|
70
|
+
warning: WARNING,
|
|
71
|
+
danger: DANGER,
|
|
72
|
+
info: INFO,
|
|
73
|
+
successLight: successC.container,
|
|
74
|
+
warningLight: warningC.container,
|
|
75
|
+
dangerLight: dangerC.container,
|
|
76
|
+
infoLight: infoC.container,
|
|
77
|
+
container: {
|
|
78
|
+
primary: primaryC.container,
|
|
79
|
+
onPrimary: primaryC.onContainer,
|
|
80
|
+
secondary: secondaryC.container,
|
|
81
|
+
onSecondary: secondaryC.onContainer,
|
|
82
|
+
accent: accentC.container,
|
|
83
|
+
onAccent: accentC.onContainer,
|
|
84
|
+
success: successC.container,
|
|
85
|
+
onSuccess: successC.onContainer,
|
|
86
|
+
warning: warningC.container,
|
|
87
|
+
onWarning: warningC.onContainer,
|
|
88
|
+
danger: dangerC.container,
|
|
89
|
+
onDanger: dangerC.onContainer,
|
|
90
|
+
info: infoC.container,
|
|
91
|
+
onInfo: infoC.onContainer,
|
|
92
|
+
},
|
|
93
|
+
state: { hover: 0.08, press: 0.12, focus: 0.12, drag: 0.16 },
|
|
94
|
+
material: { blur: 24, opacity: 0.78, borderOpacity: 0.18 },
|
|
95
|
+
ring: PRIMARY,
|
|
96
|
+
input: "#E4DFD7",
|
|
53
97
|
gradient: {
|
|
54
|
-
primary: [
|
|
55
|
-
accent: ["#
|
|
98
|
+
primary: [SECONDARY, PRIMARY],
|
|
99
|
+
accent: ["#B88A2E", ACCENT],
|
|
56
100
|
},
|
|
57
101
|
shadow: {
|
|
58
102
|
sm: {
|
|
59
103
|
shadowColor: "#000000",
|
|
60
104
|
shadowOffset: { width: 0, height: 1 },
|
|
61
|
-
shadowOpacity: 0.
|
|
105
|
+
shadowOpacity: 0.06,
|
|
62
106
|
shadowRadius: 2,
|
|
63
107
|
elevation: 1,
|
|
64
108
|
},
|
|
@@ -72,9 +116,13 @@ export const DEFAULT_THEME = {
|
|
|
72
116
|
lg: {
|
|
73
117
|
shadowColor: "#000000",
|
|
74
118
|
shadowOffset: { width: 0, height: 10 },
|
|
75
|
-
shadowOpacity: 0.
|
|
119
|
+
shadowOpacity: 0.14,
|
|
76
120
|
shadowRadius: 15,
|
|
77
121
|
elevation: 5,
|
|
78
122
|
},
|
|
79
123
|
},
|
|
124
|
+
pattern: {
|
|
125
|
+
mode: "light-pattern",
|
|
126
|
+
size: 56,
|
|
127
|
+
},
|
|
80
128
|
};
|
package/dist/theme/define.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { ThemeTokens } from "
|
|
1
|
+
import type { ThemeTokens } from "./types.js";
|
|
2
2
|
export type DeepPartial<T> = {
|
|
3
3
|
[K in keyof T]?: T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* Defines a complete, typed theme (powerful API: the framework parametrizes
|
|
7
7
|
* every token explicitly).
|
|
8
|
+
*
|
|
9
|
+
* Tip for brand palettes: set on-colors with `resolveOnColor` from
|
|
10
|
+
* `@sincpro/mobile-ui/theme` so light and dark brand fills both stay WCAG AA.
|
|
8
11
|
*/
|
|
9
12
|
export declare function defineTheme(tokens: ThemeTokens): ThemeTokens;
|
|
10
13
|
/**
|
package/dist/theme/define.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_THEME } from "
|
|
1
|
+
import { DEFAULT_THEME } from "./default.js";
|
|
2
2
|
function isPlainObject(v) {
|
|
3
3
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
4
4
|
}
|
|
@@ -15,6 +15,9 @@ function deepMerge(base, override) {
|
|
|
15
15
|
/**
|
|
16
16
|
* Defines a complete, typed theme (powerful API: the framework parametrizes
|
|
17
17
|
* every token explicitly).
|
|
18
|
+
*
|
|
19
|
+
* Tip for brand palettes: set on-colors with `resolveOnColor` from
|
|
20
|
+
* `@sincpro/mobile-ui/theme` so light and dark brand fills both stay WCAG AA.
|
|
18
21
|
*/
|
|
19
22
|
export function defineTheme(tokens) {
|
|
20
23
|
return tokens;
|