hazo_ui 2.7.0 → 2.7.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.
- package/README.md +150 -7
- package/dist/index.cjs +439 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -10
- package/dist/index.d.ts +167 -10
- package/dist/index.js +376 -63
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -174,6 +174,8 @@ The following components support both global config and prop-level color overrid
|
|
|
174
174
|
|
|
175
175
|
- **[HazoUiFlexRadio](#hazouiflexradio)** - A flexible radio button/icon selection component with support for single and multi-selection modes, customizable layouts, and react-icons integration. Perfect for settings panels, preference selection, and option groups.
|
|
176
176
|
|
|
177
|
+
- **[HazoUiPillRadio](#hazouipillradio)** - Pill-shaped radio selection buttons with optional icons, customizable accent colors, size variants, and equal-width support. Ideal for action choices, status selection, and compact option groups.
|
|
178
|
+
|
|
177
179
|
- **[HazoUiFlexInput](#hazouiflexinput)** - An enhanced input component with type validation, character restrictions, and error messaging. Supports numeric, alpha, email, and mixed input types with built-in validation and formatting guides.
|
|
178
180
|
|
|
179
181
|
- **[HazoUiRte](#hazouirte)** - A comprehensive rich text editor for email template generation with variable insertion support, file attachments, and full formatting controls. Built on Tiptap with support for tables, lists, images, and multiple view modes (HTML, Plain Text, Raw HTML).
|
|
@@ -186,6 +188,31 @@ The following components support both global config and prop-level color overrid
|
|
|
186
188
|
|
|
187
189
|
- **[HazoUiConfirmDialog](#hazouiconfirmdialog)** - A compact, opinionated confirmation dialog with accent top border, variant system (destructive, warning, info, success), async loading support, and configurable buttons. Perfect for delete confirmations, unsaved changes warnings, and simple acknowledgments.
|
|
188
190
|
|
|
191
|
+
### shadcn/ui Primitive Re-exports
|
|
192
|
+
|
|
193
|
+
All shadcn/ui base components are re-exported from hazo_ui, so sibling hazo_* packages (and consumers) can import UI primitives from a single source without installing shadcn/ui separately:
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
import { Button, Input, Label, Checkbox, Switch, Tabs, TabsList, TabsTrigger, TabsContent } from 'hazo_ui';
|
|
197
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from 'hazo_ui';
|
|
198
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from 'hazo_ui';
|
|
199
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from 'hazo_ui';
|
|
200
|
+
import { HoverCard, HoverCardTrigger, HoverCardContent } from 'hazo_ui';
|
|
201
|
+
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from 'hazo_ui';
|
|
202
|
+
import { Popover, PopoverTrigger, PopoverContent } from 'hazo_ui';
|
|
203
|
+
import { RadioGroup, RadioGroupItem } from 'hazo_ui';
|
|
204
|
+
import { Calendar, Textarea } from 'hazo_ui';
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Animation Utilities
|
|
208
|
+
|
|
209
|
+
Shared animation presets and resolver function are exported for use in custom dialog implementations:
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
import { ANIMATION_PRESETS, resolve_animation_classes } from 'hazo_ui';
|
|
213
|
+
import type { AnimationPreset } from 'hazo_ui';
|
|
214
|
+
```
|
|
215
|
+
|
|
189
216
|
---
|
|
190
217
|
|
|
191
218
|
## HazoUiMultiFilterDialog
|
|
@@ -859,6 +886,122 @@ The component supports the following react-icons packages:
|
|
|
859
886
|
|
|
860
887
|
---
|
|
861
888
|
|
|
889
|
+
## HazoUiPillRadio
|
|
890
|
+
|
|
891
|
+
Pill-shaped radio selection buttons with optional icons, customizable accent colors per pill, size variants, and equal-width support. Ideal for action choices, status selection, and compact option groups.
|
|
892
|
+
|
|
893
|
+
#### Features
|
|
894
|
+
|
|
895
|
+
- **Pill Design**: Rounded-full pill buttons with border, selected state shows accent color tint
|
|
896
|
+
- **Icon Support**: Integration with react-icons library (same icon sets as HazoUiFlexRadio)
|
|
897
|
+
- **Custom Colors**: Each pill can have its own accent color for the selected state
|
|
898
|
+
- **Size Variants**: Three sizes — `sm`, `md` (default), `lg`
|
|
899
|
+
- **Layout Options**: Horizontal (default) or vertical arrangement
|
|
900
|
+
- **Equal Width**: Optional `equal_width` prop makes all pills the same width
|
|
901
|
+
- **Auto-fit Vertical**: Vertical layout auto-fits to the widest pill instead of stretching full-width
|
|
902
|
+
- **Tooltips**: Hover tooltips with 1-second delay
|
|
903
|
+
- **Accessible**: Uses `role="radiogroup"` and `role="radio"` with `aria-checked`
|
|
904
|
+
|
|
905
|
+
#### Props
|
|
906
|
+
|
|
907
|
+
```typescript
|
|
908
|
+
interface HazoUiPillRadioItem {
|
|
909
|
+
label: string; // Text displayed in the pill
|
|
910
|
+
value: string; // Unique value identifier
|
|
911
|
+
icon?: string; // react-icons icon name (e.g., "FaFolder")
|
|
912
|
+
color?: string; // Accent color when selected (default: "#3b82f6" blue)
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
interface HazoUiPillRadioProps {
|
|
916
|
+
layout?: 'horizontal' | 'vertical'; // Layout direction (default: 'horizontal')
|
|
917
|
+
icon_set?: string; // Icon set package name (default: 'fa')
|
|
918
|
+
data: HazoUiPillRadioItem[]; // Array of pill options
|
|
919
|
+
value: string; // Controlled selected value
|
|
920
|
+
onChange: (value: string) => void; // Change handler
|
|
921
|
+
className?: string; // Additional CSS classes
|
|
922
|
+
pill_size?: 'sm' | 'md' | 'lg'; // Pill size variant (default: 'md')
|
|
923
|
+
equal_width?: boolean; // Make all pills equal width (default: false)
|
|
924
|
+
}
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
#### Usage
|
|
928
|
+
|
|
929
|
+
**Basic Horizontal Pills**
|
|
930
|
+
|
|
931
|
+
```tsx
|
|
932
|
+
import { HazoUiPillRadio, type HazoUiPillRadioItem } from 'hazo_ui';
|
|
933
|
+
import { useState } from 'react';
|
|
934
|
+
|
|
935
|
+
function ResponseSelector() {
|
|
936
|
+
const [selected, setSelected] = useState<string>('');
|
|
937
|
+
|
|
938
|
+
const options: HazoUiPillRadioItem[] = [
|
|
939
|
+
{ value: 'upload', label: 'Upload corrected document', icon: 'FaFolder' },
|
|
940
|
+
{ value: 'comment', label: 'Provide comment', icon: 'FaComment' },
|
|
941
|
+
];
|
|
942
|
+
|
|
943
|
+
return (
|
|
944
|
+
<HazoUiPillRadio
|
|
945
|
+
data={options}
|
|
946
|
+
value={selected}
|
|
947
|
+
onChange={setSelected}
|
|
948
|
+
/>
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
**Vertical Layout**
|
|
954
|
+
|
|
955
|
+
```tsx
|
|
956
|
+
<HazoUiPillRadio
|
|
957
|
+
data={options}
|
|
958
|
+
value={selected}
|
|
959
|
+
onChange={setSelected}
|
|
960
|
+
layout="vertical"
|
|
961
|
+
/>
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
**Custom Colors per Pill**
|
|
965
|
+
|
|
966
|
+
```tsx
|
|
967
|
+
const priority_options: HazoUiPillRadioItem[] = [
|
|
968
|
+
{ value: 'low', label: 'Low', icon: 'FaArrowDown', color: '#22c55e' },
|
|
969
|
+
{ value: 'medium', label: 'Medium', icon: 'FaMinus', color: '#f59e0b' },
|
|
970
|
+
{ value: 'high', label: 'High', icon: 'FaArrowUp', color: '#ef4444' },
|
|
971
|
+
];
|
|
972
|
+
|
|
973
|
+
<HazoUiPillRadio
|
|
974
|
+
data={priority_options}
|
|
975
|
+
value={selected}
|
|
976
|
+
onChange={setSelected}
|
|
977
|
+
/>
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
**Equal Width Pills**
|
|
981
|
+
|
|
982
|
+
```tsx
|
|
983
|
+
<HazoUiPillRadio
|
|
984
|
+
data={options}
|
|
985
|
+
value={selected}
|
|
986
|
+
onChange={setSelected}
|
|
987
|
+
equal_width
|
|
988
|
+
/>
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
**Different Icon Set and Size**
|
|
992
|
+
|
|
993
|
+
```tsx
|
|
994
|
+
<HazoUiPillRadio
|
|
995
|
+
data={options}
|
|
996
|
+
value={selected}
|
|
997
|
+
onChange={setSelected}
|
|
998
|
+
icon_set="md"
|
|
999
|
+
pill_size="lg"
|
|
1000
|
+
/>
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
---
|
|
1004
|
+
|
|
862
1005
|
## HazoUiFlexInput
|
|
863
1006
|
|
|
864
1007
|
An enhanced input component with type validation, character restrictions, and error messaging. Extends shadcn Input component with additional validation props for numeric, alpha, email, and mixed input types.
|
|
@@ -1962,7 +2105,7 @@ HazoUiDialog offers two approaches depending on your needs:
|
|
|
1962
2105
|
- **9 Animation Presets**: Zoom, slide (bottom/top/left/right), fade, bounce, scale-up, and flip animations
|
|
1963
2106
|
- **Header Bar Option**: Full-width colored header bar for modern modal designs
|
|
1964
2107
|
- **Color Customization**: Override header, body, footer, border, and accent colors via props
|
|
1965
|
-
- **Themed Variants**: Pre-built themes for success, warning,
|
|
2108
|
+
- **Themed Variants**: Pre-built themes for success, warning, destructive, and info states
|
|
1966
2109
|
- **Responsive Design**: Viewport-relative sizing with maximum constraints
|
|
1967
2110
|
- **Controlled Component**: Fully controlled open/close state
|
|
1968
2111
|
- **Callback Support**: Separate callbacks for confirm and cancel actions
|
|
@@ -2035,7 +2178,7 @@ interface HazoUiDialogProps {
|
|
|
2035
2178
|
showCloseButton?: boolean; // default: true
|
|
2036
2179
|
}
|
|
2037
2180
|
|
|
2038
|
-
type DialogVariant = 'default' | 'info' | 'success' | 'warning' | '
|
|
2181
|
+
type DialogVariant = 'default' | 'info' | 'success' | 'warning' | 'destructive';
|
|
2039
2182
|
type AnimationPreset = 'zoom' | 'slide' | 'fade' | 'bounce' | 'scale-up' | 'flip' | 'slide-left' | 'slide-right' | 'slide-top' | 'none';
|
|
2040
2183
|
type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
2041
2184
|
```
|
|
@@ -2577,9 +2720,9 @@ function ProgressDialog() {
|
|
|
2577
2720
|
|
|
2578
2721
|
#### Themed Dialogs (Variant Prop)
|
|
2579
2722
|
|
|
2580
|
-
Use the `variant` prop to apply preset color themes with a single prop instead of specifying individual colors. Available variants: `info`, `success`, `warning`, `
|
|
2723
|
+
Use the `variant` prop to apply preset color themes with a single prop instead of specifying individual colors. Available variants: `info`, `success`, `warning`, `destructive`.
|
|
2581
2724
|
|
|
2582
|
-
Each variant auto-applies: header background tint, header text color, border color, accent color, tinted overlay, and (for `
|
|
2725
|
+
Each variant auto-applies: header background tint, header text color, border color, accent color, tinted overlay, and (for `destructive`) destructive button variant.
|
|
2583
2726
|
|
|
2584
2727
|
**Override chain:** Individual prop > Variant preset > Global config. You can use a variant and still override specific colors via props.
|
|
2585
2728
|
|
|
@@ -2595,7 +2738,7 @@ Each variant auto-applies: header background tint, header text color, border col
|
|
|
2595
2738
|
</HazoUiDialog>
|
|
2596
2739
|
|
|
2597
2740
|
// Danger variant (auto-sets destructive button)
|
|
2598
|
-
<HazoUiDialog variant="
|
|
2741
|
+
<HazoUiDialog variant="destructive" title="⛔ Delete" actionButtonText="Delete Permanently" {...props}>
|
|
2599
2742
|
<p>All data will be permanently deleted.</p>
|
|
2600
2743
|
</HazoUiDialog>
|
|
2601
2744
|
|
|
@@ -2616,7 +2759,7 @@ By default (`splitHeader={true}`), variant dialogs render the title and descript
|
|
|
2616
2759
|
</HazoUiDialog>
|
|
2617
2760
|
|
|
2618
2761
|
// Merged header - single background, italic description
|
|
2619
|
-
<HazoUiDialog variant="
|
|
2762
|
+
<HazoUiDialog variant="destructive" splitHeader={false} title="Delete" description="This is permanent." {...props}>
|
|
2620
2763
|
<p>One red header background with italic description text.</p>
|
|
2621
2764
|
</HazoUiDialog>
|
|
2622
2765
|
```
|
|
@@ -2636,7 +2779,7 @@ By default (`splitHeader={true}`), variant dialogs render the title and descript
|
|
|
2636
2779
|
</HazoUiDialog>
|
|
2637
2780
|
|
|
2638
2781
|
// Danger variant with non-destructive button override
|
|
2639
|
-
<HazoUiDialog variant="
|
|
2782
|
+
<HazoUiDialog variant="destructive" actionButtonVariant="default" title="Acknowledge" {...props}>
|
|
2640
2783
|
<p>Red colors from variant, default button from prop override.</p>
|
|
2641
2784
|
</HazoUiDialog>
|
|
2642
2785
|
```
|