@devslab/dds-react 0.0.0-stage → 0.20.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/LICENSE +74 -0
- package/README.ko.md +28 -0
- package/README.md +33 -2
- package/dist/console-shell.d.ts +44 -0
- package/dist/console-shell.d.ts.map +1 -0
- package/dist/controls.d.ts +45 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/icon.d.ts +10 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +459 -0
- package/dist/index.js.map +1 -0
- package/dist/overlays.d.ts +36 -0
- package/dist/overlays.d.ts.map +1 -0
- package/dist/selection.d.ts +30 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/toast.d.ts +25 -0
- package/dist/toast.d.ts.map +1 -0
- package/package.json +75 -3
- package/styles.css +20 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
DevsLab Source-Available License 1.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DevsLab. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This license governs the DDS software, design tokens, components, icons,
|
|
6
|
+
documentation, and other materials distributed with this license (the
|
|
7
|
+
"Software").
|
|
8
|
+
|
|
9
|
+
1. Permitted use
|
|
10
|
+
|
|
11
|
+
Subject to this license, DevsLab grants you a limited, worldwide,
|
|
12
|
+
non-exclusive, non-transferable, revocable, royalty-free right to:
|
|
13
|
+
|
|
14
|
+
- download and install unmodified copies of the Software;
|
|
15
|
+
- use and execute the Software for internal or commercial applications;
|
|
16
|
+
- compile, minify, tree-shake, and bundle unmodified Software solely as a
|
|
17
|
+
technical part of building an application; and
|
|
18
|
+
- distribute the resulting object code only as an inseparable part of that
|
|
19
|
+
application and not as a standalone library, design system, component kit,
|
|
20
|
+
template, or asset collection.
|
|
21
|
+
|
|
22
|
+
Normal application configuration through documented public APIs, design-token
|
|
23
|
+
overrides, CSS custom properties, and component properties is permitted and is
|
|
24
|
+
not considered modification of the Software.
|
|
25
|
+
|
|
26
|
+
2. Restrictions
|
|
27
|
+
|
|
28
|
+
Except where applicable law does not allow the restriction, you may not:
|
|
29
|
+
|
|
30
|
+
- modify, adapt, translate, reverse engineer, or create derivative works of the
|
|
31
|
+
Software itself;
|
|
32
|
+
- publish, republish, sublicense, sell, rent, host, or redistribute the
|
|
33
|
+
Software or any modified version as a standalone package or downloadable
|
|
34
|
+
collection;
|
|
35
|
+
- use the Software or a substantial portion of it to create or operate a
|
|
36
|
+
competing general-purpose design system, UI kit, component library, icon
|
|
37
|
+
library, token library, template marketplace, or hosted equivalent;
|
|
38
|
+
- remove or alter copyright, license, attribution, or provenance notices; or
|
|
39
|
+
- use DevsLab names, logos, product marks, or trade dress except to make a
|
|
40
|
+
truthful statement that an application uses the Software.
|
|
41
|
+
|
|
42
|
+
No patent, trademark, design, or branding rights are granted except the
|
|
43
|
+
copyright permissions stated in Section 1.
|
|
44
|
+
|
|
45
|
+
3. Ownership and feedback
|
|
46
|
+
|
|
47
|
+
The Software is licensed, not sold. DevsLab and its licensors retain all
|
|
48
|
+
right, title, and interest in the Software. You grant DevsLab a perpetual,
|
|
49
|
+
worldwide, irrevocable, royalty-free right to use feedback you voluntarily
|
|
50
|
+
provide about the Software.
|
|
51
|
+
|
|
52
|
+
4. Termination
|
|
53
|
+
|
|
54
|
+
This license terminates automatically if you breach it. Upon termination, you
|
|
55
|
+
must stop using and distributing the Software and delete all copies under your
|
|
56
|
+
control. Sections 2, 3, 5, and 6 survive termination.
|
|
57
|
+
|
|
58
|
+
5. Disclaimer and limitation of liability
|
|
59
|
+
|
|
60
|
+
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
61
|
+
EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
62
|
+
PURPOSE, TITLE, AND NON-INFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED BY LAW,
|
|
63
|
+
DEVSLAB WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
|
|
64
|
+
CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR LOSS OF DATA, PROFITS,
|
|
65
|
+
REVENUE, OR BUSINESS, ARISING FROM OR RELATED TO THE SOFTWARE.
|
|
66
|
+
|
|
67
|
+
6. Governing law
|
|
68
|
+
|
|
69
|
+
This license is governed by the laws of the Republic of Korea, excluding
|
|
70
|
+
conflict-of-law rules. The Seoul Central District Court has exclusive
|
|
71
|
+
jurisdiction over disputes arising from this license.
|
|
72
|
+
|
|
73
|
+
This is a source-available license, not an open-source license approved by the
|
|
74
|
+
Open Source Initiative.
|
package/README.ko.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# DDS React
|
|
2
|
+
|
|
3
|
+
Ark UI 5.39.3과 DDS 토큰·CSS·아이콘을 사용하는 React 접근성 컴포넌트입니다. React/React DOM 18.3 또는 19를 peer dependency로 사용합니다.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import '@devslab/dds-react/styles.css';
|
|
7
|
+
import { Button, Field, Select, Dialog } from '@devslab/dds-react';
|
|
8
|
+
|
|
9
|
+
<Field label="국가" helpText="국가를 선택하세요">
|
|
10
|
+
{control => <Select {...control} defaultValue="kr"><option value="kr">한국</option></Select>}
|
|
11
|
+
</Field>
|
|
12
|
+
<Button onClick={() => setOpen(true)}>편집</Button>
|
|
13
|
+
<Dialog open={open} onOpenChange={setOpen} title="국가 편집">
|
|
14
|
+
<Button onClick={() => setOpen(false)}>완료</Button>
|
|
15
|
+
</Dialog>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Button, IconButton, Field, Checkbox, Radio, Select, Switch, RadioGroup, Dialog, Tabs/TabList/Tab/TabPanel, Tooltip, Icon, ToastProvider/useToast, ConsoleShell 및 props 타입을 제공합니다. 모든 제품 문구와 접근성 이름은 호출자가 전달합니다.
|
|
19
|
+
|
|
20
|
+
React DOM 속성(`className`, `htmlFor`, `onChange`)과 객체/콜백 ref를 사용합니다. Checkbox/Radio/Switch는 `checked`, `defaultChecked`, `onCheckedChange(boolean)`을 지원하고, Select는 네이티브 value/onChange를 사용합니다. RadioGroup은 label/options와 value/defaultValue/onValueChange(string)을 받습니다. Tabs는 Ark 옵션과 onValueChange(string)을 지원합니다.
|
|
21
|
+
|
|
22
|
+
Dialog는 기본적으로 portal을 사용하며 Ark가 중첩 모달, 포커스 복원, Escape, 스크롤 잠금을 관리합니다. `portal={false}`로 SSR 열린 콘텐츠를 인라인 렌더링할 수 있습니다. `contentProps`, `actions`, `frame`, `initialFocus`, `finalFocus`, `unstyled`와 Ark root 옵션을 제공합니다. Solid의 커스텀 additionalFocusContainers는 모방하지 않습니다. 고급 구성은 ArkDialog/ArkTabs/ArkTooltip/ArkRadioGroup/ArkCheckbox/ArkSwitch/ArkField/ArkToast 네임스페이스를 사용하세요.
|
|
23
|
+
|
|
24
|
+
Tooltip은 하나의 포커스 가능한 요소 또는 trigger props를 받는 render 함수를 사용합니다. ToastProvider의 regionLabel/dismissLabel은 호출자가 지정합니다. dismissLabel이 없으면 닫기 버튼이 없습니다. useToast는 show/dismiss/clear를 반환하며 duration 0은 유지됩니다. 언마운트 때 알림을 정리합니다.
|
|
25
|
+
|
|
26
|
+
ConsoleShell은 brand/nav/header/labels/foot을 받으며 인스턴스별 고유 ID를 사용합니다. 브라우저 전역 없이 import와 SSR이 가능하고, React useId로 hydration 연결을 유지합니다. Solid accessor/ref/render 방식 대신 React JSX/ref와 Ark asChild 요소 구성을 사용합니다. AG Grid는 별도 패키지 `@devslab/dds-table-react`입니다.
|
|
27
|
+
|
|
28
|
+
ESM, 타입 선언 및 명시적 CSS export를 제공합니다. React/React DOM/Ark를 번들에 복제하지 않습니다. 라이선스는 저장소와 동일한 포함 LICENSE를 확인하세요. 상세 API는 영문 README를 참고하세요.
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DDS React
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Accessible React primitives using Ark UI 5.39.3 and shared DDS tokens, CSS and icons. React and React DOM are peers (18.3 or 19). Import CSS once in the application:
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import '@devslab/dds-react/styles.css';
|
|
7
|
+
import { Button, Field, Select, Dialog, Tabs, TabList, Tab, TabPanel } from '@devslab/dds-react';
|
|
8
|
+
|
|
9
|
+
<Field label="Country" helpText="Choose a country">
|
|
10
|
+
{control => <Select {...control} defaultValue="kr"><option value="kr">Korea</option></Select>}
|
|
11
|
+
</Field>
|
|
12
|
+
<Button tone="primary" onClick={() => setOpen(true)}>Edit</Button>
|
|
13
|
+
<Dialog open={open} onOpenChange={setOpen} title="Edit country" description="Changes apply to your profile">
|
|
14
|
+
<Button onClick={() => setOpen(false)}>Done</Button>
|
|
15
|
+
</Dialog>
|
|
16
|
+
<Tabs defaultValue="overview">
|
|
17
|
+
<TabList aria-label="Sections"><Tab value="overview">Overview</Tab></TabList>
|
|
18
|
+
<TabPanel value="overview">Content</TabPanel>
|
|
19
|
+
</Tabs>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Exports: `Button`, `IconButton`, `Field`, `Checkbox`, `Radio`, `Select`, `Switch`, `RadioGroup`, `Dialog`, `Tabs`, `TabList`, `Tab`, `TabPanel`, `Tooltip`, `Icon`, `ToastProvider`, `useToast`, `ConsoleShell`, and their prop types. Labels, tooltip messages, dialog titles and notification copy come from the caller. There is no translated fallback copy.
|
|
23
|
+
|
|
24
|
+
Native DOM attributes use React spelling (`className`, `htmlFor`, `onChange`). DOM components accept React object or callback refs; Select refs target its select and Dialog refs target content. Button defaults to `type="button"`; loading prevents activation and preserves its name. Checkbox, Radio and Switch accept `checked`/`defaultChecked`, `onCheckedChange(boolean)` and native input attributes. Select uses native `value`/`defaultValue` and `onChange`. RadioGroup takes `label` and `options: { value, label, disabled? }[]`, with `value`/`defaultValue` and `onValueChange(string)`.
|
|
25
|
+
|
|
26
|
+
Tabs extends Ark root options, with `onValueChange(string)`; parts accept normal Ark DOM props including `asChild`. Dialog accepts Ark root options with `onOpenChange(boolean)`, `closeOnOutside`, `initialFocus`, `finalFocus`, `contentProps`, `actions`, `frame(parts)` and `unstyled`. Dialog portals by default; use `portal={false}` for inline markup, including open SSR content. Ark owns nested modal isolation, focus, Escape handling and scroll locking. Additional focus containers from the Solid package are not emulated; use Ark `persistentElements` and `modal`/`trapFocus` according to application needs.
|
|
27
|
+
|
|
28
|
+
Tooltip accepts one element child (Ark `asChild`) or a render function receiving native button trigger props. Use a focusable trigger and preserve the supplied events. `ToastProvider` accepts optional caller `regionLabel` and `dismissLabel` (string or record-to-string function); without `dismissLabel` it renders no close button. `useToast()` returns `show({ message, tone?, duration? })`, `dismiss(id)`, and `clear()`; duration 0 persists. Providers clear their notifications on unmount.
|
|
29
|
+
|
|
30
|
+
Advanced compositional parts are exported as `ArkDialog`, `ArkTabs`, `ArkTooltip`, `ArkRadioGroup`, `ArkCheckbox`, `ArkSwitch`, `ArkField`, and `ArkToast`. They are the pinned upstream Ark namespaces, useful inside convenience component children or for application-owned composition.
|
|
31
|
+
|
|
32
|
+
ConsoleShell accepts caller brand/navigation/header/labels/foot slots and unique per-instance landmark IDs. Its rail uses caller route state; no router or business store is included. Imports and server rendering require no browser globals; client-only effects start after mounting. React `useId` keeps label associations stable through hydration. React JSX, React refs and Ark `asChild` element composition differ from Solid render callbacks/accessors. The grid is a separate dependency: use `@devslab/dds-table-react` for AG Grid.
|
|
33
|
+
|
|
34
|
+
ESM and declarations are shipped; React, React DOM and Ark remain external to the DDS bundle. This package is source-available under the included LICENSE, matching the DDS repository.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface ConsoleNavItem {
|
|
3
|
+
id: string;
|
|
4
|
+
href: string;
|
|
5
|
+
label: string;
|
|
6
|
+
badge?: number;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ConsoleNavGroup {
|
|
10
|
+
label: string;
|
|
11
|
+
items: readonly ConsoleNavItem[];
|
|
12
|
+
}
|
|
13
|
+
export interface ConsoleShellLabels {
|
|
14
|
+
skip: string;
|
|
15
|
+
menuOpen: string;
|
|
16
|
+
menuClose: string;
|
|
17
|
+
nav: string;
|
|
18
|
+
badge: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConsoleHeader {
|
|
21
|
+
eyebrow?: string;
|
|
22
|
+
title: string;
|
|
23
|
+
actions?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface ConsoleShellProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "context"> {
|
|
26
|
+
surface: string;
|
|
27
|
+
activePath: string;
|
|
28
|
+
brand: {
|
|
29
|
+
href: string;
|
|
30
|
+
name: string;
|
|
31
|
+
mark: string;
|
|
32
|
+
};
|
|
33
|
+
context?: readonly {
|
|
34
|
+
label: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
37
|
+
nav: readonly ConsoleNavGroup[];
|
|
38
|
+
labels: ConsoleShellLabels;
|
|
39
|
+
header: ConsoleHeader;
|
|
40
|
+
foot?: ReactNode;
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}
|
|
43
|
+
export declare const ConsoleShell: import("react").ForwardRefExoticComponent<ConsoleShellProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
|
+
//# sourceMappingURL=console-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-shell.d.ts","sourceRoot":"","sources":["../src/console-shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AACD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;CAClC;AACD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AACD,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,OAAO,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,GAAG,EAAE,SAAS,eAAe,EAAE,CAAC;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AASD,eAAO,MAAM,YAAY,8GA8IxB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type InputHTMLAttributes, type SelectHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export declare const classes: (...values: (string | false | undefined)[]) => string;
|
|
3
|
+
export type ButtonTone = "primary" | "secondary" | "ghost" | "danger";
|
|
4
|
+
export type ControlSize = "sm" | "md" | "lg";
|
|
5
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
tone?: ButtonTone;
|
|
7
|
+
size?: ControlSize;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export interface IconButtonProps extends Omit<ButtonProps, "tone"> {
|
|
12
|
+
"aria-label": string;
|
|
13
|
+
tone?: "ghost" | "secondary" | "danger";
|
|
14
|
+
}
|
|
15
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export interface FieldControlProps {
|
|
17
|
+
id: string;
|
|
18
|
+
"aria-describedby"?: string;
|
|
19
|
+
"aria-invalid"?: true;
|
|
20
|
+
"aria-required"?: true;
|
|
21
|
+
}
|
|
22
|
+
export interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
helpText?: ReactNode;
|
|
25
|
+
error?: ReactNode;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
children: ReactNode | ((props: FieldControlProps) => ReactNode);
|
|
28
|
+
}
|
|
29
|
+
export declare const Field: import("react").ForwardRefExoticComponent<FieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
wrapperClassName?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
35
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "children"> {
|
|
36
|
+
label: ReactNode;
|
|
37
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
38
|
+
inputClassName?: string;
|
|
39
|
+
}
|
|
40
|
+
export type RadioProps = CheckboxProps;
|
|
41
|
+
export type SwitchProps = CheckboxProps;
|
|
42
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
43
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
44
|
+
export declare const Radio: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
45
|
+
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,eAAO,MAAM,OAAO,cAAe,CAAC,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,WAC/B,CAAC;AACnC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,eAAO,MAAM,MAAM,2GAiClB,CAAC;AACF,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAChE,YAAY,EAAE,M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AAO,MAAM,KAAK,4GAoBhB,CAAC"}
|
package/dist/icon.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SVGProps } from "react";
|
|
2
|
+
import { type DdsIconName } from "@devslab/dds-icons";
|
|
3
|
+
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, "name" | "children"> {
|
|
4
|
+
name: DdsIconName;
|
|
5
|
+
label?: string;
|
|
6
|
+
size?: number | string;
|
|
7
|
+
directional?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const Icon: import("react").ForwardRefExoticComponent<Omit<IconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../src/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1D,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,eAAO,MAAM,IAAI,kHA8Bf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./controls";
|
|
2
|
+
export * from "./selection";
|
|
3
|
+
export * from "./overlays";
|
|
4
|
+
export * from "./icon";
|
|
5
|
+
export * from "./toast";
|
|
6
|
+
export * from "./console-shell";
|
|
7
|
+
export { Dialog as ArkDialog } from "@ark-ui/react/dialog";
|
|
8
|
+
export { Tabs as ArkTabs } from "@ark-ui/react/tabs";
|
|
9
|
+
export { Tooltip as ArkTooltip } from "@ark-ui/react/tooltip";
|
|
10
|
+
export { RadioGroup as ArkRadioGroup } from "@ark-ui/react/radio-group";
|
|
11
|
+
export { Checkbox as ArkCheckbox } from "@ark-ui/react/checkbox";
|
|
12
|
+
export { Switch as ArkSwitch } from "@ark-ui/react/switch";
|
|
13
|
+
export { Field as ArkField } from "@ark-ui/react/field";
|
|
14
|
+
export { Toast as ArkToast } from "@ark-ui/react/toast";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
+
import { Field as c, Field as l } from "@ark-ui/react/field";
|
|
3
|
+
import { Checkbox as u, Checkbox as d } from "@ark-ui/react/checkbox";
|
|
4
|
+
import { Switch as f, Switch as p } from "@ark-ui/react/switch";
|
|
5
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
|
+
import { Tabs as _, Tabs as v, useTabsContext as y } from "@ark-ui/react/tabs";
|
|
7
|
+
import { RadioGroup as b, RadioGroup as x, useRadioGroupContext as S } from "@ark-ui/react/radio-group";
|
|
8
|
+
import { Dialog as C, Dialog as w } from "@ark-ui/react/dialog";
|
|
9
|
+
import { Tooltip as T, Tooltip as E } from "@ark-ui/react/tooltip";
|
|
10
|
+
import { Portal as D } from "@ark-ui/react/portal";
|
|
11
|
+
import { directionPolicy as O, icons as k } from "@devslab/dds-icons";
|
|
12
|
+
import { Toast as A, Toast as j, Toaster as M, createToaster as N } from "@ark-ui/react/toast";
|
|
13
|
+
//#region src/controls.tsx
|
|
14
|
+
var P = (...e) => e.filter(Boolean).join(" "), F = t(function({ tone: e = "primary", size: t = "md", loading: n, disabled: r, type: i = "button", className: a, children: o, ...s }, c) {
|
|
15
|
+
return /* @__PURE__ */ g("button", {
|
|
16
|
+
...s,
|
|
17
|
+
ref: c,
|
|
18
|
+
type: i,
|
|
19
|
+
disabled: r || n,
|
|
20
|
+
"aria-busy": n || void 0,
|
|
21
|
+
className: P("dds-btn", `dds-btn--${e}`, t !== "md" && `dds-btn--${t}`, a),
|
|
22
|
+
children: [n && /* @__PURE__ */ h("span", {
|
|
23
|
+
className: "dds-spinner",
|
|
24
|
+
"aria-hidden": !0
|
|
25
|
+
}), o]
|
|
26
|
+
});
|
|
27
|
+
}), I = t(function({ tone: e = "ghost", size: t = "md", loading: n, disabled: r, type: i = "button", className: a, children: o, ...s }, c) {
|
|
28
|
+
return /* @__PURE__ */ h("button", {
|
|
29
|
+
...s,
|
|
30
|
+
ref: c,
|
|
31
|
+
type: i,
|
|
32
|
+
disabled: r || n,
|
|
33
|
+
"aria-busy": n || void 0,
|
|
34
|
+
className: P("dds-iconbtn", e !== "ghost" && `dds-iconbtn--${e}`, t !== "md" && `dds-iconbtn--${t}`, a),
|
|
35
|
+
children: n ? /* @__PURE__ */ h("span", {
|
|
36
|
+
className: "dds-spinner",
|
|
37
|
+
"aria-hidden": !0
|
|
38
|
+
}) : o
|
|
39
|
+
});
|
|
40
|
+
}), L = t(function({ id: e, label: t, helpText: n, error: r, required: a, className: o, children: s, ...c }, u) {
|
|
41
|
+
let d = i(), f = e ?? `dds-field-${d}`, p = {
|
|
42
|
+
id: f,
|
|
43
|
+
"aria-describedby": [n && `${f}-help`, r && `${f}-error`].filter(Boolean).join(" ") || void 0,
|
|
44
|
+
"aria-invalid": r ? !0 : void 0,
|
|
45
|
+
"aria-required": a ? !0 : void 0
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ g(l.Root, {
|
|
48
|
+
...c,
|
|
49
|
+
ref: u,
|
|
50
|
+
invalid: !!r,
|
|
51
|
+
required: a,
|
|
52
|
+
id: f,
|
|
53
|
+
ids: {
|
|
54
|
+
control: `${f}-root`,
|
|
55
|
+
helperText: `${f}-help`,
|
|
56
|
+
errorText: `${f}-error`
|
|
57
|
+
},
|
|
58
|
+
className: P("dds-field", !!r && "dds-field--error", o),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ g(l.Label, {
|
|
61
|
+
htmlFor: f,
|
|
62
|
+
className: "dds-field__label",
|
|
63
|
+
children: [t, a && /* @__PURE__ */ h("span", {
|
|
64
|
+
"aria-hidden": !0,
|
|
65
|
+
children: " *"
|
|
66
|
+
})]
|
|
67
|
+
}),
|
|
68
|
+
typeof s == "function" ? s(p) : s,
|
|
69
|
+
n && /* @__PURE__ */ h(l.HelperText, {
|
|
70
|
+
className: "dds-field__help",
|
|
71
|
+
children: n
|
|
72
|
+
}),
|
|
73
|
+
r && /* @__PURE__ */ h(l.ErrorText, {
|
|
74
|
+
className: "dds-field__error",
|
|
75
|
+
role: "alert",
|
|
76
|
+
children: r
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}), R = t(function({ invalid: e, wrapperClassName: t, className: n, children: r, ...i }, a) {
|
|
81
|
+
return /* @__PURE__ */ h("span", {
|
|
82
|
+
className: P("dds-select", t),
|
|
83
|
+
children: /* @__PURE__ */ h("select", {
|
|
84
|
+
...i,
|
|
85
|
+
ref: a,
|
|
86
|
+
className: P("dds-select__input", n),
|
|
87
|
+
"aria-invalid": e || i["aria-invalid"],
|
|
88
|
+
children: r
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}), z = t(function({ kind: e, label: t, checked: n, defaultChecked: r, onCheckedChange: i, id: a, name: o, value: s, disabled: c, required: l, readOnly: u, form: f, className: m, inputClassName: _, onChange: v, ...y }, b) {
|
|
92
|
+
let x = e === "switch" ? p.Root : d.Root, S = e === "switch" ? p.Label : d.Label, C = e === "switch" ? p.Context : d.Context, w = e === "switch" ? "dds-switch" : "dds-check";
|
|
93
|
+
return /* @__PURE__ */ g(x, {
|
|
94
|
+
checked: n,
|
|
95
|
+
defaultChecked: r,
|
|
96
|
+
onCheckedChange: (e) => i?.(e.checked === !0),
|
|
97
|
+
ids: a ? { hiddenInput: a } : void 0,
|
|
98
|
+
name: o,
|
|
99
|
+
value: String(s ?? "on"),
|
|
100
|
+
disabled: c,
|
|
101
|
+
required: l,
|
|
102
|
+
readOnly: u,
|
|
103
|
+
form: f,
|
|
104
|
+
className: P(w, m),
|
|
105
|
+
children: [/* @__PURE__ */ h(C, { children: (t) => {
|
|
106
|
+
let { style: n, defaultChecked: r, ...i } = t.getHiddenInputProps();
|
|
107
|
+
return /* @__PURE__ */ h("input", {
|
|
108
|
+
...i,
|
|
109
|
+
...y,
|
|
110
|
+
ref: b,
|
|
111
|
+
checked: t.checked,
|
|
112
|
+
role: e === "switch" ? "switch" : void 0,
|
|
113
|
+
onChange: v ?? (() => {}),
|
|
114
|
+
onClick: (e) => {
|
|
115
|
+
y.onClick?.(e), e.defaultPrevented || i.onClick?.(e);
|
|
116
|
+
},
|
|
117
|
+
className: P(`${w}__input`, _)
|
|
118
|
+
});
|
|
119
|
+
} }), /* @__PURE__ */ h(S, { children: t })]
|
|
120
|
+
});
|
|
121
|
+
}), B = t((e, t) => /* @__PURE__ */ h(z, {
|
|
122
|
+
...e,
|
|
123
|
+
kind: "checkbox",
|
|
124
|
+
ref: t
|
|
125
|
+
})), V = t((e, t) => /* @__PURE__ */ h(z, {
|
|
126
|
+
...e,
|
|
127
|
+
kind: "switch",
|
|
128
|
+
ref: t
|
|
129
|
+
})), H = t(function({ label: e, className: t, inputClassName: n, onCheckedChange: r, onChange: i, ...a }, o) {
|
|
130
|
+
return /* @__PURE__ */ g("label", {
|
|
131
|
+
className: P("dds-check", t),
|
|
132
|
+
children: [/* @__PURE__ */ h("input", {
|
|
133
|
+
...a,
|
|
134
|
+
ref: o,
|
|
135
|
+
type: "radio",
|
|
136
|
+
className: P("dds-check__input", n),
|
|
137
|
+
onChange: (e) => {
|
|
138
|
+
i?.(e), e.defaultPrevented || r?.(e.currentTarget.checked);
|
|
139
|
+
}
|
|
140
|
+
}), /* @__PURE__ */ h("span", { children: e })]
|
|
141
|
+
});
|
|
142
|
+
}), U = t(function({ onValueChange: e, unstyled: t, className: n, ...r }, i) {
|
|
143
|
+
return /* @__PURE__ */ h(v.Root, {
|
|
144
|
+
...r,
|
|
145
|
+
ref: i,
|
|
146
|
+
onValueChange: (t) => e?.(t.value),
|
|
147
|
+
className: P(!t && "dds-tabs-root", n)
|
|
148
|
+
});
|
|
149
|
+
}), W = t(function({ unstyled: e, className: t, ...n }, r) {
|
|
150
|
+
return /* @__PURE__ */ h(v.List, {
|
|
151
|
+
...n,
|
|
152
|
+
ref: r,
|
|
153
|
+
className: P(!e && "dds-tabs", t)
|
|
154
|
+
});
|
|
155
|
+
}), G = t(function({ unstyled: e, className: t, ...n }, r) {
|
|
156
|
+
return /* @__PURE__ */ h(v.Trigger, {
|
|
157
|
+
...n,
|
|
158
|
+
ref: r,
|
|
159
|
+
className: P(!e && "dds-tab", t)
|
|
160
|
+
});
|
|
161
|
+
}), K = t(function({ value: e, style: t, ...n }, r) {
|
|
162
|
+
let i = y().value !== e;
|
|
163
|
+
return /* @__PURE__ */ h(v.Content, {
|
|
164
|
+
...n,
|
|
165
|
+
value: e,
|
|
166
|
+
ref: r,
|
|
167
|
+
hidden: i,
|
|
168
|
+
style: i ? {
|
|
169
|
+
...t,
|
|
170
|
+
display: "none"
|
|
171
|
+
} : t
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
function q({ option: e }) {
|
|
175
|
+
let t = S(), { style: n, defaultChecked: r, ...i } = t.getItemHiddenInputProps(e);
|
|
176
|
+
return /* @__PURE__ */ h("input", {
|
|
177
|
+
...i,
|
|
178
|
+
checked: t.value === e.value,
|
|
179
|
+
onChange: () => {},
|
|
180
|
+
className: "dds-check__input"
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
var J = t(function({ options: e, label: t, onValueChange: n, className: r, children: i, ...a }, o) {
|
|
184
|
+
return /* @__PURE__ */ g(x.Root, {
|
|
185
|
+
...a,
|
|
186
|
+
ref: o,
|
|
187
|
+
onValueChange: (e) => {
|
|
188
|
+
e.value !== null && n?.(e.value);
|
|
189
|
+
},
|
|
190
|
+
className: P("dds-radio-group", r),
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ h(x.Label, {
|
|
193
|
+
className: "dds-field__label",
|
|
194
|
+
children: t
|
|
195
|
+
}),
|
|
196
|
+
e.map((e) => /* @__PURE__ */ g(x.Item, {
|
|
197
|
+
value: e.value,
|
|
198
|
+
disabled: e.disabled,
|
|
199
|
+
className: "dds-check",
|
|
200
|
+
children: [/* @__PURE__ */ h(q, { option: e }), /* @__PURE__ */ h(x.ItemText, { children: e.label })]
|
|
201
|
+
}, e.value)),
|
|
202
|
+
i
|
|
203
|
+
]
|
|
204
|
+
});
|
|
205
|
+
}), Y = t(function({ title: e, description: t, children: n, actions: r, onOpenChange: i, closeOnOutside: a, portal: o = !0, className: s, overlayClassName: c, contentProps: l, initialFocus: u, finalFocus: d, frame: f, unstyled: p, ..._ }, v) {
|
|
206
|
+
let y = {
|
|
207
|
+
title: /* @__PURE__ */ h(w.Title, {
|
|
208
|
+
className: p ? void 0 : "dds-dialog__title",
|
|
209
|
+
children: e
|
|
210
|
+
}),
|
|
211
|
+
description: t && /* @__PURE__ */ h(w.Description, {
|
|
212
|
+
className: p ? void 0 : "dds-dialog__body",
|
|
213
|
+
children: t
|
|
214
|
+
}),
|
|
215
|
+
children: n,
|
|
216
|
+
actions: r && /* @__PURE__ */ h("div", {
|
|
217
|
+
className: p ? void 0 : "dds-dialog__actions",
|
|
218
|
+
children: r
|
|
219
|
+
})
|
|
220
|
+
}, b = /* @__PURE__ */ h(w.Positioner, {
|
|
221
|
+
className: P(!p && "dds-dialog-overlay", c),
|
|
222
|
+
children: /* @__PURE__ */ h(w.Content, {
|
|
223
|
+
...l,
|
|
224
|
+
ref: v,
|
|
225
|
+
"aria-describedby": t ? l?.["aria-describedby"] : void 0,
|
|
226
|
+
className: P(!p && "dds-dialog", s, l?.className),
|
|
227
|
+
children: f ? f(y) : /* @__PURE__ */ g(m, { children: [
|
|
228
|
+
y.title,
|
|
229
|
+
y.description,
|
|
230
|
+
n,
|
|
231
|
+
y.actions
|
|
232
|
+
] })
|
|
233
|
+
})
|
|
234
|
+
});
|
|
235
|
+
return /* @__PURE__ */ h(w.Root, {
|
|
236
|
+
..._,
|
|
237
|
+
onOpenChange: (e) => i?.(e.open),
|
|
238
|
+
closeOnInteractOutside: a ?? _.closeOnInteractOutside,
|
|
239
|
+
initialFocusEl: u ? () => u() ?? null : _.initialFocusEl,
|
|
240
|
+
finalFocusEl: d ? () => d() ?? null : _.finalFocusEl,
|
|
241
|
+
lazyMount: !0,
|
|
242
|
+
unmountOnExit: !0,
|
|
243
|
+
children: o ? /* @__PURE__ */ h(D, { children: b }) : b
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
function X({ content: e, children: t, onOpenChange: n, className: r, contentProps: i, ...a }) {
|
|
247
|
+
return /* @__PURE__ */ h(E.Root, {
|
|
248
|
+
openDelay: 0,
|
|
249
|
+
closeDelay: 0,
|
|
250
|
+
...a,
|
|
251
|
+
onOpenChange: (e) => n?.(e.open),
|
|
252
|
+
children: /* @__PURE__ */ g("span", {
|
|
253
|
+
className: P("dds-tooltip", r),
|
|
254
|
+
children: [typeof t == "function" ? /* @__PURE__ */ h(E.Context, { children: (e) => t(e.getTriggerProps()) }) : /* @__PURE__ */ h(E.Trigger, {
|
|
255
|
+
asChild: !0,
|
|
256
|
+
children: t
|
|
257
|
+
}), /* @__PURE__ */ h(D, { children: /* @__PURE__ */ h(E.Positioner, { children: /* @__PURE__ */ h(E.Content, {
|
|
258
|
+
...i,
|
|
259
|
+
className: P("dds-tooltip__bubble", i?.className),
|
|
260
|
+
children: e
|
|
261
|
+
}) }) })]
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/icon.tsx
|
|
267
|
+
var Z = t(function({ name: e, label: t, size: n = 24, directional: r, className: i, ...a }, o) {
|
|
268
|
+
let s = k[e];
|
|
269
|
+
return /* @__PURE__ */ g("svg", {
|
|
270
|
+
...a,
|
|
271
|
+
ref: o,
|
|
272
|
+
viewBox: s.viewBox,
|
|
273
|
+
width: n,
|
|
274
|
+
height: n,
|
|
275
|
+
fill: "none",
|
|
276
|
+
stroke: "currentColor",
|
|
277
|
+
strokeWidth: s.strokeWidth,
|
|
278
|
+
strokeLinecap: "round",
|
|
279
|
+
strokeLinejoin: "round",
|
|
280
|
+
role: t ? "img" : void 0,
|
|
281
|
+
"aria-label": t,
|
|
282
|
+
"aria-hidden": !t || void 0,
|
|
283
|
+
className: P((r ?? O.mirrorInRtl.includes(e)) && O.cssClass, i),
|
|
284
|
+
children: [t && /* @__PURE__ */ h("title", { children: t }), /* @__PURE__ */ h("g", { dangerouslySetInnerHTML: { __html: s.body } })]
|
|
285
|
+
});
|
|
286
|
+
}), Q = e(null);
|
|
287
|
+
function $({ children: e, defaultDuration: t = 5e3, dismissLabel: n, regionLabel: s, className: c }) {
|
|
288
|
+
let l = i(), u = o(0), d = a(() => N({
|
|
289
|
+
placement: "bottom-end",
|
|
290
|
+
overlap: !1,
|
|
291
|
+
gap: 8,
|
|
292
|
+
offsets: "var(--dds-space-16)",
|
|
293
|
+
removeDelay: 0,
|
|
294
|
+
hotkey: ["DDS_NO_HOTKEY"]
|
|
295
|
+
}), []), f = a(() => ({
|
|
296
|
+
show(e) {
|
|
297
|
+
let n = `dds-toast-${l}-${++u.current}`, r = e.duration ?? t;
|
|
298
|
+
return d.create({
|
|
299
|
+
id: n,
|
|
300
|
+
description: e.message,
|
|
301
|
+
type: e.tone === "danger" ? "error" : e.tone ?? "info",
|
|
302
|
+
duration: r > 0 ? r : Infinity,
|
|
303
|
+
meta: { dds: {
|
|
304
|
+
...e,
|
|
305
|
+
id: n
|
|
306
|
+
} }
|
|
307
|
+
}), n;
|
|
308
|
+
},
|
|
309
|
+
dismiss: (e) => d.remove(e),
|
|
310
|
+
clear: () => d.remove()
|
|
311
|
+
}), [
|
|
312
|
+
d,
|
|
313
|
+
l,
|
|
314
|
+
t
|
|
315
|
+
]);
|
|
316
|
+
return r(() => () => d.remove(), [d]), /* @__PURE__ */ g(Q.Provider, {
|
|
317
|
+
value: f,
|
|
318
|
+
children: [e, /* @__PURE__ */ h(M, {
|
|
319
|
+
toaster: d,
|
|
320
|
+
label: s ?? "",
|
|
321
|
+
"aria-label": s ?? "",
|
|
322
|
+
role: s ? "region" : "presentation",
|
|
323
|
+
className: P("dds-toast-region", c),
|
|
324
|
+
children: (e) => {
|
|
325
|
+
let t = e.meta?.dds;
|
|
326
|
+
return /* @__PURE__ */ g(A.Root, {
|
|
327
|
+
className: P("dds-toast", `dds-toast--${t.tone ?? "info"}`),
|
|
328
|
+
role: t.tone === "danger" ? "alert" : "status",
|
|
329
|
+
children: [/* @__PURE__ */ h(A.Description, { children: e.description }), n && /* @__PURE__ */ h(A.CloseTrigger, {
|
|
330
|
+
className: "dds-iconbtn dds-iconbtn--sm",
|
|
331
|
+
"aria-label": typeof n == "function" ? n(t) : n,
|
|
332
|
+
children: "×"
|
|
333
|
+
})]
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
})]
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function ee() {
|
|
340
|
+
let e = n(Q);
|
|
341
|
+
if (!e) throw Error("useToast must be called inside <ToastProvider>");
|
|
342
|
+
return e;
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/console-shell.tsx
|
|
346
|
+
function te(e, t) {
|
|
347
|
+
return t.active ?? (t.href.split("/").filter(Boolean).length <= 1 ? e === t.href : e === t.href || e.startsWith(`${t.href}/`));
|
|
348
|
+
}
|
|
349
|
+
var ne = t(function({ surface: e, activePath: t, brand: n, context: a, nav: o, labels: c, header: l, foot: u, children: d, className: f, ...p }, m) {
|
|
350
|
+
let [_, v] = s(!1), [y, b] = s(!1), x = i(), S = `dds-console-rail-${x}`, C = `dds-console-main-${x}`;
|
|
351
|
+
return r(() => {
|
|
352
|
+
b(!0);
|
|
353
|
+
let e = (e) => {
|
|
354
|
+
e.key === "Escape" && v(!1);
|
|
355
|
+
};
|
|
356
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
357
|
+
}, []), /* @__PURE__ */ g("div", {
|
|
358
|
+
...p,
|
|
359
|
+
ref: m,
|
|
360
|
+
className: P("dds-console-shell", f),
|
|
361
|
+
"data-surface": e,
|
|
362
|
+
"data-hydrated": y ? "true" : void 0,
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ h("a", {
|
|
365
|
+
className: "dds-console-skip dds-visually-hidden",
|
|
366
|
+
href: `#${C}`,
|
|
367
|
+
children: c.skip
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ g("button", {
|
|
370
|
+
className: "dds-console-rail__toggle",
|
|
371
|
+
type: "button",
|
|
372
|
+
"data-action": "toggle-rail",
|
|
373
|
+
"aria-controls": S,
|
|
374
|
+
"aria-expanded": _,
|
|
375
|
+
onClick: () => v(!_),
|
|
376
|
+
children: [/* @__PURE__ */ h("span", { "aria-hidden": !0 }), /* @__PURE__ */ h("span", {
|
|
377
|
+
className: "dds-visually-hidden",
|
|
378
|
+
children: _ ? c.menuClose : c.menuOpen
|
|
379
|
+
})]
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ h("div", {
|
|
382
|
+
className: "dds-console-rail__scrim",
|
|
383
|
+
"data-open": String(_),
|
|
384
|
+
onClick: () => v(!1)
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ g("aside", {
|
|
387
|
+
id: S,
|
|
388
|
+
className: "dds-console-rail",
|
|
389
|
+
"data-open": String(_),
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ g("a", {
|
|
392
|
+
className: "dds-console-rail__brand",
|
|
393
|
+
href: n.href,
|
|
394
|
+
children: [/* @__PURE__ */ h("img", {
|
|
395
|
+
src: n.mark,
|
|
396
|
+
alt: "",
|
|
397
|
+
width: 20,
|
|
398
|
+
height: 20
|
|
399
|
+
}), /* @__PURE__ */ h("strong", { children: n.name })]
|
|
400
|
+
}),
|
|
401
|
+
a && a.length > 0 && /* @__PURE__ */ h("dl", {
|
|
402
|
+
className: "dds-console-rail__context",
|
|
403
|
+
children: a.map((e, t) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", { children: e.label }), /* @__PURE__ */ h("dd", { children: e.value })] }, t))
|
|
404
|
+
}),
|
|
405
|
+
/* @__PURE__ */ h("nav", {
|
|
406
|
+
className: "dds-console-rail__nav",
|
|
407
|
+
"aria-label": c.nav,
|
|
408
|
+
children: o.map((n, r) => /* @__PURE__ */ g("section", {
|
|
409
|
+
className: "dds-console-rail__group",
|
|
410
|
+
"aria-labelledby": `${x}-group-${r}`,
|
|
411
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
412
|
+
id: `${x}-group-${r}`,
|
|
413
|
+
className: "dds-console-rail__group-label",
|
|
414
|
+
children: n.label
|
|
415
|
+
}), /* @__PURE__ */ h("ul", { children: n.items.map((n) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ g("a", {
|
|
416
|
+
className: "dds-console-rail__item",
|
|
417
|
+
"data-nav": `${e}.${n.id}`,
|
|
418
|
+
href: n.href,
|
|
419
|
+
"aria-current": te(t, n) ? "page" : void 0,
|
|
420
|
+
onClick: () => v(!1),
|
|
421
|
+
children: [/* @__PURE__ */ h("span", { children: n.label }), n.badge !== void 0 && n.badge > 0 && /* @__PURE__ */ h("span", {
|
|
422
|
+
className: "dds-console-rail__badge",
|
|
423
|
+
"aria-label": c.badge.replace("{count}", () => String(n.badge)),
|
|
424
|
+
children: n.badge
|
|
425
|
+
})]
|
|
426
|
+
}) }, n.id)) })]
|
|
427
|
+
}, r))
|
|
428
|
+
}),
|
|
429
|
+
u && /* @__PURE__ */ h("div", {
|
|
430
|
+
className: "dds-console-rail__foot",
|
|
431
|
+
children: u
|
|
432
|
+
})
|
|
433
|
+
]
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ g("main", {
|
|
436
|
+
id: C,
|
|
437
|
+
className: "dds-console-main",
|
|
438
|
+
tabIndex: -1,
|
|
439
|
+
children: [/* @__PURE__ */ g("header", {
|
|
440
|
+
className: "dds-console-page-header",
|
|
441
|
+
children: [/* @__PURE__ */ g("div", {
|
|
442
|
+
className: "dds-console-page-header__text",
|
|
443
|
+
children: [l.eyebrow && /* @__PURE__ */ h("p", {
|
|
444
|
+
className: "dds-console-page-eyebrow",
|
|
445
|
+
children: l.eyebrow
|
|
446
|
+
}), /* @__PURE__ */ h("h1", { children: l.title })]
|
|
447
|
+
}), l.actions && /* @__PURE__ */ h("div", {
|
|
448
|
+
className: "dds-console-page-header__actions",
|
|
449
|
+
children: l.actions
|
|
450
|
+
})]
|
|
451
|
+
}), d]
|
|
452
|
+
})
|
|
453
|
+
]
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
//#endregion
|
|
457
|
+
export { u as ArkCheckbox, C as ArkDialog, c as ArkField, b as ArkRadioGroup, f as ArkSwitch, _ as ArkTabs, j as ArkToast, T as ArkTooltip, F as Button, B as Checkbox, ne as ConsoleShell, Y as Dialog, L as Field, Z as Icon, I as IconButton, H as Radio, J as RadioGroup, R as Select, V as Switch, G as Tab, W as TabList, K as TabPanel, U as Tabs, $ as ToastProvider, X as Tooltip, P as classes, ee as useToast };
|
|
458
|
+
|
|
459
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/controls.tsx","../src/selection.tsx","../src/overlays.tsx","../src/icon.tsx","../src/toast.tsx","../src/console-shell.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n type ButtonHTMLAttributes,\n type InputHTMLAttributes,\n type SelectHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Field as ArkField } from \"@ark-ui/react/field\";\nimport { Checkbox as ArkCheckbox } from \"@ark-ui/react/checkbox\";\nimport { Switch as ArkSwitch } from \"@ark-ui/react/switch\";\nexport const classes = (...values: (string | false | undefined)[]) =>\n values.filter(Boolean).join(\" \");\nexport type ButtonTone = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\nexport type ControlSize = \"sm\" | \"md\" | \"lg\";\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n tone?: ButtonTone;\n size?: ControlSize;\n loading?: boolean;\n}\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n tone = \"primary\",\n size = \"md\",\n loading,\n disabled,\n type = \"button\",\n className,\n children,\n ...rest\n },\n ref\n ) {\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={classes(\n \"dds-btn\",\n `dds-btn--${tone}`,\n size !== \"md\" && `dds-btn--${size}`,\n className\n )}\n >\n {loading && <span className=\"dds-spinner\" aria-hidden />}\n {children}\n </button>\n );\n }\n);\nexport interface IconButtonProps extends Omit<ButtonProps, \"tone\"> {\n \"aria-label\": string;\n tone?: \"ghost\" | \"secondary\" | \"danger\";\n}\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n {\n tone = \"ghost\",\n size = \"md\",\n loading,\n disabled,\n type = \"button\",\n className,\n children,\n ...rest\n },\n ref\n ) {\n return (\n <button\n {...rest}\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={classes(\n \"dds-iconbtn\",\n tone !== \"ghost\" && `dds-iconbtn--${tone}`,\n size !== \"md\" && `dds-iconbtn--${size}`,\n className\n )}\n >\n {loading ? <span className=\"dds-spinner\" aria-hidden /> : children}\n </button>\n );\n }\n);\nexport interface FieldControlProps {\n id: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: true;\n \"aria-required\"?: true;\n}\nexport interface FieldProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n label: ReactNode;\n helpText?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n children: ReactNode | ((props: FieldControlProps) => ReactNode);\n}\nexport const Field = forwardRef<HTMLDivElement, FieldProps>(function Field(\n {\n id: requested,\n label,\n helpText,\n error,\n required,\n className,\n children,\n ...rest\n },\n ref\n) {\n const generated = useId();\n const id = requested ?? `dds-field-${generated}`;\n const control: FieldControlProps = {\n id,\n \"aria-describedby\":\n [helpText && `${id}-help`, error && `${id}-error`]\n .filter(Boolean)\n .join(\" \") || undefined,\n \"aria-invalid\": error ? true : undefined,\n \"aria-required\": required ? true : undefined,\n };\n return (\n <ArkField.Root\n {...rest}\n ref={ref}\n invalid={Boolean(error)}\n required={required}\n id={id}\n ids={{\n control: `${id}-root`,\n helperText: `${id}-help`,\n errorText: `${id}-error`,\n }}\n className={classes(\n \"dds-field\",\n Boolean(error) && \"dds-field--error\",\n className\n )}\n >\n <ArkField.Label htmlFor={id} className=\"dds-field__label\">\n {label}\n {required && <span aria-hidden> *</span>}\n </ArkField.Label>\n {typeof children === \"function\" ? children(control) : children}\n {helpText && (\n <ArkField.HelperText className=\"dds-field__help\">\n {helpText}\n </ArkField.HelperText>\n )}\n {error && (\n <ArkField.ErrorText className=\"dds-field__error\" role=\"alert\">\n {error}\n </ArkField.ErrorText>\n )}\n </ArkField.Root>\n );\n});\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n invalid?: boolean;\n wrapperClassName?: string;\n}\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n function Select(\n { invalid, wrapperClassName, className, children, ...rest },\n ref\n ) {\n return (\n <span className={classes(\"dds-select\", wrapperClassName)}>\n <select\n {...rest}\n ref={ref}\n className={classes(\"dds-select__input\", className)}\n aria-invalid={invalid || rest[\"aria-invalid\"]}\n >\n {children}\n </select>\n </span>\n );\n }\n);\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"children\"> {\n label: ReactNode;\n onCheckedChange?: (checked: boolean) => void;\n inputClassName?: string;\n}\nexport type RadioProps = CheckboxProps;\nexport type SwitchProps = CheckboxProps;\nconst Checkable = forwardRef<\n HTMLInputElement,\n CheckboxProps & { kind: \"checkbox\" | \"switch\" }\n>(function Checkable(\n {\n kind,\n label,\n checked,\n defaultChecked,\n onCheckedChange,\n id,\n name,\n value,\n disabled,\n required,\n readOnly,\n form,\n className,\n inputClassName,\n onChange,\n ...rest\n },\n ref\n) {\n const Root = kind === \"switch\" ? ArkSwitch.Root : ArkCheckbox.Root;\n const Label = kind === \"switch\" ? ArkSwitch.Label : ArkCheckbox.Label;\n const Context = kind === \"switch\" ? ArkSwitch.Context : ArkCheckbox.Context;\n const base = kind === \"switch\" ? \"dds-switch\" : \"dds-check\";\n return (\n <Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={(details) => onCheckedChange?.(details.checked === true)}\n ids={id ? { hiddenInput: id } : undefined}\n name={name}\n value={String(value ?? \"on\")}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n form={form}\n className={classes(base, className)}\n >\n <Context>\n {(api) => {\n // DDS styles the actual input. Keep Ark's events and state, but omit\n // its visually hidden style and use React's controlled checked prop\n // so a caller-declined change also restores the native DOM value.\n const {\n style: _,\n defaultChecked: __,\n ...inputProps\n } = api.getHiddenInputProps();\n return (\n <input\n {...inputProps}\n {...rest}\n ref={ref}\n checked={api.checked}\n role={kind === \"switch\" ? \"switch\" : undefined}\n onChange={onChange ?? (() => {})}\n onClick={(event) => {\n rest.onClick?.(event);\n if (!event.defaultPrevented) inputProps.onClick?.(event);\n }}\n className={classes(`${base}__input`, inputClassName)}\n />\n );\n }}\n </Context>\n <Label>{label}</Label>\n </Root>\n );\n});\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (props, ref) => <Checkable {...props} kind=\"checkbox\" ref={ref} />\n);\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n (props, ref) => <Checkable {...props} kind=\"switch\" ref={ref} />\n);\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { label, className, inputClassName, onCheckedChange, onChange, ...rest },\n ref\n) {\n return (\n <label className={classes(\"dds-check\", className)}>\n <input\n {...rest}\n ref={ref}\n type=\"radio\"\n className={classes(\"dds-check__input\", inputClassName)}\n onChange={(event) => {\n onChange?.(event);\n if (!event.defaultPrevented)\n onCheckedChange?.(event.currentTarget.checked);\n }}\n />\n <span>{label}</span>\n </label>\n );\n});\n","import { forwardRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Tabs as ArkTabs, useTabsContext } from \"@ark-ui/react/tabs\";\nimport {\n RadioGroup as ArkRadioGroup,\n useRadioGroupContext,\n} from \"@ark-ui/react/radio-group\";\nimport { classes } from \"./controls\";\nexport interface TabsProps\n extends Omit<ComponentProps<typeof ArkTabs.Root>, \"onValueChange\"> {\n onValueChange?: (value: string) => void;\n unstyled?: boolean;\n}\nexport const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(\n { onValueChange, unstyled, className, ...rest },\n ref\n) {\n return (\n <ArkTabs.Root\n {...rest}\n ref={ref}\n onValueChange={(details) => onValueChange?.(details.value)}\n className={classes(!unstyled && \"dds-tabs-root\", className)}\n />\n );\n});\nexport type TabProps = ComponentProps<typeof ArkTabs.Trigger> & {\n unstyled?: boolean;\n};\nexport type TabPanelProps = ComponentProps<typeof ArkTabs.Content>;\nexport const TabList = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof ArkTabs.List> & { unstyled?: boolean }\n>(function TabList({ unstyled, className, ...rest }, ref) {\n return (\n <ArkTabs.List\n {...rest}\n ref={ref}\n className={classes(!unstyled && \"dds-tabs\", className)}\n />\n );\n});\nexport const Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { unstyled, className, ...rest },\n ref\n) {\n return (\n <ArkTabs.Trigger\n {...rest}\n ref={ref}\n className={classes(!unstyled && \"dds-tab\", className)}\n />\n );\n});\nexport const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(\n function TabPanel({ value, style, ...rest }, ref) {\n const tabs = useTabsContext();\n const inactive = tabs.value !== value;\n return (\n <ArkTabs.Content\n {...rest}\n value={value}\n ref={ref}\n hidden={inactive}\n style={inactive ? { ...style, display: \"none\" } : style}\n />\n );\n }\n);\nfunction VisibleRadioInput({ option }: { option: RadioOption }) {\n const group = useRadioGroupContext();\n // Ark owns selection and roving focus; DDS displays the native radio.\n const {\n style: _,\n defaultChecked: __,\n ...inputProps\n } = group.getItemHiddenInputProps(option);\n return (\n <input\n {...inputProps}\n checked={group.value === option.value}\n onChange={() => {}}\n className=\"dds-check__input\"\n />\n );\n}\nexport interface RadioOption {\n value: string;\n label: ReactNode;\n disabled?: boolean;\n}\nexport interface RadioGroupProps\n extends Omit<\n ComponentProps<typeof ArkRadioGroup.Root>,\n \"onValueChange\" | \"children\"\n > {\n options: readonly RadioOption[];\n label: ReactNode;\n onValueChange?: (value: string) => void;\n children?: ReactNode;\n}\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup(\n { options, label, onValueChange, className, children, ...rest },\n ref\n ) {\n return (\n <ArkRadioGroup.Root\n {...rest}\n ref={ref}\n onValueChange={(details) => {\n if (details.value !== null) onValueChange?.(details.value);\n }}\n className={classes(\"dds-radio-group\", className)}\n >\n <ArkRadioGroup.Label className=\"dds-field__label\">\n {label}\n </ArkRadioGroup.Label>\n {options.map((option) => (\n <ArkRadioGroup.Item\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n className=\"dds-check\"\n >\n <VisibleRadioInput option={option} />\n <ArkRadioGroup.ItemText>{option.label}</ArkRadioGroup.ItemText>\n </ArkRadioGroup.Item>\n ))}\n {children}\n </ArkRadioGroup.Root>\n );\n }\n);\n","import {\n forwardRef,\n type ComponentProps,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Dialog as ArkDialog } from \"@ark-ui/react/dialog\";\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { classes } from \"./controls\";\nexport interface DialogFrameParts {\n title: ReactNode;\n description: ReactNode;\n children: ReactNode;\n actions: ReactNode;\n}\nexport interface DialogProps\n extends Omit<\n ComponentProps<typeof ArkDialog.Root>,\n \"children\" | \"onOpenChange\"\n > {\n title: ReactNode;\n description?: ReactNode;\n children: ReactNode;\n actions?: ReactNode;\n onOpenChange?: (open: boolean) => void;\n closeOnOutside?: boolean;\n portal?: boolean;\n className?: string;\n overlayClassName?: string;\n contentProps?: ComponentProps<typeof ArkDialog.Content>;\n initialFocus?: () => HTMLElement | null | undefined;\n finalFocus?: () => HTMLElement | null | undefined;\n frame?: (parts: DialogFrameParts) => ReactNode;\n unstyled?: boolean;\n}\nexport const Dialog = forwardRef<HTMLDivElement, DialogProps>(function Dialog(\n {\n title,\n description,\n children,\n actions,\n onOpenChange,\n closeOnOutside,\n portal = true,\n className,\n overlayClassName,\n contentProps,\n initialFocus,\n finalFocus,\n frame,\n unstyled,\n ...rest\n },\n ref\n) {\n const parts: DialogFrameParts = {\n title: (\n <ArkDialog.Title className={unstyled ? undefined : \"dds-dialog__title\"}>\n {title}\n </ArkDialog.Title>\n ),\n description: description && (\n <ArkDialog.Description\n className={unstyled ? undefined : \"dds-dialog__body\"}\n >\n {description}\n </ArkDialog.Description>\n ),\n children,\n actions: actions && (\n <div className={unstyled ? undefined : \"dds-dialog__actions\"}>\n {actions}\n </div>\n ),\n };\n const content = (\n <ArkDialog.Positioner\n className={classes(!unstyled && \"dds-dialog-overlay\", overlayClassName)}\n >\n <ArkDialog.Content\n {...contentProps}\n ref={ref}\n aria-describedby={\n description ? contentProps?.[\"aria-describedby\"] : undefined\n }\n className={classes(\n !unstyled && \"dds-dialog\",\n className,\n contentProps?.className\n )}\n >\n {frame ? (\n frame(parts)\n ) : (\n <>\n {parts.title}\n {parts.description}\n {children}\n {parts.actions}\n </>\n )}\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n );\n return (\n <ArkDialog.Root\n {...rest}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n closeOnInteractOutside={closeOnOutside ?? rest.closeOnInteractOutside}\n initialFocusEl={\n initialFocus ? () => initialFocus() ?? null : rest.initialFocusEl\n }\n finalFocusEl={finalFocus ? () => finalFocus() ?? null : rest.finalFocusEl}\n lazyMount\n unmountOnExit\n >\n {portal ? <Portal>{content}</Portal> : content}\n </ArkDialog.Root>\n );\n});\nexport type TooltipTriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;\nexport interface TooltipProps\n extends Omit<\n ComponentProps<typeof ArkTooltip.Root>,\n \"children\" | \"onOpenChange\"\n > {\n content: ReactNode;\n children: ReactNode | ((props: TooltipTriggerProps) => ReactNode);\n onOpenChange?: (open: boolean) => void;\n className?: string;\n contentProps?: ComponentProps<typeof ArkTooltip.Content>;\n}\nexport function Tooltip({\n content,\n children,\n onOpenChange,\n className,\n contentProps,\n ...rest\n}: TooltipProps) {\n return (\n <ArkTooltip.Root\n openDelay={0}\n closeDelay={0}\n {...rest}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n >\n <span className={classes(\"dds-tooltip\", className)}>\n {typeof children === \"function\" ? (\n <ArkTooltip.Context>\n {(api) => children(api.getTriggerProps())}\n </ArkTooltip.Context>\n ) : (\n <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>\n )}\n <Portal>\n <ArkTooltip.Positioner>\n <ArkTooltip.Content\n {...contentProps}\n className={classes(\n \"dds-tooltip__bubble\",\n contentProps?.className\n )}\n >\n {content}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n </Portal>\n </span>\n </ArkTooltip.Root>\n );\n}\n","import { forwardRef, type SVGProps } from \"react\";\nimport { icons, directionPolicy, type DdsIconName } from \"@devslab/dds-icons\";\nimport { classes } from \"./controls\";\nexport interface IconProps\n extends Omit<SVGProps<SVGSVGElement>, \"name\" | \"children\"> {\n name: DdsIconName;\n label?: string;\n size?: number | string;\n directional?: boolean;\n}\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n { name, label, size = 24, directional, className, ...rest },\n ref\n) {\n const icon = icons[name];\n return (\n <svg\n {...rest}\n ref={ref}\n viewBox={icon.viewBox}\n width={size}\n height={size}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={icon.strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={label ? \"img\" : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={classes(\n (directional ?? directionPolicy.mirrorInRtl.includes(name)) &&\n directionPolicy.cssClass,\n className\n )}\n >\n {label && <title>{label}</title>}\n <g dangerouslySetInnerHTML={{ __html: icon.body }} />\n </svg>\n );\n});\n","import {\n createContext,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n type ReactNode,\n} from \"react\";\nimport { Toast as ArkToast, Toaster, createToaster } from \"@ark-ui/react/toast\";\nimport { classes } from \"./controls\";\nexport type ToastTone = \"success\" | \"warning\" | \"danger\" | \"info\";\nexport interface ToastInput {\n message: ReactNode;\n tone?: ToastTone;\n duration?: number;\n}\nexport interface ToastRecord extends ToastInput {\n id: string;\n}\nexport interface ToastApi {\n show: (toast: ToastInput) => string;\n dismiss: (id: string) => void;\n clear: () => void;\n}\nexport interface ToastProviderProps {\n children: ReactNode;\n defaultDuration?: number;\n dismissLabel?: string | ((toast: ToastRecord) => string);\n regionLabel?: string;\n className?: string;\n}\nconst ToastContext = createContext<ToastApi | null>(null);\nexport function ToastProvider({\n children,\n defaultDuration = 5000,\n dismissLabel,\n regionLabel,\n className,\n}: ToastProviderProps) {\n const prefix = useId();\n const sequence = useRef(0);\n const toaster = useMemo(\n () =>\n createToaster({\n placement: \"bottom-end\",\n overlap: false,\n gap: 8,\n offsets: \"var(--dds-space-16)\",\n removeDelay: 0,\n hotkey: [\"DDS_NO_HOTKEY\"],\n }),\n []\n );\n const api = useMemo<ToastApi>(() => {\n return {\n show(input) {\n const id = `dds-toast-${prefix}-${++sequence.current}`;\n const duration = input.duration ?? defaultDuration;\n toaster.create({\n id,\n description: input.message,\n type: input.tone === \"danger\" ? \"error\" : input.tone ?? \"info\",\n duration: duration > 0 ? duration : Infinity,\n meta: { dds: { ...input, id } },\n });\n return id;\n },\n dismiss: (id) => toaster.remove(id),\n clear: () => toaster.remove(),\n };\n }, [toaster, prefix, defaultDuration]);\n useEffect(() => () => toaster.remove(), [toaster]);\n return (\n <ToastContext.Provider value={api}>\n {children}\n <Toaster\n toaster={toaster}\n label={regionLabel ?? \"\"}\n aria-label={regionLabel ?? \"\"}\n role={regionLabel ? \"region\" : \"presentation\"}\n className={classes(\"dds-toast-region\", className)}\n >\n {(toast) => {\n const record = toast.meta?.dds as ToastRecord;\n return (\n <ArkToast.Root\n className={classes(\n \"dds-toast\",\n `dds-toast--${record.tone ?? \"info\"}`\n )}\n role={record.tone === \"danger\" ? \"alert\" : \"status\"}\n >\n <ArkToast.Description>{toast.description}</ArkToast.Description>\n {dismissLabel && (\n <ArkToast.CloseTrigger\n className=\"dds-iconbtn dds-iconbtn--sm\"\n aria-label={\n typeof dismissLabel === \"function\"\n ? dismissLabel(record)\n : dismissLabel\n }\n >\n ×\n </ArkToast.CloseTrigger>\n )}\n </ArkToast.Root>\n );\n }}\n </Toaster>\n </ToastContext.Provider>\n );\n}\nexport function useToast(): ToastApi {\n const api = useContext(ToastContext);\n if (!api) throw new Error(\"useToast must be called inside <ToastProvider>\");\n return api;\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { classes } from \"./controls\";\nexport interface ConsoleNavItem {\n id: string;\n href: string;\n label: string;\n badge?: number;\n active?: boolean;\n}\nexport interface ConsoleNavGroup {\n label: string;\n items: readonly ConsoleNavItem[];\n}\nexport interface ConsoleShellLabels {\n skip: string;\n menuOpen: string;\n menuClose: string;\n nav: string;\n badge: string;\n}\nexport interface ConsoleHeader {\n eyebrow?: string;\n title: string;\n actions?: ReactNode;\n}\nexport interface ConsoleShellProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"children\" | \"context\"> {\n surface: string;\n activePath: string;\n brand: { href: string; name: string; mark: string };\n context?: readonly { label: string; value: string }[];\n nav: readonly ConsoleNavGroup[];\n labels: ConsoleShellLabels;\n header: ConsoleHeader;\n foot?: ReactNode;\n children: ReactNode;\n}\nfunction isActive(path: string, item: ConsoleNavItem) {\n return (\n item.active ??\n (item.href.split(\"/\").filter(Boolean).length <= 1\n ? path === item.href\n : path === item.href || path.startsWith(`${item.href}/`))\n );\n}\nexport const ConsoleShell = forwardRef<HTMLDivElement, ConsoleShellProps>(\n function ConsoleShell(\n {\n surface,\n activePath,\n brand,\n context,\n nav,\n labels,\n header,\n foot,\n children,\n className,\n ...rest\n },\n ref\n ) {\n const [open, setOpen] = useState(false);\n const [hydrated, setHydrated] = useState(false);\n const id = useId();\n const railId = `dds-console-rail-${id}`;\n const mainId = `dds-console-main-${id}`;\n useEffect(() => {\n setHydrated(true);\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") setOpen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, []);\n return (\n <div\n {...rest}\n ref={ref}\n className={classes(\"dds-console-shell\", className)}\n data-surface={surface}\n data-hydrated={hydrated ? \"true\" : undefined}\n >\n <a className=\"dds-console-skip dds-visually-hidden\" href={`#${mainId}`}>\n {labels.skip}\n </a>\n <button\n className=\"dds-console-rail__toggle\"\n type=\"button\"\n data-action=\"toggle-rail\"\n aria-controls={railId}\n aria-expanded={open}\n onClick={() => setOpen(!open)}\n >\n <span aria-hidden />\n <span className=\"dds-visually-hidden\">\n {open ? labels.menuClose : labels.menuOpen}\n </span>\n </button>\n <div\n className=\"dds-console-rail__scrim\"\n data-open={String(open)}\n onClick={() => setOpen(false)}\n />\n <aside\n id={railId}\n className=\"dds-console-rail\"\n data-open={String(open)}\n >\n <a className=\"dds-console-rail__brand\" href={brand.href}>\n <img src={brand.mark} alt=\"\" width={20} height={20} />\n <strong>{brand.name}</strong>\n </a>\n {context && context.length > 0 && (\n <dl className=\"dds-console-rail__context\">\n {context.map((row, index) => (\n <div key={index}>\n <dt>{row.label}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n )}\n <nav className=\"dds-console-rail__nav\" aria-label={labels.nav}>\n {nav.map((group, index) => (\n <section\n key={index}\n className=\"dds-console-rail__group\"\n aria-labelledby={`${id}-group-${index}`}\n >\n <h2\n id={`${id}-group-${index}`}\n className=\"dds-console-rail__group-label\"\n >\n {group.label}\n </h2>\n <ul>\n {group.items.map((item) => (\n <li key={item.id}>\n <a\n className=\"dds-console-rail__item\"\n data-nav={`${surface}.${item.id}`}\n href={item.href}\n aria-current={\n isActive(activePath, item) ? \"page\" : undefined\n }\n onClick={() => setOpen(false)}\n >\n <span>{item.label}</span>\n {item.badge !== undefined && item.badge > 0 && (\n <span\n className=\"dds-console-rail__badge\"\n aria-label={labels.badge.replace(\"{count}\", () =>\n String(item.badge)\n )}\n >\n {item.badge}\n </span>\n )}\n </a>\n </li>\n ))}\n </ul>\n </section>\n ))}\n </nav>\n {foot && <div className=\"dds-console-rail__foot\">{foot}</div>}\n </aside>\n <main id={mainId} className=\"dds-console-main\" tabIndex={-1}>\n <header className=\"dds-console-page-header\">\n <div className=\"dds-console-page-header__text\">\n {header.eyebrow && (\n <p className=\"dds-console-page-eyebrow\">{header.eyebrow}</p>\n )}\n <h1>{header.title}</h1>\n </div>\n {header.actions && (\n <div className=\"dds-console-page-header__actions\">\n {header.actions}\n </div>\n )}\n </header>\n {children}\n </main>\n </div>\n );\n }\n);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,KAAW,GAAG,MACzB,EAAO,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,GAQpB,IAAS,EACpB,SACE,EACE,UAAO,WACP,UAAO,MACP,YACA,aACA,UAAO,UACP,cACA,aACA,GAAG,KAEL,GACA;CACA,OACE,kBAAC,UAAD;EACE,GAAI;EACC;EACC;EACN,UAAU,KAAY;EACtB,aAAW,KAAW,KAAA;EACtB,WAAW,EACT,WACA,YAAY,KACZ,MAAS,QAAQ,YAAY,KAC7B,CACF;EAXF,UAAA,CAaG,KAAW,kBAAC,QAAD;GAAM,WAAU;GAAc,eAAA;EAAa,CAAA,GACtD,CACK;;AAEZ,CACF,GAKa,IAAa,EACxB,SACE,EACE,UAAO,SACP,UAAO,MACP,YACA,aACA,UAAO,UACP,cACA,aACA,GAAG,KAEL,GACA;CACA,OACE,kBAAC,UAAD;EACE,GAAI;EACC;EACC;EACN,UAAU,KAAY;EACtB,aAAW,KAAW,KAAA;EACtB,WAAW,EACT,eACA,MAAS,WAAW,gBAAgB,KACpC,MAAS,QAAQ,gBAAgB,KACjC,CACF;EAEC,UAAA,IAAU,kBAAC,QAAD;GA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
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ComponentProps, type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { Dialog as ArkDialog } from "@ark-ui/react/dialog";
|
|
3
|
+
import { Tooltip as ArkTooltip } from "@ark-ui/react/tooltip";
|
|
4
|
+
export interface DialogFrameParts {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
actions: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface DialogProps extends Omit<ComponentProps<typeof ArkDialog.Root>, "children" | "onOpenChange"> {
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
16
|
+
closeOnOutside?: boolean;
|
|
17
|
+
portal?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
overlayClassName?: string;
|
|
20
|
+
contentProps?: ComponentProps<typeof ArkDialog.Content>;
|
|
21
|
+
initialFocus?: () => HTMLElement | null | undefined;
|
|
22
|
+
finalFocus?: () => HTMLElement | null | undefined;
|
|
23
|
+
frame?: (parts: DialogFrameParts) => ReactNode;
|
|
24
|
+
unstyled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export type TooltipTriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
28
|
+
export interface TooltipProps extends Omit<ComponentProps<typeof ArkTooltip.Root>, "children" | "onOpenChange"> {
|
|
29
|
+
content: ReactNode;
|
|
30
|
+
children: ReactNode | ((props: TooltipTriggerProps) => ReactNode);
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
32
|
+
className?: string;
|
|
33
|
+
contentProps?: ComponentProps<typeof ArkTooltip.Content>;
|
|
34
|
+
}
|
|
35
|
+
export declare function Tooltip({ content, children, onOpenChange, className, contentProps, ...rest }: TooltipProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=overlays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../src/overlays.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG9D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,SAAS,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;CACpB;AACD,MAAM,WAAW,WACf,SAAQ,IAAI,CACV,cAAc,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,EACrC,UAAU,GAAG,cAAc,CAC5B;IACD,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,eAAO,MAAM,MAAM,wGAoFjB,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAC1E,MAAM,WAAW,YACf,SAAQ,IAAI,CACV,cAAc,CAAC,OAAO,UAAU,CAAC,IAAI,CAAC,EACtC,UAAU,GAAG,cAAc,CAC5B;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC,CAAC;IAClE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,cAAc,CAAC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;CAC1D;AACD,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,YAAY,+BAgCd"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { Tabs as ArkTabs } from "@ark-ui/react/tabs";
|
|
3
|
+
import { RadioGroup as ArkRadioGroup } from "@ark-ui/react/radio-group";
|
|
4
|
+
export interface TabsProps extends Omit<ComponentProps<typeof ArkTabs.Root>, "onValueChange"> {
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
unstyled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<TabsProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export type TabProps = ComponentProps<typeof ArkTabs.Trigger> & {
|
|
10
|
+
unstyled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TabPanelProps = ComponentProps<typeof ArkTabs.Content>;
|
|
13
|
+
export declare const TabList: import("react").ForwardRefExoticComponent<Omit<ArkTabs.ListProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
14
|
+
unstyled?: boolean;
|
|
15
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const Tab: import("react").ForwardRefExoticComponent<Omit<TabProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const TabPanel: import("react").ForwardRefExoticComponent<Omit<ArkTabs.ContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export interface RadioOption {
|
|
19
|
+
value: string;
|
|
20
|
+
label: ReactNode;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface RadioGroupProps extends Omit<ComponentProps<typeof ArkRadioGroup.Root>, "onValueChange" | "children"> {
|
|
24
|
+
options: readonly RadioOption[];
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
onValueChange?: (value: string) => void;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<Omit<RadioGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkB,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,UAAU,IAAI,aAAa,EAE5B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;IAClE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,eAAO,MAAM,IAAI,mHAYf,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AACnE,eAAO,MAAM,OAAO;eAEiC,OAAO;0DAS1D,CAAC;AACH,eAAO,MAAM,GAAG,qHAWd,CAAC;AACH,eAAO,MAAM,QAAQ,8KAcpB,CAAC;AAkBF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,EACzC,eAAe,GAAG,UAAU,CAC7B;IACD,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AACD,eAAO,MAAM,UAAU,yHAgCtB,CAAC"}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type ToastTone = "success" | "warning" | "danger" | "info";
|
|
3
|
+
export interface ToastInput {
|
|
4
|
+
message: ReactNode;
|
|
5
|
+
tone?: ToastTone;
|
|
6
|
+
duration?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastRecord extends ToastInput {
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ToastApi {
|
|
12
|
+
show: (toast: ToastInput) => string;
|
|
13
|
+
dismiss: (id: string) => void;
|
|
14
|
+
clear: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface ToastProviderProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
defaultDuration?: number;
|
|
19
|
+
dismissLabel?: string | ((toast: ToastRecord) => string);
|
|
20
|
+
regionLabel?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function ToastProvider({ children, defaultDuration, dismissLabel, regionLabel, className, }: ToastProviderProps): import("react").JSX.Element;
|
|
24
|
+
export declare function useToast(): ToastApi;
|
|
25
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../src/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAClE,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,EAAE,EAAE,MAAM,CAAC;CACZ;AACD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;IACpC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AACD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,eAAsB,EACtB,YAAY,EACZ,WAAW,EACX,SAAS,GACV,EAAE,kBAAkB,+BAyEpB;AACD,wBAAgB,QAAQ,IAAI,QAAQ,CAInC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devslab/dds-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.20.0",
|
|
4
|
+
"description": "Accessible React primitives for the DevsLab Design System",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./styles.css"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/devslab-kr/dds.git",
|
|
13
|
+
"directory": "packages/dds-react"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://devslab.kr/brand/",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/devslab-kr/dds/issues"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"registry": "https://registry.npmjs.org",
|
|
21
|
+
"access": "public",
|
|
22
|
+
"provenance": true
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"styles.css",
|
|
27
|
+
"README.md",
|
|
28
|
+
"README.ko.md"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./styles.css": "./styles.css"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@ark-ui/react": "5.39.3",
|
|
42
|
+
"@devslab/dds-css": "0.20.0",
|
|
43
|
+
"@devslab/dds-icons": "0.20.0",
|
|
44
|
+
"@devslab/dds-tokens": "0.20.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
48
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"react": "19.3.0",
|
|
52
|
+
"react-dom": "19.3.0",
|
|
53
|
+
"@types/react": "^19.0.0",
|
|
54
|
+
"@types/react-dom": "^19.0.0",
|
|
55
|
+
"@testing-library/react": "16.3.2",
|
|
56
|
+
"@testing-library/user-event": "14.6.1",
|
|
57
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
58
|
+
"@types/node": "26.3.0",
|
|
59
|
+
"axe-core": "4.13.0",
|
|
60
|
+
"jsdom": "30.0.1",
|
|
61
|
+
"typescript": "7.0.2",
|
|
62
|
+
"vite": "8.2.1",
|
|
63
|
+
"vitest": "4.1.1"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"react",
|
|
67
|
+
"components",
|
|
68
|
+
"accessibility",
|
|
69
|
+
"design-system",
|
|
70
|
+
"devslab"
|
|
71
|
+
],
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
74
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
75
|
+
"test": "vitest run && vitest run --config vitest.ssr.config.ts",
|
|
76
|
+
"test:a11y": "vitest run src/__tests__/a11y.test.tsx"
|
|
77
|
+
}
|
|
6
78
|
}
|
package/styles.css
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "@devslab/dds-tokens/tokens.css";
|
|
2
|
+
@import "@devslab/dds-css/dds.css";
|
|
3
|
+
|
|
4
|
+
/* Keep the former context-only Tabs layout while Ark owns its DOM contract. */
|
|
5
|
+
.dds-tabs-root {
|
|
6
|
+
display: contents;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Ark positions the wrapper; DDS continues to own the bubble appearance. */
|
|
10
|
+
.dds-tooltip__bubble[data-scope="tooltip"] {
|
|
11
|
+
position: relative;
|
|
12
|
+
inset: auto;
|
|
13
|
+
transform: none;
|
|
14
|
+
opacity: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dds-toast[data-scope="toast"] {
|
|
18
|
+
transform: translate(var(--x), var(--y));
|
|
19
|
+
opacity: var(--opacity);
|
|
20
|
+
}
|