@yamatozhen/design_system 1.3.11 → 1.3.13
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/dist/components/(buttons)/button/Button.js +1 -1
- package/dist/components/(buttons)/button/Button.styles.css +1 -1
- package/dist/components/(buttons)/button/Button.styles.js +1 -1
- package/dist/components/(buttons)/buttonSplit/ButtonSplit.js +1 -1
- package/dist/components/(buttons)/buttonSplit/ButtonSplit.styles.css +1 -1
- package/dist/components/(buttons)/fab/Fab.js +1 -1
- package/dist/components/(buttons)/fab/Fab.styles.css +1 -1
- package/dist/components/(color)/colorField/ColorField.styles.css +1 -1
- package/dist/components/(color)/colorPicker/ColorPicker.styles.css +1 -1
- package/dist/components/(color)/colorSlider/ColorSlider.styles.css +1 -1
- package/dist/components/(color)/colorSwatch/ColorSwatch.js +1 -1
- package/dist/components/(color)/colorSwatch/ColorSwatch.styles.css +1 -1
- package/dist/components/(color)/colorSwatchPicker/ColorSwatchPicker.js +1 -1
- package/dist/components/(color)/colorSwatchPicker/ColorSwatchPicker.styles.css +1 -1
- package/dist/components/(datetime)/calendar/Calendar.js +1 -1
- package/dist/components/(datetime)/calendar/Calendar.styles.css +1 -1
- package/dist/components/(datetime)/dateField/DateField.js +1 -1
- package/dist/components/(datetime)/rangeCalendar/RangeCalendar.styles.css +1 -1
- package/dist/components/(datetime)/shared/PickerShell.js +1 -1
- package/dist/components/(datetime)/shared/PickerShell.styles.css +1 -1
- package/dist/components/(datetime)/shared/PickerShell.styles.js +1 -1
- package/dist/components/(datetime)/timeField/TimeField.js +1 -1
- package/dist/components/(datetime)/timeField/TimeField.styles.css +1 -1
- package/dist/components/(effects)/ripple/Ripple.js +1 -1
- package/dist/components/(effects)/ripple/Ripple.styles.css +1 -1
- package/dist/components/(effects)/ripple/Ripple.styles.js +1 -1
- package/dist/components/(effects)/scrollShadow/ScrollShadow.js +1 -1
- package/dist/components/(effects)/scrollShadow/ScrollShadow.styles.css +1 -1
- package/dist/components/(effects)/scrollShadow/useScrollShadow.js +1 -1
- package/dist/components/(effects)/sinewave/Sinewave.js +1 -1
- package/dist/components/(feedback)/circularProgress/CircularProgress.js +1 -1
- package/dist/components/(feedback)/skeleton/Skeleton.js +1 -1
- package/dist/components/(feedback)/skeleton/Skeleton.styles.css +1 -1
- package/dist/components/(feedback)/skeleton/Skeleton.styles.js +1 -1
- package/dist/components/(feedback)/skeleton/constants.js +1 -0
- package/dist/components/(feedback)/skeleton/ghost.js +1 -0
- package/dist/components/(feedback)/skeleton/measure.js +1 -0
- package/dist/components/(feedback)/skeleton/reveal.js +1 -0
- package/dist/components/(feedback)/skeleton/shimmer.js +1 -0
- package/dist/components/(forms)/checkbox/Checkbox.js +1 -1
- package/dist/components/(forms)/checkbox/Checkbox.styles.css +1 -1
- package/dist/components/(forms)/checkboxGroup/CheckboxGroup.js +1 -1
- package/dist/components/(forms)/checkboxGroup/CheckboxGroup.styles.css +1 -1
- package/dist/components/(forms)/fieldset/Fieldset.js +1 -1
- package/dist/components/(forms)/fieldset/Fieldset.styles.css +1 -1
- package/dist/components/(forms)/fileUpload/FileUpload.styles.css +1 -1
- package/dist/components/(forms)/form/Form.js +1 -1
- package/dist/components/(forms)/form/Form.styles.css +1 -1
- package/dist/components/(forms)/input/Input.styles.css +1 -1
- package/dist/components/(forms)/inputOtp/InputOtp.js +1 -1
- package/dist/components/(forms)/numberField/NumberField.styles.css +1 -1
- package/dist/components/(forms)/radio/Radio.styles.css +1 -1
- package/dist/components/(forms)/radioGroup/RadioGroup.js +1 -1
- package/dist/components/(forms)/radioGroup/RadioGroup.styles.css +1 -1
- package/dist/components/(forms)/search/Search.styles.css +1 -1
- package/dist/components/(forms)/shared/FieldAdornment.styles.css +1 -1
- package/dist/components/(forms)/shared/FieldShell.js +1 -1
- package/dist/components/(forms)/shared/FieldShell.styles.css +1 -1
- package/dist/components/(forms)/shared/FieldShell.styles.js +1 -1
- package/dist/components/(forms)/shared/field.styles.css +1 -1
- package/dist/components/(forms)/slider/Slider.styles.css +1 -1
- package/dist/components/(forms)/switch/Switch.styles.css +1 -1
- package/dist/components/(layout)/accordion/Accordion.js +1 -1
- package/dist/components/(layout)/accordion/Accordion.styles.css +1 -1
- package/dist/components/(layout)/accordion/Accordion.styles.js +1 -1
- package/dist/components/(layout)/card/Card.js +1 -1
- package/dist/components/(layout)/card/Card.styles.css +1 -1
- package/dist/components/(layout)/codeSnippet/CodeSnippet.styles.css +1 -1
- package/dist/components/(layout)/grid/Grid.js +1 -1
- package/dist/components/(layout)/list/List.js +1 -1
- package/dist/components/(layout)/list/List.styles.css +1 -1
- package/dist/components/(layout)/section/Section.styles.css +1 -1
- package/dist/components/(layout)/table/Table.js +1 -1
- package/dist/components/(layout)/table/Table.styles.css +1 -1
- package/dist/components/(layout)/table/index.js +1 -1
- package/dist/components/(navigation)/breadcrumbs/Breadcrumbs.styles.css +1 -1
- package/dist/components/(navigation)/nav/Nav.js +1 -1
- package/dist/components/(navigation)/nav/Nav.styles.css +1 -1
- package/dist/components/(navigation)/nav/Nav.styles.js +1 -1
- package/dist/components/(navigation)/nav/NavContext.js +1 -1
- package/dist/components/(navigation)/nav/navAppBar/NavAppBar.styles.css +1 -1
- package/dist/components/(navigation)/nav/navBar/NavBar.js +1 -1
- package/dist/components/(navigation)/nav/navBar/NavBar.styles.css +1 -1
- package/dist/components/(navigation)/nav/navDrawer/NavDrawer.js +1 -1
- package/dist/components/(navigation)/nav/navDrawer/NavDrawer.styles.css +1 -1
- package/dist/components/(navigation)/nav/navMenu/NavMenu.js +1 -1
- package/dist/components/(navigation)/nav/navRail/NavRail.js +1 -1
- package/dist/components/(navigation)/nav/navRail/NavRail.styles.css +1 -1
- package/dist/components/(navigation)/nav/navRail/NavRail.styles.js +1 -1
- package/dist/components/(navigation)/pagination/Pagination.js +1 -1
- package/dist/components/(navigation)/pagination/Pagination.styles.css +1 -1
- package/dist/components/(navigation)/tabs/Tabs.js +1 -0
- package/dist/components/(navigation)/tabs/Tabs.styles.css +1 -0
- package/dist/components/(navigation)/tabs/Tabs.styles.js +2 -0
- package/dist/components/(navigation)/tabs/index.js +1 -0
- package/dist/components/(navigation)/tabs/usePillPhysics.js +1 -0
- package/dist/components/(overlays)/drawer/Drawer.js +1 -1
- package/dist/components/(overlays)/drawer/Drawer.styles.css +1 -1
- package/dist/components/(overlays)/drop/Drop.js +1 -1
- package/dist/components/(overlays)/drop/Drop.styles.css +1 -1
- package/dist/components/(overlays)/modal/Modal.js +1 -1
- package/dist/components/(overlays)/modal/Modal.styles.css +1 -1
- package/dist/components/(overlays)/popover/Popover.js +1 -1
- package/dist/components/(overlays)/popover/Popover.styles.css +1 -1
- package/dist/components/(overlays)/toast/Toast.js +1 -1
- package/dist/components/(overlays)/toast/Toast.styles.css +1 -1
- package/dist/components/(pickers)/select/Select.js +1 -1
- package/dist/components/(pickers)/shared/Picker.styles.css +1 -1
- package/dist/components/(primitives)/avatar/Avatar.styles.css +1 -1
- package/dist/components/(primitives)/badge/Badge.js +1 -1
- package/dist/components/(primitives)/badge/Badge.styles.css +1 -1
- package/dist/components/(primitives)/badge/Badge.styles.js +1 -1
- package/dist/components/(primitives)/code/Code.styles.css +1 -1
- package/dist/components/(primitives)/comment/Comment.js +1 -1
- package/dist/components/(primitives)/icon/Icon.js +1 -1
- package/dist/components/(primitives)/icon/Icon.styles.css +1 -0
- package/dist/components/(primitives)/icon/Icon.styles.js +2 -0
- package/dist/components/(primitives)/kbd/Kbd.styles.css +1 -1
- package/dist/components/(primitives)/label/Label.js +1 -1
- package/dist/components/(primitives)/label/Label.styles.css +1 -0
- package/dist/components/(primitives)/label/Label.styles.js +2 -0
- package/dist/components/(primitives)/separator/Separator.styles.css +1 -1
- package/dist/hooks/useErrorShake.js +1 -0
- package/dist/themes/theme.css +125 -99
- package/dist/themes/yz-palette-dark-hc.css +30 -30
- package/dist/themes/yz-palette-dark.css +29 -29
- package/dist/types/components/(buttons)/button/Button.d.ts +0 -72
- package/dist/types/components/(buttons)/button/index.d.ts +1 -1
- package/dist/types/components/(buttons)/fab/Fab.d.ts +1 -1
- package/dist/types/components/(buttons)/toggleButton/ButtonToggle.d.ts +1 -1
- package/dist/types/components/(datetime)/calendar/Calendar.d.ts +3 -3
- package/dist/types/components/(effects)/ripple/Ripple.d.ts +4 -0
- package/dist/types/components/(feedback)/skeleton/Skeleton.d.ts +18 -8
- package/dist/types/components/(feedback)/skeleton/constants.d.ts +25 -0
- package/dist/types/components/(feedback)/skeleton/ghost.d.ts +17 -0
- package/dist/types/components/(feedback)/skeleton/measure.d.ts +8 -0
- package/dist/types/components/(feedback)/skeleton/reveal.d.ts +12 -0
- package/dist/types/components/(feedback)/skeleton/shimmer.d.ts +7 -0
- package/dist/types/components/(forms)/form/Form.d.ts +2 -0
- package/dist/types/components/(layout)/accordion/Accordion.d.ts +16 -5
- package/dist/types/components/(layout)/table/Table.d.ts +3 -3
- package/dist/types/components/(layout)/table/index.d.ts +1 -1
- package/dist/types/components/(navigation)/nav/Nav.d.ts +1 -1
- package/dist/types/components/(navigation)/nav/NavContext.d.ts +3 -0
- package/dist/types/components/(navigation)/nav/navBar/NavBar.d.ts +3 -1
- package/dist/types/components/(navigation)/nav/navDrawer/NavDrawer.d.ts +3 -1
- package/dist/types/components/(navigation)/nav/navMenu/NavMenu.d.ts +3 -2
- package/dist/types/components/(navigation)/nav/navRail/NavRail.d.ts +3 -1
- package/dist/types/components/(navigation)/tabs/Tabs.d.ts +40 -0
- package/dist/types/components/(navigation)/tabs/index.d.ts +2 -0
- package/dist/types/components/(navigation)/tabs/usePillPhysics.d.ts +10 -0
- package/dist/types/components/(pickers)/select/Select.d.ts +2 -2
- package/dist/types/hooks/useErrorShake.d.ts +4 -0
- package/package.json +34 -32
- package/dist/package.exports.json +0 -403
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SkeletonAnimation } from "./Skeleton";
|
|
2
|
+
export declare class Ghost {
|
|
3
|
+
private root;
|
|
4
|
+
private animation;
|
|
5
|
+
private ghost;
|
|
6
|
+
private snapshot;
|
|
7
|
+
private layer;
|
|
8
|
+
private fallback;
|
|
9
|
+
private frame;
|
|
10
|
+
private mutations;
|
|
11
|
+
private resize;
|
|
12
|
+
constructor(root: HTMLElement, animation: SkeletonAnimation);
|
|
13
|
+
private schedule;
|
|
14
|
+
private choose;
|
|
15
|
+
private measure;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PaneBox = {
|
|
2
|
+
top: number;
|
|
3
|
+
left: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function noteSkeleton(reveal: Element): void;
|
|
8
|
+
export declare function fadeIn(element: HTMLElement, { initial }?: {
|
|
9
|
+
initial?: boolean | undefined;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare function boxOf(element: HTMLElement): PaneBox;
|
|
12
|
+
export declare function fadeOut(element: HTMLElement, box?: PaneBox): Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SkeletonRect } from "./measure";
|
|
2
|
+
import type { SkeletonAnimation } from "./Skeleton";
|
|
3
|
+
export declare const prefersReducedMotion: () => boolean;
|
|
4
|
+
export declare const animationsOf: (element: Element) => Animation[];
|
|
5
|
+
export declare function shimmer(element: HTMLElement, animation: SkeletonAnimation): void;
|
|
6
|
+
export declare const rectsOf: (layer: Element) => HTMLElement[];
|
|
7
|
+
export declare function drawSkeleton(layer: HTMLElement, rects: SkeletonRect[], animation: SkeletonAnimation): void;
|
|
@@ -11,6 +11,8 @@ type FooterProps = {
|
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
};
|
|
13
13
|
export declare function useFormFieldErrors(name?: string): string[] | undefined;
|
|
14
|
+
export declare function useFormValidationErrors(): FormValidationErrors | null;
|
|
15
|
+
export declare function useFormSubmitCount(): number | null;
|
|
14
16
|
declare function Form({ onSubmit, validationErrors, className, style, children, }: FormProps): React.JSX.Element;
|
|
15
17
|
declare function FormFooter({ children }: FooterProps): React.JSX.Element | null;
|
|
16
18
|
declare const _default: typeof Form & {
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ColorRole, SurfaceVariant } from "../../../lib/types.js";
|
|
3
|
+
export type AccordionSelection = "single" | "multiple";
|
|
3
4
|
type Tone = {
|
|
4
5
|
variant?: SurfaceVariant;
|
|
5
6
|
color?: ColorRole;
|
|
6
7
|
};
|
|
7
|
-
type
|
|
8
|
+
type AccordionBaseProps = Tone & {
|
|
8
9
|
hoverBg?: string;
|
|
9
|
-
value?: string | null;
|
|
10
|
-
defaultValue?: string | null;
|
|
11
|
-
onChange?: (value: string | null) => void;
|
|
12
10
|
className?: string;
|
|
13
11
|
style?: React.CSSProperties;
|
|
14
12
|
children?: React.ReactNode;
|
|
15
13
|
};
|
|
14
|
+
type SingleAccordionProps = AccordionBaseProps & {
|
|
15
|
+
selection?: "single";
|
|
16
|
+
value?: string | null;
|
|
17
|
+
defaultValue?: string | null;
|
|
18
|
+
onChange?: (value: string | null) => void;
|
|
19
|
+
};
|
|
20
|
+
type MultipleAccordionProps = AccordionBaseProps & {
|
|
21
|
+
selection: "multiple";
|
|
22
|
+
value?: string[];
|
|
23
|
+
defaultValue?: string[];
|
|
24
|
+
onChange?: (value: string[]) => void;
|
|
25
|
+
};
|
|
26
|
+
export type AccordionProps = SingleAccordionProps | MultipleAccordionProps;
|
|
16
27
|
type AccordionRowProps = Tone & {
|
|
17
28
|
hoverBg?: string;
|
|
18
29
|
value?: string;
|
|
@@ -26,7 +37,7 @@ type RegionProps = {
|
|
|
26
37
|
style?: React.CSSProperties;
|
|
27
38
|
children?: React.ReactNode;
|
|
28
39
|
};
|
|
29
|
-
declare function Accordion(
|
|
40
|
+
declare function Accordion(props: AccordionProps): React.JSX.Element;
|
|
30
41
|
declare function AccordionRow({ value, variant, color, hoverBg, disabled, className, style, children, }: AccordionRowProps): React.JSX.Element;
|
|
31
42
|
declare function AccordionHeader({ className, style, children }: RegionProps): React.JSX.Element;
|
|
32
43
|
declare function AccordionContent({ className, style, children }: RegionProps): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type RowKey = string | number;
|
|
3
|
-
export type
|
|
3
|
+
export type TableSelection = "none" | "single" | "multiple";
|
|
4
4
|
export type SortDirection = "ascending" | "descending";
|
|
5
5
|
export type SortDescriptor = {
|
|
6
6
|
column: string;
|
|
@@ -15,7 +15,7 @@ export type Virtualize = boolean | {
|
|
|
15
15
|
overscan?: number;
|
|
16
16
|
};
|
|
17
17
|
export type TableProps = {
|
|
18
|
-
|
|
18
|
+
selection?: TableSelection;
|
|
19
19
|
selectedKeys?: ReadonlySet<RowKey>;
|
|
20
20
|
defaultSelectedKeys?: ReadonlySet<RowKey>;
|
|
21
21
|
onChange?: (keys: ReadonlySet<RowKey>) => void;
|
|
@@ -31,7 +31,7 @@ export type TableProps = {
|
|
|
31
31
|
className?: string;
|
|
32
32
|
style?: React.CSSProperties;
|
|
33
33
|
};
|
|
34
|
-
declare function Table({
|
|
34
|
+
declare function Table({ selection, selectedKeys: selectedKeysProp, defaultSelectedKeys, onChange, sortDescriptor: sortDescriptorProp, defaultSortDescriptor, onSort, rowHeight, virtualize, align, children, className, style, }: TableProps): React.JSX.Element;
|
|
35
35
|
export type TableSectionProps = {
|
|
36
36
|
children?: React.ReactNode;
|
|
37
37
|
className?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from "./Table";
|
|
2
|
-
export type { TableProps, TableSectionProps, TableHeaderProps, TableColumnProps, TableContentProps, TableRowProps, TableCellProps, TableLoadMoreProps, RowKey,
|
|
2
|
+
export type { TableProps, TableSectionProps, TableHeaderProps, TableColumnProps, TableContentProps, TableRowProps, TableCellProps, TableLoadMoreProps, RowKey, TableSelection, SortDescriptor, SortDirection, TableAlign, TableAlignment, Virtualize, } from "./Table";
|
|
@@ -5,7 +5,7 @@ import NavDrawer from "./navDrawer/NavDrawer";
|
|
|
5
5
|
import NavAppBar, { NavLeading, NavLogo, NavTitle, NavTrailing } from "./navAppBar/NavAppBar";
|
|
6
6
|
import { type NavProps, type NavRegionProps, type NavTabProps } from "./NavContext";
|
|
7
7
|
import type { SurfaceVariant } from "../../../lib/types.js";
|
|
8
|
-
declare function NavRoot({ children, expanded: controlledExpanded, onExpandedChange, defaultExpanded, className, style, }: NavProps): React.JSX.Element;
|
|
8
|
+
declare function NavRoot({ children, expanded: controlledExpanded, onExpandedChange, defaultExpanded, selection, className, style, }: NavProps): React.JSX.Element;
|
|
9
9
|
declare function NavHeader({ children, className, style }: NavRegionProps): React.JSX.Element;
|
|
10
10
|
declare namespace NavHeader {
|
|
11
11
|
var navRegion: "header";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LabelContent } from "../../../lib/types.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export type NavSurface = "rail" | "bar" | "drawer" | "appbar";
|
|
4
|
+
export type NavSelection = "single" | "multiple";
|
|
4
5
|
export type NavRegionProps = {
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
className?: string;
|
|
@@ -11,6 +12,7 @@ export type NavProps = {
|
|
|
11
12
|
expanded?: boolean;
|
|
12
13
|
onExpandedChange?: (expanded: boolean) => void;
|
|
13
14
|
defaultExpanded?: boolean;
|
|
15
|
+
selection?: NavSelection;
|
|
14
16
|
className?: string;
|
|
15
17
|
style?: React.CSSProperties;
|
|
16
18
|
};
|
|
@@ -35,6 +37,7 @@ export type NavContextValue = {
|
|
|
35
37
|
isExpanded: boolean;
|
|
36
38
|
setExpanded: (isExpanded: boolean) => void;
|
|
37
39
|
toggleExpanded: () => void;
|
|
40
|
+
selection: NavSelection;
|
|
38
41
|
isMobile: boolean;
|
|
39
42
|
isTablet: boolean;
|
|
40
43
|
railWidth: number;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SurfaceVariant } from "../../../../lib/types.js";
|
|
3
|
+
import { type NavSelection } from "../NavContext";
|
|
3
4
|
export type NavBarProps = {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
floating?: boolean;
|
|
6
7
|
alignItems?: "center" | "left" | "right";
|
|
7
8
|
variant?: SurfaceVariant;
|
|
9
|
+
selection?: NavSelection;
|
|
8
10
|
className?: string;
|
|
9
11
|
style?: React.CSSProperties;
|
|
10
12
|
};
|
|
11
|
-
declare function NavBar({ children, floating, alignItems, variant, className, style, }: NavBarProps): React.JSX.Element;
|
|
13
|
+
declare function NavBar({ children, floating, alignItems, variant, selection, className, style, }: NavBarProps): React.JSX.Element;
|
|
12
14
|
export default NavBar;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type NavSelection } from "../NavContext";
|
|
2
3
|
export type NavDrawerPlacement = "left" | "right" | "top" | "bottom" | "none";
|
|
3
4
|
type TriggerChildProps = {
|
|
4
5
|
onClick?: (e: React.MouseEvent) => void;
|
|
@@ -9,11 +10,12 @@ export type NavDrawerProps = {
|
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
trigger?: React.ReactElement<TriggerChildProps>;
|
|
11
12
|
placement?: NavDrawerPlacement;
|
|
13
|
+
selection?: NavSelection;
|
|
12
14
|
open?: boolean;
|
|
13
15
|
defaultOpen?: boolean;
|
|
14
16
|
onOpenChange?: (open: boolean) => void;
|
|
15
17
|
className?: string;
|
|
16
18
|
style?: React.CSSProperties;
|
|
17
19
|
};
|
|
18
|
-
export default function NavDrawer({ children, trigger, placement, open: controlledOpen, defaultOpen, onOpenChange, className, style, }: NavDrawerProps): React.JSX.Element;
|
|
20
|
+
export default function NavDrawer({ children, trigger, placement, selection, open: controlledOpen, defaultOpen, onOpenChange, className, style, }: NavDrawerProps): React.JSX.Element;
|
|
19
21
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type NavSurface } from "../NavContext";
|
|
2
|
+
import { type NavSelection, type NavSurface } from "../NavContext";
|
|
3
3
|
export type NavMenuProps = {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
surface?: NavSurface;
|
|
6
6
|
depth?: number;
|
|
7
|
+
selection?: NavSelection;
|
|
7
8
|
onLeafClick?: () => void;
|
|
8
9
|
scrollRef?: React.Ref<HTMLDivElement>;
|
|
9
10
|
shadowColor?: string;
|
|
@@ -11,4 +12,4 @@ export type NavMenuProps = {
|
|
|
11
12
|
innerClassName?: string;
|
|
12
13
|
style?: React.CSSProperties;
|
|
13
14
|
};
|
|
14
|
-
export default function NavMenu({ children, surface, depth, onLeafClick, scrollRef, shadowColor, className, innerClassName, style, }: NavMenuProps): React.JSX.Element;
|
|
15
|
+
export default function NavMenu({ children, surface, depth, selection: ownSelection, onLeafClick, scrollRef, shadowColor, className, innerClassName, style, }: NavMenuProps): React.JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type NavSelection } from "../NavContext";
|
|
2
3
|
export type NavRailBehavior = "manual" | "autoClose" | "alwaysOpen";
|
|
3
4
|
export type NavRailProps = {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
behavior?: NavRailBehavior;
|
|
7
|
+
selection?: NavSelection;
|
|
6
8
|
className?: string;
|
|
7
9
|
style?: React.CSSProperties;
|
|
8
10
|
};
|
|
9
|
-
declare function NavRail({ children, behavior, className, style, }: NavRailProps): React.JSX.Element;
|
|
11
|
+
declare function NavRail({ children, behavior, selection, className, style, }: NavRailProps): React.JSX.Element;
|
|
10
12
|
export default NavRail;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ColorRole, LabelContent, SurfaceVariant } from "../../../lib/types.js";
|
|
3
|
+
export type TabsSize = "xs" | "s" | "m" | "l" | "xl";
|
|
4
|
+
export type TabsVariant = SurfaceVariant;
|
|
5
|
+
export type TabsColor = ColorRole | `${ColorRole}-bold`;
|
|
6
|
+
export type TabsFloating = boolean | "on-scroll";
|
|
7
|
+
export type TabProps = {
|
|
8
|
+
value: string;
|
|
9
|
+
content: LabelContent;
|
|
10
|
+
reverse?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
"aria-label"?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export type TabsProps = {
|
|
18
|
+
size?: TabsSize;
|
|
19
|
+
variant?: TabsVariant;
|
|
20
|
+
color?: TabsColor;
|
|
21
|
+
reverse?: boolean;
|
|
22
|
+
floating?: TabsFloating;
|
|
23
|
+
value?: string;
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
onChange?: (value: string) => void;
|
|
26
|
+
"aria-label"?: string;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: React.CSSProperties;
|
|
30
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
31
|
+
};
|
|
32
|
+
declare function Tab(_props: TabProps): React.ReactElement | null;
|
|
33
|
+
declare namespace Tab {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
declare function TabsRoot({ size, variant, color, reverse, floating, value: controlledValue, defaultValue, onChange, "aria-label": ariaLabel, children, className, style, ref, }: TabsProps): React.JSX.Element;
|
|
37
|
+
declare const Tabs: typeof TabsRoot & {
|
|
38
|
+
Tab: typeof Tab;
|
|
39
|
+
};
|
|
40
|
+
export default Tabs;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function usePillPhysics(activeIndex: number, tabCount: number, tabsKey: string, onScrollFloating: boolean): {
|
|
2
|
+
barRef: import("react").RefObject<HTMLDivElement | null>;
|
|
3
|
+
scrollerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
4
|
+
trackRef: import("react").RefObject<HTMLDivElement | null>;
|
|
5
|
+
pillRef: import("react").RefObject<HTMLDivElement | null>;
|
|
6
|
+
stuck: boolean;
|
|
7
|
+
registerTab: (index: number) => (el: HTMLButtonElement | null) => void;
|
|
8
|
+
onTabPointerEnter: (index: number) => void;
|
|
9
|
+
onTabPointerLeave: () => void;
|
|
10
|
+
};
|
|
@@ -7,7 +7,7 @@ export type SelectValue = string | string[] | null;
|
|
|
7
7
|
export type SelectProps = {
|
|
8
8
|
items: PickerItem[];
|
|
9
9
|
content?: FieldContent;
|
|
10
|
-
|
|
10
|
+
selection?: "single" | "multiple";
|
|
11
11
|
value?: SelectValue;
|
|
12
12
|
defaultValue?: SelectValue;
|
|
13
13
|
onChange?: (value: SelectValue) => void;
|
|
@@ -24,4 +24,4 @@ export type SelectProps = {
|
|
|
24
24
|
className?: string;
|
|
25
25
|
style?: React.CSSProperties;
|
|
26
26
|
};
|
|
27
|
-
export default function Select({ items, content,
|
|
27
|
+
export default function Select({ items, content, selection, value: controlledValue, defaultValue, onChange, placeholder, disabled, required, invalid, errorMessage, color, fullWidth, name, id, "aria-label": ariaLabel, className, style, }: SelectProps): React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Plays a horizontal shake on the attached element when `invalid` transitions
|
|
2
|
+
* `false` → `true`, or when a containing form is re-submitted while still
|
|
3
|
+
* invalid (never on initial mount). */
|
|
4
|
+
export declare function useErrorShake<T extends HTMLElement = HTMLElement>(invalid: boolean | undefined): import("react").RefObject<T | null>;
|
package/package.json
CHANGED
|
@@ -1,49 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamatozhen/design_system",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "Yamato Zhen design system — Material Design 3 components for React / Next.js, imported from the package (no files are copied into your project).",
|
|
5
|
-
"private": false,
|
|
3
|
+
"version": "1.3.13",
|
|
6
4
|
"license": "Apache-2.0",
|
|
7
5
|
"repository": {
|
|
8
6
|
"type": "git",
|
|
9
7
|
"url": "git+https://github.com/YamatoZhen/design_system.git"
|
|
10
8
|
},
|
|
11
|
-
"homepage": "https://github.com/YamatoZhen/design_system#readme",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/YamatoZhen/design_system/issues"
|
|
14
|
-
},
|
|
15
9
|
"publishConfig": {
|
|
16
10
|
"access": "public"
|
|
17
11
|
},
|
|
12
|
+
"description": "Yamato Zhen design system — Material Design 3 components for React / Next.js, imported from the package (no files are copied into your project).",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
18
16
|
"files": [
|
|
19
17
|
"dist",
|
|
20
18
|
"README.md"
|
|
21
19
|
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"postversion": "git push && git push --tags"
|
|
24
|
-
},
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"next": ">=15",
|
|
27
|
-
"react": ">=19",
|
|
28
|
-
"react-dom": ">=19",
|
|
29
|
-
"framer-motion": ">=12",
|
|
30
|
-
"colorthief": ">=3",
|
|
31
|
-
"flubber": ">=0.4"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"next": "^16.4.2",
|
|
35
|
-
"react": "^19.2.7",
|
|
36
|
-
"react-dom": "^19.2.7",
|
|
37
|
-
"framer-motion": "^12.34.3",
|
|
38
|
-
"colorthief": "^3.3.1",
|
|
39
|
-
"flubber": "^0.4.2",
|
|
40
|
-
"typescript": "^5",
|
|
41
|
-
"@types/react": "^19",
|
|
42
|
-
"@types/react-dom": "^19"
|
|
43
|
-
},
|
|
44
|
-
"sideEffects": [
|
|
45
|
-
"**/*.css"
|
|
46
|
-
],
|
|
47
20
|
"exports": {
|
|
48
21
|
"./themes/*": "./dist/themes/*",
|
|
49
22
|
"./accordion": {
|
|
@@ -221,6 +194,11 @@
|
|
|
221
194
|
"import": "./dist/hooks/useBodyScrollLock.js",
|
|
222
195
|
"default": "./dist/hooks/useBodyScrollLock.js"
|
|
223
196
|
},
|
|
197
|
+
"./hooks/useErrorShake": {
|
|
198
|
+
"types": "./dist/types/hooks/useErrorShake.d.ts",
|
|
199
|
+
"import": "./dist/hooks/useErrorShake.js",
|
|
200
|
+
"default": "./dist/hooks/useErrorShake.js"
|
|
201
|
+
},
|
|
224
202
|
"./hooks/useImageColor": {
|
|
225
203
|
"types": "./dist/types/hooks/useImageColor.d.ts",
|
|
226
204
|
"import": "./dist/hooks/useImageColor.js",
|
|
@@ -426,6 +404,11 @@
|
|
|
426
404
|
"import": "./dist/components/(layout)/table/index.js",
|
|
427
405
|
"default": "./dist/components/(layout)/table/index.js"
|
|
428
406
|
},
|
|
407
|
+
"./tabs": {
|
|
408
|
+
"types": "./dist/types/components/(navigation)/tabs/index.d.ts",
|
|
409
|
+
"import": "./dist/components/(navigation)/tabs/index.js",
|
|
410
|
+
"default": "./dist/components/(navigation)/tabs/index.js"
|
|
411
|
+
},
|
|
429
412
|
"./textArea": {
|
|
430
413
|
"types": "./dist/types/components/(forms)/textArea/TextArea.d.ts",
|
|
431
414
|
"import": "./dist/components/(forms)/textArea/TextArea.js",
|
|
@@ -447,9 +430,28 @@
|
|
|
447
430
|
"default": "./dist/components/(buttons)/toggleButton/index.js"
|
|
448
431
|
}
|
|
449
432
|
},
|
|
433
|
+
"peerDependencies": {
|
|
434
|
+
"next": ">=15",
|
|
435
|
+
"react": ">=19",
|
|
436
|
+
"react-dom": ">=19",
|
|
437
|
+
"framer-motion": ">=12",
|
|
438
|
+
"colorthief": ">=3",
|
|
439
|
+
"flubber": ">=0.4"
|
|
440
|
+
},
|
|
450
441
|
"peerDependenciesMeta": {
|
|
451
442
|
"colorthief": {
|
|
452
443
|
"optional": true
|
|
453
444
|
}
|
|
445
|
+
},
|
|
446
|
+
"devDependencies": {
|
|
447
|
+
"next": "^16.4.6",
|
|
448
|
+
"react": "^19.3.1",
|
|
449
|
+
"react-dom": "^19.3.1",
|
|
450
|
+
"framer-motion": "^12.34.3",
|
|
451
|
+
"colorthief": "^3.3.1",
|
|
452
|
+
"flubber": "^0.4.2",
|
|
453
|
+
"typescript": "^5",
|
|
454
|
+
"@types/react": "^19",
|
|
455
|
+
"@types/react-dom": "^19"
|
|
454
456
|
}
|
|
455
457
|
}
|