@robosystems/core 0.17.0 → 0.18.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.
Files changed (126) hide show
  1. package/README.md +2 -2
  2. package/auth-components/AppSwitcher.js +2 -3
  3. package/auth-components/LoginRedirector.js +24 -12
  4. package/auth-core/client.d.ts +2 -2
  5. package/auth-core/client.js +4 -4
  6. package/auth-core/login-home.d.ts +6 -0
  7. package/auth-core/login-home.js +11 -2
  8. package/auth-core/sso.d.ts +28 -4
  9. package/auth-core/sso.js +94 -62
  10. package/components/EntitySelector.js +1 -1
  11. package/components/RepositoryGuard.js +1 -1
  12. package/components/console/ConsoleContent.d.ts +1 -0
  13. package/components/console/ConsoleContent.js +13 -4
  14. package/components/report-chat/ReportChat.d.ts +13 -0
  15. package/components/report-chat/ReportChat.js +1 -1
  16. package/components/repositories/ActiveSubscriptions.js +1 -1
  17. package/components/repositories/BrowseRepositories.js +1 -1
  18. package/components/search/SearchBar.js +1 -1
  19. package/components/search/SearchContent.js +1 -1
  20. package/components/search/SearchHitCard.js +1 -1
  21. package/components/search/SearchPagination.js +1 -1
  22. package/hooks/use-toast.d.ts +1 -1
  23. package/hooks/use-toast.js +2 -2
  24. package/library/components/ElementBrowser.js +1 -1
  25. package/library/components/ElementDetail.js +1 -1
  26. package/library/components/LibraryHierarchy.js +1 -1
  27. package/library/components/TaxonomySidebar.js +1 -1
  28. package/package.json +2 -2
  29. package/styles/forms.css +478 -0
  30. package/styles/palette.css +265 -0
  31. package/theme/flowbite-theme.d.ts +638 -638
  32. package/theme/flowbite-theme.js +16 -21
  33. package/ui/Alert.d.ts +66 -0
  34. package/ui/Alert.js +24 -0
  35. package/ui/Badge.d.ts +50 -0
  36. package/ui/Badge.js +21 -0
  37. package/ui/Breadcrumb.d.ts +10 -0
  38. package/ui/Breadcrumb.js +31 -0
  39. package/ui/Button.d.ts +76 -0
  40. package/ui/Button.js +26 -0
  41. package/ui/Card.d.ts +32 -0
  42. package/ui/Card.js +26 -0
  43. package/ui/Checkbox.d.ts +33 -0
  44. package/ui/Checkbox.js +21 -0
  45. package/ui/Dropdown.d.ts +67 -0
  46. package/ui/Dropdown.js +134 -0
  47. package/ui/FileInput.d.ts +23 -0
  48. package/ui/FileInput.js +21 -0
  49. package/ui/Floating.d.ts +96 -0
  50. package/ui/Floating.js +92 -0
  51. package/ui/HelperText.d.ts +19 -0
  52. package/ui/HelperText.js +21 -0
  53. package/ui/Label.d.ts +21 -0
  54. package/ui/Label.js +21 -0
  55. package/ui/Modal.d.ts +85 -0
  56. package/ui/Modal.js +73 -0
  57. package/ui/Navbar.d.ts +14 -0
  58. package/ui/Navbar.js +35 -0
  59. package/ui/Progress.d.ts +40 -0
  60. package/ui/Progress.js +26 -0
  61. package/ui/Radio.d.ts +31 -0
  62. package/ui/Radio.js +21 -0
  63. package/ui/Select.d.ts +49 -0
  64. package/ui/Select.js +21 -0
  65. package/ui/Sidebar.d.ts +114 -0
  66. package/ui/Sidebar.js +76 -0
  67. package/ui/Spinner.d.ts +60 -0
  68. package/ui/Spinner.js +22 -0
  69. package/ui/Table.d.ts +23 -0
  70. package/ui/Table.js +57 -0
  71. package/ui/Tabs.d.ts +78 -0
  72. package/ui/Tabs.js +64 -0
  73. package/ui/TextInput.d.ts +58 -0
  74. package/ui/TextInput.js +21 -0
  75. package/ui/Textarea.d.ts +22 -0
  76. package/ui/Textarea.js +21 -0
  77. package/ui/ThemeModeScript.d.ts +21 -0
  78. package/ui/ThemeModeScript.js +74 -0
  79. package/ui/Toast.d.ts +24 -0
  80. package/ui/Toast.js +58 -0
  81. package/ui/ToggleSwitch.d.ts +54 -0
  82. package/ui/ToggleSwitch.js +26 -0
  83. package/ui/Tooltip.d.ts +3 -0
  84. package/ui/Tooltip.js +19 -0
  85. package/ui/cn.d.ts +6 -0
  86. package/ui/cn.js +19 -0
  87. package/ui/icons.d.ts +8 -0
  88. package/ui/icons.js +22 -0
  89. package/ui/index.d.ts +37 -0
  90. package/ui/index.js +36 -0
  91. package/ui/merge-theme.d.ts +15 -0
  92. package/ui/merge-theme.js +26 -0
  93. package/ui/theme-defaults.d.ts +821 -0
  94. package/ui/theme-defaults.js +824 -0
  95. package/ui/theme-mode.d.ts +15 -0
  96. package/ui/theme-mode.js +92 -0
  97. package/ui/types.d.ts +6 -0
  98. package/ui/types.js +1 -0
  99. package/ui-components/ConfirmModal.js +1 -1
  100. package/ui-components/StatCard.js +1 -1
  101. package/ui-components/api-keys/ApiKeyDisplay.d.ts +0 -1
  102. package/ui-components/api-keys/ApiKeyDisplay.js +3 -3
  103. package/ui-components/api-keys/CreateApiKeyModal.d.ts +0 -1
  104. package/ui-components/api-keys/CreateApiKeyModal.js +4 -4
  105. package/ui-components/api-keys/SecureApiKeyField.js +1 -1
  106. package/ui-components/chat/ChatInputArea.js +1 -1
  107. package/ui-components/chat/ChatMessage.js +1 -1
  108. package/ui-components/chat/DeepResearchToggle.js +1 -1
  109. package/ui-components/forms/CategoryInput.js +1 -1
  110. package/ui-components/forms/SettingsCard.d.ts +0 -1
  111. package/ui-components/forms/SettingsCard.js +3 -3
  112. package/ui-components/forms/SettingsFormField.d.ts +0 -1
  113. package/ui-components/forms/SettingsFormField.js +3 -3
  114. package/ui-components/forms/StatusAlert.d.ts +0 -1
  115. package/ui-components/forms/StatusAlert.js +3 -3
  116. package/ui-components/forms/TagInput.d.ts +1 -1
  117. package/ui-components/forms/TagInput.js +1 -1
  118. package/ui-components/layout/CoreNavbar.js +7 -8
  119. package/ui-components/layout/CoreSidebar.js +12 -13
  120. package/ui-components/layout/ThemeToggle.js +1 -1
  121. package/ui-components/settings/GeneralInformationCard.d.ts +0 -1
  122. package/ui-components/settings/GeneralInformationCard.js +3 -3
  123. package/ui-components/settings/PasswordInformationCard.d.ts +0 -1
  124. package/ui-components/settings/PasswordInformationCard.js +4 -4
  125. package/ui-components/settings/SettingsPageHeader.js +1 -1
  126. package/ui-components/support/SupportModal.js +1 -1
package/ui/Tabs.d.ts ADDED
@@ -0,0 +1,78 @@
1
+ import { type ComponentPropsWithoutRef, type FC, type ReactNode } from 'react';
2
+ import type { DynamicStringEnumKeysOf } from './types';
3
+ declare const t: {
4
+ readonly base: "flex flex-col gap-2";
5
+ readonly tablist: {
6
+ readonly base: "flex text-center";
7
+ readonly variant: {
8
+ readonly default: "flex-wrap border-b border-gray-200 dark:border-gray-700";
9
+ readonly underline: "-mb-px flex-wrap border-b border-gray-200 dark:border-gray-700";
10
+ readonly pills: "flex-wrap space-x-2 text-sm font-medium text-gray-500 dark:text-gray-400";
11
+ readonly fullWidth: "grid w-full grid-flow-col divide-x divide-gray-200 rounded-none text-sm font-medium dark:divide-gray-700 dark:text-gray-400 shadow";
12
+ };
13
+ readonly tabitem: {
14
+ readonly base: "flex items-center justify-center rounded-t-lg p-4 text-sm font-medium first:ml-0 focus:outline-none disabled:cursor-not-allowed disabled:text-gray-400 disabled:dark:text-gray-500 focus:ring-primary-300 mx-1 px-4 py-3 focus:ring-4";
15
+ readonly variant: {
16
+ readonly default: {
17
+ readonly base: "rounded-t-lg";
18
+ readonly active: {
19
+ readonly on: "text-primary-600 dark:text-primary-400 bg-white dark:bg-zinc-800";
20
+ readonly off: "text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300 hover:bg-zinc-50 dark:hover:bg-zinc-700";
21
+ };
22
+ };
23
+ readonly underline: {
24
+ readonly base: "rounded-t-lg";
25
+ readonly active: {
26
+ readonly on: "rounded-t-lg border-b-2 border-primary-600 text-primary-600 active dark:border-primary-400 dark:text-primary-400";
27
+ readonly off: "border-b-2 border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300";
28
+ };
29
+ };
30
+ readonly pills: {
31
+ readonly base: "";
32
+ readonly active: {
33
+ readonly on: "rounded-lg bg-primary-600 text-white";
34
+ readonly off: "rounded-lg hover:text-gray-900 dark:hover:text-white hover:bg-zinc-100 dark:hover:bg-zinc-700";
35
+ };
36
+ };
37
+ readonly fullWidth: {
38
+ readonly base: "ml-0 flex w-full rounded-none first:ml-0";
39
+ readonly active: {
40
+ readonly on: "rounded-none p-4 text-gray-900 dark:text-white active bg-white dark:bg-zinc-700";
41
+ readonly off: "rounded-none bg-white hover:text-gray-700 dark:hover:text-white hover:bg-zinc-50 dark:bg-zinc-800 dark:hover:bg-zinc-700";
42
+ };
43
+ };
44
+ };
45
+ readonly icon: "mr-2 h-5 w-5";
46
+ };
47
+ };
48
+ readonly tabitemcontainer: {
49
+ readonly base: "";
50
+ readonly variant: {
51
+ readonly default: "";
52
+ readonly underline: "";
53
+ readonly pills: "";
54
+ readonly fullWidth: "";
55
+ };
56
+ };
57
+ readonly tabpanel: "py-3";
58
+ };
59
+ export interface TabItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
60
+ active?: boolean;
61
+ disabled?: boolean;
62
+ icon?: FC<ComponentPropsWithoutRef<'svg'>>;
63
+ title: ReactNode;
64
+ }
65
+ /** The tab definition; Tabs reads its props and renders the panel itself. */
66
+ export declare const TabItem: import("react").ForwardRefExoticComponent<TabItemProps & import("react").RefAttributes<HTMLDivElement>>;
67
+ export interface TabsRef {
68
+ setActiveTab: (activeTab: number) => void;
69
+ }
70
+ export interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'ref'> {
71
+ onActiveTabChange?: (activeTab: number) => void;
72
+ variant?: DynamicStringEnumKeysOf<typeof t.tablist.variant>;
73
+ }
74
+ /** Tabs with the `Tabs.Item` alias the apps use. */
75
+ export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<TabsRef>> & {
76
+ Item: import("react").ForwardRefExoticComponent<TabItemProps & import("react").RefAttributes<HTMLDivElement>>;
77
+ };
78
+ export {};
package/ui/Tabs.js ADDED
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Children, forwardRef, useEffect, useId, useImperativeHandle, useMemo, useRef, useState, } from 'react';
15
+ import { cn } from './cn';
16
+ import { themeDefaults } from './theme-defaults';
17
+ const t = themeDefaults.tabs;
18
+ /** The tab definition; Tabs reads its props and renders the panel itself. */
19
+ export const TabItem = forwardRef(function TabItem(_a, ref) {
20
+ var { title: _title } = _a, rest = __rest(_a, ["title"]);
21
+ return _jsx("div", Object.assign({ ref: ref }, rest));
22
+ });
23
+ const TabsRoot = forwardRef(function Tabs(_a, ref) {
24
+ var { children, className, onActiveTabChange, variant = 'default' } = _a, rest = __rest(_a, ["children", "className", "onActiveTabChange", "variant"]);
25
+ const id = useId();
26
+ const tabs = useMemo(() => {
27
+ var _a;
28
+ return (_a = Children.map(Children.toArray(children), ({ props }) => props)) !== null && _a !== void 0 ? _a : [];
29
+ }, [children]);
30
+ const tabRefs = useRef([]);
31
+ const [activeTab, setActiveTab] = useState(Math.max(0, tabs.findIndex((tab) => tab.active)));
32
+ const [focusedTab, setFocusedTab] = useState(-1);
33
+ function setActiveTabWithCallback(next) {
34
+ setActiveTab(next);
35
+ onActiveTabChange === null || onActiveTabChange === void 0 ? void 0 : onActiveTabChange(next);
36
+ }
37
+ function handleClick(target) {
38
+ setActiveTabWithCallback(target);
39
+ setFocusedTab(target);
40
+ }
41
+ function handleKeyboard(event, target) {
42
+ if (event.key === 'ArrowLeft')
43
+ setFocusedTab(Math.max(0, focusedTab - 1));
44
+ if (event.key === 'ArrowRight')
45
+ setFocusedTab(Math.min(tabs.length - 1, focusedTab + 1));
46
+ if (event.key === 'Enter') {
47
+ setActiveTabWithCallback(target);
48
+ setFocusedTab(target);
49
+ }
50
+ }
51
+ const v = variant;
52
+ const tabItemStyle = t.tablist.tabitem.variant[v];
53
+ const tabItemContainerStyle = t.tabitemcontainer.variant[v];
54
+ useEffect(() => {
55
+ var _a;
56
+ (_a = tabRefs.current[focusedTab]) === null || _a === void 0 ? void 0 : _a.focus();
57
+ }, [focusedTab]);
58
+ useImperativeHandle(ref, () => ({ setActiveTab: setActiveTabWithCallback }));
59
+ return (_jsxs("div", { className: cn(t.base, className), children: [_jsx("div", Object.assign({ "aria-label": "Tabs", role: "tablist", className: cn(t.tablist.base, t.tablist.variant[v], className) }, rest, { children: tabs.map((tab, index) => (_jsxs("button", { type: "button", "aria-controls": `${id}-tabpanel-${index}`, "aria-selected": index === activeTab, className: cn(t.tablist.tabitem.base, tabItemStyle.base, index === activeTab && tabItemStyle.active.on, index !== activeTab && !tab.disabled && tabItemStyle.active.off), disabled: tab.disabled, id: `${id}-tab-${index}`, onClick: () => handleClick(index), onKeyDown: (event) => handleKeyboard(event, index), ref: (element) => {
60
+ tabRefs.current[index] = element;
61
+ }, role: "tab", tabIndex: index === focusedTab ? 0 : -1, style: { zIndex: index === focusedTab ? 2 : 1 }, children: [tab.icon && _jsx(tab.icon, { className: t.tablist.tabitem.icon }), tab.title] }, index))) })), _jsx("div", { className: cn(t.tabitemcontainer.base, tabItemContainerStyle), children: tabs.map((tab, index) => (_jsx("div", { "aria-labelledby": `${id}-tab-${index}`, className: t.tabpanel, hidden: index !== activeTab, id: `${id}-tabpanel-${index}`, role: "tabpanel", tabIndex: 0, children: tab.children }, index))) })] }));
62
+ });
63
+ /** Tabs with the `Tabs.Item` alias the apps use. */
64
+ export const Tabs = Object.assign(TabsRoot, { Item: TabItem });
@@ -0,0 +1,58 @@
1
+ import { type ComponentPropsWithoutRef, type FC, type ReactNode } from 'react';
2
+ import type { DynamicStringEnumKeysOf } from './types';
3
+ declare const t: {
4
+ readonly base: "flex";
5
+ readonly addon: "inline-flex items-center rounded-l-md border border-r-0 border-gray-300 px-3 text-sm dark:border-gray-600 dark:text-gray-400 bg-zinc-50 text-gray-500 dark:bg-zinc-700";
6
+ readonly field: {
7
+ readonly base: "relative w-full";
8
+ readonly icon: {
9
+ readonly base: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3";
10
+ readonly svg: "h-5 w-5 text-gray-500 dark:text-gray-400";
11
+ };
12
+ readonly rightIcon: {
13
+ readonly base: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3";
14
+ readonly svg: "h-5 w-5 text-gray-500 dark:text-gray-400";
15
+ };
16
+ readonly input: {
17
+ readonly base: "block w-full border focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 outline-hidden";
18
+ readonly sizes: {
19
+ readonly sm: "p-2 sm:text-xs";
20
+ readonly md: "p-2.5 text-sm sm:text-sm";
21
+ readonly lg: "p-4 sm:text-base";
22
+ };
23
+ readonly colors: {
24
+ readonly gray: "border-gray-300 text-gray-900 placeholder-gray-500 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500 bg-zinc-50 dark:bg-zinc-700";
25
+ readonly info: "border-primary-500 bg-primary-50 text-primary-900 placeholder-primary-700 focus:border-primary-500 focus:ring-primary-500 dark:border-primary-400 dark:bg-primary-100 dark:focus:border-primary-500 dark:focus:ring-primary-500";
26
+ readonly failure: "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500";
27
+ readonly warning: "border-amber-500 bg-amber-50 text-amber-900 placeholder-amber-700 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-400 dark:bg-amber-100 dark:focus:border-amber-500 dark:focus:ring-amber-500";
28
+ readonly success: "border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500";
29
+ };
30
+ readonly withRightIcon: {
31
+ readonly on: "pr-10";
32
+ readonly off: "";
33
+ };
34
+ readonly withIcon: {
35
+ readonly on: "pl-10";
36
+ readonly off: "";
37
+ };
38
+ readonly withAddon: {
39
+ readonly on: "rounded-r-lg";
40
+ readonly off: "rounded-lg";
41
+ };
42
+ readonly withShadow: {
43
+ readonly on: "shadow-xs dark:shadow-sm-light";
44
+ readonly off: "";
45
+ };
46
+ };
47
+ };
48
+ };
49
+ export interface TextInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'color'> {
50
+ addon?: ReactNode;
51
+ color?: DynamicStringEnumKeysOf<typeof t.field.input.colors>;
52
+ icon?: FC<ComponentPropsWithoutRef<'svg'>>;
53
+ rightIcon?: FC<ComponentPropsWithoutRef<'svg'>>;
54
+ shadow?: boolean;
55
+ sizing?: DynamicStringEnumKeysOf<typeof t.field.input.sizes>;
56
+ }
57
+ export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<HTMLInputElement>>;
58
+ export {};
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { forwardRef, } from 'react';
15
+ import { cn } from './cn';
16
+ import { themeDefaults } from './theme-defaults';
17
+ const t = themeDefaults.textInput;
18
+ export const TextInput = forwardRef(function TextInput(_a, ref) {
19
+ var { addon, className, color = 'gray', icon: Icon, rightIcon: RightIcon, shadow, sizing = 'md', type = 'text' } = _a, rest = __rest(_a, ["addon", "className", "color", "icon", "rightIcon", "shadow", "sizing", "type"]);
20
+ return (_jsxs("div", { className: cn(t.base, className), children: [addon && _jsx("span", { className: t.addon, children: addon }), _jsxs("div", { className: t.field.base, children: [Icon && (_jsx("div", { className: t.field.icon.base, children: _jsx(Icon, { className: t.field.icon.svg }) })), RightIcon && (_jsx("div", { "data-testid": "right-icon", className: t.field.rightIcon.base, children: _jsx(RightIcon, { className: t.field.rightIcon.svg }) })), _jsx("input", Object.assign({ className: cn(t.field.input.base, t.field.input.colors[color], t.field.input.sizes[sizing], t.field.input.withIcon[Icon ? 'on' : 'off'], t.field.input.withRightIcon[RightIcon ? 'on' : 'off'], t.field.input.withAddon[addon ? 'on' : 'off'], t.field.input.withShadow[shadow ? 'on' : 'off']), type: type }, rest, { ref: ref }))] })] }));
21
+ });
@@ -0,0 +1,22 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ import type { DynamicStringEnumKeysOf } from './types';
3
+ declare const t: {
4
+ readonly base: "block w-full rounded-lg border text-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 p-4";
5
+ readonly colors: {
6
+ readonly gray: "border-gray-300 bg-gray-50 text-gray-900 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 focus:border-secondary-500 focus:ring-secondary-500 dark:focus:border-secondary-500 dark:focus:ring-secondary-500 text-base sm:text-sm";
7
+ readonly info: "border-primary-500 bg-primary-50 text-primary-900 placeholder-primary-700 focus:border-primary-500 focus:ring-primary-500 dark:border-primary-400 dark:bg-primary-100 dark:focus:border-primary-500 dark:focus:ring-primary-500";
8
+ readonly failure: "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500";
9
+ readonly warning: "border-amber-500 bg-amber-50 text-amber-900 placeholder-amber-700 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-400 dark:bg-amber-100 dark:focus:border-amber-500 dark:focus:ring-amber-500";
10
+ readonly success: "border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500";
11
+ };
12
+ readonly withShadow: {
13
+ readonly on: "shadow-xs dark:shadow-sm-light";
14
+ readonly off: "";
15
+ };
16
+ };
17
+ export interface TextareaProps extends Omit<ComponentPropsWithoutRef<'textarea'>, 'color'> {
18
+ color?: DynamicStringEnumKeysOf<typeof t.colors>;
19
+ shadow?: boolean;
20
+ }
21
+ export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
22
+ export {};
package/ui/Textarea.js ADDED
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { forwardRef } from 'react';
15
+ import { cn } from './cn';
16
+ import { themeDefaults } from './theme-defaults';
17
+ const t = themeDefaults.textarea;
18
+ export const Textarea = forwardRef(function Textarea(_a, ref) {
19
+ var { className, color = 'gray', shadow } = _a, rest = __rest(_a, ["className", "color", "shadow"]);
20
+ return (_jsx("textarea", Object.assign({ ref: ref, className: cn(t.base, t.colors[color], t.withShadow[shadow ? 'on' : 'off'], className) }, rest)));
21
+ });
@@ -0,0 +1,21 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ export type ThemeMode = 'light' | 'dark' | 'auto';
3
+ /** The storage key flowbite-react used; kept so no user's choice resets on upgrade. */
4
+ export declare const THEME_MODE_STORAGE_KEY = "flowbite-theme-mode";
5
+ export declare const DEFAULT_THEME_MODE: ThemeMode;
6
+ export interface ThemeModeScriptProps extends ComponentPropsWithoutRef<'script'> {
7
+ /** Force a mode regardless of storage. */
8
+ mode?: ThemeMode;
9
+ /** Mode when storage holds nothing valid (default `auto`). */
10
+ defaultMode?: ThemeMode;
11
+ localStorageKey?: string;
12
+ /** CSP nonce, when the app serves one. */
13
+ nonce?: string;
14
+ }
15
+ /**
16
+ * Applies the stored (or system) color scheme before first paint by toggling
17
+ * `dark` on the root element, and keeps it in sync with the system preference
18
+ * and with other tabs. Render it in `<head>`; no client JS is needed for it.
19
+ */
20
+ export declare function ThemeModeScript({ mode, defaultMode, localStorageKey, ...others }: ThemeModeScriptProps): import("react").JSX.Element;
21
+ export declare function getThemeModeScript({ mode, defaultMode, localStorageKey, }?: Pick<ThemeModeScriptProps, 'mode' | 'defaultMode' | 'localStorageKey'>): string;
@@ -0,0 +1,74 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /** The storage key flowbite-react used; kept so no user's choice resets on upgrade. */
14
+ export const THEME_MODE_STORAGE_KEY = 'flowbite-theme-mode';
15
+ export const DEFAULT_THEME_MODE = 'auto';
16
+ /**
17
+ * Applies the stored (or system) color scheme before first paint by toggling
18
+ * `dark` on the root element, and keeps it in sync with the system preference
19
+ * and with other tabs. Render it in `<head>`; no client JS is needed for it.
20
+ */
21
+ export function ThemeModeScript(_a) {
22
+ var { mode, defaultMode = DEFAULT_THEME_MODE, localStorageKey = THEME_MODE_STORAGE_KEY } = _a, others = __rest(_a, ["mode", "defaultMode", "localStorageKey"]);
23
+ return (_jsx("script", Object.assign({}, others, { "data-theme-mode-script": true, dangerouslySetInnerHTML: {
24
+ __html: getThemeModeScript({ mode, defaultMode, localStorageKey }),
25
+ } })));
26
+ }
27
+ export function getThemeModeScript({ mode, defaultMode = DEFAULT_THEME_MODE, localStorageKey = THEME_MODE_STORAGE_KEY, } = {}) {
28
+ return `
29
+ try {
30
+ const storageMode = window.localStorage.getItem("${localStorageKey}");
31
+ const isStorageModeValid = storageMode === "light" || storageMode === "dark" || storageMode === "auto";
32
+ const resolvedMode = (isStorageModeValid ? storageMode : null) ?? ${mode ? `"${mode}"` : undefined} ?? "${defaultMode}";
33
+ const computedMode =
34
+ resolvedMode === "auto" ? (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light") : resolvedMode;
35
+ const className = "dark";
36
+
37
+ if (computedMode === "dark") {
38
+ document.documentElement.classList.add(className);
39
+ } else {
40
+ document.documentElement.classList.remove(className);
41
+ }
42
+ localStorage.setItem("${localStorageKey}", resolvedMode);
43
+
44
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
45
+ mediaQuery.addEventListener("change", (e) => {
46
+ const storageMode = window.localStorage.getItem("${localStorageKey}");
47
+ const isStorageModeValid = storageMode === "light" || storageMode === "dark" || storageMode === "auto";
48
+ const resolvedMode = isStorageModeValid ? storageMode : "${defaultMode}";
49
+
50
+ if (resolvedMode === "auto") {
51
+ if (e.matches) {
52
+ document.documentElement.classList.add(className);
53
+ } else {
54
+ document.documentElement.classList.remove(className);
55
+ }
56
+ }
57
+ });
58
+
59
+ window.addEventListener("storage", (e) => {
60
+ if (e.key === "${localStorageKey}") {
61
+ const newMode = e.newValue;
62
+ const isStorageModeValid = newMode === "light" || newMode === "dark" || newMode === "auto";
63
+ const resolvedMode = isStorageModeValid ? newMode : "${defaultMode}";
64
+
65
+ if (resolvedMode === "dark" || (resolvedMode === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
66
+ document.documentElement.classList.add(className);
67
+ } else {
68
+ document.documentElement.classList.remove(className);
69
+ }
70
+ }
71
+ });
72
+ } catch (e) {}
73
+ `;
74
+ }
package/ui/Toast.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { type ComponentPropsWithoutRef, type FC } from 'react';
2
+ declare const durationClasses: {
3
+ readonly 75: "duration-75";
4
+ readonly 100: "duration-100";
5
+ readonly 150: "duration-150";
6
+ readonly 200: "duration-200";
7
+ readonly 300: "duration-300";
8
+ readonly 500: "duration-500";
9
+ readonly 700: "duration-700";
10
+ readonly 1000: "duration-1000";
11
+ };
12
+ export type ToastDuration = keyof typeof durationClasses;
13
+ export interface ToastProps extends ComponentPropsWithoutRef<'div'> {
14
+ duration?: ToastDuration;
15
+ }
16
+ export interface ToastToggleProps extends ComponentPropsWithoutRef<'button'> {
17
+ onDismiss?: () => void;
18
+ xIcon?: FC<ComponentPropsWithoutRef<'svg'>>;
19
+ }
20
+ export declare const ToastToggle: import("react").ForwardRefExoticComponent<ToastToggleProps & import("react").RefAttributes<HTMLButtonElement>>;
21
+ export declare const Toast: import("react").ForwardRefExoticComponent<ToastProps & import("react").RefAttributes<HTMLDivElement>> & {
22
+ Toggle: import("react").ForwardRefExoticComponent<ToastToggleProps & import("react").RefAttributes<HTMLButtonElement>>;
23
+ };
24
+ export {};
package/ui/Toast.js ADDED
@@ -0,0 +1,58 @@
1
+ 'use client';
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { createContext, forwardRef, useContext, useState, } from 'react';
15
+ import { cn } from './cn';
16
+ import { XIcon } from './icons';
17
+ import { themeDefaults } from './theme-defaults';
18
+ const t = themeDefaults.toast;
19
+ const durationClasses = {
20
+ 75: 'duration-75',
21
+ 100: 'duration-100',
22
+ 150: 'duration-150',
23
+ 200: 'duration-200',
24
+ 300: 'duration-300',
25
+ 500: 'duration-500',
26
+ 700: 'duration-700',
27
+ 1000: 'duration-1000',
28
+ };
29
+ const ToastContext = createContext(undefined);
30
+ function useToastContext() {
31
+ const context = useContext(ToastContext);
32
+ if (!context)
33
+ throw new Error('useToastContext should be used within the ToastContext provider!');
34
+ return context;
35
+ }
36
+ const ToastRoot = forwardRef(function Toast(_a, ref) {
37
+ var { className, duration = 300 } = _a, rest = __rest(_a, ["className", "duration"]);
38
+ const [isClosed, setIsClosed] = useState(false);
39
+ const [isRemoved, setIsRemoved] = useState(false);
40
+ if (isRemoved)
41
+ return null;
42
+ return (_jsx(ToastContext.Provider, { value: { duration, isClosed, isRemoved, setIsClosed, setIsRemoved }, children: _jsx("div", Object.assign({ ref: ref, "data-testid": "flowbite-toast", role: "alert", className: cn(t.root.base, durationClasses[duration], isClosed && t.root.closed, className) }, rest)) }));
43
+ });
44
+ export const ToastToggle = forwardRef(function ToastToggle(_a, ref) {
45
+ var { className, onClick, onDismiss, xIcon: Icon = XIcon } = _a, rest = __rest(_a, ["className", "onClick", "onDismiss", "xIcon"]);
46
+ const { duration, isClosed, isRemoved, setIsClosed, setIsRemoved } = useToastContext();
47
+ function handleClick(e) {
48
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
49
+ if (onDismiss) {
50
+ onDismiss();
51
+ return;
52
+ }
53
+ setIsClosed(!isClosed);
54
+ setTimeout(() => setIsRemoved(!isRemoved), duration);
55
+ }
56
+ return (_jsx("button", Object.assign({ ref: ref, "aria-label": "Close", onClick: handleClick, type: "button", className: cn(t.toggle.base, className) }, rest, { children: _jsx(Icon, { "aria-hidden": true, className: t.toggle.icon }) })));
57
+ });
58
+ export const Toast = Object.assign(ToastRoot, { Toggle: ToastToggle });
@@ -0,0 +1,54 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ import type { DynamicStringEnumKeysOf } from './types';
3
+ declare const t: {
4
+ readonly root: {
5
+ readonly base: "group flex rounded-lg focus:outline-none relative items-center";
6
+ readonly active: {
7
+ readonly on: "cursor-pointer";
8
+ readonly off: "cursor-not-allowed opacity-50";
9
+ };
10
+ readonly label: "ms-3 mt-0.5 text-start text-sm font-medium text-gray-900 dark:text-gray-300 ml-3";
11
+ readonly input: "sr-only";
12
+ };
13
+ readonly toggle: {
14
+ readonly base: "relative rounded-full after:absolute after:rounded-full after:border after:bg-white after:transition-all group-focus:ring-4 toggle-bg border";
15
+ readonly checked: {
16
+ readonly on: "after:translate-x-full rtl:after:-translate-x-full after:border-white";
17
+ readonly off: "after:border-gray-300 border-gray-200 bg-zinc-200 dark:border-gray-600 dark:bg-zinc-700";
18
+ readonly color: {
19
+ readonly default: "group-focus:ring-primary-300 dark:group-focus:ring-primary-800 border-primary-600 bg-primary-600";
20
+ readonly blue: "group-focus:ring-blue-300 dark:group-focus:ring-blue-800 border-primary-600 bg-primary-600";
21
+ readonly dark: "group-focus:ring-gray-300 dark:group-focus:ring-gray-800 border-gray-900 bg-zinc-800";
22
+ readonly failure: "bg-red-700 group-focus:ring-red-300 dark:group-focus:ring-red-800 border-red-700";
23
+ readonly gray: "group-focus:ring-gray-300 dark:group-focus:ring-gray-800 border-gray-500 bg-zinc-500";
24
+ readonly green: "bg-green-600 group-focus:ring-green-300 dark:group-focus:ring-green-800 border-green-600";
25
+ readonly light: "group-focus:ring-gray-300 dark:group-focus:ring-gray-800 border-gray-200 bg-zinc-100";
26
+ readonly red: "bg-red-700 group-focus:ring-red-300 dark:group-focus:ring-red-800 border-red-700";
27
+ readonly purple: "bg-purple-700 group-focus:ring-purple-300 dark:group-focus:ring-purple-800 border-purple-700";
28
+ readonly success: "bg-green-500 group-focus:ring-green-300 dark:group-focus:ring-green-800 border-green-500";
29
+ readonly yellow: "group-focus:ring-yellow-300 dark:group-focus:ring-yellow-800 border-amber-400 bg-amber-400";
30
+ readonly warning: "group-focus:ring-yellow-300 dark:group-focus:ring-yellow-800 border-amber-600 bg-amber-600";
31
+ readonly cyan: "bg-cyan-500 group-focus:ring-cyan-300 dark:group-focus:ring-cyan-800 border-cyan-500";
32
+ readonly lime: "group-focus:ring-lime-300 dark:group-focus:ring-lime-800 border-lime-500 bg-lime-500";
33
+ readonly indigo: "group-focus:ring-indigo-300 dark:group-focus:ring-indigo-800 border-indigo-500 bg-indigo-500";
34
+ readonly teal: "group-focus:ring-teal-300 dark:group-focus:ring-teal-800 border-teal-600 bg-teal-600";
35
+ readonly info: "bg-cyan-600 group-focus:ring-cyan-300 dark:group-focus:ring-cyan-800";
36
+ readonly pink: "bg-pink-600 group-focus:ring-pink-300 dark:group-focus:ring-pink-800 border-pink-600";
37
+ };
38
+ };
39
+ readonly sizes: {
40
+ readonly sm: "h-5 w-9 min-w-9 after:h-4 after:w-4 rtl:after:right-0.5 after:absolute after:top-[2px] after:left-[2px]";
41
+ readonly md: "h-6 w-11 min-w-11 after:h-5 after:w-5 rtl:after:right-0.5 after:absolute after:top-[2px] after:left-[2px]";
42
+ readonly lg: "h-7 min-w-[52px] after:top-0.5 after:h-6 after:w-6 rtl:after:right-0.5 w-14 after:absolute after:left-[4px]";
43
+ };
44
+ };
45
+ };
46
+ export interface ToggleSwitchProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onChange' | 'color'> {
47
+ checked: boolean;
48
+ color?: DynamicStringEnumKeysOf<typeof t.toggle.checked.color>;
49
+ sizing?: DynamicStringEnumKeysOf<typeof t.toggle.sizes>;
50
+ label?: string;
51
+ onChange: (checked: boolean) => void;
52
+ }
53
+ export declare const ToggleSwitch: import("react").ForwardRefExoticComponent<ToggleSwitchProps & import("react").RefAttributes<HTMLInputElement>>;
54
+ export {};
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { forwardRef, useId, } from 'react';
15
+ import { cn } from './cn';
16
+ import { themeDefaults } from './theme-defaults';
17
+ const t = themeDefaults.toggleSwitch;
18
+ export const ToggleSwitch = forwardRef(function ToggleSwitch(_a, ref) {
19
+ var { checked, className, color = 'default', sizing = 'md', disabled, label, name, onChange } = _a, rest = __rest(_a, ["checked", "className", "color", "sizing", "disabled", "label", "name", "onChange"]);
20
+ const id = useId();
21
+ function handleOnKeyDown(event) {
22
+ if (event.code === 'Enter')
23
+ event.preventDefault();
24
+ }
25
+ return (_jsxs(_Fragment, { children: [_jsx("input", { ref: ref, checked: checked, name: name, type: "checkbox", className: t.root.input, readOnly: true, hidden: true }), _jsxs("button", Object.assign({ "aria-checked": checked, "aria-labelledby": `${id}-flowbite-toggleswitch-label`, disabled: disabled, id: `${id}-flowbite-toggleswitch`, onClick: () => onChange(!checked), onKeyDown: handleOnKeyDown, role: "switch", tabIndex: 0, type: "button", className: cn(t.root.base, t.root.active[disabled ? 'off' : 'on'], className) }, rest, { children: [_jsx("div", { "data-testid": "flowbite-toggleswitch-toggle", className: cn(t.toggle.base, t.toggle.checked.color[color], t.toggle.checked[checked ? 'on' : 'off'], t.toggle.sizes[sizing]) }), !!(label === null || label === void 0 ? void 0 : label.length) && (_jsx("span", { "data-testid": "flowbite-toggleswitch-label", id: `${id}-flowbite-toggleswitch-label`, className: t.root.label, children: label }))] }))] }));
26
+ });
@@ -0,0 +1,3 @@
1
+ import { type FloatingProps } from './Floating';
2
+ export type TooltipProps = Omit<FloatingProps, 'theme'>;
3
+ export declare function Tooltip({ animation, arrow, children, className, content, placement, style, trigger, ...rest }: TooltipProps): import("react").JSX.Element;
package/ui/Tooltip.js ADDED
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Floating } from './Floating';
15
+ import { themeDefaults } from './theme-defaults';
16
+ export function Tooltip(_a) {
17
+ var { animation = 'duration-300', arrow = true, children, className, content, placement = 'top', style = 'dark', trigger = 'hover' } = _a, rest = __rest(_a, ["animation", "arrow", "children", "className", "content", "placement", "style", "trigger"]);
18
+ return (_jsx(Floating, Object.assign({ animation: animation, arrow: arrow, content: content, placement: placement, style: style, theme: themeDefaults.tooltip, trigger: trigger, className: className }, rest, { children: children })));
19
+ }
package/ui/cn.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Class merge for the owned UI layer: tailwind-merge with the same extra class
3
+ * groups flowbite-react registered, so a caller's `className` overrides the
4
+ * defaults the way it always has.
5
+ */
6
+ export declare const cn: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
package/ui/cn.js ADDED
@@ -0,0 +1,19 @@
1
+ import { extendTailwindMerge } from 'tailwind-merge';
2
+ /**
3
+ * Class merge for the owned UI layer: tailwind-merge with the same extra class
4
+ * groups flowbite-react registered, so a caller's `className` overrides the
5
+ * defaults the way it always has.
6
+ */
7
+ export const cn = extendTailwindMerge({
8
+ extend: {
9
+ classGroups: {
10
+ 'bg-image': [
11
+ 'bg-arrow-down-icon',
12
+ 'bg-check-icon',
13
+ 'bg-dash-icon',
14
+ 'bg-dot-icon',
15
+ ],
16
+ shadow: ['shadow-sm-light'],
17
+ },
18
+ },
19
+ });
package/ui/icons.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export declare const XIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
2
+ export declare const ChevronDownIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
3
+ export declare const SunIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
+ export declare const MoonIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
5
+ export declare const OutlineXIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
6
+ export declare const ChevronRightIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
7
+ export declare const ChevronLeftIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
8
+ export declare const ChevronUpIcon: import("react").ForwardRefExoticComponent<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
package/ui/icons.js ADDED
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ /* Icons lifted from flowbite-react 0.12.17 (MIT, Copyright (c) 2022 Themesberg). */
4
+ const filled = (path, displayName) => {
5
+ const Icon = forwardRef((props, ref) => (_jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "currentColor", stroke: "currentColor", strokeWidth: 0, viewBox: "0 0 20 20", ref: ref }, props, { children: _jsx("path", { fillRule: "evenodd", stroke: "none", d: path, clipRule: "evenodd" }) }))));
6
+ Icon.displayName = displayName;
7
+ return Icon;
8
+ };
9
+ const outlined = (path, displayName) => {
10
+ const Icon = forwardRef((props, ref) => (_jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: 2, viewBox: "0 0 24 24", ref: ref }, props, { children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: path }) }))));
11
+ Icon.displayName = displayName;
12
+ return Icon;
13
+ };
14
+ export const XIcon = filled('M4.293 4.293a1 1 0 0 1 1.414 0L10 8.586l4.293-4.293a1 1 0 1 1 1.414 1.414L11.414 10l4.293 4.293a1 1 0 0 1-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 0 1-1.414-1.414L8.586 10 4.293 5.707a1 1 0 0 1 0-1.414z', 'XIcon');
15
+ export const ChevronDownIcon = filled('M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414z', 'ChevronDownIcon');
16
+ export const SunIcon = filled('M10 2a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1zm4 8a4 4 0 1 1-8 0 4 4 0 0 1 8 0zm-.464 4.95.707.707a1 1 0 0 0 1.414-1.414l-.707-.707a1 1 0 0 0-1.414 1.414zm2.12-10.607a1 1 0 0 1 0 1.414l-.706.707a1 1 0 1 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 0zM17 11a1 1 0 1 0 0-2h-1a1 1 0 1 0 0 2h1zm-7 4a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1zM5.05 6.464A1 1 0 1 0 6.465 5.05l-.708-.707a1 1 0 0 0-1.414 1.414l.707.707zm1.414 8.486-.707.707a1 1 0 0 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 1.414zM4 11a1 1 0 1 0 0-2H3a1 1 0 0 0 0 2h1z', 'SunIcon');
17
+ export const MoonIcon = forwardRef((props, ref) => (_jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "currentColor", stroke: "currentColor", strokeWidth: 0, viewBox: "0 0 20 20", ref: ref }, props, { children: _jsx("path", { stroke: "none", d: "M17.293 13.293A8 8 0 0 1 6.707 2.707a8.001 8.001 0 1 0 10.586 10.586z" }) }))));
18
+ MoonIcon.displayName = 'MoonIcon';
19
+ export const OutlineXIcon = outlined('M6 18 18 6M6 6l12 12', 'OutlineXIcon');
20
+ export const ChevronRightIcon = outlined('m9 5 7 7-7 7', 'ChevronRightIcon');
21
+ export const ChevronLeftIcon = outlined('m15 19-7-7 7-7', 'ChevronLeftIcon');
22
+ export const ChevronUpIcon = outlined('m5 15 7-7 7 7', 'ChevronUpIcon');