@manakind/ui-core 0.11.1 → 0.11.3
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/field/field.d.ts +5 -4
- package/dist/field/field.d.ts.map +1 -1
- package/dist/field/field.js +8 -4
- package/dist/field/field.js.map +1 -1
- package/dist/field/use-field-control.d.ts +13 -1
- package/dist/field/use-field-control.d.ts.map +1 -1
- package/dist/field/use-field-control.js +29 -5
- package/dist/field/use-field-control.js.map +1 -1
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/progress.js +5 -2
- package/dist/progress/progress.js.map +1 -1
- package/package.json +2 -2
package/dist/field/field.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import './field.css';
|
|
3
3
|
export type FieldProps = {
|
|
4
4
|
/** Visible label. The field's control is named by it, so it is required. */
|
|
@@ -39,9 +39,10 @@ export type FieldProps = {
|
|
|
39
39
|
/**
|
|
40
40
|
* A labelled form control with optional hint and error, built on Ark UI.
|
|
41
41
|
*
|
|
42
|
-
* Ark owns the wiring: the label's `for`,
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* Ark owns most of the wiring: the label's `for`, `aria-invalid`, `required`,
|
|
43
|
+
* `disabled` and `readOnly`. The control's `aria-describedby` is composed
|
|
44
|
+
* here from what the field renders, the error first and then the hint, so it
|
|
45
|
+
* does not depend on which attribute a given Ark version uses for the error. This wrapper decides what renders and contributes the
|
|
45
46
|
* `ds-field` classes and the `--ds-field-*` bindings. The control is whatever
|
|
46
47
|
* you put inside: an `Input`, a `Textarea`, or a future Ark field part.
|
|
47
48
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field/field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field/field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,aAAa,CAAC;AAGrB,MAAM,MAAM,UAAU,GAAG;IACvB,4EAA4E;IAC5E,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB,wEAAwE;IACxE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsBF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,SAAS,GACV,EAAE,UAAU,2CAqBZ"}
|
package/dist/field/field.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Field as ArkField, useFieldContext } from '@ark-ui/react/field';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { FieldPartsContext } from './use-field-control';
|
|
3
5
|
import './field.css';
|
|
4
6
|
import { cx } from '../cx';
|
|
5
7
|
/**
|
|
@@ -20,9 +22,10 @@ function FieldLabel({ children }) {
|
|
|
20
22
|
/**
|
|
21
23
|
* A labelled form control with optional hint and error, built on Ark UI.
|
|
22
24
|
*
|
|
23
|
-
* Ark owns the wiring: the label's `for`,
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Ark owns most of the wiring: the label's `for`, `aria-invalid`, `required`,
|
|
26
|
+
* `disabled` and `readOnly`. The control's `aria-describedby` is composed
|
|
27
|
+
* here from what the field renders, the error first and then the hint, so it
|
|
28
|
+
* does not depend on which attribute a given Ark version uses for the error. This wrapper decides what renders and contributes the
|
|
26
29
|
* `ds-field` classes and the `--ds-field-*` bindings. The control is whatever
|
|
27
30
|
* you put inside: an `Input`, a `Textarea`, or a future Ark field part.
|
|
28
31
|
*
|
|
@@ -35,6 +38,7 @@ function FieldLabel({ children }) {
|
|
|
35
38
|
export function Field({ label, children, hint, error, invalid, required, disabled, readOnly, id, className, }) {
|
|
36
39
|
const hasHint = Boolean(hint);
|
|
37
40
|
const hasError = Boolean(error);
|
|
38
|
-
|
|
41
|
+
const parts = useMemo(() => ({ hasHint, hasError }), [hasHint, hasError]);
|
|
42
|
+
return (_jsx(FieldPartsContext.Provider, { value: parts, children: _jsxs(ArkField.Root, { id: id, invalid: invalid ?? hasError, required: required, disabled: disabled, readOnly: readOnly, className: cx('ds-field', className), children: [_jsx(FieldLabel, { children: label }), children, hasHint && _jsx(ArkField.HelperText, { className: "ds-field__hint", children: hint }), hasError && _jsx(ArkField.ErrorText, { className: "ds-field__message", children: error })] }) }));
|
|
39
43
|
}
|
|
40
44
|
//# sourceMappingURL=field.js.map
|
package/dist/field/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/field/field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/field/field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,eAAe,EAAE,M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,QAAQ,IAAC,KAAK,EAAE,KAAK,YACtC,MAAC,QAAQ,CAAC,IAAI,IACZ,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,IAAI,QAAQ,EAC5B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,aAEpC,KAAC,UAAU,cAAE,KAAK,GAAc,EAC/B,QAAQ,EACR,OAAO,IAAI,KAAC,QAAQ,CAAC,UAAU,IAAC,SAAS,EAAC,gBAAgB,YAAE,IAAI,GAAuB,EACvF,QAAQ,IAAI,KAAC,QAAQ,CAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,YAAE,KAAK,GAAsB,IAC7E,GACW,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which text parts the `Field` is rendering. Ark decides the control's
|
|
3
|
+
* description from what it finds in the DOM, and which attribute carries
|
|
4
|
+
* the error changed between Ark versions (`aria-describedby` up to 5.36,
|
|
5
|
+
* `aria-errormessage` from 5.39). The field knows what it renders, so the
|
|
6
|
+
* wrapper composes the description from that and stays the same on every
|
|
7
|
+
* Ark version: the error first, then the hint.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FieldPartsContext: import("react").Context<{
|
|
10
|
+
hasHint: boolean;
|
|
11
|
+
hasError: boolean;
|
|
12
|
+
}>;
|
|
1
13
|
type ControlProps = {
|
|
2
14
|
id?: string;
|
|
3
15
|
'aria-describedby'?: string;
|
|
@@ -17,7 +29,7 @@ export type FieldControl = {
|
|
|
17
29
|
id: string;
|
|
18
30
|
/** Id of the field's label, for `aria-labelledby` on an element a `<label for>` cannot name. */
|
|
19
31
|
labelId: string;
|
|
20
|
-
/** Ids of the
|
|
32
|
+
/** Ids of the error, while invalid, and the hint. Put it in `aria-describedby`. */
|
|
21
33
|
describedBy: string | undefined;
|
|
22
34
|
invalid: boolean;
|
|
23
35
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field-control.d.ts","sourceRoot":"","sources":["../../src/field/use-field-control.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-field-control.d.ts","sourceRoot":"","sources":["../../src/field/use-field-control.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;aAA4B,OAAO;cAAY,OAAO;EAGlF,CAAC;AAEH,KAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAgBF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAKxE;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,gGAAgG;IAChG,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAYrD"}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { useFieldContext } from '@ark-ui/react/field';
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Which text parts the `Field` is rendering. Ark decides the control's
|
|
5
|
+
* description from what it finds in the DOM, and which attribute carries
|
|
6
|
+
* the error changed between Ark versions (`aria-describedby` up to 5.36,
|
|
7
|
+
* `aria-errormessage` from 5.39). The field knows what it renders, so the
|
|
8
|
+
* wrapper composes the description from that and stays the same on every
|
|
9
|
+
* Ark version: the error first, then the hint.
|
|
10
|
+
*/
|
|
11
|
+
export const FieldPartsContext = createContext({
|
|
12
|
+
hasHint: false,
|
|
13
|
+
hasError: false,
|
|
14
|
+
});
|
|
15
|
+
function useFieldDescription() {
|
|
16
|
+
const field = useFieldContext();
|
|
17
|
+
const parts = useContext(FieldPartsContext);
|
|
18
|
+
if (!field)
|
|
19
|
+
return { field };
|
|
20
|
+
const ids = [
|
|
21
|
+
field.invalid && parts.hasError ? field.ids.errorText : undefined,
|
|
22
|
+
parts.hasHint ? field.ids.helperText : undefined,
|
|
23
|
+
].filter(Boolean);
|
|
24
|
+
return { field, describedBy: ids.length ? ids.join(' ') : undefined };
|
|
25
|
+
}
|
|
2
26
|
/**
|
|
3
27
|
* Inside a `Field`, the field owns the control's `id` (the label's `for`
|
|
4
28
|
* points at it) and its description (the hint and the error). Ark lets any
|
|
@@ -9,11 +33,11 @@ import { useFieldContext } from '@ark-ui/react/field';
|
|
|
9
33
|
* props pass through untouched.
|
|
10
34
|
*/
|
|
11
35
|
export function useFieldControlProps(props) {
|
|
12
|
-
const field =
|
|
36
|
+
const { field, describedBy } = useFieldDescription();
|
|
13
37
|
if (!field)
|
|
14
38
|
return props;
|
|
15
|
-
const
|
|
16
|
-
return { ...props, id: field.ids.control, 'aria-describedby':
|
|
39
|
+
const merged = [describedBy, props['aria-describedby']].filter(Boolean).join(' ');
|
|
40
|
+
return { ...props, id: field.ids.control, 'aria-describedby': merged || undefined };
|
|
17
41
|
}
|
|
18
42
|
/**
|
|
19
43
|
* The field's wiring for a control that is not an `Input` or a `Textarea`:
|
|
@@ -28,13 +52,13 @@ export function useFieldControlProps(props) {
|
|
|
28
52
|
* ```
|
|
29
53
|
*/
|
|
30
54
|
export function useFieldControl() {
|
|
31
|
-
const field =
|
|
55
|
+
const { field, describedBy } = useFieldDescription();
|
|
32
56
|
if (!field)
|
|
33
57
|
return null;
|
|
34
58
|
return {
|
|
35
59
|
id: field.ids.control,
|
|
36
60
|
labelId: field.ids.label,
|
|
37
|
-
describedBy
|
|
61
|
+
describedBy,
|
|
38
62
|
invalid: field.invalid,
|
|
39
63
|
disabled: field.disabled,
|
|
40
64
|
readOnly: field.readOnly,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-field-control.js","sourceRoot":"","sources":["../../src/field/use-field-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-field-control.js","sourceRoot":"","sources":["../../src/field/use-field-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAA0C;IACtF,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAOH,SAAS,mBAAmB;IAI1B,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG;QACV,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACjE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;KACjD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,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,KAAK,CAAC;CACtB,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,cAAc,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,EACvC,UAAU,GAAG,YAAY,GAAG,iBAAiB,GAAG,SAAS,CAC1D,GACC,YAAY,GAAG;IACb,+EAA+E;IAC/E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEJ;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,aAAa,2CA6Bf"}
|
|
@@ -24,7 +24,10 @@ import { cx } from '../cx';
|
|
|
24
24
|
*/
|
|
25
25
|
export function Progress({ size = 'md', label, valueText, className, 'aria-label': ariaLabel, ...props }) {
|
|
26
26
|
const labelId = useId();
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
// Empty strings and numeric zero are supplied labels. An undefined ARIA
|
|
28
|
+
// override would leave Ark's generated percentage name in place.
|
|
29
|
+
const hasLabel = label !== undefined;
|
|
30
|
+
const hasHeader = hasLabel || Boolean(valueText);
|
|
31
|
+
return (_jsxs(ArkProgress.Root, { className: cx('ds-progress', `ds-progress--${size}`, className), ...props, children: [hasHeader && (_jsxs("div", { className: "ds-progress__header", children: [hasLabel ? (_jsx(ArkProgress.Label, { id: labelId, className: "ds-progress__label", children: label })) : (_jsx("span", {})), valueText && _jsx("span", { className: "ds-progress__value-text", children: valueText })] })), _jsx(ArkProgress.Track, { className: "ds-progress__track", ...(hasLabel ? { 'aria-labelledby': labelId } : { 'aria-label': ariaLabel }), children: _jsx(ArkProgress.Range, { className: "ds-progress__range" }) })] }));
|
|
29
32
|
}
|
|
30
33
|
//# sourceMappingURL=progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/progress/progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAyC3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,GAAG,IAAI,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACM;IACd,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/progress/progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAyC3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,GAAG,IAAI,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACM;IACd,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,wEAAwE;IACxE,iEAAiE;IACjE,MAAM,QAAQ,GAAG,KAAK,KAAK,SAAS,CAAC;IACrC,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAEjD,OAAO,CACL,MAAC,WAAW,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,gBAAgB,IAAI,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,aACzF,SAAS,IAAI,CACZ,eAAK,SAAS,EAAC,qBAAqB,aACjC,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,WAAW,CAAC,KAAK,IAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,oBAAoB,YAC3D,KAAK,GACY,CACrB,CAAC,CAAC,CAAC,CACF,gBAAQ,CACT,EACA,SAAS,IAAI,eAAM,SAAS,EAAC,yBAAyB,YAAE,SAAS,GAAQ,IACtE,CACP,EACD,KAAC,WAAW,CAAC,KAAK,IAChB,SAAS,EAAC,oBAAoB,KAC1B,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,YAE7E,KAAC,WAAW,CAAC,KAAK,IAAC,SAAS,EAAC,oBAAoB,GAAG,GAClC,IACH,CACpB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manakind/ui-core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"typecheck": "tsc --noEmit"
|
|
139
139
|
},
|
|
140
140
|
"dependencies": {
|
|
141
|
-
"@ark-ui/react": "^5.
|
|
141
|
+
"@ark-ui/react": "^5.39.2"
|
|
142
142
|
},
|
|
143
143
|
"peerDependencies": {
|
|
144
144
|
"react": "^19.0.0",
|