@mantis-core/ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +115 -15
- package/dist/components/Forms/ColorPickerInput.d.ts +10 -0
- package/dist/components/Forms/ColorPickerInput.d.ts.map +1 -0
- package/dist/components/Forms/ColorPickerInput.js +13 -0
- package/dist/components/Forms/ColorPickerInput.js.map +1 -0
- package/dist/components/Forms/Combobox.d.ts +10 -0
- package/dist/components/Forms/Combobox.d.ts.map +1 -0
- package/dist/components/Forms/Combobox.js +11 -0
- package/dist/components/Forms/Combobox.js.map +1 -0
- package/dist/components/Forms/DatePresets.d.ts +14 -0
- package/dist/components/Forms/DatePresets.d.ts.map +1 -0
- package/dist/components/Forms/DatePresets.js +55 -0
- package/dist/components/Forms/DatePresets.js.map +1 -0
- package/dist/components/Forms/OtpInput.d.ts +11 -0
- package/dist/components/Forms/OtpInput.d.ts.map +1 -0
- package/dist/components/Forms/OtpInput.js +11 -0
- package/dist/components/Forms/OtpInput.js.map +1 -0
- package/dist/components/Forms/PasswordInput.d.ts +12 -0
- package/dist/components/Forms/PasswordInput.d.ts.map +1 -0
- package/dist/components/Forms/PasswordInput.js +31 -0
- package/dist/components/Forms/PasswordInput.js.map +1 -0
- package/dist/components/Forms/RatingInput.d.ts +11 -0
- package/dist/components/Forms/RatingInput.d.ts.map +1 -0
- package/dist/components/Forms/RatingInput.js +11 -0
- package/dist/components/Forms/RatingInput.js.map +1 -0
- package/dist/components/Forms/TagsInput.d.ts +10 -0
- package/dist/components/Forms/TagsInput.d.ts.map +1 -0
- package/dist/components/Forms/TagsInput.js +11 -0
- package/dist/components/Forms/TagsInput.js.map +1 -0
- package/dist/components/auth/ChangePasswordForm.d.ts +16 -0
- package/dist/components/auth/ChangePasswordForm.d.ts.map +1 -0
- package/dist/components/auth/ChangePasswordForm.js +23 -0
- package/dist/components/auth/ChangePasswordForm.js.map +1 -0
- package/dist/components/auth/ForgotPasswordForm.d.ts +15 -0
- package/dist/components/auth/ForgotPasswordForm.d.ts.map +1 -0
- package/dist/components/auth/ForgotPasswordForm.js +14 -0
- package/dist/components/auth/ForgotPasswordForm.js.map +1 -0
- package/dist/components/auth/LoginForm.d.ts +22 -0
- package/dist/components/auth/LoginForm.d.ts.map +1 -0
- package/dist/components/auth/LoginForm.js +20 -0
- package/dist/components/auth/LoginForm.js.map +1 -0
- package/dist/components/auth/ResetPasswordForm.d.ts +16 -0
- package/dist/components/auth/ResetPasswordForm.d.ts.map +1 -0
- package/dist/components/auth/ResetPasswordForm.js +23 -0
- package/dist/components/auth/ResetPasswordForm.js.map +1 -0
- package/dist/components/auth/UserMenu.d.ts +22 -0
- package/dist/components/auth/UserMenu.d.ts.map +1 -0
- package/dist/components/auth/UserMenu.js +95 -0
- package/dist/components/auth/UserMenu.js.map +1 -0
- package/dist/components/auth/index.d.ts +11 -0
- package/dist/components/auth/index.d.ts.map +1 -0
- package/dist/components/auth/index.js +6 -0
- package/dist/components/auth/index.js.map +1 -0
- package/dist/components/charts/BarChart.d.ts +20 -0
- package/dist/components/charts/BarChart.d.ts.map +1 -0
- package/dist/components/charts/BarChart.js +28 -0
- package/dist/components/charts/BarChart.js.map +1 -0
- package/dist/components/charts/DonutChart.d.ts +21 -0
- package/dist/components/charts/DonutChart.d.ts.map +1 -0
- package/dist/components/charts/DonutChart.js +26 -0
- package/dist/components/charts/DonutChart.js.map +1 -0
- package/dist/components/charts/LineChart.d.ts +20 -0
- package/dist/components/charts/LineChart.d.ts.map +1 -0
- package/dist/components/charts/LineChart.js +27 -0
- package/dist/components/charts/LineChart.js.map +1 -0
- package/dist/components/charts/chart-setup.d.ts +3 -0
- package/dist/components/charts/chart-setup.d.ts.map +1 -0
- package/dist/components/charts/chart-setup.js +10 -0
- package/dist/components/charts/chart-setup.js.map +1 -0
- package/dist/components/charts/defaults.d.ts +13 -0
- package/dist/components/charts/defaults.d.ts.map +1 -0
- package/dist/components/charts/defaults.js +54 -0
- package/dist/components/charts/defaults.js.map +1 -0
- package/dist/components/charts/index.d.ts +9 -0
- package/dist/components/charts/index.d.ts.map +1 -0
- package/dist/components/charts/index.js +6 -0
- package/dist/components/charts/index.js.map +1 -0
- package/dist/components/data/DescriptionList.d.ts +11 -0
- package/dist/components/data/DescriptionList.d.ts.map +1 -0
- package/dist/components/data/DescriptionList.js +23 -0
- package/dist/components/data/DescriptionList.js.map +1 -0
- package/dist/components/data/StatCard.d.ts +14 -0
- package/dist/components/data/StatCard.d.ts.map +1 -0
- package/dist/components/data/StatCard.js +39 -0
- package/dist/components/data/StatCard.js.map +1 -0
- package/dist/components/data/Timeline.d.ts +15 -0
- package/dist/components/data/Timeline.d.ts.map +1 -0
- package/dist/components/data/Timeline.js +20 -0
- package/dist/components/data/Timeline.js.map +1 -0
- package/dist/components/feedback/Avatar.d.ts +9 -0
- package/dist/components/feedback/Avatar.d.ts.map +1 -0
- package/dist/components/feedback/Avatar.js +15 -0
- package/dist/components/feedback/Avatar.js.map +1 -0
- package/dist/components/feedback/CardSkeleton.d.ts +6 -0
- package/dist/components/feedback/CardSkeleton.d.ts.map +1 -0
- package/dist/components/feedback/CardSkeleton.js +7 -0
- package/dist/components/feedback/CardSkeleton.js.map +1 -0
- package/dist/components/feedback/EmptyState.d.ts +9 -0
- package/dist/components/feedback/EmptyState.d.ts.map +1 -0
- package/dist/components/feedback/EmptyState.js +6 -0
- package/dist/components/feedback/EmptyState.js.map +1 -0
- package/dist/components/feedback/ErrorBoundary.d.ts +18 -0
- package/dist/components/feedback/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/feedback/ErrorBoundary.js +24 -0
- package/dist/components/feedback/ErrorBoundary.js.map +1 -0
- package/dist/components/feedback/TableSkeleton.d.ts +7 -0
- package/dist/components/feedback/TableSkeleton.d.ts.map +1 -0
- package/dist/components/feedback/TableSkeleton.js +7 -0
- package/dist/components/feedback/TableSkeleton.js.map +1 -0
- package/dist/components/feedback/Tag.d.ts +6 -0
- package/dist/components/feedback/Tag.d.ts.map +1 -0
- package/dist/components/feedback/Tag.js +7 -0
- package/dist/components/feedback/Tag.js.map +1 -0
- package/dist/components/navigation/CommandPalette.d.ts +17 -0
- package/dist/components/navigation/CommandPalette.d.ts.map +1 -0
- package/dist/components/navigation/CommandPalette.js +73 -0
- package/dist/components/navigation/CommandPalette.js.map +1 -0
- package/dist/components/navigation/PageTabs.d.ts +14 -0
- package/dist/components/navigation/PageTabs.d.ts.map +1 -0
- package/dist/components/navigation/PageTabs.js +21 -0
- package/dist/components/navigation/PageTabs.js.map +1 -0
- package/dist/components/overlays/Drawer.d.ts +6 -0
- package/dist/components/overlays/Drawer.d.ts.map +1 -0
- package/dist/components/overlays/Drawer.js +8 -0
- package/dist/components/overlays/Drawer.js.map +1 -0
- package/dist/components/overlays/Modal.d.ts +6 -0
- package/dist/components/overlays/Modal.d.ts.map +1 -0
- package/dist/components/overlays/Modal.js +8 -0
- package/dist/components/overlays/Modal.js.map +1 -0
- package/dist/components/pages/app-shell/AppShell.d.ts.map +1 -1
- package/dist/components/pages/app-shell/AppShell.js +11 -9
- package/dist/components/pages/app-shell/AppShell.js.map +1 -1
- package/dist/components/pages/app-shell/types.d.ts +4 -0
- package/dist/components/pages/app-shell/types.d.ts.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +3 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/rules.d.ts +10 -0
- package/dist/validation/rules.d.ts.map +1 -0
- package/dist/validation/rules.js +39 -0
- package/dist/validation/rules.js.map +1 -0
- package/dist/validation/zod.d.ts +2 -0
- package/dist/validation/zod.d.ts.map +1 -0
- package/dist/validation/zod.js +3 -0
- package/dist/validation/zod.js.map +1 -0
- package/docs/components/action-column.md +14 -13
- package/docs/components/admin-page-configurator.md +23 -0
- package/docs/components/admin-page-header.md +15 -17
- package/docs/components/admin-page-layout-shell.md +22 -0
- package/docs/components/admin-page-layout.md +11 -20
- package/docs/components/app-shell.md +20 -0
- package/docs/components/async-select.md +18 -17
- package/docs/components/avatar.md +19 -0
- package/docs/components/bar-chart.md +21 -0
- package/docs/components/breadcrumbs.md +15 -0
- package/docs/components/button.md +20 -15
- package/docs/components/card-skeleton.md +15 -0
- package/docs/components/change-password-form.md +17 -0
- package/docs/components/ckeditor-input.md +15 -16
- package/docs/components/color-picker-input.md +19 -0
- package/docs/components/combobox.md +19 -0
- package/docs/components/command-palette.md +17 -0
- package/docs/components/confirm-dialog.md +19 -17
- package/docs/components/currency-input.md +21 -0
- package/docs/components/data-state.md +15 -15
- package/docs/components/date-input.md +17 -18
- package/docs/components/date-presets.md +18 -0
- package/docs/components/date-range-input.md +20 -0
- package/docs/components/description-list.md +16 -0
- package/docs/components/dirty-form-guard.md +15 -23
- package/docs/components/donut-chart.md +21 -0
- package/docs/components/drawer.md +19 -0
- package/docs/components/drop-down.md +18 -20
- package/docs/components/empty-state.md +18 -0
- package/docs/components/error-boundary.md +17 -0
- package/docs/components/error-message.md +11 -9
- package/docs/components/file-dropzone.md +28 -16
- package/docs/components/filter-pannel.md +12 -14
- package/docs/components/forgot-password-form.md +18 -0
- package/docs/components/form-actions-bar.md +29 -18
- package/docs/components/form-field-render.md +16 -16
- package/docs/components/form-section.md +15 -11
- package/docs/components/form-wizard.md +18 -0
- package/docs/components/hidden-field.md +12 -15
- package/docs/components/index-column.md +12 -9
- package/docs/components/line-chart.md +21 -0
- package/docs/components/loading.md +14 -12
- package/docs/components/login-form.md +22 -0
- package/docs/components/map-picker-client.md +14 -14
- package/docs/components/map-picker-osm.md +16 -14
- package/docs/components/map-picker.md +14 -17
- package/docs/components/menu-button.md +14 -18
- package/docs/components/modal.md +20 -0
- package/docs/components/multi-select-filter.md +14 -16
- package/docs/components/multi-select.md +18 -19
- package/docs/components/number-input.md +17 -16
- package/docs/components/otp-input.md +18 -0
- package/docs/components/page-tabs.md +16 -0
- package/docs/components/page-title.md +11 -9
- package/docs/components/paginated-table.md +19 -26
- package/docs/components/pagination.md +15 -18
- package/docs/components/password-input.md +19 -0
- package/docs/components/phone-input.md +18 -0
- package/docs/components/radio-group.md +20 -0
- package/docs/components/range-slider.md +20 -0
- package/docs/components/rating-input.md +19 -0
- package/docs/components/render-field.md +15 -20
- package/docs/components/reset-password-form.md +17 -0
- package/docs/components/rich-text-preview.md +15 -14
- package/docs/components/search-input.md +19 -0
- package/docs/components/select.md +19 -19
- package/docs/components/stat-card.md +19 -0
- package/docs/components/status-badge.md +16 -10
- package/docs/components/switch.md +16 -19
- package/docs/components/table-filter-field.md +13 -17
- package/docs/components/table-skeleton.md +16 -0
- package/docs/components/table-toolbar.md +16 -15
- package/docs/components/tag.md +18 -0
- package/docs/components/tags-input.md +19 -0
- package/docs/components/text-area.md +16 -16
- package/docs/components/text-input.md +16 -15
- package/docs/components/time-picker.md +17 -14
- package/docs/components/timeline.md +15 -0
- package/docs/components/toggle-inline-button.md +17 -18
- package/docs/components/toggle.md +20 -17
- package/docs/components/upload-files-preview.md +20 -22
- package/docs/components/user-menu.md +19 -0
- package/docs/contracts/component-doc-schema.md +78 -0
- package/docs/contracts/dependency-map.md +68 -29
- package/docs/contracts/style-imports.md +38 -12
- package/llms.txt +106 -0
- package/package.json +40 -4
- package/PRIMEREACT_MAPPING.md +0 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
5
|
+
import Button from '../Buttons/Button';
|
|
6
|
+
import FormFieldRender from '../Forms/FormFieldRender';
|
|
7
|
+
import TextInput from '../Forms/TextInput';
|
|
8
|
+
import PasswordInput from '../Forms/PasswordInput';
|
|
9
|
+
import { emailRule, notEmptyRule } from '../../validation';
|
|
10
|
+
const LoginForm = ({ onSubmit, brand, title = 'Iniciar sesión', subtitle, footer, identifierField = 'email', identifierLabel, identifierPlaceholder, passwordLabel = 'Contraseña', passwordPlaceholder, submitLabel = 'Ingresar', className, }) => {
|
|
11
|
+
const form = useForm({ mode: 'onChange' });
|
|
12
|
+
const isEmail = identifierField === 'email';
|
|
13
|
+
const defaultIdentifierLabel = isEmail ? 'Correo electrónico' : 'Usuario';
|
|
14
|
+
const identifierRules = isEmail
|
|
15
|
+
? { ...notEmptyRule(), ...emailRule() }
|
|
16
|
+
: notEmptyRule();
|
|
17
|
+
return (_jsx(FormProvider, { ...form, children: _jsxs("div", { className: classNames('mantis-core-login-form', className), children: [brand && _jsx("div", { className: "mantis-core-login-form__brand", children: brand }), _jsx("h1", { className: "mantis-core-login-form__title", children: title }), subtitle && _jsx("p", { className: "mantis-core-login-form__subtitle", children: subtitle }), _jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [_jsx(FormFieldRender, { label: identifierLabel ?? defaultIdentifierLabel, name: "identifier", render: ({ name }) => (_jsx(TextInput, { controller: { name, rules: identifierRules }, type: isEmail ? 'email' : 'text', autoComplete: isEmail ? 'email' : 'username', placeholder: identifierPlaceholder, block: true })) }), _jsx(FormFieldRender, { label: passwordLabel, name: "password", render: ({ name }) => (_jsx(PasswordInput, { controller: { name, rules: notEmptyRule() }, autoComplete: "current-password", placeholder: passwordPlaceholder, block: true })) }), _jsx(Button, { type: "submit", label: submitLabel, loading: form.formState.isSubmitting, disabled: form.formState.isSubmitting, block: true }), footer && _jsx("div", { className: "mantis-core-login-form__footer", children: footer })] })] }) }));
|
|
18
|
+
};
|
|
19
|
+
export default LoginForm;
|
|
20
|
+
//# sourceMappingURL=LoginForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginForm.js","sourceRoot":"","sources":["../../../src/components/auth/LoginForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAA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K,EAAE,eAAe,IAAI,sBAAsB,EAChD,IAAI,EAAC,YAAY,EACjB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACpB,KAAC,SAAS,IACR,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,EAC5C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAChC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAC5C,WAAW,EAAE,qBAAqB,EAClC,KAAK,SACL,CACH,GACD,EACF,KAAC,eAAe,IACd,KAAK,EAAE,aAAa,EACpB,IAAI,EAAC,UAAU,EACf,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACpB,KAAC,aAAa,IACZ,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAC3C,YAAY,EAAC,kBAAkB,EAC/B,WAAW,EAAE,mBAAmB,EAChC,KAAK,SACL,CACH,GACD,EACF,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EACpC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EACrC,KAAK,SACL,EACD,MAAM,IAAI,cAAK,SAAS,EAAC,gCAAgC,YAAE,MAAM,GAAO,IACpE,IACH,GACO,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ResetPasswordFormValues {
|
|
3
|
+
newPassword: string;
|
|
4
|
+
confirmPassword: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ResetPasswordFormProps {
|
|
7
|
+
onSubmit: (values: ResetPasswordFormValues) => void | Promise<void>;
|
|
8
|
+
title?: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
submitLabel?: string;
|
|
11
|
+
minPasswordLength?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const ResetPasswordForm: React.FC<ResetPasswordFormProps>;
|
|
15
|
+
export default ResetPasswordForm;
|
|
16
|
+
//# sourceMappingURL=ResetPasswordForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResetPasswordForm.d.ts","sourceRoot":"","sources":["../../../src/components/auth/ResetPasswordForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA2DvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
5
|
+
import Button from '../Buttons/Button';
|
|
6
|
+
import FormFieldRender from '../Forms/FormFieldRender';
|
|
7
|
+
import PasswordInput from '../Forms/PasswordInput';
|
|
8
|
+
import { minLengthRule, notEmptyRule } from '../../validation';
|
|
9
|
+
const ResetPasswordForm = ({ onSubmit, title = 'Nueva contraseña', subtitle, submitLabel = 'Guardar contraseña', minPasswordLength = 8, className, }) => {
|
|
10
|
+
const form = useForm({ mode: 'onChange' });
|
|
11
|
+
const { watch } = form;
|
|
12
|
+
return (_jsx(FormProvider, { ...form, children: _jsxs("div", { className: classNames('mantis-core-reset-password-form', className), children: [_jsx("h1", { className: "mantis-core-reset-password-form__title", children: title }), subtitle && _jsx("p", { className: "mantis-core-reset-password-form__subtitle", children: subtitle }), _jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [_jsx(FormFieldRender, { label: "Nueva contrase\u00F1a", name: "newPassword", render: ({ name }) => (_jsx(PasswordInput, { controller: {
|
|
13
|
+
name,
|
|
14
|
+
rules: { ...notEmptyRule(), ...minLengthRule(minPasswordLength) },
|
|
15
|
+
}, autoComplete: "new-password", block: true })) }), _jsx(FormFieldRender, { label: "Confirmar contrase\u00F1a", name: "confirmPassword", render: ({ name }) => (_jsx(PasswordInput, { controller: {
|
|
16
|
+
name,
|
|
17
|
+
rules: {
|
|
18
|
+
validate: (v) => v === watch('newPassword') || 'Las contraseñas no coinciden',
|
|
19
|
+
},
|
|
20
|
+
}, autoComplete: "new-password", block: true })) }), _jsx(Button, { type: "submit", label: submitLabel, loading: form.formState.isSubmitting, disabled: form.formState.isSubmitting, block: true })] })] }) }));
|
|
21
|
+
};
|
|
22
|
+
export default ResetPasswordForm;
|
|
23
|
+
//# sourceMappingURL=ResetPasswordForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResetPasswordForm.js","sourceRoot":"","sources":["../../../src/components/auth/ResetPasswordForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,eAAe,MAAM,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AK,EAAE;wCACL,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,CAAC,KAAK,KAAK,CAAC,aAAa,CAAC,IAAI,8BAA8B;qCAC/D;iCACF,EACD,YAAY,EAAC,cAAc,EAC3B,KAAK,SACL,CACH,GACD,EACF,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EACpC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EACrC,KAAK,SACL,IACG,IACH,GACO,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface UserMenuItem {
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface UserMenuUser {
|
|
9
|
+
name?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
avatarUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UserMenuProps {
|
|
14
|
+
user: UserMenuUser;
|
|
15
|
+
items?: UserMenuItem[];
|
|
16
|
+
onSignOut?: () => void;
|
|
17
|
+
signOutLabel?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const UserMenu: React.FC<UserMenuProps>;
|
|
21
|
+
export default UserMenu;
|
|
22
|
+
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../src/components/auth/UserMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8LrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { PrimeIcons } from 'primereact/api';
|
|
5
|
+
import { useEffect, useRef, useState } from 'react';
|
|
6
|
+
const UserMenu = ({ user, items, onSignOut, signOutLabel = 'Cerrar sesión', className, }) => {
|
|
7
|
+
const [open, setOpen] = useState(false);
|
|
8
|
+
const wrapperRef = useRef(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const handler = (e) => {
|
|
11
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
12
|
+
setOpen(false);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
document.addEventListener('mousedown', handler);
|
|
16
|
+
return () => document.removeEventListener('mousedown', handler);
|
|
17
|
+
}, []);
|
|
18
|
+
const initial = (user.name ?? user.email ?? '?')[0].toUpperCase();
|
|
19
|
+
return (_jsxs("div", { ref: wrapperRef, className: classNames('mantis-core-user-menu', className), style: { position: 'relative', display: 'inline-block' }, children: [_jsx("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-haspopup": "true", "aria-expanded": open, style: {
|
|
20
|
+
background: 'none',
|
|
21
|
+
border: 'none',
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
padding: '0',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
gap: '0.5rem',
|
|
27
|
+
}, children: user.avatarUrl ? (_jsx("img", { src: user.avatarUrl, alt: user.name ?? user.email ?? 'Avatar', style: {
|
|
28
|
+
width: '2rem',
|
|
29
|
+
height: '2rem',
|
|
30
|
+
borderRadius: '50%',
|
|
31
|
+
objectFit: 'cover',
|
|
32
|
+
} })) : (_jsx("span", { style: {
|
|
33
|
+
width: '2rem',
|
|
34
|
+
height: '2rem',
|
|
35
|
+
borderRadius: '50%',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
backgroundColor: 'var(--primary-color)',
|
|
40
|
+
color: 'var(--primary-color-text)',
|
|
41
|
+
fontWeight: 600,
|
|
42
|
+
fontSize: '0.875rem',
|
|
43
|
+
}, children: initial })) }), open && (_jsxs("div", { className: "mantis-core-user-menu__dropdown", style: {
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
right: 0,
|
|
46
|
+
top: 'calc(100% + 0.5rem)',
|
|
47
|
+
minWidth: '14rem',
|
|
48
|
+
backgroundColor: 'var(--surface-overlay)',
|
|
49
|
+
border: '1px solid var(--surface-border)',
|
|
50
|
+
borderRadius: 'var(--border-radius)',
|
|
51
|
+
boxShadow: 'var(--card-shadow)',
|
|
52
|
+
zIndex: 1000,
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
}, children: [_jsxs("div", { style: {
|
|
55
|
+
padding: '0.75rem 1rem',
|
|
56
|
+
borderBottom: '1px solid var(--surface-border)',
|
|
57
|
+
}, children: [user.name && (_jsx("p", { style: { margin: 0, fontWeight: 600, color: 'var(--text-color)' }, children: user.name })), user.email && (_jsx("p", { style: { margin: 0, fontSize: '0.8125rem', color: 'var(--text-color-secondary)' }, children: user.email }))] }), items && items.length > 0 && (_jsx("div", { style: { padding: '0.25rem 0' }, children: items.map((item, i) => item.href ? (_jsxs("a", { href: item.href, onClick: () => setOpen(false), style: {
|
|
58
|
+
display: 'flex',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
gap: '0.5rem',
|
|
61
|
+
padding: '0.5rem 1rem',
|
|
62
|
+
color: 'var(--text-color)',
|
|
63
|
+
textDecoration: 'none',
|
|
64
|
+
}, children: [item.icon, item.label] }, i)) : (_jsxs("button", { type: "button", onClick: () => {
|
|
65
|
+
setOpen(false);
|
|
66
|
+
item.onClick?.();
|
|
67
|
+
}, style: {
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
gap: '0.5rem',
|
|
71
|
+
padding: '0.5rem 1rem',
|
|
72
|
+
width: '100%',
|
|
73
|
+
background: 'none',
|
|
74
|
+
border: 'none',
|
|
75
|
+
cursor: 'pointer',
|
|
76
|
+
color: 'var(--text-color)',
|
|
77
|
+
textAlign: 'left',
|
|
78
|
+
}, children: [item.icon, item.label] }, i))) })), onSignOut && (_jsx("div", { style: { borderTop: '1px solid var(--surface-border)', padding: '0.25rem 0' }, children: _jsxs("button", { type: "button", onClick: () => {
|
|
79
|
+
setOpen(false);
|
|
80
|
+
onSignOut();
|
|
81
|
+
}, style: {
|
|
82
|
+
display: 'flex',
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
gap: '0.5rem',
|
|
85
|
+
padding: '0.5rem 1rem',
|
|
86
|
+
width: '100%',
|
|
87
|
+
background: 'none',
|
|
88
|
+
border: 'none',
|
|
89
|
+
cursor: 'pointer',
|
|
90
|
+
color: 'var(--text-color)',
|
|
91
|
+
textAlign: 'left',
|
|
92
|
+
}, children: [_jsx("i", { className: PrimeIcons.SIGN_OUT, style: { fontSize: '0.875rem' } }), signOutLabel] }) }))] }))] }));
|
|
93
|
+
};
|
|
94
|
+
export default UserMenu;
|
|
95
|
+
//# sourceMappingURL=UserMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../../src/components/auth/UserMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAuB3D,MAAM,QAAQ,GAA4B,CAAC,EACzC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,YAAY,GAAG,eAAe,EAC9B,SAAS,GACV,EAAE,EAAE;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,CAAC,CAAa,EAAE,EAAE;YAChC,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAc,CAAC,EAAE,CAAC;gBACzE,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAElE,OAAO,CACL,eACE,GAAG,EAAE,UAAU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|
|
1
|
+
export { default as LoginForm } from './LoginForm';
|
|
2
|
+
export type { LoginFormProps, LoginFormValues } from './LoginForm';
|
|
3
|
+
export { default as ForgotPasswordForm } from './ForgotPasswordForm';
|
|
4
|
+
export type { ForgotPasswordFormProps, ForgotPasswordFormValues } from './ForgotPasswordForm';
|
|
5
|
+
export { default as ResetPasswordForm } from './ResetPasswordForm';
|
|
6
|
+
export type { ResetPasswordFormProps, ResetPasswordFormValues } from './ResetPasswordForm';
|
|
7
|
+
export { default as ChangePasswordForm } from './ChangePasswordForm';
|
|
8
|
+
export type { ChangePasswordFormProps, ChangePasswordFormValues } from './ChangePasswordForm';
|
|
9
|
+
export { default as UserMenu } from './UserMenu';
|
|
10
|
+
export type { UserMenuProps, UserMenuUser, UserMenuItem } from './UserMenu';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as LoginForm } from './LoginForm';
|
|
2
|
+
export { default as ForgotPasswordForm } from './ForgotPasswordForm';
|
|
3
|
+
export { default as ResetPasswordForm } from './ResetPasswordForm';
|
|
4
|
+
export { default as ChangePasswordForm } from './ChangePasswordForm';
|
|
5
|
+
export { default as UserMenu } from './UserMenu';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Bar } from "react-chartjs-2";
|
|
3
|
+
import type { ChartOptions, ChartDataset } from "chart.js";
|
|
4
|
+
export type BarChartDataset = Omit<ChartDataset<"bar">, "data"> & {
|
|
5
|
+
data: number[];
|
|
6
|
+
};
|
|
7
|
+
export interface BarChartProps extends Omit<React.ComponentProps<typeof Bar>, "data" | "options"> {
|
|
8
|
+
labels: string[];
|
|
9
|
+
datasets: BarChartDataset[];
|
|
10
|
+
/** Deep-merged over sensible defaults. */
|
|
11
|
+
options?: ChartOptions<"bar">;
|
|
12
|
+
/** Color palette applied to datasets that don't specify their own colors. */
|
|
13
|
+
colors?: string[];
|
|
14
|
+
/** Container height in px. Default: 300. */
|
|
15
|
+
height?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const BarChart: React.FC<BarChartProps>;
|
|
19
|
+
export default BarChart;
|
|
20
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/components/charts/BarChart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,EAAa,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAOtE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG;IAChE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC9B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmCrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Bar } from "react-chartjs-2";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { registerCharts } from "./chart-setup";
|
|
6
|
+
import { DEFAULT_COLORS, defaultBarOptions } from "./defaults";
|
|
7
|
+
registerCharts();
|
|
8
|
+
const BarChart = ({ labels, datasets, options, colors = DEFAULT_COLORS, height = 300, className, ...rest }) => {
|
|
9
|
+
const data = {
|
|
10
|
+
labels,
|
|
11
|
+
datasets: datasets.map((ds, i) => ({
|
|
12
|
+
backgroundColor: colors[i % colors.length] + "cc", // 80% opacity
|
|
13
|
+
borderColor: colors[i % colors.length],
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderRadius: 4,
|
|
16
|
+
...ds,
|
|
17
|
+
})),
|
|
18
|
+
};
|
|
19
|
+
const mergedOptions = {
|
|
20
|
+
...defaultBarOptions,
|
|
21
|
+
...options,
|
|
22
|
+
plugins: { ...defaultBarOptions.plugins, ...options?.plugins },
|
|
23
|
+
scales: { ...defaultBarOptions.scales, ...options?.scales },
|
|
24
|
+
};
|
|
25
|
+
return (_jsx("div", { className: classNames("mantis-core-chart mantis-core-chart--bar", className), style: { height }, children: _jsx(Bar, { data: data, options: mergedOptions, ...rest }) }));
|
|
26
|
+
};
|
|
27
|
+
export default BarChart;
|
|
28
|
+
//# sourceMappingURL=BarChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../src/components/charts/BarChart.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/D,cAAc,EAAE,CAAC;AAmBjB,MAAM,QAAQ,GAA4B,CAAC,EACzC,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,cAAc,EACvB,MAAM,GAAG,GAAG,EACZ,SAAS,EACT,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,IAAI,GAAqB;QAC7B,MAAM;QACN,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,eAAe,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,cAAc;YACjE,WAAW,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;YACtC,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,GAAG,EAAE;SACN,CAAC,CAAC;KACJ,CAAC;IAEF,MAAM,aAAa,GAAwB;QACzC,GAAG,iBAAiB;QACpB,GAAG,OAAO;QACV,OAAO,EAAE,EAAE,GAAG,iBAAiB,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;QAC9D,MAAM,EAAE,EAAE,GAAG,iBAAiB,CAAC,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE;KAC5D,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAE,UAAU,CAAC,0CAA0C,EAAE,SAAS,CAAC,EAC5E,KAAK,EAAE,EAAE,MAAM,EAAE,YAEjB,KAAC,GAAG,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,KAAM,IAAI,GAAI,GACjD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Doughnut } from "react-chartjs-2";
|
|
3
|
+
import type { ChartOptions } from "chart.js";
|
|
4
|
+
export interface DonutChartProps extends Omit<React.ComponentProps<typeof Doughnut>, "data" | "options"> {
|
|
5
|
+
labels: string[];
|
|
6
|
+
/** One value per label/slice. */
|
|
7
|
+
datasets: {
|
|
8
|
+
data: number[];
|
|
9
|
+
label?: string;
|
|
10
|
+
}[];
|
|
11
|
+
/** Deep-merged over sensible defaults. */
|
|
12
|
+
options?: ChartOptions<"doughnut">;
|
|
13
|
+
/** Color palette for slices. */
|
|
14
|
+
colors?: string[];
|
|
15
|
+
/** Container height in px. Default: 300. */
|
|
16
|
+
height?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const DonutChart: React.FC<DonutChartProps>;
|
|
20
|
+
export default DonutChart;
|
|
21
|
+
//# sourceMappingURL=DonutChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../src/components/charts/DonutChart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,UAAU,CAAC;AAOxD,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iCAAiC;IACjC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,0CAA0C;IAC1C,OAAO,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACnC,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiCzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Doughnut } from "react-chartjs-2";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { registerCharts } from "./chart-setup";
|
|
6
|
+
import { DEFAULT_COLORS, defaultDonutOptions } from "./defaults";
|
|
7
|
+
registerCharts();
|
|
8
|
+
const DonutChart = ({ labels, datasets, options, colors = DEFAULT_COLORS, height = 300, className, ...rest }) => {
|
|
9
|
+
const data = {
|
|
10
|
+
labels,
|
|
11
|
+
datasets: datasets.map((ds) => ({
|
|
12
|
+
backgroundColor: labels.map((_, i) => colors[i % colors.length] + "cc"),
|
|
13
|
+
borderColor: labels.map((_, i) => colors[i % colors.length]),
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
...ds,
|
|
16
|
+
})),
|
|
17
|
+
};
|
|
18
|
+
const mergedOptions = {
|
|
19
|
+
...defaultDonutOptions,
|
|
20
|
+
...options,
|
|
21
|
+
plugins: { ...defaultDonutOptions.plugins, ...options?.plugins },
|
|
22
|
+
};
|
|
23
|
+
return (_jsx("div", { className: classNames("mantis-core-chart mantis-core-chart--donut", className), style: { height }, children: _jsx(Doughnut, { data: data, options: mergedOptions, ...rest }) }));
|
|
24
|
+
};
|
|
25
|
+
export default DonutChart;
|
|
26
|
+
//# sourceMappingURL=DonutChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.js","sourceRoot":"","sources":["../../../src/components/charts/DonutChart.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjE,cAAc,EAAE,CAAC;AAgBjB,MAAM,UAAU,GAA8B,CAAC,EAC7C,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,GAAG,cAAc,EACvB,MAAM,GAAG,GAAG,EACZ,SAAS,EACT,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,IAAI,GAA0B;QAClC,MAAM;QACN,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC9B,eAAe,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YACvE,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5D,WAAW,EAAE,CAAC;YACd,GAAG,EAAE;SACN,CAAC,CAAC;KACJ,CAAC;IAEF,MAAM,aAAa,GAA6B;QAC9C,GAAG,mBAAmB;QACtB,GAAG,OAAO;QACV,OAAO,EAAE,EAAE,GAAG,mBAAmB,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;KACjE,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAE,UAAU,CAAC,4CAA4C,EAAE,SAAS,CAAC,EAC9E,KAAK,EAAE,EAAE,MAAM,EAAE,YAEjB,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,KAAM,IAAI,GAAI,GACtD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Line } from "react-chartjs-2";
|
|
3
|
+
import type { ChartOptions, ChartDataset } from "chart.js";
|
|
4
|
+
export type LineChartDataset = Omit<ChartDataset<"line">, "data"> & {
|
|
5
|
+
data: number[];
|
|
6
|
+
};
|
|
7
|
+
export interface LineChartProps extends Omit<React.ComponentProps<typeof Line>, "data" | "options"> {
|
|
8
|
+
labels: string[];
|
|
9
|
+
datasets: LineChartDataset[];
|
|
10
|
+
/** Deep-merged over sensible defaults. */
|
|
11
|
+
options?: ChartOptions<"line">;
|
|
12
|
+
/** Color palette applied to datasets that don't specify their own colors. */
|
|
13
|
+
colors?: string[];
|
|
14
|
+
/** Container height in px. Default: 300. */
|
|
15
|
+
height?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const LineChart: React.FC<LineChartProps>;
|
|
19
|
+
export default LineChart;
|
|
20
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/components/charts/LineChart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAa,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAOtE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG;IAClE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAkCvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Line } from "react-chartjs-2";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { registerCharts } from "./chart-setup";
|
|
6
|
+
import { DEFAULT_COLORS, defaultLineOptions } from "./defaults";
|
|
7
|
+
registerCharts();
|
|
8
|
+
const LineChart = ({ labels, datasets, options, colors = DEFAULT_COLORS, height = 300, className, ...rest }) => {
|
|
9
|
+
const data = {
|
|
10
|
+
labels,
|
|
11
|
+
datasets: datasets.map((ds, i) => ({
|
|
12
|
+
borderColor: colors[i % colors.length],
|
|
13
|
+
backgroundColor: colors[i % colors.length] + "33", // 20% opacity fill
|
|
14
|
+
tension: 0.3,
|
|
15
|
+
...ds,
|
|
16
|
+
})),
|
|
17
|
+
};
|
|
18
|
+
const mergedOptions = {
|
|
19
|
+
...defaultLineOptions,
|
|
20
|
+
...options,
|
|
21
|
+
plugins: { ...defaultLineOptions.plugins, ...options?.plugins },
|
|
22
|
+
scales: { ...defaultLineOptions.scales, ...options?.scales },
|
|
23
|
+
};
|
|
24
|
+
return (_jsx("div", { className: classNames("mantis-core-chart mantis-core-chart--line", className), style: { height }, children: _jsx(Line, { data: data, options: mergedOptions, ...rest }) }));
|
|
25
|
+
};
|
|
26
|
+
export default LineChart;
|
|
27
|
+
//# sourceMappingURL=LineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.js","sourceRoot":"","sources":["../../../src/components/charts/LineChart.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EA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AACtE,wBAAgB,cAAc,IAAI,IAAI,CAerC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, BarElement, ArcElement, Title, Tooltip, Legend, Filler, } from "chart.js";
|
|
2
|
+
let registered = false;
|
|
3
|
+
/** Register chart.js controllers/elements/scales once. Idempotent. */
|
|
4
|
+
export function registerCharts() {
|
|
5
|
+
if (registered)
|
|
6
|
+
return;
|
|
7
|
+
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, BarElement, ArcElement, Title, Tooltip, Legend, Filler);
|
|
8
|
+
registered = true;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=chart-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-setup.js","sourceRoot":"","sources":["../../../src/components/charts/chart-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,OAAO,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,GACP,MAAM,UAAU,CAAC;AAElB,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,sEAAsE;AACtE,MAAM,UAAU,cAAc;IAC5B,IAAI,UAAU;QAAE,OAAO;IACvB,OAAO,CAAC,QAAQ,CACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,CACP,CAAC;IACF,UAAU,GAAG,IAAI,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartOptions } from "chart.js";
|
|
2
|
+
/** Default color palette (hex). Override via `colors` prop or CSS tokens at runtime. */
|
|
3
|
+
export declare const DEFAULT_COLORS: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a CSS custom property value at runtime (browser-only).
|
|
6
|
+
* Returns null when called on the server or when the property is not set.
|
|
7
|
+
* // ponytail: guard keeps this SSR-safe; token resolution is a nicety
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveCssToken(token: string): string | null;
|
|
10
|
+
export declare const defaultLineOptions: ChartOptions<"line">;
|
|
11
|
+
export declare const defaultBarOptions: ChartOptions<"bar">;
|
|
12
|
+
export declare const defaultDonutOptions: ChartOptions<"doughnut">;
|
|
13
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/components/charts/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wFAAwF;AACxF,eAAO,MAAM,cAAc,UAS1B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG5D;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,MAAM,CAWnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,KAAK,CAWjD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,UAAU,CAOxD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Default color palette (hex). Override via `colors` prop or CSS tokens at runtime. */
|
|
2
|
+
export const DEFAULT_COLORS = [
|
|
3
|
+
"#6366f1", // indigo
|
|
4
|
+
"#22d3ee", // cyan
|
|
5
|
+
"#f59e0b", // amber
|
|
6
|
+
"#10b981", // emerald
|
|
7
|
+
"#f43f5e", // rose
|
|
8
|
+
"#a78bfa", // violet
|
|
9
|
+
"#fb923c", // orange
|
|
10
|
+
"#34d399", // green
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a CSS custom property value at runtime (browser-only).
|
|
14
|
+
* Returns null when called on the server or when the property is not set.
|
|
15
|
+
* // ponytail: guard keeps this SSR-safe; token resolution is a nicety
|
|
16
|
+
*/
|
|
17
|
+
export function resolveCssToken(token) {
|
|
18
|
+
if (typeof window === "undefined")
|
|
19
|
+
return null;
|
|
20
|
+
return getComputedStyle(document.documentElement).getPropertyValue(token).trim() || null;
|
|
21
|
+
}
|
|
22
|
+
export const defaultLineOptions = {
|
|
23
|
+
responsive: true,
|
|
24
|
+
maintainAspectRatio: false,
|
|
25
|
+
plugins: {
|
|
26
|
+
legend: { position: "top" },
|
|
27
|
+
tooltip: { mode: "index", intersect: false },
|
|
28
|
+
},
|
|
29
|
+
scales: {
|
|
30
|
+
x: { grid: { display: false } },
|
|
31
|
+
y: { beginAtZero: true },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const defaultBarOptions = {
|
|
35
|
+
responsive: true,
|
|
36
|
+
maintainAspectRatio: false,
|
|
37
|
+
plugins: {
|
|
38
|
+
legend: { position: "top" },
|
|
39
|
+
tooltip: { mode: "index", intersect: false },
|
|
40
|
+
},
|
|
41
|
+
scales: {
|
|
42
|
+
x: { grid: { display: false } },
|
|
43
|
+
y: { beginAtZero: true },
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export const defaultDonutOptions = {
|
|
47
|
+
responsive: true,
|
|
48
|
+
maintainAspectRatio: false,
|
|
49
|
+
plugins: {
|
|
50
|
+
legend: { position: "right" },
|
|
51
|
+
tooltip: { mode: "nearest" },
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/components/charts/defaults.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,OAA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,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;QAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC7B;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as LineChart } from "./LineChart";
|
|
2
|
+
export type { LineChartProps, LineChartDataset } from "./LineChart";
|
|
3
|
+
export { default as BarChart } from "./BarChart";
|
|
4
|
+
export type { BarChartProps, BarChartDataset } from "./BarChart";
|
|
5
|
+
export { default as DonutChart } from "./DonutChart";
|
|
6
|
+
export type { DonutChartProps } from "./DonutChart";
|
|
7
|
+
export { registerCharts } from "./chart-setup";
|
|
8
|
+
export { DEFAULT_COLORS } from "./defaults";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/charts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as LineChart } from "./LineChart";
|
|
2
|
+
export { default as BarChart } from "./BarChart";
|
|
3
|
+
export { default as DonutChart } from "./DonutChart";
|
|
4
|
+
export { registerCharts } from "./chart-setup";
|
|
5
|
+
export { DEFAULT_COLORS } from "./defaults";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/charts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
type DescriptionListProps = React.HTMLAttributes<HTMLDListElement> & {
|
|
3
|
+
items: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
}[];
|
|
7
|
+
columns?: 1 | 2 | 3;
|
|
8
|
+
};
|
|
9
|
+
declare const DescriptionList: React.FC<DescriptionListProps>;
|
|
10
|
+
export default DescriptionList;
|
|
11
|
+
//# sourceMappingURL=DescriptionList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescriptionList.d.ts","sourceRoot":"","sources":["../../../src/components/data/DescriptionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG;IACnE,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACrB,CAAC;AAQF,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmCnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
const colTemplates = {
|
|
4
|
+
1: "1fr",
|
|
5
|
+
2: "1fr 1fr",
|
|
6
|
+
3: "1fr 1fr 1fr",
|
|
7
|
+
};
|
|
8
|
+
const DescriptionList = ({ items, columns = 1, className, ...rest }) => (_jsx("dl", { className: classNames("mantis-core-description-list", className), style: {
|
|
9
|
+
display: "grid",
|
|
10
|
+
gridTemplateColumns: colTemplates[columns],
|
|
11
|
+
gap: "12px 24px",
|
|
12
|
+
margin: 0,
|
|
13
|
+
padding: 0,
|
|
14
|
+
}, ...rest, children: items.map((item, i) => (_jsxs("div", { children: [_jsx("dt", { style: {
|
|
15
|
+
fontSize: "12px",
|
|
16
|
+
fontWeight: 600,
|
|
17
|
+
textTransform: "uppercase",
|
|
18
|
+
letterSpacing: "0.05em",
|
|
19
|
+
color: "var(--muted-foreground)",
|
|
20
|
+
marginBottom: "2px",
|
|
21
|
+
}, children: item.label }), _jsx("dd", { style: { margin: 0, fontSize: "14px" }, children: item.value })] }, i))) }));
|
|
22
|
+
export default DescriptionList;
|
|
23
|
+
//# sourceMappingURL=DescriptionList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescriptionList.js","sourceRoot":"","sources":["../../../src/components/data/DescriptionList.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,MAAM,YAAY,GAA8B;IAC9C,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,aAAa;CACjB,CAAC;AAEF,MAAM,eAAe,GAAmC,CAAC,EACvD,KAAK,EACL,OAAO,GAAG,CAAC,EACX,SAAS,EACT,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,aACE,SAAS,EAAE,UAAU,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAChE,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,mBAAmB,EAAE,YAAY,CAAC,OAAO,CAAC;QAC1C,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX,KACG,IAAI,YAEP,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,0BACE,aACE,KAAK,EAAE;oBACL,QAAQ,EAAE,MAAM;oBAChB,UAAU,EAAE,GAAG;oBACf,aAAa,EAAE,WAAW;oBAC1B,aAAa,EAAE,QAAQ;oBACvB,KAAK,EAAE,yBAAyB;oBAChC,YAAY,EAAE,KAAK;iBACpB,YAEA,IAAI,CAAC,KAAK,GACR,EACL,aAAI,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAG,IAAI,CAAC,KAAK,GAAM,KAbrD,CAAC,CAcL,CACP,CAAC,GACC,CACN,CAAC;AAEF,eAAe,eAAe,CAAC"}
|