@dataverse-kit/design-tokens 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/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @dataverse-kit/design-tokens
2
+
3
+ The **single canonical source** of the Dynamics 365 design tokens — `colors`, `spacing`,
4
+ `typography`, `radius`, and `layout`. Pure-TypeScript, **zero dependencies** (no React, no
5
+ Fluent), so it is safe to import from any layer or framework-agnostic code.
6
+
7
+ This package exists to end the token drift: the same hex/spacing values were previously
8
+ re-declared in `@dataverse-kit/surface-kit`, `@khester/reusable-components`, and 10+ client
9
+ projects. Those packages now re-export from here; new code (and client projects) should
10
+ import the values directly.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @dataverse-kit/design-tokens
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { colors, spacing, typography, radius, layout } from '@dataverse-kit/design-tokens';
22
+
23
+ const styles = {
24
+ border: `1px solid ${colors.borderNeutral}`,
25
+ borderRadius: radius.card,
26
+ padding: spacing.md,
27
+ fontFamily: typography.fontFamily,
28
+ color: colors.textPrimary,
29
+ };
30
+ ```
31
+
32
+ ## Exports
33
+
34
+ | Export | Shape |
35
+ |--------|-------|
36
+ | `colors` | brand / neutral / text / surface / canvas / field fills + borders (Dynamics CE palette) |
37
+ | `spacing` | `xs`…`xxl` (px scale) |
38
+ | `typography` | Segoe UI font stacks + `fontSize` + `fontWeight` |
39
+ | `radius` | `card` / `lg` corner radii |
40
+ | `layout` | `labelColWidth` (the "Label : input" field-row label column) |
41
+
42
+ All values are `as const`, so consumers keep the literal types (e.g. `typeof colors.brand`
43
+ is `'#0078d4'`).
44
+
45
+ > Note: `@khester/dynamics-utils` ships a separate, legacy spacing scale (`xs/s/m/l/xl`);
46
+ > it is intentionally **not** unified into this package.
package/dist/index.cjs ADDED
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ colors: () => colors,
24
+ layout: () => layout,
25
+ radius: () => radius,
26
+ spacing: () => spacing,
27
+ typography: () => typography
28
+ });
29
+ module.exports = __toCommonJS(src_exports);
30
+ var colors = {
31
+ brand: "#0078d4",
32
+ brandHover: "#106ebe",
33
+ brandDark: "#005a9e",
34
+ borderNeutral: "#edebe9",
35
+ textPrimary: "#323130",
36
+ textSecondary: "#605e5c",
37
+ surface: "#ffffff",
38
+ surfaceAlt: "#f5f5f5",
39
+ // App canvas behind cards/forms (matches the Dynamics model-driven form background).
40
+ canvas: "#fafafa",
41
+ // Required-field asterisk / error accent (Fluent error red).
42
+ danger: "#a4262c",
43
+ // Field input: subtle idle fill + neutral border (Dynamics-style).
44
+ fieldFill: "#faf9f8",
45
+ fieldFillReadonly: "#f3f2f1",
46
+ fieldBorder: "#e1dfdd"
47
+ };
48
+ var spacing = {
49
+ xs: 4,
50
+ sm: 8,
51
+ md: 12,
52
+ lg: 16,
53
+ xl: 24,
54
+ xxl: 40
55
+ };
56
+ var typography = {
57
+ fontFamily: '"Segoe UI", Arial, sans-serif',
58
+ fontFamilySemibold: '"Segoe UI Semibold", "Segoe UI", sans-serif',
59
+ fontSize: {
60
+ sm: "12px",
61
+ smPlus: "13px",
62
+ md: "14px",
63
+ lg: "17px"
64
+ },
65
+ fontWeight: {
66
+ regular: 400,
67
+ semibold: 600
68
+ }
69
+ };
70
+ var radius = {
71
+ card: "4px",
72
+ // Softer rounding for the outer form shell (matches Dynamics cards).
73
+ lg: "8px"
74
+ };
75
+ var layout = {
76
+ // Width of the label column in a two-column "Label : input" field row.
77
+ labelColWidth: "130px"
78
+ };
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ colors,
82
+ layout,
83
+ radius,
84
+ spacing,
85
+ typography
86
+ });
87
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @dataverse-kit/design-tokens\n//\n// The single canonical source of the Dynamics 365 design tokens — colors, spacing,\n// typography, radius, and layout. Pure-TS, ZERO dependencies (no react / no @fluentui),\n// so it is safe to import from any layer, framework-agnostic code, or client project.\n//\n// surface-kit and @khester/reusable-components re-export these (so existing imports keep\n// working); client projects should import them directly from here instead of re-declaring\n// the values (the drift this package exists to end).\n//\n// NOTE: @khester/dynamics-utils ships a SEPARATE, differently-named spacing scale\n// (xs/s/m/l/xl) for legacy reasons — it is intentionally NOT unified here.\n\nexport const colors = {\n brand: '#0078d4',\n brandHover: '#106ebe',\n brandDark: '#005a9e',\n borderNeutral: '#edebe9',\n textPrimary: '#323130',\n textSecondary: '#605e5c',\n surface: '#ffffff',\n surfaceAlt: '#f5f5f5',\n // App canvas behind cards/forms (matches the Dynamics model-driven form background).\n canvas: '#fafafa',\n // Required-field asterisk / error accent (Fluent error red).\n danger: '#a4262c',\n // Field input: subtle idle fill + neutral border (Dynamics-style).\n fieldFill: '#faf9f8',\n fieldFillReadonly: '#f3f2f1',\n fieldBorder: '#e1dfdd',\n} as const;\n\nexport const spacing = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 16,\n xl: 24,\n xxl: 40,\n} as const;\n\nexport const typography = {\n fontFamily: '\"Segoe UI\", Arial, sans-serif',\n fontFamilySemibold: '\"Segoe UI Semibold\", \"Segoe UI\", sans-serif',\n fontSize: {\n sm: '12px',\n smPlus: '13px',\n md: '14px',\n lg: '17px',\n },\n fontWeight: {\n regular: 400,\n semibold: 600,\n },\n} as const;\n\nexport const radius = {\n card: '4px',\n // Softer rounding for the outer form shell (matches Dynamics cards).\n lg: '8px',\n} as const;\n\nexport const layout = {\n // Width of the label column in a two-column \"Label : input\" field row.\n labelColWidth: '130px',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,IAAM,SAAS;AAAA,EACpB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,SAAS;AAAA,EACT,YAAY;AAAA;AAAA,EAEZ,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,aAAa;AACf;AAEO,IAAM,UAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAEO,IAAM,aAAa;AAAA,EACxB,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AAAA,EACA,YAAY;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,SAAS;AAAA,EACpB,MAAM;AAAA;AAAA,EAEN,IAAI;AACN;AAEO,IAAM,SAAS;AAAA;AAAA,EAEpB,eAAe;AACjB;","names":[]}
@@ -0,0 +1,46 @@
1
+ declare const colors: {
2
+ readonly brand: "#0078d4";
3
+ readonly brandHover: "#106ebe";
4
+ readonly brandDark: "#005a9e";
5
+ readonly borderNeutral: "#edebe9";
6
+ readonly textPrimary: "#323130";
7
+ readonly textSecondary: "#605e5c";
8
+ readonly surface: "#ffffff";
9
+ readonly surfaceAlt: "#f5f5f5";
10
+ readonly canvas: "#fafafa";
11
+ readonly danger: "#a4262c";
12
+ readonly fieldFill: "#faf9f8";
13
+ readonly fieldFillReadonly: "#f3f2f1";
14
+ readonly fieldBorder: "#e1dfdd";
15
+ };
16
+ declare const spacing: {
17
+ readonly xs: 4;
18
+ readonly sm: 8;
19
+ readonly md: 12;
20
+ readonly lg: 16;
21
+ readonly xl: 24;
22
+ readonly xxl: 40;
23
+ };
24
+ declare const typography: {
25
+ readonly fontFamily: "\"Segoe UI\", Arial, sans-serif";
26
+ readonly fontFamilySemibold: "\"Segoe UI Semibold\", \"Segoe UI\", sans-serif";
27
+ readonly fontSize: {
28
+ readonly sm: "12px";
29
+ readonly smPlus: "13px";
30
+ readonly md: "14px";
31
+ readonly lg: "17px";
32
+ };
33
+ readonly fontWeight: {
34
+ readonly regular: 400;
35
+ readonly semibold: 600;
36
+ };
37
+ };
38
+ declare const radius: {
39
+ readonly card: "4px";
40
+ readonly lg: "8px";
41
+ };
42
+ declare const layout: {
43
+ readonly labelColWidth: "130px";
44
+ };
45
+
46
+ export { colors, layout, radius, spacing, typography };
@@ -0,0 +1,46 @@
1
+ declare const colors: {
2
+ readonly brand: "#0078d4";
3
+ readonly brandHover: "#106ebe";
4
+ readonly brandDark: "#005a9e";
5
+ readonly borderNeutral: "#edebe9";
6
+ readonly textPrimary: "#323130";
7
+ readonly textSecondary: "#605e5c";
8
+ readonly surface: "#ffffff";
9
+ readonly surfaceAlt: "#f5f5f5";
10
+ readonly canvas: "#fafafa";
11
+ readonly danger: "#a4262c";
12
+ readonly fieldFill: "#faf9f8";
13
+ readonly fieldFillReadonly: "#f3f2f1";
14
+ readonly fieldBorder: "#e1dfdd";
15
+ };
16
+ declare const spacing: {
17
+ readonly xs: 4;
18
+ readonly sm: 8;
19
+ readonly md: 12;
20
+ readonly lg: 16;
21
+ readonly xl: 24;
22
+ readonly xxl: 40;
23
+ };
24
+ declare const typography: {
25
+ readonly fontFamily: "\"Segoe UI\", Arial, sans-serif";
26
+ readonly fontFamilySemibold: "\"Segoe UI Semibold\", \"Segoe UI\", sans-serif";
27
+ readonly fontSize: {
28
+ readonly sm: "12px";
29
+ readonly smPlus: "13px";
30
+ readonly md: "14px";
31
+ readonly lg: "17px";
32
+ };
33
+ readonly fontWeight: {
34
+ readonly regular: 400;
35
+ readonly semibold: 600;
36
+ };
37
+ };
38
+ declare const radius: {
39
+ readonly card: "4px";
40
+ readonly lg: "8px";
41
+ };
42
+ declare const layout: {
43
+ readonly labelColWidth: "130px";
44
+ };
45
+
46
+ export { colors, layout, radius, spacing, typography };
package/dist/index.mjs ADDED
@@ -0,0 +1,58 @@
1
+ // src/index.ts
2
+ var colors = {
3
+ brand: "#0078d4",
4
+ brandHover: "#106ebe",
5
+ brandDark: "#005a9e",
6
+ borderNeutral: "#edebe9",
7
+ textPrimary: "#323130",
8
+ textSecondary: "#605e5c",
9
+ surface: "#ffffff",
10
+ surfaceAlt: "#f5f5f5",
11
+ // App canvas behind cards/forms (matches the Dynamics model-driven form background).
12
+ canvas: "#fafafa",
13
+ // Required-field asterisk / error accent (Fluent error red).
14
+ danger: "#a4262c",
15
+ // Field input: subtle idle fill + neutral border (Dynamics-style).
16
+ fieldFill: "#faf9f8",
17
+ fieldFillReadonly: "#f3f2f1",
18
+ fieldBorder: "#e1dfdd"
19
+ };
20
+ var spacing = {
21
+ xs: 4,
22
+ sm: 8,
23
+ md: 12,
24
+ lg: 16,
25
+ xl: 24,
26
+ xxl: 40
27
+ };
28
+ var typography = {
29
+ fontFamily: '"Segoe UI", Arial, sans-serif',
30
+ fontFamilySemibold: '"Segoe UI Semibold", "Segoe UI", sans-serif',
31
+ fontSize: {
32
+ sm: "12px",
33
+ smPlus: "13px",
34
+ md: "14px",
35
+ lg: "17px"
36
+ },
37
+ fontWeight: {
38
+ regular: 400,
39
+ semibold: 600
40
+ }
41
+ };
42
+ var radius = {
43
+ card: "4px",
44
+ // Softer rounding for the outer form shell (matches Dynamics cards).
45
+ lg: "8px"
46
+ };
47
+ var layout = {
48
+ // Width of the label column in a two-column "Label : input" field row.
49
+ labelColWidth: "130px"
50
+ };
51
+ export {
52
+ colors,
53
+ layout,
54
+ radius,
55
+ spacing,
56
+ typography
57
+ };
58
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @dataverse-kit/design-tokens\n//\n// The single canonical source of the Dynamics 365 design tokens — colors, spacing,\n// typography, radius, and layout. Pure-TS, ZERO dependencies (no react / no @fluentui),\n// so it is safe to import from any layer, framework-agnostic code, or client project.\n//\n// surface-kit and @khester/reusable-components re-export these (so existing imports keep\n// working); client projects should import them directly from here instead of re-declaring\n// the values (the drift this package exists to end).\n//\n// NOTE: @khester/dynamics-utils ships a SEPARATE, differently-named spacing scale\n// (xs/s/m/l/xl) for legacy reasons — it is intentionally NOT unified here.\n\nexport const colors = {\n brand: '#0078d4',\n brandHover: '#106ebe',\n brandDark: '#005a9e',\n borderNeutral: '#edebe9',\n textPrimary: '#323130',\n textSecondary: '#605e5c',\n surface: '#ffffff',\n surfaceAlt: '#f5f5f5',\n // App canvas behind cards/forms (matches the Dynamics model-driven form background).\n canvas: '#fafafa',\n // Required-field asterisk / error accent (Fluent error red).\n danger: '#a4262c',\n // Field input: subtle idle fill + neutral border (Dynamics-style).\n fieldFill: '#faf9f8',\n fieldFillReadonly: '#f3f2f1',\n fieldBorder: '#e1dfdd',\n} as const;\n\nexport const spacing = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 16,\n xl: 24,\n xxl: 40,\n} as const;\n\nexport const typography = {\n fontFamily: '\"Segoe UI\", Arial, sans-serif',\n fontFamilySemibold: '\"Segoe UI Semibold\", \"Segoe UI\", sans-serif',\n fontSize: {\n sm: '12px',\n smPlus: '13px',\n md: '14px',\n lg: '17px',\n },\n fontWeight: {\n regular: 400,\n semibold: 600,\n },\n} as const;\n\nexport const radius = {\n card: '4px',\n // Softer rounding for the outer form shell (matches Dynamics cards).\n lg: '8px',\n} as const;\n\nexport const layout = {\n // Width of the label column in a two-column \"Label : input\" field row.\n labelColWidth: '130px',\n} as const;\n"],"mappings":";AAaO,IAAM,SAAS;AAAA,EACpB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,SAAS;AAAA,EACT,YAAY;AAAA;AAAA,EAEZ,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,aAAa;AACf;AAEO,IAAM,UAAU;AAAA,EACrB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAEO,IAAM,aAAa;AAAA,EACxB,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AAAA,EACA,YAAY;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,SAAS;AAAA,EACpB,MAAM;AAAA;AAAA,EAEN,IAAI;AACN;AAEO,IAAM,SAAS;AAAA;AAAA,EAEpB,eAAe;AACjB;","names":[]}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@dataverse-kit/design-tokens",
3
+ "version": "0.1.0",
4
+ "description": "Canonical Dynamics 365 design tokens (colors, spacing, typography, radius, layout) — pure-TS, zero-dependency. The single source consumed by surface-kit, reusable-components, and client projects.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "sideEffects": false,
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsup",
22
+ "dev": "tsup --watch",
23
+ "typecheck": "tsc --noEmit",
24
+ "lint": "eslint src --ext .ts,.tsx",
25
+ "clean": "rimraf dist",
26
+ "prepublishOnly": "npm run build"
27
+ },
28
+ "keywords": [
29
+ "dynamics-365",
30
+ "design-tokens",
31
+ "power-platform",
32
+ "fluent"
33
+ ],
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "devDependencies": {
38
+ "tsup": "^8.0.0",
39
+ "typescript": "^5.3.3"
40
+ }
41
+ }