@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,232 @@
|
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
4
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
5
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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; } }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
12
|
+
// Placeholder imports for design system components
|
|
13
|
+
// Replace with actual imports from your design system
|
|
14
|
+
import { Button } from "../../shared/elements/Button/Button";
|
|
15
|
+
import { Input } from "../../shared/components/forms/Input/Input";
|
|
16
|
+
|
|
17
|
+
// Placeholder ChatContainer
|
|
18
|
+
var ChatContainer = function ChatContainer(_ref) {
|
|
19
|
+
var children = _ref.children;
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "bg-neutral-50 border rounded-xl p-4 h-[500px] overflow-y-auto flex flex-col gap-3"
|
|
22
|
+
}, children);
|
|
23
|
+
};
|
|
24
|
+
// Placeholder ChatBubble
|
|
25
|
+
var ChatBubble = function ChatBubble(_ref2) {
|
|
26
|
+
var message = _ref2.message,
|
|
27
|
+
from = _ref2.from,
|
|
28
|
+
markdown = _ref2.markdown;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "max-w-[70%] px-4 py-2 rounded-lg ".concat(from === 'user' ? 'bg-primary-100 self-end' : 'bg-white border self-start', " whitespace-pre-wrap")
|
|
31
|
+
}, message);
|
|
32
|
+
};
|
|
33
|
+
// Placeholder ChatInput
|
|
34
|
+
var ChatInput = function ChatInput(_ref3) {
|
|
35
|
+
var value = _ref3.value,
|
|
36
|
+
_onChange = _ref3.onChange,
|
|
37
|
+
onSend = _ref3.onSend,
|
|
38
|
+
suggestions = _ref3.suggestions;
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "flex flex-col gap-1"
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "flex gap-2"
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
44
|
+
value: value,
|
|
45
|
+
onChange: function onChange(e) {
|
|
46
|
+
return _onChange(e.target.value);
|
|
47
|
+
},
|
|
48
|
+
placeholder: "Type a message or command..."
|
|
49
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
text: "Send",
|
|
51
|
+
onClick: onSend,
|
|
52
|
+
variant: "primary"
|
|
53
|
+
})), suggestions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "flex gap-2 mt-1 flex-wrap"
|
|
55
|
+
}, suggestions.map(function (s) {
|
|
56
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
57
|
+
key: s,
|
|
58
|
+
text: s,
|
|
59
|
+
variant: "basic",
|
|
60
|
+
size: "small",
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
return _onChange(s);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
})));
|
|
66
|
+
};
|
|
67
|
+
// Placeholder TransactionCard
|
|
68
|
+
var TransactionCard = function TransactionCard(_ref4) {
|
|
69
|
+
var tx = _ref4.tx;
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: "bg-neutral-100 border p-3 rounded-lg mt-2"
|
|
72
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "font-bold mb-1"
|
|
74
|
+
}, "Transaction Preview"), /*#__PURE__*/React.createElement("pre", {
|
|
75
|
+
className: "text-xs whitespace-pre-wrap"
|
|
76
|
+
}, JSON.stringify(tx, null, 2)));
|
|
77
|
+
};
|
|
78
|
+
var QUICK_ACTIONS = ['Show my balance', 'Send XLM', 'Receive payment', 'Swap assets', 'Recent transactions'];
|
|
79
|
+
var DEMO_TX = {
|
|
80
|
+
type: 'payment',
|
|
81
|
+
asset: 'XLM',
|
|
82
|
+
amount: ': ',
|
|
83
|
+
to: 'G...DEST',
|
|
84
|
+
memo: 'Dinner'
|
|
85
|
+
};
|
|
86
|
+
export var ConversationInterface = function ConversationInterface() {
|
|
87
|
+
var _useState = useState([{
|
|
88
|
+
id: ', ',
|
|
89
|
+
from: ': ',
|
|
90
|
+
content: '👋 Welcome to your Nobak Wallet! How can I help you today?\n\n*You can try commands like:* `Show my balance`, `Send XLM`, or `Swap assets`.\n',
|
|
91
|
+
markdown: true,
|
|
92
|
+
quickActions: QUICK_ACTIONS
|
|
93
|
+
}]),
|
|
94
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
95
|
+
messages = _useState2[0],
|
|
96
|
+
setMessages = _useState2[1];
|
|
97
|
+
var _useState3 = useState(''),
|
|
98
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
99
|
+
input = _useState4[0],
|
|
100
|
+
setInput = _useState4[1];
|
|
101
|
+
var _useState5 = useState(QUICK_ACTIONS),
|
|
102
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
103
|
+
suggestions = _useState6[0],
|
|
104
|
+
setSuggestions = _useState6[1];
|
|
105
|
+
var chatEndRef = useRef(null);
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
var _chatEndRef$current;
|
|
108
|
+
(_chatEndRef$current = chatEndRef.current) === null || _chatEndRef$current === void 0 || _chatEndRef$current.scrollIntoView({
|
|
109
|
+
behavior: 'smooth'
|
|
110
|
+
});
|
|
111
|
+
}, [messages]);
|
|
112
|
+
|
|
113
|
+
// Demo: handle input and simulate AI response
|
|
114
|
+
var handleSend = function handleSend() {
|
|
115
|
+
if (!input.trim()) return;
|
|
116
|
+
var userMsg = {
|
|
117
|
+
id: "u".concat(Date.now()),
|
|
118
|
+
from: 'user',
|
|
119
|
+
content: input
|
|
120
|
+
};
|
|
121
|
+
setMessages(function (msgs) {
|
|
122
|
+
return [].concat(_toConsumableArray(msgs), [userMsg]);
|
|
123
|
+
});
|
|
124
|
+
setInput('');
|
|
125
|
+
setSuggestions([]);
|
|
126
|
+
setTimeout(function () {
|
|
127
|
+
// Simulate AI response and transaction preview
|
|
128
|
+
if (/send/i.test(userMsg.content)) {
|
|
129
|
+
setMessages(function (msgs) {
|
|
130
|
+
return [].concat(_toConsumableArray(msgs), [{
|
|
131
|
+
id: "a".concat(Date.now()),
|
|
132
|
+
from: ': ',
|
|
133
|
+
content: 'Here is your transaction preview:',
|
|
134
|
+
txPreview: DEMO_TX,
|
|
135
|
+
confirmationFlow: true
|
|
136
|
+
}]);
|
|
137
|
+
});
|
|
138
|
+
} else if (/balance/i.test(userMsg.content)) {
|
|
139
|
+
setMessages(function (msgs) {
|
|
140
|
+
return [].concat(_toConsumableArray(msgs), [{
|
|
141
|
+
id: "a".concat(Date.now()),
|
|
142
|
+
from: ': ',
|
|
143
|
+
content: 'Your current balance is **1,250 XLM**.',
|
|
144
|
+
markdown: true
|
|
145
|
+
}]);
|
|
146
|
+
});
|
|
147
|
+
} else {
|
|
148
|
+
setMessages(function (msgs) {
|
|
149
|
+
return [].concat(_toConsumableArray(msgs), [{
|
|
150
|
+
id: "a".concat(Date.now()),
|
|
151
|
+
from: ': ',
|
|
152
|
+
content: "Sorry, I didn't understand that. Try a quick action below!",
|
|
153
|
+
quickActions: QUICK_ACTIONS
|
|
154
|
+
}]);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}, 700);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// Demo: handle quick action button click
|
|
161
|
+
var handleQuickAction = function handleQuickAction(action) {
|
|
162
|
+
setInput(action);
|
|
163
|
+
setSuggestions([]);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Demo: handle transaction confirmation
|
|
167
|
+
var handleConfirm = function handleConfirm(msgId) {
|
|
168
|
+
setMessages(function (msgs) {
|
|
169
|
+
return [].concat(_toConsumableArray(msgs), [{
|
|
170
|
+
id: "c".concat(Date.now()),
|
|
171
|
+
from: 'user',
|
|
172
|
+
content: 'Confirm transaction'
|
|
173
|
+
}, {
|
|
174
|
+
id: "a".concat(Date.now()),
|
|
175
|
+
from: ': ',
|
|
176
|
+
content: '✅ Transaction confirmed and sent!'
|
|
177
|
+
}]);
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: "w-full max-w-xl mx-auto bg-white rounded-xl shadow-md p-6 mt-4 flex flex-col gap-4"
|
|
182
|
+
}, /*#__PURE__*/React.createElement(ChatContainer, null, messages.map(function (msg) {
|
|
183
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
184
|
+
key: msg.id
|
|
185
|
+
}, /*#__PURE__*/React.createElement(ChatBubble, {
|
|
186
|
+
message: msg.content,
|
|
187
|
+
from: msg.from,
|
|
188
|
+
markdown: msg.markdown
|
|
189
|
+
}), msg.txPreview && /*#__PURE__*/React.createElement(TransactionCard, {
|
|
190
|
+
tx: msg.txPreview
|
|
191
|
+
}), msg.confirmationFlow && /*#__PURE__*/React.createElement("div", {
|
|
192
|
+
className: "flex gap-2 mt-2"
|
|
193
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
194
|
+
text: "Confirm",
|
|
195
|
+
variant: "primary",
|
|
196
|
+
onClick: function onClick() {
|
|
197
|
+
return handleConfirm(msg.id);
|
|
198
|
+
}
|
|
199
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
200
|
+
text: "Cancel",
|
|
201
|
+
variant: "basic",
|
|
202
|
+
onClick: function onClick() {
|
|
203
|
+
return setMessages(function (msgs) {
|
|
204
|
+
return [].concat(_toConsumableArray(msgs), [{
|
|
205
|
+
id: "a".concat(Date.now()),
|
|
206
|
+
from: '../..',
|
|
207
|
+
content: 'Transaction cancelled.'
|
|
208
|
+
}]);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
})), msg.quickActions && /*#__PURE__*/React.createElement("div", {
|
|
212
|
+
className: "flex gap-2 mt-2 flex-wrap"
|
|
213
|
+
}, msg.quickActions.map(function (qa) {
|
|
214
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
215
|
+
key: qa,
|
|
216
|
+
text: qa,
|
|
217
|
+
variant: "basic",
|
|
218
|
+
size: "small",
|
|
219
|
+
onClick: function onClick() {
|
|
220
|
+
return handleQuickAction(qa);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
})));
|
|
224
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
225
|
+
ref: chatEndRef
|
|
226
|
+
})), /*#__PURE__*/React.createElement(ChatInput, {
|
|
227
|
+
value: input,
|
|
228
|
+
onChange: setInput,
|
|
229
|
+
onSend: handleSend,
|
|
230
|
+
suggestions: suggestions
|
|
231
|
+
}));
|
|
232
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from "../shared";
|
|
3
|
+
var DevFooter = function DevFooter(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
Link = _ref.component,
|
|
6
|
+
docs_url = _ref.docs_url,
|
|
7
|
+
main_url = _ref.main_url;
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "flex justify-center"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "flex justify-between items-center py-8 w-full max-w-screen-xl"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "flex items-center"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
15
|
+
text: "Nobak",
|
|
16
|
+
type: "link",
|
|
17
|
+
component: Link,
|
|
18
|
+
variant: "basic",
|
|
19
|
+
to: main_url,
|
|
20
|
+
customCss: "text-primary-800"
|
|
21
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "flex space-x-6 items-center"
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
text: "API Documentation",
|
|
25
|
+
type: "link",
|
|
26
|
+
component: Link,
|
|
27
|
+
variant: "basic",
|
|
28
|
+
to: docs_url,
|
|
29
|
+
customCss: "text-primary-1200"
|
|
30
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
31
|
+
type: "anchor",
|
|
32
|
+
to: "/faq",
|
|
33
|
+
text: "FAQ",
|
|
34
|
+
variant: "basic",
|
|
35
|
+
customCss: "text-primary-1200"
|
|
36
|
+
}))));
|
|
37
|
+
};
|
|
38
|
+
export { DevFooter };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Logo } from "./";
|
|
3
|
+
import { Button } from "../shared";
|
|
4
|
+
var DevMenu = function DevMenu(_ref) {
|
|
5
|
+
var menuItems = _ref.menuItems,
|
|
6
|
+
Link = _ref.component;
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "flex justify-center bg-primary-400"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "flex justify-between items-center p-4 w-full max-w-screen-xl"
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
12
|
+
to: "/"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "flex items-center"
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Logo, {
|
|
16
|
+
type: "Isologo",
|
|
17
|
+
size: "small"
|
|
18
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "ml-2 text-p1-bold"
|
|
20
|
+
}, "Developers"))), /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "flex space-x-6 items-center"
|
|
22
|
+
}, menuItems.map(function (item, index) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
key: index,
|
|
25
|
+
text: item.label,
|
|
26
|
+
variant: "basic",
|
|
27
|
+
type: "link",
|
|
28
|
+
to: item.to,
|
|
29
|
+
component: item.component || Link,
|
|
30
|
+
size: "small",
|
|
31
|
+
active: item.isActive
|
|
32
|
+
});
|
|
33
|
+
}))));
|
|
34
|
+
};
|
|
35
|
+
export { DevMenu };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from "../shared";
|
|
3
|
+
var DevSidebar = function DevSidebar(_ref) {
|
|
4
|
+
var sidebarItems = _ref.sidebarItems,
|
|
5
|
+
Link = _ref.component;
|
|
6
|
+
console.log('sidebarItems', sidebarItems);
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "sticky top-0 z-10"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "w-64 flex flex-col justify-between p-4"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "mt-8 flex-1"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "flex flex-col space-y-4 pl-2 pr-2 pt-2"
|
|
15
|
+
}, sidebarItems.map(function (item, index) {
|
|
16
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
17
|
+
key: index,
|
|
18
|
+
text: item.label,
|
|
19
|
+
variant: "air",
|
|
20
|
+
size: "small",
|
|
21
|
+
type: "link",
|
|
22
|
+
component: Link,
|
|
23
|
+
to: item.to,
|
|
24
|
+
active: item.isActive
|
|
25
|
+
});
|
|
26
|
+
})))));
|
|
27
|
+
};
|
|
28
|
+
export { DevSidebar };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// Define the glyphs with their corresponding SVG paths
|
|
4
|
+
var glyphs = {
|
|
5
|
+
'0': 'M3.82749 7.49855V13.7937L1.83018 15.791L1.17139 15.1218V6.50513L3.82749 7.49855ZM1.17139 25.7253V17.1086L1.83018 16.4498L3.82749 18.4367V24.7318L1.17139 25.7253ZM12.7683 28.0468H2.82361C1.93475 27.8272 1.39099 27.2729 1.17139 26.3945L3.82749 25.4011H11.7853L12.7788 28.0572L12.7683 28.0468ZM11.7748 6.83986H3.85874L1.20264 5.84643C1.42224 4.96804 1.97646 4.41381 2.85486 4.19421H12.7682L11.7748 6.85032V6.83986ZM12.4442 13.7937V6.82932L13.4376 4.17322C14.316 4.39282 14.8702 4.94704 15.0898 5.82544V15.1009L14.431 15.7597L12.4442 13.7728V13.7937ZM14.431 16.4499L15.0898 17.1087V26.3841C14.8702 27.273 14.316 27.8167 13.4376 28.0363L12.4442 25.3802V18.4158L14.431 16.429V16.4499Z',
|
|
6
|
+
'1': 'M1.35983 13.7937V6.82932L2.35326 4.17322C3.23165 4.39282 3.78588 4.94704 4.00548 5.82544V15.1009L3.34668 15.7597L1.35983 13.7728V13.7937ZM3.34668 16.4499L4.00548 17.1087V26.3841C3.78588 27.273 3.23165 27.8167 2.35326 28.0363L1.35983 25.3802V18.4158L3.34668 16.429V16.4499Z',
|
|
7
|
+
'2': 'M1.09119 25.7253V17.1086L1.74998 16.4498L3.73683 18.4367V24.7318L1.09119 25.7253ZM13.6815 28.0468H2.74341C1.85455 27.8272 1.31079 27.2729 1.09119 26.3945L3.74729 25.4011H12.6986L13.692 28.0572L13.6815 28.0468ZM11.6946 6.83986H3.77854L1.12244 5.84643C1.34204 4.96804 1.89626 4.41381 2.77466 4.19421H12.688L11.6946 6.85032V6.83986ZM12.3535 14.7871L13.6815 16.1152L12.3535 17.4432H3.73684L2.41925 16.1152L3.73684 14.7871H12.3535ZM12.3535 13.7937V6.82932L13.3469 4.17322C14.2253 4.39282 14.7795 4.94704 14.9991 5.82544V15.1009L14.3403 15.7597L12.3535 13.7728V13.7937Z',
|
|
8
|
+
'3': 'M12.8766 28.0468H2.93185C2.043 27.8272 1.49923 27.2729 1.27963 26.3945L3.93573 25.4011H11.8936L12.887 28.0572L12.8766 28.0468ZM11.8832 6.83986H3.96717L1.31107 5.84643C1.53066 4.96804 2.08489 4.41381 2.96329 4.19421H12.8766L11.8832 6.85032V6.83986ZM12.5419 14.7871L13.87 16.1152L12.5419 17.4432H3.92528L2.59723 16.1152L3.92528 14.7871H12.5419ZM12.5419 13.7937V6.82932L13.5353 4.17322C14.4137 4.39282 14.9679 4.94704 15.1875 5.82544V15.1009L14.5287 15.7597L12.5419 13.7728V13.7937ZM14.5287 16.4499L15.1875 17.1087V26.3841C14.9679 27.273 14.4137 27.8167 13.5353 28.0363L12.5419 25.3802V18.4158L14.5287 16.429V16.4499Z',
|
|
9
|
+
'4': 'M4.12418 6.50502V13.7936L2.12688 15.7909L1.46808 15.1217V5.5116L4.12418 6.50502ZM12.7408 14.7871L14.0584 16.1152L12.7408 17.4432H4.12419L2.79614 16.1152L4.12419 14.7871H12.7408ZM12.7408 13.7937V6.82932L13.7343 4.17322C14.6127 4.39282 15.1669 4.94704 15.3865 5.82544V15.1009L14.7277 15.7597L12.7408 13.7728V13.7937ZM14.7277 16.4499L15.3865 17.1087V26.3841C15.1669 27.273 14.6127 27.8167 13.7343 28.0363L12.7408 25.3802V18.4158L14.7277 16.429V16.4499Z',
|
|
10
|
+
'5': 'M4.30217 7.47755V13.7727L2.31533 15.77L1.65652 15.1008V6.48413L4.30217 7.47755ZM13.2534 28.0258H3.30875C2.41989 27.8062 1.87612 27.2519 1.65652 26.3736L4.31263 25.3801H12.2705L13.2639 28.0362L13.2534 28.0258ZM13.2534 6.81886H4.3335L1.6774 5.82544C1.897 4.94704 2.45123 4.39282 3.32962 4.17322H14.2364L13.2429 6.82932L13.2534 6.81886ZM12.9189 14.7661L14.2469 16.0942L12.9189 17.4222H4.3022L2.97415 16.0942L4.3022 14.7661H12.9189ZM14.9057 16.4289L15.5645 17.0877V26.3631C15.3449 27.252 14.7907 27.7957 13.9123 28.0153L12.9189 25.3592V18.3948L14.9057 16.408V16.4289Z',
|
|
11
|
+
'6': 'M3.5011 7.47755V13.7727L1.51426 15.77L0.845001 15.1008V6.48413L3.5011 7.47755ZM0.845001 25.7044V17.0878L1.51426 16.429L3.5011 18.4158V24.711L0.845001 25.7044ZM12.4524 28.0258H2.50766C1.61881 27.8062 1.07504 27.2519 0.855438 26.3736L3.51154 25.3801H11.4694L12.4628 28.0362L12.4524 28.0258ZM12.4523 6.81886H3.53238L0.876282 5.82544C1.09588 4.94704 1.6501 4.39282 2.5285 4.17322H13.4352L12.4418 6.82932L12.4523 6.81886ZM12.1177 14.7661L13.4457 16.0942L12.1177 17.4222H3.50102L2.17297 16.0942L3.50102 14.7661H12.1177ZM14.1045 16.4289L14.7633 17.0877V26.3631C14.5437 27.252 13.9895 27.7957 13.1111 28.0153L12.1177 25.3592V18.3948L14.1045 16.408V16.4289Z',
|
|
12
|
+
'7': 'M3.67909 7.49855V13.7937L1.69223 15.791L1.03345 15.1218V6.50513L3.67909 7.49855ZM11.6369 6.83986H3.72085L1.06476 5.84643C1.28436 4.96804 1.83859 4.41381 2.71698 4.19421H12.6303L11.6369 6.85032V6.83986ZM12.2957 13.7937V6.82932L13.2892 4.17322C14.1676 4.39282 14.7218 4.94704 14.9414 5.82544V15.1009L14.2826 15.7597L12.2957 13.7728V13.7937ZM14.2931 16.4499L14.9519 17.1087V26.3841C14.7323 27.273 14.178 27.8167 13.2996 28.0363L12.3062 25.3802V18.4158L14.2931 16.429V16.4499Z',
|
|
13
|
+
'8': 'M3.878 7.49855V13.7937L1.89115 15.791L1.22189 15.1218V6.50513L3.878 7.49855ZM1.22189 25.7253V17.1086L1.89115 16.4498L3.878 18.4367V24.7318L1.22189 25.7253ZM12.8292 28.0468H2.88454C1.99568 27.8272 1.45193 27.2729 1.23233 26.3945L3.88843 25.4011H11.8463L12.8397 28.0572L12.8292 28.0468ZM11.8357 6.83974H3.91968L1.26358 5.84631C1.48318 4.96792 2.03741 4.41369 2.9158 4.19409H12.8291L11.8357 6.85019V6.83974ZM12.4946 14.7871L13.8226 16.1152L12.4946 17.4432H3.87792L2.54987 16.1152L3.87792 14.7871H12.4946ZM12.4946 13.7937V6.82932L13.488 4.17322C14.3664 4.39282 14.9206 4.94704 15.1402 5.82544V15.1009L14.4814 15.7597L12.4946 13.7728V13.7937ZM14.4814 16.4499L15.1402 17.1087V26.3841C14.9206 27.273 14.3664 27.8167 13.488 28.0363L12.4946 25.3802V18.4158L14.4814 16.429V16.4499Z',
|
|
14
|
+
'9': 'M4.06639 7.49855V13.7937L2.07953 15.791L1.41028 15.1218V6.50513L4.06639 7.49855ZM13.0072 28.0468H3.0625C2.17365 27.8272 1.62988 27.2729 1.41028 26.3945L4.06639 25.4011H12.0242L13.0177 28.0572L13.0072 28.0468ZM12.0139 6.83986H4.09788L1.44177 5.84643C1.66137 4.96804 2.2156 4.41381 3.094 4.19421H13.0073L12.0139 6.85032V6.83986ZM12.6831 14.7871L14.0007 16.1152L12.6831 17.4432H4.06646L2.7384 16.1152L4.06646 14.7871H12.6831ZM12.683 13.7937V6.82932L13.6765 4.17322C14.5549 4.39282 15.1091 4.94704 15.3287 5.82544V15.1009L14.6699 15.7597L12.683 13.7728V13.7937ZM14.6699 16.4499L15.3287 17.1087V26.3841C15.1091 27.273 14.5549 27.8167 13.6765 28.0363L12.683 25.3802V18.4158L14.6699 16.429V16.4499Z',
|
|
15
|
+
'.': 'M3.25491 25.3802H0.598816V28.0364H3.25491V25.3802Z',
|
|
16
|
+
',': 'M2.97578 30.7029L1.65819 32.0309L0.330139 30.7029V25.4011H2.97578V30.7029Z',
|
|
17
|
+
'$': 'M3.71724 7.49855V13.7937L1.73038 15.791L1.07159 15.1218V6.50513L3.71724 7.49855Z M12.6685 28.0468H2.72382C1.83496 27.8272 1.29119 27.2729 1.07159 26.3945L3.72769 25.4011H11.6855L12.679 28.0572L12.6685 28.0468Z M3.75906 6.83986L1.10297 5.84643C1.32257 4.96804 1.87679 4.41381 2.75519 4.19421H13.3273C14.2057 4.41381 14.7599 4.96804 14.9795 5.84643L12.3234 6.83986H3.73816H3.75906Z M12.3339 14.7871L13.662 16.1152L12.3339 17.4432H3.71726L2.39966 16.1152L3.71726 14.7871H12.3339Z M7.0321 3.19023V1.53801L8.36016 0.209961L9.6882 1.53801V3.19023H7.0321Z M9.6882 7.83325H7.0321V13.7938H9.6882V7.83325Z M9.6882 18.4366H7.0321V24.3972H9.6882V18.4366Z M9.6882 29.0402V30.7028L8.36016 32.0309L7.0321 30.7028V29.0402H9.6882Z M14.3311 16.4499L14.9899 17.1087V26.3841C14.7703 27.273 14.2161 27.8167 13.3377 28.0363L12.3443 25.3802V18.4158L14.3311 16.429V16.4499Z'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Define the allowed characters
|
|
21
|
+
var allowedCharacters = Object.keys(glyphs);
|
|
22
|
+
|
|
23
|
+
// Define viewBox sizes based on character type
|
|
24
|
+
var viewBoxMap = {
|
|
25
|
+
'.': '0 0 4 32',
|
|
26
|
+
',': '0 0 4 32',
|
|
27
|
+
'1': '0 0 5 32'
|
|
28
|
+
// All other digits use '0 0 16 32'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Define the props for the DigitalDisplay component
|
|
32
|
+
|
|
33
|
+
// The DigitalDisplay component
|
|
34
|
+
var DigitalDisplay = function DigitalDisplay(_ref) {
|
|
35
|
+
var value = _ref.value,
|
|
36
|
+
_ref$color = _ref.color,
|
|
37
|
+
color = _ref$color === void 0 ? 'black' : _ref$color,
|
|
38
|
+
_ref$secondaryColor = _ref.secondaryColor,
|
|
39
|
+
secondaryColor = _ref$secondaryColor === void 0 ? 'blue' : _ref$secondaryColor;
|
|
40
|
+
// Validate the input string
|
|
41
|
+
var isValid = value.split('').every(function (_char) {
|
|
42
|
+
return allowedCharacters.includes(_char);
|
|
43
|
+
});
|
|
44
|
+
if (!isValid) {
|
|
45
|
+
console.error('DigitalDisplay: Invalid character detected in the input string.');
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Render each character as an SVG
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
style: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'flex-end'
|
|
54
|
+
}
|
|
55
|
+
}, value.split('').map(function (_char2, index) {
|
|
56
|
+
// Determine the viewBox based on the character
|
|
57
|
+
var viewBox = viewBoxMap[_char2] || '0 0 16 32'; // Default viewBox for digits other than '1'
|
|
58
|
+
|
|
59
|
+
// Determine the width based on the viewBox
|
|
60
|
+
var viewBoxWidth = parseInt(viewBox.split(' ')[2], 10);
|
|
61
|
+
var viewBoxHeight = parseInt(viewBox.split(' ')[3], 10);
|
|
62
|
+
|
|
63
|
+
// Calculate aspect ratio
|
|
64
|
+
var aspectRatio = viewBoxWidth / viewBoxHeight;
|
|
65
|
+
|
|
66
|
+
// Define the SVG size
|
|
67
|
+
var height = 32; // Fixed height
|
|
68
|
+
var width = height * aspectRatio;
|
|
69
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
70
|
+
key: index,
|
|
71
|
+
width: width,
|
|
72
|
+
height: height,
|
|
73
|
+
viewBox: viewBox,
|
|
74
|
+
style: {
|
|
75
|
+
marginRight: 2
|
|
76
|
+
}
|
|
77
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
78
|
+
d: glyphs[_char2],
|
|
79
|
+
fill: _char2 === '$' ? secondaryColor : color
|
|
80
|
+
}));
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
export { DigitalDisplay };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from "../shared";
|
|
3
|
+
var Footer = function Footer(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
Link = _ref.component,
|
|
6
|
+
docs_url = _ref.docs_url;
|
|
7
|
+
console.log("docs_url", docs_url);
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "flex justify-center bg-primary-800"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "flex justify-between items-center p-4 w-full max-w-screen-xl"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "flex items-center"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "ml-2 text-lg font-semibold text-primary-1200"
|
|
16
|
+
}, "Nobak")), /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "flex space-x-6 items-center"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
19
|
+
type: "anchor",
|
|
20
|
+
variant: "basic",
|
|
21
|
+
icon: "Discord",
|
|
22
|
+
to: "https://discord.gg/B5uwNJq7"
|
|
23
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
type: "anchor",
|
|
25
|
+
variant: "basic",
|
|
26
|
+
icon: "Github",
|
|
27
|
+
to: "https://github.com/nobak-net/"
|
|
28
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
29
|
+
text: "API Documentation",
|
|
30
|
+
type: "anchor",
|
|
31
|
+
variant: "basic",
|
|
32
|
+
to: docs_url
|
|
33
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
text: "Privacy Policy",
|
|
35
|
+
type: "anchor",
|
|
36
|
+
variant: "basic",
|
|
37
|
+
to: "https://legal.nobak.net/privacy-policy"
|
|
38
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
39
|
+
text: "Terms of Service",
|
|
40
|
+
type: "anchor",
|
|
41
|
+
variant: "basic",
|
|
42
|
+
to: "https://legal.nobak.net/terms-of-service"
|
|
43
|
+
}))));
|
|
44
|
+
};
|
|
45
|
+
export { Footer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var HeroContainer = function HeroContainer(_ref) {
|
|
3
|
+
var children = _ref.children;
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5
|
+
className: "flex justify-center w-full bg-primary-2000"
|
|
6
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "p-[48px] w-full max-w-screen-xl h-[791px]"
|
|
8
|
+
}, children));
|
|
9
|
+
};
|
|
10
|
+
export { HeroContainer };
|
|
@@ -0,0 +1,174 @@
|
|
|
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, useEffect } from 'react';
|
|
8
|
+
// Placeholder components for design system
|
|
9
|
+
var IntentChip = function IntentChip(_ref) {
|
|
10
|
+
var label = _ref.label,
|
|
11
|
+
active = _ref.active;
|
|
12
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
13
|
+
className: "inline-block px-3 py-1 rounded-full text-xs font-semibold mr-2 mb-2 ".concat(active ? 'bg-primary-100 text-primary-800' : 'bg-neutral-200 text-neutral-700')
|
|
14
|
+
}, label);
|
|
15
|
+
};
|
|
16
|
+
var CommandSuggestionList = function CommandSuggestionList(_ref2) {
|
|
17
|
+
var suggestions = _ref2.suggestions,
|
|
18
|
+
onSelect = _ref2.onSelect;
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "flex flex-wrap gap-2 mt-2"
|
|
21
|
+
}, suggestions.map(function (s) {
|
|
22
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
23
|
+
key: s,
|
|
24
|
+
className: "bg-neutral-100 border px-2 py-1 rounded text-xs hover:bg-primary-50",
|
|
25
|
+
onClick: function onClick() {
|
|
26
|
+
return onSelect(s);
|
|
27
|
+
}
|
|
28
|
+
}, s);
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
var ChatInput = function ChatInput(_ref3) {
|
|
32
|
+
var value = _ref3.value,
|
|
33
|
+
_onChange = _ref3.onChange,
|
|
34
|
+
onSend = _ref3.onSend;
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "flex gap-2 mt-2"
|
|
37
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
38
|
+
className: "flex-1 border rounded px-3 py-2",
|
|
39
|
+
value: value,
|
|
40
|
+
onChange: function onChange(e) {
|
|
41
|
+
return _onChange(e.target.value);
|
|
42
|
+
},
|
|
43
|
+
placeholder: "Type a command or question...",
|
|
44
|
+
"aria-label": "Chat input"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
46
|
+
className: "bg-primary-600 text-white px-4 py-2 rounded",
|
|
47
|
+
onClick: onSend
|
|
48
|
+
}, "Send"));
|
|
49
|
+
};
|
|
50
|
+
var INTENT_PATTERNS = [{
|
|
51
|
+
intent: 'send',
|
|
52
|
+
pattern: /send (\d+(?:\.\d+)?) ([A-Z]+) to ([G][A-Z0-9]{10,})/i
|
|
53
|
+
}, {
|
|
54
|
+
intent: 'convert',
|
|
55
|
+
pattern: /convert (\d+(?:\.\d+)?) ([A-Z]+) to ([A-Z]+)/i
|
|
56
|
+
}, {
|
|
57
|
+
intent: 'check',
|
|
58
|
+
pattern: /(balance|show.*balance|how much|what.*have)/i
|
|
59
|
+
}];
|
|
60
|
+
var INTENT_COMMANDS = {
|
|
61
|
+
send: 'Send payment',
|
|
62
|
+
convert: 'Convert assets',
|
|
63
|
+
check: 'Check balance'
|
|
64
|
+
};
|
|
65
|
+
var AUTOCOMPLETE = ['Send 10 XLM to G...', 'Convert 100 XLM to USDC', 'Show my balance', 'Help'];
|
|
66
|
+
export var IntentRecognition = function IntentRecognition() {
|
|
67
|
+
var _useState = useState(''),
|
|
68
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
+
input = _useState2[0],
|
|
70
|
+
setInput = _useState2[1];
|
|
71
|
+
var _useState3 = useState(null),
|
|
72
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
73
|
+
intent = _useState4[0],
|
|
74
|
+
setIntent = _useState4[1];
|
|
75
|
+
var _useState5 = useState({}),
|
|
76
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
77
|
+
entities = _useState6[0],
|
|
78
|
+
setEntities = _useState6[1];
|
|
79
|
+
var _useState7 = useState([]),
|
|
80
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
81
|
+
suggestions = _useState8[0],
|
|
82
|
+
setSuggestions = _useState8[1];
|
|
83
|
+
var _useState9 = useState(AUTOCOMPLETE),
|
|
84
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
85
|
+
autocomplete = _useState0[0],
|
|
86
|
+
setAutocomplete = _useState0[1];
|
|
87
|
+
useEffect(function () {
|
|
88
|
+
var foundIntent = null;
|
|
89
|
+
var foundEntities = {};
|
|
90
|
+
for (var _i = 0, _INTENT_PATTERNS = INTENT_PATTERNS; _i < _INTENT_PATTERNS.length; _i++) {
|
|
91
|
+
var _INTENT_PATTERNS$_i = _INTENT_PATTERNS[_i],
|
|
92
|
+
_intent = _INTENT_PATTERNS$_i.intent,
|
|
93
|
+
pattern = _INTENT_PATTERNS$_i.pattern;
|
|
94
|
+
var match = input.match(pattern);
|
|
95
|
+
if (match) {
|
|
96
|
+
foundIntent = _intent;
|
|
97
|
+
if (_intent === 'send') {
|
|
98
|
+
foundEntities = {
|
|
99
|
+
amount: match[1],
|
|
100
|
+
asset: match[2],
|
|
101
|
+
recipient: match[3]
|
|
102
|
+
};
|
|
103
|
+
} else if (_intent === 'convert') {
|
|
104
|
+
foundEntities = {
|
|
105
|
+
amount: match[1],
|
|
106
|
+
asset: match[2],
|
|
107
|
+
toAsset: match[3]
|
|
108
|
+
};
|
|
109
|
+
} else if (_intent === 'check') {
|
|
110
|
+
foundEntities = {};
|
|
111
|
+
}
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
setIntent(foundIntent);
|
|
116
|
+
setEntities(foundEntities);
|
|
117
|
+
if (foundIntent) {
|
|
118
|
+
setSuggestions([INTENT_COMMANDS[foundIntent]]);
|
|
119
|
+
} else {
|
|
120
|
+
setSuggestions([]);
|
|
121
|
+
}
|
|
122
|
+
}, [input]);
|
|
123
|
+
var handleSuggestion = function handleSuggestion(s) {
|
|
124
|
+
setInput(s);
|
|
125
|
+
};
|
|
126
|
+
var handleSend = function handleSend() {
|
|
127
|
+
// For demo, just clear input
|
|
128
|
+
setInput('');
|
|
129
|
+
setIntent(null);
|
|
130
|
+
setEntities({});
|
|
131
|
+
setSuggestions([]);
|
|
132
|
+
};
|
|
133
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "w-full max-w-lg mx-auto bg-white rounded-xl shadow-md p-6 mt-4 flex flex-col gap-4",
|
|
135
|
+
"aria-live": "polite"
|
|
136
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
|
|
137
|
+
className: "block text-sm font-medium mb-1",
|
|
138
|
+
htmlFor: "intent-input"
|
|
139
|
+
}, "Try a command:"), /*#__PURE__*/React.createElement(ChatInput, {
|
|
140
|
+
value: input,
|
|
141
|
+
onChange: setInput,
|
|
142
|
+
onSend: handleSend
|
|
143
|
+
}), autocomplete.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "flex flex-wrap gap-2 mt-2"
|
|
145
|
+
}, autocomplete.map(function (s) {
|
|
146
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
147
|
+
key: s,
|
|
148
|
+
className: "bg-neutral-50 border px-2 py-1 rounded text-xs hover:bg-primary-50",
|
|
149
|
+
onClick: function onClick() {
|
|
150
|
+
return setInput(s);
|
|
151
|
+
}
|
|
152
|
+
}, s);
|
|
153
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: "flex flex-wrap gap-2 items-center"
|
|
155
|
+
}, intent && /*#__PURE__*/React.createElement(IntentChip, {
|
|
156
|
+
label: INTENT_COMMANDS[intent],
|
|
157
|
+
active: true
|
|
158
|
+
}), !intent && /*#__PURE__*/React.createElement("span", {
|
|
159
|
+
className: "text-neutral-400 text-xs"
|
|
160
|
+
}, "No intent detected yet.")), /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "flex flex-wrap gap-2 items-center"
|
|
162
|
+
}, Object.entries(entities).map(function (_ref4) {
|
|
163
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
164
|
+
k = _ref5[0],
|
|
165
|
+
v = _ref5[1];
|
|
166
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
167
|
+
key: k,
|
|
168
|
+
className: "bg-primary-50 border border-primary-200 px-2 py-1 rounded text-xs font-mono text-primary-700"
|
|
169
|
+
}, k, ": ", v);
|
|
170
|
+
})), /*#__PURE__*/React.createElement(CommandSuggestionList, {
|
|
171
|
+
suggestions: suggestions,
|
|
172
|
+
onSelect: handleSuggestion
|
|
173
|
+
}));
|
|
174
|
+
};
|