@vkzstudio/muza-ui 1.0.5 → 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.
- package/dist/components/Button/buttonVariants.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +158 -150
- package/dist/components/DataTable/DataTable.d.ts +17 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +73 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +10 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +28 -26
- package/dist/components/ExpandableTable/Table.d.ts +1 -1
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +83 -78
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +98 -94
- package/dist/components/Flex/Flex.d.ts +1 -1
- package/dist/components/Icons/CustomIcons.d.ts +3 -0
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +90 -41
- package/dist/components/Icons/Icons.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +51 -50
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/index.d.ts +2 -0
- package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
- package/dist/components/Searchbar/Searchbar.d.ts +3 -2
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.js +56 -54
- package/dist/components/Searchbar/Searchbar.stories.d.ts +1 -0
- package/dist/components/Searchbar/Searchbar.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +43 -42
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +43 -42
- package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
- package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +85 -84
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +204 -186
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/constants.js +4 -0
- package/dist/node_modules/date-fns/constructFrom.js +8 -0
- package/dist/node_modules/date-fns/isSameWeek.js +14 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
- package/dist/node_modules/date-fns/locale/cs.js +21 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
- package/dist/node_modules/date-fns/locale/sk.js +21 -0
- package/dist/node_modules/date-fns/startOfWeek.js +11 -0
- package/dist/node_modules/date-fns/toDate.js +8 -0
- package/dist/styles/token-colors.css +1206 -1199
- package/dist/styles/token-sizes.css +680 -680
- package/dist/styles/typography.css +84 -84
- package/dist/translations/TranslationContext.d.ts +61 -0
- package/dist/translations/TranslationContext.d.ts.map +1 -0
- package/dist/translations/TranslationContext.js +74 -0
- package/dist/translations/index.d.ts +6 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/locales/cs.d.ts +3 -0
- package/dist/translations/locales/cs.d.ts.map +1 -0
- package/dist/translations/locales/cs.js +52 -0
- package/dist/translations/locales/en.d.ts +3 -0
- package/dist/translations/locales/en.d.ts.map +1 -0
- package/dist/translations/locales/en.js +52 -0
- package/dist/translations/locales/sk.d.ts +3 -0
- package/dist/translations/locales/sk.d.ts.map +1 -0
- package/dist/translations/locales/sk.js +52 -0
- package/dist/translations/types.d.ts +118 -0
- package/dist/translations/types.d.ts.map +1 -0
- 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?: "
|
|
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;
|
|
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;AAazB,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,MAAM,IAAI,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAA;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mBAAmB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAA;IAC3C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAA;IACtC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAA;IACjD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IAC/C,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,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
|
|
2
|
-
import * as
|
|
3
|
-
import { formatDate as
|
|
4
|
-
import { formatDateRange as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
11
|
-
const
|
|
12
|
-
leftPanelChildren:
|
|
13
|
-
defaultMonth:
|
|
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:
|
|
16
|
-
selected:
|
|
17
|
-
onSelect:
|
|
18
|
-
onReset:
|
|
19
|
-
onConfirm:
|
|
20
|
-
resetButtonText:
|
|
21
|
-
confirmButtonText:
|
|
22
|
-
renderResetButton:
|
|
23
|
-
renderConfirmButton:
|
|
24
|
-
bottomTextDefault:
|
|
25
|
-
dateFormatter:
|
|
26
|
-
dateRangeFormatter:
|
|
27
|
-
disabledDates:
|
|
28
|
-
weekStartsOn:
|
|
29
|
-
excludeDisabled:
|
|
30
|
-
}) =>
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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:
|
|
90
|
-
formatters:
|
|
91
|
-
components:
|
|
95
|
+
captionLayout: l = "label",
|
|
96
|
+
formatters: a,
|
|
97
|
+
components: m,
|
|
98
|
+
locale: s,
|
|
92
99
|
...f
|
|
93
100
|
}) => {
|
|
94
|
-
const t =
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
|
|
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
|
-
|
|
111
|
+
u
|
|
104
112
|
),
|
|
105
|
-
captionLayout:
|
|
113
|
+
captionLayout: l,
|
|
106
114
|
formatters: {
|
|
107
|
-
formatMonthDropdown: (
|
|
108
|
-
formatWeekdayName: (
|
|
109
|
-
formatCaption: (
|
|
110
|
-
...
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
...
|
|
218
|
+
...c
|
|
211
219
|
},
|
|
212
220
|
components: {
|
|
213
221
|
Root: ({
|
|
214
|
-
className:
|
|
222
|
+
className: n,
|
|
215
223
|
rootRef: d,
|
|
216
|
-
...
|
|
217
|
-
}) => /* @__PURE__ */
|
|
224
|
+
...i
|
|
225
|
+
}) => /* @__PURE__ */ r(
|
|
218
226
|
"div",
|
|
219
227
|
{
|
|
220
228
|
"data-slot": "calendar",
|
|
221
229
|
ref: d,
|
|
222
|
-
className:
|
|
223
|
-
...
|
|
230
|
+
className: n,
|
|
231
|
+
...i
|
|
224
232
|
}
|
|
225
233
|
),
|
|
226
234
|
Chevron: ({
|
|
227
|
-
className:
|
|
235
|
+
className: n,
|
|
228
236
|
orientation: d,
|
|
229
|
-
...
|
|
230
|
-
}) => d === "left" ? /* @__PURE__ */
|
|
231
|
-
|
|
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__ */
|
|
238
|
-
|
|
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
|
-
|
|
250
|
+
n
|
|
243
251
|
),
|
|
244
|
-
...
|
|
252
|
+
...i
|
|
245
253
|
}
|
|
246
254
|
)
|
|
247
255
|
}
|
|
248
|
-
) : d === "right" ? /* @__PURE__ */
|
|
249
|
-
|
|
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__ */
|
|
256
|
-
|
|
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
|
-
|
|
268
|
+
n
|
|
261
269
|
),
|
|
262
|
-
...
|
|
270
|
+
...i
|
|
263
271
|
}
|
|
264
272
|
)
|
|
265
273
|
}
|
|
266
|
-
) : /* @__PURE__ */
|
|
267
|
-
|
|
274
|
+
) : /* @__PURE__ */ r(
|
|
275
|
+
E,
|
|
268
276
|
{
|
|
269
|
-
className: e("size-comp-calendar-ico-size",
|
|
270
|
-
...
|
|
277
|
+
className: e("size-comp-calendar-ico-size", n),
|
|
278
|
+
...i
|
|
271
279
|
}
|
|
272
280
|
),
|
|
273
|
-
DayButton:
|
|
274
|
-
WeekNumber: ({ children:
|
|
275
|
-
...
|
|
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
|
-
},
|
|
281
|
-
className:
|
|
282
|
-
day:
|
|
288
|
+
}, F = ({
|
|
289
|
+
className: u,
|
|
290
|
+
day: c,
|
|
283
291
|
modifiers: o,
|
|
284
|
-
children:
|
|
285
|
-
disabled:
|
|
286
|
-
...
|
|
292
|
+
children: l,
|
|
293
|
+
disabled: a,
|
|
294
|
+
...m
|
|
287
295
|
}) => {
|
|
288
|
-
const
|
|
289
|
-
return
|
|
290
|
-
var
|
|
291
|
-
o.focused && ((
|
|
292
|
-
}, [o.focused]), /* @__PURE__ */
|
|
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:
|
|
296
|
-
"data-day":
|
|
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:
|
|
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": !
|
|
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
|
-
|
|
316
|
-
|
|
323
|
+
s.day,
|
|
324
|
+
u
|
|
317
325
|
),
|
|
318
|
-
...
|
|
319
|
-
children: /* @__PURE__ */
|
|
320
|
-
|
|
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:
|
|
336
|
+
children: l
|
|
329
337
|
}
|
|
330
338
|
)
|
|
331
339
|
}
|
|
332
340
|
);
|
|
333
341
|
};
|
|
334
342
|
export {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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 @@
|
|
|
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;
|
|
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"}
|