@deix/rossini-core 6.2.1 → 6.3.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.
Files changed (44) hide show
  1. package/lib/components/filters/DateFilter.d.ts +11 -0
  2. package/lib/components/filters/DateFilter.d.ts.map +1 -0
  3. package/lib/components/filters/DateFilter.js +29 -0
  4. package/lib/components/filters/FilterForm.d.ts +10 -0
  5. package/lib/components/filters/FilterForm.d.ts.map +1 -0
  6. package/lib/components/filters/FilterForm.js +15 -0
  7. package/lib/components/filters/NumberFilter.d.ts +12 -0
  8. package/lib/components/filters/NumberFilter.d.ts.map +1 -0
  9. package/lib/components/filters/NumberFilter.js +26 -0
  10. package/lib/components/filters/SelectFilter.d.ts +20 -0
  11. package/lib/components/filters/SelectFilter.d.ts.map +1 -0
  12. package/lib/components/filters/SelectFilter.js +40 -0
  13. package/lib/components/filters/TextFilter.d.ts +12 -0
  14. package/lib/components/filters/TextFilter.d.ts.map +1 -0
  15. package/lib/components/filters/TextFilter.js +25 -0
  16. package/lib/components/filters/index.d.ts +11 -0
  17. package/lib/components/filters/index.d.ts.map +1 -0
  18. package/lib/components/filters/index.js +5 -0
  19. package/lib/components/i18n/Link.d.ts.map +1 -1
  20. package/lib/components/index.d.ts +14 -12
  21. package/lib/components/index.d.ts.map +1 -1
  22. package/lib/components/index.js +7 -6
  23. package/lib/components/provider/UserInfoProvider.d.ts.map +1 -1
  24. package/lib/components/provider/UserInfoProvider.js +5 -4
  25. package/lib/index.d.ts +5 -5
  26. package/lib/index.d.ts.map +1 -1
  27. package/lib/index.js +3 -3
  28. package/lib/tsconfig.tsbuildinfo +1 -1
  29. package/lib/utils/helpers/index.d.ts +3 -3
  30. package/lib/utils/helpers/index.d.ts.map +1 -1
  31. package/lib/utils/helpers/index.js +3 -3
  32. package/lib/utils/helpers/stringHelpers.d.ts +2 -0
  33. package/lib/utils/helpers/stringHelpers.d.ts.map +1 -1
  34. package/lib/utils/helpers/stringHelpers.js +14 -0
  35. package/lib/utils/hooks/useFormattedQueryState.d.ts +8 -0
  36. package/lib/utils/hooks/useFormattedQueryState.d.ts.map +1 -0
  37. package/lib/utils/hooks/useFormattedQueryState.js +18 -0
  38. package/lib/utils/index.d.ts +4 -4
  39. package/lib/utils/index.d.ts.map +1 -1
  40. package/lib/utils/index.js +3 -3
  41. package/lib/utils/middleware/index.d.ts +1 -1
  42. package/lib/utils/middleware/index.d.ts.map +1 -1
  43. package/lib/utils/middleware/index.js +1 -1
  44. package/package.json +16 -16
@@ -1,4 +1,4 @@
1
- export { colorToRgb, getTextColor, hexToRgb } from './colorHelpers';
2
- export { dateDiff, getTimeStr, isValidDate, toLocalStandardDateString, } from './dateHelpers';
3
- export { camelToSnake, commonStart, stringToColor, toTitleCase, interpolate, } from './stringHelpers';
1
+ export * from './colorHelpers';
2
+ export * from './dateHelpers';
3
+ export * from './stringHelpers';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
@@ -1,3 +1,3 @@
1
- export { colorToRgb, getTextColor, hexToRgb } from './colorHelpers';
2
- export { dateDiff, getTimeStr, isValidDate, toLocalStandardDateString, } from './dateHelpers';
3
- export { camelToSnake, commonStart, stringToColor, toTitleCase, interpolate, } from './stringHelpers';
1
+ export * from './colorHelpers';
2
+ export * from './dateHelpers';
3
+ export * from './stringHelpers';
@@ -1,7 +1,9 @@
1
+ import { Locale, StringTranslation } from '../../types';
1
2
  export declare const camelToSnake: (inputString: string) => string;
2
3
  export declare const snakeToCamel: (inputString: string) => string;
3
4
  export declare const toTitleCase: (inputString: string, sep?: string) => string;
4
5
  export declare const stringToColor: (string: string) => string;
5
6
  export declare const commonStart: (strings: string[]) => string;
6
7
  export declare const interpolate: (template: string, values: Record<string, string>) => string;
8
+ export declare const getStringTranslation: (value: string | StringTranslation, locale?: Locale, defaultValue?: string) => string;
7
9
  //# sourceMappingURL=stringHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stringHelpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/stringHelpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAC0B,CAAC;AAE9E,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAGhD,CAAC;AAEJ,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,YAAS,KAAG,MAI/C,CAAC;AAEf,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,WAgB3C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,WAS5C,CAAC;AAIF,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAO/B,CAAC"}
1
+ {"version":3,"file":"stringHelpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/stringHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAC0B,CAAC;AAE9E,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAGhD,CAAC;AAEJ,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,YAAS,KAAG,MAI/C,CAAC;AAEf,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,WAgB3C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,WAS5C,CAAC;AAIF,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAO/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,GAAG,iBAAiB,EACjC,SAAS,MAAM,EACf,eAAe,MAAM,KACpB,MAYF,CAAC"}
@@ -36,3 +36,17 @@ export const interpolate = (template, values) => {
36
36
  };
37
37
  return template.replace(/\{(\w+)\}/gi, replaceVariable);
38
38
  };
39
+ export const getStringTranslation = (value, locale, defaultValue) => {
40
+ if (typeof value === 'string') {
41
+ return value;
42
+ }
43
+ if (!locale) {
44
+ if (value.en) {
45
+ return value.en;
46
+ }
47
+ else {
48
+ return defaultValue || '';
49
+ }
50
+ }
51
+ return value[locale] || defaultValue || '';
52
+ };
@@ -0,0 +1,8 @@
1
+ interface FormattedQueryStateOptions {
2
+ defaultValue?: string;
3
+ parseUrlParam?: (param: string) => string;
4
+ formatUrlParam?: (param: string) => string;
5
+ }
6
+ export declare const useFormattedQueryState: (name: string, { defaultValue, parseUrlParam, formatUrlParam }: FormattedQueryStateOptions) => readonly [string, (unformattedUrlValue?: string) => void];
7
+ export {};
8
+ //# sourceMappingURL=useFormattedQueryState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormattedQueryState.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormattedQueryState.ts"],"names":[],"mappings":"AAEA,UAAU,0BAA0B;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAED,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,EACZ,iDAAiD,0BAA0B,8CAUrB,MAAM,UAW7D,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { useQueryState } from 'nuqs';
2
+ export const useFormattedQueryState = (name, { defaultValue, parseUrlParam, formatUrlParam }) => {
3
+ const [urlValue, setUrlValue] = useQueryState(name, {
4
+ defaultValue: defaultValue || '',
5
+ });
6
+ // If a function was provided, use it to parse the value coming from the url
7
+ const parsedUrlValue = urlValue && parseUrlParam ? parseUrlParam(urlValue) : urlValue;
8
+ console.log('urlValue parsedUrlValue', urlValue, parseUrlParam);
9
+ const setUnformattedUrlValue = (unformattedUrlValue) => {
10
+ // If a function was provided, use it to format the value before setting the url param
11
+ const formattedUrlValue = formatUrlParam && unformattedUrlValue
12
+ ? formatUrlParam(unformattedUrlValue)
13
+ : unformattedUrlValue;
14
+ console.log('setUnformattedUrlValue', formattedUrlValue);
15
+ setUrlValue(formattedUrlValue || null);
16
+ };
17
+ return [parsedUrlValue, setUnformattedUrlValue];
18
+ };
@@ -1,5 +1,5 @@
1
- export { camelToSnake, colorToRgb, commonStart, dateDiff, getTextColor, getTimeStr, hexToRgb, interpolate, isValidDate, stringToColor, toLocalStandardDateString, toTitleCase, } from './helpers';
2
- export { useAPI, useOptionalAPI, useLocale, usePathname, usePersistedState, } from './hooks';
3
- export type { UserInfo } from './hooks';
4
- export { createI18nMiddleware } from './middleware';
1
+ export * from './helpers';
2
+ export * from './hooks';
3
+ export type * from './hooks';
4
+ export * from './middleware';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,yBAAyB,EACzB,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,MAAM,EACN,cAAc,EACd,SAAS,EACT,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,mBAAmB,SAAS,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -1,3 +1,3 @@
1
- export { camelToSnake, colorToRgb, commonStart, dateDiff, getTextColor, getTimeStr, hexToRgb, interpolate, isValidDate, stringToColor, toLocalStandardDateString, toTitleCase, } from './helpers';
2
- export { useAPI, useOptionalAPI, useLocale, usePathname, usePersistedState, } from './hooks';
3
- export { createI18nMiddleware } from './middleware';
1
+ export * from './helpers';
2
+ export * from './hooks';
3
+ export * from './middleware';
@@ -1,2 +1,2 @@
1
- export { createI18nMiddleware } from './createI18nMiddleware';
1
+ export * from './createI18nMiddleware';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- export { createI18nMiddleware } from './createI18nMiddleware';
1
+ export * from './createI18nMiddleware';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deix/rossini-core",
3
- "version": "6.2.1",
3
+ "version": "6.3.0",
4
4
  "main": "lib/index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,32 +37,30 @@
37
37
  "@emotion/react": "^11.13.5",
38
38
  "@emotion/styled": "^11.13.5",
39
39
  "@eslint/js": "^10.0.1",
40
- "@eslint/plugin-kit": "^0.3.4",
40
+ "@eslint/plugin-kit": "^0.6.0",
41
41
  "@fontsource/raleway": "^5.1.0",
42
42
  "@mui/icons-material": "^7.2.0",
43
- "@mui/material": "^7.2.0",
44
- "@storybook/addon-docs": "^10.0.0",
45
- "@storybook/addon-links": "^10.0.0",
46
- "@storybook/addon-onboarding": "^10.0.0",
47
- "@storybook/nextjs": "^10.0.0",
43
+ "@mui/material": "^7.3.9",
44
+ "@storybook/addon-docs": "^10.2.16",
45
+ "@storybook/addon-links": "^10.2.16",
46
+ "@storybook/addon-onboarding": "^10.2.16",
47
+ "@storybook/nextjs": "^10.2.16",
48
48
  "@tanstack/react-query": "^5.64.2",
49
49
  "@tanstack/react-query-devtools": "^5.64.2",
50
- "@types/node": "^24.11.0",
50
+ "@types/node": "^24.12.0",
51
51
  "@types/react": "19.2.7",
52
52
  "@types/react-dom": "19.2.3",
53
53
  "axios": "^1.12.2",
54
- "babel-loader": "^10.0.0",
55
- "commitizen": "^4.3.1",
56
- "cz-conventional-changelog": "^3.3.0",
54
+ "babel-loader": "^10.1.0",
57
55
  "eslint": "^10.0.2",
58
56
  "eslint-config-prettier": "^10.1.1",
59
57
  "eslint-plugin-prettier": "^5.5.5",
60
- "eslint-plugin-storybook": "^10.0.0",
58
+ "eslint-plugin-storybook": "^10.2.16",
61
59
  "form-data": "^4.0.4",
62
- "react": "19.2.3",
60
+ "react": "^19.2.4",
63
61
  "react-docgen-typescript-plugin": "^1.0.8",
64
- "react-dom": "19.2.3",
65
- "storybook": "^10.0.0",
62
+ "react-dom": "^19.2.4",
63
+ "storybook": "^10.2.16",
66
64
  "typescript": "^5.6.3",
67
65
  "typescript-eslint": "^8.15.0"
68
66
  },
@@ -76,12 +74,14 @@
76
74
  },
77
75
  "dependencies": {
78
76
  "@formatjs/intl-localematcher": "^0.6.0",
77
+ "@mui/x-date-pickers": "^8.27.2",
79
78
  "@types/negotiator": "^0.6.3",
79
+ "date-fns": "^4.1.0",
80
80
  "negotiator": "^1.0.0",
81
81
  "next": "^16.1.4",
82
82
  "notistack": "^3.0.2",
83
83
  "nuqs": "^2.8.8",
84
- "prettier": "^3.3.3"
84
+ "react-hook-form": "^7.71.2"
85
85
  },
86
86
  "overrides": {
87
87
  "tmp": "^0.2.4",