@dbcdk/react-components 0.0.122 → 0.0.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/forms/checkbox/Checkbox.cjs +12 -4
- package/dist/components/forms/checkbox/Checkbox.d.ts +4 -1
- package/dist/components/forms/checkbox/Checkbox.js +12 -4
- package/dist/components/lightbox/Lightbox.cjs +3 -2
- package/dist/components/lightbox/Lightbox.d.ts +2 -0
- package/dist/components/lightbox/Lightbox.js +3 -2
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var lucideReact = require('lucide-react');
|
|
6
6
|
var react = require('react');
|
|
7
|
+
var Tooltip = require('../../../components/overlay/tooltip/Tooltip');
|
|
7
8
|
var styles = require('./Checkbox.module.css');
|
|
8
9
|
var InputContainer = require('../input-container/InputContainer');
|
|
9
10
|
|
|
@@ -29,7 +30,9 @@ function Checkbox({
|
|
|
29
30
|
required = false,
|
|
30
31
|
noContainer = false,
|
|
31
32
|
id,
|
|
32
|
-
"data-cy": dataCy
|
|
33
|
+
"data-cy": dataCy,
|
|
34
|
+
tooltip,
|
|
35
|
+
tooltipPlacement
|
|
33
36
|
}) {
|
|
34
37
|
const [internal, setInternal] = react.useState(false);
|
|
35
38
|
const isChecked = controlled != null ? controlled : internal;
|
|
@@ -47,7 +50,7 @@ function Checkbox({
|
|
|
47
50
|
className: [styles__default.default.container, size === "sm" ? styles__default.default.containerSm : ""].filter(Boolean).join(" "),
|
|
48
51
|
"data-cy": dataCy,
|
|
49
52
|
children: [
|
|
50
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: tooltip, placement: tooltipPlacement, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
54
|
"button",
|
|
52
55
|
{
|
|
53
56
|
id: controlId,
|
|
@@ -58,10 +61,15 @@ function Checkbox({
|
|
|
58
61
|
"aria-disabled": disabled || void 0,
|
|
59
62
|
"aria-invalid": Boolean(error) || void 0,
|
|
60
63
|
onClick: toggle,
|
|
61
|
-
className: [
|
|
64
|
+
className: [
|
|
65
|
+
styles__default.default.checkbox,
|
|
66
|
+
isChecked ? styles__default.default.checked : "",
|
|
67
|
+
styles__default.default[variant],
|
|
68
|
+
styles__default.default[size]
|
|
69
|
+
].filter(Boolean).join(" "),
|
|
62
70
|
children: isChecked && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: styles__default.default.icon })
|
|
63
71
|
}
|
|
64
|
-
),
|
|
72
|
+
) }),
|
|
65
73
|
label && (labelAs === "label" ? /* @__PURE__ */ jsxRuntime.jsx("label", { className: styles__default.default.label, htmlFor: controlId, children: label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.label, children: label }))
|
|
66
74
|
]
|
|
67
75
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { JSX, ReactNode } from 'react';
|
|
3
|
+
import type { TooltipPlacement } from '../../../components/overlay/tooltip/TooltipProvider';
|
|
3
4
|
type Variant = 'default' | 'primary' | 'outlined' | 'success' | 'info';
|
|
4
5
|
type Size = 'sm' | 'md' | 'lg';
|
|
5
6
|
interface CheckboxProps {
|
|
@@ -21,6 +22,8 @@ interface CheckboxProps {
|
|
|
21
22
|
noContainer?: boolean;
|
|
22
23
|
id?: string;
|
|
23
24
|
'data-cy'?: string;
|
|
25
|
+
tooltip?: ReactNode;
|
|
26
|
+
tooltipPlacement?: TooltipPlacement;
|
|
24
27
|
}
|
|
25
|
-
export declare function Checkbox({ checked: controlled, onChange, variant, disabled, label, labelAs, size, modified, containerLabel, error, helpText, orientation, labelWidth, fullWidth, required, noContainer, id, 'data-cy': dataCy, }: CheckboxProps): JSX.Element;
|
|
28
|
+
export declare function Checkbox({ checked: controlled, onChange, variant, disabled, label, labelAs, size, modified, containerLabel, error, helpText, orientation, labelWidth, fullWidth, required, noContainer, id, 'data-cy': dataCy, tooltip, tooltipPlacement, }: CheckboxProps): JSX.Element;
|
|
26
29
|
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Check } from 'lucide-react';
|
|
4
4
|
import { useState, useId } from 'react';
|
|
5
|
+
import { Tooltip } from '../../../components/overlay/tooltip/Tooltip';
|
|
5
6
|
import styles from './Checkbox.module.css';
|
|
6
7
|
import { InputContainer } from '../input-container/InputContainer';
|
|
7
8
|
|
|
@@ -23,7 +24,9 @@ function Checkbox({
|
|
|
23
24
|
required = false,
|
|
24
25
|
noContainer = false,
|
|
25
26
|
id,
|
|
26
|
-
"data-cy": dataCy
|
|
27
|
+
"data-cy": dataCy,
|
|
28
|
+
tooltip,
|
|
29
|
+
tooltipPlacement
|
|
27
30
|
}) {
|
|
28
31
|
const [internal, setInternal] = useState(false);
|
|
29
32
|
const isChecked = controlled != null ? controlled : internal;
|
|
@@ -41,7 +44,7 @@ function Checkbox({
|
|
|
41
44
|
className: [styles.container, size === "sm" ? styles.containerSm : ""].filter(Boolean).join(" "),
|
|
42
45
|
"data-cy": dataCy,
|
|
43
46
|
children: [
|
|
44
|
-
/* @__PURE__ */ jsx(
|
|
47
|
+
/* @__PURE__ */ jsx(Tooltip, { content: tooltip, placement: tooltipPlacement, children: /* @__PURE__ */ jsx(
|
|
45
48
|
"button",
|
|
46
49
|
{
|
|
47
50
|
id: controlId,
|
|
@@ -52,10 +55,15 @@ function Checkbox({
|
|
|
52
55
|
"aria-disabled": disabled || void 0,
|
|
53
56
|
"aria-invalid": Boolean(error) || void 0,
|
|
54
57
|
onClick: toggle,
|
|
55
|
-
className: [
|
|
58
|
+
className: [
|
|
59
|
+
styles.checkbox,
|
|
60
|
+
isChecked ? styles.checked : "",
|
|
61
|
+
styles[variant],
|
|
62
|
+
styles[size]
|
|
63
|
+
].filter(Boolean).join(" "),
|
|
56
64
|
children: isChecked && /* @__PURE__ */ jsx(Check, { className: styles.icon })
|
|
57
65
|
}
|
|
58
|
-
),
|
|
66
|
+
) }),
|
|
59
67
|
label && (labelAs === "label" ? /* @__PURE__ */ jsx("label", { className: styles.label, htmlFor: controlId, children: label }) : /* @__PURE__ */ jsx("span", { className: styles.label, children: label }))
|
|
60
68
|
]
|
|
61
69
|
}
|
|
@@ -121,7 +121,7 @@ function Lightbox({
|
|
|
121
121
|
if (!items.length) return null;
|
|
122
122
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
123
123
|
trigger ? trigger(openAt) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.thumbnails, children: items.map((item, i) => {
|
|
124
|
-
var _a2;
|
|
124
|
+
var _a2, _b;
|
|
125
125
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.thumbnailCard, children: [
|
|
126
126
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.thumbnailMedia, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
127
127
|
"button",
|
|
@@ -139,7 +139,8 @@ function Lightbox({
|
|
|
139
139
|
{
|
|
140
140
|
items: [
|
|
141
141
|
{ value: item.height != null ? `H:${item.height}px` : "-" },
|
|
142
|
-
{ value: item.width != null ? `B:${item.width}px` : "-" }
|
|
142
|
+
{ value: item.width != null ? `B:${item.width}px` : "-" },
|
|
143
|
+
...(_b = item.metaAddition) != null ? _b : []
|
|
143
144
|
]
|
|
144
145
|
}
|
|
145
146
|
) }),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { type MetaItem } from '../../client';
|
|
2
3
|
export type LightboxItem = {
|
|
3
4
|
thumbnail: ReactNode;
|
|
4
5
|
preview?: ReactNode;
|
|
@@ -7,6 +8,7 @@ export type LightboxItem = {
|
|
|
7
8
|
mimeType?: string;
|
|
8
9
|
width?: number;
|
|
9
10
|
height?: number;
|
|
11
|
+
metaAddition?: MetaItem[];
|
|
10
12
|
};
|
|
11
13
|
export type LightboxContextMenuItem = {
|
|
12
14
|
label: ReactNode;
|
|
@@ -115,7 +115,7 @@ function Lightbox({
|
|
|
115
115
|
if (!items.length) return null;
|
|
116
116
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
117
117
|
trigger ? trigger(openAt) : /* @__PURE__ */ jsx("div", { className: styles.thumbnails, children: items.map((item, i) => {
|
|
118
|
-
var _a2;
|
|
118
|
+
var _a2, _b;
|
|
119
119
|
return /* @__PURE__ */ jsxs("div", { className: styles.thumbnailCard, children: [
|
|
120
120
|
/* @__PURE__ */ jsx("div", { className: styles.thumbnailMedia, children: /* @__PURE__ */ jsx(
|
|
121
121
|
"button",
|
|
@@ -133,7 +133,8 @@ function Lightbox({
|
|
|
133
133
|
{
|
|
134
134
|
items: [
|
|
135
135
|
{ value: item.height != null ? `H:${item.height}px` : "-" },
|
|
136
|
-
{ value: item.width != null ? `B:${item.width}px` : "-" }
|
|
136
|
+
{ value: item.width != null ? `B:${item.width}px` : "-" },
|
|
137
|
+
...(_b = item.metaAddition) != null ? _b : []
|
|
137
138
|
]
|
|
138
139
|
}
|
|
139
140
|
) }),
|