@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,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an RGB color.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents an HSB (Hue, Saturation, Brightness) color.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Converts RGB color values to HSB.
|
|
11
|
+
* @param r - Red component (0-255).
|
|
12
|
+
* @param g - Green component (0-255).
|
|
13
|
+
* @param b - Blue component (0-255).
|
|
14
|
+
* @returns HSB color object.
|
|
15
|
+
*/
|
|
16
|
+
var rgbToHsb = function rgbToHsb(r, g, b) {
|
|
17
|
+
r /= 255;
|
|
18
|
+
g /= 255;
|
|
19
|
+
b /= 255;
|
|
20
|
+
var v = Math.max(r, g, b);
|
|
21
|
+
var n = v - Math.min(r, g, b);
|
|
22
|
+
var h = n === 0 ? 0 : n && v === r ? (g - b) / n : v === g ? 2 + (b - r) / n : 4 + (r - g) / n;
|
|
23
|
+
return {
|
|
24
|
+
h: 60 * (h < 0 ? h + 6 : h),
|
|
25
|
+
s: v && n / v * 100,
|
|
26
|
+
b: v * 100
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Converts HSB color values to RGB.
|
|
32
|
+
* @param h - Hue component (0-360).
|
|
33
|
+
* @param s - Saturation component (0-100).
|
|
34
|
+
* @param b - Brightness component (0-100).
|
|
35
|
+
* @returns RGB color object.
|
|
36
|
+
*/
|
|
37
|
+
var hsbToRgb = function hsbToRgb(h, s, b) {
|
|
38
|
+
s /= 100;
|
|
39
|
+
b /= 100;
|
|
40
|
+
var k = function k(n) {
|
|
41
|
+
return (n + h / 60) % 6;
|
|
42
|
+
};
|
|
43
|
+
var f = function f(n) {
|
|
44
|
+
return b * (1 - s * Math.max(0, Math.min(k(n), 4 - k(n), 1)));
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
r: Math.round(255 * f(5)),
|
|
48
|
+
g: Math.round(255 * f(3)),
|
|
49
|
+
b: Math.round(255 * f(1))
|
|
50
|
+
}; // Added Math.round for integer RGB values
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Converts a HEX color string to an RGB object.
|
|
55
|
+
* Handles shorthand hex codes (e.g., #fff).
|
|
56
|
+
* @param hex - Hex color string (e.g., '#ff0000', 'ff0000', '#f00', 'f00').
|
|
57
|
+
* @returns RGB color object, or null if the hex string is invalid.
|
|
58
|
+
*/
|
|
59
|
+
var hexToRgb = function hexToRgb(hex) {
|
|
60
|
+
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
61
|
+
hex = hex.replace(shorthandRegex, function (_m, r, g, b) {
|
|
62
|
+
return r + r + g + g + b + b;
|
|
63
|
+
});
|
|
64
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
65
|
+
return result ? {
|
|
66
|
+
r: parseInt(result[1], 16),
|
|
67
|
+
g: parseInt(result[2], 16),
|
|
68
|
+
b: parseInt(result[3], 16)
|
|
69
|
+
} : null;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Converts RGB color values to a HEX string.
|
|
74
|
+
* @param r - Red component (0-255).
|
|
75
|
+
* @param g - Green component (0-255).
|
|
76
|
+
* @param b - Blue component (0-255).
|
|
77
|
+
* @returns Hex color string (without '#').
|
|
78
|
+
*/
|
|
79
|
+
var rgbToHex = function rgbToHex(r, g, b) {
|
|
80
|
+
return ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Lightens or darkens a HEX color by a specific amount.
|
|
85
|
+
* @param hexColor - Hex color string (e.g., '#ff0000', 'ff0000').
|
|
86
|
+
* @param amount - Amount to lighten (positive value) or darken (negative value).
|
|
87
|
+
* @returns The adjusted hex color string.
|
|
88
|
+
*/
|
|
89
|
+
var lightenDarkenColor = function lightenDarkenColor(hexColor, amount) {
|
|
90
|
+
var usePound = false;
|
|
91
|
+
if (hexColor[0] == "#") {
|
|
92
|
+
hexColor = hexColor.slice(1);
|
|
93
|
+
usePound = true;
|
|
94
|
+
}
|
|
95
|
+
var num = parseInt(hexColor, 16);
|
|
96
|
+
var r = (num >> 16) + amount;
|
|
97
|
+
r = Math.max(0, Math.min(255, r)); // Clamp Red
|
|
98
|
+
|
|
99
|
+
var g = (num >> 8 & 0x00FF) + amount;
|
|
100
|
+
g = Math.max(0, Math.min(255, g)); // Clamp Green
|
|
101
|
+
|
|
102
|
+
var b = (num & 0x0000FF) + amount;
|
|
103
|
+
b = Math.max(0, Math.min(255, b)); // Clamp Blue
|
|
104
|
+
|
|
105
|
+
// Corrected variable order in final calculation (was g, b, r -> r, g, b)
|
|
106
|
+
var newHex = (r << 16 | g << 8 | b).toString(16).padStart(6, '0');
|
|
107
|
+
return (usePound ? "#" : "") + newHex;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Applies the sRGB transformation to a single normalized color channel value.
|
|
112
|
+
* Used for luminance calculation.
|
|
113
|
+
* @param channelValue - Normalized color channel value (0-1).
|
|
114
|
+
* @returns The adjusted channel value.
|
|
115
|
+
*/
|
|
116
|
+
var checksRGB = function checksRGB(channelValue) {
|
|
117
|
+
if (channelValue <= 0.03928) {
|
|
118
|
+
return channelValue / 12.92;
|
|
119
|
+
} else {
|
|
120
|
+
return Math.pow((channelValue + 0.055) / 1.055, 2.4);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Converts an RGB object's channels using the sRGB transformation.
|
|
126
|
+
* @param color - An RGB color object.
|
|
127
|
+
* @returns An object with sRGB-adjusted r, g, b values.
|
|
128
|
+
*/
|
|
129
|
+
var getColorObject = function getColorObject(color) {
|
|
130
|
+
var colorObj = {
|
|
131
|
+
r: checksRGB(color.r / 255),
|
|
132
|
+
g: checksRGB(color.g / 255),
|
|
133
|
+
b: checksRGB(color.b / 255)
|
|
134
|
+
};
|
|
135
|
+
return colorObj;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Calculates the contrast ratio between two RGB colors.
|
|
140
|
+
* Follows WCAG guidelines.
|
|
141
|
+
* @param color1 - The first RGB color object.
|
|
142
|
+
* @param color2 - The second RGB color object.
|
|
143
|
+
* @returns The contrast ratio.
|
|
144
|
+
*/
|
|
145
|
+
var calculateRatio = function calculateRatio(color1, color2) {
|
|
146
|
+
var colorOneObject = getColorObject(color1);
|
|
147
|
+
var colorTwoObject = getColorObject(color2);
|
|
148
|
+
// Calculate luminance (L)
|
|
149
|
+
var colorOneL = 0.2126 * colorOneObject.r + 0.7152 * colorOneObject.g + 0.0722 * colorOneObject.b;
|
|
150
|
+
var colorTwoL = 0.2126 * colorTwoObject.r + 0.7152 * colorTwoObject.g + 0.0722 * colorTwoObject.b;
|
|
151
|
+
|
|
152
|
+
// Calculate contrast ratio
|
|
153
|
+
if (colorOneL > colorTwoL) {
|
|
154
|
+
return (colorOneL + 0.05) / (colorTwoL + 0.05);
|
|
155
|
+
} else {
|
|
156
|
+
return (colorTwoL + 0.05) / (colorOneL + 0.05);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
export { calculateRatio, getColorObject, checksRGB, lightenDarkenColor, rgbToHex, hexToRgb, rgbToHsb, hsbToRgb };
|
|
@@ -0,0 +1,95 @@
|
|
|
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 * as React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
// import { SearchIcon } from '@heroicons/react/solid'
|
|
10
|
+
import { Combobox, Dialog, Transition } from '@headlessui/react';
|
|
11
|
+
export var Command = function Command(_ref) {
|
|
12
|
+
var imageUrl = _ref.imageUrl,
|
|
13
|
+
_ref$size = _ref.size,
|
|
14
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
15
|
+
customCss = _ref.customCss,
|
|
16
|
+
initialState = _ref.initialState,
|
|
17
|
+
closeCommand = _ref.closeCommand;
|
|
18
|
+
var people = [{
|
|
19
|
+
id: 1,
|
|
20
|
+
name: 'Leslie Alexander',
|
|
21
|
+
url: '#'
|
|
22
|
+
}];
|
|
23
|
+
var _React$useState = React.useState(people[0]),
|
|
24
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
+
selectedPerson = _React$useState2[0],
|
|
26
|
+
setSelectedPerson = _React$useState2[1];
|
|
27
|
+
var _React$useState3 = React.useState(''),
|
|
28
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
29
|
+
query = _React$useState4[0],
|
|
30
|
+
setQuery = _React$useState4[1];
|
|
31
|
+
var filteredPeople = query === '' ? [] : people.filter(function (person) {
|
|
32
|
+
return person.name.toLowerCase().includes(query.toLowerCase());
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React.createElement(Transition.Root, {
|
|
35
|
+
show: initialState,
|
|
36
|
+
as: React.Fragment,
|
|
37
|
+
afterLeave: function afterLeave() {
|
|
38
|
+
return setQuery('');
|
|
39
|
+
},
|
|
40
|
+
appear: true
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Dialog, {
|
|
42
|
+
as: "div",
|
|
43
|
+
className: "relative z-10",
|
|
44
|
+
onClose: closeCommand
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Transition.Child, {
|
|
46
|
+
as: React.Fragment,
|
|
47
|
+
enter: "ease-out duration-300",
|
|
48
|
+
enterFrom: "opacity-0",
|
|
49
|
+
enterTo: "opacity-100",
|
|
50
|
+
leave: "ease-in duration-200",
|
|
51
|
+
leaveFrom: "opacity-100",
|
|
52
|
+
leaveTo: "opacity-0"
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "fixed inset-0 bg-gray-500 bg-opacity-90 transition-opacity"
|
|
55
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "fixed inset-0 z-10 overflow-y-auto p-4 sm:p-6 md:p-20"
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Transition.Child, {
|
|
58
|
+
as: React.Fragment,
|
|
59
|
+
enter: "ease-out duration-300",
|
|
60
|
+
enterFrom: "opacity-0 scale-95",
|
|
61
|
+
enterTo: "opacity-100 scale-100",
|
|
62
|
+
leave: "ease-in duration-200",
|
|
63
|
+
leaveFrom: "opacity-100 scale-100",
|
|
64
|
+
leaveTo: "opacity-0 scale-95"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Dialog.Panel, {
|
|
66
|
+
className: "mx-auto max-w-xl transform divide-y divide-gray-100 overflow-hidden rounded-xl bg-white shadow-2xl ring-1 ring-black ring-opacity-5 transition-all"
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Combobox, {
|
|
68
|
+
value: selectedPerson,
|
|
69
|
+
onChange: function onChange(person) {
|
|
70
|
+
return window.location = person.url;
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "relative"
|
|
74
|
+
}, /*#__PURE__*/React.createElement(Combobox.Input, {
|
|
75
|
+
className: "h-12 w-full border-0 bg-transparent pl-11 pr-4 text-gray-800 placeholder-gray-400 focus:ring-0 sm:text-sm",
|
|
76
|
+
placeholder: "Search...",
|
|
77
|
+
onChange: function onChange(event) {
|
|
78
|
+
return setQuery(event.target.value);
|
|
79
|
+
}
|
|
80
|
+
})), filteredPeople.length > 0 && /*#__PURE__*/React.createElement(Combobox.Options, {
|
|
81
|
+
"static": true,
|
|
82
|
+
className: "max-h-72 scroll-py-2 overflow-y-auto py-2 text-sm text-gray-800"
|
|
83
|
+
}, filteredPeople.map(function (person) {
|
|
84
|
+
return /*#__PURE__*/React.createElement(Combobox.Option, {
|
|
85
|
+
key: person.id,
|
|
86
|
+
value: person,
|
|
87
|
+
className: function className(_ref2) {
|
|
88
|
+
var active = _ref2.active;
|
|
89
|
+
return clsx('cursor-default select-none px-4 py-2', active && 'bg-indigo-600 text-white');
|
|
90
|
+
}
|
|
91
|
+
}, person.name);
|
|
92
|
+
})), query !== '' && filteredPeople.length === 0 && /*#__PURE__*/React.createElement("p", {
|
|
93
|
+
className: "p-4 text-sm text-gray-500"
|
|
94
|
+
}, "No people found.")))))));
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Command } from "./Command";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
export var Container = function Container(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
_ref$padding = _ref.padding,
|
|
6
|
+
padding = _ref$padding === void 0 ? 'none' : _ref$padding,
|
|
7
|
+
_ref$border = _ref.border,
|
|
8
|
+
border = _ref$border === void 0 ? 'none' : _ref$border,
|
|
9
|
+
_ref$height = _ref.height,
|
|
10
|
+
height = _ref$height === void 0 ? 'small' : _ref$height,
|
|
11
|
+
_ref$overflow = _ref.overflow,
|
|
12
|
+
overflow = _ref$overflow === void 0 ? false : _ref$overflow,
|
|
13
|
+
customCss = _ref.customCss;
|
|
14
|
+
var style = clsx(padding === 'small' && 'px-2', height === '1/3' && 'h-v76', border === 'bottom' && 'border-b', overflow && 'overflow-y-scroll', 'border-solid border-primary border-collapse', "".concat(customCss));
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: style
|
|
17
|
+
}, children);
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Container } from "./Container";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
export var Cover = function Cover(_ref) {
|
|
4
|
+
var imageUrl = _ref.imageUrl,
|
|
5
|
+
_ref$variant = _ref.variant,
|
|
6
|
+
variant = _ref$variant === void 0 ? 'large' : _ref$variant,
|
|
7
|
+
_ref$fade = _ref.fade,
|
|
8
|
+
fade = _ref$fade === void 0 ? false : _ref$fade;
|
|
9
|
+
var style = clsx(variant === 'medium' && 'h-[160px]', variant === 'large' && 'h-[260px] rounded-t-[20px]', "bg-cover bg-center w-full object-center object-cover");
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: style,
|
|
12
|
+
style: {
|
|
13
|
+
backgroundImage: "linear-gradient(to top, rgba(28, 24, 30, 1), rgba(28, 24, 30, 0.2), rgba(249, 252, 255, 0.16)), url('".concat(imageUrl, "')"),
|
|
14
|
+
backgroundSize: 'cover'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cover } from "./Cover";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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; } }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { DateWrapper } from "./components";
|
|
15
|
+
// import { Moon } from "lunarphase-js";
|
|
16
|
+
import { DateTime } from 'luxon';
|
|
17
|
+
export var DatePicker = function DatePicker(_ref) {
|
|
18
|
+
var value = _ref.value,
|
|
19
|
+
defaultValue = _ref.defaultValue,
|
|
20
|
+
handleChange = _ref.handleChange,
|
|
21
|
+
close = _ref.close;
|
|
22
|
+
var _React$useState = React.useState({
|
|
23
|
+
selectedDate: !!value ? typeof value === 'string' ? new Date(value) : value : new Date(),
|
|
24
|
+
date: value,
|
|
25
|
+
firstDayOfWeek: 0,
|
|
26
|
+
showOutsideDays: false
|
|
27
|
+
}),
|
|
28
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
29
|
+
selected = _React$useState2[0],
|
|
30
|
+
setSelected = _React$useState2[1];
|
|
31
|
+
var handleOnDateSelected = function handleOnDateSelected(dateObj) {
|
|
32
|
+
var date = dateObj.date,
|
|
33
|
+
selectable = dateObj.selectable;
|
|
34
|
+
if (!selectable) {
|
|
35
|
+
return;
|
|
36
|
+
} else {
|
|
37
|
+
setSelected(_objectSpread(_objectSpread({}, selected), {}, {
|
|
38
|
+
selectedDate: date,
|
|
39
|
+
date: date
|
|
40
|
+
}));
|
|
41
|
+
var dt = DateTime.fromJSDate(date).startOf('day');
|
|
42
|
+
handleChange({
|
|
43
|
+
name: "".concat(dt.weekdayShort, " ").concat(dt.day, " ").concat(dt.monthLong),
|
|
44
|
+
value: +new Date(date) / 1000
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DateWrapper, {
|
|
49
|
+
selected: selected.selectedDate,
|
|
50
|
+
onDateSelected: handleOnDateSelected
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
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
|
+
import React from 'react';
|
|
3
|
+
var monthNamesShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
4
|
+
var weekdayNamesShort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
5
|
+
export var Calendar = /*#__PURE__*/React.forwardRef(function (_ref, forwarededRef) {
|
|
6
|
+
var calendars = _ref.calendars,
|
|
7
|
+
getBackProps = _ref.getBackProps,
|
|
8
|
+
getForwardProps = _ref.getForwardProps,
|
|
9
|
+
getDateProps = _ref.getDateProps,
|
|
10
|
+
onDateSelected = _ref.onDateSelected;
|
|
11
|
+
var ref = React.useRef(null);
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
13
|
+
React.useImperativeHandle(forwarededRef, function () {
|
|
14
|
+
return ref.current;
|
|
15
|
+
});
|
|
16
|
+
if (calendars.length) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, calendars.map(function (calendar, key) {
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "flex items-center justify-center",
|
|
20
|
+
key: key
|
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "w-full"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "flex items-center justify-between leading-8"
|
|
25
|
+
}, /*#__PURE__*/React.createElement("h1", {
|
|
26
|
+
className: "font-medium text-neutral-800"
|
|
27
|
+
}, monthNamesShort[calendar.month], " ", calendar.year), /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "flex items-center text-neutral-800"
|
|
29
|
+
}, /*#__PURE__*/React.createElement("button", _extends({}, getBackProps({
|
|
30
|
+
calendars: calendars
|
|
31
|
+
}), {
|
|
32
|
+
type: "button"
|
|
33
|
+
}), /*#__PURE__*/React.createElement("svg", {
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
className: "icon icon-tabler icon-tabler-chevron-left",
|
|
36
|
+
width: 24,
|
|
37
|
+
height: 24,
|
|
38
|
+
viewBox: "0 0 24 24",
|
|
39
|
+
strokeWidth: "1.5",
|
|
40
|
+
stroke: "currentColor",
|
|
41
|
+
fill: "none",
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round"
|
|
44
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
45
|
+
stroke: "none",
|
|
46
|
+
d: "M0 0h24v24H0z",
|
|
47
|
+
fill: "none"
|
|
48
|
+
}), /*#__PURE__*/React.createElement("polyline", {
|
|
49
|
+
points: "15 6 9 12 15 18"
|
|
50
|
+
}))), /*#__PURE__*/React.createElement("button", _extends({}, getForwardProps({
|
|
51
|
+
calendars: calendars
|
|
52
|
+
}), {
|
|
53
|
+
type: "button"
|
|
54
|
+
}), /*#__PURE__*/React.createElement("svg", {
|
|
55
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
56
|
+
className: "icon icon-tabler ml-3 icon-tabler-chevron-right",
|
|
57
|
+
width: 24,
|
|
58
|
+
height: 24,
|
|
59
|
+
viewBox: "0 0 24 24",
|
|
60
|
+
strokeWidth: "1.5",
|
|
61
|
+
stroke: "currentColor",
|
|
62
|
+
fill: "none",
|
|
63
|
+
strokeLinecap: "round",
|
|
64
|
+
strokeLinejoin: "round"
|
|
65
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
66
|
+
stroke: "none",
|
|
67
|
+
d: "M0 0h24v24H0z",
|
|
68
|
+
fill: "none"
|
|
69
|
+
}), /*#__PURE__*/React.createElement("polyline", {
|
|
70
|
+
points: "9 6 15 12 9 18"
|
|
71
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: "flex items-center justify-between pt-4 overflow-x-auto "
|
|
73
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
74
|
+
className: "w-full"
|
|
75
|
+
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, weekdayNamesShort.map(function (weekday, key) {
|
|
76
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
77
|
+
key: key
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "w-full flex justify-center"
|
|
80
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
81
|
+
className: " font-medium text-center text-neutral-800"
|
|
82
|
+
}, weekday)));
|
|
83
|
+
}))), /*#__PURE__*/React.createElement("tbody", null, calendar.weeks.map(function (week, weekIndex) {
|
|
84
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
85
|
+
key: weekIndex
|
|
86
|
+
}, week.map(function (dateObj, index) {
|
|
87
|
+
var key = "".concat(calendar.month).concat(calendar.year).concat(weekIndex).concat(index);
|
|
88
|
+
if (!dateObj) {
|
|
89
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
90
|
+
className: "p-0.5",
|
|
91
|
+
key: key
|
|
92
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "cursor-pointer flex w-full justify-center"
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
var date = dateObj.date,
|
|
97
|
+
selected = dateObj.selected,
|
|
98
|
+
selectable = dateObj.selectable,
|
|
99
|
+
today = dateObj.today;
|
|
100
|
+
|
|
101
|
+
// console.log('Date is', date)
|
|
102
|
+
var background = today ? 'text-primary-400' : 'transparent';
|
|
103
|
+
background = selected ? 'bg-secondary-400 text-neutral-800' : background;
|
|
104
|
+
background = !selectable ? 'bg-primary-100 text-neutral-800' : background;
|
|
105
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
106
|
+
className: "p-0.5",
|
|
107
|
+
key: key
|
|
108
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: "cursor-pointer flex w-full justify-center"
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", _extends({
|
|
111
|
+
type: "button",
|
|
112
|
+
className: "w-10 h-10 flex items-center justify-center font-medium text-neutral-800 ".concat(background, " rounded-full")
|
|
113
|
+
}, getDateProps({
|
|
114
|
+
dateObj: dateObj
|
|
115
|
+
}), {
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
return onDateSelected(dateObj);
|
|
118
|
+
}
|
|
119
|
+
}), selectable ? date.getDate() : 'X'))));
|
|
120
|
+
}));
|
|
121
|
+
}))))));
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import React from 'react';
|
|
3
|
+
export var CalendarDay = function CalendarDay(_ref) {
|
|
4
|
+
var selectable = _ref.selectable,
|
|
5
|
+
date = _ref.date,
|
|
6
|
+
dateObj = _ref.dateObj,
|
|
7
|
+
onDateSelected = _ref.onDateSelected,
|
|
8
|
+
color = _ref.color,
|
|
9
|
+
background = _ref.background,
|
|
10
|
+
getDateProps = _ref.getDateProps;
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "cursor-pointer flex w-full justify-center"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", _extends({
|
|
14
|
+
type: "button",
|
|
15
|
+
className: "w-10 h-10 flex items-center justify-center font-medium text-".concat(color, " ").concat(background, " rounded-full")
|
|
16
|
+
}, getDateProps({
|
|
17
|
+
dateObj: dateObj
|
|
18
|
+
}), {
|
|
19
|
+
onClick: function onClick() {
|
|
20
|
+
return onDateSelected(dateObj);
|
|
21
|
+
}
|
|
22
|
+
}), selectable ? date.getDate() : 'X')));
|
|
23
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
import React from 'react';
|
|
3
|
+
import { useDayzed } from 'dayzed';
|
|
4
|
+
import { Calendar } from '.';
|
|
5
|
+
export var DateWrapper = function DateWrapper(_ref) {
|
|
6
|
+
var selected = _ref.selected,
|
|
7
|
+
onDateSelected = _ref.onDateSelected;
|
|
8
|
+
var dayzedData = useDayzed({
|
|
9
|
+
selected: selected,
|
|
10
|
+
onDateSelected: onDateSelected
|
|
11
|
+
});
|
|
12
|
+
return /*#__PURE__*/React.createElement(Calendar, _extends({}, dayzedData, {
|
|
13
|
+
onDateSelected: onDateSelected
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from "./DatePicker";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
var getToday = function getToday() {
|
|
5
|
+
var date = format(+new Date(), 'MMM, dd, eee, yyyy').split(',');
|
|
6
|
+
return {
|
|
7
|
+
month: date[0],
|
|
8
|
+
date: date[1],
|
|
9
|
+
dayWeek: date[2],
|
|
10
|
+
year: date[3]
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export var DateTime = function DateTime(_ref) {
|
|
14
|
+
var Component = _ref.component,
|
|
15
|
+
to = _ref.to,
|
|
16
|
+
_ref$variant = _ref.variant,
|
|
17
|
+
variant = _ref$variant === void 0 ? 'large' : _ref$variant;
|
|
18
|
+
var today = getToday();
|
|
19
|
+
var containerStyle = clsx(variant === 'medium' && 'w-[64px] h-[64px]', variant === 'large' && 'w-[96px]', 'block rounded-[8px] overflow-hidden bg-neutral-900 text-center');
|
|
20
|
+
var dateStyle = clsx(variant === 'medium' && 'text-[21px] font-bold', variant === 'large' && 'text-4xl font-bold');
|
|
21
|
+
var yearStyle = clsx(variant === 'medium' && 'text-[7px] font-bold', variant === 'large' && 'text-xs font-bold');
|
|
22
|
+
var dayWeekStyle = clsx(variant === 'medium' && 'text-[7px] font-bold', variant === 'large' && 'text-xs font-bold');
|
|
23
|
+
var monthStyle = clsx(variant === 'medium' && 'bg-secondary-400 text-white text-[12px] py-1 font-bold tracking-wider', variant === 'large' && 'bg-secondary-400 text-white py-1');
|
|
24
|
+
var topStyle = clsx(variant === 'medium' && 'pt-[1px] border-l border-r', variant === 'large' && 'pt-1 border-l border-r');
|
|
25
|
+
var botStyle = clsx(variant === 'medium' && 'pb-[1px] px-[2px] border-l border-r border-b flex justify-between', variant === 'large' && 'pb-2 px-2 border-l border-r border-b flex justify-between');
|
|
26
|
+
return /*#__PURE__*/React.createElement(Component, {
|
|
27
|
+
to: to
|
|
28
|
+
}, variant === "medium" && /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: containerStyle
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: monthStyle
|
|
32
|
+
}, today.dayWeek), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: topStyle
|
|
34
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
35
|
+
className: dateStyle
|
|
36
|
+
}, today.date))), variant === "large" && /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: containerStyle
|
|
38
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: monthStyle
|
|
40
|
+
}, today.month), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: topStyle
|
|
42
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: dateStyle
|
|
44
|
+
}, today.date)), /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: botStyle
|
|
46
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
className: yearStyle
|
|
48
|
+
}, today.dayWeek), /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
className: dayWeekStyle
|
|
50
|
+
}, today.year))));
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateTime } from "./DateTime";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var Debug = function Debug(_ref) {
|
|
3
|
+
var children = _ref.children,
|
|
4
|
+
customCss = _ref.customCss;
|
|
5
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
className: "mt-[40px] p-[20px] bg-neutral-150 ".concat(customCss, " border rounded-[3px] border-solid border-neutral-200")
|
|
7
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "text-neutral-1500 font-bold"
|
|
9
|
+
}, "DEBUG"), /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "bg-neutral-200 border border-neutral-300 rounded-[2px] px-[32px] py-[16px] text-neutral-1300 flex flex-col space-y-[4px"
|
|
11
|
+
}, children)));
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Debug } from "./Debug";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Disclosure as DisclosureComponent } from '@headlessui/react';
|
|
4
|
+
import { Icon } from '..';
|
|
5
|
+
export var Disclosure = function Disclosure(_ref) {
|
|
6
|
+
var items = _ref.items;
|
|
7
|
+
var style = clsx('flex flex-col space-y-[20px] w-full');
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: style
|
|
10
|
+
}, items.map(function (_ref2, key) {
|
|
11
|
+
var title = _ref2.title,
|
|
12
|
+
text = _ref2.text;
|
|
13
|
+
return /*#__PURE__*/React.createElement(DisclosureComponent, {
|
|
14
|
+
key: key
|
|
15
|
+
}, function (_ref3) {
|
|
16
|
+
var open = _ref3.open;
|
|
17
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DisclosureComponent.Button, {
|
|
18
|
+
className: "w-full py-[15px] px-[30px] text-h4-semi-bold text-neutral-800 border rounded-[4px] border-neutral-150"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "flex justify-between"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("div", null, title), /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "".concat(!!open && 'rotate-180')
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
24
|
+
name: "shootingArrowRight",
|
|
25
|
+
size: "xlarge"
|
|
26
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DisclosureComponent.Panel, {
|
|
27
|
+
className: "pt-4 pb-2 text-left text-p1-medium text-neutral-500"
|
|
28
|
+
}, text))));
|
|
29
|
+
});
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Disclosure } from "./Disclosure";
|