@donotdev/components 0.0.23 → 0.0.25
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/CarouselContent-HEXWLSR2.css +1 -0
- package/dist/CarouselContent-WGDMI6BH.js +1 -0
- package/dist/CodeContent-EYAMBIQ2.css +1 -0
- package/dist/CodeContent-RW7AXCX3.js +2 -0
- package/dist/CrawlContent-5CUKBDIN.js +1 -0
- package/dist/MarqueeContent-25D2GMPK.css +1 -0
- package/dist/MarqueeContent-DOKPFDYK.js +1 -0
- package/dist/advanced/Carousel/CarouselContent.js +2 -2
- package/dist/advanced/Carousel/CarouselSkeleton.js +1 -1
- package/dist/advanced/Code/CodeContent.js +1 -1
- package/dist/advanced/Code/CodeSkeleton.js +1 -1
- package/dist/advanced/Crawl/Crawl.d.ts.map +1 -1
- package/dist/advanced/Crawl/Crawl.js +1 -1
- package/dist/advanced/JsonViewer/JsonViewer.js +1 -1
- package/dist/advanced/Marquee/Marquee.d.ts.map +1 -1
- package/dist/advanced/Marquee/Marquee.js +1 -1
- package/dist/advanced/Marquee/MarqueeContent.js +3 -3
- package/dist/advanced/Marquee/MarqueeSkeleton.js +2 -2
- package/dist/advanced/Reveal/Reveal.js +1 -1
- package/dist/advanced/Roadmap/RoadmapContent.d.ts.map +1 -1
- package/dist/advanced/Roadmap/RoadmapContent.js +3 -3
- package/dist/advanced/SplitReveal/SplitReveal.d.ts.map +1 -1
- package/dist/advanced/SplitReveal/SplitReveal.js +2 -2
- package/dist/advanced/StackedCards/StackedCardsContent.d.ts.map +1 -1
- package/dist/advanced/StackedCards/StackedCardsContent.js +2 -2
- package/dist/atomic/Alert/index.d.ts +1 -1
- package/dist/atomic/Badge/index.d.ts +1 -1
- package/dist/atomic/Button/index.d.ts +1 -1
- package/dist/atomic/Button/index.d.ts.map +1 -1
- package/dist/atomic/Button/index.js +1 -1
- package/dist/atomic/ButtonGroup/index.d.ts +93 -0
- package/dist/atomic/ButtonGroup/index.d.ts.map +1 -0
- package/dist/atomic/ButtonGroup/index.js +57 -0
- package/dist/atomic/Calendar/index.d.ts.map +1 -1
- package/dist/atomic/Calendar/index.js +5 -4
- package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts +7 -0
- package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts.map +1 -1
- package/dist/atomic/Collapsible/CollapsiblePrimitive.js +1 -1
- package/dist/atomic/ColorPicker/index.d.ts +100 -0
- package/dist/atomic/ColorPicker/index.d.ts.map +1 -0
- package/dist/atomic/ColorPicker/index.js +195 -0
- package/dist/atomic/Combobox/index.d.ts.map +1 -1
- package/dist/atomic/Combobox/index.js +28 -5
- package/dist/atomic/CommandDialog/index.d.ts.map +1 -1
- package/dist/atomic/CommandDialog/index.js +5 -5
- package/dist/atomic/Dialog/index.d.ts +1 -1
- package/dist/atomic/Dialog/index.d.ts.map +1 -1
- package/dist/atomic/Dialog/index.js +1 -1
- package/dist/atomic/HeroSection/index.d.ts +1 -1
- package/dist/atomic/HoverCard/index.d.ts.map +1 -1
- package/dist/atomic/HoverCard/index.js +1 -1
- package/dist/atomic/Icons/Partner/providerIcons.js +11 -11
- package/dist/atomic/Input/index.d.ts +1 -1
- package/dist/atomic/Input/index.d.ts.map +1 -1
- package/dist/atomic/Input/index.js +1 -1
- package/dist/atomic/Pagination/index.d.ts.map +1 -1
- package/dist/atomic/Pagination/index.js +2 -2
- package/dist/atomic/RadioGroup/index.d.ts +10 -5
- package/dist/atomic/RadioGroup/index.d.ts.map +1 -1
- package/dist/atomic/RadioGroup/index.js +9 -4
- package/dist/atomic/RangeInput/index.js +1 -1
- package/dist/atomic/Rating/index.d.ts +10 -1
- package/dist/atomic/Rating/index.d.ts.map +1 -1
- package/dist/atomic/Rating/index.js +2 -2
- package/dist/atomic/SkipLink/index.d.ts +38 -0
- package/dist/atomic/SkipLink/index.d.ts.map +1 -0
- package/dist/atomic/SkipLink/index.js +56 -0
- package/dist/atomic/Stepper/index.d.ts +1 -1
- package/dist/atomic/Tabs/index.d.ts +1 -1
- package/dist/atomic/Tag/index.d.ts +1 -1
- package/dist/atomic/Toaster/ToastPrimitive.d.ts +1 -1
- package/dist/atomic/Toaster/index.d.ts.map +1 -1
- package/dist/atomic/Toaster/index.js +1 -1
- package/dist/atomic/Toggle/index.d.ts +1 -1
- package/dist/atomic/TreeView/index.d.ts +116 -0
- package/dist/atomic/TreeView/index.d.ts.map +1 -0
- package/dist/atomic/TreeView/index.js +316 -0
- package/dist/atomic/VideoPlayer/index.d.ts.map +1 -1
- package/dist/atomic/index.d.ts +8 -0
- package/dist/atomic/index.d.ts.map +1 -1
- package/dist/atomic/index.js +4 -0
- package/dist/chunk-E54ZWOWD.js +1 -0
- package/dist/chunk-FA4BDD6N.js +1 -0
- package/dist/chunk-IFHHPSKN.js +1 -0
- package/dist/chunk-O2XFH626.js +1 -0
- package/dist/chunk-Q3J75GL4.js +1 -0
- package/dist/chunk-U37VKGRT.js +3 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useClickOutside.d.ts +0 -1
- package/dist/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/hooks/useClickOutside.js +0 -1
- package/dist/hooks/useSwipeToClose.d.ts.map +1 -1
- package/dist/hooks/useSwipeToClose.js +2 -1
- package/dist/hooks/useToast.d.ts +2 -3
- package/dist/hooks/useToast.d.ts.map +1 -1
- package/dist/hooks/useToast.js +1 -2
- package/dist/index.js +4 -7
- package/dist/styles/index.css +456 -51
- package/dist/utils/variants.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// packages/components/src/atomic/RadioGroup/index.tsx
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview RadioGroup Component - Props-based API
|
|
5
5
|
* @description Accessible radio group component built on Radix UI primitives with semantic color variants.
|
|
6
6
|
* Provides props-based API for 90% use cases with items prop.
|
|
7
7
|
*
|
|
8
|
-
* @version 0.0.
|
|
8
|
+
* @version 0.0.4
|
|
9
9
|
* @since 0.0.1
|
|
10
10
|
* @author AMBROISE PARK Consulting
|
|
11
11
|
*/
|
|
@@ -13,6 +13,7 @@ import { cva } from 'class-variance-authority';
|
|
|
13
13
|
import { RadioGroupPrimitive, RadioGroupRootPrimitive, RadioGroupItemPrimitive, RadioGroupIndicatorPrimitive, } from './RadioGroupPrimitive';
|
|
14
14
|
import { CONTROL_VARIANT } from '../../utils/constants';
|
|
15
15
|
import { cn, getVariantDataAttrs } from '../../utils/helpers';
|
|
16
|
+
import Grid from '../Grid';
|
|
16
17
|
import './RadioGroup.css';
|
|
17
18
|
const radioGroupVariants = cva('dndev-radio-group dndev-control-group', {
|
|
18
19
|
variants: {
|
|
@@ -34,6 +35,7 @@ const radioGroupVariants = cva('dndev-radio-group dndev-control-group', {
|
|
|
34
35
|
/**
|
|
35
36
|
* Accessible radio group component with semantic color variants.
|
|
36
37
|
* Supports props-based API with items prop for 90% use cases.
|
|
38
|
+
* When gridCols is provided, items are laid out using the Grid component.
|
|
37
39
|
*
|
|
38
40
|
* @component
|
|
39
41
|
* @example
|
|
@@ -41,9 +43,11 @@ const radioGroupVariants = cva('dndev-radio-group dndev-control-group', {
|
|
|
41
43
|
* <RadioGroup
|
|
42
44
|
* value={value}
|
|
43
45
|
* onValueChange={handleChange}
|
|
46
|
+
* gridCols={[1, 1, 3, 3]}
|
|
44
47
|
* items={[
|
|
45
48
|
* { value: 'option1', label: 'Option 1' },
|
|
46
|
-
* { value: 'option2', label: 'Option 2' }
|
|
49
|
+
* { value: 'option2', label: 'Option 2' },
|
|
50
|
+
* { value: 'option3', label: 'Option 3' }
|
|
47
51
|
* ]}
|
|
48
52
|
* />
|
|
49
53
|
* ```
|
|
@@ -52,7 +56,8 @@ const radioGroupVariants = cva('dndev-radio-group dndev-control-group', {
|
|
|
52
56
|
*/
|
|
53
57
|
const RadioGroup = ({ variant, className, items = [], gridCols, children, ...props }) => {
|
|
54
58
|
const variantAttrs = getVariantDataAttrs({ variant });
|
|
55
|
-
|
|
59
|
+
const radioItems = (_jsxs(_Fragment, { children: [children, items.map((option) => (_jsxs("label", { children: [_jsx(RadioGroupItemPrimitive, { value: option.value, className: "dndev-control dndev-size-md", ...variantAttrs, children: _jsx(RadioGroupIndicatorPrimitive, {}) }), _jsx("span", { children: option.label })] }, option.value)))] }));
|
|
60
|
+
return (_jsx(RadioGroupRootPrimitive, { className: cn(radioGroupVariants({ variant }), className), ...variantAttrs, ...props, children: gridCols ? (_jsx(Grid, { cols: gridCols, gap: "medium", children: radioItems })) : (radioItems) }));
|
|
56
61
|
};
|
|
57
62
|
export default RadioGroup;
|
|
58
63
|
export { CONTROL_VARIANT as RADIOGROUP_VARIANT };
|
|
@@ -56,7 +56,7 @@ export function RangeInput({ type = 'number', label, minPlaceholder = 'Min', max
|
|
|
56
56
|
const hasValue = !!(minValue || maxValue);
|
|
57
57
|
const inputs = (_jsxs(_Fragment, { children: [_jsx(Input, { type: type, placeholder: minPlaceholder, value: minValue, min: min, max: max, bare: true, onFocus: handleMinFocus, onChange: (e) => onChange(e.target.value, maxValue), ...props }), _jsx(Text, { level: "small", variant: "muted", className: "dndev-range-input-separator", children: "\u2013" }), _jsx(Input, { type: type, placeholder: maxPlaceholder, value: maxValue, min: min, max: max, bare: true, onFocus: handleMaxFocus, onChange: (e) => onChange(minValue, e.target.value), ...props }), _jsx(Button, { icon: X, variant: "ghost", display: "compact", onClick: onClear, disabled: !hasValue, "aria-label": "Clear", className: "dndev-range-input-clear" })] }));
|
|
58
58
|
if (label) {
|
|
59
|
-
return (_jsx(FloatingLabel, { label: label, className: "dndev-range-input", children: inputs }));
|
|
59
|
+
return (_jsx(FloatingLabel, { label: label, children: _jsx("div", { className: "dndev-range-input", children: inputs }) }));
|
|
60
60
|
}
|
|
61
61
|
return _jsx("div", { className: "dndev-range-input", children: inputs });
|
|
62
62
|
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Rating Component
|
|
3
|
+
* @description Interactive star rating component for forms and display.
|
|
4
|
+
* Input mode accepts whole numbers (1-5), display mode renders fractional values.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.0.1
|
|
7
|
+
* @since 0.0.1
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
1
10
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
11
|
import { CONTROL_VARIANT, type ControlVariant } from '../../utils/constants';
|
|
3
12
|
import './Rating.css';
|
|
4
13
|
import type { HTMLAttributes } from 'react';
|
|
5
14
|
declare const ratingVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
15
|
+
variant?: "warning" | "success" | "default" | "muted" | "primary" | "secondary" | "accent" | "destructive" | null | undefined;
|
|
7
16
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
17
|
export interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>, VariantProps<typeof ratingVariants> {
|
|
9
18
|
/** Current rating value (1-5, supports decimals for display) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Rating/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Rating/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAE3D,QAAA,MAAM,cAAc;;8EAgBlB,CAAC;AAEH,MAAM,WAAW,WACf,SACE,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAChD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,2BAA2B;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAiBD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,GAAI,gHAWb,WAAW,4CAoHb,CAAC;AAEF,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC;AAC7D,YAAY,EAAE,cAAc,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -9,9 +9,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* @since 0.0.1
|
|
10
10
|
* @author AMBROISE PARK Consulting
|
|
11
11
|
*/
|
|
12
|
-
import { useState, useCallback, useId } from 'react';
|
|
13
|
-
import { Star } from 'lucide-react';
|
|
14
12
|
import { cva } from 'class-variance-authority';
|
|
13
|
+
import { Star } from 'lucide-react';
|
|
14
|
+
import { useState, useCallback, useId } from 'react';
|
|
15
15
|
import { CONTROL_VARIANT } from '../../utils/constants';
|
|
16
16
|
import { cn, getVariantDataAttrs } from '../../utils/helpers';
|
|
17
17
|
import './Rating.css';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import './SkipLink.css';
|
|
3
|
+
export interface SkipLinkItem {
|
|
4
|
+
/** Target element ID (without #). The href will be `#${targetId}` */
|
|
5
|
+
targetId: string;
|
|
6
|
+
/** Visible label when focused (e.g., "Skip to main content") */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SkipLinkProps extends Omit<HTMLAttributes<HTMLElement>, 'role'> {
|
|
10
|
+
/**
|
|
11
|
+
* Array of skip link targets.
|
|
12
|
+
* Each renders as a focusable anchor that scrolls to and focuses the target.
|
|
13
|
+
*/
|
|
14
|
+
items: SkipLinkItem[];
|
|
15
|
+
/** Additional CSS classes */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Accessibility skip links — invisible until focused via keyboard.
|
|
20
|
+
* Place as the first element in the page body.
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <SkipLink
|
|
26
|
+
* items={[
|
|
27
|
+
* { targetId: 'main-content', label: 'Skip to main content' },
|
|
28
|
+
* { targetId: 'navigation', label: 'Skip to navigation' },
|
|
29
|
+
* ]}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @param {SkipLinkProps} props - The props for the skip links
|
|
34
|
+
* @returns {JSX.Element} The rendered skip link navigation
|
|
35
|
+
*/
|
|
36
|
+
declare function SkipLink({ items, className, ...props }: SkipLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export default SkipLink;
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/SkipLink/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAExD,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,cAAc,CAAC,WAAW,CAAC,EAC3B,MAAM,CACP;IACC;;;OAGG;IACH,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0BD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAmB9D;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/atomic/SkipLink/index.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview SkipLink component
|
|
5
|
+
* @description Accessibility skip-to-content links that become visible only on keyboard focus.
|
|
6
|
+
* Should be placed as the first focusable element in the DOM. Supports multiple targets.
|
|
7
|
+
* Gracefully degrades without JS via native anchor behavior.
|
|
8
|
+
*
|
|
9
|
+
* @version 0.0.1
|
|
10
|
+
* @since 0.0.1
|
|
11
|
+
* @author AMBROISE PARK Consulting
|
|
12
|
+
*/
|
|
13
|
+
import { cn } from '../../utils/helpers';
|
|
14
|
+
import './SkipLink.css';
|
|
15
|
+
/**
|
|
16
|
+
* Handle skip link click: scroll to target and focus it.
|
|
17
|
+
* Makes non-focusable targets temporarily focusable via tabindex="-1".
|
|
18
|
+
*/
|
|
19
|
+
function handleSkipClick(e, targetId) {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
const target = document.getElementById(targetId);
|
|
22
|
+
if (!target)
|
|
23
|
+
return;
|
|
24
|
+
// Make target focusable if it isn't already
|
|
25
|
+
const isFocusable = target.matches('a, button, input, select, textarea, [tabindex]');
|
|
26
|
+
if (!isFocusable) {
|
|
27
|
+
target.setAttribute('tabindex', '-1');
|
|
28
|
+
target.addEventListener('blur', () => target.removeAttribute('tabindex'), {
|
|
29
|
+
once: true,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
33
|
+
target.focus({ preventScroll: true });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Accessibility skip links — invisible until focused via keyboard.
|
|
37
|
+
* Place as the first element in the page body.
|
|
38
|
+
*
|
|
39
|
+
* @component
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <SkipLink
|
|
43
|
+
* items={[
|
|
44
|
+
* { targetId: 'main-content', label: 'Skip to main content' },
|
|
45
|
+
* { targetId: 'navigation', label: 'Skip to navigation' },
|
|
46
|
+
* ]}
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param {SkipLinkProps} props - The props for the skip links
|
|
51
|
+
* @returns {JSX.Element} The rendered skip link navigation
|
|
52
|
+
*/
|
|
53
|
+
function SkipLink({ items, className, ...props }) {
|
|
54
|
+
return (_jsx("nav", { "aria-label": "Skip links", className: cn('dndev-skip-links', className), ...props, children: items.map((item) => (_jsx("a", { href: `#${item.targetId}`, className: "dndev-skip-link", onClick: (e) => handleSkipClick(e, item.targetId), children: item.label }, item.targetId))) }));
|
|
55
|
+
}
|
|
56
|
+
export default SkipLink;
|
|
@@ -20,7 +20,7 @@ export interface StepperStep {
|
|
|
20
20
|
content: ReactNode;
|
|
21
21
|
}
|
|
22
22
|
declare const stepperVariants: (props?: ({
|
|
23
|
-
variant?: "
|
|
23
|
+
variant?: "warning" | "success" | "default" | "muted" | "primary" | "secondary" | "accent" | "destructive" | null | undefined;
|
|
24
24
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
25
25
|
export type StepperVariant = VariantProps<typeof stepperVariants>['variant'];
|
|
26
26
|
export interface StepperProps extends VariantProps<typeof stepperVariants> {
|
|
@@ -25,7 +25,7 @@ export interface TabItem {
|
|
|
25
25
|
forceMount?: boolean;
|
|
26
26
|
}
|
|
27
27
|
declare const tabsVariants: (props?: ({
|
|
28
|
-
variant?: "
|
|
28
|
+
variant?: "warning" | "success" | "default" | "muted" | "primary" | "secondary" | "accent" | "destructive" | null | undefined;
|
|
29
29
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
30
30
|
export type TabsVariant = VariantProps<typeof tabsVariants>['variant'];
|
|
31
31
|
export interface TabsProps extends Omit<ComponentProps<typeof TabsPrimitive>, 'children'>, VariantProps<typeof tabsVariants> {
|
|
@@ -15,7 +15,7 @@ export declare const TAG_VARIANT: {
|
|
|
15
15
|
readonly ACCENT: "accent";
|
|
16
16
|
};
|
|
17
17
|
declare const tagVariants: (props?: ({
|
|
18
|
-
variant?: "default" | "
|
|
18
|
+
variant?: "default" | "accent" | "outline" | null | undefined;
|
|
19
19
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
20
20
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
21
|
export interface TagProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'onClick'>, VariantProps<typeof tagVariants> {
|
|
@@ -13,7 +13,7 @@ import type { ComponentProps, ReactElement } from 'react';
|
|
|
13
13
|
declare const ToastProvider: import("react").FC<ToastPrimitives.ToastProviderProps>;
|
|
14
14
|
declare function ToastViewport({ className, ...props }: ComponentProps<typeof ToastPrimitives.Viewport>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
declare const toastVariants: (props?: ({
|
|
16
|
-
variant?: "
|
|
16
|
+
variant?: "error" | "warning" | "info" | "success" | "default" | null | undefined;
|
|
17
17
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
18
|
interface ToastProps extends ComponentProps<typeof ToastPrimitives.Root>, VariantProps<typeof toastVariants> {
|
|
19
19
|
toastType?: ToastType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Toaster/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EACL,aAAa,EAMb,WAAW,IAAI,oBAAoB,EACpC,MAAM,kBAAkB,CAAC;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Toaster/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EACL,aAAa,EAMb,WAAW,IAAI,oBAAoB,EACpC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAuB5C;;GAEG;AACH,QAAA,MAAM,WAAW,GAAI,OAAO,cAAc,CAAC,OAAO,oBAAoB,CAAC,4CAEtE,CAAC;AAEF,iBAAS,OAAO,4CAwCf;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* @author AMBROISE PARK Consulting
|
|
10
10
|
*/
|
|
11
11
|
import { ToastProvider, ToastViewport, ToastPrimitive as Toast, ToastTitle as ToastTitlePrimitive, ToastDescription as ToastDescriptionPrimitive, ToastClose as ToastClosePrimitive, ToastAction as ToastActionPrimitive, } from './ToastPrimitive';
|
|
12
|
-
import useToast
|
|
12
|
+
import { useToast } from '../../hooks/useToast';
|
|
13
13
|
import Stack from '../Stack';
|
|
14
14
|
/**
|
|
15
15
|
* Toast title component with pattern classes
|
|
@@ -10,7 +10,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
10
10
|
import { TogglePrimitive } from './TogglePrimitive';
|
|
11
11
|
import type { ComponentPropsWithoutRef } from 'react';
|
|
12
12
|
declare const toggleVariants: (props?: ({
|
|
13
|
-
variant?: "
|
|
13
|
+
variant?: "warning" | "success" | "default" | "muted" | "primary" | "secondary" | "accent" | "destructive" | "outline" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
15
|
export interface ToggleProps extends ComponentPropsWithoutRef<typeof TogglePrimitive>, VariantProps<typeof toggleVariants> {
|
|
16
16
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { LucideProps } from 'lucide-react';
|
|
2
|
+
import type { ComponentType, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import './TreeView.css';
|
|
4
|
+
/** Recursive tree node data structure */
|
|
5
|
+
export interface TreeNode {
|
|
6
|
+
/** Unique identifier */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Display label */
|
|
9
|
+
label: string | ReactNode;
|
|
10
|
+
/** Icon for this node — Lucide component, string name, or ReactNode */
|
|
11
|
+
icon?: ComponentType<LucideProps> | string | ReactNode;
|
|
12
|
+
/** Child nodes. undefined = leaf. Empty array = empty branch. */
|
|
13
|
+
children?: TreeNode[];
|
|
14
|
+
/** Whether this node is disabled */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Arbitrary metadata passed through to callbacks */
|
|
17
|
+
data?: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface TreeViewProps extends Omit<HTMLAttributes<HTMLUListElement>, 'role' | 'onSelect'> {
|
|
20
|
+
/** Tree data — array of root-level nodes */
|
|
21
|
+
nodes: TreeNode[];
|
|
22
|
+
/**
|
|
23
|
+
* Selection mode.
|
|
24
|
+
* - 'single': one node at a time
|
|
25
|
+
* - 'multi': multiple nodes via Enter/Space
|
|
26
|
+
* - 'none': no selection, Enter/Space toggles expansion on branches
|
|
27
|
+
* @default 'single'
|
|
28
|
+
*/
|
|
29
|
+
selectionMode?: 'single' | 'multi' | 'none';
|
|
30
|
+
/** Controlled selected node IDs */
|
|
31
|
+
selected?: Set<string> | string[];
|
|
32
|
+
/** Default selected node IDs (uncontrolled) */
|
|
33
|
+
defaultSelected?: string[];
|
|
34
|
+
/** Callback when selection changes */
|
|
35
|
+
onSelect?: (selected: Set<string>, node: TreeNode) => void;
|
|
36
|
+
/** Controlled expanded node IDs */
|
|
37
|
+
expanded?: Set<string> | string[];
|
|
38
|
+
/** Default expanded node IDs (uncontrolled) */
|
|
39
|
+
defaultExpanded?: string[];
|
|
40
|
+
/** Callback when expansion changes. Use for lazy loading children. */
|
|
41
|
+
onExpand?: (expanded: Set<string>, node: TreeNode) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Show connector lines between parent and children.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
showLines?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Default icon for branch nodes (nodes with children array).
|
|
49
|
+
* Individual node icons take precedence.
|
|
50
|
+
*/
|
|
51
|
+
branchIcon?: ComponentType<LucideProps> | string | ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Default icon for leaf nodes (nodes without children).
|
|
54
|
+
* Individual node icons take precedence.
|
|
55
|
+
*/
|
|
56
|
+
leafIcon?: ComponentType<LucideProps> | string | ReactNode;
|
|
57
|
+
/** Accessible label for the tree */
|
|
58
|
+
'aria-label': string;
|
|
59
|
+
/** Additional CSS classes */
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Accessible hierarchical tree component following the WAI-ARIA TreeView pattern.
|
|
64
|
+
*
|
|
65
|
+
* @component
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* const nodes: TreeNode[] = [
|
|
69
|
+
* {
|
|
70
|
+
* id: 'src',
|
|
71
|
+
* label: 'src',
|
|
72
|
+
* icon: Folder,
|
|
73
|
+
* children: [
|
|
74
|
+
* { id: 'app', label: 'App.tsx', icon: FileCode },
|
|
75
|
+
* { id: 'index', label: 'index.ts', icon: FileCode },
|
|
76
|
+
* {
|
|
77
|
+
* id: 'components',
|
|
78
|
+
* label: 'components',
|
|
79
|
+
* icon: Folder,
|
|
80
|
+
* children: [
|
|
81
|
+
* { id: 'header', label: 'Header.tsx', icon: FileCode },
|
|
82
|
+
* { id: 'footer', label: 'Footer.tsx', icon: FileCode },
|
|
83
|
+
* ],
|
|
84
|
+
* },
|
|
85
|
+
* ],
|
|
86
|
+
* },
|
|
87
|
+
* { id: 'readme', label: 'README.md', icon: FileText },
|
|
88
|
+
* ];
|
|
89
|
+
*
|
|
90
|
+
* <TreeView
|
|
91
|
+
* nodes={nodes}
|
|
92
|
+
* aria-label="Project files"
|
|
93
|
+
* defaultExpanded={['src']}
|
|
94
|
+
* showLines
|
|
95
|
+
* onSelect={(selected, node) => console.log('Selected:', node.id)}
|
|
96
|
+
* />
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* // Multi-select, no icons
|
|
102
|
+
* <TreeView
|
|
103
|
+
* nodes={categories}
|
|
104
|
+
* aria-label="Categories"
|
|
105
|
+
* selectionMode="multi"
|
|
106
|
+
* selected={selectedIds}
|
|
107
|
+
* onSelect={setSelectedIds}
|
|
108
|
+
* />
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @param {TreeViewProps} props - The props for the tree view
|
|
112
|
+
* @returns {JSX.Element} The rendered tree view
|
|
113
|
+
*/
|
|
114
|
+
declare const TreeView: import("react").ForwardRefExoticComponent<TreeViewProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
115
|
+
export default TreeView;
|
|
116
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/TreeView/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAEd,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,MAAM,WAAW,QAAQ;IACvB,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,uEAAuE;IACvE,IAAI,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IACvD,iEAAiE;IACjE,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,cAAc,CAAC,gBAAgB,CAAC,EAChC,MAAM,GAAG,UAAU,CACpB;IACC,4CAA4C;IAC5C,KAAK,EAAE,QAAQ,EAAE,CAAC;IAElB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAE5C,mCAAmC;IACnC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC;IAClC,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAE3D,mCAAmC;IACnC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC;IAClC,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAE3D;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IAE7D;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;IAE3D,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,QAAA,MAAM,QAAQ,4GA8QZ,CAAC;AAIH,eAAe,QAAQ,CAAC"}
|