@vkzstudio/muza-ui 1.0.6 → 1.0.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 (81) hide show
  1. package/dist/components/Button/buttonVariants.d.ts +1 -1
  2. package/dist/components/Calendar/Calendar.d.ts +2 -2
  3. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  4. package/dist/components/Calendar/Calendar.js +158 -150
  5. package/dist/components/DataTable/DataTable.d.ts +17 -0
  6. package/dist/components/DataTable/DataTable.d.ts.map +1 -0
  7. package/dist/components/DataTable/DataTable.js +73 -0
  8. package/dist/components/DataTable/DataTable.stories.d.ts +10 -0
  9. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
  10. package/dist/components/DataTable/index.d.ts +2 -0
  11. package/dist/components/DataTable/index.d.ts.map +1 -0
  12. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  13. package/dist/components/Dialog/Dialog.js +28 -26
  14. package/dist/components/ExpandableTable/Table.d.ts +1 -1
  15. package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
  16. package/dist/components/FileUpload/FileItem.js +81 -77
  17. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  18. package/dist/components/FileUpload/FileUpload.js +98 -94
  19. package/dist/components/Flex/Flex.d.ts +1 -1
  20. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  21. package/dist/components/MultiSelect/MultiSelect.js +51 -50
  22. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
  23. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
  24. package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
  25. package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
  26. package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
  27. package/dist/components/MuzaUIProvider/index.d.ts +2 -0
  28. package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
  29. package/dist/components/Searchbar/Searchbar.d.ts +1 -1
  30. package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
  31. package/dist/components/Searchbar/Searchbar.js +50 -49
  32. package/dist/components/Select/Select.d.ts.map +1 -1
  33. package/dist/components/Select/Select.js +43 -42
  34. package/dist/components/Stepper/Stepper.d.ts +1 -1
  35. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  36. package/dist/components/Stepper/Stepper.js +43 -42
  37. package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
  38. package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
  39. package/dist/components/SwipeButton/SwipeButton.js +85 -84
  40. package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
  41. package/dist/components/Typography/Typography.d.ts +1 -1
  42. package/dist/components/index.d.ts +3 -0
  43. package/dist/components/index.d.ts.map +1 -1
  44. package/dist/index.js +204 -189
  45. package/dist/muza-ui.css +1 -1
  46. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  47. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  48. package/dist/node_modules/date-fns/constants.js +4 -0
  49. package/dist/node_modules/date-fns/constructFrom.js +8 -0
  50. package/dist/node_modules/date-fns/isSameWeek.js +14 -0
  51. package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
  52. package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
  53. package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
  54. package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
  55. package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
  56. package/dist/node_modules/date-fns/locale/cs.js +21 -0
  57. package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
  58. package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
  59. package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
  60. package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
  61. package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
  62. package/dist/node_modules/date-fns/locale/sk.js +21 -0
  63. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  64. package/dist/node_modules/date-fns/toDate.js +8 -0
  65. package/dist/translations/TranslationContext.d.ts +61 -0
  66. package/dist/translations/TranslationContext.d.ts.map +1 -0
  67. package/dist/translations/TranslationContext.js +74 -0
  68. package/dist/translations/index.d.ts +6 -0
  69. package/dist/translations/index.d.ts.map +1 -0
  70. package/dist/translations/locales/cs.d.ts +3 -0
  71. package/dist/translations/locales/cs.d.ts.map +1 -0
  72. package/dist/translations/locales/cs.js +52 -0
  73. package/dist/translations/locales/en.d.ts +3 -0
  74. package/dist/translations/locales/en.d.ts.map +1 -0
  75. package/dist/translations/locales/en.js +52 -0
  76. package/dist/translations/locales/sk.d.ts +3 -0
  77. package/dist/translations/locales/sk.d.ts.map +1 -0
  78. package/dist/translations/locales/sk.js +52 -0
  79. package/dist/translations/types.d.ts +118 -0
  80. package/dist/translations/types.d.ts.map +1 -0
  81. package/package.json +1 -1
@@ -6,7 +6,7 @@ export declare const sharedButtonVariants: {
6
6
  };
7
7
  export declare const buttonVariants: (props?: ({
8
8
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
9
- variant?: "invert" | "link" | "dashed" | "linkInvert" | "primary" | "secondary" | "tertiary" | null | undefined;
9
+ variant?: "link" | "invert" | "dashed" | "linkInvert" | "primary" | "secondary" | "tertiary" | null | undefined;
10
10
  iconOnly?: boolean | null | undefined;
11
11
  fullWidth?: boolean | null | undefined;
12
12
  ghost?: boolean | null | undefined;
@@ -28,8 +28,8 @@ type Single = {
28
28
  selected?: Date | undefined;
29
29
  onSelect?: (date: Date) => void;
30
30
  };
31
- declare const Calendar: ({ leftPanelChildren, defaultMonth, numberOfMonths, mode, selected, onSelect, onReset, onConfirm, resetButtonText, confirmButtonText, renderResetButton, renderConfirmButton, bottomTextDefault, dateFormatter, dateRangeFormatter, disabledDates, weekStartsOn, excludeDisabled, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
32
- declare const CalendarBase: ({ className, classNames, showOutsideDays, captionLayout, formatters, components, ...props }: React.ComponentProps<typeof DayPicker>) => import("react/jsx-runtime").JSX.Element;
31
+ declare const Calendar: ({ leftPanelChildren, defaultMonth, numberOfMonths, mode, selected, onSelect, onReset, onConfirm, resetButtonText: resetButtonTextProp, confirmButtonText: confirmButtonTextProp, renderResetButton, renderConfirmButton, bottomTextDefault: bottomTextDefaultProp, dateFormatter, dateRangeFormatter, disabledDates, weekStartsOn, excludeDisabled, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
32
+ declare const CalendarBase: ({ className, classNames, showOutsideDays, captionLayout, formatters, components, locale, ...props }: React.ComponentProps<typeof DayPicker>) => import("react/jsx-runtime").JSX.Element;
33
33
  declare const CalendarDayButton: ({ className, day, modifiers, children, disabled, ...props }: React.ComponentProps<typeof DayButton>) => import("react/jsx-runtime").JSX.Element;
34
34
  export { Calendar, CalendarBase, CalendarDayButton };
35
35
  //# sourceMappingURL=Calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,KAAK,SAAS,EACd,SAAS,EACT,SAAS,EACT,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAA;AAYzB,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,CAAA;AAEhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,CAAC,GAAG,CAAC,CAAA;IACrB,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IAC/B,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,OAAO,EAAE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AE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;CACtC,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CAChC,CAAA;AAED,QAAA,MAAM,QAAQ,GAAI,uVAmBf,aAAa,4CAmFf,CAAA;AAED,QAAA,MAAM,YAAY,GAAI,qGASnB,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,4CAqNxC,CAAA;AAED,QAAA,MAAM,iBAAiB,GAAI,6DAOxB,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,4CAqDxC,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,113 +1,121 @@
1
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import * as w from "react";
3
- import { formatDate as C } from "./utils/formatDate.js";
4
- import { formatDateRange as D } from "./utils/formatDateRange.js";
5
- import { Typography as b, typographyVariants as g } from "../Typography/Typography.js";
6
- import { Button as h } from "../Button/Button.js";
7
- import { getDefaultClassNames as _ } from "../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js";
8
- import { DayPicker as A } from "../../node_modules/react-day-picker/dist/esm/DayPicker.js";
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
+ import * as _ from "react";
3
+ import { formatDate as L } from "./utils/formatDate.js";
4
+ import { formatDateRange as R } from "./utils/formatDateRange.js";
5
+ import { useMuzaTranslationContext as S } from "../../translations/TranslationContext.js";
6
+ import { Typography as p, typographyVariants as y } from "../Typography/Typography.js";
7
+ import { Button as k } from "../Button/Button.js";
8
+ import { getDefaultClassNames as N } from "../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js";
9
+ import { DayPicker as q } from "../../node_modules/react-day-picker/dist/esm/DayPicker.js";
9
10
  import { cn as e } from "../../utils/cn.js";
10
- import { AltArrowLeftOutline as L, AltArrowRightOutline as R, AltArrowDownOutline as S } from "@solar-icons/react-perf";
11
- const H = ({
12
- leftPanelChildren: s,
13
- defaultMonth: u,
11
+ import { AltArrowLeftOutline as W, AltArrowRightOutline as Y, AltArrowDownOutline as E } from "@solar-icons/react-perf";
12
+ const U = ({
13
+ leftPanelChildren: u,
14
+ defaultMonth: c,
14
15
  numberOfMonths: o,
15
- mode: i,
16
- selected: n,
17
- onSelect: c,
18
- onReset: f,
19
- onConfirm: t,
20
- resetButtonText: r,
21
- confirmButtonText: d,
22
- renderResetButton: l,
23
- renderConfirmButton: p,
24
- bottomTextDefault: k,
25
- dateFormatter: z = C,
26
- dateRangeFormatter: N = D,
27
- disabledDates: x,
28
- weekStartsOn: y = 1,
29
- excludeDisabled: j
30
- }) => /* @__PURE__ */ m("div", { className: "flex", children: [
31
- s && /* @__PURE__ */ a("div", { className: "flex flex-col border-r border-stroke-base-primary py-sm", children: s }),
32
- /* @__PURE__ */ m("div", { className: "mt-2xl flex flex-col justify-between", children: [
33
- i === "range" ? /* @__PURE__ */ a(
34
- v,
35
- {
36
- numberOfMonths: o,
37
- defaultMonth: u,
38
- mode: "range",
39
- selected: n,
40
- onSelect: c,
41
- required: !0,
42
- weekStartsOn: y,
43
- disabled: x,
44
- excludeDisabled: j
45
- }
46
- ) : /* @__PURE__ */ a(
47
- v,
48
- {
49
- numberOfMonths: o,
50
- defaultMonth: u,
51
- mode: "single",
52
- selected: n,
53
- onSelect: c,
54
- required: !0,
55
- weekStartsOn: y,
56
- disabled: x
57
- }
58
- ),
59
- /* @__PURE__ */ m(
60
- "div",
61
- {
62
- className: e(
63
- "mx-xl mt-lg mb-4 flex items-center justify-between",
64
- "max-lg:flex-col max-lg:items-start max-lg:border-t max-lg:border-stroke-base-primary max-lg:pt-lg"
65
- ),
66
- children: [
67
- /* @__PURE__ */ a(
68
- b,
69
- {
70
- component: "span",
71
- variant: "body",
72
- weight: "medium",
73
- size: "base",
74
- children: i === "range" && (n != null && n.from) && (n != null && n.to) ? N(n) : i === "single" && n ? z(n) : k
75
- }
16
+ mode: l,
17
+ selected: a,
18
+ onSelect: m,
19
+ onReset: s,
20
+ onConfirm: f,
21
+ resetButtonText: t,
22
+ confirmButtonText: b,
23
+ renderResetButton: n,
24
+ renderConfirmButton: d,
25
+ bottomTextDefault: i,
26
+ dateFormatter: D = L,
27
+ dateRangeFormatter: j = R,
28
+ disabledDates: w,
29
+ weekStartsOn: h = 1,
30
+ excludeDisabled: C
31
+ }) => {
32
+ const { translations: x, dateFnsLocale: v } = S(), T = t ?? x.calendar.resetButton, B = b ?? x.calendar.confirmButton, A = i ?? x.calendar.bottomTextDefault;
33
+ return /* @__PURE__ */ g("div", { className: "flex", children: [
34
+ u && /* @__PURE__ */ r("div", { className: "flex flex-col border-r border-stroke-base-primary py-sm", children: u }),
35
+ /* @__PURE__ */ g("div", { className: "mt-2xl flex flex-col justify-between", children: [
36
+ l === "range" ? /* @__PURE__ */ r(
37
+ z,
38
+ {
39
+ numberOfMonths: o,
40
+ defaultMonth: c,
41
+ mode: "range",
42
+ selected: a,
43
+ onSelect: m,
44
+ required: !0,
45
+ weekStartsOn: h,
46
+ disabled: w,
47
+ excludeDisabled: C,
48
+ locale: v
49
+ }
50
+ ) : /* @__PURE__ */ r(
51
+ z,
52
+ {
53
+ numberOfMonths: o,
54
+ defaultMonth: c,
55
+ mode: "single",
56
+ selected: a,
57
+ onSelect: m,
58
+ required: !0,
59
+ weekStartsOn: h,
60
+ disabled: w,
61
+ locale: v
62
+ }
63
+ ),
64
+ /* @__PURE__ */ g(
65
+ "div",
66
+ {
67
+ className: e(
68
+ "mx-xl mt-lg mb-4 flex items-center justify-between",
69
+ "max-lg:flex-col max-lg:items-start max-lg:border-t max-lg:border-stroke-base-primary max-lg:pt-lg"
76
70
  ),
77
- /* @__PURE__ */ m("div", { className: "flex gap-2xl max-lg:w-full max-lg:justify-between max-lg:gap-0 max-lg:pt-lg", children: [
78
- l ? l() : /* @__PURE__ */ a(h, { variant: "link", onClick: f, children: r }),
79
- p ? p() : /* @__PURE__ */ a(h, { variant: "primary", size: "sm", onClick: t, children: d })
80
- ] })
81
- ]
82
- }
83
- )
84
- ] })
85
- ] }), v = ({
86
- className: s,
87
- classNames: u,
71
+ children: [
72
+ /* @__PURE__ */ r(
73
+ p,
74
+ {
75
+ component: "span",
76
+ variant: "body",
77
+ weight: "medium",
78
+ size: "base",
79
+ children: l === "range" && (a != null && a.from) && (a != null && a.to) ? j(a) : l === "single" && a ? D(a) : A
80
+ }
81
+ ),
82
+ /* @__PURE__ */ g("div", { className: "flex gap-2xl max-lg:w-full max-lg:justify-between max-lg:gap-0 max-lg:pt-lg", children: [
83
+ n ? n() : /* @__PURE__ */ r(k, { variant: "link", onClick: s, children: T }),
84
+ d ? d() : /* @__PURE__ */ r(k, { variant: "primary", size: "sm", onClick: f, children: B })
85
+ ] })
86
+ ]
87
+ }
88
+ )
89
+ ] })
90
+ ] });
91
+ }, z = ({
92
+ className: u,
93
+ classNames: c,
88
94
  showOutsideDays: o = !0,
89
- captionLayout: i = "label",
90
- formatters: n,
91
- components: c,
95
+ captionLayout: l = "label",
96
+ formatters: a,
97
+ components: m,
98
+ locale: s,
92
99
  ...f
93
100
  }) => {
94
- const t = _();
95
- return /* @__PURE__ */ a(
96
- A,
101
+ const t = N(), b = (s == null ? void 0 : s.code) ?? "default";
102
+ return /* @__PURE__ */ r(
103
+ q,
97
104
  {
98
105
  showOutsideDays: o,
106
+ locale: s,
99
107
  className: e(
100
108
  "[[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
101
109
  String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
102
110
  String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
103
- s
111
+ u
104
112
  ),
105
- captionLayout: i,
113
+ captionLayout: l,
106
114
  formatters: {
107
- formatMonthDropdown: (r) => r.toLocaleString("default", { month: "short" }),
108
- formatWeekdayName: (r) => r.toLocaleString("default", { weekday: "short" }),
109
- formatCaption: (r) => r.toLocaleString("default", { month: "long", year: "numeric" }),
110
- ...n
115
+ formatMonthDropdown: (n) => n.toLocaleString(b, { month: "short" }),
116
+ formatWeekdayName: (n) => n.toLocaleString(b, { weekday: "short" }),
117
+ formatCaption: (n) => n.toLocaleString(b, { month: "long", year: "numeric" }),
118
+ ...a
111
119
  },
112
120
  classNames: {
113
121
  root: e("w-fit", t.root),
@@ -145,7 +153,7 @@ const H = ({
145
153
  t.dropdown
146
154
  ),
147
155
  caption_label: e(
148
- g({
156
+ y({
149
157
  variant: "title",
150
158
  weight: "medium",
151
159
  size: "md",
@@ -157,7 +165,7 @@ const H = ({
157
165
  table: "w-full border-collapse",
158
166
  weekdays: e("flex mb-sm", t.weekdays),
159
167
  weekday: e(
160
- g({
168
+ y({
161
169
  variant: "body",
162
170
  weight: "medium",
163
171
  size: "caption"
@@ -178,7 +186,7 @@ const H = ({
178
186
  t.week_number
179
187
  ),
180
188
  day: e(
181
- g({
189
+ y({
182
190
  variant: "body",
183
191
  weight: "regular",
184
192
  size: "base"
@@ -207,98 +215,98 @@ const H = ({
207
215
  t.disabled
208
216
  ),
209
217
  hidden: e("invisible", t.hidden),
210
- ...u
218
+ ...c
211
219
  },
212
220
  components: {
213
221
  Root: ({
214
- className: r,
222
+ className: n,
215
223
  rootRef: d,
216
- ...l
217
- }) => /* @__PURE__ */ a(
224
+ ...i
225
+ }) => /* @__PURE__ */ r(
218
226
  "div",
219
227
  {
220
228
  "data-slot": "calendar",
221
229
  ref: d,
222
- className: r,
223
- ...l
230
+ className: n,
231
+ ...i
224
232
  }
225
233
  ),
226
234
  Chevron: ({
227
- className: r,
235
+ className: n,
228
236
  orientation: d,
229
- ...l
230
- }) => d === "left" ? /* @__PURE__ */ a(
231
- b,
237
+ ...i
238
+ }) => d === "left" ? /* @__PURE__ */ r(
239
+ p,
232
240
  {
233
241
  component: "span",
234
242
  variant: "title",
235
243
  weight: "medium",
236
244
  size: "md",
237
- children: /* @__PURE__ */ a(
238
- L,
245
+ children: /* @__PURE__ */ r(
246
+ W,
239
247
  {
240
248
  className: e(
241
249
  "inline size-comp-calendar-ico-size text-comp-select-icon-brand-def",
242
- r
250
+ n
243
251
  ),
244
- ...l
252
+ ...i
245
253
  }
246
254
  )
247
255
  }
248
- ) : d === "right" ? /* @__PURE__ */ a(
249
- b,
256
+ ) : d === "right" ? /* @__PURE__ */ r(
257
+ p,
250
258
  {
251
259
  component: "span",
252
260
  variant: "title",
253
261
  weight: "medium",
254
262
  size: "md",
255
- children: /* @__PURE__ */ a(
256
- R,
263
+ children: /* @__PURE__ */ r(
264
+ Y,
257
265
  {
258
266
  className: e(
259
267
  "inline size-comp-calendar-ico-size text-comp-select-icon-brand-def",
260
- r
268
+ n
261
269
  ),
262
- ...l
270
+ ...i
263
271
  }
264
272
  )
265
273
  }
266
- ) : /* @__PURE__ */ a(
267
- S,
274
+ ) : /* @__PURE__ */ r(
275
+ E,
268
276
  {
269
- className: e("size-comp-calendar-ico-size", r),
270
- ...l
277
+ className: e("size-comp-calendar-ico-size", n),
278
+ ...i
271
279
  }
272
280
  ),
273
- DayButton: q,
274
- WeekNumber: ({ children: r, ...d }) => /* @__PURE__ */ a("td", { ...d, children: /* @__PURE__ */ a("div", { className: "flex items-center justify-center text-center", children: r }) }),
275
- ...c
281
+ DayButton: F,
282
+ WeekNumber: ({ children: n, ...d }) => /* @__PURE__ */ r("td", { ...d, children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center text-center", children: n }) }),
283
+ ...m
276
284
  },
277
285
  ...f
278
286
  }
279
287
  );
280
- }, q = ({
281
- className: s,
282
- day: u,
288
+ }, F = ({
289
+ className: u,
290
+ day: c,
283
291
  modifiers: o,
284
- children: i,
285
- disabled: n,
286
- ...c
292
+ children: l,
293
+ disabled: a,
294
+ ...m
287
295
  }) => {
288
- const f = _(), t = w.useRef(null);
289
- return w.useEffect(() => {
290
- var r;
291
- o.focused && ((r = t.current) == null || r.focus());
292
- }, [o.focused]), /* @__PURE__ */ a(
296
+ const s = N(), f = _.useRef(null);
297
+ return _.useEffect(() => {
298
+ var t;
299
+ o.focused && ((t = f.current) == null || t.focus());
300
+ }, [o.focused]), /* @__PURE__ */ r(
293
301
  "button",
294
302
  {
295
- ref: t,
296
- "data-day": u.date.toLocaleDateString(),
303
+ ref: f,
304
+ "data-day": c.date.toLocaleDateString(),
297
305
  "data-selected-single": o.selected && !o.range_start && !o.range_end && !o.range_middle,
298
306
  "data-range-start": o.range_start,
299
307
  "data-range-end": o.range_end,
300
308
  "data-range-middle": o.range_middle,
301
- disabled: n,
309
+ disabled: a,
302
310
  className: e(
303
311
  "relative size-full",
304
312
  'before:absolute before:inset-0 before:rounded-full before:transition-colors before:content-[""]',
@@ -310,14 +318,14 @@ const H = ({
310
318
  "group-data-[focused=true]/day:z-10",
311
319
  "outline-0",
312
320
  {
313
- "hover:text-text-brand-def hover:before:bg-surface-brand-brand-tertiary focus-visible:text-text-brand-def focus-visible:focus-default focus-visible:before:bg-surface-brand-brand-tertiary": !n
321
+ "hover:text-text-brand-def hover:before:bg-surface-brand-brand-tertiary focus-visible:text-text-brand-def focus-visible:focus-default focus-visible:before:bg-surface-brand-brand-tertiary": !a
314
322
  },
315
- f.day,
316
- s
323
+ s.day,
324
+ u
317
325
  ),
318
- ...c,
319
- children: /* @__PURE__ */ a(
320
- b,
326
+ ...m,
327
+ children: /* @__PURE__ */ r(
328
+ p,
321
329
  {
322
330
  variant: "body",
323
331
  weight: "regular",
@@ -325,14 +333,14 @@ const H = ({
325
333
  component: "span",
326
334
  fixY: !0,
327
335
  className: "relative z-1 block transition-colors",
328
- children: i
336
+ children: l
329
337
  }
330
338
  )
331
339
  }
332
340
  );
333
341
  };
334
342
  export {
335
- H as Calendar,
336
- v as CalendarBase,
337
- q as CalendarDayButton
343
+ U as Calendar,
344
+ z as CalendarBase,
345
+ F as CalendarDayButton
338
346
  };
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DataTableColumn<T> {
3
+ dataKey: keyof T;
4
+ title: ReactNode;
5
+ className?: string;
6
+ lineClamp?: boolean | 1 | 2;
7
+ render?: (value: T[keyof T], rowData: T, rowIndex: number) => ReactNode;
8
+ }
9
+ export interface DataTableProps<T> extends Omit<React.HTMLAttributes<HTMLTableElement>, 'children'> {
10
+ data: T[];
11
+ columns: DataTableColumn<T>[];
12
+ showHeader?: boolean;
13
+ className?: string;
14
+ }
15
+ declare const DataTable: <T>({ data, columns, showHeader, className, ...props }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
16
+ export { DataTable };
17
+ //# sourceMappingURL=DataTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAA;CACxE;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,CAC/B,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAChE,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,SAAS,GAAI,CAAC,EAAG,oDAMpB,cAAc,CAAC,CAAC,CAAC,4CA8EnB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,73 @@
1
+ import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
+ import "react";
3
+ import { typographyVariants as b, Typography as y } from "../Typography/Typography.js";
4
+ import { cn as s } from "../../utils/cn.js";
5
+ const u = ({
6
+ data: d,
7
+ columns: i,
8
+ showHeader: p = !0,
9
+ className: m,
10
+ ...o
11
+ }) => /* @__PURE__ */ r("div", { className: "w-full overflow-x-auto overflow-y-hidden", children: /* @__PURE__ */ h(
12
+ "table",
13
+ {
14
+ className: s(
15
+ "-my-sm w-full border-separate border-spacing-y-sm",
16
+ m
17
+ ),
18
+ ...o,
19
+ children: [
20
+ p && /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: i.map((a, t) => /* @__PURE__ */ r(
21
+ "th",
22
+ {
23
+ className: s(
24
+ b({
25
+ size: "sm",
26
+ uppercase: !0,
27
+ variant: "body",
28
+ weight: "medium"
29
+ }),
30
+ "px-comp-table-p text-left text-text-dark-secondary",
31
+ a.className
32
+ ),
33
+ children: a.title
34
+ },
35
+ t
36
+ )) }) }),
37
+ /* @__PURE__ */ r("tbody", { children: d.map((a, t) => /* @__PURE__ */ r("tr", { className: "group", children: i.map((e, l) => {
38
+ const n = l === 0, c = l === i.length - 1;
39
+ return /* @__PURE__ */ r(
40
+ "td",
41
+ {
42
+ className: s(
43
+ "h-comp-table-h border-y border-stroke-base-secondary bg-surface-base-primary px-2xl transition-colors",
44
+ {
45
+ "rounded-l-lg border-l": n,
46
+ "rounded-r-lg border-r": c
47
+ },
48
+ e.className
49
+ ),
50
+ children: e.render ? e.render(a[e.dataKey], a, t) : /* @__PURE__ */ r(
51
+ y,
52
+ {
53
+ variant: "body",
54
+ size: "base",
55
+ weight: "medium",
56
+ component: "span",
57
+ className: s({
58
+ "line-clamp-1": e.lineClamp === !0 || e.lineClamp === 1,
59
+ "line-clamp-2": e.lineClamp === 2
60
+ }),
61
+ children: a[e.dataKey]
62
+ }
63
+ )
64
+ },
65
+ l
66
+ );
67
+ }) }, t)) })
68
+ ]
69
+ }
70
+ ) });
71
+ export {
72
+ u as DataTable
73
+ };
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Default: Story;
6
+ export declare const SimpleTable: Story;
7
+ export declare const WithCustomContent: Story;
8
+ export declare const HiddenHeader: Story;
9
+ export declare const WithEditableFields: Story;
10
+ //# sourceMappingURL=DataTable.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAO3D,QAAA,MAAM,IAAI,EAAE,IA4CX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAA;AAsFrB,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAA;AAaD,eAAO,MAAM,WAAW,EAAE,KAWzB,CAAA;AA0CD,eAAO,MAAM,iBAAiB,EAAE,KAW/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAa1B,CAAA;AASD,eAAO,MAAM,kBAAkB,EAAE,KAmIhC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { DataTable, type DataTableProps, type DataTableColumn, } from './DataTable';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAIzD,QAAA,MAAM,MAAM,iDAAuB,CAAA;AACnC,QAAA,MAAM,WAAW,iIAAwB,CAAA;AACzC,QAAA,MAAM,iBAAiB,yIAA8B,CAAA;AACrD,QAAA,MAAM,aAAa,kIAA0B,CAAA;AAC7C,QAAA,MAAM,YAAY,uDAAyB,CAAA;AAC3C,QAAA,MAAM,WAAW,gIAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,4LAYjB,CAAA;AAGF,QAAA,MAAM,aAAa;WAGR,OAAO,GAAG,QAAQ,GAAG,OAAO;qBAClB,MAAM;kDAwC1B,CAAA;AAGD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,GAClB,CAAA"}
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,QAAA,MAAM,MAAM,iDAAuB,CAAA;AACnC,QAAA,MAAM,WAAW,iIAAwB,CAAA;AACzC,QAAA,MAAM,iBAAiB,yIAA8B,CAAA;AACrD,QAAA,MAAM,aAAa,kIAA0B,CAAA;AAC7C,QAAA,MAAM,YAAY,uDAAyB,CAAA;AAC3C,QAAA,MAAM,WAAW,gIAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,4LAYjB,CAAA;AAiDF,QAAA,MAAM,aAAa;WAGR,OAAO,GAAG,QAAQ,GAAG,OAAO;qBAClB,MAAM;kDAEN,CAAA;AAGrB,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,GAClB,CAAA"}