@umami/react-zen 0.12.0 → 0.14.0
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/index.css +16 -191
- package/dist/index.d.ts +25 -69
- package/dist/index.js +334 -1327
- package/dist/index.mjs +168 -1161
- package/dist/zen.css +1 -1
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* src/components/
|
|
1
|
+
/* src/components/forms/Form.module.css */
|
|
2
2
|
.Form_form {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -630,7 +630,7 @@
|
|
|
630
630
|
text-align: right;
|
|
631
631
|
}
|
|
632
632
|
|
|
633
|
-
/* src/components/
|
|
633
|
+
/* src/components/forms/FormField.module.css */
|
|
634
634
|
.FormField_field {
|
|
635
635
|
display: flex;
|
|
636
636
|
flex-direction: column;
|
|
@@ -1215,11 +1215,6 @@
|
|
|
1215
1215
|
}
|
|
1216
1216
|
|
|
1217
1217
|
/* src/components/TextField.module.css */
|
|
1218
|
-
.TextField_textarea {
|
|
1219
|
-
font-family: inherit;
|
|
1220
|
-
min-height: 60px;
|
|
1221
|
-
min-width: 140px;
|
|
1222
|
-
}
|
|
1223
1218
|
.TextField_allowCopy {
|
|
1224
1219
|
padding-right: 32px;
|
|
1225
1220
|
}
|
|
@@ -1495,198 +1490,28 @@
|
|
|
1495
1490
|
}
|
|
1496
1491
|
|
|
1497
1492
|
/* src/components/NavigationMenu.module.css */
|
|
1498
|
-
.
|
|
1499
|
-
position: relative;
|
|
1500
|
-
display: flex;
|
|
1501
|
-
align-items: center;
|
|
1502
|
-
justify-content: center;
|
|
1503
|
-
width: 100%;
|
|
1504
|
-
z-index: 1;
|
|
1505
|
-
}
|
|
1506
|
-
.NavigationMenu_list {
|
|
1493
|
+
.NavigationMenu_nav {
|
|
1507
1494
|
display: flex;
|
|
1508
1495
|
align-items: center;
|
|
1509
|
-
|
|
1510
|
-
background-color: var(--background-color);
|
|
1511
|
-
gap: var(--gap);
|
|
1512
|
-
list-style: none;
|
|
1513
|
-
margin: 0;
|
|
1496
|
+
gap: var(--gap-lg);
|
|
1514
1497
|
}
|
|
1515
|
-
.
|
|
1498
|
+
.NavigationMenu_item {
|
|
1499
|
+
color: var(--font-color);
|
|
1516
1500
|
display: flex;
|
|
1517
1501
|
align-items: center;
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
border:
|
|
1521
|
-
|
|
1522
|
-
}
|
|
1523
|
-
.NavigationMenu_link {
|
|
1524
|
-
display: block;
|
|
1525
|
-
text-decoration: none;
|
|
1526
|
-
}
|
|
1527
|
-
.NavigationMenu_trigger,
|
|
1528
|
-
.NavigationMenu_link {
|
|
1529
|
-
outline: none;
|
|
1530
|
-
user-select: none;
|
|
1531
|
-
}
|
|
1532
|
-
.NavigationMenu_content {
|
|
1533
|
-
position: absolute;
|
|
1534
|
-
top: 0;
|
|
1535
|
-
left: 0;
|
|
1536
|
-
width: 100%;
|
|
1537
|
-
animation-duration: 250ms;
|
|
1538
|
-
animation-timing-function: ease;
|
|
1539
|
-
}
|
|
1540
|
-
.NavigationMenu_content[data-motion=from-start] {
|
|
1541
|
-
animation-name: NavigationMenu_enterFromLeft;
|
|
1542
|
-
}
|
|
1543
|
-
.NavigationMenu_content[data-motion=from-end] {
|
|
1544
|
-
animation-name: NavigationMenu_enterFromRight;
|
|
1545
|
-
}
|
|
1546
|
-
.NavigationMenu_content[data-motion=to-start] {
|
|
1547
|
-
animation-name: NavigationMenu_exitToLeft;
|
|
1548
|
-
}
|
|
1549
|
-
.NavigationMenu_content[data-motion=to-end] {
|
|
1550
|
-
animation-name: NavigationMenu_exitToRight;
|
|
1551
|
-
}
|
|
1552
|
-
@media only screen and (min-width: 600px) {
|
|
1553
|
-
.NavigationMenu_content {
|
|
1554
|
-
width: auto;
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
.NavigationMenu_indicator {
|
|
1558
|
-
display: flex;
|
|
1559
|
-
align-items: flex-end;
|
|
1560
|
-
justify-content: center;
|
|
1561
|
-
height: 10px;
|
|
1562
|
-
top: 100%;
|
|
1563
|
-
overflow: hidden;
|
|
1564
|
-
z-index: 1;
|
|
1565
|
-
transition: width, transform 250ms ease;
|
|
1566
|
-
}
|
|
1567
|
-
.NavigationMenu_indicator[data-state=visible] {
|
|
1568
|
-
animation: NavigationMenu_fadeIn 200ms ease;
|
|
1569
|
-
}
|
|
1570
|
-
.NavigationMenu_indicator[data-state=hidden] {
|
|
1571
|
-
animation: NavigationMenu_fadeOut 200ms ease;
|
|
1572
|
-
}
|
|
1573
|
-
.NavigationMenu_viewport {
|
|
1574
|
-
position: relative;
|
|
1575
|
-
transform-origin: top center;
|
|
1576
|
-
margin-top: 10px;
|
|
1577
|
-
width: 100%;
|
|
1578
|
-
overflow: hidden;
|
|
1579
|
-
box-shadow: var(--box-shadow);
|
|
1580
|
-
height: var(--radix-navigation-menu-viewport-height);
|
|
1581
|
-
transition:
|
|
1582
|
-
width,
|
|
1583
|
-
height,
|
|
1584
|
-
300ms ease;
|
|
1585
|
-
}
|
|
1586
|
-
.NavigationMenu_viewport[data-state=open] {
|
|
1587
|
-
animation: NavigationMenu_scaleIn 200ms ease;
|
|
1588
|
-
}
|
|
1589
|
-
.NavigationMenu_viewport[data-state=closed] {
|
|
1590
|
-
animation: NavigationMenu_scaleOut 200ms ease;
|
|
1591
|
-
}
|
|
1592
|
-
@media only screen and (min-width: 600px) {
|
|
1593
|
-
.NavigationMenu_viewport {
|
|
1594
|
-
width: var(--radix-navigation-menu-viewport-width);
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
.NavigationMenu_wrapper {
|
|
1598
|
-
position: absolute;
|
|
1599
|
-
display: flex;
|
|
1600
|
-
justify-content: center;
|
|
1601
|
-
width: 100%;
|
|
1602
|
-
top: 100%;
|
|
1603
|
-
left: 0;
|
|
1604
|
-
perspective: 2000px;
|
|
1605
|
-
}
|
|
1606
|
-
.NavigationMenu_arrow {
|
|
1607
|
-
position: relative;
|
|
1608
|
-
top: 70%;
|
|
1609
|
-
background-color: white;
|
|
1610
|
-
width: 10px;
|
|
1611
|
-
height: 10px;
|
|
1612
|
-
transform: rotate(45deg);
|
|
1613
|
-
border-top-left-radius: 2px;
|
|
1614
|
-
}
|
|
1615
|
-
@keyframes NavigationMenu_enterFromRight {
|
|
1616
|
-
from {
|
|
1617
|
-
opacity: 0;
|
|
1618
|
-
transform: translateX(200px);
|
|
1619
|
-
}
|
|
1620
|
-
to {
|
|
1621
|
-
opacity: 1;
|
|
1622
|
-
transform: translateX(0);
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
@keyframes NavigationMenu_enterFromLeft {
|
|
1626
|
-
from {
|
|
1627
|
-
opacity: 0;
|
|
1628
|
-
transform: translateX(-200px);
|
|
1629
|
-
}
|
|
1630
|
-
to {
|
|
1631
|
-
opacity: 1;
|
|
1632
|
-
transform: translateX(0);
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
@keyframes NavigationMenu_exitToRight {
|
|
1636
|
-
from {
|
|
1637
|
-
opacity: 1;
|
|
1638
|
-
transform: translateX(0);
|
|
1639
|
-
}
|
|
1640
|
-
to {
|
|
1641
|
-
opacity: 0;
|
|
1642
|
-
transform: translateX(200px);
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
@keyframes NavigationMenu_exitToLeft {
|
|
1646
|
-
from {
|
|
1647
|
-
opacity: 1;
|
|
1648
|
-
transform: translateX(0);
|
|
1649
|
-
}
|
|
1650
|
-
to {
|
|
1651
|
-
opacity: 0;
|
|
1652
|
-
transform: translateX(-200px);
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
@keyframes NavigationMenu_scaleIn {
|
|
1656
|
-
from {
|
|
1657
|
-
opacity: 0;
|
|
1658
|
-
transform: rotateX(-30deg) scale(0.9);
|
|
1659
|
-
}
|
|
1660
|
-
to {
|
|
1661
|
-
opacity: 1;
|
|
1662
|
-
transform: rotateX(0deg) scale(1);
|
|
1663
|
-
}
|
|
1502
|
+
gap: var(--gap-md);
|
|
1503
|
+
padding: var(--padding);
|
|
1504
|
+
border-radius: var(--border-radius);
|
|
1505
|
+
cursor: default;
|
|
1664
1506
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
opacity: 1;
|
|
1668
|
-
transform: rotateX(0deg) scale(1);
|
|
1669
|
-
}
|
|
1670
|
-
to {
|
|
1671
|
-
opacity: 0;
|
|
1672
|
-
transform: rotateX(-10deg) scale(0.95);
|
|
1673
|
-
}
|
|
1507
|
+
.NavigationMenu_item:hover {
|
|
1508
|
+
background: var(--highlight-color);
|
|
1674
1509
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
opacity: 0;
|
|
1678
|
-
}
|
|
1679
|
-
to {
|
|
1680
|
-
opacity: 1;
|
|
1681
|
-
}
|
|
1510
|
+
.NavigationMenu_nav .NavigationMenu_item > a {
|
|
1511
|
+
color: var(--font-color);
|
|
1682
1512
|
}
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
opacity: 1;
|
|
1686
|
-
}
|
|
1687
|
-
to {
|
|
1688
|
-
opacity: 0;
|
|
1689
|
-
}
|
|
1513
|
+
.NavigationMenu_icon {
|
|
1514
|
+
color: var(--font-muted-color);
|
|
1690
1515
|
}
|
|
1691
1516
|
|
|
1692
1517
|
/* src/components/PasswordField.module.css */
|
package/dist/index.d.ts
CHANGED
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
// Dependencies for this module:
|
|
3
3
|
// ../../react-aria-components
|
|
4
4
|
// ../../@radix-ui/react-slot
|
|
5
|
+
// ../../@/components/forms/Form
|
|
6
|
+
// ../../@/components/forms/FormField
|
|
7
|
+
// ../../@/components/forms/FormResetButton
|
|
8
|
+
// ../../@/components/forms/FormSubmitButton
|
|
5
9
|
// ../../react
|
|
6
|
-
// ../../react-hook-form
|
|
7
10
|
// ../../@radix-ui/react-accordion
|
|
8
11
|
// ../../@/lib/types
|
|
9
|
-
// ../../@radix-ui/react-navigation-menu
|
|
10
12
|
// ../../@radix-ui/react-toast
|
|
11
13
|
// ../../@radix-ui/react-toggle-group
|
|
12
14
|
|
|
13
15
|
declare module '@umami/react-zen' {
|
|
14
16
|
import { DialogTrigger, FileTrigger, MenuTrigger, SubmenuTrigger, TooltipTrigger } from 'react-aria-components';
|
|
15
17
|
import { Slot } from '@radix-ui/react-slot';
|
|
16
|
-
import { Form } from '
|
|
17
|
-
import { FormField } from '
|
|
18
|
-
import { FormResetButton } from '
|
|
19
|
-
import { FormSubmitButton } from '
|
|
18
|
+
import { Form } from '@/components/forms/Form';
|
|
19
|
+
import { FormField } from '@/components/forms/FormField';
|
|
20
|
+
import { FormResetButton } from '@/components/forms/FormResetButton';
|
|
21
|
+
import { FormSubmitButton } from '@/components/forms/FormSubmitButton';
|
|
20
22
|
import { useDebounce } from '@umami/react-zen/hooks/useDebounce';
|
|
21
23
|
import { useTheme } from '@umami/react-zen/hooks/useTheme';
|
|
22
24
|
import { useToast } from '@umami/react-zen/hooks/useToast';
|
|
@@ -48,7 +50,7 @@ declare module '@umami/react-zen' {
|
|
|
48
50
|
import { Menu } from '@umami/react-zen/Menu';
|
|
49
51
|
import { MenuItem } from '@umami/react-zen/MenuItem';
|
|
50
52
|
import { Modal } from '@umami/react-zen/Modal';
|
|
51
|
-
import { NavigationMenu, NavigationMenuItem
|
|
53
|
+
import { NavigationMenu, NavigationMenuItem } from '@umami/react-zen/NavigationMenu';
|
|
52
54
|
import { PasswordField } from '@umami/react-zen/PasswordField';
|
|
53
55
|
import { Page } from '@umami/react-zen/Page';
|
|
54
56
|
import { Popover } from '@umami/react-zen/Popover';
|
|
@@ -73,57 +75,7 @@ declare module '@umami/react-zen' {
|
|
|
73
75
|
import { ToggleGroup, ToggleGroupItem } from '@umami/react-zen/ToggleGroup';
|
|
74
76
|
import { Tooltip } from '@umami/react-zen/Tooltip';
|
|
75
77
|
import { ZenProvider } from '@umami/react-zen/ZenProvider';
|
|
76
|
-
export { Form, FormField, FormResetButton, FormSubmitButton, useDebounce, useTheme, useToast, Accordion, AccordionContent, AccordionItem, AccordionHeader, AlertBanner, AlertDialog, Box, Breadcrumb, Breadcrumbs, Button, Calendar, Checkbox, Column, Combobox, ConfirmationDialog, DataTable, DataColumn, Dialog, DialogTrigger, Dots, FileTrigger, Flexbox, Heading, HoverTrigger, Icon, Icons, InlineEditField, Label, List, ListItem, Loading, LoadingButton, Menu, MenuItem, MenuTrigger, Modal, NavigationMenu, NavigationMenuItem,
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
declare module '@umami/react-zen/form/Form' {
|
|
80
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
81
|
-
import { UseFormProps, SubmitHandler, UseFormReturn } from 'react-hook-form';
|
|
82
|
-
interface FormProps extends UseFormProps, Omit<HTMLAttributes<HTMLFormElement>, 'children'> {
|
|
83
|
-
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
84
|
-
autoComplete?: string;
|
|
85
|
-
onSubmit?: SubmitHandler<any>;
|
|
86
|
-
error?: ReactNode;
|
|
87
|
-
preventSubmit?: boolean;
|
|
88
|
-
children?: ReactNode | ((e: UseFormReturn) => ReactNode);
|
|
89
|
-
}
|
|
90
|
-
function Form({ gap, autoComplete, onSubmit, error, preventSubmit, mode, disabled, reValidateMode, defaultValues, values, errors, resetOptions, resolver, context, shouldFocusError, shouldUnregister, shouldUseNativeValidation, progressive, criteriaMode, delayError, className, children, ...props }: FormProps): import("react").JSX.Element;
|
|
91
|
-
export { Form };
|
|
92
|
-
export type { FormProps };
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare module '@umami/react-zen/form/FormField' {
|
|
96
|
-
import { HTMLAttributes } from 'react';
|
|
97
|
-
import { RegisterOptions, UseFormReturn, FieldValues } from 'react-hook-form';
|
|
98
|
-
interface FormFieldProps extends HTMLAttributes<HTMLDivElement>, Partial<UseFormReturn> {
|
|
99
|
-
name: string;
|
|
100
|
-
description?: string;
|
|
101
|
-
label?: string;
|
|
102
|
-
rules?: RegisterOptions<FieldValues, string>;
|
|
103
|
-
children: any;
|
|
104
|
-
}
|
|
105
|
-
const FormField: import("react").ForwardRefExoticComponent<FormFieldProps & import("react").RefAttributes<any>>;
|
|
106
|
-
export { FormField };
|
|
107
|
-
export type { FormFieldProps };
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
declare module '@umami/react-zen/form/FormResetButton' {
|
|
111
|
-
import { FieldValues } from 'react-hook-form';
|
|
112
|
-
import { ButtonProps } from '@umami/react-zen/Button';
|
|
113
|
-
interface FormResetButtonProps extends ButtonProps {
|
|
114
|
-
values?: FieldValues | {
|
|
115
|
-
[p: string]: any;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function FormResetButton({ values, children, onPress, ...props }: FormResetButtonProps): import("react").JSX.Element;
|
|
119
|
-
export { FormResetButton };
|
|
120
|
-
export type { FormResetButtonProps };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
declare module '@umami/react-zen/form/FormSubmitButton' {
|
|
124
|
-
import { LoadingButtonProps } from '@umami/react-zen/LoadingButton';
|
|
125
|
-
function FormSubmitButton({ children, disabled, isLoading, ...props }: LoadingButtonProps): import("react").JSX.Element;
|
|
126
|
-
export { FormSubmitButton };
|
|
78
|
+
export { Form, FormField, FormResetButton, FormSubmitButton, useDebounce, useTheme, useToast, Accordion, AccordionContent, AccordionItem, AccordionHeader, AlertBanner, AlertDialog, Box, Breadcrumb, Breadcrumbs, Button, Calendar, Checkbox, Column, Combobox, ConfirmationDialog, DataTable, DataColumn, Dialog, DialogTrigger, Dots, FileTrigger, Flexbox, Heading, HoverTrigger, Icon, Icons, InlineEditField, Label, List, ListItem, Loading, LoadingButton, Menu, MenuItem, MenuTrigger, Modal, NavigationMenu, NavigationMenuItem, PasswordField, Page, Popover, ProgressBar, ProgressCircle, Radio, RadioGroup, Row, SearchField, Select, Slider, Slot, Spinner, StatusLight, SubmenuTrigger, Switch, Table, TableHeader, TableBody, TableRow, TableColumn, TableCell, Tab, Tabs, TabList, TabPanel, Text, TextOverflow, TextField, TextArea, Toast, ToastProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipTrigger, ZenProvider, };
|
|
127
79
|
}
|
|
128
80
|
|
|
129
81
|
declare module '@umami/react-zen/hooks/useDebounce' {
|
|
@@ -247,7 +199,7 @@ declare module '@umami/react-zen/Button' {
|
|
|
247
199
|
asChild?: boolean;
|
|
248
200
|
slot?: string;
|
|
249
201
|
}
|
|
250
|
-
|
|
202
|
+
const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<any>>;
|
|
251
203
|
export { Button };
|
|
252
204
|
export type { ButtonProps };
|
|
253
205
|
}
|
|
@@ -376,10 +328,13 @@ declare module '@umami/react-zen/Heading' {
|
|
|
376
328
|
declare module '@umami/react-zen/HoverTrigger' {
|
|
377
329
|
import { ReactElement } from 'react';
|
|
378
330
|
export interface HoverButtonProps {
|
|
331
|
+
isOpen?: boolean;
|
|
332
|
+
onHoverStart?: () => void;
|
|
333
|
+
onHoverEnd?: () => void;
|
|
379
334
|
closeDelay?: number;
|
|
380
335
|
children: ReactElement[];
|
|
381
336
|
}
|
|
382
|
-
export function HoverTrigger({ closeDelay, children }: HoverButtonProps): import("react").JSX.Element;
|
|
337
|
+
export function HoverTrigger({ isOpen, onHoverStart, onHoverEnd, closeDelay, children, }: HoverButtonProps): import("react").JSX.Element;
|
|
383
338
|
}
|
|
384
339
|
|
|
385
340
|
declare module '@umami/react-zen/Icon' {
|
|
@@ -522,16 +477,16 @@ declare module '@umami/react-zen/Modal' {
|
|
|
522
477
|
}
|
|
523
478
|
|
|
524
479
|
declare module '@umami/react-zen/NavigationMenu' {
|
|
525
|
-
import
|
|
526
|
-
|
|
527
|
-
export interface NavigationMenuProps extends RadixNavigationMenuProps {
|
|
480
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
481
|
+
export interface NavigationMenuProps extends HTMLAttributes<HTMLElement> {
|
|
528
482
|
showArrow?: boolean;
|
|
529
483
|
}
|
|
530
|
-
export function NavigationMenu({ showArrow, children, ...props }: NavigationMenuProps):
|
|
531
|
-
export
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
484
|
+
export function NavigationMenu({ showArrow, className, children, ...props }: NavigationMenuProps): import("react").JSX.Element;
|
|
485
|
+
export interface NavigationMenuItemProps extends HTMLAttributes<HTMLElement> {
|
|
486
|
+
label: string;
|
|
487
|
+
children?: ReactNode;
|
|
488
|
+
}
|
|
489
|
+
export function NavigationMenuItem({ label, children, className, ...props }: NavigationMenuItemProps): import("react").JSX.Element;
|
|
535
490
|
}
|
|
536
491
|
|
|
537
492
|
declare module '@umami/react-zen/PasswordField' {
|
|
@@ -729,8 +684,8 @@ declare module '@umami/react-zen/TextField' {
|
|
|
729
684
|
interface TextFieldProps extends AriaTextFieldProps {
|
|
730
685
|
label?: string;
|
|
731
686
|
placeholder?: string;
|
|
732
|
-
asTextArea?: boolean;
|
|
733
687
|
allowCopy?: boolean;
|
|
688
|
+
asChild?: boolean;
|
|
734
689
|
onChange?: (e: any) => void;
|
|
735
690
|
}
|
|
736
691
|
const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -742,6 +697,7 @@ declare module '@umami/react-zen/TextArea' {
|
|
|
742
697
|
import { TextFieldProps } from '@umami/react-zen/TextField';
|
|
743
698
|
interface TextAreaProps extends TextFieldProps {
|
|
744
699
|
resize?: 'none' | 'vertical' | 'horizontal';
|
|
700
|
+
children?: React.ReactNode;
|
|
745
701
|
}
|
|
746
702
|
const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<any>>;
|
|
747
703
|
export { TextArea };
|