@skeletonlabs/skeleton-react 1.0.0-next.2 → 1.0.0-next.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.
Files changed (41) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +9 -8
  2. package/dist/components/Accordion/Accordion.js +47 -68
  3. package/dist/components/Accordion/types.d.ts +24 -25
  4. package/dist/components/AppBar/AppBar.d.ts +2 -2
  5. package/dist/components/AppBar/AppBar.js +18 -20
  6. package/dist/components/AppBar/types.d.ts +1 -1
  7. package/dist/components/Avatar/Avatar.d.ts +2 -2
  8. package/dist/components/Avatar/Avatar.js +21 -7
  9. package/dist/components/Avatar/types.d.ts +10 -5
  10. package/dist/components/Navigation/Navigation.d.ts +2 -2
  11. package/dist/components/Navigation/Navigation.js +53 -30
  12. package/dist/components/Navigation/types.d.ts +6 -1
  13. package/dist/components/Progress/Progress.d.ts +2 -2
  14. package/dist/components/Progress/Progress.js +21 -14
  15. package/dist/components/Progress/types.d.ts +20 -8
  16. package/dist/components/ProgressRing/ProgressRing.d.ts +2 -2
  17. package/dist/components/ProgressRing/ProgressRing.js +22 -27
  18. package/dist/components/ProgressRing/types.d.ts +9 -13
  19. package/dist/components/Rating/Rating.d.ts +3 -3
  20. package/dist/components/Rating/Rating.js +50 -76
  21. package/dist/components/Rating/types.d.ts +35 -54
  22. package/dist/components/Segment/Segment.d.ts +6 -0
  23. package/dist/components/Segment/Segment.js +62 -0
  24. package/dist/components/Segment/types.d.ts +59 -0
  25. package/dist/components/Segment/types.js +2 -0
  26. package/dist/components/Switch/Switch.d.ts +2 -2
  27. package/dist/components/Switch/Switch.js +34 -27
  28. package/dist/components/Switch/types.d.ts +28 -25
  29. package/dist/components/Tabs/Tabs.d.ts +12 -7
  30. package/dist/components/Tabs/Tabs.js +65 -99
  31. package/dist/components/Tabs/types.d.ts +48 -81
  32. package/dist/components/Test/Test.js +1 -1
  33. package/dist/index.d.ts +11 -10
  34. package/dist/index.js +11 -10
  35. package/dist/internal/nodes.d.ts +3 -0
  36. package/dist/internal/nodes.js +4 -0
  37. package/dist/internal/noop.d.ts +1 -0
  38. package/dist/internal/noop.js +2 -0
  39. package/package.json +36 -35
  40. package/dist/utils/react-compose.d.ts +0 -4
  41. package/dist/utils/react-compose.js +0 -3
@@ -1,41 +1,48 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- export const Switch = ({ id = "", name = "", checked = false, disabled = false, compact = false,
4
- // Aria
5
- labelledby = undefined, describedby = undefined,
3
+ import { useId } from 'react';
4
+ import * as zagSwitch from '@zag-js/switch';
5
+ import { useMachine, normalizeProps } from '@zag-js/react';
6
+ import { noop } from '../../internal/noop.js';
7
+ export const Switch = ({ name = '', checked = false, disabled = false, compact = false,
6
8
  // Root (Track)
7
- base = "flex cursor-pointer transition duration-200", stateInactive = "preset-filled-surface-200-800", stateActive = "preset-filled-primary-500", stateDisabled = "opacity-50 cursor-not-allowed", width = "w-10", height = "h-6", padding = "p-0.5", rounded = "rounded-full", hover = "hover:brightness-90 dark:hover:brightness-110", classes = "",
9
+ base = 'inline-flex items-center gap-4', classes = '',
10
+ // Control
11
+ controlBase = 'cursor-pointer transition duration-200', controlInactive = 'preset-filled-surface-200-800', controlActive = 'preset-filled-primary-500', controlDisabled = 'opacity-50 cursor-not-allowed', controlWidth = 'w-10', controlHeight = 'h-6', controlPadding = 'p-0.5', controlRounded = 'rounded-full', controlHover = 'hover:brightness-90 dark:hover:brightness-110', controlClasses = '',
8
12
  // Thumb
9
- thumbBase = "right-0 aspect-square h-full flex justify-center items-center text-right", thumbInactive = "preset-filled-surface-50-950", thumbActive = "bg-surface-50 text-surface-contrast-50", thumbRounded = "rounded-full", thumbTranslateX = "translate-x-4", thumbTransition = "transition", thumbEase = "ease-in-out", thumbDuration = "duration-200", thumbClasses = "",
13
+ thumbBase = 'right-0 aspect-square h-full flex justify-center items-center text-right cursor-pointer', thumbInactive = 'preset-filled-surface-50-950', thumbActive = 'bg-surface-50 text-surface-contrast-50', thumbRounded = 'rounded-full', thumbTranslateX = 'translate-x-4 rtl:-translate-x-4', thumbTransition = 'transition', thumbEase = 'ease-in-out', thumbDuration = 'duration-200', thumbClasses = '',
14
+ // Label
15
+ labelBase = '', labelClasses = '',
10
16
  // Icons
11
- iconInactiveBase = "pointer-events-none", iconActiveBase = "pointer-events-none",
17
+ iconInactiveBase = 'pointer-events-none', iconActiveBase = 'pointer-events-none',
12
18
  // Events
13
- onCheckedChange = () => { },
19
+ onCheckedChange = noop,
14
20
  // Children
15
- inactiveChild, activeChild, }) => {
21
+ children, inactiveChild, activeChild }) => {
22
+ // Zag
23
+ const [state, send] = useMachine(zagSwitch.machine({
24
+ id: useId(),
25
+ name,
26
+ disabled,
27
+ checked,
28
+ onCheckedChange: (details) => onCheckedChange(details.checked)
29
+ }));
30
+ const api = zagSwitch.connect(state, send, normalizeProps);
16
31
  // Set Compact Mode
17
32
  if (compact) {
18
- base = thumbBase;
33
+ controlBase = thumbBase;
19
34
  // Removes the height class
20
- height = "";
35
+ controlHeight = '';
21
36
  // Thumb inherits track styles
22
- thumbInactive = stateInactive;
23
- thumbActive = stateActive;
37
+ thumbInactive = controlInactive;
38
+ thumbActive = controlActive;
24
39
  // Remove X-axis translate
25
- thumbTranslateX = "";
40
+ thumbTranslateX = '';
26
41
  // Remove padding
27
- padding = "";
42
+ controlPadding = '';
28
43
  }
29
- function toggle() {
30
- if (disabled)
31
- return;
32
- checked = !checked;
33
- onCheckedChange(checked);
34
- }
35
- const rxTrackState = checked ? stateActive : stateInactive;
36
- const rxThumbState = checked
37
- ? `${thumbActive} ${thumbTranslateX}`
38
- : thumbInactive;
39
- const rxDisabled = disabled ? stateDisabled : "";
40
- return (_jsxs("button", { type: "button", className: `${base} ${rxTrackState} ${width} ${height} ${padding} ${rounded} ${hover} ${rxDisabled} ${classes}`, role: "switch", "aria-checked": checked, "aria-labelledby": labelledby, "aria-describedby": describedby, onClick: toggle, "data-testid": "switch", children: [_jsx("input", { type: "checkbox", id: id, name: name, checked: checked, onChange: () => { }, className: "hidden", disabled: disabled }), _jsxs("div", { className: `${thumbBase} ${rxThumbState} ${thumbRounded} ${thumbTransition} ${thumbEase} ${thumbDuration} ${thumbClasses}`, children: [!checked && inactiveChild ? (_jsx("span", { className: iconInactiveBase, children: inactiveChild })) : null, checked && activeChild ? (_jsx("span", { className: iconActiveBase, children: activeChild })) : null] })] }));
44
+ const rxTrackState = api.checked ? controlActive : controlInactive;
45
+ const rxThumbState = api.checked ? `${thumbActive} ${thumbTranslateX}` : thumbInactive;
46
+ const rxDisabled = api.disabled ? controlDisabled : '';
47
+ return (_jsxs("label", { ...api.getRootProps(), className: `${base} ${classes}`, "data-testid": "switch", children: [_jsx("input", { ...api.getHiddenInputProps(), "data-testid": "switch-input" }), _jsx("span", { ...api.getControlProps(), className: `${controlBase} ${rxTrackState} ${controlWidth} ${controlHeight} ${controlPadding} ${controlRounded} ${controlHover} ${rxDisabled} ${controlClasses}`, "data-testid": "switch-control", children: _jsxs("span", { ...api.getThumbProps(), className: `${thumbBase} ${rxThumbState} ${thumbRounded} ${thumbTransition} ${thumbEase} ${thumbDuration} ${thumbClasses}`, "data-testid": "switch-thumb", children: [!checked && inactiveChild ? (_jsx("span", { className: iconInactiveBase, "data-testid": "switch-icon-inactive", children: inactiveChild })) : null, checked && activeChild ? (_jsx("span", { className: iconActiveBase, "data-testid": "switch-icon-active", children: activeChild })) : null] }) }), _jsx("span", { ...api.getLabelProps(), className: `${labelBase} ${labelClasses}`, "data-testid": "switch-label", children: children })] }));
41
48
  };
@@ -1,7 +1,6 @@
1
- import { ReactNode } from "react";
2
- export interface SwitchProps {
3
- /** Set a unique ID for the switch input. */
4
- id: string;
1
+ import { ReactNode } from 'react';
2
+ import * as zagSwitch from '@zag-js/switch';
3
+ export interface SwitchProps extends React.PropsWithChildren, Omit<zagSwitch.Context, 'id' | 'onCheckedChange'> {
5
4
  /** Set a unique name for the switch input. */
6
5
  name: string;
7
6
  /** Set the checked state. */
@@ -10,30 +9,30 @@ export interface SwitchProps {
10
9
  disabled?: boolean;
11
10
  /** Set the compact display mode. */
12
11
  compact?: boolean;
13
- /** Identifies the element that labels the switch. */
14
- labelledby?: string | undefined;
15
- /** Identifies the element that describes the switch. */
16
- describedby?: string | undefined;
17
12
  /** Set base classes for the root element. */
18
13
  base?: string;
19
- /** Set inactive state classes for the root element. */
20
- stateInactive?: string;
21
- /** Set active state classes for the root element. */
22
- stateActive?: string;
23
- /** Set disabled state classes for the root element. */
24
- stateDisabled?: string;
25
- /** Set width classes for the root element. */
26
- width?: string;
27
- /** Set height classes for the root element. */
28
- height?: string;
29
- /** Set padding classes for the root element. */
30
- padding?: string;
31
- /** Set rounded classes for the root element. */
32
- rounded?: string;
33
- /** Set hover classes for the root element. */
34
- hover?: string;
35
14
  /** Provide arbitrary classes to the root element. */
36
15
  classes?: string;
16
+ /** Set base classes for the control element. */
17
+ controlBase?: string;
18
+ /** Set inactive state classes for the control element. */
19
+ controlInactive?: string;
20
+ /** Set active state classes for the control element. */
21
+ controlActive?: string;
22
+ /** Set disabled state classes for the control element. */
23
+ controlDisabled?: string;
24
+ /** Set width classes for the control element. */
25
+ controlWidth?: string;
26
+ /** Set height classes for the control element. */
27
+ controlHeight?: string;
28
+ /** Set padding classes for the control element. */
29
+ controlPadding?: string;
30
+ /** Set rounded classes for the control element. */
31
+ controlRounded?: string;
32
+ /** Set hover classes for the control element. */
33
+ controlHover?: string;
34
+ /** Provide arbitrary classes to the control element. */
35
+ controlClasses?: string;
37
36
  /** Set base classes for the thumb element. */
38
37
  thumbBase?: string;
39
38
  /** Set inactive classes for the thumb element. */
@@ -52,12 +51,16 @@ export interface SwitchProps {
52
51
  thumbDuration?: string;
53
52
  /** Provide arbitrary classes to the thumb element. */
54
53
  thumbClasses?: string;
54
+ /** Set base classes for the label element. */
55
+ labelBase?: string;
56
+ /** Provide arbitrary classes to the label element. */
57
+ labelClasses?: string;
55
58
  /** Set base classes for the inactive icon child. */
56
59
  iconInactiveBase?: string;
57
60
  /** Set base classes for the active icon child. */
58
61
  iconActiveBase?: string;
59
62
  /** Triggers when the switch is toggled. */
60
- onCheckedChange?: (event: boolean) => void;
63
+ onCheckedChange?: (value: boolean) => void;
61
64
  /** The inactive state children. */
62
65
  inactiveChild?: ReactNode;
63
66
  /** The active state children. */
@@ -1,8 +1,13 @@
1
- import React from "react";
2
- import { TabsProps, TabsListProps, TabsControlProps, TabsControlItemProps, TabsPanelItemProps } from "./types.js";
3
- export declare const Tabs: React.FC<TabsProps> & {
4
- List: React.FC<TabsListProps>;
5
- Control: React.FC<TabsControlProps>;
6
- Panel: React.FC<TabsPanelItemProps>;
7
- Item: React.FC<TabsControlItemProps>;
1
+ import { FC } from 'react';
2
+ import { TabsContextState, TabsRootProps, TabsListProps, TabsControlProps, TabsContentProps, TabsPanelProps } from './types.js';
3
+ export declare const TabsContext: import("react").Context<TabsContextState>;
4
+ export declare const Tabs: FC<TabsRootProps> & {
5
+ /** A group of tab controls. */
6
+ List: FC<TabsListProps>;
7
+ /** An individual tab control. */
8
+ Control: FC<TabsControlProps>;
9
+ /** A group of tab panels. */
10
+ Content: FC<TabsContentProps>;
11
+ /** An individual tab panel. */
12
+ Panel: FC<TabsPanelProps>;
8
13
  };
@@ -1,121 +1,87 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from "react";
3
+ import { createContext, useContext, useId } from 'react';
4
+ import * as tabs from '@zag-js/tabs';
5
+ import { useMachine, normalizeProps } from '@zag-js/react';
6
+ import { noop } from '../../internal/noop.js';
7
+ // Context ---
8
+ export const TabsContext = createContext({
9
+ fluid: false,
10
+ api: {}
11
+ });
3
12
  // Components ---
4
- const TabsRoot = ({ id = "",
13
+ const TabsRoot = ({ fluid = false,
5
14
  // Root
6
- base = "w-full", spaceY = "space-y-4", classes = "",
15
+ base = 'w-full', classes = '',
16
+ // Events
17
+ onValueChange = noop,
7
18
  // Children
8
- children, }) => {
9
- return (_jsx("div", { id: id, className: `${base} ${spaceY} ${classes}`, "data-testid": "tabs", children: children }));
19
+ children,
20
+ // Zag
21
+ ...zagProps }) => {
22
+ // Zag
23
+ const [state, send] = useMachine(tabs.machine({
24
+ id: useId(),
25
+ onValueChange: (details) => onValueChange(details.value)
26
+ }), { context: zagProps });
27
+ const api = tabs.connect(state, send, normalizeProps);
28
+ return (_jsx("div", { ...api.getRootProps(), className: `${base} ${classes}`, "data-testid": "tabs", children: _jsx(TabsContext.Provider, { value: { fluid, api }, children: children }) }));
10
29
  };
11
30
  const TabsList = ({
12
31
  // Root
13
- base = "flex", justify = "justify-start", gap = "gap-2", border = "border-b border-surface-200-800", classes = "",
32
+ base = 'flex', justify = 'justify-start', border = 'border-b border-surface-200-800', margin = 'mb-4', gap = 'gap-2', classes = '',
14
33
  // Children
15
- children, }) => {
16
- return (_jsx("div", { className: `${base} ${gap} ${justify} ${border} ${classes}`, role: "tablist", children: children }));
34
+ children }) => {
35
+ const ctx = useContext(TabsContext);
36
+ return (_jsx("div", { ...ctx.api.getListProps(), className: `${base} ${justify} ${border} ${margin} ${gap} ${classes}`, "data-testid": "tabs-list", children: children }));
17
37
  };
18
- const TabsControl = ({ id = "", name, group, title = "",
19
- // A11y
20
- label = "", controls = "",
38
+ const TabsControl = ({
21
39
  // Root
22
- base = "group", width = "", active = "text-surface-950-50 border-surface-950-50", inactive = "text-surface-600-400 border-transparent", flex = "flex justify-center items-center", background = "", border = "border-b", text = "type-scale-3", padding = "pb-2", rounded = "", gap = "gap-1", cursor = "cursor-pointer", classes = "",
23
- // Events
24
- onClick = () => { }, onKeydown = () => { }, onKeyup = () => { }, onChange = () => { },
40
+ base = 'border-b border-transparent', padding = 'pb-2', translateX = 'translate-y-[1px]', classes = '',
41
+ // Label
42
+ labelBase = 'btn hover:preset-tonal-primary', labelClasses = '',
43
+ // State
44
+ stateInactive = '[&:not(:hover)]:opacity-50', stateActive = 'border-surface-950-50 opacity-100', stateLabelInactive = '', stateLabelActive = '',
45
+ // Nodes
46
+ lead,
25
47
  // Children
26
- children, }) => {
27
- const [selected, setSelected] = useState(group === name);
28
- useEffect(() => {
29
- setSelected(group === name);
30
- }, [group, name]);
31
- const [rxActive, setRxActive] = useState(selected ? active : inactive);
32
- useEffect(() => {
33
- setRxActive(selected ? active : inactive);
34
- }, [selected, active, inactive]);
35
- function handleOnChange(event) {
36
- onChange(event.target.value);
37
- }
38
- const elemInputRef = useRef(null);
39
- function onKeyDownHandler(event) {
40
- // Fire Event Handler
41
- onKeydown(event);
42
- // If select key events
43
- if (!["ArrowRight", "ArrowLeft", "Home", "End"].includes(event.code))
44
- return;
45
- const elemInput = elemInputRef.current;
46
- if (!elemInput)
47
- return;
48
- // Prevent default behavior
49
- event.preventDefault();
50
- // Find the closest tab/tablelist
51
- const currTab = elemInput.closest('[role="tab"]');
52
- if (!currTab)
53
- return;
54
- const tabList = elemInput.closest('[role="tablist"]');
55
- if (!tabList)
56
- return;
57
- // Get RTL mode
58
- const isRTL = getComputedStyle(tabList).direction === "rtl";
59
- // Get list of tab elements
60
- const tabs = Array.from(tabList.querySelectorAll('[role="tab"]'));
61
- // Get a reference to the current tab
62
- const currIndex = tabs.indexOf(currTab);
63
- // Determine the index of the next tab
64
- let nextIndex = -1;
65
- switch (event.code) {
66
- case "ArrowRight":
67
- if (isRTL) {
68
- nextIndex = currIndex - 1 < 0 ? tabs.length - 1 : currIndex - 1;
69
- break;
70
- }
71
- nextIndex = currIndex + 1 >= tabs.length ? 0 : currIndex + 1;
72
- break;
73
- case "ArrowLeft":
74
- if (isRTL) {
75
- nextIndex = currIndex + 1 >= tabs.length ? 0 : currIndex + 1;
76
- break;
77
- }
78
- nextIndex = currIndex - 1 < 0 ? tabs.length - 1 : currIndex - 1;
79
- break;
80
- case "Home":
81
- nextIndex = 0;
82
- break;
83
- case "End":
84
- nextIndex = tabs.length - 1;
85
- break;
86
- }
87
- if (nextIndex < 0)
88
- return;
89
- // Set Active Tab
90
- const nextTab = tabs[nextIndex];
91
- const nextTabInput = nextTab?.querySelector("input");
92
- if (nextTabInput) {
93
- nextTabInput.click();
94
- nextTab.focus();
95
- }
96
- }
97
- return (_jsx("label", { id: id, className: `${base} ${width} ${rxActive} ${flex} ${background} ${border} ${text} ${padding} ${rounded} ${gap} ${cursor} ${classes}`, "aria-label": label, title: title, children: _jsxs("div", { className: "size-full", role: "tab", "aria-controls": controls, "aria-selected": selected, "data-testid": "tabs-control", tabIndex: selected ? 0 : -1, onKeyDown: onKeyDownHandler, onKeyUp: onKeyup, children: [_jsx("div", { className: "h-0 w-0 flex-none overflow-hidden", children: _jsx("input", { ref: elemInputRef, type: "radio", name: name, value: name, checked: selected, onChange: handleOnChange, onClick: onClick, tabIndex: -1 }) }), children] }) }));
48
+ children,
49
+ // Zag
50
+ ...zagProps }) => {
51
+ const ctx = useContext(TabsContext);
52
+ const state = ctx.api.getTriggerState(zagProps);
53
+ // Reactive
54
+ const rxActive = state.selected ? stateActive : stateInactive;
55
+ const rxLabelActive = state.selected ? stateLabelActive : stateLabelInactive;
56
+ // Styles
57
+ const commonStyles = { width: ctx.fluid ? '100%' : '' };
58
+ return (_jsx("button", { ...ctx.api.getTriggerProps(zagProps), className: `${base} ${padding} ${translateX} ${rxActive} ${classes}`, style: commonStyles, "data-testid": "tabs-control", children: _jsxs("div", { className: `${labelBase} ${rxLabelActive} ${labelClasses}`, style: commonStyles, "data-testid": "tabs-control-label", children: [lead && _jsx("span", { "data-testid": "tabs-control-lead", children: lead }), _jsx("span", { "data-testid": "tabs-control-children", children: children })] }) }));
98
59
  };
99
- const TabsControlItem = ({
60
+ const TabsContent = ({
100
61
  // Root
101
- base = "w-full", flex = "flex justify-center items-center", gap = "gap-2", background = "group-hover:preset-tonal-primary", padding = "p-2 px-4", rounded = "rounded-container", classes = "",
62
+ base = '', classes = '',
102
63
  // Children
103
- children, }) => {
104
- return (_jsx("div", { className: `${base} ${flex} ${gap} ${background} ${padding} ${rounded} ${classes}`, children: children }));
64
+ children }) => {
65
+ return (_jsx("div", { className: `${base} ${classes}`, "data-testid": "tabs-content", children: children }));
105
66
  };
106
- const TabsPanelItem = ({ id = "", value, group,
107
- // A11y
108
- labelledBy,
67
+ const TabsPanel = ({
109
68
  // Root
110
- classes = "",
69
+ base = '', classes = '',
111
70
  // Children
112
- children, }) => {
113
- return (value === group &&
114
- children && (_jsx("div", { id: id, role: "tabpanel", tabIndex: 0, "aria-labelledby": labelledBy, className: classes, children: children })));
71
+ children,
72
+ // Zag
73
+ ...zagProps }) => {
74
+ const ctx = useContext(TabsContext);
75
+ return (_jsx("div", { ...ctx.api.getContentProps(zagProps), className: `${base} ${classes}`, "data-testid": "tabs-panel", children: children }));
115
76
  };
77
+ // Export ---
116
78
  export const Tabs = Object.assign(TabsRoot, {
79
+ /** A group of tab controls. */
117
80
  List: TabsList,
81
+ /** An individual tab control. */
118
82
  Control: TabsControl,
119
- Panel: TabsPanelItem,
120
- Item: TabsControlItem,
83
+ /** A group of tab panels. */
84
+ Content: TabsContent,
85
+ /** An individual tab panel. */
86
+ Panel: TabsPanel
121
87
  });
@@ -1,99 +1,66 @@
1
- import React from "react";
2
- export interface TabsProps extends React.PropsWithChildren {
3
- /** Provide a unique ID. */
4
- id?: string;
5
- /** Sets base styles. */
1
+ import React, { ReactNode } from 'react';
2
+ import * as tabs from '@zag-js/tabs';
3
+ export interface TabsContextState {
4
+ fluid: boolean;
5
+ api: ReturnType<typeof tabs.connect>;
6
+ }
7
+ export interface TabsRootProps extends React.PropsWithChildren, Omit<tabs.Context, 'id' | 'orientation' | 'onValueChange'> {
8
+ /** Set tabs to stretch to fill the available width. */
9
+ fluid?: boolean;
10
+ /** Set base classes for the root element. */
6
11
  base?: string;
7
- /** Set vertical spacing between list and panels. */
8
- spaceY?: string;
9
- /** Provide arbitrary CSS classes. */
12
+ /** Provide arbitrary classes for the root element. */
10
13
  classes?: string;
14
+ /** Triggers when the value state is changed. */
15
+ onValueChange?: (value: string) => void;
11
16
  }
12
17
  export interface TabsListProps extends React.PropsWithChildren {
13
- /** Sets the base styles. */
18
+ /** Set base classes for the list element. */
14
19
  base?: string;
15
- /** Sets the justification styles. */
20
+ /** Set justify classes for the list element. */
16
21
  justify?: string;
17
- /** Sets the gap spacing. */
18
- gap?: string;
19
- /** Sets the border styles. */
22
+ /** Set border classes for the list element. */
20
23
  border?: string;
21
- /** Provide arbitrary CSS classes. */
24
+ /** Set margin classes for the list element. */
25
+ margin?: string;
26
+ /** Set gap classes for the list element. */
27
+ gap?: string;
28
+ /** Provide arbitrary classes for the list element. */
22
29
  classes?: string;
23
30
  }
24
- export interface TabsControlProps extends React.PropsWithChildren {
25
- /** Provide a unique ID. */
26
- id?: string;
27
- /** Provide the tab control name. */
28
- name: string;
29
- /** Provide the tab control radio group. */
30
- group: string;
31
- /** Provide a hoverable title attribute. */
32
- title?: string;
33
- /** Sets the A11y label. */
34
- label?: string;
35
- /** Sets ARIA controls value to define which panel this tab controls. */
36
- controls?: string;
37
- /** Sets base styles. */
31
+ export interface TabsControlProps extends React.PropsWithChildren, tabs.TriggerProps {
32
+ /** Set base classes for the control element. */
38
33
  base?: string;
39
- /** Sets width styles. */
40
- width?: string;
41
- /** Sets the active control styles. */
42
- active?: string;
43
- /** Sets the inactive control styles. */
44
- inactive?: string;
45
- /** Sets flex styles. */
46
- flex?: string;
47
- /** Sets background styles. */
48
- background?: string;
49
- /** Sets border styles. */
50
- border?: string;
51
- /** Sets text size styles. */
52
- text?: string;
53
- /** Sets padding styles. */
34
+ /** Set padding classes for the control element. */
54
35
  padding?: string;
55
- /** Sets rounded styles. */
56
- rounded?: string;
57
- /** Sets vertical gap styles. */
58
- gap?: string;
59
- /** Sets cursor styles. */
60
- cursor?: string;
61
- /** Provide arbitrary CSS classes. */
36
+ /** Set x-axis translate classes for the control element. */
37
+ translateX?: string;
38
+ /** Provide arbitrary classes for the control element. */
62
39
  classes?: string;
63
- /** Triggers on Tab Control click. */
64
- onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
65
- /** Triggers on Tab Control key down. */
66
- onKeydown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
67
- /** Triggers on Tab Control key up. */
68
- onKeyup?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
69
- /** Triggers on Tab Control group change. */
70
- onChange?: (group: string) => void;
40
+ /** Set base classes for the label element. */
41
+ labelBase?: string;
42
+ /** Provide arbitrary classes for the label element. */
43
+ labelClasses?: string;
44
+ /** Set inactive classes for the control element. */
45
+ stateInactive?: string;
46
+ /** Set active classes for the control element. */
47
+ stateActive?: string;
48
+ /** Set inactive classes for the label element. */
49
+ stateLabelInactive?: string;
50
+ /** Set active classes for the label element. */
51
+ stateLabelActive?: string;
52
+ /** The lead node for the control element. */
53
+ lead?: ReactNode;
71
54
  }
72
- export interface TabsControlItemProps extends React.PropsWithChildren {
73
- /** Sets base styles. */
55
+ export interface TabsContentProps extends React.PropsWithChildren {
56
+ /** Set base classes for the panel group element. */
74
57
  base?: string;
75
- /** Sets flex styles. */
76
- flex?: string;
77
- /** Sets gap styles. */
78
- gap?: string;
79
- /** Sets background styles. */
80
- background?: string;
81
- /** Sets padding styles. */
82
- padding?: string;
83
- /** Sets rounded styles. */
84
- rounded?: string;
85
- /** Provide arbitrary CSS classes. */
58
+ /** Provide arbitrary classes for the panel group element. */
86
59
  classes?: string;
87
60
  }
88
- export interface TabsPanelItemProps extends React.PropsWithChildren {
89
- /** Provide a unique ID. */
90
- id?: string;
91
- /** Provide the tab panel value. */
92
- value: string;
93
- /** Provide the tab control radio group. */
94
- group: string;
95
- /** Sets the A11y labelledby. */
96
- labelledBy?: string;
97
- /** Provide arbitrary CSS classes. */
61
+ export interface TabsPanelProps extends React.PropsWithChildren, tabs.ContentProps {
62
+ /** Set base classes for the panel element. */
63
+ base?: string;
64
+ /** Provide arbitrary classes for the panel element. */
98
65
  classes?: string;
99
66
  }
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import { useState } from 'react';
3
3
  function Test() {
4
4
  const [count, setCount] = useState(0);
5
5
  function countUp() {
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- export { default as TestReact } from "./components/Test/Test.js";
2
- export { Accordion } from "./components/Accordion/Accordion.js";
3
- export { Avatar } from "./components/Avatar/Avatar.js";
4
- export { AppBar } from "./components/AppBar/AppBar.js";
5
- export { Nav } from "./components/Navigation/Navigation.js";
6
- export { Progress } from "./components/Progress/Progress.js";
7
- export { ProgressRing } from "./components/ProgressRing/ProgressRing.js";
8
- export { Switch } from "./components/Switch/Switch.js";
9
- export { Tabs } from "./components/Tabs/Tabs.js";
10
- export { Rating } from "./components/Rating/Rating.js";
1
+ export { default as TestReact } from './components/Test/Test.js';
2
+ export { Accordion } from './components/Accordion/Accordion.js';
3
+ export { Avatar } from './components/Avatar/Avatar.js';
4
+ export { AppBar } from './components/AppBar/AppBar.js';
5
+ export { Nav } from './components/Navigation/Navigation.js';
6
+ export { Progress } from './components/Progress/Progress.js';
7
+ export { ProgressRing } from './components/ProgressRing/ProgressRing.js';
8
+ export { Switch } from './components/Switch/Switch.js';
9
+ export { Segment } from './components/Segment/Segment.js';
10
+ export { Tabs } from './components/Tabs/Tabs.js';
11
+ export { Rating } from './components/Rating/Rating.js';
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
- export { default as TestReact } from "./components/Test/Test.js";
1
+ export { default as TestReact } from './components/Test/Test.js';
2
2
  // Components
3
- export { Accordion } from "./components/Accordion/Accordion.js";
4
- export { Avatar } from "./components/Avatar/Avatar.js";
5
- export { AppBar } from "./components/AppBar/AppBar.js";
6
- export { Nav } from "./components/Navigation/Navigation.js";
7
- export { Progress } from "./components/Progress/Progress.js";
8
- export { ProgressRing } from "./components/ProgressRing/ProgressRing.js";
9
- export { Switch } from "./components/Switch/Switch.js";
10
- export { Tabs } from "./components/Tabs/Tabs.js";
11
- export { Rating } from "./components/Rating/Rating.js";
3
+ export { Accordion } from './components/Accordion/Accordion.js';
4
+ export { Avatar } from './components/Avatar/Avatar.js';
5
+ export { AppBar } from './components/AppBar/AppBar.js';
6
+ export { Nav } from './components/Navigation/Navigation.js';
7
+ export { Progress } from './components/Progress/Progress.js';
8
+ export { ProgressRing } from './components/ProgressRing/ProgressRing.js';
9
+ export { Switch } from './components/Switch/Switch.js';
10
+ export { Segment } from './components/Segment/Segment.js';
11
+ export { Tabs } from './components/Tabs/Tabs.js';
12
+ export { Rating } from './components/Rating/Rating.js';
@@ -0,0 +1,3 @@
1
+ export declare const starEmpty: import("react/jsx-runtime").JSX.Element;
2
+ export declare const starHalf: import("react/jsx-runtime").JSX.Element;
3
+ export declare const starFull: import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const starEmpty = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", height: "24", width: "24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z" }) }));
3
+ export const starHalf = (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: "24", width: "24", children: [_jsx("defs", { children: _jsxs("linearGradient", { id: "half-fill", children: [_jsx("stop", { offset: "50%", stopColor: "currentColor" }), _jsx("stop", { offset: "50%", stopColor: "transparent" })] }) }), _jsx("path", { fill: "url(#half-fill)", d: "M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z" })] }));
4
+ export const starFull = (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", height: "24", width: "24", children: _jsx("path", { fillRule: "evenodd", d: "M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z", clipRule: "evenodd" }) }));
@@ -0,0 +1 @@
1
+ export declare function noop(): void;
@@ -0,0 +1,2 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2
+ export function noop() { }