@semcore/tab-panel 4.43.0-prerelease.0 → 4.43.0-prerelease.4

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.
@@ -1,71 +0,0 @@
1
- import type { Box, BoxProps } from '@semcore/base-components';
2
- import type { Intergalactic, PropGetterFn } from '@semcore/core';
3
- import type { NSText } from '@semcore/typography';
4
- declare namespace NSTabPanel {
5
- type Value = string | number | boolean;
6
- type Props<V extends NSTabPanel.Value = NSTabPanel.Value> = BoxProps & {
7
- /** Is invoked when changing the selection */
8
- onChange?: ((value: V, e?: React.SyntheticEvent<HTMLButtonElement>) => void) | React.Dispatch<React.SetStateAction<V>>;
9
- /** Value of the selected tab */
10
- value?: V;
11
- /** Default value of the selected tab
12
- * @default null
13
- * */
14
- defaultValue?: V;
15
- /**
16
- * Behavior of tabs.
17
- * In `auto`, changes the tab immediately when press arrow.
18
- * In `manual`, needs to press `space` or `enter` for select a choice.
19
- * @default 'auto'
20
- */
21
- behavior?: 'auto' | 'manual';
22
- };
23
- type Ctx = {
24
- getItemProps: PropGetterFn;
25
- };
26
- type Handlers = {
27
- value: null;
28
- };
29
- namespace Item {
30
- type Props = BoxProps & {
31
- /** Makes a tab selected. This property is determined automatically depending on the value. */
32
- selected?: boolean;
33
- /** Disabled state */
34
- disabled?: boolean;
35
- /** Tab value */
36
- value?: NSTabPanel.Value;
37
- /** Left addon tag */
38
- addonLeft?: React.ElementType;
39
- /** Right addon tag */
40
- addonRight?: React.ElementType;
41
- };
42
- namespace Text {
43
- type Props = NSText.Props;
44
- type Component = NSText.Component;
45
- }
46
- namespace Addon {
47
- type Component = typeof Box;
48
- }
49
- type Component = Intergalactic.Component<'div', Props, {}, [handlers: NSTabPanel.Handlers]> & {
50
- Text: Text.Component;
51
- Addon: Addon.Component;
52
- };
53
- }
54
- type WrapperComponent<PropsExtending = {}> = (<V extends NSTabPanel.Value, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', Props<V>, Ctx, [
55
- handlers: Handlers
56
- ]> & PropsExtending) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', Props>;
57
- type Component = WrapperComponent & {
58
- Item: Item.Component;
59
- };
60
- }
61
- /** @deprecated It will be removed in v18. */
62
- export type TabPanelValue = NSTabPanel.Value;
63
- /** @deprecated It will be removed in v18. */
64
- export type TabPanelProps<T extends TabPanelValue = TabPanelValue> = NSTabPanel.Props<T>;
65
- /** @deprecated It will be removed in v18. */
66
- export type TabPanelItemProps = NSTabPanel.Item.Props;
67
- /** @deprecated It will be removed in v18. */
68
- export type TabPanelContext = NSTabPanel.Ctx;
69
- /** @deprecated It will be removed in v18. */
70
- export type TabPanelHandlers = NSTabPanel.Handlers;
71
- export type { NSTabPanel };