@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.
Files changed (142) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/chunk-3EVAP5JT.js +67 -0
  3. package/dist/{chunk-IQFU7CM5.js → chunk-3GS5EFXV.js} +1 -1
  4. package/dist/{chunk-CLU2FRJZ.js → chunk-55OQPFLF.js} +1 -1
  5. package/dist/{chunk-N2RDQJQ5.js → chunk-5POPBNPS.js} +1 -1
  6. package/dist/{chunk-WWFDI534.js → chunk-7C4MHI6Q.js} +13 -6
  7. package/dist/{chunk-3CZOYF3X.js → chunk-7T36JGTC.js} +2 -2
  8. package/dist/chunk-A4FQBEYU.js +163 -0
  9. package/dist/chunk-ATUH6SXK.js +233 -0
  10. package/dist/chunk-DQRN4E5G.js +25 -0
  11. package/dist/{chunk-RTUZVKPK.js → chunk-E3AOYBY5.js} +1 -1
  12. package/dist/{chunk-I74XQIVV.js → chunk-EEFNW7NS.js} +3 -3
  13. package/dist/{chunk-UO6U7AYM.js → chunk-FCZJILMW.js} +1 -1
  14. package/dist/{chunk-2WYVO6B2.js → chunk-H3RW6JSU.js} +1 -1
  15. package/dist/chunk-IPAXAP6K.js +119 -0
  16. package/dist/{chunk-NGS4OSWT.js → chunk-J4FJQ3FN.js} +1 -1
  17. package/dist/{chunk-RFGKH3R6.js → chunk-JK4BP73A.js} +39 -38
  18. package/dist/{chunk-T33SBHYI.js → chunk-KMR5C25B.js} +3 -1
  19. package/dist/{chunk-JYWYEOM6.js → chunk-NFSAJ5GJ.js} +23 -10
  20. package/dist/{chunk-G2PZZFJL.js → chunk-NM7UW54G.js} +21 -24
  21. package/dist/{chunk-M56R3RJ7.js → chunk-OGSDZTHM.js} +7 -3
  22. package/dist/chunk-P3EUPXFA.js +150 -0
  23. package/dist/chunk-PBRN7MJY.js +315 -0
  24. package/dist/{chunk-NH25O7PC.js → chunk-PVQCLQNA.js} +1 -1
  25. package/dist/{chunk-NZJCJJH5.js → chunk-RWIZ7Q74.js} +1 -1
  26. package/dist/{chunk-TAI352I3.js → chunk-VE7J2N47.js} +1 -1
  27. package/dist/{chunk-K7D7A34K.js → chunk-XP2MX2AA.js} +1 -1
  28. package/dist/{chunk-23SR7TFO.js → chunk-XZR237JJ.js} +1 -1
  29. package/dist/{chunk-VBWTKANQ.js → chunk-Y37DCY7Y.js} +3 -3
  30. package/dist/{chunk-SVQELXFK.js → chunk-Z5TPS2BO.js} +1 -1
  31. package/dist/{chunk-FKETYVPP.js → chunk-ZANLDY2W.js} +87 -43
  32. package/dist/components/Badge.cjs +1346 -0
  33. package/dist/components/Badge.d.cts +10 -0
  34. package/dist/components/Badge.d.ts +10 -0
  35. package/dist/components/Badge.js +13 -0
  36. package/dist/components/Button.cjs +235 -107
  37. package/dist/components/Button.d.cts +3 -1
  38. package/dist/components/Button.d.ts +3 -1
  39. package/dist/components/Button.js +8 -7
  40. package/dist/components/ButtonRow.cjs +254 -110
  41. package/dist/components/ButtonRow.d.cts +6 -2
  42. package/dist/components/ButtonRow.d.ts +6 -2
  43. package/dist/components/ButtonRow.js +14 -11
  44. package/dist/components/CardPage.cjs +1921 -0
  45. package/dist/components/CardPage.d.cts +54 -0
  46. package/dist/components/CardPage.d.ts +54 -0
  47. package/dist/components/CardPage.js +33 -0
  48. package/dist/components/Collapsible.cjs +38 -54
  49. package/dist/components/Collapsible.js +4 -5
  50. package/dist/components/ContentTable.cjs +38 -54
  51. package/dist/components/ContentTable.js +3 -4
  52. package/dist/components/CopyToClipboardButton.cjs +161 -65
  53. package/dist/components/CopyToClipboardButton.js +6 -5
  54. package/dist/components/CurrencyAmount.cjs +38 -54
  55. package/dist/components/CurrencyAmount.js +3 -4
  56. package/dist/components/FileInput.cjs +1959 -0
  57. package/dist/components/FileInput.d.cts +21 -0
  58. package/dist/components/FileInput.d.ts +21 -0
  59. package/dist/components/FileInput.js +113 -0
  60. package/dist/components/GradientCardHeader.cjs +177 -0
  61. package/dist/components/GradientCardHeader.d.cts +10 -0
  62. package/dist/components/GradientCardHeader.d.ts +10 -0
  63. package/dist/components/GradientCardHeader.js +8 -0
  64. package/dist/components/Icon.cjs +38 -54
  65. package/dist/components/Icon.js +2 -3
  66. package/dist/components/LightTooltip.cjs +1428 -0
  67. package/dist/components/LightTooltip.d.cts +9 -0
  68. package/dist/components/LightTooltip.d.ts +9 -0
  69. package/dist/components/LightTooltip.js +12 -0
  70. package/dist/components/LightboxImage.cjs +1 -1
  71. package/dist/components/LightboxImage.js +2 -2
  72. package/dist/components/LightsparkProvider.cjs +41 -57
  73. package/dist/components/LightsparkProvider.js +3 -4
  74. package/dist/components/Loading.cjs +38 -54
  75. package/dist/components/Loading.js +3 -4
  76. package/dist/components/Modal.cjs +251 -145
  77. package/dist/components/Modal.js +12 -11
  78. package/dist/components/Pill.cjs +1717 -0
  79. package/dist/components/Pill.d.cts +19 -0
  80. package/dist/components/Pill.d.ts +19 -0
  81. package/dist/components/Pill.js +16 -0
  82. package/dist/components/ProgressBar.cjs +38 -56
  83. package/dist/components/ProgressBar.js +2 -3
  84. package/dist/components/SecretContainer.cjs +162 -66
  85. package/dist/components/SecretContainer.js +7 -6
  86. package/dist/components/TextIconAligner.cjs +38 -54
  87. package/dist/components/TextIconAligner.js +3 -4
  88. package/dist/components/UnstyledButton.cjs +38 -54
  89. package/dist/components/UnstyledButton.js +2 -3
  90. package/dist/components/documentation/AnchorLinkHeader.cjs +38 -56
  91. package/dist/components/documentation/AnchorLinkHeader.js +3 -4
  92. package/dist/components/documentation/index.cjs +38 -56
  93. package/dist/components/documentation/index.js +3 -4
  94. package/dist/components/index.cjs +1191 -358
  95. package/dist/components/index.d.cts +7 -1
  96. package/dist/components/index.d.ts +7 -1
  97. package/dist/components/index.js +63 -32
  98. package/dist/icons/ArrowCornerDownRight.cjs +49 -0
  99. package/dist/icons/ArrowCornerDownRight.d.cts +5 -0
  100. package/dist/icons/ArrowCornerDownRight.d.ts +5 -0
  101. package/dist/icons/ArrowCornerDownRight.js +30 -0
  102. package/dist/icons/Copy.cjs +4 -3
  103. package/dist/icons/Copy.js +4 -3
  104. package/dist/icons/Download.cjs +22 -11
  105. package/dist/icons/Download.js +23 -12
  106. package/dist/icons/Sort.cjs +48 -0
  107. package/dist/icons/Sort.d.cts +5 -0
  108. package/dist/icons/Sort.d.ts +5 -0
  109. package/dist/icons/Sort.js +29 -0
  110. package/dist/icons/Upload.cjs +22 -11
  111. package/dist/icons/Upload.js +23 -12
  112. package/dist/icons/index.cjs +38 -54
  113. package/dist/icons/index.js +2 -3
  114. package/dist/router.cjs +7 -3
  115. package/dist/router.js +1 -1
  116. package/dist/styles/common.cjs +38 -66
  117. package/dist/styles/common.d.cts +10 -11
  118. package/dist/styles/common.d.ts +10 -11
  119. package/dist/styles/common.js +1 -14
  120. package/dist/styles/fields.cjs +117 -61
  121. package/dist/styles/fields.d.cts +12 -5
  122. package/dist/styles/fields.d.ts +12 -5
  123. package/dist/styles/fields.js +28 -164
  124. package/dist/styles/fonts/typography/Article.cjs +38 -54
  125. package/dist/styles/fonts/typography/Article.js +5 -6
  126. package/dist/styles/fonts/typography/index.cjs +38 -54
  127. package/dist/styles/fonts/typography/index.js +5 -6
  128. package/dist/styles/global.cjs +41 -57
  129. package/dist/styles/global.js +2 -3
  130. package/dist/styles/type.cjs +38 -54
  131. package/dist/styles/type.js +8 -145
  132. package/dist/styles/utils.cjs +38 -54
  133. package/dist/styles/utils.js +2 -3
  134. package/dist/styles/z-index.cjs +1 -1
  135. package/dist/styles/z-index.d.cts +1 -1
  136. package/dist/styles/z-index.d.ts +1 -1
  137. package/dist/styles/z-index.js +1 -1
  138. package/dist/types/index.d.cts +2 -0
  139. package/dist/types/index.d.ts +2 -0
  140. package/dist/utils/toReactNodes.cjs +7 -3
  141. package/dist/utils/toReactNodes.js +2 -2
  142. package/package.json +10 -6
@@ -0,0 +1,119 @@
1
+ import {
2
+ z
3
+ } from "./chunk-55OQPFLF.js";
4
+
5
+ // src/components/GradientCardHeader.tsx
6
+ import styled from "@emotion/styled";
7
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
8
+ function GradientCardHeader(props) {
9
+ return /* @__PURE__ */ jsxs(CardHeaderWrapper, { children: [
10
+ /* @__PURE__ */ jsx(Gradients, {}),
11
+ /* @__PURE__ */ jsxs("div", { children: [
12
+ props.status,
13
+ /* @__PURE__ */ jsx(CardHeaderTitle, { children: props.title })
14
+ ] }),
15
+ props.children
16
+ ] });
17
+ }
18
+ var CardHeaderWrapper = styled.div`
19
+ position: relative;
20
+ display: flex;
21
+ flex-direction: column;
22
+ justify-content: space-between;
23
+ padding: 40px 32px 24px 32px;
24
+ background-color: black;
25
+ color: white;
26
+ height: 264px;
27
+ `;
28
+ var CardHeaderTitle = styled.h3`
29
+ font-size: 21px;
30
+ font-weight: 800;
31
+ color: white;
32
+ margin: 0;
33
+ z-index: ${z.headerContainer} - 1;
34
+ position: relative;
35
+ `;
36
+ var Gradients = () => {
37
+ return /* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }, children: [
38
+ /* @__PURE__ */ jsx(BackgroundGradients, {}),
39
+ /* @__PURE__ */ jsx(AccentGradients, {})
40
+ ] });
41
+ };
42
+ var BackgroundGradients = styled.div`
43
+ &:before,
44
+ &:after {
45
+ content: "";
46
+ position: absolute;
47
+ margin: auto;
48
+ filter: blur(38.5px);
49
+ }
50
+ &:before {
51
+ z-index: ${z.walletActionPreviewTopGradient};
52
+ right: -280px;
53
+ top: -340px;
54
+ width: 704px;
55
+ height: 619px;
56
+ background: radial-gradient(
57
+ 31.57% 32.06% at 50.1% 49.9%,
58
+ #0032ff 0%,
59
+ rgb(0 121 255 / 31%) 97%,
60
+ rgba(0, 102, 255, 0.05) 100%
61
+ );
62
+ }
63
+ &:after {
64
+ z-index: ${z.walletActionPreviewTopGradient - 1};
65
+ width: 636px;
66
+ height: 552px;
67
+ top: -400px;
68
+ right: -280px;
69
+ background: radial-gradient(
70
+ 31.57% 32.06% at 50.1% 49.9%,
71
+ rgb(255 114 104) 0%,
72
+ rgb(191 9 255 / 14%) 90%,
73
+ rgb(191 9 255 / 5%) 100%
74
+ );
75
+ }
76
+ `;
77
+ var AccentGradients = styled.div`
78
+ position: absolute;
79
+ top: 0;
80
+ left: 0;
81
+ width: 100%;
82
+ height: 100%;
83
+ right: 0;
84
+ bottom: 0;
85
+ z-index: ${z.walletActionPreviewTopGradient - 1};
86
+ &:before,
87
+ &:after {
88
+ content: "";
89
+ position: absolute;
90
+ margin: auto;
91
+ filter: blur(38.5px);
92
+ }
93
+ &:before {
94
+ right: -70px;
95
+ top: -100px;
96
+ width: 169px;
97
+ height: 323px;
98
+ background: radial-gradient(
99
+ 31.57% 32.06% at 50.1% 49.9%,
100
+ #ff8c28,
101
+ rgba(191, 9, 255, 0.1) 100%
102
+ );
103
+ }
104
+ &:after {
105
+ right: -22px;
106
+ top: -140px;
107
+ width: 225px;
108
+ height: 190px;
109
+ background: radial-gradient(
110
+ 41.57% 62.06% at 53.1% 49.9%,
111
+ rgb(255 119 0),
112
+ rgb(255 106 9 / 55%) 100%
113
+ );
114
+ }
115
+ `;
116
+
117
+ export {
118
+ GradientCardHeader
119
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Icon
3
- } from "./chunk-NZJCJJH5.js";
3
+ } from "./chunk-RWIZ7Q74.js";
4
4
 
5
5
  // src/components/Loading.tsx
6
6
  import styled from "@emotion/styled";
@@ -6,21 +6,52 @@ import {
6
6
  import {
7
7
  bp
8
8
  } from "./chunk-JSGRNWSB.js";
9
- import {
10
- z
11
- } from "./chunk-CLU2FRJZ.js";
12
9
 
13
10
  // src/styles/common.tsx
14
11
  import { css } from "@emotion/react";
15
12
  import styled from "@emotion/styled";
16
- import { Tooltip } from "react-tooltip";
17
13
  var rootFontSizePx = 12;
18
14
  var rootFontSizeRems = rootFontSizePx / 16;
19
15
  var standardLineHeightEms = 1.21;
20
16
  var headingContentMarginPx = 30;
21
- var standardContentInsetPx = 32;
22
- var standardContentInsetMdPx = 24;
23
- var standardContentInsetSmPx = 16;
17
+ function buildStandardContentInset(smPx, minSmMaxLgPx, lgPx) {
18
+ const smCSS = css`
19
+ ${bp.sm(`
20
+ margin-left: auto;
21
+ margin-right: auto;
22
+ width: calc(100% - ${smPx * 2}px);
23
+ `)}
24
+ `;
25
+ const minSmMaxLgCSS = css`
26
+ ${bp.minSmMaxLg(`
27
+ margin-left: auto;
28
+ margin-right: auto;
29
+ width: calc(100% - ${minSmMaxLgPx * 2}px);
30
+ `)}
31
+ `;
32
+ const lgCSS = css`
33
+ ${bp.lg(`
34
+ margin-left: auto;
35
+ margin-right: auto;
36
+ width: calc(100% - ${lgPx * 2}px);
37
+ max-width: 1280px;
38
+ `)}
39
+ `;
40
+ return {
41
+ smPx,
42
+ minSmMaxLgPx,
43
+ lgPx,
44
+ smCSS,
45
+ minSmMaxLgCSS,
46
+ lgCSS,
47
+ css: css`
48
+ ${lgCSS}
49
+ ${smCSS}
50
+ ${minSmMaxLgCSS}
51
+ `
52
+ };
53
+ }
54
+ var standardContentInset = buildStandardContentInset(16, 24, 32);
24
55
  var cardBorderRadiusPx = 16;
25
56
  var standardBorderRadius = (radius) => {
26
57
  const borderRadiusPx = Array.isArray(radius) ? radius.map((r) => `${r}px`).join(" ") : `${radius}px`;
@@ -28,27 +59,6 @@ var standardBorderRadius = (radius) => {
28
59
  border-radius: ${borderRadiusPx};
29
60
  `;
30
61
  };
31
- var smContentInset = css`
32
- ${bp.sm(`
33
- margin-left: auto;
34
- margin-right: auto;
35
- width: calc(100% - ${standardContentInsetSmPx * 2}px);
36
- `)}
37
- `;
38
- var minSmMaxLgContentInset = css`
39
- ${bp.minSmMaxLg(`
40
- width: calc(100% - ${standardContentInsetMdPx * 2}px);
41
- `)}
42
- `;
43
- var standardContentInset = css`
44
- margin-left: auto;
45
- margin-right: auto;
46
- width: calc(100% - ${standardContentInsetPx * 2}px);
47
- max-width: 1280px;
48
-
49
- ${smContentInset}
50
- ${minSmMaxLgContentInset}
51
- `;
52
62
  var standardCardShadow = css`
53
63
  box-shadow:
54
64
  0px 4px 10px 0px rgba(0, 0, 0, 0.08),
@@ -91,9 +101,6 @@ var Subtext = styled.div`
91
101
  var darkGradientBg = css`
92
102
  background: ${darkGradient};
93
103
  `;
94
- var StyledTooltip = styled(Tooltip)`
95
- z-index: ${z.modalOverlay};
96
- `;
97
104
  var overlaySurfaceBorderColor = ({
98
105
  theme,
99
106
  important = false
@@ -125,14 +132,9 @@ export {
125
132
  rootFontSizeRems,
126
133
  standardLineHeightEms,
127
134
  headingContentMarginPx,
128
- standardContentInsetPx,
129
- standardContentInsetMdPx,
130
- standardContentInsetSmPx,
135
+ standardContentInset,
131
136
  cardBorderRadiusPx,
132
137
  standardBorderRadius,
133
- smContentInset,
134
- minSmMaxLgContentInset,
135
- standardContentInset,
136
138
  standardCardShadow,
137
139
  pageBorderRadiusPx,
138
140
  pageBorderRadius,
@@ -143,7 +145,6 @@ export {
143
145
  subtext,
144
146
  Subtext,
145
147
  darkGradientBg,
146
- StyledTooltip,
147
148
  overlaySurfaceBorderColor,
148
149
  overlaySurface,
149
150
  mcBold,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  rootFontSizeRems,
6
6
  standardLineHeightEms
7
- } from "./chunk-RFGKH3R6.js";
7
+ } from "./chunk-JK4BP73A.js";
8
8
  import {
9
9
  useThemeBg
10
10
  } from "./chunk-2VBDEO6M.js";
@@ -110,6 +110,8 @@ function GlobalStyles() {
110
110
  :root {
111
111
  ${cssVars.docHeight}: 100vh;
112
112
  --rt-opacity: 1 !important;
113
+ --rt-transition-show-delay: 0.15s !important;
114
+ --rt-transition-closing-delay: 0.2s !important;
113
115
  }
114
116
 
115
117
  html {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Button
3
- } from "./chunk-FKETYVPP.js";
3
+ } from "./chunk-ZANLDY2W.js";
4
4
  import {
5
5
  overflowAutoWithoutScrollbars
6
- } from "./chunk-UO6U7AYM.js";
6
+ } from "./chunk-FCZJILMW.js";
7
7
  import {
8
- standardContentInsetSmPx
9
- } from "./chunk-RFGKH3R6.js";
8
+ standardContentInset
9
+ } from "./chunk-JK4BP73A.js";
10
10
  import {
11
11
  bp
12
12
  } from "./chunk-JSGRNWSB.js";
@@ -23,7 +23,9 @@ function ButtonRow({
23
23
  smSticky = true,
24
24
  headerHeight = 0
25
25
  }) {
26
- return /* @__PURE__ */ jsx(ButtonRowContainer, { smSticky, headerHeight, children: /* @__PURE__ */ jsx(StyledButtonRow, { className, children: buttons.map((button, idx) => /* @__PURE__ */ jsx(Button, __spreadValues({}, button), idx)) }) });
26
+ return /* @__PURE__ */ jsx(ButtonRowContainer, { smSticky, headerHeight, children: /* @__PURE__ */ jsx(StyledButtonRow, { className, children: buttons.map(
27
+ (button, idx) => button === "divider" ? /* @__PURE__ */ jsx(ButtonRowDivider, {}, idx) : /* @__PURE__ */ jsx(Button, __spreadValues({}, button), idx)
28
+ ) }) });
27
29
  }
28
30
  var ButtonRowContainer = styled.div`
29
31
  max-width: 100%;
@@ -35,9 +37,9 @@ var ButtonRowContainer = styled.div`
35
37
  position: sticky;
36
38
  top: ${headerHeight}px;
37
39
  margin-top: 24px;
38
- margin-left: -${standardContentInsetSmPx}px;
39
- width: calc(100% + ${standardContentInsetSmPx * 2}px);
40
- max-width: calc(100% + ${standardContentInsetSmPx * 2}px);
40
+ margin-left: -${standardContentInset.smPx}px;
41
+ width: calc(100% + ${standardContentInset.smPx * 2}px);
42
+ max-width: calc(100% + ${standardContentInset.smPx * 2}px);
41
43
  z-index: 2;` : `position: relative;`}
42
44
  z-index: 2;
43
45
  &:before {
@@ -53,6 +55,11 @@ var ButtonRowContainer = styled.div`
53
55
  `
54
56
  )}
55
57
  `;
58
+ var ButtonRowDivider = styled.div`
59
+ border-left: 1px #d9d9d9 solid;
60
+ margin-left: 16px;
61
+ padding-left: 16px;
62
+ `;
56
63
  var StyledButtonRow = styled.div`
57
64
  ${overflowAutoWithoutScrollbars}
58
65
  background: ${({ theme }) => theme.bg};
@@ -65,12 +72,18 @@ var StyledButtonRow = styled.div`
65
72
  margin-left: 8px;
66
73
  }
67
74
 
75
+ & ${ButtonRowDivider} + button,
76
+ & ${ButtonRowDivider} + a {
77
+ margin-left: 0;
78
+ }
79
+
68
80
  ${bp.sm(`
69
- padding: 12px;
81
+ padding: ${standardContentInset.smPx}px;
70
82
  `)}
71
83
  `;
72
84
 
73
85
  export {
74
86
  ButtonRow,
75
- ButtonRowContainer
87
+ ButtonRowContainer,
88
+ StyledButtonRow
76
89
  };
@@ -1,42 +1,41 @@
1
1
  import {
2
2
  toReactNodes
3
- } from "./chunk-TAI352I3.js";
3
+ } from "./chunk-VE7J2N47.js";
4
4
  import {
5
5
  useLiveRef
6
6
  } from "./chunk-NBCCPGA4.js";
7
7
  import {
8
8
  ProgressBar
9
- } from "./chunk-RTUZVKPK.js";
9
+ } from "./chunk-E3AOYBY5.js";
10
10
  import {
11
11
  Button
12
- } from "./chunk-FKETYVPP.js";
12
+ } from "./chunk-ZANLDY2W.js";
13
13
  import {
14
14
  select
15
15
  } from "./chunk-YMNSXZ5D.js";
16
+ import {
17
+ UnstyledButton
18
+ } from "./chunk-3GS5EFXV.js";
19
+ import {
20
+ z
21
+ } from "./chunk-55OQPFLF.js";
16
22
  import {
17
23
  overflowAutoWithoutScrollbars,
18
24
  pxToRems
19
- } from "./chunk-UO6U7AYM.js";
20
- import {
21
- UnstyledButton
22
- } from "./chunk-IQFU7CM5.js";
25
+ } from "./chunk-FCZJILMW.js";
23
26
  import {
24
27
  Icon
25
- } from "./chunk-NZJCJJH5.js";
28
+ } from "./chunk-RWIZ7Q74.js";
26
29
  import {
27
30
  overlaySurface,
28
- smContentInset,
29
31
  standardBorderRadius,
30
- standardContentInsetSmPx,
32
+ standardContentInset,
31
33
  standardFocusOutline
32
- } from "./chunk-RFGKH3R6.js";
34
+ } from "./chunk-JK4BP73A.js";
33
35
  import {
34
36
  bp,
35
37
  useBreakpoints
36
38
  } from "./chunk-JSGRNWSB.js";
37
- import {
38
- z
39
- } from "./chunk-CLU2FRJZ.js";
40
39
 
41
40
  // src/components/Modal.tsx
42
41
  import styled from "@emotion/styled";
@@ -57,7 +56,7 @@ function Modal({
57
56
  submitDisabled,
58
57
  submitLoading,
59
58
  submitText,
60
- cancelText,
59
+ cancelText = "Cancel",
61
60
  firstFocusRef,
62
61
  nonDismissable = false,
63
62
  autoFocus = true,
@@ -185,16 +184,16 @@ function Modal({
185
184
  title ? /* @__PURE__ */ jsx("h4", { children: title }) : null,
186
185
  formattedDescription ? /* @__PURE__ */ jsx(Description, { children: formattedDescription }) : null,
187
186
  /* @__PURE__ */ jsx("div", { children }),
188
- onSubmit ? /* @__PURE__ */ jsxs(ModalButtonRow, { children: [
187
+ onSubmit || onCancel ? /* @__PURE__ */ jsxs(ModalButtonRow, { children: [
189
188
  !isSm && !cancelHidden && /* @__PURE__ */ jsx(
190
189
  Button,
191
190
  {
192
191
  disabled: cancelDisabled,
193
192
  onClick: onClickCancel,
194
- text: cancelText != null ? cancelText : "Cancel"
193
+ text: cancelText
195
194
  }
196
195
  ),
197
- /* @__PURE__ */ jsx(
196
+ onSubmit && /* @__PURE__ */ jsx(
198
197
  Button,
199
198
  {
200
199
  disabled: submitDisabled,
@@ -204,7 +203,7 @@ function Modal({
204
203
  type: "submit"
205
204
  }
206
205
  ),
207
- isSm && !cancelHidden && /* @__PURE__ */ jsx(Button, { onClick: onClose, text: "Cancel" })
206
+ isSm && !cancelHidden && /* @__PURE__ */ jsx(Button, { onClick: onClose, text: cancelText })
208
207
  ] }) : null
209
208
  ] })
210
209
  ] })
@@ -247,7 +246,7 @@ var ModalContainer = styled.div`
247
246
  justify-content: center;
248
247
  align-items: center;
249
248
  color: ${({ theme }) => theme.text};
250
- padding-top: ${standardContentInsetSmPx}px;
249
+ padding-top: ${standardContentInset.smPx}px;
251
250
  `;
252
251
  var contentTopMarginPx = 24;
253
252
  var Description = styled.div`
@@ -260,6 +259,7 @@ var Description = styled.div`
260
259
  var ModalButtonRow = styled.div`
261
260
  margin-top: 32px;
262
261
  ${bp.minSm(`display: flex;`)}
262
+ gap: 10px;
263
263
 
264
264
  button {
265
265
  width: 50%;
@@ -272,14 +272,11 @@ var ModalButtonRow = styled.div`
272
272
  ${bp.sm(`
273
273
  margin-top: 16px;
274
274
  `)}
275
- ${bp.minSm(`
276
- margin-left: 10px;
277
- `)}
278
275
  }
279
276
  `;
280
277
  var ModalContent = styled.div`
281
278
  ${overflowAutoWithoutScrollbars}
282
- ${smContentInset}
279
+ ${standardContentInset.smCSS}
283
280
  ${standardBorderRadius(16)}
284
281
  ${(props) => props.ghost ? "" : overlaySurface}
285
282
  pointer-events: auto;
@@ -50,19 +50,23 @@ function Link({
50
50
  blue = false,
51
51
  newTab = false
52
52
  }) {
53
- if (!isString(to) && !externalLink) {
54
- throw new Error("Link must have either `to` or `externalLink` defined");
53
+ if (!isString(to) && !externalLink && !onClick) {
54
+ throw new Error(
55
+ "Link must have either `to` or `externalLink` or `onClick` defined"
56
+ );
55
57
  }
56
58
  let toStr;
57
59
  if (isString(to)) {
58
60
  toStr = replaceParams(to, params);
59
61
  toStr += hash ? `#${hash}` : "";
60
- } else {
62
+ } else if (externalLink) {
61
63
  const definedExternalLink = externalLink;
62
64
  if (!definedExternalLink.startsWith("http")) {
63
65
  throw new Error("Link's externalLink must start with http");
64
66
  }
65
67
  toStr = definedExternalLink;
68
+ } else {
69
+ toStr = "#";
66
70
  }
67
71
  return /* @__PURE__ */ jsx(
68
72
  RLink,
@@ -0,0 +1,150 @@
1
+ import {
2
+ firstChild,
3
+ pxToRems
4
+ } from "./chunk-FCZJILMW.js";
5
+ import {
6
+ bp
7
+ } from "./chunk-JSGRNWSB.js";
8
+ import {
9
+ __spreadValues
10
+ } from "./chunk-CIGAQ47A.js";
11
+
12
+ // src/styles/type.tsx
13
+ import { css, useTheme } from "@emotion/react";
14
+ import styled from "@emotion/styled";
15
+ import { jsx } from "@emotion/react/jsx-runtime";
16
+ var defaultHeadingSizes = {
17
+ h1: {
18
+ size: 32,
19
+ sizeSm: 21
20
+ },
21
+ h2: {
22
+ size: 24,
23
+ sizeSm: 18
24
+ },
25
+ h3: {
26
+ size: 21,
27
+ sizeSm: 18
28
+ },
29
+ h4: {
30
+ size: 14,
31
+ sizeSm: 14
32
+ }
33
+ };
34
+ var defaultHeadingMargins = {
35
+ h1: {
36
+ mt: 24,
37
+ mb: 24,
38
+ mtSm: 24,
39
+ mbSm: 24
40
+ },
41
+ h2: {
42
+ mt: 24,
43
+ mb: 24,
44
+ mtSm: 24,
45
+ mbSm: 24
46
+ },
47
+ h3: {
48
+ mt: 24,
49
+ mb: 24,
50
+ mtSm: 24,
51
+ mbSm: 24
52
+ },
53
+ h4: {
54
+ mt: 16,
55
+ mb: 16,
56
+ mtSm: 16,
57
+ mbSm: 16
58
+ }
59
+ };
60
+ var baseHeading = ({ mt, mb, mtSm, mbSm, theme }) => css`
61
+ line-height: 1.214em;
62
+
63
+ margin-bottom: ${mb}px;
64
+ margin-top: ${mt}px;
65
+
66
+ ${bp.sm(`
67
+ margin-top: ${mtSm}px;
68
+ margin-bottom: ${mbSm}px;
69
+ `)}
70
+ `;
71
+ var firstChildStyles = firstChild(`margin-top: 0;`);
72
+ var headings = {
73
+ h1: styled.h1`
74
+ ${(props) => baseHeading(props)}
75
+ ${firstChildStyles}
76
+
77
+ font-size: ${pxToRems(defaultHeadingSizes.h1.size)};
78
+ font-weight: ${({ light }) => light ? 400 : 800}};
79
+ ${bp.sm(`
80
+ font-size: ${pxToRems(defaultHeadingSizes.h1.sizeSm)};
81
+ `)}
82
+ `,
83
+ h2: styled.h2`
84
+ ${(props) => baseHeading(props)}
85
+ ${firstChildStyles}
86
+
87
+ font-size: ${pxToRems(defaultHeadingSizes.h2.size)};
88
+ font-weight: ${({ light }) => light ? 400 : 700}};
89
+ ${bp.sm(`
90
+ font-size: ${pxToRems(defaultHeadingSizes.h2.sizeSm)};
91
+ `)}
92
+ `,
93
+ h3: styled.h3`
94
+ ${(props) => baseHeading(props)}
95
+ ${firstChildStyles}
96
+
97
+ font-size: ${pxToRems(defaultHeadingSizes.h3.size)};
98
+ font-weight: ${({ light }) => light ? 400 : 700}};
99
+ ${bp.sm(`
100
+ font-size: ${pxToRems(defaultHeadingSizes.h3.sizeSm)};
101
+ `)}
102
+ `,
103
+ h4: styled.h4`
104
+ ${(props) => baseHeading(props)}
105
+ ${firstChildStyles}
106
+
107
+ font-size: ${pxToRems(defaultHeadingSizes.h4.size)};
108
+ font-weight: ${({ light }) => light ? 400 : 600}};
109
+ ${bp.sm(`
110
+ font-size: ${pxToRems(defaultHeadingSizes.h4.sizeSm)};
111
+ `)}
112
+ `
113
+ };
114
+ function Heading({
115
+ children,
116
+ type = "h2",
117
+ id,
118
+ mt = defaultHeadingMargins[type].mt,
119
+ mb = defaultHeadingMargins[type].mb,
120
+ mtSm = defaultHeadingMargins[type].mtSm,
121
+ mbSm = defaultHeadingMargins[type].mbSm,
122
+ m0 = false,
123
+ light = false
124
+ }) {
125
+ const StyledHeading = headings[type];
126
+ const theme = useTheme();
127
+ const heading = /* @__PURE__ */ jsx(
128
+ StyledHeading,
129
+ {
130
+ id,
131
+ mt: m0 ? 0 : mt,
132
+ mb: m0 ? 0 : mb,
133
+ mtSm: m0 ? 0 : mtSm,
134
+ mbSm: m0 ? 0 : mbSm,
135
+ light,
136
+ theme,
137
+ children: id ? /* @__PURE__ */ jsx("a", { href: `#${id}`, css: { color: "inherit" }, children }) : children
138
+ }
139
+ );
140
+ return heading;
141
+ }
142
+ function headingWithDefaults(defaultProps) {
143
+ return (props) => /* @__PURE__ */ jsx(Heading, __spreadValues(__spreadValues({}, defaultProps), props));
144
+ }
145
+
146
+ export {
147
+ headings,
148
+ Heading,
149
+ headingWithDefaults
150
+ };