@g4rcez/components 0.0.73 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +77 -117
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16784 -15205
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +77 -117
- package/dist/index.umd.js.map +1 -1
- package/dist/preset/preset.tailwind.js +1 -1
- package/dist/preset/src/styles/design-tokens.d.ts.map +1 -1
- package/dist/preset.tailwind.js +1 -1
- package/dist/src/components/core/render-on-view.d.ts.map +1 -1
- package/dist/src/components/core/resizable.d.ts.map +1 -1
- package/dist/src/components/display/alert.d.ts.map +1 -1
- package/dist/src/components/display/alert.js +1 -1
- package/dist/src/components/display/calendar.d.ts +12 -20
- package/dist/src/components/display/calendar.d.ts.map +1 -1
- package/dist/src/components/display/calendar.js +23 -15
- package/dist/src/components/display/card.d.ts.map +1 -1
- package/dist/src/components/display/card.js +1 -1
- package/dist/src/components/display/empty.d.ts.map +1 -1
- package/dist/src/components/display/empty.js +1 -1
- package/dist/src/components/display/list.d.ts +1 -1
- package/dist/src/components/display/list.d.ts.map +1 -1
- package/dist/src/components/display/list.js +1 -1
- package/dist/src/components/display/notifications.d.ts.map +1 -1
- package/dist/src/components/display/notifications.js +1 -1
- package/dist/src/components/display/stats.d.ts +3 -1
- package/dist/src/components/display/stats.d.ts.map +1 -1
- package/dist/src/components/display/stats.js +1 -1
- package/dist/src/components/display/step.d.ts.map +1 -1
- package/dist/src/components/display/step.js +1 -1
- package/dist/src/components/display/tabs.d.ts.map +1 -1
- package/dist/src/components/display/timeline.d.ts.map +1 -1
- package/dist/src/components/floating/dropdown.d.ts.map +1 -1
- package/dist/src/components/floating/expand.d.ts.map +1 -1
- package/dist/src/components/floating/menu.d.ts +15 -18
- package/dist/src/components/floating/menu.d.ts.map +1 -1
- package/dist/src/components/floating/menu.js +10 -12
- package/dist/src/components/floating/modal.d.ts +8 -3
- package/dist/src/components/floating/modal.d.ts.map +1 -1
- package/dist/src/components/floating/modal.js +13 -9
- package/dist/src/components/floating/toolbar.d.ts.map +1 -1
- package/dist/src/components/floating/tooltip.d.ts.map +1 -1
- package/dist/src/components/form/autocomplete.d.ts.map +1 -1
- package/dist/src/components/form/autocomplete.js +3 -3
- package/dist/src/components/form/date-picker.d.ts +2 -66
- package/dist/src/components/form/date-picker.d.ts.map +1 -1
- package/dist/src/components/form/date-picker.js +3 -2
- package/dist/src/components/form/file-upload.d.ts.map +1 -1
- package/dist/src/components/form/form.d.ts +0 -1
- package/dist/src/components/form/form.d.ts.map +1 -1
- package/dist/src/components/form/form.js +0 -17
- package/dist/src/components/form/formReset.d.ts +2 -0
- package/dist/src/components/form/formReset.d.ts.map +1 -0
- package/dist/src/components/form/formReset.js +17 -0
- package/dist/src/components/form/free-text.d.ts +4 -5
- package/dist/src/components/form/free-text.d.ts.map +1 -1
- package/dist/src/components/form/input-field.d.ts.map +1 -1
- package/dist/src/components/form/input-field.js +3 -2
- package/dist/src/components/form/input.d.ts +2 -2
- package/dist/src/components/form/input.d.ts.map +1 -1
- package/dist/src/components/form/multi-combobox.d.ts.map +1 -1
- package/dist/src/components/form/multi-combobox.js +2 -2
- package/dist/src/components/form/radiobox.d.ts.map +1 -1
- package/dist/src/components/form/select.js +1 -1
- package/dist/src/components/form/task-list.d.ts.map +1 -1
- package/dist/src/components/form/textarea.d.ts +2 -1
- package/dist/src/components/form/textarea.d.ts.map +1 -1
- package/dist/src/components/form/transfer-list.d.ts.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/table/filter.d.ts +7 -7
- package/dist/src/components/table/filter.d.ts.map +1 -1
- package/dist/src/components/table/filter.js +1 -1
- package/dist/src/components/table/group.d.ts +3 -3
- package/dist/src/components/table/group.d.ts.map +1 -1
- package/dist/src/components/table/group.js +1 -1
- package/dist/src/components/table/index.d.ts +9 -8
- package/dist/src/components/table/index.d.ts.map +1 -1
- package/dist/src/components/table/metadata.d.ts +2 -1
- package/dist/src/components/table/metadata.d.ts.map +1 -1
- package/dist/src/components/table/pagination.d.ts.map +1 -1
- package/dist/src/components/table/pagination.js +1 -1
- package/dist/src/components/table/sort.d.ts +8 -8
- package/dist/src/components/table/sort.d.ts.map +1 -1
- package/dist/src/components/table/sort.js +2 -2
- package/dist/src/components/table/table-lib.d.ts +3 -3
- package/dist/src/components/table/table-lib.d.ts.map +1 -1
- package/dist/src/components/table/thead.d.ts +2 -2
- package/dist/src/components/table/thead.d.ts.map +1 -1
- package/dist/src/components/table/thead.js +12 -10
- package/dist/src/hooks/use-click-outside.d.ts.map +1 -1
- package/dist/src/hooks/use-color-parser.d.ts +2 -0
- package/dist/src/hooks/use-color-parser.d.ts.map +1 -0
- package/dist/src/hooks/use-color-parser.js +9 -0
- package/dist/src/hooks/use-components-provider.d.ts +17 -62
- package/dist/src/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/src/hooks/use-components-provider.js +5 -30
- package/dist/src/hooks/use-form.d.ts +20 -3
- package/dist/src/hooks/use-form.d.ts.map +1 -1
- package/dist/src/hooks/use-hover.d.ts.map +1 -1
- package/dist/src/hooks/use-locale.d.ts +3 -0
- package/dist/src/hooks/use-locale.d.ts.map +1 -0
- package/dist/src/hooks/use-locale.js +10 -0
- package/dist/src/hooks/use-media-query.d.ts.map +1 -1
- package/dist/src/hooks/use-on-event.d.ts.map +1 -1
- package/dist/src/hooks/use-parent.d.ts.map +1 -1
- package/dist/src/hooks/use-previous.d.ts.map +1 -1
- package/dist/src/hooks/use-previous.js +1 -1
- package/dist/src/hooks/use-reactive.d.ts.map +1 -1
- package/dist/src/hooks/use-remove-scroll.d.ts +2 -0
- package/dist/src/hooks/use-remove-scroll.d.ts.map +1 -0
- package/dist/src/hooks/use-remove-scroll.js +30 -0
- package/dist/src/hooks/use-stable-ref.d.ts +1 -1
- package/dist/src/hooks/use-stable-ref.d.ts.map +1 -1
- package/dist/src/hooks/use-translations.d.ts +57 -0
- package/dist/src/hooks/use-translations.d.ts.map +1 -0
- package/dist/src/hooks/use-translations.js +8 -0
- package/dist/src/hooks/use-tweaks.d.ts +3 -0
- package/dist/src/hooks/use-tweaks.d.ts.map +1 -0
- package/dist/src/hooks/use-tweaks.js +8 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/lib/dom.d.ts +2 -1
- package/dist/src/lib/dom.d.ts.map +1 -1
- package/dist/src/lib/dom.js +1 -0
- package/dist/src/lib/fns.d.ts +1 -1
- package/dist/src/lib/fns.d.ts.map +1 -1
- package/dist/src/styles/design-tokens.d.ts.map +1 -1
- package/dist/src/types.d.ts +8 -2
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +36 -26
|
@@ -48,7 +48,7 @@ var config = {
|
|
|
48
48
|
plugin(function (_a) {
|
|
49
49
|
var addVariant = _a.addVariant, theme = _a.theme, matchUtilities = _a.matchUtilities;
|
|
50
50
|
addVariant("link", ["&:hover", "&:active"]);
|
|
51
|
-
addVariant("
|
|
51
|
+
addVariant("hocus", ["&:hover", "&:focus"]);
|
|
52
52
|
addVariant("group-assert", [":merge(.group):valid:has(.input:valid:not(:placeholder-shown)) &"]);
|
|
53
53
|
addVariant("group-error", [
|
|
54
54
|
":merge(.group):invalid:has(.input:not(:focus):invalid[data-initialized=true]) &",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-tokens.d.ts","sourceRoot":"","sources":["../../../../src/styles/design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE5G,eAAO,MAAM,OAAO;;cAEN,MAAM;aACP,MAAM;aACN,MAAM;cACL,MAAM;aACP,MAAM;aACN,MAAM;4BACS,MAAM,SAAS,MAAM,MAAM,MAAM,KAAK,MAAM;CAC1B,CAAC;AAE/C,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"design-tokens.d.ts","sourceRoot":"","sources":["../../../../src/styles/design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE5G,eAAO,MAAM,OAAO;;cAEN,MAAM;aACP,MAAM;aACN,MAAM;cACL,MAAM;aACP,MAAM;aACN,MAAM;4BACS,MAAM,SAAS,MAAM,MAAM,MAAM,KAAK,MAAM;CAC1B,CAAC;AAE/C,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,aAAa,EAAE,QAAQ,CAAC,EAAE,OAAO,mBAAmB,EAAE,SAAQ,MAAW,EAAE,SAAQ,MAAW,KAAG,KAAK,EAQnI,CAAC;AAEX,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,aAAa,EAAE,EAAE,SAAS,kBAAkB,EACrF,QAAQ,CAAC,EACT,OAAO,EAAE,EACT,SAAQ,MAAW,EACnB,SAAQ,MAAW,KACpB,CAWY,CAAC;AAmBhB,eAAO,MAAM,YAAY;sBACH,KAAK,EAAE;mBACV,KAAK,EAAE;CACzB,CAAC;AAEF,KAAK,gBAAgB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,CAAC;AAE1E,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAgBjG,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,EAAE,OAAO,MAAM,WAIxD,CAAC;AAEP,eAAO,MAAM,mBAAmB,GAAI,OAAO,YAAY,EAAE,MAAM,UAAU,KAAG,aAG3E,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,OAAO,YAAY,EAAE,MAAM,UAAU,WAIjE,CAAC"}
|
package/dist/preset.tailwind.js
CHANGED
|
@@ -36,7 +36,7 @@ const config = {
|
|
|
36
36
|
forms({ strategy: "class" }),
|
|
37
37
|
plugin(function ({ addVariant, theme, matchUtilities }) {
|
|
38
38
|
addVariant("link", ["&:hover", "&:active"]);
|
|
39
|
-
addVariant("
|
|
39
|
+
addVariant("hocus", ["&:hover", "&:focus"]);
|
|
40
40
|
addVariant("group-assert", [`:merge(.group):valid:has(.input:valid:not(:placeholder-shown)) &`]);
|
|
41
41
|
addVariant("group-error", [
|
|
42
42
|
`:merge(.group):invalid:has(.input:not(:focus):invalid[data-initialized=true]) &`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-on-view.d.ts","sourceRoot":"","sources":["../../../../src/components/core/render-on-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAAC;IAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,EAAE,CAAC,CAAC,CAAC;AAY1H,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"render-on-view.d.ts","sourceRoot":"","sources":["../../../../src/components/core/render-on-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAAC;IAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,EAAE,CAAC,CAAC,CAAC;AAY1H,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,CAAC,iBAAiB,CAAC,4CAsBxF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAkD5D,eAAO,MAAM,SAAS,GAAI,cAAc,KAAK,CAAC,iBAAiB,4CAQ9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/display/alert.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAahE,KAAK,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/display/alert.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAahE,KAAK,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,4CAiB/D,CAAC;AAEF,QAAA,MAAM,aAAa;;mFAajB,CAAC;AAEH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC1E,YAAY,CAAC,OAAO,aAAa,CAAC,GAC9B,OAAO,CAAC;IACJ,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GA2CxE,CAAC"}
|
|
@@ -32,5 +32,5 @@ const alertVariants = cva("p-4 w-full block border relative rounded-lg text-sm",
|
|
|
32
32
|
});
|
|
33
33
|
export const Alert = forwardRef(function Alert({ className, theme, Icon, onClose, open = true, ...props }, ref) {
|
|
34
34
|
const close = () => onClose?.(false);
|
|
35
|
-
return (_jsx("div", { "data-open": !!open, "aria-hidden": !open, "data-component": "alert", className: css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none"), children: _jsx(Collapse, { "data-open": !!open, open: !!open, children: _jsxs(Polymorph, { ...props, ref: ref, role: "alert", "data-theme": theme, as: props.as ?? "div", className: css(alertVariants({ theme }), className), children: [_jsxs("h4", { className: "mb-2 flex items-center gap-2", children: [!Icon && theme === "success" ? _jsx(CheckCircleIcon, { size: 20 }) : null, !Icon && theme === "info" ? _jsx(InfoIcon, { size: 20 }) : null, !Icon && theme === "danger" ? _jsx(TriangleAlertIcon, { size: 20 }) : null, Icon, _jsx("span", { className: "tracking-3 text-balance text-lg font-semibold", children: props.title })] }), props.children, onClose !== undefined ? (_jsx("button", { type: "button", onClick: close, className: "absolute right-3 top-3 text-foreground transition-colors duration-300 ease-in-out hover:text-danger", children: _jsx(XIcon, { size: 20 }) })) : null] }) }) }));
|
|
35
|
+
return (_jsx("div", { "data-open": !!open, "aria-hidden": !open, "data-component": "alert", className: css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none"), children: _jsx(Collapse, { "data-open": !!open, open: !!open, children: _jsxs(Polymorph, { ...props, ref: ref, role: "alert", "data-theme": theme, as: props.as ?? "div", className: css(alertVariants({ theme }), className), children: [_jsxs("h4", { className: "mb-2 flex items-center gap-2", children: [!Icon && theme === "success" ? _jsx(CheckCircleIcon, { size: 20 }) : null, !Icon && theme === "info" ? _jsx(InfoIcon, { size: 20 }) : null, !Icon && theme === "danger" ? _jsx(TriangleAlertIcon, { size: 20 }) : null, Icon, _jsx("span", { className: "tracking-3 text-balance text-lg font-semibold", children: props.title })] }), props.children, onClose !== undefined && open ? (_jsx("button", { type: "button", onClick: close, className: "absolute right-3 top-3 text-foreground transition-colors duration-300 ease-in-out hover:text-danger", children: _jsx(XIcon, { size: 20 }) })) : null] }) }) }));
|
|
36
36
|
});
|
|
@@ -6,43 +6,35 @@ type Range = {
|
|
|
6
6
|
};
|
|
7
7
|
type OnChangeDate = (d: Date | undefined) => void;
|
|
8
8
|
type OnChangeRange = (d: Range | undefined) => void;
|
|
9
|
+
type DateStyle = (d: Date) => string;
|
|
9
10
|
type CalendarStyles = Partial<{
|
|
10
|
-
day: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
calendar: string;
|
|
11
|
+
day: string | DateStyle;
|
|
12
|
+
weekDay: string | DateStyle;
|
|
13
|
+
dayFrame: string | DateStyle;
|
|
14
|
+
week: string | ((week: Date[]) => string);
|
|
15
|
+
calendar: string | ((daysOfMonth: Date[]) => string);
|
|
15
16
|
}>;
|
|
16
|
-
export type CalendarProps
|
|
17
|
-
|
|
17
|
+
export type CalendarProps = Partial<{
|
|
18
|
+
date: Date;
|
|
19
|
+
range: Range;
|
|
18
20
|
markRange: boolean;
|
|
19
21
|
markToday: boolean;
|
|
20
22
|
rangeMode: boolean;
|
|
21
23
|
styles: CalendarStyles;
|
|
22
24
|
changeOnlyOnClick: boolean;
|
|
25
|
+
locale: Locales | undefined;
|
|
23
26
|
onChangeYear: (d: Date) => void;
|
|
24
27
|
onChangeMonth: (d: Date) => void;
|
|
25
28
|
RenderOnDay: React.FC<{
|
|
26
29
|
date: Date;
|
|
27
30
|
}>;
|
|
28
31
|
disabledDate: (date: Date) => boolean;
|
|
32
|
+
onChange: OnChangeRange | OnChangeDate;
|
|
29
33
|
labelRange: {
|
|
30
34
|
to: string;
|
|
31
35
|
from: string;
|
|
32
36
|
};
|
|
33
|
-
}
|
|
34
|
-
date: Date;
|
|
35
|
-
onChange: OnChangeDate;
|
|
36
|
-
} : T extends "range" ? {
|
|
37
|
-
range: Range;
|
|
38
|
-
onChange: OnChangeRange;
|
|
39
|
-
} : {}) & ({
|
|
40
|
-
date: Date;
|
|
41
|
-
onChange: OnChangeDate;
|
|
42
|
-
} | {
|
|
43
|
-
range: Range;
|
|
44
|
-
onChange: OnChangeRange;
|
|
45
|
-
})>;
|
|
37
|
+
}>;
|
|
46
38
|
export declare const Calendar: ({ RenderOnDay, changeOnlyOnClick, labelRange, disabledDate, locale, markToday, onChangeMonth, onChangeYear, rangeMode, onChange, styles, markRange, ...props }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
39
|
export {};
|
|
48
40
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/display/calendar.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAqB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/display/calendar.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAqB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAsBvD,KAAK,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAExC,KAAK,YAAY,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;AAElD,KAAK,aAAa,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,KAAK,IAAI,CAAC;AAEpD,KAAK,SAAS,GAAG,CAAC,CAAC,EAAE,IAAI,KAAK,MAAM,CAAC;AAErC,KAAK,cAAc,GAAG,OAAO,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,MAAM,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,MAAM,CAAC,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;IAChC,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACtC,QAAQ,EAAE,aAAa,GAAG,YAAY,CAAC;IACvC,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,CAAC,CAAC;AAwIH,eAAO,MAAM,QAAQ,GAAI,gKActB,aAAa,4CAkQf,CAAC"}
|
|
@@ -8,7 +8,8 @@ import { Is } from "sidekicker";
|
|
|
8
8
|
import TheMaskInput from "the-mask-input";
|
|
9
9
|
import { useReducer } from "use-typed-reducer";
|
|
10
10
|
import { useDebounce } from "../../hooks/use-debounce";
|
|
11
|
-
import { useLocale
|
|
11
|
+
import { useLocale } from "../../hooks/use-locale";
|
|
12
|
+
import { useTranslations } from "../../hooks/use-translations";
|
|
12
13
|
import { css } from "../../lib/dom";
|
|
13
14
|
import { splitInto, uuid } from "../../lib/fns";
|
|
14
15
|
const transition = { type: "spring", bounce: 0.3, duration: 0.6 };
|
|
@@ -38,7 +39,7 @@ const onChangeUsingKeyboard = {
|
|
|
38
39
|
const focusDate = (origin, root, next, delay = 0) => {
|
|
39
40
|
const d = next.toISOString();
|
|
40
41
|
const select = () => {
|
|
41
|
-
if (
|
|
42
|
+
if (origin?.dataset.focustrap) {
|
|
42
43
|
const el = root.current?.querySelector(`button[data-focustrap="${origin?.dataset.focustrap}"]`);
|
|
43
44
|
return setTimeout(() => el?.focus({ preventScroll: false }), delay);
|
|
44
45
|
}
|
|
@@ -60,17 +61,21 @@ const inRange = (start, middle, end) => {
|
|
|
60
61
|
};
|
|
61
62
|
const CalendarBody = (props) => {
|
|
62
63
|
const translate = useTranslations();
|
|
63
|
-
return (_jsx(motion.tbody, { layout: true, variants: variants, custom: props.direction, onKeyDown: props.onKeyDown, className: css(props.styles?.week), children: props.zip.map((week, index) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
return (_jsx(motion.tbody, { layout: true, variants: variants, custom: props.direction, onKeyDown: props.onKeyDown, className: css(props.styles?.week), children: props.zip.map((week, index) => {
|
|
65
|
+
const weekClassName = Is.function(props.styles?.week) ? props.styles?.week(week) : props.styles?.week;
|
|
66
|
+
return (_jsx("tr", { className: weekClassName, children: week.map((day) => {
|
|
67
|
+
const key = day.toISOString();
|
|
68
|
+
const isSelected = props.rangeMode
|
|
69
|
+
? key === props.range?.to?.toISOString() || key === props.range?.from?.toISOString()
|
|
70
|
+
: key === props.date?.toISOString();
|
|
71
|
+
const today = isToday(day) && props.markToday;
|
|
72
|
+
const disabledByFn = props.disabledDate?.(day) || false;
|
|
73
|
+
const sameMonth = isSameMonth(day, props.stateDate);
|
|
74
|
+
const disableDate = !sameMonth || disabledByFn;
|
|
75
|
+
const isInRange = props.rangeMode ? inRange(props.range?.from, day, props.range?.to) : false;
|
|
76
|
+
return (_jsxs("td", { align: "center", className: css("relative", Is.function(props.styles?.dayFrame) ? props.styles?.dayFrame(day) : props.styles?.dayFrame), children: [_jsxs("button", { type: "button", "data-date": key, disabled: disabledByFn, "data-samemonth": sameMonth, "data-range": props.rangeMode, onClick: props.dispatch.onSelectDate, "data-view": props.stateDate.getMonth().toString(), className: css(`flex size-10 items-center justify-center rounded-full proportional-nums disabled:cursor-not-allowed ${today ? "text-emphasis" : ""} ${disableDate ? "text-disabled" : ""} ${isSelected ? "bg-primary text-primary-foreground" : ""}`, isInRange && props.markRange ? "size-10 border border-dashed border-card-border" : "", Is.function(props.styles?.day) ? props.styles?.day(day) : props.styles?.day), children: [day.getDate(), isSelected && props.stateRange.from?.toISOString() === key ? (_jsx("span", { className: "absolute -top-2 left-0 h-full w-full", children: _jsx("span", { className: "text-xs text-foreground", children: props.labelRange?.from ?? translate.calendarFromDate }) })) : null, isSelected && props.stateRange.to?.toISOString() === key ? (_jsx("span", { className: "absolute -top-2 left-0 h-full w-full", children: _jsx("span", { className: "text-xs text-foreground", children: props.labelRange?.to ?? translate.calendarToDate }) })) : null] }), props.RenderOnDay ? _jsx(props.RenderOnDay, { date: day }) : null] }, key));
|
|
77
|
+
}) }, `week-${week.length}-${index}`));
|
|
78
|
+
}) }));
|
|
74
79
|
};
|
|
75
80
|
export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, disabledDate, locale, markToday = true, onChangeMonth, onChangeYear, rangeMode = false, onChange, styles, markRange = true, ...props }) => {
|
|
76
81
|
const id = useRef(uuid());
|
|
@@ -189,7 +194,8 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
189
194
|
},
|
|
190
195
|
],
|
|
191
196
|
});
|
|
192
|
-
const
|
|
197
|
+
const allDaysOfMonth = createDays(state.date);
|
|
198
|
+
const zip = splitInto(allDaysOfMonth, 7);
|
|
193
199
|
const currentAsString = state.date.toISOString();
|
|
194
200
|
const monthString = formatMonth(state.date, currentLocale);
|
|
195
201
|
useEffect(() => {
|
|
@@ -209,5 +215,7 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
209
215
|
onChangeYear?.(new Date(value));
|
|
210
216
|
defer(value);
|
|
211
217
|
};
|
|
212
|
-
return (_jsx(MotionConfig, { transition: transition, children: _jsxs("div", { "data-component": "calendar", ref: root, className: css("relative overflow-hidden", styles?.calendar), children: [_jsx("div", { className: "flex flex-col justify-center rounded text-center", children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", custom: state.direction, onExitComplete: dispatch.onExitComplete, children: _jsxs(motion.div, { initial: "enter", animate: "middle", exit: "exit", children: [_jsxs("header", { className: "relative flex justify-between", children: [_jsx(motion.button, { layout: true, type: "button", "data-focustrap": "prev", variants: removeImmediately, onClick: dispatch.previousMonth, title: translations.calendarBackMonth, className: "z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground", children: _jsx(ChevronLeftIcon, { className: "h-4 w-4" }) }), _jsx(motion.span, { layout: true, variants: variants, custom: state.direction, className: "absolute inset-0 isolate z-normal flex items-center justify-center font-semibold", children: _jsxs("span", { className: "flex w-fit items-center justify-center gap-0.5 py-1", children: [_jsx("select", { value: monthString, onChange: dispatch.onChangeMonth, style: { width: `${monthString.length + 1}ch` }, className: "cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary", children: state.months }), _jsx(TheMaskInput, { mask: "int", maxLength: 4, placeholder: "YYYY", value: state.year, onChange: internalOnChangeYear, style: { width: `${state.year.length}ch` }, className: "w-16 cursor-pointer appearance-none bg-transparent hover:text-primary" })] }) }), _jsx(motion.button, { layout: true, type: "button", "data-focustrap": "next", variants: removeImmediately, onClick: dispatch.nextMonth, title: translations.calendarNextMonth, className: "z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground", children: _jsx(ChevronRightIcon, { className: "h-4 w-4" }) }), _jsx("div", { className: "absolute inset-0", style: {
|
|
218
|
+
return (_jsx(MotionConfig, { transition: transition, children: _jsxs("div", { "data-component": "calendar", ref: root, className: css("relative overflow-hidden", Is.function(styles?.calendar) ? styles?.calendar(allDaysOfMonth) : styles?.calendar), children: [_jsx("div", { className: "flex flex-col justify-center rounded text-center", children: _jsx(AnimatePresence, { initial: false, mode: "popLayout", custom: state.direction, onExitComplete: dispatch.onExitComplete, children: _jsxs(motion.div, { initial: "enter", animate: "middle", exit: "exit", children: [_jsxs("header", { className: "relative flex justify-between", children: [_jsx(motion.button, { layout: true, type: "button", "data-focustrap": "prev", variants: removeImmediately, onClick: dispatch.previousMonth, title: translations.calendarBackMonth, className: "z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground", children: _jsx(ChevronLeftIcon, { className: "h-4 w-4" }) }), _jsx(motion.span, { layout: true, variants: variants, custom: state.direction, className: "absolute inset-0 isolate z-normal flex items-center justify-center font-semibold", children: _jsxs("span", { className: "flex w-fit items-center justify-center gap-0.5 py-1", children: [_jsx("select", { "aria-label": translations.calendarMonthLabel, value: monthString, onChange: dispatch.onChangeMonth, style: { width: `${monthString.length + 1}ch` }, className: "cursor-pointer appearance-none bg-transparent capitalize proportional-nums hover:text-primary", children: state.months }), _jsx(TheMaskInput, { mask: "int", maxLength: 4, placeholder: "YYYY", value: state.year, onChange: internalOnChangeYear, style: { width: `${state.year.length}ch` }, className: "w-16 cursor-pointer appearance-none bg-transparent hover:text-primary" })] }) }), _jsx(motion.button, { layout: true, type: "button", "data-focustrap": "next", variants: removeImmediately, onClick: dispatch.nextMonth, title: translations.calendarNextMonth, className: "z-calendar rounded-full p-1.5 hover:bg-primary hover:text-primary-foreground", children: _jsx(ChevronRightIcon, { className: "h-4 w-4" }) }), _jsx("div", { className: "absolute inset-0", style: {
|
|
219
|
+
backgroundImage: "linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)",
|
|
220
|
+
} })] }), _jsxs(motion.table, { className: "mt-2 table min-w-full table-auto border-0", children: [_jsx("thead", { children: _jsx("tr", { children: state.week.map((dayOfWeek) => (_jsx("th", { role: "columnheader", className: css("py-2 text-sm font-medium capitalize", Is.function(styles?.weekDay) ? styles.weekDay(dayOfWeek) : styles?.weekDay), children: dayOfWeek.toLocaleDateString(currentLocale, { weekday: "short" }) }, dayOfWeek.toString()))) }) }), _jsx(CalendarBody, { zip: zip, range: range, styles: styles, date: date || null, dispatch: dispatch, markRange: markRange, markToday: markToday, rangeMode: rangeMode, stateDate: state.date, labelRange: labelRange, stateRange: state.range, RenderOnDay: RenderOnDay, direction: state.direction, disabledDate: disabledDate, onKeyDown: dispatch.onKeyDown })] })] }, monthString) }) }), _jsx("footer", { className: "mt-2 text-center text-primary", children: _jsx("button", { className: "transition-transform duration-300 hover:scale-105", type: "button", onClick: dispatch.setToday, children: translations.calendarToday }) })] }) }));
|
|
213
221
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/display/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,gBAAgB,CACpC,QAAQ,CACJ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B;IACI,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CACtC,CACJ,EACD,KAAK,CACR,CAAC;AAEF,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/display/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,gBAAgB,CACpC,QAAQ,CACJ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B;IACI,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CACtC,CACJ,EACD,KAAK,CACR,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,iFASlB,iBAAiB,CAAC,SAAS,CAAC,4CAc9B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { css } from "../../lib/dom";
|
|
3
3
|
import { Polymorph } from "../core/polymorph";
|
|
4
|
-
export const Card = ({ children, title, titleClassName = "", as = "div", container = "", header = null, className = "", ...props }) => (_jsxs(Polymorph, { ...props, as: as, "data-componen": "card", className: css("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow", container), children: [title ? _jsx("header", { className: css("mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium", titleClassName), children: title }) : header, _jsx("div", { className: css("min-w-full px-8", className), children: children })] }));
|
|
4
|
+
export const Card = ({ children, title, titleClassName = "", as = "div", container = "", header = null, className = "", ...props }) => (_jsxs(Polymorph, { ...props, as: as, "data-componen": "card", className: css("flex flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-8 shadow", container), children: [title ? (_jsx("header", { className: css("mb-2 w-full border-b border-card-border px-8 pb-4 text-xl font-medium", titleClassName), children: title })) : (header), _jsx("div", { className: css("min-w-full px-8", className), children: children })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../../../src/components/display/empty.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../../../src/components/display/empty.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAStC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { FileIcon } from "lucide-react";
|
|
3
|
-
import { useTranslations } from "../../hooks/use-
|
|
3
|
+
import { useTranslations } from "../../hooks/use-translations";
|
|
4
4
|
export const Empty = (props) => {
|
|
5
5
|
const Icon = props.Icon ?? FileIcon;
|
|
6
6
|
const translate = useTranslations();
|
|
@@ -9,7 +9,7 @@ type AnimatedItemProps = {
|
|
|
9
9
|
open: () => void;
|
|
10
10
|
}>;
|
|
11
11
|
};
|
|
12
|
-
type AnimatedListProps =
|
|
12
|
+
type AnimatedListProps = object;
|
|
13
13
|
export declare const AnimatedList: (props: PropsWithChildren<AnimatedListProps>) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const AnimatedListItem: (props: PropsWithChildren<AnimatedItemProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/components/display/list.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,KAAK,iBAAiB,GAAG;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,KAAK,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;CAC5C,CAAC;AAIF,KAAK,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/components/display/list.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,KAAK,iBAAiB,GAAG;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,KAAK,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;CAC5C,CAAC;AAIF,KAAK,iBAAiB,GAAG,MAAM,CAAC;AA2DhC,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,4CAoEvE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,4CAA0C,CAAC"}
|
|
@@ -26,7 +26,7 @@ export const AnimatedList = (props) => {
|
|
|
26
26
|
const innerId = `${id}-${index}`;
|
|
27
27
|
const setter = () => setSelected({ ...item, id: innerId });
|
|
28
28
|
const Leading = item.leading;
|
|
29
|
-
return (_jsx(motion.li, { layout: true, layoutId: `item-${innerId}`, className: `border-b border-card-border py-2 last:border-transparent`, children: _jsx(motion.div, { layoutId: `toast-${innerId}`, className: "relative", children: _jsx("div", { className: "relative flex items-start space-x-3", children: _jsxs(Fragment, { children: [item.avatar ? (_jsx("div", { children: _jsx("div", { className: "relative px-1", children: _jsx("button", { onClick: setter, className: "flex size-10 items-center justify-center ring-primary", children: item.avatar }) }) })) : null, _jsx("div", { className: "min-w-0 flex-1 py-1 text-foreground", children: _jsxs("div", { className: "flex flex-row flex-nowrap justify-between gap-4", children: [_jsxs("button", { onClick: setter, className: "
|
|
29
|
+
return (_jsx(motion.li, { layout: true, layoutId: `item-${innerId}`, className: `border-b border-card-border py-2 last:border-transparent`, children: _jsx(motion.div, { layoutId: `toast-${innerId}`, className: "relative", children: _jsx("div", { className: "relative flex items-start space-x-3", children: _jsxs(Fragment, { children: [item.avatar ? (_jsx("div", { children: _jsx("div", { className: "relative px-1", children: _jsx("button", { onClick: setter, className: "flex size-10 items-center justify-center ring-primary", children: item.avatar }) }) })) : null, _jsx("div", { className: "min-w-0 flex-1 py-1 text-foreground", children: _jsxs("div", { className: "flex flex-row flex-nowrap justify-between gap-4", children: [_jsxs("button", { onClick: setter, className: "cursor-pointer text-left transition-all ease-out hover:scale-105 hover:text-primary", children: [_jsx("h3", { children: item.title }), _jsx("p", { className: "text-sm leading-snug text-secondary", children: item.description })] }), Leading ? _jsx(Leading, { open: setter }) : null] }) })] }) }) }) }, innerId));
|
|
30
30
|
}) })] }));
|
|
31
31
|
};
|
|
32
32
|
export const AnimatedListItem = (props) => _jsx(Fragment, { children: props.children });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../src/components/display/notifications.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAA8C,KAAK,iBAAiB,EAAwD,MAAM,OAAO,CAAC;AAEjJ,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,QAAA,MAAM,QAAQ;;mFAcb,CAAC;AAEF,KAAK,mBAAmB,GAAG,OAAO,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CACjD,CAAC,CAAC;AAEH,KAAK,sBAAsB,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEvE,KAAK,eAAe,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,mBAAmB,KAAK,sBAAsB,CAAC;AAM3F,eAAO,MAAM,eAAe,uBAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../src/components/display/notifications.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAA8C,KAAK,iBAAiB,EAAwD,MAAM,OAAO,CAAC;AAEjJ,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,QAAA,MAAM,QAAQ;;mFAcb,CAAC;AAEF,KAAK,mBAAmB,GAAG,OAAO,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CACjD,CAAC,CAAC;AAEH,KAAK,sBAAsB,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEvE,KAAK,eAAe,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,mBAAmB,KAAK,sBAAsB,CAAC;AAM3F,eAAO,MAAM,eAAe,uBAAwC,CAAC;AA+DrE,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE3E,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAO,EAAE,QAAe,EAAE,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,2CAuDzG"}
|
|
@@ -46,7 +46,7 @@ export function Notifications({ children, max = 5, duration = 5000 }) {
|
|
|
46
46
|
const [messages, setMessages] = useState([]);
|
|
47
47
|
const clear = useCallback(() => setMessages([]), []);
|
|
48
48
|
useEffect(() => {
|
|
49
|
-
return
|
|
49
|
+
return clear;
|
|
50
50
|
}, [clear]);
|
|
51
51
|
const notify = useCallback((text, args) => {
|
|
52
52
|
const id = window.crypto.randomUUID();
|
|
@@ -2,9 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { Label } from "../../types";
|
|
3
3
|
export type StatsProps = {
|
|
4
4
|
title: Label;
|
|
5
|
-
Icon: React.FC<any>;
|
|
6
5
|
iconContainer?: string;
|
|
7
6
|
footer?: React.ReactElement;
|
|
7
|
+
Icon: React.FC<{
|
|
8
|
+
className: string;
|
|
9
|
+
}>;
|
|
8
10
|
};
|
|
9
11
|
export declare const Stats: (props: React.PropsWithChildren<StatsProps>) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/components/display/stats.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/components/display/stats.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,4CAmB/D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { css } from "../../lib/dom";
|
|
3
3
|
export const Stats = (props) => {
|
|
4
|
-
return (_jsxs("div", { className: "divide-y divide-card-border
|
|
4
|
+
return (_jsxs("div", { className: "divide-y divide-card-border rounded-card border border-card-border bg-card-background shadow", children: [_jsxs("header", { className: "flex items-start gap-4 p-6", children: [_jsx("div", { className: css("flex aspect-square size-10 items-center justify-center rounded-card bg-primary p-8", props.iconContainer), children: _jsx("div", { children: _jsx(props.Icon, { className: "aspect-square size-10 text-primary-foreground" }) }) }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("header", { children: _jsx("h3", { className: "text-base leading-none", children: props.title }) }), _jsx("p", { className: "text-4xl font-semibold", children: props.children })] })] }), props.footer ? _jsx("footer", { className: "px-6 py-2", children: props.footer }) : null] }));
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/components/display/step.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAkB,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAmC5E,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAkBpH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/components/display/step.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAkB,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAmC5E,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAkBpH,eAAO,MAAM,cAAc,GAAI,OAAO,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,4CA6B9F,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,4CAkDpC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { motion, stagger, useAnimate } from "motion/react";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
|
-
import { useColorParser } from "../../hooks/use-
|
|
5
|
+
import { useColorParser } from "../../hooks/use-color-parser";
|
|
6
6
|
const iconTransitions = {
|
|
7
7
|
delay: 0.2,
|
|
8
8
|
duration: 0.3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/display/tabs.tsx"],"names":[],"mappings":"AAEA,OAAc,EAA2B,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAGzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,MAAM,SAAS,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAIF,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/display/tabs.tsx"],"names":[],"mappings":"AAEA,OAAc,EAA2B,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAGzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,MAAM,SAAS,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAIF,eAAO,MAAM,IAAI,GAAI,OAAO,iBAAiB,CAAC,SAAS,CAAC,4CA2FvD,CAAC;AAIF,MAAM,MAAM,QAAQ,GACd;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,GAChD;IACI,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAER,eAAO,MAAM,GAAG,GAAI,OAAO,iBAAiB,CAAC,QAAQ,CAAC,4CAGrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../../src/components/display/timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,QAAA,MAAM,OAAO;;;;cA4B+B,iBAAiB;;CAAI,CAAC;AAElE,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,OAAO,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAE3G,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../../src/components/display/timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,QAAA,MAAM,OAAO;;;;cA4B+B,iBAAiB;;CAAI,CAAC;AAElE,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,OAAO,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAE3G,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAyB5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/dropdown.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAoC,MAAM,OAAO,CAAC;AAE7F,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IACtD,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/dropdown.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAoC,MAAM,OAAO,CAAC;AAE7F,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;IACtD,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,4CAoE/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/expand.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,MAAM,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAA2B,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAU,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE1F,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/expand.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,MAAM,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAA2B,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAU,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE1F,eAAO,MAAM,MAAM,GAAI,OAAO,iBAAiB,CAAC,WAAW,CAAC,4CA4C3D,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { LucideProps } from "lucide-react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Override } from "../../types";
|
|
4
3
|
export type MenuProps = Partial<{
|
|
5
|
-
FloatingComponent: React.ElementType;
|
|
6
|
-
floatingClassName: string;
|
|
7
4
|
hover: boolean;
|
|
5
|
+
open?: boolean;
|
|
8
6
|
nested: boolean;
|
|
9
|
-
isParent: boolean;
|
|
10
7
|
asChild: boolean;
|
|
8
|
+
isParent: boolean;
|
|
11
9
|
children: React.ReactNode;
|
|
10
|
+
floatingClassName: string;
|
|
11
|
+
FloatingComponent: React.ElementType;
|
|
12
12
|
} & ({
|
|
13
13
|
label: string;
|
|
14
14
|
} | {
|
|
@@ -16,34 +16,31 @@ export type MenuProps = Partial<{
|
|
|
16
16
|
title: string;
|
|
17
17
|
})>;
|
|
18
18
|
type MenuItemProps = {
|
|
19
|
-
label: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
Right?: React.FC<LucideProps>;
|
|
22
|
-
} | {
|
|
23
|
-
label: React.ReactElement;
|
|
24
19
|
title: string;
|
|
25
20
|
disabled?: boolean;
|
|
26
21
|
Right?: React.FC<LucideProps>;
|
|
27
22
|
};
|
|
28
|
-
export declare const MenuItem: React.ForwardRefExoticComponent<
|
|
29
|
-
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "hover" | "asChild" | "
|
|
30
|
-
FloatingComponent: React.ElementType;
|
|
31
|
-
floatingClassName: string;
|
|
23
|
+
export declare const MenuItem: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof MenuItemProps> & MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "open" | "children" | "hover" | "asChild" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
32
25
|
hover: boolean;
|
|
26
|
+
open?: boolean;
|
|
33
27
|
nested: boolean;
|
|
34
|
-
isParent: boolean;
|
|
35
28
|
asChild: boolean;
|
|
29
|
+
isParent: boolean;
|
|
36
30
|
children: React.ReactNode;
|
|
31
|
+
floatingClassName: string;
|
|
32
|
+
FloatingComponent: React.ElementType;
|
|
37
33
|
} & {
|
|
38
34
|
label: string;
|
|
39
|
-
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "hover" | "asChild" | "
|
|
40
|
-
FloatingComponent: React.ElementType;
|
|
41
|
-
floatingClassName: string;
|
|
35
|
+
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "open" | "children" | "hover" | "asChild" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
42
36
|
hover: boolean;
|
|
37
|
+
open?: boolean;
|
|
43
38
|
nested: boolean;
|
|
44
|
-
isParent: boolean;
|
|
45
39
|
asChild: boolean;
|
|
40
|
+
isParent: boolean;
|
|
46
41
|
children: React.ReactNode;
|
|
42
|
+
floatingClassName: string;
|
|
43
|
+
FloatingComponent: React.ElementType;
|
|
47
44
|
} & {
|
|
48
45
|
label: React.ReactElement;
|
|
49
46
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAA2E,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAA2E,MAAM,OAAO,CAAC;AA6BhG,MAAM,MAAM,SAAS,GAAG,OAAO,CAC3B;IACI,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,KAAK,CAAC,WAAW,CAAC;CACxC,GAAG,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CACzE,CAAC;AA4KF,KAAK,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAE1F,eAAO,MAAM,QAAQ,oKAmCpB,CAAC;AAEF,eAAO,MAAM,IAAI;WA5NF,OAAO;WACP,OAAO;YACN,OAAO;aACN,OAAO;cACN,OAAO;cACP,KAAK,CAAC,SAAS;uBACN,MAAM;uBACN,KAAK,CAAC,WAAW;;WAC1B,MAAM;;WART,OAAO;WACP,OAAO;YACN,OAAO;aACN,OAAO;cACN,OAAO;cACP,KAAK,CAAC,SAAS;uBACN,MAAM;uBACN,KAAK,CAAC,WAAW;;WACN,KAAK,CAAC,YAAY;WAAS,MAAM;qDA6NrE,CAAC"}
|
|
@@ -14,8 +14,8 @@ const MenuContext = createContext({
|
|
|
14
14
|
setActiveIndex: () => { },
|
|
15
15
|
setHasFocusInside: () => { },
|
|
16
16
|
});
|
|
17
|
-
const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", hover = true, isParent, floatingClassName = "", label, ...props }, forwardedRef) => {
|
|
18
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
17
|
+
const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", hover = true, open, isParent, floatingClassName = "", label, ...props }, forwardedRef) => {
|
|
18
|
+
const [isOpen, setIsOpen] = useState(open ?? false);
|
|
19
19
|
const [hasFocusInside, setHasFocusInside] = useState(false);
|
|
20
20
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
21
21
|
const elementsRef = useRef([]);
|
|
@@ -55,7 +55,7 @@ const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", h
|
|
|
55
55
|
listRef: elementsRef,
|
|
56
56
|
activeIndex,
|
|
57
57
|
nested: isNested,
|
|
58
|
-
onNavigate: setActiveIndex
|
|
58
|
+
onNavigate: setActiveIndex,
|
|
59
59
|
});
|
|
60
60
|
const typeahead = useTypeahead(context, {
|
|
61
61
|
activeIndex,
|
|
@@ -63,9 +63,7 @@ const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", h
|
|
|
63
63
|
resetMs: TYPEAHEAD_RESET_DELAY,
|
|
64
64
|
onMatch: isOpen ? setActiveIndex : undefined,
|
|
65
65
|
});
|
|
66
|
-
const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([
|
|
67
|
-
hoverModule, click, role, dismiss, listNavigation, typeahead
|
|
68
|
-
]);
|
|
66
|
+
const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([hoverModule, click, role, dismiss, listNavigation, typeahead]);
|
|
69
67
|
useEffect(() => {
|
|
70
68
|
if (!tree)
|
|
71
69
|
return;
|
|
@@ -90,14 +88,14 @@ const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", h
|
|
|
90
88
|
}
|
|
91
89
|
}, [tree, isOpen, nodeId, parentId]);
|
|
92
90
|
const className = isParent ? props.className : css(menuItemClassName(props.className));
|
|
93
|
-
return (_jsxs(FloatingNode, { id: nodeId, children: [_jsx(Fragment, { children: props.asChild ? (_jsx(Slot, {
|
|
91
|
+
return (_jsxs(FloatingNode, { id: nodeId, children: [_jsx(Fragment, { children: props.asChild ? (_jsx(Slot, { ...getReferenceProps(parent.getItemProps({
|
|
94
92
|
...props,
|
|
95
93
|
onFocus(event) {
|
|
96
94
|
props.onFocus?.(event);
|
|
97
95
|
setHasFocusInside(false);
|
|
98
96
|
parent.setHasFocusInside(true);
|
|
99
97
|
},
|
|
100
|
-
})) })) : (_jsxs("button", { type: "button", className: className, "data-open": isOpen ? "" : undefined, "data-nested": isNested ? "" : undefined, role: isNested ? "menuitem" : undefined, "data-focus-inside": hasFocusInside ? "" : undefined, ref: useMergeRefs([refs.setReference, item.ref, forwardedRef]), tabIndex: !isNested ? undefined : parent.activeIndex === item.index ? 0 : -1, ...getReferenceProps(parent.getItemProps({
|
|
98
|
+
})), children: label, ref: useMergeRefs([refs.setReference, item.ref, forwardedRef]), tabIndex: !isNested ? undefined : parent.activeIndex === item.index ? 0 : -1, "data-open": isOpen ? "" : undefined, "data-nested": isNested ? "" : undefined, role: isNested ? "menuitem" : undefined, "data-focus-inside": hasFocusInside ? "" : undefined, className: className })) : (_jsxs("button", { type: "button", className: className, "data-open": isOpen ? "" : undefined, "data-nested": isNested ? "" : undefined, role: isNested ? "menuitem" : undefined, "data-focus-inside": hasFocusInside ? "" : undefined, ref: useMergeRefs([refs.setReference, item.ref, forwardedRef]), tabIndex: !isNested ? undefined : parent.activeIndex === item.index ? 0 : -1, ...getReferenceProps(parent.getItemProps({
|
|
101
99
|
...props,
|
|
102
100
|
onFocus(event) {
|
|
103
101
|
props.onFocus?.(event);
|
|
@@ -106,12 +104,12 @@ const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", h
|
|
|
106
104
|
},
|
|
107
105
|
})), children: [label, isNested && (_jsxs("span", { style: { marginLeft: 10, fontSize: 10 }, children: [_jsx("span", { className: "sr-only", children: "Next menu" }), _jsx(ChevronRightIcon, { size: 14 })] }))] })) }), _jsx(MenuContext.Provider, { value: { activeIndex, setActiveIndex, getItemProps, setHasFocusInside, isOpen }, children: _jsx(FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && (_jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(FloatingFocusManager, { context: context, modal: false, initialFocus: isNested ? -1 : 0, returnFocus: !isNested, children: _jsx(FloatingComponent, { ...getFloatingProps(), ref: refs.setFloating, style: { ...props.style, ...floatingStyles }, className: css("isolate z-tooltip flex flex-col items-start rounded-lg border border-floating-border bg-floating-background text-left shadow-xl outline-none", floatingClassName), children: children }) }) })) }) })] }));
|
|
108
106
|
});
|
|
109
|
-
export const MenuItem = React.forwardRef(({
|
|
107
|
+
export const MenuItem = React.forwardRef(({ title, Right, disabled, children, ...props }, forwardedRef) => {
|
|
110
108
|
const menu = useContext(MenuContext);
|
|
111
|
-
const item = useListItem({ label: disabled ? null :
|
|
109
|
+
const item = useListItem({ label: disabled ? null : title });
|
|
112
110
|
const tree = useFloatingTree();
|
|
113
111
|
const isActive = item.index === menu.activeIndex;
|
|
114
|
-
return (_jsxs("button", { ...props, type: "button", role: "menuitem", disabled: disabled, "data-active": isActive, "data-open": menu.isOpen, tabIndex: isActive ? 0 : -1, ref: useMergeRefs([item.ref, forwardedRef]), className: menuItemClassName(`${props.className ?? ""} ${isActive ? "bg-primary text-primary-foreground" : ""}`), ...menu.getItemProps({
|
|
112
|
+
return (_jsxs("button", { ...props, title: title, type: "button", role: "menuitem", disabled: disabled, "data-active": isActive, "data-open": menu.isOpen, tabIndex: isActive ? 0 : -1, ref: useMergeRefs([item.ref, forwardedRef]), className: menuItemClassName(`${props.className ?? ""} ${isActive ? "bg-primary text-primary-foreground" : ""}`), ...menu.getItemProps({
|
|
115
113
|
onClick(event) {
|
|
116
114
|
props.onClick?.(event);
|
|
117
115
|
tree?.events.emit("click");
|
|
@@ -120,7 +118,7 @@ export const MenuItem = React.forwardRef(({ label, title, Right, disabled, ...pr
|
|
|
120
118
|
props.onFocus?.(event);
|
|
121
119
|
menu.setHasFocusInside(true);
|
|
122
120
|
},
|
|
123
|
-
}), children: [
|
|
121
|
+
}), children: [children, Right ? _jsx(Right, { size: 16 }) : null] }));
|
|
124
122
|
});
|
|
125
123
|
export const Menu = React.forwardRef((props, ref) => {
|
|
126
124
|
const parentId = useFloatingParentNodeId();
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "motion/react";
|
|
2
2
|
import React, { PropsWithChildren } from "react";
|
|
3
3
|
import { Label, Override } from "../../types";
|
|
4
|
-
export type ModalProps = Override<HTMLMotionProps<"div">, {
|
|
5
|
-
|
|
4
|
+
export type ModalProps = Override<HTMLMotionProps<"div">, ({
|
|
5
|
+
title: Label;
|
|
6
|
+
ariaTitle?: string;
|
|
7
|
+
} | {
|
|
8
|
+
ariaTitle: string;
|
|
6
9
|
title?: Label;
|
|
10
|
+
}) & {
|
|
11
|
+
open: boolean;
|
|
7
12
|
footer?: Label;
|
|
8
13
|
asChild?: boolean;
|
|
9
14
|
layoutId?: string;
|
|
@@ -18,5 +23,5 @@ export type ModalProps = Override<HTMLMotionProps<"div">, {
|
|
|
18
23
|
type?: "dialog" | "drawer" | "sheet";
|
|
19
24
|
onChange: (nextState: boolean) => void;
|
|
20
25
|
}>;
|
|
21
|
-
export declare const Modal: ({ open, title, footer, asChild, trigger, children, layoutId, onChange, className, resizer, closable, forceType, overlayClassName, type: _type, position: propsPosition, overlayClickClose, ...props }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const Modal: ({ open, title, footer, asChild, trigger, children, layoutId, onChange, className, resizer, closable, forceType, overlayClassName, type: _type, position: propsPosition, overlayClickClose, ariaTitle, ...props }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
22
27
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAmB,eAAe,EAAqE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAmB,eAAe,EAAqE,MAAM,cAAc,CAAC;AACnI,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAS,MAAM,OAAO,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2D9C,MAAM,MAAM,UAAU,GAAG,QAAQ,CAC7B,eAAe,CAAC,KAAK,CAAC,EACtB,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAAG;IAC5E,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CACJ,CAAC;AAoEF,eAAO,MAAM,KAAK,GAAI,kNAmBnB,iBAAiB,CAAC,UAAU,CAAC,4CA+G/B,CAAC"}
|