@payfit/unity-themes 2.47.4 → 2.47.6

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,34 +1,30 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { createContext as i, useState as s, useEffect as f, useContext as h } from "react";
3
- const o = i({
4
- // Render legacy by default for backwards compatibility
5
- theme: "legacy",
6
- // Intentional noop. Will be replaced by a set dispatcher from React
7
- // eslint-disable-next-line @typescript-eslint/no-empty-function
8
- setTheme: () => {
9
- }
1
+ import { createContext as e, useContext as t, useEffect as n, useState as r } from "react";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ //#region src/components/unity-theme-provider.tsx
4
+ var a = e({
5
+ theme: "legacy",
6
+ setTheme: () => {}
10
7
  });
11
- function d(e) {
12
- return e === void 0 ? document.documentElement : typeof e == "string" ? document.querySelector(e) : e.current;
8
+ function o(e) {
9
+ return e === void 0 ? document.documentElement : typeof e == "string" ? document.querySelector(e) : e.current;
13
10
  }
14
- function T({
15
- theme: e = "legacy",
16
- target: r,
17
- children: u
18
- }) {
19
- const [t, m] = s(e);
20
- return f(() => {
21
- const n = d(r);
22
- if (n)
23
- return n.dataset.uyTheme = t, () => {
24
- delete n.dataset.uyTheme;
25
- };
26
- }, [t, r]), /* @__PURE__ */ c(o.Provider, { value: { theme: t, setTheme: m }, children: u });
11
+ function s({ theme: e = "legacy", target: t, children: s }) {
12
+ let [c, l] = r(e);
13
+ return n(() => {
14
+ let e = o(t);
15
+ if (e) return e.dataset.uyTheme = c, () => {
16
+ delete e.dataset.uyTheme;
17
+ };
18
+ }, [c, t]), /* @__PURE__ */ i(a.Provider, {
19
+ value: {
20
+ theme: c,
21
+ setTheme: l
22
+ },
23
+ children: s
24
+ });
27
25
  }
28
- function a() {
29
- return h(o);
26
+ function c() {
27
+ return t(a);
30
28
  }
31
- export {
32
- T as UnityThemeProvider,
33
- a as useUnityTheme
34
- };
29
+ //#endregion
30
+ export { s as UnityThemeProvider, c as useUnityTheme };
package/dist/esm/index.js CHANGED
@@ -1,15 +1,6 @@
1
- import { classNames as o, clsx as m, cn as t } from "./utils/cn.js";
2
- import { uyMerge as x } from "./utils/tailwind-merge.js";
3
- import { uyTv as s } from "./utils/tailwind-variants.js";
4
- import { twMergeConfig as n } from "./utils/merge-config.js";
5
- import { UnityThemeProvider as c, useUnityTheme as g } from "./components/unity-theme-provider.js";
6
- export {
7
- c as UnityThemeProvider,
8
- o as classNames,
9
- m as clsx,
10
- t as cn,
11
- n as twMergeConfig,
12
- g as useUnityTheme,
13
- x as uyMerge,
14
- s as uyTv
15
- };
1
+ import { twMergeConfig as e } from "./utils/merge-config.js";
2
+ import { classNames as t, clsx as n, cn as r } from "./utils/cn.js";
3
+ import { uyMerge as i } from "./utils/tailwind-merge.js";
4
+ import { uyTv as a } from "./utils/tailwind-variants.js";
5
+ import { UnityThemeProvider as o, useUnityTheme as s } from "./components/unity-theme-provider.js";
6
+ export { o as UnityThemeProvider, t as classNames, n as clsx, r as cn, e as twMergeConfig, s as useUnityTheme, i as uyMerge, a as uyTv };
@@ -1,11 +1,9 @@
1
- import { cnMerge as e } from "tailwind-variants";
2
- import { twMergeConfig as r } from "./merge-config.js";
3
- const o = (...t) => e(...t)({
4
- twMerge: !0,
5
- twMergeConfig: r
6
- }), s = o, m = o, g = o;
7
- export {
8
- m as classNames,
9
- g as clsx,
10
- s as cn
11
- };
1
+ import { twMergeConfig as e } from "./merge-config.js";
2
+ import { cnMerge as t } from "tailwind-variants";
3
+ //#region src/utils/cn.ts
4
+ var n = (...n) => t(...n)({
5
+ twMerge: !0,
6
+ twMergeConfig: e
7
+ }), r = n, i = n, a = n;
8
+ //#endregion
9
+ export { i as classNames, a as clsx, r as cn };
@@ -1,172 +1,152 @@
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
1
+ import { validators as e } from "tailwind-merge";
2
+ //#region src/utils/merge-config.ts
3
+ var t = [
4
+ "0",
5
+ "25",
6
+ "50",
7
+ "75",
8
+ "100",
9
+ "125",
10
+ "150",
11
+ "200",
12
+ "250",
13
+ "300",
14
+ "400",
15
+ "500",
16
+ "600",
17
+ "800",
18
+ "1000"
19
+ ], n = [
20
+ "display-heading",
21
+ "h1",
22
+ "h2",
23
+ "h3",
24
+ "h4",
25
+ "overline",
26
+ "subtitle",
27
+ "display-title",
28
+ "display-body",
29
+ "body",
30
+ "body-strong",
31
+ "body-small",
32
+ "body-small-strong",
33
+ "body-large",
34
+ "body-large-strong",
35
+ "action",
36
+ "action-small",
37
+ "action-large"
38
+ ], r = [
39
+ "50",
40
+ "75",
41
+ "100",
42
+ "200",
43
+ "300",
44
+ "400",
45
+ "500",
46
+ "600",
47
+ "800",
48
+ "1000",
49
+ "1200",
50
+ "1400",
51
+ "1600"
52
+ ], i = [
53
+ "0",
54
+ "25",
55
+ "50",
56
+ "75",
57
+ "100",
58
+ "125",
59
+ "150",
60
+ "200",
61
+ "300",
62
+ "400",
63
+ "xs",
64
+ "sm",
65
+ "md",
66
+ "lg",
67
+ "xl",
68
+ "circle",
69
+ "pill"
70
+ ], a = [
71
+ "canvas",
72
+ "raising",
73
+ "floating",
74
+ "flying",
75
+ "soaring"
76
+ ], o = (e) => !!(/^[a-z]+-l\d+$/.test(e) || /^(?:canvas|surface|content|border|utility)-.+$/.test(e)), s = {
77
+ prefix: "uy",
78
+ extend: { classGroups: {
79
+ "bg-color": [{ bg: [e.isArbitraryValue, o] }],
80
+ "text-color": [{ text: [e.isArbitraryValue, o] }],
81
+ "border-color": [{ border: [e.isArbitraryValue, o] }],
82
+ "outline-color": [{ outline: [e.isArbitraryValue, o] }],
83
+ "ring-color": [{ ring: [e.isArbitraryValue, o] }],
84
+ "ring-offset-color": [{ "ring-offset": [e.isArbitraryValue, o] }],
85
+ "divide-color": [{ divide: [e.isArbitraryValue, o] }],
86
+ "text-decoration-color": [{ decoration: [e.isArbitraryValue, o] }],
87
+ "gradient-color-from": [{ from: [e.isArbitraryValue, o] }],
88
+ "gradient-color-via": [{ via: [e.isArbitraryValue, o] }],
89
+ "gradient-color-to": [{ to: [e.isArbitraryValue, o] }],
90
+ p: [{ p: t }],
91
+ px: [{ px: t }],
92
+ py: [{ py: t }],
93
+ ps: [{ ps: t }],
94
+ pe: [{ pe: t }],
95
+ pt: [{ pt: t }],
96
+ pr: [{ pr: t }],
97
+ pb: [{ pb: t }],
98
+ pl: [{ pl: t }],
99
+ m: [{ m: t }],
100
+ mx: [{ mx: t }],
101
+ my: [{ my: t }],
102
+ ms: [{ ms: t }],
103
+ me: [{ me: t }],
104
+ mt: [{ mt: t }],
105
+ mr: [{ mr: t }],
106
+ mb: [{ mb: t }],
107
+ ml: [{ ml: t }],
108
+ gap: [{ gap: t }],
109
+ "gap-x": [{ "gap-x": t }],
110
+ "gap-y": [{ "gap-y": t }],
111
+ "space-x": [{ "space-x": t }],
112
+ "space-y": [{ "space-y": t }],
113
+ "scroll-p": [{ "scroll-p": t }],
114
+ "scroll-px": [{ "scroll-px": t }],
115
+ "scroll-py": [{ "scroll-py": t }],
116
+ "scroll-ps": [{ "scroll-ps": t }],
117
+ "scroll-pe": [{ "scroll-pe": t }],
118
+ "scroll-pt": [{ "scroll-pt": t }],
119
+ "scroll-pr": [{ "scroll-pr": t }],
120
+ "scroll-pb": [{ "scroll-pb": t }],
121
+ "scroll-pl": [{ "scroll-pl": t }],
122
+ "scroll-m": [{ "scroll-m": t }],
123
+ "scroll-mx": [{ "scroll-mx": t }],
124
+ "scroll-my": [{ "scroll-my": t }],
125
+ "scroll-ms": [{ "scroll-ms": t }],
126
+ "scroll-me": [{ "scroll-me": t }],
127
+ "scroll-mt": [{ "scroll-mt": t }],
128
+ "scroll-mr": [{ "scroll-mr": t }],
129
+ "scroll-mb": [{ "scroll-mb": t }],
130
+ "scroll-ml": [{ "scroll-ml": t }],
131
+ typography: [{ typography: n }],
132
+ "font-size": [{ text: r }],
133
+ rounded: [{ rounded: i }],
134
+ "rounded-s": [{ "rounded-s": i }],
135
+ "rounded-e": [{ "rounded-e": i }],
136
+ "rounded-t": [{ "rounded-t": i }],
137
+ "rounded-r": [{ "rounded-r": i }],
138
+ "rounded-b": [{ "rounded-b": i }],
139
+ "rounded-l": [{ "rounded-l": i }],
140
+ "rounded-ss": [{ "rounded-ss": i }],
141
+ "rounded-se": [{ "rounded-se": i }],
142
+ "rounded-ee": [{ "rounded-ee": i }],
143
+ "rounded-es": [{ "rounded-es": i }],
144
+ "rounded-tl": [{ "rounded-tl": i }],
145
+ "rounded-tr": [{ "rounded-tr": i }],
146
+ "rounded-br": [{ "rounded-br": i }],
147
+ "rounded-bl": [{ "rounded-bl": i }],
148
+ shadow: [{ shadow: a }]
149
+ } }
172
150
  };
151
+ //#endregion
152
+ export { s as twMergeConfig };
@@ -1,8 +1,6 @@
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
- };
1
+ import { twMergeConfig as e } from "./merge-config.js";
2
+ import { createTailwindMerge as t, getDefaultConfig as n, mergeConfigs as r } from "tailwind-merge";
3
+ //#region src/utils/tailwind-merge.ts
4
+ var i = t(() => r(n(), e));
5
+ //#endregion
6
+ export { i as uyMerge };
@@ -1,9 +1,9 @@
1
- import { createTV as r } from "tailwind-variants";
2
1
  import { twMergeConfig as e } from "./merge-config.js";
3
- const m = r({
4
- twMerge: !0,
5
- twMergeConfig: e
2
+ import { createTV as t } from "tailwind-variants";
3
+ //#region src/utils/tailwind-variants.ts
4
+ var n = t({
5
+ twMerge: !0,
6
+ twMergeConfig: e
6
7
  });
7
- export {
8
- m as uyTv
9
- };
8
+ //#endregion
9
+ export { n as uyTv };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-themes",
3
- "version": "2.47.4",
3
+ "version": "2.47.6",
4
4
  "main": "./dist/esm/index.js",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "style": "./dist/css/unity.css",
@@ -51,7 +51,7 @@
51
51
  "@types/react": "18.3.18",
52
52
  "@types/react-dom": "18.3.5",
53
53
  "@types/tinycolor2": "1.4.6",
54
- "@vitest/browser": "4.1.0",
54
+ "@vitest/browser": "4.1.9",
55
55
  "msw": "2.14.6",
56
56
  "msw-storybook-addon": "2.0.7",
57
57
  "playwright": "1.55.1",
@@ -62,8 +62,8 @@
62
62
  "storybook": "10.4.4",
63
63
  "tsx": "4.20.5",
64
64
  "typescript": "6.0.3",
65
- "vite": "7.1.12",
66
- "vitest": "4.1.0",
65
+ "vite": "8.0.16",
66
+ "vitest": "4.1.9",
67
67
  "@payfit/hr-app-eslint": "0.0.0-use.local",
68
68
  "@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
69
69
  "@payfit/storybook-config": "0.0.0-use.local",