@tooark/react 1.2.2 → 1.3.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 +21 -3
- package/README.pt-BR.md +21 -3
- package/dist/ark-alert.d.ts +12 -1
- package/dist/ark-alert.js +7 -6
- package/dist/ark-avatar.d.ts +8 -1
- package/dist/ark-avatar.js +4 -3
- package/dist/ark-badge.d.ts +6 -1
- package/dist/ark-badge.js +4 -3
- package/dist/ark-button.d.ts +7 -1
- package/dist/ark-button.js +4 -3
- package/dist/ark-calendar.d.ts +15 -2
- package/dist/ark-calendar.js +7 -6
- package/dist/ark-card.d.ts +8 -1
- package/dist/ark-card.js +4 -3
- package/dist/ark-carousel.d.ts +10 -1
- package/dist/ark-carousel.js +7 -6
- package/dist/ark-checkbox.d.ts +16 -1
- package/dist/ark-checkbox.js +7 -6
- package/dist/ark-clock.d.ts +10 -2
- package/dist/ark-clock.js +7 -6
- package/dist/ark-color-swatches.d.ts +15 -1
- package/dist/ark-color-swatches.js +7 -6
- package/dist/ark-command-palette.d.ts +40 -2
- package/dist/ark-command-palette.js +9 -7
- package/dist/ark-copy-button.d.ts +16 -1
- package/dist/ark-copy-button.js +7 -6
- package/dist/ark-datepicker.d.ts +13 -1
- package/dist/ark-datepicker.js +7 -6
- package/dist/ark-dialog.d.ts +22 -1
- package/dist/ark-dialog.js +6 -5
- package/dist/ark-drawer.d.ts +22 -1
- package/dist/ark-drawer.js +6 -5
- package/dist/ark-empty.d.ts +10 -1
- package/dist/ark-empty.js +4 -3
- package/dist/ark-file-input.d.ts +23 -1
- package/dist/ark-file-input.js +7 -6
- package/dist/ark-input.d.ts +34 -1
- package/dist/ark-input.js +7 -6
- package/dist/ark-kbd.d.ts +6 -1
- package/dist/ark-kbd.js +4 -3
- package/dist/ark-kv-editor.d.ts +39 -2
- package/dist/ark-kv-editor.js +16 -8
- package/dist/ark-mark.d.ts +6 -1
- package/dist/ark-mark.js +4 -3
- package/dist/ark-menu.d.ts +34 -2
- package/dist/ark-menu.js +9 -7
- package/dist/ark-progress.d.ts +14 -1
- package/dist/ark-progress.js +4 -3
- package/dist/ark-radio.d.ts +17 -1
- package/dist/ark-radio.js +7 -6
- package/dist/ark-scheduler.d.ts +25 -2
- package/dist/ark-scheduler.js +7 -6
- package/dist/ark-select.d.ts +20 -1
- package/dist/ark-select.js +7 -6
- package/dist/ark-shape-picker.d.ts +17 -1
- package/dist/ark-shape-picker.js +9 -7
- package/dist/ark-skeleton.d.ts +11 -1
- package/dist/ark-skeleton.js +4 -3
- package/dist/ark-spinner.d.ts +6 -1
- package/dist/ark-spinner.js +4 -3
- package/dist/ark-split-pane.d.ts +12 -1
- package/dist/ark-split-pane.js +7 -6
- package/dist/ark-status-dot.d.ts +6 -1
- package/dist/ark-status-dot.js +4 -3
- package/dist/ark-switch.d.ts +12 -2
- package/dist/ark-switch.js +7 -6
- package/dist/ark-tabs.d.ts +30 -2
- package/dist/ark-tabs.js +10 -8
- package/dist/ark-textarea.d.ts +34 -1
- package/dist/ark-textarea.js +7 -6
- package/dist/ark-toaster.d.ts +9 -1
- package/dist/ark-toaster.js +7 -6
- package/dist/ark-toggle.d.ts +21 -2
- package/dist/ark-toggle.js +12 -11
- package/dist/ark-tooltip.d.ts +10 -1
- package/dist/ark-tooltip.js +4 -3
- package/dist/jsx-intrinsics.d.ts +8 -0
- package/dist/use-forwarded-ref.d.ts +3 -0
- package/dist/use-forwarded-ref.js +31 -0
- package/package.json +3 -3
package/dist/ark-menu.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ArkMenuAlign, ArkMenuDirection, ArkMenuItemStyleOptions, ArkMenuStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkMenu as ArkMenuElement, ArkMenuItem as ArkMenuItemElement } from "@tooark/web-components";
|
|
2
3
|
import React, { type PropsWithChildren } from "react";
|
|
3
4
|
export type ArkMenuProps = PropsWithChildren<ArkMenuStyleOptions & {
|
|
4
5
|
/** id do gatilho (vira o atributo for): o menu escreve aria-* nele e escuta clique e setas. */
|
|
@@ -18,7 +19,26 @@ export type ArkMenuProps = PropsWithChildren<ArkMenuStyleOptions & {
|
|
|
18
19
|
onOpen?: (event: CustomEvent) => void;
|
|
19
20
|
onClose?: (event: CustomEvent) => void;
|
|
20
21
|
}>;
|
|
21
|
-
export declare
|
|
22
|
+
export declare const ArkMenu: React.ForwardRefExoticComponent<ArkMenuStyleOptions & {
|
|
23
|
+
/** id do gatilho (vira o atributo for): o menu escreve aria-* nele e escuta clique e setas. */
|
|
24
|
+
htmlFor?: string;
|
|
25
|
+
/** Aberto; refletido do estado do popover. */
|
|
26
|
+
open?: boolean;
|
|
27
|
+
/** Alinhamento em relacao ao gatilho. Padrao: "start". */
|
|
28
|
+
align?: ArkMenuAlign;
|
|
29
|
+
/** Lado do gatilho; vira quando nao cabe. Padrao: "down". */
|
|
30
|
+
direction?: ArkMenuDirection;
|
|
31
|
+
"aria-label"?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Um item foi escolhido; o menu fecha em seguida. */
|
|
34
|
+
onSelect?: (event: CustomEvent<{
|
|
35
|
+
value: string;
|
|
36
|
+
}>) => void;
|
|
37
|
+
onOpen?: (event: CustomEvent) => void;
|
|
38
|
+
onClose?: (event: CustomEvent) => void;
|
|
39
|
+
} & {
|
|
40
|
+
children?: React.ReactNode | undefined;
|
|
41
|
+
} & React.RefAttributes<ArkMenuElement>>;
|
|
22
42
|
export type ArkMenuItemProps = PropsWithChildren<ArkMenuItemStyleOptions & {
|
|
23
43
|
value?: string;
|
|
24
44
|
disabled?: boolean;
|
|
@@ -30,4 +50,16 @@ export type ArkMenuItemProps = PropsWithChildren<ArkMenuItemStyleOptions & {
|
|
|
30
50
|
static?: boolean;
|
|
31
51
|
className?: string;
|
|
32
52
|
}>;
|
|
33
|
-
export declare
|
|
53
|
+
export declare const ArkMenuItem: React.ForwardRefExoticComponent<ArkMenuItemStyleOptions & {
|
|
54
|
+
value?: string;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/** Item checkbox: true marcado, false desmarcado; omitido e um item comum. */
|
|
57
|
+
checked?: boolean;
|
|
58
|
+
/** Linha separadora (role separator). */
|
|
59
|
+
divider?: boolean;
|
|
60
|
+
/** Conteudo nao interativo (nome e e-mail), sem role de item. */
|
|
61
|
+
static?: boolean;
|
|
62
|
+
className?: string;
|
|
63
|
+
} & {
|
|
64
|
+
children?: React.ReactNode | undefined;
|
|
65
|
+
} & React.RefAttributes<ArkMenuItemElement>>;
|
package/dist/ark-menu.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
3
4
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
4
|
-
export function ArkMenu(props) {
|
|
5
|
+
export const ArkMenu = forwardRef(function ArkMenu(props, forwardedRef) {
|
|
5
6
|
const { children, className, htmlFor, open, onSelect, onOpen, onClose, ...rest } = props;
|
|
6
|
-
const ref =
|
|
7
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
7
8
|
useEffect(() => {
|
|
8
9
|
ensureTooarkComponentsRegistered();
|
|
9
10
|
}, []);
|
|
@@ -25,20 +26,21 @@ export function ArkMenu(props) {
|
|
|
25
26
|
}, [onSelect, onOpen, onClose]);
|
|
26
27
|
const attrs = {
|
|
27
28
|
...rest,
|
|
28
|
-
ref,
|
|
29
|
+
ref: setRef,
|
|
29
30
|
class: className,
|
|
30
31
|
for: htmlFor,
|
|
31
32
|
open: open ? "" : undefined
|
|
32
33
|
};
|
|
33
34
|
return createElement("ark-menu", attrs, children);
|
|
34
|
-
}
|
|
35
|
-
export function ArkMenuItem(props) {
|
|
35
|
+
});
|
|
36
|
+
export const ArkMenuItem = forwardRef(function ArkMenuItem(props, forwardedRef) {
|
|
36
37
|
const { children, className, disabled, checked, divider, static: isStatic, ...rest } = props;
|
|
37
38
|
useEffect(() => {
|
|
38
39
|
ensureTooarkComponentsRegistered();
|
|
39
40
|
}, []);
|
|
40
41
|
const attrs = {
|
|
41
42
|
...rest,
|
|
43
|
+
ref: forwardedRef,
|
|
42
44
|
class: className,
|
|
43
45
|
disabled: disabled ? "" : undefined,
|
|
44
46
|
checked: checked === undefined ? undefined : checked ? "" : "false",
|
|
@@ -46,4 +48,4 @@ export function ArkMenuItem(props) {
|
|
|
46
48
|
static: isStatic ? "" : undefined
|
|
47
49
|
};
|
|
48
50
|
return createElement("ark-menu-item", attrs, children);
|
|
49
|
-
}
|
|
51
|
+
});
|
package/dist/ark-progress.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ArkProgressStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkProgress as ArkProgressElement } from "@tooark/web-components";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
export type ArkProgressProps = ArkProgressStyleOptions & {
|
|
4
5
|
/** Valor atual, de 0 a max. Padrao: 0. */
|
|
@@ -13,4 +14,16 @@ export type ArkProgressProps = ArkProgressStyleOptions & {
|
|
|
13
14
|
showValue?: boolean;
|
|
14
15
|
className?: string;
|
|
15
16
|
};
|
|
16
|
-
export declare
|
|
17
|
+
export declare const ArkProgress: React.ForwardRefExoticComponent<ArkProgressStyleOptions & {
|
|
18
|
+
/** Valor atual, de 0 a max. Padrao: 0. */
|
|
19
|
+
value?: number;
|
|
20
|
+
/** Valor maximo. Padrao: 100. */
|
|
21
|
+
max?: number;
|
|
22
|
+
/** Segmento em loop no lugar do valor (loader continuo, isento de movimento reduzido). */
|
|
23
|
+
indeterminate?: boolean;
|
|
24
|
+
/** Nome acessivel (aria-label). */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Mostra a porcentagem ao lado do trilho. */
|
|
27
|
+
showValue?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
} & React.RefAttributes<ArkProgressElement>>;
|
package/dist/ark-progress.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { createElement, useEffect } from "react";
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
export function ArkProgress(props) {
|
|
3
|
+
export const ArkProgress = forwardRef(function ArkProgress(props, forwardedRef) {
|
|
4
4
|
const { className, value, max, indeterminate, showValue, ...rest } = props;
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
ensureTooarkComponentsRegistered();
|
|
7
7
|
}, []);
|
|
8
8
|
const attrs = {
|
|
9
9
|
...rest,
|
|
10
|
+
ref: forwardedRef,
|
|
10
11
|
class: className,
|
|
11
12
|
value: value === undefined ? undefined : String(value),
|
|
12
13
|
max: max === undefined ? undefined : String(max),
|
|
@@ -14,4 +15,4 @@ export function ArkProgress(props) {
|
|
|
14
15
|
"show-value": showValue ? "" : undefined
|
|
15
16
|
};
|
|
16
17
|
return createElement("ark-progress", attrs);
|
|
17
|
-
}
|
|
18
|
+
});
|
package/dist/ark-radio.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ArkRadioStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkRadio as ArkRadioElement } from "@tooark/web-components";
|
|
2
3
|
import React, { type PropsWithChildren } from "react";
|
|
3
4
|
export type ArkRadioProps = PropsWithChildren<ArkRadioStyleOptions & {
|
|
4
5
|
disabled?: boolean;
|
|
@@ -14,4 +15,19 @@ export type ArkRadioProps = PropsWithChildren<ArkRadioStyleOptions & {
|
|
|
14
15
|
value: string;
|
|
15
16
|
}>) => void;
|
|
16
17
|
}>;
|
|
17
|
-
export declare
|
|
18
|
+
export declare const ArkRadio: React.ForwardRefExoticComponent<ArkRadioStyleOptions & {
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Nome do grupo: agrupa no formulario e para setas/roving tabindex. */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Valor submetido e publicado em `change` quando marcado. Padrao: "on". */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** Rotulo proprio (<label for>); sem ele use aria-label ou filhos como rotulo livre. */
|
|
25
|
+
label?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Dispara so no radio que ganhou a marca. */
|
|
28
|
+
onChange?: (event: CustomEvent<{
|
|
29
|
+
value: string;
|
|
30
|
+
}>) => void;
|
|
31
|
+
} & {
|
|
32
|
+
children?: React.ReactNode | undefined;
|
|
33
|
+
} & React.RefAttributes<ArkRadioElement>>;
|
package/dist/ark-radio.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
|
+
export const ArkRadio = forwardRef(function ArkRadio(props, forwardedRef) {
|
|
4
5
|
const { children, className, checked, disabled, onChange, ...rest } = props;
|
|
5
|
-
const ref =
|
|
6
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
ensureTooarkComponentsRegistered();
|
|
8
9
|
}, []);
|
|
@@ -13,13 +14,13 @@ export function ArkRadio(props) {
|
|
|
13
14
|
const handler = (event) => onChange(event);
|
|
14
15
|
el.addEventListener("change", handler);
|
|
15
16
|
return () => el.removeEventListener("change", handler);
|
|
16
|
-
}, [onChange]);
|
|
17
|
+
}, [ref, onChange]);
|
|
17
18
|
const attrs = {
|
|
18
19
|
...rest,
|
|
19
|
-
ref,
|
|
20
|
+
ref: setRef,
|
|
20
21
|
class: className,
|
|
21
22
|
checked: checked ? "" : undefined,
|
|
22
23
|
disabled: disabled ? "" : undefined
|
|
23
24
|
};
|
|
24
25
|
return createElement("ark-radio", attrs, children);
|
|
25
|
-
}
|
|
26
|
+
});
|
package/dist/ark-scheduler.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ArkDatepickerLang, ArkSchedulerEvent, ArkSchedulerStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import type { ArkScheduler as ArkSchedulerElement } from "@tooark/web-components";
|
|
3
|
+
import type React from "react";
|
|
3
4
|
export type ArkSchedulerProps = ArkSchedulerStyleOptions & {
|
|
4
5
|
lang?: ArkDatepickerLang;
|
|
5
6
|
/** JSON com strings próprias, mesclado sobre o inglês, quando lang é "custom". */
|
|
@@ -23,4 +24,26 @@ export type ArkSchedulerProps = ArkSchedulerStyleOptions & {
|
|
|
23
24
|
view: string;
|
|
24
25
|
}) => void;
|
|
25
26
|
};
|
|
26
|
-
export declare
|
|
27
|
+
export declare const ArkScheduler: React.ForwardRefExoticComponent<ArkSchedulerStyleOptions & {
|
|
28
|
+
lang?: ArkDatepickerLang;
|
|
29
|
+
/** JSON com strings próprias, mesclado sobre o inglês, quando lang é "custom". */
|
|
30
|
+
localeJson?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
onEventClick?: (detail: {
|
|
33
|
+
event: ArkSchedulerEvent;
|
|
34
|
+
id: string | null;
|
|
35
|
+
}) => void;
|
|
36
|
+
onSlotClick?: (detail: {
|
|
37
|
+
start: string;
|
|
38
|
+
end: string;
|
|
39
|
+
allDay: boolean;
|
|
40
|
+
}) => void;
|
|
41
|
+
onViewChange?: (detail: {
|
|
42
|
+
view: string;
|
|
43
|
+
}) => void;
|
|
44
|
+
onRangeChange?: (detail: {
|
|
45
|
+
start: string;
|
|
46
|
+
end: string;
|
|
47
|
+
view: string;
|
|
48
|
+
}) => void;
|
|
49
|
+
} & React.RefAttributes<ArkSchedulerElement>>;
|
package/dist/ark-scheduler.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
|
+
export const ArkScheduler = forwardRef(function ArkScheduler(props, forwardedRef) {
|
|
4
5
|
const { className, events, hourStart, hourEnd, slotMinutes, hoursFormat, localeJson, onEventClick, onSlotClick, onViewChange, onRangeChange, ...rest } = props;
|
|
5
|
-
const ref =
|
|
6
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
ensureTooarkComponentsRegistered();
|
|
8
9
|
}, []);
|
|
@@ -27,10 +28,10 @@ export function ArkScheduler(props) {
|
|
|
27
28
|
el.removeEventListener(name, listener);
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
|
-
}, [onEventClick, onSlotClick, onViewChange, onRangeChange]);
|
|
31
|
+
}, [ref, onEventClick, onSlotClick, onViewChange, onRangeChange]);
|
|
31
32
|
const attrs = {
|
|
32
33
|
...rest,
|
|
33
|
-
ref,
|
|
34
|
+
ref: setRef,
|
|
34
35
|
class: className,
|
|
35
36
|
events: events ? JSON.stringify(events) : undefined,
|
|
36
37
|
"hour-start": hourStart !== undefined ? String(hourStart) : undefined,
|
|
@@ -40,4 +41,4 @@ export function ArkScheduler(props) {
|
|
|
40
41
|
"locale-json": localeJson
|
|
41
42
|
};
|
|
42
43
|
return createElement("ark-scheduler", attrs);
|
|
43
|
-
}
|
|
44
|
+
});
|
package/dist/ark-select.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ArkSelectOption, ArkSelectStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkSelect as ArkSelectElement } from "@tooark/web-components";
|
|
2
3
|
import React, { type PropsWithChildren } from "react";
|
|
3
4
|
export type ArkSelectProps = PropsWithChildren<ArkSelectStyleOptions & {
|
|
4
5
|
label?: string;
|
|
@@ -17,4 +18,22 @@ export type ArkSelectProps = PropsWithChildren<ArkSelectStyleOptions & {
|
|
|
17
18
|
value: string;
|
|
18
19
|
}>) => void;
|
|
19
20
|
}>;
|
|
20
|
-
export declare
|
|
21
|
+
export declare const ArkSelect: React.ForwardRefExoticComponent<ArkSelectStyleOptions & {
|
|
22
|
+
label?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
options?: ArkSelectOption[];
|
|
25
|
+
value?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
helper?: string;
|
|
28
|
+
error?: boolean;
|
|
29
|
+
errorMessage?: string;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
onInput?: (event: Event) => void;
|
|
34
|
+
onChange?: (event: CustomEvent<{
|
|
35
|
+
value: string;
|
|
36
|
+
}>) => void;
|
|
37
|
+
} & {
|
|
38
|
+
children?: React.ReactNode | undefined;
|
|
39
|
+
} & React.RefAttributes<ArkSelectElement>>;
|
package/dist/ark-select.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
|
+
export const ArkSelect = forwardRef(function ArkSelect(props, forwardedRef) {
|
|
4
5
|
const { children, className, options, errorMessage, error, disabled, required, onInput, onChange, ...rest } = props;
|
|
5
|
-
const ref =
|
|
6
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
ensureTooarkComponentsRegistered();
|
|
8
9
|
}, []);
|
|
@@ -18,10 +19,10 @@ export function ArkSelect(props) {
|
|
|
18
19
|
el.removeEventListener("input", handleInput);
|
|
19
20
|
el.removeEventListener("change", handleChange);
|
|
20
21
|
};
|
|
21
|
-
}, [onInput, onChange]);
|
|
22
|
+
}, [ref, onInput, onChange]);
|
|
22
23
|
const attrs = {
|
|
23
24
|
...rest,
|
|
24
|
-
ref,
|
|
25
|
+
ref: setRef,
|
|
25
26
|
class: className,
|
|
26
27
|
options: options ? JSON.stringify(options) : undefined,
|
|
27
28
|
"error-message": errorMessage,
|
|
@@ -30,4 +31,4 @@ export function ArkSelect(props) {
|
|
|
30
31
|
required: required ? "" : undefined
|
|
31
32
|
};
|
|
32
33
|
return createElement("ark-select", attrs, children);
|
|
33
|
-
}
|
|
34
|
+
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { ArkMarkShape, ArkShapePickerStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkShapePicker as ArkShapePickerElement } from "@tooark/web-components";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
export type ArkShapePickerProps = ArkShapePickerStyleOptions & {
|
|
4
5
|
/** Forma selecionada. */
|
|
5
6
|
value?: ArkMarkShape;
|
|
7
|
+
/** Formas oferecidas, na ordem (ou "all"). Padrao: as dez. */
|
|
8
|
+
shapes?: ArkMarkShape[] | "all";
|
|
6
9
|
/** Nome acessivel do radiogroup. */
|
|
7
10
|
label?: string;
|
|
8
11
|
disabled?: boolean;
|
|
@@ -12,4 +15,17 @@ export type ArkShapePickerProps = ArkShapePickerStyleOptions & {
|
|
|
12
15
|
value: ArkMarkShape;
|
|
13
16
|
}>) => void;
|
|
14
17
|
};
|
|
15
|
-
export declare
|
|
18
|
+
export declare const ArkShapePicker: React.ForwardRefExoticComponent<ArkShapePickerStyleOptions & {
|
|
19
|
+
/** Forma selecionada. */
|
|
20
|
+
value?: ArkMarkShape;
|
|
21
|
+
/** Formas oferecidas, na ordem (ou "all"). Padrao: as dez. */
|
|
22
|
+
shapes?: ArkMarkShape[] | "all";
|
|
23
|
+
/** Nome acessivel do radiogroup. */
|
|
24
|
+
label?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Selecao mudou pelo usuario: detail.value e a forma. */
|
|
28
|
+
onChange?: (event: CustomEvent<{
|
|
29
|
+
value: ArkMarkShape;
|
|
30
|
+
}>) => void;
|
|
31
|
+
} & React.RefAttributes<ArkShapePickerElement>>;
|
package/dist/ark-shape-picker.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { createElement,
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
|
+
export const ArkShapePicker = forwardRef(function ArkShapePicker(props, forwardedRef) {
|
|
5
|
+
const { className, disabled, shapes, localeJson, onChange, ...rest } = props;
|
|
6
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
ensureTooarkComponentsRegistered();
|
|
8
9
|
}, []);
|
|
@@ -13,13 +14,14 @@ export function ArkShapePicker(props) {
|
|
|
13
14
|
const handler = (event) => onChange(event);
|
|
14
15
|
el.addEventListener("change", handler);
|
|
15
16
|
return () => el.removeEventListener("change", handler);
|
|
16
|
-
}, [onChange]);
|
|
17
|
+
}, [ref, onChange]);
|
|
17
18
|
const attrs = {
|
|
18
19
|
...rest,
|
|
19
|
-
ref,
|
|
20
|
+
ref: setRef,
|
|
20
21
|
class: className,
|
|
21
22
|
disabled: disabled ? "" : undefined,
|
|
23
|
+
shapes: Array.isArray(shapes) ? (shapes.length > 0 ? shapes.join(",") : undefined) : shapes,
|
|
22
24
|
"locale-json": localeJson
|
|
23
25
|
};
|
|
24
26
|
return createElement("ark-shape-picker", attrs);
|
|
25
|
-
}
|
|
27
|
+
});
|
package/dist/ark-skeleton.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ArkSkeletonStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkSkeleton as ArkSkeletonElement } from "@tooark/web-components";
|
|
2
3
|
import React, { type PropsWithChildren } from "react";
|
|
3
4
|
export type ArkSkeletonProps = PropsWithChildren<ArkSkeletonStyleOptions & {
|
|
4
5
|
/** Numero de barras; acima de 1 troca o bloco por barras em coluna. Padrao: 1. */
|
|
@@ -8,4 +9,13 @@ export type ArkSkeletonProps = PropsWithChildren<ArkSkeletonStyleOptions & {
|
|
|
8
9
|
className?: string;
|
|
9
10
|
style?: React.CSSProperties;
|
|
10
11
|
}>;
|
|
11
|
-
export declare
|
|
12
|
+
export declare const ArkSkeleton: React.ForwardRefExoticComponent<ArkSkeletonStyleOptions & {
|
|
13
|
+
/** Numero de barras; acima de 1 troca o bloco por barras em coluna. Padrao: 1. */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** Liga o brilho que varre (opt-in; para sob movimento reduzido). */
|
|
16
|
+
animated?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
} & {
|
|
20
|
+
children?: React.ReactNode | undefined;
|
|
21
|
+
} & React.RefAttributes<ArkSkeletonElement>>;
|
package/dist/ark-skeleton.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { createElement, useEffect } from "react";
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
export function ArkSkeleton(props) {
|
|
3
|
+
export const ArkSkeleton = forwardRef(function ArkSkeleton(props, forwardedRef) {
|
|
4
4
|
const { children, className, rows, animated, ...rest } = props;
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
ensureTooarkComponentsRegistered();
|
|
7
7
|
}, []);
|
|
8
8
|
const attrs = {
|
|
9
9
|
...rest,
|
|
10
|
+
ref: forwardedRef,
|
|
10
11
|
class: className,
|
|
11
12
|
rows: rows === undefined ? undefined : String(rows),
|
|
12
13
|
animated: animated ? "" : undefined
|
|
13
14
|
};
|
|
14
15
|
return createElement("ark-skeleton", attrs, children);
|
|
15
|
-
}
|
|
16
|
+
});
|
package/dist/ark-spinner.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { ArkSpinnerStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkSpinner as ArkSpinnerElement } from "@tooark/web-components";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
export type ArkSpinnerProps = ArkSpinnerStyleOptions & {
|
|
4
5
|
/** Rotulo so para leitores de tela. Padrao: a string `loading` do idioma. */
|
|
5
6
|
label?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const ArkSpinner: React.ForwardRefExoticComponent<ArkSpinnerStyleOptions & {
|
|
10
|
+
/** Rotulo so para leitores de tela. Padrao: a string `loading` do idioma. */
|
|
11
|
+
label?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & React.RefAttributes<ArkSpinnerElement>>;
|
package/dist/ark-spinner.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { createElement, useEffect } from "react";
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
export function ArkSpinner(props) {
|
|
3
|
+
export const ArkSpinner = forwardRef(function ArkSpinner(props, forwardedRef) {
|
|
4
4
|
const { className, localeJson, ...rest } = props;
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
ensureTooarkComponentsRegistered();
|
|
7
7
|
}, []);
|
|
8
8
|
const attrs = {
|
|
9
9
|
...rest,
|
|
10
|
+
ref: forwardedRef,
|
|
10
11
|
class: className,
|
|
11
12
|
"locale-json": localeJson
|
|
12
13
|
};
|
|
13
14
|
return createElement("ark-spinner", attrs);
|
|
14
|
-
}
|
|
15
|
+
});
|
package/dist/ark-split-pane.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ArkSplitPaneStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkSplitPane as ArkSplitPaneElement } from "@tooark/web-components";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
import { type PropsWithChildren } from "react";
|
|
4
5
|
export type ArkSplitPaneProps = PropsWithChildren<ArkSplitPaneStyleOptions & {
|
|
@@ -10,4 +11,14 @@ export type ArkSplitPaneProps = PropsWithChildren<ArkSplitPaneStyleOptions & {
|
|
|
10
11
|
sizes: number[];
|
|
11
12
|
}>) => void;
|
|
12
13
|
}>;
|
|
13
|
-
export declare
|
|
14
|
+
export declare const ArkSplitPane: React.ForwardRefExoticComponent<ArkSplitPaneStyleOptions & {
|
|
15
|
+
/** Tamanhos dos paineis em percentuais, na ordem dos filhos (ex.: [30, 70]); faltantes sao distribuidos. */
|
|
16
|
+
sizes?: number[];
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Tamanhos mudaram por arrasto ou teclado: detail.sizes e a lista normalizada. Persistir e do app. */
|
|
19
|
+
onResize?: (event: CustomEvent<{
|
|
20
|
+
sizes: number[];
|
|
21
|
+
}>) => void;
|
|
22
|
+
} & {
|
|
23
|
+
children?: React.ReactNode | undefined;
|
|
24
|
+
} & React.RefAttributes<ArkSplitPaneElement>>;
|
package/dist/ark-split-pane.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { createElement,
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
|
+
export const ArkSplitPane = forwardRef(function ArkSplitPane(props, forwardedRef) {
|
|
4
5
|
const { children, className, sizes, localeJson, onResize, ...rest } = props;
|
|
5
|
-
const ref =
|
|
6
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
ensureTooarkComponentsRegistered();
|
|
8
9
|
}, []);
|
|
@@ -13,13 +14,13 @@ export function ArkSplitPane(props) {
|
|
|
13
14
|
const handler = (event) => onResize(event);
|
|
14
15
|
el.addEventListener("ark-resize", handler);
|
|
15
16
|
return () => el.removeEventListener("ark-resize", handler);
|
|
16
|
-
}, [onResize]);
|
|
17
|
+
}, [ref, onResize]);
|
|
17
18
|
const attrs = {
|
|
18
19
|
...rest,
|
|
19
|
-
ref,
|
|
20
|
+
ref: setRef,
|
|
20
21
|
class: className,
|
|
21
22
|
sizes: sizes ? sizes.join(",") : undefined,
|
|
22
23
|
"locale-json": localeJson
|
|
23
24
|
};
|
|
24
25
|
return createElement("ark-split-pane", attrs, children);
|
|
25
|
-
}
|
|
26
|
+
});
|
package/dist/ark-status-dot.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { ArkStatusDotStyleOptions } from "@tooark/core";
|
|
2
|
+
import type { ArkStatusDot as ArkStatusDotElement } from "@tooark/web-components";
|
|
2
3
|
import type React from "react";
|
|
3
4
|
export type ArkStatusDotProps = ArkStatusDotStyleOptions & {
|
|
4
5
|
/** Com rotulo o ponto vira role="img" nomeado; sem ele e decorativo (aria-hidden). */
|
|
5
6
|
label?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const ArkStatusDot: React.ForwardRefExoticComponent<ArkStatusDotStyleOptions & {
|
|
10
|
+
/** Com rotulo o ponto vira role="img" nomeado; sem ele e decorativo (aria-hidden). */
|
|
11
|
+
label?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & React.RefAttributes<ArkStatusDotElement>>;
|
package/dist/ark-status-dot.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { createElement, useEffect } from "react";
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
export function ArkStatusDot(props) {
|
|
3
|
+
export const ArkStatusDot = forwardRef(function ArkStatusDot(props, forwardedRef) {
|
|
4
4
|
const { className, ...rest } = props;
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
ensureTooarkComponentsRegistered();
|
|
7
7
|
}, []);
|
|
8
8
|
const attrs = {
|
|
9
9
|
...rest,
|
|
10
|
+
ref: forwardedRef,
|
|
10
11
|
class: className
|
|
11
12
|
};
|
|
12
13
|
return createElement("ark-status-dot", attrs);
|
|
13
|
-
}
|
|
14
|
+
});
|
package/dist/ark-switch.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ArkSwitchStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import type { ArkSwitch as ArkSwitchElement } from "@tooark/web-components";
|
|
3
|
+
import type React from "react";
|
|
3
4
|
export type ArkSwitchProps = ArkSwitchStyleOptions & {
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
name?: string;
|
|
@@ -10,4 +11,13 @@ export type ArkSwitchProps = ArkSwitchStyleOptions & {
|
|
|
10
11
|
checked: boolean;
|
|
11
12
|
}>) => void;
|
|
12
13
|
};
|
|
13
|
-
export declare
|
|
14
|
+
export declare const ArkSwitch: React.ForwardRefExoticComponent<ArkSwitchStyleOptions & {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
name?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
onChange?: (event: CustomEvent<{
|
|
21
|
+
checked: boolean;
|
|
22
|
+
}>) => void;
|
|
23
|
+
} & React.RefAttributes<ArkSwitchElement>>;
|
package/dist/ark-switch.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
2
2
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
|
-
|
|
3
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
|
+
export const ArkSwitch = forwardRef(function ArkSwitch(props, forwardedRef) {
|
|
4
5
|
const { className, checked, labels, labelOn, labelOff, icons, disabled, onChange, ...rest } = props;
|
|
5
6
|
useEffect(() => {
|
|
6
7
|
ensureTooarkComponentsRegistered();
|
|
7
8
|
}, []);
|
|
8
|
-
const ref =
|
|
9
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
9
10
|
useEffect(() => {
|
|
10
11
|
const el = ref.current;
|
|
11
12
|
if (!el || !onChange)
|
|
@@ -13,10 +14,10 @@ export function ArkSwitch(props) {
|
|
|
13
14
|
const handler = (event) => onChange(event);
|
|
14
15
|
el.addEventListener("change", handler);
|
|
15
16
|
return () => el.removeEventListener("change", handler);
|
|
16
|
-
}, [onChange]);
|
|
17
|
+
}, [ref, onChange]);
|
|
17
18
|
const attrs = {
|
|
18
19
|
...rest,
|
|
19
|
-
ref,
|
|
20
|
+
ref: setRef,
|
|
20
21
|
class: className,
|
|
21
22
|
checked: checked ? "" : undefined,
|
|
22
23
|
disabled: disabled ? "" : undefined,
|
|
@@ -26,4 +27,4 @@ export function ArkSwitch(props) {
|
|
|
26
27
|
"label-off": labelOff
|
|
27
28
|
};
|
|
28
29
|
return createElement("ark-switch", attrs);
|
|
29
|
-
}
|
|
30
|
+
});
|