@ledgerhq/lumen-ui-react 0.0.64 → 0.0.65
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/lib/Components/BaseInput/BaseInput.d.ts +1 -0
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +49 -48
- package/dist/lib/Components/BaseInput/types.d.ts +5 -1
- package/dist/lib/Components/BaseInput/types.d.ts.map +1 -1
- package/dist/lib/Components/SearchInput/SearchInput.d.ts +3 -2
- package/dist/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/lib/Components/SearchInput/SearchInput.js +45 -13
- package/dist/lib/Components/SearchInput/types.d.ts +7 -1
- package/dist/lib/Components/SearchInput/types.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.d.ts +15 -9
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +117 -119
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ export declare const BaseInput: React.ForwardRefExoticComponent<{
|
|
|
27
27
|
onClear?: () => void;
|
|
28
28
|
hideClearButton?: boolean;
|
|
29
29
|
className?: string;
|
|
30
|
+
containerClassName?: string;
|
|
30
31
|
inputClassName?: string;
|
|
31
32
|
labelClassName?: string;
|
|
32
33
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;iHA0LrB,CAAC"}
|
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
3
|
-
import
|
|
4
|
-
import { useCommonTranslation as
|
|
5
|
-
import { InteractiveIcon as
|
|
2
|
+
import { cn as a } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import l from "react";
|
|
4
|
+
import { useCommonTranslation as _ } from "../../../i18n/useCommonTranslation.js";
|
|
5
|
+
import { InteractiveIcon as $ } from "../InteractiveIcon/InteractiveIcon.js";
|
|
6
6
|
import { DeleteCircleFill as I } from "../../Symbols/Icons/DeleteCircleFill.js";
|
|
7
|
-
const
|
|
7
|
+
const q = a(
|
|
8
8
|
"group relative flex h-48 w-full cursor-text items-center gap-8 rounded-sm bg-muted px-16 transition-colors",
|
|
9
9
|
"focus-within:ring-2 focus-within:ring-active hover:bg-muted-hover",
|
|
10
10
|
"has-disabled:cursor-not-allowed has-disabled:bg-disabled has-disabled:text-disabled",
|
|
11
11
|
"has-invalid:border-error has-invalid:ring-1 has-invalid:ring-error",
|
|
12
12
|
'has-[input[aria-invalid="true"]]:border-error has-[input[aria-invalid="true"]]:ring-1 has-[input[aria-invalid="true"]]:ring-error'
|
|
13
|
-
),
|
|
13
|
+
), H = a(
|
|
14
14
|
"peer w-full flex-1 bg-muted body-1 text-base caret-active outline-hidden transition-colors",
|
|
15
15
|
"group-hover:bg-muted-hover group-disabled:bg-disabled",
|
|
16
16
|
"group-has-disabled:cursor-not-allowed group-has-disabled:bg-disabled group-has-disabled:text-disabled",
|
|
17
17
|
"placeholder:text-muted group-has-disabled:placeholder:text-disabled",
|
|
18
18
|
"[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
19
19
|
"truncate"
|
|
20
|
-
),
|
|
20
|
+
), U = a(
|
|
21
21
|
"pointer-events-none absolute top-6 left-16 origin-left body-4 text-muted transition-all duration-300",
|
|
22
22
|
"peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-placeholder-shown:body-2",
|
|
23
23
|
"group-has-disabled:text-disabled",
|
|
24
24
|
"peer-focus:top-6 peer-focus:-translate-y-0 peer-focus:body-4",
|
|
25
25
|
"w-[calc(100%-var(--size-56))] truncate"
|
|
26
|
-
),
|
|
26
|
+
), G = l.forwardRef(
|
|
27
27
|
({
|
|
28
28
|
className: N,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
containerClassName: R,
|
|
30
|
+
inputClassName: S,
|
|
31
|
+
labelClassName: k,
|
|
31
32
|
label: u,
|
|
32
|
-
id:
|
|
33
|
+
id: z,
|
|
33
34
|
disabled: f,
|
|
34
|
-
errorMessage:
|
|
35
|
-
suffix:
|
|
36
|
-
prefix:
|
|
35
|
+
errorMessage: i,
|
|
36
|
+
suffix: E,
|
|
37
|
+
prefix: j,
|
|
37
38
|
onClear: p,
|
|
38
|
-
hideClearButton:
|
|
39
|
+
hideClearButton: B = !1,
|
|
39
40
|
"aria-invalid": m,
|
|
40
41
|
onChange: d,
|
|
41
|
-
...
|
|
42
|
-
},
|
|
42
|
+
...o
|
|
43
|
+
}, C) => {
|
|
43
44
|
var x;
|
|
44
|
-
const { t:
|
|
45
|
-
((x =
|
|
46
|
-
),
|
|
45
|
+
const { t: D } = _(), r = l.useRef(null), F = l.useId(), b = z || `input-${F}`, L = m || (i ? !0 : void 0), c = o.value !== void 0, [T, v] = l.useState(
|
|
46
|
+
((x = o.defaultValue) == null ? void 0 : x.toString()) || ""
|
|
47
|
+
), V = l.useCallback(
|
|
47
48
|
(t) => {
|
|
48
49
|
c || v(t.target.value), d == null || d(t);
|
|
49
50
|
},
|
|
50
51
|
[c, d]
|
|
51
|
-
), g = (c ? !!
|
|
52
|
+
), g = (c ? !!o.value && o.value.toString().length > 0 : T.length > 0) && !f && !B, w = `${b}-error`, A = () => {
|
|
52
53
|
var e;
|
|
53
54
|
if (!r.current) return;
|
|
54
55
|
const t = (e = Object.getOwnPropertyDescriptor(
|
|
@@ -56,13 +57,13 @@ const $ = l(
|
|
|
56
57
|
"value"
|
|
57
58
|
)) == null ? void 0 : e.set;
|
|
58
59
|
t == null || t.call(r.current, ""), c || v("");
|
|
59
|
-
const
|
|
60
|
-
r.current.dispatchEvent(
|
|
60
|
+
const s = new Event("input", { bubbles: !0 });
|
|
61
|
+
r.current.dispatchEvent(s), r.current.focus(), p == null || p();
|
|
61
62
|
};
|
|
62
|
-
function
|
|
63
|
-
return (
|
|
63
|
+
function O(...t) {
|
|
64
|
+
return (s) => {
|
|
64
65
|
t.forEach((e) => {
|
|
65
|
-
e && (typeof e == "function" ? e(
|
|
66
|
+
e && (typeof e == "function" ? e(s) : e.current = s);
|
|
66
67
|
});
|
|
67
68
|
};
|
|
68
69
|
}
|
|
@@ -70,7 +71,7 @@ const $ = l(
|
|
|
70
71
|
/* @__PURE__ */ h(
|
|
71
72
|
"div",
|
|
72
73
|
{
|
|
73
|
-
className:
|
|
74
|
+
className: a(q, R),
|
|
74
75
|
onPointerDown: (t) => {
|
|
75
76
|
if (t.target.closest("input, button, a")) return;
|
|
76
77
|
const e = r.current;
|
|
@@ -85,51 +86,51 @@ const $ = l(
|
|
|
85
86
|
});
|
|
86
87
|
},
|
|
87
88
|
children: [
|
|
88
|
-
|
|
89
|
+
j,
|
|
89
90
|
/* @__PURE__ */ n(
|
|
90
91
|
"input",
|
|
91
92
|
{
|
|
92
|
-
ref:
|
|
93
|
+
ref: O(C, r),
|
|
93
94
|
id: b,
|
|
94
95
|
disabled: f,
|
|
95
96
|
placeholder: " ",
|
|
96
|
-
"aria-invalid":
|
|
97
|
-
"aria-describedby":
|
|
98
|
-
className:
|
|
99
|
-
|
|
97
|
+
"aria-invalid": L,
|
|
98
|
+
"aria-describedby": i ? w : void 0,
|
|
99
|
+
className: a(
|
|
100
|
+
H,
|
|
100
101
|
u && "pt-12 body-2",
|
|
101
|
-
|
|
102
|
+
S
|
|
102
103
|
),
|
|
103
|
-
onChange:
|
|
104
|
-
...
|
|
104
|
+
onChange: V,
|
|
105
|
+
...o
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
108
|
u && /* @__PURE__ */ n(
|
|
108
109
|
"label",
|
|
109
110
|
{
|
|
110
111
|
htmlFor: b,
|
|
111
|
-
className:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
className: a(
|
|
113
|
+
U,
|
|
114
|
+
i && "text-error",
|
|
115
|
+
k
|
|
115
116
|
),
|
|
116
117
|
children: u
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
120
|
g && /* @__PURE__ */ n(
|
|
120
|
-
|
|
121
|
+
$,
|
|
121
122
|
{
|
|
122
123
|
iconType: "filled",
|
|
123
|
-
onClick:
|
|
124
|
-
"aria-label":
|
|
124
|
+
onClick: A,
|
|
125
|
+
"aria-label": D("components.baseInput.clearInputAriaLabel"),
|
|
125
126
|
children: /* @__PURE__ */ n(I, { size: 20 })
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
!g &&
|
|
129
|
+
!g && E
|
|
129
130
|
]
|
|
130
131
|
}
|
|
131
132
|
),
|
|
132
|
-
|
|
133
|
+
i && /* @__PURE__ */ h(
|
|
133
134
|
"div",
|
|
134
135
|
{
|
|
135
136
|
id: w,
|
|
@@ -137,14 +138,14 @@ const $ = l(
|
|
|
137
138
|
role: "alert",
|
|
138
139
|
children: [
|
|
139
140
|
/* @__PURE__ */ n(I, { size: 16, className: "shrink-0 text-error" }),
|
|
140
|
-
/* @__PURE__ */ n("span", { children:
|
|
141
|
+
/* @__PURE__ */ n("span", { children: i })
|
|
141
142
|
]
|
|
142
143
|
}
|
|
143
144
|
)
|
|
144
145
|
] });
|
|
145
146
|
}
|
|
146
147
|
);
|
|
147
|
-
|
|
148
|
+
G.displayName = "BaseInput";
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
+
G as BaseInput
|
|
150
151
|
};
|
|
@@ -32,9 +32,13 @@ export type BaseInputProps = {
|
|
|
32
32
|
*/
|
|
33
33
|
hideClearButton?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
* Additional class names to apply to the
|
|
35
|
+
* Additional class names to apply to the outer wrapper element
|
|
36
36
|
*/
|
|
37
37
|
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Additional class names to apply to the inner container element
|
|
40
|
+
*/
|
|
41
|
+
containerClassName?: string;
|
|
38
42
|
/**
|
|
39
43
|
* Additional class names to apply to the input element
|
|
40
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { SearchInputProps } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* A customizable search input component with built-in search icon, automatic clear button, error states, and focus/hover effects.
|
|
5
4
|
*
|
|
@@ -54,5 +53,7 @@ import { SearchInputProps } from './types';
|
|
|
54
53
|
* }}
|
|
55
54
|
* />
|
|
56
55
|
*/
|
|
57
|
-
export declare const SearchInput: React.ForwardRefExoticComponent<
|
|
56
|
+
export declare const SearchInput: React.ForwardRefExoticComponent<Omit<import('..').BaseInputProps, "label" | "prefix" | "containerClassName" | "labelClassName"> & {
|
|
57
|
+
appearance?: "plain" | "transparent";
|
|
58
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
58
59
|
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,WAAW;;0CAuBvB,CAAC"}
|
|
@@ -1,18 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as t } from "class-variance-authority";
|
|
4
|
+
import o from "react";
|
|
5
|
+
import { BaseInput as d } from "../BaseInput/BaseInput.js";
|
|
6
|
+
import { Search as c } from "../../Symbols/Icons/Search.js";
|
|
7
|
+
const m = t("", {
|
|
8
|
+
variants: {
|
|
9
|
+
appearance: {
|
|
10
|
+
plain: "",
|
|
11
|
+
transparent: "bg-muted-transparent hover:bg-muted-transparent-hover has-disabled:bg-muted-transparent-disabled"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
appearance: "plain"
|
|
16
|
+
}
|
|
17
|
+
}), l = t("", {
|
|
18
|
+
variants: {
|
|
19
|
+
appearance: {
|
|
20
|
+
plain: "",
|
|
21
|
+
transparent: "bg-transparent group-hover:bg-transparent-hover group-has-disabled:bg-transparent-disabled"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
appearance: "plain"
|
|
26
|
+
}
|
|
27
|
+
}), u = o.forwardRef(
|
|
28
|
+
({ appearance: a = "plain", className: e, inputClassName: n, ...s }, p) => /* @__PURE__ */ r(
|
|
29
|
+
d,
|
|
8
30
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
31
|
+
ref: p,
|
|
32
|
+
prefix: /* @__PURE__ */ r(
|
|
33
|
+
c,
|
|
34
|
+
{
|
|
35
|
+
size: 20,
|
|
36
|
+
className: "text-muted group-has-disabled:text-disabled",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
className: e,
|
|
41
|
+
containerClassName: m({ appearance: a }),
|
|
42
|
+
inputClassName: i(l({ appearance: a }), n),
|
|
43
|
+
...s
|
|
12
44
|
}
|
|
13
|
-
)
|
|
45
|
+
)
|
|
14
46
|
);
|
|
15
|
-
|
|
47
|
+
u.displayName = "SearchInput";
|
|
16
48
|
export {
|
|
17
|
-
|
|
49
|
+
u as SearchInput
|
|
18
50
|
};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { BaseInputProps } from '../BaseInput/types';
|
|
2
|
-
export type SearchInputProps = Omit<BaseInputProps, 'prefix' | 'label' | 'labelClassName' | '
|
|
2
|
+
export type SearchInputProps = Omit<BaseInputProps, 'prefix' | 'label' | 'labelClassName' | 'containerClassName'> & {
|
|
3
|
+
/**
|
|
4
|
+
* The visual appearance of the search input
|
|
5
|
+
* @default 'plain'
|
|
6
|
+
*/
|
|
7
|
+
appearance?: 'plain' | 'transparent';
|
|
8
|
+
};
|
|
3
9
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,EACd,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,EACd,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,oBAAoB,CAC7D,GAAG;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;CACtC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* A flexible tile component that uses a composite pattern for maximum customization.
|
|
4
5
|
* Displays content in a vertical layout with support for spots, text, and custom content.
|
|
@@ -26,10 +27,14 @@ import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionP
|
|
|
26
27
|
* <div>Custom content</div>
|
|
27
28
|
* </Tile>
|
|
28
29
|
*/
|
|
29
|
-
export declare const Tile: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
export declare const Tile: import('react').ForwardRefExoticComponent<{
|
|
31
|
+
appearance?: "no-background" | "card";
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
34
|
+
children: import('react').ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
} & Omit<import('react').HTMLAttributes<HTMLDivElement>, "onClick"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
33
38
|
/**
|
|
34
39
|
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
35
40
|
* Always renders at a fixed size of 48.
|
|
@@ -79,8 +84,9 @@ export declare const TileDescription: {
|
|
|
79
84
|
* </TileContent>
|
|
80
85
|
* </Tile>
|
|
81
86
|
*/
|
|
82
|
-
export declare const TileSecondaryAction: {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
export declare const TileSecondaryAction: import('react').ForwardRefExoticComponent<{
|
|
88
|
+
onClick?: MouseEventHandler;
|
|
89
|
+
icon: React.ComponentType<Omit<import('../Icon').IconProps, "children">>;
|
|
90
|
+
className?: string;
|
|
91
|
+
} & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
86
92
|
//# sourceMappingURL=Tile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAc,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAG7E,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAGpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAgEjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;;;;;;;oHAsGhB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,WAAW;wCAIrB,gBAAgB;;CASlB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,SAAS;wCAInB,cAAc;;CAiBhB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,eAAe;wCAIzB,oBAAoB;;CAiBtB,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;;;;0HAuC9B,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { extractSlottable as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { Spot as
|
|
6
|
-
import { InteractiveIcon as
|
|
7
|
-
const [
|
|
8
|
-
root:
|
|
1
|
+
import { jsx as s, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { extractSlottable as C, createSafeContext as I, cn as u } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as v } from "class-variance-authority";
|
|
4
|
+
import { forwardRef as x, useState as w, useCallback as d } from "react";
|
|
5
|
+
import { Spot as z } from "../Spot/Spot.js";
|
|
6
|
+
import { InteractiveIcon as V } from "../InteractiveIcon/InteractiveIcon.js";
|
|
7
|
+
const [j, p] = I("Tile"), T = {
|
|
8
|
+
root: v(
|
|
9
9
|
[
|
|
10
10
|
"group relative flex flex-col items-center gap-8 text-base transition-colors",
|
|
11
11
|
"rounded-md focus-visible:outline-2 focus-visible:outline-focus"
|
|
@@ -58,113 +58,116 @@ const [V, u] = C("Tile"), v = {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
button:
|
|
61
|
+
button: v(
|
|
62
62
|
"flex w-full cursor-pointer flex-col items-center gap-8 rounded-md px-8 py-12 focus-visible:outline-2 focus-visible:outline-focus"
|
|
63
63
|
)
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
a
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
[o]
|
|
86
|
-
), A = n(
|
|
87
|
-
(a) => {
|
|
88
|
-
f(!1), c == null || c(a);
|
|
89
|
-
},
|
|
90
|
-
[c]
|
|
91
|
-
), S = n(
|
|
92
|
-
(a) => {
|
|
93
|
-
f(!1), s == null || s(a);
|
|
94
|
-
},
|
|
95
|
-
[s]
|
|
96
|
-
);
|
|
97
|
-
return /* @__PURE__ */ l(V, { value: { disabled: t }, children: /* @__PURE__ */ k(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
...x,
|
|
101
|
-
className: v.root({
|
|
102
|
-
appearance: r,
|
|
103
|
-
isActive: y,
|
|
104
|
-
disabled: t,
|
|
105
|
-
className: e
|
|
106
|
-
}),
|
|
107
|
-
onMouseDown: t ? void 0 : (a) => {
|
|
108
|
-
h(a);
|
|
64
|
+
}, P = x(
|
|
65
|
+
({
|
|
66
|
+
className: e,
|
|
67
|
+
onClick: i,
|
|
68
|
+
appearance: r = "no-background",
|
|
69
|
+
disabled: t = !1,
|
|
70
|
+
"aria-label": f,
|
|
71
|
+
children: m,
|
|
72
|
+
onMouseDown: l,
|
|
73
|
+
onMouseUp: o,
|
|
74
|
+
onMouseLeave: c,
|
|
75
|
+
...n
|
|
76
|
+
}, N) => {
|
|
77
|
+
const [g, b] = w(!1), { slotElement: h, remainingChildren: A } = C(
|
|
78
|
+
m,
|
|
79
|
+
y
|
|
80
|
+
), S = d(
|
|
81
|
+
(a) => {
|
|
82
|
+
a.target.closest(
|
|
83
|
+
"[data-secondary-button-container]"
|
|
84
|
+
) || (l == null || l(a), b(!0));
|
|
109
85
|
},
|
|
110
|
-
|
|
111
|
-
|
|
86
|
+
[l]
|
|
87
|
+
), k = d(
|
|
88
|
+
(a) => {
|
|
89
|
+
b(!1), o == null || o(a);
|
|
112
90
|
},
|
|
113
|
-
|
|
114
|
-
|
|
91
|
+
[o]
|
|
92
|
+
), R = d(
|
|
93
|
+
(a) => {
|
|
94
|
+
b(!1), c == null || c(a);
|
|
115
95
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
96
|
+
[c]
|
|
97
|
+
);
|
|
98
|
+
return /* @__PURE__ */ s(j, { value: { disabled: t }, children: /* @__PURE__ */ q(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
...n,
|
|
102
|
+
ref: N,
|
|
103
|
+
className: T.root({
|
|
104
|
+
appearance: r,
|
|
105
|
+
isActive: g,
|
|
106
|
+
disabled: t,
|
|
107
|
+
className: e
|
|
108
|
+
}),
|
|
109
|
+
onMouseDown: t ? void 0 : (a) => {
|
|
110
|
+
S(a);
|
|
111
|
+
},
|
|
112
|
+
onMouseUp: t ? void 0 : (a) => {
|
|
113
|
+
k(a);
|
|
114
|
+
},
|
|
115
|
+
onMouseLeave: t ? void 0 : (a) => {
|
|
116
|
+
R(a);
|
|
117
|
+
},
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ s(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
"aria-label": f,
|
|
123
|
+
onClick: t ? void 0 : i,
|
|
124
|
+
disabled: t,
|
|
125
|
+
"data-disabled": t || void 0,
|
|
126
|
+
className: T.button(),
|
|
127
|
+
children: A
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
h
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
) });
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
P.displayName = "Tile";
|
|
137
|
+
const D = (e) => {
|
|
138
|
+
const { disabled: i } = p({
|
|
136
139
|
consumerName: "TileSpot",
|
|
137
140
|
contextRequired: !0
|
|
138
141
|
});
|
|
139
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ s(z, { ...e, size: 48, disabled: i });
|
|
140
143
|
};
|
|
141
|
-
|
|
142
|
-
const
|
|
144
|
+
D.displayName = "TileSpot";
|
|
145
|
+
const E = ({
|
|
143
146
|
children: e,
|
|
144
147
|
className: i,
|
|
145
148
|
...r
|
|
146
|
-
}) => /* @__PURE__ */
|
|
149
|
+
}) => /* @__PURE__ */ s(
|
|
147
150
|
"div",
|
|
148
151
|
{
|
|
149
|
-
className:
|
|
152
|
+
className: u("flex w-full flex-col items-center text-center", i),
|
|
150
153
|
...r,
|
|
151
154
|
children: e
|
|
152
155
|
}
|
|
153
156
|
);
|
|
154
|
-
|
|
155
|
-
const
|
|
157
|
+
E.displayName = "TileContent";
|
|
158
|
+
const O = ({
|
|
156
159
|
children: e,
|
|
157
160
|
className: i,
|
|
158
161
|
...r
|
|
159
162
|
}) => {
|
|
160
|
-
const { disabled: t } =
|
|
163
|
+
const { disabled: t } = p({
|
|
161
164
|
consumerName: "TileTitle",
|
|
162
165
|
contextRequired: !0
|
|
163
166
|
});
|
|
164
|
-
return /* @__PURE__ */
|
|
167
|
+
return /* @__PURE__ */ s(
|
|
165
168
|
"div",
|
|
166
169
|
{
|
|
167
|
-
className:
|
|
170
|
+
className: u(
|
|
168
171
|
"w-full truncate body-2-semi-bold",
|
|
169
172
|
t && "text-disabled",
|
|
170
173
|
i
|
|
@@ -174,20 +177,20 @@ const D = ({
|
|
|
174
177
|
}
|
|
175
178
|
);
|
|
176
179
|
};
|
|
177
|
-
|
|
178
|
-
const
|
|
180
|
+
O.displayName = "TileTitle";
|
|
181
|
+
const B = ({
|
|
179
182
|
children: e,
|
|
180
183
|
className: i,
|
|
181
184
|
...r
|
|
182
185
|
}) => {
|
|
183
|
-
const { disabled: t } =
|
|
186
|
+
const { disabled: t } = p({
|
|
184
187
|
consumerName: "TileDescription",
|
|
185
188
|
contextRequired: !0
|
|
186
189
|
});
|
|
187
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ s(
|
|
188
191
|
"div",
|
|
189
192
|
{
|
|
190
|
-
className:
|
|
193
|
+
className: u(
|
|
191
194
|
"w-full truncate body-3",
|
|
192
195
|
t ? "text-disabled" : "text-muted",
|
|
193
196
|
i
|
|
@@ -197,30 +200,24 @@ const E = ({
|
|
|
197
200
|
}
|
|
198
201
|
);
|
|
199
202
|
};
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
icon: i,
|
|
204
|
-
className: r,
|
|
205
|
-
"aria-label": t,
|
|
206
|
-
...p
|
|
207
|
-
}) => {
|
|
208
|
-
const { disabled: m } = u({
|
|
203
|
+
B.displayName = "TileDescription";
|
|
204
|
+
const y = x(({ onClick: e, icon: i, className: r, "aria-label": t, ...f }, m) => {
|
|
205
|
+
const { disabled: l } = p({
|
|
209
206
|
consumerName: "TileSecondaryAction",
|
|
210
207
|
contextRequired: !0
|
|
211
|
-
}), o =
|
|
212
|
-
(
|
|
213
|
-
|
|
208
|
+
}), o = d(
|
|
209
|
+
(n) => {
|
|
210
|
+
n.stopPropagation(), n.preventDefault(), e == null || e(n);
|
|
214
211
|
},
|
|
215
212
|
[e]
|
|
216
213
|
);
|
|
217
|
-
if (
|
|
214
|
+
if (l) return null;
|
|
218
215
|
const c = i;
|
|
219
|
-
return /* @__PURE__ */
|
|
220
|
-
|
|
216
|
+
return /* @__PURE__ */ s(
|
|
217
|
+
V,
|
|
221
218
|
{
|
|
222
219
|
"data-slot": "tile-secondary-action",
|
|
223
|
-
className:
|
|
220
|
+
className: u(
|
|
224
221
|
"absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
|
|
225
222
|
r
|
|
226
223
|
),
|
|
@@ -228,17 +225,18 @@ const T = ({
|
|
|
228
225
|
iconType: "stroked",
|
|
229
226
|
onClick: o,
|
|
230
227
|
"aria-label": t,
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
ref: m,
|
|
229
|
+
...f,
|
|
230
|
+
children: /* @__PURE__ */ s(c, { size: 24 })
|
|
233
231
|
}
|
|
234
232
|
);
|
|
235
|
-
};
|
|
236
|
-
|
|
233
|
+
});
|
|
234
|
+
y.displayName = "TileSecondaryAction";
|
|
237
235
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
236
|
+
P as Tile,
|
|
237
|
+
E as TileContent,
|
|
238
|
+
B as TileDescription,
|
|
239
|
+
y as TileSecondaryAction,
|
|
240
|
+
D as TileSpot,
|
|
241
|
+
O as TileTitle
|
|
244
242
|
};
|
package/dist/package.json
CHANGED