@indra-inter/neobrutalism-components 0.1.3 → 0.1.4

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.
@@ -1,25 +1,26 @@
1
+ import { designTokens } from './design-tokens.generated.js';
1
2
  export type ThemeMode = 'light' | 'dark';
3
+ export type ThemeVariant = 'blue' | 'coral';
4
+ type KebabToCamelCase<Value extends string> = Value extends `${infer Head}-${infer Tail}` ? `${Head}${Capitalize<KebabToCamelCase<Tail>>}` : Value;
5
+ type ModeTokenName = keyof (typeof designTokens.mode.light.Blue) & string;
6
+ type ModeColors = {
7
+ [Name in ModeTokenName as KebabToCamelCase<Name>]: string;
8
+ };
9
+ type ThemeStatusName = 'success' | 'info' | 'warning' | 'error';
10
+ type ThemeStatusScale = '100' | '200' | '300' | '400' | '500';
11
+ type ThemeStatusColor = Record<ThemeStatusScale, string> & {
12
+ foreground: string;
13
+ };
14
+ export type ThemeStatus = Record<ThemeStatusName, ThemeStatusColor>;
2
15
  export type Theme = {
3
- colors: {
4
- background: string;
5
- surface: string;
6
- popover: string;
7
- accent: string;
8
- primary: string;
9
- primaryHover: string;
10
- primaryForeground: string;
11
- secondary: string;
12
- secondaryForeground: string;
13
- destructive: string;
14
- destructiveForeground: string;
16
+ colors: ModeColors & {
15
17
  warning: string;
16
18
  success: string;
17
19
  info: string;
18
- foreground: string;
19
- mutedForeground: string;
20
+ error: string;
20
21
  disabled: string;
21
- semanticBorder: string;
22
22
  };
23
+ status: ThemeStatus;
23
24
  border: {
24
25
  color: string;
25
26
  radius: number;
@@ -47,6 +48,8 @@ export type Theme = {
47
48
  weight: '500';
48
49
  };
49
50
  };
50
- export declare function createTheme(mode?: ThemeMode): Theme;
51
+ export declare function createNativeWindVariables(mode: ThemeMode, variant?: ThemeVariant): Record<`--${string}`, string>;
52
+ export declare function createTheme(mode?: ThemeMode, variant?: ThemeVariant): Theme;
51
53
  export declare const theme: Theme;
54
+ export {};
52
55
  //# sourceMappingURL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,MAAM,KAAK,OAAuB,CAAC"}
package/nativewind.css CHANGED
@@ -1,25 +1,47 @@
1
1
  /* Generated NativeWind semantic tokens from Figma design tokens. Do not edit by hand. */
2
2
  :root {
3
+ --accent: 201.11 100% 89.41%;
4
+ --accent-foreground: 202.17 79.31% 11.37%;
3
5
  --background: 0 0% 100%;
4
- --foreground: 0 0% 3.92%;
6
+ --background-color: 0 0% 0% / 50.2%;
7
+ --border: 0 0% 0%;
5
8
  --card: 0 0% 95.29%;
6
9
  --card-foreground: 0 0% 3.92%;
10
+ --code: 0 0% 94.9%;
11
+ --code-foreground: 0 0% 3.92%;
12
+ --decor-accent: 199.84 100% 50.2%;
13
+ --decor-ink: 0 0% 0%;
14
+ --decor-paper: 0 0% 100%;
15
+ --destructive: 355.49 77.58% 56.27%;
16
+ --destructive-foreground: 0 0% 100%;
17
+ --foreground: 0 0% 3.92%;
18
+ --input: 0 0% 100%;
19
+ --muted: 0 0% 94.9%;
20
+ --muted-foreground: 0 0% 36.08%;
7
21
  --popover: 0 0% 98.04%;
8
22
  --popover-foreground: 0 0% 3.92%;
9
23
  --primary: 199.84 100% 50.2%;
10
- --primary-hover: 200.98 79.89% 64.9%;
11
24
  --primary-foreground: 0 0% 0%;
25
+ --primary-hover: 200.98 79.89% 64.9%;
26
+ --ring: 199.84 100% 50.2%;
12
27
  --secondary: 0 0% 3.92%;
13
28
  --secondary-foreground: 0 0% 100%;
14
- --muted: 0 0% 94.9%;
15
- --muted-foreground: 0 0% 36.08%;
16
- --accent: 201.11 100% 89.41%;
17
- --accent-foreground: 202.17 79.31% 11.37%;
18
- --destructive: 355.49 77.58% 56.27%;
19
- --destructive-foreground: 0 0% 100%;
20
- --border: 0 0% 0%;
21
- --input: 0 0% 100%;
22
- --ring: 199.84 100% 50.2%;
29
+ --selection: 199.84 100% 50.2%;
30
+ --selection-foreground: 0 0% 0%;
31
+ --semantic-background: 0 0% 55.29%;
32
+ --semantic-border: 0 0.45% 56.27%;
33
+ --semantic-foreground: 0 0% 100%;
34
+ --shadow-color: 0 0% 4.31%;
35
+ --sidebar: 0 0% 100%;
36
+ --sidebar-accent: 201.11 100% 89.41%;
37
+ --sidebar-accent-foreground: 202.17 79.31% 11.37%;
38
+ --sidebar-border: 0 0% 0%;
39
+ --sidebar-foreground: 0 0% 3.92%;
40
+ --sidebar-primary: 199.84 100% 50.2%;
41
+ --sidebar-primary-foreground: 0 0% 0%;
42
+ --sidebar-ring: 199.84 100% 50.2%;
43
+ --surface: 0 0% 95.29%;
44
+ --surface-foreground: 0 0% 3.92%;
23
45
  --success: 142.09 70.56% 45.29%;
24
46
  --success-foreground: 0 0% 3.92%;
25
47
  --color-success-100: 140.63 84.21% 92.55%;
@@ -51,26 +73,48 @@
51
73
  }
52
74
 
53
75
  .dark:root {
76
+ --accent: 202.5 64.86% 14.51%;
77
+ --accent-foreground: 201.11 100% 89.41%;
54
78
  --background: 0 0% 12.16%;
55
- --foreground: 0 0% 98.04%;
79
+ --background-color: 0 0% 0% / 50.2%;
80
+ --border: 0 0% 0%;
56
81
  --card: 0 0% 10.2%;
57
82
  --card-foreground: 0 0% 98.04%;
83
+ --code: 0 0% 14.9%;
84
+ --code-foreground: 0 0% 98.04%;
85
+ --decor-accent: 200.19 46.85% 56.47%;
86
+ --decor-ink: 0 0% 0%;
87
+ --decor-paper: 0 0% 100%;
88
+ --destructive: 0 100% 70.98%;
89
+ --destructive-foreground: 0 10.64% 9.22%;
90
+ --foreground: 0 0% 98.04%;
91
+ --input: 200 8.57% 13.73%;
92
+ --muted: 0 0% 14.9%;
93
+ --muted-foreground: 0 0% 63.92%;
58
94
  --popover: 0 0% 10.2%;
59
95
  --popover-foreground: 0 0% 98.04%;
60
96
  --primary: 199.84 100% 50.2%;
61
- --primary-hover: 200.98 79.89% 64.9%;
62
97
  --primary-foreground: 0 0% 0%;
98
+ --primary-hover: 200.98 79.89% 64.9%;
99
+ --ring: 199.89 100% 65.1%;
63
100
  --secondary: 0 0% 98.04%;
64
101
  --secondary-foreground: 0 0% 5.88%;
65
- --muted: 0 0% 14.9%;
66
- --muted-foreground: 0 0% 63.92%;
67
- --accent: 202.5 64.86% 14.51%;
68
- --accent-foreground: 201.11 100% 89.41%;
69
- --destructive: 0 100% 70.98%;
70
- --destructive-foreground: 0 10.64% 9.22%;
71
- --border: 0 0% 0%;
72
- --input: 200 8.57% 13.73%;
73
- --ring: 199.89 100% 65.1%;
102
+ --selection: 199.84 100% 50.2%;
103
+ --selection-foreground: 0 0% 0%;
104
+ --semantic-background: 30 2.63% 14.9%;
105
+ --semantic-border: 210 1.22% 32.16%;
106
+ --semantic-foreground: 0 0% 100%;
107
+ --shadow-color: 0 0% 23.92%;
108
+ --sidebar: 0 0% 12.16%;
109
+ --sidebar-accent: 202.5 64.86% 14.51%;
110
+ --sidebar-accent-foreground: 201.11 100% 89.41%;
111
+ --sidebar-border: 0 0% 0%;
112
+ --sidebar-foreground: 0 0% 98.04%;
113
+ --sidebar-primary: 199.84 100% 50.2%;
114
+ --sidebar-primary-foreground: 0 0% 0%;
115
+ --sidebar-ring: 199.89 100% 65.1%;
116
+ --surface: 0 0% 10.2%;
117
+ --surface-foreground: 0 0% 98.04%;
74
118
  --success: 142.09 70.56% 45.29%;
75
119
  --success-foreground: 0 0% 98.04%;
76
120
  --color-success-100: 140.63 84.21% 92.55%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra-inter/neobrutalism-components",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -47,15 +47,16 @@
47
47
  "test:card-nativewind": "node ./scripts/test-card-nativewind.mjs",
48
48
  "test:bottom-sheet-drag-dismiss": "node ./scripts/test-bottom-sheet-drag-dismiss.mjs",
49
49
  "test:chat-list-item-slots": "node ./scripts/test-chat-list-item-slots.mjs",
50
- "test:design-tokens": "node ./scripts/test-design-tokens.mjs",
50
+ "test:design-tokens": "node ./scripts/test-design-tokens.mjs && node ./scripts/test-theme-family-token-contract.mjs",
51
51
  "test:divider": "node ./scripts/test-divider.mjs",
52
52
  "test:icon-button-ghost": "node ./scripts/test-icon-button-ghost.mjs",
53
53
  "test:input-addon-padding": "node ./scripts/test-input-addon-padding.mjs",
54
54
  "test:list-item-nativewind": "node ./scripts/test-list-item-nativewind.mjs",
55
55
  "test:pin-code-field": "node ./scripts/test-pin-code-field.mjs",
56
- "test:public-styling-contract": "node ./scripts/test-public-styling-contract.mjs",
56
+ "test:public-styling-contract": "node ./scripts/test-public-styling-contract.mjs && node ./scripts/test-theme-family-public-contract.mjs",
57
57
  "test:shared-styling": "node ./scripts/test-shared-styling.mjs",
58
58
  "test:styling-aliases": "node ./scripts/test-styling-aliases.mjs",
59
+ "test:theme-family-runtime": "node ./scripts/test-theme-family-runtime-contract.mjs",
59
60
  "test:tabs-figma-update": "node ./scripts/test-tabs-figma-update.mjs",
60
61
  "prepare": "pnpm build",
61
62
  "typecheck": "tsc --noEmit"