@ensi-platform/admin-ui 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Component-DrdEP1wD.js → Component-B3Iscpfx.js} +3 -3
- package/dist/{Component-DrdEP1wD.js.map → Component-B3Iscpfx.js.map} +1 -1
- package/dist/{Component-_PP1i9V1.js → Component-Bs-kDKZf.js} +3 -3
- package/dist/{Component-_PP1i9V1.js.map → Component-Bs-kDKZf.js.map} +1 -1
- package/dist/{Component--pn4mDeS.js → Component-Q_eH0Y9C.js} +2 -2
- package/dist/{Component--pn4mDeS.js.map → Component-Q_eH0Y9C.js.map} +1 -1
- package/dist/{Component-COgt_U9z.js → Component-jpe2PT8K.js} +3 -3
- package/dist/{Component-COgt_U9z.js.map → Component-jpe2PT8K.js.map} +1 -1
- package/dist/active-filters/index.js +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -0
- package/dist/assets/index9.css +1 -1
- package/dist/autocomplete/index.js +1 -1
- package/dist/autocomplete-async/index.js +2 -2
- package/dist/bottom-sheet/index.js +1 -1
- package/dist/cascade-menu/index.js +1 -1
- package/dist/color-field/index.js +22 -22
- package/dist/color-field/index.js.map +1 -1
- package/dist/combobox/components/MultiTrigger/index.d.ts.map +1 -1
- package/dist/combobox/components/Trigger/index.d.ts.map +1 -1
- package/dist/combobox/index.js +3 -3
- package/dist/data-table/index.js +2 -2
- package/dist/date-picker/Component.d.ts.map +1 -1
- package/dist/date-picker/index.js +142 -134
- package/dist/date-picker/index.js.map +1 -1
- package/dist/date-range-picker/Component.d.ts.map +1 -1
- package/dist/date-range-picker/index.js +150 -142
- package/dist/date-range-picker/index.js.map +1 -1
- package/dist/dropzone/index.js +1 -1
- package/dist/filters/index.js +1 -1
- package/dist/flex-layout/Component.d.ts +1 -1
- package/dist/flex-layout/Component.d.ts.map +1 -1
- package/dist/flex-layout/index.js +60 -52
- package/dist/flex-layout/index.js.map +1 -1
- package/dist/flex-layout/types.d.ts +10 -1
- package/dist/flex-layout/types.d.ts.map +1 -1
- package/dist/grid-layout/Component.d.ts +1 -1
- package/dist/grid-layout/Component.d.ts.map +1 -1
- package/dist/grid-layout/index.js +57 -53
- package/dist/grid-layout/index.js.map +1 -1
- package/dist/grid-layout/types.d.ts +6 -0
- package/dist/grid-layout/types.d.ts.map +1 -1
- package/dist/index-CoyesAvE.js +275 -0
- package/dist/index-CoyesAvE.js.map +1 -0
- package/dist/{index-o14ps46j.js → index-DbaGX3oz.js} +2 -2
- package/dist/{index-o14ps46j.js.map → index-DbaGX3oz.js.map} +1 -1
- package/dist/index-DtpMocgp.js +106 -0
- package/dist/index-DtpMocgp.js.map +1 -0
- package/dist/multi-autocomplete/index.js +1 -1
- package/dist/multi-autocomplete-async/index.js +1 -1
- package/dist/multi-select/index.js +2 -2
- package/dist/rating/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/time-field/Component.d.ts.map +1 -1
- package/dist/time-field/index.js +87 -79
- package/dist/time-field/index.js.map +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/tree/Component.d.ts +5 -0
- package/dist/tree/Component.d.ts.map +1 -0
- package/dist/tree/components/Item/index.d.ts +11 -0
- package/dist/tree/components/Item/index.d.ts.map +1 -0
- package/dist/tree/index.d.ts +3 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/index.js +84 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/types.d.ts +51 -0
- package/dist/tree/types.d.ts.map +1 -0
- package/dist/tree/utils.d.ts +7 -0
- package/dist/tree/utils.d.ts.map +1 -0
- package/dist/typography/index.js +1 -1
- package/dist/{utils-Dfp1NDWx.js → utils-C3l0oYwN.js} +8 -8
- package/dist/utils-C3l0oYwN.js.map +1 -0
- package/dist/vertical-tabs/index.js +1 -1
- package/package.json +5 -1
- package/src/color-field/docs/cssVariables.ts +8 -2
- package/src/date-picker/docs/cssVariables.ts +4 -0
- package/src/date-range-picker/docs/cssVariables.ts +4 -0
- package/src/flex-layout/docs/Description.md +3 -1
- package/src/flex-layout/types.ts +11 -1
- package/src/grid-layout/docs/Description.md +3 -1
- package/src/grid-layout/types.ts +6 -0
- package/src/time-field/docs/cssVariables.ts +4 -0
- package/src/tree/docs/Description.md +29 -0
- package/src/tree/docs/Example.md +15 -0
- package/src/tree/docs/cssVariables.ts +16 -0
- package/src/tree/types.ts +56 -0
- package/dist/index-CYUeRS10.js +0 -262
- package/dist/index-CYUeRS10.js.map +0 -1
- package/dist/index-Rx06m88a.js +0 -101
- package/dist/index-Rx06m88a.js.map +0 -1
- package/dist/utils-Dfp1NDWx.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { Key, Selection } from 'react-aria-components';
|
|
3
|
+
import { IDataTestIdProps } from '../ds/common/index.js';
|
|
4
|
+
/** One node. Omit `children` or pass an empty list for a leaf. */
|
|
5
|
+
export interface ITreeItem {
|
|
6
|
+
/** Node key. */
|
|
7
|
+
id: string | number;
|
|
8
|
+
/** Visible label. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Nested nodes. */
|
|
11
|
+
children?: ITreeItem[];
|
|
12
|
+
/** Blocks selection and expansion of this node. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Selection mode. */
|
|
16
|
+
export type TTreeSelectionMode = 'none' | 'single' | 'multiple';
|
|
17
|
+
/** Selection and expansion state. */
|
|
18
|
+
export interface ITreeControlProps {
|
|
19
|
+
/** Selection mode. */
|
|
20
|
+
selectionMode?: TTreeSelectionMode;
|
|
21
|
+
/** Controlled selection. An empty set means nothing is selected. */
|
|
22
|
+
selectedKeys?: Selection;
|
|
23
|
+
/** Uncontrolled initial selection. */
|
|
24
|
+
defaultSelectedKeys?: Selection;
|
|
25
|
+
/** Selection change handler. */
|
|
26
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
27
|
+
/** Controlled expanded branches. */
|
|
28
|
+
expandedKeys?: Iterable<Key>;
|
|
29
|
+
/** Uncontrolled initial expanded branches. */
|
|
30
|
+
defaultExpandedKeys?: Iterable<Key>;
|
|
31
|
+
/** Expanded branches change handler. */
|
|
32
|
+
onExpandedChange?: (keys: Set<Key>) => void;
|
|
33
|
+
/** Blocks selection and expansion for every node. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** Keeps the current selection. Expansion still works. */
|
|
36
|
+
readOnly?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** Own / chrome props (not from RAC). */
|
|
39
|
+
export interface ITreeOwnProps extends IDataTestIdProps {
|
|
40
|
+
/** Nodes. */
|
|
41
|
+
items: ITreeItem[];
|
|
42
|
+
/** Accessible name. The tree has no visible caption. */
|
|
43
|
+
'aria-label': string;
|
|
44
|
+
/** Root class name. */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Ref to the tree root (React 19 prop). */
|
|
47
|
+
ref?: Ref<HTMLDivElement>;
|
|
48
|
+
}
|
|
49
|
+
export interface ITreeProps extends ITreeControlProps, ITreeOwnProps {
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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AyC;AACzC,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACnD,aAAa;IACb,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,UAAW,SAAQ,iBAAiB,EAAE,aAAa;CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Key } from 'react-aria-components';
|
|
2
|
+
import { ITreeItem } from './types';
|
|
3
|
+
/** Every node id. */
|
|
4
|
+
export declare const collectTreeKeys: (items: readonly ITreeItem[]) => Key[];
|
|
5
|
+
/** Ids of nodes marked `disabled`. */
|
|
6
|
+
export declare const collectDisabledKeys: (items: readonly ITreeItem[]) => Key[];
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tree/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAWzC,qBAAqB;AACrB,eAAO,MAAM,eAAe,GAAI,OAAO,SAAS,SAAS,EAAE,UAAiC,CAAC;AAE7F,sCAAsC;AACtC,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,SAAS,EAAE,UAAqD,CAAC"}
|
package/dist/typography/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../assets/
|
|
1
|
+
import '../assets/index36.css';const o = "aub_styles-module_bodyXs_863df", d = "aub_styles-module_bodyS_94552", s = "aub_styles-module_bodySTight_67dbf", b = "aub_styles-module_bodyM_10045", y = "aub_styles-module_bodyL_f2885", e = "aub_styles-module_headingM_1babc", t = "aub_styles-module_headingL_09557", _ = {
|
|
2
2
|
bodyXs: o,
|
|
3
3
|
bodyS: d,
|
|
4
4
|
bodySTight: s,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as f, Fragment as P, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as d } from "react";
|
|
3
|
-
import { Popover as k, Virtualizer as A, ListLayout as w, ListBox as K, Collection as j, ListBoxItem as O, ListBoxLoadMoreItem as T, SelectStateContext as v, ComboBoxStateContext as
|
|
4
|
-
import { u as
|
|
3
|
+
import { Popover as k, Virtualizer as A, ListLayout as w, ListBox as K, Collection as j, ListBoxItem as O, ListBoxLoadMoreItem as T, SelectStateContext as v, ComboBoxStateContext as N } from "react-aria-components";
|
|
4
|
+
import { u as S } from "./hooks-BSSTu-2y.js";
|
|
5
5
|
import { C as H } from "./Check-deng4Zns.js";
|
|
6
6
|
import { u as q, C as D } from "./metrics-D4vChkd-.js";
|
|
7
7
|
import { cva as b } from "class-variance-authority";
|
|
@@ -48,7 +48,7 @@ const E = "aub_styles-module_root_11502", tt = "aub_styles-module_primary_baf0d"
|
|
|
48
48
|
defaultVariants: {
|
|
49
49
|
variant: "primary"
|
|
50
50
|
}
|
|
51
|
-
}), $ = ({ triggerRef: t, variant: o, children: s }) => /* @__PURE__ */ l(k, { triggerRef: t, className: et({ variant: o }), offset: 4, children: s });
|
|
51
|
+
}), $ = ({ triggerRef: t, variant: o, children: s }) => /* @__PURE__ */ l(k, { triggerRef: t, className: et({ variant: o }), offset: 4, isNonModal: !0, children: s });
|
|
52
52
|
$.displayName = "ComboboxPopover";
|
|
53
53
|
const ot = "aub_styles-module_root_1bdaf", st = "aub_styles-module_sm_d9011", lt = "aub_styles-module_md_78271", at = "aub_styles-module_lg_3795f", rt = "aub_styles-module_more_e8c1a", u = {
|
|
54
54
|
root: ot,
|
|
@@ -68,7 +68,7 @@ const ot = "aub_styles-module_root_1bdaf", st = "aub_styles-module_sm_d9011", lt
|
|
|
68
68
|
size: "md"
|
|
69
69
|
}
|
|
70
70
|
}), mt = () => {
|
|
71
|
-
const { loadingSuggestions: t } =
|
|
71
|
+
const { loadingSuggestions: t } = S();
|
|
72
72
|
return /* @__PURE__ */ l("span", { className: u.more, role: "status", children: t });
|
|
73
73
|
}, ut = ({
|
|
74
74
|
triggerRef: t,
|
|
@@ -124,7 +124,7 @@ const ct = "aub_styles-module_root_0e5b7", it = "aub_styles-module_clear_260ce",
|
|
|
124
124
|
variant: "primary"
|
|
125
125
|
}
|
|
126
126
|
}), c = ({ isDisabled: t, size: o, variant: s, onClear: e }) => {
|
|
127
|
-
const { clear: a } =
|
|
127
|
+
const { clear: a } = S();
|
|
128
128
|
return /* @__PURE__ */ l(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
@@ -174,7 +174,7 @@ const Ct = ({ isDisabled: t, size: o, variant: s }) => {
|
|
|
174
174
|
};
|
|
175
175
|
Ct.displayName = "FieldMultiSelectClearButton";
|
|
176
176
|
const xt = ({ isDisabled: t, size: o, variant: s }) => {
|
|
177
|
-
const e = d(
|
|
177
|
+
const e = d(N), a = e?.value;
|
|
178
178
|
return !e || a == null || a === "" || t ? null : /* @__PURE__ */ l(
|
|
179
179
|
c,
|
|
180
180
|
{
|
|
@@ -189,7 +189,7 @@ const xt = ({ isDisabled: t, size: o, variant: s }) => {
|
|
|
189
189
|
};
|
|
190
190
|
xt.displayName = "FieldComboBoxClearButton";
|
|
191
191
|
const gt = ({ isDisabled: t, size: o, variant: s }) => {
|
|
192
|
-
const e = d(
|
|
192
|
+
const e = d(N);
|
|
193
193
|
return !e || F(e.value) || t ? null : /* @__PURE__ */ l(
|
|
194
194
|
c,
|
|
195
195
|
{
|
|
@@ -220,4 +220,4 @@ export {
|
|
|
220
220
|
Mt as r,
|
|
221
221
|
Pt as t
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=utils-
|
|
223
|
+
//# sourceMappingURL=utils-C3l0oYwN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-C3l0oYwN.js","sources":["../src/combobox/components/Item/theme.ts","../src/combobox/components/Item/index.tsx","../src/combobox/components/Popover/theme.ts","../src/combobox/components/Popover/index.tsx","../src/combobox/components/List/theme.ts","../src/combobox/components/List/index.tsx","../src/field-clear-button/theme.ts","../src/field-clear-button/Component.tsx","../src/field-clear-button/adapters.tsx","../src/combobox/utils.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const comboboxItemVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n },\n});\n","import { Check } from '@/icons';\n\nimport styles from './styles.module.css';\n\nexport { comboboxItemVariants } from './theme';\n\nexport interface IComboboxItemContentProps {\n label: string;\n}\n\nexport const ComboboxItemContent = ({ label }: IComboboxItemContentProps) => (\n <>\n <span className={styles.label}>{label}</span>\n <Check className={styles.check} />\n </>\n);\n\nComboboxItemContent.displayName = 'ComboboxItemContent';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const comboboxPopoverVariants = cva(styles.root, {\n variants: {\n variant: {\n primary: styles.primary,\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n});\n","import { type ReactNode, type RefObject } from 'react';\n\nimport { Popover as RacPopover } from 'react-aria-components';\n\nimport { type TComboboxVariant } from '../../types';\n\nimport { comboboxPopoverVariants } from './theme';\n\nexport interface IComboboxPopoverProps {\n triggerRef: RefObject<HTMLElement | null>;\n variant: TComboboxVariant;\n children: ReactNode;\n}\n\nexport const ComboboxPopover = ({ triggerRef, variant, children }: IComboboxPopoverProps) => (\n <RacPopover triggerRef={triggerRef} className={comboboxPopoverVariants({ variant })} offset={4} isNonModal>\n {children}\n </RacPopover>\n);\n\nComboboxPopover.displayName = 'ComboboxPopover';\n","import { cva } from 'class-variance-authority';\nimport cn from 'classnames';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const comboboxListBoxVariants = cva(styles.root, {\n variants: {\n size: {\n sm: cn(styles.sm, typographyStyles.bodyS),\n md: cn(styles.md, typographyStyles.bodyM),\n lg: cn(styles.lg, typographyStyles.bodyL),\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import { type RefObject } from 'react';\n\nimport { Collection, ListBox, ListBoxItem, ListBoxLoadMoreItem, ListLayout, Virtualizer } from 'react-aria-components';\n\nimport { useAuiLabels } from '@/provider';\n\nimport { type IComboboxOption, type TComboboxSize, type TComboboxVariant } from '../../types';\nimport { ComboboxItemContent, comboboxItemVariants } from '../Item';\nimport { ComboboxListStatus } from '../ListStatus';\nimport { ComboboxPopover } from '../Popover';\n\nimport { useComboboxListMetrics } from './metrics';\nimport { comboboxListBoxVariants } from './theme';\n\nimport styles from './styles.module.css';\n\nconst LoadMoreStatus = () => {\n const { loadingSuggestions } = useAuiLabels();\n\n return (\n <span className={styles.more} role=\"status\">\n {loadingSuggestions}\n </span>\n );\n};\n\nexport interface IComboboxListProps {\n triggerRef: RefObject<HTMLElement | null>;\n options: IComboboxOption[];\n size: TComboboxSize;\n variant: TComboboxVariant;\n isLoading?: boolean;\n isError?: boolean;\n /** When true, empty options show ListStatus empty chrome (autocomplete). */\n showEmptyStatus?: boolean;\n /** Further pages exist. Renders a sentinel at the end of the virtual list. */\n hasMore?: boolean;\n /** Fetch the next page. Called when the sentinel nears the viewport. */\n onLoadMore?: () => void;\n /** True while a later page is loading. Keeps already shown options. */\n isLoadingMore?: boolean;\n}\n\nexport const ComboboxList = ({\n triggerRef,\n options,\n size,\n variant,\n isLoading = false,\n isError = false,\n showEmptyStatus = false,\n hasMore = false,\n onLoadMore,\n isLoadingMore = false,\n}: IComboboxListProps) => {\n const { rowSize, padding } = useComboboxListMetrics(size);\n const showStatus = isLoading || (isError && options.length === 0) || (showEmptyStatus && options.length === 0);\n const showItems = !isLoading && !(isError && options.length === 0) && (!showEmptyStatus || options.length > 0);\n const showMore = showItems && (hasMore || isLoadingMore) && onLoadMore != null;\n\n return (\n <ComboboxPopover triggerRef={triggerRef} variant={variant}>\n {showStatus ? (\n <ComboboxListStatus isLoading={isLoading} isError={isError} isEmpty={!isLoading && !isError} />\n ) : null}\n {showItems ? (\n <Virtualizer layout={ListLayout} layoutOptions={{ rowSize, padding, loaderSize: rowSize }}>\n <ListBox className={comboboxListBoxVariants({ size })}>\n <Collection items={options}>\n {(item: IComboboxOption) => (\n <ListBoxItem\n id={item.value}\n textValue={item.label}\n isDisabled={item.disabled}\n className={comboboxItemVariants({ size, variant })}\n >\n <ComboboxItemContent label={item.label} />\n </ListBoxItem>\n )}\n </Collection>\n {showMore ? (\n <ListBoxLoadMoreItem isLoading={isLoadingMore} onLoadMore={onLoadMore}>\n {isLoadingMore ? <LoadMoreStatus /> : null}\n </ListBoxLoadMoreItem>\n ) : null}\n </ListBox>\n </Virtualizer>\n ) : null}\n </ComboboxPopover>\n );\n};\n\nComboboxList.displayName = 'ComboboxList';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const fieldClearVariants = cva(styles.clear, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n },\n});\n","import { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { fieldClearVariants } from './theme';\nimport { type IFieldClearButtonProps } from './types';\n\nimport styles from './styles.module.css';\n\n/** Presentational clear button for field triggers. */\nexport const FieldClearButton = ({ isDisabled, size, variant, onClear }: IFieldClearButtonProps) => {\n const { clear } = useAuiLabels();\n\n return (\n <button\n type=\"button\"\n className={fieldClearVariants({ size, variant })}\n aria-label={clear}\n disabled={isDisabled}\n onPointerDown={event => {\n event.preventDefault();\n event.stopPropagation();\n }}\n onClick={event => {\n event.preventDefault();\n event.stopPropagation();\n onClear();\n }}\n >\n <Clear className={styles.root} />\n </button>\n );\n};\n\nFieldClearButton.displayName = 'FieldClearButton';\n","import { useContext } from 'react';\n\nimport { ComboBoxStateContext, SelectStateContext } from 'react-aria-components';\n\nimport { FieldClearButton } from './Component';\nimport { type TFieldClearSize, type TFieldClearVariant } from './types';\n\nconst isEmptyMultiValue = (value: unknown): boolean => {\n if (value == null) {\n return true;\n }\n\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n\n return false;\n};\n\ninterface IAdapterProps {\n isDisabled: boolean;\n size: TFieldClearSize;\n variant: TFieldClearVariant;\n}\n\n/** Clear for single Select (SelectStateContext). */\nexport const FieldSelectClearButton = ({ isDisabled, size, variant }: IAdapterProps) => {\n const state = useContext(SelectStateContext);\n\n if (!state || state.selectedKey == null || isDisabled) {\n return null;\n }\n\n return (\n <FieldClearButton\n isDisabled={isDisabled}\n size={size}\n variant={variant}\n onClear={() => {\n state.setSelectedKey(null);\n }}\n />\n );\n};\n\nFieldSelectClearButton.displayName = 'FieldSelectClearButton';\n\n/** Clear for multi Select. */\nexport const FieldMultiSelectClearButton = ({ isDisabled, size, variant }: IAdapterProps) => {\n const state = useContext(SelectStateContext);\n\n if (!state || isEmptyMultiValue(state.value) || isDisabled) {\n return null;\n }\n\n return (\n <FieldClearButton\n isDisabled={isDisabled}\n size={size}\n variant={variant}\n onClear={() => {\n state.setValue([]);\n }}\n />\n );\n};\n\nFieldMultiSelectClearButton.displayName = 'FieldMultiSelectClearButton';\n\n/** Clear for single ComboBox. */\nexport const FieldComboBoxClearButton = ({ isDisabled, size, variant }: IAdapterProps) => {\n const state = useContext(ComboBoxStateContext);\n const selected = state?.value;\n\n if (!state || selected == null || selected === '' || isDisabled) {\n return null;\n }\n\n return (\n <FieldClearButton\n isDisabled={isDisabled}\n size={size}\n variant={variant}\n onClear={() => {\n state.setValue(null);\n state.setInputValue('');\n }}\n />\n );\n};\n\nFieldComboBoxClearButton.displayName = 'FieldComboBoxClearButton';\n\n/** Clear for multi ComboBox. */\nexport const FieldMultiComboBoxClearButton = ({ isDisabled, size, variant }: IAdapterProps) => {\n const state = useContext(ComboBoxStateContext);\n\n if (!state || isEmptyMultiValue(state.value) || isDisabled) {\n return null;\n }\n\n return (\n <FieldClearButton\n isDisabled={isDisabled}\n size={size}\n variant={variant}\n onClear={() => {\n state.setValue([]);\n state.setInputValue('');\n }}\n />\n );\n};\n\nFieldMultiComboBoxClearButton.displayName = 'FieldMultiComboBoxClearButton';\n","import { type Key } from 'react-aria-components';\n\nimport { type IComboboxOption, type TComboboxValue } from './types';\n\n/**\n * Resolves selected keys to options in key order.\n * Missing keys fall back to `{ value, label: String(key) }`.\n */\nexport const resolveSelectedOptions = (\n keys: readonly Key[],\n optionsByValue: ReadonlyMap<TComboboxValue, IComboboxOption>\n): IComboboxOption[] =>\n keys.map(key => {\n const value = key as TComboboxValue;\n const found = optionsByValue.get(value);\n\n if (found) {\n return found;\n }\n\n return { value, label: String(key) };\n });\n\n/** True when click originated from remove / nested button chrome (not tag body). */\nexport const isInteractiveTarget = (target: EventTarget | null) => {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n\n return Boolean(target.closest('[slot=\"remove\"], button'));\n};\n\n/** Normalize RAC value to a key list for tag remove / clear. */\nexport const toKeyList = (value: unknown): Key[] => (Array.isArray(value) ? value : []);\n"],"names":["comboboxItemVariants","cva","styles","ComboboxItemContent","label","jsxs","Fragment","jsx","Check","comboboxPopoverVariants","ComboboxPopover","triggerRef","variant","children","RacPopover","comboboxListBoxVariants","cn","typographyStyles","LoadMoreStatus","loadingSuggestions","useAuiLabels","ComboboxList","options","size","isLoading","isError","showEmptyStatus","hasMore","onLoadMore","isLoadingMore","rowSize","padding","useComboboxListMetrics","showStatus","showItems","showMore","ComboboxListStatus","Virtualizer","ListLayout","ListBox","Collection","item","ListBoxItem","ListBoxLoadMoreItem","fieldClearVariants","FieldClearButton","isDisabled","onClear","clear","event","Clear","isEmptyMultiValue","value","FieldSelectClearButton","state","useContext","SelectStateContext","FieldMultiSelectClearButton","FieldComboBoxClearButton","ComboBoxStateContext","selected","FieldMultiComboBoxClearButton","resolveSelectedOptions","keys","optionsByValue","key","found","isInteractiveTarget","target","toKeyList"],"mappings":";;;;;;;;;;;;;;;;;;GAIaA,IAAuBC,EAAIC,EAAO,MAAM;AAAA,EACjD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACL,SAASA,EAAO;AAAA,IAAA;AAAA,EACpB;AAAA,EAEJ,iBAAiB;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAEjB,CAAC,GCTYC,IAAsB,CAAC,EAAE,OAAAC,EAAA,MAClC,gBAAAC,EAAAC,GAAA,EACI,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWL,EAAO,OAAQ,UAAAE,GAAM;AAAA,EACtC,gBAAAG,EAACC,GAAA,EAAM,WAAWN,EAAO,MAAA,CAAO;AAAA,EAAA,CACpC;AAGJC,EAAoB,cAAc;;;;GCbrBM,KAA0BR,EAAIC,EAAO,MAAM;AAAA,EACpD,UAAU;AAAA,IACN,SAAS;AAAA,MACL,SAASA,EAAO;AAAA,IAAA;AAAA,EACpB;AAAA,EAEJ,iBAAiB;AAAA,IACb,SAAS;AAAA,EAAA;AAEjB,CAAC,GCCYQ,IAAkB,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,UAAAC,EAAA,wBAClDC,GAAA,EAAW,YAAAH,GAAwB,WAAWF,GAAwB,EAAE,SAAAG,GAAS,GAAG,QAAQ,GAAG,YAAU,IACrG,UAAAC,EAAA,CACL;AAGJH,EAAgB,cAAc;;;;;;;GCbjBK,KAA0Bd,EAAIC,EAAO,MAAM;AAAA,EACpD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIc,EAAGd,EAAO,IAAIe,EAAiB,KAAK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;AAExB,SAAI,CAACA,KAASM,KAAY,QAAQA,MAAa,MAAMd,IAC1C,OAIP,gBAAAvC;AAAA,IAACsC;AAAA,IAAA;AAAA,MACG,YAAAC;AAAA,MACA,MAAAvB;AAAA,MACA,SAAAX;AAAA,MACA,SAAS,MAAM;AACX,QAAA0C,EAAM,SAAS,IAAI,GACnBA,EAAM,cAAc,EAAE;AAAA,MAC1B;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAI,GAAyB,cAAc;AAGhC,MAAMG,KAAgC,CAAC,EAAE,YAAAf,GAAY,MAAAvB,GAAM,SAAAX,QAA6B;AAC3F,QAAM0C,IAAQC,EAAWI,CAAoB;AAE7C,SAAI,CAACL,KAASH,EAAkBG,EAAM,KAAK,KAAKR,IACrC,OAIP,gBAAAvC;AAAA,IAACsC;AAAA,IAAA;AAAA,MACG,YAAAC;AAAA,MACA,MAAAvB;AAAA,MACA,SAAAX;AAAA,MACA,SAAS,MAAM;AACX,QAAA0C,EAAM,SAAS,EAAE,GACjBA,EAAM,cAAc,EAAE;AAAA,MAC1B;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAO,GAA8B,cAAc;AC1GrC,MAAMC,KAAyB,CAClCC,GACAC,MAEAD,EAAK,IAAI,CAAAE,MAAO;AACZ,QAAMb,IAAQa,GACRC,IAAQF,EAAe,IAAIZ,CAAK;AAEtC,SAAIc,KAIG,EAAE,OAAAd,GAAO,OAAO,OAAOa,CAAG,EAAA;AACrC,CAAC,GAGQE,KAAsB,CAACC,MAC1BA,aAAkB,cAIjB,EAAQA,EAAO,QAAQ,yBAAyB,IAH5C,IAOFC,KAAY,CAACjB,MAA2B,MAAM,QAAQA,CAAK,IAAIA,IAAQ,CAAA;"}
|
|
@@ -5,7 +5,7 @@ import { SelectionIndicator as w, Tab as D, TabList as K, TabPanel as M, TabPane
|
|
|
5
5
|
import { s as _ } from "../index-h8z54aFR.js";
|
|
6
6
|
import { typographyStyles as b } from "../typography/index.js";
|
|
7
7
|
import { cva as p } from "class-variance-authority";
|
|
8
|
-
import '../assets/
|
|
8
|
+
import '../assets/index32.css';const V = C(void 0), g = () => {
|
|
9
9
|
const t = L(V);
|
|
10
10
|
if (!t)
|
|
11
11
|
throw new Error("This component must be used within a <VerticalTabs> component");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ensi-platform/admin-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Admin UI for Ensi admin panel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -289,6 +289,10 @@
|
|
|
289
289
|
"types": "./dist/tooltip/index.d.ts",
|
|
290
290
|
"import": "./dist/tooltip/index.js"
|
|
291
291
|
},
|
|
292
|
+
"./tree": {
|
|
293
|
+
"types": "./dist/tree/index.d.ts",
|
|
294
|
+
"import": "./dist/tree/index.js"
|
|
295
|
+
},
|
|
292
296
|
"./typography": {
|
|
293
297
|
"types": "./dist/typography/index.d.ts",
|
|
294
298
|
"import": "./dist/typography/index.js"
|
|
@@ -13,8 +13,14 @@ export const docsCssVariables = `--aui-color-field-bg-primary: var(--aui-input-b
|
|
|
13
13
|
--aui-color-field-pad-x-md: var(--aui-input-pad-x-md); /* padding-x md */
|
|
14
14
|
--aui-color-field-pad-x-lg: var(--aui-input-pad-x-lg); /* padding-x lg */
|
|
15
15
|
--aui-color-field-gap-md: var(--aui-spacing-8); /* gap inside the field */
|
|
16
|
-
--aui-color-field-icon-size: var(--aui-spacing-
|
|
17
|
-
--aui-color-field-icon-
|
|
16
|
+
--aui-color-field-icon-size-sm: var(--aui-spacing-12); /* clear icon size sm */
|
|
17
|
+
--aui-color-field-icon-size-md: var(--aui-spacing-16); /* clear icon size md */
|
|
18
|
+
--aui-color-field-icon-size-lg: var(--aui-spacing-20); /* clear icon size lg */
|
|
19
|
+
--aui-color-field-icon-hit-sm: var(--aui-spacing-16); /* clear icon hit sm */
|
|
20
|
+
--aui-color-field-icon-hit-md: var(--aui-spacing-24); /* clear icon hit md */
|
|
21
|
+
--aui-color-field-icon-hit-lg: var(--aui-spacing-32); /* clear icon hit lg */
|
|
22
|
+
--aui-color-field-icon-size: var(--aui-color-field-icon-size-md); /* alias of md */
|
|
23
|
+
--aui-color-field-icon-hit: var(--aui-color-field-icon-hit-md); /* alias of md */
|
|
18
24
|
--aui-color-field-clear-radius: var(--aui-control-radius-sm); /* clear button radius */
|
|
19
25
|
--aui-color-field-swatch-sm: var(--aui-spacing-16); /* trigger swatch sm */
|
|
20
26
|
--aui-color-field-swatch-md: var(--aui-spacing-20); /* trigger swatch md */
|
|
@@ -18,8 +18,12 @@ export const docsCssVariables = `/* CSS variables — DatePicker (--aui-date-pic
|
|
|
18
18
|
--aui-date-picker-pad-x-lg: var(--aui-input-pad-x-lg); /* padding-x lg */
|
|
19
19
|
--aui-date-picker-gap-md: var(--aui-spacing-8); /* md gap */
|
|
20
20
|
|
|
21
|
+
--aui-date-picker-icon-size-sm: var(--aui-spacing-12); /* icon size sm */
|
|
21
22
|
--aui-date-picker-icon-size-md: var(--aui-spacing-16); /* icon size md */
|
|
23
|
+
--aui-date-picker-icon-size-lg: var(--aui-spacing-20); /* icon size lg */
|
|
24
|
+
--aui-date-picker-icon-hit-sm: var(--aui-spacing-16); /* icon hit sm */
|
|
22
25
|
--aui-date-picker-icon-hit-md: var(--aui-spacing-24); /* icon hit md */
|
|
26
|
+
--aui-date-picker-icon-hit-lg: var(--aui-spacing-32); /* icon hit lg */
|
|
23
27
|
|
|
24
28
|
--aui-date-picker-clear-radius-md: var(--aui-control-radius-sm); /* clear control radius md */
|
|
25
29
|
|
|
@@ -18,8 +18,12 @@ export const docsCssVariables = `/* CSS variables — DateRangePicker (--aui-dat
|
|
|
18
18
|
--aui-date-range-picker-pad-x-lg: var(--aui-date-picker-pad-x-lg); /* padding-x lg */
|
|
19
19
|
--aui-date-range-picker-gap-md: var(--aui-date-picker-gap-md); /* md gap */
|
|
20
20
|
|
|
21
|
+
--aui-date-range-picker-icon-size-sm: var(--aui-date-picker-icon-size-sm); /* icon size sm */
|
|
21
22
|
--aui-date-range-picker-icon-size-md: var(--aui-date-picker-icon-size-md); /* icon size md */
|
|
23
|
+
--aui-date-range-picker-icon-size-lg: var(--aui-date-picker-icon-size-lg); /* icon size lg */
|
|
24
|
+
--aui-date-range-picker-icon-hit-sm: var(--aui-date-picker-icon-hit-sm); /* icon hit sm */
|
|
22
25
|
--aui-date-range-picker-icon-hit-md: var(--aui-date-picker-icon-hit-md); /* icon hit md */
|
|
26
|
+
--aui-date-range-picker-icon-hit-lg: var(--aui-date-picker-icon-hit-lg); /* icon hit lg */
|
|
23
27
|
|
|
24
28
|
--aui-date-range-picker-clear-radius-md: var(--aui-date-picker-clear-radius-md); /* clear control radius md */
|
|
25
29
|
|
|
@@ -17,7 +17,9 @@ Equal field columns use `GridLayout`.
|
|
|
17
17
|
| Prop | Values | Default | Description |
|
|
18
18
|
| ------------ | ---------------------------------------------- | --------- | ------------------------- |
|
|
19
19
|
| `direction` | `row` \| `column` | `row` | axis |
|
|
20
|
-
| `gap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `16` | gap
|
|
20
|
+
| `gap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `16` | gap on both axes |
|
|
21
|
+
| `rowGap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `gap` | vertical gap, else `gap` |
|
|
22
|
+
| `columnGap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `gap` | horizontal gap, else `gap` |
|
|
21
23
|
| `align` | `start` \| `center` \| `end` \| `stretch` | `stretch` | cross-axis alignment |
|
|
22
24
|
| `justify` | `start` \| `center` \| `end` \| `between` | `start` | main-axis distribution |
|
|
23
25
|
| `wrap` | `boolean` | `false` | wrap onto the next line |
|
package/src/flex-layout/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef, type ReactNode, type Ref } from 'react';
|
|
1
|
+
import { type CSSProperties, type ComponentPropsWithRef, type ReactNode, type Ref } from 'react';
|
|
2
2
|
|
|
3
3
|
import { type IDataTestIdProps } from '@ds/common';
|
|
4
4
|
|
|
@@ -21,6 +21,10 @@ export interface IFlexLayoutOwnProps extends IDataTestIdProps {
|
|
|
21
21
|
direction?: TFlexLayoutDirection;
|
|
22
22
|
/** Gap between items. */
|
|
23
23
|
gap?: TFlexLayoutGap;
|
|
24
|
+
/** Row gap. Overrides gap. */
|
|
25
|
+
rowGap?: TFlexLayoutGap;
|
|
26
|
+
/** Column gap. Overrides gap. */
|
|
27
|
+
columnGap?: TFlexLayoutGap;
|
|
24
28
|
/** Cross-axis alignment. */
|
|
25
29
|
align?: TFlexLayoutAlign;
|
|
26
30
|
/** Main-axis distribution. */
|
|
@@ -45,3 +49,9 @@ export interface IFlexLayoutItemOwnProps extends IDataTestIdProps {
|
|
|
45
49
|
|
|
46
50
|
export interface IFlexLayoutItemProps
|
|
47
51
|
extends Omit<ComponentPropsWithRef<'div'>, keyof IFlexLayoutItemOwnProps | 'children'>, IFlexLayoutItemOwnProps {}
|
|
52
|
+
|
|
53
|
+
/** Inline axis gaps written by FlexLayout. */
|
|
54
|
+
export interface IFlexLayoutStyle extends CSSProperties {
|
|
55
|
+
'--aui-flex-layout-row-gap'?: string;
|
|
56
|
+
'--aui-flex-layout-column-gap'?: string;
|
|
57
|
+
}
|
|
@@ -16,7 +16,9 @@ import { GridLayout } from '@ensi-platform/admin-ui/grid-layout';
|
|
|
16
16
|
| Prop | Values | Default | Description |
|
|
17
17
|
| ------------ | ---------------------------------------------- | --------- | -------------------------------- |
|
|
18
18
|
| `cols` | `number` \| track list | — | columns |
|
|
19
|
-
| `gap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `16` | gap
|
|
19
|
+
| `gap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `16` | gap on both axes |
|
|
20
|
+
| `rowGap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `gap` | vertical gap, else `gap` |
|
|
21
|
+
| `columnGap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `gap` | horizontal gap, else `gap` |
|
|
20
22
|
| `col` | `number` \| `full` | — | span when nested in another grid |
|
|
21
23
|
| `align` | `start` \| `center` \| `end` \| `stretch` | `stretch` | cross-axis alignment |
|
|
22
24
|
| `dataTestId` | `string` | — | `data-test-id` for tests |
|
package/src/grid-layout/types.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface IGridLayoutOwnProps extends IDataTestIdProps {
|
|
|
21
21
|
cols: number | TGridLayoutTrack[];
|
|
22
22
|
/** Gap between items. */
|
|
23
23
|
gap?: TGridLayoutGap;
|
|
24
|
+
/** Row gap. Overrides gap. */
|
|
25
|
+
rowGap?: TGridLayoutGap;
|
|
26
|
+
/** Column gap. Overrides gap. */
|
|
27
|
+
columnGap?: TGridLayoutGap;
|
|
24
28
|
/** Span when this grid sits inside another grid. */
|
|
25
29
|
col?: TGridLayoutCol;
|
|
26
30
|
/** Cross-axis alignment. */
|
|
@@ -48,4 +52,6 @@ export interface IGridLayoutItemProps
|
|
|
48
52
|
export interface IGridLayoutStyle extends CSSProperties {
|
|
49
53
|
'--aui-grid-layout-template'?: string;
|
|
50
54
|
'--aui-grid-layout-col'?: string;
|
|
55
|
+
'--aui-grid-layout-row-gap'?: string;
|
|
56
|
+
'--aui-grid-layout-column-gap'?: string;
|
|
51
57
|
}
|
|
@@ -18,8 +18,12 @@ export const docsCssVariables = `/* CSS variables — TimeField (--aui-time-fiel
|
|
|
18
18
|
--aui-time-field-pad-x-lg: var(--aui-input-pad-x-lg); /* padding-x lg */
|
|
19
19
|
--aui-time-field-gap-md: var(--aui-spacing-8); /* md gap */
|
|
20
20
|
|
|
21
|
+
--aui-time-field-icon-size-sm: var(--aui-spacing-12); /* icon size sm */
|
|
21
22
|
--aui-time-field-icon-size-md: var(--aui-spacing-16); /* icon size md */
|
|
23
|
+
--aui-time-field-icon-size-lg: var(--aui-spacing-20); /* icon size lg */
|
|
24
|
+
--aui-time-field-icon-hit-sm: var(--aui-spacing-16); /* icon hit sm */
|
|
22
25
|
--aui-time-field-icon-hit-md: var(--aui-spacing-24); /* icon hit md */
|
|
26
|
+
--aui-time-field-icon-hit-lg: var(--aui-spacing-32); /* icon hit lg */
|
|
23
27
|
|
|
24
28
|
--aui-time-field-clear-radius-md: var(--aui-control-radius-sm); /* clear control radius md */
|
|
25
29
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
A tree of nested rows: the chevron expands a branch, and pressing a row selects it.
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { Tree } from '@ensi-platform/admin-ui/tree';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- a hierarchy where branches expand and a row is selected separately
|
|
10
|
+
- one selected node, or several
|
|
11
|
+
- not a flat menu — see `MenuList`
|
|
12
|
+
- not a short list of values — see `Select`
|
|
13
|
+
|
|
14
|
+
## API (short)
|
|
15
|
+
|
|
16
|
+
| Prop | Values | Default | Description |
|
|
17
|
+
| --------------------- | --------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `items` | `{ id, label, children?, disabled? }[]` | — | nodes. An empty or omitted `children` is a leaf. `disabled` blocks selection and expansion of that node |
|
|
19
|
+
| `aria-label` | `string` | — | accessible name. The tree has no visible caption |
|
|
20
|
+
| `selectionMode` | `none` \| `single` \| `multiple` | `single` | selection mode. In `single`, pressing the selected row again keeps it. In `multiple`, pressing it again clears it. An empty key set is allowed |
|
|
21
|
+
| `selectedKeys` | `Selection` | — | selected keys |
|
|
22
|
+
| `defaultSelectedKeys` | `Selection` | — | initial selection without external state |
|
|
23
|
+
| `onSelectionChange` | `(keys) => void` | — | selection handler. Not called when `disabled` or `readOnly` |
|
|
24
|
+
| `expandedKeys` | `Iterable<Key>` | — | expanded branches |
|
|
25
|
+
| `defaultExpandedKeys` | `Iterable<Key>` | — | initial expansion without external state |
|
|
26
|
+
| `onExpandedChange` | `(keys) => void` | — | expansion handler |
|
|
27
|
+
| `disabled` | `boolean` | `false` | no node can be selected or expanded. Wins over `readOnly` |
|
|
28
|
+
| `readOnly` | `boolean` | `false` | the selection stays visible and does not change. Branches still expand |
|
|
29
|
+
| `dataTestId` | `string` | — | `data-test-id` attribute |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Tree CSS variables from semantic tokens (--aui-tree-*). */
|
|
2
|
+
export const docsCssVariables = `/* CSS variables — Tree (--aui-tree-*) */
|
|
3
|
+
--aui-tree-fg-primary: var(--aui-page-fg-primary); /* row label */
|
|
4
|
+
--aui-tree-fg-muted: var(--aui-page-fg-muted); /* chevron */
|
|
5
|
+
--aui-tree-item-bg-hover: var(--aui-surface-bg-muted-active); /* row hover */
|
|
6
|
+
--aui-tree-item-bg-selected: var(--aui-surface-bg-muted); /* selected row */
|
|
7
|
+
--aui-tree-item-bg-selected-hover: var(--aui-surface-bg-muted-active); /* selected row hover */
|
|
8
|
+
--aui-tree-border-focus: var(--aui-control-border-focus); /* focus ring */
|
|
9
|
+
--aui-tree-item-pad-y: var(--aui-spacing-8); /* row block padding */
|
|
10
|
+
--aui-tree-item-pad-x: var(--aui-spacing-8); /* row inline end padding */
|
|
11
|
+
--aui-tree-item-indent: var(--aui-spacing-12); /* indent per level */
|
|
12
|
+
--aui-tree-item-gap: var(--aui-spacing-4); /* chevron to label */
|
|
13
|
+
--aui-tree-chevron-size: var(--aui-spacing-16); /* chevron slot */
|
|
14
|
+
--aui-tree-duration-fast: var(--aui-control-duration-fast); /* chevron rotation */
|
|
15
|
+
--aui-tree-ease-out: var(--aui-control-ease-out); /* chevron rotation easing */
|
|
16
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
import { type Key, type Selection } from 'react-aria-components';
|
|
4
|
+
|
|
5
|
+
import { type IDataTestIdProps } from '@ds/common';
|
|
6
|
+
|
|
7
|
+
/** One node. Omit `children` or pass an empty list for a leaf. */
|
|
8
|
+
export interface ITreeItem {
|
|
9
|
+
/** Node key. */
|
|
10
|
+
id: string | number;
|
|
11
|
+
/** Visible label. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Nested nodes. */
|
|
14
|
+
children?: ITreeItem[];
|
|
15
|
+
/** Blocks selection and expansion of this node. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Selection mode. */
|
|
20
|
+
export type TTreeSelectionMode = 'none' | 'single' | 'multiple';
|
|
21
|
+
|
|
22
|
+
/** Selection and expansion state. */
|
|
23
|
+
export interface ITreeControlProps {
|
|
24
|
+
/** Selection mode. */
|
|
25
|
+
selectionMode?: TTreeSelectionMode;
|
|
26
|
+
/** Controlled selection. An empty set means nothing is selected. */
|
|
27
|
+
selectedKeys?: Selection;
|
|
28
|
+
/** Uncontrolled initial selection. */
|
|
29
|
+
defaultSelectedKeys?: Selection;
|
|
30
|
+
/** Selection change handler. */
|
|
31
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
32
|
+
/** Controlled expanded branches. */
|
|
33
|
+
expandedKeys?: Iterable<Key>;
|
|
34
|
+
/** Uncontrolled initial expanded branches. */
|
|
35
|
+
defaultExpandedKeys?: Iterable<Key>;
|
|
36
|
+
/** Expanded branches change handler. */
|
|
37
|
+
onExpandedChange?: (keys: Set<Key>) => void;
|
|
38
|
+
/** Blocks selection and expansion for every node. */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** Keeps the current selection. Expansion still works. */
|
|
41
|
+
readOnly?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Own / chrome props (not from RAC). */
|
|
45
|
+
export interface ITreeOwnProps extends IDataTestIdProps {
|
|
46
|
+
/** Nodes. */
|
|
47
|
+
items: ITreeItem[];
|
|
48
|
+
/** Accessible name. The tree has no visible caption. */
|
|
49
|
+
'aria-label': string;
|
|
50
|
+
/** Root class name. */
|
|
51
|
+
className?: string;
|
|
52
|
+
/** Ref to the tree root (React 19 prop). */
|
|
53
|
+
ref?: Ref<HTMLDivElement>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ITreeProps extends ITreeControlProps, ITreeOwnProps {}
|