@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,267 @@
|
|
|
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, { Fragment } from 'react';
|
|
8
|
+
import { format, isSameDay } from 'date-fns';
|
|
9
|
+
import { timesOfDay } from "./constants";
|
|
10
|
+
import { CalendarHeader } from "./CalendarHeader";
|
|
11
|
+
import { useCalendar } from '@h6s/calendar';
|
|
12
|
+
import { DateTime } from 'luxon';
|
|
13
|
+
import clsx from 'clsx';
|
|
14
|
+
var ColumnsFix = function ColumnsFix() {
|
|
15
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "min-h-screen bg-neutral-150 max-h-full max-w-full"
|
|
17
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "sm:col-start-1"
|
|
19
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "sm:col-start-2"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "sm:col-start-3"
|
|
23
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "sm:col-start-4"
|
|
25
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "sm:col-start-5"
|
|
27
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "sm:col-start-6"
|
|
29
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "sm:col-start-7"
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
export var WeekView = function WeekView(_ref) {
|
|
34
|
+
var headers = _ref.headers,
|
|
35
|
+
body = _ref.body,
|
|
36
|
+
navigation = _ref.navigation,
|
|
37
|
+
cursorDate = _ref.cursorDate,
|
|
38
|
+
events = _ref.events,
|
|
39
|
+
view = _ref.view;
|
|
40
|
+
var container = React.useRef(null);
|
|
41
|
+
var containerNav = React.useRef(null);
|
|
42
|
+
var containerOffset = React.useRef(null);
|
|
43
|
+
|
|
44
|
+
// React.useEffect(() => {
|
|
45
|
+
// const currentMinute = new Date().getHours() * 60;
|
|
46
|
+
// if (
|
|
47
|
+
// typeof container.current?.scrollHeight === 'number' &&
|
|
48
|
+
// typeof containerNav.current?.offsetHeight === 'number' &&
|
|
49
|
+
// typeof containerOffset.current?.offsetHeight === 'number'C
|
|
50
|
+
// ) {
|
|
51
|
+
// const x =
|
|
52
|
+
// container.current.scrollHeight -
|
|
53
|
+
// containerNav.current.offsetHeight -
|
|
54
|
+
// containerOffset.current.offsetHeight;
|
|
55
|
+
// window.scrollTo(0, (x * currentMinute) / 1440);
|
|
56
|
+
// }
|
|
57
|
+
// }, []);
|
|
58
|
+
// console.log('cursorDate', cursorDate)
|
|
59
|
+
|
|
60
|
+
var eventsOnWeek = body.value.map(function (_ref2, key) {
|
|
61
|
+
var week = _ref2.value;
|
|
62
|
+
// console.log('item', item)
|
|
63
|
+
// console.log('value', item.value)
|
|
64
|
+
// Find Week
|
|
65
|
+
// console.log('week', key, week)
|
|
66
|
+
var weekly = week.map(function (_ref3) {
|
|
67
|
+
var day = _ref3.value,
|
|
68
|
+
isCurrentDate = _ref3.isCurrentDate;
|
|
69
|
+
if (isCurrentDate) {
|
|
70
|
+
// console.log('week', key, week)
|
|
71
|
+
}
|
|
72
|
+
var evently = events.filter(function (event) {
|
|
73
|
+
// console.log('event', day)
|
|
74
|
+
|
|
75
|
+
// console.log(new Date(event.timestamp *1000))
|
|
76
|
+
if (isSameDay(day, +new Date(event.timestamp * 1000))) {
|
|
77
|
+
// console.log(isSameDay(day, +new Date(event.timestamp *1000)), +new Date(event.timestamp *1000))
|
|
78
|
+
return event;
|
|
79
|
+
}
|
|
80
|
+
// const eventTime = new Date(event.timestamp * 1000);
|
|
81
|
+
// return isSameDay(day, +new Date(event.timestamp *1000)) ? event : null;
|
|
82
|
+
});
|
|
83
|
+
// console.log('evently', evently)
|
|
84
|
+
return evently;
|
|
85
|
+
});
|
|
86
|
+
// console.log('weekly', weekly)
|
|
87
|
+
return weekly;
|
|
88
|
+
})[0];
|
|
89
|
+
|
|
90
|
+
// console.log('events', events)
|
|
91
|
+
|
|
92
|
+
// console.log('eventsOnWeek', eventsOnWeek)
|
|
93
|
+
|
|
94
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
ref: container,
|
|
96
|
+
className: "flex flex-auto flex-col overflow-auto bg-neutral-100"
|
|
97
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
style: {
|
|
99
|
+
width: '165%'
|
|
100
|
+
},
|
|
101
|
+
className: "flex max-w-full flex-none flex-col sm:max-w-none md:max-w-full"
|
|
102
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
ref: containerNav,
|
|
104
|
+
className: "sticky top-0 flex-none bg-neutral-100 shadow ring-1 ring-neutral-800 ring-opacity-5 sm:pr-8"
|
|
105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: "grid grid-cols-7 text-sm leading-6 text-neutral-500 sm:hidden"
|
|
107
|
+
}, headers.weekDays.map(function (_ref4) {
|
|
108
|
+
var key = _ref4.key,
|
|
109
|
+
value = _ref4.value;
|
|
110
|
+
var isToday = format(value, 'Y-MM-dd') === format(+new Date(), 'Y-MM-dd');
|
|
111
|
+
var isSelected = format(cursorDate, 'Y-MM-dd') === format(value, 'Y-MM-dd') ? true : false;
|
|
112
|
+
var dayStyle = clsx('mt-1 flex h-8 w-8 items-center justify-center font-semibold rounded-full', isToday && isSelected && 'bg-primary-400 text-neutral-100', isToday && !isSelected && 'text-primary-400', isSelected && 'bg-neutral-900 text-neutral-100', !isSelected && 'text-neutral-900');
|
|
113
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
114
|
+
type: "button",
|
|
115
|
+
className: "flex flex-col items-center pt-2 pb-3",
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
return navigation.setDate(value);
|
|
118
|
+
},
|
|
119
|
+
key: key
|
|
120
|
+
}, format(value, 'eee').charAt(0), /*#__PURE__*/React.createElement("span", {
|
|
121
|
+
className: dayStyle
|
|
122
|
+
}, format(value, 'dd')));
|
|
123
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: "-mr-px hidden grid-cols-7 divide-x divide-neutral-800 border-r border-neutral-100 text-sm leading-6 text-neutral-500 sm:grid"
|
|
125
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: "col-end-1 w-14 border-b"
|
|
127
|
+
}), headers.weekDays.map(function (_ref5) {
|
|
128
|
+
var key = _ref5.key,
|
|
129
|
+
value = _ref5.value;
|
|
130
|
+
var isToday = format(value, 'Y-MM-dd') === format(+new Date(), 'Y-MM-dd');
|
|
131
|
+
var isSelected = format(cursorDate, 'Y-MM-dd') === format(value, 'Y-MM-dd') ? true : false;
|
|
132
|
+
var dayStyle = clsx('items-center justify-center font-semibold ml-1 flex h-6 w-6 rounded-full', isToday && isSelected && 'bg-primary-400 text-neutral-100', isToday && !isSelected && 'text-primary-400', isSelected && 'bg-neutral-900 text-neutral-100', !isSelected && 'text-neutral-900');
|
|
133
|
+
var spanStyle = clsx(isToday && 'flex items-baseline');
|
|
134
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
className: "flex items-center justify-center py-3",
|
|
136
|
+
key: key
|
|
137
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
className: spanStyle
|
|
139
|
+
}, format(value, 'eee').slice(0, 3), ' ', /*#__PURE__*/React.createElement("button", {
|
|
140
|
+
type: "button",
|
|
141
|
+
onClick: function onClick() {
|
|
142
|
+
return navigation.setDate(value);
|
|
143
|
+
}
|
|
144
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
145
|
+
className: dayStyle
|
|
146
|
+
}, format(value, 'dd')))));
|
|
147
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
className: "flex flex-auto"
|
|
149
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
className: "sticky left-0 w-14 flex-none bg-neutral-100 ring-1 ring-neutral-800"
|
|
151
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
className: "grid flex-auto grid-cols-1 grid-rows-1 bg-neutral-50"
|
|
153
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: "col-start-1 col-end-2 row-start-1 grid divide-y divide-neutral-100",
|
|
155
|
+
style: {
|
|
156
|
+
gridTemplateRows: 'repeat(48, minmax(3.5rem, 1fr))'
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
ref: containerOffset,
|
|
160
|
+
className: "row-end-1 h-7"
|
|
161
|
+
}), timesOfDay.map(function (_ref6, key) {
|
|
162
|
+
var time = _ref6.time;
|
|
163
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
164
|
+
key: key
|
|
165
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
className: "sticky left-0 -mt-2.5 -ml-14 w-14 pr-2 text-right text-xs leading-5 text-neutral-400"
|
|
167
|
+
}, time)), /*#__PURE__*/React.createElement("div", null));
|
|
168
|
+
}), /*#__PURE__*/React.createElement("div", null)), /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
className: "col-start-1 col-end-2 row-start-1 hidden grid-cols-7 grid-rows-1 divide-x divide-neutral-400 sm:grid sm:grid-cols-7"
|
|
170
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
171
|
+
className: "col-start-1 row-span-full"
|
|
172
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
className: "col-start-2 row-span-full"
|
|
174
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
175
|
+
className: "col-start-3 row-span-full"
|
|
176
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
className: "col-start-4 row-span-full"
|
|
178
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
179
|
+
className: "col-start-5 row-span-full"
|
|
180
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: "col-start-6 row-span-full"
|
|
182
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
183
|
+
className: "col-start-7 row-span-full"
|
|
184
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
185
|
+
className: "col-start-8 row-span-full w-8"
|
|
186
|
+
})), /*#__PURE__*/React.createElement("ol", {
|
|
187
|
+
className: "col-start-1 col-end-2 row-start-1 grid grid-cols-1 sm:grid-cols-7 sm:pr-8",
|
|
188
|
+
style: {
|
|
189
|
+
gridTemplateRows: '1.75rem repeat(288, minmax(0, 1fr)) auto'
|
|
190
|
+
}
|
|
191
|
+
}, eventsOnWeek.map(function (day, index) {
|
|
192
|
+
console.log('day', day);
|
|
193
|
+
if (day.length > 0) {
|
|
194
|
+
return day.map(function (event) {
|
|
195
|
+
var start = DateTime.fromSeconds(parseInt(event.timestamp)),
|
|
196
|
+
end = DateTime.fromSeconds(parseInt(event.timestamp) + parseInt(event.duration));
|
|
197
|
+
var start_time = (parseInt(start.toFormat('HH')) * 60 + parseInt(start.toFormat('mm'))) / 5 + 2;
|
|
198
|
+
var startTime = start.toFormat('HH:mm'),
|
|
199
|
+
endTime = end.toFormat('HH:mm');
|
|
200
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
201
|
+
key: index
|
|
202
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
203
|
+
className: "relative mt-px flex sm:col-start-".concat(index + 1),
|
|
204
|
+
style: {
|
|
205
|
+
gridRow: "".concat(start_time, " / span ").concat(event.duration / 60 / 5)
|
|
206
|
+
}
|
|
207
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
208
|
+
href: "#",
|
|
209
|
+
className: "group absolute inset-1 flex flex-col overflow-y-auto rounded-lg bg-primary-300 p-2 text-xs leading-5 hover:bg-blue-100"
|
|
210
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
211
|
+
className: "order-1 font-semibold text-blue-700"
|
|
212
|
+
}, event.name), /*#__PURE__*/React.createElement("p", {
|
|
213
|
+
className: "text-blue-500 group-hover:text-blue-700"
|
|
214
|
+
}, /*#__PURE__*/React.createElement("time", {
|
|
215
|
+
dateTime: "2022-01-22T06:00"
|
|
216
|
+
}, event.date)), /*#__PURE__*/React.createElement("p", null, startTime, " - ", endTime))));
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
})))))));
|
|
220
|
+
};
|
|
221
|
+
export var CalendarWeek = function CalendarWeek(_ref7) {
|
|
222
|
+
var _ref7$events = _ref7.events,
|
|
223
|
+
events = _ref7$events === void 0 ? [] : _ref7$events;
|
|
224
|
+
var _React$useState = React.useState('month'),
|
|
225
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
226
|
+
activeView = _React$useState2[0],
|
|
227
|
+
changeView = _React$useState2[1];
|
|
228
|
+
var _useCalendar = useCalendar(),
|
|
229
|
+
cursorDate = _useCalendar.cursorDate,
|
|
230
|
+
headers = _useCalendar.headers,
|
|
231
|
+
body = _useCalendar.body,
|
|
232
|
+
view = _useCalendar.view,
|
|
233
|
+
navigation = _useCalendar.navigation;
|
|
234
|
+
var setView = function setView(option) {
|
|
235
|
+
changeView(option);
|
|
236
|
+
switch (option) {
|
|
237
|
+
case 'month':
|
|
238
|
+
return view.showMonthView();
|
|
239
|
+
case 'day':
|
|
240
|
+
return view.showMonthView();
|
|
241
|
+
case 'week':
|
|
242
|
+
return view.showWeekView();
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// React.useEffect, populate events, watch [view]
|
|
247
|
+
var eventsOnDate = events.filter(function (event) {
|
|
248
|
+
return format(cursorDate, 'DDD') === format(new Date(event.timestamp * 1000), 'DDD') ? true : false;
|
|
249
|
+
});
|
|
250
|
+
var bodyStyle = clsx(activeView === 'month' && 'flex flex-col', (activeView === 'week' || activeView === 'day') && 'flex flex-col h-screen');
|
|
251
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
252
|
+
className: bodyStyle
|
|
253
|
+
}, /*#__PURE__*/React.createElement(CalendarHeader, {
|
|
254
|
+
activeView: activeView,
|
|
255
|
+
setView: setView,
|
|
256
|
+
view: view,
|
|
257
|
+
cursorDate: cursorDate,
|
|
258
|
+
navigation: navigation
|
|
259
|
+
}), /*#__PURE__*/React.createElement(WeekView, {
|
|
260
|
+
headers: headers,
|
|
261
|
+
body: body,
|
|
262
|
+
events: events,
|
|
263
|
+
navigation: navigation,
|
|
264
|
+
cursorDate: cursorDate,
|
|
265
|
+
view: view
|
|
266
|
+
})));
|
|
267
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export var timesOfDay = [{
|
|
2
|
+
time: '12AM',
|
|
3
|
+
code: '2'
|
|
4
|
+
}, {
|
|
5
|
+
time: '1AM',
|
|
6
|
+
code: '14'
|
|
7
|
+
}, {
|
|
8
|
+
time: '2AM',
|
|
9
|
+
code: '26'
|
|
10
|
+
}, {
|
|
11
|
+
time: '3AM',
|
|
12
|
+
code: '38'
|
|
13
|
+
}, {
|
|
14
|
+
time: '4AM',
|
|
15
|
+
code: '50'
|
|
16
|
+
}, {
|
|
17
|
+
time: '5AM',
|
|
18
|
+
code: '62'
|
|
19
|
+
}, {
|
|
20
|
+
time: '6AM',
|
|
21
|
+
code: '74'
|
|
22
|
+
}, {
|
|
23
|
+
time: '7AM',
|
|
24
|
+
code: '86'
|
|
25
|
+
}, {
|
|
26
|
+
time: '8AM',
|
|
27
|
+
code: '98'
|
|
28
|
+
}, {
|
|
29
|
+
time: '9AM',
|
|
30
|
+
code: '110'
|
|
31
|
+
}, {
|
|
32
|
+
time: '10AM',
|
|
33
|
+
code: '122'
|
|
34
|
+
}, {
|
|
35
|
+
time: '11AM',
|
|
36
|
+
code: '134'
|
|
37
|
+
}, {
|
|
38
|
+
time: '12PM',
|
|
39
|
+
code: '146'
|
|
40
|
+
}, {
|
|
41
|
+
time: '1PM',
|
|
42
|
+
code: '158'
|
|
43
|
+
}, {
|
|
44
|
+
time: '2PM',
|
|
45
|
+
code: '170'
|
|
46
|
+
}, {
|
|
47
|
+
time: '3PM',
|
|
48
|
+
code: '182'
|
|
49
|
+
}, {
|
|
50
|
+
time: '4PM',
|
|
51
|
+
code: '194'
|
|
52
|
+
}, {
|
|
53
|
+
time: '5PM',
|
|
54
|
+
code: '206'
|
|
55
|
+
}, {
|
|
56
|
+
time: '6PM',
|
|
57
|
+
code: '218'
|
|
58
|
+
}, {
|
|
59
|
+
time: '7PM',
|
|
60
|
+
code: '230'
|
|
61
|
+
}, {
|
|
62
|
+
time: '8PM',
|
|
63
|
+
code: '242'
|
|
64
|
+
}, {
|
|
65
|
+
time: '9PM',
|
|
66
|
+
code: '254'
|
|
67
|
+
}, {
|
|
68
|
+
time: '10PM',
|
|
69
|
+
code: '266'
|
|
70
|
+
}, {
|
|
71
|
+
time: '11PM',
|
|
72
|
+
code: '278'
|
|
73
|
+
}];
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var Cartel = function Cartel(_ref) {
|
|
3
|
+
var _ref$size = _ref.size,
|
|
4
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
5
|
+
_ref$variant = _ref.variant,
|
|
6
|
+
variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
|
|
7
|
+
customCss = _ref.customCss,
|
|
8
|
+
message = _ref.message,
|
|
9
|
+
CTA = _ref.CTA;
|
|
10
|
+
var _ref2 = message || {},
|
|
11
|
+
title = _ref2.title,
|
|
12
|
+
description = _ref2.description;
|
|
13
|
+
switch (variant) {
|
|
14
|
+
case 'basic':
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "flex flex-row justify-center p-[20px] bg-neutral-100 rounded-[8px]"
|
|
17
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "flex flex-col space-y-[20px] w-[200px] text-center"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "text-neutral-800"
|
|
21
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "text-neutral-600"
|
|
23
|
+
}, description), /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "h-[64px]"
|
|
25
|
+
}, CTA)));
|
|
26
|
+
case 'full':
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "border border-neutral-100 rounded-[20px] text-neutral-800 flex flex-row justify-between w-full"
|
|
29
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "w-[300px] rounded-bl-[20px] rounded-tl-[20px] bg-cover bg-center",
|
|
31
|
+
style: {
|
|
32
|
+
backgroundImage: "linear-gradient(to right, rgba(255, 255, 255, 0), #1C181E), url('https://imagedelivery.net/uDbEDRBQqhBXrrfuCRrATQ/f583905b-d36c-49e6-0f3b-edc3d40b3c00/public')"
|
|
33
|
+
}
|
|
34
|
+
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "flex flex-col space-y-[20px] p-[40px] "
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: "text-subheading-bold"
|
|
38
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "text-p2-medium"
|
|
40
|
+
}, description), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "h-[64px]"
|
|
42
|
+
}, CTA))));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cartel } from "./Cartel";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
// Cells are List and Table child components for displaying data.
|
|
3
|
+
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Button, Checkbox, Dropdown, Person } from '..';
|
|
6
|
+
// type DropdownItemsI = {
|
|
7
|
+
// title: string;
|
|
8
|
+
// type: 'button' | 'link';
|
|
9
|
+
// action?: () => void;
|
|
10
|
+
// to?: string;
|
|
11
|
+
// }[];
|
|
12
|
+
|
|
13
|
+
export var Cell = function Cell(_ref) {
|
|
14
|
+
var type = _ref.type,
|
|
15
|
+
value = _ref.value,
|
|
16
|
+
Component = _ref.component;
|
|
17
|
+
var handleClick = function handleClick() {
|
|
18
|
+
// runSound()
|
|
19
|
+
if (type === 'button' || 'checkbox') value === null || value === void 0 || value.onClick(value === null || value === void 0 ? void 0 : value.content);
|
|
20
|
+
};
|
|
21
|
+
var cellAssert = function cellAssert(type, value) {
|
|
22
|
+
switch (type) {
|
|
23
|
+
case 'simple':
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "text-p3-medium"
|
|
26
|
+
}, value);
|
|
27
|
+
case 'person':
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "px-[16px]"
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Person, {
|
|
31
|
+
imageUrl: value.avatar_url,
|
|
32
|
+
fullname: value.first_name
|
|
33
|
+
}));
|
|
34
|
+
case 'description':
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "px-6 py-4"
|
|
37
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: "text-sm text-neutral-800"
|
|
39
|
+
}, value.title), /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "text-sm text-neutral-500"
|
|
41
|
+
}, value.description));
|
|
42
|
+
case 'extended':
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "flex items-center px-6 py-4"
|
|
45
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "flex-shrink-0 h-10 w-10"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
48
|
+
className: "h-10 w-10 rounded-full",
|
|
49
|
+
src: value.imageUrl,
|
|
50
|
+
alt: ""
|
|
51
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: "ml-4"
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "text-sm font-medium text-neutral-800"
|
|
55
|
+
}, value.title), /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "text-sm text-neutral-500"
|
|
57
|
+
}, value.description)));
|
|
58
|
+
case 'button':
|
|
59
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({}, value, {
|
|
60
|
+
size: "tiny",
|
|
61
|
+
text: value.text,
|
|
62
|
+
onClick: handleClick
|
|
63
|
+
})));
|
|
64
|
+
case 'internal_link':
|
|
65
|
+
if (!!Component) return /*#__PURE__*/React.createElement(Component, {
|
|
66
|
+
to: value.to
|
|
67
|
+
}, value.text);
|
|
68
|
+
case 'link':
|
|
69
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
70
|
+
href: value.to
|
|
71
|
+
}, value.text);
|
|
72
|
+
case 'badge':
|
|
73
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
74
|
+
case 'icon':
|
|
75
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
76
|
+
case 'dropdown':
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: ""
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
80
|
+
button: {
|
|
81
|
+
icon: 'dots',
|
|
82
|
+
size: 'small',
|
|
83
|
+
variant: 'basic'
|
|
84
|
+
},
|
|
85
|
+
items: value,
|
|
86
|
+
component: Component
|
|
87
|
+
}));
|
|
88
|
+
case 'image':
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: "flex h-[64px] px-6 py-4",
|
|
91
|
+
style: {
|
|
92
|
+
backgroundImage: "linear-gradient(to left, rgba(44, 51, 53, 1), rgba(44, 51, 53, 0.5), rgba(44, 51, 53, 0.5), rgba(44, 51, 53, 0.2)), url('".concat(value.imageUrl, "')"),
|
|
93
|
+
backgroundSize: 'cover'
|
|
94
|
+
}
|
|
95
|
+
}, value.text);
|
|
96
|
+
case 'checkbox':
|
|
97
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
98
|
+
onChange: handleClick
|
|
99
|
+
});
|
|
100
|
+
default:
|
|
101
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return cellAssert(type, value);
|
|
105
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cell } from "./Cell";
|
|
@@ -0,0 +1,27 @@
|
|
|
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 from 'react';
|
|
8
|
+
import { Switch as SwitchComponent } from '@headlessui/react';
|
|
9
|
+
import { Icon } from "../Icon";
|
|
10
|
+
export var Checkbox = function Checkbox(_ref) {
|
|
11
|
+
var onChange = _ref.onChange;
|
|
12
|
+
var _React$useState = React.useState(false),
|
|
13
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14
|
+
enabled = _React$useState2[0],
|
|
15
|
+
setEnabled = _React$useState2[1];
|
|
16
|
+
var toggleAction = function toggleAction() {
|
|
17
|
+
setEnabled(!enabled);
|
|
18
|
+
onChange();
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement(SwitchComponent, {
|
|
21
|
+
checked: enabled,
|
|
22
|
+
onChange: toggleAction,
|
|
23
|
+
className: "".concat(enabled ? 'bg-blue-600 border-blue-600 text-white' : 'bg-white border-neutral-1000 text-white', " h-6 w-6 border rounded-md")
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
name: "Power"
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox } from "./Checkbox";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var Clock = function Clock(_ref) {
|
|
4
|
+
_objectDestructuringEmpty(_ref);
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", null);
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Clock } from "./Clock";
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { hexToRgb, calculateRatio, rgbToHsb, hsbToRgb, rgbToHex } from "./utils";
|
|
10
|
+
import { Button } from '..';
|
|
11
|
+
export var ColorChecker = function ColorChecker(_ref) {
|
|
12
|
+
_objectDestructuringEmpty(_ref);
|
|
13
|
+
var _React$useState = React.useState('ffffff'),
|
|
14
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15
|
+
colorOne = _React$useState2[0],
|
|
16
|
+
setColorOne = _React$useState2[1];
|
|
17
|
+
var _React$useState3 = React.useState('ffffff'),
|
|
18
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
19
|
+
colorTwo = _React$useState4[0],
|
|
20
|
+
setColorTwo = _React$useState4[1];
|
|
21
|
+
var _React$useState5 = React.useState(null),
|
|
22
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
23
|
+
ratio = _React$useState6[0],
|
|
24
|
+
setRatio = _React$useState6[1];
|
|
25
|
+
React.useEffect(function () {
|
|
26
|
+
var c1 = hexToRgb(colorOne);
|
|
27
|
+
var c2 = hexToRgb(colorTwo);
|
|
28
|
+
var r = calculateRatio(c1, c2).toFixed(2);
|
|
29
|
+
setRatio(r);
|
|
30
|
+
// if (parseInt(r) > 1) {
|
|
31
|
+
// console.log('greater')
|
|
32
|
+
// } else {
|
|
33
|
+
// if (!c2) return;
|
|
34
|
+
// console.log('not greater')
|
|
35
|
+
// const { r, g , b } = c2
|
|
36
|
+
// const { h, s , b: brightness} = rgbToHsb(r, g, b)
|
|
37
|
+
// const newB = brightness * 0.33
|
|
38
|
+
// const newC = hsbToRgb(h,s,newB)
|
|
39
|
+
// console.log(newC)
|
|
40
|
+
// const newR = calculateRatio(c1, newC).toFixed(2)
|
|
41
|
+
// console.log('iRatio', newR, parseFloat(newR), parseFloat(newR) > 7)
|
|
42
|
+
// if (parseFloat(newR) > 7) {
|
|
43
|
+
// console.log('is Greater')
|
|
44
|
+
// // const newH = rgbToHex(newC)
|
|
45
|
+
// const newH = rgbToHex(newC?.r, newC?.g, newC?.b)
|
|
46
|
+
// console.log('newH', parseInt(newH).toString())
|
|
47
|
+
// setColorTwo(parseInt(newH).toString())
|
|
48
|
+
// setRatio(newR)
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
}, [colorOne, colorTwo]);
|
|
52
|
+
var fixContrast = function fixContrast() {
|
|
53
|
+
var c1 = hexToRgb(colorOne);
|
|
54
|
+
var c2 = hexToRgb(colorTwo);
|
|
55
|
+
if (!c2) return;
|
|
56
|
+
var r = c2.r,
|
|
57
|
+
g = c2.g,
|
|
58
|
+
b = c2.b;
|
|
59
|
+
var _rgbToHsb = rgbToHsb(r, g, b),
|
|
60
|
+
h = _rgbToHsb.h,
|
|
61
|
+
s = _rgbToHsb.s,
|
|
62
|
+
brightness = _rgbToHsb.b;
|
|
63
|
+
var newB = brightness * 0.33;
|
|
64
|
+
var newC = hsbToRgb(h, s, newB);
|
|
65
|
+
var newR = calculateRatio(c1, newC).toFixed(2);
|
|
66
|
+
if (parseFloat(newR) > 7) {
|
|
67
|
+
var newH = rgbToHex(newC === null || newC === void 0 ? void 0 : newC.r, newC === null || newC === void 0 ? void 0 : newC.g, newC === null || newC === void 0 ? void 0 : newC.b);
|
|
68
|
+
setColorTwo(parseInt(newH).toString());
|
|
69
|
+
setRatio(newR);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "text-neutral-800"
|
|
74
|
+
}, /*#__PURE__*/React.createElement("div", null, "Ratio: ", ratio), /*#__PURE__*/React.createElement("div", null, "Color 1: ", colorOne), /*#__PURE__*/React.createElement("div", null, "Color 2: ", colorTwo), /*#__PURE__*/React.createElement(Button, {
|
|
75
|
+
text: "fix contrast",
|
|
76
|
+
onClick: function onClick() {
|
|
77
|
+
return fixContrast();
|
|
78
|
+
}
|
|
79
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: "w-[200px] h-[200px]",
|
|
81
|
+
style: {
|
|
82
|
+
backgroundColor: "#".concat(colorOne)
|
|
83
|
+
}
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
style: {
|
|
86
|
+
color: "#".concat(colorTwo)
|
|
87
|
+
}
|
|
88
|
+
}, "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quasi vero sequi similique ullam, accusamus architecto cumque delectus quae, quo odio, vel rerum repellat?")));
|
|
89
|
+
};
|