@skeletonlabs/skeleton-react 1.5.0-next.0 → 2.0.0-next.2

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 (192) hide show
  1. package/dist/components/accordion/anatomy/accordion-content.d.ts +9 -0
  2. package/dist/components/accordion/anatomy/accordion-content.js +24 -0
  3. package/dist/components/accordion/anatomy/accordion-heading.d.ts +16 -0
  4. package/dist/components/accordion/anatomy/accordion-heading.js +17 -0
  5. package/dist/components/accordion/anatomy/accordion-indicator.d.ts +9 -0
  6. package/dist/components/accordion/anatomy/accordion-indicator.js +21 -0
  7. package/dist/components/accordion/anatomy/accordion-item-context.d.ts +10 -0
  8. package/dist/components/accordion/anatomy/accordion-item-context.js +11 -0
  9. package/dist/components/accordion/anatomy/accordion-item.d.ts +10 -0
  10. package/dist/components/accordion/anatomy/accordion-item.js +28 -0
  11. package/dist/components/accordion/anatomy/accordion-root-context.d.ts +10 -0
  12. package/dist/components/accordion/anatomy/accordion-root-context.js +11 -0
  13. package/dist/components/accordion/anatomy/accordion-root.d.ts +10 -0
  14. package/dist/components/accordion/anatomy/accordion-root.js +28 -0
  15. package/dist/components/accordion/anatomy/accordion-trigger.d.ts +9 -0
  16. package/dist/components/accordion/anatomy/accordion-trigger.js +21 -0
  17. package/dist/components/accordion/index.js +3 -0
  18. package/dist/components/accordion/modules/accordion-anatomy.d.ts +21 -0
  19. package/dist/components/accordion/modules/accordion-anatomy.js +22 -0
  20. package/dist/components/accordion/modules/accordion-item-context.d.ts +10 -0
  21. package/dist/components/accordion/modules/accordion-item-context.js +7 -0
  22. package/dist/components/accordion/modules/accordion-root-context.d.ts +9 -0
  23. package/dist/components/accordion/modules/accordion-root-context.js +7 -0
  24. package/dist/components/avatar/anatomy/avatar-fallback.d.ts +9 -0
  25. package/dist/components/avatar/anatomy/avatar-fallback.js +22 -0
  26. package/dist/components/avatar/anatomy/avatar-image.d.ts +9 -0
  27. package/dist/components/avatar/anatomy/avatar-image.js +19 -0
  28. package/dist/components/avatar/anatomy/avatar-root-context.d.ts +10 -0
  29. package/dist/components/avatar/anatomy/avatar-root-context.js +11 -0
  30. package/dist/components/avatar/anatomy/avatar-root.d.ts +10 -0
  31. package/dist/components/avatar/anatomy/avatar-root.js +31 -0
  32. package/dist/components/avatar/index.js +3 -0
  33. package/dist/components/avatar/modules/avatar-anatomy.d.ts +13 -0
  34. package/dist/components/avatar/modules/avatar-anatomy.js +14 -0
  35. package/dist/components/avatar/modules/avatar-root-context.d.ts +9 -0
  36. package/dist/components/avatar/modules/avatar-root-context.js +7 -0
  37. package/dist/components/rating-group/anatomy/rating-group-control.d.ts +9 -0
  38. package/dist/components/rating-group/anatomy/rating-group-control.js +19 -0
  39. package/dist/components/rating-group/anatomy/rating-group-hidden-input.d.ts +9 -0
  40. package/dist/components/rating-group/anatomy/rating-group-hidden-input.js +16 -0
  41. package/dist/components/rating-group/anatomy/rating-group-item-context.d.ts +10 -0
  42. package/dist/components/rating-group/anatomy/rating-group-item-context.js +11 -0
  43. package/dist/components/rating-group/anatomy/rating-group-item.d.ts +29 -0
  44. package/dist/components/rating-group/anatomy/rating-group-item.js +29 -0
  45. package/dist/components/rating-group/anatomy/rating-group-label.d.ts +9 -0
  46. package/dist/components/rating-group/anatomy/rating-group-label.js +19 -0
  47. package/dist/components/rating-group/anatomy/rating-group-root-context.d.ts +10 -0
  48. package/dist/components/rating-group/anatomy/rating-group-root-context.js +11 -0
  49. package/dist/components/rating-group/anatomy/rating-group-root.d.ts +10 -0
  50. package/dist/components/rating-group/anatomy/rating-group-root.js +28 -0
  51. package/dist/components/rating-group/index.js +3 -0
  52. package/dist/components/rating-group/modules/rating-group-anatomy.d.ts +19 -0
  53. package/dist/components/rating-group/modules/rating-group-anatomy.js +20 -0
  54. package/dist/components/rating-group/modules/rating-group-item-context.d.ts +9 -0
  55. package/dist/components/rating-group/modules/rating-group-item-context.js +7 -0
  56. package/dist/components/rating-group/modules/rating-group-root-context.d.ts +9 -0
  57. package/dist/components/rating-group/modules/rating-group-root-context.js +7 -0
  58. package/dist/components/tabs/anatomy/tabs-content.d.ts +10 -0
  59. package/dist/components/tabs/anatomy/tabs-content.js +21 -0
  60. package/dist/components/tabs/anatomy/tabs-indicator.d.ts +9 -0
  61. package/dist/components/tabs/anatomy/tabs-indicator.js +16 -0
  62. package/dist/components/tabs/anatomy/tabs-list.d.ts +9 -0
  63. package/dist/components/tabs/anatomy/tabs-list.js +19 -0
  64. package/dist/components/tabs/anatomy/tabs-root-context.d.ts +10 -0
  65. package/dist/components/tabs/anatomy/tabs-root-context.js +11 -0
  66. package/dist/components/tabs/anatomy/tabs-root.d.ts +10 -0
  67. package/dist/components/tabs/anatomy/tabs-root.js +28 -0
  68. package/dist/components/tabs/anatomy/tabs-trigger.d.ts +10 -0
  69. package/dist/components/tabs/anatomy/tabs-trigger.js +21 -0
  70. package/dist/components/tabs/index.js +3 -0
  71. package/dist/components/tabs/modules/tabs-anatomy.d.ts +17 -0
  72. package/dist/components/tabs/modules/tabs-anatomy.js +18 -0
  73. package/dist/components/tabs/modules/tabs-root-context.d.ts +9 -0
  74. package/dist/components/tabs/modules/tabs-root-context.js +7 -0
  75. package/dist/index.css +2 -0
  76. package/dist/index.d.ts +36 -17
  77. package/dist/index.js +10 -17
  78. package/dist/internal/components/star-empty.js +22 -0
  79. package/dist/internal/components/star-full.js +20 -0
  80. package/dist/internal/components/star-half.js +36 -0
  81. package/dist/internal/props-with-element.d.ts +13 -0
  82. package/package.json +30 -33
  83. package/dist/components/Accordion/Accordion.d.ts +0 -7
  84. package/dist/components/Accordion/Accordion.js +0 -62
  85. package/dist/components/Accordion/context.d.ts +0 -4
  86. package/dist/components/Accordion/context.js +0 -10
  87. package/dist/components/Accordion/types.d.ts +0 -73
  88. package/dist/components/Accordion/types.js +0 -2
  89. package/dist/components/AppBar/AppBar.d.ts +0 -9
  90. package/dist/components/AppBar/AppBar.js +0 -52
  91. package/dist/components/AppBar/types.d.ts +0 -63
  92. package/dist/components/AppBar/types.js +0 -1
  93. package/dist/components/Avatar/Avatar.d.ts +0 -3
  94. package/dist/components/Avatar/Avatar.js +0 -28
  95. package/dist/components/Avatar/types.d.ts +0 -36
  96. package/dist/components/Avatar/types.js +0 -1
  97. package/dist/components/FileUpload/FileUpload.d.ts +0 -3
  98. package/dist/components/FileUpload/FileUpload.js +0 -41
  99. package/dist/components/FileUpload/types.d.ts +0 -73
  100. package/dist/components/FileUpload/types.js +0 -1
  101. package/dist/components/Navigation/Navigation.d.ts +0 -10
  102. package/dist/components/Navigation/Navigation.js +0 -92
  103. package/dist/components/Navigation/context.d.ts +0 -2
  104. package/dist/components/Navigation/context.js +0 -7
  105. package/dist/components/Navigation/types.d.ts +0 -132
  106. package/dist/components/Navigation/types.js +0 -2
  107. package/dist/components/Pagination/Pagination.d.ts +0 -3
  108. package/dist/components/Pagination/Pagination.js +0 -39
  109. package/dist/components/Pagination/types.d.ts +0 -56
  110. package/dist/components/Pagination/types.js +0 -1
  111. package/dist/components/Progress/Progress.d.ts +0 -3
  112. package/dist/components/Progress/Progress.js +0 -28
  113. package/dist/components/Progress/types.d.ts +0 -44
  114. package/dist/components/Progress/types.js +0 -1
  115. package/dist/components/ProgressRing/ProgressRing.d.ts +0 -3
  116. package/dist/components/ProgressRing/ProgressRing.js +0 -34
  117. package/dist/components/ProgressRing/types.d.ts +0 -53
  118. package/dist/components/ProgressRing/types.js +0 -1
  119. package/dist/components/Rating/Rating.d.ts +0 -3
  120. package/dist/components/Rating/Rating.js +0 -50
  121. package/dist/components/Rating/types.d.ts +0 -36
  122. package/dist/components/Rating/types.js +0 -1
  123. package/dist/components/Segment/Segment.d.ts +0 -5
  124. package/dist/components/Segment/Segment.js +0 -58
  125. package/dist/components/Segment/context.d.ts +0 -2
  126. package/dist/components/Segment/context.js +0 -5
  127. package/dist/components/Segment/types.d.ts +0 -59
  128. package/dist/components/Segment/types.js +0 -2
  129. package/dist/components/Slider/Slider.d.ts +0 -3
  130. package/dist/components/Slider/Slider.js +0 -39
  131. package/dist/components/Slider/types.d.ts +0 -66
  132. package/dist/components/Slider/types.js +0 -1
  133. package/dist/components/Switch/Switch.d.ts +0 -3
  134. package/dist/components/Switch/Switch.js +0 -40
  135. package/dist/components/Switch/types.d.ts +0 -62
  136. package/dist/components/Switch/types.js +0 -1
  137. package/dist/components/Tabs/Tabs.d.ts +0 -12
  138. package/dist/components/Tabs/Tabs.js +0 -80
  139. package/dist/components/Tabs/context.d.ts +0 -2
  140. package/dist/components/Tabs/context.js +0 -5
  141. package/dist/components/Tabs/types.d.ts +0 -64
  142. package/dist/components/Tabs/types.js +0 -1
  143. package/dist/components/TagsInput/TagsInput.d.ts +0 -3
  144. package/dist/components/TagsInput/TagsInput.js +0 -39
  145. package/dist/components/TagsInput/types.d.ts +0 -40
  146. package/dist/components/TagsInput/types.js +0 -1
  147. package/dist/components/Toast/Toast.d.ts +0 -2
  148. package/dist/components/Toast/Toast.js +0 -49
  149. package/dist/components/Toast/Toaster.d.ts +0 -2
  150. package/dist/components/Toast/Toaster.js +0 -28
  151. package/dist/components/Toast/create-toaster.d.ts +0 -2
  152. package/dist/components/Toast/create-toaster.js +0 -4
  153. package/dist/components/Toast/types.d.ts +0 -46
  154. package/dist/components/Toast/types.js +0 -1
  155. package/dist/composed/accordion/anatomy/accordion-content.d.ts +0 -2
  156. package/dist/composed/accordion/anatomy/accordion-content.js +0 -15
  157. package/dist/composed/accordion/anatomy/accordion-heading.d.ts +0 -2
  158. package/dist/composed/accordion/anatomy/accordion-heading.js +0 -11
  159. package/dist/composed/accordion/anatomy/accordion-indicator.d.ts +0 -2
  160. package/dist/composed/accordion/anatomy/accordion-indicator.js +0 -14
  161. package/dist/composed/accordion/anatomy/accordion-item.d.ts +0 -2
  162. package/dist/composed/accordion/anatomy/accordion-item.js +0 -16
  163. package/dist/composed/accordion/anatomy/accordion-root.d.ts +0 -2
  164. package/dist/composed/accordion/anatomy/accordion-root.js +0 -20
  165. package/dist/composed/accordion/anatomy/accordion-trigger.d.ts +0 -2
  166. package/dist/composed/accordion/anatomy/accordion-trigger.js +0 -15
  167. package/dist/composed/accordion/index.d.ts +0 -2
  168. package/dist/composed/accordion/index.js +0 -2
  169. package/dist/composed/accordion/modules/anatomy.d.ts +0 -14
  170. package/dist/composed/accordion/modules/anatomy.js +0 -14
  171. package/dist/composed/accordion/modules/context.d.ts +0 -4
  172. package/dist/composed/accordion/modules/context.js +0 -5
  173. package/dist/composed/accordion/modules/types.d.ts +0 -28
  174. package/dist/composed/accordion/modules/types.js +0 -1
  175. package/dist/composed/avatar/anatomy/avatar-fallback.d.ts +0 -2
  176. package/dist/composed/avatar/anatomy/avatar-fallback.js +0 -14
  177. package/dist/composed/avatar/anatomy/avatar-image.d.ts +0 -2
  178. package/dist/composed/avatar/anatomy/avatar-image.js +0 -14
  179. package/dist/composed/avatar/anatomy/avatar-root.d.ts +0 -2
  180. package/dist/composed/avatar/anatomy/avatar-root.js +0 -20
  181. package/dist/composed/avatar/index.d.ts +0 -2
  182. package/dist/composed/avatar/index.js +0 -2
  183. package/dist/composed/avatar/modules/anatomy.d.ts +0 -8
  184. package/dist/composed/avatar/modules/anatomy.js +0 -8
  185. package/dist/composed/avatar/modules/context.d.ts +0 -3
  186. package/dist/composed/avatar/modules/context.js +0 -3
  187. package/dist/composed/avatar/modules/types.d.ts +0 -13
  188. package/dist/composed/avatar/modules/types.js +0 -1
  189. package/dist/composed/index.d.ts +0 -2
  190. package/dist/composed/index.js +0 -2
  191. package/dist/internal/props-with-child.d.ts +0 -7
  192. package/dist/internal/props-with-child.js +0 -1
@@ -1,39 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useId } from 'react';
4
- import * as tagsInput from '@zag-js/tags-input';
5
- import { useMachine, normalizeProps } from '@zag-js/react';
6
- export const TagsInput = ({ placeholder = '',
7
- // Root
8
- base = 'grid input !h-auto', gap = 'gap-2', padding = 'p-3', classes = '',
9
- // Input: Add
10
- inputBase = 'input-ghost', inputClasses = '',
11
- // Tag List
12
- tagListBase = 'flex flex-wrap gap-1', tagListClasses = '',
13
- // Tag
14
- tagBase = 'chip', tagBackground = 'preset-filled', tagClasses = '',
15
- // Input: Edit
16
- tagEditInputBase = 'input', tagEditInputClasses = '',
17
- // Delete Button
18
- buttonDeleteBase = '', buttonDeleteClasses = '',
19
- // Snippets
20
- buttonDelete,
21
- // State
22
- stateDisabled = '',
23
- // Zag
24
- ...zagProps }) => {
25
- // Zag
26
- const service = useMachine(tagsInput.machine, {
27
- id: useId(),
28
- ...zagProps
29
- });
30
- const api = tagsInput.connect(service, normalizeProps);
31
- // Reactive
32
- const rxDisabled = service.prop('disabled') ? stateDisabled : '';
33
- return (_jsxs("div", { ...api.getRootProps(), className: `${base} ${padding} ${gap} ${rxDisabled} ${classes}`, "data-testid": "tags", children: [_jsx("input", { ...api.getInputProps(), placeholder: placeholder, className: `${inputBase} ${inputClasses}`, "data-testid": "tags-input-add" }), _jsx("input", { ...api.getHiddenInputProps(), "data-testid": "tags-input" }), api.value.length > 0 && (_jsx("div", { className: `${tagListBase} ${tagListClasses}`, "data-testid": "tags-list", children: api.value.map((value, index) => {
34
- const itemState = api.getItemState({ index, value });
35
- return (
36
- // Tag
37
- _jsxs("div", { className: "contents", ...api.getItemProps({ value, index }), "data-testid": "tags-tag", children: [_jsxs("div", { ...api.getItemPreviewProps({ index, value }), className: `${tagBase} ${tagBackground} ${tagClasses}`, style: { display: itemState.editing ? 'none' : '' }, "data-testid": "tag-display", children: [_jsx("span", { children: value }), _jsx("button", { ...api.getItemDeleteTriggerProps({ index, value }), className: `${buttonDeleteBase} ${buttonDeleteClasses}`, "data-testid": "tag-delete", children: buttonDelete ?? _jsx("strong", { children: "\u00D7" }) })] }), _jsx("input", { ...api.getItemInputProps({ index, value }), className: `${tagEditInputBase} ${tagEditInputClasses}`, style: { display: itemState.editing ? '' : 'none' }, "data-testid": "tags-input-edit" })] }, value));
38
- }) }))] }));
39
- };
@@ -1,40 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import * as tagsInput from '@zag-js/tags-input';
3
- export interface TagsInputProps extends Omit<tagsInput.Props, 'id'> {
4
- /** Set the add tag input placeholder. */
5
- placeholder?: string;
6
- /** Set base classes for the root. */
7
- base?: string;
8
- /** Set gap classes for the root. */
9
- gap?: string;
10
- /** Set padding classes for the root. */
11
- padding?: string;
12
- /** Provide arbitrary classes to the root. */
13
- classes?: string;
14
- /** Set base classes for the add tag input. */
15
- inputBase?: string;
16
- /** Provide arbitrary classes to the add tag input. */
17
- inputClasses?: string;
18
- /** Set base classes for the tag list. */
19
- tagListBase?: string;
20
- /** Provide arbitrary classes to the tag list. */
21
- tagListClasses?: string;
22
- /** Set base classes for each tag. */
23
- tagBase?: string;
24
- /** Set background classes for each tag. */
25
- tagBackground?: string;
26
- /** Provide arbitrary classes to each tag. */
27
- tagClasses?: string;
28
- /** Set base classes for the edit tag input. */
29
- tagEditInputBase?: string;
30
- /** Provide arbitrary classes to the edit tag input. */
31
- tagEditInputClasses?: string;
32
- /** Set base classes for the delete button. */
33
- buttonDeleteBase?: string;
34
- /** Provide arbitrary classes to the delete button. */
35
- buttonDeleteClasses?: string;
36
- /** The delete button label snippet. */
37
- buttonDelete?: ReactNode;
38
- /** Set the component disabled state. */
39
- stateDisabled?: string;
40
- }
@@ -1 +0,0 @@
1
- import * as tagsInput from '@zag-js/tags-input';
@@ -1,2 +0,0 @@
1
- import type { ToastProps } from './types.js';
2
- export declare function Toast(props: ToastProps): import("react/jsx-runtime").JSX.Element;
@@ -1,49 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import * as toast from '@zag-js/toast';
4
- import { normalizeProps, useMachine } from '@zag-js/react';
5
- export function Toast(props) {
6
- const service = useMachine(toast.machine, {
7
- ...props.toast,
8
- parent: props.parent
9
- });
10
- const api = toast.connect(service, normalizeProps);
11
- function getStateClasses() {
12
- switch (api.type) {
13
- case 'success':
14
- return props.stateSuccess;
15
- case 'warning':
16
- return props.stateWarning;
17
- case 'error':
18
- return props.stateError;
19
- default:
20
- return props.stateInfo;
21
- }
22
- }
23
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${props.base} ${props.width} ${props.padding} ${props.rounded} ${getStateClasses()} ${props.classes}`, ...api.getRootProps(), "data-testid": "toast-root", children: [_jsxs("div", { className: `${props.messageBase} ${props.messageClasses}`, "data-testid": "toast-message", children: [_jsx("span", { className: `${props.titleBase} ${props.titleClasses}`, ...api.getTitleProps(), "data-testid": "toast-title", children: api.title }), _jsx("span", { className: `${props.descriptionBase} ${props.descriptionClasses}`, ...api.getDescriptionProps(), "data-testid": "toast-description", children: api.description })] }), api.closable && (
24
- // Dismiss Button
25
- _jsx("button", { className: `${props.btnDismissBase} ${props.btnDismissClasses}`, title: props.btnDismissTitle, "aria-label": props.btnDismissAriaLabel, onClick: api.dismiss, "data-testid": "toast-dismiss", children: "\u00D7" }))] }), _jsx("style", { children: `
26
- [data-part='root'] {
27
- translate: var(--x) var(--y);
28
- scale: var(--scale);
29
- z-index: var(--z-index);
30
- height: var(--height);
31
- opacity: var(--opacity);
32
- will-change: translate, opacity, scale;
33
- }
34
- [data-part='root'] {
35
- transition:
36
- translate 400ms,
37
- scale 400ms,
38
- opacity 400ms;
39
- transition-timing-function: cubic-bezier(0.21, 1.02, 0.73, 1);
40
- }
41
- [data-part='root'][data-state='closed'] {
42
- transition:
43
- translate 400ms,
44
- scale 400ms,
45
- opacity 200ms;
46
- transition-timing-function: cubic-bezier(0.06, 0.71, 0.55, 1);
47
- }
48
- ` })] }));
49
- }
@@ -1,2 +0,0 @@
1
- import type { ToasterProps } from './types.js';
2
- export declare function Toaster({ toaster, base, width, padding, rounded, classes, messageBase, messageClasses, titleBase, titleClasses, descriptionBase, descriptionClasses, btnDismissBase, btnDismissClasses, btnDismissTitle, btnDismissAriaLabel, stateInfo, stateSuccess, stateWarning, stateError }: ToasterProps): import("react/jsx-runtime").JSX.Element;
@@ -1,28 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as toast from '@zag-js/toast';
4
- import { Toast } from './Toast.js';
5
- import { useId } from 'react';
6
- import { normalizeProps, useMachine } from '@zag-js/react';
7
- export function Toaster({
8
- // Toaster
9
- toaster,
10
- // Toast
11
- base = 'flex justify-between items-center gap-3', width = 'min-w-xs', padding = 'p-3', rounded = 'rounded-container', classes = '',
12
- // Message
13
- messageBase = 'grid', messageClasses = '',
14
- // Title
15
- titleBase = 'font-semibold', titleClasses = '',
16
- // Description
17
- descriptionBase = 'text-sm', descriptionClasses = '',
18
- // Dismiss Button
19
- btnDismissBase = 'btn-icon hover:preset-tonal', btnDismissClasses = '', btnDismissTitle = 'Dismiss', btnDismissAriaLabel = 'Dismiss',
20
- // State
21
- stateInfo = 'preset-outlined-surface-200-800 preset-filled-surface-50-950', stateSuccess = 'preset-filled-success-500', stateWarning = 'preset-filled-warning-500', stateError = 'preset-filled-error-500' }) {
22
- const service = useMachine(toast.group.machine, {
23
- id: useId(),
24
- store: toaster
25
- });
26
- const api = toast.group.connect(service, normalizeProps);
27
- return (_jsx("div", { ...api.getGroupProps(), "data-testid": "toaster-root", children: api.getToasts().map((toast) => (_jsx(Toast, { base: base, width: width, padding: padding, rounded: rounded, classes: classes, messageBase: messageBase, messageClasses: messageClasses, titleBase: titleBase, titleClasses: titleClasses, descriptionBase: descriptionBase, descriptionClasses: descriptionClasses, btnDismissBase: btnDismissBase, btnDismissClasses: btnDismissClasses, btnDismissTitle: btnDismissTitle, btnDismissAriaLabel: btnDismissAriaLabel, stateInfo: stateInfo, stateError: stateError, stateWarning: stateWarning, stateSuccess: stateSuccess, toast: toast, parent: service }, toast.id))) }));
28
- }
@@ -1,2 +0,0 @@
1
- import * as toast from '@zag-js/toast';
2
- export declare function createToaster(options?: toast.StoreProps): toast.Store<any>;
@@ -1,4 +0,0 @@
1
- import * as toast from '@zag-js/toast';
2
- export function createToaster(options = {}) {
3
- return toast.createStore(options);
4
- }
@@ -1,46 +0,0 @@
1
- import * as toast from '@zag-js/toast';
2
- export interface ToasterProps {
3
- toaster: toast.Store;
4
- /** Provide base classes for the root element. */
5
- base?: string;
6
- /** Provide width classes for the root element. */
7
- width?: string;
8
- /** Provide padding classes for the root element. */
9
- padding?: string;
10
- /** Provide border radius classes for the root element. */
11
- rounded?: string;
12
- /** Provide arbitrary classes for the toast cards. */
13
- classes?: string;
14
- /** Provide base classes for the message. */
15
- messageBase?: string;
16
- /** Provide classes for the message. */
17
- messageClasses?: string;
18
- /** Provide base classes for the title. */
19
- titleBase?: string;
20
- /** Provide classes for the title. */
21
- titleClasses?: string;
22
- /** Provide base classes for the description. */
23
- descriptionBase?: string;
24
- /** Provide classes for the description. */
25
- descriptionClasses?: string;
26
- /** Provide base classes for the dismiss button. */
27
- btnDismissBase?: string;
28
- /** Provide arbitrary classes for the dismiss button. */
29
- btnDismissClasses?: string;
30
- /** Provide the title attribute for the dismiss button. */
31
- btnDismissTitle?: string;
32
- /** Provide the aria-label attribute for the dismiss button. */
33
- btnDismissAriaLabel?: string;
34
- /** Provide base classes for info toasts. */
35
- stateInfo?: string;
36
- /** Provide base classes for success toasts. */
37
- stateSuccess?: string;
38
- /** Provide base classes for warning toasts. */
39
- stateWarning?: string;
40
- /** Provide base classes for error toasts. */
41
- stateError?: string;
42
- }
43
- export interface ToastProps extends Omit<ToasterProps, 'toaster'> {
44
- toast: toast.Options;
45
- parent: toast.GroupService;
46
- }
@@ -1 +0,0 @@
1
- import * as toast from '@zag-js/toast';
@@ -1,2 +0,0 @@
1
- import type { AccordionContentProps } from '../modules/types.js';
2
- export default function (props: AccordionContentProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,15 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useContext } from 'react';
4
- import { mergeProps } from '@zag-js/react';
5
- import { classesAccordion } from '@skeletonlabs/skeleton-common';
6
- import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
7
- export default function (props) {
8
- const rootContext = useContext(AccordionRootContext);
9
- const itemContext = useContext(AccordionItemContext);
10
- const { element, children, ...restAttributes } = props;
11
- const attributes = mergeProps(rootContext.api.getItemContentProps(itemContext.itemProps), {
12
- className: classesAccordion.content
13
- }, restAttributes);
14
- return element ? element({ attributes }) : _jsx("div", { ...attributes, children: children });
15
- }
@@ -1,2 +0,0 @@
1
- import type { AccordionHeadingProps } from '../modules/types.js';
2
- export default function (props: AccordionHeadingProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { mergeProps } from '@zag-js/react';
3
- import { classesAccordion } from '@skeletonlabs/skeleton-common';
4
- export default function (props) {
5
- const { level = 3, element, children, ...restAttributes } = props;
6
- const Tag = `h${level}`;
7
- const attributes = mergeProps({
8
- className: classesAccordion.heading
9
- }, restAttributes);
10
- return element ? element({ attributes }) : _jsx(Tag, { ...attributes, children: children });
11
- }
@@ -1,2 +0,0 @@
1
- import type { AccordionIndicatorProps } from '../modules/types.js';
2
- export default function (props: AccordionIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { mergeProps } from '@zag-js/react';
3
- import { useContext } from 'react';
4
- import { classesAccordion } from '@skeletonlabs/skeleton-common';
5
- import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
6
- export default function (props) {
7
- const rootContext = useContext(AccordionRootContext);
8
- const itemContext = useContext(AccordionItemContext);
9
- const { element, children, ...restAttributes } = props;
10
- const attributes = mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), {
11
- class: classesAccordion.indicator
12
- }, restAttributes);
13
- return element ? element({ attributes }) : _jsx("div", { ...attributes, children: children });
14
- }
@@ -1,2 +0,0 @@
1
- import type { AccordionItemProps } from '../modules/types.js';
2
- export default function (props: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useContext } from 'react';
4
- import * as accordion from '@zag-js/accordion';
5
- import { mergeProps } from '@zag-js/react';
6
- import { classesAccordion } from '@skeletonlabs/skeleton-common';
7
- import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
8
- export default function (props) {
9
- const rootContext = useContext(AccordionRootContext);
10
- const [itemProps, componentProps] = accordion.splitItemProps(props);
11
- const { element, children, ...restAttributes } = componentProps;
12
- const attributes = mergeProps(rootContext.api.getItemProps(itemProps), {
13
- class: classesAccordion.item
14
- }, restAttributes);
15
- return (_jsx(AccordionItemContext.Provider, { value: { itemProps }, children: element ? element({ attributes }) : _jsx("div", { ...attributes, children: children }) }));
16
- }
@@ -1,2 +0,0 @@
1
- import type { AccordionRootProps } from '../modules/types.js';
2
- export default function (props: AccordionRootProps): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useId } from 'react';
4
- import * as accordion from '@zag-js/accordion';
5
- import { useMachine, normalizeProps, mergeProps } from '@zag-js/react';
6
- import { AccordionRootContext } from '../modules/context.js';
7
- import { classesAccordion } from '@skeletonlabs/skeleton-common';
8
- export default function (props) {
9
- const [machineProps, componentProps] = accordion.splitProps(props);
10
- const { element, children, ...restAttributes } = componentProps;
11
- const service = useMachine(accordion.machine, {
12
- id: useId(),
13
- ...machineProps
14
- });
15
- const api = accordion.connect(service, normalizeProps);
16
- const attributes = mergeProps(api.getRootProps(), {
17
- className: classesAccordion.root
18
- }, restAttributes);
19
- return (_jsx(AccordionRootContext.Provider, { value: { api }, children: element ? element({ attributes }) : _jsx("div", { ...attributes, children: children }) }));
20
- }
@@ -1,2 +0,0 @@
1
- import type { AccordionTriggerProps } from '../modules/types.js';
2
- export default function (props: AccordionTriggerProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,15 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useContext } from 'react';
4
- import { mergeProps } from '@zag-js/react';
5
- import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
6
- import { classesAccordion } from '@skeletonlabs/skeleton-common';
7
- export default function (props) {
8
- const rootContext = useContext(AccordionRootContext);
9
- const itemContext = useContext(AccordionItemContext);
10
- const { element, children, ...restAttributes } = props;
11
- const attributes = mergeProps(rootContext.api.getItemTriggerProps(itemContext.itemProps), {
12
- className: classesAccordion.trigger
13
- }, restAttributes);
14
- return element ? element({ attributes }) : _jsx("button", { ...attributes, children: children });
15
- }
@@ -1,2 +0,0 @@
1
- export * from './modules/types.js';
2
- export * from './modules/anatomy.js';
@@ -1,2 +0,0 @@
1
- export * from './modules/types.js';
2
- export * from './modules/anatomy.js';
@@ -1,14 +0,0 @@
1
- import AccordionRoot from '../anatomy/accordion-root.js';
2
- import AccordionItem from '../anatomy/accordion-item.js';
3
- import AccordionHeading from '../anatomy/accordion-heading.js';
4
- import AccordionTrigger from '../anatomy/accordion-trigger.js';
5
- import AccordionIndicator from '../anatomy/accordion-indicator.js';
6
- import AccordionContent from '../anatomy/accordion-content.js';
7
- declare const Accordion: typeof AccordionRoot & {
8
- Item: typeof AccordionItem;
9
- Heading: typeof AccordionHeading;
10
- Trigger: typeof AccordionTrigger;
11
- Indicator: typeof AccordionIndicator;
12
- Content: typeof AccordionContent;
13
- };
14
- export { Accordion };
@@ -1,14 +0,0 @@
1
- import AccordionRoot from '../anatomy/accordion-root.js';
2
- import AccordionItem from '../anatomy/accordion-item.js';
3
- import AccordionHeading from '../anatomy/accordion-heading.js';
4
- import AccordionTrigger from '../anatomy/accordion-trigger.js';
5
- import AccordionIndicator from '../anatomy/accordion-indicator.js';
6
- import AccordionContent from '../anatomy/accordion-content.js';
7
- const Accordion = Object.assign(AccordionRoot, {
8
- Item: AccordionItem,
9
- Heading: AccordionHeading,
10
- Trigger: AccordionTrigger,
11
- Indicator: AccordionIndicator,
12
- Content: AccordionContent
13
- });
14
- export { Accordion };
@@ -1,4 +0,0 @@
1
- import type { AccordionContext as AccordionRootContextType, AccordionItemContext as AccordionItemContextType } from './types.js';
2
- declare const AccordionRootContext: import("react").Context<AccordionRootContextType>;
3
- declare const AccordionItemContext: import("react").Context<AccordionItemContextType>;
4
- export { AccordionRootContext, AccordionItemContext };
@@ -1,5 +0,0 @@
1
- 'use client';
2
- import { createContext } from 'react';
3
- const AccordionRootContext = createContext(null);
4
- const AccordionItemContext = createContext(null);
5
- export { AccordionRootContext, AccordionItemContext };
@@ -1,28 +0,0 @@
1
- import * as accordion from '@zag-js/accordion';
2
- import type { PropsWithChildren, ComponentProps } from 'react';
3
- import type { PropsWithElement } from '../../../internal/props-with-child.js';
4
- interface AccordionRootProps extends PropsWithChildren, PropsWithElement, Omit<accordion.Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'defaultValue' | 'dir'> {
5
- }
6
- interface AccordionItemProps extends PropsWithChildren, PropsWithElement, accordion.ItemProps, ComponentProps<'div'> {
7
- }
8
- interface AccordionTriggerProps extends PropsWithChildren, PropsWithElement, ComponentProps<'button'> {
9
- }
10
- interface AccordionHeadingProps extends PropsWithChildren, PropsWithElement, ComponentProps<'h3'> {
11
- /**
12
- * The level of the heading. This is used to determine the heading level for accessibility purposes.
13
- *
14
- * @defaultValue 3
15
- */
16
- level?: 1 | 2 | 3 | 4 | 5 | 6;
17
- }
18
- interface AccordionIndicatorProps extends PropsWithChildren, PropsWithElement, ComponentProps<'div'> {
19
- }
20
- interface AccordionContentProps extends PropsWithChildren, PropsWithElement, ComponentProps<'div'> {
21
- }
22
- interface AccordionContext {
23
- api: accordion.Api;
24
- }
25
- interface AccordionItemContext {
26
- itemProps: accordion.ItemProps;
27
- }
28
- export type { AccordionRootProps, AccordionItemProps, AccordionTriggerProps, AccordionHeadingProps, AccordionIndicatorProps, AccordionContentProps, AccordionContext, AccordionItemContext };
@@ -1 +0,0 @@
1
- import * as accordion from '@zag-js/accordion';
@@ -1,2 +0,0 @@
1
- import type { AvatarFallbackProps } from '../modules/types.js';
2
- export default function (props: AvatarFallbackProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,14 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useContext } from 'react';
4
- import { mergeProps } from '@zag-js/react';
5
- import { AvatarRootContext } from '../modules/context.js';
6
- import { classesAvatar } from '@skeletonlabs/skeleton-common';
7
- export default function (props) {
8
- const rootContext = useContext(AvatarRootContext);
9
- const { element, children, ...restAttributes } = props;
10
- const attributes = mergeProps(rootContext.api.getFallbackProps(), {
11
- className: classesAvatar.fallback
12
- }, restAttributes);
13
- return element ? element({ attributes }) : _jsx("span", { ...attributes, children: children });
14
- }
@@ -1,2 +0,0 @@
1
- import type { AvatarImageProps } from '../modules/types.js';
2
- export default function (props: AvatarImageProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,14 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useContext } from 'react';
4
- import { mergeProps } from '@zag-js/react';
5
- import { AvatarRootContext } from '../modules/context.js';
6
- import { classesAvatar } from '@skeletonlabs/skeleton-common';
7
- export default function (props) {
8
- const rootContext = useContext(AvatarRootContext);
9
- const { element, ...restAttributes } = props;
10
- const attributes = mergeProps(rootContext.api.getImageProps(), {
11
- className: classesAvatar.image
12
- }, restAttributes);
13
- return element ? element({ attributes }) : _jsx("img", { ...attributes });
14
- }
@@ -1,2 +0,0 @@
1
- import type { AvatarRootProps } from '../modules/types.js';
2
- export default function (props: AvatarRootProps): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useId } from 'react';
4
- import { useMachine, normalizeProps, mergeProps } from '@zag-js/react';
5
- import * as avatar from '@zag-js/avatar';
6
- import { AvatarRootContext } from '../modules/context.js';
7
- import { classesAvatar } from '@skeletonlabs/skeleton-common';
8
- export default function (props) {
9
- const [machineProps, componentProps] = avatar.splitProps(props);
10
- const { element, children, ...restAttributes } = componentProps;
11
- const service = useMachine(avatar.machine, {
12
- id: useId(),
13
- ...machineProps
14
- });
15
- const api = avatar.connect(service, normalizeProps);
16
- const attributes = mergeProps(api.getRootProps(), {
17
- className: classesAvatar.root
18
- }, restAttributes);
19
- return (_jsx(AvatarRootContext.Provider, { value: { api }, children: element ? element({ attributes }) : _jsx("div", { ...attributes, children: children }) }));
20
- }
@@ -1,2 +0,0 @@
1
- export * from './modules/types.js';
2
- export * from './modules/anatomy.js';
@@ -1,2 +0,0 @@
1
- export * from './modules/types.js';
2
- export * from './modules/anatomy.js';
@@ -1,8 +0,0 @@
1
- import AvatarRoot from '../anatomy/avatar-root.js';
2
- import AvatarImage from '../anatomy/avatar-image.js';
3
- import AvatarFallback from '../anatomy/avatar-fallback.js';
4
- declare const Avatar: typeof AvatarRoot & {
5
- Image: typeof AvatarImage;
6
- Fallback: typeof AvatarFallback;
7
- };
8
- export { Avatar };
@@ -1,8 +0,0 @@
1
- import AvatarRoot from '../anatomy/avatar-root.js';
2
- import AvatarImage from '../anatomy/avatar-image.js';
3
- import AvatarFallback from '../anatomy/avatar-fallback.js';
4
- const Avatar = Object.assign(AvatarRoot, {
5
- Image: AvatarImage,
6
- Fallback: AvatarFallback
7
- });
8
- export { Avatar };
@@ -1,3 +0,0 @@
1
- import type { AvatarRootContext as AvatarRootContextType } from './types.js';
2
- declare const AvatarRootContext: import("react").Context<AvatarRootContextType>;
3
- export { AvatarRootContext };
@@ -1,3 +0,0 @@
1
- import { createContext } from 'react';
2
- const AvatarRootContext = createContext(null);
3
- export { AvatarRootContext };
@@ -1,13 +0,0 @@
1
- import * as avatar from '@zag-js/avatar';
2
- import type { ComponentProps, PropsWithChildren } from 'react';
3
- import type { PropsWithElement } from '../../../internal/props-with-child.js';
4
- interface AvatarRootProps extends PropsWithChildren, PropsWithElement, Omit<avatar.Props, 'id'>, Omit<ComponentProps<'div'>, 'id' | 'dir'> {
5
- }
6
- interface AvatarImageProps extends PropsWithElement, ComponentProps<'img'> {
7
- }
8
- interface AvatarFallbackProps extends PropsWithChildren, PropsWithElement, ComponentProps<'span'> {
9
- }
10
- interface AvatarRootContext {
11
- api: avatar.Api;
12
- }
13
- export type { AvatarRootProps, AvatarImageProps, AvatarFallbackProps, AvatarRootContext };
@@ -1 +0,0 @@
1
- import * as avatar from '@zag-js/avatar';
@@ -1,2 +0,0 @@
1
- export * from './accordion/index.js';
2
- export * from './avatar/index.js';
@@ -1,2 +0,0 @@
1
- export * from './accordion/index.js';
2
- export * from './avatar/index.js';
@@ -1,7 +0,0 @@
1
- import type { JSX } from 'react';
2
- interface PropsWithElement {
3
- element?: (...args: [{
4
- attributes: Record<string, unknown>;
5
- }]) => JSX.Element | null;
6
- }
7
- export type { PropsWithElement };
@@ -1 +0,0 @@
1
- export {};