@mehdashti/tokens 0.2.0 → 0.2.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/dist/borders.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export declare const borderRadius: {
7
7
  readonly none: "0";
8
+ readonly xs: "0.1875rem";
8
9
  readonly sm: "0.125rem";
9
10
  readonly base: "0.25rem";
10
11
  readonly md: "0.375rem";
@@ -1 +1 @@
1
- {"version":3,"file":"borders.d.ts","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAMX,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC"}
1
+ {"version":3,"file":"borders.d.ts","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,YAAY;;;;;;;;;;;CAWf,CAAC;AAMX,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC"}
package/dist/borders.js CHANGED
@@ -8,6 +8,7 @@
8
8
  // =============================================================================
9
9
  export const borderRadius = {
10
10
  none: "0",
11
+ xs: "0.1875rem", // 3px - Material Design 3 standard for interactive components
11
12
  sm: "0.125rem", // 2px
12
13
  base: "0.25rem", // 4px
13
14
  md: "0.375rem", // 6px
@@ -1 +1 @@
1
- {"version":3,"file":"borders.js","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,GAAG;IACT,EAAE,EAAE,UAAU,EAAE,MAAM;IACtB,IAAI,EAAE,SAAS,EAAE,MAAM;IACvB,EAAE,EAAE,UAAU,EAAE,MAAM;IACtB,EAAE,EAAE,QAAQ,EAAE,MAAM;IACpB,EAAE,EAAE,SAAS,EAAE,OAAO;IACtB,KAAK,EAAE,MAAM,EAAE,OAAO;IACtB,KAAK,EAAE,QAAQ,EAAE,OAAO;IACxB,IAAI,EAAE,QAAQ;CACN,CAAC;AAEX,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;CACA,CAAC"}
1
+ {"version":3,"file":"borders.js","sourceRoot":"","sources":["../src/borders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,GAAG;IACT,EAAE,EAAE,WAAW,EAAE,8DAA8D;IAC/E,EAAE,EAAE,UAAU,EAAE,MAAM;IACtB,IAAI,EAAE,SAAS,EAAE,MAAM;IACvB,EAAE,EAAE,UAAU,EAAE,MAAM;IACtB,EAAE,EAAE,QAAQ,EAAE,MAAM;IACpB,EAAE,EAAE,SAAS,EAAE,OAAO;IACtB,KAAK,EAAE,MAAM,EAAE,OAAO;IACtB,KAAK,EAAE,QAAQ,EAAE,OAAO;IACxB,IAAI,EAAE,QAAQ;CACN,CAAC;AAEX,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;CACA,CAAC"}
@@ -41,6 +41,7 @@
41
41
 
42
42
  /* Border Radius */
43
43
  --radius-none: 0;
44
+ --radius-xs: 0.1875rem;
44
45
  --radius-sm: 0.125rem;
45
46
  --radius-base: 0.25rem;
46
47
  --radius-md: 0.375rem;
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  * - Shadows
10
10
  * - Z-index layers
11
11
  * - Density modes (cozy/compact)
12
+ * - Interaction states (Ghost, Outlined, Underline variants)
12
13
  */
13
14
  export * from "./colors.js";
14
15
  export * from "./spacing.js";
@@ -18,4 +19,5 @@ export * from "./shadows.js";
18
19
  export * from "./zIndex.js";
19
20
  export * from "./breakpoints.js";
20
21
  export * from "./density.js";
22
+ export * from "./interactions.js";
21
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@
9
9
  * - Shadows
10
10
  * - Z-index layers
11
11
  * - Density modes (cozy/compact)
12
+ * - Interaction states (Ghost, Outlined, Underline variants)
12
13
  */
13
14
  export * from "./colors.js";
14
15
  export * from "./spacing.js";
@@ -18,4 +19,5 @@ export * from "./shadows.js";
18
19
  export * from "./zIndex.js";
19
20
  export * from "./breakpoints.js";
20
21
  export * from "./density.js";
22
+ export * from "./interactions.js";
21
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Interaction State Tokens
3
+ *
4
+ * Defines interaction patterns for components following enterprise UI standards:
5
+ * - Ghost variant (IFS Cloud style): No borders, background on hover
6
+ * - Outlined variant (SAP Fiori style): With borders, background + border on hover
7
+ * - Underline variant (Navigation style): Bottom border on hover
8
+ */
9
+ export declare const interactionOpacity: {
10
+ readonly hover: "0.05";
11
+ readonly hoverStrong: "0.10";
12
+ readonly active: "0.15";
13
+ readonly focus: "0.08";
14
+ readonly disabled: "0.40";
15
+ };
16
+ /**
17
+ * Ghost Variant Pattern (IFS Cloud Style)
18
+ * - No borders
19
+ * - Transparent background
20
+ * - Background color on hover (5-10% opacity)
21
+ * - Border radius: 3px (Material Design 3 standard)
22
+ */
23
+ export declare const ghostVariant: {
24
+ readonly base: {
25
+ readonly border: "none";
26
+ readonly borderWidth: "0";
27
+ readonly background: "transparent";
28
+ readonly borderRadius: "0.1875rem";
29
+ };
30
+ readonly hover: {
31
+ readonly background: "hsl(var(--accent) / 0.5)";
32
+ };
33
+ readonly focus: {
34
+ readonly background: "hsl(var(--accent) / 0.5)";
35
+ readonly outline: "2px solid hsl(var(--ring))";
36
+ readonly outlineOffset: "2px";
37
+ };
38
+ readonly active: {
39
+ readonly background: "hsl(var(--accent) / 0.5)";
40
+ };
41
+ };
42
+ /**
43
+ * Outlined Variant Pattern (SAP Fiori Style)
44
+ * - With borders
45
+ * - Background + border color change on hover
46
+ * - Border radius: 3px
47
+ */
48
+ export declare const outlinedVariant: {
49
+ readonly base: {
50
+ readonly border: "1px solid hsl(var(--input))";
51
+ readonly background: "transparent";
52
+ readonly borderRadius: "0.1875rem";
53
+ };
54
+ readonly hover: {
55
+ readonly background: "hsl(var(--accent) / 0.5)";
56
+ readonly borderColor: "hsl(var(--primary) / 0.5)";
57
+ };
58
+ readonly focus: {
59
+ readonly background: "hsl(var(--accent) / 0.5)";
60
+ readonly borderColor: "hsl(var(--ring))";
61
+ readonly outline: "2px solid hsl(var(--ring))";
62
+ readonly outlineOffset: "2px";
63
+ };
64
+ readonly active: {
65
+ readonly background: "hsl(var(--accent))";
66
+ readonly borderColor: "hsl(var(--primary))";
67
+ };
68
+ };
69
+ /**
70
+ * Underline Variant Pattern (Navigation Style)
71
+ * - No top/side borders
72
+ * - Bottom border appears on hover
73
+ * - No border radius (sharp corners for navigation)
74
+ */
75
+ export declare const underlineVariant: {
76
+ readonly base: {
77
+ readonly border: "none";
78
+ readonly borderBottom: "2px solid transparent";
79
+ readonly background: "transparent";
80
+ readonly borderRadius: "0";
81
+ };
82
+ readonly hover: {
83
+ readonly borderBottomColor: "hsl(var(--primary) / 0.5)";
84
+ };
85
+ readonly focus: {
86
+ readonly borderBottomColor: "hsl(var(--primary))";
87
+ readonly outline: "2px solid hsl(var(--ring))";
88
+ readonly outlineOffset: "2px";
89
+ };
90
+ readonly active: {
91
+ readonly borderBottomColor: "hsl(var(--primary))";
92
+ };
93
+ };
94
+ /**
95
+ * Standard border radius for interactive components
96
+ * Following Material Design 3: 3px for buttons, inputs, cards, filters, tabs
97
+ */
98
+ export declare const interactiveBorderRadius = "0.1875rem";
99
+ /**
100
+ * Hover background opacity for ghost-style components
101
+ */
102
+ export declare const hoverBackgroundOpacity = "0.5";
103
+ /**
104
+ * Focus ring configuration
105
+ */
106
+ export declare const focusRing: {
107
+ readonly width: "2px";
108
+ readonly color: "hsl(var(--ring))";
109
+ readonly offset: "2px";
110
+ };
111
+ //# sourceMappingURL=interactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../src/interactions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAMX;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;CAkBf,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;CAoBlB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;CAkBnB,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,uBAAuB,cAAc,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,SAAS;;;;CAIZ,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Interaction State Tokens
3
+ *
4
+ * Defines interaction patterns for components following enterprise UI standards:
5
+ * - Ghost variant (IFS Cloud style): No borders, background on hover
6
+ * - Outlined variant (SAP Fiori style): With borders, background + border on hover
7
+ * - Underline variant (Navigation style): Bottom border on hover
8
+ */
9
+ // =============================================================================
10
+ // Opacity Levels for Interaction States
11
+ // =============================================================================
12
+ export const interactionOpacity = {
13
+ hover: "0.05", // 5% for ghost variant hover
14
+ hoverStrong: "0.10", // 10% for stronger hover states
15
+ active: "0.15", // 15% for active/pressed states
16
+ focus: "0.08", // 8% for focus states
17
+ disabled: "0.40", // 40% for disabled states
18
+ };
19
+ // =============================================================================
20
+ // Variant Patterns
21
+ // =============================================================================
22
+ /**
23
+ * Ghost Variant Pattern (IFS Cloud Style)
24
+ * - No borders
25
+ * - Transparent background
26
+ * - Background color on hover (5-10% opacity)
27
+ * - Border radius: 3px (Material Design 3 standard)
28
+ */
29
+ export const ghostVariant = {
30
+ base: {
31
+ border: "none",
32
+ borderWidth: "0",
33
+ background: "transparent",
34
+ borderRadius: "0.1875rem", // 3px
35
+ },
36
+ hover: {
37
+ background: "hsl(var(--accent) / 0.5)", // 50% opacity of accent color
38
+ },
39
+ focus: {
40
+ background: "hsl(var(--accent) / 0.5)",
41
+ outline: "2px solid hsl(var(--ring))",
42
+ outlineOffset: "2px",
43
+ },
44
+ active: {
45
+ background: "hsl(var(--accent) / 0.5)",
46
+ },
47
+ };
48
+ /**
49
+ * Outlined Variant Pattern (SAP Fiori Style)
50
+ * - With borders
51
+ * - Background + border color change on hover
52
+ * - Border radius: 3px
53
+ */
54
+ export const outlinedVariant = {
55
+ base: {
56
+ border: "1px solid hsl(var(--input))",
57
+ background: "transparent",
58
+ borderRadius: "0.1875rem", // 3px
59
+ },
60
+ hover: {
61
+ background: "hsl(var(--accent) / 0.5)",
62
+ borderColor: "hsl(var(--primary) / 0.5)",
63
+ },
64
+ focus: {
65
+ background: "hsl(var(--accent) / 0.5)",
66
+ borderColor: "hsl(var(--ring))",
67
+ outline: "2px solid hsl(var(--ring))",
68
+ outlineOffset: "2px",
69
+ },
70
+ active: {
71
+ background: "hsl(var(--accent))",
72
+ borderColor: "hsl(var(--primary))",
73
+ },
74
+ };
75
+ /**
76
+ * Underline Variant Pattern (Navigation Style)
77
+ * - No top/side borders
78
+ * - Bottom border appears on hover
79
+ * - No border radius (sharp corners for navigation)
80
+ */
81
+ export const underlineVariant = {
82
+ base: {
83
+ border: "none",
84
+ borderBottom: "2px solid transparent",
85
+ background: "transparent",
86
+ borderRadius: "0",
87
+ },
88
+ hover: {
89
+ borderBottomColor: "hsl(var(--primary) / 0.5)",
90
+ },
91
+ focus: {
92
+ borderBottomColor: "hsl(var(--primary))",
93
+ outline: "2px solid hsl(var(--ring))",
94
+ outlineOffset: "2px",
95
+ },
96
+ active: {
97
+ borderBottomColor: "hsl(var(--primary))",
98
+ },
99
+ };
100
+ // =============================================================================
101
+ // Semantic Interaction Tokens
102
+ // =============================================================================
103
+ /**
104
+ * Standard border radius for interactive components
105
+ * Following Material Design 3: 3px for buttons, inputs, cards, filters, tabs
106
+ */
107
+ export const interactiveBorderRadius = "0.1875rem"; // 3px
108
+ /**
109
+ * Hover background opacity for ghost-style components
110
+ */
111
+ export const hoverBackgroundOpacity = "0.5"; // 50% of accent color
112
+ /**
113
+ * Focus ring configuration
114
+ */
115
+ export const focusRing = {
116
+ width: "2px",
117
+ color: "hsl(var(--ring))",
118
+ offset: "2px",
119
+ };
120
+ //# sourceMappingURL=interactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactions.js","sourceRoot":"","sources":["../src/interactions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gFAAgF;AAChF,wCAAwC;AACxC,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,EAAE,6BAA6B;IAC5C,WAAW,EAAE,MAAM,EAAE,gCAAgC;IACrD,MAAM,EAAE,MAAM,EAAE,gCAAgC;IAChD,KAAK,EAAE,MAAM,EAAE,sBAAsB;IACrC,QAAQ,EAAE,MAAM,EAAE,0BAA0B;CACpC,CAAC;AAEX,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,GAAG;QAChB,UAAU,EAAE,aAAa;QACzB,YAAY,EAAE,WAAW,EAAE,MAAM;KAClC;IACD,KAAK,EA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,CAAC,sBAAsB;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,KAAK;CACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mehdashti/tokens",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Design tokens for Smart Platform - colors, spacing, typography, and themes",
5
5
  "author": "mehdashti",
6
6
  "license": "MIT",