@dev-dga/react 0.12.2 → 1.0.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/CHANGELOG.md +19 -0
- package/dist/{chunk-JAMYRBHS.js → chunk-AHUL5WRD.js} +4 -4
- package/dist/{chunk-5N6CFYT6.cjs → chunk-B3MX4XNP.cjs} +3 -3
- package/dist/{chunk-5N6CFYT6.cjs.map → chunk-B3MX4XNP.cjs.map} +1 -1
- package/dist/{chunk-KSEN4ESR.js → chunk-BJIB6S5L.js} +3 -3
- package/dist/chunk-BJIB6S5L.js.map +1 -0
- package/dist/{chunk-DWCTUNFU.cjs → chunk-H7DMDBAG.cjs} +7 -2
- package/dist/chunk-H7DMDBAG.cjs.map +1 -0
- package/dist/{chunk-ANHZT2X2.js → chunk-JADNUODB.js} +3 -3
- package/dist/{chunk-ANHZT2X2.js.map → chunk-JADNUODB.js.map} +1 -1
- package/dist/{chunk-4WXBRKGZ.cjs → chunk-K7GLIST7.cjs} +3 -3
- package/dist/{chunk-4WXBRKGZ.cjs.map → chunk-K7GLIST7.cjs.map} +1 -1
- package/dist/{chunk-6CDZ7ZBG.js → chunk-SQ7NQVEK.js} +7 -2
- package/dist/chunk-SQ7NQVEK.js.map +1 -0
- package/dist/{chunk-QLV4RQVQ.cjs → chunk-V7U2CXYL.cjs} +3 -3
- package/dist/chunk-V7U2CXYL.cjs.map +1 -0
- package/dist/components/Chip/Chip.cjs +2 -2
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/index.cjs +2 -2
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/Filtration/Filtration.cjs +4 -4
- package/dist/components/Filtration/Filtration.js +3 -3
- package/dist/components/Filtration/index.cjs +4 -4
- package/dist/components/Filtration/index.js +3 -3
- package/dist/components/Progress/Progress.cjs +2 -2
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Progress/index.cjs +2 -2
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/SlideoutMenu/SlideoutMenu.cjs +2 -2
- package/dist/components/SlideoutMenu/SlideoutMenu.js +1 -1
- package/dist/components/SlideoutMenu/index.cjs +2 -2
- package/dist/components/SlideoutMenu/index.js +1 -1
- package/dist/index.cjs +39 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +42 -42
- package/package.json +3 -3
- package/dist/chunk-6CDZ7ZBG.js.map +0 -1
- package/dist/chunk-DWCTUNFU.cjs.map +0 -1
- package/dist/chunk-KSEN4ESR.js.map +0 -1
- package/dist/chunk-QLV4RQVQ.cjs.map +0 -1
- /package/dist/{chunk-JAMYRBHS.js.map → chunk-AHUL5WRD.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -872,13 +872,13 @@ type CircularProgressOwnProps = VariantProps<typeof circularProgressVariants> &
|
|
|
872
872
|
state?: ProgressState;
|
|
873
873
|
thickness?: number;
|
|
874
874
|
segments?: number;
|
|
875
|
-
|
|
875
|
+
showValue?: boolean;
|
|
876
876
|
description?: React.ReactNode;
|
|
877
877
|
'aria-label'?: string;
|
|
878
878
|
'aria-labelledby'?: string;
|
|
879
879
|
};
|
|
880
880
|
type CircularProgressProps = CircularProgressOwnProps & Omit<React.ComponentProps<'div'>, keyof CircularProgressOwnProps>;
|
|
881
|
-
declare function CircularProgress({ value, max, size, variant, state, thickness, segments,
|
|
881
|
+
declare function CircularProgress({ value, max, size, variant, state, thickness, segments, showValue, description, className, ...props }: CircularProgressProps): react_jsx_runtime.JSX.Element;
|
|
882
882
|
|
|
883
883
|
declare const dropdownMenuVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
884
884
|
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenu$1.Root>;
|
|
@@ -2424,7 +2424,7 @@ interface SlideoutMenuHeaderProps extends React.ComponentProps<'div'> {
|
|
|
2424
2424
|
/** Optional featured icon, shown in a 32px brand-tinted disc before the title. */
|
|
2425
2425
|
icon?: React.ReactNode;
|
|
2426
2426
|
/** Render the close (X) button. Defaults to `true`. */
|
|
2427
|
-
|
|
2427
|
+
showCloseButton?: boolean;
|
|
2428
2428
|
/** Localized aria-label for the close button. Defaults to `"Close"`. */
|
|
2429
2429
|
closeLabel?: string;
|
|
2430
2430
|
}
|
|
@@ -2454,7 +2454,7 @@ interface SlideoutMenuItemProps extends React.ComponentProps<'button'> {
|
|
|
2454
2454
|
declare function SlideoutMenu(props: SlideoutMenuProps): react_jsx_runtime.JSX.Element;
|
|
2455
2455
|
declare function SlideoutMenuTrigger({ className, ...props }: SlideoutMenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
2456
2456
|
declare function SlideoutMenuContent({ side, background, className, children, ...props }: SlideoutMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
2457
|
-
declare function SlideoutMenuHeader({ icon,
|
|
2457
|
+
declare function SlideoutMenuHeader({ icon, showCloseButton, closeLabel, className, children, ...props }: SlideoutMenuHeaderProps): react_jsx_runtime.JSX.Element;
|
|
2458
2458
|
declare function SlideoutMenuTitle({ asChild, className, ...props }: SlideoutMenuTitleProps): react_jsx_runtime.JSX.Element;
|
|
2459
2459
|
declare function SlideoutMenuDescription({ asChild, className, ...props }: SlideoutMenuDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
2460
2460
|
declare function SlideoutMenuBody({ asChild, className, ...props }: SlideoutMenuSectionProps): react_jsx_runtime.JSX.Element;
|
|
@@ -2526,6 +2526,7 @@ declare const chipVariants: (props?: ({
|
|
|
2526
2526
|
variant?: "neutral" | "primary" | null | undefined;
|
|
2527
2527
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2528
2528
|
rounded?: boolean | null | undefined;
|
|
2529
|
+
onColor?: boolean | null | undefined;
|
|
2529
2530
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2530
2531
|
interface ChipProps extends Omit<React.ComponentProps<'button'>, 'onChange'>, VariantProps<typeof chipVariants> {
|
|
2531
2532
|
/** Controlled selected state — drives `aria-pressed` and the filled treatment. */
|
|
@@ -2545,7 +2546,7 @@ interface ChipProps extends Omit<React.ComponentProps<'button'>, 'onChange'>, Va
|
|
|
2545
2546
|
* Interactive selectable chip (SDGA "Chip") — a toggle button, distinct from the
|
|
2546
2547
|
* static `Tag` (SDGA "Tags"). Selecting fills the chip (`#1B8354` primary / gray-700 neutral).
|
|
2547
2548
|
*/
|
|
2548
|
-
declare function Chip({ variant, size, rounded, selected, defaultSelected, onSelectedChange, leadingIcon, trailingIcon, asChild, className, children, disabled, onClick, type, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
2549
|
+
declare function Chip({ variant, size, rounded, onColor, selected, defaultSelected, onSelectedChange, leadingIcon, trailingIcon, asChild, className, children, disabled, onClick, type, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
2549
2550
|
|
|
2550
2551
|
declare const saudiRiyalSymbolVariants: (props?: ({
|
|
2551
2552
|
size?: "sm" | "lg" | "xl" | "base" | "xs" | "2xl" | "3xl" | "2xs" | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -872,13 +872,13 @@ type CircularProgressOwnProps = VariantProps<typeof circularProgressVariants> &
|
|
|
872
872
|
state?: ProgressState;
|
|
873
873
|
thickness?: number;
|
|
874
874
|
segments?: number;
|
|
875
|
-
|
|
875
|
+
showValue?: boolean;
|
|
876
876
|
description?: React.ReactNode;
|
|
877
877
|
'aria-label'?: string;
|
|
878
878
|
'aria-labelledby'?: string;
|
|
879
879
|
};
|
|
880
880
|
type CircularProgressProps = CircularProgressOwnProps & Omit<React.ComponentProps<'div'>, keyof CircularProgressOwnProps>;
|
|
881
|
-
declare function CircularProgress({ value, max, size, variant, state, thickness, segments,
|
|
881
|
+
declare function CircularProgress({ value, max, size, variant, state, thickness, segments, showValue, description, className, ...props }: CircularProgressProps): react_jsx_runtime.JSX.Element;
|
|
882
882
|
|
|
883
883
|
declare const dropdownMenuVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
884
884
|
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenu$1.Root>;
|
|
@@ -2424,7 +2424,7 @@ interface SlideoutMenuHeaderProps extends React.ComponentProps<'div'> {
|
|
|
2424
2424
|
/** Optional featured icon, shown in a 32px brand-tinted disc before the title. */
|
|
2425
2425
|
icon?: React.ReactNode;
|
|
2426
2426
|
/** Render the close (X) button. Defaults to `true`. */
|
|
2427
|
-
|
|
2427
|
+
showCloseButton?: boolean;
|
|
2428
2428
|
/** Localized aria-label for the close button. Defaults to `"Close"`. */
|
|
2429
2429
|
closeLabel?: string;
|
|
2430
2430
|
}
|
|
@@ -2454,7 +2454,7 @@ interface SlideoutMenuItemProps extends React.ComponentProps<'button'> {
|
|
|
2454
2454
|
declare function SlideoutMenu(props: SlideoutMenuProps): react_jsx_runtime.JSX.Element;
|
|
2455
2455
|
declare function SlideoutMenuTrigger({ className, ...props }: SlideoutMenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
2456
2456
|
declare function SlideoutMenuContent({ side, background, className, children, ...props }: SlideoutMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
2457
|
-
declare function SlideoutMenuHeader({ icon,
|
|
2457
|
+
declare function SlideoutMenuHeader({ icon, showCloseButton, closeLabel, className, children, ...props }: SlideoutMenuHeaderProps): react_jsx_runtime.JSX.Element;
|
|
2458
2458
|
declare function SlideoutMenuTitle({ asChild, className, ...props }: SlideoutMenuTitleProps): react_jsx_runtime.JSX.Element;
|
|
2459
2459
|
declare function SlideoutMenuDescription({ asChild, className, ...props }: SlideoutMenuDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
2460
2460
|
declare function SlideoutMenuBody({ asChild, className, ...props }: SlideoutMenuSectionProps): react_jsx_runtime.JSX.Element;
|
|
@@ -2526,6 +2526,7 @@ declare const chipVariants: (props?: ({
|
|
|
2526
2526
|
variant?: "neutral" | "primary" | null | undefined;
|
|
2527
2527
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2528
2528
|
rounded?: boolean | null | undefined;
|
|
2529
|
+
onColor?: boolean | null | undefined;
|
|
2529
2530
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2530
2531
|
interface ChipProps extends Omit<React.ComponentProps<'button'>, 'onChange'>, VariantProps<typeof chipVariants> {
|
|
2531
2532
|
/** Controlled selected state — drives `aria-pressed` and the filled treatment. */
|
|
@@ -2545,7 +2546,7 @@ interface ChipProps extends Omit<React.ComponentProps<'button'>, 'onChange'>, Va
|
|
|
2545
2546
|
* Interactive selectable chip (SDGA "Chip") — a toggle button, distinct from the
|
|
2546
2547
|
* static `Tag` (SDGA "Tags"). Selecting fills the chip (`#1B8354` primary / gray-700 neutral).
|
|
2547
2548
|
*/
|
|
2548
|
-
declare function Chip({ variant, size, rounded, selected, defaultSelected, onSelectedChange, leadingIcon, trailingIcon, asChild, className, children, disabled, onClick, type, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
2549
|
+
declare function Chip({ variant, size, rounded, onColor, selected, defaultSelected, onSelectedChange, leadingIcon, trailingIcon, asChild, className, children, disabled, onClick, type, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
2549
2550
|
|
|
2550
2551
|
declare const saudiRiyalSymbolVariants: (props?: ({
|
|
2551
2552
|
size?: "sm" | "lg" | "xl" | "base" | "xs" | "2xl" | "3xl" | "2xs" | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "./chunk-L2D4TPJW.js";
|
|
3
|
-
import "./chunk-XBAAHOCP.js";
|
|
4
|
-
import "./chunk-ZCO5QKH2.js";
|
|
5
2
|
import "./chunk-ZY5XXYXJ.js";
|
|
6
|
-
import {
|
|
7
|
-
Textarea,
|
|
8
|
-
textareaVariants
|
|
9
|
-
} from "./chunk-BQZ4XAYH.js";
|
|
10
3
|
import "./chunk-Q3XKCP3I.js";
|
|
11
4
|
import {
|
|
12
5
|
Timeline,
|
|
@@ -19,10 +12,26 @@ import {
|
|
|
19
12
|
timelineMarkerVariants,
|
|
20
13
|
timelineVariants
|
|
21
14
|
} from "./chunk-NS4IRTKQ.js";
|
|
15
|
+
import "./chunk-L2D4TPJW.js";
|
|
22
16
|
import {
|
|
23
17
|
Toggle,
|
|
24
18
|
toggleVariants
|
|
25
19
|
} from "./chunk-VISVU5LS.js";
|
|
20
|
+
import "./chunk-XBAAHOCP.js";
|
|
21
|
+
import "./chunk-ZCO5QKH2.js";
|
|
22
|
+
import {
|
|
23
|
+
TagInput,
|
|
24
|
+
tagInputVariants
|
|
25
|
+
} from "./chunk-WRCHASO2.js";
|
|
26
|
+
import "./chunk-VB5VOUED.js";
|
|
27
|
+
import {
|
|
28
|
+
Tag,
|
|
29
|
+
tagVariants
|
|
30
|
+
} from "./chunk-JWOG4I4P.js";
|
|
31
|
+
import {
|
|
32
|
+
Textarea,
|
|
33
|
+
textareaVariants
|
|
34
|
+
} from "./chunk-BQZ4XAYH.js";
|
|
26
35
|
import "./chunk-T2E5XT7P.js";
|
|
27
36
|
import "./chunk-MS6HASC6.js";
|
|
28
37
|
import {
|
|
@@ -51,15 +60,6 @@ import {
|
|
|
51
60
|
TableRow,
|
|
52
61
|
tableVariants
|
|
53
62
|
} from "./chunk-VEFRVKSA.js";
|
|
54
|
-
import {
|
|
55
|
-
TagInput,
|
|
56
|
-
tagInputVariants
|
|
57
|
-
} from "./chunk-WRCHASO2.js";
|
|
58
|
-
import "./chunk-VB5VOUED.js";
|
|
59
|
-
import {
|
|
60
|
-
Tag,
|
|
61
|
-
tagVariants
|
|
62
|
-
} from "./chunk-JWOG4I4P.js";
|
|
63
63
|
import "./chunk-NVCOEKCU.js";
|
|
64
64
|
import {
|
|
65
65
|
SlideoutMenu,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
SlideoutMenuTitle,
|
|
76
76
|
SlideoutMenuTrigger,
|
|
77
77
|
slideoutMenuContentVariants
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-BJIB6S5L.js";
|
|
79
79
|
import "./chunk-JVUANKS3.js";
|
|
80
80
|
import {
|
|
81
81
|
Slider,
|
|
@@ -208,7 +208,7 @@ import {
|
|
|
208
208
|
Progress,
|
|
209
209
|
circularProgressVariants,
|
|
210
210
|
progressVariants
|
|
211
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-JADNUODB.js";
|
|
212
212
|
import "./chunk-F5YD6T5D.js";
|
|
213
213
|
import "./chunk-WAIVED2F.js";
|
|
214
214
|
import {
|
|
@@ -292,7 +292,7 @@ import {
|
|
|
292
292
|
FiltrationSection,
|
|
293
293
|
FiltrationTrigger,
|
|
294
294
|
filtrationPanelVariants
|
|
295
|
-
} from "./chunk-
|
|
295
|
+
} from "./chunk-AHUL5WRD.js";
|
|
296
296
|
import "./chunk-HBCSQSOP.js";
|
|
297
297
|
import {
|
|
298
298
|
SearchBox
|
|
@@ -359,16 +359,16 @@ import {
|
|
|
359
359
|
DescriptionTerm,
|
|
360
360
|
descriptionListVariants
|
|
361
361
|
} from "./chunk-J3RL3NPU.js";
|
|
362
|
-
import "./chunk-H2HKUDBZ.js";
|
|
363
|
-
import {
|
|
364
|
-
DigitalStamp,
|
|
365
|
-
digitalStampVariants
|
|
366
|
-
} from "./chunk-QU32POS4.js";
|
|
367
362
|
import "./chunk-S72BEZHS.js";
|
|
368
363
|
import {
|
|
369
364
|
Divider,
|
|
370
365
|
dividerVariants
|
|
371
366
|
} from "./chunk-CUGEH7EB.js";
|
|
367
|
+
import "./chunk-H2HKUDBZ.js";
|
|
368
|
+
import {
|
|
369
|
+
DigitalStamp,
|
|
370
|
+
digitalStampVariants
|
|
371
|
+
} from "./chunk-QU32POS4.js";
|
|
372
372
|
import "./chunk-O6AFVTKN.js";
|
|
373
373
|
import {
|
|
374
374
|
Drawer,
|
|
@@ -413,16 +413,24 @@ import {
|
|
|
413
413
|
} from "./chunk-XIJKAUCN.js";
|
|
414
414
|
import "./chunk-SDFMITFO.js";
|
|
415
415
|
import "./chunk-AR7K3D3Z.js";
|
|
416
|
-
import "./chunk-
|
|
416
|
+
import "./chunk-OF7NTZ2I.js";
|
|
417
417
|
import {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
418
|
+
Card,
|
|
419
|
+
CardContent,
|
|
420
|
+
CardDescription,
|
|
421
|
+
CardExpandableContent,
|
|
422
|
+
CardFooter,
|
|
423
|
+
CardHeader,
|
|
424
|
+
CardIcon,
|
|
425
|
+
CardImage,
|
|
426
|
+
CardTitle,
|
|
427
|
+
cardVariants
|
|
428
|
+
} from "./chunk-NJIQJHJS.js";
|
|
421
429
|
import "./chunk-TPNCV7KA.js";
|
|
422
430
|
import {
|
|
423
431
|
Chip,
|
|
424
432
|
chipVariants
|
|
425
|
-
} from "./chunk-
|
|
433
|
+
} from "./chunk-SQ7NQVEK.js";
|
|
426
434
|
import "./chunk-4WUUV44R.js";
|
|
427
435
|
import {
|
|
428
436
|
CodeSnippet,
|
|
@@ -458,19 +466,6 @@ import {
|
|
|
458
466
|
CollapsibleContent,
|
|
459
467
|
CollapsibleTrigger
|
|
460
468
|
} from "./chunk-775MRN7R.js";
|
|
461
|
-
import "./chunk-OF7NTZ2I.js";
|
|
462
|
-
import {
|
|
463
|
-
Card,
|
|
464
|
-
CardContent,
|
|
465
|
-
CardDescription,
|
|
466
|
-
CardExpandableContent,
|
|
467
|
-
CardFooter,
|
|
468
|
-
CardHeader,
|
|
469
|
-
CardIcon,
|
|
470
|
-
CardImage,
|
|
471
|
-
CardTitle,
|
|
472
|
-
cardVariants
|
|
473
|
-
} from "./chunk-NJIQJHJS.js";
|
|
474
469
|
import "./chunk-N5JDL4VE.js";
|
|
475
470
|
import {
|
|
476
471
|
Button,
|
|
@@ -493,6 +488,11 @@ import {
|
|
|
493
488
|
carouselDotsVariants,
|
|
494
489
|
carouselVariants
|
|
495
490
|
} from "./chunk-LEDIOXDM.js";
|
|
491
|
+
import "./chunk-TZWNX7FF.js";
|
|
492
|
+
import {
|
|
493
|
+
Checkbox,
|
|
494
|
+
checkboxVariants
|
|
495
|
+
} from "./chunk-TNIRKGXY.js";
|
|
496
496
|
import "./chunk-AVHWS36I.js";
|
|
497
497
|
import {
|
|
498
498
|
BarChart,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-dga/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Independent React 19 component library implementing Saudi Arabia's DGA (Digital Government Authority) Platforms Code design system. Accessible (WCAG 2.2 AA), RTL-native, Arabic-first, dark-mode ready, RSC-compatible. Not affiliated with the DGA.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"cmdk": "^1.1.1",
|
|
66
66
|
"radix-ui": "^1.0.0",
|
|
67
67
|
"react-aria-components": "^1.17.0",
|
|
68
|
-
"@dev-dga/tokens": "0.
|
|
68
|
+
"@dev-dga/tokens": "1.0.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^19.0.0",
|
|
72
72
|
"react-dom": "^19.0.0",
|
|
73
|
-
"@dev-dga/css": "0.
|
|
73
|
+
"@dev-dga/css": "1.0.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@storybook/react-vite": "^10.2.15",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Chip/Chip.tsx"],"sourcesContent":["'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst chipVariants = cva('ddga-chip', {\n variants: {\n variant: {\n primary: 'ddga-chip--primary',\n neutral: 'ddga-chip--neutral',\n },\n size: {\n sm: 'ddga-chip--sm',\n md: 'ddga-chip--md',\n lg: 'ddga-chip--lg',\n },\n rounded: {\n true: 'ddga-chip--rounded',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n});\n\ninterface ChipProps\n extends Omit<React.ComponentProps<'button'>, 'onChange'>, VariantProps<typeof chipVariants> {\n /** Controlled selected state — drives `aria-pressed` and the filled treatment. */\n selected?: boolean;\n /** Uncontrolled initial selected state. */\n defaultSelected?: boolean;\n /** Called with the next selected value when the chip toggles. */\n onSelectedChange?: (selected: boolean) => void;\n /** Leading icon (inherits the chip text colour; 14px, 16px at `lg`). */\n leadingIcon?: ReactNode;\n /** Trailing icon. */\n trailingIcon?: ReactNode;\n /** Render as the child element (Radix `Slot`) — e.g. wrap a router link. */\n asChild?: boolean;\n}\n\n/**\n * Interactive selectable chip (SDGA \"Chip\") — a toggle button, distinct from the\n * static `Tag` (SDGA \"Tags\"). Selecting fills the chip (`#1B8354` primary / gray-700 neutral).\n */\nfunction Chip({\n variant,\n size,\n rounded,\n selected,\n defaultSelected = false,\n onSelectedChange,\n leadingIcon,\n trailingIcon,\n asChild,\n className,\n children,\n disabled,\n onClick,\n type = 'button',\n ...props\n}: ChipProps) {\n const isControlled = selected !== undefined;\n const [internal, setInternal] = useState(defaultSelected);\n const isSelected = isControlled ? selected : internal;\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n return (\n <Comp\n // type/native disabled only apply to <button>; in asChild mode lean on\n // aria-disabled + tabIndex (CSS matches [aria-disabled='true'] too).\n {...(asChild ? {} : { type, disabled })}\n {...(asChild && disabled ? { tabIndex: -1 } : {})}\n aria-disabled={disabled || undefined}\n data-slot=\"chip\"\n aria-pressed={isSelected}\n className={cn(chipVariants({ variant, size, rounded }), className)}\n onClick={(e) => {\n if (disabled) {\n e.preventDefault();\n return;\n }\n onClick?.(e);\n if (e.defaultPrevented) return;\n const next = !isSelected;\n if (!isControlled) setInternal(next);\n onSelectedChange?.(next);\n }}\n {...props}\n >\n {leadingIcon != null && (\n <span className=\"ddga-chip__icon\" aria-hidden=\"true\">\n {leadingIcon}\n </span>\n )}\n {asChild ? (\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n children != null && <span className=\"ddga-chip__label\">{children}</span>\n )}\n {trailingIcon != null && (\n <span className=\"ddga-chip__icon\" aria-hidden=\"true\">\n {trailingIcon}\n </span>\n )}\n </Comp>\n );\n}\n\nexport { Chip, chipVariants };\nexport type { ChipProps };\n"],"mappings":";;;;;AAEA,SAAS,gBAAgC;AACzC,SAAS,QAAQ,qBAAqB;AACtC,SAAS,WAA8B;AAmEnC,SAuBI,KAvBJ;AAhEJ,IAAM,eAAe,IAAI,aAAa;AAAA,EACpC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CAAC;AAsBD,SAAS,KAAK;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,GAAc;AACZ,QAAM,eAAe,aAAa;AAClC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,eAAe;AACxD,QAAM,aAAa,eAAe,WAAW;AAC7C,QAAM,OAAO,UAAU,cAAc,OAAO;AAE5C,SACE;AAAA,IAAC;AAAA;AAAA,MAGE,GAAI,UAAU,CAAC,IAAI,EAAE,MAAM,SAAS;AAAA,MACpC,GAAI,WAAW,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC;AAAA,MAC/C,iBAAe,YAAY;AAAA,MAC3B,aAAU;AAAA,MACV,gBAAc;AAAA,MACd,WAAW,GAAG,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC,GAAG,SAAS;AAAA,MACjE,SAAS,CAAC,MAAM;AACd,YAAI,UAAU;AACZ,YAAE,eAAe;AACjB;AAAA,QACF;AACA,kBAAU,CAAC;AACX,YAAI,EAAE,iBAAkB;AACxB,cAAM,OAAO,CAAC;AACd,YAAI,CAAC,aAAc,aAAY,IAAI;AACnC,2BAAmB,IAAI;AAAA,MACzB;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,uBAAe,QACd,oBAAC,UAAK,WAAU,mBAAkB,eAAY,QAC3C,uBACH;AAAA,QAED,UACC,oBAAC,cAAc,WAAd,EAAyB,UAAS,IAEnC,YAAY,QAAQ,oBAAC,UAAK,WAAU,oBAAoB,UAAS;AAAA,QAElE,gBAAgB,QACf,oBAAC,UAAK,WAAU,mBAAkB,eAAY,QAC3C,wBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/devdhaif/work/react/dga-dev/packages/react/dist/chunk-DWCTUNFU.cjs","../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACFA,8BAAyC;AACzC,mCAAsC;AACtC,kEAAuC;AAmEnC,+CAAA;AAhEJ,IAAM,aAAA,EAAe,yCAAA,WAAI,EAAa;AAAA,EACpC,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,OAAA,EAAS,oBAAA;AAAA,MACT,OAAA,EAAS;AAAA,IACX,CAAA;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,eAAA;AAAA,MACJ,EAAA,EAAI,eAAA;AAAA,MACJ,EAAA,EAAI;AAAA,IACN,CAAA;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM;AAAA,IACR;AAAA,EACF,CAAA;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,SAAA;AAA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,QACF;AACA,wBAAA,OAAA,wBAAA,CAAU,CAAC,GAAA;AACX,QAAA,GAAA,CAAI,CAAA,CAAE,gBAAA,EAAkB,MAAA;AACxB,QAAA,MAAM,KAAA,EAAO,CAAC,UAAA;AACd,QAAA,GAAA,CAAI,CAAC,YAAA,EAAc,WAAA,CAAY,IAAI,CAAA;AACnC,wBAAA,gBAAA,0BAAA,CAAmB,IAAI,GAAA;AAAA,MACzB,CAAA;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,YAAA,GAAe,KAAA,mBACd,6BAAA,MAAC,EAAA,EAAK,SAAA,EAAU,iBAAA,EAAkB,aAAA,EAAY,MAAA,EAC3C,QAAA,EAAA,YAAA,CACH,CAAA;AAAA,QAED,QAAA,kBACC,6BAAA,aAAC,CAAc,SAAA,EAAd,EAAyB,SAAA,CAAS,EAAA,EAEnC,SAAA,GAAY,KAAA,mBAAQ,6BAAA,MAAC,EAAA,EAAK,SAAA,EAAU,kBAAA,EAAoB,SAAA,CAAS,CAAA;AAAA,QAElE,aAAA,GAAgB,KAAA,mBACf,6BAAA,MAAC,EAAA,EAAK,SAAA,EAAU,iBAAA,EAAkB,aAAA,EAAY,MAAA,EAC3C,QAAA,EAAA,aAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,CAAA;AAEJ;AD/BA;AACA;AACE;AACA;AACF,yDAAC","file":"/home/devdhaif/work/react/dga-dev/packages/react/dist/chunk-DWCTUNFU.cjs","sourcesContent":[null,"'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst chipVariants = cva('ddga-chip', {\n variants: {\n variant: {\n primary: 'ddga-chip--primary',\n neutral: 'ddga-chip--neutral',\n },\n size: {\n sm: 'ddga-chip--sm',\n md: 'ddga-chip--md',\n lg: 'ddga-chip--lg',\n },\n rounded: {\n true: 'ddga-chip--rounded',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n});\n\ninterface ChipProps\n extends Omit<React.ComponentProps<'button'>, 'onChange'>, VariantProps<typeof chipVariants> {\n /** Controlled selected state — drives `aria-pressed` and the filled treatment. */\n selected?: boolean;\n /** Uncontrolled initial selected state. */\n defaultSelected?: boolean;\n /** Called with the next selected value when the chip toggles. */\n onSelectedChange?: (selected: boolean) => void;\n /** Leading icon (inherits the chip text colour; 14px, 16px at `lg`). */\n leadingIcon?: ReactNode;\n /** Trailing icon. */\n trailingIcon?: ReactNode;\n /** Render as the child element (Radix `Slot`) — e.g. wrap a router link. */\n asChild?: boolean;\n}\n\n/**\n * Interactive selectable chip (SDGA \"Chip\") — a toggle button, distinct from the\n * static `Tag` (SDGA \"Tags\"). Selecting fills the chip (`#1B8354` primary / gray-700 neutral).\n */\nfunction Chip({\n variant,\n size,\n rounded,\n selected,\n defaultSelected = false,\n onSelectedChange,\n leadingIcon,\n trailingIcon,\n asChild,\n className,\n children,\n disabled,\n onClick,\n type = 'button',\n ...props\n}: ChipProps) {\n const isControlled = selected !== undefined;\n const [internal, setInternal] = useState(defaultSelected);\n const isSelected = isControlled ? selected : internal;\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n return (\n <Comp\n // type/native disabled only apply to <button>; in asChild mode lean on\n // aria-disabled + tabIndex (CSS matches [aria-disabled='true'] too).\n {...(asChild ? {} : { type, disabled })}\n {...(asChild && disabled ? { tabIndex: -1 } : {})}\n aria-disabled={disabled || undefined}\n data-slot=\"chip\"\n aria-pressed={isSelected}\n className={cn(chipVariants({ variant, size, rounded }), className)}\n onClick={(e) => {\n if (disabled) {\n e.preventDefault();\n return;\n }\n onClick?.(e);\n if (e.defaultPrevented) return;\n const next = !isSelected;\n if (!isControlled) setInternal(next);\n onSelectedChange?.(next);\n }}\n {...props}\n >\n {leadingIcon != null && (\n <span className=\"ddga-chip__icon\" aria-hidden=\"true\">\n {leadingIcon}\n </span>\n )}\n {asChild ? (\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n children != null && <span className=\"ddga-chip__label\">{children}</span>\n )}\n {trailingIcon != null && (\n <span className=\"ddga-chip__icon\" aria-hidden=\"true\">\n {trailingIcon}\n </span>\n )}\n </Comp>\n );\n}\n\nexport { Chip, chipVariants };\nexport type { ChipProps };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SlideoutMenu/SlideoutMenu.tsx"],"sourcesContent":["'use client';\n\nimport { useContext, useId } from 'react';\nimport { Dialog as DialogPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\nimport { Close } from '../../internal/icons';\n\n// Nav panel on Radix Dialog. Uses <ul>/<li>/link semantics, NOT role=\"menu\" (which breaks SR browse mode for site nav).\n\nconst slideoutMenuContentVariants = cva('ddga-slideout-menu', {\n variants: {\n side: {\n start: 'ddga-slideout-menu--start',\n end: 'ddga-slideout-menu--end',\n },\n /** Panel surface — SDGA \"Background Color\". Gray (`gray-100`) or White. */\n background: {\n gray: 'ddga-slideout-menu--gray',\n white: 'ddga-slideout-menu--white',\n },\n },\n defaultVariants: {\n side: 'start',\n background: 'gray',\n },\n});\n\ntype SlideoutMenuProps = React.ComponentProps<typeof DialogPrimitive.Root>;\ntype SlideoutMenuTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\ntype SlideoutMenuCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\n\ninterface SlideoutMenuContentProps\n extends\n React.ComponentProps<typeof DialogPrimitive.Content>,\n VariantProps<typeof slideoutMenuContentVariants> {}\n\ninterface SlideoutMenuHeaderProps extends React.ComponentProps<'div'> {\n /** Optional featured icon, shown in a 32px brand-tinted disc before the title. */\n icon?: React.ReactNode;\n /** Render the close (X) button. Defaults to `true`. */\n showClose?: boolean;\n /** Localized aria-label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string;\n}\n\ninterface SlideoutMenuTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {\n asChild?: boolean;\n}\n\ninterface SlideoutMenuDescriptionProps extends React.ComponentProps<\n typeof DialogPrimitive.Description\n> {\n asChild?: boolean;\n}\n\ntype SlideoutMenuSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface SlideoutMenuGroupProps extends React.ComponentProps<'div'> {\n /** Section heading rendered above the list (SDGA \"Group Label\"). */\n label?: React.ReactNode;\n}\n\ninterface SlideoutMenuItemProps extends React.ComponentProps<'button'> {\n /** Render as the child element (e.g. an `<a>` or router `<Link>`). */\n asChild?: boolean;\n /** Leading 24px icon. */\n icon?: React.ReactNode;\n /** Trailing slot — counter text, an icon button, a check, a `Tag`, etc. */\n trailing?: React.ReactNode;\n /** Marks the current page — sets `aria-current=\"page\"` and the active style. */\n active?: boolean;\n}\n\nfunction SlideoutMenu(props: SlideoutMenuProps) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction SlideoutMenuTrigger({ className, ...props }: SlideoutMenuTriggerProps) {\n return (\n <DialogPrimitive.Trigger data-slot=\"slideout-menu-trigger\" className={className} {...props} />\n );\n}\n\nfunction SlideoutMenuContent({\n side,\n background,\n className,\n children,\n ...props\n}: SlideoutMenuContentProps) {\n // Portal anchored to the provider root so theme/dark-mode inherit and the fixed panel escapes ancestor transforms.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay\n className=\"ddga-slideout-menu__overlay\"\n data-slot=\"slideout-menu-overlay\"\n />\n <DialogPrimitive.Content\n data-slot=\"slideout-menu-content\"\n className={cn(slideoutMenuContentVariants({ side, background }), className)}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction SlideoutMenuHeader({\n icon,\n showClose = true,\n closeLabel = 'Close',\n className,\n children,\n ...props\n}: SlideoutMenuHeaderProps) {\n return (\n <div\n data-slot=\"slideout-menu-header\"\n className={cn('ddga-slideout-menu__header', className)}\n {...props}\n >\n <div className=\"ddga-slideout-menu__header-content\">\n {icon ? (\n <span\n data-slot=\"slideout-menu-featured-icon\"\n className=\"ddga-slideout-menu__featured-icon\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n ) : null}\n <div className=\"ddga-slideout-menu__header-text\">{children}</div>\n </div>\n {showClose ? (\n <DialogPrimitive.Close\n className=\"ddga-slideout-menu__close\"\n aria-label={closeLabel}\n data-slot=\"slideout-menu-close-x\"\n >\n <Close aria-hidden=\"true\" />\n </DialogPrimitive.Close>\n ) : null}\n </div>\n );\n}\n\nfunction SlideoutMenuTitle({ asChild, className, ...props }: SlideoutMenuTitleProps) {\n return (\n <DialogPrimitive.Title\n asChild={asChild}\n data-slot=\"slideout-menu-title\"\n className={cn('ddga-slideout-menu__title', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuDescription({ asChild, className, ...props }: SlideoutMenuDescriptionProps) {\n return (\n <DialogPrimitive.Description\n asChild={asChild}\n data-slot=\"slideout-menu-description\"\n className={cn('ddga-slideout-menu__description', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuBody({ asChild, className, ...props }: SlideoutMenuSectionProps) {\n // asChild lets consumers make the scroll region a `<nav aria-label>` landmark.\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"slideout-menu-body\"\n className={cn('ddga-slideout-menu__body', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuGroup({ label, className, children, ...props }: SlideoutMenuGroupProps) {\n const labelId = useId();\n return (\n <div\n data-slot=\"slideout-menu-group\"\n className={cn('ddga-slideout-menu__group', className)}\n {...props}\n >\n {label != null ? (\n <div id={labelId} className=\"ddga-slideout-menu__group-label\">\n {label}\n </div>\n ) : null}\n <ul\n className=\"ddga-slideout-menu__list\"\n {...(label != null ? { 'aria-labelledby': labelId } : {})}\n >\n {children}\n </ul>\n </div>\n );\n}\n\nfunction SlideoutMenuItem({\n asChild,\n icon,\n trailing,\n active,\n className,\n children,\n ...props\n}: SlideoutMenuItemProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <li data-slot=\"slideout-menu-item-wrapper\" className=\"ddga-slideout-menu__item-wrapper\">\n <Comp\n data-slot=\"slideout-menu-item\"\n className={cn('ddga-slideout-menu__item', className)}\n data-active={active ? '' : undefined}\n aria-current={active ? 'page' : undefined}\n {...(asChild ? {} : { type: 'button' as const })}\n {...props}\n >\n {icon ? (\n <span className=\"ddga-slideout-menu__item-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n {asChild ? (\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n <span className=\"ddga-slideout-menu__item-label\">{children}</span>\n )}\n {trailing ? <span className=\"ddga-slideout-menu__item-trailing\">{trailing}</span> : null}\n </Comp>\n </li>\n );\n}\n\nfunction SlideoutMenuSeparator({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"slideout-menu-separator\"\n role=\"separator\"\n className={cn('ddga-slideout-menu__separator', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuFooter({ asChild, className, ...props }: SlideoutMenuSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"slideout-menu-footer\"\n className={cn('ddga-slideout-menu__footer', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuClose({ className, ...props }: SlideoutMenuCloseProps) {\n return <DialogPrimitive.Close data-slot=\"slideout-menu-close\" className={className} {...props} />;\n}\n\nexport {\n SlideoutMenu,\n SlideoutMenuTrigger,\n SlideoutMenuContent,\n SlideoutMenuHeader,\n SlideoutMenuTitle,\n SlideoutMenuDescription,\n SlideoutMenuBody,\n SlideoutMenuGroup,\n SlideoutMenuItem,\n SlideoutMenuSeparator,\n SlideoutMenuFooter,\n SlideoutMenuClose,\n slideoutMenuContentVariants,\n};\nexport type {\n SlideoutMenuProps,\n SlideoutMenuTriggerProps,\n SlideoutMenuContentProps,\n SlideoutMenuHeaderProps,\n SlideoutMenuTitleProps,\n SlideoutMenuDescriptionProps,\n SlideoutMenuSectionProps,\n SlideoutMenuGroupProps,\n SlideoutMenuItemProps,\n SlideoutMenuCloseProps,\n};\n"],"mappings":";;;;;;;;;;;AAEA,SAAS,YAAY,aAAa;AAClC,SAAS,UAAU,iBAAiB,QAAQ,qBAAqB;AACjE,SAAS,WAA8B;AAwE9B,cAqBL,YArBK;AAjET,IAAM,8BAA8B,IAAI,sBAAsB;AAAA,EAC5D,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,KAAK;AAAA,IACP;AAAA;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AACF,CAAC;AAgDD,SAAS,aAAa,OAA0B;AAC9C,SAAO,oBAAC,gBAAgB,MAAhB,EAAsB,GAAG,OAAO;AAC1C;AAEA,SAAS,oBAAoB,EAAE,WAAW,GAAG,MAAM,GAA6B;AAC9E,SACE,oBAAC,gBAAgB,SAAhB,EAAwB,aAAU,yBAAwB,WAAuB,GAAG,OAAO;AAEhG;AAEA,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA6B;AAE3B,QAAM,MAAM,WAAW,UAAU;AACjC,QAAM,kBAAkB,KAAK,YAAY,KAAK,UAAU;AAExD,SACE,qBAAC,gBAAgB,QAAhB,EAAuB,WAAW,iBACjC;AAAA;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC,WAAU;AAAA,QACV,aAAU;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC,gBAAgB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5D,WAAW,oBAAC,UAAK,WAAU,qCAAqC,oBAAS,IAAU;AAAA;AAAA;AAAA,EACtF,GACF;AAEJ;AAEA,SAAS,sBAAsB,EAAE,WAAW,GAAG,MAAM,GAAgC;AACnF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,mBAAmB,EAAE,SAAS,WAAW,GAAG,MAAM,GAA6B;AACtF,QAAM,OAAO,UAAU,cAAc,OAAO;AAC5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,8BAA8B,SAAS;AAAA,MACpD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB,EAAE,WAAW,GAAG,MAAM,GAA2B;AAC1E,SAAO,oBAAC,gBAAgB,OAAhB,EAAsB,aAAU,uBAAsB,WAAuB,GAAG,OAAO;AACjG;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/devdhaif/work/react/dga-dev/packages/react/dist/chunk-QLV4RQVQ.cjs","../src/components/SlideoutMenu/SlideoutMenu.tsx"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACRA,8BAAkC;AAClC,mCAAiE;AACjE,kEAAuC;AAwE9B,+CAAA;AAjET,IAAM,4BAAA,EAA8B,yCAAA,oBAAI,EAAsB;AAAA,EAC5D,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO,2BAAA;AAAA,MACP,GAAA,EAAK;AAAA,IACP,CAAA;AAAA;AAAA,IAEA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,0BAAA;AAAA,MACN,KAAA,EAAO;AAAA,IACT;AAAA,EACF,CAAA;AAAA,EACA,eAA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/home/devdhaif/work/react/dga-dev/packages/react/dist/chunk-QLV4RQVQ.cjs","sourcesContent":[null,"'use client';\n\nimport { useContext, useId } from 'react';\nimport { Dialog as DialogPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\nimport { Close } from '../../internal/icons';\n\n// Nav panel on Radix Dialog. Uses <ul>/<li>/link semantics, NOT role=\"menu\" (which breaks SR browse mode for site nav).\n\nconst slideoutMenuContentVariants = cva('ddga-slideout-menu', {\n variants: {\n side: {\n start: 'ddga-slideout-menu--start',\n end: 'ddga-slideout-menu--end',\n },\n /** Panel surface — SDGA \"Background Color\". Gray (`gray-100`) or White. */\n background: {\n gray: 'ddga-slideout-menu--gray',\n white: 'ddga-slideout-menu--white',\n },\n },\n defaultVariants: {\n side: 'start',\n background: 'gray',\n },\n});\n\ntype SlideoutMenuProps = React.ComponentProps<typeof DialogPrimitive.Root>;\ntype SlideoutMenuTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\ntype SlideoutMenuCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\n\ninterface SlideoutMenuContentProps\n extends\n React.ComponentProps<typeof DialogPrimitive.Content>,\n VariantProps<typeof slideoutMenuContentVariants> {}\n\ninterface SlideoutMenuHeaderProps extends React.ComponentProps<'div'> {\n /** Optional featured icon, shown in a 32px brand-tinted disc before the title. */\n icon?: React.ReactNode;\n /** Render the close (X) button. Defaults to `true`. */\n showClose?: boolean;\n /** Localized aria-label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string;\n}\n\ninterface SlideoutMenuTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {\n asChild?: boolean;\n}\n\ninterface SlideoutMenuDescriptionProps extends React.ComponentProps<\n typeof DialogPrimitive.Description\n> {\n asChild?: boolean;\n}\n\ntype SlideoutMenuSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface SlideoutMenuGroupProps extends React.ComponentProps<'div'> {\n /** Section heading rendered above the list (SDGA \"Group Label\"). */\n label?: React.ReactNode;\n}\n\ninterface SlideoutMenuItemProps extends React.ComponentProps<'button'> {\n /** Render as the child element (e.g. an `<a>` or router `<Link>`). */\n asChild?: boolean;\n /** Leading 24px icon. */\n icon?: React.ReactNode;\n /** Trailing slot — counter text, an icon button, a check, a `Tag`, etc. */\n trailing?: React.ReactNode;\n /** Marks the current page — sets `aria-current=\"page\"` and the active style. */\n active?: boolean;\n}\n\nfunction SlideoutMenu(props: SlideoutMenuProps) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction SlideoutMenuTrigger({ className, ...props }: SlideoutMenuTriggerProps) {\n return (\n <DialogPrimitive.Trigger data-slot=\"slideout-menu-trigger\" className={className} {...props} />\n );\n}\n\nfunction SlideoutMenuContent({\n side,\n background,\n className,\n children,\n ...props\n}: SlideoutMenuContentProps) {\n // Portal anchored to the provider root so theme/dark-mode inherit and the fixed panel escapes ancestor transforms.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay\n className=\"ddga-slideout-menu__overlay\"\n data-slot=\"slideout-menu-overlay\"\n />\n <DialogPrimitive.Content\n data-slot=\"slideout-menu-content\"\n className={cn(slideoutMenuContentVariants({ side, background }), className)}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction SlideoutMenuHeader({\n icon,\n showClose = true,\n closeLabel = 'Close',\n className,\n children,\n ...props\n}: SlideoutMenuHeaderProps) {\n return (\n <div\n data-slot=\"slideout-menu-header\"\n className={cn('ddga-slideout-menu__header', className)}\n {...props}\n >\n <div className=\"ddga-slideout-menu__header-content\">\n {icon ? (\n <span\n data-slot=\"slideout-menu-featured-icon\"\n className=\"ddga-slideout-menu__featured-icon\"\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n ) : null}\n <div className=\"ddga-slideout-menu__header-text\">{children}</div>\n </div>\n {showClose ? (\n <DialogPrimitive.Close\n className=\"ddga-slideout-menu__close\"\n aria-label={closeLabel}\n data-slot=\"slideout-menu-close-x\"\n >\n <Close aria-hidden=\"true\" />\n </DialogPrimitive.Close>\n ) : null}\n </div>\n );\n}\n\nfunction SlideoutMenuTitle({ asChild, className, ...props }: SlideoutMenuTitleProps) {\n return (\n <DialogPrimitive.Title\n asChild={asChild}\n data-slot=\"slideout-menu-title\"\n className={cn('ddga-slideout-menu__title', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuDescription({ asChild, className, ...props }: SlideoutMenuDescriptionProps) {\n return (\n <DialogPrimitive.Description\n asChild={asChild}\n data-slot=\"slideout-menu-description\"\n className={cn('ddga-slideout-menu__description', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuBody({ asChild, className, ...props }: SlideoutMenuSectionProps) {\n // asChild lets consumers make the scroll region a `<nav aria-label>` landmark.\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"slideout-menu-body\"\n className={cn('ddga-slideout-menu__body', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuGroup({ label, className, children, ...props }: SlideoutMenuGroupProps) {\n const labelId = useId();\n return (\n <div\n data-slot=\"slideout-menu-group\"\n className={cn('ddga-slideout-menu__group', className)}\n {...props}\n >\n {label != null ? (\n <div id={labelId} className=\"ddga-slideout-menu__group-label\">\n {label}\n </div>\n ) : null}\n <ul\n className=\"ddga-slideout-menu__list\"\n {...(label != null ? { 'aria-labelledby': labelId } : {})}\n >\n {children}\n </ul>\n </div>\n );\n}\n\nfunction SlideoutMenuItem({\n asChild,\n icon,\n trailing,\n active,\n className,\n children,\n ...props\n}: SlideoutMenuItemProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <li data-slot=\"slideout-menu-item-wrapper\" className=\"ddga-slideout-menu__item-wrapper\">\n <Comp\n data-slot=\"slideout-menu-item\"\n className={cn('ddga-slideout-menu__item', className)}\n data-active={active ? '' : undefined}\n aria-current={active ? 'page' : undefined}\n {...(asChild ? {} : { type: 'button' as const })}\n {...props}\n >\n {icon ? (\n <span className=\"ddga-slideout-menu__item-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n {asChild ? (\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n <span className=\"ddga-slideout-menu__item-label\">{children}</span>\n )}\n {trailing ? <span className=\"ddga-slideout-menu__item-trailing\">{trailing}</span> : null}\n </Comp>\n </li>\n );\n}\n\nfunction SlideoutMenuSeparator({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"slideout-menu-separator\"\n role=\"separator\"\n className={cn('ddga-slideout-menu__separator', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuFooter({ asChild, className, ...props }: SlideoutMenuSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"slideout-menu-footer\"\n className={cn('ddga-slideout-menu__footer', className)}\n {...props}\n />\n );\n}\n\nfunction SlideoutMenuClose({ className, ...props }: SlideoutMenuCloseProps) {\n return <DialogPrimitive.Close data-slot=\"slideout-menu-close\" className={className} {...props} />;\n}\n\nexport {\n SlideoutMenu,\n SlideoutMenuTrigger,\n SlideoutMenuContent,\n SlideoutMenuHeader,\n SlideoutMenuTitle,\n SlideoutMenuDescription,\n SlideoutMenuBody,\n SlideoutMenuGroup,\n SlideoutMenuItem,\n SlideoutMenuSeparator,\n SlideoutMenuFooter,\n SlideoutMenuClose,\n slideoutMenuContentVariants,\n};\nexport type {\n SlideoutMenuProps,\n SlideoutMenuTriggerProps,\n SlideoutMenuContentProps,\n SlideoutMenuHeaderProps,\n SlideoutMenuTitleProps,\n SlideoutMenuDescriptionProps,\n SlideoutMenuSectionProps,\n SlideoutMenuGroupProps,\n SlideoutMenuItemProps,\n SlideoutMenuCloseProps,\n};\n"]}
|
|
File without changes
|