@g4rcez/components 0.1.0 → 0.2.1
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 +18002 -16413
- 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/src/styles/design-tokens.d.ts.map +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/core/tag.d.ts +1 -1
- package/dist/src/components/core/tag.js +2 -2
- 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 +7 -16
- package/dist/src/components/display/calendar.d.ts.map +1 -1
- package/dist/src/components/display/calendar.js +27 -25
- 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/tabs.js +2 -2
- package/dist/src/components/display/timeline.d.ts +8 -30
- package/dist/src/components/display/timeline.d.ts.map +1 -1
- package/dist/src/components/display/timeline.js +11 -14
- 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/modal.d.ts +5 -2
- package/dist/src/components/floating/modal.d.ts.map +1 -1
- package/dist/src/components/floating/modal.js +20 -14
- 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 +4 -4
- 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 +2 -1
- 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-select.d.ts +19 -0
- package/dist/src/components/form/multi-select.d.ts.map +1 -0
- package/dist/src/components/form/{multi-combobox.js → multi-select.js} +26 -19
- 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 +3 -1
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +3 -1
- 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 +7 -7
- 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/config/context.d.ts +17 -0
- package/dist/src/config/context.d.ts.map +1 -0
- package/dist/src/config/context.js +10 -0
- package/dist/src/config/default-translations.d.ts +59 -0
- package/dist/src/config/default-translations.d.ts.map +1 -0
- package/dist/src/config/default-translations.js +52 -0
- package/dist/src/config/default-tweaks.d.ts +7 -0
- package/dist/src/config/default-tweaks.d.ts.map +1 -0
- package/dist/src/config/default-tweaks.js +5 -0
- 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 +8 -127
- package/dist/src/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/src/hooks/use-components-provider.js +5 -89
- package/dist/src/hooks/use-debounce.d.ts +1 -0
- package/dist/src/hooks/use-debounce.d.ts.map +1 -1
- package/dist/src/hooks/use-debounce.js +1 -1
- package/dist/src/hooks/use-form.d.ts +21 -4
- 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-on-event.js +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 +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-swipe.d.ts +8 -0
- package/dist/src/hooks/use-swipe.d.ts.map +1 -0
- package/dist/src/hooks/use-swipe.js +16 -0
- 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 +9 -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 +9 -0
- package/dist/src/index.d.ts +12 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -5
- package/dist/src/lib/dict.d.ts +2 -2
- package/dist/src/lib/dict.d.ts.map +1 -1
- package/dist/src/lib/dict.js +8 -6
- package/dist/src/lib/dom.d.ts +4 -3
- package/dist/src/lib/dom.d.ts.map +1 -1
- package/dist/src/lib/dom.js +2 -1
- package/dist/src/lib/fns.d.ts +3 -2
- 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 +9 -2
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +36 -26
- package/dist/src/components/form/multi-combobox.d.ts +0 -24
- package/dist/src/components/form/multi-combobox.d.ts.map +0 -1
|
@@ -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"}
|
|
@@ -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"}
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Label } from "../../types";
|
|
4
4
|
import { PolymorphicProps } from "./polymorph";
|
|
5
5
|
declare const indicatorVariant: (props?: ({
|
|
6
|
-
theme?: "
|
|
6
|
+
theme?: "info" | "warn" | "muted" | "danger" | "primary" | "success" | "secondary" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare const tagVariants: (props?: ({
|
|
9
9
|
size?: "big" | "small" | "default" | "icon" | null | undefined;
|
|
@@ -9,7 +9,7 @@ const indicatorVariant = cva("size-2.5 aspect-square rounded-full border-0", {
|
|
|
9
9
|
info: "bg-info",
|
|
10
10
|
warn: "bg-warn",
|
|
11
11
|
muted: "bg-muted",
|
|
12
|
-
|
|
12
|
+
primary: "bg-primary",
|
|
13
13
|
danger: "bg-danger",
|
|
14
14
|
success: "bg-success",
|
|
15
15
|
secondary: "bg-secondary",
|
|
@@ -40,5 +40,5 @@ const tagVariants = cva("inline-flex rounded-pill gap-1.5 border-2 border-transp
|
|
|
40
40
|
defaultVariants: { theme: "primary", size: "default" },
|
|
41
41
|
});
|
|
42
42
|
export const Tag = forwardRef(function Tag({ className, indicator = undefined, icon, loading, theme, size, ...props }, ref) {
|
|
43
|
-
return (_jsxs(Polymorph, { ...props, ref: ref, "data-theme": theme, "data-component": "tag", as: props.as ?? "span", className: css(tagVariants({ size, theme }), className), children: [indicator ? _jsx("span", { className: indicatorVariant({ theme: indicator }) }) : null, icon, props.children] }));
|
|
43
|
+
return (_jsxs(Polymorph, { ...props, ref: ref, "data-theme": theme, "data-component": "tag", as: props.as ?? "span", className: css(tagVariants({ size, theme }), className), children: [indicator ? _jsx("span", { "aria-hidden": "true", className: indicatorVariant({ theme: indicator }) }) : null, icon, props.children] }));
|
|
44
44
|
});
|
|
@@ -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 && 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] }) }) }));
|
|
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, { "aria-hidden": "true", size: 20 }) : null, !Icon && theme === "info" ? _jsx(InfoIcon, { "aria-hidden": "true", size: 20 }) : null, !Icon && theme === "danger" ? _jsx(TriangleAlertIcon, { "aria-hidden": "true", 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
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Locales } from "the-mask-input";
|
|
2
|
+
import { type Locales } from "the-mask-input";
|
|
3
3
|
type Range = {
|
|
4
4
|
from?: Date;
|
|
5
5
|
to?: Date;
|
|
@@ -14,36 +14,27 @@ type CalendarStyles = Partial<{
|
|
|
14
14
|
week: string | ((week: Date[]) => string);
|
|
15
15
|
calendar: string | ((daysOfMonth: Date[]) => string);
|
|
16
16
|
}>;
|
|
17
|
-
export type CalendarProps
|
|
18
|
-
|
|
17
|
+
export type CalendarProps = Partial<{
|
|
18
|
+
date: Date;
|
|
19
|
+
range: Range;
|
|
19
20
|
markRange: boolean;
|
|
20
21
|
markToday: boolean;
|
|
21
22
|
rangeMode: boolean;
|
|
22
23
|
styles: CalendarStyles;
|
|
23
24
|
changeOnlyOnClick: boolean;
|
|
25
|
+
locale: Locales | undefined;
|
|
24
26
|
onChangeYear: (d: Date) => void;
|
|
25
27
|
onChangeMonth: (d: Date) => void;
|
|
26
28
|
RenderOnDay: React.FC<{
|
|
27
29
|
date: Date;
|
|
28
30
|
}>;
|
|
29
31
|
disabledDate: (date: Date) => boolean;
|
|
32
|
+
onChange: OnChangeRange | OnChangeDate;
|
|
30
33
|
labelRange: {
|
|
31
34
|
to: string;
|
|
32
35
|
from: string;
|
|
33
36
|
};
|
|
34
|
-
}
|
|
35
|
-
date: Date;
|
|
36
|
-
onChange: OnChangeDate;
|
|
37
|
-
} : T extends "range" ? {
|
|
38
|
-
range: Range;
|
|
39
|
-
onChange: OnChangeRange;
|
|
40
|
-
} : {}) & ({
|
|
41
|
-
date: Date;
|
|
42
|
-
onChange: OnChangeDate;
|
|
43
|
-
} | {
|
|
44
|
-
range: Range;
|
|
45
|
-
onChange: OnChangeRange;
|
|
46
|
-
})>;
|
|
37
|
+
}>;
|
|
47
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;
|
|
48
39
|
export {};
|
|
49
40
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/display/calendar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/display/calendar.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAuB5D,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;AA0IH,eAAO,MAAM,QAAQ,GAAI,gKActB,aAAa,4CAkQf,CAAC"}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { AnimatePresence, motion, MotionConfig } from "motion/react";
|
|
3
|
+
import { add, eachDayOfInterval, endOfWeek, isAfter, isBefore, isSameMonth, isToday, setYear, startOfDay, startOfMonth, startOfWeek, sub, } from "date-fns";
|
|
5
4
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
|
+
import { AnimatePresence, motion, MotionConfig } from "motion/react";
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
7
7
|
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 { useSwipe } from "../../hooks/use-swipe";
|
|
13
|
+
import { useTranslations } from "../../hooks/use-translations";
|
|
12
14
|
import { css } from "../../lib/dom";
|
|
13
15
|
import { splitInto, uuid } from "../../lib/fns";
|
|
14
16
|
const transition = { type: "spring", bounce: 0.3, duration: 0.6 };
|
|
15
17
|
const dir = (mod) => (n = 1) => ({ x: `${100 * mod * n}%`, opacity: 0.25 });
|
|
16
18
|
const variants = {
|
|
17
|
-
middle: { x: "0%", opacity: 1 },
|
|
18
19
|
enter: dir(1),
|
|
19
20
|
exit: dir(-1),
|
|
21
|
+
middle: { x: "0%", opacity: 1 },
|
|
20
22
|
};
|
|
21
23
|
const removeImmediately = { exit: { visibility: "hidden" } };
|
|
22
24
|
const createDays = (month) => {
|
|
23
25
|
const start = startOfWeek(startOfMonth(month));
|
|
24
|
-
return eachDayOfInterval({ start, end:
|
|
26
|
+
return eachDayOfInterval({ start, end: add(start, { days: 41 }) });
|
|
25
27
|
};
|
|
26
28
|
const formatMonth = (d, locale) => d.toLocaleDateString(locale, { month: "long" });
|
|
27
29
|
const getOptionsMonth = (id, date, locale) => Array.from({ length: 12 }).map((_, i) => {
|
|
@@ -30,15 +32,15 @@ const getOptionsMonth = (id, date, locale) => Array.from({ length: 12 }).map((_,
|
|
|
30
32
|
return (_jsx("option", { value: label, "data-index": i, children: label }, `${id}-${label}`));
|
|
31
33
|
});
|
|
32
34
|
const onChangeUsingKeyboard = {
|
|
33
|
-
ArrowLeft: (date, duration) => (duration === "days" ?
|
|
34
|
-
ArrowRight: (date, duration) => (duration === "days" ?
|
|
35
|
-
ArrowUp: (date, duration) => (duration === "days" ?
|
|
36
|
-
ArrowDown: (date, duration) => (duration === "days" ?
|
|
35
|
+
ArrowLeft: (date, duration) => (duration === "days" ? sub(date, { days: 1 }) : sub(date, { months: 1 })),
|
|
36
|
+
ArrowRight: (date, duration) => (duration === "days" ? add(date, { days: 1 }) : add(date, { months: 1 })),
|
|
37
|
+
ArrowUp: (date, duration) => (duration === "days" ? sub(date, { weeks: 1 }) : sub(date, { years: 1 })),
|
|
38
|
+
ArrowDown: (date, duration) => (duration === "days" ? add(date, { weeks: 1 }) : add(date, { years: 1 })),
|
|
37
39
|
};
|
|
38
40
|
const focusDate = (origin, root, next, delay = 0) => {
|
|
39
41
|
const d = next.toISOString();
|
|
40
42
|
const select = () => {
|
|
41
|
-
if (
|
|
43
|
+
if (origin?.dataset.focustrap) {
|
|
42
44
|
const el = root.current?.querySelector(`button[data-focustrap="${origin?.dataset.focustrap}"]`);
|
|
43
45
|
return setTimeout(() => el?.focus({ preventScroll: false }), delay);
|
|
44
46
|
}
|
|
@@ -76,6 +78,7 @@ const CalendarBody = (props) => {
|
|
|
76
78
|
}) }, `week-${week.length}-${index}`));
|
|
77
79
|
}) }));
|
|
78
80
|
};
|
|
81
|
+
const setToday = () => startOfDay(new Date());
|
|
79
82
|
export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, disabledDate, locale, markToday = true, onChangeMonth, onChangeYear, rangeMode = false, onChange, styles, markRange = true, ...props }) => {
|
|
80
83
|
const id = useRef(uuid());
|
|
81
84
|
const translations = useTranslations();
|
|
@@ -95,7 +98,6 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
95
98
|
week: eachDayOfInterval({ start: startOfWeek(providedDate), end: endOfWeek(providedDate) }),
|
|
96
99
|
}, (get) => ({
|
|
97
100
|
onChangeYear: (year) => ({ year }),
|
|
98
|
-
setToday: () => ({ date: startOfDay(new Date()) }),
|
|
99
101
|
onExitComplete: () => {
|
|
100
102
|
focusDate(monthClicked.current || null, root, get.state().date, 200);
|
|
101
103
|
monthClicked.current = null;
|
|
@@ -106,19 +108,21 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
106
108
|
return { date: newDate, year: formatYear(newDate) };
|
|
107
109
|
},
|
|
108
110
|
nextMonth: (e) => {
|
|
109
|
-
|
|
111
|
+
if (e)
|
|
112
|
+
monthClicked.current = e.currentTarget;
|
|
110
113
|
const state = get.state();
|
|
111
114
|
if (state.isAnimating)
|
|
112
115
|
return state;
|
|
113
|
-
const date =
|
|
116
|
+
const date = add(state.date, { months: 1 });
|
|
114
117
|
return { date, isAnimating: true, direction: 1, year: formatYear(date) };
|
|
115
118
|
},
|
|
116
119
|
previousMonth: (e) => {
|
|
117
|
-
|
|
120
|
+
if (e)
|
|
121
|
+
monthClicked.current = e.currentTarget;
|
|
118
122
|
const state = get.state();
|
|
119
123
|
if (state.isAnimating)
|
|
120
124
|
return state;
|
|
121
|
-
const date =
|
|
125
|
+
const date = sub(state.date, { months: 1 });
|
|
122
126
|
return { date, isAnimating: true, direction: -1, year: formatYear(date) };
|
|
123
127
|
},
|
|
124
128
|
onSelectDate: (e) => {
|
|
@@ -200,21 +204,19 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
200
204
|
useEffect(() => {
|
|
201
205
|
if (!changeOnlyOnClick)
|
|
202
206
|
onChange?.(state.date);
|
|
203
|
-
}, [currentAsString]);
|
|
204
|
-
const defer = useDebounce((y) =>
|
|
205
|
-
dispatch.date((prev) => {
|
|
206
|
-
const d = new Date(prev);
|
|
207
|
-
d.setFullYear(+y);
|
|
208
|
-
return d;
|
|
209
|
-
});
|
|
210
|
-
}, 1200);
|
|
207
|
+
}, [currentAsString, changeOnlyOnClick]);
|
|
208
|
+
const defer = useDebounce((y) => dispatch.date((prev) => setYear(new Date(prev), +y)), 1200);
|
|
211
209
|
const internalOnChangeYear = (e) => {
|
|
212
210
|
const value = e.currentTarget.value;
|
|
213
211
|
dispatch.onChangeYear(value);
|
|
214
212
|
onChangeYear?.(new Date(value));
|
|
215
213
|
defer(value);
|
|
216
214
|
};
|
|
217
|
-
|
|
215
|
+
const swipe = useSwipe((event, direction) => {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
return direction === "right" ? dispatch.previousMonth() : dispatch.nextMonth();
|
|
218
|
+
}, 10);
|
|
219
|
+
return (_jsx(MotionConfig, { transition: transition, children: _jsxs("div", { ref: root, "data-component": "calendar", onTouchEnd: swipe.onTouchEnd, onTouchStart: swipe.onTouchStart, 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", { value: monthString, onChange: dispatch.onChangeMonth, "aria-label": translations.calendarMonthLabel, 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
220
|
backgroundImage: "linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)",
|
|
219
|
-
} })] }), _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",
|
|
221
|
+
} })] }), _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", { type: "button", onClick: () => dispatch.date(setToday), className: "transition-transform duration-300 hover:scale-105", children: translations.calendarToday }) })] }) }));
|
|
220
222
|
};
|
|
@@ -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 lg:px-8 px-4 pb-4 text-xl font-medium", titleClassName), children: title })) : (header), _jsx("div", { className: css("min-w-full lg:px-8 px-4", 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;AAG1B,MAAM,MAAM,UAAU,GAAG;
|
|
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;AAG1B,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAE1D,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;
|
|
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;AAIpC,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"}
|
|
@@ -4,6 +4,7 @@ import { useMotionValue } from "motion/react";
|
|
|
4
4
|
import React, { createContext, Fragment, useContext, useEffect, useRef } from "react";
|
|
5
5
|
import { useReactive } from "../../hooks/use-reactive";
|
|
6
6
|
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
7
|
+
import { Polymorph } from "../core/polymorph";
|
|
7
8
|
import { Card } from "./card";
|
|
8
9
|
const Context = createContext("");
|
|
9
10
|
export const Tabs = (props) => {
|
|
@@ -11,7 +12,6 @@ export const Tabs = (props) => {
|
|
|
11
12
|
const left = useMotionValue(0);
|
|
12
13
|
const width = useMotionValue(0);
|
|
13
14
|
const ref = useRef(null);
|
|
14
|
-
const Render = props.useHash ? "a" : "button";
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
const header = ref.current;
|
|
17
17
|
if (header === null)
|
|
@@ -57,7 +57,7 @@ export const Tabs = (props) => {
|
|
|
57
57
|
};
|
|
58
58
|
return (_jsx(Context.Provider, { value: active, children: _jsx(Card, { className: props.className, container: "pt-0 max-w-full w-full min-w-0", header: _jsx("header", { ref: ref, className: "relative mb-2 overflow-x-auto border-b border-card-border", children: _jsx("nav", { className: "min-w-0", children: _jsx("ul", { className: "flex w-0 min-w-full flex-1 justify-start overflow-x-auto", children: items.map((x) => {
|
|
59
59
|
const inner = x.props;
|
|
60
|
-
return (_jsx("li", { "data-id": inner.id, "data-active": active === inner.id, className: "w-full border-b-2 transition-all border-card-border data-[active=true]:border-primary data-[active=true]:text-primary", children: _jsx(
|
|
60
|
+
return (_jsx("li", { "data-id": inner.id, "data-active": active === inner.id, className: "w-full border-b-2 transition-all border-card-border data-[active=true]:border-primary data-[active=true]:text-primary", children: _jsx(Polymorph, { onClick: onClick, "data-id": inner.id, "aria-current": "page", as: props.useHash ? "a" : "button", href: props.useHash ? `#${inner.id}` : undefined, className: "block w-full whitespace-nowrap px-10 py-4", children: inner.title }) }, `tab-header-${inner.id}`));
|
|
61
61
|
}) }) }) }), children: props.children }) }));
|
|
62
62
|
};
|
|
63
63
|
const useTabs = () => useContext(Context);
|
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ComponentProps, ElementType, PropsWithChildren } from "react";
|
|
2
|
+
import { PolymorphicProps } from "../core/polymorph";
|
|
3
|
+
export declare const TimelineItem: {
|
|
4
|
+
(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Icon(props: PropsWithChildren<ComponentProps<"header">>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Body<T extends ElementType = "section">(props: PropsWithChildren<PolymorphicProps<object, T>>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Right<T extends ElementType = "button">(props: PolymorphicProps<object, T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export type TimelineItemProps = {
|
|
11
|
-
id: string | number;
|
|
12
|
-
date: Date;
|
|
13
|
-
type: TimelineItemType;
|
|
14
|
-
avatar?: {
|
|
15
|
-
img?: string;
|
|
16
|
-
name: string;
|
|
17
|
-
profile?: string;
|
|
18
|
-
};
|
|
19
|
-
text?: string;
|
|
20
|
-
custom?: React.FC<{
|
|
21
|
-
item: TimelineItemProps;
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
24
|
-
export type TimelineProps = {
|
|
25
|
-
items: TimelineItemProps[];
|
|
26
|
-
Custom?: React.FC<{
|
|
27
|
-
item: TimelineItemProps;
|
|
28
|
-
}>;
|
|
29
|
-
};
|
|
30
|
-
export declare const Timeline: (props: TimelineProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export {};
|
|
9
|
+
export declare const Timeline: (props: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
32
10
|
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../../src/components/display/timeline.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../../src/components/display/timeline.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,eAAO,MAAM,YAAY;YAAW,iBAAiB;gBAOJ,iBAAiB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;SAW9C,CAAC,SAAS,WAAW,qBAAqB,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;UAQtF,CAAC,SAAS,WAAW,oBAAoB,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;CArBnH,CAAC;AA6BF,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,4CAIhD,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
record: ({ item }) => (_jsxs(Fragment, { children: [_jsxs("div", { className: "relative", children: [_jsx("img", { src: item.avatar?.img, alt: item.avatar?.name, className: "flex aspect-square size-12 items-center justify-center rounded-full bg-primary-hover" }), _jsx("span", { className: "absolute -bottom-0.5 -right-1 rounded-full rounded-tl bg-card-background px-0.5 py-px", children: _jsx(MessagesSquareIcon, { "aria-hidden": "true", className: "aspect-square size-5" }) })] }), _jsxs("div", { className: "min-w-0 flex-1 text-foreground", children: [_jsxs("div", { children: [_jsx("a", { href: item.avatar?.profile, className: "text-base font-medium text-primary", children: item.avatar?.name }), _jsxs("p", { className: "mt-0.5 text-sm", children: ["Commented ", item.date.toISOString()] })] }), _jsx("div", { className: "mt-2 text-wrap text-sm", children: _jsx("p", { children: item.text }) })] })] })),
|
|
2
|
+
import { css } from "../../lib/dom";
|
|
3
|
+
import { Polymorph } from "../core/polymorph";
|
|
4
|
+
export const TimelineItem = (props) => (_jsxs("li", { "data-component": "timeline-item", className: "relative pb-12", role: "listitem", children: [_jsx("span", { "aria-hidden": "true", className: "absolute left-6 top-8 -ml-px h-full w-0.5 bg-card-border" }), _jsx("div", { className: "relative flex items-stretch justify-start space-x-3", children: props.children })] }));
|
|
5
|
+
TimelineItem.Icon = function TimelineIcon(props) {
|
|
6
|
+
return (_jsx("header", { ...props, className: css("flex size-12 items-center justify-center rounded-full bg-primary p-2 text-primary-foreground", props.className), children: props.children }));
|
|
8
7
|
};
|
|
9
|
-
|
|
10
|
-
return (_jsx(
|
|
11
|
-
const Render = typeMap[item.type] ?? null;
|
|
12
|
-
if (Render === null && props.Custom) {
|
|
13
|
-
return _jsx(props.Custom, { item: item });
|
|
14
|
-
}
|
|
15
|
-
return (_jsx("li", { children: _jsxs("div", { className: "relative pb-8", children: [index !== props.items.length - 1 ? (_jsx("span", { "aria-hidden": "true", className: "absolute left-5 top-5 -ml-px h-full w-0.5 bg-card-border" })) : null, _jsx("div", { className: "relative flex items-start space-x-3", children: _jsx(Render, { item: item }) })] }) }, item.id));
|
|
16
|
-
}) }) }));
|
|
8
|
+
TimelineItem.Body = function TimelineItemBody(props) {
|
|
9
|
+
return (_jsx(Polymorph, { ...props, className: css("min-w-0 flex-1", props.className), children: props.children }));
|
|
17
10
|
};
|
|
11
|
+
TimelineItem.Right = function TimelineItemRight(props) {
|
|
12
|
+
return (_jsx("footer", { className: "flex gap-6 self-stretch px-4 align-baseline", children: _jsx(Polymorph, { ...props, type: "button" }) }));
|
|
13
|
+
};
|
|
14
|
+
export const Timeline = (props) => (_jsx("ul", { "data-component": "timeline", role: "list", className: "flow-root [&>li:last-child>span[aria-hidden=true]]:hidden", children: props.children }));
|
|
@@ -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,6 +1,8 @@
|
|
|
1
1
|
import { HTMLMotionProps } from "motion/react";
|
|
2
2
|
import React, { PropsWithChildren } from "react";
|
|
3
3
|
import { Label, Override } from "../../types";
|
|
4
|
+
type DialogType = "dialog" | "drawer" | "sheet";
|
|
5
|
+
type DrawerPosition = "left" | "right";
|
|
4
6
|
export type ModalProps = Override<HTMLMotionProps<"div">, ({
|
|
5
7
|
title: Label;
|
|
6
8
|
ariaTitle?: string;
|
|
@@ -13,15 +15,16 @@ export type ModalProps = Override<HTMLMotionProps<"div">, ({
|
|
|
13
15
|
asChild?: boolean;
|
|
14
16
|
layoutId?: string;
|
|
15
17
|
resizer?: boolean;
|
|
18
|
+
type?: DialogType;
|
|
16
19
|
className?: string;
|
|
17
20
|
closable?: boolean;
|
|
18
21
|
forceType?: boolean;
|
|
19
22
|
overlayClassName?: string;
|
|
23
|
+
position?: DrawerPosition;
|
|
20
24
|
overlayClickClose?: boolean;
|
|
21
|
-
position?: "left" | "right";
|
|
22
25
|
trigger?: Label | React.FC<any>;
|
|
23
|
-
type?: "dialog" | "drawer" | "sheet";
|
|
24
26
|
onChange: (nextState: boolean) => void;
|
|
25
27
|
}>;
|
|
26
28
|
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;
|
|
29
|
+
export {};
|
|
27
30
|
//# 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,EAAO,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2DnD,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD,KAAK,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvC,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,IAAI,CAAC,EAAE,UAAU,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,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CACJ,CAAC;AA2EF,eAAO,MAAM,KAAK,GAAI,kNAmBnB,iBAAiB,CAAC,UAAU,CAAC,4CA8G/B,CAAC"}
|