@mriqbox/ui-kit 3.5.0 → 3.5.2

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 (28) hide show
  1. package/bin/cli.js +1 -1
  2. package/dist/components/molecules/MriActionCard.d.ts +38 -0
  3. package/dist/components/molecules/MriActionCard.stories.d.ts +122 -0
  4. package/dist/components/molecules/MriButtonGroup.d.ts +2 -1
  5. package/dist/components/molecules/MriButtonGroup.stories.d.ts +1 -0
  6. package/dist/components/molecules/MriEconomyCard.d.ts +4 -1
  7. package/dist/components/molecules/MriEconomyCard.stories.d.ts +2 -0
  8. package/dist/components/molecules/MriPlayerVitals.d.ts +3 -1
  9. package/dist/components/molecules/MriPlayerVitals.stories.d.ts +4 -0
  10. package/dist/components/molecules/MriSelect.d.ts +34 -0
  11. package/dist/components/molecules/MriSelect.stories.d.ts +35 -0
  12. package/dist/components/molecules/MriVitalAdjustModal.d.ts +4 -1
  13. package/dist/components/molecules/MriVitalAdjustModal.stories.d.ts +1 -0
  14. package/dist/index.d.ts +2 -5
  15. package/dist/index.es.js +4143 -4154
  16. package/dist/index.umd.js +65 -55
  17. package/dist/style.css +1 -1
  18. package/package.json +89 -81
  19. package/dist/components/molecules/MriActionButton.d.ts +0 -9
  20. package/dist/components/molecules/MriActionButton.stories.d.ts +0 -30
  21. package/dist/components/molecules/MriActionDropdown.d.ts +0 -28
  22. package/dist/components/molecules/MriActionDropdown.stories.d.ts +0 -51
  23. package/dist/components/molecules/MriCreatableCombobox.d.ts +0 -17
  24. package/dist/components/molecules/MriCreatableCombobox.stories.d.ts +0 -8
  25. package/dist/components/molecules/MriMultiSelect.d.ts +0 -19
  26. package/dist/components/molecules/MriMultiSelect.stories.d.ts +0 -11
  27. package/dist/components/molecules/MriSelectSearch.d.ts +0 -21
  28. package/dist/components/molecules/MriSelectSearch.stories.d.ts +0 -10
package/bin/cli.js CHANGED
@@ -177,7 +177,7 @@ async function checkDependencies(filePath, installDir) {
177
177
  program
178
178
  .name('mri-ui')
179
179
  .description('Add Mri UI components to your project')
180
- .version('3.5.0');
180
+ .version('3.5.2');
181
181
 
182
182
  program
183
183
  .command('add <component>')
@@ -0,0 +1,38 @@
1
+ import { LucideIcon } from 'lucide-react';
2
+ import { ComponentType } from 'react';
3
+
4
+ export interface MriActionCardOption {
5
+ value: string;
6
+ label: string;
7
+ }
8
+ export type MriActionCardItemType = "text" | "dropdown" | "button";
9
+ export interface MriActionCardItem {
10
+ id: string;
11
+ label: string;
12
+ option: MriActionCardItemType;
13
+ placeholder?: string;
14
+ disabled?: boolean;
15
+ options?: MriActionCardOption[];
16
+ onTextChange?: (id: string, value: string) => void;
17
+ onDropdownSelect?: (id: string, val: MriActionCardOption) => void;
18
+ onButtonClick?: (item: MriActionCardItem) => void;
19
+ selectedValue?: string;
20
+ selectedLabel?: string;
21
+ searchPlaceholder?: string;
22
+ noneFoundText?: string;
23
+ selectPlaceholder?: string;
24
+ }
25
+ export interface MriActionCardProps {
26
+ id?: string;
27
+ label: string;
28
+ icon?: LucideIcon | ComponentType<{
29
+ className?: string;
30
+ }>;
31
+ isFavorite?: boolean;
32
+ isProcessing?: boolean;
33
+ disabled?: boolean;
34
+ onClick?: () => void;
35
+ onToggleFavorite?: (id: string) => void;
36
+ items?: MriActionCardItem[];
37
+ }
38
+ export declare const MriActionCard: ({ id, label, icon: Icon, isFavorite, isProcessing, disabled, onClick, onToggleFavorite, items, }: MriActionCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,122 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: ({ id, label, icon: Icon, isFavorite, isProcessing, disabled, onClick, onToggleFavorite, items, }: import('./MriActionCard').MriActionCardProps) => import("react/jsx-runtime").JSX.Element;
4
+ argTypes: {
5
+ onClick: {
6
+ action: string;
7
+ };
8
+ onToggleFavorite: {
9
+ action: string;
10
+ };
11
+ };
12
+ };
13
+ export default _default;
14
+ export declare const Button: {
15
+ args: {
16
+ label: string;
17
+ icon: (props?: {
18
+ className?: string;
19
+ }) => import("react/jsx-runtime").JSX.Element;
20
+ };
21
+ };
22
+ export declare const Favorite: {
23
+ args: {
24
+ label: string;
25
+ isFavorite: boolean;
26
+ };
27
+ };
28
+ export declare const Processing: {
29
+ args: {
30
+ label: string;
31
+ isProcessing: boolean;
32
+ };
33
+ };
34
+ export declare const Disabled: {
35
+ args: {
36
+ label: string;
37
+ disabled: boolean;
38
+ };
39
+ };
40
+ export declare const WithCustomIcons: {
41
+ render: () => import("react/jsx-runtime").JSX.Element;
42
+ };
43
+ export declare const Expandable: {
44
+ args: {
45
+ label: string;
46
+ icon: (props?: {
47
+ className?: string;
48
+ }) => import("react/jsx-runtime").JSX.Element;
49
+ items: ({
50
+ id: string;
51
+ label: string;
52
+ option: string;
53
+ options: {
54
+ value: string;
55
+ label: string;
56
+ }[];
57
+ selectedLabel: string;
58
+ searchPlaceholder: string;
59
+ noneFoundText: string;
60
+ placeholder?: undefined;
61
+ } | {
62
+ id: string;
63
+ label: string;
64
+ option: string;
65
+ placeholder: string;
66
+ options?: undefined;
67
+ selectedLabel?: undefined;
68
+ searchPlaceholder?: undefined;
69
+ noneFoundText?: undefined;
70
+ } | {
71
+ id: string;
72
+ label: string;
73
+ option: string;
74
+ options?: undefined;
75
+ selectedLabel?: undefined;
76
+ searchPlaceholder?: undefined;
77
+ noneFoundText?: undefined;
78
+ placeholder?: undefined;
79
+ })[];
80
+ };
81
+ };
82
+ export declare const ExpandableDisabled: {
83
+ args: {
84
+ label: string;
85
+ icon: (props?: {
86
+ className?: string;
87
+ }) => import("react/jsx-runtime").JSX.Element;
88
+ disabled: boolean;
89
+ items: ({
90
+ id: string;
91
+ label: string;
92
+ option: string;
93
+ placeholder: string;
94
+ } | {
95
+ id: string;
96
+ label: string;
97
+ option: string;
98
+ placeholder?: undefined;
99
+ })[];
100
+ };
101
+ };
102
+ export declare const ExpandablePartialDisabled: {
103
+ args: {
104
+ label: string;
105
+ icon: (props?: {
106
+ className?: string;
107
+ }) => import("react/jsx-runtime").JSX.Element;
108
+ items: ({
109
+ id: string;
110
+ label: string;
111
+ option: string;
112
+ placeholder: string;
113
+ disabled: boolean;
114
+ } | {
115
+ id: string;
116
+ label: string;
117
+ option: string;
118
+ disabled: boolean;
119
+ placeholder?: undefined;
120
+ })[];
121
+ };
122
+ };
@@ -6,7 +6,8 @@ type Action = {
6
6
  onClick?: () => void;
7
7
  disabled?: boolean;
8
8
  };
9
- export default function MriButtonGroup({ buttons }: {
9
+ export default function MriButtonGroup({ buttons, disabled }: {
10
10
  buttons: Action[];
11
+ disabled?: boolean;
11
12
  }): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -6,3 +6,4 @@ export default meta;
6
6
  type Story = StoryObj<typeof MriButtonGroup>;
7
7
  export declare const Default: Story;
8
8
  export declare const DisabledItem: Story;
9
+ export declare const AllDisabled: Story;
@@ -4,5 +4,8 @@ export interface MriEconomyCardProps {
4
4
  amountColorClass?: string;
5
5
  onAdd?: () => void;
6
6
  onRemove?: () => void;
7
+ disableAdd?: boolean;
8
+ disableRemove?: boolean;
9
+ defaultVisible?: boolean;
7
10
  }
8
- export declare function MriEconomyCard({ label, amount, amountColorClass, onAdd, onRemove }: MriEconomyCardProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function MriEconomyCard({ label, amount, amountColorClass, onAdd, onRemove, disableAdd, disableRemove, defaultVisible, }: MriEconomyCardProps): import("react/jsx-runtime").JSX.Element;
@@ -6,3 +6,5 @@ export default meta;
6
6
  type Story = StoryObj<typeof MriEconomyCard>;
7
7
  export declare const Default: Story;
8
8
  export declare const Negative: Story;
9
+ export declare const HiddenByDefault: Story;
10
+ export declare const DisabledButtons: Story;
@@ -22,6 +22,8 @@ export interface MriPlayerVitalsProps {
22
22
  hunger?: string;
23
23
  thirst?: string;
24
24
  stress?: string;
25
+ dead?: string;
25
26
  };
27
+ disabledVitals?: string[];
26
28
  }
27
- export declare function MriPlayerVitals({ vitals, size, onAction, onIconClick, className, labels }: MriPlayerVitalsProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function MriPlayerVitals({ vitals, size, onAction, onIconClick, className, labels, disabledVitals }: MriPlayerVitalsProps): import("react/jsx-runtime").JSX.Element;
@@ -9,3 +9,7 @@ export declare const Mini: Story;
9
9
  export declare const Full: Story;
10
10
  export declare const CriticalState: Story;
11
11
  export declare const WithIconClick: Story;
12
+ export declare const PartialDisabled: Story;
13
+ export declare const AllDisabled: Story;
14
+ export declare const Dead: Story;
15
+ export declare const DeadFull: Story;
@@ -0,0 +1,34 @@
1
+ export interface MriSelectOption {
2
+ label: string;
3
+ value: string | number;
4
+ [key: string]: unknown;
5
+ }
6
+ type MriSelectBase = {
7
+ options: MriSelectOption[];
8
+ placeholder?: string;
9
+ searchPlaceholder?: string;
10
+ emptyMessage?: string;
11
+ className?: string;
12
+ disabled?: boolean;
13
+ isLoading?: boolean;
14
+ error?: boolean | string;
15
+ portal?: boolean;
16
+ size?: "default" | "sm";
17
+ createLabelPrefix?: string;
18
+ };
19
+ type MriSelectSingleProps = MriSelectBase & {
20
+ multiple?: false;
21
+ value: string | number;
22
+ onChange: (value: string) => void;
23
+ clearable?: boolean;
24
+ creatable?: boolean;
25
+ };
26
+ type MriSelectMultipleProps = MriSelectBase & {
27
+ multiple: true;
28
+ value: (string | number)[];
29
+ onChange: (value: (string | number)[]) => void;
30
+ maxVisibleValues?: number;
31
+ };
32
+ export type MriSelectProps = MriSelectSingleProps | MriSelectMultipleProps;
33
+ export declare function MriSelect(props: MriSelectProps): import("react/jsx-runtime").JSX.Element;
34
+ export {};
@@ -0,0 +1,35 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { MriSelect } from './MriSelect';
3
+
4
+ declare const meta: Meta<typeof MriSelect>;
5
+ export default meta;
6
+ export declare const Single: {
7
+ render: () => import("react/jsx-runtime").JSX.Element;
8
+ };
9
+ export declare const SingleClearable: {
10
+ render: () => import("react/jsx-runtime").JSX.Element;
11
+ };
12
+ export declare const SingleCreatable: {
13
+ render: () => import("react/jsx-runtime").JSX.Element;
14
+ };
15
+ export declare const SingleSmall: {
16
+ render: () => import("react/jsx-runtime").JSX.Element;
17
+ };
18
+ export declare const SingleLoading: {
19
+ render: () => import("react/jsx-runtime").JSX.Element;
20
+ };
21
+ export declare const SingleError: {
22
+ render: () => import("react/jsx-runtime").JSX.Element;
23
+ };
24
+ export declare const Multiple: {
25
+ render: () => import("react/jsx-runtime").JSX.Element;
26
+ };
27
+ export declare const MultipleWithMany: {
28
+ render: () => import("react/jsx-runtime").JSX.Element;
29
+ };
30
+ export declare const MultipleDisabled: {
31
+ render: () => import("react/jsx-runtime").JSX.Element;
32
+ };
33
+ export declare const MultipleError: {
34
+ render: () => import("react/jsx-runtime").JSX.Element;
35
+ };
@@ -25,5 +25,8 @@ export interface MriVitalAdjustModalProps {
25
25
  cancel?: string;
26
26
  playerNameLabel?: string;
27
27
  };
28
+ hideBlur?: boolean;
29
+ hideOverlay?: boolean;
30
+ disabled?: boolean;
28
31
  }
29
- export declare function MriVitalAdjustModal({ isOpen, onClose, onSubmit, vital, currentValue, playerName, labels, icon, showFullProgress, title, description, confirmLabel, cancelLabel, newValueLabel }: MriVitalAdjustModalProps): import("react/jsx-runtime").JSX.Element | null;
32
+ export declare function MriVitalAdjustModal({ isOpen, onClose, onSubmit, vital, currentValue, playerName, labels, icon, showFullProgress, title, description, confirmLabel, cancelLabel, newValueLabel, hideBlur, hideOverlay, disabled, }: MriVitalAdjustModalProps): import("react/jsx-runtime").JSX.Element | null;
@@ -12,3 +12,4 @@ export declare const Armor: Story;
12
12
  export declare const Hunger: Story;
13
13
  export declare const Thirst: Story;
14
14
  export declare const Stress: Story;
15
+ export declare const Disabled: Story;
package/dist/index.d.ts CHANGED
@@ -14,24 +14,21 @@ export * from './components/molecules/MriCompactSearch';
14
14
  export * from './components/molecules/MriDialog';
15
15
  export * from './components/molecules/MriModal';
16
16
  export * from './components/molecules/MriPopover';
17
- export * from './components/molecules/MriSelectSearch';
17
+ export * from './components/molecules/MriSelect';
18
18
  export * from './components/molecules/MriThemeToggle';
19
19
  export * from './components/molecules/MriTimePicker';
20
20
  export * from './components/molecules/MriCommand';
21
21
  export * from './components/molecules/MriCopyButton';
22
22
  export * from './components/molecules/MriEconomyCard';
23
- export * from './components/molecules/MriActionButton';
24
- export * from './components/molecules/MriActionDropdown';
23
+ export * from './components/molecules/MriActionCard';
25
24
  export * from './components/molecules/MriActionModal';
26
25
  export * from './components/molecules/MriGridActionButton';
27
26
  export * from './components/molecules/MriSearchInput';
28
27
  export * from './components/molecules/MriSectionHeader';
29
28
  export * from './components/molecules/MriDatePicker';
30
29
  export * from './components/molecules/MriColorPicker';
31
- export * from './components/molecules/MriCreatableCombobox';
32
30
  export * from './components/molecules/MriPlayerVitals';
33
31
  export * from './components/molecules/MriVitalAdjustModal';
34
- export * from './components/molecules/MriMultiSelect';
35
32
  export * from './components/organisms/MriCalendar';
36
33
  export * from './components/organisms/MriPageHeader';
37
34
  export * from './components/organisms/MriSidebar';