@vkzstudio/muza-ui 1.0.6 → 1.0.8
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/Chip/Chip.d.ts +43 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.js +98 -0
- package/dist/components/Chip/Chip.stories.d.ts +9 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +23 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +101 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +14 -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 +81 -77
- 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/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/Reorderable/Reorderable.d.ts +100 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.js +197 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts +14 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -0
- package/dist/components/Reorderable/index.d.ts +2 -0
- package/dist/components/Reorderable/index.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +40 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +175 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +18 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -0
- package/dist/components/ReorderableTable/index.d.ts +2 -0
- package/dist/components/ReorderableTable/index.d.ts.map +1 -0
- package/dist/components/Searchbar/Searchbar.d.ts +1 -1
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.js +50 -49
- 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 +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +217 -189
- 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/node_modules/framer-motion/dist/es/components/Reorder/Group.js +38 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +29 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- 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 +56 -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 +56 -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 +56 -0
- package/dist/translations/types.d.ts +126 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -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,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const chipVariants: (props?: ({
|
|
3
|
+
checked?: boolean | null | undefined;
|
|
4
|
+
disabled?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Props for the Chip component.
|
|
8
|
+
* Extends standard button HTML attributes, excluding 'onChange' and 'disabled' to use custom implementations.
|
|
9
|
+
*/
|
|
10
|
+
export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'disabled'> {
|
|
11
|
+
/**
|
|
12
|
+
* The checked state of the chip.
|
|
13
|
+
* When true, the chip displays a filled check icon and active styling.
|
|
14
|
+
*/
|
|
15
|
+
checked: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function triggered when the chip's checked state changes.
|
|
18
|
+
* @param checked - The new checked state
|
|
19
|
+
*/
|
|
20
|
+
onCheckedChange: (checked: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the chip is disabled.
|
|
23
|
+
* When true, prevents interaction and applies disabled styling.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A selectable chip component that acts as a toggleable filter or option.
|
|
30
|
+
* Displays as a pill-shaped button with an icon indicating its checked state.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const [checked, setChecked] = React.useState(false)
|
|
35
|
+
*
|
|
36
|
+
* <Chip checked={checked} onCheckedChange={setChecked}>
|
|
37
|
+
* Option Label
|
|
38
|
+
* </Chip>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
export { Chip, chipVariants };
|
|
43
|
+
//# sourceMappingURL=Chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,QAAA,MAAM,YAAY;;;8EA0CjB,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,SACf,SAAQ,IAAI,CACV,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,UAAU,GAAG,UAAU,CACxB;IACD;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,IAAI,qFA6CT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { cva as m } from "class-variance-authority";
|
|
4
|
+
import { EmptyCircle as f } from "../Icons/CustomIcons.js";
|
|
5
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
6
|
+
import { cn as x } from "../../utils/cn.js";
|
|
7
|
+
import { CheckCircleBold as b } from "@solar-icons/react-perf";
|
|
8
|
+
const v = m(
|
|
9
|
+
[
|
|
10
|
+
"inline-flex items-center gap-xs rounded-full px-md py-sm",
|
|
11
|
+
"cursor-pointer transition-colors",
|
|
12
|
+
"focus-visible-default",
|
|
13
|
+
"[&>svg]:size-icon-small [&>svg]:shrink-0",
|
|
14
|
+
"border-1 border-stroke-base-primary"
|
|
15
|
+
],
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
checked: {
|
|
19
|
+
true: [
|
|
20
|
+
"bg-surface-brand-primary",
|
|
21
|
+
"border-surface-brand-primary",
|
|
22
|
+
"text-text-invert-def",
|
|
23
|
+
"[&>svg]:text-icon-invert-def"
|
|
24
|
+
],
|
|
25
|
+
false: [
|
|
26
|
+
"text-text-dark-secondary",
|
|
27
|
+
"[&>svg]:text-icon-dark-secondary-def",
|
|
28
|
+
"hover:text-text-brand-hover",
|
|
29
|
+
"hover:bg-surface-brand-brand-tertiary",
|
|
30
|
+
"hover:[&>svg]:text-icon-brand-hover"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
true: [
|
|
35
|
+
"cursor-not-allowed",
|
|
36
|
+
"text-text-dark-disabled",
|
|
37
|
+
"[&>svg]:text-icon-dark-tertiary",
|
|
38
|
+
"hover:bg-transparent",
|
|
39
|
+
"hover:text-text-dark-disabled",
|
|
40
|
+
"hover:[&>svg]:text-icon-dark-tertiary"
|
|
41
|
+
],
|
|
42
|
+
false: ""
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
checked: !1,
|
|
47
|
+
disabled: !1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
), h = l.forwardRef(
|
|
51
|
+
({
|
|
52
|
+
className: a,
|
|
53
|
+
checked: r,
|
|
54
|
+
onCheckedChange: o,
|
|
55
|
+
disabled: e = !1,
|
|
56
|
+
children: i,
|
|
57
|
+
...s
|
|
58
|
+
}, n) => {
|
|
59
|
+
const d = () => {
|
|
60
|
+
e || o(!r);
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */ c(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
ref: n,
|
|
66
|
+
type: "button",
|
|
67
|
+
role: "checkbox",
|
|
68
|
+
"aria-checked": r,
|
|
69
|
+
"aria-disabled": e,
|
|
70
|
+
disabled: e,
|
|
71
|
+
"data-state": r ? "checked" : "unchecked",
|
|
72
|
+
className: x(v({ checked: r, disabled: e, className: a })),
|
|
73
|
+
onClick: d,
|
|
74
|
+
...s,
|
|
75
|
+
children: [
|
|
76
|
+
r ? /* @__PURE__ */ t(b, {}) : /* @__PURE__ */ t(f, {}),
|
|
77
|
+
/* @__PURE__ */ t(
|
|
78
|
+
p,
|
|
79
|
+
{
|
|
80
|
+
component: "span",
|
|
81
|
+
variant: "body",
|
|
82
|
+
weight: "medium",
|
|
83
|
+
size: "base",
|
|
84
|
+
fixY: !0,
|
|
85
|
+
className: "text-inherit",
|
|
86
|
+
children: i
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
h.displayName = "Chip";
|
|
95
|
+
export {
|
|
96
|
+
h as Chip,
|
|
97
|
+
v as chipVariants
|
|
98
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Chip } from './Chip';
|
|
3
|
+
declare const meta: Meta<typeof Chip>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Chip>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AllStates: Story;
|
|
8
|
+
export declare const ChipGroup: Story;
|
|
9
|
+
//# sourceMappingURL=Chip.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA0C3B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KA+BvB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAmDvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const dataTableCellVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "white" | null | undefined;
|
|
5
|
+
position?: "first" | "last" | "middle" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface DataTableColumn<T> {
|
|
8
|
+
dataKey: keyof T;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
lineClamp?: boolean | 1 | 2;
|
|
12
|
+
render?: (value: T[keyof T], rowData: T, rowIndex: number, disabled?: boolean) => ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface DataTableProps<T> extends Omit<React.HTMLAttributes<HTMLTableElement>, 'children'>, VariantProps<typeof dataTableCellVariants> {
|
|
15
|
+
data: T[];
|
|
16
|
+
columns: DataTableColumn<T>[];
|
|
17
|
+
showHeader?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const DataTable: <T>({ data, columns, showHeader, className, variant, disabled, ...props }: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { DataTable, dataTableCellVariants };
|
|
23
|
+
//# 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;AACtC,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,qBAAqB;;;8EAmB1B,CAAA;AAED,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,CACP,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EACjB,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,OAAO,KACf,SAAS,CAAA;CACf;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,CAC/B,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,EAC9D,YAAY,CAAC,OAAO,qBAAqB,CAAC;IAC5C,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;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,QAAA,MAAM,SAAS,GAAI,CAAC,EAAG,uEAQpB,cAAc,CAAC,CAAC,CAAC,4CAyFnB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAA"}
|