@digdir/designsystemet-react 1.0.0-next.48 → 1.0.0-next.49
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/cjs/components/Badge/Badge.js +2 -2
- package/dist/cjs/components/Button/Button.js +1 -1
- package/dist/cjs/components/Card/Card.js +2 -2
- package/dist/cjs/components/Combobox/Combobox.js +0 -2
- package/dist/cjs/components/Details/Details.js +2 -2
- package/dist/cjs/components/Dialog/Dialog.js +74 -0
- package/dist/cjs/components/Dialog/DialogBlock.js +30 -0
- package/dist/cjs/components/Dialog/DialogTrigger.js +27 -0
- package/dist/cjs/components/Dialog/DialogTriggerContext.js +28 -0
- package/dist/cjs/components/Dialog/index.js +34 -0
- package/dist/cjs/components/Popover/Popover.js +2 -2
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/{components/Pagination → utilities/hooks/usePagination}/usePagination.js +10 -1
- package/dist/esm/components/Badge/Badge.js +2 -2
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Card/Card.js +2 -2
- package/dist/esm/components/Chip/Chips.js +1 -1
- package/dist/esm/components/Chip/index.js +1 -1
- package/dist/esm/components/Combobox/Combobox.js +1 -3
- package/dist/esm/components/Combobox/ComboboxIdContext.js +1 -1
- package/dist/esm/components/Combobox/useFloatingCombobox.js +1 -1
- package/dist/esm/components/Details/Details.js +2 -2
- package/dist/esm/components/Dialog/Dialog.js +72 -0
- package/dist/esm/components/Dialog/DialogBlock.js +28 -0
- package/dist/esm/components/{Modal/ModalTrigger.js → Dialog/DialogTrigger.js} +9 -9
- package/dist/esm/components/Dialog/DialogTriggerContext.js +25 -0
- package/dist/esm/components/Dialog/index.js +29 -0
- package/dist/esm/components/ErrorSummary/ErrorSummary.js +1 -1
- package/dist/esm/components/Field/index.js +1 -1
- package/dist/esm/components/List/index.js +1 -1
- package/dist/esm/components/Popover/Popover.js +2 -2
- package/dist/esm/components/Suggestion/Suggestion.js +1 -1
- package/dist/esm/components/Tabs/Tabs.js +1 -1
- package/dist/esm/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/utilities/RovingFocus/RovingFocusRoot.js +1 -1
- package/dist/esm/{components/Pagination → utilities/hooks/usePagination}/usePagination.js +10 -1
- package/dist/types/colors.d.ts +12 -2
- package/dist/types/colors.d.ts.map +1 -1
- package/dist/types/components/Badge/Badge.d.ts +13 -1
- package/dist/types/components/Badge/Badge.d.ts.map +1 -1
- package/dist/types/components/Badge/index.d.ts +2 -1
- package/dist/types/components/Badge/index.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts +10 -6
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Card/Card.d.ts +9 -7
- package/dist/types/components/Card/Card.d.ts.map +1 -1
- package/dist/types/components/Card/index.d.ts +2 -2
- package/dist/types/components/Details/Details.d.ts +4 -4
- package/dist/types/components/Details/Details.d.ts.map +1 -1
- package/dist/types/components/{Modal/Modal.d.ts → Dialog/Dialog.d.ts} +17 -17
- package/dist/types/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/types/components/{Modal/ModalBlock.d.ts → Dialog/DialogBlock.d.ts} +12 -12
- package/dist/types/components/Dialog/DialogBlock.d.ts.map +1 -0
- package/dist/types/components/Dialog/DialogTrigger.d.ts +22 -0
- package/dist/types/components/Dialog/DialogTrigger.d.ts.map +1 -0
- package/dist/types/components/Dialog/DialogTriggerContext.d.ts +21 -0
- package/dist/types/components/Dialog/DialogTriggerContext.d.ts.map +1 -0
- package/dist/types/components/Dialog/index.d.ts +43 -0
- package/dist/types/components/Dialog/index.d.ts.map +1 -0
- package/dist/types/components/Dropdown/DropdownHeading.d.ts +1 -1
- package/dist/types/components/Dropdown/index.d.ts +1 -1
- package/dist/types/components/ErrorSummary/ErrorSummaryHeading.d.ts +1 -1
- package/dist/types/components/ErrorSummary/index.d.ts +1 -1
- package/dist/types/components/Fieldset/FieldsetDescription.d.ts +1 -1
- package/dist/types/components/Fieldset/index.d.ts +1 -1
- package/dist/types/components/Heading/Heading.d.ts +2 -2
- package/dist/types/components/Heading/Heading.d.ts.map +1 -1
- package/dist/types/components/Pagination/index.d.ts +0 -2
- package/dist/types/components/Pagination/index.d.ts.map +1 -1
- package/dist/types/components/Paragraph/Paragraph.d.ts +2 -2
- package/dist/types/components/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/types/components/Popover/Popover.d.ts +13 -1
- package/dist/types/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/components/Popover/index.d.ts +2 -1
- package/dist/types/components/Popover/index.d.ts.map +1 -1
- package/dist/types/components/Search/SearchButton.d.ts +2 -2
- package/dist/types/components/Search/index.d.ts +2 -2
- package/dist/types/components/Spinner/Spinner.d.ts +1 -1
- package/dist/types/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utilities/hooks/index.d.ts +2 -0
- package/dist/types/utilities/hooks/index.d.ts.map +1 -1
- package/dist/types/utilities/hooks/useCheckboxGroup/useCheckboxGroup.d.ts +2 -1
- package/dist/types/utilities/hooks/useCheckboxGroup/useCheckboxGroup.d.ts.map +1 -1
- package/dist/types/{components/Pagination → utilities/hooks/usePagination}/usePagination.d.ts +19 -11
- package/dist/types/utilities/hooks/usePagination/usePagination.d.ts.map +1 -0
- package/dist/types/utilities/hooks/useRadioGroup/useRadioGroup.d.ts +1 -1
- package/dist/types/utilities/hooks/useRadioGroup/useRadioGroup.d.ts.map +1 -1
- package/package.json +5 -3
- package/dist/cjs/components/Modal/Modal.js +0 -74
- package/dist/cjs/components/Modal/ModalBlock.js +0 -30
- package/dist/cjs/components/Modal/ModalTrigger.js +0 -27
- package/dist/cjs/components/Modal/ModalTriggerContext.js +0 -28
- package/dist/cjs/components/Modal/index.js +0 -34
- package/dist/esm/components/Modal/Modal.js +0 -72
- package/dist/esm/components/Modal/ModalBlock.js +0 -28
- package/dist/esm/components/Modal/ModalTriggerContext.js +0 -25
- package/dist/esm/components/Modal/index.js +0 -29
- package/dist/types/components/Modal/Modal.d.ts.map +0 -1
- package/dist/types/components/Modal/ModalBlock.d.ts.map +0 -1
- package/dist/types/components/Modal/ModalTrigger.d.ts +0 -22
- package/dist/types/components/Modal/ModalTrigger.d.ts.map +0 -1
- package/dist/types/components/Modal/ModalTriggerContext.d.ts +0 -21
- package/dist/types/components/Modal/ModalTriggerContext.d.ts.map +0 -1
- package/dist/types/components/Modal/index.d.ts +0 -43
- package/dist/types/components/Modal/index.d.ts.map +0 -1
- package/dist/types/components/Pagination/usePagination.d.ts.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, createContext } from 'react';
|
|
4
|
+
|
|
5
|
+
const Context = createContext({
|
|
6
|
+
current: null,
|
|
7
|
+
});
|
|
8
|
+
/**
|
|
9
|
+
* DialogTriggerContext component, used to provide a context for a dialog trigger.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Dialog.TriggerContext>
|
|
13
|
+
* <Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
14
|
+
* <Dialog>
|
|
15
|
+
* Content
|
|
16
|
+
* </Dialog>
|
|
17
|
+
* </Dialog.TriggerContext>
|
|
18
|
+
*/
|
|
19
|
+
const DialogTriggerContext = ({ children, }) => {
|
|
20
|
+
const contextRef = useRef(null);
|
|
21
|
+
return jsx(Context.Provider, { value: contextRef, children: children });
|
|
22
|
+
};
|
|
23
|
+
DialogTriggerContext.displayName = 'DialogTriggerContext';
|
|
24
|
+
|
|
25
|
+
export { Context, DialogTriggerContext };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Dialog as Dialog$1 } from './Dialog.js';
|
|
3
|
+
import { DialogBlock } from './DialogBlock.js';
|
|
4
|
+
import { DialogTrigger } from './DialogTrigger.js';
|
|
5
|
+
import { DialogTriggerContext } from './DialogTriggerContext.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Dialog component, used to display a Dialog dialog.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <Dialog.TriggerContext>
|
|
12
|
+
* <Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
13
|
+
* <Dialog>
|
|
14
|
+
* <Dialog.Block>
|
|
15
|
+
* Content
|
|
16
|
+
* </Dialog.Block>
|
|
17
|
+
* </Dialog>
|
|
18
|
+
* </Dialog.TriggerContext>
|
|
19
|
+
*/
|
|
20
|
+
const Dialog = Object.assign(Dialog$1, {
|
|
21
|
+
Block: DialogBlock,
|
|
22
|
+
TriggerContext: DialogTriggerContext,
|
|
23
|
+
Trigger: DialogTrigger,
|
|
24
|
+
});
|
|
25
|
+
Dialog.Block.displayName = 'Dialog.Block';
|
|
26
|
+
Dialog.TriggerContext.displayName = 'Dialog.TriggerContext';
|
|
27
|
+
Dialog.Trigger.displayName = 'Dialog.Trigger';
|
|
28
|
+
|
|
29
|
+
export { Dialog, DialogBlock, DialogTrigger, DialogTriggerContext };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
4
|
import cl from 'clsx/lite';
|
|
5
|
-
import {
|
|
5
|
+
import { forwardRef, createContext, useId, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
const ErrorSummaryContext = createContext({
|
|
8
8
|
headingId: 'heading',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Field as Field$1 } from './Field.js';
|
|
3
|
-
import {
|
|
3
|
+
import { FieldAffix, FieldAffixes } from './FieldAffix.js';
|
|
4
4
|
import { FieldCounter } from './FieldCounter.js';
|
|
5
5
|
import { FieldDescription } from './FieldDescription.js';
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ import { Context } from './PopoverTriggerContext.js';
|
|
|
24
24
|
* Content
|
|
25
25
|
* </Popover>
|
|
26
26
|
*/
|
|
27
|
-
const Popover = forwardRef(function Popover({ id, className, onClose, onOpen, open, placement = 'top', autoPlacement = true, asChild = false, ...rest }, ref) {
|
|
27
|
+
const Popover = forwardRef(function Popover({ id, className, onClose, onOpen, open, 'data-variant': variant = 'default', placement = 'top', autoPlacement = true, asChild = false, ...rest }, ref) {
|
|
28
28
|
const Component = asChild ? Slot : 'div';
|
|
29
29
|
const popoverRef = useRef(null);
|
|
30
30
|
const mergedRefs = useMergeRefs([popoverRef, ref]);
|
|
@@ -95,7 +95,7 @@ const Popover = forwardRef(function Popover({ id, className, onClose, onOpen, op
|
|
|
95
95
|
}, [id]);
|
|
96
96
|
return (jsx(Component, { className: cl('ds-popover', className), id: id || popoverId,
|
|
97
97
|
// @ts-ignore @types/react-dom does not understand popover yet
|
|
98
|
-
popover: 'manual', ref: mergedRefs, ...rest }));
|
|
98
|
+
popover: 'manual', "data-variant": variant, ref: mergedRefs, ...rest }));
|
|
99
99
|
});
|
|
100
100
|
const arrowPseudoElement = {
|
|
101
101
|
name: 'ArrowPseudoElement',
|
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
4
|
import { getDatalistValue, syncDatalistState } from '@u-elements/u-datalist';
|
|
5
5
|
import cl from 'clsx/lite';
|
|
6
|
-
import {
|
|
6
|
+
import { forwardRef, createContext, useState, useId, useRef, useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
const SuggestionContext = createContext({});
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import cl from 'clsx/lite';
|
|
4
|
-
import {
|
|
4
|
+
import { forwardRef, useId, useState, createContext } from 'react';
|
|
5
5
|
import { RovingFocusRoot } from '../../utilities/RovingFocus/RovingFocusRoot.js';
|
|
6
6
|
|
|
7
7
|
const ToggleGroupContext = createContext({});
|
package/dist/esm/index.js
CHANGED
|
@@ -27,7 +27,6 @@ export { Alert } from './components/Alert/Alert.js';
|
|
|
27
27
|
export { Tag } from './components/Tag/Tag.js';
|
|
28
28
|
export { Chip } from './components/Chip/index.js';
|
|
29
29
|
export { ChipButton, ChipCheckbox, ChipRadio, ChipRemovable } from './components/Chip/Chips.js';
|
|
30
|
-
export { usePagination } from './components/Pagination/usePagination.js';
|
|
31
30
|
export { Pagination } from './components/Pagination/index.js';
|
|
32
31
|
export { PaginationList } from './components/Pagination/PaginationList.js';
|
|
33
32
|
export { PaginationItem } from './components/Pagination/PaginationItem.js';
|
|
@@ -57,10 +56,10 @@ export { Popover } from './components/Popover/index.js';
|
|
|
57
56
|
export { PopoverTriggerContext } from './components/Popover/PopoverTriggerContext.js';
|
|
58
57
|
export { PopoverTrigger } from './components/Popover/PopoverTrigger.js';
|
|
59
58
|
export { Divider } from './components/Divider/Divider.js';
|
|
60
|
-
export {
|
|
61
|
-
export {
|
|
62
|
-
export {
|
|
63
|
-
export {
|
|
59
|
+
export { Dialog } from './components/Dialog/index.js';
|
|
60
|
+
export { DialogBlock } from './components/Dialog/DialogBlock.js';
|
|
61
|
+
export { DialogTriggerContext } from './components/Dialog/DialogTriggerContext.js';
|
|
62
|
+
export { DialogTrigger } from './components/Dialog/DialogTrigger.js';
|
|
64
63
|
export { Dropdown } from './components/Dropdown/index.js';
|
|
65
64
|
export { DropdownTriggerContext } from './components/Dropdown/DropdownTriggerContext.js';
|
|
66
65
|
export { DropdownList } from './components/Dropdown/DropdownList.js';
|
|
@@ -102,6 +101,7 @@ export { useIsomorphicLayoutEffect } from './utilities/hooks/useIsomorphicLayout
|
|
|
102
101
|
export { useMediaQuery } from './utilities/hooks/useMediaQuery/useMediaQuery.js';
|
|
103
102
|
export { useRadioGroup } from './utilities/hooks/useRadioGroup/useRadioGroup.js';
|
|
104
103
|
export { useSynchronizedAnimation } from './utilities/hooks/useSynchronizedAnimation/useSynchronizedAnimation.js';
|
|
104
|
+
export { usePagination } from './utilities/hooks/usePagination/usePagination.js';
|
|
105
105
|
export { RovingFocusRoot } from './utilities/RovingFocus/RovingFocusRoot.js';
|
|
106
106
|
export { useRovingFocus } from './utilities/RovingFocus/useRovingFocus.js';
|
|
107
107
|
export { RovingFocusItem, getNextFocusableValue, getPrevFocusableValue } from './utilities/RovingFocus/RovingFocusItem.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMergeRefs } from '@floating-ui/react';
|
|
4
4
|
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
-
import {
|
|
5
|
+
import { forwardRef, useState, useRef, useEffect, createContext } from 'react';
|
|
6
6
|
|
|
7
7
|
const RovingFocusContext = createContext({
|
|
8
8
|
elements: { current: new Map() },
|
|
@@ -41,7 +41,7 @@ const getSteps = (now, max, show) => {
|
|
|
41
41
|
* </Pagination.Item>
|
|
42
42
|
* </Pagination>
|
|
43
43
|
**/
|
|
44
|
-
const usePagination = ({ currentPage = 1, setCurrentPage, onChange, totalPages, showPages = 7, }) => useMemo(() => {
|
|
44
|
+
const usePagination = ({ currentPage = 1, setCurrentPage, onChange, totalPages = 1, showPages = 7, }) => useMemo(() => {
|
|
45
45
|
const hasNext = currentPage < totalPages;
|
|
46
46
|
const hasPrev = currentPage !== 1;
|
|
47
47
|
const handleClick = (page) => (event) => {
|
|
@@ -54,8 +54,17 @@ const usePagination = ({ currentPage = 1, setCurrentPage, onChange, totalPages,
|
|
|
54
54
|
return {
|
|
55
55
|
/** Number of steps */
|
|
56
56
|
pages: getSteps(currentPage, totalPages, showPages).map((page, index) => ({
|
|
57
|
+
/**
|
|
58
|
+
* Page number or "ellipsis" for the ellipsis item
|
|
59
|
+
*/
|
|
57
60
|
page: page || 'ellipsis',
|
|
61
|
+
/**
|
|
62
|
+
* Unique key for the item
|
|
63
|
+
*/
|
|
58
64
|
itemKey: page ? `page-${page}` : `ellipsis-${index}`, // React key utility
|
|
65
|
+
/**
|
|
66
|
+
* Properties to spread on Pagination.Button
|
|
67
|
+
*/
|
|
59
68
|
buttonProps: (page
|
|
60
69
|
? {
|
|
61
70
|
'aria-current': page === currentPage ? 'page' : undefined,
|
package/dist/types/colors.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
2
|
+
type EmptyObject = {
|
|
3
|
+
[emptyObjectSymbol]?: never;
|
|
4
|
+
};
|
|
1
5
|
/**
|
|
2
6
|
* Base interface for available colors in the design system.
|
|
3
7
|
* The CLI will generate augmentations of this interface to allow
|
|
@@ -5,7 +9,13 @@
|
|
|
5
9
|
*/
|
|
6
10
|
export interface MainAndSupportColors {
|
|
7
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* If {@link MainAndSupportColors} has been extended to include color names, return T,
|
|
14
|
+
* otherwise return the arbitrary string type.
|
|
15
|
+
*/
|
|
16
|
+
type ColorWithFallback<T> = MainAndSupportColors extends EmptyObject ? string & {} : T;
|
|
8
17
|
export type SeverityColors = 'info' | 'success' | 'warning' | 'danger';
|
|
9
|
-
export type CustomColors = 'neutral' | keyof MainAndSupportColors
|
|
10
|
-
export type Color = CustomColors | SeverityColors
|
|
18
|
+
export type CustomColors = ColorWithFallback<'neutral' | keyof MainAndSupportColors>;
|
|
19
|
+
export type Color = CustomColors | ColorWithFallback<SeverityColors>;
|
|
20
|
+
export {};
|
|
11
21
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAC/C,KAAK,WAAW,GAAG;IAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnD;;;;GAIG;AAGH,MAAM,WAAW,oBAAoB;CAAG;AAExC;;;GAGG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,oBAAoB,SAAS,WAAW,GAChE,MAAM,GAAG,EAAE,GACX,CAAC,CAAC;AAEN,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAC1C,SAAS,GAAG,MAAM,oBAAoB,CACvC,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,YAAY,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -10,6 +10,12 @@ export type BadgeProps = MergeRight<DefaultProps & HTMLAttributes<HTMLSpanElemen
|
|
|
10
10
|
* The maximum number to display in the badge, when the count exceeds this number, the badge will display `{max}+`
|
|
11
11
|
*/
|
|
12
12
|
maxCount?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Change the background color of the badge.
|
|
15
|
+
*
|
|
16
|
+
* @default 'base'
|
|
17
|
+
*/
|
|
18
|
+
'data-variant'?: 'base' | 'tinted';
|
|
13
19
|
children?: never;
|
|
14
20
|
}>;
|
|
15
21
|
/**
|
|
@@ -23,7 +29,7 @@ export type BadgeProps = MergeRight<DefaultProps & HTMLAttributes<HTMLSpanElemen
|
|
|
23
29
|
* <Icon />
|
|
24
30
|
* </Badge>
|
|
25
31
|
*/
|
|
26
|
-
export declare const Badge: React.ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLSpanElement>, "children" | "count" | "maxCount"> & {
|
|
32
|
+
export declare const Badge: React.ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLSpanElement>, "children" | "data-variant" | "count" | "maxCount"> & {
|
|
27
33
|
/**
|
|
28
34
|
* The number to display in the badge
|
|
29
35
|
*/
|
|
@@ -32,6 +38,12 @@ export declare const Badge: React.ForwardRefExoticComponent<Omit<DefaultProps &
|
|
|
32
38
|
* The maximum number to display in the badge, when the count exceeds this number, the badge will display `{max}+`
|
|
33
39
|
*/
|
|
34
40
|
maxCount?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Change the background color of the badge.
|
|
43
|
+
*
|
|
44
|
+
* @default 'base'
|
|
45
|
+
*/
|
|
46
|
+
'data-variant'?: "base" | "tinted";
|
|
35
47
|
children?: never;
|
|
36
48
|
} & React.RefAttributes<HTMLSpanElement>>;
|
|
37
49
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,cAAc,CAAC,eAAe,CAAC,EAC9C;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CACF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,cAAc,CAAC,eAAe,CAAC,EAC9C;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CACF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK;IA7Bd;;OAEG;YACK,MAAM;IACd;;OAEG;eACQ,MAAM;IACjB;;;;OAIG;qBACc,MAAM,GAAG,QAAQ;eACvB,KAAK;yCA8BlB,CAAC"}
|
|
@@ -5,9 +5,10 @@ import { BadgePosition } from './BadgePosition';
|
|
|
5
5
|
* @example without children
|
|
6
6
|
* <Badge count={5} maxCount={10} />
|
|
7
7
|
*/
|
|
8
|
-
declare const Badge: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.HTMLAttributes<HTMLSpanElement>, "children" | "count" | "maxCount"> & {
|
|
8
|
+
declare const Badge: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.HTMLAttributes<HTMLSpanElement>, "children" | "data-variant" | "count" | "maxCount"> & {
|
|
9
9
|
count?: number;
|
|
10
10
|
maxCount?: number;
|
|
11
|
+
'data-variant'?: "base" | "tinted";
|
|
11
12
|
children?: never;
|
|
12
13
|
} & React.RefAttributes<HTMLSpanElement>> & {
|
|
13
14
|
Position: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;GAKG;AACH,QAAA,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;GAKG;AACH,QAAA,MAAM,KAAK;;;;;;;;;;CAAuD,CAAC;AAInE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes } from 'react';
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { DefaultProps } from '../../types';
|
|
3
3
|
import type { MergeRight } from '../../utilities';
|
|
4
4
|
export type ButtonProps = MergeRight<DefaultProps & ButtonHTMLAttributes<HTMLButtonElement>, {
|
|
@@ -13,10 +13,12 @@ export type ButtonProps = MergeRight<DefaultProps & ButtonHTMLAttributes<HTMLBut
|
|
|
13
13
|
*/
|
|
14
14
|
icon?: boolean;
|
|
15
15
|
/**
|
|
16
|
-
* Toggle loading state
|
|
16
|
+
* Toggle loading state.
|
|
17
|
+
* Pass an element if you want to display a custom loader.
|
|
18
|
+
*
|
|
17
19
|
* @default false
|
|
18
20
|
*/
|
|
19
|
-
loading?: boolean;
|
|
21
|
+
loading?: boolean | ReactNode;
|
|
20
22
|
/**
|
|
21
23
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
22
24
|
* @default false
|
|
@@ -34,7 +36,7 @@ export type ButtonProps = MergeRight<DefaultProps & ButtonHTMLAttributes<HTMLBut
|
|
|
34
36
|
* @example
|
|
35
37
|
* <Button>Click me</Button>
|
|
36
38
|
*/
|
|
37
|
-
export declare const Button: React.ForwardRefExoticComponent<Omit<DefaultProps & ButtonHTMLAttributes<HTMLButtonElement>, "type" | "
|
|
39
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<DefaultProps & ButtonHTMLAttributes<HTMLButtonElement>, "type" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
38
40
|
/**
|
|
39
41
|
* Specify which variant to use
|
|
40
42
|
* @default 'primary'
|
|
@@ -46,10 +48,12 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<DefaultProps &
|
|
|
46
48
|
*/
|
|
47
49
|
icon?: boolean;
|
|
48
50
|
/**
|
|
49
|
-
* Toggle loading state
|
|
51
|
+
* Toggle loading state.
|
|
52
|
+
* Pass an element if you want to display a custom loader.
|
|
53
|
+
*
|
|
50
54
|
* @default false
|
|
51
55
|
*/
|
|
52
|
-
loading?: boolean;
|
|
56
|
+
loading?: boolean | ReactNode;
|
|
53
57
|
/**
|
|
54
58
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
55
59
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACtD;IACE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;CACxD,CACF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM;IApCf;;;OAGG;cACO,SAAS,GAAG,WAAW,GAAG,UAAU;IAC9C;;;OAGG;WACI,OAAO;IACd;;;;;OAKG;cACO,OAAO,GAAG,SAAS;IAC7B;;;OAGG;cACO,OAAO;IACjB;;;OAGG;WACI,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;2CA+CzD,CAAC"}
|
|
@@ -3,10 +3,11 @@ import type { DefaultProps } from '../../types';
|
|
|
3
3
|
import type { MergeRight } from '../../utilities';
|
|
4
4
|
export type CardProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Change the background color of the card.
|
|
7
|
+
*
|
|
8
|
+
* @default 'default'
|
|
8
9
|
*/
|
|
9
|
-
'data-
|
|
10
|
+
'data-variant'?: 'default' | 'tinted';
|
|
10
11
|
/**
|
|
11
12
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
12
13
|
* @default false
|
|
@@ -25,12 +26,13 @@ export type CardProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>
|
|
|
25
26
|
* <Card.Block>Footer</Card.Block>
|
|
26
27
|
* </Card>
|
|
27
28
|
*/
|
|
28
|
-
export declare const Card: React.ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "
|
|
29
|
+
export declare const Card: React.ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "children" | "asChild" | "data-variant"> & {
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* Change the background color of the card.
|
|
32
|
+
*
|
|
33
|
+
* @default 'default'
|
|
32
34
|
*/
|
|
33
|
-
'data-
|
|
35
|
+
'data-variant'?: "default" | "tinted";
|
|
34
36
|
/**
|
|
35
37
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
36
38
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,UAAU,CAChC,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,EAC7C;IACE
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,UAAU,CAChC,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,EAC7C;IACE;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,SAAS,CAAC;CACrB,CACF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI;IA1Bb;;;;OAIG;qBACc,SAAS,GAAG,QAAQ;IACrC;;;OAGG;cACO,OAAO;IACjB,gEAAgE;cACtD,SAAS;wCAgDrB,CAAC"}
|
|
@@ -9,8 +9,8 @@ import { CardBlock } from './CardBlock';
|
|
|
9
9
|
* <Card.Block>Footer</Card.Block>
|
|
10
10
|
* </Card>
|
|
11
11
|
*/
|
|
12
|
-
declare const Card: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.HTMLAttributes<HTMLDivElement>, "
|
|
13
|
-
'data-
|
|
12
|
+
declare const Card: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.HTMLAttributes<HTMLDivElement>, "children" | "asChild" | "data-variant"> & {
|
|
13
|
+
'data-variant'?: "default" | "tinted";
|
|
14
14
|
asChild?: boolean;
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import '@u-elements/u-details';
|
|
3
|
-
import type { Color } from '../../colors';
|
|
4
3
|
import type { DefaultProps } from '../../types';
|
|
5
4
|
import type { MergeRight } from '../../utilities';
|
|
6
5
|
export type DetailsProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDetailsElement>, {
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Change the background color of the details.
|
|
8
|
+
*
|
|
9
|
+
* @default 'default'
|
|
10
10
|
*/
|
|
11
|
-
'data-
|
|
11
|
+
'data-variant'?: 'default' | 'tinted';
|
|
12
12
|
/**
|
|
13
13
|
* Controls open-state.
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,UAAU,CACnC,YAAY,GAAG,cAAc,CAAC,kBAAkB,CAAC,EACjD;IACE;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACtC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CACF,GACC,CACI;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CAAE,GACnD;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CAAE,CACtD,CAAC;AAEJ;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,yFA2CnB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DialogHTMLAttributes } from 'react';
|
|
2
2
|
import type { DefaultProps } from '../../types';
|
|
3
3
|
import type { MergeRight } from '../../utilities';
|
|
4
|
-
export type
|
|
4
|
+
export type DialogProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, {
|
|
5
5
|
/**
|
|
6
6
|
* Screen reader label of close button. Set false to hide the close button.
|
|
7
7
|
* @default 'Lukk dialogvindu'
|
|
@@ -13,7 +13,7 @@ export type ModalProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDial
|
|
|
13
13
|
*/
|
|
14
14
|
backdropClose?: boolean;
|
|
15
15
|
/**
|
|
16
|
-
* Callback that is called when the
|
|
16
|
+
* Callback that is called when the dialog is closed.
|
|
17
17
|
*/
|
|
18
18
|
onClose?: (event: Event) => void;
|
|
19
19
|
/**
|
|
@@ -23,29 +23,29 @@ export type ModalProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDial
|
|
|
23
23
|
asChild?: boolean;
|
|
24
24
|
}>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Dialog component, used to display a dialog dialog.
|
|
27
27
|
*
|
|
28
28
|
* @example with TriggerContext
|
|
29
|
-
* <
|
|
30
|
-
* <
|
|
31
|
-
* <
|
|
32
|
-
* <
|
|
29
|
+
* <Dialog.TriggerContext>
|
|
30
|
+
* <Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
31
|
+
* <Dialog>
|
|
32
|
+
* <Dialog.Block>
|
|
33
33
|
* Content
|
|
34
|
-
* </
|
|
35
|
-
* </
|
|
36
|
-
* </
|
|
34
|
+
* </Dialog.Block>
|
|
35
|
+
* </Dialog>
|
|
36
|
+
* </Dialog.TriggerContext>
|
|
37
37
|
*
|
|
38
38
|
* @example without TriggerContext
|
|
39
|
-
* const
|
|
39
|
+
* const dialogRef = useRef<HTMLDialogElement>(null);
|
|
40
40
|
*
|
|
41
41
|
* ...
|
|
42
42
|
*
|
|
43
|
-
* <Button onClick={() =>
|
|
44
|
-
* <
|
|
43
|
+
* <Button onClick={() => dialogRef.current?.showDialog()}>Open Dialog</Button>
|
|
44
|
+
* <Dialog ref={dialogRef}>
|
|
45
45
|
* Content
|
|
46
|
-
* </
|
|
46
|
+
* </Dialog>
|
|
47
47
|
*/
|
|
48
|
-
export declare const
|
|
48
|
+
export declare const Dialog: React.ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "onClose" | "closeButton" | "backdropClose"> & {
|
|
49
49
|
/**
|
|
50
50
|
* Screen reader label of close button. Set false to hide the close button.
|
|
51
51
|
* @default 'Lukk dialogvindu'
|
|
@@ -57,7 +57,7 @@ export declare const Modal: React.ForwardRefExoticComponent<Omit<DefaultProps &
|
|
|
57
57
|
*/
|
|
58
58
|
backdropClose?: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* Callback that is called when the
|
|
60
|
+
* Callback that is called when the dialog is closed.
|
|
61
61
|
*/
|
|
62
62
|
onClose?: (event: Event) => void;
|
|
63
63
|
/**
|
|
@@ -66,4 +66,4 @@ export declare const Modal: React.ForwardRefExoticComponent<Omit<DefaultProps &
|
|
|
66
66
|
*/
|
|
67
67
|
asChild?: boolean;
|
|
68
68
|
} & React.RefAttributes<HTMLDialogElement>>;
|
|
69
|
-
//# sourceMappingURL=
|
|
69
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACtD;IACE;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;IA7Cf;;;OAGG;kBACW,MAAM,GAAG,KAAK;IAC5B;;;OAGG;oBACa,OAAO;IACvB;;OAEG;cACO,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAChC;;;OAGG;cACO,OAAO;2CA+GpB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type DialogBlockProps = {
|
|
3
3
|
/**
|
|
4
4
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
5
5
|
* @default false
|
|
@@ -7,26 +7,26 @@ export type ModalBlockProps = {
|
|
|
7
7
|
asChild?: boolean;
|
|
8
8
|
} & HTMLAttributes<HTMLDivElement>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* DialogBlock component, used to separate content in a Dialog.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
* <
|
|
14
|
-
* <
|
|
13
|
+
* <Dialog>
|
|
14
|
+
* <Dialog.Block>
|
|
15
15
|
* Header
|
|
16
|
-
* </
|
|
17
|
-
* <
|
|
16
|
+
* </Dialog.Block>
|
|
17
|
+
* <Dialog.Block>
|
|
18
18
|
* Content
|
|
19
|
-
* </
|
|
20
|
-
* <
|
|
19
|
+
* </Dialog.Block>
|
|
20
|
+
* <Dialog.Block>
|
|
21
21
|
* Footer
|
|
22
|
-
* </
|
|
23
|
-
* </
|
|
22
|
+
* </Dialog.Block>
|
|
23
|
+
* </Dialog>
|
|
24
24
|
*/
|
|
25
|
-
export declare const
|
|
25
|
+
export declare const DialogBlock: React.ForwardRefExoticComponent<{
|
|
26
26
|
/**
|
|
27
27
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
28
28
|
* @default false
|
|
29
29
|
*/
|
|
30
30
|
asChild?: boolean;
|
|
31
31
|
} & HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
//# sourceMappingURL=
|
|
32
|
+
//# sourceMappingURL=DialogBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogBlock.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/DialogBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW;IAvBtB;;;OAGG;cACO,OAAO;yEA+BlB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { Button } from '../Button/Button';
|
|
3
|
+
export type DialogTriggerProps = ComponentPropsWithRef<typeof Button>;
|
|
4
|
+
/**
|
|
5
|
+
* DialogTrigger component, used within a Dialog.TriggerContext to open a dialog.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Dialog.TriggerContext>
|
|
9
|
+
* <Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
10
|
+
* <Dialog>
|
|
11
|
+
* Content
|
|
12
|
+
* </Dialog>
|
|
13
|
+
* </Dialog.TriggerContext>
|
|
14
|
+
*/
|
|
15
|
+
export declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("../../types").DefaultProps & React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
16
|
+
variant?: "primary" | "secondary" | "tertiary";
|
|
17
|
+
icon?: boolean;
|
|
18
|
+
loading?: boolean | React.ReactNode;
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
type?: React.ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
|
21
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
//# sourceMappingURL=DialogTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/DialogTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,MAAM,CAAC,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa;;;;;;4FAczB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
export declare const Context: React.Context<RefObject<HTMLDialogElement | null>>;
|
|
3
|
+
export type DialogTriggerContextProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* DialogTriggerContext component, used to provide a context for a dialog trigger.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Dialog.TriggerContext>
|
|
11
|
+
* <Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
12
|
+
* <Dialog>
|
|
13
|
+
* Content
|
|
14
|
+
* </Dialog>
|
|
15
|
+
* </Dialog.TriggerContext>
|
|
16
|
+
*/
|
|
17
|
+
export declare const DialogTriggerContext: {
|
|
18
|
+
({ children, }: DialogTriggerContextProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=DialogTriggerContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTriggerContext.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/DialogTriggerContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,eAAO,MAAM,OAAO,oDAElB,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB;oBAE9B,yBAAyB;;CAI3B,CAAC"}
|