@spelyco/react-lib 0.0.1-29c05d1e-alpha → 0.0.1-515a989a-alpha

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.
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as _mantine_core from '@mantine/core';
2
+
1
3
  interface UseBooleanReturn {
2
4
  value: boolean;
3
5
  setTrue: () => void;
@@ -12,4 +14,146 @@ declare function useDebounce<T>(value: T, delay?: number): T;
12
14
  type ClassValue = string | undefined | null | false | ClassValue[];
13
15
  declare function cn(...inputs: ClassValue[]): string;
14
16
 
15
- export { cn, useBoolean, useDebounce };
17
+ declare const theme: (primaryColor?: string) => {
18
+ focusRing?: "auto" | "always" | "never" | undefined;
19
+ scale?: number | undefined;
20
+ fontSmoothing?: boolean | undefined;
21
+ white?: string | undefined;
22
+ black?: string | undefined;
23
+ colors?: {
24
+ [x: string & {}]: _mantine_core.MantineColorsTuple | undefined;
25
+ blue?: _mantine_core.MantineColorsTuple | undefined;
26
+ dark?: _mantine_core.MantineColorsTuple | undefined;
27
+ gray?: _mantine_core.MantineColorsTuple | undefined;
28
+ red?: _mantine_core.MantineColorsTuple | undefined;
29
+ pink?: _mantine_core.MantineColorsTuple | undefined;
30
+ grape?: _mantine_core.MantineColorsTuple | undefined;
31
+ violet?: _mantine_core.MantineColorsTuple | undefined;
32
+ indigo?: _mantine_core.MantineColorsTuple | undefined;
33
+ cyan?: _mantine_core.MantineColorsTuple | undefined;
34
+ green?: _mantine_core.MantineColorsTuple | undefined;
35
+ lime?: _mantine_core.MantineColorsTuple | undefined;
36
+ yellow?: _mantine_core.MantineColorsTuple | undefined;
37
+ orange?: _mantine_core.MantineColorsTuple | undefined;
38
+ teal?: _mantine_core.MantineColorsTuple | undefined;
39
+ } | undefined;
40
+ primaryShade?: _mantine_core.MantineColorShade | {
41
+ light?: _mantine_core.MantineColorShade | undefined;
42
+ dark?: _mantine_core.MantineColorShade | undefined;
43
+ } | undefined;
44
+ primaryColor?: string | undefined;
45
+ variantColorResolver?: _mantine_core.VariantColorsResolver | undefined;
46
+ autoContrast?: boolean | undefined;
47
+ luminanceThreshold?: number | undefined;
48
+ fontFamily?: string | undefined;
49
+ fontFamilyMonospace?: string | undefined;
50
+ headings?: {
51
+ fontFamily?: string | undefined;
52
+ fontWeight?: string | undefined;
53
+ textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
54
+ sizes?: {
55
+ h1?: {
56
+ fontSize?: string | undefined;
57
+ fontWeight?: string | undefined;
58
+ lineHeight?: string | undefined;
59
+ } | undefined;
60
+ h2?: {
61
+ fontSize?: string | undefined;
62
+ fontWeight?: string | undefined;
63
+ lineHeight?: string | undefined;
64
+ } | undefined;
65
+ h3?: {
66
+ fontSize?: string | undefined;
67
+ fontWeight?: string | undefined;
68
+ lineHeight?: string | undefined;
69
+ } | undefined;
70
+ h4?: {
71
+ fontSize?: string | undefined;
72
+ fontWeight?: string | undefined;
73
+ lineHeight?: string | undefined;
74
+ } | undefined;
75
+ h5?: {
76
+ fontSize?: string | undefined;
77
+ fontWeight?: string | undefined;
78
+ lineHeight?: string | undefined;
79
+ } | undefined;
80
+ h6?: {
81
+ fontSize?: string | undefined;
82
+ fontWeight?: string | undefined;
83
+ lineHeight?: string | undefined;
84
+ } | undefined;
85
+ } | undefined;
86
+ } | undefined;
87
+ radius?: {
88
+ [x: string & {}]: string | undefined;
89
+ md?: string | undefined;
90
+ xs?: string | undefined;
91
+ sm?: string | undefined;
92
+ lg?: string | undefined;
93
+ xl?: string | undefined;
94
+ } | undefined;
95
+ defaultRadius?: _mantine_core.MantineRadius | undefined;
96
+ spacing?: {
97
+ [x: number]: string | undefined;
98
+ [x: string & {}]: string | undefined;
99
+ md?: string | undefined;
100
+ xs?: string | undefined;
101
+ sm?: string | undefined;
102
+ lg?: string | undefined;
103
+ xl?: string | undefined;
104
+ } | undefined;
105
+ fontSizes?: {
106
+ [x: string & {}]: string | undefined;
107
+ md?: string | undefined;
108
+ xs?: string | undefined;
109
+ sm?: string | undefined;
110
+ lg?: string | undefined;
111
+ xl?: string | undefined;
112
+ } | undefined;
113
+ lineHeights?: {
114
+ [x: string & {}]: string | undefined;
115
+ md?: string | undefined;
116
+ xs?: string | undefined;
117
+ sm?: string | undefined;
118
+ lg?: string | undefined;
119
+ xl?: string | undefined;
120
+ } | undefined;
121
+ breakpoints?: {
122
+ [x: string & {}]: string | undefined;
123
+ md?: string | undefined;
124
+ xs?: string | undefined;
125
+ sm?: string | undefined;
126
+ lg?: string | undefined;
127
+ xl?: string | undefined;
128
+ } | undefined;
129
+ shadows?: {
130
+ [x: string & {}]: string | undefined;
131
+ md?: string | undefined;
132
+ xs?: string | undefined;
133
+ sm?: string | undefined;
134
+ lg?: string | undefined;
135
+ xl?: string | undefined;
136
+ } | undefined;
137
+ respectReducedMotion?: boolean | undefined;
138
+ cursorType?: "default" | "pointer" | undefined;
139
+ defaultGradient?: {
140
+ from?: string | undefined;
141
+ to?: string | undefined;
142
+ deg?: number | undefined;
143
+ } | undefined;
144
+ activeClassName?: string | undefined;
145
+ focusClassName?: string | undefined;
146
+ components?: {
147
+ [x: string]: {
148
+ classNames?: any;
149
+ styles?: any;
150
+ vars?: any;
151
+ defaultProps?: any;
152
+ } | undefined;
153
+ } | undefined;
154
+ other?: {
155
+ [x: string]: any;
156
+ } | undefined;
157
+ };
158
+
159
+ export { cn, theme, useBoolean, useDebounce };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as _mantine_core from '@mantine/core';
2
+
1
3
  interface UseBooleanReturn {
2
4
  value: boolean;
3
5
  setTrue: () => void;
@@ -12,4 +14,146 @@ declare function useDebounce<T>(value: T, delay?: number): T;
12
14
  type ClassValue = string | undefined | null | false | ClassValue[];
13
15
  declare function cn(...inputs: ClassValue[]): string;
14
16
 
15
- export { cn, useBoolean, useDebounce };
17
+ declare const theme: (primaryColor?: string) => {
18
+ focusRing?: "auto" | "always" | "never" | undefined;
19
+ scale?: number | undefined;
20
+ fontSmoothing?: boolean | undefined;
21
+ white?: string | undefined;
22
+ black?: string | undefined;
23
+ colors?: {
24
+ [x: string & {}]: _mantine_core.MantineColorsTuple | undefined;
25
+ blue?: _mantine_core.MantineColorsTuple | undefined;
26
+ dark?: _mantine_core.MantineColorsTuple | undefined;
27
+ gray?: _mantine_core.MantineColorsTuple | undefined;
28
+ red?: _mantine_core.MantineColorsTuple | undefined;
29
+ pink?: _mantine_core.MantineColorsTuple | undefined;
30
+ grape?: _mantine_core.MantineColorsTuple | undefined;
31
+ violet?: _mantine_core.MantineColorsTuple | undefined;
32
+ indigo?: _mantine_core.MantineColorsTuple | undefined;
33
+ cyan?: _mantine_core.MantineColorsTuple | undefined;
34
+ green?: _mantine_core.MantineColorsTuple | undefined;
35
+ lime?: _mantine_core.MantineColorsTuple | undefined;
36
+ yellow?: _mantine_core.MantineColorsTuple | undefined;
37
+ orange?: _mantine_core.MantineColorsTuple | undefined;
38
+ teal?: _mantine_core.MantineColorsTuple | undefined;
39
+ } | undefined;
40
+ primaryShade?: _mantine_core.MantineColorShade | {
41
+ light?: _mantine_core.MantineColorShade | undefined;
42
+ dark?: _mantine_core.MantineColorShade | undefined;
43
+ } | undefined;
44
+ primaryColor?: string | undefined;
45
+ variantColorResolver?: _mantine_core.VariantColorsResolver | undefined;
46
+ autoContrast?: boolean | undefined;
47
+ luminanceThreshold?: number | undefined;
48
+ fontFamily?: string | undefined;
49
+ fontFamilyMonospace?: string | undefined;
50
+ headings?: {
51
+ fontFamily?: string | undefined;
52
+ fontWeight?: string | undefined;
53
+ textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
54
+ sizes?: {
55
+ h1?: {
56
+ fontSize?: string | undefined;
57
+ fontWeight?: string | undefined;
58
+ lineHeight?: string | undefined;
59
+ } | undefined;
60
+ h2?: {
61
+ fontSize?: string | undefined;
62
+ fontWeight?: string | undefined;
63
+ lineHeight?: string | undefined;
64
+ } | undefined;
65
+ h3?: {
66
+ fontSize?: string | undefined;
67
+ fontWeight?: string | undefined;
68
+ lineHeight?: string | undefined;
69
+ } | undefined;
70
+ h4?: {
71
+ fontSize?: string | undefined;
72
+ fontWeight?: string | undefined;
73
+ lineHeight?: string | undefined;
74
+ } | undefined;
75
+ h5?: {
76
+ fontSize?: string | undefined;
77
+ fontWeight?: string | undefined;
78
+ lineHeight?: string | undefined;
79
+ } | undefined;
80
+ h6?: {
81
+ fontSize?: string | undefined;
82
+ fontWeight?: string | undefined;
83
+ lineHeight?: string | undefined;
84
+ } | undefined;
85
+ } | undefined;
86
+ } | undefined;
87
+ radius?: {
88
+ [x: string & {}]: string | undefined;
89
+ md?: string | undefined;
90
+ xs?: string | undefined;
91
+ sm?: string | undefined;
92
+ lg?: string | undefined;
93
+ xl?: string | undefined;
94
+ } | undefined;
95
+ defaultRadius?: _mantine_core.MantineRadius | undefined;
96
+ spacing?: {
97
+ [x: number]: string | undefined;
98
+ [x: string & {}]: string | undefined;
99
+ md?: string | undefined;
100
+ xs?: string | undefined;
101
+ sm?: string | undefined;
102
+ lg?: string | undefined;
103
+ xl?: string | undefined;
104
+ } | undefined;
105
+ fontSizes?: {
106
+ [x: string & {}]: string | undefined;
107
+ md?: string | undefined;
108
+ xs?: string | undefined;
109
+ sm?: string | undefined;
110
+ lg?: string | undefined;
111
+ xl?: string | undefined;
112
+ } | undefined;
113
+ lineHeights?: {
114
+ [x: string & {}]: string | undefined;
115
+ md?: string | undefined;
116
+ xs?: string | undefined;
117
+ sm?: string | undefined;
118
+ lg?: string | undefined;
119
+ xl?: string | undefined;
120
+ } | undefined;
121
+ breakpoints?: {
122
+ [x: string & {}]: string | undefined;
123
+ md?: string | undefined;
124
+ xs?: string | undefined;
125
+ sm?: string | undefined;
126
+ lg?: string | undefined;
127
+ xl?: string | undefined;
128
+ } | undefined;
129
+ shadows?: {
130
+ [x: string & {}]: string | undefined;
131
+ md?: string | undefined;
132
+ xs?: string | undefined;
133
+ sm?: string | undefined;
134
+ lg?: string | undefined;
135
+ xl?: string | undefined;
136
+ } | undefined;
137
+ respectReducedMotion?: boolean | undefined;
138
+ cursorType?: "default" | "pointer" | undefined;
139
+ defaultGradient?: {
140
+ from?: string | undefined;
141
+ to?: string | undefined;
142
+ deg?: number | undefined;
143
+ } | undefined;
144
+ activeClassName?: string | undefined;
145
+ focusClassName?: string | undefined;
146
+ components?: {
147
+ [x: string]: {
148
+ classNames?: any;
149
+ styles?: any;
150
+ vars?: any;
151
+ defaultProps?: any;
152
+ } | undefined;
153
+ } | undefined;
154
+ other?: {
155
+ [x: string]: any;
156
+ } | undefined;
157
+ };
158
+
159
+ export { cn, theme, useBoolean, useDebounce };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var react = require('react');
4
+ var core = require('@mantine/core');
4
5
 
5
6
  // src/hooks/useBoolean.ts
6
7
  function useBoolean(initialValue = false) {
@@ -23,8 +24,20 @@ function useDebounce(value, delay = 300) {
23
24
  function cn(...inputs) {
24
25
  return inputs.flat(Infinity).filter(Boolean).join(" ");
25
26
  }
27
+ var theme = (primaryColor) => core.createTheme({
28
+ primaryColor: primaryColor ?? "blue",
29
+ defaultRadius: "md",
30
+ components: {
31
+ Button: core.Button.extend({
32
+ defaultProps: {
33
+ variant: "default"
34
+ }
35
+ })
36
+ }
37
+ });
26
38
 
27
39
  exports.cn = cn;
40
+ exports.theme = theme;
28
41
  exports.useBoolean = useBoolean;
29
42
  exports.useDebounce = useDebounce;
30
43
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useBoolean.ts","../src/hooks/useDebounce.ts","../src/utils/cn.ts"],"names":["useState","useCallback","useEffect"],"mappings":";;;;;AAUO,SAAS,UAAA,CAAW,eAAe,KAAA,EAAyB;AACjE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIA,eAAS,YAAY,CAAA;AAE/C,EAAA,MAAM,UAAUC,iBAAA,CAAY,MAAM,SAAS,IAAI,CAAA,EAAG,EAAE,CAAA;AACpD,EAAA,MAAM,WAAWA,iBAAA,CAAY,MAAM,SAAS,KAAK,CAAA,EAAG,EAAE,CAAA;AACtD,EAAA,MAAM,MAAA,GAASA,iBAAA,CAAY,MAAM,QAAA,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA,EAAG,EAAE,CAAA;AAExD,EAAA,OAAO,EAAE,KAAA,EAAO,OAAA,EAAS,QAAA,EAAU,QAAQ,QAAA,EAAS;AACtD;AChBO,SAAS,WAAA,CAAe,KAAA,EAAU,KAAA,GAAQ,GAAA,EAAQ;AACvD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAID,eAAY,KAAK,CAAA;AAE7D,EAAAE,eAAA,CAAU,MAAM;AACd,IAAA,MAAM,QAAQ,UAAA,CAAW,MAAM,iBAAA,CAAkB,KAAK,GAAG,KAAK,CAAA;AAC9D,IAAA,OAAO,MAAM,aAAa,KAAK,CAAA;AAAA,EACjC,CAAA,EAAG,CAAC,KAAA,EAAO,KAAK,CAAC,CAAA;AAEjB,EAAA,OAAO,cAAA;AACT;;;ACTO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,MAAA,CACJ,KAAK,QAAa,CAAA,CAClB,OAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AACb","file":"index.js","sourcesContent":["import { useCallback, useState } from \"react\";\n\nexport interface UseBooleanReturn {\n value: boolean;\n setTrue: () => void;\n setFalse: () => void;\n toggle: () => void;\n setValue: (value: boolean) => void;\n}\n\nexport function useBoolean(initialValue = false): UseBooleanReturn {\n const [value, setValue] = useState(initialValue);\n\n const setTrue = useCallback(() => setValue(true), []);\n const setFalse = useCallback(() => setValue(false), []);\n const toggle = useCallback(() => setValue((v) => !v), []);\n\n return { value, setTrue, setFalse, toggle, setValue };\n}\n","import { useEffect, useState } from \"react\";\n\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay);\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","type ClassValue = string | undefined | null | false | ClassValue[];\n\nexport function cn(...inputs: ClassValue[]): string {\n return inputs\n .flat(Infinity as 1)\n .filter(Boolean)\n .join(\" \");\n}\n"]}
1
+ {"version":3,"sources":["../src/hooks/useBoolean.ts","../src/hooks/useDebounce.ts","../src/utils/cn.ts","../src/utils/theme.ts"],"names":["useState","useCallback","useEffect","createTheme","Button"],"mappings":";;;;;;AAUO,SAAS,UAAA,CAAW,eAAe,KAAA,EAAyB;AACjE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIA,eAAS,YAAY,CAAA;AAE/C,EAAA,MAAM,UAAUC,iBAAA,CAAY,MAAM,SAAS,IAAI,CAAA,EAAG,EAAE,CAAA;AACpD,EAAA,MAAM,WAAWA,iBAAA,CAAY,MAAM,SAAS,KAAK,CAAA,EAAG,EAAE,CAAA;AACtD,EAAA,MAAM,MAAA,GAASA,iBAAA,CAAY,MAAM,QAAA,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA,EAAG,EAAE,CAAA;AAExD,EAAA,OAAO,EAAE,KAAA,EAAO,OAAA,EAAS,QAAA,EAAU,QAAQ,QAAA,EAAS;AACtD;AChBO,SAAS,WAAA,CAAe,KAAA,EAAU,KAAA,GAAQ,GAAA,EAAQ;AACvD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAID,eAAY,KAAK,CAAA;AAE7D,EAAAE,eAAA,CAAU,MAAM;AACd,IAAA,MAAM,QAAQ,UAAA,CAAW,MAAM,iBAAA,CAAkB,KAAK,GAAG,KAAK,CAAA;AAC9D,IAAA,OAAO,MAAM,aAAa,KAAK,CAAA;AAAA,EACjC,CAAA,EAAG,CAAC,KAAA,EAAO,KAAK,CAAC,CAAA;AAEjB,EAAA,OAAO,cAAA;AACT;;;ACTO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,MAAA,CACJ,KAAK,QAAa,CAAA,CAClB,OAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AACb;ACLO,IAAM,KAAA,GAAQ,CAAC,YAAA,KACpBC,gBAAA,CAAY;AAAA,EACV,cAAc,YAAA,IAAgB,MAAA;AAAA,EAC9B,aAAA,EAAe,IAAA;AAAA,EACf,UAAA,EAAY;AAAA,IACV,MAAA,EAAQC,YAAO,MAAA,CAAO;AAAA,MACpB,YAAA,EAAc;AAAA,QACZ,OAAA,EAAS;AAAA;AACX,KACD;AAAA;AAEL,CAAC","file":"index.js","sourcesContent":["import { useCallback, useState } from \"react\";\n\nexport interface UseBooleanReturn {\n value: boolean;\n setTrue: () => void;\n setFalse: () => void;\n toggle: () => void;\n setValue: (value: boolean) => void;\n}\n\nexport function useBoolean(initialValue = false): UseBooleanReturn {\n const [value, setValue] = useState(initialValue);\n\n const setTrue = useCallback(() => setValue(true), []);\n const setFalse = useCallback(() => setValue(false), []);\n const toggle = useCallback(() => setValue((v) => !v), []);\n\n return { value, setTrue, setFalse, toggle, setValue };\n}\n","import { useEffect, useState } from \"react\";\n\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay);\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","type ClassValue = string | undefined | null | false | ClassValue[];\n\nexport function cn(...inputs: ClassValue[]): string {\n return inputs\n .flat(Infinity as 1)\n .filter(Boolean)\n .join(\" \");\n}\n","import { Button, createTheme } from \"@mantine/core\";\n\nexport const theme = (primaryColor?: string) =>\n createTheme({\n primaryColor: primaryColor ?? \"blue\",\n defaultRadius: \"md\",\n components: {\n Button: Button.extend({\n defaultProps: {\n variant: \"default\",\n },\n }),\n },\n });\n"]}
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useState, useCallback, useEffect } from 'react';
2
+ import { createTheme, Button } from '@mantine/core';
2
3
 
3
4
  // src/hooks/useBoolean.ts
4
5
  function useBoolean(initialValue = false) {
@@ -21,7 +22,18 @@ function useDebounce(value, delay = 300) {
21
22
  function cn(...inputs) {
22
23
  return inputs.flat(Infinity).filter(Boolean).join(" ");
23
24
  }
25
+ var theme = (primaryColor) => createTheme({
26
+ primaryColor: primaryColor ?? "blue",
27
+ defaultRadius: "md",
28
+ components: {
29
+ Button: Button.extend({
30
+ defaultProps: {
31
+ variant: "default"
32
+ }
33
+ })
34
+ }
35
+ });
24
36
 
25
- export { cn, useBoolean, useDebounce };
37
+ export { cn, theme, useBoolean, useDebounce };
26
38
  //# sourceMappingURL=index.mjs.map
27
39
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useBoolean.ts","../src/hooks/useDebounce.ts","../src/utils/cn.ts"],"names":["useState"],"mappings":";;;AAUO,SAAS,UAAA,CAAW,eAAe,KAAA,EAAyB;AACjE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,YAAY,CAAA;AAE/C,EAAA,MAAM,UAAU,WAAA,CAAY,MAAM,SAAS,IAAI,CAAA,EAAG,EAAE,CAAA;AACpD,EAAA,MAAM,WAAW,WAAA,CAAY,MAAM,SAAS,KAAK,CAAA,EAAG,EAAE,CAAA;AACtD,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,MAAM,QAAA,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA,EAAG,EAAE,CAAA;AAExD,EAAA,OAAO,EAAE,KAAA,EAAO,OAAA,EAAS,QAAA,EAAU,QAAQ,QAAA,EAAS;AACtD;AChBO,SAAS,WAAA,CAAe,KAAA,EAAU,KAAA,GAAQ,GAAA,EAAQ;AACvD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIA,SAAY,KAAK,CAAA;AAE7D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,QAAQ,UAAA,CAAW,MAAM,iBAAA,CAAkB,KAAK,GAAG,KAAK,CAAA;AAC9D,IAAA,OAAO,MAAM,aAAa,KAAK,CAAA;AAAA,EACjC,CAAA,EAAG,CAAC,KAAA,EAAO,KAAK,CAAC,CAAA;AAEjB,EAAA,OAAO,cAAA;AACT;;;ACTO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,MAAA,CACJ,KAAK,QAAa,CAAA,CAClB,OAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AACb","file":"index.mjs","sourcesContent":["import { useCallback, useState } from \"react\";\n\nexport interface UseBooleanReturn {\n value: boolean;\n setTrue: () => void;\n setFalse: () => void;\n toggle: () => void;\n setValue: (value: boolean) => void;\n}\n\nexport function useBoolean(initialValue = false): UseBooleanReturn {\n const [value, setValue] = useState(initialValue);\n\n const setTrue = useCallback(() => setValue(true), []);\n const setFalse = useCallback(() => setValue(false), []);\n const toggle = useCallback(() => setValue((v) => !v), []);\n\n return { value, setTrue, setFalse, toggle, setValue };\n}\n","import { useEffect, useState } from \"react\";\n\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay);\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","type ClassValue = string | undefined | null | false | ClassValue[];\n\nexport function cn(...inputs: ClassValue[]): string {\n return inputs\n .flat(Infinity as 1)\n .filter(Boolean)\n .join(\" \");\n}\n"]}
1
+ {"version":3,"sources":["../src/hooks/useBoolean.ts","../src/hooks/useDebounce.ts","../src/utils/cn.ts","../src/utils/theme.ts"],"names":["useState"],"mappings":";;;;AAUO,SAAS,UAAA,CAAW,eAAe,KAAA,EAAyB;AACjE,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,YAAY,CAAA;AAE/C,EAAA,MAAM,UAAU,WAAA,CAAY,MAAM,SAAS,IAAI,CAAA,EAAG,EAAE,CAAA;AACpD,EAAA,MAAM,WAAW,WAAA,CAAY,MAAM,SAAS,KAAK,CAAA,EAAG,EAAE,CAAA;AACtD,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,MAAM,QAAA,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA,EAAG,EAAE,CAAA;AAExD,EAAA,OAAO,EAAE,KAAA,EAAO,OAAA,EAAS,QAAA,EAAU,QAAQ,QAAA,EAAS;AACtD;AChBO,SAAS,WAAA,CAAe,KAAA,EAAU,KAAA,GAAQ,GAAA,EAAQ;AACvD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIA,SAAY,KAAK,CAAA;AAE7D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,QAAQ,UAAA,CAAW,MAAM,iBAAA,CAAkB,KAAK,GAAG,KAAK,CAAA;AAC9D,IAAA,OAAO,MAAM,aAAa,KAAK,CAAA;AAAA,EACjC,CAAA,EAAG,CAAC,KAAA,EAAO,KAAK,CAAC,CAAA;AAEjB,EAAA,OAAO,cAAA;AACT;;;ACTO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,MAAA,CACJ,KAAK,QAAa,CAAA,CAClB,OAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AACb;ACLO,IAAM,KAAA,GAAQ,CAAC,YAAA,KACpB,WAAA,CAAY;AAAA,EACV,cAAc,YAAA,IAAgB,MAAA;AAAA,EAC9B,aAAA,EAAe,IAAA;AAAA,EACf,UAAA,EAAY;AAAA,IACV,MAAA,EAAQ,OAAO,MAAA,CAAO;AAAA,MACpB,YAAA,EAAc;AAAA,QACZ,OAAA,EAAS;AAAA;AACX,KACD;AAAA;AAEL,CAAC","file":"index.mjs","sourcesContent":["import { useCallback, useState } from \"react\";\n\nexport interface UseBooleanReturn {\n value: boolean;\n setTrue: () => void;\n setFalse: () => void;\n toggle: () => void;\n setValue: (value: boolean) => void;\n}\n\nexport function useBoolean(initialValue = false): UseBooleanReturn {\n const [value, setValue] = useState(initialValue);\n\n const setTrue = useCallback(() => setValue(true), []);\n const setFalse = useCallback(() => setValue(false), []);\n const toggle = useCallback(() => setValue((v) => !v), []);\n\n return { value, setTrue, setFalse, toggle, setValue };\n}\n","import { useEffect, useState } from \"react\";\n\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => setDebouncedValue(value), delay);\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","type ClassValue = string | undefined | null | false | ClassValue[];\n\nexport function cn(...inputs: ClassValue[]): string {\n return inputs\n .flat(Infinity as 1)\n .filter(Boolean)\n .join(\" \");\n}\n","import { Button, createTheme } from \"@mantine/core\";\n\nexport const theme = (primaryColor?: string) =>\n createTheme({\n primaryColor: primaryColor ?? \"blue\",\n defaultRadius: \"md\",\n components: {\n Button: Button.extend({\n defaultProps: {\n variant: \"default\",\n },\n }),\n },\n });\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spelyco/react-lib",
3
- "version": "0.0.1-29c05d1e-alpha",
3
+ "version": "0.0.1-515a989a-alpha",
4
4
  "description": "Shared React hooks and utilities for Spelyco UI packages",
5
5
  "keywords": [
6
6
  "react",
@@ -32,9 +32,11 @@
32
32
  "clean": "rm -rf dist"
33
33
  },
34
34
  "peerDependencies": {
35
+ "@mantine/core": ">=8",
35
36
  "react": ">=18"
36
37
  },
37
38
  "devDependencies": {
39
+ "@mantine/core": "^8.3.18",
38
40
  "@spelyco/tsconfig": "*",
39
41
  "@testing-library/react": "^16.1.0",
40
42
  "@types/react": "^19.2.14",