@robosystems/core 0.17.1 → 0.18.1

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 (122) hide show
  1. package/README.md +4 -3
  2. package/auth-components/AppSwitcher.js +2 -3
  3. package/components/EntitySelector.js +1 -1
  4. package/components/RepositoryGuard.js +1 -1
  5. package/components/console/ConsoleContent.js +1 -1
  6. package/components/report-chat/ReportChat.d.ts +13 -0
  7. package/components/report-chat/ReportChat.js +1 -1
  8. package/components/repositories/ActiveSubscriptions.js +1 -1
  9. package/components/repositories/BrowseRepositories.js +1 -1
  10. package/components/search/SearchBar.js +1 -1
  11. package/components/search/SearchContent.js +1 -1
  12. package/components/search/SearchHitCard.js +1 -1
  13. package/components/search/SearchPagination.js +1 -1
  14. package/hooks/use-toast.d.ts +1 -1
  15. package/hooks/use-toast.js +2 -2
  16. package/index.d.ts +0 -1
  17. package/index.js +0 -1
  18. package/library/components/ElementBrowser.js +1 -1
  19. package/library/components/ElementDetail.js +1 -1
  20. package/library/components/LibraryHierarchy.js +1 -1
  21. package/library/components/TaxonomySidebar.js +1 -1
  22. package/package.json +2 -2
  23. package/styles/forms.css +478 -0
  24. package/styles/palette.css +265 -0
  25. package/ui/Alert.d.ts +66 -0
  26. package/ui/Alert.js +24 -0
  27. package/ui/Badge.d.ts +50 -0
  28. package/ui/Badge.js +21 -0
  29. package/ui/Breadcrumb.d.ts +10 -0
  30. package/ui/Breadcrumb.js +31 -0
  31. package/ui/Button.d.ts +76 -0
  32. package/ui/Button.js +26 -0
  33. package/ui/Card.d.ts +32 -0
  34. package/ui/Card.js +26 -0
  35. package/ui/Checkbox.d.ts +33 -0
  36. package/ui/Checkbox.js +21 -0
  37. package/ui/Dropdown.d.ts +67 -0
  38. package/ui/Dropdown.js +134 -0
  39. package/ui/FileInput.d.ts +23 -0
  40. package/ui/FileInput.js +21 -0
  41. package/ui/Floating.d.ts +96 -0
  42. package/ui/Floating.js +92 -0
  43. package/ui/HelperText.d.ts +19 -0
  44. package/ui/HelperText.js +21 -0
  45. package/ui/Label.d.ts +21 -0
  46. package/ui/Label.js +21 -0
  47. package/ui/Modal.d.ts +85 -0
  48. package/ui/Modal.js +73 -0
  49. package/ui/Navbar.d.ts +14 -0
  50. package/ui/Navbar.js +35 -0
  51. package/ui/Progress.d.ts +40 -0
  52. package/ui/Progress.js +26 -0
  53. package/ui/Radio.d.ts +31 -0
  54. package/ui/Radio.js +21 -0
  55. package/ui/Select.d.ts +49 -0
  56. package/ui/Select.js +21 -0
  57. package/ui/Sidebar.d.ts +114 -0
  58. package/ui/Sidebar.js +76 -0
  59. package/ui/Spinner.d.ts +60 -0
  60. package/ui/Spinner.js +22 -0
  61. package/ui/Table.d.ts +23 -0
  62. package/ui/Table.js +57 -0
  63. package/ui/Tabs.d.ts +78 -0
  64. package/ui/Tabs.js +64 -0
  65. package/ui/TextInput.d.ts +58 -0
  66. package/ui/TextInput.js +21 -0
  67. package/ui/Textarea.d.ts +22 -0
  68. package/ui/Textarea.js +21 -0
  69. package/ui/ThemeModeScript.d.ts +21 -0
  70. package/ui/ThemeModeScript.js +74 -0
  71. package/ui/Toast.d.ts +24 -0
  72. package/ui/Toast.js +58 -0
  73. package/ui/ToggleSwitch.d.ts +54 -0
  74. package/ui/ToggleSwitch.js +26 -0
  75. package/ui/Tooltip.d.ts +3 -0
  76. package/ui/Tooltip.js +19 -0
  77. package/ui/cn.d.ts +6 -0
  78. package/ui/cn.js +19 -0
  79. package/ui/icons.d.ts +8 -0
  80. package/ui/icons.js +22 -0
  81. package/ui/index.d.ts +37 -0
  82. package/ui/index.js +36 -0
  83. package/ui/merge-theme.d.ts +15 -0
  84. package/ui/merge-theme.js +26 -0
  85. package/ui/theme-defaults.d.ts +821 -0
  86. package/ui/theme-defaults.js +824 -0
  87. package/ui/theme-mode.d.ts +15 -0
  88. package/ui/theme-mode.js +92 -0
  89. package/ui/types.d.ts +6 -0
  90. package/ui/types.js +1 -0
  91. package/ui-components/ConfirmModal.js +1 -1
  92. package/ui-components/StatCard.js +1 -1
  93. package/ui-components/api-keys/ApiKeyDisplay.d.ts +0 -1
  94. package/ui-components/api-keys/ApiKeyDisplay.js +3 -3
  95. package/ui-components/api-keys/CreateApiKeyModal.d.ts +0 -1
  96. package/ui-components/api-keys/CreateApiKeyModal.js +4 -4
  97. package/ui-components/api-keys/SecureApiKeyField.js +1 -1
  98. package/ui-components/chat/ChatInputArea.js +1 -1
  99. package/ui-components/chat/ChatMessage.js +1 -1
  100. package/ui-components/chat/DeepResearchToggle.js +1 -1
  101. package/ui-components/forms/CategoryInput.js +1 -1
  102. package/ui-components/forms/SettingsCard.d.ts +0 -1
  103. package/ui-components/forms/SettingsCard.js +3 -3
  104. package/ui-components/forms/SettingsFormField.d.ts +0 -1
  105. package/ui-components/forms/SettingsFormField.js +3 -3
  106. package/ui-components/forms/StatusAlert.d.ts +0 -1
  107. package/ui-components/forms/StatusAlert.js +3 -3
  108. package/ui-components/forms/TagInput.d.ts +1 -1
  109. package/ui-components/forms/TagInput.js +1 -1
  110. package/ui-components/layout/CoreNavbar.js +7 -8
  111. package/ui-components/layout/CoreSidebar.js +12 -13
  112. package/ui-components/layout/ThemeToggle.js +1 -1
  113. package/ui-components/settings/GeneralInformationCard.d.ts +0 -1
  114. package/ui-components/settings/GeneralInformationCard.js +3 -3
  115. package/ui-components/settings/PasswordInformationCard.d.ts +0 -1
  116. package/ui-components/settings/PasswordInformationCard.js +4 -4
  117. package/ui-components/settings/SettingsPageHeader.js +1 -1
  118. package/ui-components/support/SupportModal.js +1 -1
  119. package/theme/flowbite-theme.d.ts +0 -758
  120. package/theme/flowbite-theme.js +0 -769
  121. package/theme/index.d.ts +0 -1
  122. package/theme/index.js +0 -1
@@ -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');
package/ui/index.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The owned UI primitives: flowbite-react's prop names, RoboSystems' look as the
3
+ * defaults, no runtime theme machinery. Import from `@robosystems/core/ui`.
4
+ *
5
+ * Stylesheets that go with them: `@robosystems/core/styles/palette.css` and
6
+ * `@robosystems/core/styles/forms.css` (imported from each app's globals.css).
7
+ */
8
+ export { Alert, type AlertColor, type AlertProps, type AlertTheme, } from './Alert';
9
+ export { Badge, type BadgeColor, type BadgeProps, type BadgeSize, } from './Badge';
10
+ export { Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, } from './Breadcrumb';
11
+ export { Button, type ButtonColor, type ButtonProps, type ButtonSize, } from './Button';
12
+ export { Card, type CardProps, type CardTheme } from './Card';
13
+ export { Checkbox, type CheckboxColor, type CheckboxProps } from './Checkbox';
14
+ export { cn } from './cn';
15
+ export { Dropdown, DropdownDivider, DropdownHeader, DropdownItem, type DropdownDividerProps, type DropdownHeaderProps, type DropdownItemProps, type DropdownProps, } from './Dropdown';
16
+ export { FileInput, type FileInputProps } from './FileInput';
17
+ export type { FloatingPlacement, FloatingStyle, FloatingTrigger, } from './Floating';
18
+ export { HelperText, type HelperTextProps } from './HelperText';
19
+ export { Label, type LabelProps } from './Label';
20
+ export { mergeTheme, type DeepPartial } from './merge-theme';
21
+ export { Modal, ModalBody, ModalFooter, ModalHeader, type ModalBodyProps, type ModalFooterProps, type ModalHeaderProps, type ModalPosition, type ModalProps, type ModalSize, type ModalTheme, } from './Modal';
22
+ export { Navbar, NavbarBrand, type NavbarBrandProps, type NavbarProps, } from './Navbar';
23
+ export { Progress, type ProgressProps } from './Progress';
24
+ export { Radio, type RadioColor, type RadioProps } from './Radio';
25
+ export { Select, type SelectProps } from './Select';
26
+ export { Sidebar, SidebarCollapse, SidebarItem, SidebarItemGroup, SidebarItems, type SidebarCollapseProps, type SidebarItemGroupProps, type SidebarItemProps, type SidebarItemsProps, type SidebarProps, } from './Sidebar';
27
+ export { Spinner, type SpinnerProps } from './Spinner';
28
+ export { Table, TableBody, TableCell, TableHead, TableHeadCell, TableRow, type TableBodyProps, type TableCellProps, type TableHeadCellProps, type TableHeadProps, type TableProps, type TableRowProps, } from './Table';
29
+ export { TabItem, Tabs, type TabItemProps, type TabsProps, type TabsRef, } from './Tabs';
30
+ export { Textarea, type TextareaProps } from './Textarea';
31
+ export { TextInput, type TextInputProps } from './TextInput';
32
+ export { themeDefaults, type ThemeDefaults } from './theme-defaults';
33
+ export { DarkThemeToggle, useThemeMode, type DarkThemeToggleProps, } from './theme-mode';
34
+ export { DEFAULT_THEME_MODE, THEME_MODE_STORAGE_KEY, ThemeModeScript, getThemeModeScript, type ThemeMode, type ThemeModeScriptProps, } from './ThemeModeScript';
35
+ export { Toast, ToastToggle, type ToastDuration, type ToastProps, type ToastToggleProps, } from './Toast';
36
+ export { ToggleSwitch, type ToggleSwitchProps } from './ToggleSwitch';
37
+ export { Tooltip, type TooltipProps } from './Tooltip';
package/ui/index.js ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The owned UI primitives: flowbite-react's prop names, RoboSystems' look as the
3
+ * defaults, no runtime theme machinery. Import from `@robosystems/core/ui`.
4
+ *
5
+ * Stylesheets that go with them: `@robosystems/core/styles/palette.css` and
6
+ * `@robosystems/core/styles/forms.css` (imported from each app's globals.css).
7
+ */
8
+ export { Alert, } from './Alert';
9
+ export { Badge, } from './Badge';
10
+ export { Breadcrumb, BreadcrumbItem, } from './Breadcrumb';
11
+ export { Button, } from './Button';
12
+ export { Card } from './Card';
13
+ export { Checkbox } from './Checkbox';
14
+ export { cn } from './cn';
15
+ export { Dropdown, DropdownDivider, DropdownHeader, DropdownItem, } from './Dropdown';
16
+ export { FileInput } from './FileInput';
17
+ export { HelperText } from './HelperText';
18
+ export { Label } from './Label';
19
+ export { mergeTheme } from './merge-theme';
20
+ export { Modal, ModalBody, ModalFooter, ModalHeader, } from './Modal';
21
+ export { Navbar, NavbarBrand, } from './Navbar';
22
+ export { Progress } from './Progress';
23
+ export { Radio } from './Radio';
24
+ export { Select } from './Select';
25
+ export { Sidebar, SidebarCollapse, SidebarItem, SidebarItemGroup, SidebarItems, } from './Sidebar';
26
+ export { Spinner } from './Spinner';
27
+ export { Table, TableBody, TableCell, TableHead, TableHeadCell, TableRow, } from './Table';
28
+ export { TabItem, Tabs, } from './Tabs';
29
+ export { Textarea } from './Textarea';
30
+ export { TextInput } from './TextInput';
31
+ export { themeDefaults } from './theme-defaults';
32
+ export { DarkThemeToggle, useThemeMode, } from './theme-mode';
33
+ export { DEFAULT_THEME_MODE, THEME_MODE_STORAGE_KEY, ThemeModeScript, getThemeModeScript, } from './ThemeModeScript';
34
+ export { Toast, ToastToggle, } from './Toast';
35
+ export { ToggleSwitch } from './ToggleSwitch';
36
+ export { Tooltip } from './Tooltip';
@@ -0,0 +1,15 @@
1
+ type ThemeShape = {
2
+ [key: string]: string | ThemeShape;
3
+ };
4
+ export type DeepPartial<T> = {
5
+ [K in keyof T]?: T[K] extends string ? string : T[K] extends object ? DeepPartial<T[K]> : T[K];
6
+ };
7
+ /**
8
+ * A per-call override merged over a component's resolved defaults: strings
9
+ * merge with `cn`, objects merge key by key. This is the one piece of
10
+ * flowbite-react's `theme` prop the apps actually used (a handful of call
11
+ * sites override a nested slot such as a modal's inner panel); there is no
12
+ * provider, store or resolver behind it.
13
+ */
14
+ export declare function mergeTheme<T extends ThemeShape>(defaults: T, override?: DeepPartial<T>): T;
15
+ export {};
@@ -0,0 +1,26 @@
1
+ import { cn } from './cn';
2
+ /**
3
+ * A per-call override merged over a component's resolved defaults: strings
4
+ * merge with `cn`, objects merge key by key. This is the one piece of
5
+ * flowbite-react's `theme` prop the apps actually used (a handful of call
6
+ * sites override a nested slot such as a modal's inner panel); there is no
7
+ * provider, store or resolver behind it.
8
+ */
9
+ export function mergeTheme(defaults, override) {
10
+ if (!override)
11
+ return defaults;
12
+ const out = Object.assign({}, defaults);
13
+ for (const key of Object.keys(override)) {
14
+ const base = defaults[key];
15
+ const extra = override[key];
16
+ if (extra === undefined)
17
+ continue;
18
+ if (typeof base === 'string' && typeof extra === 'string') {
19
+ out[key] = cn(base, extra);
20
+ }
21
+ else if (typeof base === 'object' && typeof extra === 'object') {
22
+ out[key] = mergeTheme(base, extra);
23
+ }
24
+ }
25
+ return out;
26
+ }