@stackone/malachite 2.95.0 → 2.96.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/COMPONENTS.md +1 -0
- package/dist/components/Accordion.js +112 -105
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/AppLogo.js +8 -7
- package/dist/components/AppLogo.js.map +1 -1
- package/dist/components/CollapseFocusHandOff.js +18 -0
- package/dist/components/CollapseFocusHandOff.js.map +1 -0
- package/dist/components/ConfirmationDialog.js +107 -95
- package/dist/components/ConfirmationDialog.js.map +1 -1
- package/dist/components/StepList.js +109 -0
- package/dist/components/StepList.js.map +1 -0
- package/dist/components/collapseFocus.js +22 -0
- package/dist/components/collapseFocus.js.map +1 -0
- package/dist/components/composeRefs.js +11 -11
- package/dist/components/composeRefs.js.map +1 -1
- package/dist/components/inert.js +6 -0
- package/dist/components/inert.js.map +1 -0
- package/dist/components/reactVersion.js +6 -0
- package/dist/components/reactVersion.js.map +1 -0
- package/dist/index.d.ts +40 -1
- package/dist/index.js +362 -360
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { IS_REACT_19 as p } from "./reactVersion.js";
|
|
2
|
+
const u = (n, o) => {
|
|
3
3
|
if (typeof n == "function")
|
|
4
4
|
return n(o);
|
|
5
5
|
n && (n.current = o);
|
|
6
|
-
},
|
|
7
|
-
const t = n.map((c) =>
|
|
6
|
+
}, a = (...n) => (o) => {
|
|
7
|
+
const t = n.map((c) => u(c, o));
|
|
8
8
|
if (t.some((c) => typeof c == "function"))
|
|
9
9
|
return () => {
|
|
10
|
-
n.forEach((c,
|
|
11
|
-
const f = t[
|
|
10
|
+
n.forEach((c, e) => {
|
|
11
|
+
const f = t[e];
|
|
12
12
|
if (typeof f == "function") {
|
|
13
13
|
f();
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
u(c, null);
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
},
|
|
19
|
+
}, s = (n) => p ? n.props.ref : n.ref, i = (n, o) => (t) => {
|
|
20
20
|
n == null || n(t), t.defaultPrevented || o(t);
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
i as chainHandler,
|
|
24
|
+
a as composeRefs,
|
|
25
|
+
s as elementRef
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=composeRefs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeRefs.js","sources":["../../src/components/composeRefs.ts"],"sourcesContent":["import type React from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"composeRefs.js","sources":["../../src/components/composeRefs.ts"],"sourcesContent":["import type React from 'react';\nimport { IS_REACT_19 } from './reactVersion';\n\ntype AnyRef<T> = React.Ref<T> | undefined;\n\nconst setRef = <T>(ref: AnyRef<T>, node: T | null): void | (() => void) => {\n if (typeof ref === 'function') {\n return ref(node);\n }\n if (ref) {\n (ref as React.MutableRefObject<T | null>).current = node;\n }\n};\n\nexport const composeRefs =\n <T>(...refs: AnyRef<T>[]) =>\n (node: T | null): void | (() => void) => {\n const cleanups = refs.map((ref) => setRef(ref, node));\n if (!cleanups.some((cleanup) => typeof cleanup === 'function')) {\n return;\n }\n return () => {\n refs.forEach((ref, index) => {\n const cleanup = cleanups[index];\n if (typeof cleanup === 'function') {\n cleanup();\n return;\n }\n setRef(ref, null);\n });\n };\n };\n\nexport const elementRef = <T>(element: React.ReactElement): AnyRef<T> =>\n (IS_REACT_19\n ? (element.props as { ref?: React.Ref<T> }).ref\n : (element as unknown as { ref?: React.Ref<T> }).ref) as AnyRef<T>;\n\nexport const chainHandler =\n <E extends React.SyntheticEvent>(\n theirs: ((event: E) => void) | undefined,\n ours: (event: E) => void,\n ) =>\n (event: E): void => {\n theirs?.(event);\n if (!event.defaultPrevented) {\n ours(event);\n }\n };\n"],"names":["setRef","ref","node","composeRefs","refs","cleanups","cleanup","index","elementRef","element","IS_REACT_19","chainHandler","theirs","ours","event"],"mappings":";AAKA,MAAMA,IAAS,CAAIC,GAAgBC,MAAwC;AACvE,MAAI,OAAOD,KAAQ;AACf,WAAOA,EAAIC,CAAI;AAEnB,EAAID,MACCA,EAAyC,UAAUC;AAE5D,GAEaC,IACT,IAAOC,MACP,CAACF,MAAwC;AACrC,QAAMG,IAAWD,EAAK,IAAI,CAACH,MAAQD,EAAOC,GAAKC,CAAI,CAAC;AACpD,MAAKG,EAAS,KAAK,CAACC,MAAY,OAAOA,KAAY,UAAU;AAG7D,WAAO,MAAM;AACT,MAAAF,EAAK,QAAQ,CAACH,GAAKM,MAAU;AACzB,cAAMD,IAAUD,EAASE,CAAK;AAC9B,YAAI,OAAOD,KAAY,YAAY;AAC/B,UAAAA,EAAA;AACA;AAAA,QACJ;AACA,QAAAN,EAAOC,GAAK,IAAI;AAAA,MACpB,CAAC;AAAA,IACL;AACJ,GAESO,IAAa,CAAIC,MACzBC,IACMD,EAAQ,MAAiC,MACzCA,EAA8C,KAE5CE,IACT,CACIC,GACAC,MAEJ,CAACC,MAAmB;AAChB,EAAAF,KAAA,QAAAA,EAASE,IACJA,EAAM,oBACPD,EAAKC,CAAK;AAElB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inert.js","sources":["../../src/components/inert.ts"],"sourcesContent":["import type React from 'react';\nimport { IS_REACT_19 } from './reactVersion';\n\n// React 19 takes `inert` as a boolean; React 18 only passes a string through to the DOM.\nexport const inertWhen = (on: boolean) =>\n (on ? { inert: IS_REACT_19 ? true : '' } : {}) as React.HTMLAttributes<HTMLDivElement>;\n"],"names":["inertWhen","on","IS_REACT_19"],"mappings":";AAIO,MAAMA,IAAY,CAACC,MACrBA,IAAK,EAAE,OAAOC,IAAc,KAAO,OAAO,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactVersion.js","sources":["../../src/components/reactVersion.ts"],"sourcesContent":["import { version } from 'react';\n\nexport const IS_REACT_19 = Number(version.split('.')[0]) >= 19;\n"],"names":["IS_REACT_19","version"],"mappings":";AAEO,MAAMA,IAAc,OAAOC,EAAQ,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -280,7 +280,7 @@ export declare interface AppLogoProps {
|
|
|
280
280
|
nameWeight?: FontWeight;
|
|
281
281
|
/** Rendered as a tag after the name, e.g. `v1.2.0` or `Legacy`. */
|
|
282
282
|
version?: string;
|
|
283
|
-
/** Truncates a long name with an ellipsis and reveals
|
|
283
|
+
/** Truncates a long name with an ellipsis, and reveals it on hover once it is cut off. */
|
|
284
284
|
truncate?: boolean;
|
|
285
285
|
className?: string;
|
|
286
286
|
}
|
|
@@ -5239,6 +5239,45 @@ export declare type StatusPillTone = 'success' | 'neutral' | 'warning' | 'error'
|
|
|
5239
5239
|
|
|
5240
5240
|
export declare const StepCurrentIcon: React.FC<IconProps_108>;
|
|
5241
5241
|
|
|
5242
|
+
/**
|
|
5243
|
+
* A numbered, vertical list of setup steps: a marker per step joined by a line that turns
|
|
5244
|
+
* solid once a step is done, the step's title and description, and an optional action.
|
|
5245
|
+
*/
|
|
5246
|
+
export declare const StepList: default_2.FC<StepListProps>;
|
|
5247
|
+
|
|
5248
|
+
export declare interface StepListItem {
|
|
5249
|
+
/** Keys the row; falls back to its position, so pass one when steps come and go. */
|
|
5250
|
+
key?: string;
|
|
5251
|
+
title: default_2.ReactNode;
|
|
5252
|
+
description?: default_2.ReactNode;
|
|
5253
|
+
/**
|
|
5254
|
+
* `complete` fills the marker with a tick, `open` rings it in the accent, and `locked`
|
|
5255
|
+
* dims the marker and the text. The first `open` step is the current one.
|
|
5256
|
+
*/
|
|
5257
|
+
status: StepListStatus;
|
|
5258
|
+
/**
|
|
5259
|
+
* Right of the text, e.g. the step's button. The state is already announced after the
|
|
5260
|
+
* title, so a label that repeats it, such as "Completed", wants `aria-hidden`.
|
|
5261
|
+
*/
|
|
5262
|
+
action?: default_2.ReactNode;
|
|
5263
|
+
}
|
|
5264
|
+
|
|
5265
|
+
export declare interface StepListProps {
|
|
5266
|
+
steps: StepListItem[];
|
|
5267
|
+
/** `small` is the compact list for a sidebar: tighter rows and smaller text. */
|
|
5268
|
+
size?: StepListSize;
|
|
5269
|
+
/** Rules a line under each row, for a list that fills its container edge to edge. */
|
|
5270
|
+
dividers?: boolean;
|
|
5271
|
+
'aria-label'?: string;
|
|
5272
|
+
'aria-labelledby'?: string;
|
|
5273
|
+
/** On the list. Each connector runs to the next row's marker, so add no gap between rows. */
|
|
5274
|
+
className?: string;
|
|
5275
|
+
}
|
|
5276
|
+
|
|
5277
|
+
export declare type StepListSize = 'medium' | 'small';
|
|
5278
|
+
|
|
5279
|
+
export declare type StepListStatus = 'complete' | 'open' | 'locked';
|
|
5280
|
+
|
|
5242
5281
|
export declare const Stepper: default_2.FC<StepperProps | GroupedStepperProps>;
|
|
5243
5282
|
|
|
5244
5283
|
declare interface StepperBaseProps {
|