@caspeco/casper-ui-library 6.0.0 → 7.0.0
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/components/alert/alert.js +25 -25
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/button/types.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.js +57 -57
- package/dist/components/combobox/combobox-menu.d.ts.map +1 -1
- package/dist/components/combobox/combobox-menu.js +58 -56
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +34 -34
- package/dist/components/combobox/types.d.ts +2 -2
- package/dist/components/combobox/types.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/base-date-picker.js +129 -129
- package/dist/components/date-picker/types.d.ts +3 -2
- package/dist/components/date-picker/types.d.ts.map +1 -1
- package/dist/components/drawer/use-drawer-key-down.js +8 -6
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +13 -12
- package/dist/components/icon-button/icon-button.d.ts +1 -1
- package/dist/components/icon-button/types.d.ts +3 -2
- package/dist/components/icon-button/types.d.ts.map +1 -1
- package/dist/components/image-upload/image-cropper.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-dropzone.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-dropzone.js +24 -24
- package/dist/components/image-upload/image-upload-modal.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-modal.js +61 -58
- package/dist/components/menu/menu-item.d.ts +2 -1
- package/dist/components/menu/menu-item.d.ts.map +1 -1
- package/dist/components/menu/menu.composition.d.ts.map +1 -1
- package/dist/components/modal/modal-footer.d.ts.map +1 -1
- package/dist/components/modal/modal-footer.js +16 -13
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/table-cell.js +18 -18
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +21 -19
- package/dist/components/table/table-context-provider.d.ts +8 -4
- package/dist/components/table/table-context-provider.d.ts.map +1 -1
- package/dist/components/table/table-context-provider.js +96 -94
- package/dist/components/table/table-filter.d.ts +27 -0
- package/dist/components/table/table-filter.d.ts.map +1 -0
- package/dist/components/table/table-filter.js +140 -0
- package/dist/components/table/table-filter.spec.d.ts +2 -0
- package/dist/components/table/table-filter.spec.d.ts.map +1 -0
- package/dist/components/table/table-header-dropdown.d.ts +1 -1
- package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
- package/dist/components/table/table-header-dropdown.js +71 -59
- package/dist/components/table/table-row.js +40 -40
- package/dist/components/table/table-toolbar.d.ts.map +1 -1
- package/dist/components/table/table-toolbar.js +111 -81
- package/dist/components/table/table.composition.d.ts +1 -1
- package/dist/components/table/table.composition.d.ts.map +1 -1
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +22 -24
- package/dist/components/table/translations.d.ts +10 -0
- package/dist/components/table/translations.d.ts.map +1 -1
- package/dist/components/table/translations.js +17 -9
- package/dist/components/table/types.d.ts +1 -5
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/components/tabs/tabs.composition.d.ts +1 -1
- package/dist/index.js +168 -165
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/theme-config/components/button-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/button-theme.js +35 -20
- package/dist/theme/theme-context.d.ts +10 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +11 -0
- package/dist/theme/theme-provider-context.composition.d.ts.map +1 -1
- package/dist/theme/theme-provider.d.ts +0 -8
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +21 -27
- package/package.json +16 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineStyleConfig as i } from "@chakra-ui/react";
|
|
2
|
-
import { isTouchScreenDevice as
|
|
2
|
+
import { isTouchScreenDevice as r } from "../../theme-helper.js";
|
|
3
3
|
import { ThemeColorToken as o, ThemeBorderToken as a, ThemeRadiusToken as d, ThemeFontToken as t, ThemeFontSizeToken as c } from "../theme-tokens.js";
|
|
4
4
|
const l = {
|
|
5
5
|
fontFamily: t.SubHeader,
|
|
@@ -21,7 +21,7 @@ const l = {
|
|
|
21
21
|
background: o.Accent,
|
|
22
22
|
color: o.OnAccent,
|
|
23
23
|
_hover: {
|
|
24
|
-
background:
|
|
24
|
+
background: r() ? o.Accent : o.AccentHover,
|
|
25
25
|
_disabled: {
|
|
26
26
|
background: o.Accent,
|
|
27
27
|
color: o.OnAccent
|
|
@@ -31,12 +31,12 @@ const l = {
|
|
|
31
31
|
background: o.AccentActive,
|
|
32
32
|
color: o.OnAccent
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, b = {
|
|
35
35
|
background: o.AccentContainer,
|
|
36
36
|
color: o.OnAccentContainer,
|
|
37
37
|
_hover: {
|
|
38
|
-
background:
|
|
39
|
-
color:
|
|
38
|
+
background: r() ? o.AccentContainer : o.AccentHover,
|
|
39
|
+
color: r() ? o.OnAccentContainer : o.OnAccent,
|
|
40
40
|
_disabled: {
|
|
41
41
|
background: o.AccentContainer,
|
|
42
42
|
color: o.OnAccentContainer
|
|
@@ -46,18 +46,32 @@ const l = {
|
|
|
46
46
|
background: o.AccentActive,
|
|
47
47
|
color: o.OnAccent
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, g = {
|
|
50
50
|
color: o.OnBackground,
|
|
51
51
|
fontWeight: "medium",
|
|
52
52
|
_hover: {
|
|
53
53
|
color: o.OnBackground,
|
|
54
|
-
bg:
|
|
54
|
+
bg: r() ? "none" : o.AccentHoverAlpha,
|
|
55
55
|
textDecoration: "none"
|
|
56
56
|
},
|
|
57
57
|
_active: {
|
|
58
58
|
bg: o.AccentActiveAlpha,
|
|
59
59
|
color: o.OnBackground
|
|
60
60
|
}
|
|
61
|
+
}, A = {
|
|
62
|
+
background: o.Error,
|
|
63
|
+
color: o.OnAccent,
|
|
64
|
+
_hover: {
|
|
65
|
+
background: r() ? o.Error : o.ErrorHover,
|
|
66
|
+
_disabled: {
|
|
67
|
+
background: o.Error,
|
|
68
|
+
color: o.OnAccent
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
_active: {
|
|
72
|
+
background: o.ErrorActive,
|
|
73
|
+
color: o.OnAccent
|
|
74
|
+
}
|
|
61
75
|
}, s = {
|
|
62
76
|
color: o.OnBackground,
|
|
63
77
|
fontFamily: t.Body,
|
|
@@ -69,7 +83,7 @@ const l = {
|
|
|
69
83
|
width: "fit-content",
|
|
70
84
|
border: 0,
|
|
71
85
|
_hover: {
|
|
72
|
-
color:
|
|
86
|
+
color: r() ? o.OnBackground : o.AccentHover
|
|
73
87
|
},
|
|
74
88
|
_active: {
|
|
75
89
|
color: o.AccentActive,
|
|
@@ -78,7 +92,7 @@ const l = {
|
|
|
78
92
|
_disabled: {
|
|
79
93
|
textDecoration: "none"
|
|
80
94
|
}
|
|
81
|
-
},
|
|
95
|
+
}, v = {
|
|
82
96
|
flex: "1",
|
|
83
97
|
fontWeight: "normal",
|
|
84
98
|
font: t.Body,
|
|
@@ -108,7 +122,7 @@ const l = {
|
|
|
108
122
|
bg: o.AccentHoverAlpha,
|
|
109
123
|
color: o.OnAccentContainer
|
|
110
124
|
}
|
|
111
|
-
},
|
|
125
|
+
}, k = {
|
|
112
126
|
background: "transparent",
|
|
113
127
|
color: o.OnBackground,
|
|
114
128
|
borderColor: o.OnBackgroundBorder,
|
|
@@ -134,13 +148,13 @@ const l = {
|
|
|
134
148
|
}
|
|
135
149
|
}
|
|
136
150
|
}
|
|
137
|
-
},
|
|
151
|
+
}, e = '&[aria-pressed="true"]', n = '&[aria-pressed="false"]', h = {
|
|
138
152
|
// Base style
|
|
139
153
|
borderRadius: d.Small,
|
|
140
154
|
borderWidth: a.XSmall,
|
|
141
155
|
borderColor: o.OnSurfaceBorder,
|
|
142
156
|
// Pressed state
|
|
143
|
-
[`${
|
|
157
|
+
[`${e}`]: {
|
|
144
158
|
background: o.Accent,
|
|
145
159
|
color: o.OnAccent
|
|
146
160
|
},
|
|
@@ -151,7 +165,7 @@ const l = {
|
|
|
151
165
|
},
|
|
152
166
|
// Hover styles
|
|
153
167
|
"@media(hover: hover)": {
|
|
154
|
-
[`${
|
|
168
|
+
[`${e}&:hover`]: {
|
|
155
169
|
background: o.AccentHover,
|
|
156
170
|
borderColor: o.AccentHover,
|
|
157
171
|
_disabled: {
|
|
@@ -169,7 +183,7 @@ const l = {
|
|
|
169
183
|
}
|
|
170
184
|
},
|
|
171
185
|
// Active styles
|
|
172
|
-
[`${
|
|
186
|
+
[`${e}:active`]: {
|
|
173
187
|
color: o.OnAccent,
|
|
174
188
|
background: o.AccentActive
|
|
175
189
|
},
|
|
@@ -178,7 +192,7 @@ const l = {
|
|
|
178
192
|
background: o.AccentActiveAlpha
|
|
179
193
|
},
|
|
180
194
|
// Define general disabled styles last to ensure they are not overridden
|
|
181
|
-
[`${
|
|
195
|
+
[`${e}:disabled`]: {
|
|
182
196
|
color: o.OnAccent,
|
|
183
197
|
background: o.Accent,
|
|
184
198
|
borderColor: o.Accent
|
|
@@ -211,12 +225,13 @@ const l = {
|
|
|
211
225
|
},
|
|
212
226
|
variants: {
|
|
213
227
|
primary: u,
|
|
214
|
-
secondary:
|
|
215
|
-
ghost:
|
|
228
|
+
secondary: b,
|
|
229
|
+
ghost: g,
|
|
216
230
|
link: s,
|
|
217
|
-
segmentedControl:
|
|
218
|
-
tertiary:
|
|
219
|
-
toggle:
|
|
231
|
+
segmentedControl: v,
|
|
232
|
+
tertiary: k,
|
|
233
|
+
toggle: h,
|
|
234
|
+
alert: A
|
|
220
235
|
}
|
|
221
236
|
});
|
|
222
237
|
export {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ThemeColorValues, ThemeFontValues, GlobalStyles } from './theme-types.js';
|
|
2
|
+
type ThemeProviderContextType = {
|
|
3
|
+
colors: ThemeColorValues;
|
|
4
|
+
fonts: ThemeFontValues;
|
|
5
|
+
fontStyleSheet: string;
|
|
6
|
+
globalStyles: GlobalStyles;
|
|
7
|
+
};
|
|
8
|
+
export declare const ThemeProviderContext: import('react').Context<ThemeProviderContextType>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=theme-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-context.d.ts","sourceRoot":"","sources":["../../lib/theme/theme-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAErF,KAAK,wBAAwB,GAAG;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,mDAK/B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext as o } from "react";
|
|
2
|
+
import { casperUITheme as e } from "./theme-config/theme-casper-ui.js";
|
|
3
|
+
const l = o({
|
|
4
|
+
colors: e.colors,
|
|
5
|
+
fonts: e.fonts,
|
|
6
|
+
fontStyleSheet: e.fontStyleSheet,
|
|
7
|
+
globalStyles: e.globalStyles
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
l as ThemeProviderContext
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider-context.composition.d.ts","sourceRoot":"","sources":["../../lib/theme/theme-provider-context.composition.tsx"],"names":[],"mappings":"AAaA,wBAAgB,MAAM,4CA8BrB;AAED,wBAAgB,KAAK,
|
|
1
|
+
{"version":3,"file":"theme-provider-context.composition.d.ts","sourceRoot":"","sources":["../../lib/theme/theme-provider-context.composition.tsx"],"names":[],"mappings":"AAaA,wBAAgB,MAAM,4CA8BrB;AAED,wBAAgB,KAAK,4CAmBpB;AAED,wBAAgB,SAAS,4CAkBxB;AAED,wBAAgB,KAAK,4CAyBpB;AAED,wBAAgB,WAAW,4CA2B1B;AAED,wBAAgB,YAAY,4CA2B3B;AAED,wBAAgB,OAAO,4CA6BtB;AAED,wBAAgB,WAAW,4CAa1B;AAED,wBAAgB,SAAS,4CAgCxB"}
|
|
@@ -14,13 +14,6 @@ export type ThemeProviderProps = {
|
|
|
14
14
|
fontStyleSheet?: string;
|
|
15
15
|
globalStyles?: GlobalStyles;
|
|
16
16
|
};
|
|
17
|
-
type ThemeProviderContextType = {
|
|
18
|
-
colors: ThemeColorValues;
|
|
19
|
-
fonts: ThemeFontValues;
|
|
20
|
-
fontStyleSheet: string;
|
|
21
|
-
globalStyles: GlobalStyles;
|
|
22
|
-
};
|
|
23
|
-
export declare const ThemeProviderContext: import('react').Context<ThemeProviderContextType>;
|
|
24
17
|
/**
|
|
25
18
|
* Provides theme appearance to all children rendered within the provider.
|
|
26
19
|
* Default theme values are set to a Casper UI-theme. To override them,
|
|
@@ -34,5 +27,4 @@ export declare function ThemeProvider({ colors, fonts, fontStyleSheet, globalSty
|
|
|
34
27
|
* @see Docs https://caspeco.github.io/casper-ui-library/getting-started/theme/
|
|
35
28
|
*/
|
|
36
29
|
export declare function ThemeColorModeScript(): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export {};
|
|
38
30
|
//# sourceMappingURL=theme-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../lib/theme/theme-provider.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../lib/theme/theme-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAG/F,MAAM,MAAM,kBAAkB,GAAG;IAChC,iDAAiD;IACjD,QAAQ,EAAE,SAAS,CAAC;IACpB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;8EAC0E;IAC1E,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;iDAE6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC7B,MAA6B,EAC7B,KAA2B,EAC3B,cAA6C,EAC7C,YAAyC,EACzC,QAAQ,GACR,EAAE,kBAAkB,2CAsBpB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,4CAKnC"}
|
|
@@ -1,39 +1,33 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { ColorModeScript as
|
|
3
|
-
import
|
|
2
|
+
import { ColorModeScript as p, extendTheme as a, ChakraProvider as f } from "@chakra-ui/react";
|
|
3
|
+
import "react";
|
|
4
4
|
import { createSemanticTokens as d } from "./theme-config/theme.js";
|
|
5
5
|
import { casperUITheme as o } from "./theme-config/theme-casper-ui.js";
|
|
6
|
-
import { componentsConfig as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
colors: t = o.colors,
|
|
15
|
-
fonts: r = o.fonts,
|
|
16
|
-
fontStyleSheet: n = o.fontStyleSheet,
|
|
17
|
-
globalStyles: i = o.globalStyles,
|
|
18
|
-
children: l
|
|
6
|
+
import { componentsConfig as h } from "./theme-config/theme-components.js";
|
|
7
|
+
import { ThemeProviderContext as C } from "./theme-context.js";
|
|
8
|
+
function S({
|
|
9
|
+
colors: r = o.colors,
|
|
10
|
+
fonts: t = o.fonts,
|
|
11
|
+
fontStyleSheet: i = o.fontStyleSheet,
|
|
12
|
+
globalStyles: m = o.globalStyles,
|
|
13
|
+
children: n
|
|
19
14
|
}) {
|
|
20
|
-
const
|
|
15
|
+
const s = {
|
|
21
16
|
cssVarPrefix: "theme",
|
|
22
17
|
initialColorMode: "light",
|
|
23
18
|
useSystemColorMode: !1
|
|
24
|
-
},
|
|
25
|
-
semanticTokens: d(
|
|
26
|
-
components:
|
|
27
|
-
config:
|
|
28
|
-
styles:
|
|
19
|
+
}, c = { global: { ...m, fontStyleSheet: i } }, l = a({
|
|
20
|
+
semanticTokens: d(r, t),
|
|
21
|
+
components: h,
|
|
22
|
+
config: s,
|
|
23
|
+
styles: c
|
|
29
24
|
});
|
|
30
|
-
return /* @__PURE__ */ e(C.Provider, { value: { colors:
|
|
25
|
+
return /* @__PURE__ */ e(C.Provider, { value: { colors: r, fonts: t, fontStyleSheet: i, globalStyles: m }, children: /* @__PURE__ */ e(f, { theme: l, children: n }) });
|
|
31
26
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
27
|
+
function k() {
|
|
28
|
+
return /* @__PURE__ */ e(p, { initialColorMode: "light" });
|
|
34
29
|
}
|
|
35
30
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
C as ThemeProviderContext
|
|
31
|
+
k as ThemeColorModeScript,
|
|
32
|
+
S as ThemeProvider
|
|
39
33
|
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"prettier": "@caspeco/prettier-config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
+
"homepage": "https://github.com/Caspeco/casper-ui-library",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Caspeco/casper-ui-library.git"
|
|
11
|
+
},
|
|
7
12
|
"files": [
|
|
8
13
|
"dist"
|
|
9
14
|
],
|
|
@@ -25,24 +30,24 @@
|
|
|
25
30
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
26
31
|
"@caspeco/eslint-config": "^4.0.5",
|
|
27
32
|
"@caspeco/prettier-config": "^1.0.6",
|
|
28
|
-
"@eslint/js": "^9.
|
|
29
|
-
"@testing-library/jest-dom": "^6.
|
|
33
|
+
"@eslint/js": "^9.37.0",
|
|
34
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
30
35
|
"@testing-library/react": "^16.3.0",
|
|
31
36
|
"@testing-library/user-event": "^14.6.1",
|
|
32
37
|
"@types/jest": "^30.0.0",
|
|
33
|
-
"@types/node": "^24.
|
|
38
|
+
"@types/node": "^24.7.0",
|
|
34
39
|
"@types/react": "^18.3.12",
|
|
35
40
|
"@types/react-dom": "^18.3.1",
|
|
36
|
-
"@vitejs/plugin-react-swc": "^4.0
|
|
37
|
-
"eslint": "^9.
|
|
38
|
-
"eslint-plugin-react-hooks": "^
|
|
39
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
41
|
+
"@vitejs/plugin-react-swc": "^4.1.0",
|
|
42
|
+
"eslint": "^9.37.0",
|
|
43
|
+
"eslint-plugin-react-hooks": "^6.1.1",
|
|
44
|
+
"eslint-plugin-react-refresh": "^0.4.23",
|
|
40
45
|
"globals": "^16.4.0",
|
|
41
46
|
"jsdom": "^27.0.0",
|
|
42
47
|
"tsc-alias": "^1.8.16",
|
|
43
|
-
"typescript": "~5.9.
|
|
44
|
-
"typescript-eslint": "^8.
|
|
45
|
-
"vite": "^7.1.
|
|
48
|
+
"typescript": "~5.9.3",
|
|
49
|
+
"typescript-eslint": "^8.45.0",
|
|
50
|
+
"vite": "^7.1.9",
|
|
46
51
|
"vite-plugin-dts": "^4.5.4",
|
|
47
52
|
"vite-tsconfig-paths": "^5.1.4",
|
|
48
53
|
"vitest": "^3.2.4"
|