@tooark/react 1.9.3 → 1.10.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 +70 -5
- package/README.pt-BR.md +70 -5
- package/dist/ark-accordion.d.ts +28 -0
- package/dist/ark-accordion.js +65 -0
- package/dist/ark-alert.d.ts +2 -2
- package/dist/ark-alert.js +5 -3
- package/dist/ark-avatar.d.ts +1 -1
- package/dist/ark-avatar.js +3 -2
- package/dist/ark-badge.d.ts +6 -2
- package/dist/ark-badge.js +23 -6
- package/dist/ark-breadcrumb.d.ts +38 -0
- package/dist/ark-breadcrumb.js +48 -0
- package/dist/ark-button.d.ts +7 -3
- package/dist/ark-button.js +9 -6
- package/dist/ark-calendar.d.ts +2 -2
- package/dist/ark-calendar.js +3 -2
- package/dist/ark-card.d.ts +10 -2
- package/dist/ark-card.js +22 -5
- package/dist/ark-carousel.d.ts +1 -1
- package/dist/ark-carousel.js +3 -2
- package/dist/ark-checkbox.d.ts +2 -2
- package/dist/ark-checkbox.js +5 -3
- package/dist/ark-clock.d.ts +2 -2
- package/dist/ark-clock.js +3 -2
- package/dist/ark-color-swatches.d.ts +2 -2
- package/dist/ark-color-swatches.js +3 -2
- package/dist/ark-combobox.d.ts +54 -0
- package/dist/ark-combobox.js +44 -0
- package/dist/ark-command-palette.d.ts +3 -3
- package/dist/ark-command-palette.js +12 -6
- package/dist/ark-copy-button.d.ts +6 -2
- package/dist/ark-copy-button.js +7 -4
- package/dist/ark-data-view.d.ts +1 -1
- package/dist/ark-data-view.js +5 -3
- package/dist/ark-datepicker.d.ts +2 -2
- package/dist/ark-datepicker.js +11 -4
- package/dist/ark-dialog.d.ts +2 -2
- package/dist/ark-dialog.js +5 -3
- package/dist/ark-drawer.d.ts +2 -2
- package/dist/ark-drawer.js +5 -3
- package/dist/ark-empty.d.ts +1 -1
- package/dist/ark-empty.js +5 -3
- package/dist/ark-file-input.d.ts +7 -3
- package/dist/ark-file-input.js +16 -4
- package/dist/ark-input.d.ts +2 -2
- package/dist/ark-input.js +5 -3
- package/dist/ark-kbd.d.ts +1 -1
- package/dist/ark-kbd.js +5 -3
- package/dist/ark-kv-editor.d.ts +2 -2
- package/dist/ark-kv-editor.js +3 -2
- package/dist/ark-mark.d.ts +1 -1
- package/dist/ark-mark.js +3 -2
- package/dist/ark-menu.d.ts +1 -1
- package/dist/ark-menu.js +9 -7
- package/dist/ark-nav.d.ts +4 -4
- package/dist/ark-nav.js +9 -7
- package/dist/ark-otp-input.d.ts +40 -0
- package/dist/ark-otp-input.js +38 -0
- package/dist/ark-pagination.d.ts +1 -1
- package/dist/ark-pagination.js +3 -2
- package/dist/ark-popover.d.ts +24 -0
- package/dist/ark-popover.js +42 -0
- package/dist/ark-progress.d.ts +2 -2
- package/dist/ark-progress.js +3 -2
- package/dist/ark-radio.d.ts +5 -5
- package/dist/ark-radio.js +7 -5
- package/dist/ark-scheduler.d.ts +1 -1
- package/dist/ark-scheduler.js +3 -2
- package/dist/ark-select.d.ts +2 -2
- package/dist/ark-select.js +5 -3
- package/dist/ark-shape-picker.d.ts +2 -2
- package/dist/ark-shape-picker.js +3 -2
- package/dist/ark-skeleton.d.ts +1 -1
- package/dist/ark-skeleton.js +5 -3
- package/dist/ark-slider.d.ts +45 -0
- package/dist/ark-slider.js +49 -0
- package/dist/ark-spinner.d.ts +1 -1
- package/dist/ark-spinner.js +3 -2
- package/dist/ark-split-pane.d.ts +1 -1
- package/dist/ark-split-pane.js +5 -3
- package/dist/ark-status-dot.d.ts +1 -1
- package/dist/ark-status-dot.js +3 -2
- package/dist/ark-stepper.d.ts +50 -0
- package/dist/ark-stepper.js +57 -0
- package/dist/ark-switch.d.ts +2 -2
- package/dist/ark-switch.js +8 -5
- package/dist/ark-tabs.d.ts +19 -3
- package/dist/ark-tabs.js +20 -5
- package/dist/ark-textarea.d.ts +6 -2
- package/dist/ark-textarea.js +7 -4
- package/dist/ark-time.d.ts +1 -1
- package/dist/ark-time.js +3 -2
- package/dist/ark-timeline.d.ts +32 -0
- package/dist/ark-timeline.js +26 -0
- package/dist/ark-timer.d.ts +26 -0
- package/dist/ark-timer.js +41 -0
- package/dist/ark-toaster.d.ts +1 -1
- package/dist/ark-toaster.js +3 -2
- package/dist/ark-toggle.d.ts +1 -1
- package/dist/ark-toggle.js +7 -5
- package/dist/ark-tooltip.d.ts +1 -1
- package/dist/ark-tooltip.js +5 -3
- package/dist/ark-tree.d.ts +3 -3
- package/dist/ark-tree.js +7 -5
- package/dist/code.d.ts +1 -1
- package/dist/elements.d.ts +104 -0
- package/dist/elements.js +52 -0
- package/dist/index.d.ts +1 -85
- package/dist/index.js +7 -43
- package/dist/jsx-intrinsics.d.ts +190 -0
- package/dist/register-elements.d.ts +8 -0
- package/dist/register-elements.js +22 -0
- package/dist/text-child.d.ts +3 -0
- package/dist/text-child.js +8 -0
- package/package.json +17 -7
package/dist/ark-calendar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkCalendarEvent, ArkCalendarStyleOptions, ArkDatepickerLang, ArkLocale } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkCalendar as ArkCalendarElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkCalendarProps = ArkDomProps<ArkCalendarStyleOptions & {
|
|
@@ -27,4 +27,4 @@ export declare const ArkCalendar: React.ForwardRefExoticComponent<ArkCalendarSty
|
|
|
27
27
|
events: ArkCalendarEvent[];
|
|
28
28
|
}) => void;
|
|
29
29
|
className?: string;
|
|
30
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "localeJson" | keyof ArkCalendarStyleOptions | "
|
|
30
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "value" | "localeJson" | keyof ArkCalendarStyleOptions | "min" | "max"> & React.RefAttributes<ArkCalendarElement>>;
|
package/dist/ark-calendar.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ArkCalendar as ArkCalendarElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useCallback, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
4
5
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
6
|
export const ArkCalendar = forwardRef(function ArkCalendar(props, forwardedRef) {
|
|
6
7
|
const { lang, localeJson, theme, intent, accentColor, value, min, max, onChange, className, testid, events, eventDisplay, ...rest } = props;
|
|
7
8
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
|
|
10
|
+
ensureTooarkElementsRegistered(ArkCalendarElement);
|
|
10
11
|
}, []);
|
|
11
12
|
const handleChange = useCallback((e) => {
|
|
12
13
|
if (onChange) {
|
package/dist/ark-card.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import type { ArkCardStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkCard as ArkCardElement } from "@tooark/web-components";
|
|
3
3
|
import React, { type PropsWithChildren } from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkCardProps = PropsWithChildren<ArkDomProps<ArkCardStyleOptions & {
|
|
6
6
|
/** Título (h2) na linha de cima; com ele o filho slot="header" vira a linha seguinte do cabeçalho. */
|
|
7
7
|
heading?: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
/** Clique simples no link do card (com `href`), cancelável: `preventDefault()` e roteie pelo app. */
|
|
10
|
+
onNavigate?: (event: CustomEvent<{
|
|
11
|
+
href: string;
|
|
12
|
+
}>) => void;
|
|
9
13
|
}>>;
|
|
10
14
|
export declare const ArkCard: React.ForwardRefExoticComponent<ArkCardStyleOptions & {
|
|
11
15
|
/** Título (h2) na linha de cima; com ele o filho slot="header" vira a linha seguinte do cabeçalho. */
|
|
12
16
|
heading?: string;
|
|
13
17
|
className?: string;
|
|
14
|
-
|
|
18
|
+
/** Clique simples no link do card (com `href`), cancelável: `preventDefault()` e roteie pelo app. */
|
|
19
|
+
onNavigate?: (event: CustomEvent<{
|
|
20
|
+
href: string;
|
|
21
|
+
}>) => void;
|
|
22
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "heading" | "onNavigate" | keyof ArkCardStyleOptions> & {
|
|
15
23
|
children?: React.ReactNode | undefined;
|
|
16
24
|
} & React.RefAttributes<ArkCardElement>>;
|
package/dist/ark-card.js
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
|
+
import { ArkCard as ArkCardElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
5
|
+
import { textChild } from "./text-child.js";
|
|
6
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
7
|
+
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
4
8
|
export const ArkCard = forwardRef(function ArkCard(props, forwardedRef) {
|
|
5
|
-
const { children, className, headingLevel, wrapActions, ...rest } = props;
|
|
9
|
+
const { children, className, headingLevel, wrapActions, onNavigate, ...rest } = props;
|
|
10
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
6
11
|
useEffect(() => {
|
|
7
|
-
|
|
12
|
+
ensureTooarkElementsRegistered(ArkCardElement);
|
|
8
13
|
}, []);
|
|
14
|
+
useIsomorphicLayoutEffect(() => {
|
|
15
|
+
const el = ref.current;
|
|
16
|
+
if (!el || !onNavigate)
|
|
17
|
+
return;
|
|
18
|
+
// Só o do próprio card: o ark-navigate borbulha e vem também de um ark-button ou ark-nav-item dentro dele.
|
|
19
|
+
const handleNavigate = (event) => {
|
|
20
|
+
if (event.target === event.currentTarget)
|
|
21
|
+
onNavigate(event);
|
|
22
|
+
};
|
|
23
|
+
el.addEventListener("ark-navigate", handleNavigate);
|
|
24
|
+
return () => el.removeEventListener("ark-navigate", handleNavigate);
|
|
25
|
+
}, [ref, onNavigate]);
|
|
9
26
|
const attrs = {
|
|
10
27
|
...domAttrs(rest),
|
|
11
|
-
ref:
|
|
28
|
+
ref: setRef,
|
|
12
29
|
class: className,
|
|
13
30
|
"heading-level": headingLevel,
|
|
14
31
|
"wrap-actions": wrapActions ? "" : undefined
|
|
15
32
|
};
|
|
16
|
-
return createElement("ark-card", attrs, children);
|
|
33
|
+
return createElement("ark-card", attrs, textChild(children));
|
|
17
34
|
});
|
package/dist/ark-carousel.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkCarouselSnap, ArkCarouselStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkCarousel as ArkCarouselElement } from "@tooark/web-components";
|
|
3
3
|
import React, { type PropsWithChildren } from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkCarouselProps = PropsWithChildren<ArkDomProps<ArkCarouselStyleOptions & {
|
package/dist/ark-carousel.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ArkCarousel as ArkCarouselElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useCallback, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
4
5
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
6
|
export const ArkCarousel = forwardRef(function ArkCarousel(props, forwardedRef) {
|
|
6
7
|
const { children, theme, intent, accentColor, slidesPerView, gap, startIndex, loop, autoplay, autoplayDelay, showDots, showArrows, dragFree, snap, onSlideChange, className, testid, ...rest } = props;
|
|
7
8
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
|
|
10
|
+
ensureTooarkElementsRegistered(ArkCarouselElement);
|
|
10
11
|
}, []);
|
|
11
12
|
const handleSlideChange = useCallback(
|
|
12
13
|
// Só o ark-slide-change deste carrossel: o evento borbulha, e o de outro dentro de um slide chegava aqui.
|
package/dist/ark-checkbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkCheckboxStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkCheckbox as ArkCheckboxElement } from "@tooark/web-components";
|
|
3
3
|
import React, { type PropsWithChildren } from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkCheckboxProps = PropsWithChildren<ArkDomProps<ArkCheckboxStyleOptions & {
|
|
@@ -31,6 +31,6 @@ export declare const ArkCheckbox: React.ForwardRefExoticComponent<ArkCheckboxSty
|
|
|
31
31
|
onChange?: (event: CustomEvent<{
|
|
32
32
|
checked: boolean;
|
|
33
33
|
}>) => void;
|
|
34
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "
|
|
34
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "disabled" | "value" | "label" | "name" | keyof ArkCheckboxStyleOptions | "helper"> & {
|
|
35
35
|
children?: React.ReactNode | undefined;
|
|
36
36
|
} & React.RefAttributes<ArkCheckboxElement>>;
|
package/dist/ark-checkbox.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { ArkCheckbox as ArkCheckboxElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
5
|
+
import { textChild } from "./text-child.js";
|
|
4
6
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
7
|
export const ArkCheckbox = forwardRef(function ArkCheckbox(props, forwardedRef) {
|
|
6
8
|
const { children, className, checked, indeterminate, disabled, onChange, ...rest } = props;
|
|
7
9
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
10
|
useEffect(() => {
|
|
9
|
-
|
|
11
|
+
ensureTooarkElementsRegistered(ArkCheckboxElement);
|
|
10
12
|
}, []);
|
|
11
13
|
useEffect(() => {
|
|
12
14
|
const el = ref.current;
|
|
@@ -24,5 +26,5 @@ export const ArkCheckbox = forwardRef(function ArkCheckbox(props, forwardedRef)
|
|
|
24
26
|
indeterminate: indeterminate ? "" : undefined,
|
|
25
27
|
disabled: disabled ? "" : undefined
|
|
26
28
|
};
|
|
27
|
-
return createElement("ark-checkbox", attrs, children);
|
|
29
|
+
return createElement("ark-checkbox", attrs, textChild(children));
|
|
28
30
|
});
|
package/dist/ark-clock.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkClockStyleOptions, ArkDatepickerLang } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkClock as ArkClockElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkClockProps = ArkDomProps<ArkClockStyleOptions & {
|
|
@@ -21,4 +21,4 @@ export declare const ArkClock: React.ForwardRefExoticComponent<ArkClockStyleOpti
|
|
|
21
21
|
onChange?: (detail: {
|
|
22
22
|
value: string;
|
|
23
23
|
}) => void;
|
|
24
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "
|
|
24
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "value" | "localeJson" | keyof ArkClockStyleOptions> & React.RefAttributes<ArkClockElement>>;
|
package/dist/ark-clock.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ArkClock as ArkClockElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
4
5
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
6
|
export const ArkClock = forwardRef(function ArkClock(props, forwardedRef) {
|
|
6
7
|
const { className, seconds, stepMinutes, hoursFormat, localeJson, onChange, ...rest } = props;
|
|
7
8
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
|
|
10
|
+
ensureTooarkElementsRegistered(ArkClockElement);
|
|
10
11
|
}, []);
|
|
11
12
|
useEffect(() => {
|
|
12
13
|
const el = ref.current;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkColorSwatch, ArkColorSwatchesStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkColorSwatches as ArkColorSwatchesElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkColorSwatchesProps = ArkDomProps<ArkColorSwatchesStyleOptions & {
|
|
@@ -29,4 +29,4 @@ export declare const ArkColorSwatches: React.ForwardRefExoticComponent<ArkColorS
|
|
|
29
29
|
onChange?: (event: CustomEvent<{
|
|
30
30
|
value: string;
|
|
31
31
|
}>) => void;
|
|
32
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "
|
|
32
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "disabled" | "value" | "label" | keyof ArkColorSwatchesStyleOptions | "colors"> & React.RefAttributes<ArkColorSwatchesElement>>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ArkColorSwatches as ArkColorSwatchesElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
4
5
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
6
|
export const ArkColorSwatches = forwardRef(function ArkColorSwatches(props, forwardedRef) {
|
|
6
7
|
const { className, colors, disabled, onChange, ...rest } = props;
|
|
7
8
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
|
|
10
|
+
ensureTooarkElementsRegistered(ArkColorSwatchesElement);
|
|
10
11
|
}, []);
|
|
11
12
|
useEffect(() => {
|
|
12
13
|
const el = ref.current;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ArkComboboxChangeDetail, ArkComboboxMode, ArkComboboxOption, ArkComboboxQueryDetail, ArkComboboxStyleOptions } from "@tooark/core";
|
|
2
|
+
import { ArkCombobox as ArkComboboxElement } from "@tooark/web-components";
|
|
3
|
+
import React, { type PropsWithChildren } from "react";
|
|
4
|
+
import { type ArkDomProps } from "./dom-props.js";
|
|
5
|
+
export type ArkComboboxProps = PropsWithChildren<ArkDomProps<ArkComboboxStyleOptions & {
|
|
6
|
+
label?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
options?: ArkComboboxOption[];
|
|
9
|
+
/** Valor da opção escolhida. */
|
|
10
|
+
value?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
/** `server`: a lista mostra as opções como vêm, sem filtrar (o app busca no `onQuery`). Padrão: "client". */
|
|
13
|
+
mode?: ArkComboboxMode;
|
|
14
|
+
/** A lista mostra o texto de busca em andamento no lugar das opções. */
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
/** Botão que limpa a escolha. */
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
helper?: string;
|
|
19
|
+
error?: boolean;
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/** Strings customizadas (JSON) quando lang é "custom". */
|
|
24
|
+
localeJson?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
onChange?: (event: CustomEvent<ArkComboboxChangeDetail>) => void;
|
|
27
|
+
onQuery?: (event: CustomEvent<ArkComboboxQueryDetail>) => void;
|
|
28
|
+
}>>;
|
|
29
|
+
export declare const ArkCombobox: React.ForwardRefExoticComponent<ArkComboboxStyleOptions & {
|
|
30
|
+
label?: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
options?: ArkComboboxOption[];
|
|
33
|
+
/** Valor da opção escolhida. */
|
|
34
|
+
value?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
/** `server`: a lista mostra as opções como vêm, sem filtrar (o app busca no `onQuery`). Padrão: "client". */
|
|
37
|
+
mode?: ArkComboboxMode;
|
|
38
|
+
/** A lista mostra o texto de busca em andamento no lugar das opções. */
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
/** Botão que limpa a escolha. */
|
|
41
|
+
clearable?: boolean;
|
|
42
|
+
helper?: string;
|
|
43
|
+
error?: boolean;
|
|
44
|
+
errorMessage?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
required?: boolean;
|
|
47
|
+
/** Strings customizadas (JSON) quando lang é "custom". */
|
|
48
|
+
localeJson?: string;
|
|
49
|
+
className?: string;
|
|
50
|
+
onChange?: (event: CustomEvent<ArkComboboxChangeDetail>) => void;
|
|
51
|
+
onQuery?: (event: CustomEvent<ArkComboboxQueryDetail>) => void;
|
|
52
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "disabled" | "value" | "error" | "label" | "localeJson" | "name" | "loading" | "helper" | keyof ArkComboboxStyleOptions | "placeholder" | "options" | "mode" | "clearable" | "errorMessage" | "required" | "onQuery"> & {
|
|
53
|
+
children?: React.ReactNode | undefined;
|
|
54
|
+
} & React.RefAttributes<ArkComboboxElement>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ArkCombobox as ArkComboboxElement } from "@tooark/web-components";
|
|
2
|
+
import { createElement, forwardRef, useEffect } from "react";
|
|
3
|
+
import { domAttrs } from "./dom-props.js";
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
5
|
+
import { textChild } from "./text-child.js";
|
|
6
|
+
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
7
|
+
export const ArkCombobox = forwardRef(function ArkCombobox(props, forwardedRef) {
|
|
8
|
+
const { children, className, options, errorMessage, error, disabled, required, loading, clearable, localeJson, onChange, onQuery, ...rest } = props;
|
|
9
|
+
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
ensureTooarkElementsRegistered(ArkComboboxElement);
|
|
12
|
+
}, []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const el = ref.current;
|
|
15
|
+
if (!el)
|
|
16
|
+
return;
|
|
17
|
+
const handleChange = (event) => onChange?.(event);
|
|
18
|
+
// ark-query borbulha e sai do ark-combobox e do ark-command-palette: só o deste elemento chega ao app.
|
|
19
|
+
const handleQuery = (event) => {
|
|
20
|
+
if (event.target === event.currentTarget)
|
|
21
|
+
onQuery?.(event);
|
|
22
|
+
};
|
|
23
|
+
el.addEventListener("change", handleChange);
|
|
24
|
+
el.addEventListener("ark-query", handleQuery);
|
|
25
|
+
return () => {
|
|
26
|
+
el.removeEventListener("change", handleChange);
|
|
27
|
+
el.removeEventListener("ark-query", handleQuery);
|
|
28
|
+
};
|
|
29
|
+
}, [ref, onChange, onQuery]);
|
|
30
|
+
const attrs = {
|
|
31
|
+
...domAttrs(rest),
|
|
32
|
+
ref: setRef,
|
|
33
|
+
class: className,
|
|
34
|
+
options: options ? JSON.stringify(options) : undefined,
|
|
35
|
+
"error-message": errorMessage,
|
|
36
|
+
"locale-json": localeJson,
|
|
37
|
+
error: error ? "" : undefined,
|
|
38
|
+
disabled: disabled ? "" : undefined,
|
|
39
|
+
required: required ? "" : undefined,
|
|
40
|
+
loading: loading ? "" : undefined,
|
|
41
|
+
clearable: clearable ? "" : undefined
|
|
42
|
+
};
|
|
43
|
+
return createElement("ark-combobox", attrs, textChild(children));
|
|
44
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkCommandItemStyleOptions, ArkCommandPaletteStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkCommandItem as ArkCommandItemElement, ArkCommandPalette as ArkCommandPaletteElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type PropsWithChildren } from "react";
|
|
5
5
|
import { type ArkDomProps } from "./dom-props.js";
|
|
@@ -62,7 +62,7 @@ export declare const ArkCommandPalette: React.ForwardRefExoticComponent<ArkComma
|
|
|
62
62
|
}>) => void;
|
|
63
63
|
onOpen?: (event: CustomEvent) => void;
|
|
64
64
|
onClose?: (event: CustomEvent) => void;
|
|
65
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "onSelect" | "
|
|
65
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "onSelect" | "filter" | "open" | "label" | "placeholder" | "onQuery" | keyof ArkCommandPaletteStyleOptions | "hotkey" | "queryDelay" | "hint" | "busy" | "noScrollLock" | "onOpen" | "onClose"> & {
|
|
66
66
|
children?: React.ReactNode | undefined;
|
|
67
67
|
} & React.RefAttributes<ArkCommandPaletteElement>>;
|
|
68
68
|
export type ArkCommandItemProps = PropsWithChildren<ArkDomProps<ArkCommandItemStyleOptions & {
|
|
@@ -82,6 +82,6 @@ export declare const ArkCommandItem: React.ForwardRefExoticComponent<ArkCommandI
|
|
|
82
82
|
label?: string;
|
|
83
83
|
disabled?: boolean;
|
|
84
84
|
className?: string;
|
|
85
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "testid" | "
|
|
85
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "testid" | "disabled" | "value" | "label" | "group"> & {
|
|
86
86
|
children?: React.ReactNode | undefined;
|
|
87
87
|
} & React.RefAttributes<ArkCommandItemElement>>;
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
+
import { ArkCommandItem as ArkCommandItemElement, ArkCommandPalette as ArkCommandPaletteElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
5
|
+
import { textChild } from "./text-child.js";
|
|
4
6
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
7
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
6
8
|
export const ArkCommandPalette = forwardRef(function ArkCommandPalette(props, forwardedRef) {
|
|
7
9
|
const { children, className, open, filter, busy, queryDelay, noScrollLock, localeJson, onSelect, onQuery, onOpen, onClose, ...rest } = props;
|
|
8
10
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
9
11
|
useEffect(() => {
|
|
10
|
-
|
|
12
|
+
ensureTooarkElementsRegistered(ArkCommandPaletteElement);
|
|
11
13
|
}, []);
|
|
12
14
|
useIsomorphicLayoutEffect(() => {
|
|
13
15
|
const el = ref.current;
|
|
14
16
|
if (!el)
|
|
15
17
|
return;
|
|
16
18
|
const handleSelect = (event) => onSelect?.(event);
|
|
17
|
-
|
|
19
|
+
// ark-query borbulha e sai do ark-combobox e do ark-command-palette: só o deste elemento chega ao app.
|
|
20
|
+
const handleQuery = (event) => {
|
|
21
|
+
if (event.target === event.currentTarget)
|
|
22
|
+
onQuery?.(event);
|
|
23
|
+
};
|
|
18
24
|
// ark-open e ark-close borbulham: só os deste elemento chegam ao app. Os de um overlay de dentro chegavam também
|
|
19
25
|
// (um ark-menu que fechava dentro de um diálogo chamava o onClose do diálogo).
|
|
20
26
|
const handleOpen = (event) => {
|
|
@@ -47,12 +53,12 @@ export const ArkCommandPalette = forwardRef(function ArkCommandPalette(props, fo
|
|
|
47
53
|
"query-delay": queryDelay === undefined ? undefined : String(queryDelay),
|
|
48
54
|
"locale-json": localeJson
|
|
49
55
|
};
|
|
50
|
-
return createElement("ark-command-palette", attrs, children);
|
|
56
|
+
return createElement("ark-command-palette", attrs, textChild(children));
|
|
51
57
|
});
|
|
52
58
|
export const ArkCommandItem = forwardRef(function ArkCommandItem(props, forwardedRef) {
|
|
53
59
|
const { children, className, disabled, ...rest } = props;
|
|
54
60
|
useEffect(() => {
|
|
55
|
-
|
|
61
|
+
ensureTooarkElementsRegistered(ArkCommandItemElement);
|
|
56
62
|
}, []);
|
|
57
63
|
const attrs = {
|
|
58
64
|
...domAttrs(rest),
|
|
@@ -60,5 +66,5 @@ export const ArkCommandItem = forwardRef(function ArkCommandItem(props, forwarde
|
|
|
60
66
|
class: className,
|
|
61
67
|
disabled: disabled ? "" : undefined
|
|
62
68
|
};
|
|
63
|
-
return createElement("ark-command-item", attrs, children);
|
|
69
|
+
return createElement("ark-command-item", attrs, textChild(children));
|
|
64
70
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkCopyButtonStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkCopyButton as ArkCopyButtonElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type PropsWithChildren } from "react";
|
|
5
5
|
import { type ArkDomProps } from "./dom-props.js";
|
|
@@ -11,6 +11,8 @@ export type ArkCopyButtonProps = PropsWithChildren<ArkDomProps<ArkCopyButtonStyl
|
|
|
11
11
|
/** Duração do feedback "copiado" em ms. Padrão: 1500. */
|
|
12
12
|
feedbackMs?: number;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
/** Desabilitado só para a ação: continua no Tab e sob o ponteiro, para um tooltip dizer o motivo. */
|
|
15
|
+
softDisabled?: boolean;
|
|
14
16
|
className?: string;
|
|
15
17
|
onCopy?: (event: CustomEvent<{
|
|
16
18
|
value: string;
|
|
@@ -24,10 +26,12 @@ export declare const ArkCopyButton: React.ForwardRefExoticComponent<ArkCopyButto
|
|
|
24
26
|
/** Duração do feedback "copiado" em ms. Padrão: 1500. */
|
|
25
27
|
feedbackMs?: number;
|
|
26
28
|
disabled?: boolean;
|
|
29
|
+
/** Desabilitado só para a ação: continua no Tab e sob o ponteiro, para um tooltip dizer o motivo. */
|
|
30
|
+
softDisabled?: boolean;
|
|
27
31
|
className?: string;
|
|
28
32
|
onCopy?: (event: CustomEvent<{
|
|
29
33
|
value: string;
|
|
30
34
|
}>) => void;
|
|
31
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onCopy" | "disabled" | "value" | keyof ArkCopyButtonStyleOptions | "htmlFor" | "feedbackMs"> & {
|
|
35
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onCopy" | "disabled" | "value" | "softDisabled" | keyof ArkCopyButtonStyleOptions | "htmlFor" | "feedbackMs"> & {
|
|
32
36
|
children?: React.ReactNode | undefined;
|
|
33
37
|
} & React.RefAttributes<ArkCopyButtonElement>>;
|
package/dist/ark-copy-button.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { ArkCopyButton as ArkCopyButtonElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
5
|
+
import { textChild } from "./text-child.js";
|
|
4
6
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
7
|
export const ArkCopyButton = forwardRef(function ArkCopyButton(props, forwardedRef) {
|
|
6
|
-
const { children, className, htmlFor, feedbackMs, textColor, localeJson, loading, iconOnly, fullWidth, disabled, onCopy, ...rest } = props;
|
|
8
|
+
const { children, className, htmlFor, feedbackMs, textColor, localeJson, loading, iconOnly, fullWidth, disabled, softDisabled, onCopy, ...rest } = props;
|
|
7
9
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
10
|
useEffect(() => {
|
|
9
|
-
|
|
11
|
+
ensureTooarkElementsRegistered(ArkCopyButtonElement);
|
|
10
12
|
}, []);
|
|
11
13
|
useEffect(() => {
|
|
12
14
|
const el = ref.current;
|
|
@@ -26,8 +28,9 @@ export const ArkCopyButton = forwardRef(function ArkCopyButton(props, forwardedR
|
|
|
26
28
|
"locale-json": localeJson,
|
|
27
29
|
loading: loading ? "" : undefined,
|
|
28
30
|
disabled: disabled ? "" : undefined,
|
|
31
|
+
"soft-disabled": softDisabled ? "" : undefined,
|
|
29
32
|
"icon-only": iconOnly ? "" : undefined,
|
|
30
33
|
"full-width": fullWidth ? "" : undefined
|
|
31
34
|
};
|
|
32
|
-
return createElement("ark-copy-button", attrs, children);
|
|
35
|
+
return createElement("ark-copy-button", attrs, textChild(children));
|
|
33
36
|
});
|
package/dist/ark-data-view.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkDataViewCardContext, ArkDataViewCellContext, ArkDataViewColumn, ArkDataViewKey, ArkDataViewQueryChangeDetail, ArkDataViewReorderDetail, ArkDataViewRow, ArkDataViewRowClickDetail, ArkDataViewSelectionChangeDetail, ArkDataViewSort, ArkDataViewStyleOptions, ArkDataViewViewChangeDetail } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkDataView as ArkDataViewElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type PropsWithChildren } from "react";
|
|
5
5
|
import { type ArkDomProps } from "./dom-props.js";
|
package/dist/ark-data-view.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ArkDataView as ArkDataViewElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, Fragment, forwardRef, useEffect, useReducer, useRef } from "react";
|
|
2
3
|
import { createPortal, flushSync } from "react-dom";
|
|
3
4
|
import { domAttrs } from "./dom-props.js";
|
|
4
|
-
import {
|
|
5
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
6
|
+
import { textChild } from "./text-child.js";
|
|
5
7
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
6
8
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
7
9
|
let hostSeq = 0;
|
|
@@ -49,7 +51,7 @@ const ArkDataViewBase = forwardRef(function ArkDataView(props, forwardedRef) {
|
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
useEffect(() => {
|
|
52
|
-
|
|
54
|
+
ensureTooarkElementsRegistered(ArkDataViewElement);
|
|
53
55
|
}, []);
|
|
54
56
|
useIsomorphicLayoutEffect(() => {
|
|
55
57
|
latest.current = { columns, cardRender };
|
|
@@ -192,7 +194,7 @@ const ArkDataViewBase = forwardRef(function ArkDataView(props, forwardedRef) {
|
|
|
192
194
|
continue;
|
|
193
195
|
portals.push(createPortal(content, node, String(entry.id)));
|
|
194
196
|
}
|
|
195
|
-
return createElement(Fragment, null, createElement("ark-data-view", attrs, children), portals);
|
|
197
|
+
return createElement(Fragment, null, createElement("ark-data-view", attrs, textChild(children)), portals);
|
|
196
198
|
});
|
|
197
199
|
/**
|
|
198
200
|
* Wrapper do ark-data-view. Genérico no registro: `<ArkDataView<User> rows={users} ... />` tipa `columns`, `render`
|
package/dist/ark-datepicker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkDatepickerLang, ArkDatepickerStyleOptions, ArkLocale } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkDatepicker as ArkDatepickerElement } from "@tooark/web-components";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkDatepickerProps = ArkDomProps<ArkDatepickerStyleOptions & {
|
|
@@ -25,4 +25,4 @@ export declare const ArkDatepicker: React.ForwardRefExoticComponent<ArkDatepicke
|
|
|
25
25
|
date: Date | null;
|
|
26
26
|
}) => void;
|
|
27
27
|
className?: string;
|
|
28
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "
|
|
28
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "value" | "localeJson" | "min" | "max" | keyof ArkDatepickerStyleOptions> & React.RefAttributes<ArkDatepickerElement>>;
|
package/dist/ark-datepicker.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ArkDatepicker as ArkDatepickerElement } from "@tooark/web-components";
|
|
1
2
|
import React, { forwardRef, useCallback, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
4
5
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
6
|
export const ArkDatepicker = forwardRef(function ArkDatepicker(props, forwardedRef) {
|
|
6
|
-
const { lang, localeJson, theme, intent, accentColor, value, min, max, onChange, className, testid, mode, input, placeholder, name, format, seconds, disabled, events, eventDisplay, stepMinutes, hoursFormat, ...rest } = props;
|
|
7
|
+
const { lang, localeJson, theme, intent, accentColor, value, min, max, onChange, className, testid, mode, input, placeholder, name, format, seconds, disabled, events, eventDisplay, stepMinutes, hoursFormat, error, errorMessage, required, readonly, fullWidth, ...rest } = props;
|
|
7
8
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
|
|
10
|
+
ensureTooarkElementsRegistered(ArkDatepickerElement);
|
|
10
11
|
}, []);
|
|
11
12
|
const handleChange = useCallback((e) => {
|
|
12
13
|
if (onChange) {
|
|
@@ -44,7 +45,13 @@ export const ArkDatepicker = forwardRef(function ArkDatepicker(props, forwardedR
|
|
|
44
45
|
events: events ? JSON.stringify(events) : undefined,
|
|
45
46
|
"event-display": eventDisplay,
|
|
46
47
|
"step-minutes": stepMinutes !== undefined ? String(stepMinutes) : undefined,
|
|
47
|
-
"hours-format": hoursFormat
|
|
48
|
+
"hours-format": hoursFormat,
|
|
49
|
+
// label, helper, size, rounded e autocomplete seguem no rest com o mesmo nome do atributo.
|
|
50
|
+
error: error ? "" : undefined,
|
|
51
|
+
"error-message": errorMessage,
|
|
52
|
+
required: required ? "" : undefined,
|
|
53
|
+
readonly: readonly ? "" : undefined,
|
|
54
|
+
"full-width": fullWidth ? "" : undefined
|
|
48
55
|
};
|
|
49
56
|
return React.createElement("ark-datepicker", { ...attrs, ref: setRef });
|
|
50
57
|
});
|
package/dist/ark-dialog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkDialogCloseReason, ArkDialogStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkDialog as ArkDialogElement } from "@tooark/web-components";
|
|
3
3
|
import React, { type PropsWithChildren } from "react";
|
|
4
4
|
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
export type ArkDialogProps = PropsWithChildren<ArkDomProps<ArkDialogStyleOptions & {
|
|
@@ -39,6 +39,6 @@ export declare const ArkDialog: React.ForwardRefExoticComponent<ArkDialogStyleOp
|
|
|
39
39
|
onClose?: (event: CustomEvent<{
|
|
40
40
|
reason: ArkDialogCloseReason;
|
|
41
41
|
}>) => void;
|
|
42
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "
|
|
42
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "open" | "label" | "noScrollLock" | "onOpen" | "onClose" | keyof ArkDialogStyleOptions | "noCloseButton" | "persistent"> & {
|
|
43
43
|
children?: React.ReactNode | undefined;
|
|
44
44
|
} & React.RefAttributes<ArkDialogElement>>;
|
package/dist/ark-dialog.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { ArkDialog as ArkDialogElement } from "@tooark/web-components";
|
|
1
2
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
3
|
import { domAttrs } from "./dom-props.js";
|
|
3
|
-
import {
|
|
4
|
+
import { ensureTooarkElementsRegistered } from "./register-elements.js";
|
|
5
|
+
import { textChild } from "./text-child.js";
|
|
4
6
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
5
7
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
6
8
|
export const ArkDialog = forwardRef(function ArkDialog(props, forwardedRef) {
|
|
7
9
|
const { children, className, open, width, height, noCloseButton, persistent, noScrollLock, localeJson, headingLevel, onOpen, onClose, ...rest } = props;
|
|
8
10
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
9
11
|
useEffect(() => {
|
|
10
|
-
|
|
12
|
+
ensureTooarkElementsRegistered(ArkDialogElement);
|
|
11
13
|
}, []);
|
|
12
14
|
useIsomorphicLayoutEffect(() => {
|
|
13
15
|
const el = ref.current;
|
|
@@ -44,5 +46,5 @@ export const ArkDialog = forwardRef(function ArkDialog(props, forwardedRef) {
|
|
|
44
46
|
"locale-json": localeJson,
|
|
45
47
|
"heading-level": headingLevel
|
|
46
48
|
};
|
|
47
|
-
return createElement("ark-dialog", attrs, children);
|
|
49
|
+
return createElement("ark-dialog", attrs, textChild(children));
|
|
48
50
|
});
|
package/dist/ark-drawer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkDrawerCloseReason, ArkDrawerStyleOptions } from "@tooark/core";
|
|
2
|
-
import
|
|
2
|
+
import { ArkDrawer as ArkDrawerElement } from "@tooark/web-components";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { type PropsWithChildren } from "react";
|
|
5
5
|
import { type ArkDomProps } from "./dom-props.js";
|
|
@@ -40,6 +40,6 @@ export declare const ArkDrawer: React.ForwardRefExoticComponent<ArkDrawerStyleOp
|
|
|
40
40
|
onClose?: (event: CustomEvent<{
|
|
41
41
|
reason: ArkDrawerCloseReason;
|
|
42
42
|
}>) => void;
|
|
43
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "
|
|
43
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "open" | "label" | "noScrollLock" | "onOpen" | "onClose" | "noCloseButton" | "persistent" | keyof ArkDrawerStyleOptions> & {
|
|
44
44
|
children?: React.ReactNode | undefined;
|
|
45
45
|
} & React.RefAttributes<ArkDrawerElement>>;
|