@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":"Filter.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/Filter/Filter.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAkC,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,WAAW,EAEX,SAAS,EACT,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoB7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GAAG,IAAI,GACZ;IACb,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExC,MAAM,QAAQ,GAAG,QAAQ;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;SACzC,MAAM,CACL,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE;QACrB,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;QAC9B,M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IAAI,EAAE,SAAS;gCACf,KAAK,EACF,OAAO,CAAC,SAAS,CAAY,IAAI,EAAE;gCACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oCAClB,aAAa,CACX,SAAS,EACT,KAAK,CAAC,MAAM,CAAC,KAAK,CACnB,CAAC;gCACJ,CAAC;gCACD,GAAG,EAAE,OAAO;gCACZ,GAAG,EAAE,OAAO;6BACb,CAAC,CACF,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,gBAAgB,EAEpB;gCAAA,EAAE,IAAI,CAAC,IAAI,CACb;8BAAA,EAAE,IAAI,CAAC,CACR,CAAC;oBACJ,CAAC,CAAC,EAEN;sBAAA,EAAE,GAAG,CACP;oBAAA,EAAE,GAAG,CAAC,CACP,CAAC;YACJ,CAAC,CAAC,EAEN;YAAA,EAAE,GAAG,CAAC,CACP,CAAC,EAEJ;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,uGAAuG,CACpH;UAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAC3D;YAAA,CAAC,WAAW,CAAC,IAAI,CACnB;UAAA,EAAE,MAAM,CACR;UAAA,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,CACnD;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,IAAI,CACR;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/Filter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/Filter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/02-molecules/Filter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/02-molecules/Filter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
@@ -12,6 +12,8 @@ export type TInputBase = {
|
|
|
12
12
|
onDebouncedChange?: (query: string) => void | OptionType[] | Promise<void | OptionType[]>;
|
|
13
13
|
debounceDelay?: number;
|
|
14
14
|
toggleButtonLabel?: string;
|
|
15
|
+
/** Hides the dropdown-toggle chevron on an `autocomplete` input — see `Autocomplete`. */
|
|
16
|
+
hideToggleButton?: boolean;
|
|
15
17
|
noOptionsText?: string;
|
|
16
18
|
};
|
|
17
19
|
export type TInputRegular = TInputBase & {
|
|
@@ -24,15 +26,36 @@ export type TInputRadio = TInputBase & {
|
|
|
24
26
|
options: Record<string, string>;
|
|
25
27
|
placeholder?: never;
|
|
26
28
|
};
|
|
29
|
+
export type TFilterHelpers = {
|
|
30
|
+
filterKey: string;
|
|
31
|
+
setFilter: (name: string, value: TFilterValues) => void;
|
|
32
|
+
filters: Record<string, TFilterValues>;
|
|
33
|
+
};
|
|
27
34
|
export type TInputSelect = TInputBase & {
|
|
28
35
|
type: 'select';
|
|
29
36
|
options: Record<string, string>;
|
|
30
37
|
placeholder?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Fired after the panel state has taken the new value. `setFilter` lets a consumer
|
|
40
|
+
* react to the change, e.g. clearing the inputs that depended on the previous option.
|
|
41
|
+
*/
|
|
42
|
+
onChange?: (value: string, helpers: TFilterHelpers) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Renders the select read-only. Use it when the value is fixed for the current
|
|
45
|
+
* session (e.g. a scope with a single option) but should still be visible.
|
|
46
|
+
*/
|
|
47
|
+
disabled?: boolean;
|
|
31
48
|
};
|
|
32
49
|
export type TInputMultiSelect = TInputBase & {
|
|
33
50
|
type: 'multiselect';
|
|
34
51
|
options: OptionType[];
|
|
35
52
|
placeholder?: never;
|
|
53
|
+
/**
|
|
54
|
+
* Renders the multiselect read-only, keeping its selection visible. Use it when
|
|
55
|
+
* another control of the panel makes this one irrelevant (e.g. a switch that
|
|
56
|
+
* widens the search beyond what this control narrows).
|
|
57
|
+
*/
|
|
58
|
+
disabled?: boolean;
|
|
36
59
|
};
|
|
37
60
|
export type TInputSwitch = TInputBase & {
|
|
38
61
|
type: 'switch';
|
|
@@ -42,11 +65,7 @@ export type TInputSwitch = TInputBase & {
|
|
|
42
65
|
export type TInputAutocomplete = TInputBase & {
|
|
43
66
|
type: 'autocomplete';
|
|
44
67
|
options: OptionType[];
|
|
45
|
-
onSelect?: (selectedOption: OptionType | undefined, helpers:
|
|
46
|
-
filterKey: string;
|
|
47
|
-
setFilter: (name: string, value: TFilterValues) => void;
|
|
48
|
-
filters: Record<string, TFilterValues>;
|
|
49
|
-
}) => void;
|
|
68
|
+
onSelect?: (selectedOption: OptionType | undefined, helpers: TFilterHelpers) => void;
|
|
50
69
|
placeholder?: never;
|
|
51
70
|
};
|
|
52
71
|
export type TFilterInput = TInputRegular | TInputRadio | TInputSelect | TInputMultiSelect | TInputAutocomplete | TInputSwitch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/Filter/types.ts"],"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AAG,SAAS,EACtC,OAAO,EAAE,cAAc,KACpB,IAAI,CAAC;IACV,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,kBAAkB,GAClB,YAAY,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN;IACE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB,CACF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TFilterInput, TFilterInputs, TFilterValues } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a value against the options its control currently exposes.
|
|
4
|
+
*
|
|
5
|
+
* @param {TFilterInput} config - Configuration of the control that owns the value.
|
|
6
|
+
* @param {TFilterValues} value - Value to validate.
|
|
7
|
+
* @returns {TFilterValues | undefined} The same value when it is still
|
|
8
|
+
* selectable, a narrowed list when only part of a multiple selection survives,
|
|
9
|
+
* or `undefined` when nothing is selectable anymore.
|
|
10
|
+
*/
|
|
11
|
+
export declare const resolveFilterValue: (config: TFilterInput, value: TFilterValues) => TFilterValues | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Drops the applied values that the current options no longer offer, so a
|
|
14
|
+
* control whose options were replaced stops reporting a selection that cannot
|
|
15
|
+
* be chosen anymore.
|
|
16
|
+
*
|
|
17
|
+
* @param {TFilterInputs} inputs - Filter configuration holding the current options.
|
|
18
|
+
* @param {Record<string, TFilterValues>} values - Applied values, keyed as `name` or `name__index`.
|
|
19
|
+
* @returns {{ values: Record<string, TFilterValues>; changed: boolean }} The
|
|
20
|
+
* surviving values, returning the received reference untouched when nothing
|
|
21
|
+
* had to be dropped.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const { values } = pruneOrphanValues(
|
|
25
|
+
* { city: { config: [{ label: 'City', type: 'select', options: { bogota: 'Bogota' } }] } },
|
|
26
|
+
* { city: 'cdmx' },
|
|
27
|
+
* );
|
|
28
|
+
* // values → {}
|
|
29
|
+
*/
|
|
30
|
+
export declare const pruneOrphanValues: (inputs: TFilterInputs, values: Record<string, TFilterValues>) => {
|
|
31
|
+
values: Record<string, TFilterValues>;
|
|
32
|
+
changed: boolean;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=pruneOrphanValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pruneOrphanValues.d.ts","sourceRoot":"","sources":["../../../../../src/components/02-molecules/Filter/utils/pruneOrphanValues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK3E;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,WACrB,YAAY,SACb,aAAa,KACnB,aAAa,GAAG,SA4BlB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,WACpB,aAAa,UACb,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,KACpC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAoB3D,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const isEmptyValue = (value) => value === undefined || value === null || value === '';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a value against the options its control currently exposes.
|
|
4
|
+
*
|
|
5
|
+
* @param {TFilterInput} config - Configuration of the control that owns the value.
|
|
6
|
+
* @param {TFilterValues} value - Value to validate.
|
|
7
|
+
* @returns {TFilterValues | undefined} The same value when it is still
|
|
8
|
+
* selectable, a narrowed list when only part of a multiple selection survives,
|
|
9
|
+
* or `undefined` when nothing is selectable anymore.
|
|
10
|
+
*/
|
|
11
|
+
export const resolveFilterValue = (config, value) => {
|
|
12
|
+
const { type, options } = config;
|
|
13
|
+
if ((type === 'multiselect' || type === 'autocomplete') &&
|
|
14
|
+
Array.isArray(options) &&
|
|
15
|
+
Array.isArray(value)) {
|
|
16
|
+
const allowed = new Set(options.map((option) => String(option.value)));
|
|
17
|
+
const pruned = value.filter((option) => allowed.has(String(option.value)));
|
|
18
|
+
if (pruned.length === value.length)
|
|
19
|
+
return value;
|
|
20
|
+
return pruned.length ? pruned : undefined;
|
|
21
|
+
}
|
|
22
|
+
if ((type === 'select' || type === 'radio') &&
|
|
23
|
+
options &&
|
|
24
|
+
typeof options === 'object' &&
|
|
25
|
+
!Array.isArray(options) &&
|
|
26
|
+
typeof value === 'string') {
|
|
27
|
+
return value in options ? value : undefined;
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Drops the applied values that the current options no longer offer, so a
|
|
33
|
+
* control whose options were replaced stops reporting a selection that cannot
|
|
34
|
+
* be chosen anymore.
|
|
35
|
+
*
|
|
36
|
+
* @param {TFilterInputs} inputs - Filter configuration holding the current options.
|
|
37
|
+
* @param {Record<string, TFilterValues>} values - Applied values, keyed as `name` or `name__index`.
|
|
38
|
+
* @returns {{ values: Record<string, TFilterValues>; changed: boolean }} The
|
|
39
|
+
* surviving values, returning the received reference untouched when nothing
|
|
40
|
+
* had to be dropped.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const { values } = pruneOrphanValues(
|
|
44
|
+
* { city: { config: [{ label: 'City', type: 'select', options: { bogota: 'Bogota' } }] } },
|
|
45
|
+
* { city: 'cdmx' },
|
|
46
|
+
* );
|
|
47
|
+
* // values → {}
|
|
48
|
+
*/
|
|
49
|
+
export const pruneOrphanValues = (inputs, values) => {
|
|
50
|
+
let changed = false;
|
|
51
|
+
const next = { ...values };
|
|
52
|
+
for (const [key, value] of Object.entries(values)) {
|
|
53
|
+
if (isEmptyValue(value))
|
|
54
|
+
continue;
|
|
55
|
+
const [name, index] = key.split('__');
|
|
56
|
+
const config = inputs[name]?.config[Number(index) || 0];
|
|
57
|
+
if (!config)
|
|
58
|
+
continue;
|
|
59
|
+
const resolved = resolveFilterValue(config, value);
|
|
60
|
+
if (resolved === value)
|
|
61
|
+
continue;
|
|
62
|
+
changed = true;
|
|
63
|
+
if (resolved === undefined)
|
|
64
|
+
delete next[key];
|
|
65
|
+
else
|
|
66
|
+
next[key] = resolved;
|
|
67
|
+
}
|
|
68
|
+
return { values: changed ? next : values, changed };
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=pruneOrphanValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pruneOrphanValues.js","sourceRoot":"","sources":["../../../../../src/components/02-molecules/Filter/utils/pruneOrphanValues.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG,CAAC,KAAoB,EAAW,EAAE,CACrD,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAAoB,EACpB,KAAoB,EACO,EAAE;IAC7B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAEjC,IACE,CAAC,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,cAAc,CAAC;QACnD,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QACtB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,GAAG,CACpB,OAAwB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAChE,CAAC;QACF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO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E,KAAK,CAAC,CAAC;QACnD,IAAI,QAAQ,KAAK,KAAK;YAAE,SAAS;QAEjC,OAAO,GAAG,IAAI,CAAC;QACf,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;;YACxC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type TImageCrop } from './ImageViewerImage';
|
|
3
|
+
export type { TImageCrop } from './ImageViewerImage';
|
|
2
4
|
export type TImageView = {
|
|
3
5
|
id: string;
|
|
4
6
|
label: string;
|
|
5
7
|
src: string;
|
|
6
8
|
alt: string;
|
|
9
|
+
indicator?: ReactNode;
|
|
10
|
+
crop?: TImageCrop;
|
|
7
11
|
};
|
|
12
|
+
export type TImageViewerLayout = 'tabs' | 'split';
|
|
8
13
|
export type TImageViewerLabels = {
|
|
9
14
|
zoomIn: string;
|
|
10
15
|
zoomOut: string;
|
|
@@ -15,27 +20,53 @@ export type TImageViewerLabels = {
|
|
|
15
20
|
type ImageViewerProps = {
|
|
16
21
|
views: TImageView[];
|
|
17
22
|
labels: TImageViewerLabels;
|
|
23
|
+
layout?: TImageViewerLayout;
|
|
18
24
|
title?: ReactNode;
|
|
19
25
|
emptyState?: ReactNode;
|
|
26
|
+
activeId?: string;
|
|
27
|
+
onViewChange?: (id: string) => void;
|
|
20
28
|
} & Omit<HTMLAttributes<HTMLElement>, 'children' | 'title'>;
|
|
21
29
|
/**
|
|
22
30
|
* ImageViewer component for inspecting one or more images of the same subject.
|
|
23
31
|
*
|
|
24
32
|
* Each view is a tab, so a subject photographed from several angles reads as one
|
|
25
|
-
* piece instead of a gallery. Zoom and rotation reset
|
|
33
|
+
* piece instead of a gallery. Zoom and rotation reset whenever the active view
|
|
34
|
+
* changes, whether the user picked a tab or the consumer moved `activeId`: a
|
|
26
35
|
* transform that made sense for one angle rarely makes sense for the next.
|
|
27
36
|
*
|
|
37
|
+
* Uncontrolled by default. Passing `activeId` makes the consumer own the active
|
|
38
|
+
* view, so something outside the viewer (a side panel, a "next pending" action)
|
|
39
|
+
* can follow or drive it; `onViewChange` reports tab picks in both modes.
|
|
40
|
+
*
|
|
28
41
|
* Renders `emptyState` while `views` is empty, and disables the toolbar with it,
|
|
29
42
|
* so the frame keeps its size instead of collapsing.
|
|
30
43
|
*
|
|
44
|
+
* `layout="split"` is for comparing different subjects instead: every view
|
|
45
|
+
* gets its own pane with its label, side by side from `sm` and stacked below
|
|
46
|
+
* it. The toolbar acts on all panes at once, so both stay at the same scale,
|
|
47
|
+
* and there is no active view.
|
|
48
|
+
*
|
|
49
|
+
* A view's `crop` draws only that region of its image, fitted to the frame
|
|
50
|
+
* like the whole image would be — a face inside a document, for instance.
|
|
51
|
+
*
|
|
31
52
|
* @component
|
|
32
53
|
* @example
|
|
54
|
+
* const [viewId, setViewId] = useState('front');
|
|
55
|
+
*
|
|
33
56
|
* <ImageViewer
|
|
34
57
|
* title="Identity document"
|
|
35
58
|
* views={[
|
|
36
59
|
* { id: 'front', label: 'Front', src: '/front.jpg', alt: 'Document front' },
|
|
37
|
-
* {
|
|
60
|
+
* {
|
|
61
|
+
* id: 'back',
|
|
62
|
+
* label: 'Back',
|
|
63
|
+
* src: '/back.jpg',
|
|
64
|
+
* alt: 'Document back',
|
|
65
|
+
* indicator: <FiAlertTriangle role="img" aria-label="Needs review" />,
|
|
66
|
+
* },
|
|
38
67
|
* ]}
|
|
68
|
+
* activeId={viewId}
|
|
69
|
+
* onViewChange={setViewId}
|
|
39
70
|
* labels={{
|
|
40
71
|
* zoomIn: 'Zoom in',
|
|
41
72
|
* zoomOut: 'Zoom out',
|
|
@@ -46,15 +77,34 @@ type ImageViewerProps = {
|
|
|
46
77
|
* emptyState={<p>Nothing uploaded yet</p>}
|
|
47
78
|
* />
|
|
48
79
|
*
|
|
80
|
+
* @example
|
|
81
|
+
* <ImageViewer
|
|
82
|
+
* layout="split"
|
|
83
|
+
* title="Compared images"
|
|
84
|
+
* views={[
|
|
85
|
+
* { id: 'photo', label: 'Photo', src: '/photo.jpg', alt: 'Photo taken today' },
|
|
86
|
+
* {
|
|
87
|
+
* id: 'card',
|
|
88
|
+
* label: 'ID card',
|
|
89
|
+
* src: '/card.jpg',
|
|
90
|
+
* alt: 'Face on the ID card',
|
|
91
|
+
* crop: { left: 0.08, top: 0.2, width: 0.3, height: 0.5 },
|
|
92
|
+
* },
|
|
93
|
+
* ]}
|
|
94
|
+
* labels={labels}
|
|
95
|
+
* />
|
|
96
|
+
*
|
|
49
97
|
* @param {Object} props - The properties of the ImageViewer component.
|
|
50
|
-
* @param {TImageView[]} props.views - Images to display.
|
|
98
|
+
* @param {TImageView[]} props.views - Images to display. In `tabs`, more than one renders a tab per view; in `split`, a pane per view. A view's optional `indicator` sits after its label and becomes part of the tab's accessible name, so give it its own (for an icon, `role="img"` and `aria-label`). In `tabs` with a single view there are no tabs, so no indicator is shown. A view's optional `crop` (`left`, `top`, `width`, `height` as fractions from 0 to 1 of the image) shows only that region; a crop outside the image is clamped to it, and one with no area left falls back to the whole image.
|
|
51
99
|
* @param {TImageViewerLabels} props.labels - Accessible names of the toolbar actions.
|
|
100
|
+
* @param {TImageViewerLayout} [props.layout='tabs'] - `tabs` shows one view at a time; `split` shows every view at once, one pane each.
|
|
52
101
|
* @param {ReactNode} [props.title] - Optional heading rendered on the left of the toolbar.
|
|
53
102
|
* @param {ReactNode} [props.emptyState] - Content rendered when there is no image.
|
|
103
|
+
* @param {string} [props.activeId] - Id of the view to show. Makes the viewer controlled; an id that matches no view falls back to the first one. Ignored in `split`.
|
|
104
|
+
* @param {(id: string) => void} [props.onViewChange] - Called with the id of the tab the user picks, only when it differs from the active one. Never called in `split`.
|
|
54
105
|
* @param {HTMLAttributes<HTMLElement>} [props.restProps] - Additional attributes for the root element.
|
|
55
106
|
*
|
|
56
107
|
* @returns {ReactNode} The rendered ImageViewer component.
|
|
57
108
|
*/
|
|
58
|
-
export declare function ImageViewer({ views, labels, title, emptyState, ...restProps }: ImageViewerProps): ReactNode;
|
|
59
|
-
export {};
|
|
109
|
+
export declare function ImageViewer({ views, labels, layout, title, emptyState, activeId, onViewChange, ...restProps }: ImageViewerProps): ReactNode;
|
|
60
110
|
//# sourceMappingURL=ImageViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/ImageViewer/ImageViewer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageViewer.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/ImageViewer/ImageViewer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAYf,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEvE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAiB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,MAAe,EACf,KAAK,EACL,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,gBAAgB,GAAG,SAAS,CAqP9B"}
|
|
@@ -6,30 +6,55 @@ import { MdFullscreen, MdFullscreenExit, MdRotateRight, MdZoomIn, MdZoomOut, } f
|
|
|
6
6
|
import { Each, Show } from '../../00-base';
|
|
7
7
|
import { List, Paragraph } from '../../01-atoms';
|
|
8
8
|
import { TabItem } from '../Tab/TabItem';
|
|
9
|
+
import { ImageViewerImage } from './ImageViewerImage';
|
|
9
10
|
const MIN_ZOOM = 1;
|
|
10
11
|
const MAX_ZOOM = 3;
|
|
11
12
|
const ZOOM_STEP = 0.5;
|
|
12
13
|
const QUARTER_TURN = 90;
|
|
13
14
|
const FULL_TURN = 360;
|
|
15
|
+
const INITIAL_TRANSFORM = { zoom: MIN_ZOOM, rotation: 0 };
|
|
14
16
|
const TOOL_CLASSNAME = 'hover:bg-gray-5 focus-visible:ring-lavender disabled:text-gray-3 dark:disabled:text-gray-1 dark:hover:bg-gray-1 flex h-8 w-8 cursor-pointer items-center justify-center rounded-sm text-lg text-black focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:hover:bg-transparent dark:text-white';
|
|
15
17
|
/**
|
|
16
18
|
* ImageViewer component for inspecting one or more images of the same subject.
|
|
17
19
|
*
|
|
18
20
|
* Each view is a tab, so a subject photographed from several angles reads as one
|
|
19
|
-
* piece instead of a gallery. Zoom and rotation reset
|
|
21
|
+
* piece instead of a gallery. Zoom and rotation reset whenever the active view
|
|
22
|
+
* changes, whether the user picked a tab or the consumer moved `activeId`: a
|
|
20
23
|
* transform that made sense for one angle rarely makes sense for the next.
|
|
21
24
|
*
|
|
25
|
+
* Uncontrolled by default. Passing `activeId` makes the consumer own the active
|
|
26
|
+
* view, so something outside the viewer (a side panel, a "next pending" action)
|
|
27
|
+
* can follow or drive it; `onViewChange` reports tab picks in both modes.
|
|
28
|
+
*
|
|
22
29
|
* Renders `emptyState` while `views` is empty, and disables the toolbar with it,
|
|
23
30
|
* so the frame keeps its size instead of collapsing.
|
|
24
31
|
*
|
|
32
|
+
* `layout="split"` is for comparing different subjects instead: every view
|
|
33
|
+
* gets its own pane with its label, side by side from `sm` and stacked below
|
|
34
|
+
* it. The toolbar acts on all panes at once, so both stay at the same scale,
|
|
35
|
+
* and there is no active view.
|
|
36
|
+
*
|
|
37
|
+
* A view's `crop` draws only that region of its image, fitted to the frame
|
|
38
|
+
* like the whole image would be — a face inside a document, for instance.
|
|
39
|
+
*
|
|
25
40
|
* @component
|
|
26
41
|
* @example
|
|
42
|
+
* const [viewId, setViewId] = useState('front');
|
|
43
|
+
*
|
|
27
44
|
* <ImageViewer
|
|
28
45
|
* title="Identity document"
|
|
29
46
|
* views={[
|
|
30
47
|
* { id: 'front', label: 'Front', src: '/front.jpg', alt: 'Document front' },
|
|
31
|
-
* {
|
|
48
|
+
* {
|
|
49
|
+
* id: 'back',
|
|
50
|
+
* label: 'Back',
|
|
51
|
+
* src: '/back.jpg',
|
|
52
|
+
* alt: 'Document back',
|
|
53
|
+
* indicator: <FiAlertTriangle role="img" aria-label="Needs review" />,
|
|
54
|
+
* },
|
|
32
55
|
* ]}
|
|
56
|
+
* activeId={viewId}
|
|
57
|
+
* onViewChange={setViewId}
|
|
33
58
|
* labels={{
|
|
34
59
|
* zoomIn: 'Zoom in',
|
|
35
60
|
* zoomOut: 'Zoom out',
|
|
@@ -40,19 +65,38 @@ const TOOL_CLASSNAME = 'hover:bg-gray-5 focus-visible:ring-lavender disabled:tex
|
|
|
40
65
|
* emptyState={<p>Nothing uploaded yet</p>}
|
|
41
66
|
* />
|
|
42
67
|
*
|
|
68
|
+
* @example
|
|
69
|
+
* <ImageViewer
|
|
70
|
+
* layout="split"
|
|
71
|
+
* title="Compared images"
|
|
72
|
+
* views={[
|
|
73
|
+
* { id: 'photo', label: 'Photo', src: '/photo.jpg', alt: 'Photo taken today' },
|
|
74
|
+
* {
|
|
75
|
+
* id: 'card',
|
|
76
|
+
* label: 'ID card',
|
|
77
|
+
* src: '/card.jpg',
|
|
78
|
+
* alt: 'Face on the ID card',
|
|
79
|
+
* crop: { left: 0.08, top: 0.2, width: 0.3, height: 0.5 },
|
|
80
|
+
* },
|
|
81
|
+
* ]}
|
|
82
|
+
* labels={labels}
|
|
83
|
+
* />
|
|
84
|
+
*
|
|
43
85
|
* @param {Object} props - The properties of the ImageViewer component.
|
|
44
|
-
* @param {TImageView[]} props.views - Images to display.
|
|
86
|
+
* @param {TImageView[]} props.views - Images to display. In `tabs`, more than one renders a tab per view; in `split`, a pane per view. A view's optional `indicator` sits after its label and becomes part of the tab's accessible name, so give it its own (for an icon, `role="img"` and `aria-label`). In `tabs` with a single view there are no tabs, so no indicator is shown. A view's optional `crop` (`left`, `top`, `width`, `height` as fractions from 0 to 1 of the image) shows only that region; a crop outside the image is clamped to it, and one with no area left falls back to the whole image.
|
|
45
87
|
* @param {TImageViewerLabels} props.labels - Accessible names of the toolbar actions.
|
|
88
|
+
* @param {TImageViewerLayout} [props.layout='tabs'] - `tabs` shows one view at a time; `split` shows every view at once, one pane each.
|
|
46
89
|
* @param {ReactNode} [props.title] - Optional heading rendered on the left of the toolbar.
|
|
47
90
|
* @param {ReactNode} [props.emptyState] - Content rendered when there is no image.
|
|
91
|
+
* @param {string} [props.activeId] - Id of the view to show. Makes the viewer controlled; an id that matches no view falls back to the first one. Ignored in `split`.
|
|
92
|
+
* @param {(id: string) => void} [props.onViewChange] - Called with the id of the tab the user picks, only when it differs from the active one. Never called in `split`.
|
|
48
93
|
* @param {HTMLAttributes<HTMLElement>} [props.restProps] - Additional attributes for the root element.
|
|
49
94
|
*
|
|
50
95
|
* @returns {ReactNode} The rendered ImageViewer component.
|
|
51
96
|
*/
|
|
52
|
-
export function ImageViewer({ views, labels, title, emptyState, ...restProps }) {
|
|
53
|
-
const [
|
|
54
|
-
const [
|
|
55
|
-
const [rotation, setRotation] = useState(0);
|
|
97
|
+
export function ImageViewer({ views, labels, layout = 'tabs', title, emptyState, activeId, onViewChange, ...restProps }) {
|
|
98
|
+
const [internalIndex, setInternalIndex] = useState(0);
|
|
99
|
+
const [transform, setTransform] = useState(INITIAL_TRANSFORM);
|
|
56
100
|
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
57
101
|
const generatedId = useId();
|
|
58
102
|
/**
|
|
@@ -62,9 +106,8 @@ export function ImageViewer({ views, labels, title, emptyState, ...restProps })
|
|
|
62
106
|
*/
|
|
63
107
|
const viewsSignature = views.map(({ id }) => id).join('|');
|
|
64
108
|
useEffect(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
setRotation(0);
|
|
109
|
+
setInternalIndex(0);
|
|
110
|
+
setTransform(INITIAL_TRANSFORM);
|
|
68
111
|
}, [viewsSignature]);
|
|
69
112
|
useEffect(() => {
|
|
70
113
|
if (!isFullscreen)
|
|
@@ -76,12 +119,35 @@ export function ImageViewer({ views, labels, title, emptyState, ...restProps })
|
|
|
76
119
|
document.addEventListener('keydown', handleKeyDown);
|
|
77
120
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
78
121
|
}, [isFullscreen]);
|
|
122
|
+
const isControlled = activeId !== undefined;
|
|
123
|
+
const activeIndex = isControlled
|
|
124
|
+
? Math.max(views.findIndex(({ id }) => id === activeId), 0)
|
|
125
|
+
: internalIndex;
|
|
79
126
|
const activeView = views[activeIndex] ?? views[0];
|
|
80
127
|
const hasImage = Boolean(activeView);
|
|
128
|
+
const isSplit = layout === 'split';
|
|
129
|
+
const hasTabs = !isSplit && views.length > 1;
|
|
130
|
+
const { zoom, rotation } = transform;
|
|
131
|
+
const imageStyle = { transform: `rotate(${rotation}deg) scale(${zoom})` };
|
|
132
|
+
/**
|
|
133
|
+
* En modo controlado la vista puede cambiar sin pasar por `selectView`, asi
|
|
134
|
+
* que el reinicio se ata a la vista activa y no al clic. Guardar el zoom por
|
|
135
|
+
* id no alcanza: al volver a una vista reapareceria el zoom que tenia.
|
|
136
|
+
*/
|
|
137
|
+
const [transformViewId, setTransformViewId] = useState(activeView?.id);
|
|
138
|
+
if (activeView?.id !== transformViewId) {
|
|
139
|
+
setTransformViewId(activeView?.id);
|
|
140
|
+
setTransform(INITIAL_TRANSFORM);
|
|
141
|
+
}
|
|
81
142
|
const selectView = (index) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
143
|
+
const view = views[index];
|
|
144
|
+
if (!view)
|
|
145
|
+
return;
|
|
146
|
+
setTransform(INITIAL_TRANSFORM);
|
|
147
|
+
if (!isControlled)
|
|
148
|
+
setInternalIndex(index);
|
|
149
|
+
if (view.id !== activeView?.id)
|
|
150
|
+
onViewChange?.(view.id);
|
|
85
151
|
};
|
|
86
152
|
const frame = (<section {...restProps} className={clsx('border-gray-5 dark:border-gray-1 flex min-h-0 flex-col overflow-hidden rounded-lg border', isFullscreen ? 'h-full w-full bg-white dark:bg-black' : undefined, !isFullscreen ? restProps.className : undefined)}>
|
|
87
153
|
<div className="border-gray-5 bg-gray-6 dark:border-gray-1 dark:bg-black-1 flex flex-none items-center justify-between gap-4 border-b px-4 py-3">
|
|
@@ -93,13 +159,22 @@ export function ImageViewer({ views, labels, title, emptyState, ...restProps })
|
|
|
93
159
|
</Show.When>
|
|
94
160
|
</Show>
|
|
95
161
|
<div className="ml-auto flex items-center gap-1.5">
|
|
96
|
-
<button type="button" aria-label={labels.zoomOut} disabled={!hasImage || zoom <= MIN_ZOOM} onClick={() =>
|
|
162
|
+
<button type="button" aria-label={labels.zoomOut} disabled={!hasImage || zoom <= MIN_ZOOM} onClick={() => setTransform((current) => ({
|
|
163
|
+
...current,
|
|
164
|
+
zoom: current.zoom - ZOOM_STEP,
|
|
165
|
+
}))} className={TOOL_CLASSNAME}>
|
|
97
166
|
<MdZoomOut aria-hidden="true"/>
|
|
98
167
|
</button>
|
|
99
|
-
<button type="button" aria-label={labels.zoomIn} disabled={!hasImage || zoom >= MAX_ZOOM} onClick={() =>
|
|
168
|
+
<button type="button" aria-label={labels.zoomIn} disabled={!hasImage || zoom >= MAX_ZOOM} onClick={() => setTransform((current) => ({
|
|
169
|
+
...current,
|
|
170
|
+
zoom: current.zoom + ZOOM_STEP,
|
|
171
|
+
}))} className={TOOL_CLASSNAME}>
|
|
100
172
|
<MdZoomIn aria-hidden="true"/>
|
|
101
173
|
</button>
|
|
102
|
-
<button type="button" aria-label={labels.rotate} disabled={!hasImage} onClick={() =>
|
|
174
|
+
<button type="button" aria-label={labels.rotate} disabled={!hasImage} onClick={() => setTransform((current) => ({
|
|
175
|
+
...current,
|
|
176
|
+
rotation: (current.rotation + QUARTER_TURN) % FULL_TURN,
|
|
177
|
+
}))} className={TOOL_CLASSNAME}>
|
|
103
178
|
<MdRotateRight aria-hidden="true"/>
|
|
104
179
|
</button>
|
|
105
180
|
<button type="button" aria-label={isFullscreen ? labels.exitFullscreen : labels.enterFullscreen} aria-pressed={isFullscreen} disabled={!hasImage} onClick={() => setIsFullscreen((current) => !current)} className={TOOL_CLASSNAME}>
|
|
@@ -109,27 +184,43 @@ export function ImageViewer({ views, labels, title, emptyState, ...restProps })
|
|
|
109
184
|
</div>
|
|
110
185
|
|
|
111
186
|
<Show>
|
|
112
|
-
<Show.When isTrue={
|
|
187
|
+
<Show.When isTrue={hasTabs}>
|
|
113
188
|
<List role="tablist" aria-orientation="horizontal" orientation="horizontal" className="border-gray-5 dark:border-gray-1 flex-none items-end gap-6 border-b px-4">
|
|
114
|
-
<Each of={views} render={({ id, label }, index) => (<li key={id} role="presentation">
|
|
189
|
+
<Each of={views} render={({ id, label, indicator }, index) => (<li key={id} role="presentation">
|
|
115
190
|
<TabItem id={`${generatedId}-tab-${index}`} aria-controls={`${generatedId}-panel`} aria-selected={index === activeIndex} tabIndex={index === activeIndex ? 0 : -1} isActive={index === activeIndex} onClick={() => selectView(index)} className="pb-2">
|
|
116
|
-
|
|
191
|
+
<span className="inline-flex items-center gap-1.5">
|
|
192
|
+
{label}
|
|
193
|
+
{!!indicator && (<span className="flex flex-none items-center">
|
|
194
|
+
{indicator}
|
|
195
|
+
</span>)}
|
|
196
|
+
</span>
|
|
117
197
|
</TabItem>
|
|
118
198
|
</li>)}/>
|
|
119
199
|
</List>
|
|
120
200
|
</Show.When>
|
|
121
201
|
</Show>
|
|
122
202
|
|
|
123
|
-
<div id={`${generatedId}-panel`} role={
|
|
203
|
+
<div id={`${generatedId}-panel`} role={hasTabs ? 'tabpanel' : undefined} aria-labelledby={hasTabs ? `${generatedId}-tab-${activeIndex}` : undefined} className="bg-gray-7 dark:bg-black-2 flex min-h-0 flex-1 items-center justify-center overflow-hidden p-5">
|
|
124
204
|
<Show>
|
|
205
|
+
<Show.When isTrue={hasImage && isSplit}>
|
|
206
|
+
<div className="grid h-full w-full auto-rows-fr grid-cols-1 gap-5 sm:auto-cols-fr sm:grid-flow-col sm:grid-cols-none sm:grid-rows-1">
|
|
207
|
+
<Each of={views} render={({ id, label, indicator, src, alt, crop }) => (<figure key={id} className="flex min-h-0 min-w-0 flex-col gap-2">
|
|
208
|
+
<figcaption className="flex flex-none items-center gap-1.5">
|
|
209
|
+
<Paragraph size="subtitle-2" className="dark:text-white">
|
|
210
|
+
{label}
|
|
211
|
+
</Paragraph>
|
|
212
|
+
{!!indicator && (<span className="flex flex-none items-center">
|
|
213
|
+
{indicator}
|
|
214
|
+
</span>)}
|
|
215
|
+
</figcaption>
|
|
216
|
+
<div className="flex min-h-0 flex-1 items-center justify-center overflow-hidden">
|
|
217
|
+
<ImageViewerImage src={src} alt={alt} crop={crop} style={imageStyle}/>
|
|
218
|
+
</div>
|
|
219
|
+
</figure>)}/>
|
|
220
|
+
</div>
|
|
221
|
+
</Show.When>
|
|
125
222
|
<Show.When isTrue={hasImage}>
|
|
126
|
-
{
|
|
127
|
-
* `next/image` exigiria que cada consumidor declare el dominio de
|
|
128
|
-
* sus imagenes en `remotePatterns`. Estas son cargas de usuario en
|
|
129
|
-
* almacenamiento externo, asi que la lista no se puede conocer.
|
|
130
|
-
*/}
|
|
131
|
-
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
132
|
-
<img src={activeView?.src} alt={activeView?.alt} style={{ transform: `rotate(${rotation}deg) scale(${zoom})` }} className="max-h-full max-w-full object-contain transition-transform duration-200 ease-out"/>
|
|
223
|
+
{activeView && (<ImageViewerImage key={activeView.id} src={activeView.src} alt={activeView.alt} crop={activeView.crop} style={imageStyle}/>)}
|
|
133
224
|
</Show.When>
|
|
134
225
|
<Show.Else>{emptyState}</Show.Else>
|
|
135
226
|
</Show>
|