@spesia/ui 1.8.21 → 1.9.7

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 (87) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_commonjsHelpers.js +6 -0
  3. package/dist/_virtual/index.js +4 -0
  4. package/dist/client.d.ts +7 -0
  5. package/dist/client.js +16 -0
  6. package/dist/components/Logo/Logo.js +121 -0
  7. package/dist/components/Logo3d/Logo3d.js +61 -0
  8. package/dist/components/checkbox/Checked.js +47 -0
  9. package/dist/components/checkbox/Unchecked.js +70 -0
  10. package/dist/components/chip-list/ChipList.js +97 -0
  11. package/dist/components/container-grid/ContainerGrid.js +110 -0
  12. package/dist/components/date-picker/DatePicker/DatePicker.js +62 -0
  13. package/dist/components/date-picker/PeriodPicker/PeriodPicker.js +374 -0
  14. package/dist/components/date-picker/utils.js +27 -0
  15. package/dist/components/filters/Checked.js +26 -0
  16. package/dist/components/filters/FilterList.js +121 -0
  17. package/dist/components/filters/Unchecked.js +26 -0
  18. package/dist/components/index.d.ts +0 -9
  19. package/dist/components/radio/Checked.js +34 -0
  20. package/dist/components/radio/Unchecked.js +48 -0
  21. package/dist/components/trending-chip/TrendingChip.js +93 -0
  22. package/dist/helpers/suitCx.js +17 -0
  23. package/dist/helpers/utils.js +11 -0
  24. package/dist/hooks/useContainerDimension.js +23 -0
  25. package/dist/index.d.ts +3 -2
  26. package/dist/index.js +13 -37197
  27. package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +42 -0
  28. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  29. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  30. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js +515 -0
  31. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
  32. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
  33. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  34. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  35. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/protectedTokens.js +20 -0
  36. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js +6 -0
  37. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js +8 -0
  38. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js +16 -0
  39. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js +59 -0
  40. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js +11 -0
  41. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js +12 -0
  42. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js +15 -0
  43. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js +12 -0
  44. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js +17 -0
  45. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js +7 -0
  46. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js +14 -0
  47. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMonth.js +13 -0
  48. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js +13 -0
  49. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js +9 -0
  50. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  51. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  52. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  53. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  54. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  55. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  56. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  57. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  58. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  59. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js +21 -0
  60. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js +9 -0
  61. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js +8 -0
  62. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js +11 -0
  63. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js +11 -0
  64. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js +13 -0
  65. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js +9 -0
  66. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js +8 -0
  67. package/dist/styles/alert/alert.js +70 -0
  68. package/dist/styles/button/button.js +195 -0
  69. package/dist/styles/card/card.js +16 -0
  70. package/dist/styles/checkbox/checkbox.js +46 -0
  71. package/dist/styles/chip/chip.js +115 -0
  72. package/dist/styles/colors.js +435 -0
  73. package/dist/styles/dialog/dialog.js +34 -0
  74. package/dist/styles/form/form.js +18 -0
  75. package/dist/styles/index.js +53 -0
  76. package/dist/styles/input/input.js +127 -0
  77. package/dist/styles/list/list.js +42 -0
  78. package/dist/styles/palette.js +150 -0
  79. package/dist/styles/radio/radio.js +37 -0
  80. package/dist/styles/slider/slider.js +55 -0
  81. package/dist/styles/switch/switch.js +63 -0
  82. package/dist/styles/tab/tab.js +70 -0
  83. package/dist/styles/tooltip/tooltip.js +19 -0
  84. package/dist/styles/typography.js +139 -0
  85. package/dist/themes.js +35 -0
  86. package/package.json +6 -1
  87. /package/dist/components/{TrendingChip → trending-chip}/TrendingChip.d.ts +0 -0
@@ -0,0 +1,93 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { suitCx as l } from "../../helpers/suitCx.js";
3
+ import { Box as i, Chip as c } from "@mui/material";
4
+ import { ArrowDownward as n, ArrowUpward as s } from "@mui/icons-material";
5
+ import { formatPercentage as h } from "../../helpers/utils.js";
6
+ import { colors as t } from "../../styles/colors.js";
7
+ const C = ({
8
+ value: e,
9
+ size: a,
10
+ iconOnly: d,
11
+ className: p
12
+ }) => {
13
+ const o = l(
14
+ {
15
+ name: "TrendingChip"
16
+ },
17
+ {},
18
+ p
19
+ );
20
+ return d ? e < 0 ? /* @__PURE__ */ r(
21
+ i,
22
+ {
23
+ sx: {
24
+ display: "inline-flex",
25
+ alignItems: "center",
26
+ justifyContent: "center",
27
+ borderRadius: "100%",
28
+ backgroundColor: "#F38840",
29
+ color: t.neutral.white,
30
+ width: "48px",
31
+ height: "48px"
32
+ },
33
+ children: /* @__PURE__ */ r(
34
+ n,
35
+ {
36
+ className: o(),
37
+ sx: { width: "24px", height: "24px", rotate: "-45deg" }
38
+ }
39
+ )
40
+ }
41
+ ) : /* @__PURE__ */ r(
42
+ i,
43
+ {
44
+ sx: {
45
+ display: "inline-flex",
46
+ alignItems: "center",
47
+ justifyContent: "center",
48
+ borderRadius: "100%",
49
+ backgroundColor: t.secondary.olive[50],
50
+ color: t.neutral.white,
51
+ width: "48px",
52
+ height: "48px"
53
+ },
54
+ children: /* @__PURE__ */ r(
55
+ s,
56
+ {
57
+ className: o(),
58
+ sx: { width: "24px", height: "24px", rotate: "45deg" }
59
+ }
60
+ )
61
+ }
62
+ ) : /* @__PURE__ */ r(
63
+ c,
64
+ {
65
+ className: o(),
66
+ variant: "outlined",
67
+ size: a,
68
+ sx: {
69
+ pointerEvents: "none",
70
+ border: "none !important",
71
+ borderRadius: 2,
72
+ color: e >= 0 ? `${t.secondary.olive[50]} !important` : "#F38840 !important"
73
+ },
74
+ color: e < 0 ? "error" : "success",
75
+ icon: e < 0 ? /* @__PURE__ */ r(
76
+ n,
77
+ {
78
+ sx: { width: "18px", height: "18px", rotate: "-45deg" }
79
+ }
80
+ ) : /* @__PURE__ */ r(
81
+ s,
82
+ {
83
+ sx: { width: "18px", height: "18px", rotate: "45deg" }
84
+ }
85
+ ),
86
+ label: h(e, !1, 1)
87
+ }
88
+ );
89
+ };
90
+ export {
91
+ C as TrendingChip,
92
+ C as default
93
+ };
@@ -0,0 +1,17 @@
1
+ import m from "../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
2
+ const c = (o, i, f = {}) => {
3
+ let e;
4
+ typeof o == "string" ? e = { name: o, modifiers: [], states: [] } : e = o;
5
+ const a = i;
6
+ e.modifiers && e.modifiers.map((s) => {
7
+ const t = a[s];
8
+ t != null && t !== !1 && (typeof t == "boolean" ? a[e.name + "--" + s] = !0 : a[e.name + "--" + t] = !0, a[s] = !1);
9
+ }), e.states && e.states.map((s) => {
10
+ i[s] && (a["is-" + s] = !0, a[s] = !1);
11
+ });
12
+ const l = m(e.name, a, f), n = e.name;
13
+ return (...s) => s.length && n ? s.map((t) => `${n}-${t}`).join(" ") : l;
14
+ };
15
+ export {
16
+ c as suitCx
17
+ };
@@ -0,0 +1,11 @@
1
+ import t from "lodash/round";
2
+ const c = (r, e, n) => {
3
+ {
4
+ const o = Math.round(r * 1e3) / 10;
5
+ return `${d(o, n)}%`;
6
+ }
7
+ }, d = (r, e) => r < 0 ? -t(Math.abs(r), e) : t(r, e);
8
+ export {
9
+ c as formatPercentage,
10
+ d as roundNumber
11
+ };
@@ -0,0 +1,23 @@
1
+ import { useState as r, useEffect as d } from "react";
2
+ const u = (i) => {
3
+ const [o, s] = r({
4
+ width: void 0,
5
+ height: void 0
6
+ });
7
+ return d(() => {
8
+ function n() {
9
+ var t;
10
+ if (i) {
11
+ const e = (t = i.current) == null ? void 0 : t.getBoundingClientRect();
12
+ s({
13
+ width: e == null ? void 0 : e.width,
14
+ height: e == null ? void 0 : e.height
15
+ });
16
+ }
17
+ }
18
+ return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
19
+ }, []), o;
20
+ };
21
+ export {
22
+ u as useContainerDimensions
23
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export { theme } from './styles';
2
1
  export { colors, tokens, primitives } from './styles/colors';
3
2
  export { themes, defaultTheme } from './themes';
4
3
  export { suitCx } from './helpers/suitCx';
5
- export * from './components';
4
+ export { default as Logo } from './components/Logo/Logo';
5
+ export { default as Logo3d } from './components/Logo3d/Logo3d';
6
+ export { type LogoProps } from './components/Logo/Logo';