@siiway/ui-core 0.0.0 → 0.1.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/LICENSE +21 -0
- package/README.md +14 -1
- package/dist/boot.d.ts +17 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +29 -0
- package/dist/boot.js.map +1 -0
- package/dist/duration.d.ts +27 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/duration.js +87 -0
- package/dist/duration.js.map +1 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +53 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/index.d.ts +11 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +16 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/types.d.ts +66 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +2 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/i18n/zh.d.ts +3 -0
- package/dist/i18n/zh.d.ts.map +1 -0
- package/dist/i18n/zh.js +53 -0
- package/dist/i18n/zh.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/scheme.d.ts +11 -0
- package/dist/scheme.d.ts.map +1 -0
- package/dist/scheme.js +13 -0
- package/dist/scheme.js.map +1 -0
- package/dist/theme/brand.d.ts +17 -0
- package/dist/theme/brand.d.ts.map +1 -0
- package/dist/theme/brand.js +25 -0
- package/dist/theme/brand.js.map +1 -0
- package/dist/theme/color.d.ts +26 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +148 -0
- package/dist/theme/color.js.map +1 -0
- package/dist/theme/overrides.d.ts +12 -0
- package/dist/theme/overrides.d.ts.map +1 -0
- package/dist/theme/overrides.js +12 -0
- package/dist/theme/overrides.js.map +1 -0
- package/dist/tokens/canvas.d.ts +8 -0
- package/dist/tokens/canvas.d.ts.map +1 -0
- package/dist/tokens/canvas.js +7 -0
- package/dist/tokens/canvas.js.map +1 -0
- package/dist/tokens/neutral.d.ts +55 -0
- package/dist/tokens/neutral.d.ts.map +1 -0
- package/dist/tokens/neutral.js +110 -0
- package/dist/tokens/neutral.js.map +1 -0
- package/dist/tokens/radii.d.ts +8 -0
- package/dist/tokens/radii.d.ts.map +1 -0
- package/dist/tokens/radii.js +8 -0
- package/dist/tokens/radii.js.map +1 -0
- package/dist/tokens/shadows.d.ts +14 -0
- package/dist/tokens/shadows.d.ts.map +1 -0
- package/dist/tokens/shadows.js +21 -0
- package/dist/tokens/shadows.js.map +1 -0
- package/package.json +25 -2
- package/src/boot.ts +40 -0
- package/src/duration.ts +119 -0
- package/src/i18n/en.ts +63 -0
- package/src/i18n/index.ts +24 -0
- package/src/i18n/types.ts +76 -0
- package/src/i18n/zh.ts +62 -0
- package/src/index.ts +42 -0
- package/src/scheme.ts +19 -0
- package/src/theme/brand.ts +32 -0
- package/src/theme/color.ts +147 -0
- package/src/theme/overrides.ts +15 -0
- package/src/tokens/canvas.ts +8 -0
- package/src/tokens/neutral.ts +116 -0
- package/src/tokens/radii.ts +7 -0
- package/src/tokens/shadows.ts +27 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Scheme } from "../scheme.js";
|
|
2
|
+
|
|
3
|
+
// Neutral ramp modelled on the Cloudflare dashboard: one flat page colour
|
|
4
|
+
// (CANVAS) shared by header, sidebar and content; surfaces that differ from it
|
|
5
|
+
// by a hairline border and at most a shade of fill; true neutral greys.
|
|
6
|
+
// StrokeAccessible keeps form-control boundaries above 3:1.
|
|
7
|
+
//
|
|
8
|
+
// Keys are Fluent token names. Fluent's React components and its web
|
|
9
|
+
// components both read these as CSS variables (--colorNeutralBackground1, …),
|
|
10
|
+
// so any adapter can apply them.
|
|
11
|
+
|
|
12
|
+
const LIGHT = {
|
|
13
|
+
colorNeutralBackground1: "#ffffff",
|
|
14
|
+
colorNeutralBackground1Hover: "#f7f7f7",
|
|
15
|
+
colorNeutralBackground1Pressed: "#efefef",
|
|
16
|
+
colorNeutralBackground1Selected: "#f2f2f2",
|
|
17
|
+
colorNeutralBackground2: "#fafafa",
|
|
18
|
+
colorNeutralBackground2Hover: "#f2f2f2",
|
|
19
|
+
colorNeutralBackground2Pressed: "#ebebeb",
|
|
20
|
+
colorNeutralBackground2Selected: "#efefef",
|
|
21
|
+
colorNeutralBackground3: "#f2f2f2",
|
|
22
|
+
colorNeutralBackground3Hover: "#ebebeb",
|
|
23
|
+
colorNeutralBackground3Pressed: "#e3e3e3",
|
|
24
|
+
colorNeutralBackground3Selected: "#ebebeb",
|
|
25
|
+
colorNeutralBackground4: "#ebebeb",
|
|
26
|
+
colorNeutralBackground4Hover: "#e3e3e3",
|
|
27
|
+
colorNeutralBackground4Pressed: "#dbdbdb",
|
|
28
|
+
colorNeutralBackground4Selected: "#e3e3e3",
|
|
29
|
+
colorNeutralBackground5: "#e3e3e3",
|
|
30
|
+
colorNeutralBackground5Hover: "#dbdbdb",
|
|
31
|
+
colorNeutralBackground5Pressed: "#d4d4d4",
|
|
32
|
+
colorNeutralBackground5Selected: "#dbdbdb",
|
|
33
|
+
colorNeutralBackground6: "#dbdbdb",
|
|
34
|
+
colorNeutralForeground1: "#171717",
|
|
35
|
+
colorNeutralForeground1Hover: "#171717",
|
|
36
|
+
colorNeutralForeground1Pressed: "#171717",
|
|
37
|
+
colorNeutralForeground1Selected: "#171717",
|
|
38
|
+
colorNeutralForeground2: "#404040",
|
|
39
|
+
colorNeutralForeground2Hover: "#171717",
|
|
40
|
+
colorNeutralForeground2Pressed: "#171717",
|
|
41
|
+
colorNeutralForeground2Selected: "#171717",
|
|
42
|
+
colorNeutralForeground3: "#6b6b6b",
|
|
43
|
+
colorNeutralForeground3Hover: "#404040",
|
|
44
|
+
colorNeutralForeground3Pressed: "#404040",
|
|
45
|
+
colorNeutralForeground3Selected: "#404040",
|
|
46
|
+
colorNeutralForeground4: "#858585",
|
|
47
|
+
colorNeutralStroke1: "#dedede",
|
|
48
|
+
colorNeutralStroke1Hover: "#c7c7c7",
|
|
49
|
+
colorNeutralStroke1Pressed: "#b3b3b3",
|
|
50
|
+
colorNeutralStroke1Selected: "#bdbdbd",
|
|
51
|
+
colorNeutralStroke2: "#e8e8e8",
|
|
52
|
+
colorNeutralStroke3: "#f0f0f0",
|
|
53
|
+
colorNeutralStrokeAccessible: "#858585",
|
|
54
|
+
colorNeutralStrokeAccessibleHover: "#6b6b6b",
|
|
55
|
+
colorNeutralStrokeAccessiblePressed: "#595959",
|
|
56
|
+
// Loading placeholders: a shade off the card, not a block of grey.
|
|
57
|
+
colorNeutralStencil1: "#ececec",
|
|
58
|
+
colorNeutralStencil2: "#f6f6f6",
|
|
59
|
+
colorNeutralStencil1Alpha: "rgba(0, 0, 0, 0.07)",
|
|
60
|
+
colorNeutralStencil2Alpha: "rgba(0, 0, 0, 0.035)",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const DARK: typeof LIGHT = {
|
|
64
|
+
colorNeutralBackground1: "#222222",
|
|
65
|
+
colorNeutralBackground1Hover: "#292929",
|
|
66
|
+
colorNeutralBackground1Pressed: "#303030",
|
|
67
|
+
colorNeutralBackground1Selected: "#2c2c2c",
|
|
68
|
+
colorNeutralBackground2: "#1f1f1f",
|
|
69
|
+
colorNeutralBackground2Hover: "#262626",
|
|
70
|
+
colorNeutralBackground2Pressed: "#2d2d2d",
|
|
71
|
+
colorNeutralBackground2Selected: "#2a2a2a",
|
|
72
|
+
colorNeutralBackground3: "#2b2b2b",
|
|
73
|
+
colorNeutralBackground3Hover: "#323232",
|
|
74
|
+
colorNeutralBackground3Pressed: "#393939",
|
|
75
|
+
colorNeutralBackground3Selected: "#323232",
|
|
76
|
+
colorNeutralBackground4: "#323232",
|
|
77
|
+
colorNeutralBackground4Hover: "#393939",
|
|
78
|
+
colorNeutralBackground4Pressed: "#404040",
|
|
79
|
+
colorNeutralBackground4Selected: "#393939",
|
|
80
|
+
colorNeutralBackground5: "#393939",
|
|
81
|
+
colorNeutralBackground5Hover: "#404040",
|
|
82
|
+
colorNeutralBackground5Pressed: "#474747",
|
|
83
|
+
colorNeutralBackground5Selected: "#404040",
|
|
84
|
+
colorNeutralBackground6: "#404040",
|
|
85
|
+
colorNeutralForeground1: "#f0f0f0",
|
|
86
|
+
colorNeutralForeground1Hover: "#ffffff",
|
|
87
|
+
colorNeutralForeground1Pressed: "#ffffff",
|
|
88
|
+
colorNeutralForeground1Selected: "#ffffff",
|
|
89
|
+
colorNeutralForeground2: "#d0d0d0",
|
|
90
|
+
colorNeutralForeground2Hover: "#f5f5f5",
|
|
91
|
+
colorNeutralForeground2Pressed: "#f5f5f5",
|
|
92
|
+
colorNeutralForeground2Selected: "#f5f5f5",
|
|
93
|
+
colorNeutralForeground3: "#a3a3a3",
|
|
94
|
+
colorNeutralForeground3Hover: "#d0d0d0",
|
|
95
|
+
colorNeutralForeground3Pressed: "#d0d0d0",
|
|
96
|
+
colorNeutralForeground3Selected: "#d0d0d0",
|
|
97
|
+
colorNeutralForeground4: "#858585",
|
|
98
|
+
colorNeutralStroke1: "#3b3b3b",
|
|
99
|
+
colorNeutralStroke1Hover: "#4a4a4a",
|
|
100
|
+
colorNeutralStroke1Pressed: "#575757",
|
|
101
|
+
colorNeutralStroke1Selected: "#4a4a4a",
|
|
102
|
+
colorNeutralStroke2: "#313131",
|
|
103
|
+
colorNeutralStroke3: "#292929",
|
|
104
|
+
colorNeutralStrokeAccessible: "#8f8f8f",
|
|
105
|
+
colorNeutralStrokeAccessibleHover: "#a8a8a8",
|
|
106
|
+
colorNeutralStrokeAccessiblePressed: "#bababa",
|
|
107
|
+
colorNeutralStencil1: "#303030",
|
|
108
|
+
colorNeutralStencil2: "#282828",
|
|
109
|
+
colorNeutralStencil1Alpha: "rgba(255, 255, 255, 0.07)",
|
|
110
|
+
colorNeutralStencil2Alpha: "rgba(255, 255, 255, 0.035)",
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type NeutralTokens = typeof LIGHT;
|
|
114
|
+
|
|
115
|
+
/** Neutral backgrounds, foregrounds, strokes and stencils, per scheme. */
|
|
116
|
+
export const NEUTRAL: Record<Scheme, NeutralTokens> = { light: LIGHT, dark: DARK };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Scheme } from "../scheme.js";
|
|
2
|
+
|
|
3
|
+
// Only floating surfaces (menus, popovers, dialogs) use these; page content is
|
|
4
|
+
// flat and separated by borders alone.
|
|
5
|
+
|
|
6
|
+
const LIGHT = {
|
|
7
|
+
shadow2: "0 1px 2px rgba(0, 0, 0, 0.05)",
|
|
8
|
+
shadow4: "0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04)",
|
|
9
|
+
shadow8: "0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05)",
|
|
10
|
+
shadow16: "0 8px 24px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.05)",
|
|
11
|
+
shadow28: "0 14px 36px rgba(0, 0, 0, 0.14), 0 3px 8px rgba(0, 0, 0, 0.06)",
|
|
12
|
+
shadow64: "0 24px 64px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08)",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const DARK: typeof LIGHT = {
|
|
16
|
+
shadow2: "0 1px 2px rgba(0, 0, 0, 0.5)",
|
|
17
|
+
shadow4: "0 1px 3px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4)",
|
|
18
|
+
shadow8: "0 4px 12px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4)",
|
|
19
|
+
shadow16: "0 8px 24px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4)",
|
|
20
|
+
shadow28: "0 14px 36px rgba(0, 0, 0, 0.65), 0 3px 8px rgba(0, 0, 0, 0.4)",
|
|
21
|
+
shadow64: "0 24px 64px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(0, 0, 0, 0.45)",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type ShadowTokens = typeof LIGHT;
|
|
25
|
+
|
|
26
|
+
/** Shadows for floating surfaces, per scheme. */
|
|
27
|
+
export const SHADOWS: Record<Scheme, ShadowTokens> = { light: LIGHT, dark: DARK };
|