@clicoh/orion-library 1.1.0 → 1.2.0-beta.10
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/assets/css/base.css +24 -1
- package/dist/components/01-atoms/Badge/Badge.d.ts +13 -3
- package/dist/components/01-atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/01-atoms/Badge/Badge.jsx +21 -4
- package/dist/components/01-atoms/Badge/Badge.jsx.map +1 -1
- package/dist/components/01-atoms/Button/Button.d.ts +7 -1
- package/dist/components/01-atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/01-atoms/Button/Button.jsx +46 -4
- package/dist/components/01-atoms/Button/Button.jsx.map +1 -1
- package/dist/components/01-atoms/IconButton/IconButton.d.ts +28 -0
- package/dist/components/01-atoms/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/01-atoms/IconButton/IconButton.jsx +32 -0
- package/dist/components/01-atoms/IconButton/IconButton.jsx.map +1 -0
- package/dist/components/01-atoms/IconButton/index.d.ts +2 -0
- package/dist/components/01-atoms/IconButton/index.d.ts.map +1 -0
- package/dist/components/01-atoms/IconButton/index.js +2 -0
- package/dist/components/01-atoms/IconButton/index.js.map +1 -0
- package/dist/components/01-atoms/Input/Input.d.ts +5 -1
- package/dist/components/01-atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/01-atoms/Input/Input.jsx +12 -6
- package/dist/components/01-atoms/Input/Input.jsx.map +1 -1
- package/dist/components/01-atoms/Input/utils/border.d.ts +3 -1
- package/dist/components/01-atoms/Input/utils/border.d.ts.map +1 -1
- package/dist/components/01-atoms/Input/utils/border.js +3 -3
- package/dist/components/01-atoms/Input/utils/border.js.map +1 -1
- package/dist/components/01-atoms/MultiSelect/MultiSelect.jsx +2 -2
- package/dist/components/01-atoms/MultiSelect/MultiSelect.jsx.map +1 -1
- package/dist/components/01-atoms/ProgressBar/ProgressBar.d.ts +42 -0
- package/dist/components/01-atoms/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/dist/components/01-atoms/ProgressBar/ProgressBar.jsx +52 -0
- package/dist/components/01-atoms/ProgressBar/ProgressBar.jsx.map +1 -0
- package/dist/components/01-atoms/ProgressBar/index.d.ts +2 -0
- package/dist/components/01-atoms/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/01-atoms/ProgressBar/index.js +2 -0
- package/dist/components/01-atoms/ProgressBar/index.js.map +1 -0
- package/dist/components/01-atoms/Radio/Radio.d.ts +19 -2
- package/dist/components/01-atoms/Radio/Radio.d.ts.map +1 -1
- package/dist/components/01-atoms/Radio/Radio.jsx +51 -6
- package/dist/components/01-atoms/Radio/Radio.jsx.map +1 -1
- package/dist/components/01-atoms/Select/Select.d.ts +3 -1
- package/dist/components/01-atoms/Select/Select.d.ts.map +1 -1
- package/dist/components/01-atoms/Select/Select.jsx +8 -4
- package/dist/components/01-atoms/Select/Select.jsx.map +1 -1
- package/dist/components/01-atoms/Skeleton/Skeleton.d.ts +32 -0
- package/dist/components/01-atoms/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/01-atoms/Skeleton/Skeleton.jsx +34 -0
- package/dist/components/01-atoms/Skeleton/Skeleton.jsx.map +1 -0
- package/dist/components/01-atoms/Skeleton/index.d.ts +2 -0
- package/dist/components/01-atoms/Skeleton/index.d.ts.map +1 -0
- package/dist/components/01-atoms/Skeleton/index.js +2 -0
- package/dist/components/01-atoms/Skeleton/index.js.map +1 -0
- package/dist/components/01-atoms/SmallInput/SmallInput.jsx +1 -1
- package/dist/components/01-atoms/SmallInput/SmallInput.jsx.map +1 -1
- package/dist/components/01-atoms/Switch/Switch.d.ts +5 -2
- package/dist/components/01-atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/01-atoms/Switch/Switch.jsx +15 -12
- package/dist/components/01-atoms/Switch/Switch.jsx.map +1 -1
- package/dist/components/01-atoms/Textarea/Textarea.d.ts +38 -0
- package/dist/components/01-atoms/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/01-atoms/Textarea/Textarea.jsx +50 -0
- package/dist/components/01-atoms/Textarea/Textarea.jsx.map +1 -0
- package/dist/components/01-atoms/Textarea/index.d.ts +2 -0
- package/dist/components/01-atoms/Textarea/index.d.ts.map +1 -0
- package/dist/components/01-atoms/Textarea/index.js +2 -0
- package/dist/components/01-atoms/Textarea/index.js.map +1 -0
- package/dist/components/01-atoms/Toast/Toast.d.ts.map +1 -1
- package/dist/components/01-atoms/Toast/Toast.jsx +3 -1
- package/dist/components/01-atoms/Toast/Toast.jsx.map +1 -1
- package/dist/components/01-atoms/index.d.ts +4 -0
- package/dist/components/01-atoms/index.d.ts.map +1 -1
- package/dist/components/01-atoms/index.js +4 -0
- package/dist/components/01-atoms/index.js.map +1 -1
- package/dist/components/02-molecules/Accordion/Accordion.d.ts +15 -4
- package/dist/components/02-molecules/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/Accordion.jsx +20 -6
- package/dist/components/02-molecules/Accordion/Accordion.jsx.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionContext.d.ts +5 -1
- package/dist/components/02-molecules/Accordion/AccordionContext.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionContext.jsx +4 -3
- package/dist/components/02-molecules/Accordion/AccordionContext.jsx.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.d.ts +2 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.jsx +35 -8
- package/dist/components/02-molecules/Accordion/AccordionSection.jsx.map +1 -1
- package/dist/components/02-molecules/Accordion/index.d.ts +1 -0
- package/dist/components/02-molecules/Accordion/index.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/index.js.map +1 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.d.ts +10 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.jsx +29 -10
- package/dist/components/02-molecules/Autocomplete/Autocomplete.jsx.map +1 -1
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts +79 -0
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx +229 -0
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx.map +1 -0
- package/dist/components/02-molecules/DatePicker/index.d.ts +2 -0
- package/dist/components/02-molecules/DatePicker/index.d.ts.map +1 -0
- package/dist/components/02-molecules/DatePicker/index.js +2 -0
- package/dist/components/02-molecules/DatePicker/index.js.map +1 -0
- package/dist/components/02-molecules/Filter/Filter.d.ts +1 -0
- package/dist/components/02-molecules/Filter/Filter.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/Filter.jsx +25 -4
- package/dist/components/02-molecules/Filter/Filter.jsx.map +1 -1
- package/dist/components/02-molecules/Filter/index.d.ts +1 -0
- package/dist/components/02-molecules/Filter/index.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/index.js +1 -0
- package/dist/components/02-molecules/Filter/index.js.map +1 -1
- package/dist/components/02-molecules/Filter/types.d.ts +24 -5
- package/dist/components/02-molecules/Filter/types.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.d.ts +34 -0
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.d.ts.map +1 -0
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.js +70 -0
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.js.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewer.d.ts +55 -5
- package/dist/components/02-molecules/ImageViewer/ImageViewer.d.ts.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewer.jsx +118 -27
- package/dist/components/02-molecules/ImageViewer/ImageViewer.jsx.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.d.ts +40 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.d.ts.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.jsx +108 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.jsx.map +1 -0
- package/dist/components/02-molecules/InlineMessage/InlineMessage.d.ts +37 -0
- package/dist/components/02-molecules/InlineMessage/InlineMessage.d.ts.map +1 -0
- package/dist/components/02-molecules/InlineMessage/InlineMessage.jsx +59 -0
- package/dist/components/02-molecules/InlineMessage/InlineMessage.jsx.map +1 -0
- package/dist/components/02-molecules/InlineMessage/index.d.ts +2 -0
- package/dist/components/02-molecules/InlineMessage/index.d.ts.map +1 -0
- package/dist/components/02-molecules/InlineMessage/index.js +2 -0
- package/dist/components/02-molecules/InlineMessage/index.js.map +1 -0
- package/dist/components/02-molecules/Modal/Modal.d.ts +5 -1
- package/dist/components/02-molecules/Modal/Modal.d.ts.map +1 -1
- package/dist/components/02-molecules/Modal/Modal.jsx +7 -5
- package/dist/components/02-molecules/Modal/Modal.jsx.map +1 -1
- package/dist/components/02-molecules/index.d.ts +3 -0
- package/dist/components/02-molecules/index.d.ts.map +1 -1
- package/dist/components/02-molecules/index.js +3 -0
- package/dist/components/02-molecules/index.js.map +1 -1
- package/dist/components/03-organisms/MapView/MapView.d.ts +73 -0
- package/dist/components/03-organisms/MapView/MapView.d.ts.map +1 -0
- package/dist/components/03-organisms/MapView/MapView.jsx +228 -0
- package/dist/components/03-organisms/MapView/MapView.jsx.map +1 -0
- package/dist/components/03-organisms/MapView/index.d.ts +2 -0
- package/dist/components/03-organisms/MapView/index.d.ts.map +1 -0
- package/dist/components/03-organisms/MapView/index.js +2 -0
- package/dist/components/03-organisms/MapView/index.js.map +1 -0
- package/dist/components/03-organisms/index.d.ts +1 -0
- package/dist/components/03-organisms/index.d.ts.map +1 -1
- package/dist/components/03-organisms/index.js +1 -0
- package/dist/components/03-organisms/index.js.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx +2 -2
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx.map +1 -1
- package/dist/components/04-templates/SideFilterTemplate/SideFilterTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/SideFilterTemplate/SideFilterTemplate.jsx +4 -1
- package/dist/components/04-templates/SideFilterTemplate/SideFilterTemplate.jsx.map +1 -1
- package/package.json +5 -2
- package/tailwind.config.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageViewer.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/ImageViewer/ImageViewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageViewer.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/ImageViewer/ImageViewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,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C,CAAC,UAAU,CAAC,IAAI,CAAC,CACtB,KAAK,CAAC,CAAC,UAAU,CAAC,EAClB,CACH,CACH;UAAA,EAAE,IAAI,CAAC,IAAI,CACX;UAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,IAAI,CACpC;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,OAAO,CAAC,CACX,CAAC;IAEF,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IAEhC,OAAO,YAAY,CACjB,CAAC,GAAG,CAAC,SAAS,CAAC,qEAAqE,CAClF;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CACvD;IAAA,EAAE,GAAG,CAAC,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
export type TImageCrop = {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
type ImageViewerImageProps = {
|
|
9
|
+
src: string;
|
|
10
|
+
alt: string;
|
|
11
|
+
crop?: TImageCrop;
|
|
12
|
+
style: CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Image of one `ImageViewer` view, fitted inside its frame. With `crop`, only
|
|
16
|
+
* that region of the image is drawn, scaled to fit the frame the same way the
|
|
17
|
+
* whole image would be.
|
|
18
|
+
*
|
|
19
|
+
* Internal to `ImageViewer`: it is not exported from the library.
|
|
20
|
+
*
|
|
21
|
+
* @component
|
|
22
|
+
* @example
|
|
23
|
+
* <ImageViewerImage
|
|
24
|
+
* src="/document.jpg"
|
|
25
|
+
* alt="Document front"
|
|
26
|
+
* crop={{ left: 0.1, top: 0.2, width: 0.3, height: 0.4 }}
|
|
27
|
+
* style={{ transform: 'rotate(0deg) scale(1)' }}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} props - The properties of the ImageViewerImage component.
|
|
31
|
+
* @param {string} props.src - Image URL.
|
|
32
|
+
* @param {string} props.alt - Accessible description of the image.
|
|
33
|
+
* @param {TImageCrop} [props.crop] - Region to show, as fractions (0 to 1) of the image width and height.
|
|
34
|
+
* @param {CSSProperties} props.style - Zoom and rotation computed by the viewer.
|
|
35
|
+
*
|
|
36
|
+
* @returns {ReactNode} The rendered image.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ImageViewerImage({ src, alt, crop, style, }: ImageViewerImageProps): ReactNode;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=ImageViewerImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageViewerImage.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/ImageViewer/ImageViewerImage.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAOF,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AA0DF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,GACN,EAAE,qBAAqB,GAAG,SAAS,CA4DnC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useEffect, useId, useState, } from 'react';
|
|
4
|
+
const TRANSFORM_CLASSNAME = 'transition-transform duration-200 ease-out';
|
|
5
|
+
const clampFraction = (value) => Math.min(Math.max(value, 0), 1);
|
|
6
|
+
/**
|
|
7
|
+
* Keeps the region inside the image, and drops it when nothing is left to
|
|
8
|
+
* show, so a malformed crop falls back to the whole image.
|
|
9
|
+
*/
|
|
10
|
+
const normalizeCrop = (crop) => {
|
|
11
|
+
if (!crop)
|
|
12
|
+
return null;
|
|
13
|
+
const left = clampFraction(crop.left);
|
|
14
|
+
const top = clampFraction(crop.top);
|
|
15
|
+
const width = clampFraction(crop.left + crop.width) - left;
|
|
16
|
+
const height = clampFraction(crop.top + crop.height) - top;
|
|
17
|
+
return width > 0 && height > 0 ? { left, top, width, height } : null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The crop is expressed in fractions, but an SVG `viewBox` needs pixels to keep
|
|
21
|
+
* the region undistorted, so the image is decoded once to read its size.
|
|
22
|
+
*/
|
|
23
|
+
const useNaturalSize = (src, isEnabled) => {
|
|
24
|
+
const [size, setSize] = useState(null);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isEnabled)
|
|
27
|
+
return;
|
|
28
|
+
let isCurrent = true;
|
|
29
|
+
const image = new window.Image();
|
|
30
|
+
setSize(null);
|
|
31
|
+
image.onload = () => {
|
|
32
|
+
if (isCurrent) {
|
|
33
|
+
setSize({ width: image.naturalWidth, height: image.naturalHeight });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
image.onerror = () => {
|
|
37
|
+
if (isCurrent)
|
|
38
|
+
setSize('error');
|
|
39
|
+
};
|
|
40
|
+
image.src = src;
|
|
41
|
+
return () => {
|
|
42
|
+
isCurrent = false;
|
|
43
|
+
image.onload = null;
|
|
44
|
+
image.onerror = null;
|
|
45
|
+
};
|
|
46
|
+
}, [src, isEnabled]);
|
|
47
|
+
return size;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Image of one `ImageViewer` view, fitted inside its frame. With `crop`, only
|
|
51
|
+
* that region of the image is drawn, scaled to fit the frame the same way the
|
|
52
|
+
* whole image would be.
|
|
53
|
+
*
|
|
54
|
+
* Internal to `ImageViewer`: it is not exported from the library.
|
|
55
|
+
*
|
|
56
|
+
* @component
|
|
57
|
+
* @example
|
|
58
|
+
* <ImageViewerImage
|
|
59
|
+
* src="/document.jpg"
|
|
60
|
+
* alt="Document front"
|
|
61
|
+
* crop={{ left: 0.1, top: 0.2, width: 0.3, height: 0.4 }}
|
|
62
|
+
* style={{ transform: 'rotate(0deg) scale(1)' }}
|
|
63
|
+
* />
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} props - The properties of the ImageViewerImage component.
|
|
66
|
+
* @param {string} props.src - Image URL.
|
|
67
|
+
* @param {string} props.alt - Accessible description of the image.
|
|
68
|
+
* @param {TImageCrop} [props.crop] - Region to show, as fractions (0 to 1) of the image width and height.
|
|
69
|
+
* @param {CSSProperties} props.style - Zoom and rotation computed by the viewer.
|
|
70
|
+
*
|
|
71
|
+
* @returns {ReactNode} The rendered image.
|
|
72
|
+
*/
|
|
73
|
+
export function ImageViewerImage({ src, alt, crop, style, }) {
|
|
74
|
+
const region = normalizeCrop(crop);
|
|
75
|
+
const size = useNaturalSize(src, region !== null);
|
|
76
|
+
const clipId = `crop${useId().replace(/[^\w-]/g, '')}`;
|
|
77
|
+
if (!region || size === 'error') {
|
|
78
|
+
return (
|
|
79
|
+
/**
|
|
80
|
+
* `next/image` exigiria que cada consumidor declare el dominio de sus
|
|
81
|
+
* imagenes en `remotePatterns`. Estas son cargas de usuario en
|
|
82
|
+
* almacenamiento externo, asi que la lista no se puede conocer.
|
|
83
|
+
*/
|
|
84
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
85
|
+
<img src={src} alt={alt} style={style} className={clsx('max-h-full max-w-full object-contain', TRANSFORM_CLASSNAME)}/>);
|
|
86
|
+
}
|
|
87
|
+
if (!size)
|
|
88
|
+
return null;
|
|
89
|
+
const box = {
|
|
90
|
+
x: region.left * size.width,
|
|
91
|
+
y: region.top * size.height,
|
|
92
|
+
width: region.width * size.width,
|
|
93
|
+
height: region.height * size.height,
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* `meet` centers the region but the SVG still paints whatever falls in the
|
|
97
|
+
* letterbox, which is the rest of the image: the clip keeps only the region.
|
|
98
|
+
*/
|
|
99
|
+
return (<svg role="img" aria-label={alt} viewBox={[box.x, box.y, box.width, box.height].join(' ')} preserveAspectRatio="xMidYMid meet" style={style} className={clsx('h-full w-full', TRANSFORM_CLASSNAME)}>
|
|
100
|
+
<defs>
|
|
101
|
+
<clipPath id={clipId}>
|
|
102
|
+
<rect {...box}/>
|
|
103
|
+
</clipPath>
|
|
104
|
+
</defs>
|
|
105
|
+
<image href={src} width={size.width} height={size.height} clipPath={`url(#${clipId})`}/>
|
|
106
|
+
</svg>);
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=ImageViewerImage.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageViewerImage.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/ImageViewer/ImageViewerImage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAGL,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAC;AAqBf,MAAM,mBAAmB,GAAG,4CAA4C,CAAC;AAEzE,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CAC9C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAElC;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAC,IAA4B,EAAqB,EAAE;IACxE,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,M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M;KACpC,CAAC;IAEF;;;OAGG;IACH,OAAO,CACL,CAAC,GAAG,CACF,IAAI,CAAC,KAAK,CACV,UAAU,CAAC,CAAC,GAAG,CAAC,CAChB,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACzD,mBAAmB,CAAC,eAAe,CACnC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,SAAS,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAEtD;MAAA,CAAC,IAAI,CACH;QAAA,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CACnB;UAAA,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,EAChB;QAAA,EAAE,QAAQ,CACZ;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,KAAK,CACJ,IAAI,CAAC,CAAC,GAAG,CAAC,CACV,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CACpB,QAAQ,CAAC,CAAC,QAAQ,MAAM,GAAG,CAAC,EAEhC;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type InlineMessageModifier = 'info' | 'warning' | 'error' | 'success';
|
|
3
|
+
export type InlineMessageProps = {
|
|
4
|
+
modifier: InlineMessageModifier;
|
|
5
|
+
/** Icon rendered before the text. Defaults per modifier; pass `null` to render none. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
/**
|
|
10
|
+
* Short contextual message attached to a piece of content: a validation that
|
|
11
|
+
* blocks a row, a hint under a form section, a confirmation next to a field.
|
|
12
|
+
* It stays in the flow of the page, unlike `showToast`, which floats and
|
|
13
|
+
* disappears.
|
|
14
|
+
*
|
|
15
|
+
* The text and background take the semantic color of the modifier, using the
|
|
16
|
+
* text-grade tokens so the copy keeps AA contrast on the tinted surface.
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
* @example
|
|
20
|
+
* <InlineMessage modifier="warning">
|
|
21
|
+
* Select a time window to include this item
|
|
22
|
+
* </InlineMessage>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Custom icon, or none at all
|
|
26
|
+
* <InlineMessage modifier="info" icon={<FiClock />}>Closes at 18:00</InlineMessage>
|
|
27
|
+
* <InlineMessage modifier="success" icon={null}>Saved</InlineMessage>
|
|
28
|
+
*
|
|
29
|
+
* @param {Object} props - The properties of the InlineMessage component.
|
|
30
|
+
* @param {'info' | 'warning' | 'error' | 'success'} props.modifier - Semantic tone; drives colors, default icon and ARIA role.
|
|
31
|
+
* @param {ReactNode} [props.icon] - Icon rendered before the text. Defaults per modifier; `null` renders no icon.
|
|
32
|
+
* @param {ReactNode} props.children - The message text.
|
|
33
|
+
*
|
|
34
|
+
* @returns {ReactNode} The rendered InlineMessage component.
|
|
35
|
+
*/
|
|
36
|
+
export declare function InlineMessage({ modifier, icon, children, ...restProps }: InlineMessageProps): ReactNode;
|
|
37
|
+
//# sourceMappingURL=InlineMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/InlineMessage/InlineMessage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,wFAAwF;IACxF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AA+BnC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CAmBhC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { FiAlertCircle, FiAlertTriangle, FiCheckCircle, FiInfo, } from 'react-icons/fi';
|
|
3
|
+
import { Paragraph } from '../../01-atoms/Paragraph';
|
|
4
|
+
const styleMap = {
|
|
5
|
+
info: clsx('bg-info-1 text-info-dark-3 dark:bg-info-dark-1 dark:text-info-dark'),
|
|
6
|
+
warning: clsx('bg-warning-1 text-amber-strong dark:bg-warning-dark-1 dark:text-warning-dark'),
|
|
7
|
+
error: clsx('bg-error-1 text-error-strong dark:bg-error-dark-1 dark:text-error-dark'),
|
|
8
|
+
success: clsx('bg-success-1 text-success-strong dark:bg-success-dark-1 dark:text-success-dark'),
|
|
9
|
+
};
|
|
10
|
+
const defaultIconMap = {
|
|
11
|
+
info: <FiInfo />,
|
|
12
|
+
warning: <FiAlertTriangle />,
|
|
13
|
+
error: <FiAlertCircle />,
|
|
14
|
+
success: <FiCheckCircle />,
|
|
15
|
+
};
|
|
16
|
+
const roleMap = {
|
|
17
|
+
info: 'status',
|
|
18
|
+
warning: 'alert',
|
|
19
|
+
error: 'alert',
|
|
20
|
+
success: 'status',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Short contextual message attached to a piece of content: a validation that
|
|
24
|
+
* blocks a row, a hint under a form section, a confirmation next to a field.
|
|
25
|
+
* It stays in the flow of the page, unlike `showToast`, which floats and
|
|
26
|
+
* disappears.
|
|
27
|
+
*
|
|
28
|
+
* The text and background take the semantic color of the modifier, using the
|
|
29
|
+
* text-grade tokens so the copy keeps AA contrast on the tinted surface.
|
|
30
|
+
*
|
|
31
|
+
* @component
|
|
32
|
+
* @example
|
|
33
|
+
* <InlineMessage modifier="warning">
|
|
34
|
+
* Select a time window to include this item
|
|
35
|
+
* </InlineMessage>
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // Custom icon, or none at all
|
|
39
|
+
* <InlineMessage modifier="info" icon={<FiClock />}>Closes at 18:00</InlineMessage>
|
|
40
|
+
* <InlineMessage modifier="success" icon={null}>Saved</InlineMessage>
|
|
41
|
+
*
|
|
42
|
+
* @param {Object} props - The properties of the InlineMessage component.
|
|
43
|
+
* @param {'info' | 'warning' | 'error' | 'success'} props.modifier - Semantic tone; drives colors, default icon and ARIA role.
|
|
44
|
+
* @param {ReactNode} [props.icon] - Icon rendered before the text. Defaults per modifier; `null` renders no icon.
|
|
45
|
+
* @param {ReactNode} props.children - The message text.
|
|
46
|
+
*
|
|
47
|
+
* @returns {ReactNode} The rendered InlineMessage component.
|
|
48
|
+
*/
|
|
49
|
+
export function InlineMessage({ modifier, icon, children, ...restProps }) {
|
|
50
|
+
const resolvedIcon = icon === undefined ? defaultIconMap[modifier] : icon;
|
|
51
|
+
const className = clsx('flex items-center gap-2 rounded-md px-2.5 py-2', styleMap[modifier], restProps.className);
|
|
52
|
+
return (<div role={roleMap[modifier]} {...restProps} className={className}>
|
|
53
|
+
{!!resolvedIcon && (<span aria-hidden="true" className="inline-flex shrink-0 text-xs">
|
|
54
|
+
{resolvedIcon}
|
|
55
|
+
</span>)}
|
|
56
|
+
<Paragraph size="subtitle-2">{children}</Paragraph>
|
|
57
|
+
</div>);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=InlineMessage.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineMessage.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/InlineMessage/InlineMessage.tsx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AC,SAAS,CAAC,CAAC,SAAS,CAAC,CAChE;MAAA,CAAC,CAAC,CAAC,YAAY,IAAI,CACjB,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,8BAA8B,CAC/D;UAAA,CAAC,YAAY,CACf;QAAA,EAAE,IAAI,CAAC,CACR,CACD;MAAA,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CACpD;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/InlineMessage/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/02-molecules/InlineMessage/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type ReactNode, type RefObject } from 'react';
|
|
1
|
+
import { type ComponentProps, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import { Button } from '../../01-atoms';
|
|
2
3
|
type ModalProps = {
|
|
3
4
|
header: string | ReactNode;
|
|
4
5
|
subHeader?: string | ReactNode;
|
|
@@ -16,6 +17,7 @@ export type TButton = {
|
|
|
16
17
|
text: string;
|
|
17
18
|
callback: (close: (closeAction: () => void) => void) => void;
|
|
18
19
|
disabled?: boolean;
|
|
20
|
+
tone?: ComponentProps<typeof Button>['tone'];
|
|
19
21
|
};
|
|
20
22
|
type ModalRef = {
|
|
21
23
|
handlerClose: (callback: TButton['callback']) => void;
|
|
@@ -43,10 +45,12 @@ type ModalRef = {
|
|
|
43
45
|
* @param {Object} [props.confirmButton] - Configuration for the confirm button.
|
|
44
46
|
* @param {Function} props.confirmButton.callback - Callback function triggered on confirm.
|
|
45
47
|
* @param {boolean} [props.confirmButton.disabled] - Whether the confirm button is disabled.
|
|
48
|
+
* @param {'default' | 'critical'} [props.confirmButton.tone='default'] - `critical` for a confirmation that cannot be undone (reject, delete).
|
|
46
49
|
* @param {Object} [props.cancelButton] - Configuration for the cancel button.
|
|
47
50
|
* @param {string} props.cancelButton.text - Text displayed on the cancel button.
|
|
48
51
|
* @param {Function} props.cancelButton.callback - Callback function triggered on cancel.
|
|
49
52
|
* @param {boolean} [props.cancelButton.disabled] - Whether the cancel button is disabled.
|
|
53
|
+
* @param {'default' | 'critical'} [props.cancelButton.tone='default'] - Tone of the cancel button, same values as the confirm one.
|
|
50
54
|
* @param {'base' | 'lg' | 'xl'} [props.size='base'] - The size of the modal.
|
|
51
55
|
* @param {string} props.classHeader - Class header.
|
|
52
56
|
* @param {Function} [props.handleCloseIcon] - Handle close icon close
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EACd,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAa,MAAM,gBAAgB,CAAC;AAGnD,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACvD,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,KAAK,iGAqJhB,CAAC"}
|
|
@@ -29,10 +29,12 @@ const leavingClasses = 'ease-in duration-200 opacity-75';
|
|
|
29
29
|
* @param {Object} [props.confirmButton] - Configuration for the confirm button.
|
|
30
30
|
* @param {Function} props.confirmButton.callback - Callback function triggered on confirm.
|
|
31
31
|
* @param {boolean} [props.confirmButton.disabled] - Whether the confirm button is disabled.
|
|
32
|
+
* @param {'default' | 'critical'} [props.confirmButton.tone='default'] - `critical` for a confirmation that cannot be undone (reject, delete).
|
|
32
33
|
* @param {Object} [props.cancelButton] - Configuration for the cancel button.
|
|
33
34
|
* @param {string} props.cancelButton.text - Text displayed on the cancel button.
|
|
34
35
|
* @param {Function} props.cancelButton.callback - Callback function triggered on cancel.
|
|
35
36
|
* @param {boolean} [props.cancelButton.disabled] - Whether the cancel button is disabled.
|
|
37
|
+
* @param {'default' | 'critical'} [props.cancelButton.tone='default'] - Tone of the cancel button, same values as the confirm one.
|
|
36
38
|
* @param {'base' | 'lg' | 'xl'} [props.size='base'] - The size of the modal.
|
|
37
39
|
* @param {string} props.classHeader - Class header.
|
|
38
40
|
* @param {Function} [props.handleCloseIcon] - Handle close icon close
|
|
@@ -83,8 +85,8 @@ export const Modal = forwardRef(function ({ header, subHeader, children, confirm
|
|
|
83
85
|
}, !isOpen
|
|
84
86
|
? `${enteringClasses} pointer-events-none translate-y-4 sm:translate-y-0 sm:scale-95`
|
|
85
87
|
: `translate-y-0 sm:scale-100`)}>
|
|
86
|
-
<div className="bg-gray-6 dark:bg-black-1 flex justify-between rounded-t-lg px-6 py-4">
|
|
87
|
-
<div>
|
|
88
|
+
<div className="bg-gray-6 dark:bg-black-1 flex items-start justify-between gap-4 rounded-t-lg px-6 py-4">
|
|
89
|
+
<div className="min-w-0">
|
|
88
90
|
<Paragraph id={titleId} size="subtitle-1">
|
|
89
91
|
{header}
|
|
90
92
|
</Paragraph>
|
|
@@ -92,7 +94,7 @@ export const Modal = forwardRef(function ({ header, subHeader, children, confirm
|
|
|
92
94
|
{subHeader}
|
|
93
95
|
</Paragraph>)}
|
|
94
96
|
</div>
|
|
95
|
-
<button type="button" aria-label={closeButtonAriaLabel} className="hover:text-gray-1 focus-visible:ring-lavender dark:hover:text-gray-3 rounded-sm p-1 transition-colors focus-visible:ring-2 focus-visible:outline-none" onClick={() => handlerClose(handleCloseIcon)}>
|
|
97
|
+
<button type="button" aria-label={closeButtonAriaLabel} className="hover:text-gray-1 focus-visible:ring-lavender dark:hover:text-gray-3 -my-1 shrink-0 rounded-sm p-1 transition-colors focus-visible:ring-2 focus-visible:outline-none" onClick={() => handlerClose(handleCloseIcon)}>
|
|
96
98
|
<IoCloseSharp aria-hidden size={20}/>
|
|
97
99
|
</button>
|
|
98
100
|
</div>
|
|
@@ -100,10 +102,10 @@ export const Modal = forwardRef(function ({ header, subHeader, children, confirm
|
|
|
100
102
|
{children}
|
|
101
103
|
</div>
|
|
102
104
|
{!!(cancelButton || confirmButton) && (<div className="flex flex-col-reverse justify-end gap-2 px-6 py-4 sm:flex-row">
|
|
103
|
-
{!!cancelButton && (<Button modifier="text" onClick={() => handlerClose(cancelButton.callback)} disabled={cancelButton.disabled}>
|
|
105
|
+
{!!cancelButton && (<Button modifier="text" tone={cancelButton.tone} onClick={() => handlerClose(cancelButton.callback)} disabled={cancelButton.disabled}>
|
|
104
106
|
{cancelButton.text}
|
|
105
107
|
</Button>)}
|
|
106
|
-
{!!confirmButton && (<Button onClick={() => handlerClose(confirmButton.callback)} disabled={confirmButton.disabled}>
|
|
108
|
+
{!!confirmButton && (<Button tone={confirmButton.tone} onClick={() => handlerClose(confirmButton.callback)} disabled={confirmButton.disabled}>
|
|
107
109
|
{confirmButton.text}
|
|
108
110
|
</Button>)}
|
|
109
111
|
</div>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"Modal.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAEL,UAAU,EAIV,WAAW,EACX,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA2BlD,MAAM,eAAe,GAAG,iCAAiC,CAAC;AAC1D,MAAM,cAAc,GAAG,iCAAiC,CAAC;AAEzD;;;;;;;;;;;;;;;;;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CAAC,CACV,CACD;kBAAA,CAAC,CAAC,CAAC,aAAa,IAAI,CAClB,CAAC,MAAM,CACL,IAAI,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CACzB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CACpD,QAAQ,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAEjC;sBAAA,CAAC,aAAa,CAAC,IAAI,CACrB;oBAAA,EAAE,MAAM,CAAC,CACV,CACH;gBAAA,EAAE,GAAG,CAAC,CACP,CACH;YAAA,EAAE,GAAG,CACP;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,GAAG,CACP;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './Table';
|
|
2
2
|
export * from './Filter';
|
|
3
|
+
export * from './Autocomplete';
|
|
3
4
|
export * from './FilterChips';
|
|
4
5
|
export * from './Dropdown';
|
|
5
6
|
export * from './Container';
|
|
@@ -16,4 +17,6 @@ export * from './ButtonGroup';
|
|
|
16
17
|
export * from './Accordion';
|
|
17
18
|
export * from './TimePicker';
|
|
18
19
|
export * from './BellNotifications';
|
|
20
|
+
export * from './DatePicker';
|
|
21
|
+
export * from './InlineMessage';
|
|
19
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/02-molecules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/02-molecules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './Table';
|
|
2
2
|
export * from './Filter';
|
|
3
|
+
export * from './Autocomplete';
|
|
3
4
|
export * from './FilterChips';
|
|
4
5
|
export * from './Dropdown';
|
|
5
6
|
export * from './Container';
|
|
@@ -16,4 +17,6 @@ export * from './ButtonGroup';
|
|
|
16
17
|
export * from './Accordion';
|
|
17
18
|
export * from './TimePicker';
|
|
18
19
|
export * from './BellNotifications';
|
|
20
|
+
export * from './DatePicker';
|
|
21
|
+
export * from './InlineMessage';
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/02-molecules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/02-molecules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type MapMarkerVariant = 'default' | 'numbered' | 'numbered-black' | 'muted';
|
|
3
|
+
export type MapMarker = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly lat: number;
|
|
6
|
+
readonly lng: number;
|
|
7
|
+
readonly label?: string;
|
|
8
|
+
readonly tooltip?: string;
|
|
9
|
+
readonly variant?: MapMarkerVariant;
|
|
10
|
+
};
|
|
11
|
+
export type MapViewControls = {
|
|
12
|
+
readonly zoomInLabel: string;
|
|
13
|
+
readonly zoomOutLabel: string;
|
|
14
|
+
readonly recenterLabel: string;
|
|
15
|
+
};
|
|
16
|
+
export type MapViewProps = {
|
|
17
|
+
readonly center: {
|
|
18
|
+
lat: number;
|
|
19
|
+
lng: number;
|
|
20
|
+
};
|
|
21
|
+
readonly zoom?: number;
|
|
22
|
+
readonly markers?: MapMarker[];
|
|
23
|
+
readonly fitToMarkers?: boolean;
|
|
24
|
+
readonly tileUrl?: string;
|
|
25
|
+
readonly attribution?: string;
|
|
26
|
+
readonly controls?: MapViewControls;
|
|
27
|
+
readonly onMarkerClick?: (marker: MapMarker) => void;
|
|
28
|
+
/** Fired with the clicked coordinates when the map itself (not a marker) is clicked. */
|
|
29
|
+
readonly onMapClick?: (lat: number, lng: number) => void;
|
|
30
|
+
/** Makes every rendered marker draggable. Pair with `onMarkerDragEnd` to read the new position. */
|
|
31
|
+
readonly draggableMarker?: boolean;
|
|
32
|
+
readonly onMarkerDragEnd?: (marker: MapMarker, lat: number, lng: number) => void;
|
|
33
|
+
readonly emptyMessage?: string;
|
|
34
|
+
readonly tone?: MapViewTone;
|
|
35
|
+
readonly className?: string;
|
|
36
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
37
|
+
export type MapViewTone = 'mono' | 'color';
|
|
38
|
+
/**
|
|
39
|
+
* MapView renders an interactive map with customizable markers and controls.
|
|
40
|
+
* Leaflet is loaded dynamically so the library barrel stays safe for SSR.
|
|
41
|
+
*
|
|
42
|
+
* @component
|
|
43
|
+
* @example
|
|
44
|
+
* <MapView
|
|
45
|
+
* center={{ lat: 4.711, lng: -74.072 }}
|
|
46
|
+
* markers={[{ id: '1', lat: 4.71, lng: -74.07, tooltip: 'Stop A' }]}
|
|
47
|
+
* controls={{
|
|
48
|
+
* zoomInLabel: 'Zoom in',
|
|
49
|
+
* zoomOutLabel: 'Zoom out',
|
|
50
|
+
* recenterLabel: 'Recenter',
|
|
51
|
+
* }}
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* @param {MapViewProps} props - The properties of the MapView component.
|
|
55
|
+
* @param {{ lat: number; lng: number }} props.center - Initial map center.
|
|
56
|
+
* @param {number} [props.zoom=12] - Initial zoom level.
|
|
57
|
+
* @param {MapMarker[]} [props.markers] - Markers to render on the map. `variant` is `default` or `numbered` (lavender `#6A5DF9`), `numbered-black` (black fill, white number) or `muted` (gray, no number). Numbered variants show `label` in white.
|
|
58
|
+
* @param {boolean} [props.fitToMarkers] - Fit bounds to markers when they change.
|
|
59
|
+
* @param {string} [props.tileUrl] - Tile layer URL template.
|
|
60
|
+
* @param {string} [props.attribution] - Map attribution HTML.
|
|
61
|
+
* @param {MapViewControls} [props.controls] - Labels for zoom and recenter controls.
|
|
62
|
+
* @param {(marker: MapMarker) => void} [props.onMarkerClick] - Fired when a marker is clicked.
|
|
63
|
+
* @param {(lat: number, lng: number) => void} [props.onMapClick] - Fired with the clicked coordinates when the map itself (not a marker) is clicked.
|
|
64
|
+
* @param {boolean} [props.draggableMarker] - Makes every rendered marker draggable.
|
|
65
|
+
* @param {(marker: MapMarker, lat: number, lng: number) => void} [props.onMarkerDragEnd] - Fired with the new coordinates once a dragged marker is released.
|
|
66
|
+
* @param {string} [props.emptyMessage] - Message shown when there are no markers.
|
|
67
|
+
* @param {'mono' | 'color'} [props.tone='mono'] - `mono` renders the tiles in grayscale and inverts them in dark mode, so the map follows the theme and the pins stay the only accent. `color` leaves the tiles as the provider serves them.
|
|
68
|
+
* @param {string} [props.className] - Extra classes for the root element.
|
|
69
|
+
*
|
|
70
|
+
* @returns {ReactNode} The rendered MapView component.
|
|
71
|
+
*/
|
|
72
|
+
export declare function MapView({ center, zoom, markers, fitToMarkers, tileUrl, attribution, controls, onMarkerClick, onMapClick, draggableMarker, onMarkerDragEnd, emptyMessage, tone, className, ...restProps }: MapViewProps): ReactNode;
|
|
73
|
+
//# sourceMappingURL=MapView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../src/components/03-organisms/MapView/MapView.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,UAAU,GACV,gBAAgB,GAChB,OAAO,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ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