@yuhuanowo/yunui 0.2.0 → 0.2.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.
- package/README.md +51 -49
- package/README.zh-CN.md +154 -0
- package/README.zh-TW.md +154 -0
- package/dist/ai.d.ts +5 -46
- package/dist/ai.js +25 -59
- package/dist/ai.js.map +1 -1
- package/dist/chunk-FOP7I6N3.js +79 -0
- package/dist/chunk-FOP7I6N3.js.map +1 -0
- package/dist/{chunk-YRITK7CC.js → chunk-KTA7HC4V.js} +114 -11
- package/dist/chunk-KTA7HC4V.js.map +1 -0
- package/dist/footer-BoFu7Wqq.d.ts +46 -0
- package/dist/index.d.ts +52 -2
- package/dist/index.js +1 -1
- package/dist/patterns.d.ts +1 -0
- package/dist/patterns.js +3 -2
- package/dist/patterns.js.map +1 -1
- package/package.json +7 -3
- package/styles/tokens.css +2007 -0
- package/styles/yunui.css +44 -5
- package/dist/chunk-WASCOOVD.js +0 -29
- package/dist/chunk-WASCOOVD.js.map +0 -1
- package/dist/chunk-YRITK7CC.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const GithubIcon: () => React.JSX.Element;
|
|
5
|
+
declare const InstagramIcon: () => React.JSX.Element;
|
|
6
|
+
declare const DiscordIcon: () => React.JSX.Element;
|
|
7
|
+
interface FooterLink {
|
|
8
|
+
/** Link text. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Destination href. */
|
|
11
|
+
href: string;
|
|
12
|
+
}
|
|
13
|
+
interface FooterSection {
|
|
14
|
+
/** Column heading. */
|
|
15
|
+
title: string;
|
|
16
|
+
/** Links in this column. */
|
|
17
|
+
links: FooterLink[];
|
|
18
|
+
}
|
|
19
|
+
interface FooterSocial {
|
|
20
|
+
/** Icon to render (e.g. {@link GithubIcon}). */
|
|
21
|
+
icon: ReactNode;
|
|
22
|
+
/** Destination href (external links open in a new tab). */
|
|
23
|
+
href: string;
|
|
24
|
+
/** Accessible label for the link. */
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
interface FooterProps {
|
|
28
|
+
/** Brand name shown next to the logo. */
|
|
29
|
+
appName: string;
|
|
30
|
+
/** Logo image src. @defaultValue "/favicon.ico" */
|
|
31
|
+
logoSrc?: string;
|
|
32
|
+
/** Where the logo links to. @defaultValue "/" */
|
|
33
|
+
homeHref?: string;
|
|
34
|
+
/** Short brand tagline under the logo. */
|
|
35
|
+
tagline?: string;
|
|
36
|
+
/** Link columns. */
|
|
37
|
+
sections?: FooterSection[];
|
|
38
|
+
/** Social/icon links shown in the bottom bar. */
|
|
39
|
+
social?: FooterSocial[];
|
|
40
|
+
/** Defaults to `© <year> <appName>. All rights reserved.` */
|
|
41
|
+
copyright?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Site footer: brand block, link columns, copyright line, and social icons. */
|
|
44
|
+
declare function Footer({ appName, logoSrc, homeHref, tagline, sections, social, copyright, }: FooterProps): React.JSX.Element;
|
|
45
|
+
|
|
46
|
+
export { DiscordIcon as D, Footer as F, GithubIcon as G, InstagramIcon as I, type FooterLink as a, type FooterProps as b, type FooterSection as c, type FooterSocial as d };
|
package/dist/index.d.ts
CHANGED
|
@@ -421,7 +421,7 @@ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
421
421
|
* Visual style. Options: `primary`, `secondary`, `ghost`, `accent`, `outline`, `amber`, `red`/`destructive`.
|
|
422
422
|
* @defaultValue "default"
|
|
423
423
|
*/
|
|
424
|
-
variant?: /** @deprecated alias of `primary` */ "default" | "primary" | "secondary" | "ghost" | "accent" | "outline" | "amber" | /** @deprecated alias of `destructive` */ "red" | "destructive";
|
|
424
|
+
variant?: /** @deprecated alias of `primary` */ "default" | "primary" | "secondary" | "ghost" | "accent" | /** Solid fill from the runtime-themeable brand token (data-brand). */ "brand" | "outline" | "amber" | /** @deprecated alias of `destructive` */ "red" | "destructive";
|
|
425
425
|
/** Size: `sm`, `md` (default), `lg`, or `icon` (square 40×40). */
|
|
426
426
|
size?: "sm" | "md" | "lg" | "icon";
|
|
427
427
|
/** Show a spinner before the children and disable the button while busy. */
|
|
@@ -868,4 +868,54 @@ declare function useBodyScrollLock(locked?: boolean): void;
|
|
|
868
868
|
*/
|
|
869
869
|
declare function useModalBehavior(isOpen: boolean, onClose: () => void): void;
|
|
870
870
|
|
|
871
|
-
|
|
871
|
+
/**
|
|
872
|
+
* Runtime theming for YunUI's token system.
|
|
873
|
+
*
|
|
874
|
+
* The design tokens (styles/tokens.css) are driven by data-* attributes on a
|
|
875
|
+
* root element. Switching a role's palette is a single attribute change — no
|
|
876
|
+
* rebuild, instant, and it cascades to every component/utility that consumes the
|
|
877
|
+
* semantic tokens (e.g. the `bg-brand-solid-strong` / `text-accent-on-background-*`
|
|
878
|
+
* utilities). Light/dark itself is still owned by your theme manager (e.g.
|
|
879
|
+
* next-themes via the `.dark` class); this layer governs brand/accent/neutral
|
|
880
|
+
* palette + solid/surface style.
|
|
881
|
+
*
|
|
882
|
+
* import { applyTheme, useYunUITheme, YUNUI_PALETTES } from "@yuhuanowo/yunui";
|
|
883
|
+
* applyTheme({ brand: "emerald", accent: "violet" }); // imperative
|
|
884
|
+
* const [theme, setTheme] = useYunUITheme({ brand: "blue" }); // React, persisted
|
|
885
|
+
*/
|
|
886
|
+
type YunUIPalette = "gray" | "sand" | "slate" | "mint" | "rose" | "dusk" | "red" | "orange" | "yellow" | "moss" | "green" | "emerald" | "aqua" | "cyan" | "blue" | "indigo" | "violet" | "magenta" | "pink";
|
|
887
|
+
/** How solid (filled) surfaces derive their color. */
|
|
888
|
+
type YunUISolid = "color" | "contrast" | "inverse";
|
|
889
|
+
/** Whether elevated surfaces are opaque or frosted. */
|
|
890
|
+
type YunUISurface = "filled" | "translucent";
|
|
891
|
+
/** Color scheme — usually managed by your theme manager, exposed here for completeness. */
|
|
892
|
+
type YunUIColorScheme = "light" | "dark";
|
|
893
|
+
interface YunUITheme {
|
|
894
|
+
/** Primary brand palette. */
|
|
895
|
+
brand?: YunUIPalette;
|
|
896
|
+
/** Secondary accent palette. */
|
|
897
|
+
accent?: YunUIPalette;
|
|
898
|
+
/** Neutral/gray palette (typically gray, sand, or slate). */
|
|
899
|
+
neutral?: YunUIPalette;
|
|
900
|
+
solid?: YunUISolid;
|
|
901
|
+
surface?: YunUISurface;
|
|
902
|
+
theme?: YunUIColorScheme;
|
|
903
|
+
}
|
|
904
|
+
/** All palettes available to the brand/accent/neutral roles (for building pickers). */
|
|
905
|
+
declare const YUNUI_PALETTES: YunUIPalette[];
|
|
906
|
+
/**
|
|
907
|
+
* Apply theme attributes to an element (defaults to <html>). Only the keys you
|
|
908
|
+
* pass are written; pass `null` for a key to clear it. Safe to call on the
|
|
909
|
+
* server (no-ops when there is no document and no explicit element).
|
|
910
|
+
*/
|
|
911
|
+
declare function applyTheme(theme: Partial<Record<keyof YunUITheme, string | null>>, el?: HTMLElement | null): void;
|
|
912
|
+
/** Read the current theme attributes back off an element (defaults to <html>). */
|
|
913
|
+
declare function readTheme(el?: HTMLElement | null): YunUITheme;
|
|
914
|
+
/**
|
|
915
|
+
* React hook for runtime theming. Returns the current theme and a setter that
|
|
916
|
+
* merges a patch, applies it to <html>, and persists to localStorage. On mount
|
|
917
|
+
* it hydrates from localStorage (falling back to `defaults`) and applies it.
|
|
918
|
+
*/
|
|
919
|
+
declare function useYunUITheme(defaults?: YunUITheme): [YunUITheme, (patch: YunUITheme) => void];
|
|
920
|
+
|
|
921
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, type AnimatedNumberProps, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Column, Combobox, type ComboboxOption, ConfirmModal, type ConfirmModalVariant, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, type FlexProps, Grid, type GridCount, type GridProps, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, type NavTab, NavTabs, PageLoader, Pagination, type PaginationProps, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, type SegmentedOption, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, type SelectOption, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, type SpacingScale, Spinner, Stack, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, type YunUIColorScheme, type YunUIPalette, type YunUISolid, type YunUISurface, type YunUITheme, applyTheme, cn, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior, useYunUITheme };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, fadeIn, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior } from './chunk-
|
|
2
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, Input, Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior, useYunUITheme } from './chunk-KTA7HC4V.js';
|
|
3
3
|
export { ThemeToggle, cn } from './chunk-N7JHOWGR.js';
|
|
4
4
|
import './chunk-T37N6OZA.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/patterns.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ElementType, ReactNode } from 'react';
|
|
3
|
+
export { F as Footer, a as FooterLink, b as FooterProps, c as FooterSection, d as FooterSocial } from './footer-BoFu7Wqq.js';
|
|
3
4
|
|
|
4
5
|
declare function BackgroundEffects(): React$1.JSX.Element;
|
|
5
6
|
|
package/dist/patterns.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-
|
|
3
|
-
import { copyToClipboard } from './chunk-
|
|
2
|
+
import { Button, Card, Badge, Avatar, AvatarImage, AvatarFallback, IconButton, Spinner } from './chunk-KTA7HC4V.js';
|
|
3
|
+
import { copyToClipboard } from './chunk-FOP7I6N3.js';
|
|
4
|
+
export { Footer } from './chunk-FOP7I6N3.js';
|
|
4
5
|
import { cn } from './chunk-N7JHOWGR.js';
|
|
5
6
|
import { useYunUI } from './chunk-T37N6OZA.js';
|
|
6
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|