@namroodinc/liquid-editorial 0.6.8 → 0.7.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/README.md +110 -4
- package/UPGRADING.md +129 -0
- package/dist/chunks/CollectionView-BIuOL917.cjs +2 -0
- package/dist/chunks/CollectionView-BIuOL917.cjs.map +1 -0
- package/dist/chunks/CollectionView-Cr12UFWa.js +179 -0
- package/dist/chunks/CollectionView-Cr12UFWa.js.map +1 -0
- package/dist/chunks/{ColourField-DC6cLb9h.js → ColourField-B-tjjBfA.js} +2 -2
- package/dist/chunks/{ColourField-DC6cLb9h.js.map → ColourField-B-tjjBfA.js.map} +1 -1
- package/dist/chunks/{ColourField-NnFxLEsh.cjs → ColourField-ynUP1pfN.cjs} +2 -2
- package/dist/chunks/{ColourField-NnFxLEsh.cjs.map → ColourField-ynUP1pfN.cjs.map} +1 -1
- package/dist/chunks/FormEditor-C_4JbAnS.cjs +2 -0
- package/dist/chunks/FormEditor-C_4JbAnS.cjs.map +1 -0
- package/dist/chunks/{FormEditor-BkBhcYI5.js → FormEditor-ucTbDyQt.js} +177 -161
- package/dist/chunks/FormEditor-ucTbDyQt.js.map +1 -0
- package/dist/chunks/LoadState-B7GTDlWv.js +71 -0
- package/dist/chunks/LoadState-B7GTDlWv.js.map +1 -0
- package/dist/chunks/LoadState-C7tQ6fIP.cjs +2 -0
- package/dist/chunks/LoadState-C7tQ6fIP.cjs.map +1 -0
- package/dist/chunks/NumberField-1EYJdwDY.cjs +2 -0
- package/dist/chunks/NumberField-1EYJdwDY.cjs.map +1 -0
- package/dist/chunks/NumberField-DizR4NJv.js +178 -0
- package/dist/chunks/NumberField-DizR4NJv.js.map +1 -0
- package/dist/chunks/Slider-BfvNPjRJ.cjs +2 -0
- package/dist/chunks/Slider-BfvNPjRJ.cjs.map +1 -0
- package/dist/chunks/Slider-Cab6NqhK.js +168 -0
- package/dist/chunks/Slider-Cab6NqhK.js.map +1 -0
- package/dist/chunks/Wizard-B_CPW1V6.cjs +2 -0
- package/dist/chunks/Wizard-B_CPW1V6.cjs.map +1 -0
- package/dist/chunks/Wizard-C1iR5z44.js +99 -0
- package/dist/chunks/Wizard-C1iR5z44.js.map +1 -0
- package/dist/chunks/decimal-Ca7qJExZ.cjs +2 -0
- package/dist/chunks/decimal-Ca7qJExZ.cjs.map +1 -0
- package/dist/chunks/decimal-hq_W9D3s.js +15 -0
- package/dist/chunks/decimal-hq_W9D3s.js.map +1 -0
- package/dist/components/CollectionView/empty.d.cts +15 -0
- package/dist/components/CollectionView/empty.d.cts.map +1 -0
- package/dist/components/CollectionView/empty.d.ts +15 -0
- package/dist/components/CollectionView/empty.d.ts.map +1 -0
- package/dist/components/CollectionView/filters.d.cts +6 -0
- package/dist/components/CollectionView/filters.d.cts.map +1 -0
- package/dist/components/CollectionView/filters.d.ts +6 -0
- package/dist/components/CollectionView/filters.d.ts.map +1 -0
- package/dist/components/CollectionView/index.cjs +1 -0
- package/dist/components/CollectionView/index.d.cts +6 -0
- package/dist/components/CollectionView/index.d.cts.map +1 -0
- package/dist/components/CollectionView/index.d.ts +6 -0
- package/dist/components/CollectionView/index.d.ts.map +1 -0
- package/dist/components/CollectionView/index.js +2 -0
- package/dist/components/CollectionView/style.css +70 -0
- package/dist/components/CollectionView/toolbar.d.cts +5 -0
- package/dist/components/CollectionView/toolbar.d.cts.map +1 -0
- package/dist/components/CollectionView/toolbar.d.ts +5 -0
- package/dist/components/CollectionView/toolbar.d.ts.map +1 -0
- package/dist/components/CollectionView/types.d.cts +40 -0
- package/dist/components/CollectionView/types.d.cts.map +1 -0
- package/dist/components/CollectionView/types.d.ts +40 -0
- package/dist/components/CollectionView/types.d.ts.map +1 -0
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/EditLayout/style.css +1 -1
- package/dist/components/EditSection/index.cjs +2 -0
- package/dist/components/EditSection/index.cjs.map +1 -0
- package/dist/components/EditSection/index.d.cts +9 -0
- package/dist/components/EditSection/index.d.cts.map +1 -0
- package/dist/components/EditSection/index.d.ts +9 -0
- package/dist/components/EditSection/index.d.ts.map +1 -0
- package/dist/components/EditSection/index.js +22 -0
- package/dist/components/EditSection/index.js.map +1 -0
- package/dist/components/EditSection/style.css +31 -0
- package/dist/components/FormEditor/README.md +49 -7
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts +5 -0
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +5 -0
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.js +1 -1
- package/dist/components/LoadState/error.d.cts +13 -0
- package/dist/components/LoadState/error.d.cts.map +1 -0
- package/dist/components/LoadState/error.d.ts +13 -0
- package/dist/components/LoadState/error.d.ts.map +1 -0
- package/dist/components/LoadState/index.cjs +1 -0
- package/dist/components/LoadState/index.d.cts +15 -0
- package/dist/components/LoadState/index.d.cts.map +1 -0
- package/dist/components/LoadState/index.d.ts +15 -0
- package/dist/components/LoadState/index.d.ts.map +1 -0
- package/dist/components/LoadState/index.js +1 -0
- package/dist/components/LoadState/types.d.cts +3 -0
- package/dist/components/LoadState/types.d.cts.map +1 -0
- package/dist/components/LoadState/types.d.ts +3 -0
- package/dist/components/LoadState/types.d.ts.map +1 -0
- package/dist/components/LoadState/useRetryAttempt.d.cts +15 -0
- package/dist/components/LoadState/useRetryAttempt.d.cts.map +1 -0
- package/dist/components/LoadState/useRetryAttempt.d.ts +15 -0
- package/dist/components/LoadState/useRetryAttempt.d.ts.map +1 -0
- package/dist/components/MetaList/index.cjs +2 -0
- package/dist/components/MetaList/index.cjs.map +1 -0
- package/dist/components/MetaList/index.d.cts +7 -0
- package/dist/components/MetaList/index.d.cts.map +1 -0
- package/dist/components/MetaList/index.d.ts +7 -0
- package/dist/components/MetaList/index.d.ts.map +1 -0
- package/dist/components/MetaList/index.js +13 -0
- package/dist/components/MetaList/index.js.map +1 -0
- package/dist/components/MetaList/style.css +19 -0
- package/dist/components/NumberField/index.cjs +1 -2
- package/dist/components/NumberField/index.d.cts +10 -3
- package/dist/components/NumberField/index.d.cts.map +1 -1
- package/dist/components/NumberField/index.d.ts +10 -3
- package/dist/components/NumberField/index.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -128
- package/dist/components/NumberField/step.d.cts +29 -0
- package/dist/components/NumberField/step.d.cts.map +1 -0
- package/dist/components/NumberField/step.d.ts +29 -0
- package/dist/components/NumberField/step.d.ts.map +1 -0
- package/dist/components/PageHeader/index.cjs +2 -0
- package/dist/components/PageHeader/index.cjs.map +1 -0
- package/dist/components/PageHeader/index.d.cts +9 -0
- package/dist/components/PageHeader/index.d.cts.map +1 -0
- package/dist/components/PageHeader/index.d.ts +9 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/PageHeader/index.js +27 -0
- package/dist/components/PageHeader/index.js.map +1 -0
- package/dist/components/PageHeader/style.css +39 -0
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.d.cts.map +1 -1
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Slider/scale.d.cts +0 -2
- package/dist/components/Slider/scale.d.cts.map +1 -1
- package/dist/components/Slider/scale.d.ts +0 -2
- package/dist/components/Slider/scale.d.ts.map +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.cjs.map +1 -1
- package/dist/components/Stepper/index.d.cts +8 -0
- package/dist/components/Stepper/index.d.cts.map +1 -1
- package/dist/components/Stepper/index.d.ts +8 -0
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/Stepper/index.js +15 -14
- package/dist/components/Stepper/index.js.map +1 -1
- package/dist/components/Stepper/style.css +53 -0
- package/dist/components/Wizard/actions.d.cts +13 -0
- package/dist/components/Wizard/actions.d.cts.map +1 -0
- package/dist/components/Wizard/actions.d.ts +13 -0
- package/dist/components/Wizard/actions.d.ts.map +1 -0
- package/dist/components/Wizard/index.cjs +1 -0
- package/dist/components/Wizard/index.d.cts +7 -0
- package/dist/components/Wizard/index.d.cts.map +1 -0
- package/dist/components/Wizard/index.d.ts +7 -0
- package/dist/components/Wizard/index.d.ts.map +1 -0
- package/dist/components/Wizard/index.js +2 -0
- package/dist/components/Wizard/review-table.d.cts +13 -0
- package/dist/components/Wizard/review-table.d.cts.map +1 -0
- package/dist/components/Wizard/review-table.d.ts +13 -0
- package/dist/components/Wizard/review-table.d.ts.map +1 -0
- package/dist/components/Wizard/style.css +13 -0
- package/dist/components/Wizard/types.d.cts +35 -0
- package/dist/components/Wizard/types.d.cts.map +1 -0
- package/dist/components/Wizard/types.d.ts +35 -0
- package/dist/components/Wizard/types.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -30
- package/dist/internal/decimal.d.cts +7 -0
- package/dist/internal/decimal.d.cts.map +1 -0
- package/dist/internal/decimal.d.ts +7 -0
- package/dist/internal/decimal.d.ts.map +1 -0
- package/dist/styles.css +5 -0
- package/package.json +1 -1
- package/dist/chunks/FormEditor-B4mtAxaU.cjs +0 -2
- package/dist/chunks/FormEditor-B4mtAxaU.cjs.map +0 -1
- package/dist/chunks/FormEditor-BkBhcYI5.js.map +0 -1
- package/dist/chunks/Slider-k8weRl34.cjs +0 -2
- package/dist/chunks/Slider-k8weRl34.cjs.map +0 -1
- package/dist/chunks/Slider-vdMFLX-H.js +0 -174
- package/dist/chunks/Slider-vdMFLX-H.js.map +0 -1
- package/dist/components/NumberField/index.cjs.map +0 -1
- package/dist/components/NumberField/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["MetaList","items","term","description","Fragment","index"],"sources":["../../../src/components/MetaList/index.tsx"],"sourcesContent":["import { Fragment } from \"react\";\nimport type { ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport interface MetaListProps {\n items: readonly [term: string, description: ReactNode][];\n}\n\n/** Read-only facts about an item: IDs, dates, sizes. */\nexport function MetaList({ items }: MetaListProps) {\n return (\n <dl className=\"ds-meta-list\">\n {/* Terms may repeat, and rows hold no state of their own, so position is the key. */}\n {items.map(([term, description], index) => (\n <Fragment key={index}>\n <dt>{term}</dt>\n <dd>{description}</dd>\n </Fragment>\n ))}\n </dl>\n );\n}\n"],"mappings":";;;AASA,SAAgBA,EAAS,EAAE,YAAwB;CACjD,OACE,kBAAC,MAAD;EAAI,WAAU;EAEX,UAAAC,EAAM,KAAK,CAACC,GAAMC,IAAc,MAC/B,kBAACC,GAAD,EAAA,UAAA,CACE,kBAAC,MAAD,EAAA,UAAKF,EAAS,CAAA,GACd,kBAAC,MAAD,EAAA,UAAKC,EAAgB,CAAA,CACb,EAAA,GAHKE,CAGL,CACX;CACC,CAAA;AAER"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ds-meta-list {
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
5
|
+
gap: var(--space-2) var(--space-3);
|
|
6
|
+
margin: 0;
|
|
7
|
+
font-size: var(--font-size-sm);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ds-meta-list dt {
|
|
11
|
+
color: var(--color-text-muted);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ds-meta-list dd {
|
|
15
|
+
margin: 0;
|
|
16
|
+
overflow-wrap: anywhere;
|
|
17
|
+
text-align: end;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/NumberField-1EYJdwDY.cjs");exports.NumberField=e.t,exports.NumberRangeField=e.n;
|
|
@@ -7,6 +7,11 @@ export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
7
7
|
onValueChange?: (value: number | "") => void;
|
|
8
8
|
min?: number;
|
|
9
9
|
max?: number;
|
|
10
|
+
/**
|
|
11
|
+
* The grid steppers and arrow keys move on, counted from `min` (or 0). Defaults
|
|
12
|
+
* to 1. `"any"` accepts any typed precision; its steppers move by 1, or by the
|
|
13
|
+
* largest power of ten below the range when `min` and `max` are at most 1 apart.
|
|
14
|
+
*/
|
|
10
15
|
step?: number | "any";
|
|
11
16
|
/** Rendered inside the field, before the number — "£", "$", a glyph. */
|
|
12
17
|
prefix?: ReactNode;
|
|
@@ -14,15 +19,17 @@ export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
14
19
|
suffix?: ReactNode;
|
|
15
20
|
isDisabled?: boolean;
|
|
16
21
|
isInvalid?: boolean;
|
|
17
|
-
/**
|
|
22
|
+
/** Show the − / + steppers. Defaults to true; false keeps typing and arrow keys only. */
|
|
18
23
|
hasSteppers?: boolean;
|
|
19
24
|
/** Stepper names. Include the field's label when a form has several number fields. */
|
|
20
25
|
decreaseLabel?: string;
|
|
21
26
|
increaseLabel?: string;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
|
-
* A quantity, bounded by `min` and `max`. Steppers
|
|
25
|
-
* the
|
|
29
|
+
* A quantity, bounded by `min` and `max`. Steppers and ArrowUp/ArrowDown move
|
|
30
|
+
* on the `step` grid and stop at the bounds; an empty field's first press lands
|
|
31
|
+
* on a bound at or beyond 0. Typing is never blocked; an out-of-range value
|
|
32
|
+
* reads invalid. The steppers stay out of the tab order and never take focus.
|
|
26
33
|
*/
|
|
27
34
|
export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
28
35
|
export interface NumberRangeValue {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/NumberField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/NumberField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EAExB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAC5C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,CACnE;IACC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,EAAE,KAAK,IAAI,CAAC;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,wEAAwE;IACxE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,qEAAqE;IACrE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yFAAyF;IACzF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,+GAqItB,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAmC,EACnC,aAAa,EACb,IAAW,EACX,GAAG,EACH,GAAG,EACH,IAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAkB,EAClB,QAAoB,EACpB,QAAoB,EACpB,SAAS,EACT,GAAG,OAAO,EACX,EAAE,qBAAqB,+BA2DvB"}
|
|
@@ -7,6 +7,11 @@ export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
7
7
|
onValueChange?: (value: number | "") => void;
|
|
8
8
|
min?: number;
|
|
9
9
|
max?: number;
|
|
10
|
+
/**
|
|
11
|
+
* The grid steppers and arrow keys move on, counted from `min` (or 0). Defaults
|
|
12
|
+
* to 1. `"any"` accepts any typed precision; its steppers move by 1, or by the
|
|
13
|
+
* largest power of ten below the range when `min` and `max` are at most 1 apart.
|
|
14
|
+
*/
|
|
10
15
|
step?: number | "any";
|
|
11
16
|
/** Rendered inside the field, before the number — "£", "$", a glyph. */
|
|
12
17
|
prefix?: ReactNode;
|
|
@@ -14,15 +19,17 @@ export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
14
19
|
suffix?: ReactNode;
|
|
15
20
|
isDisabled?: boolean;
|
|
16
21
|
isInvalid?: boolean;
|
|
17
|
-
/**
|
|
22
|
+
/** Show the − / + steppers. Defaults to true; false keeps typing and arrow keys only. */
|
|
18
23
|
hasSteppers?: boolean;
|
|
19
24
|
/** Stepper names. Include the field's label when a form has several number fields. */
|
|
20
25
|
decreaseLabel?: string;
|
|
21
26
|
increaseLabel?: string;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
|
-
* A quantity, bounded by `min` and `max`. Steppers
|
|
25
|
-
* the
|
|
29
|
+
* A quantity, bounded by `min` and `max`. Steppers and ArrowUp/ArrowDown move
|
|
30
|
+
* on the `step` grid and stop at the bounds; an empty field's first press lands
|
|
31
|
+
* on a bound at or beyond 0. Typing is never blocked; an out-of-range value
|
|
32
|
+
* reads invalid. The steppers stay out of the tab order and never take focus.
|
|
26
33
|
*/
|
|
27
34
|
export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
28
35
|
export interface NumberRangeValue {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EAExB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE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C;IAChC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAmC,EACnC,aAAa,EACb,IAAW,EACX,GAAG,EACH,GAAG,EACH,IAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAkB,EAClB,QAAoB,EACpB,QAAoB,EACpB,SAAS,EACT,GAAG,OAAO,EACX,EAAE,qBAAqB,+BA2DvB"}
|
|
@@ -1,128 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/* empty css */
|
|
3
|
-
import { r as t } from "../../chunks/binding-Bshy43sG.js";
|
|
4
|
-
import { FieldAffix as n } from "../FieldAffix/index.js";
|
|
5
|
-
import { forwardRef as r, useCallback as i, useRef as a, useState as o } from "react";
|
|
6
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/NumberField/index.tsx
|
|
8
|
-
function l(...e) {
|
|
9
|
-
return e.filter(Boolean).join(" ");
|
|
10
|
-
}
|
|
11
|
-
var u = r(function({ size: t = "md", value: r, defaultValue: u = "", onValueChange: d, min: f, max: p, step: m = 1, prefix: h, suffix: g, isDisabled: _ = !1, isInvalid: v = !1, hasSteppers: y = !0, decreaseLabel: b = "Decrease", increaseLabel: x = "Increase", className: S, disabled: C, "aria-invalid": w, ...T }, E) {
|
|
12
|
-
let [D, O] = o(u), k = r ?? D, A = a(null), j = i((e) => {
|
|
13
|
-
r === void 0 && O(e), d?.(e);
|
|
14
|
-
}, [d, r]), M = (e) => {
|
|
15
|
-
let t = (k === "" ? f ?? 0 : k) + e * (m === "any" ? 1 : m);
|
|
16
|
-
f !== void 0 && (t = Math.max(f, t)), p !== void 0 && (t = Math.min(p, t)), t = Number(t.toFixed(10)), j(t), A.current?.focus();
|
|
17
|
-
}, N = k !== "" && (f !== void 0 && k < f || p !== void 0 && k > p);
|
|
18
|
-
return /* @__PURE__ */ c("div", {
|
|
19
|
-
className: l("ds-number", S),
|
|
20
|
-
"data-size": t,
|
|
21
|
-
children: [
|
|
22
|
-
y && /* @__PURE__ */ s(e, {
|
|
23
|
-
size: t,
|
|
24
|
-
isIconOnly: !0,
|
|
25
|
-
iconStart: "minus",
|
|
26
|
-
className: "ds-number__step",
|
|
27
|
-
"aria-label": b,
|
|
28
|
-
isDisabled: _ || C || f !== void 0 && k !== "" && k <= f,
|
|
29
|
-
onClick: () => M(-1)
|
|
30
|
-
}),
|
|
31
|
-
/* @__PURE__ */ s(n, {
|
|
32
|
-
className: "ds-number__body",
|
|
33
|
-
lead: h,
|
|
34
|
-
trail: g,
|
|
35
|
-
children: /* @__PURE__ */ s("input", {
|
|
36
|
-
ref: (e) => {
|
|
37
|
-
A.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
38
|
-
},
|
|
39
|
-
type: "number",
|
|
40
|
-
inputMode: "decimal",
|
|
41
|
-
value: k,
|
|
42
|
-
min: f,
|
|
43
|
-
max: p,
|
|
44
|
-
step: m,
|
|
45
|
-
disabled: _ || C,
|
|
46
|
-
"aria-invalid": v || N || w || void 0,
|
|
47
|
-
"data-size": t,
|
|
48
|
-
className: "ds-field-skin ds-number__input",
|
|
49
|
-
onChange: (e) => {
|
|
50
|
-
let t = e.target.value;
|
|
51
|
-
j(t === "" ? "" : Number(t));
|
|
52
|
-
},
|
|
53
|
-
...T
|
|
54
|
-
})
|
|
55
|
-
}),
|
|
56
|
-
y && /* @__PURE__ */ s(e, {
|
|
57
|
-
size: t,
|
|
58
|
-
isIconOnly: !0,
|
|
59
|
-
iconStart: "plus",
|
|
60
|
-
className: "ds-number__step",
|
|
61
|
-
"aria-label": x,
|
|
62
|
-
isDisabled: _ || C || p !== void 0 && k !== "" && k >= p,
|
|
63
|
-
onClick: () => M(1)
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
function d({ value: e, defaultValue: n = {
|
|
69
|
-
min: "",
|
|
70
|
-
max: ""
|
|
71
|
-
}, onValueChange: r, size: i = "md", min: a, max: d, step: f = 1, prefix: p, suffix: m, isDisabled: h = !1, minLabel: g = "Minimum", maxLabel: _ = "Maximum", className: v, ...y }) {
|
|
72
|
-
let [b, x] = o(n), S = e ?? b, C = (t) => {
|
|
73
|
-
e === void 0 && x(t), r?.(t);
|
|
74
|
-
}, w = S.min !== "" && S.max !== "" && S.min > S.max, { attributes: T } = t(y);
|
|
75
|
-
return /* @__PURE__ */ c("div", {
|
|
76
|
-
...T,
|
|
77
|
-
className: l("ds-number-range", v),
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ s(u, {
|
|
80
|
-
"aria-invalid": y["aria-invalid"],
|
|
81
|
-
"aria-label": g,
|
|
82
|
-
decreaseLabel: `Decrease ${g}`,
|
|
83
|
-
increaseLabel: `Increase ${g}`,
|
|
84
|
-
size: i,
|
|
85
|
-
value: S.min,
|
|
86
|
-
min: a,
|
|
87
|
-
max: d,
|
|
88
|
-
step: f,
|
|
89
|
-
prefix: p,
|
|
90
|
-
suffix: m,
|
|
91
|
-
isDisabled: h,
|
|
92
|
-
isInvalid: w,
|
|
93
|
-
onValueChange: (e) => C({
|
|
94
|
-
...S,
|
|
95
|
-
min: e
|
|
96
|
-
})
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ s("span", {
|
|
99
|
-
className: "ds-number-range__dash",
|
|
100
|
-
"aria-hidden": "true",
|
|
101
|
-
children: "–"
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ s(u, {
|
|
104
|
-
"aria-invalid": y["aria-invalid"],
|
|
105
|
-
"aria-label": _,
|
|
106
|
-
decreaseLabel: `Decrease ${_}`,
|
|
107
|
-
increaseLabel: `Increase ${_}`,
|
|
108
|
-
size: i,
|
|
109
|
-
value: S.max,
|
|
110
|
-
min: a,
|
|
111
|
-
max: d,
|
|
112
|
-
step: f,
|
|
113
|
-
prefix: p,
|
|
114
|
-
suffix: m,
|
|
115
|
-
isDisabled: h,
|
|
116
|
-
isInvalid: w,
|
|
117
|
-
onValueChange: (e) => C({
|
|
118
|
-
...S,
|
|
119
|
-
max: e
|
|
120
|
-
})
|
|
121
|
-
})
|
|
122
|
-
]
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
export { u as NumberField, d as NumberRangeField };
|
|
127
|
-
|
|
128
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { t as NumberField, n as NumberRangeField } from "../../chunks/NumberField-DizR4NJv.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The bounds and step a NumberField's steppers and arrow keys move within. */
|
|
2
|
+
export interface NumberScale {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
step: number | "any";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How far one press or arrow key moves, or undefined for a step that is not a
|
|
9
|
+
* positive finite number. `"any"` has no step of its own: it moves by 1, or by
|
|
10
|
+
* the largest power of ten below the range when `min` and `max` are at most 1
|
|
11
|
+
* apart, so a 0–1 ratio moves by 0.1 instead of jumping between its ends.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stepSize({ min, max, step }: NumberScale): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Where one press or arrow key moves `current`, or undefined when it cannot move.
|
|
16
|
+
*
|
|
17
|
+
* A numeric step keeps values on the grid `min + k × step` (from 0 without a
|
|
18
|
+
* `min`), as browser stepping does, so stepped values never fail step
|
|
19
|
+
* validation. An off-grid value first moves to the neighbouring grid value, and
|
|
20
|
+
* `max` stops at the highest grid value inside it. `"any"` adds `stepSize` at
|
|
21
|
+
* the operands' precision. Results stay inside the bounds and never move
|
|
22
|
+
* against the pressed direction, so an out-of-range value only steps back in.
|
|
23
|
+
*
|
|
24
|
+
* An empty field counts as 0, except that the first press lands on a bound at
|
|
25
|
+
* or beyond 0: an empty `min: 1` field gives 1 and an empty `min: 0` field
|
|
26
|
+
* gives 0, instead of stepping past them.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stepTarget(current: number | "", direction: 1 | -1, scale: NumberScale): number | undefined;
|
|
29
|
+
//# sourceMappingURL=step.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.cts","sourceRoot":"","sources":["../../../src/components/NumberField/step.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAKD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAW5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,GAAG,EAAE,EACpB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EACjB,KAAK,EAAE,WAAW,GACjB,MAAM,GAAG,SAAS,CAcpB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The bounds and step a NumberField's steppers and arrow keys move within. */
|
|
2
|
+
export interface NumberScale {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
step: number | "any";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How far one press or arrow key moves, or undefined for a step that is not a
|
|
9
|
+
* positive finite number. `"any"` has no step of its own: it moves by 1, or by
|
|
10
|
+
* the largest power of ten below the range when `min` and `max` are at most 1
|
|
11
|
+
* apart, so a 0–1 ratio moves by 0.1 instead of jumping between its ends.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stepSize({ min, max, step }: NumberScale): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Where one press or arrow key moves `current`, or undefined when it cannot move.
|
|
16
|
+
*
|
|
17
|
+
* A numeric step keeps values on the grid `min + k × step` (from 0 without a
|
|
18
|
+
* `min`), as browser stepping does, so stepped values never fail step
|
|
19
|
+
* validation. An off-grid value first moves to the neighbouring grid value, and
|
|
20
|
+
* `max` stops at the highest grid value inside it. `"any"` adds `stepSize` at
|
|
21
|
+
* the operands' precision. Results stay inside the bounds and never move
|
|
22
|
+
* against the pressed direction, so an out-of-range value only steps back in.
|
|
23
|
+
*
|
|
24
|
+
* An empty field counts as 0, except that the first press lands on a bound at
|
|
25
|
+
* or beyond 0: an empty `min: 1` field gives 1 and an empty `min: 0` field
|
|
26
|
+
* gives 0, instead of stepping past them.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stepTarget(current: number | "", direction: 1 | -1, scale: NumberScale): number | undefined;
|
|
29
|
+
//# sourceMappingURL=step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/step.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAKD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAW5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,GAAG,EAAE,EACpB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,EACjB,KAAK,EAAE,WAAW,GACjB,MAAM,GAAG,SAAS,CAcpB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime");var n=(0,e.forwardRef)(function({title:e,description:n,actions:r,className:i,...a},o){return(0,t.jsxs)(`header`,{...a,ref:o,className:[`ds-page-header`,i].filter(Boolean).join(` `),children:[(0,t.jsxs)(`div`,{className:`ds-page-header__titles`,children:[(0,t.jsx)(`h1`,{className:`ds-page-header__title`,children:e}),n&&(0,t.jsx)(`p`,{className:`ds-page-header__description`,children:n})]}),r&&(0,t.jsx)(`div`,{className:`ds-page-header__actions`,children:r})]})});exports.PageHeader=n;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","PageHeader","rest","className","title","description","actions"],"sources":["../../../src/components/PageHeader/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n}\n\n/** Page title and actions, independent of routing. */\nexport const PageHeader = forwardRef<HTMLElement, PageHeaderProps>(function PageHeader(\n { title, description, actions, className, ...rest },\n ref,\n) {\n return (\n <header\n {...rest}\n ref={ref}\n className={[\"ds-page-header\", className].filter(Boolean).join(\" \")}\n >\n <div className=\"ds-page-header__titles\">\n <h1 className=\"ds-page-header__title\">{title}</h1>\n {description && <p className=\"ds-page-header__description\">{description}</p>}\n </div>\n {actions && <div className=\"ds-page-header__actions\">{actions}</div>}\n </header>\n );\n});\n"],"mappings":"A,yHAUA,IAAaG,GAAA,EAAaH,EAAAA,WAAAA,CAAyC,SACjE,CAAE,QAAO,cAAa,UAAS,YAAW,GAAGI,GAC7C,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,SAAD,CACE,GAAIE,EACC,MACL,UAAW,CAAC,iBAAkBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAHnE,SAAA,EAKE,EAAAH,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,yBAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,wBAAyB,SAAAI,CAAU,CAAA,EAChDC,IAAe,EAAAL,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,8BAA+B,SAAAK,CAAe,CAAA,CACxE,CACJ,CAAA,EAAAC,IAAW,EAAAN,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAM,CAAa,CAAA,CAC7D,C,EAEZ,CAAC,E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Page title and actions, independent of routing. */
|
|
8
|
+
export declare const PageHeader: import("react").ForwardRefExoticComponent<PageHeaderProps & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/PageHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACjF,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,sDAAsD;AACtD,eAAO,MAAM,UAAU,yGAiBrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Page title and actions, independent of routing. */
|
|
8
|
+
export declare const PageHeader: import("react").ForwardRefExoticComponent<PageHeaderProps & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PageHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACjF,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,sDAAsD;AACtD,eAAO,MAAM,UAAU,yGAiBrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/PageHeader/index.tsx
|
|
4
|
+
var r = e(function({ title: e, description: r, actions: i, className: a, ...o }, s) {
|
|
5
|
+
return /* @__PURE__ */ n("header", {
|
|
6
|
+
...o,
|
|
7
|
+
ref: s,
|
|
8
|
+
className: ["ds-page-header", a].filter(Boolean).join(" "),
|
|
9
|
+
children: [/* @__PURE__ */ n("div", {
|
|
10
|
+
className: "ds-page-header__titles",
|
|
11
|
+
children: [/* @__PURE__ */ t("h1", {
|
|
12
|
+
className: "ds-page-header__title",
|
|
13
|
+
children: e
|
|
14
|
+
}), r && /* @__PURE__ */ t("p", {
|
|
15
|
+
className: "ds-page-header__description",
|
|
16
|
+
children: r
|
|
17
|
+
})]
|
|
18
|
+
}), i && /* @__PURE__ */ t("div", {
|
|
19
|
+
className: "ds-page-header__actions",
|
|
20
|
+
children: i
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as PageHeader };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["PageHeader","forwardRef","rest","className","title","description","actions"],"sources":["../../../src/components/PageHeader/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, \"title\"> {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n}\n\n/** Page title and actions, independent of routing. */\nexport const PageHeader = forwardRef<HTMLElement, PageHeaderProps>(function PageHeader(\n { title, description, actions, className, ...rest },\n ref,\n) {\n return (\n <header\n {...rest}\n ref={ref}\n className={[\"ds-page-header\", className].filter(Boolean).join(\" \")}\n >\n <div className=\"ds-page-header__titles\">\n <h1 className=\"ds-page-header__title\">{title}</h1>\n {description && <p className=\"ds-page-header__description\">{description}</p>}\n </div>\n {actions && <div className=\"ds-page-header__actions\">{actions}</div>}\n </header>\n );\n});\n"],"mappings":";;;AAUA,IAAaA,IAAaC,EAAyC,SACjE,EAAE,UAAO,gBAAa,YAAS,cAAW,GAAGC,KAC7C,GACA;CACA,OACE,kBAAC,UAAD;EACE,GAAIA;EACC;EACL,WAAW,CAAC,kBAAkBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAHnE,UAAA,CAKE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;IAAyB,UAAAC;GAAU,CAAA,GAChDC,KAAe,kBAAC,KAAD;IAAG,WAAU;IAA+B,UAAAA;GAAe,CAAA,CACxE;EACJ,CAAA,GAAAC,KAAW,kBAAC,OAAD;GAAK,WAAU;GAA2B,UAAAA;EAAa,CAAA,CAC7D;;AAEZ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ds-page-header {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
gap: var(--space-6);
|
|
8
|
+
min-inline-size: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ds-page-header__titles {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: var(--space-1);
|
|
15
|
+
min-inline-size: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* reset.css is optional, so the heading and description clear UA margins. */
|
|
19
|
+
.ds-page-header__title {
|
|
20
|
+
margin: 0;
|
|
21
|
+
font-size: var(--font-size-xl);
|
|
22
|
+
font-weight: var(--font-weight-bold);
|
|
23
|
+
line-height: var(--line-height-tight);
|
|
24
|
+
overflow-wrap: anywhere;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ds-page-header__description {
|
|
28
|
+
margin: 0;
|
|
29
|
+
color: var(--color-text-muted);
|
|
30
|
+
overflow-wrap: anywhere;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-page-header__actions {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
gap: var(--space-2);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Slider-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Slider-BfvNPjRJ.cjs");exports.RangeSlider=e.t,exports.Slider=e.n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,aAAa,CAAC;AA+CrB,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,CAC1D;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,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,EACxB,IAA0B,EAC1B,aAAoB,EACpB,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAc,EACd,UAAkB,EAClB,QAAoB,EACpB,QAAoB,EACpB,SAAS,EACT,GAAG,OAAO,EACX,EAAE,gBAAgB,+BAgFlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,aAAa,CAAC;AA+CrB,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,CAC1D;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4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O,EACX,EAAE,gBAAgB,+BAgFlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as RangeSlider, n as Slider } from "../../chunks/Slider-
|
|
1
|
+
export { t as RangeSlider, n as Slider } from "../../chunks/Slider-Cab6NqhK.js";
|
|
@@ -8,6 +8,4 @@ export interface SliderScale {
|
|
|
8
8
|
export declare const sliderDefaults: SliderScale;
|
|
9
9
|
export declare function sliderScale({ min, max, step, }?: Partial<SliderScale>): SliderScale;
|
|
10
10
|
export declare function clampToScale(value: number, { min, max }: SliderScale): number;
|
|
11
|
-
/** `a + b` at the operands' decimal precision: 0.3 + -0.1 is 0.2, not 0.19999999999999998. */
|
|
12
|
-
export declare function preciseSum(a: number, b: number): number;
|
|
13
11
|
//# sourceMappingURL=scale.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE
|
|
1
|
+
{"version":3,"file":"scale.d.cts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE"}
|
|
@@ -8,6 +8,4 @@ export interface SliderScale {
|
|
|
8
8
|
export declare const sliderDefaults: SliderScale;
|
|
9
9
|
export declare function sliderScale({ min, max, step, }?: Partial<SliderScale>): SliderScale;
|
|
10
10
|
export declare function clampToScale(value: number, { min, max }: SliderScale): number;
|
|
11
|
-
/** `a + b` at the operands' decimal precision: 0.3 + -0.1 is 0.2, not 0.19999999999999998. */
|
|
12
|
-
export declare function preciseSum(a: number, b: number): number;
|
|
13
11
|
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/scale.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,WAA2C,CAAC;AAEzE,wBAAgB,WAAW,CAAC,EAC1B,GAAwB,EACxB,GAAwB,EACxB,IAA0B,GAC3B,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAEzC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,WAAW,UAEpE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-WOhlu6Rp.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(e,t){return e<t?`complete`:e===t?`current`:`upcoming`}var a=(0,n.forwardRef)(function({steps:a,activeStep:o,size:s=`md`,
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-WOhlu6Rp.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(e,t){return e<t?`complete`:e===t?`current`:`upcoming`}var a=(0,n.forwardRef)(function({steps:a,activeStep:o,size:s=`md`,orientation:c=`horizontal`,label:l=`Progress`,onStepChange:u,className:d,...f},p){let m=(0,n.useId)();return(0,r.jsx)(`nav`,{ref:p,"aria-label":l,"data-size":s,"data-orientation":c,className:[`ds-stepper`,d].filter(Boolean).join(` `),...f,children:(0,r.jsx)(`ol`,{className:`ds-stepper__list`,children:a.map((n,a)=>{let s=i(a,o),c=!!u&&s!==`upcoming`,l=(0,r.jsxs)(r.Fragment,{children:[s===`complete`?(0,r.jsx)(e.t,{name:`check`,size:16,"aria-hidden":`true`}):a+1,(0,r.jsx)(`span`,{id:`${m}-${a}-status`,className:`ds-stepper__sr`,children:s})]});return(0,r.jsxs)(`li`,{className:`ds-stepper__step`,"data-status":s,"aria-current":s===`current`?`step`:void 0,children:[(0,r.jsxs)(`span`,{className:`ds-stepper__track`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`start`}),(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`end`})]}),c?(0,r.jsx)(t.Button,{className:`ds-stepper__marker`,variant:s===`complete`?`primary`:`active`,size:`sm`,isIconOnly:!0,"aria-labelledby":`${m}-${a}-label`,"aria-describedby":`${m}-${a}-status`,onClick:()=>u?.(a,n.id),children:l}):(0,r.jsx)(`span`,{className:`ds-stepper__marker`,children:l}),(0,r.jsxs)(`span`,{className:`ds-stepper__text`,children:[(0,r.jsx)(`span`,{id:`${m}-${a}-label`,className:`ds-stepper__label`,children:n.label}),n.description&&(0,r.jsx)(`span`,{className:`ds-stepper__description`,children:n.description})]})]},n.id)})})})});exports.Stepper=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","useId","_Fragment","Icon","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","statusOf","index","activeStep","Stepper","rest","id","label","size","className","steps","status","interactive","onStepChange","marker","step"],"sources":["../../../src/components/Stepper/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nexport type StepperSize = \"sm\" | \"md\";\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface Step {\n /** Stable key, and the value reported by `onStepChange`. */\n id: string;\n /** The step in the user's words — sentence case. */\n label: ReactNode;\n /** One line on what happens here. */\n description?: ReactNode;\n}\n\nexport interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, \"onChange\" | \"children\"> {\n /** The ordered steps. Three or more spread evenly across the full width. */\n steps: Step[];\n /** Index of the step being worked on. Everything before it reads as complete. */\n activeStep: number;\n /** Marker scale. `sm` for a toolbar band, `md` for a page header. */\n size?: StepperSize;\n /** Accessible name for the progress bar. */\n label?: string;\n /**\n * Makes completed steps (and the current one) navigable. Omit for a\n * read-only progress indicator.\n */\n onStepChange?: (index: number, id: string) => void;\n}\n\nfunction statusOf(index: number, activeStep: number): StepStatus {\n if (index < activeStep) {\n return \"complete\";\n }\n if (index === activeStep) {\n return \"current\";\n }\n return \"upcoming\";\n}\n\n/**\n * A linear progress rail: 1 - 2 - 3. Steps share the row equally however many\n * there are, so the last marker always lands on the trailing edge.\n */\nexport const Stepper = forwardRef<HTMLElement, StepperProps>(function Stepper(\n {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useId","_Fragment","Icon","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","statusOf","index","activeStep","Stepper","rest","id","label","size","orientation","className","steps","status","interactive","onStepChange","marker","step"],"sources":["../../../src/components/Stepper/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nexport type StepperSize = \"sm\" | \"md\";\n/**\n * `horizontal` spreads steps across one row. `vertical` stacks them, each\n * marker beside its label. `auto` stacks while the stepper is narrower than\n * 28rem, so labels stay readable in narrow dialogs, drawers and sidebars.\n */\nexport type StepperOrientation = \"horizontal\" | \"vertical\" | \"auto\";\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface Step {\n /** Stable key, and the value reported by `onStepChange`. */\n id: string;\n /** The step in the user's words — sentence case. */\n label: ReactNode;\n /** One line on what happens here. */\n description?: ReactNode;\n}\n\nexport interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, \"onChange\" | \"children\"> {\n /** The ordered steps. Three or more spread evenly across the full width. */\n steps: Step[];\n /** Index of the step being worked on. Everything before it reads as complete. */\n activeStep: number;\n /** Marker scale. `sm` for a toolbar band, `md` for a page header. */\n size?: StepperSize;\n /** Layout of the steps. Defaults to `horizontal`. */\n orientation?: StepperOrientation;\n /** Accessible name for the progress bar. */\n label?: string;\n /**\n * Makes completed steps (and the current one) navigable. Omit for a\n * read-only progress indicator.\n */\n onStepChange?: (index: number, id: string) => void;\n}\n\nfunction statusOf(index: number, activeStep: number): StepStatus {\n if (index < activeStep) {\n return \"complete\";\n }\n if (index === activeStep) {\n return \"current\";\n }\n return \"upcoming\";\n}\n\n/**\n * A linear progress rail: 1 - 2 - 3. Steps share the row equally however many\n * there are, so the last marker always lands on the trailing edge.\n */\nexport const Stepper = forwardRef<HTMLElement, StepperProps>(function Stepper(\n {\n steps,\n activeStep,\n size = \"md\",\n orientation = \"horizontal\",\n label = \"Progress\",\n onStepChange,\n className,\n ...rest\n },\n ref,\n) {\n const id = useId();\n return (\n <nav\n ref={ref}\n aria-label={label}\n data-size={size}\n data-orientation={orientation}\n className={[\"ds-stepper\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ol className=\"ds-stepper__list\">\n {steps.map((step, index) => {\n const status = statusOf(index, activeStep);\n const interactive = Boolean(onStepChange) && status !== \"upcoming\";\n const marker = (\n <>\n {status === \"complete\" ? (\n <Icon\n name=\"check\"\n size={16}\n aria-hidden=\"true\"\n />\n ) : (\n index + 1\n )}\n <span\n id={`${id}-${index}-status`}\n className=\"ds-stepper__sr\"\n >\n {status}\n </span>\n </>\n );\n return (\n <li\n key={step.id}\n className=\"ds-stepper__step\"\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n >\n <span\n className=\"ds-stepper__track\"\n aria-hidden=\"true\"\n >\n <span\n className=\"ds-stepper__connector\"\n data-side=\"start\"\n />\n <span\n className=\"ds-stepper__connector\"\n data-side=\"end\"\n />\n </span>\n {interactive ? (\n <Button\n className=\"ds-stepper__marker\"\n variant={status === \"complete\" ? \"primary\" : \"active\"}\n size=\"sm\"\n isIconOnly\n aria-labelledby={`${id}-${index}-label`}\n aria-describedby={`${id}-${index}-status`}\n onClick={() => onStepChange?.(index, step.id)}\n >\n {marker}\n </Button>\n ) : (\n <span className=\"ds-stepper__marker\">{marker}</span>\n )}\n <span className=\"ds-stepper__text\">\n <span\n id={`${id}-${index}-label`}\n className=\"ds-stepper__label\"\n >\n {step.label}\n </span>\n {step.description && (\n <span className=\"ds-stepper__description\">{step.description}</span>\n )}\n </span>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\n"],"mappings":"A,4MAyCA,SAASS,EAAS,EAAe,EAAgC,CAO/D,OANIC,EAAQC,EACH,WAELD,IAAUC,EACL,UAEF,UACT,CAMA,IAAaC,GAAA,EAAUZ,EAAAA,WAAAA,CAAsC,SAC3D,CACE,QACA,aACA,OAAO,KACP,cAAc,aACd,QAAQ,WACR,eACA,YACA,GAAGa,GAEL,EACA,CACA,IAAMC,GAAA,EAAKb,EAAAA,MAAAA,CAAM,EACjB,OACE,EAAAO,EAAA,IAAA,CAAC,MAAD,CACO,MACL,aAAYO,EACZ,YAAWC,EACX,mBAAkBC,EAClB,UAAW,CAAC,aAAcC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC7D,GAAIL,EAEJ,UAAA,EAAAL,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,mBACX,SAAAW,EAAM,KAAK,EAAM,IAAU,CAC1B,IAAMC,EAASX,EAASC,EAAOC,CAAU,EACnCU,EAAc,EAAQC,GAAiBF,IAAW,WAClDG,GACJ,EAAAf,EAAA,KAAA,CAAAN,EAAAA,SAAA,CAAA,SAAA,CACGkB,IAAW,YACV,EAAAZ,EAAA,IAAA,CAACL,EAAAA,EAAD,CACE,KAAK,QACL,KAAM,GACN,cAAY,MACb,CAAA,EAEDO,EAAQ,GAEV,EAAAF,EAAA,IAAA,CAAC,OAAD,CACE,GAAI,GAAGM,EAAG,GAAGJ,EAAM,SACnB,UAAU,iBAET,SAAAU,CACG,CAAA,CACN,CAAA,CAAA,EAEJ,OACE,EAAAZ,EAAA,KAAA,CAAC,KAAD,CAEE,UAAU,mBACV,cAAaY,EACb,eAAcA,IAAW,UAAY,OAAS,IAAA,GAJhD,SAAA,EAME,EAAAZ,EAAA,KAAA,CAAC,OAAD,CACE,UAAU,oBACV,cAAY,OAFd,SAAA,EAIE,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,UAAU,wBACV,YAAU,OACX,CAAA,GACD,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,UAAU,wBACV,YAAU,KACX,CAAA,CACG,C,GACLa,GACC,EAAAb,EAAA,IAAA,CAACJ,EAAAA,OAAD,CACE,UAAU,qBACV,QAASgB,IAAW,WAAa,UAAY,SAC7C,KAAK,KACL,WAAA,GACA,kBAAiB,GAAGN,EAAG,GAAGJ,EAAM,QAChC,mBAAkB,GAAGI,EAAG,GAAGJ,EAAM,SACjC,YAAeY,IAAeZ,EAAOc,EAAK,EAAE,EAE3C,SAAAD,CACK,CAAA,GAER,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qBAAsB,SAAAe,CAAa,CAAA,GAErD,EAAAf,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,mBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,GAAI,GAAGM,EAAG,GAAGJ,EAAM,QACnB,UAAU,oBAET,SAAAc,EAAK,KACF,CAAA,EACLA,EAAK,cACJ,EAAAhB,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,0BAA2B,SAAAgB,EAAK,WAAkB,CAAA,CAEhE,C,EACJ,CA5CG,EAAAA,EAAK,EA4CR,CAER,CAAC,CACC,CAAA,CACD,CAAA,CAET,CAAC,E"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
2
|
export type StepperSize = "sm" | "md";
|
|
3
|
+
/**
|
|
4
|
+
* `horizontal` spreads steps across one row. `vertical` stacks them, each
|
|
5
|
+
* marker beside its label. `auto` stacks while the stepper is narrower than
|
|
6
|
+
* 28rem, so labels stay readable in narrow dialogs, drawers and sidebars.
|
|
7
|
+
*/
|
|
8
|
+
export type StepperOrientation = "horizontal" | "vertical" | "auto";
|
|
3
9
|
export type StepStatus = "complete" | "current" | "upcoming";
|
|
4
10
|
export interface Step {
|
|
5
11
|
/** Stable key, and the value reported by `onStepChange`. */
|
|
@@ -16,6 +22,8 @@ export interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, "onChang
|
|
|
16
22
|
activeStep: number;
|
|
17
23
|
/** Marker scale. `sm` for a toolbar band, `md` for a page header. */
|
|
18
24
|
size?: StepperSize;
|
|
25
|
+
/** Layout of the steps. Defaults to `horizontal`. */
|
|
26
|
+
orientation?: StepperOrientation;
|
|
19
27
|
/** Accessible name for the progress bar. */
|
|
20
28
|
label?: string;
|
|
21
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Stepper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7D,MAAM,WAAW,IAAI;IACnB,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,KAAK,EAAE,SAAS,CAAC;IACjB,qCAAqC;IACrC,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9F,4EAA4E;IAC5E,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,IAAI,CAA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AAYD;;;GAGG;AACH,eAAO,MAAM,OAAO,sGAkGlB,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
2
|
export type StepperSize = "sm" | "md";
|
|
3
|
+
/**
|
|
4
|
+
* `horizontal` spreads steps across one row. `vertical` stacks them, each
|
|
5
|
+
* marker beside its label. `auto` stacks while the stepper is narrower than
|
|
6
|
+
* 28rem, so labels stay readable in narrow dialogs, drawers and sidebars.
|
|
7
|
+
*/
|
|
8
|
+
export type StepperOrientation = "horizontal" | "vertical" | "auto";
|
|
3
9
|
export type StepStatus = "complete" | "current" | "upcoming";
|
|
4
10
|
export interface Step {
|
|
5
11
|
/** Stable key, and the value reported by `onStepChange`. */
|
|
@@ -16,6 +22,8 @@ export interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, "onChang
|
|
|
16
22
|
activeStep: number;
|
|
17
23
|
/** Marker scale. `sm` for a toolbar band, `md` for a page header. */
|
|
18
24
|
size?: StepperSize;
|
|
25
|
+
/** Layout of the steps. Defaults to `horizontal`. */
|
|
26
|
+
orientation?: StepperOrientation;
|
|
19
27
|
/** Accessible name for the progress bar. */
|
|
20
28
|
label?: string;
|
|
21
29
|
/**
|