@djangocfg/ui-core 2.1.260 → 2.1.261
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 +27 -12
- package/package.json +4 -4
- package/src/components/{avatar.story.tsx → data/avatar/avatar.story.tsx} +1 -1
- package/src/components/{avatar.tsx → data/avatar/index.tsx} +1 -1
- package/src/components/{badge.story.tsx → data/badge/badge.story.tsx} +1 -1
- package/src/components/{badge.tsx → data/badge/index.tsx} +1 -1
- package/src/components/{calendar.story.tsx → data/calendar/calendar.story.tsx} +2 -1
- package/src/components/{calendar → data/calendar}/calendar.tsx +2 -2
- package/src/components/{calendar → data/calendar}/date-picker.tsx +3 -3
- package/src/components/{carousel.story.tsx → data/carousel/carousel.story.tsx} +2 -2
- package/src/components/{carousel.tsx → data/carousel/index.tsx} +2 -2
- package/src/components/{chart.tsx → data/chart/index.tsx} +1 -1
- package/src/components/{progress.tsx → data/progress/index.tsx} +1 -1
- package/src/components/{progress.story.tsx → data/progress/progress.story.tsx} +1 -1
- package/src/components/{table.tsx → data/table/index.tsx} +1 -1
- package/src/components/{table.story.tsx → data/table/table.story.tsx} +2 -2
- package/src/components/{toggle.tsx → data/toggle/index.tsx} +1 -1
- package/src/components/{toggle.story.tsx → data/toggle/toggle.story.tsx} +1 -1
- package/src/components/{toggle-group.tsx → data/toggle-group/index.tsx} +2 -2
- package/src/components/{toggle-group.story.tsx → data/toggle-group/toggle-group.story.tsx} +1 -1
- package/src/components/{alert.story.tsx → feedback/alert/alert.story.tsx} +1 -1
- package/src/components/{alert.tsx → feedback/alert/index.tsx} +1 -1
- package/src/components/{empty.story.tsx → feedback/empty/empty.story.tsx} +2 -2
- package/src/components/{empty.tsx → feedback/empty/index.tsx} +1 -1
- package/src/components/{preloader.tsx → feedback/preloader/index.tsx} +1 -1
- package/src/components/{preloader.story.tsx → feedback/preloader/preloader.story.tsx} +1 -1
- package/src/components/{sonner.tsx → feedback/sonner/index.tsx} +1 -1
- package/src/components/{spinner.tsx → feedback/spinner/index.tsx} +1 -1
- package/src/components/{spinner.story.tsx → feedback/spinner/spinner.story.tsx} +1 -1
- package/src/components/{button.story.tsx → forms/button/button.story.tsx} +1 -1
- package/src/components/{button.tsx → forms/button/index.tsx} +1 -1
- package/src/components/{button-download.story.tsx → forms/button-download/button-download.story.tsx} +1 -1
- package/src/components/{button-download.tsx → forms/button-download/index.tsx} +3 -3
- package/src/components/{button-group.story.tsx → forms/button-group/button-group.story.tsx} +2 -2
- package/src/components/{button-group.tsx → forms/button-group/index.tsx} +2 -2
- package/src/components/{checkbox.story.tsx → forms/checkbox/checkbox.story.tsx} +2 -2
- package/src/components/{checkbox.tsx → forms/checkbox/index.tsx} +1 -1
- package/src/components/{field.tsx → forms/field/index.tsx} +3 -3
- package/src/components/{form.tsx → forms/form/index.tsx} +2 -2
- package/src/components/{input.tsx → forms/input/index.tsx} +2 -2
- package/src/components/{input.story.tsx → forms/input/input.story.tsx} +2 -2
- package/src/components/{input-group.tsx → forms/input-group/index.tsx} +4 -4
- package/src/components/{input-group.story.tsx → forms/input-group/input-group.story.tsx} +2 -2
- package/src/components/{input-otp.tsx → forms/input-otp/index.tsx} +1 -1
- package/src/components/{input-otp.story.tsx → forms/input-otp/input-otp.story.tsx} +1 -1
- package/src/components/{label.tsx → forms/label/index.tsx} +1 -1
- package/src/components/{label.story.tsx → forms/label/label.story.tsx} +3 -3
- package/src/components/{otp → forms/otp}/index.tsx +2 -2
- package/src/components/{phone-input.tsx → forms/phone-input/index.tsx} +4 -4
- package/src/components/{radio-group.tsx → forms/radio-group/index.tsx} +1 -1
- package/src/components/{radio-group.story.tsx → forms/radio-group/radio-group.story.tsx} +2 -2
- package/src/components/{slider.tsx → forms/slider/index.tsx} +2 -2
- package/src/components/{slider.story.tsx → forms/slider/slider.story.tsx} +2 -2
- package/src/components/{switch.tsx → forms/switch/index.tsx} +1 -1
- package/src/components/{switch.story.tsx → forms/switch/switch.story.tsx} +2 -2
- package/src/components/{textarea.tsx → forms/textarea/index.tsx} +2 -2
- package/src/components/{textarea.story.tsx → forms/textarea/textarea.story.tsx} +2 -2
- package/src/components/index.ts +110 -100
- package/src/components/{aspect-ratio.story.tsx → layout/aspect-ratio/aspect-ratio.story.tsx} +1 -1
- package/src/components/{card.story.tsx → layout/card/card.story.tsx} +4 -4
- package/src/components/{card.tsx → layout/card/index.tsx} +1 -1
- package/src/components/{resizable.tsx → layout/resizable/index.tsx} +1 -1
- package/src/components/{resizable.story.tsx → layout/resizable/resizable.story.tsx} +1 -1
- package/src/components/{scroll-area.tsx → layout/scroll-area/index.tsx} +1 -1
- package/src/components/{scroll-area.story.tsx → layout/scroll-area/scroll-area.story.tsx} +2 -2
- package/src/components/{section.tsx → layout/section/index.tsx} +1 -1
- package/src/components/{separator.tsx → layout/separator/index.tsx} +1 -1
- package/src/components/{separator.story.tsx → layout/separator/separator.story.tsx} +1 -1
- package/src/components/{skeleton.tsx → layout/skeleton/index.tsx} +1 -1
- package/src/components/{skeleton.story.tsx → layout/skeleton/skeleton.story.tsx} +1 -1
- package/src/components/{sticky.tsx → layout/sticky/index.tsx} +1 -1
- package/src/components/{accordion.story.tsx → navigation/accordion/accordion.story.tsx} +1 -1
- package/src/components/{accordion.tsx → navigation/accordion/index.tsx} +2 -2
- package/src/components/{collapsible.story.tsx → navigation/collapsible/collapsible.story.tsx} +2 -2
- package/src/components/{command.story.tsx → navigation/command/command.story.tsx} +2 -2
- package/src/components/{command.tsx → navigation/command/index.tsx} +2 -2
- package/src/components/{context-menu.story.tsx → navigation/context-menu/context-menu.story.tsx} +1 -1
- package/src/components/{context-menu.tsx → navigation/context-menu/index.tsx} +1 -1
- package/src/components/{dropdown-menu.story.tsx → navigation/dropdown-menu/dropdown-menu.story.tsx} +2 -2
- package/src/components/{dropdown-menu.tsx → navigation/dropdown-menu/index.tsx} +1 -1
- package/src/components/{menubar.tsx → navigation/menubar/index.tsx} +1 -1
- package/src/components/{menubar.story.tsx → navigation/menubar/menubar.story.tsx} +1 -1
- package/src/components/{navigation-menu.tsx → navigation/navigation-menu/index.tsx} +1 -1
- package/src/components/{navigation-menu.story.tsx → navigation/navigation-menu/navigation-menu.story.tsx} +2 -2
- package/src/components/{tabs.tsx → navigation/tabs/index.tsx} +6 -6
- package/src/components/{tabs.story.tsx → navigation/tabs/tabs.story.tsx} +5 -5
- package/src/components/{alert-dialog.story.tsx → overlay/alert-dialog/alert-dialog.story.tsx} +2 -2
- package/src/components/{alert-dialog.tsx → overlay/alert-dialog/index.tsx} +2 -2
- package/src/components/{dialog.story.tsx → overlay/dialog/dialog.story.tsx} +4 -4
- package/src/components/{dialog.tsx → overlay/dialog/index.tsx} +1 -1
- package/src/components/{drawer.story.tsx → overlay/drawer/drawer.story.tsx} +4 -4
- package/src/components/{drawer.tsx → overlay/drawer/index.tsx} +1 -1
- package/src/components/{hover-card.story.tsx → overlay/hover-card/hover-card.story.tsx} +3 -3
- package/src/components/{hover-card.tsx → overlay/hover-card/index.tsx} +1 -1
- package/src/components/{popover.tsx → overlay/popover/index.tsx} +1 -1
- package/src/components/{popover.story.tsx → overlay/popover/popover.story.tsx} +4 -4
- package/src/components/{responsive-sheet.tsx → overlay/responsive-sheet/index.tsx} +3 -3
- package/src/components/{responsive-sheet.story.tsx → overlay/responsive-sheet/responsive-sheet.story.tsx} +4 -4
- package/src/components/{sheet.tsx → overlay/sheet/index.tsx} +1 -1
- package/src/components/{sheet.story.tsx → overlay/sheet/sheet.story.tsx} +4 -4
- package/src/components/{tooltip.tsx → overlay/tooltip/index.tsx} +1 -1
- package/src/components/{tooltip.story.tsx → overlay/tooltip/tooltip.story.tsx} +2 -2
- package/src/components/select/README.md +272 -0
- package/src/components/{combobox.story.tsx → select/combobox.story.tsx} +2 -2
- package/src/components/{combobox.tsx → select/combobox.tsx} +50 -8
- package/src/components/{country-select.story.tsx → select/country-select.story.tsx} +1 -1
- package/src/components/{country-select.tsx → select/country-select.tsx} +8 -8
- package/src/components/{multi-select-pro → select}/helpers.tsx +2 -2
- package/src/components/select/index.ts +59 -0
- package/src/components/{language-select.story.tsx → select/language-select.story.tsx} +1 -1
- package/src/components/{language-select.tsx → select/language-select.tsx} +8 -8
- package/src/components/{multi-select-pro/async.tsx → select/multi-select-pro-async.tsx} +5 -5
- package/src/components/{multi-select-pro/index.tsx → select/multi-select-pro.tsx} +5 -5
- package/src/components/{multi-select.story.tsx → select/multi-select.story.tsx} +1 -1
- package/src/components/{multi-select.tsx → select/multi-select.tsx} +6 -6
- package/src/components/{select.story.tsx → select/select.story.tsx} +2 -2
- package/src/components/{select.tsx → select/select.tsx} +25 -7
- package/src/components/select/types.ts +57 -0
- package/src/components/{copy.story.tsx → specialized/copy/copy.story.tsx} +1 -1
- package/src/components/{copy.tsx → specialized/copy/index.tsx} +2 -2
- package/src/components/{image-with-fallback.story.tsx → specialized/image-with-fallback/image-with-fallback.story.tsx} +1 -1
- package/src/components/{image-with-fallback.tsx → specialized/image-with-fallback/index.tsx} +2 -2
- package/src/components/{item.tsx → specialized/item/index.tsx} +2 -2
- package/src/components/{kbd.tsx → specialized/kbd/index.tsx} +1 -1
- package/src/components/{kbd.story.tsx → specialized/kbd/kbd.story.tsx} +1 -1
- package/src/components/{token-icon.tsx → specialized/token-icon/index.tsx} +1 -1
- package/src/lib/dialog-service/dialog-service.story.tsx +1 -1
- package/src/lib/dialog-service/dialogs/AlertDialogUI.tsx +1 -1
- package/src/lib/dialog-service/dialogs/ConfirmDialogUI.tsx +2 -2
- package/src/lib/dialog-service/dialogs/PromptDialogUI.tsx +3 -3
- package/src/stories/index.ts +8 -8
- /package/src/components/{calendar → data/calendar}/index.ts +0 -0
- /package/src/components/{otp → forms/otp}/types.ts +0 -0
- /package/src/components/{otp → forms/otp}/use-otp-input.ts +0 -0
- /package/src/components/{aspect-ratio.tsx → layout/aspect-ratio/index.tsx} +0 -0
- /package/src/components/{collapsible.tsx → navigation/collapsible/index.tsx} +0 -0
- /package/src/components/{tooltip-provider-safe.tsx → overlay/tooltip/tooltip-provider-safe.tsx} +0 -0
- /package/src/components/{portal.tsx → specialized/portal/index.tsx} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select Components - Unified Collection
|
|
3
|
+
*
|
|
4
|
+
* All select-based components in one place:
|
|
5
|
+
* - Select: Radix UI primitives with icon/badge support
|
|
6
|
+
* - Combobox: Searchable single-select with icon/badge support
|
|
7
|
+
* - MultiSelectPro: Multi-select with badges, icons, animations
|
|
8
|
+
* - MultiSelectProAsync: Async multi-select with all features
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Radix Select primitives (enhanced)
|
|
12
|
+
export {
|
|
13
|
+
Select,
|
|
14
|
+
SelectGroup,
|
|
15
|
+
SelectValue,
|
|
16
|
+
SelectTrigger,
|
|
17
|
+
SelectContent,
|
|
18
|
+
SelectLabel,
|
|
19
|
+
SelectItem,
|
|
20
|
+
SelectSeparator,
|
|
21
|
+
SelectScrollUpButton,
|
|
22
|
+
SelectScrollDownButton,
|
|
23
|
+
} from './select';
|
|
24
|
+
|
|
25
|
+
// Combobox
|
|
26
|
+
export { Combobox } from './combobox';
|
|
27
|
+
export type { ComboboxOption, ComboboxProps } from './combobox';
|
|
28
|
+
|
|
29
|
+
// MultiSelectPro
|
|
30
|
+
export { MultiSelectPro } from './multi-select-pro';
|
|
31
|
+
export type {
|
|
32
|
+
MultiSelectProOption,
|
|
33
|
+
MultiSelectProGroup,
|
|
34
|
+
MultiSelectProProps,
|
|
35
|
+
MultiSelectProRef,
|
|
36
|
+
AnimationConfig,
|
|
37
|
+
ResponsiveConfig,
|
|
38
|
+
} from './multi-select-pro';
|
|
39
|
+
|
|
40
|
+
// MultiSelectPro Async
|
|
41
|
+
export { MultiSelectProAsync } from './multi-select-pro-async';
|
|
42
|
+
export type {
|
|
43
|
+
MultiSelectProAsyncProps,
|
|
44
|
+
MultiSelectProAsyncOption,
|
|
45
|
+
MultiSelectProAsyncGroup,
|
|
46
|
+
MultiSelectProAsyncRef,
|
|
47
|
+
} from './multi-select-pro-async';
|
|
48
|
+
|
|
49
|
+
// Helpers
|
|
50
|
+
export { createOption, createOptions } from './helpers';
|
|
51
|
+
export type { OptionBuilderConfig } from './helpers';
|
|
52
|
+
|
|
53
|
+
// Shared types
|
|
54
|
+
export type {
|
|
55
|
+
BaseSelectOption,
|
|
56
|
+
SelectOptionGroup,
|
|
57
|
+
BadgeStyle,
|
|
58
|
+
SelectAnimationConfig,
|
|
59
|
+
} from './types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { defineStory } from '@djangocfg/playground';
|
|
3
3
|
import { LanguageSelect, type TLanguageCode } from './language-select';
|
|
4
|
-
import { Label } from '
|
|
4
|
+
import { Label } from '../forms/label';
|
|
5
5
|
|
|
6
6
|
export default defineStory({
|
|
7
7
|
title: 'Core/LanguageSelect',
|
|
@@ -4,7 +4,7 @@ import { Check, ChevronsUpDown, Search, X } from 'lucide-react';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { languages, getEmojiFlag, type TLanguageCode, type TCountryCode } from 'countries-list';
|
|
6
6
|
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from '../../lib/utils';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Mapping of language codes (ISO 639-1) to primary country codes (ISO 3166-1 alpha-2)
|
|
@@ -285,15 +285,15 @@ export function getLanguageFlag(languageCode: TLanguageCode | string): string {
|
|
|
285
285
|
if (!countryCode) return '';
|
|
286
286
|
return getEmojiFlag(countryCode);
|
|
287
287
|
}
|
|
288
|
-
import { Badge } from '
|
|
289
|
-
import { Button } from '
|
|
290
|
-
import { Checkbox } from '
|
|
288
|
+
import { Badge } from '../data/badge';
|
|
289
|
+
import { Button } from '../forms/button';
|
|
290
|
+
import { Checkbox } from '../forms/checkbox';
|
|
291
291
|
import {
|
|
292
292
|
Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList
|
|
293
|
-
} from '
|
|
294
|
-
import { Input } from '
|
|
295
|
-
import { Popover, PopoverContent, PopoverTrigger } from '
|
|
296
|
-
import { ScrollArea } from '
|
|
293
|
+
} from '../navigation/command';
|
|
294
|
+
import { Input } from '../forms/input';
|
|
295
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../overlay/popover';
|
|
296
|
+
import { ScrollArea } from '../layout/scroll-area';
|
|
297
297
|
|
|
298
298
|
export interface LanguageOption {
|
|
299
299
|
code: TLanguageCode;
|
|
@@ -18,11 +18,11 @@ import { Check, ChevronsUpDown, Loader2, X, XCircle } from 'lucide-react';
|
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
|
|
20
20
|
import { useAppT } from '@djangocfg/i18n';
|
|
21
|
-
import { Badge } from '../badge';
|
|
22
|
-
import { Button } from '../button';
|
|
23
|
-
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../command';
|
|
24
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
25
|
-
import { Separator } from '../separator';
|
|
21
|
+
import { Badge } from '../data/badge';
|
|
22
|
+
import { Button } from '../forms/button';
|
|
23
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../navigation/command';
|
|
24
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../overlay/popover';
|
|
25
|
+
import { Separator } from '../layout/separator';
|
|
26
26
|
import { cn } from '../../lib';
|
|
27
27
|
|
|
28
28
|
// ==================== TYPES ====================
|
|
@@ -5,11 +5,11 @@ import { Check, ChevronsUpDown, X, XCircle } from 'lucide-react';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useAppT } from '@djangocfg/i18n';
|
|
8
|
-
import { Badge } from '../badge';
|
|
9
|
-
import { Button } from '../button';
|
|
10
|
-
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../command';
|
|
11
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
12
|
-
import { Separator } from '../separator';
|
|
8
|
+
import { Badge } from '../data/badge';
|
|
9
|
+
import { Button } from '../forms/button';
|
|
10
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../navigation/command';
|
|
11
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../overlay/popover';
|
|
12
|
+
import { Separator } from '../layout/separator';
|
|
13
13
|
import { cn } from '../../lib';
|
|
14
14
|
|
|
15
15
|
// ==================== TYPES ====================
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { defineStory } from '@djangocfg/playground';
|
|
3
3
|
import { MultiSelect, type MultiSelectOption } from './multi-select';
|
|
4
|
-
import { Label } from '
|
|
4
|
+
import { Label } from '../forms/label';
|
|
5
5
|
|
|
6
6
|
export default defineStory({
|
|
7
7
|
title: 'Core/MultiSelect',
|
|
@@ -4,14 +4,14 @@ import { Check, ChevronsUpDown, X } from 'lucide-react';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
import { useAppT } from '@djangocfg/i18n';
|
|
7
|
-
import { useStoredValue, type StorageType, type UseStoredValueOptions } from '
|
|
8
|
-
import { cn } from '
|
|
9
|
-
import { Badge } from '
|
|
10
|
-
import { Button } from '
|
|
7
|
+
import { useStoredValue, type StorageType, type UseStoredValueOptions } from '../../hooks/useStoredValue';
|
|
8
|
+
import { cn } from '../../lib/utils';
|
|
9
|
+
import { Badge } from '../data/badge';
|
|
10
|
+
import { Button } from '../forms/button';
|
|
11
11
|
import {
|
|
12
12
|
Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList
|
|
13
|
-
} from '
|
|
14
|
-
import { Popover, PopoverContent, PopoverTrigger } from '
|
|
13
|
+
} from '../navigation/command';
|
|
14
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../overlay/popover';
|
|
15
15
|
|
|
16
16
|
export interface MultiSelectOption {
|
|
17
17
|
value: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStory, useBoolean } from '@djangocfg/playground';
|
|
2
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '
|
|
3
|
-
import { Label } from '
|
|
2
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '.';
|
|
3
|
+
import { Label } from '../forms/label';
|
|
4
4
|
|
|
5
5
|
export default defineStory({
|
|
6
6
|
title: 'Core/Select',
|
|
@@ -5,7 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';
|
|
6
6
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
8
|
+
import { cn } from '../../lib/utils';
|
|
9
|
+
import { Badge } from '../data/badge';
|
|
9
10
|
|
|
10
11
|
const Select = SelectPrimitive.Root
|
|
11
12
|
|
|
@@ -15,8 +16,10 @@ const SelectValue = SelectPrimitive.Value
|
|
|
15
16
|
|
|
16
17
|
const SelectTrigger = React.forwardRef<
|
|
17
18
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
18
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
19
|
-
|
|
19
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {
|
|
20
|
+
icon?: React.ComponentType<{ className?: string }>;
|
|
21
|
+
}
|
|
22
|
+
>(({ className, children, icon: Icon, ...props }, ref) => (
|
|
20
23
|
<SelectPrimitive.Trigger
|
|
21
24
|
ref={ref}
|
|
22
25
|
className={cn(
|
|
@@ -25,7 +28,10 @@ const SelectTrigger = React.forwardRef<
|
|
|
25
28
|
)}
|
|
26
29
|
{...props}
|
|
27
30
|
>
|
|
28
|
-
|
|
31
|
+
<span className="flex items-center gap-2 flex-1 min-w-0">
|
|
32
|
+
{Icon && <Icon className="h-4 w-4 shrink-0" />}
|
|
33
|
+
{children}
|
|
34
|
+
</span>
|
|
29
35
|
<SelectPrimitive.Icon asChild>
|
|
30
36
|
<ChevronDownIcon className="h-4 w-4 opacity-50" />
|
|
31
37
|
</SelectPrimitive.Icon>
|
|
@@ -114,8 +120,12 @@ SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
|
114
120
|
|
|
115
121
|
const SelectItem = React.forwardRef<
|
|
116
122
|
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
117
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {
|
|
118
|
-
|
|
123
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {
|
|
124
|
+
key?: React.Key;
|
|
125
|
+
icon?: React.ComponentType<{ className?: string }>;
|
|
126
|
+
badge?: string | React.ReactNode;
|
|
127
|
+
}
|
|
128
|
+
>(({ className, children, icon: Icon, badge, ...props }, ref) => (
|
|
119
129
|
<SelectPrimitive.Item
|
|
120
130
|
ref={ref}
|
|
121
131
|
className={cn(
|
|
@@ -129,7 +139,15 @@ const SelectItem = React.forwardRef<
|
|
|
129
139
|
<CheckIcon className="h-4 w-4" />
|
|
130
140
|
</SelectPrimitive.ItemIndicator>
|
|
131
141
|
</span>
|
|
132
|
-
<
|
|
142
|
+
<div className="flex items-center gap-2 flex-1 min-w-0 pr-6">
|
|
143
|
+
{Icon && <Icon className="h-4 w-4 shrink-0" />}
|
|
144
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
145
|
+
{badge && (
|
|
146
|
+
<Badge variant="outline" className="text-xs shrink-0">
|
|
147
|
+
{badge}
|
|
148
|
+
</Badge>
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
133
151
|
</SelectPrimitive.Item>
|
|
134
152
|
))
|
|
135
153
|
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for all select-based components
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Base option interface for all select components
|
|
9
|
+
*/
|
|
10
|
+
export interface BaseSelectOption {
|
|
11
|
+
/** Unique value */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Display label */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Optional description/subtitle */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Optional icon component */
|
|
18
|
+
icon?: React.ComponentType<{ className?: string }>;
|
|
19
|
+
/** Optional badge text */
|
|
20
|
+
badge?: string | ReactNode;
|
|
21
|
+
/** Whether this option is disabled */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Custom styling for badge/icon */
|
|
24
|
+
style?: {
|
|
25
|
+
badgeColor?: string;
|
|
26
|
+
iconColor?: string;
|
|
27
|
+
gradient?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Group of options with heading
|
|
33
|
+
*/
|
|
34
|
+
export interface SelectOptionGroup {
|
|
35
|
+
heading: string;
|
|
36
|
+
options: BaseSelectOption[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Style configuration for badge
|
|
41
|
+
*/
|
|
42
|
+
export interface BadgeStyle {
|
|
43
|
+
badgeColor?: string;
|
|
44
|
+
iconColor?: string;
|
|
45
|
+
gradient?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Animation configuration for select components
|
|
50
|
+
*/
|
|
51
|
+
export interface SelectAnimationConfig {
|
|
52
|
+
badgeAnimation?: 'bounce' | 'pulse' | 'wiggle' | 'fade' | 'slide' | 'none';
|
|
53
|
+
popoverAnimation?: 'scale' | 'slide' | 'fade' | 'flip' | 'none';
|
|
54
|
+
optionHoverAnimation?: 'highlight' | 'scale' | 'glow' | 'none';
|
|
55
|
+
duration?: number;
|
|
56
|
+
delay?: number;
|
|
57
|
+
}
|
|
@@ -4,8 +4,8 @@ import { Check, Copy } from 'lucide-react';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
import { useAppT } from '@djangocfg/i18n';
|
|
7
|
-
import { cn } from '
|
|
8
|
-
import { Button } from '
|
|
7
|
+
import { cn } from '../../../lib/utils';
|
|
8
|
+
import { Button } from '../../forms/button';
|
|
9
9
|
|
|
10
10
|
// =============================================================================
|
|
11
11
|
// CopyButton - Copy button with icon feedback
|
package/src/components/{image-with-fallback.tsx → specialized/image-with-fallback/index.tsx}
RENAMED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { Car, ImageIcon, MapPin, Package, User } from 'lucide-react';
|
|
8
8
|
import React, { forwardRef } from 'react';
|
|
9
9
|
|
|
10
|
-
import { useImageLoader } from '
|
|
11
|
-
import { cn } from '
|
|
10
|
+
import { useImageLoader } from '../../../hooks/useImageLoader';
|
|
11
|
+
import { cn } from '../../../lib/utils';
|
|
12
12
|
|
|
13
13
|
export interface ImageWithFallbackProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'onLoad' | 'onError'> {
|
|
14
14
|
src?: string;
|
|
@@ -5,8 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
9
|
-
import { Separator } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
|
+
import { Separator } from '../../layout/separator';
|
|
10
10
|
|
|
11
11
|
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
12
12
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { defineStory } from '@djangocfg/playground';
|
|
3
|
-
import { Button } from '../../components/button';
|
|
3
|
+
import { Button } from '../../components/forms/button';
|
|
4
4
|
import { DialogProvider } from './DialogProvider';
|
|
5
5
|
import { useDialog } from './hooks';
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
AlertDialogFooter,
|
|
11
11
|
AlertDialogHeader,
|
|
12
12
|
AlertDialogTitle,
|
|
13
|
-
} from '../../../components/alert-dialog';
|
|
13
|
+
} from '../../../components/overlay/alert-dialog';
|
|
14
14
|
import { useHotkey } from '../../../hooks/useHotkey';
|
|
15
15
|
import { I18N_KEYS } from '../constants';
|
|
16
16
|
import type { DialogOptions } from '../types';
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
AlertDialogFooter,
|
|
12
12
|
AlertDialogHeader,
|
|
13
13
|
AlertDialogTitle,
|
|
14
|
-
} from '../../../components/alert-dialog';
|
|
15
|
-
import { buttonVariants } from '../../../components/button';
|
|
14
|
+
} from '../../../components/overlay/alert-dialog';
|
|
15
|
+
import { buttonVariants } from '../../../components/forms/button';
|
|
16
16
|
import { useHotkey } from '../../../hooks/useHotkey';
|
|
17
17
|
import { cn } from '../../utils';
|
|
18
18
|
import { I18N_KEYS } from '../constants';
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
DialogFooter,
|
|
10
10
|
DialogHeader,
|
|
11
11
|
DialogTitle,
|
|
12
|
-
} from '../../../components/dialog';
|
|
13
|
-
import { Button } from '../../../components/button';
|
|
14
|
-
import { Input } from '../../../components/input';
|
|
12
|
+
} from '../../../components/overlay/dialog';
|
|
13
|
+
import { Button } from '../../../components/forms/button';
|
|
14
|
+
import { Input } from '../../../components/forms/input';
|
|
15
15
|
import { useHotkey } from '../../../hooks/useHotkey';
|
|
16
16
|
import { I18N_KEYS } from '../constants';
|
|
17
17
|
import type { DialogOptions } from '../types';
|
package/src/stories/index.ts
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import type { StoryModule } from '@djangocfg/playground';
|
|
8
8
|
|
|
9
|
-
import * as Button from '../components/button.story';
|
|
10
|
-
import * as Input from '../components/input.story';
|
|
11
|
-
import * as Select from '../components/select.story';
|
|
12
|
-
import * as Slider from '../components/slider.story';
|
|
13
|
-
import * as Dialog from '../components/dialog.story';
|
|
14
|
-
import * as Tabs from '../components/tabs.story';
|
|
15
|
-
import * as Popover from '../components/popover.story';
|
|
16
|
-
import * as Tooltip from '../components/tooltip.story';
|
|
9
|
+
import * as Button from '../components/forms/button/button.story';
|
|
10
|
+
import * as Input from '../components/forms/input/input.story';
|
|
11
|
+
import * as Select from '../components/select/select.story';
|
|
12
|
+
import * as Slider from '../components/forms/slider/slider.story';
|
|
13
|
+
import * as Dialog from '../components/overlay/dialog/dialog.story';
|
|
14
|
+
import * as Tabs from '../components/navigation/tabs/tabs.story';
|
|
15
|
+
import * as Popover from '../components/overlay/popover/popover.story';
|
|
16
|
+
import * as Tooltip from '../components/overlay/tooltip/tooltip.story';
|
|
17
17
|
|
|
18
18
|
export const uiCoreStoryModules: Record<string, StoryModule> = {
|
|
19
19
|
'button.story.tsx': Button,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/{tooltip-provider-safe.tsx → overlay/tooltip/tooltip-provider-safe.tsx}
RENAMED
|
File without changes
|
|
File without changes
|