@g4rcez/components 2.0.32 → 2.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/{button.js → button.jsx} +5 -3
- package/dist/components/core/heading.d.ts +1 -1
- package/dist/components/core/heading.d.ts.map +1 -1
- package/dist/components/core/heading.jsx +4 -0
- package/dist/components/core/{polymorph.js → polymorph.jsx} +1 -2
- package/dist/components/core/render-on-view.d.ts +1 -1
- package/dist/components/core/render-on-view.d.ts.map +1 -1
- package/dist/components/core/{render-on-view.js → render-on-view.jsx} +4 -3
- package/dist/components/core/resizable.d.ts +1 -1
- package/dist/components/core/resizable.d.ts.map +1 -1
- package/dist/components/core/{resizable.js → resizable.jsx} +4 -3
- package/dist/components/core/{slot.js → slot.jsx} +8 -5
- package/dist/components/core/{tag.js → tag.jsx} +6 -3
- package/dist/components/core/typography.d.ts +5 -5
- package/dist/components/core/typography.d.ts.map +1 -1
- package/dist/components/core/typography.jsx +26 -0
- package/dist/components/display/alert.d.ts +1 -1
- package/dist/components/display/alert.d.ts.map +1 -1
- package/dist/components/display/alert.jsx +56 -0
- package/dist/components/display/calendar.d.ts +1 -1
- package/dist/components/display/calendar.d.ts.map +1 -1
- package/dist/components/display/{calendar.js → calendar.jsx} +83 -21
- package/dist/components/display/card.d.ts +3 -3
- package/dist/components/display/card.d.ts.map +1 -1
- package/dist/components/display/card.jsx +43 -0
- package/dist/components/display/empty.d.ts +1 -1
- package/dist/components/display/empty.d.ts.map +1 -1
- package/dist/components/display/empty.jsx +11 -0
- package/dist/components/display/list.d.ts +2 -2
- package/dist/components/display/list.d.ts.map +1 -1
- package/dist/components/display/list.jsx +81 -0
- package/dist/components/display/notifications.d.ts +1 -1
- package/dist/components/display/notifications.d.ts.map +1 -1
- package/dist/components/display/{notifications.js → notifications.jsx} +34 -10
- package/dist/components/display/progress.d.ts +1 -1
- package/dist/components/display/progress.d.ts.map +1 -1
- package/dist/components/display/progress.jsx +13 -0
- package/dist/components/display/shortcut.d.ts +1 -1
- package/dist/components/display/shortcut.d.ts.map +1 -1
- package/dist/components/display/shortcut.jsx +23 -0
- package/dist/components/display/skeleton.d.ts +4 -4
- package/dist/components/display/skeleton.d.ts.map +1 -1
- package/dist/components/display/skeleton.jsx +14 -0
- package/dist/components/display/spinner.d.ts +2 -2
- package/dist/components/display/spinner.d.ts.map +1 -1
- package/dist/components/display/spinner.jsx +7 -0
- package/dist/components/display/stats.d.ts +1 -1
- package/dist/components/display/stats.d.ts.map +1 -1
- package/dist/components/display/stats.jsx +20 -0
- package/dist/components/display/step.d.ts +2 -2
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/step.jsx +133 -0
- package/dist/components/display/tabs.d.ts +3 -3
- package/dist/components/display/tabs.d.ts.map +1 -1
- package/dist/components/display/{tabs.js → tabs.jsx} +21 -7
- package/dist/components/display/timeline.d.ts +6 -6
- package/dist/components/display/timeline.d.ts.map +1 -1
- package/dist/components/display/timeline.jsx +25 -0
- package/dist/components/floating/command-palette.d.ts +1 -1
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/command-palette.jsx +187 -0
- package/dist/components/floating/dropdown.d.ts +1 -1
- package/dist/components/floating/dropdown.d.ts.map +1 -1
- package/dist/components/floating/{dropdown.js → dropdown.jsx} +17 -3
- package/dist/components/floating/expand.d.ts +1 -1
- package/dist/components/floating/expand.d.ts.map +1 -1
- package/dist/components/floating/{expand.js → expand.jsx} +14 -2
- package/dist/components/floating/{menu.js → menu.jsx} +52 -27
- package/dist/components/floating/modal.d.ts +10 -2
- package/dist/components/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/modal.jsx +240 -0
- package/dist/components/floating/toolbar.d.ts +1 -1
- package/dist/components/floating/toolbar.d.ts.map +1 -1
- package/dist/components/floating/toolbar.jsx +5 -0
- package/dist/components/floating/{tooltip.js → tooltip.jsx} +12 -3
- package/dist/components/floating/wizard.d.ts +1 -1
- package/dist/components/floating/wizard.d.ts.map +1 -1
- package/dist/components/floating/{wizard.js → wizard.jsx} +64 -19
- package/dist/components/form/autocomplete.jsx +276 -0
- package/dist/components/form/checkbox.jsx +12 -0
- package/dist/components/form/{date-picker.js → date-picker.jsx} +15 -4
- package/dist/components/form/file-upload.d.ts +1 -1
- package/dist/components/form/file-upload.d.ts.map +1 -1
- package/dist/components/form/file-upload.jsx +133 -0
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/{form.js → form.jsx} +2 -2
- package/dist/components/form/{free-text.js → free-text.jsx} +4 -3
- package/dist/components/form/input-field.d.ts +1 -1
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input-field.jsx +54 -0
- package/dist/components/form/multi-select.jsx +328 -0
- package/dist/components/form/radiobox.d.ts +1 -1
- package/dist/components/form/radiobox.d.ts.map +1 -1
- package/dist/components/form/radiobox.jsx +6 -0
- package/dist/components/form/select.jsx +42 -0
- package/dist/components/form/slider.d.ts +1 -1
- package/dist/components/form/slider.d.ts.map +1 -1
- package/dist/components/form/{slider.js → slider.jsx} +11 -3
- package/dist/components/form/switch.jsx +46 -0
- package/dist/components/form/task-list.d.ts +1 -1
- package/dist/components/form/task-list.d.ts.map +1 -1
- package/dist/components/form/{task-list.js → task-list.jsx} +1 -2
- package/dist/components/form/transfer-list.d.ts +1 -1
- package/dist/components/form/transfer-list.d.ts.map +1 -1
- package/dist/components/form/transfer-list.jsx +39 -0
- package/dist/components/table/filter.d.ts +2 -2
- package/dist/components/table/filter.d.ts.map +1 -1
- package/dist/components/table/{filter.js → filter.jsx} +35 -7
- package/dist/components/table/group.d.ts +1 -1
- package/dist/components/table/group.d.ts.map +1 -1
- package/dist/components/table/group.jsx +68 -0
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/{index.js → index.jsx} +10 -2
- package/dist/components/table/inner-table.d.ts +1 -1
- package/dist/components/table/inner-table.d.ts.map +1 -1
- package/dist/components/table/{inner-table.js → inner-table.jsx} +21 -9
- package/dist/components/table/metadata.d.ts +1 -1
- package/dist/components/table/metadata.d.ts.map +1 -1
- package/dist/components/table/metadata.jsx +37 -0
- package/dist/components/table/pagination.d.ts +1 -1
- package/dist/components/table/pagination.d.ts.map +1 -1
- package/dist/components/table/pagination.jsx +73 -0
- package/dist/components/table/row.d.ts +1 -1
- package/dist/components/table/row.d.ts.map +1 -1
- package/dist/components/table/row.jsx +58 -0
- package/dist/components/table/sort.d.ts +2 -2
- package/dist/components/table/sort.d.ts.map +1 -1
- package/dist/components/table/{sort.js → sort.jsx} +32 -6
- package/dist/components/table/thead.d.ts +2 -1
- package/dist/components/table/thead.d.ts.map +1 -1
- package/dist/components/table/thead.jsx +103 -0
- package/dist/config/default-translations.d.ts +1 -1
- package/dist/config/{default-translations.js → default-translations.jsx} +5 -3
- package/dist/flow/flow.d.ts +1 -1
- package/dist/flow/flow.d.ts.map +1 -1
- package/dist/flow/flow.jsx +111 -0
- package/dist/hooks/use-components-provider.d.ts +2 -2
- package/dist/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/hooks/{use-components-provider.js → use-components-provider.jsx} +2 -3
- package/dist/hooks/use-translations.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13463 -16070
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +14 -31
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/core/heading.js +0 -5
- package/dist/components/core/typography.js +0 -10
- package/dist/components/display/alert.js +0 -37
- package/dist/components/display/card.js +0 -18
- package/dist/components/display/empty.js +0 -8
- package/dist/components/display/list.js +0 -32
- package/dist/components/display/progress.js +0 -9
- package/dist/components/display/shortcut.js +0 -19
- package/dist/components/display/skeleton.js +0 -13
- package/dist/components/display/spinner.js +0 -6
- package/dist/components/display/stats.js +0 -5
- package/dist/components/display/step.js +0 -122
- package/dist/components/display/timeline.js +0 -14
- package/dist/components/floating/command-palette.js +0 -155
- package/dist/components/floating/modal.js +0 -195
- package/dist/components/floating/toolbar.js +0 -4
- package/dist/components/form/autocomplete.js +0 -247
- package/dist/components/form/checkbox.js +0 -7
- package/dist/components/form/file-upload.js +0 -88
- package/dist/components/form/input-field.js +0 -17
- package/dist/components/form/multi-select.js +0 -277
- package/dist/components/form/radiobox.js +0 -3
- package/dist/components/form/select.js +0 -31
- package/dist/components/form/switch.js +0 -36
- package/dist/components/form/transfer-list.js +0 -22
- package/dist/components/table/group.js +0 -41
- package/dist/components/table/metadata.js +0 -10
- package/dist/components/table/pagination.js +0 -42
- package/dist/components/table/row.js +0 -47
- package/dist/components/table/thead.js +0 -71
- package/dist/flow/flow.js +0 -77
- /package/dist/components/form/{formReset.js → formReset.jsx} +0 -0
- /package/dist/components/form/{input.js → input.jsx} +0 -0
- /package/dist/components/form/{textarea.js → textarea.jsx} +0 -0
- /package/dist/components/table/{table.context.js → table.context.jsx} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
|
-
import { forwardRef } from "react";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
4
3
|
import { css } from "../../lib/dom";
|
|
5
4
|
import { Polymorph } from "./polymorph";
|
|
6
5
|
/**
|
|
@@ -80,5 +79,8 @@ const buttonVariants = cva("relative overflow-hidden inline-flex duration-500 en
|
|
|
80
79
|
*/
|
|
81
80
|
export const Button = forwardRef(function Button({ className, icon, loading, theme, type = "button", size, rounded, ...props }, ref) {
|
|
82
81
|
const disabled = loading || props.disabled;
|
|
83
|
-
return (
|
|
82
|
+
return (<Polymorph {...props} ref={ref} type={type} data-theme={theme} disabled={disabled} data-loading={loading} data-component="button" aria-disabled={disabled} as={props.as ?? "button"} aria-busy={disabled || loading} onClick={disabled ? undefined : props.onClick} className={css(buttonVariants({ size, rounded, theme }), className)}>
|
|
83
|
+
{icon}
|
|
84
|
+
{props.children}
|
|
85
|
+
</Polymorph>);
|
|
84
86
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
export declare const Heading: (props: PropsWithChildren) => import("react
|
|
2
|
+
export declare const Heading: (props: PropsWithChildren) => import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/components/core/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,OAAO,GAAI,OAAO,iBAAiB,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/components/core/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,OAAO,GAAI,OAAO,iBAAiB,gCAE/C,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { forwardRef } from "react";
|
|
3
2
|
export const Polymorph = forwardRef(function InnerPolymorph(props, ref) {
|
|
4
3
|
const Element = props.as || "span";
|
|
5
|
-
return
|
|
4
|
+
return <Element ref={ref} {...props} as={undefined}/>;
|
|
6
5
|
});
|
|
@@ -3,5 +3,5 @@ import { PolymorphicProps } from "./polymorph";
|
|
|
3
3
|
export type RenderOnViewProps<T extends React.ElementType = "div"> = PolymorphicProps<{
|
|
4
4
|
onIntersection?: () => void;
|
|
5
5
|
}, T>;
|
|
6
|
-
export declare const RenderOnView: ({ children, ...props }: PropsWithChildren<RenderOnViewProps>) =>
|
|
6
|
+
export declare const RenderOnView: ({ children, ...props }: PropsWithChildren<RenderOnViewProps>) => React.JSX.Element;
|
|
7
7
|
//# sourceMappingURL=render-on-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-on-view.d.ts","sourceRoot":"","sources":["../../../src/components/core/render-on-view.tsx"],"names":[],"mappings":"AACA,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,CACjF;IACI,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,EACD,CAAC,CACJ,CAAC;AAYF,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"render-on-view.d.ts","sourceRoot":"","sources":["../../../src/components/core/render-on-view.tsx"],"names":[],"mappings":"AACA,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,CACjF;IACI,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,EACD,CAAC,CACJ,CAAC;AAYF,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,CAAC,iBAAiB,CAAC,sBAsBxF,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import React, { useLayoutEffect, useRef, useState } from "react";
|
|
4
3
|
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
5
4
|
function isInViewport(el) {
|
|
6
5
|
const rect = el.getBoundingClientRect();
|
|
@@ -26,5 +25,7 @@ export const RenderOnView = ({ children, ...props }) => {
|
|
|
26
25
|
observer.observe(div);
|
|
27
26
|
return () => observer.disconnect();
|
|
28
27
|
}, []);
|
|
29
|
-
return (
|
|
28
|
+
return (<div {...props} ref={ref}>
|
|
29
|
+
{shouldRender ? children : null}
|
|
30
|
+
</div>);
|
|
30
31
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const Resizable: ({ children }: React.PropsWithChildren) =>
|
|
2
|
+
export declare const Resizable: ({ children }: React.PropsWithChildren) => React.JSX.Element;
|
|
3
3
|
//# sourceMappingURL=resizable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,sBAQ9D,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { motion, useMotionValue } from "motion/react";
|
|
4
|
-
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
5
4
|
import { isSsr } from "../../lib/fns";
|
|
6
5
|
const defaultState = {
|
|
7
6
|
x: 0,
|
|
@@ -46,5 +45,7 @@ const useElementRect = () => {
|
|
|
46
45
|
export const Resizable = ({ children }) => {
|
|
47
46
|
const [ref, bounds] = useElementRect();
|
|
48
47
|
const h = bounds.get().height;
|
|
49
|
-
return (
|
|
48
|
+
return (<motion.div animate={{ height: h > 0 ? h : "auto" }}>
|
|
49
|
+
<div ref={ref}>{children}</div>
|
|
50
|
+
</motion.div>);
|
|
50
51
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
4
3
|
function setRef(ref, value) {
|
|
@@ -72,11 +71,15 @@ export function createSlot(ownerName) {
|
|
|
72
71
|
return child;
|
|
73
72
|
}
|
|
74
73
|
});
|
|
75
|
-
return (
|
|
74
|
+
return (<SlotClone {...slotProps} ref={forwardedRef}>
|
|
75
|
+
{React.isValidElement(newElement)
|
|
76
76
|
? React.cloneElement(newElement, undefined, newChildren)
|
|
77
|
-
: null
|
|
77
|
+
: null}
|
|
78
|
+
</SlotClone>);
|
|
78
79
|
}
|
|
79
|
-
return (
|
|
80
|
+
return (<SlotClone {...slotProps} ref={forwardedRef}>
|
|
81
|
+
{children}
|
|
82
|
+
</SlotClone>);
|
|
80
83
|
});
|
|
81
84
|
Slot.displayName = `${ownerName}.Slot`;
|
|
82
85
|
return Slot;
|
|
@@ -105,7 +108,7 @@ function createSlotClone(ownerName) {
|
|
|
105
108
|
const SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');
|
|
106
109
|
export function createSlottable(ownerName) {
|
|
107
110
|
const Slottable = ({ children }) => {
|
|
108
|
-
return
|
|
111
|
+
return <>{children}</>;
|
|
109
112
|
};
|
|
110
113
|
Slottable.displayName = `${ownerName}.Slottable`;
|
|
111
114
|
Slottable.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
|
-
import { forwardRef } from "react";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
4
3
|
import { css } from "../../lib/dom";
|
|
5
4
|
import { Polymorph } from "./polymorph";
|
|
6
5
|
const variants = {
|
|
@@ -44,5 +43,9 @@ const tagVariants = cva("inline-flex rounded-pill gap-1.5 border-0 items-center
|
|
|
44
43
|
defaultVariants: { theme: "primary", size: "default" },
|
|
45
44
|
});
|
|
46
45
|
export const Tag = forwardRef(function Tag({ className, indicator = undefined, icon, loading, theme, size, ...props }, ref) {
|
|
47
|
-
return (
|
|
46
|
+
return (<Polymorph {...props} ref={ref} data-theme={theme} data-component="tag" as={props.as ?? "span"} className={css(tagVariants({ size, theme: loading ? "loading" : theme }), className)}>
|
|
47
|
+
{indicator ? <span aria-hidden="true" className={indicatorVariant({ theme: indicator })}/> : null}
|
|
48
|
+
{icon}
|
|
49
|
+
{props.children}
|
|
50
|
+
</Polymorph>);
|
|
48
51
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
2
|
import React, { type ComponentProps } from "react";
|
|
3
3
|
import { Label } from "../../types";
|
|
4
|
-
export declare const Paragraph: (props: ComponentProps<"p">) =>
|
|
5
|
-
export declare const Description: (props: ComponentProps<"p">) =>
|
|
4
|
+
export declare const Paragraph: (props: ComponentProps<"p">) => React.JSX.Element;
|
|
5
|
+
export declare const Description: (props: ComponentProps<"p">) => React.JSX.Element;
|
|
6
6
|
export type InfoProps = {
|
|
7
7
|
info?: Label;
|
|
8
8
|
label: Label;
|
|
@@ -11,14 +11,14 @@ export type InfoProps = {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
infoDescription?: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const Info: (props: React.PropsWithChildren<InfoProps>) =>
|
|
14
|
+
export declare const Info: (props: React.PropsWithChildren<InfoProps>) => React.JSX.Element;
|
|
15
15
|
export declare const PageTitle: (props: PropsWithChildren<{
|
|
16
16
|
title: string;
|
|
17
|
-
}>) =>
|
|
17
|
+
}>) => React.JSX.Element;
|
|
18
18
|
type PageHeaderProps = {
|
|
19
19
|
title: string;
|
|
20
20
|
description: Label;
|
|
21
21
|
};
|
|
22
|
-
export declare const PageHeader: (props: PropsWithChildren<PageHeaderProps>) =>
|
|
22
|
+
export declare const PageHeader: (props: PropsWithChildren<PageHeaderProps>) => React.JSX.Element;
|
|
23
23
|
export {};
|
|
24
24
|
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/components/core/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/components/core/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,CAAC,GAAG,CAAC,sBAEnD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,cAAc,CAAC,GAAG,CAAC,sBAErD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,sBAS7D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,sBAKpE,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,KAAK,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,iBAAiB,CAAC,eAAe,CAAC,sBAWnE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
import { css } from "../../lib/dom";
|
|
3
|
+
export const Paragraph = (props) => (<p {...props} className={css("text-base leading-snug", props.className)}/>);
|
|
4
|
+
export const Description = (props) => (<p {...props} className={css("mb-kilo text-sm text-secondary", props.className)}/>);
|
|
5
|
+
export const Info = (props) => (<div className={css(`flex ${props.row ? "flex-row items-center" : "flex-col"} gap-1`, props.className)}>
|
|
6
|
+
<Fragment>
|
|
7
|
+
<span className="text-sm font-medium tracking-wide">{props.row ? `${props.label}:` : props.label}</span>
|
|
8
|
+
<span className={`w-fit ${props.disabled ? "text-disabled" : ""} ${props.row ? "text-base" : "text-lg"}`}>
|
|
9
|
+
{props.children}
|
|
10
|
+
</span>
|
|
11
|
+
</Fragment>
|
|
12
|
+
</div>);
|
|
13
|
+
export const PageTitle = (props) => (<div>
|
|
14
|
+
<h2 className="text-3xl font-bold typography tracking-wide">{props.title}</h2>
|
|
15
|
+
<p className="text-secondary typography">{props.children}</p>
|
|
16
|
+
</div>);
|
|
17
|
+
export const PageHeader = (props) => {
|
|
18
|
+
return (<header className="flex flex-row flex-wrap justify-between items-center gap-mega">
|
|
19
|
+
<div>
|
|
20
|
+
<PageTitle title={props.title}>{props.description}</PageTitle>
|
|
21
|
+
</div>
|
|
22
|
+
<div className="flex gap-kilo items-center">
|
|
23
|
+
{props.children}
|
|
24
|
+
</div>
|
|
25
|
+
</header>);
|
|
26
|
+
};
|
|
@@ -5,7 +5,7 @@ import { PolymorphicProps } from "../core/polymorph";
|
|
|
5
5
|
type CollapseProps = HTMLMotionProps<"section"> & {
|
|
6
6
|
open: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const Collapse: (props: PropsWithChildren<CollapseProps>) =>
|
|
8
|
+
export declare const Collapse: (props: PropsWithChildren<CollapseProps>) => React.JSX.Element;
|
|
9
9
|
declare const themeVariants: {
|
|
10
10
|
theme: {
|
|
11
11
|
primary: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,eAAe,EAAU,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,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,
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,eAAe,EAAU,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,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,sBAiB/D,CAAC;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;CAUlB,CAAC;AAOF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC1E,WAAW,CAAC,OAAO,aAAa,CAAC,GACjC,OAAO,CAAC;IACJ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACF,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GA6CxE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
4
|
+
import { CheckCircleIcon, InfoIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
5
|
+
import React, { forwardRef } from "react";
|
|
6
|
+
import { css } from "../../lib/dom";
|
|
7
|
+
import { Polymorph } from "../core/polymorph";
|
|
8
|
+
const variants = {
|
|
9
|
+
true: { opacity: 1, height: "auto" },
|
|
10
|
+
false: { opacity: [0.7, 0.3, 0], height: 0 },
|
|
11
|
+
};
|
|
12
|
+
const transition = {
|
|
13
|
+
type: "tween",
|
|
14
|
+
duration: 0.7,
|
|
15
|
+
ease: [0.04, 0.62, 0.23, 0.98],
|
|
16
|
+
};
|
|
17
|
+
export const Collapse = (props) => (<motion.div {...props} layout layoutRoot layoutScroll initial={false} variants={variants} exit={variants.false} transition={transition} aria-hidden={!props.open} data-component="collapse" animate={props.open.toString()} className={css("aria-hidden:pointer-events-none", props.className)}>
|
|
18
|
+
{props.children}
|
|
19
|
+
</motion.div>);
|
|
20
|
+
const themeVariants = {
|
|
21
|
+
theme: {
|
|
22
|
+
primary: "bg-alert-primary-bg text-alert-primary-text border-alert-primary-border",
|
|
23
|
+
danger: "bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",
|
|
24
|
+
info: "bg-alert-info-bg text-alert-info-text border-alert-info-border",
|
|
25
|
+
success: "bg-alert-success-bg text-alert-success-text border-alert-success-border",
|
|
26
|
+
secondary: "bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",
|
|
27
|
+
warn: "bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",
|
|
28
|
+
neutral: "bg-transparent border border-card-border text-alert-primary-text",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const alertVariants = cva("p-4 w-full block border relative rounded-lg text-sm", {
|
|
32
|
+
variants: themeVariants,
|
|
33
|
+
defaultVariants: { theme: "neutral" },
|
|
34
|
+
});
|
|
35
|
+
export const Alert = forwardRef(function Alert({ className, theme, Icon, onClose, open = true, ...props }, ref) {
|
|
36
|
+
const close = () => onClose?.(false);
|
|
37
|
+
return (<AnimatePresence presenceAffectsLayout propagate mode="sync">
|
|
38
|
+
{open ? <motion.div data-open={!!open} aria-hidden={!open} data-component="alert" className={css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none")}>
|
|
39
|
+
<Collapse data-open={!!open} open={!!open}>
|
|
40
|
+
<Polymorph {...props} ref={ref} role="alert" data-theme={theme} as={props.as ?? "div"} className={css(alertVariants({ theme }), className)}>
|
|
41
|
+
<h4 className="flex gap-2 items-center mb-2">
|
|
42
|
+
{!Icon && theme === "success" ? <CheckCircleIcon aria-hidden="true" size={20}/> : null}
|
|
43
|
+
{!Icon && theme === "info" ? <InfoIcon aria-hidden="true" size={20}/> : null}
|
|
44
|
+
{!Icon && theme === "danger" ? <TriangleAlertIcon aria-hidden="true" size={20}/> : null}
|
|
45
|
+
{Icon}
|
|
46
|
+
<span className="text-lg font-semibold tracking-3 text-balance">{props.title}</span>
|
|
47
|
+
</h4>
|
|
48
|
+
{props.children}
|
|
49
|
+
{onClose !== undefined && open ? (<button type="button" onClick={close} className="absolute top-3 right-3 transition-colors duration-300 ease-in-out text-foreground hover:text-danger">
|
|
50
|
+
<XIcon size={20}/>
|
|
51
|
+
</button>) : null}
|
|
52
|
+
</Polymorph>
|
|
53
|
+
</Collapse>
|
|
54
|
+
</motion.div> : null}
|
|
55
|
+
</AnimatePresence>);
|
|
56
|
+
});
|
|
@@ -37,6 +37,6 @@ export type CalendarProps = Partial<{
|
|
|
37
37
|
from: string;
|
|
38
38
|
};
|
|
39
39
|
}>;
|
|
40
|
-
export declare const Calendar: ({ RenderOnDay, changeOnlyOnClick, labelRange, disabledDate, locale, markToday, onChangeMonth, onChangeYear, rangeMode, onChange, styles, markRange, type, datetimeTitle, ...props }: CalendarProps) =>
|
|
40
|
+
export declare const Calendar: ({ RenderOnDay, changeOnlyOnClick, labelRange, disabledDate, locale, markToday, onChangeMonth, onChangeYear, rangeMode, onChange, styles, markRange, type, datetimeTitle, ...props }: CalendarProps) => React.JSX.Element;
|
|
41
41
|
export {};
|
|
42
42
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/display/calendar.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAqB,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA0B5D,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,M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,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,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACtC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,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,qLAgBtB,aAAa,sBA+Rf,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { add, eachDayOfInterval, endOfWeek, isAfter, isBefore, isSameMonth, isToday, setYear, startOfDay, startOfMonth, startOfWeek, sub, format, set, } from "date-fns";
|
|
4
3
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
4
|
import { AnimatePresence, motion, MotionConfig } from "motion/react";
|
|
6
|
-
import { useEffect, useRef } from "react";
|
|
5
|
+
import React, { useEffect, useRef } from "react";
|
|
7
6
|
import { Is } from "sidekicker";
|
|
8
7
|
import TheMaskInput from "the-mask-input";
|
|
9
8
|
import { useReducer } from "use-typed-reducer";
|
|
@@ -31,7 +30,9 @@ const formatMonth = (d, locale) => d.toLocaleDateString(locale, { month: "long"
|
|
|
31
30
|
const getOptionsMonth = (id, date, locale) => Array.from({ length: 12 }).map((_, i) => {
|
|
32
31
|
const month = startOfMonth(new Date(1970, i, 1).setMonth(i));
|
|
33
32
|
const label = formatMonth(month, locale);
|
|
34
|
-
return (
|
|
33
|
+
return (<option value={label} key={`${id}-${label}`} data-index={i}>
|
|
34
|
+
{label}
|
|
35
|
+
</option>);
|
|
35
36
|
});
|
|
36
37
|
const onChangeUsingKeyboard = {
|
|
37
38
|
ArrowLeft: (date, duration) => (duration === "days" ? sub(date, { days: 1 }) : sub(date, { months: 1 })),
|
|
@@ -64,9 +65,11 @@ const inRange = (start, middle, end) => {
|
|
|
64
65
|
};
|
|
65
66
|
const CalendarBody = (props) => {
|
|
66
67
|
const translate = useTranslations();
|
|
67
|
-
return (
|
|
68
|
+
return (<motion.tbody layout variants={variants} custom={props.direction} onKeyDown={props.onKeyDown} className={css(props.styles?.week)}>
|
|
69
|
+
{props.zip.map((week, index) => {
|
|
68
70
|
const weekClassName = Is.function(props.styles?.week) ? props.styles?.week(week) : props.styles?.week;
|
|
69
|
-
return (
|
|
71
|
+
return (<tr key={`week-${week.length}-${index}`} className={weekClassName}>
|
|
72
|
+
{week.map((day) => {
|
|
70
73
|
const key = day.toISOString();
|
|
71
74
|
const isSelected = props.rangeMode
|
|
72
75
|
? key === props.range?.to?.toISOString() || key === props.range?.from?.toISOString()
|
|
@@ -76,9 +79,24 @@ const CalendarBody = (props) => {
|
|
|
76
79
|
const sameMonth = isSameMonth(day, props.stateDate);
|
|
77
80
|
const disableDate = !sameMonth || disabledByFn;
|
|
78
81
|
const isInRange = props.rangeMode ? inRange(props.range?.from, day, props.range?.to) : false;
|
|
79
|
-
return (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
return (<td key={key} align="center" className={css("relative", Is.function(props.styles?.dayFrame) ? props.styles?.dayFrame(day) : props.styles?.dayFrame)}>
|
|
83
|
+
<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)}>
|
|
84
|
+
{day.getDate()}
|
|
85
|
+
{isSelected && props.stateRange.from?.toISOString() === key ? (<span className="absolute -top-2 left-0 h-full w-full">
|
|
86
|
+
<span className="text-xs text-foreground">
|
|
87
|
+
{props.labelRange?.from ?? translate.calendarFromDate}
|
|
88
|
+
</span>
|
|
89
|
+
</span>) : null}
|
|
90
|
+
{isSelected && props.stateRange.to?.toISOString() === key ? (<span className="absolute -top-2 left-0 h-full w-full">
|
|
91
|
+
<span className="text-xs text-foreground">{props.labelRange?.to ?? translate.calendarToDate}</span>
|
|
92
|
+
</span>) : null}
|
|
93
|
+
</button>
|
|
94
|
+
{props.RenderOnDay ? <props.RenderOnDay date={day}/> : null}
|
|
95
|
+
</td>);
|
|
96
|
+
})}
|
|
97
|
+
</tr>);
|
|
98
|
+
})}
|
|
99
|
+
</motion.tbody>);
|
|
82
100
|
};
|
|
83
101
|
const getToday = () => startOfDay(new Date());
|
|
84
102
|
export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, disabledDate, locale, markToday = true, onChangeMonth, onChangeYear, rangeMode = false, onChange, styles, markRange = true, type = "date", datetimeTitle, ...props }) => {
|
|
@@ -223,17 +241,61 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
223
241
|
dispatch.date(() => d);
|
|
224
242
|
onChange?.(d);
|
|
225
243
|
};
|
|
226
|
-
return (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
244
|
+
return (<MotionConfig transition={transition}>
|
|
245
|
+
<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)}>
|
|
246
|
+
<div className="flex flex-col justify-center rounded text-center">
|
|
247
|
+
<AnimatePresence initial={false} mode="popLayout" custom={state.direction} onExitComplete={dispatch.onExitComplete}>
|
|
248
|
+
<motion.div key={monthString} initial="enter" animate="middle" exit="exit">
|
|
249
|
+
<header className="relative flex justify-between">
|
|
250
|
+
<motion.button layout 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">
|
|
251
|
+
<ChevronLeftIcon className="h-4 w-4"/>
|
|
252
|
+
</motion.button>
|
|
253
|
+
<motion.span layout variants={variants} custom={state.direction} className="absolute inset-0 isolate z-normal flex items-center justify-center font-semibold">
|
|
254
|
+
<span className="flex w-fit items-center justify-center gap-0.5 py-1">
|
|
255
|
+
<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">
|
|
256
|
+
{state.months}
|
|
257
|
+
</select>
|
|
258
|
+
<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"/>
|
|
259
|
+
</span>
|
|
260
|
+
</motion.span>
|
|
261
|
+
<motion.button layout 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">
|
|
262
|
+
<ChevronRightIcon className="h-4 w-4"/>
|
|
263
|
+
</motion.button>
|
|
264
|
+
<div className="absolute inset-0" style={{
|
|
265
|
+
backgroundImage: "linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)",
|
|
266
|
+
}}/>
|
|
267
|
+
</header>
|
|
268
|
+
<motion.table className="mt-2 table min-w-full table-auto border-0">
|
|
269
|
+
<thead>
|
|
270
|
+
<tr>
|
|
271
|
+
{state.week.map((dayOfWeek) => (<th role="columnheader" key={dayOfWeek.toString()} className={css("py-2 text-sm font-medium capitalize", Is.function(styles?.weekDay) ? styles.weekDay(dayOfWeek) : styles?.weekDay)}>
|
|
272
|
+
{dayOfWeek.toLocaleDateString(currentLocale, { weekday: "short" })}
|
|
273
|
+
</th>))}
|
|
274
|
+
</tr>
|
|
275
|
+
</thead>
|
|
276
|
+
<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}/>
|
|
277
|
+
</motion.table>
|
|
278
|
+
</motion.div>
|
|
279
|
+
</AnimatePresence>
|
|
280
|
+
</div>
|
|
281
|
+
{type === "datetime" ? (<section className="grid items-center my-4">
|
|
282
|
+
<Input info={null} mask="time" optionalText=" " container="w-full" reportStatus={false} defaultValue={date ? format(date, "HH:mm") : undefined} title={datetimeTitle || translations.calendarDatetimeTitle} onChange={e => {
|
|
283
|
+
const value = e.target.value;
|
|
284
|
+
const match = timeRegex.exec(value);
|
|
285
|
+
if (!match)
|
|
286
|
+
return;
|
|
287
|
+
const hour = match.groups.hour;
|
|
288
|
+
const min = match.groups.min;
|
|
289
|
+
const d = set(state.date, { hours: Number(hour), minutes: Number(min), seconds: 0 });
|
|
290
|
+
dispatch.date(() => d);
|
|
291
|
+
onChange?.(d);
|
|
292
|
+
}}/>
|
|
293
|
+
</section>) : null}
|
|
294
|
+
<footer className="mt-2 text-center text-primary">
|
|
295
|
+
<button type="button" onClick={onSetToday} className="transition-transform duration-300 hover:scale-105">
|
|
296
|
+
{translations.calendarToday}
|
|
297
|
+
</button>
|
|
298
|
+
</footer>
|
|
299
|
+
</div>
|
|
300
|
+
</MotionConfig>);
|
|
239
301
|
};
|
|
@@ -10,8 +10,8 @@ export type CardProps<T extends React.ElementType = "div"> = PolymorphicProps<{
|
|
|
10
10
|
header?: React.ReactElement | null;
|
|
11
11
|
}, T>;
|
|
12
12
|
export declare const Card: {
|
|
13
|
-
<T extends React.ElementType = "div">({ title, loading, children, as, header, container, titleClassName, ...props }: PropsWithChildren<CardProps<T>>):
|
|
14
|
-
Title({ as, titleTag, navTag, children, ...props }: PropsWithChildren<CardHeaderTitleProps>):
|
|
13
|
+
<T extends React.ElementType = "div">({ title, loading, children, as, header, container, titleClassName, ...props }: PropsWithChildren<CardProps<T>>): React.JSX.Element;
|
|
14
|
+
Title({ as, titleTag, navTag, children, ...props }: PropsWithChildren<CardHeaderTitleProps>): React.JSX.Element;
|
|
15
15
|
};
|
|
16
16
|
export type CardHeaderTitleProps<T extends React.ElementType = "div"> = PolymorphicProps<{
|
|
17
17
|
navTag?: React.ElementType;
|
|
@@ -25,5 +25,5 @@ export type StatsCardProps = CardProps<React.ElementType> & {
|
|
|
25
25
|
mark?: string;
|
|
26
26
|
interactive?: boolean;
|
|
27
27
|
};
|
|
28
|
-
export declare const StatsCard: (props: StatsCardProps) =>
|
|
28
|
+
export declare const StatsCard: (props: StatsCardProps) => React.JSX.Element;
|
|
29
29
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/display/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGhE,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KA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import { Is } from "sidekicker";
|
|
4
|
+
import { css } from "../../lib/dom";
|
|
5
|
+
import { Polymorph } from "../core/polymorph";
|
|
6
|
+
import { Skeleton } from "./skeleton";
|
|
7
|
+
export const Card = ({ title, loading, children, as, header = null, container = "", titleClassName = "", ...props }) => (<Polymorph {...props} as={as || "div"} data-component="card" className={css("flex shadow-shadow-card flex-col gap-4 rounded-card border border-card-border bg-card-background w-full py-4", container)}>
|
|
8
|
+
{title ? (<header data-component="card-title" className={css("mb-2 w-full border-b border-card-border px-6 pb-4 text-xl font-medium", titleClassName)}>
|
|
9
|
+
{title}
|
|
10
|
+
</header>) : (header)}
|
|
11
|
+
<div data-component="card-body" className={css("min-w-full px-6", props.className)}>
|
|
12
|
+
{loading ? (<div className="flex flex-col gap-4">
|
|
13
|
+
<Skeleton className="w-full"/>
|
|
14
|
+
<Skeleton className="w-8/12"/>
|
|
15
|
+
<Skeleton className="w-10/12"/>
|
|
16
|
+
<Skeleton className="w-1/2"/>
|
|
17
|
+
</div>) : children}
|
|
18
|
+
</div>
|
|
19
|
+
</Polymorph>);
|
|
20
|
+
Card.Title = ({ as, titleTag, navTag, children, ...props }) => {
|
|
21
|
+
const Component = (as || "div");
|
|
22
|
+
const Title = (titleTag || "h2");
|
|
23
|
+
const Nav = (navTag || "nav");
|
|
24
|
+
return (<Component {...props} title={Is.string(props.title) ? props.title : undefined} className={css("flex w-full flex-col flex-wrap items-start justify-between gap-base sm:flex-row sm:items-center", props.className)}>
|
|
25
|
+
<Title className="font-semibold">{props.title}</Title>
|
|
26
|
+
{children ? (<Nav className="flex flex-col justify-start items-start sm:flex-row sm:justify-end sm:items-center gap-kilo">{children}</Nav>) : null}
|
|
27
|
+
</Component>);
|
|
28
|
+
};
|
|
29
|
+
export const StatsCard = (props) => {
|
|
30
|
+
const interactive = props.interactive ?? true;
|
|
31
|
+
const Icon = props.Icon ?? InfoIcon;
|
|
32
|
+
return (<Card {...props} title={null} loading={undefined} container="px-0 py-0" className="flex gap-4 items-center px-0">
|
|
33
|
+
<div className={`flex w-full items-center gap-4 rounded-card px-0 lg:px-0 ${interactive ? "transition-colors duration-300 ease-linear hover:bg-primary-hover/10" : ""}`}>
|
|
34
|
+
<div className={css("flex aspect-square h-[stretch] w-20 items-center justify-center rounded-l-card bg-primary p-4 text-primary-foreground", props.mark)}>
|
|
35
|
+
{<Icon size={48}/>}
|
|
36
|
+
</div>
|
|
37
|
+
<div className="flex flex-col gap-2 justify-center py-2">
|
|
38
|
+
<p className="text-lg">{props.title}</p>
|
|
39
|
+
{props.loading ? <Skeleton className="h-10"/> : <p className="text-4xl font-bold tracking-wide">{props.value}</p>}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</Card>);
|
|
43
|
+
};
|
|
@@ -4,5 +4,5 @@ export type EmptyProps = {
|
|
|
4
4
|
Icon?: React.FC<LucideProps>;
|
|
5
5
|
message?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const Empty: (props: EmptyProps) =>
|
|
7
|
+
export declare const Empty: (props: EmptyProps) => React.JSX.Element;
|
|
8
8
|
//# sourceMappingURL=empty.d.ts.map
|
|
@@ -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;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,
|
|
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,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,sBAStC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileIcon } from "lucide-react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useTranslations } from "../../hooks/use-translations";
|
|
4
|
+
export const Empty = (props) => {
|
|
5
|
+
const Icon = props.Icon ?? FileIcon;
|
|
6
|
+
const translate = useTranslations();
|
|
7
|
+
return (<div className="flex flex-col gap-4 justify-center items-center py-12 px-8 w-full">
|
|
8
|
+
<Icon size={64} className="text-disabled"/>
|
|
9
|
+
<p className="text-disabled">{props.message ?? translate.emptyDataMessage}</p>
|
|
10
|
+
</div>);
|
|
11
|
+
};
|
|
@@ -10,7 +10,7 @@ type AnimatedItemProps = {
|
|
|
10
10
|
}>;
|
|
11
11
|
};
|
|
12
12
|
type AnimatedListProps = object;
|
|
13
|
-
export declare const AnimatedList: (props: PropsWithChildren<AnimatedListProps>) =>
|
|
14
|
-
export declare const AnimatedListItem: (props: PropsWithChildren<AnimatedItemProps>) =>
|
|
13
|
+
export declare const AnimatedList: (props: PropsWithChildren<AnimatedListProps>) => React.JSX.Element;
|
|
14
|
+
export declare const AnimatedListItem: (props: PropsWithChildren<AnimatedItemProps>) => React.JSX.Element;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -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,MAAM,CAAC;AAuDhC,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,
|
|
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;AAuDhC,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,sBAoEvE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,sBAA0C,CAAC"}
|