@veevarts/design-system 1.0.0-alpha.6 → 1.0.0-alpha.7

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.
Files changed (46) hide show
  1. package/README.md +59 -0
  2. package/dist/components/index.d.ts +13 -0
  3. package/dist/index.cjs +11 -11
  4. package/dist/index.d.ts +8 -12
  5. package/dist/index.js +9449 -7552
  6. package/dist/patterns/EventDetails/EventDetails.d.ts +1 -1
  7. package/dist/patterns/EventDetails/EventDetails.test.d.ts +1 -0
  8. package/dist/patterns/OfferCard/OfferCard.d.ts +12 -0
  9. package/dist/patterns/OfferCard/OfferCard.test.d.ts +1 -0
  10. package/dist/patterns/OfferCard/OfferCardEmpty.d.ts +12 -0
  11. package/dist/patterns/OfferCard/OfferCardError.d.ts +12 -0
  12. package/dist/patterns/OfferCard/OfferCardList.d.ts +12 -0
  13. package/dist/patterns/OfferCard/OfferCardSkeleton.d.ts +12 -0
  14. package/dist/patterns/OfferCard/animations.d.ts +42 -0
  15. package/dist/patterns/OfferCard/examples/CustomQuantitySelectorExample.d.ts +1 -0
  16. package/dist/patterns/OfferCard/examples/ListWithEurosCurrencyExample.d.ts +1 -0
  17. package/dist/patterns/OfferCard/examples/ListWithoutAnimationExample.d.ts +1 -0
  18. package/dist/patterns/OfferCard/examples/index.d.ts +3 -0
  19. package/dist/patterns/OfferCard/index.d.ts +14 -0
  20. package/dist/patterns/OfferCard/types.d.ts +483 -0
  21. package/dist/patterns/OfferCard/utils/currency.d.ts +26 -0
  22. package/dist/patterns/OfferCard/utils/index.d.ts +2 -0
  23. package/dist/patterns/OfferCard/utils/offers.d.ts +3 -0
  24. package/dist/patterns/RevenueDistribution/RevenueDistributionCard.d.ts +16 -0
  25. package/dist/patterns/RevenueDistribution/RevenueDistributionCard.test.d.ts +1 -0
  26. package/dist/patterns/RevenueDistribution/RevenueDistributionEmpty.d.ts +11 -0
  27. package/dist/patterns/RevenueDistribution/RevenueDistributionError.d.ts +11 -0
  28. package/dist/patterns/RevenueDistribution/RevenueDistributionSkeleton.d.ts +11 -0
  29. package/dist/patterns/RevenueDistribution/examples/InteractiveExample.d.ts +8 -0
  30. package/dist/patterns/RevenueDistribution/examples/MultipleDistributionsFormExample.d.ts +10 -0
  31. package/dist/patterns/RevenueDistribution/examples/WithGlAccountSearchExample.d.ts +7 -0
  32. package/dist/patterns/RevenueDistribution/examples/index.d.ts +9 -0
  33. package/dist/patterns/RevenueDistribution/index.d.ts +14 -0
  34. package/dist/patterns/RevenueDistribution/types.d.ts +394 -0
  35. package/dist/patterns/RevenueDistribution/utils/amount.d.ts +56 -0
  36. package/dist/patterns/RevenueDistribution/utils/data.d.ts +4 -0
  37. package/dist/patterns/RevenueDistribution/utils/index.d.ts +5 -0
  38. package/dist/patterns/RichText/TipTapArea/TipTapArea.d.ts +1 -1
  39. package/dist/patterns/RichText/types/props.d.ts +1 -1
  40. package/dist/patterns/Stepper/Stepper.d.ts +1 -1
  41. package/dist/patterns/index.d.ts +10 -5
  42. package/dist/tailwind/index.d.ts +541 -0
  43. package/dist/tailwind/index.js +293 -0
  44. package/dist/theme/index.d.ts +26 -2
  45. package/dist/tokens/colors.d.ts +67 -2
  46. package/package.json +16 -2
@@ -0,0 +1,293 @@
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/tailwind/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ colors: () => colors,
24
+ createHeroUIConfig: () => createHeroUIConfig,
25
+ deepMerge: () => deepMerge,
26
+ defaultHeroUITheme: () => defaultHeroUITheme,
27
+ normalizeColorPalette: () => normalizeColorPalette,
28
+ spacing: () => spacing,
29
+ tailwindTheme: () => tailwindTheme,
30
+ tokens: () => tokens,
31
+ typography: () => typography,
32
+ veevartPreset: () => veevartPreset
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+
36
+ // src/tokens/colors.ts
37
+ var colors = {
38
+ brand: {
39
+ primary: {
40
+ 50: "#fef5f1",
41
+ 100: "#fde8e0",
42
+ 200: "#fbd5c7",
43
+ 300: "#f7b79f",
44
+ 400: "#f18d68",
45
+ 500: "#C14615",
46
+ 600: "#a83b11",
47
+ 700: "#8b2f0e",
48
+ 800: "#73260d",
49
+ 900: "#5f210c",
50
+ DEFAULT: "#C14615"
51
+ }
52
+ },
53
+ semantic: {
54
+ secondary: "#000000",
55
+ success: "#057A54",
56
+ warning: "#F5A524",
57
+ danger: "#B62214",
58
+ info: "#2563EB"
59
+ },
60
+ neutral: {
61
+ white: "#FFFFFF",
62
+ black: "#000000",
63
+ gray: {
64
+ 50: "#F9FAFB",
65
+ 100: "#F3F4F6",
66
+ 200: "#E5E7EB",
67
+ 300: "#D1D5DB",
68
+ 400: "#9CA3AF",
69
+ 500: "#6B7280",
70
+ 600: "#4B5563",
71
+ 700: "#374151",
72
+ 800: "#1F2937",
73
+ 900: "#111827"
74
+ }
75
+ },
76
+ palettes: {
77
+ secondary: {
78
+ 50: "#f9fafb",
79
+ 100: "#f3f4f6",
80
+ 200: "#e5e7eb",
81
+ 300: "#d1d5db",
82
+ 400: "#9ca3af",
83
+ 500: "#000000",
84
+ 600: "#000000",
85
+ 700: "#000000",
86
+ 800: "#000000",
87
+ 900: "#000000",
88
+ DEFAULT: "#000000"
89
+ },
90
+ danger: {
91
+ 50: "#fef2f2",
92
+ 100: "#fee2e2",
93
+ 200: "#fecaca",
94
+ 300: "#fca5a5",
95
+ 400: "#f87171",
96
+ 500: "#B62214",
97
+ 600: "#a31e12",
98
+ 700: "#8b1a0f",
99
+ 800: "#73160d",
100
+ 900: "#5c120a",
101
+ DEFAULT: "#B62214"
102
+ },
103
+ success: {
104
+ 50: "#ecfdf5",
105
+ 100: "#d1fae5",
106
+ 200: "#a7f3d0",
107
+ 300: "#6ee7b7",
108
+ 400: "#34d399",
109
+ 500: "#057A54",
110
+ 600: "#046c4a",
111
+ 700: "#035e40",
112
+ 800: "#025035",
113
+ 900: "#01422b",
114
+ DEFAULT: "#057A54"
115
+ },
116
+ warning: {
117
+ 50: "#fffbeb",
118
+ 100: "#fef3c7",
119
+ 200: "#fde68a",
120
+ 300: "#fcd34d",
121
+ 400: "#fbbf24",
122
+ 500: "#F5A524",
123
+ 600: "#d97706",
124
+ 700: "#b45309",
125
+ 800: "#92400e",
126
+ 900: "#78350f",
127
+ DEFAULT: "#F5A524"
128
+ }
129
+ }
130
+ };
131
+
132
+ // src/tokens/typography.ts
133
+ var typography = {
134
+ fontFamily: {
135
+ primary: '"NeueMontreal", system-ui, sans-serif',
136
+ secondary: '"Scholar", Georgia, serif',
137
+ sans: '"NeueMontreal", system-ui, sans-serif',
138
+ serif: '"Scholar", Georgia, serif',
139
+ mono: '"JetBrains Mono", Consolas, monospace'
140
+ },
141
+ fontSize: {
142
+ xs: "0.75rem",
143
+ // 12px
144
+ sm: "0.875rem",
145
+ // 14px
146
+ base: "1rem",
147
+ // 16px
148
+ lg: "1.125rem",
149
+ // 18px
150
+ xl: "1.25rem",
151
+ // 20px
152
+ "2xl": "1.5rem",
153
+ // 24px
154
+ "3xl": "1.875rem",
155
+ // 30px
156
+ "4xl": "2.25rem",
157
+ // 36px
158
+ "5xl": "3rem"
159
+ // 48px
160
+ },
161
+ fontWeight: {
162
+ normal: "400",
163
+ // Available for both NeueMontreal and Scholar
164
+ semibold: "600",
165
+ // Available for NeueMontreal only
166
+ bold: "700"
167
+ // Available for NeueMontreal only
168
+ },
169
+ lineHeight: {
170
+ tight: "1.25",
171
+ normal: "1.5",
172
+ relaxed: "1.75"
173
+ }
174
+ };
175
+
176
+ // src/tokens/spacing.ts
177
+ var spacing = {
178
+ xs: "0.25rem",
179
+ // 4px - Fine control (½ of base unit)
180
+ sm: "0.5rem",
181
+ // 8px - Base unit
182
+ md: "1rem",
183
+ // 16px
184
+ lg: "1.5rem",
185
+ // 24px
186
+ xl: "2rem",
187
+ // 32px
188
+ "2xl": "3rem",
189
+ // 48px
190
+ "3xl": "4rem",
191
+ // 64px
192
+ "4xl": "6rem",
193
+ // 96px
194
+ "5xl": "8rem"
195
+ // 128px
196
+ };
197
+
198
+ // src/tailwind/index.ts
199
+ var tailwindTheme = {
200
+ colors: {
201
+ ...colors.brand,
202
+ ...colors.neutral,
203
+ ...colors.semantic
204
+ },
205
+ fontFamily: typography.fontFamily,
206
+ spacing,
207
+ fontSize: typography.fontSize,
208
+ fontWeight: typography.fontWeight,
209
+ lineHeight: typography.lineHeight
210
+ };
211
+ function deepMerge(target, source) {
212
+ if (!source || typeof source !== "object") {
213
+ return target;
214
+ }
215
+ const result = { ...target };
216
+ for (const key of Object.keys(source)) {
217
+ const sourceValue = source[key];
218
+ const targetValue = target[key];
219
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
220
+ result[key] = deepMerge(targetValue, sourceValue);
221
+ } else if (sourceValue !== void 0) {
222
+ result[key] = sourceValue;
223
+ }
224
+ }
225
+ return result;
226
+ }
227
+ function normalizeColorPalette(color, defaultPalette) {
228
+ if (typeof color === "string") {
229
+ return {
230
+ ...defaultPalette,
231
+ 500: color,
232
+ DEFAULT: color
233
+ };
234
+ }
235
+ return { ...defaultPalette, ...color };
236
+ }
237
+ var defaultHeroUITheme = {
238
+ light: {
239
+ colors: {
240
+ primary: colors.brand.primary,
241
+ secondary: colors.palettes.secondary,
242
+ danger: colors.palettes.danger,
243
+ success: colors.palettes.success,
244
+ warning: colors.palettes.warning
245
+ }
246
+ }
247
+ };
248
+ function createHeroUIConfig(overrides = {}) {
249
+ const { colors: colorOverrides = {}, themes: themeOverrides = {} } = overrides;
250
+ const lightColors = {
251
+ primary: colorOverrides.primary ? normalizeColorPalette(colorOverrides.primary, colors.brand.primary) : colors.brand.primary,
252
+ secondary: colorOverrides.secondary ? normalizeColorPalette(colorOverrides.secondary, colors.palettes.secondary) : colors.palettes.secondary,
253
+ danger: colorOverrides.danger ? normalizeColorPalette(colorOverrides.danger, colors.palettes.danger) : colors.palettes.danger,
254
+ success: colorOverrides.success ? normalizeColorPalette(colorOverrides.success, colors.palettes.success) : colors.palettes.success,
255
+ warning: colorOverrides.warning ? normalizeColorPalette(colorOverrides.warning, colors.palettes.warning) : colors.palettes.warning
256
+ };
257
+ const baseConfig = {
258
+ themes: {
259
+ light: {
260
+ colors: lightColors
261
+ }
262
+ }
263
+ };
264
+ if (themeOverrides && Object.keys(themeOverrides).length > 0) {
265
+ return deepMerge(baseConfig, { themes: themeOverrides });
266
+ }
267
+ return baseConfig;
268
+ }
269
+ var veevartPreset = {
270
+ theme: {
271
+ extend: tailwindTheme
272
+ },
273
+ darkMode: "class"
274
+ };
275
+ var tokens = {
276
+ colors,
277
+ typography,
278
+ spacing,
279
+ tailwindTheme
280
+ };
281
+ // Annotate the CommonJS export names for ESM import in node:
282
+ 0 && (module.exports = {
283
+ colors,
284
+ createHeroUIConfig,
285
+ deepMerge,
286
+ defaultHeroUITheme,
287
+ normalizeColorPalette,
288
+ spacing,
289
+ tailwindTheme,
290
+ tokens,
291
+ typography,
292
+ veevartPreset
293
+ });
@@ -10,12 +10,36 @@ export declare const theme: {
10
10
  readonly 200: "#fbd5c7";
11
11
  readonly 300: "#f7b79f";
12
12
  readonly 400: "#f18d68";
13
- readonly 500: "#C14615";
13
+ readonly 500: {
14
+ readonly 50: "#fef5f1";
15
+ readonly 100: "#fde8e0";
16
+ readonly 200: "#fbd5c7";
17
+ readonly 300: "#f7b79f";
18
+ readonly 400: "#f18d68";
19
+ readonly 500: "#C14615";
20
+ readonly 600: "#a83b11";
21
+ readonly 700: "#8b2f0e";
22
+ readonly 800: "#73260d";
23
+ readonly 900: "#5f210c";
24
+ readonly DEFAULT: "#C14615";
25
+ };
14
26
  readonly 600: "#a83b11";
15
27
  readonly 700: "#8b2f0e";
16
28
  readonly 800: "#73260d";
17
29
  readonly 900: "#5f210c";
18
- readonly DEFAULT: "#C14615";
30
+ readonly DEFAULT: {
31
+ readonly 50: "#fef5f1";
32
+ readonly 100: "#fde8e0";
33
+ readonly 200: "#fbd5c7";
34
+ readonly 300: "#f7b79f";
35
+ readonly 400: "#f18d68";
36
+ readonly 500: "#C14615";
37
+ readonly 600: "#a83b11";
38
+ readonly 700: "#8b2f0e";
39
+ readonly 800: "#73260d";
40
+ readonly 900: "#5f210c";
41
+ readonly DEFAULT: "#C14615";
42
+ };
19
43
  };
20
44
  readonly secondary: {
21
45
  readonly 50: "#f9fafb";
@@ -4,8 +4,19 @@
4
4
  */
5
5
  export declare const colors: {
6
6
  readonly brand: {
7
- readonly primary: "#C14615";
8
- readonly secondary: "#000000";
7
+ readonly primary: {
8
+ readonly 50: "#fef5f1";
9
+ readonly 100: "#fde8e0";
10
+ readonly 200: "#fbd5c7";
11
+ readonly 300: "#f7b79f";
12
+ readonly 400: "#f18d68";
13
+ readonly 500: "#C14615";
14
+ readonly 600: "#a83b11";
15
+ readonly 700: "#8b2f0e";
16
+ readonly 800: "#73260d";
17
+ readonly 900: "#5f210c";
18
+ readonly DEFAULT: "#C14615";
19
+ };
9
20
  };
10
21
  readonly semantic: {
11
22
  readonly secondary: "#000000";
@@ -30,5 +41,59 @@ export declare const colors: {
30
41
  readonly 900: "#111827";
31
42
  };
32
43
  };
44
+ readonly palettes: {
45
+ readonly secondary: {
46
+ readonly 50: "#f9fafb";
47
+ readonly 100: "#f3f4f6";
48
+ readonly 200: "#e5e7eb";
49
+ readonly 300: "#d1d5db";
50
+ readonly 400: "#9ca3af";
51
+ readonly 500: "#000000";
52
+ readonly 600: "#000000";
53
+ readonly 700: "#000000";
54
+ readonly 800: "#000000";
55
+ readonly 900: "#000000";
56
+ readonly DEFAULT: "#000000";
57
+ };
58
+ readonly danger: {
59
+ readonly 50: "#fef2f2";
60
+ readonly 100: "#fee2e2";
61
+ readonly 200: "#fecaca";
62
+ readonly 300: "#fca5a5";
63
+ readonly 400: "#f87171";
64
+ readonly 500: "#B62214";
65
+ readonly 600: "#a31e12";
66
+ readonly 700: "#8b1a0f";
67
+ readonly 800: "#73160d";
68
+ readonly 900: "#5c120a";
69
+ readonly DEFAULT: "#B62214";
70
+ };
71
+ readonly success: {
72
+ readonly 50: "#ecfdf5";
73
+ readonly 100: "#d1fae5";
74
+ readonly 200: "#a7f3d0";
75
+ readonly 300: "#6ee7b7";
76
+ readonly 400: "#34d399";
77
+ readonly 500: "#057A54";
78
+ readonly 600: "#046c4a";
79
+ readonly 700: "#035e40";
80
+ readonly 800: "#025035";
81
+ readonly 900: "#01422b";
82
+ readonly DEFAULT: "#057A54";
83
+ };
84
+ readonly warning: {
85
+ readonly 50: "#fffbeb";
86
+ readonly 100: "#fef3c7";
87
+ readonly 200: "#fde68a";
88
+ readonly 300: "#fcd34d";
89
+ readonly 400: "#fbbf24";
90
+ readonly 500: "#F5A524";
91
+ readonly 600: "#d97706";
92
+ readonly 700: "#b45309";
93
+ readonly 800: "#92400e";
94
+ readonly 900: "#78350f";
95
+ readonly DEFAULT: "#F5A524";
96
+ };
97
+ };
33
98
  };
34
99
  export type ColorToken = typeof colors;
package/package.json CHANGED
@@ -1,17 +1,30 @@
1
1
  {
2
2
  "name": "@veevarts/design-system",
3
3
  "private": false,
4
- "version": "1.0.0-alpha.6",
4
+ "version": "1.0.0-alpha.7",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./tailwind": {
16
+ "types": "./dist/tailwind/index.d.ts",
17
+ "require": "./dist/tailwind/index.js",
18
+ "import": "./dist/tailwind/index.js"
19
+ }
20
+ },
9
21
  "files": [
10
22
  "dist"
11
23
  ],
12
24
  "scripts": {
13
25
  "dev": "vite",
14
- "build": "vite build",
26
+ "build": "vite build && npm run build:tailwind",
27
+ "build:tailwind": "esbuild src/tailwind/index.ts --bundle --platform=node --format=cjs --outfile=dist/tailwind/index.js && tsc -p src/tailwind/tsconfig.json",
15
28
  "lint": "eslint .",
16
29
  "preview": "vite preview",
17
30
  "test": "vitest --run",
@@ -47,6 +60,7 @@
47
60
  },
48
61
  "dependencies": {
49
62
  "@iconify/react": "^6.0.2",
63
+ "react-hook-form": "^7.56.4",
50
64
  "vite-plugin-css-injected-by-js": "3.5.2",
51
65
  "vite-plugin-dts": "4.5.4"
52
66
  },