@lightsparkdev/ui 0.0.7 → 0.0.9
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/CHANGELOG.md +24 -0
- package/dist/chunk-3EVAP5JT.js +67 -0
- package/dist/{chunk-IQFU7CM5.js → chunk-3GS5EFXV.js} +1 -1
- package/dist/{chunk-CLU2FRJZ.js → chunk-55OQPFLF.js} +1 -1
- package/dist/{chunk-N2RDQJQ5.js → chunk-5POPBNPS.js} +1 -1
- package/dist/{chunk-WWFDI534.js → chunk-7C4MHI6Q.js} +13 -6
- package/dist/{chunk-3CZOYF3X.js → chunk-7T36JGTC.js} +2 -2
- package/dist/chunk-A4FQBEYU.js +163 -0
- package/dist/chunk-ATUH6SXK.js +233 -0
- package/dist/chunk-DQRN4E5G.js +25 -0
- package/dist/{chunk-RTUZVKPK.js → chunk-E3AOYBY5.js} +1 -1
- package/dist/{chunk-I74XQIVV.js → chunk-EEFNW7NS.js} +3 -3
- package/dist/{chunk-UO6U7AYM.js → chunk-FCZJILMW.js} +1 -1
- package/dist/{chunk-2WYVO6B2.js → chunk-H3RW6JSU.js} +1 -1
- package/dist/chunk-IPAXAP6K.js +119 -0
- package/dist/{chunk-NGS4OSWT.js → chunk-J4FJQ3FN.js} +1 -1
- package/dist/{chunk-RFGKH3R6.js → chunk-JK4BP73A.js} +39 -38
- package/dist/{chunk-T33SBHYI.js → chunk-KMR5C25B.js} +3 -1
- package/dist/{chunk-JYWYEOM6.js → chunk-NFSAJ5GJ.js} +23 -10
- package/dist/{chunk-G2PZZFJL.js → chunk-NM7UW54G.js} +21 -24
- package/dist/{chunk-M56R3RJ7.js → chunk-OGSDZTHM.js} +7 -3
- package/dist/chunk-P3EUPXFA.js +150 -0
- package/dist/chunk-PBRN7MJY.js +315 -0
- package/dist/{chunk-NH25O7PC.js → chunk-PVQCLQNA.js} +1 -1
- package/dist/{chunk-NZJCJJH5.js → chunk-RWIZ7Q74.js} +1 -1
- package/dist/{chunk-TAI352I3.js → chunk-VE7J2N47.js} +1 -1
- package/dist/{chunk-K7D7A34K.js → chunk-XP2MX2AA.js} +1 -1
- package/dist/{chunk-23SR7TFO.js → chunk-XZR237JJ.js} +1 -1
- package/dist/{chunk-VBWTKANQ.js → chunk-Y37DCY7Y.js} +3 -3
- package/dist/{chunk-SVQELXFK.js → chunk-Z5TPS2BO.js} +1 -1
- package/dist/{chunk-FKETYVPP.js → chunk-ZANLDY2W.js} +87 -43
- package/dist/components/Badge.cjs +1346 -0
- package/dist/components/Badge.d.cts +10 -0
- package/dist/components/Badge.d.ts +10 -0
- package/dist/components/Badge.js +13 -0
- package/dist/components/Button.cjs +235 -107
- package/dist/components/Button.d.cts +3 -1
- package/dist/components/Button.d.ts +3 -1
- package/dist/components/Button.js +8 -7
- package/dist/components/ButtonRow.cjs +254 -110
- package/dist/components/ButtonRow.d.cts +6 -2
- package/dist/components/ButtonRow.d.ts +6 -2
- package/dist/components/ButtonRow.js +14 -11
- package/dist/components/CardPage.cjs +1921 -0
- package/dist/components/CardPage.d.cts +54 -0
- package/dist/components/CardPage.d.ts +54 -0
- package/dist/components/CardPage.js +33 -0
- package/dist/components/Collapsible.cjs +38 -54
- package/dist/components/Collapsible.js +4 -5
- package/dist/components/ContentTable.cjs +38 -54
- package/dist/components/ContentTable.js +3 -4
- package/dist/components/CopyToClipboardButton.cjs +161 -65
- package/dist/components/CopyToClipboardButton.js +6 -5
- package/dist/components/CurrencyAmount.cjs +38 -54
- package/dist/components/CurrencyAmount.js +3 -4
- package/dist/components/FileInput.cjs +1959 -0
- package/dist/components/FileInput.d.cts +21 -0
- package/dist/components/FileInput.d.ts +21 -0
- package/dist/components/FileInput.js +113 -0
- package/dist/components/GradientCardHeader.cjs +177 -0
- package/dist/components/GradientCardHeader.d.cts +10 -0
- package/dist/components/GradientCardHeader.d.ts +10 -0
- package/dist/components/GradientCardHeader.js +8 -0
- package/dist/components/Icon.cjs +38 -54
- package/dist/components/Icon.js +2 -3
- package/dist/components/LightTooltip.cjs +1428 -0
- package/dist/components/LightTooltip.d.cts +9 -0
- package/dist/components/LightTooltip.d.ts +9 -0
- package/dist/components/LightTooltip.js +12 -0
- package/dist/components/LightboxImage.cjs +1 -1
- package/dist/components/LightboxImage.js +2 -2
- package/dist/components/LightsparkProvider.cjs +41 -57
- package/dist/components/LightsparkProvider.js +3 -4
- package/dist/components/Loading.cjs +38 -54
- package/dist/components/Loading.js +3 -4
- package/dist/components/Modal.cjs +251 -145
- package/dist/components/Modal.js +12 -11
- package/dist/components/Pill.cjs +1717 -0
- package/dist/components/Pill.d.cts +19 -0
- package/dist/components/Pill.d.ts +19 -0
- package/dist/components/Pill.js +16 -0
- package/dist/components/ProgressBar.cjs +38 -56
- package/dist/components/ProgressBar.js +2 -3
- package/dist/components/SecretContainer.cjs +162 -66
- package/dist/components/SecretContainer.js +7 -6
- package/dist/components/TextIconAligner.cjs +38 -54
- package/dist/components/TextIconAligner.js +3 -4
- package/dist/components/UnstyledButton.cjs +38 -54
- package/dist/components/UnstyledButton.js +2 -3
- package/dist/components/documentation/AnchorLinkHeader.cjs +38 -56
- package/dist/components/documentation/AnchorLinkHeader.js +3 -4
- package/dist/components/documentation/index.cjs +38 -56
- package/dist/components/documentation/index.js +3 -4
- package/dist/components/index.cjs +1191 -358
- package/dist/components/index.d.cts +7 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.js +63 -32
- package/dist/icons/ArrowCornerDownRight.cjs +49 -0
- package/dist/icons/ArrowCornerDownRight.d.cts +5 -0
- package/dist/icons/ArrowCornerDownRight.d.ts +5 -0
- package/dist/icons/ArrowCornerDownRight.js +30 -0
- package/dist/icons/Copy.cjs +4 -3
- package/dist/icons/Copy.js +4 -3
- package/dist/icons/Download.cjs +22 -11
- package/dist/icons/Download.js +23 -12
- package/dist/icons/Sort.cjs +48 -0
- package/dist/icons/Sort.d.cts +5 -0
- package/dist/icons/Sort.d.ts +5 -0
- package/dist/icons/Sort.js +29 -0
- package/dist/icons/Upload.cjs +22 -11
- package/dist/icons/Upload.js +23 -12
- package/dist/icons/index.cjs +38 -54
- package/dist/icons/index.js +2 -3
- package/dist/router.cjs +7 -3
- package/dist/router.js +1 -1
- package/dist/styles/common.cjs +38 -66
- package/dist/styles/common.d.cts +10 -11
- package/dist/styles/common.d.ts +10 -11
- package/dist/styles/common.js +1 -14
- package/dist/styles/fields.cjs +117 -61
- package/dist/styles/fields.d.cts +12 -5
- package/dist/styles/fields.d.ts +12 -5
- package/dist/styles/fields.js +28 -164
- package/dist/styles/fonts/typography/Article.cjs +38 -54
- package/dist/styles/fonts/typography/Article.js +5 -6
- package/dist/styles/fonts/typography/index.cjs +38 -54
- package/dist/styles/fonts/typography/index.js +5 -6
- package/dist/styles/global.cjs +41 -57
- package/dist/styles/global.js +2 -3
- package/dist/styles/type.cjs +38 -54
- package/dist/styles/type.js +8 -145
- package/dist/styles/utils.cjs +38 -54
- package/dist/styles/utils.js +2 -3
- package/dist/styles/z-index.cjs +1 -1
- package/dist/styles/z-index.d.cts +1 -1
- package/dist/styles/z-index.d.ts +1 -1
- package/dist/styles/z-index.js +1 -1
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/toReactNodes.cjs +7 -3
- package/dist/utils/toReactNodes.js +2 -2
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @lightsparkdev/ui
|
|
2
2
|
|
|
3
|
+
## 0.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 79f9f9f: - Fix ButtonRow inset
|
|
8
|
+
- Add CardPage
|
|
9
|
+
- Add GradientCardHeader
|
|
10
|
+
- Default cancelText value for Modal and simplify inset refs
|
|
11
|
+
- 062bf8a: - Add active prop to textInputStyle for indicating active style in response to external factors
|
|
12
|
+
- 062bf8a: [js] Add engines field to all packages to indicate supported NodeJS versions
|
|
13
|
+
- Updated dependencies [062bf8a]
|
|
14
|
+
- @lightsparkdev/core@1.0.18
|
|
15
|
+
|
|
16
|
+
## 0.0.8
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- df7bd3f: - Updates to LightTooltip
|
|
21
|
+
- 20fb70b: - Add Badge, FileInput, LightTooltip, Pill
|
|
22
|
+
- Single character Button should be round
|
|
23
|
+
- Allow "divider" in ButtonRow
|
|
24
|
+
- Updated dependencies [20fb70b]
|
|
25
|
+
- @lightsparkdev/core@1.0.17
|
|
26
|
+
|
|
3
27
|
## 0.0.7
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
z
|
|
3
|
+
} from "./chunk-55OQPFLF.js";
|
|
4
|
+
import {
|
|
5
|
+
overlaySurface
|
|
6
|
+
} from "./chunk-JK4BP73A.js";
|
|
7
|
+
import {
|
|
8
|
+
__spreadProps,
|
|
9
|
+
__spreadValues
|
|
10
|
+
} from "./chunk-CIGAQ47A.js";
|
|
11
|
+
|
|
12
|
+
// src/components/LightTooltip.tsx
|
|
13
|
+
import { css } from "@emotion/css";
|
|
14
|
+
import { useTheme } from "@emotion/react";
|
|
15
|
+
import React, { useEffect, useRef } from "react";
|
|
16
|
+
import ReactDOM from "react-dom";
|
|
17
|
+
import { Tooltip } from "react-tooltip";
|
|
18
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
19
|
+
function LightTooltip(props) {
|
|
20
|
+
const nodeRef = useRef(null);
|
|
21
|
+
const [nodeReady, setNodeReady] = React.useState(false);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!nodeRef.current) {
|
|
24
|
+
nodeRef.current = document.createElement("div");
|
|
25
|
+
document.body.appendChild(nodeRef.current);
|
|
26
|
+
}
|
|
27
|
+
setNodeReady(true);
|
|
28
|
+
return () => {
|
|
29
|
+
if (nodeRef.current) {
|
|
30
|
+
document.body.removeChild(nodeRef.current);
|
|
31
|
+
nodeRef.current = null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
console.log("LightTooltip.tsx: tooltipProps:", props);
|
|
37
|
+
return nodeReady && nodeRef.current ? ReactDOM.createPortal(
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
Tooltip,
|
|
40
|
+
__spreadProps(__spreadValues({}, props), {
|
|
41
|
+
id: props.id || "",
|
|
42
|
+
content: props.content || "",
|
|
43
|
+
noArrow: true,
|
|
44
|
+
border: "0.05rem solid rgba(0, 0, 0, 0.1)",
|
|
45
|
+
className: styles({ theme }),
|
|
46
|
+
variant: "light",
|
|
47
|
+
delayShow: 180
|
|
48
|
+
})
|
|
49
|
+
),
|
|
50
|
+
nodeRef.current
|
|
51
|
+
) : null;
|
|
52
|
+
}
|
|
53
|
+
var styles = ({ theme }) => css`
|
|
54
|
+
font-size: "10px",
|
|
55
|
+
color: ${theme.c2Neutral};
|
|
56
|
+
border-radius: 8px !important;
|
|
57
|
+
padding: 16px !important;
|
|
58
|
+
z-index: ${z.tooltip};
|
|
59
|
+
${overlaySurface({ theme, important: true })};
|
|
60
|
+
|
|
61
|
+
max-width: 260px;
|
|
62
|
+
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10), 0px 4px 8px 0px rgba(0, 0, 0, 0.08) !important;
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
LightTooltip
|
|
67
|
+
};
|
|
@@ -14,13 +14,13 @@ var z = {
|
|
|
14
14
|
navAction: 101,
|
|
15
15
|
smNavAction: 100,
|
|
16
16
|
// keep under navDropdown
|
|
17
|
-
tooltip: 160,
|
|
18
17
|
notificationBanner: 170,
|
|
19
18
|
qrReaderVideo: 180,
|
|
20
19
|
qrReaderOverlay: 181,
|
|
21
20
|
modalOverlay: 190,
|
|
22
21
|
modalContainer: 191,
|
|
23
22
|
dropdown: 192,
|
|
23
|
+
tooltip: 193,
|
|
24
24
|
toast: 200
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnstyledButton
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3GS5EFXV.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
LightTooltip
|
|
6
|
+
} from "./chunk-3EVAP5JT.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
Icon
|
|
9
|
+
} from "./chunk-RWIZ7Q74.js";
|
|
10
10
|
import {
|
|
11
11
|
__async
|
|
12
12
|
} from "./chunk-CIGAQ47A.js";
|
|
@@ -49,7 +49,14 @@ var CopyToClipboardButton = (props) => {
|
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
LightTooltip,
|
|
54
|
+
{
|
|
55
|
+
id,
|
|
56
|
+
place: props.place || "right",
|
|
57
|
+
content: tooltipContent
|
|
58
|
+
}
|
|
59
|
+
)
|
|
53
60
|
] });
|
|
54
61
|
};
|
|
55
62
|
var Children = styled.span`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopyToClipboardButton
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7C4MHI6Q.js";
|
|
4
4
|
import {
|
|
5
5
|
standardBorderRadius
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JK4BP73A.js";
|
|
7
7
|
|
|
8
8
|
// src/components/SecretContainer.tsx
|
|
9
9
|
import styled from "@emotion/styled";
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Loading
|
|
3
|
+
} from "./chunk-J4FJQ3FN.js";
|
|
4
|
+
import {
|
|
5
|
+
UnstyledButton
|
|
6
|
+
} from "./chunk-3GS5EFXV.js";
|
|
7
|
+
import {
|
|
8
|
+
flexCenter
|
|
9
|
+
} from "./chunk-FCZJILMW.js";
|
|
10
|
+
import {
|
|
11
|
+
Icon
|
|
12
|
+
} from "./chunk-RWIZ7Q74.js";
|
|
13
|
+
import {
|
|
14
|
+
colors
|
|
15
|
+
} from "./chunk-2VBDEO6M.js";
|
|
16
|
+
|
|
17
|
+
// src/components/Pill.tsx
|
|
18
|
+
import styled from "@emotion/styled";
|
|
19
|
+
import { useEffect, useRef } from "react";
|
|
20
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
21
|
+
function Pill({
|
|
22
|
+
text,
|
|
23
|
+
onDeleteMouseDown,
|
|
24
|
+
onDeleteMouseUp,
|
|
25
|
+
onDeleteFromKeyboard,
|
|
26
|
+
icon,
|
|
27
|
+
loading = false,
|
|
28
|
+
cursor = "text",
|
|
29
|
+
isEditing = false,
|
|
30
|
+
onChangeTextInput = () => {
|
|
31
|
+
},
|
|
32
|
+
onFocusTextInput = () => {
|
|
33
|
+
},
|
|
34
|
+
onClickPillBody = () => {
|
|
35
|
+
},
|
|
36
|
+
onBlurTextInput = () => {
|
|
37
|
+
}
|
|
38
|
+
}) {
|
|
39
|
+
const textInputRef = useRef(null);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (isEditing && textInputRef.current) {
|
|
42
|
+
textInputRef.current.focus();
|
|
43
|
+
}
|
|
44
|
+
}, [isEditing]);
|
|
45
|
+
function handleOnDeleteMouseDown(event) {
|
|
46
|
+
if (onDeleteMouseDown) {
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
onDeleteMouseDown(event);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function handleOnDeleteKeyDown(event) {
|
|
52
|
+
if (onDeleteFromKeyboard) {
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
if (event.key === "Enter") {
|
|
55
|
+
onDeleteFromKeyboard();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsxs(
|
|
60
|
+
StyledPill,
|
|
61
|
+
{
|
|
62
|
+
hasIcon: Boolean(icon || loading || onDeleteMouseDown),
|
|
63
|
+
cursor,
|
|
64
|
+
onClick: (event) => {
|
|
65
|
+
if (onClickPillBody) {
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
onClickPillBody();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
isEditing ? /* @__PURE__ */ jsx(
|
|
72
|
+
PillInput,
|
|
73
|
+
{
|
|
74
|
+
value: text,
|
|
75
|
+
onChange: (event) => onChangeTextInput(event.target.value),
|
|
76
|
+
onFocus: onFocusTextInput,
|
|
77
|
+
onBlur: onBlurTextInput,
|
|
78
|
+
ref: textInputRef
|
|
79
|
+
}
|
|
80
|
+
) : /* @__PURE__ */ jsx(PillText, { children: text }),
|
|
81
|
+
(icon || loading || onDeleteMouseDown) && /* @__PURE__ */ jsxs(
|
|
82
|
+
PillIconContainer,
|
|
83
|
+
{
|
|
84
|
+
hasIconInset: Boolean(icon && !loading && !onDeleteMouseDown),
|
|
85
|
+
children: [
|
|
86
|
+
loading && /* @__PURE__ */ jsx(Loading, { size: 16.1, center: false, ml: 5 }),
|
|
87
|
+
!loading && onDeleteMouseDown && /* @__PURE__ */ jsx(
|
|
88
|
+
UnstyledButton,
|
|
89
|
+
{
|
|
90
|
+
onMouseDown: handleOnDeleteMouseDown,
|
|
91
|
+
onKeyDown: handleOnDeleteKeyDown,
|
|
92
|
+
type: "button",
|
|
93
|
+
css: {
|
|
94
|
+
display: "flex",
|
|
95
|
+
padding: "10px",
|
|
96
|
+
marginRight: "-10px"
|
|
97
|
+
},
|
|
98
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "DeleteIcon", width: 16.1 })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
!loading && icon && !onDeleteMouseDown && /* @__PURE__ */ jsx(Icon, { name: icon, width: 16.1, color: colors.white })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
var PillText = styled.div`
|
|
110
|
+
/* For mobile ensure empty values don't prevent div from having height: */
|
|
111
|
+
height: 1.2rem;
|
|
112
|
+
min-width: 100px;
|
|
113
|
+
max-width: 210px;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
text-overflow: ellipsis;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
font-weight: 600;
|
|
118
|
+
`;
|
|
119
|
+
var StyledPill = styled.div`
|
|
120
|
+
* + & {
|
|
121
|
+
margin-top: 16px;
|
|
122
|
+
}
|
|
123
|
+
background-color: ${({ theme }) => theme.c05Neutral};
|
|
124
|
+
color: ${({ theme }) => theme.text};
|
|
125
|
+
padding: 12px 18px;
|
|
126
|
+
${({ hasIcon }) => hasIcon && `padding-right: 48px;`}
|
|
127
|
+
border-radius: 2em;
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
cursor: ${({ cursor }) => cursor};
|
|
131
|
+
position: relative;
|
|
132
|
+
`;
|
|
133
|
+
var PillIconContainer = styled.div`
|
|
134
|
+
${flexCenter}
|
|
135
|
+
${({ hasIconInset }) => hasIconInset ? `
|
|
136
|
+
background-color: ${colors.blue43};
|
|
137
|
+
padding: 8px;
|
|
138
|
+
right: 4px;
|
|
139
|
+
top: 3.5px;` : `right: 18px;`}
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
margin-left: 12px;
|
|
142
|
+
position: absolute;
|
|
143
|
+
`;
|
|
144
|
+
var PillInput = styled.input`
|
|
145
|
+
background-color: transparent;
|
|
146
|
+
border: none;
|
|
147
|
+
outline: none;
|
|
148
|
+
color: ${({ theme }) => theme.text};
|
|
149
|
+
font-weight: 600;
|
|
150
|
+
font-size: 1rem;
|
|
151
|
+
padding: 0;
|
|
152
|
+
margin: 0;
|
|
153
|
+
width: 100%;
|
|
154
|
+
max-width: 210px;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
font-family: ${({ theme }) => theme.typography.fontFamilies.main};
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
export {
|
|
162
|
+
Pill
|
|
163
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import {
|
|
2
|
+
z
|
|
3
|
+
} from "./chunk-55OQPFLF.js";
|
|
4
|
+
import {
|
|
5
|
+
standardBorderRadius,
|
|
6
|
+
subtext
|
|
7
|
+
} from "./chunk-JK4BP73A.js";
|
|
8
|
+
import {
|
|
9
|
+
colors,
|
|
10
|
+
themeOr
|
|
11
|
+
} from "./chunk-2VBDEO6M.js";
|
|
12
|
+
|
|
13
|
+
// src/styles/fields.tsx
|
|
14
|
+
import { css } from "@emotion/react";
|
|
15
|
+
import styled from "@emotion/styled";
|
|
16
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
17
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
18
|
+
var maxFieldWidth = "100%";
|
|
19
|
+
var fieldWidth = "100%";
|
|
20
|
+
var inputSpacingPx = 24;
|
|
21
|
+
var formButtonTopMargin = "32px";
|
|
22
|
+
var formButtonTopMarginStyle = css`
|
|
23
|
+
margin-top: ${formButtonTopMargin};
|
|
24
|
+
`;
|
|
25
|
+
var standardBorderColor = ({ theme }) => css`
|
|
26
|
+
border-color: ${themeOr(theme.c1Neutral, theme.mcNeutral)({ theme })};
|
|
27
|
+
`;
|
|
28
|
+
var inputBlockStyle = ({
|
|
29
|
+
theme,
|
|
30
|
+
hasValue,
|
|
31
|
+
hasError
|
|
32
|
+
}) => css`
|
|
33
|
+
${subtext({ theme })}
|
|
34
|
+
${standardBorderColor({ theme })}
|
|
35
|
+
${standardBorderRadius(8)}
|
|
36
|
+
background-color: ${theme.bg};
|
|
37
|
+
border-width: 2px;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
position: relative;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
padding: 52.5px;
|
|
45
|
+
${hasError ? `border-style: solid; border-color: ${colors.danger}; border-width: 2px;` : hasValue ? `border-style: solid; border-color: ${theme.info};` : `border-style: dashed;`}
|
|
46
|
+
`;
|
|
47
|
+
var textInputPlaceholderColor = ({ theme }) => theme.c4Neutral;
|
|
48
|
+
var textInputColor = ({ theme }) => theme.text;
|
|
49
|
+
var textInputFontWeight = 600;
|
|
50
|
+
var textInputBorderRadiusPx = 8;
|
|
51
|
+
var textInputPaddingPx = 12;
|
|
52
|
+
var textInputPadding = `${textInputPaddingPx}px`;
|
|
53
|
+
var textInputBorderColor = ({ theme }) => themeOr(theme.c1Neutral, theme.c3Neutral)({ theme });
|
|
54
|
+
var textInputBorderColorFocused = ({ theme }) => themeOr(theme.hcNeutral, theme.hcNeutral)({ theme });
|
|
55
|
+
var textInputActiveStyles = ({
|
|
56
|
+
theme,
|
|
57
|
+
paddingLeftPx,
|
|
58
|
+
paddingRightPx
|
|
59
|
+
}) => css`
|
|
60
|
+
border-color: ${textInputBorderColorFocused({ theme })};
|
|
61
|
+
border-width: 2px;
|
|
62
|
+
color: ${textInputColor({ theme })};
|
|
63
|
+
padding: ${textInputPaddingPx - 1}px;
|
|
64
|
+
${paddingLeftPx ? `padding-left: ${paddingLeftPx - 1}px;` : ""}
|
|
65
|
+
${paddingRightPx ? `padding-right: ${paddingRightPx - 1}px;` : ""}
|
|
66
|
+
`;
|
|
67
|
+
var textInputStyle = ({
|
|
68
|
+
theme,
|
|
69
|
+
active,
|
|
70
|
+
disabled,
|
|
71
|
+
hasError,
|
|
72
|
+
paddingLeftPx,
|
|
73
|
+
paddingRightPx
|
|
74
|
+
}) => {
|
|
75
|
+
var _a;
|
|
76
|
+
return css`
|
|
77
|
+
border-radius: ${textInputBorderRadiusPx}px;
|
|
78
|
+
background-color: ${disabled ? theme.vlcNeutral : theme.bg};
|
|
79
|
+
cursor: ${disabled ? "not-allowed" : "auto"};
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
font-weight: ${textInputFontWeight};
|
|
82
|
+
|
|
83
|
+
position: relative;
|
|
84
|
+
z-index: ${z.textInput};
|
|
85
|
+
font-family: ${(_a = theme.typography) == null ? void 0 : _a.fontFamilies.main};
|
|
86
|
+
padding: ${textInputPaddingPx - (hasError ? 1 : 0)}px;
|
|
87
|
+
${paddingLeftPx ? `padding-left: ${paddingLeftPx - (hasError ? 1 : 0)}px;` : ""}
|
|
88
|
+
${paddingRightPx ? `padding-right: ${paddingRightPx - (hasError ? 1 : 0)}px;` : ""}
|
|
89
|
+
border-style: solid;
|
|
90
|
+
border-width: ${hasError ? "2" : "1"}px;
|
|
91
|
+
border-color: ${hasError ? theme.danger : textInputBorderColor({ theme })};
|
|
92
|
+
line-height: 22px;
|
|
93
|
+
outline: none;
|
|
94
|
+
/* Use low contrast by default. Some fields, eg login, need high contrast simply
|
|
95
|
+
because of quirks with default autofill styles. Clicking in to an autofilled value
|
|
96
|
+
does not change the color of the text, it just uses the default field color */
|
|
97
|
+
color: ${textInputColor({ theme })};
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
width: ${fieldWidth};
|
|
100
|
+
max-width: ${maxFieldWidth};
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
&:focus,
|
|
103
|
+
&:active,
|
|
104
|
+
&:has(:focus) {
|
|
105
|
+
${textInputActiveStyles({ theme, paddingLeftPx, paddingRightPx })}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
${active && textInputActiveStyles({ theme, paddingLeftPx, paddingRightPx })}
|
|
109
|
+
|
|
110
|
+
&::placeholder {
|
|
111
|
+
color: ${textInputPlaceholderColor({ theme })};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:focus::placeholder {
|
|
115
|
+
color: ${textInputPlaceholderColor({ theme })};
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
};
|
|
119
|
+
var FieldError = styled.div`
|
|
120
|
+
background-color: rgba(242, 239, 255, 1);
|
|
121
|
+
padding: 16px 16px 8px;
|
|
122
|
+
margin-top: -8px;
|
|
123
|
+
border-radius: 0 0 8px 8px;
|
|
124
|
+
position: relative;
|
|
125
|
+
z-index: ${z.fieldError};
|
|
126
|
+
`;
|
|
127
|
+
var aboveFieldError = ({
|
|
128
|
+
theme,
|
|
129
|
+
hasError
|
|
130
|
+
}) => css`
|
|
131
|
+
${hasError ? "border: none !important" : ""};
|
|
132
|
+
background-color: ${theme.bg};
|
|
133
|
+
position: relative;
|
|
134
|
+
z-index: ${z.fieldError + 1};
|
|
135
|
+
${hasError && "box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 1px 4px rgba(0, 0, 0, 0.1);"}
|
|
136
|
+
`;
|
|
137
|
+
var inputSubtextSeconds = 0.25;
|
|
138
|
+
function InputSubtext({
|
|
139
|
+
text,
|
|
140
|
+
hasError = false,
|
|
141
|
+
tooltipId
|
|
142
|
+
}) {
|
|
143
|
+
const timeoutRef = useRef(null);
|
|
144
|
+
const [subtext2, setSubtext] = useState(text);
|
|
145
|
+
const [visible, setVisible] = useState(Boolean(text));
|
|
146
|
+
useLayoutEffect(() => {
|
|
147
|
+
if (text) {
|
|
148
|
+
setSubtext(text);
|
|
149
|
+
setVisible(true);
|
|
150
|
+
if (timeoutRef.current) {
|
|
151
|
+
clearTimeout(timeoutRef.current);
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
setVisible(false);
|
|
155
|
+
timeoutRef.current = setTimeout(() => {
|
|
156
|
+
setSubtext(void 0);
|
|
157
|
+
}, inputSubtextSeconds * 1e3);
|
|
158
|
+
}
|
|
159
|
+
}, [text]);
|
|
160
|
+
return /* @__PURE__ */ jsx(
|
|
161
|
+
StyledInputSubtext,
|
|
162
|
+
{
|
|
163
|
+
visible,
|
|
164
|
+
hasError,
|
|
165
|
+
cursorPointer: Boolean(tooltipId),
|
|
166
|
+
children: tooltipId ? /* @__PURE__ */ jsx("span", { "data-tooltip-id": tooltipId, children: subtext2 }) : subtext2
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
var StyledInputSubtext = styled.div`
|
|
171
|
+
margin-top: ${({ visible }) => visible ? "8px" : "0px"};
|
|
172
|
+
margin-left: ${({ visible }) => visible ? "8px" : "0px"};
|
|
173
|
+
font-size: 12px;
|
|
174
|
+
font-size: ${({ visible }) => visible ? "12px" : "0px"};
|
|
175
|
+
opacity: ${({ visible }) => visible ? "1" : "0"};
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
transition:
|
|
178
|
+
font-size ${inputSubtextSeconds}s cubic-bezier(0.25, 0.87, 0.56, 1.23),
|
|
179
|
+
opacity ${inputSubtextSeconds * 0.8}s cubic-bezier(0.25, 0.87, 0.56, 1.23),
|
|
180
|
+
margin ${inputSubtextSeconds}s cubic-bezier(0.25, 0.87, 0.56, 1.23);
|
|
181
|
+
color: ${({ hasError, theme }) => hasError ? theme.danger : theme.text};
|
|
182
|
+
cursor: ${({ cursorPointer }) => cursorPointer ? "pointer" : "auto"};
|
|
183
|
+
`;
|
|
184
|
+
var labelStyle = ({
|
|
185
|
+
theme,
|
|
186
|
+
hasError
|
|
187
|
+
}) => css`
|
|
188
|
+
color: ${hasError ? theme.danger : theme.text};
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
display: flex;
|
|
191
|
+
justify-content: space-between;
|
|
192
|
+
align-items: center;
|
|
193
|
+
& + * {
|
|
194
|
+
margin-top: 12px;
|
|
195
|
+
}
|
|
196
|
+
* ~ & {
|
|
197
|
+
margin-top: 40px;
|
|
198
|
+
}
|
|
199
|
+
`;
|
|
200
|
+
var Label = styled.label`
|
|
201
|
+
${subtext}
|
|
202
|
+
${labelStyle}
|
|
203
|
+
`;
|
|
204
|
+
var LabelDiv = styled.div`
|
|
205
|
+
${subtext}
|
|
206
|
+
${labelStyle}
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
export {
|
|
210
|
+
maxFieldWidth,
|
|
211
|
+
fieldWidth,
|
|
212
|
+
inputSpacingPx,
|
|
213
|
+
formButtonTopMargin,
|
|
214
|
+
formButtonTopMarginStyle,
|
|
215
|
+
standardBorderColor,
|
|
216
|
+
inputBlockStyle,
|
|
217
|
+
textInputPlaceholderColor,
|
|
218
|
+
textInputColor,
|
|
219
|
+
textInputFontWeight,
|
|
220
|
+
textInputBorderRadiusPx,
|
|
221
|
+
textInputPaddingPx,
|
|
222
|
+
textInputPadding,
|
|
223
|
+
textInputBorderColor,
|
|
224
|
+
textInputBorderColorFocused,
|
|
225
|
+
textInputStyle,
|
|
226
|
+
FieldError,
|
|
227
|
+
aboveFieldError,
|
|
228
|
+
InputSubtext,
|
|
229
|
+
StyledInputSubtext,
|
|
230
|
+
labelStyle,
|
|
231
|
+
Label,
|
|
232
|
+
LabelDiv
|
|
233
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
standardBorderRadius
|
|
3
|
+
} from "./chunk-JK4BP73A.js";
|
|
4
|
+
import {
|
|
5
|
+
isLight
|
|
6
|
+
} from "./chunk-2VBDEO6M.js";
|
|
7
|
+
|
|
8
|
+
// src/components/Badge.tsx
|
|
9
|
+
import styled from "@emotion/styled";
|
|
10
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
11
|
+
function Badge({ text, ml = 0 }) {
|
|
12
|
+
return text ? /* @__PURE__ */ jsx(StyledBadge, { ml, children: text }) : null;
|
|
13
|
+
}
|
|
14
|
+
var badgeVPadding = 2;
|
|
15
|
+
var StyledBadge = styled.span`
|
|
16
|
+
${standardBorderRadius(4)}
|
|
17
|
+
${({ ml }) => ml === 0 ? "" : `margin-left: ${ml}px;`}
|
|
18
|
+
padding: ${badgeVPadding}px 6px;
|
|
19
|
+
background-color: ${({ theme }) => isLight(theme) ? theme.c05Neutral : theme.c15Neutral};
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
Badge,
|
|
24
|
+
badgeVPadding
|
|
25
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
overflowAutoWithoutScrollbars
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FCZJILMW.js";
|
|
4
4
|
import {
|
|
5
5
|
Icon
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RWIZ7Q74.js";
|
|
7
7
|
import {
|
|
8
8
|
standardBorderRadius
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JK4BP73A.js";
|
|
10
10
|
|
|
11
11
|
// src/components/Collapsible.tsx
|
|
12
12
|
import styled from "@emotion/styled";
|