@indra-inter/neobrutalism-components 0.1.2 → 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 ADDED
@@ -0,0 +1,146 @@
1
+ /* Generated NativeWind semantic tokens from Figma design tokens. Do not edit by hand. */
2
+ :root {
3
+ --accent: 201.11 100% 89.41%;
4
+ --accent-foreground: 202.17 79.31% 11.37%;
5
+ --background: 0 0% 100%;
6
+ --background-color: 0 0% 0% / 50.2%;
7
+ --border: 0 0% 0%;
8
+ --card: 0 0% 95.29%;
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%;
21
+ --popover: 0 0% 98.04%;
22
+ --popover-foreground: 0 0% 3.92%;
23
+ --primary: 199.84 100% 50.2%;
24
+ --primary-foreground: 0 0% 0%;
25
+ --primary-hover: 200.98 79.89% 64.9%;
26
+ --ring: 199.84 100% 50.2%;
27
+ --secondary: 0 0% 3.92%;
28
+ --secondary-foreground: 0 0% 100%;
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%;
45
+ --success: 142.09 70.56% 45.29%;
46
+ --success-foreground: 0 0% 3.92%;
47
+ --color-success-100: 140.63 84.21% 92.55%;
48
+ --color-success-200: 141 78.95% 85.1%;
49
+ --color-success-300: 141.71 76.64% 73.14%;
50
+ --color-success-400: 141.89 69.16% 58.04%;
51
+ --color-success-500: 142.09 70.56% 45.29%;
52
+ --info: 217.22 91.22% 59.8%;
53
+ --info-foreground: 0 0% 3.92%;
54
+ --color-info-100: 214.29 94.59% 92.75%;
55
+ --color-info-200: 213.33 96.92% 87.25%;
56
+ --color-info-300: 211.7 96.36% 78.43%;
57
+ --color-info-400: 213.12 93.9% 67.84%;
58
+ --color-info-500: 217.22 91.22% 59.8%;
59
+ --warning: 26.39 90.22% 63.92%;
60
+ --warning-foreground: 0 0% 3.92%;
61
+ --color-warning-100: 28 100% 97.06%;
62
+ --color-warning-200: 26.51 100% 91.57%;
63
+ --color-warning-300: 26.84 100% 85.1%;
64
+ --color-warning-400: 26.55 100% 77.84%;
65
+ --color-warning-500: 26.39 90.22% 63.92%;
66
+ --error: 0 75.25% 60.39%;
67
+ --error-foreground: 0 75.25% 60.39% / 25.1%;
68
+ --color-error-100: 0 100% 95.88%;
69
+ --color-error-200: 0 100% 90.78%;
70
+ --color-error-300: 0 100% 82.75%;
71
+ --color-error-400: 0 90.14% 72.16%;
72
+ --color-error-500: 0 75.25% 60.39%;
73
+ }
74
+
75
+ .dark:root {
76
+ --accent: 202.5 64.86% 14.51%;
77
+ --accent-foreground: 201.11 100% 89.41%;
78
+ --background: 0 0% 12.16%;
79
+ --background-color: 0 0% 0% / 50.2%;
80
+ --border: 0 0% 0%;
81
+ --card: 0 0% 10.2%;
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%;
94
+ --popover: 0 0% 10.2%;
95
+ --popover-foreground: 0 0% 98.04%;
96
+ --primary: 199.84 100% 50.2%;
97
+ --primary-foreground: 0 0% 0%;
98
+ --primary-hover: 200.98 79.89% 64.9%;
99
+ --ring: 199.89 100% 65.1%;
100
+ --secondary: 0 0% 98.04%;
101
+ --secondary-foreground: 0 0% 5.88%;
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%;
118
+ --success: 142.09 70.56% 45.29%;
119
+ --success-foreground: 0 0% 98.04%;
120
+ --color-success-100: 140.63 84.21% 92.55%;
121
+ --color-success-200: 141 78.95% 85.1%;
122
+ --color-success-300: 141.71 76.64% 73.14%;
123
+ --color-success-400: 141.89 69.16% 58.04%;
124
+ --color-success-500: 142.09 70.56% 45.29%;
125
+ --info: 217.22 91.22% 59.8%;
126
+ --info-foreground: 0 0% 98.04%;
127
+ --color-info-100: 214.29 94.59% 92.75%;
128
+ --color-info-200: 213.33 96.92% 87.25%;
129
+ --color-info-300: 211.7 96.36% 78.43%;
130
+ --color-info-400: 213.12 93.9% 67.84%;
131
+ --color-info-500: 217.22 91.22% 59.8%;
132
+ --warning: 26.39 90.22% 63.92%;
133
+ --warning-foreground: 0 0% 98.04%;
134
+ --color-warning-100: 28 100% 97.06%;
135
+ --color-warning-200: 26.51 100% 91.57%;
136
+ --color-warning-300: 26.84 100% 85.1%;
137
+ --color-warning-400: 26.55 100% 77.84%;
138
+ --color-warning-500: 26.39 90.22% 63.92%;
139
+ --error: 0 75.25% 60.39%;
140
+ --error-foreground: 0 75.25% 60.39% / 25.1%;
141
+ --color-error-100: 0 100% 95.88%;
142
+ --color-error-200: 0 100% 90.78%;
143
+ --color-error-300: 0 100% 82.75%;
144
+ --color-error-400: 0 90.14% 72.16%;
145
+ --color-error-500: 0 75.25% 60.39%;
146
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra-inter/neobrutalism-components",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,11 +13,13 @@
13
13
  "default": "./dist/module/index.js"
14
14
  },
15
15
  "./tokens.css": "./tokens.css",
16
+ "./nativewind.css": "./nativewind.css",
16
17
  "./package.json": "./package.json"
17
18
  },
18
19
  "files": [
19
20
  "dist",
20
21
  "tokens.css",
22
+ "nativewind.css",
21
23
  "README.md"
22
24
  ],
23
25
  "peerDependencies": {
@@ -45,15 +47,16 @@
45
47
  "test:card-nativewind": "node ./scripts/test-card-nativewind.mjs",
46
48
  "test:bottom-sheet-drag-dismiss": "node ./scripts/test-bottom-sheet-drag-dismiss.mjs",
47
49
  "test:chat-list-item-slots": "node ./scripts/test-chat-list-item-slots.mjs",
48
- "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",
49
51
  "test:divider": "node ./scripts/test-divider.mjs",
50
52
  "test:icon-button-ghost": "node ./scripts/test-icon-button-ghost.mjs",
51
53
  "test:input-addon-padding": "node ./scripts/test-input-addon-padding.mjs",
52
54
  "test:list-item-nativewind": "node ./scripts/test-list-item-nativewind.mjs",
53
55
  "test:pin-code-field": "node ./scripts/test-pin-code-field.mjs",
54
- "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",
55
57
  "test:shared-styling": "node ./scripts/test-shared-styling.mjs",
56
58
  "test:styling-aliases": "node ./scripts/test-styling-aliases.mjs",
59
+ "test:theme-family-runtime": "node ./scripts/test-theme-family-runtime-contract.mjs",
57
60
  "test:tabs-figma-update": "node ./scripts/test-tabs-figma-update.mjs",
58
61
  "prepare": "pnpm build",
59
62
  "typecheck": "tsc --noEmit"