@indietabletop/appkit 6.1.6 → 7.0.0-0
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/AppConfig/AppConfig.d.ts +29 -0
- package/dist/AuthCard/AuthCard.d.ts +10 -0
- package/dist/AuthCard/AuthCard.stories.d.ts +34 -0
- package/dist/AuthCard/style.css.d.ts +23 -0
- package/dist/DialogTrigger/index.d.ts +13 -0
- package/dist/DocumentTitle/DocumentTitle.d.ts +3 -0
- package/dist/EnumMapper.d.ts +25 -0
- package/dist/ExternalLink.d.ts +3 -0
- package/dist/FullscreenDismissBlocker.d.ts +5 -0
- package/{lib/HistoryState.ts → dist/HistoryState.d.ts} +2 -5
- package/dist/IndieTabletopClubLogo.d.ts +7 -0
- package/dist/IndieTabletopClubSymbol.d.ts +7 -0
- package/dist/InfoPage/index.d.ts +8 -0
- package/dist/InfoPage/pages.d.ts +2 -0
- package/dist/InfoPage/style.css.d.ts +5 -0
- package/dist/Letterhead/index.d.ts +19 -0
- package/dist/Letterhead/stories.d.ts +13 -0
- package/dist/Letterhead/style.css.d.ts +46 -0
- package/dist/LetterheadForm/LetterheadReadonlyTextField.stories.d.ts +17 -0
- package/dist/LetterheadForm/LetterheadSubmitError.stories.d.ts +11 -0
- package/dist/LetterheadForm/LetterheadTextField.stories.d.ts +336 -0
- package/dist/LetterheadForm/index.d.ts +44 -0
- package/dist/LetterheadForm/style.css.d.ts +8 -0
- package/dist/LoadingIndicator.d.ts +3 -0
- package/dist/MiddotSeparated/MiddotSeparated.d.ts +8 -0
- package/dist/MiddotSeparated/MiddotSeparated.stories.d.ts +586 -0
- package/dist/MiddotSeparated/style.css.d.ts +1 -0
- package/dist/ModalDialog/index.d.ts +12 -0
- package/dist/ModalDialog/style.css.d.ts +58 -0
- package/dist/ModernIDB/Cursor.d.ts +56 -0
- package/dist/ModernIDB/ModernIDB.d.ts +66 -0
- package/dist/ModernIDB/ModernIDBError.d.ts +3 -0
- package/dist/ModernIDB/ObjectStore.d.ts +112 -0
- package/dist/ModernIDB/ObjectStoreIndex.d.ts +53 -0
- package/dist/ModernIDB/Transaction.d.ts +16 -0
- package/dist/ModernIDB/VersionChangeManager.d.ts +30 -0
- package/dist/ModernIDB/bindings/factory.d.ts +12 -0
- package/dist/ModernIDB/bindings/index.d.ts +2 -0
- package/{lib/ModernIDB/bindings/types.ts → dist/ModernIDB/bindings/types.d.ts} +13 -32
- package/dist/ModernIDB/bindings/utils.d.ts +2 -0
- package/dist/ModernIDB/index.d.ts +10 -0
- package/dist/ModernIDB/types.d.ts +88 -0
- package/dist/ModernIDB/utils.d.ts +4 -0
- package/dist/QRCode/QRCode.d.ts +7 -0
- package/dist/QRCode/QRCode.stories.d.ts +33 -0
- package/dist/QRCode/style.css.d.ts +4 -0
- package/dist/ReleaseInfo/index.d.ts +5 -0
- package/dist/RulesetResolver.d.ts +87 -0
- package/dist/SafariCheck/SafariCheck.d.ts +23 -0
- package/dist/SafariCheck/SafariCheck.stories.d.ts +73 -0
- package/dist/SafariCheck/style.css.d.ts +17 -0
- package/dist/ServiceWorkerHandler.d.ts +11 -0
- package/dist/ShareButton/ShareButton.d.ts +57 -0
- package/dist/ShareButton/ShareButton.stories.d.ts +1577 -0
- package/dist/ShareButton/test.css.d.ts +1 -0
- package/dist/SubscribeCard/LetterheadInfoCard.d.ts +2 -0
- package/dist/SubscribeCard/SubscribeByEmailCard.d.ts +24 -0
- package/dist/SubscribeCard/SubscribeByEmailCard.stories.d.ts +10 -0
- package/dist/SubscribeCard/SubscribeByPledgeCard.d.ts +36 -0
- package/dist/SubscribeCard/SubscribeByPledgeCard.stories.d.ts +65 -0
- package/dist/SubscribeCard/style.css.d.ts +4 -0
- package/dist/account/AccountIssueView.d.ts +3 -0
- package/dist/account/AlreadyLoggedInView.d.ts +5 -0
- package/dist/account/CurrentUserFetcher.d.ts +20 -0
- package/dist/account/CurrentUserFetcher.stories.d.ts +136 -0
- package/dist/account/FailureFallbackView.d.ts +1 -0
- package/dist/account/JoinCard.d.ts +14 -0
- package/dist/account/JoinCard.stories.d.ts +143 -0
- package/dist/account/LoadingView.d.ts +1 -0
- package/dist/account/LoginCard.d.ts +39 -0
- package/dist/account/LoginCard.stories.d.ts +217 -0
- package/dist/account/LoginView.d.ts +10 -0
- package/dist/account/NoConnectionView.d.ts +4 -0
- package/dist/account/PasswordResetCard.d.ts +15 -0
- package/dist/account/PasswordResetCard.stories.d.ts +128 -0
- package/dist/account/UserMismatchView.d.ts +6 -0
- package/dist/account/VerifyPage.d.ts +13 -0
- package/dist/account/style.css.d.ts +10 -0
- package/{lib/account/types.ts → dist/account/types.d.ts} +3 -6
- package/dist/account/useFetchCurrentUser.d.ts +28 -0
- package/dist/account/useRedirectPath.d.ts +6 -0
- package/dist/animations.css.d.ts +3 -0
- package/dist/append-copy-to-text.d.ts +10 -0
- package/dist/append-copy-to-text.test.d.ts +1 -0
- package/dist/appkit.css +1 -0
- package/dist/appkit.js +10692 -0
- package/dist/async-op.d.ts +101 -0
- package/dist/atomic.css.d.ts +6 -0
- package/{lib/caught-value.ts → dist/caught-value.d.ts} +1 -11
- package/{lib/class-names.ts → dist/class-names.d.ts} +6 -17
- package/dist/client.d.ts +424 -0
- package/dist/common.css.d.ts +5 -0
- package/dist/copyrightRange.d.ts +1 -0
- package/dist/copyrightRange.test.d.ts +1 -0
- package/dist/createSafeStorage.d.ts +34 -0
- package/dist/failureMessages.d.ts +20 -0
- package/dist/failureMessages.test.d.ts +1 -0
- package/dist/form/FormSubmitButton.d.ts +17 -0
- package/dist/form/SubmitErrorAlert.d.ts +5 -0
- package/dist/form/style.css.d.ts +3 -0
- package/dist/globals.css.d.ts +0 -0
- package/dist/groupBy.d.ts +1 -0
- package/dist/groupBy.test.d.ts +1 -0
- package/dist/hrefs.d.ts +32 -0
- package/dist/hrefs.test.d.ts +1 -0
- package/dist/idToDate.d.ts +5 -0
- package/dist/idToDate.test.d.ts +1 -0
- package/dist/ids.d.ts +1 -0
- package/dist/ids.test.d.ts +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/internal.css.d.ts +2 -0
- package/dist/mailto.d.ts +8 -0
- package/dist/mailto.test.d.ts +1 -0
- package/dist/media.d.ts +39 -0
- package/dist/random.d.ts +3 -0
- package/dist/result/swr.d.ts +4 -0
- package/{lib/sleep.ts → dist/sleep.d.ts} +1 -3
- package/dist/store/index.d.ts +237 -0
- package/dist/store/store.d.ts +144 -0
- package/dist/store/types.d.ts +49 -0
- package/dist/store/utils.d.ts +10 -0
- package/dist/storybook/decorators.d.ts +3 -0
- package/dist/structs.d.ts +1 -0
- package/{lib/typeguards.ts → dist/typeguards.d.ts} +1 -3
- package/dist/typeguards.test.d.ts +1 -0
- package/{lib/types.ts → dist/types.d.ts} +12 -23
- package/dist/unique.d.ts +10 -0
- package/dist/unique.test.d.ts +1 -0
- package/dist/use-async-op.d.ts +6 -0
- package/dist/use-document-background-color.d.ts +4 -0
- package/dist/use-form.d.ts +29 -0
- package/dist/use-is-installed.d.ts +8 -0
- package/dist/use-media-query.d.ts +1 -0
- package/dist/use-reverting-state.d.ts +5 -0
- package/dist/use-scroll-restoration.d.ts +25 -0
- package/dist/useEnsureValue.d.ts +6 -0
- package/dist/useInvokeClient.d.ts +25 -0
- package/dist/useIsVisible.d.ts +4 -0
- package/dist/utm.d.ts +58 -0
- package/dist/utm.test.d.ts +1 -0
- package/dist/validations.d.ts +3 -0
- package/dist/vars.css.d.ts +10 -0
- package/package.json +12 -5
- package/lib/AppConfig/AppConfig.tsx +0 -61
- package/lib/AuthCard/AuthCard.stories.ts +0 -34
- package/lib/AuthCard/AuthCard.tsx +0 -64
- package/lib/AuthCard/style.css.ts +0 -49
- package/lib/DialogTrigger/index.tsx +0 -36
- package/lib/DocumentTitle/DocumentTitle.tsx +0 -10
- package/lib/EnumMapper.ts +0 -50
- package/lib/ExternalLink.tsx +0 -10
- package/lib/FullscreenDismissBlocker.tsx +0 -23
- package/lib/IndieTabletopClubLogo.tsx +0 -44
- package/lib/IndieTabletopClubSymbol.tsx +0 -37
- package/lib/InfoPage/index.tsx +0 -46
- package/lib/InfoPage/pages.tsx +0 -36
- package/lib/InfoPage/style.css.ts +0 -36
- package/lib/Letterhead/index.tsx +0 -85
- package/lib/Letterhead/stories.tsx +0 -41
- package/lib/Letterhead/style.css.ts +0 -152
- package/lib/LetterheadForm/LetterheadReadonlyTextField.stories.tsx +0 -17
- package/lib/LetterheadForm/LetterheadSubmitError.stories.tsx +0 -19
- package/lib/LetterheadForm/LetterheadTextField.stories.tsx +0 -19
- package/lib/LetterheadForm/index.tsx +0 -137
- package/lib/LetterheadForm/style.css.ts +0 -89
- package/lib/LoadingIndicator.tsx +0 -40
- package/lib/MiddotSeparated/MiddotSeparated.stories.ts +0 -26
- package/lib/MiddotSeparated/MiddotSeparated.tsx +0 -26
- package/lib/MiddotSeparated/style.css.ts +0 -10
- package/lib/ModalDialog/index.tsx +0 -28
- package/lib/ModalDialog/style.css.ts +0 -88
- package/lib/ModernIDB/Cursor.ts +0 -91
- package/lib/ModernIDB/ModernIDB.ts +0 -337
- package/lib/ModernIDB/ModernIDBError.ts +0 -9
- package/lib/ModernIDB/ObjectStore.ts +0 -195
- package/lib/ModernIDB/ObjectStoreIndex.ts +0 -102
- package/lib/ModernIDB/README.md +0 -9
- package/lib/ModernIDB/Transaction.ts +0 -40
- package/lib/ModernIDB/VersionChangeManager.ts +0 -57
- package/lib/ModernIDB/bindings/factory.tsx +0 -165
- package/lib/ModernIDB/bindings/index.ts +0 -2
- package/lib/ModernIDB/bindings/utils.tsx +0 -32
- package/lib/ModernIDB/index.ts +0 -10
- package/lib/ModernIDB/types.ts +0 -120
- package/lib/ModernIDB/utils.ts +0 -51
- package/lib/QRCode/QRCode.stories.tsx +0 -41
- package/lib/QRCode/QRCode.tsx +0 -54
- package/lib/QRCode/style.css.ts +0 -23
- package/lib/ReleaseInfo/index.tsx +0 -29
- package/lib/RulesetResolver.ts +0 -214
- package/lib/SafariCheck/SafariCheck.stories.tsx +0 -99
- package/lib/SafariCheck/SafariCheck.tsx +0 -273
- package/lib/SafariCheck/addToDock.svg +0 -13
- package/lib/SafariCheck/addToHomeScreen.svg +0 -12
- package/lib/SafariCheck/safari.svg +0 -32
- package/lib/SafariCheck/shareIcon.svg +0 -11
- package/lib/SafariCheck/style.css.ts +0 -106
- package/lib/ServiceWorkerHandler.tsx +0 -53
- package/lib/ShareButton/ShareButton.stories.tsx +0 -58
- package/lib/ShareButton/ShareButton.tsx +0 -153
- package/lib/ShareButton/test.css.ts +0 -3
- package/lib/SubscribeCard/LetterheadInfoCard.tsx +0 -23
- package/lib/SubscribeCard/SubscribeByEmailCard.stories.tsx +0 -69
- package/lib/SubscribeCard/SubscribeByEmailCard.tsx +0 -183
- package/lib/SubscribeCard/SubscribeByPledgeCard.stories.tsx +0 -133
- package/lib/SubscribeCard/SubscribeByPledgeCard.tsx +0 -127
- package/lib/SubscribeCard/style.css.ts +0 -14
- package/lib/account/AccountIssueView.tsx +0 -44
- package/lib/account/AlreadyLoggedInView.tsx +0 -47
- package/lib/account/CurrentUserFetcher.stories.tsx +0 -292
- package/lib/account/CurrentUserFetcher.tsx +0 -118
- package/lib/account/FailureFallbackView.tsx +0 -36
- package/lib/account/JoinCard.stories.tsx +0 -257
- package/lib/account/JoinCard.tsx +0 -301
- package/lib/account/LoadingView.tsx +0 -14
- package/lib/account/LoginCard.stories.tsx +0 -288
- package/lib/account/LoginCard.tsx +0 -100
- package/lib/account/LoginView.tsx +0 -151
- package/lib/account/NoConnectionView.tsx +0 -34
- package/lib/account/PasswordResetCard.stories.tsx +0 -242
- package/lib/account/PasswordResetCard.tsx +0 -296
- package/lib/account/UserMismatchView.tsx +0 -62
- package/lib/account/VerifyPage.tsx +0 -195
- package/lib/account/style.css.ts +0 -57
- package/lib/account/useFetchCurrentUser.tsx +0 -63
- package/lib/account/useRedirectPath.ts +0 -21
- package/lib/animations.css.ts +0 -17
- package/lib/append-copy-to-text.ts +0 -35
- package/lib/async-op.ts +0 -286
- package/lib/atomic.css.ts +0 -11
- package/lib/client.ts +0 -662
- package/lib/common.css.ts +0 -48
- package/lib/copyrightRange.ts +0 -10
- package/lib/createSafeStorage.ts +0 -91
- package/lib/failureMessages.ts +0 -108
- package/lib/form/FormSubmitButton.tsx +0 -58
- package/lib/form/SubmitErrorAlert.tsx +0 -21
- package/lib/form/style.css.ts +0 -9
- package/lib/globals.css.ts +0 -62
- package/lib/groupBy.ts +0 -25
- package/lib/hrefs.ts +0 -48
- package/lib/idToDate.ts +0 -8
- package/lib/ids.ts +0 -6
- package/lib/index.ts +0 -71
- package/lib/internal.css.ts +0 -10
- package/lib/mailto.ts +0 -40
- package/lib/media.ts +0 -50
- package/lib/random.ts +0 -19
- package/lib/result/swr.ts +0 -18
- package/lib/store/index.tsx +0 -241
- package/lib/store/store.ts +0 -479
- package/lib/store/types.ts +0 -45
- package/lib/store/utils.ts +0 -54
- package/lib/storybook/decorators.tsx +0 -10
- package/lib/structs.ts +0 -3
- package/lib/unique.ts +0 -24
- package/lib/use-async-op.ts +0 -16
- package/lib/use-document-background-color.ts +0 -16
- package/lib/use-form.ts +0 -78
- package/lib/use-is-installed.ts +0 -17
- package/lib/use-media-query.ts +0 -21
- package/lib/use-reverting-state.ts +0 -32
- package/lib/use-scroll-restoration.ts +0 -99
- package/lib/useEnsureValue.ts +0 -31
- package/lib/useInvokeClient.ts +0 -54
- package/lib/useIsVisible.ts +0 -27
- package/lib/utm.ts +0 -92
- package/lib/validations.ts +0 -25
- package/lib/vars.css.ts +0 -13
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { style } from "@vanilla-extract/css";
|
|
2
|
-
import { manofa, minion } from "../common.css.ts";
|
|
3
|
-
import { Color } from "../vars.css.ts";
|
|
4
|
-
|
|
5
|
-
const border = style({
|
|
6
|
-
borderRadius: "0.5rem",
|
|
7
|
-
border: `1px solid ${Color.GRAY}`,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const field = style({
|
|
11
|
-
display: "block",
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const fieldLabel = style([
|
|
15
|
-
manofa,
|
|
16
|
-
{
|
|
17
|
-
display: "block",
|
|
18
|
-
textTransform: "uppercase",
|
|
19
|
-
fontSize: "0.75rem",
|
|
20
|
-
fontWeight: 600,
|
|
21
|
-
marginBottom: "0.5rem",
|
|
22
|
-
textAlign: "start",
|
|
23
|
-
},
|
|
24
|
-
]);
|
|
25
|
-
|
|
26
|
-
export const fieldInput = style([
|
|
27
|
-
border,
|
|
28
|
-
minion,
|
|
29
|
-
{
|
|
30
|
-
display: "block",
|
|
31
|
-
width: "100%",
|
|
32
|
-
fontSize: "1rem",
|
|
33
|
-
lineHeight: "1.25rem",
|
|
34
|
-
padding: "1rem 0 1rem 1rem",
|
|
35
|
-
textAlign: "start",
|
|
36
|
-
|
|
37
|
-
":read-only": {
|
|
38
|
-
backgroundColor: "hsl(0 0% 0% / 0.05)",
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
// Hide MS Edge widgets -- we handle them manually
|
|
42
|
-
"::-ms-clear": {
|
|
43
|
-
display: "none",
|
|
44
|
-
},
|
|
45
|
-
"::-ms-reveal": {
|
|
46
|
-
display: "none",
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
]);
|
|
50
|
-
|
|
51
|
-
export const checkboxField = style({
|
|
52
|
-
textAlign: "start",
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export const fieldIssue = style({
|
|
56
|
-
color: Color.PURPLE,
|
|
57
|
-
fontSize: "0.875rem",
|
|
58
|
-
marginTop: "0.5rem",
|
|
59
|
-
textAlign: "start",
|
|
60
|
-
|
|
61
|
-
":empty": {
|
|
62
|
-
display: "none",
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export const fieldHint = style({
|
|
67
|
-
color: Color.MID_GRAY,
|
|
68
|
-
fontSize: "0.875rem",
|
|
69
|
-
marginTop: "0.5rem",
|
|
70
|
-
textAlign: "start",
|
|
71
|
-
|
|
72
|
-
selectors: {
|
|
73
|
-
[`${fieldIssue}:not(:empty) + &`]: {
|
|
74
|
-
display: "none",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export const submitError = style({
|
|
80
|
-
padding: "1rem",
|
|
81
|
-
color: Color.PURPLE,
|
|
82
|
-
backgroundColor: Color.PALE_GRAY,
|
|
83
|
-
borderRadius: "0.75rem",
|
|
84
|
-
textAlign: "start",
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
export const header = style({
|
|
88
|
-
marginBlockEnd: "3rem",
|
|
89
|
-
});
|
package/lib/LoadingIndicator.tsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
2
|
-
import { animationDelay, dot } from "./internal.css.ts";
|
|
3
|
-
|
|
4
|
-
export function LoadingIndicator(props: { className?: string }) {
|
|
5
|
-
const diameter = 10;
|
|
6
|
-
const radius = diameter / 2;
|
|
7
|
-
const gap = diameter;
|
|
8
|
-
const cy = diameter;
|
|
9
|
-
const height = cy * 2;
|
|
10
|
-
const width = diameter * 3 + gap;
|
|
11
|
-
const initialDelay = 300;
|
|
12
|
-
const interBounceDelay = 150;
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<svg
|
|
16
|
-
viewBox={`0 0 ${width} ${height}`}
|
|
17
|
-
width={width}
|
|
18
|
-
height={height}
|
|
19
|
-
className={props.className}
|
|
20
|
-
preserveAspectRatio="xMidYMid meet"
|
|
21
|
-
>
|
|
22
|
-
<g stroke="none" fill="inherit">
|
|
23
|
-
{Array.from({ length: 3 }, (_, index) => {
|
|
24
|
-
const delay = `${initialDelay + interBounceDelay * index}ms`;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<circle
|
|
28
|
-
key={index}
|
|
29
|
-
cx={radius * (index + 1) + gap * index}
|
|
30
|
-
cy={cy}
|
|
31
|
-
r={radius}
|
|
32
|
-
className={dot}
|
|
33
|
-
style={assignInlineVars({ [animationDelay]: delay })}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
})}
|
|
37
|
-
</g>
|
|
38
|
-
</svg>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import preview from "../../.storybook/preview.tsx";
|
|
2
|
-
import { MiddotSeparated } from "./MiddotSeparated.tsx";
|
|
3
|
-
|
|
4
|
-
const meta = preview.meta({
|
|
5
|
-
title: "Components/Middot Separated",
|
|
6
|
-
component: MiddotSeparated,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The default case in which all steps of the flow succeed.
|
|
12
|
-
*/
|
|
13
|
-
export const Default = meta.story({
|
|
14
|
-
args: {
|
|
15
|
-
children: ["Lorem", "Ipsum", " Dolor"],
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Edge case when it comes to handling children in React.
|
|
21
|
-
*/
|
|
22
|
-
export const SingleElement = meta.story({
|
|
23
|
-
args: {
|
|
24
|
-
children: "Lorem",
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type HTMLAttributes, Children } from "react";
|
|
2
|
-
import { withMiddlot } from "./style.css.ts";
|
|
3
|
-
|
|
4
|
-
type MiddotSeparatedProps = HTMLAttributes<HTMLDivElement>;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A utility component that wraps children into spans and adds middledots
|
|
8
|
-
* between each item using CSS ::before pseudo elements.
|
|
9
|
-
*/
|
|
10
|
-
export function MiddotSeparated(props: MiddotSeparatedProps) {
|
|
11
|
-
const { children, ...divProps } = props;
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div {...divProps}>
|
|
15
|
-
{Children.toArray(children)
|
|
16
|
-
.filter((item) => item !== "")
|
|
17
|
-
.map((item, index) => {
|
|
18
|
-
return (
|
|
19
|
-
<span className={withMiddlot} key={index}>
|
|
20
|
-
{item}
|
|
21
|
-
</span>
|
|
22
|
-
);
|
|
23
|
-
})}
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Dialog, type DialogProps } from "@ariakit/react";
|
|
2
|
-
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
3
|
-
import type { ReactNode } from "react";
|
|
4
|
-
import { cx } from "../class-names.ts";
|
|
5
|
-
import * as css from "./style.css.ts";
|
|
6
|
-
|
|
7
|
-
type Size = NonNullable<NonNullable<RecipeVariants<typeof css.dialog>>["size"]>;
|
|
8
|
-
|
|
9
|
-
export type ModalDialogProps = Omit<DialogProps, "modal" | "backdrop"> & {
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
size: Size;
|
|
12
|
-
backdropClassName?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function ModalDialog(props: ModalDialogProps) {
|
|
16
|
-
const { size, backdropClassName, className, ...dialogProps } = props;
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<Dialog
|
|
20
|
-
{...dialogProps}
|
|
21
|
-
{...cx(className, css.dialog({ size }))}
|
|
22
|
-
backdrop={<div {...cx(css.backdrop, backdropClassName)} />}
|
|
23
|
-
modal
|
|
24
|
-
>
|
|
25
|
-
{props.children}
|
|
26
|
-
</Dialog>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { style } from "@vanilla-extract/css";
|
|
2
|
-
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
-
import { MinWidth } from "../media.ts";
|
|
4
|
-
import { ZIndex } from "../vars.css.ts";
|
|
5
|
-
|
|
6
|
-
const scaleTransition = {
|
|
7
|
-
transition: "transform 200ms, opacity 200ms",
|
|
8
|
-
transform: "scale(1.1)",
|
|
9
|
-
|
|
10
|
-
selectors: {
|
|
11
|
-
"&[data-enter]": {
|
|
12
|
-
opacity: 1,
|
|
13
|
-
transform: "scale(1)",
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
"&[data-leave]": {
|
|
17
|
-
opacity: 0,
|
|
18
|
-
transform: "scale(0.9)",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const translateTransition = {
|
|
24
|
-
transition: "transform 200ms, opacity 200ms",
|
|
25
|
-
transform: "translateY(5rem)",
|
|
26
|
-
|
|
27
|
-
selectors: {
|
|
28
|
-
"&[data-enter]": {
|
|
29
|
-
opacity: 1,
|
|
30
|
-
transform: "translateY(0)",
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
"&[data-leave]": {
|
|
34
|
-
opacity: 0,
|
|
35
|
-
transform: "translateY(5rem)",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const dialog = recipe({
|
|
41
|
-
base: {
|
|
42
|
-
position: "fixed",
|
|
43
|
-
inset: 0,
|
|
44
|
-
zIndex: ZIndex.DIALOG,
|
|
45
|
-
margin: "auto",
|
|
46
|
-
overflow: "auto",
|
|
47
|
-
opacity: 0,
|
|
48
|
-
backgroundColor: "white",
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
variants: {
|
|
52
|
-
size: {
|
|
53
|
-
large: {
|
|
54
|
-
...translateTransition,
|
|
55
|
-
inlineSize: "100%",
|
|
56
|
-
blockSize: "100%",
|
|
57
|
-
|
|
58
|
-
"@media": {
|
|
59
|
-
[MinWidth.MEDIUM]: {
|
|
60
|
-
...scaleTransition,
|
|
61
|
-
blockSize: "fit-content",
|
|
62
|
-
maxInlineSize: "40rem",
|
|
63
|
-
maxBlockSize: "90%",
|
|
64
|
-
borderRadius: "1rem",
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
small: {
|
|
70
|
-
...scaleTransition,
|
|
71
|
-
inlineSize: "min(24rem, 90svw)",
|
|
72
|
-
blockSize: "fit-content",
|
|
73
|
-
borderRadius: "1rem",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export const backdrop = style({
|
|
80
|
-
backgroundColor: "black",
|
|
81
|
-
opacity: 0,
|
|
82
|
-
transition: "opacity 200ms",
|
|
83
|
-
selectors: {
|
|
84
|
-
"&[data-enter]": {
|
|
85
|
-
opacity: 0.4,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
});
|
package/lib/ModernIDB/Cursor.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
2
|
-
|
|
3
|
-
import { requestToPromise } from "./utils.ts";
|
|
4
|
-
|
|
5
|
-
export class Cursor<C extends IDBCursor = IDBCursor> {
|
|
6
|
-
idbCursor: C;
|
|
7
|
-
|
|
8
|
-
constructor(idbCursor: C) {
|
|
9
|
-
this.idbCursor = idbCursor;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
get key() {
|
|
13
|
-
return this.idbCursor.key;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
get primaryKey() {
|
|
17
|
-
return this.idbCursor.primaryKey;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get direction() {
|
|
21
|
-
return this.idbCursor.direction;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Advances the cursor through the next count records in range.
|
|
26
|
-
*
|
|
27
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBCursor/advance
|
|
28
|
-
*/
|
|
29
|
-
advance(count: number): void {
|
|
30
|
-
this.idbCursor.advance(count);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Advances the cursor to the next record in range.
|
|
34
|
-
*
|
|
35
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBCursor/continue)
|
|
36
|
-
*/
|
|
37
|
-
continue(key?: IDBValidKey): void {
|
|
38
|
-
this.idbCursor.continue(key);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class CursorWithValue<Item> extends Cursor<IDBCursorWithValue> {
|
|
43
|
-
get value(): Item {
|
|
44
|
-
return this.idbCursor.value;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Delete the record pointed at by the cursor.
|
|
49
|
-
*
|
|
50
|
-
* If successful, request's result will be undefined.
|
|
51
|
-
*
|
|
52
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBCursor/delete)
|
|
53
|
-
*/
|
|
54
|
-
delete(): Promise<undefined> {
|
|
55
|
-
return requestToPromise(this.idbCursor.delete());
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Updated the record pointed at by the cursor with a new value.
|
|
59
|
-
*
|
|
60
|
-
* Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed.
|
|
61
|
-
*
|
|
62
|
-
* If successful, request's result will be the record's key.
|
|
63
|
-
*
|
|
64
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBCursor/update)
|
|
65
|
-
*/
|
|
66
|
-
update(value: Item): Promise<IDBValidKey> {
|
|
67
|
-
return requestToPromise(this.idbCursor.update(value));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export class IndexCursor extends Cursor {
|
|
72
|
-
/**
|
|
73
|
-
* Advances the cursor to the next record in range matching or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.
|
|
74
|
-
*
|
|
75
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBCursor/continuePrimaryKey)
|
|
76
|
-
*/
|
|
77
|
-
continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void {
|
|
78
|
-
this.idbCursor.continuePrimaryKey(key, primaryKey);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export class IndexCursorWithValue<Item> extends CursorWithValue<Item> {
|
|
83
|
-
/**
|
|
84
|
-
* Advances the cursor to the next record in range matching or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.
|
|
85
|
-
*
|
|
86
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBCursor/continuePrimaryKey)
|
|
87
|
-
*/
|
|
88
|
-
continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void {
|
|
89
|
-
this.idbCursor.continuePrimaryKey(key, primaryKey);
|
|
90
|
-
}
|
|
91
|
-
}
|