@nobak/design-system 1.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/LICENSE +73 -0
- package/README.md +142 -0
- package/lib/assets/icons.js +67 -0
- package/lib/components/AccountOverview/AccountOverview.js +122 -0
- package/lib/components/AdminPanel.js +58 -0
- package/lib/components/AssetExchange/AssetExchange.js +189 -0
- package/lib/components/AuthenticationFlow.js +216 -0
- package/lib/components/ConversationInterface/ConversationInterface.js +232 -0
- package/lib/components/DevFooter.js +38 -0
- package/lib/components/DevMenu.js +35 -0
- package/lib/components/DevSidebar.js +28 -0
- package/lib/components/DigitalDisplay.js +83 -0
- package/lib/components/Footer.js +45 -0
- package/lib/components/HeroContainer.js +10 -0
- package/lib/components/IntentRecognition/IntentRecognition.js +174 -0
- package/lib/components/Logo.js +259 -0
- package/lib/components/MenuBar.js +56 -0
- package/lib/components/NetworkSettings.js +223 -0
- package/lib/components/RecoverySetup/RecoverySetup.js +354 -0
- package/lib/components/RisingSun.js +122 -0
- package/lib/components/Symbol.js +226 -0
- package/lib/components/TransactionComposer/TransactionComposer.js +258 -0
- package/lib/components/TransactionConfirmation.js +184 -0
- package/lib/components/WalletMenu.js +33 -0
- package/lib/components/console/code/CodeBlock.js +150 -0
- package/lib/components/console/code/index.js +9 -0
- package/lib/components/console/data/DataTable.js +245 -0
- package/lib/components/console/data/MetricCard.js +79 -0
- package/lib/components/console/data/index.js +11 -0
- package/lib/components/console/documentation/index.js +10 -0
- package/lib/components/console/forms/APIKeyGenerator.js +261 -0
- package/lib/components/console/forms/SearchBar.js +210 -0
- package/lib/components/console/forms/index.js +10 -0
- package/lib/components/console/index.js +29 -0
- package/lib/components/console/layout/ConsoleCard.js +82 -0
- package/lib/components/console/layout/ConsoleLayout.js +86 -0
- package/lib/components/console/layout/index.js +10 -0
- package/lib/components/console/monitoring/StatusIndicator.js +128 -0
- package/lib/components/console/monitoring/index.js +9 -0
- package/lib/components/console/navigation/DevFooter.js +38 -0
- package/lib/components/console/navigation/DevMenu.js +35 -0
- package/lib/components/console/navigation/DevSidebar.js +28 -0
- package/lib/components/console/navigation/index.js +11 -0
- package/lib/components/console/settings/index.js +10 -0
- package/lib/components/index.js +12 -0
- package/lib/design/ColorPicker.stories.js +9 -0
- package/lib/design/HSLTool-V1.js +345 -0
- package/lib/design/HSLTool-V2.js +475 -0
- package/lib/design/HSLTool-V3.js +543 -0
- package/lib/design/HSLTool-V4.js +1139 -0
- package/lib/design/HSLTool.js +374 -0
- package/lib/design/OKLCHColorPicker.stories.js +24 -0
- package/lib/design/OKLCHTool.js +1014 -0
- package/lib/index.js +4 -0
- package/lib/shared/components/Avatar/Avatar.js +18 -0
- package/lib/shared/components/Avatar/index.js +1 -0
- package/lib/shared/components/Badge/Badge.js +34 -0
- package/lib/shared/components/Badge/index.js +1 -0
- package/lib/shared/components/Breadcrumb/Breadcrumb.js +13 -0
- package/lib/shared/components/Breadcrumb/index.js +1 -0
- package/lib/shared/components/Button/Button.js +184 -0
- package/lib/shared/components/Button/index.js +1 -0
- package/lib/shared/components/Calendar/Calendar.js +155 -0
- package/lib/shared/components/Calendar/CalendarDay.js +251 -0
- package/lib/shared/components/Calendar/CalendarHeader.js +88 -0
- package/lib/shared/components/Calendar/CalendarMonth.js +106 -0
- package/lib/shared/components/Calendar/CalendarWeek.js +267 -0
- package/lib/shared/components/Calendar/constants.js +73 -0
- package/lib/shared/components/Calendar/index.js +3 -0
- package/lib/shared/components/Calendar/types.d.js +0 -0
- package/lib/shared/components/Cartel/Cartel.js +44 -0
- package/lib/shared/components/Cartel/index.js +1 -0
- package/lib/shared/components/Cell/Cell.js +105 -0
- package/lib/shared/components/Cell/index.js +1 -0
- package/lib/shared/components/Checkbox/Checkbox.js +27 -0
- package/lib/shared/components/Checkbox/index.js +1 -0
- package/lib/shared/components/Clock/Clock.js +6 -0
- package/lib/shared/components/Clock/index.js +1 -0
- package/lib/shared/components/ColorChecker/ColorChecker.js +89 -0
- package/lib/shared/components/ColorChecker/index.js +2 -0
- package/lib/shared/components/ColorChecker/utils.js +159 -0
- package/lib/shared/components/Command/Command.js +95 -0
- package/lib/shared/components/Command/index.js +1 -0
- package/lib/shared/components/Container/Container.js +18 -0
- package/lib/shared/components/Container/index.js +1 -0
- package/lib/shared/components/Cover/Cover.js +17 -0
- package/lib/shared/components/Cover/index.js +1 -0
- package/lib/shared/components/DatePicker/DatePicker.js +52 -0
- package/lib/shared/components/DatePicker/components/Calendar.js +125 -0
- package/lib/shared/components/DatePicker/components/CalendarDay.js +23 -0
- package/lib/shared/components/DatePicker/components/DateWrapper.js +15 -0
- package/lib/shared/components/DatePicker/components/index.js +2 -0
- package/lib/shared/components/DatePicker/index.js +1 -0
- package/lib/shared/components/DateTime/DateTime.js +51 -0
- package/lib/shared/components/DateTime/index.js +1 -0
- package/lib/shared/components/Debug/Debug.js +12 -0
- package/lib/shared/components/Debug/index.js +1 -0
- package/lib/shared/components/Disclosure/Disclosure.js +31 -0
- package/lib/shared/components/Disclosure/index.js +1 -0
- package/lib/shared/components/Dropdown/Dropdown.js +91 -0
- package/lib/shared/components/Dropdown/index.js +1 -0
- package/lib/shared/components/EmptyState/EmptyState.js +40 -0
- package/lib/shared/components/EmptyState/index.js +1 -0
- package/lib/shared/components/Form/Form.js +41 -0
- package/lib/shared/components/Form/components/DynamicForm.js +66 -0
- package/lib/shared/components/Form/components/StepperForm.js +266 -0
- package/lib/shared/components/Form/components/index.js +2 -0
- package/lib/shared/components/Form/context/Form.js +164 -0
- package/lib/shared/components/Form/context/index.js +1 -0
- package/lib/shared/components/Form/index.js +1 -0
- package/lib/shared/components/Form/types.d.js +1 -0
- package/lib/shared/components/Form/utils/index.js +31 -0
- package/lib/shared/components/GroupItems/GroupItems.js +17 -0
- package/lib/shared/components/GroupItems/index.js +1 -0
- package/lib/shared/components/Header/Header.js +26 -0
- package/lib/shared/components/Header/index.js +1 -0
- package/lib/shared/components/Heading/Heading.js +5 -0
- package/lib/shared/components/Heading/index.js +1 -0
- package/lib/shared/components/Icon/Icon.js +28 -0
- package/lib/shared/components/Icon/index.js +1 -0
- package/lib/shared/components/Identicons/Identicons.js +6 -0
- package/lib/shared/components/Identicons/index.d.js +0 -0
- package/lib/shared/components/Identicons/index.js +1 -0
- package/lib/shared/components/Image/Image.js +22 -0
- package/lib/shared/components/Image/index.js +1 -0
- package/lib/shared/components/Input/Input.js +201 -0
- package/lib/shared/components/Input/components/CheckBoxInput.js +81 -0
- package/lib/shared/components/Input/components/DateInput.js +89 -0
- package/lib/shared/components/Input/components/DefaultInput.js +102 -0
- package/lib/shared/components/Input/components/FileReaderInput.js +88 -0
- package/lib/shared/components/Input/components/NumberInput.js +141 -0
- package/lib/shared/components/Input/components/PickerInput.js +122 -0
- package/lib/shared/components/Input/components/RCInput.js +112 -0
- package/lib/shared/components/Input/components/Radiobox/RadioboxBasic.js +56 -0
- package/lib/shared/components/Input/components/Radiobox/RadioboxCard.js +27 -0
- package/lib/shared/components/Input/components/Radiobox/RadioboxFull.js +44 -0
- package/lib/shared/components/Input/components/Radiobox/index.js +3 -0
- package/lib/shared/components/Input/components/RadioboxInput.js +102 -0
- package/lib/shared/components/Input/components/SelectInput.js +70 -0
- package/lib/shared/components/Input/components/TextAreaInput.js +67 -0
- package/lib/shared/components/Input/components/TextInput.js +139 -0
- package/lib/shared/components/Input/components/TimeInput.js +37 -0
- package/lib/shared/components/Input/components/UploadFileInput.js +123 -0
- package/lib/shared/components/Input/components/index.js +13 -0
- package/lib/shared/components/Input/components/types.d.js +0 -0
- package/lib/shared/components/Input/index.js +1 -0
- package/lib/shared/components/Input/types.d.js +0 -0
- package/lib/shared/components/Layout/Layout.js +13 -0
- package/lib/shared/components/Layout/index.js +1 -0
- package/lib/shared/components/List/List.js +30 -0
- package/lib/shared/components/List/index.js +1 -0
- package/lib/shared/components/Loader/Loader.js +27 -0
- package/lib/shared/components/Loader/index.js +1 -0
- package/lib/shared/components/Modal/Modal.js +102 -0
- package/lib/shared/components/Modal/index.js +1 -0
- package/lib/shared/components/Notification/Notification.js +39 -0
- package/lib/shared/components/Notification/index.js +1 -0
- package/lib/shared/components/Person/Person.js +81 -0
- package/lib/shared/components/Person/index.js +1 -0
- package/lib/shared/components/Popover/Popover.js +39 -0
- package/lib/shared/components/Popover/index.js +1 -0
- package/lib/shared/components/QRCode/QRCode.js +329 -0
- package/lib/shared/components/QRCode/index.js +1 -0
- package/lib/shared/components/RadioGroup/RadioGroup.js +35 -0
- package/lib/shared/components/RadioGroup/components/DefaultGroup.js +71 -0
- package/lib/shared/components/RadioGroup/components/VerticalGroup.js +83 -0
- package/lib/shared/components/RadioGroup/components/index.js +2 -0
- package/lib/shared/components/RadioGroup/index.js +1 -0
- package/lib/shared/components/Search/Search.js +12 -0
- package/lib/shared/components/Search/index.js +1 -0
- package/lib/shared/components/Select/Select.js +90 -0
- package/lib/shared/components/Select/index.js +1 -0
- package/lib/shared/components/Sidebar/Sidebar.js +42 -0
- package/lib/shared/components/Sidebar/index.js +1 -0
- package/lib/shared/components/SlideOver/SlideOver.js +81 -0
- package/lib/shared/components/SlideOver/index.js +1 -0
- package/lib/shared/components/Slider/Slider.js +80 -0
- package/lib/shared/components/Slider/index.js +1 -0
- package/lib/shared/components/Stepper/Stepper.js +32 -0
- package/lib/shared/components/Stepper/index.js +1 -0
- package/lib/shared/components/Steps/Steps.js +53 -0
- package/lib/shared/components/Steps/index.js +1 -0
- package/lib/shared/components/Switch/Switch.js +26 -0
- package/lib/shared/components/Switch/index.js +1 -0
- package/lib/shared/components/Tab/Tab.js +59 -0
- package/lib/shared/components/Tab/index.js +1 -0
- package/lib/shared/components/Table/Table.js +47 -0
- package/lib/shared/components/Table/index.js +1 -0
- package/lib/shared/components/Text/Text.js +11 -0
- package/lib/shared/components/Text/index.js +1 -0
- package/lib/shared/components/TextList/TextList.js +15 -0
- package/lib/shared/components/TextList/index.js +1 -0
- package/lib/shared/components/TimePicker/TimePicker.js +161 -0
- package/lib/shared/components/TimePicker/index.js +1 -0
- package/lib/shared/components/Tooltip/Tooltip.js +13 -0
- package/lib/shared/components/Tooltip/index.js +1 -0
- package/lib/shared/components/Uploader/Uploader.js +63 -0
- package/lib/shared/components/Uploader/index.js +1 -0
- package/lib/shared/components/Video/Video.js +20 -0
- package/lib/shared/components/Video/index.js +1 -0
- package/lib/shared/components/index.d.js +0 -0
- package/lib/shared/components/index.js +50 -0
- package/lib/shared/elements/Color/ColorPallet.js +20 -0
- package/lib/shared/elements/Color/index.js +1 -0
- package/lib/shared/elements/Text.js +37 -0
- package/lib/shared/elements/index.js +1 -0
- package/lib/shared/helpers/FakeLink.js +8 -0
- package/lib/shared/helpers/constants.js +359 -0
- package/lib/shared/helpers/index.js +2 -0
- package/lib/shared/helpers/isEqual.js +56 -0
- package/lib/shared/index.d.js +0 -0
- package/lib/shared/index.js +1 -0
- package/lib/shared/stories/components/Avatar.stories.js +17 -0
- package/lib/shared/stories/components/Badge.stories.dev.js +37 -0
- package/lib/shared/stories/components/Button.stories.js +553 -0
- package/lib/shared/stories/components/Calendar.stories.js +62 -0
- package/lib/shared/stories/components/Cartel.stories.js +32 -0
- package/lib/shared/stories/components/Checkbox.stories.js +15 -0
- package/lib/shared/stories/components/ColorChecker.stories.dev.js +16 -0
- package/lib/shared/stories/components/DateTime.stories.js +27 -0
- package/lib/shared/stories/components/Disclosure.stories.js +30 -0
- package/lib/shared/stories/components/Dropdown.stories.js +39 -0
- package/lib/shared/stories/components/Form/Default.stories.js +201 -0
- package/lib/shared/stories/components/Form/DummyForm.stories.js +48 -0
- package/lib/shared/stories/components/Form/DynamicForm.stories.js +155 -0
- package/lib/shared/stories/components/Form/StepperForm.stories.js +138 -0
- package/lib/shared/stories/components/Form/ValidateForm.stories.js +70 -0
- package/lib/shared/stories/components/Form/Validation.stories.js +184 -0
- package/lib/shared/stories/components/GroupItems.stories.js +23 -0
- package/lib/shared/stories/components/Header.stories.js +29 -0
- package/lib/shared/stories/components/Heading.stories.js +27 -0
- package/lib/shared/stories/components/Icon.stories.js +22 -0
- package/lib/shared/stories/components/Image.stories.js +23 -0
- package/lib/shared/stories/components/Input/Checkbox.stories.js +45 -0
- package/lib/shared/stories/components/Input/DatePicker.stories.js +23 -0
- package/lib/shared/stories/components/Input/Defaut.stories.js +24 -0
- package/lib/shared/stories/components/Input/Number.stories.js +24 -0
- package/lib/shared/stories/components/Input/RCI.stories.js +59 -0
- package/lib/shared/stories/components/Input/Radiobox.stories.dev.js +28 -0
- package/lib/shared/stories/components/Input/Select.stories.dev.js +27 -0
- package/lib/shared/stories/components/Input/SelectMultiple.stories.dev.js +510 -0
- package/lib/shared/stories/components/Input/Textarea.stories.js +24 -0
- package/lib/shared/stories/components/List.stories.js +34 -0
- package/lib/shared/stories/components/Loader.stories.js +15 -0
- package/lib/shared/stories/components/Modal.stories.js +50 -0
- package/lib/shared/stories/components/Notification.stories.js +22 -0
- package/lib/shared/stories/components/Person.stories.js +41 -0
- package/lib/shared/stories/components/Picker.stories.js +15 -0
- package/lib/shared/stories/components/Popover.stories.js +36 -0
- package/lib/shared/stories/components/QRCode.stories.js +20 -0
- package/lib/shared/stories/components/RadioGroup.stories.js +56 -0
- package/lib/shared/stories/components/Select.stories.js +50 -0
- package/lib/shared/stories/components/Sidebar.stories.js +35 -0
- package/lib/shared/stories/components/Slider.stories.dev.js +48 -0
- package/lib/shared/stories/components/Stepper/Stepper.stories.js +38 -0
- package/lib/shared/stories/components/Steps.stories.js +15 -0
- package/lib/shared/stories/components/Switch.stories.js +15 -0
- package/lib/shared/stories/components/Tab.stories.js +15 -0
- package/lib/shared/stories/components/Table.stories.js +95 -0
- package/lib/shared/stories/components/TextList.stories.js +23 -0
- package/lib/shared/stories/components/Tooltip.stories.dev.js +40 -0
- package/lib/shared/stories/elements/Color.stories.js +269 -0
- package/lib/shared/stories/elements/Text.stories.js +45 -0
- package/lib/shared/types/index.js +1 -0
- package/lib/stories/Foundation/BrandIdentity.prod.stories.js +510 -0
- package/lib/stories/Foundation/Logo.stories.js +19 -0
- package/lib/stories/Foundation/RisingSun.stories.js +16 -0
- package/lib/stories/Foundation/Shadows.stories.js +601 -0
- package/lib/stories/Foundation/Symbol.stories.js +18 -0
- package/lib/stories/HeroContainer.stories.js +18 -0
- package/lib/styles/accessibilityTokens.js +72 -0
- package/lib/styles/borderWidth.js +10 -0
- package/lib/styles/colors.js +303 -0
- package/lib/styles/elevation.js +240 -0
- package/lib/styles/icons.js +218 -0
- package/lib/styles/index.js +29 -0
- package/lib/styles/motion.js +668 -0
- package/lib/styles/opacity.js +10 -0
- package/lib/styles/radius.js +11 -0
- package/lib/styles/sizing.js +35 -0
- package/lib/styles/space.js +24 -0
- package/lib/styles/theme/darkTheme.js +471 -0
- package/lib/styles/theme/index.js +44 -0
- package/lib/styles/theme/lightTheme.js +480 -0
- package/lib/styles/theme/themeTypes.js +1 -0
- package/lib/styles/theme/themeUtils.js +63 -0
- package/lib/styles/typography-advanced.js +510 -0
- package/lib/styles/typography.js +1419 -0
- package/lib/styles/zIndex.js +19 -0
- package/lib/tokens/borders.js +161 -0
- package/lib/tokens/colors.js +426 -0
- package/lib/tokens/components.js +499 -0
- package/lib/tokens/index.js +84 -0
- package/lib/tokens/lighting.js +384 -0
- package/lib/tokens/motion.js +284 -0
- package/lib/tokens/semantic.js +367 -0
- package/lib/tokens/shadows.js +114 -0
- package/lib/tokens/spacing.js +189 -0
- package/lib/tokens/typography.js +268 -0
- package/package.json +176 -0
- package/styles/generated-tokens.css +677 -0
- package/styles/index.css +2 -0
- package/styles/main.css +610 -0
- package/tailwind.config.js +64 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { Stepper } from "../../shared/components/navigation/Stepper/Stepper";
|
|
9
|
+
import { Form } from "../../shared/components/forms/Form/Form";
|
|
10
|
+
import { Input } from "../../shared/components/forms/Input/Input";
|
|
11
|
+
import { Button } from "../../shared/elements/Button/Button";
|
|
12
|
+
import { Text } from "../../shared/elements/Text/Text";
|
|
13
|
+
import { Badge } from "../../shared/elements/Badge/Badge";
|
|
14
|
+
|
|
15
|
+
// Placeholder for RCIInput and DigitalDisplay
|
|
16
|
+
var RCIInput = function RCIInput(props) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(Input, props);
|
|
18
|
+
};
|
|
19
|
+
var DigitalDisplay = function DigitalDisplay(_ref) {
|
|
20
|
+
var value = _ref.value;
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "bg-neutral-100 rounded-lg p-4 font-mono text-lg text-center mb-2"
|
|
23
|
+
}, value);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Step 1: Intro
|
|
27
|
+
var IntroStep = function IntroStep(_ref2) {
|
|
28
|
+
var onNext = _ref2.onNext;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
30
|
+
content: "Set up account recovery to protect your Nobak Wallet.",
|
|
31
|
+
fontSize: ": "
|
|
32
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
33
|
+
content: "Choose one or more secure recovery methods. This helps you regain access if you lose your device or credentials.",
|
|
34
|
+
fontSize: ": "
|
|
35
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "mt-4 flex flex-col gap-2"
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Badge, {
|
|
38
|
+
title: "Recovery Phrase",
|
|
39
|
+
variant: "primary",
|
|
40
|
+
size: "small"
|
|
41
|
+
}), /*#__PURE__*/React.createElement(Badge, {
|
|
42
|
+
title: "Email Recovery",
|
|
43
|
+
variant: "secondary",
|
|
44
|
+
size: "small"
|
|
45
|
+
}), /*#__PURE__*/React.createElement(Badge, {
|
|
46
|
+
title: "Authenticator App (Optional)",
|
|
47
|
+
variant: "basic",
|
|
48
|
+
size: "small"
|
|
49
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
text: "Start",
|
|
51
|
+
variant: "primary",
|
|
52
|
+
onClick: onNext
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Step 2: Recovery Phrase
|
|
57
|
+
var RecoveryPhraseStep = function RecoveryPhraseStep(_ref3) {
|
|
58
|
+
var phraseVerified = _ref3.phraseVerified,
|
|
59
|
+
verifyPhrase = _ref3.verifyPhrase,
|
|
60
|
+
onNext = _ref3.onNext,
|
|
61
|
+
onBack = _ref3.onBack;
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
63
|
+
content: "Backup Recovery Phrase",
|
|
64
|
+
fontSize: ": "
|
|
65
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
66
|
+
content: "Write down your secret phrase and keep it safe. You'll need to verify it next.",
|
|
67
|
+
fontSize: ": "
|
|
68
|
+
}), /*#__PURE__*/React.createElement(DigitalDisplay, {
|
|
69
|
+
value: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
|
|
70
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
71
|
+
placeholder: "Type your recovery phrase to verify",
|
|
72
|
+
onChange: function onChange(e) {
|
|
73
|
+
return verifyPhrase(e.target.value);
|
|
74
|
+
}
|
|
75
|
+
}), phraseVerified && /*#__PURE__*/React.createElement(Badge, {
|
|
76
|
+
title: "Verified",
|
|
77
|
+
variant: "positive",
|
|
78
|
+
size: "small"
|
|
79
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
80
|
+
text: "Next",
|
|
81
|
+
variant: "primary",
|
|
82
|
+
onClick: onNext,
|
|
83
|
+
disabled: !phraseVerified
|
|
84
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
85
|
+
text: "Back",
|
|
86
|
+
variant: "basic",
|
|
87
|
+
onClick: onBack
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// Step 3: Email Recovery
|
|
92
|
+
var EmailRecoveryStep = function EmailRecoveryStep(_ref4) {
|
|
93
|
+
var email = _ref4.email,
|
|
94
|
+
setEmail = _ref4.setEmail,
|
|
95
|
+
emailError = _ref4.emailError,
|
|
96
|
+
emailSent = _ref4.emailSent,
|
|
97
|
+
sendEmailCode = _ref4.sendEmailCode,
|
|
98
|
+
emailCode = _ref4.emailCode,
|
|
99
|
+
setEmailCode = _ref4.setEmailCode,
|
|
100
|
+
verifyEmailCode = _ref4.verifyEmailCode,
|
|
101
|
+
onBack = _ref4.onBack;
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
103
|
+
content: "Set Up Email Recovery",
|
|
104
|
+
fontSize: ": "
|
|
105
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
106
|
+
content: "We'll send a code to your email to verify ownership.",
|
|
107
|
+
fontSize: ": "
|
|
108
|
+
}), /*#__PURE__*/React.createElement(Form, {
|
|
109
|
+
fields: [{
|
|
110
|
+
field: {
|
|
111
|
+
type: 'email',
|
|
112
|
+
label: 'Email',
|
|
113
|
+
value: email,
|
|
114
|
+
onChange: function onChange(e) {
|
|
115
|
+
return setEmail(e.target.value);
|
|
116
|
+
},
|
|
117
|
+
error: emailError
|
|
118
|
+
}
|
|
119
|
+
}],
|
|
120
|
+
onSubmit: sendEmailCode,
|
|
121
|
+
submitLabel: emailSent ? 'Resend Code' : 'Send Code'
|
|
122
|
+
}), emailSent && /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: "mt-4"
|
|
124
|
+
}, /*#__PURE__*/React.createElement(RCIInput, {
|
|
125
|
+
placeholder: "Enter verification code",
|
|
126
|
+
onChange: function onChange(e) {
|
|
127
|
+
return setEmailCode(e.target.value);
|
|
128
|
+
},
|
|
129
|
+
error: emailError
|
|
130
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
131
|
+
text: "Verify Code",
|
|
132
|
+
variant: "primary",
|
|
133
|
+
onClick: verifyEmailCode
|
|
134
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
135
|
+
text: "Back",
|
|
136
|
+
variant: "basic",
|
|
137
|
+
onClick: onBack
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Step 4: Additional Security
|
|
142
|
+
var AdditionalSecurityStep = function AdditionalSecurityStep(_ref5) {
|
|
143
|
+
var showOtp = _ref5.showOtp,
|
|
144
|
+
setShowOtp = _ref5.setShowOtp,
|
|
145
|
+
otp = _ref5.otp,
|
|
146
|
+
setOtp = _ref5.setOtp,
|
|
147
|
+
otpError = _ref5.otpError,
|
|
148
|
+
verifyOtp = _ref5.verifyOtp,
|
|
149
|
+
onNext = _ref5.onNext,
|
|
150
|
+
onBack = _ref5.onBack;
|
|
151
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
152
|
+
content: "Add Extra Security (Optional)",
|
|
153
|
+
fontSize: ": "
|
|
154
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
155
|
+
content: "Protect your account with an authenticator app (TOTP).",
|
|
156
|
+
fontSize: ": "
|
|
157
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
158
|
+
text: showOtp ? 'Hide Authenticator' : 'Add Authenticator',
|
|
159
|
+
variant: "secondary",
|
|
160
|
+
onClick: function onClick() {
|
|
161
|
+
return setShowOtp(function (v) {
|
|
162
|
+
return !v;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}), showOtp && /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
className: "mt-4"
|
|
167
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
168
|
+
content: "Scan the QR code with your authenticator app, then enter the 6-digit code.",
|
|
169
|
+
fontSize: ": "
|
|
170
|
+
}), /*#__PURE__*/React.createElement(DigitalDisplay, {
|
|
171
|
+
value: "otpauth://totp/Nobak:demo?secret=SECRETKEY"
|
|
172
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
173
|
+
placeholder: "Enter 6-digit code",
|
|
174
|
+
onChange: function onChange(e) {
|
|
175
|
+
return setOtp(e.target.value);
|
|
176
|
+
},
|
|
177
|
+
error: otpError
|
|
178
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
179
|
+
text: "Verify Code",
|
|
180
|
+
variant: "primary",
|
|
181
|
+
onClick: verifyOtp
|
|
182
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
183
|
+
text: "Next",
|
|
184
|
+
variant: "primary",
|
|
185
|
+
onClick: onNext
|
|
186
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
187
|
+
text: "Back",
|
|
188
|
+
variant: "basic",
|
|
189
|
+
onClick: onBack
|
|
190
|
+
}));
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// Step 5: Confirmation
|
|
194
|
+
var ConfirmationStep = function ConfirmationStep(_ref6) {
|
|
195
|
+
var onRestart = _ref6.onRestart;
|
|
196
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
197
|
+
className: "flex flex-col items-center"
|
|
198
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
199
|
+
content: "Recovery Setup Complete!",
|
|
200
|
+
fontSize: ": "
|
|
201
|
+
}), /*#__PURE__*/React.createElement(Badge, {
|
|
202
|
+
title: "All Set",
|
|
203
|
+
variant: "positive",
|
|
204
|
+
size: "medium"
|
|
205
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
206
|
+
content: "Your account is protected. Keep your recovery methods safe.",
|
|
207
|
+
fontSize: ": "
|
|
208
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
209
|
+
text: "Finish",
|
|
210
|
+
variant: "primary",
|
|
211
|
+
onClick: onRestart
|
|
212
|
+
}));
|
|
213
|
+
};
|
|
214
|
+
export var RecoverySetup = function RecoverySetup() {
|
|
215
|
+
var _useState = useState(0),
|
|
216
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
217
|
+
step = _useState2[0],
|
|
218
|
+
setStep = _useState2[1];
|
|
219
|
+
var _useState3 = useState(false),
|
|
220
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
221
|
+
phraseVerified = _useState4[0],
|
|
222
|
+
setPhraseVerified = _useState4[1];
|
|
223
|
+
var _useState5 = useState(''),
|
|
224
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
225
|
+
email = _useState6[0],
|
|
226
|
+
setEmail = _useState6[1];
|
|
227
|
+
var _useState7 = useState(''),
|
|
228
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
229
|
+
emailCode = _useState8[0],
|
|
230
|
+
setEmailCode = _useState8[1];
|
|
231
|
+
var _useState9 = useState(false),
|
|
232
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
233
|
+
emailSent = _useState0[0],
|
|
234
|
+
setEmailSent = _useState0[1];
|
|
235
|
+
var _useState1 = useState(''),
|
|
236
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
237
|
+
emailError = _useState10[0],
|
|
238
|
+
setEmailError = _useState10[1];
|
|
239
|
+
var _useState11 = useState(''),
|
|
240
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
241
|
+
otp = _useState12[0],
|
|
242
|
+
setOtp = _useState12[1];
|
|
243
|
+
var _useState13 = useState(''),
|
|
244
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
245
|
+
otpError = _useState14[0],
|
|
246
|
+
setOtpError = _useState14[1];
|
|
247
|
+
var _useState15 = useState(false),
|
|
248
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
249
|
+
showOtp = _useState16[0],
|
|
250
|
+
setShowOtp = _useState16[1];
|
|
251
|
+
var handleNext = function handleNext() {
|
|
252
|
+
return setStep(function (s) {
|
|
253
|
+
return Math.min(s + 1, stepComponents.length - 1);
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
var handleBack = function handleBack() {
|
|
257
|
+
return setStep(function (s) {
|
|
258
|
+
return Math.max(s - 1, 0);
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
var handleRestart = function handleRestart() {
|
|
262
|
+
return setStep(0);
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// Simulate phrase verification
|
|
266
|
+
var verifyPhrase = function verifyPhrase(input) {
|
|
267
|
+
if (input.trim() === 'correct phrase') {
|
|
268
|
+
setPhraseVerified(true);
|
|
269
|
+
setTimeout(handleNext, 700);
|
|
270
|
+
} else {
|
|
271
|
+
setPhraseVerified(false);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// Simulate sending email code
|
|
276
|
+
var sendEmailCode = function sendEmailCode() {
|
|
277
|
+
if (!/^[^@]+@[^@]+\.[^@]+$/.test(email)) {
|
|
278
|
+
setEmailError('Enter a valid email address.');
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
setEmailError('');
|
|
282
|
+
setEmailSent(true);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
// Simulate email code verification
|
|
286
|
+
var verifyEmailCode = function verifyEmailCode() {
|
|
287
|
+
if (emailCode === '123456') {
|
|
288
|
+
setEmailError('');
|
|
289
|
+
handleNext();
|
|
290
|
+
} else {
|
|
291
|
+
setEmailError('Invalid verification code.');
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// Simulate OTP verification
|
|
296
|
+
var verifyOtp = function verifyOtp() {
|
|
297
|
+
if (otp === '000000') {
|
|
298
|
+
setOtpError('');
|
|
299
|
+
handleNext();
|
|
300
|
+
} else {
|
|
301
|
+
setOtpError('Invalid code.');
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
var stepComponents = [{
|
|
305
|
+
component: IntroStep,
|
|
306
|
+
options: {
|
|
307
|
+
onNext: handleNext
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
component: RecoveryPhraseStep,
|
|
311
|
+
options: {
|
|
312
|
+
phraseVerified: phraseVerified,
|
|
313
|
+
verifyPhrase: verifyPhrase,
|
|
314
|
+
onNext: handleNext,
|
|
315
|
+
onBack: handleBack
|
|
316
|
+
}
|
|
317
|
+
}, {
|
|
318
|
+
component: EmailRecoveryStep,
|
|
319
|
+
options: {
|
|
320
|
+
email: email,
|
|
321
|
+
setEmail: setEmail,
|
|
322
|
+
emailError: emailError,
|
|
323
|
+
emailSent: emailSent,
|
|
324
|
+
sendEmailCode: sendEmailCode,
|
|
325
|
+
emailCode: emailCode,
|
|
326
|
+
setEmailCode: setEmailCode,
|
|
327
|
+
verifyEmailCode: verifyEmailCode,
|
|
328
|
+
onBack: handleBack
|
|
329
|
+
}
|
|
330
|
+
}, {
|
|
331
|
+
component: AdditionalSecurityStep,
|
|
332
|
+
options: {
|
|
333
|
+
showOtp: showOtp,
|
|
334
|
+
setShowOtp: setShowOtp,
|
|
335
|
+
otp: otp,
|
|
336
|
+
setOtp: setOtp,
|
|
337
|
+
otpError: otpError,
|
|
338
|
+
verifyOtp: verifyOtp,
|
|
339
|
+
onNext: handleNext,
|
|
340
|
+
onBack: handleBack
|
|
341
|
+
}
|
|
342
|
+
}, {
|
|
343
|
+
component: ConfirmationStep,
|
|
344
|
+
options: {
|
|
345
|
+
onRestart: handleRestart
|
|
346
|
+
}
|
|
347
|
+
}];
|
|
348
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
349
|
+
className: "w-full max-w-lg mx-auto bg-white rounded-xl shadow-md p-6 mt-4 flex flex-col gap-6"
|
|
350
|
+
}, /*#__PURE__*/React.createElement(Stepper, {
|
|
351
|
+
steps: stepComponents,
|
|
352
|
+
currentStep: step
|
|
353
|
+
}));
|
|
354
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
// RisingSun.tsx
|
|
8
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
9
|
+
var RisingSun = function RisingSun(_ref) {
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
_ref$roundedClass = _ref.roundedClass,
|
|
12
|
+
roundedClass = _ref$roundedClass === void 0 ? '' : _ref$roundedClass;
|
|
13
|
+
var canvasRef = useRef(null);
|
|
14
|
+
var parentRef = useRef(null);
|
|
15
|
+
var _useState = useState({
|
|
16
|
+
width: 800,
|
|
17
|
+
height: 600
|
|
18
|
+
}),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
canvasSize = _useState2[0],
|
|
21
|
+
setCanvasSize = _useState2[1]; // Default size
|
|
22
|
+
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
if (parentRef.current) {
|
|
25
|
+
var handleResize = function handleResize() {
|
|
26
|
+
var _ref2 = parentRef.current,
|
|
27
|
+
clientWidth = _ref2.clientWidth,
|
|
28
|
+
clientHeight = _ref2.clientHeight;
|
|
29
|
+
setCanvasSize({
|
|
30
|
+
width: clientWidth,
|
|
31
|
+
height: clientHeight
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
handleResize(); // Initialize with the current parent size
|
|
35
|
+
|
|
36
|
+
var resizeObserver = new ResizeObserver(handleResize);
|
|
37
|
+
resizeObserver.observe(parentRef.current);
|
|
38
|
+
return function () {
|
|
39
|
+
resizeObserver.disconnect();
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}, []);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
var canvas = canvasRef.current;
|
|
45
|
+
var context = canvas === null || canvas === void 0 ? void 0 : canvas.getContext('2d');
|
|
46
|
+
if (!context) return;
|
|
47
|
+
var canvasWidth = canvasSize.width,
|
|
48
|
+
canvasHeight = canvasSize.height;
|
|
49
|
+
var sunRadius = 80;
|
|
50
|
+
var startAngle = 0;
|
|
51
|
+
var getRayEndPoint = function getRayEndPoint(angle) {
|
|
52
|
+
var radians = angle * Math.PI / 180;
|
|
53
|
+
var dx = Math.cos(radians);
|
|
54
|
+
var dy = Math.sin(radians);
|
|
55
|
+
if (canvasWidth * dy <= canvasHeight * dx) {
|
|
56
|
+
return {
|
|
57
|
+
x: canvasWidth,
|
|
58
|
+
y: canvasWidth * dy / dx
|
|
59
|
+
};
|
|
60
|
+
} else {
|
|
61
|
+
return {
|
|
62
|
+
x: canvasHeight * dx / dy,
|
|
63
|
+
y: canvasHeight
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var _draw = function draw() {
|
|
68
|
+
context.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
69
|
+
context.beginPath();
|
|
70
|
+
context.arc(0, 0, sunRadius, 0, Math.PI / 2);
|
|
71
|
+
context.lineTo(0, 0);
|
|
72
|
+
context.fillStyle = '#C2CCD5';
|
|
73
|
+
context.fill();
|
|
74
|
+
for (var i = 0; i < 30; i++) {
|
|
75
|
+
var angle = (startAngle + 12 * i) % 360;
|
|
76
|
+
var endPoint = getRayEndPoint(angle);
|
|
77
|
+
context.beginPath();
|
|
78
|
+
context.moveTo(0, 0);
|
|
79
|
+
context.lineTo(endPoint.x, endPoint.y);
|
|
80
|
+
context.strokeStyle = '#C2CCD5'; // Custom hex color
|
|
81
|
+
context.lineWidth = 1;
|
|
82
|
+
context.stroke();
|
|
83
|
+
}
|
|
84
|
+
startAngle += 0.05; // Slower rotation speed
|
|
85
|
+
|
|
86
|
+
requestAnimationFrame(_draw);
|
|
87
|
+
};
|
|
88
|
+
_draw();
|
|
89
|
+
}, [canvasSize]);
|
|
90
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
ref: parentRef,
|
|
92
|
+
className: "relative w-full h-full overflow-hidden ".concat(roundedClass),
|
|
93
|
+
style: {
|
|
94
|
+
WebkitMaskImage: 'inherit'
|
|
95
|
+
}
|
|
96
|
+
}, /*#__PURE__*/React.createElement("canvas", {
|
|
97
|
+
ref: canvasRef,
|
|
98
|
+
style: {
|
|
99
|
+
position: 'absolute',
|
|
100
|
+
top: 0,
|
|
101
|
+
left: 0,
|
|
102
|
+
width: '100%',
|
|
103
|
+
height: '100%',
|
|
104
|
+
backgroundColor: '#080909'
|
|
105
|
+
},
|
|
106
|
+
width: canvasSize.width,
|
|
107
|
+
height: canvasSize.height
|
|
108
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: "flex flex-row justify-center pt-[24px] pb-[24px] gap-[24px]",
|
|
110
|
+
style: {
|
|
111
|
+
position: 'relative',
|
|
112
|
+
zIndex: 1
|
|
113
|
+
}
|
|
114
|
+
}, /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: "flex flex-col justify-center w-[400px]"
|
|
116
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: "text-primary-100 text-h4-bold"
|
|
118
|
+
}, "Secure, Fast and User-Friendly: Meet Nobak Wallet"), /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: "text-primary-400 text-p1-medium"
|
|
120
|
+
}, "Your gateway to the Stellar ecosystem\u2014manage your digital assets with confidence."))));
|
|
121
|
+
};
|
|
122
|
+
export { RisingSun };
|