@djangocfg/ui-core 2.1.260 → 2.1.262
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 +112 -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} +3 -1
- package/src/components/{tooltip-provider-safe.tsx → overlay/tooltip/tooltip-provider-safe.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 +73 -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/{portal.tsx → specialized/portal/index.tsx} +0 -0
package/README.md
CHANGED
|
@@ -28,30 +28,45 @@ pnpm add @djangocfg/ui-core
|
|
|
28
28
|
| `@djangocfg/ui-tools` | Heavy tools with lazy loading |
|
|
29
29
|
| `@djangocfg/ui-nextjs` | Next.js apps (extends ui-core) |
|
|
30
30
|
|
|
31
|
-
## Components (
|
|
31
|
+
## Components (65+)
|
|
32
|
+
|
|
33
|
+
Components are organized by category in `components/`. All exports are available from the root:
|
|
34
|
+
```tsx
|
|
35
|
+
import { Button, Dialog, Table } from '@djangocfg/ui-core';
|
|
36
|
+
```
|
|
32
37
|
|
|
33
38
|
### Forms (18)
|
|
34
|
-
`
|
|
39
|
+
`Button` `ButtonLink` `ButtonGroup` `Input` `Textarea` `Checkbox` `RadioGroup` `Switch` `Slider` `Label` `Form` `Field` `InputOTP` `PhoneInput` `InputGroup` `DownloadButton` `OTPInput` `Textarea`
|
|
40
|
+
|
|
41
|
+
### Select (8)
|
|
42
|
+
`Select` `Combobox` `MultiSelect` `MultiSelectPro` `MultiSelectProAsync` `CountrySelect` `LanguageSelect`
|
|
43
|
+
|
|
44
|
+
> **Select Components** — All select components now support **icons** and **badges**:
|
|
45
|
+
> - `Select` — Radix primitives with `icon` on trigger/item, `badge` on item
|
|
46
|
+
> - `Combobox` — Searchable single-select with icon + badge in trigger and dropdown
|
|
47
|
+
> - `MultiSelectPro` — Multi-select with colored badges, icons, animations
|
|
48
|
+
>
|
|
49
|
+
> See `components/select/README.md` for full documentation.
|
|
35
50
|
|
|
36
51
|
### Layout (8)
|
|
37
52
|
`Card` `Separator` `Skeleton` `AspectRatio` `Sticky` `ScrollArea` `Resizable` `Section`
|
|
38
53
|
|
|
39
|
-
### Overlay (
|
|
40
|
-
`Dialog` `AlertDialog` `Sheet` `Drawer` `Popover` `HoverCard` `Tooltip`
|
|
54
|
+
### Overlay (8)
|
|
55
|
+
`Dialog` `AlertDialog` `Sheet` `Drawer` `Popover` `HoverCard` `Tooltip` `ResponsiveSheet`
|
|
41
56
|
|
|
42
57
|
Default **`TooltipContent`** styling uses semantic **popover** tokens (`bg-popover`, `text-popover-foreground`, `border-border`, shadow) — not `primary` — so hints read as neutral floating UI.
|
|
43
58
|
|
|
44
|
-
###
|
|
45
|
-
`
|
|
59
|
+
### Navigation (8)
|
|
60
|
+
`Tabs` `Accordion` `Collapsible` `Command` `ContextMenu` `DropdownMenu` `Menubar` `NavigationMenu`
|
|
46
61
|
|
|
47
|
-
### Data (
|
|
48
|
-
`Table` `
|
|
62
|
+
### Data (10)
|
|
63
|
+
`Table` `Badge` `Avatar` `Progress` `Calendar` `Carousel` `Chart` `Toggle` `ToggleGroup` `DatePicker`
|
|
49
64
|
|
|
50
|
-
###
|
|
51
|
-
`
|
|
65
|
+
### Feedback (5)
|
|
66
|
+
`Alert` `Toaster` (Sonner) `Spinner` `Empty` `Preloader`
|
|
52
67
|
|
|
53
|
-
### Specialized (
|
|
54
|
-
`
|
|
68
|
+
### Specialized (7)
|
|
69
|
+
`Kbd` `TokenIcon` `Item` `Portal` `ImageWithFallback` `CopyButton` `CopyField`
|
|
55
70
|
|
|
56
71
|
## Hooks (17)
|
|
57
72
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/ui-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.262",
|
|
4
4
|
"description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"playground": "playground dev"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@djangocfg/i18n": "^2.1.
|
|
89
|
+
"@djangocfg/i18n": "^2.1.262",
|
|
90
90
|
"consola": "^3.4.2",
|
|
91
91
|
"lucide-react": "^0.545.0",
|
|
92
92
|
"moment": "^2.30.1",
|
|
@@ -148,9 +148,9 @@
|
|
|
148
148
|
"vaul": "1.1.2"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
|
-
"@djangocfg/i18n": "^2.1.
|
|
151
|
+
"@djangocfg/i18n": "^2.1.262",
|
|
152
152
|
"@djangocfg/playground": "workspace:*",
|
|
153
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
153
|
+
"@djangocfg/typescript-config": "^2.1.262",
|
|
154
154
|
"@types/node": "^24.7.2",
|
|
155
155
|
"@types/react": "^19.1.0",
|
|
156
156
|
"@types/react-dom": "^19.1.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '../../../lib/utils';
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva(
|
|
7
7
|
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { defineStory } from '@djangocfg/playground';
|
|
3
|
-
import { Calendar
|
|
3
|
+
import { Calendar } from '.';
|
|
4
|
+
import { DatePicker, DateRangePicker, type DateRange } from './date-picker';
|
|
4
5
|
|
|
5
6
|
export default defineStory({
|
|
6
7
|
title: 'Core/Calendar',
|
|
@@ -4,8 +4,8 @@ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
6
6
|
|
|
7
|
-
import { cn } from '
|
|
8
|
-
import { Button, buttonVariants } from '
|
|
7
|
+
import { cn } from '../../../lib/utils';
|
|
8
|
+
import { Button, buttonVariants } from '../../forms/button';
|
|
9
9
|
|
|
10
10
|
function Calendar({
|
|
11
11
|
className,
|
|
@@ -5,9 +5,9 @@ import { CalendarIcon } from 'lucide-react';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
7
|
import { useAppT } from '@djangocfg/i18n';
|
|
8
|
-
import { cn } from '
|
|
9
|
-
import { Button } from '
|
|
10
|
-
import { Popover, PopoverContent, PopoverTrigger } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
|
+
import { Button } from '../../forms/button';
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../overlay/popover';
|
|
11
11
|
import { Calendar } from './calendar';
|
|
12
12
|
|
|
13
13
|
import type { SelectSingleEventHandler, DateRange as RDPDateRange } from 'react-day-picker'
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
CarouselItem,
|
|
6
6
|
CarouselNext,
|
|
7
7
|
CarouselPrevious,
|
|
8
|
-
} from '
|
|
9
|
-
import { Card, CardContent } from '
|
|
8
|
+
} from '.';
|
|
9
|
+
import { Card, CardContent } from '../../layout/card';
|
|
10
10
|
|
|
11
11
|
const meta: StoryMeta = defineStory({
|
|
12
12
|
title: 'Core/Carousel',
|
|
@@ -6,8 +6,8 @@ import * as React from 'react';
|
|
|
6
6
|
import { ArrowLeftIcon, ArrowRightIcon } from '@radix-ui/react-icons';
|
|
7
7
|
|
|
8
8
|
import { useAppT } from '@djangocfg/i18n';
|
|
9
|
-
import { cn } from '
|
|
10
|
-
import { Button } from '
|
|
9
|
+
import { cn } from '../../../lib/utils';
|
|
10
|
+
import { Button } from '../../forms/button';
|
|
11
11
|
|
|
12
12
|
type CarouselApi = UseEmblaCarouselType[1]
|
|
13
13
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
6
6
|
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from '../../../lib/utils';
|
|
8
8
|
|
|
9
9
|
const Progress = React.forwardRef<
|
|
10
10
|
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
9
|
|
|
10
10
|
const toggleVariants = cva(
|
|
11
11
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -5,8 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
9
|
-
import { toggleVariants } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
|
+
import { toggleVariants } from '../../data/toggle';
|
|
10
10
|
|
|
11
11
|
const ToggleGroupContext = React.createContext<
|
|
12
12
|
VariantProps<typeof toggleVariants>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineStory, useSelect, useBoolean } from '@djangocfg/playground';
|
|
2
|
-
import { ToggleGroup, ToggleGroupItem } from '
|
|
2
|
+
import { ToggleGroup, ToggleGroupItem } from '.';
|
|
3
3
|
import { Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight, AlignJustify } from 'lucide-react';
|
|
4
4
|
|
|
5
5
|
export default defineStory({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineStory, useSelect } from '@djangocfg/playground';
|
|
2
|
-
import { Alert, AlertTitle, AlertDescription } from '
|
|
2
|
+
import { Alert, AlertTitle, AlertDescription } from '.';
|
|
3
3
|
import { AlertCircle, CheckCircle2, Info, AlertTriangle } from 'lucide-react';
|
|
4
4
|
|
|
5
5
|
export default defineStory({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '../../../lib/utils';
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
7
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
EmptyDescription,
|
|
7
7
|
EmptyContent,
|
|
8
8
|
EmptyMedia,
|
|
9
|
-
} from '
|
|
10
|
-
import { Button } from '
|
|
9
|
+
} from '.';
|
|
10
|
+
import { Button } from '../../forms/button';
|
|
11
11
|
import { Inbox, Search, FileQuestion, Plus, RefreshCw } from 'lucide-react';
|
|
12
12
|
|
|
13
13
|
export default defineStory({
|
|
@@ -11,7 +11,7 @@ import { Loader2 } from 'lucide-react';
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
13
|
import { useAppT } from '@djangocfg/i18n';
|
|
14
|
-
import { cn } from '
|
|
14
|
+
import { cn } from '../../../lib/utils';
|
|
15
15
|
// Spinner is available for future use
|
|
16
16
|
// import { Spinner } from './spinner';
|
|
17
17
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Loader2Icon } from 'lucide-react';
|
|
2
2
|
|
|
3
3
|
import { useAppT } from '@djangocfg/i18n';
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '../../../lib/utils';
|
|
5
5
|
|
|
6
6
|
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
|
7
7
|
const t = useAppT()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStory, useSelect, useBoolean } from '@djangocfg/playground';
|
|
2
2
|
import { Mail, Send, Loader2, ChevronRight, Plus, Trash2 } from 'lucide-react';
|
|
3
|
-
import { Button, ButtonLink } from '
|
|
3
|
+
import { Button, ButtonLink } from '.';
|
|
4
4
|
|
|
5
5
|
export default defineStory({
|
|
6
6
|
title: 'Core/Button',
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Slot } from '@radix-ui/react-slot';
|
|
8
8
|
|
|
9
|
-
import { cn } from '
|
|
9
|
+
import { cn } from '../../../lib/utils';
|
|
10
10
|
|
|
11
11
|
const buttonVariants = cva(
|
|
12
12
|
"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { AlertCircle, CheckCircle2, Download, Loader2 } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
import { Button, type ButtonProps } from '
|
|
7
|
-
import { cn } from '
|
|
8
|
-
import { useLocalStorage } from '
|
|
6
|
+
import { Button, type ButtonProps } from '../../forms/button';
|
|
7
|
+
import { cn } from '../../../lib';
|
|
8
|
+
import { useLocalStorage } from '../../../hooks/useLocalStorage';
|
|
9
9
|
|
|
10
10
|
// Token key used by the API client
|
|
11
11
|
const TOKEN_KEY = "auth_token"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStory } from '@djangocfg/playground';
|
|
2
|
-
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from '
|
|
3
|
-
import { Button } from '
|
|
2
|
+
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from '.';
|
|
3
|
+
import { Button } from '../../forms/button';
|
|
4
4
|
import { Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight, ChevronDown } from 'lucide-react';
|
|
5
5
|
|
|
6
6
|
export default defineStory({
|
|
@@ -4,8 +4,8 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
6
6
|
|
|
7
|
-
import { cn } from '
|
|
8
|
-
import { Separator } from '
|
|
7
|
+
import { cn } from '../../../lib/utils';
|
|
8
|
+
import { Separator } from '../../layout/separator';
|
|
9
9
|
|
|
10
10
|
const buttonGroupVariants = cva(
|
|
11
11
|
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { defineStory, useBoolean } from '@djangocfg/playground';
|
|
3
|
-
import { Checkbox } from '
|
|
4
|
-
import { Label } from '
|
|
3
|
+
import { Checkbox } from '.';
|
|
4
|
+
import { Label } from '../../forms/label';
|
|
5
5
|
|
|
6
6
|
export default defineStory({
|
|
7
7
|
title: 'Core/Checkbox',
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
6
6
|
import { CheckIcon } from '@radix-ui/react-icons';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
9
|
|
|
10
10
|
const Checkbox = React.forwardRef<
|
|
11
11
|
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
|
|
6
|
-
import { cn } from '
|
|
7
|
-
import { Label } from '
|
|
8
|
-
import { Separator } from '
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { Label } from '../../forms/label';
|
|
8
|
+
import { Separator } from '../../layout/separator';
|
|
9
9
|
|
|
10
10
|
function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
|
|
11
11
|
return (
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
|
|
11
|
-
import { cn } from '
|
|
12
|
-
import { Label } from '
|
|
11
|
+
import { cn } from '../../../lib/utils';
|
|
12
|
+
import { Label } from '../../forms/label';
|
|
13
13
|
|
|
14
14
|
const Form = FormProvider
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { useStoredValue, type StorageType, type UseStoredValueOptions } from '
|
|
4
|
-
import { cn } from '
|
|
3
|
+
import { useStoredValue, type StorageType, type UseStoredValueOptions } from '../../../hooks/useStoredValue';
|
|
4
|
+
import { cn } from '../../../lib/utils';
|
|
5
5
|
|
|
6
6
|
export interface InputProps extends React.ComponentProps<"input"> {
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStory, useSelect, useBoolean } from '@djangocfg/playground';
|
|
2
|
-
import { Input } from '
|
|
3
|
-
import { Label } from '
|
|
2
|
+
import { Input } from '.';
|
|
3
|
+
import { Label } from '../../forms/label';
|
|
4
4
|
|
|
5
5
|
export default defineStory({
|
|
6
6
|
title: 'Core/Input',
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
import { cn } from '
|
|
7
|
-
import { Button } from '
|
|
8
|
-
import { Input } from '
|
|
9
|
-
import { Textarea } from '
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { Button } from '../../forms/button';
|
|
8
|
+
import { Input } from '../../forms/input';
|
|
9
|
+
import { Textarea } from '../../forms/textarea';
|
|
10
10
|
|
|
11
11
|
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
12
12
|
return (
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
InputGroupText,
|
|
7
7
|
InputGroupInput,
|
|
8
8
|
InputGroupTextarea,
|
|
9
|
-
} from '
|
|
9
|
+
} from '.';
|
|
10
10
|
import { Search, Mail, Eye, EyeOff, Copy, AtSign } from 'lucide-react';
|
|
11
11
|
import { useState } from 'react';
|
|
12
|
-
import { Kbd } from '
|
|
12
|
+
import { Kbd } from '../../specialized/kbd';
|
|
13
13
|
|
|
14
14
|
export default defineStory({
|
|
15
15
|
title: 'Core/InputGroup',
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import { MinusIcon } from '@radix-ui/react-icons';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
9
|
|
|
10
10
|
type ChildrenBranch = Extract<BaseOTPInputProps, { render?: never }>;
|
|
11
11
|
type InputOTPProps = Omit<ChildrenBranch, 'className' | 'containerClassName'> & {
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
|
|
6
6
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
9
|
|
|
10
10
|
const labelVariants = cva(
|
|
11
11
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineStory } from '@djangocfg/playground';
|
|
2
|
-
import { Label } from '
|
|
3
|
-
import { Input } from '
|
|
4
|
-
import { Checkbox } from '
|
|
2
|
+
import { Label } from '.';
|
|
3
|
+
import { Input } from '../../forms/input';
|
|
4
|
+
import { Checkbox } from '../../forms/checkbox';
|
|
5
5
|
|
|
6
6
|
export default defineStory({
|
|
7
7
|
title: 'Core/Label',
|
|
@@ -4,8 +4,8 @@ import { MinusIcon } from 'lucide-react';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
import { InputOTP, InputOTPGroup, InputOTPSlot } from '../input-otp';
|
|
7
|
-
import { cn } from '
|
|
8
|
-
import { useIsMobile } from '
|
|
7
|
+
import { cn } from '../../../lib';
|
|
8
|
+
import { useIsMobile } from '../../../hooks/useMobile';
|
|
9
9
|
|
|
10
10
|
import { createPasteHandler, useSmartOTP } from './use-otp-input';
|
|
11
11
|
|
|
@@ -7,12 +7,12 @@ import { ChevronDown, Search } from 'lucide-react';
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
import { useAppT } from '@djangocfg/i18n';
|
|
10
|
-
import { Button } from '
|
|
11
|
-
import { Input } from '
|
|
12
|
-
import { cn } from '
|
|
10
|
+
import { Button } from '../../forms/button';
|
|
11
|
+
import { Input } from '../../forms/input';
|
|
12
|
+
import { cn } from '../../../lib';
|
|
13
13
|
import {
|
|
14
14
|
DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger
|
|
15
|
-
} from '
|
|
15
|
+
} from '../../navigation/dropdown-menu';
|
|
16
16
|
|
|
17
17
|
// Generate country flag emoji from country code
|
|
18
18
|
const getCountryFlag = (countryCode: CountryCode): string => {
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { DotFilledIcon } from '@radix-ui/react-icons';
|
|
6
6
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
7
7
|
|
|
8
|
-
import { cn } from '
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
9
|
|
|
10
10
|
const RadioGroup = React.forwardRef<
|
|
11
11
|
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStory, useBoolean } from '@djangocfg/playground';
|
|
2
|
-
import { RadioGroup, RadioGroupItem } from '
|
|
3
|
-
import { Label } from '
|
|
2
|
+
import { RadioGroup, RadioGroupItem } from '.';
|
|
3
|
+
import { Label } from '../../forms/label';
|
|
4
4
|
|
|
5
5
|
export default defineStory({
|
|
6
6
|
title: 'Core/Radio Group',
|