@astryxdesign/lab 0.3.0-canary.e0fef44 → 0.3.0-canary.e9fc2bb
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/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +9 -9
- package/dist/TransferList/TransferList.d.ts +90 -0
- package/dist/TransferList/TransferList.d.ts.map +1 -0
- package/dist/TransferList/TransferList.js +895 -0
- package/dist/TransferList/TransferListSelector.d.ts +57 -0
- package/dist/TransferList/TransferListSelector.d.ts.map +1 -0
- package/dist/TransferList/TransferListSelector.js +211 -0
- package/dist/TransferList/index.d.ts +10 -0
- package/dist/TransferList/index.d.ts.map +1 -0
- package/dist/TransferList/index.js +12 -0
- package/dist/TransferList/tokens.stylex.d.ts +15 -0
- package/dist/TransferList/tokens.stylex.d.ts.map +1 -0
- package/dist/TransferList/tokens.stylex.js +19 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/lab.css +35 -2
- package/package.json +3 -3
- package/src/BottomSheet/BottomSheet.doc.mjs +2 -2
- package/src/Stepper/Step.tsx +7 -3
- package/src/Stepper/Stepper.doc.mjs +5 -3
- package/src/Tour/Tour.doc.mjs +8 -8
- package/src/TransferList/TransferList.composition.test.tsx +288 -0
- package/src/TransferList/TransferList.doc.mjs +749 -0
- package/src/TransferList/TransferList.test.tsx +888 -0
- package/src/TransferList/TransferList.tsx +1323 -0
- package/src/TransferList/TransferListSelector.test.tsx +562 -0
- package/src/TransferList/TransferListSelector.tsx +315 -0
- package/src/TransferList/index.ts +20 -0
- package/src/TransferList/tokens.stylex.ts +18 -0
- package/src/index.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../src/Stepper/Step.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAC,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wdD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,UAAkB,EAClB,UAAkB,EAClB,UAAU,EACV,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACR,EAAE,SAAS,+BAylBX;yBA3mBe,IAAI"}
|
package/dist/Stepper/Step.js
CHANGED
|
@@ -88,7 +88,7 @@ function CurrentIcon() {
|
|
|
88
88
|
|
|
89
89
|
// --- Styles ---
|
|
90
90
|
|
|
91
|
-
const BAR_WIDTH = '
|
|
91
|
+
const BAR_WIDTH = spacingVars['--spacing-1'];
|
|
92
92
|
const ICON_SIZE = spacingVars['--spacing-4'];
|
|
93
93
|
const NUMBER_SIZE = spacingVars['--spacing-5'];
|
|
94
94
|
const _temp = {
|
|
@@ -309,7 +309,7 @@ const styles = {
|
|
|
309
309
|
$$css: true
|
|
310
310
|
},
|
|
311
311
|
otSegBaseV: {
|
|
312
|
-
kzqmXN: "
|
|
312
|
+
kzqmXN: "xx9zwd3",
|
|
313
313
|
kmuXW: "x2lah0s",
|
|
314
314
|
kaIpWk: "x2u8bby",
|
|
315
315
|
$$css: true
|
|
@@ -326,7 +326,7 @@ const styles = {
|
|
|
326
326
|
"--x-height": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(value)
|
|
327
327
|
}],
|
|
328
328
|
otSegH: {
|
|
329
|
-
kZKoxP: "
|
|
329
|
+
kZKoxP: "x11c6zpc",
|
|
330
330
|
kUk6DE: "x98rzlu",
|
|
331
331
|
k7Eaqz: "x18ki04u",
|
|
332
332
|
kaIpWk: "x2u8bby",
|
|
@@ -556,7 +556,7 @@ export function Step({
|
|
|
556
556
|
...{
|
|
557
557
|
className: "xjm74w1 xv1l7n4"
|
|
558
558
|
},
|
|
559
|
-
children:
|
|
559
|
+
children: t('@astryx.step.optional')
|
|
560
560
|
})]
|
|
561
561
|
}), endContent]
|
|
562
562
|
});
|
|
@@ -616,7 +616,7 @@ export function Step({
|
|
|
616
616
|
...{
|
|
617
617
|
className: "xjm74w1 xv1l7n4"
|
|
618
618
|
},
|
|
619
|
-
children:
|
|
619
|
+
children: t('@astryx.step.optional')
|
|
620
620
|
})]
|
|
621
621
|
}), endContent]
|
|
622
622
|
});
|
|
@@ -722,10 +722,10 @@ export function Step({
|
|
|
722
722
|
children: [/*#__PURE__*/_jsx("div", {
|
|
723
723
|
...mergeProps(themeProps('step-bar'), {
|
|
724
724
|
0: {
|
|
725
|
-
className: "
|
|
725
|
+
className: "xx9zwd3 xjspbzw x2lah0s xkh2ocl x1m4xfpy"
|
|
726
726
|
},
|
|
727
727
|
1: {
|
|
728
|
-
className: "
|
|
728
|
+
className: "xx9zwd3 xjspbzw x2lah0s xkh2ocl x1ewilqj"
|
|
729
729
|
}
|
|
730
730
|
}[!!isBarFilled << 0]),
|
|
731
731
|
"aria-hidden": "true"
|
|
@@ -805,10 +805,10 @@ export function Step({
|
|
|
805
805
|
children: [/*#__PURE__*/_jsx("div", {
|
|
806
806
|
...mergeProps(themeProps('step-bar'), {
|
|
807
807
|
0: {
|
|
808
|
-
className: "xh8yej3
|
|
808
|
+
className: "xh8yej3 x11c6zpc xjspbzw x2lah0s xlstkdb x1m4xfpy"
|
|
809
809
|
},
|
|
810
810
|
1: {
|
|
811
|
-
className: "xh8yej3
|
|
811
|
+
className: "xh8yej3 x11c6zpc xjspbzw x2lah0s xlstkdb x1ewilqj"
|
|
812
812
|
}
|
|
813
813
|
}[!!isBarFilled << 0]),
|
|
814
814
|
"aria-hidden": "true"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file TransferList.tsx
|
|
3
|
+
* @input Controlled option data, React DOM portals, local action glyphs, and shared Lab reorder styles
|
|
4
|
+
* @output Exports TransferList with immediate transfers, vertical reordering, and responsive scroll ownership
|
|
5
|
+
* @position Lab collection input; consumed by index.ts, TransferListSelector, docs, and tests
|
|
6
|
+
*
|
|
7
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
8
|
+
* - /packages/lab/src/TransferList/TransferList.doc.mjs
|
|
9
|
+
* - /packages/lab/src/TransferList/TransferList.test.tsx
|
|
10
|
+
* - /packages/lab/src/TransferList/index.ts
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import type { BaseProps } from '@astryxdesign/core';
|
|
14
|
+
export interface TransferListOption<T extends string = string> {
|
|
15
|
+
/** Stable value written to the controlled value array. */
|
|
16
|
+
value: T;
|
|
17
|
+
/** Visible option name and the basis of action labels. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Optional searchable metadata. Not rendered in the default row. */
|
|
20
|
+
description?: ReactNode;
|
|
21
|
+
/** Optional group heading on the available side. */
|
|
22
|
+
group?: string;
|
|
23
|
+
/** Prevents moving the option between the selected and available lists. */
|
|
24
|
+
isTransferDisabled?: boolean;
|
|
25
|
+
/** Prevents reordering the selected option and keeps its position fixed. */
|
|
26
|
+
isReorderDisabled?: boolean;
|
|
27
|
+
/** Explains why a transfer or reorder action is unavailable. */
|
|
28
|
+
disabledMessage?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface TransferListProps<T extends string = string> extends Omit<BaseProps<HTMLDivElement>, 'onChange'> {
|
|
31
|
+
/** Ref forwarded to the root group. */
|
|
32
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
33
|
+
/** Accessible name for the complete control. */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Visually hides the label while retaining its accessible name. */
|
|
36
|
+
isLabelHidden?: boolean;
|
|
37
|
+
/** Supporting guidance shown below the label. */
|
|
38
|
+
description?: string;
|
|
39
|
+
/** Complete option catalog. Option values must be unique. */
|
|
40
|
+
options: readonly TransferListOption<T>[];
|
|
41
|
+
/** Ordered selected values. This array is the single source of truth. */
|
|
42
|
+
value: readonly T[];
|
|
43
|
+
/** Called with the next ordered selection after a committed change. */
|
|
44
|
+
onChange: (value: readonly T[]) => void;
|
|
45
|
+
/** Heading for the selected panel. @default 'Selected' */
|
|
46
|
+
selectedLabel?: string;
|
|
47
|
+
/** Heading for the available panel. @default 'Available' */
|
|
48
|
+
availableLabel?: string;
|
|
49
|
+
/** Shows one search field that filters both panels. @default false */
|
|
50
|
+
hasSearch?: boolean;
|
|
51
|
+
/** Accessible label for search. Defaults to `Search ${label}`. */
|
|
52
|
+
searchLabel?: string;
|
|
53
|
+
/** Search input placeholder. @default 'Search…' */
|
|
54
|
+
searchPlaceholder?: string;
|
|
55
|
+
/** Enables pointer and keyboard ordering on selected options. @default true */
|
|
56
|
+
isReorderable?: boolean;
|
|
57
|
+
/** Shows an Add all action. @default false */
|
|
58
|
+
hasSelectAll?: boolean;
|
|
59
|
+
/** Shows a Clear action. Transfer-disabled selected options are retained. */
|
|
60
|
+
hasClear?: boolean;
|
|
61
|
+
/** Customizes primary row content without changing built-in behavior. */
|
|
62
|
+
renderOption?: (option: TransferListOption<T>) => ReactNode;
|
|
63
|
+
/** Empty copy for the selected panel. */
|
|
64
|
+
selectedEmptyText?: string;
|
|
65
|
+
/** Empty copy for the available panel. */
|
|
66
|
+
availableEmptyText?: string;
|
|
67
|
+
/** Empty copy while a search query is active. */
|
|
68
|
+
noResultsText?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A controlled dual-panel collection input for choosing and ordering values.
|
|
72
|
+
* Selection, ordering, drafts, persistence, and saved views stay explicit in
|
|
73
|
+
* the consumer; this component owns only search and active gesture state.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```
|
|
77
|
+
* const [columns, setColumns] = useState(['name', 'status']);
|
|
78
|
+
* <TransferList
|
|
79
|
+
* label="Table columns"
|
|
80
|
+
* options={columnOptions}
|
|
81
|
+
* value={columns}
|
|
82
|
+
* onChange={setColumns}
|
|
83
|
+
* />
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function TransferList<T extends string = string>({ label, isLabelHidden, description, options, value, onChange, selectedLabel, availableLabel, hasSearch, searchLabel, searchPlaceholder, isReorderable, hasSelectAll, hasClear, renderOption, selectedEmptyText, availableEmptyText, noResultsText, xstyle, className, style, ref, role, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...restProps }: TransferListProps<T>): ReactNode;
|
|
87
|
+
export declare namespace TransferList {
|
|
88
|
+
var displayName: string;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=TransferList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransferList.d.ts","sourceRoot":"","sources":["../../src/TransferList/TransferList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAiFlD,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC3D,0DAA0D;IAC1D,KAAK,EAAE,CAAC,CAAC;IACT,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CACxE,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC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