@payfit/unity-themes 2.46.17 → 2.46.18

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 (37) hide show
  1. package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Oblique.woff +0 -0
  2. package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Oblique.woff2 +0 -0
  3. package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Regular.woff +0 -0
  4. package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Regular.woff2 +0 -0
  5. package/dist/css/generated/proprietary-fonts.css +11 -0
  6. package/dist/css/unity.css +1982 -0
  7. package/dist/esm/components/unity-theme-provider.d.ts +25 -0
  8. package/dist/esm/components/unity-theme-provider.js +34 -0
  9. package/dist/esm/components/unity-theme-provider.test.d.ts +1 -0
  10. package/dist/esm/index.d.ts +5 -0
  11. package/dist/esm/index.js +15 -0
  12. package/dist/esm/scripts/actions/append-animations.d.ts +3 -0
  13. package/dist/esm/scripts/actions/compose-multi-theme.d.ts +15 -0
  14. package/dist/esm/scripts/build.d.ts +1 -0
  15. package/dist/esm/scripts/file-headers/unity.d.ts +2 -0
  16. package/dist/esm/scripts/formats/processors/grid-processor.d.ts +2 -0
  17. package/dist/esm/scripts/formats/processors/typography-processor.d.ts +2 -0
  18. package/dist/esm/scripts/formats/unity-theme.d.ts +3 -0
  19. package/dist/esm/scripts/formats/utils.d.ts +3 -0
  20. package/dist/esm/scripts/transforms/oklch.d.ts +4 -0
  21. package/dist/esm/scripts/transforms/tailwind-animation-token.d.ts +6 -0
  22. package/dist/esm/scripts/transforms/tailwind-color-token.d.ts +7 -0
  23. package/dist/esm/scripts/transforms/tailwind-grid-token.d.ts +7 -0
  24. package/dist/esm/scripts/transforms/tailwind-spacing-token.d.ts +4 -0
  25. package/dist/esm/scripts/transforms/tailwind-text-token.d.ts +4 -0
  26. package/dist/esm/scripts/transforms/tailwind-typography-token.d.ts +3 -0
  27. package/dist/esm/scripts/types.d.ts +21 -0
  28. package/dist/esm/scripts/utils/prefix-transform.d.ts +4 -0
  29. package/dist/esm/utils/cn.d.ts +94 -0
  30. package/dist/esm/utils/cn.js +11 -0
  31. package/dist/esm/utils/merge-config.d.ts +217 -0
  32. package/dist/esm/utils/merge-config.js +172 -0
  33. package/dist/esm/utils/tailwind-merge.d.ts +67 -0
  34. package/dist/esm/utils/tailwind-merge.js +8 -0
  35. package/dist/esm/utils/tailwind-variants.d.ts +44 -0
  36. package/dist/esm/utils/tailwind-variants.js +9 -0
  37. package/package.json +1 -1
@@ -0,0 +1,172 @@
1
+ import { validators as l } from "tailwind-merge";
2
+ const r = [
3
+ "0",
4
+ "25",
5
+ "50",
6
+ "75",
7
+ "100",
8
+ "125",
9
+ "150",
10
+ "200",
11
+ "250",
12
+ "300",
13
+ "400",
14
+ "500",
15
+ "600",
16
+ "800",
17
+ "1000"
18
+ ], d = [
19
+ "display-heading",
20
+ "h1",
21
+ "h2",
22
+ "h3",
23
+ "h4",
24
+ "overline",
25
+ "subtitle",
26
+ "display-title",
27
+ "display-body",
28
+ "body",
29
+ "body-strong",
30
+ "body-small",
31
+ "body-small-strong",
32
+ "body-large",
33
+ "body-large-strong",
34
+ "action",
35
+ "action-small",
36
+ "action-large"
37
+ ], t = [
38
+ "50",
39
+ "75",
40
+ "100",
41
+ "200",
42
+ "300",
43
+ "400",
44
+ "500",
45
+ "600",
46
+ "800",
47
+ "1000",
48
+ "1200",
49
+ "1400",
50
+ "1600"
51
+ ], o = [
52
+ "0",
53
+ "25",
54
+ "50",
55
+ "75",
56
+ "100",
57
+ "125",
58
+ "150",
59
+ "200",
60
+ "300",
61
+ "400",
62
+ "xs",
63
+ "sm",
64
+ "md",
65
+ "lg",
66
+ "xl",
67
+ "circle",
68
+ "pill"
69
+ ], n = ["canvas", "raising", "floating", "flying", "soaring"], s = (e) => !!(/^[a-z]+-l\d+$/.test(e) || /^(?:canvas|surface|content|border|utility)-.+$/.test(e)), a = {
70
+ prefix: "uy",
71
+ extend: {
72
+ classGroups: {
73
+ // Colors - Use pattern matching for maintainability
74
+ // Matches primitive colors like: grayscale-l0, red-l1, blue-l12, etc.
75
+ // Matches semantic colors like: surface-primary-default, content-neutral-low, border-danger-default, etc.
76
+ "bg-color": [{ bg: [l.isArbitraryValue, s] }],
77
+ "text-color": [{ text: [l.isArbitraryValue, s] }],
78
+ "border-color": [{ border: [l.isArbitraryValue, s] }],
79
+ "outline-color": [
80
+ { outline: [l.isArbitraryValue, s] }
81
+ ],
82
+ "ring-color": [{ ring: [l.isArbitraryValue, s] }],
83
+ "ring-offset-color": [
84
+ { "ring-offset": [l.isArbitraryValue, s] }
85
+ ],
86
+ "divide-color": [{ divide: [l.isArbitraryValue, s] }],
87
+ "text-decoration-color": [
88
+ { decoration: [l.isArbitraryValue, s] }
89
+ ],
90
+ "gradient-color-from": [
91
+ { from: [l.isArbitraryValue, s] }
92
+ ],
93
+ "gradient-color-via": [
94
+ { via: [l.isArbitraryValue, s] }
95
+ ],
96
+ "gradient-color-to": [
97
+ { to: [l.isArbitraryValue, s] }
98
+ ],
99
+ // Spacing - Padding
100
+ p: [{ p: r }],
101
+ px: [{ px: r }],
102
+ py: [{ py: r }],
103
+ ps: [{ ps: r }],
104
+ pe: [{ pe: r }],
105
+ pt: [{ pt: r }],
106
+ pr: [{ pr: r }],
107
+ pb: [{ pb: r }],
108
+ pl: [{ pl: r }],
109
+ // Spacing - Margin
110
+ m: [{ m: r }],
111
+ mx: [{ mx: r }],
112
+ my: [{ my: r }],
113
+ ms: [{ ms: r }],
114
+ me: [{ me: r }],
115
+ mt: [{ mt: r }],
116
+ mr: [{ mr: r }],
117
+ mb: [{ mb: r }],
118
+ ml: [{ ml: r }],
119
+ // Spacing - Gap
120
+ gap: [{ gap: r }],
121
+ "gap-x": [{ "gap-x": r }],
122
+ "gap-y": [{ "gap-y": r }],
123
+ // Spacing - Space between
124
+ "space-x": [{ "space-x": r }],
125
+ "space-y": [{ "space-y": r }],
126
+ // Spacing - Scroll padding
127
+ "scroll-p": [{ "scroll-p": r }],
128
+ "scroll-px": [{ "scroll-px": r }],
129
+ "scroll-py": [{ "scroll-py": r }],
130
+ "scroll-ps": [{ "scroll-ps": r }],
131
+ "scroll-pe": [{ "scroll-pe": r }],
132
+ "scroll-pt": [{ "scroll-pt": r }],
133
+ "scroll-pr": [{ "scroll-pr": r }],
134
+ "scroll-pb": [{ "scroll-pb": r }],
135
+ "scroll-pl": [{ "scroll-pl": r }],
136
+ // Spacing - Scroll margin
137
+ "scroll-m": [{ "scroll-m": r }],
138
+ "scroll-mx": [{ "scroll-mx": r }],
139
+ "scroll-my": [{ "scroll-my": r }],
140
+ "scroll-ms": [{ "scroll-ms": r }],
141
+ "scroll-me": [{ "scroll-me": r }],
142
+ "scroll-mt": [{ "scroll-mt": r }],
143
+ "scroll-mr": [{ "scroll-mr": r }],
144
+ "scroll-mb": [{ "scroll-mb": r }],
145
+ "scroll-ml": [{ "scroll-ml": r }],
146
+ // Typography
147
+ typography: [{ typography: d }],
148
+ "font-size": [{ text: t }],
149
+ // Border radius
150
+ rounded: [{ rounded: o }],
151
+ "rounded-s": [{ "rounded-s": o }],
152
+ "rounded-e": [{ "rounded-e": o }],
153
+ "rounded-t": [{ "rounded-t": o }],
154
+ "rounded-r": [{ "rounded-r": o }],
155
+ "rounded-b": [{ "rounded-b": o }],
156
+ "rounded-l": [{ "rounded-l": o }],
157
+ "rounded-ss": [{ "rounded-ss": o }],
158
+ "rounded-se": [{ "rounded-se": o }],
159
+ "rounded-ee": [{ "rounded-ee": o }],
160
+ "rounded-es": [{ "rounded-es": o }],
161
+ "rounded-tl": [{ "rounded-tl": o }],
162
+ "rounded-tr": [{ "rounded-tr": o }],
163
+ "rounded-br": [{ "rounded-br": o }],
164
+ "rounded-bl": [{ "rounded-bl": o }],
165
+ // Shadows
166
+ shadow: [{ shadow: n }]
167
+ }
168
+ }
169
+ };
170
+ export {
171
+ a as twMergeConfig
172
+ };
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Unity-configured tailwind-merge function for intelligent CSS class merging.
3
+ *
4
+ * This is a pre-configured version of tailwind-merge that includes Unity's custom
5
+ * class definitions and merge rules. It automatically handles Unity's design tokens
6
+ * including semantic colors, primitive colors, spacing values, typography classes,
7
+ * border radius, shadows, and more.
8
+ * @param classes - CSS class names to merge
9
+ * @returns Merged and deduplicated class string with conflicts resolved
10
+ * @example
11
+ * ```tsx
12
+ * import { uyMerge } from '@payfit/unity-themes'
13
+ *
14
+ * // Basic conflict resolution - last class wins
15
+ * const className = uyMerge('uy:bg-surface-primary-default', 'uy:bg-surface-danger-default')
16
+ * // → 'uy:bg-surface-danger-default'
17
+ *
18
+ * // Spacing conflicts
19
+ * const className = uyMerge('uy:p-100', 'uy:px-200', 'uy:py-300')
20
+ * // → 'uy:p-100 uy:px-200 uy:py-300' (px/py don't conflict with p)
21
+ *
22
+ * const className = uyMerge('uy:p-100', 'uy:p-200')
23
+ * // → 'uy:p-200' (direct conflict resolved)
24
+ *
25
+ * // Typography conflicts
26
+ * const className = uyMerge('uy:typography-h1', 'uy:typography-body')
27
+ * // → 'uy:typography-body'
28
+ *
29
+ * // Complex semantic colors
30
+ * const className = uyMerge(
31
+ * 'uy:bg-surface-primary-default-default',
32
+ * 'uy:bg-surface-primary-default-hover'
33
+ * )
34
+ * // → 'uy:bg-surface-primary-default-hover'
35
+ *
36
+ * // Mixed with standard Tailwind (no conflicts)
37
+ * const className = uyMerge('flex items-center', 'uy:bg-surface-primary-default', 'justify-center')
38
+ * // → 'flex items-center uy:bg-surface-primary-default justify-center'
39
+ *
40
+ * // Responsive and state variants
41
+ * const className = uyMerge(
42
+ * 'uy:bg-surface-neutral-default',
43
+ * 'uy:hover:bg-surface-primary-hover',
44
+ * 'uy:md:bg-surface-secondary-default'
45
+ * )
46
+ * // → 'uy:bg-surface-neutral-default uy:hover:bg-surface-primary-hover uy:md:bg-surface-secondary-default'
47
+ * ```
48
+ * @description
49
+ * **Supported Unity Features:**
50
+ * - **Primitive Colors**: `grayscale-l0`, `red-l5`, `blue-l12`, etc. (pattern: `{color}-l{number}`)
51
+ * - **Semantic Colors**: `surface-primary-default`, `content-neutral-low`, `border-danger-default`, etc.
52
+ * - **Spacing**: All Unity spacing values (`0`, `25`, `50`, `75`, `100`, `125`, `150`, `200`, `250`, `300`, `400`, `500`, `600`, `800`, `1000`)
53
+ * - **Typography**: `h1`, `h2`, `body`, `action`, etc. (generated class names without `-sm` variants)
54
+ * - **Border Radius**: Numeric (`0`, `25`, `50`, etc.) and semantic (`xs`, `sm`, `md`, `lg`, `xl`, `circle`, `pill`)
55
+ * - **Shadows**: Unity shadow values (`canvas`, `raising`, `floating`, `flying`, `soaring`)
56
+ * - **All Utilities**: `bg-*`, `text-*`, `border-*`, `outline-*`, `ring-*`, `divide-*`, `decoration-*`, gradients, etc.
57
+ *
58
+ * **Merge Rules:**
59
+ * - Conflicting classes within the same group are resolved (last one wins)
60
+ * - Non-conflicting classes are preserved
61
+ * - Unity classes don't conflict with standard Tailwind classes
62
+ * - Responsive and state variants are handled correctly
63
+ * - Pattern matching automatically supports new Unity design tokens
64
+ * @see {@link twMergeConfig} for the complete Unity merge configuration
65
+ * @see {@link https://github.com/dcastil/tailwind-merge Tailwind Merge Documentation}
66
+ */
67
+ export declare const uyMerge: (...classLists: import('tailwind-merge').ClassNameValue[]) => string;
@@ -0,0 +1,8 @@
1
+ import { createTailwindMerge as e, mergeConfigs as r, getDefaultConfig as o } from "tailwind-merge";
2
+ import { twMergeConfig as g } from "./merge-config.js";
3
+ const f = e(
4
+ () => r(o(), g)
5
+ );
6
+ export {
7
+ f as uyMerge
8
+ };
@@ -0,0 +1,44 @@
1
+ import { VariantProps } from 'tailwind-variants';
2
+ /**
3
+ * Unity-configured tailwind-variants TV function for creating component variants.
4
+ *
5
+ * This is a pre-configured version of tailwind-variants' `createTV` function that includes
6
+ * Unity's custom tailwind-merge configuration. It automatically handles Unity's custom
7
+ * class names including semantic colors, spacing values, typography classes, and more.
8
+ * @example
9
+ * ```tsx
10
+ * import { uyTv } from '@payfit/unity-themes'
11
+ *
12
+ * const button = uyTv({
13
+ * base: 'uy:px-200 uy:py-100 uy:rounded-100',
14
+ * variants: {
15
+ * variant: {
16
+ * primary: 'uy:bg-surface-primary-default uy:text-content-inverted-default',
17
+ * secondary: 'uy:bg-surface-neutral-default uy:text-content-neutral-default',
18
+ * },
19
+ * size: {
20
+ * small: 'uy:text-75 uy:px-150 uy:py-75',
21
+ * large: 'uy:text-200 uy:px-300 uy:py-150',
22
+ * }
23
+ * },
24
+ * defaultVariants: {
25
+ * variant: 'primary',
26
+ * size: 'small'
27
+ * }
28
+ * })
29
+ *
30
+ * // Usage in component
31
+ * <button className={button({ variant: 'secondary', size: 'large' })}>
32
+ * Click me
33
+ * </button>
34
+ * ```
35
+ * @description
36
+ * - Automatically merges conflicting Unity classes (e.g., `uy:bg-surface-primary` + `uy:bg-surface-danger` → `uy:bg-surface-danger`)
37
+ * - Supports all Unity design tokens: colors, spacing, typography, shadows, border radius
38
+ * - Handles responsive and state variants correctly
39
+ * - Compatible with standard Tailwind classes alongside Unity classes
40
+ * @see {@link https://www.tailwind-variants.org/ Tailwind Variants Documentation}
41
+ * @see {@link twMergeConfig} for the Unity merge configuration details
42
+ */
43
+ export declare const uyTv: import('tailwind-variants').TV;
44
+ export type { VariantProps };
@@ -0,0 +1,9 @@
1
+ import { createTV as r } from "tailwind-variants";
2
+ import { twMergeConfig as e } from "./merge-config.js";
3
+ const m = r({
4
+ twMerge: !0,
5
+ twMergeConfig: e
6
+ });
7
+ export {
8
+ m as uyTv
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-themes",
3
- "version": "2.46.17",
3
+ "version": "2.46.18",
4
4
  "main": "./dist/esm/index.js",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "style": "./dist/css/unity.css",