musae 0.2.3 → 0.2.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 (104) hide show
  1. package/README.md +1 -1
  2. package/dist/components/avatar/avatar.js +1 -1
  3. package/dist/components/avatar/context.d.ts +0 -1
  4. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  5. package/dist/components/breadcrumb/item.js +1 -1
  6. package/dist/components/button/button.js +1 -1
  7. package/dist/components/button-toggle/context.d.ts +0 -1
  8. package/dist/components/calendar/calendar.js +1 -1
  9. package/dist/components/calendar/hooks.js +1 -1
  10. package/dist/components/cascader/hooks.d.ts +1 -8
  11. package/dist/components/cascader/utils.d.ts +0 -1
  12. package/dist/components/checkbox/checkbox.js +1 -1
  13. package/dist/components/checkbox/context.d.ts +0 -1
  14. package/dist/components/checkbox/index.d.ts +0 -1
  15. package/dist/components/clock/column.js +1 -1
  16. package/dist/components/collapse/collapse.js +1 -1
  17. package/dist/components/collapse/context.d.ts +0 -1
  18. package/dist/components/collapse/item.js +1 -1
  19. package/dist/components/config/context.d.ts +0 -1
  20. package/dist/components/date-picker/date-picker.js +1 -1
  21. package/dist/components/date-picker/hooks.d.ts +1 -5
  22. package/dist/components/date-range-picker/hooks.d.ts +1 -5
  23. package/dist/components/dialog/hooks.d.ts +1 -5
  24. package/dist/components/dialog/popup.js +2 -2
  25. package/dist/components/divider/divider.js +1 -1
  26. package/dist/components/drawer/popup.js +2 -2
  27. package/dist/components/empty/empty.js +1 -1
  28. package/dist/components/form/context.d.ts +0 -1
  29. package/dist/components/form/field/field.d.ts +1 -1
  30. package/dist/components/form/field/field.js +8 -7
  31. package/dist/components/form/field/layout.js +1 -1
  32. package/dist/components/grid/col.js +1 -1
  33. package/dist/components/grid/index.d.ts +0 -1
  34. package/dist/components/grid/row.js +1 -1
  35. package/dist/components/icon/icon.js +1 -1
  36. package/dist/components/image/index.d.ts +0 -1
  37. package/dist/components/image/preview/context.d.ts +0 -1
  38. package/dist/components/image/preview/operations.js +1 -1
  39. package/dist/components/image/preview/preview.js +1 -1
  40. package/dist/components/input/input.d.ts +20 -20
  41. package/dist/components/input/input.js +3 -11
  42. package/dist/components/layout/header.js +1 -1
  43. package/dist/components/layout/layout.js +1 -1
  44. package/dist/components/layout/main.d.ts +0 -1
  45. package/dist/components/loading/loading.js +1 -1
  46. package/dist/components/menu/context.d.ts +0 -1
  47. package/dist/components/menu/group.d.ts +2 -2
  48. package/dist/components/menu/group.js +1 -1
  49. package/dist/components/menu/hooks.js +1 -1
  50. package/dist/components/menu/item.d.ts +1 -1
  51. package/dist/components/menu/item.js +1 -1
  52. package/dist/components/notification/holder.js +1 -1
  53. package/dist/components/notification/notification.js +1 -1
  54. package/dist/components/pagination/hooks.d.ts +2 -3
  55. package/dist/components/picker/context.d.ts +0 -1
  56. package/dist/components/picker/picker.js +1 -1
  57. package/dist/components/popover/popover.js +1 -1
  58. package/dist/components/popper/dropdown.js +1 -1
  59. package/dist/components/popper/hooks.d.ts +3 -3
  60. package/dist/components/progress/circular.js +1 -1
  61. package/dist/components/progress/hooks.d.ts +0 -1
  62. package/dist/components/progress/linear.js +1 -1
  63. package/dist/components/radio/context.d.ts +0 -1
  64. package/dist/components/radio/radio.js +22 -13
  65. package/dist/components/rate/rate.js +1 -1
  66. package/dist/components/rate/star.js +1 -1
  67. package/dist/components/ripple/ripple.js +1 -1
  68. package/dist/components/select/selector.js +1 -1
  69. package/dist/components/select/utils.d.ts +0 -1
  70. package/dist/components/space/space.js +1 -1
  71. package/dist/components/steps/context.d.ts +0 -1
  72. package/dist/components/steps/item.js +1 -1
  73. package/dist/components/steps/steps.js +1 -1
  74. package/dist/components/switch/switch.js +1 -1
  75. package/dist/components/table/body.js +1 -1
  76. package/dist/components/table/context.d.ts +0 -1
  77. package/dist/components/table/header/cell.js +1 -1
  78. package/dist/components/table/header/header.js +1 -1
  79. package/dist/components/tabs/context.d.ts +0 -1
  80. package/dist/components/tabs/item.js +3 -1
  81. package/dist/components/tabs/tabs.js +1 -1
  82. package/dist/components/tag/tag.js +1 -1
  83. package/dist/components/theme/hooks.d.ts +1 -2
  84. package/dist/components/time-picker/panel.js +1 -1
  85. package/dist/components/time-picker/time-picker.js +1 -1
  86. package/dist/components/timeline/context.d.ts +0 -1
  87. package/dist/components/timeline/item.js +1 -1
  88. package/dist/components/tour/tour.js +1 -1
  89. package/dist/components/tree/context.d.ts +0 -1
  90. package/dist/components/tree/hooks.d.ts +0 -1
  91. package/dist/components/tree/list.js +1 -1
  92. package/dist/components/tree/node.js +1 -1
  93. package/dist/components/upload/types.d.ts +8 -6
  94. package/dist/components/upload/upload.d.ts +1 -1
  95. package/dist/components/upload/upload.js +11 -4
  96. package/dist/components/upload/uploadeds.js +8 -3
  97. package/dist/components/waterfall/hooks.d.ts +0 -1
  98. package/dist/components/waterfall/sequential.js +1 -1
  99. package/dist/components/waterfall/waterfall.js +1 -1
  100. package/dist/stylex.css +5 -4
  101. package/dist/utils/class-name.d.ts +1 -205
  102. package/package.json +12 -12
  103. /package/dist/node_modules/{@aiszlab → .pnpm/@aiszlab_relax@1.2.55_react-dom@18.3.1_react@18.3.1/node_modules/@aiszlab}/relax/dist/dom/contains.js +0 -0
  104. /package/dist/node_modules/{@stylexjs → .pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs}/stylex/lib/es/stylex.js +0 -0
@@ -2,7 +2,7 @@ import React, { forwardRef, useState, useImperativeHandle } from 'react';
2
2
  import Portal from '../portal/portal.js';
3
3
  import { AnimatePresence } from 'framer-motion';
4
4
  import Notification from './notification.js';
5
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import { useEvent } from '@aiszlab/relax';
7
7
 
8
8
  const styles = {
@@ -1,4 +1,4 @@
1
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
1
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
2
  import React, { useEffect, createElement } from 'react';
3
3
  import { usePresence, useAnimate } from 'framer-motion';
4
4
  import { useTheme } from '../theme/hooks.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaginationItems } from "./types";
3
2
  /**
4
3
  * @author murukal
@@ -13,8 +12,8 @@ export declare const usePagiantion: ({ total, siblings, boundaries, ...props }:
13
12
  pageSize: number;
14
13
  }) => {
15
14
  paginationItems: PaginationItems;
16
- add: (step?: number | undefined) => void;
17
- subtract: (step?: number | undefined) => void;
15
+ add: (step?: number) => void;
16
+ subtract: (step?: number) => void;
18
17
  changePage: import("react").Dispatch<import("react").SetStateAction<number>>;
19
18
  page: number;
20
19
  hasPrev: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { ContextValue } from "./types";
3
2
  export declare const Context: import("react").Context<ContextValue>;
@@ -4,7 +4,7 @@ import { useBoolean, chain, useFocus } from '@aiszlab/relax';
4
4
  import { useEvents } from './hooks.js';
5
5
  import { ComponentToken, PickerClassToken } from '../../utils/class-name.js';
6
6
  import { useClassNames } from '../../hooks/use-class-names.js';
7
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
8
8
  import { useTheme } from '../theme/hooks.js';
9
9
  import { ColorToken } from '../../utils/colors.js';
10
10
  import clsx from 'clsx';
@@ -1,7 +1,7 @@
1
1
  import { useBoolean, toArray, useRefs, useEvent, useHover, chain, useFocus } from '@aiszlab/relax';
2
2
  import React, { useRef, useMemo, cloneElement } from 'react';
3
3
  import Popper from '../popper/popper.js';
4
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import { typography } from '../theme/theme.js';
6
6
  import { useClassNames } from '../../hooks/use-class-names.js';
7
7
  import { ComponentToken, PopoverClassToken } from '../../utils/class-name.js';
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, useMemo, useEffect } from 'react';
2
2
  import { ComponentToken, PopperClassToken } from '../../utils/class-name.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import clsx from 'clsx';
6
6
  import { isFunction } from '@aiszlab/relax';
7
7
  import { autoUpdate, computePosition, flip, offset, arrow } from '@floating-ui/dom';
@@ -7,7 +7,7 @@ export declare const useOffsets: ({ offset, arrowable }: {
7
7
  offset: PopperProps["offset"];
8
8
  arrowable: boolean;
9
9
  }) => {
10
- mainAxis?: number | undefined;
11
- crossAxis?: number | undefined;
12
- alignmentAxis?: number | null | undefined;
10
+ mainAxis?: number;
11
+ crossAxis?: number;
12
+ alignmentAxis?: number | null;
13
13
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useTheme } from '../theme/hooks.js';
4
4
  import { ColorToken } from '../../utils/colors.js';
5
5
  import { sizes } from '../theme/tokens.stylex.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @description
4
3
  * count circle path
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, ProgressClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ContextValue } from "./types";
3
2
  declare const Context: import("react").Context<ContextValue | null>;
4
3
  export default Context;
@@ -3,7 +3,7 @@ import Context from './context.js';
3
3
  import { useControlledState } from '@aiszlab/relax';
4
4
  import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, RadioClassToken } from '../../utils/class-name.js';
6
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
7
  import { useTheme } from '../theme/hooks.js';
8
8
  import { ColorToken } from '../../utils/colors.js';
9
9
  import { typography } from '../theme/theme.js';
@@ -104,15 +104,24 @@ const styles = {
104
104
  "--joftei": props.borderColor != null ? props.borderColor : "initial"
105
105
  }],
106
106
  disabled: props => [{
107
- borderColor: "musae-eqt46j",
108
- borderInlineColor: null,
109
- borderInlineStartColor: null,
110
- borderLeftColor: null,
111
- borderInlineEndColor: null,
112
- borderRightColor: null,
113
- borderBlockColor: null,
114
- borderTopColor: null,
115
- borderBottomColor: null,
107
+ "::after_borderWidth": "musae-1jxe9zw",
108
+ "::after_borderInlineWidth": null,
109
+ "::after_borderInlineStartWidth": null,
110
+ "::after_borderLeftWidth": null,
111
+ "::after_borderInlineEndWidth": null,
112
+ "::after_borderRightWidth": null,
113
+ "::after_borderBlockWidth": null,
114
+ "::after_borderTopWidth": null,
115
+ "::after_borderBottomWidth": null,
116
+ "::after_borderColor": "musae-3yd8hb",
117
+ "::after_borderInlineColor": null,
118
+ "::after_borderInlineStartColor": null,
119
+ "::after_borderLeftColor": null,
120
+ "::after_borderInlineEndColor": null,
121
+ "::after_borderRightColor": null,
122
+ "::after_borderBlockColor": null,
123
+ "::after_borderTopColor": null,
124
+ "::after_borderBottomColor": null,
116
125
  "::before_content": "musae-1cpjm7i",
117
126
  "::before_position": "musae-1hmns74",
118
127
  "::before_visibility": "musae-11srvyv",
@@ -130,11 +139,11 @@ const styles = {
130
139
  "::before_borderBottomRightRadius": null,
131
140
  $$css: true
132
141
  }, {
133
- "--borderColor": props.backgroundColor != null ? props.backgroundColor : "initial",
142
+ "--joftei": props.backgroundColor != null ? props.backgroundColor : "initial",
134
143
  "--1lrm08k": props.backgroundColor != null ? props.backgroundColor : "initial"
135
144
  }],
136
145
  unckecked: {
137
- "::before": null,
146
+ "::before_display": "musae-15ozc13",
138
147
  $$css: true
139
148
  }
140
149
  },
@@ -197,7 +206,7 @@ const Radio = ({
197
206
  label: props(typography.body.medium, styles.label.default)
198
207
  };
199
208
  return React.createElement("label", {
200
- className: clsx(styled.radio.className, classNames[RadioClassToken.Radio], props$1.className)
209
+ className: clsx(classNames[RadioClassToken.Radio], props$1.className, styled.radio.className)
201
210
  }, React.createElement("input", {
202
211
  type: "radio",
203
212
  "aria-checked": isChecked,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, RateClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
@@ -1,6 +1,6 @@
1
1
  import React, { createElement } from 'react';
2
2
  import { useEvent, useHover } from '@aiszlab/relax';
3
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
  import clsx from 'clsx';
5
5
  import { useClassNames } from '../../hooks/use-class-names.js';
6
6
  import { ComponentToken, RateClassToken } from '../../utils/class-name.js';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AnimatePresence, motion } from 'framer-motion';
3
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
 
5
5
  const styles = {
6
6
  ripple: {
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, useRef, useContext, useImperativeHandle } from 'react';
2
2
  import Tag from '../tag/tag.js';
3
3
  import { styles as styles$1 } from '../input/input.js';
4
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import { Context } from '../picker/context.js';
6
6
  import { useTheme } from '../theme/hooks.js';
7
7
  import { ColorToken } from '../../utils/colors.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Filter, ReadableOptions, ToMenuItem, Value, ValueOrValues } from "./types";
3
2
  import type { Option } from "../../types/option";
4
3
  import type { MenuItem } from "../menu";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useGutters } from '../../hooks/use-gutters.js';
4
4
  import clsx from 'clsx';
5
5
 
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { ContextValue } from "./types";
3
2
  export declare const Context: import("react").Context<ContextValue>;
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, StepsClassToken } from '../../utils/class-name.js';
5
5
  import clsx from 'clsx';
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
2
2
  import Item from './item.js';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, StepsClassToken } from '../../utils/class-name.js';
5
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import clsx from 'clsx';
7
7
  import { Context } from './context.js';
8
8
 
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useControlledState } from '@aiszlab/relax';
3
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
  import { useTheme } from '../theme/hooks.js';
5
5
  import { ColorToken } from '../../utils/colors.js';
6
6
  import clsx from 'clsx';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTable } from './context.js';
3
3
  import { flexRender } from '@tanstack/react-table';
4
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import clsx from 'clsx';
6
6
  import { typography } from '../theme/theme.js';
7
7
  import { useTheme } from '../theme/hooks.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ContextValue } from "./types";
3
2
  declare const Context: import("react").Context<ContextValue<unknown>>;
4
3
  export default Context;
@@ -1,6 +1,6 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
2
  import { toFunction, useEvent, isUndefined } from '@aiszlab/relax';
3
- import _stylex from '../../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
+ import _stylex from '../../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
4
  import { useTheme } from '../../theme/hooks.js';
5
5
  import { ColorToken } from '../../../utils/colors.js';
6
6
  import Context from '../context.js';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTable } from '../context.js';
3
3
  import { flexRender } from '@tanstack/react-table';
4
- import { props } from '../../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import { props } from '../../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import { useTheme } from '../../theme/hooks.js';
6
6
  import clsx from 'clsx';
7
7
  import { ColorToken } from '../../../utils/colors.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ContextValue } from "./types";
3
2
  declare const Context: import("react").Context<ContextValue | null>;
4
3
  export default Context;
@@ -14,7 +14,9 @@ const Item = ({ value, onClick, ...props }) => {
14
14
  const click = useCallback(() => {
15
15
  onClick(value);
16
16
  }, [onClick, value]);
17
- return (React.createElement(Button, { variant: "text", color: isActive ? "primary" : "secondary", ref: setItem, onClick: click, className: classNames[TabsClassToken.Item], ripple: false }, props.label));
17
+ return (React.createElement(Button, { variant: "text", color: isActive ? "primary" : "secondary", ref: setItem, onClick: click, className: classNames[TabsClassToken.Item], ripple: false, style: {
18
+ borderRadius: "10% 10% 0 0",
19
+ } }, props.label));
18
20
  };
19
21
 
20
22
  export { Item as default };
@@ -3,7 +3,7 @@ import { useControlledState, useMounted } from '@aiszlab/relax';
3
3
  import { useAnimate } from 'framer-motion';
4
4
  import Context from './context.js';
5
5
  import Item from './item.js';
6
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
7
  import { useTheme } from '../theme/hooks.js';
8
8
  import { ColorToken } from '../../utils/colors.js';
9
9
  import { useClassNames } from '../../hooks/use-class-names.js';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, TagClassToken } from '../../utils/class-name.js';
5
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
6
  import { useTheme } from '../theme/hooks.js';
7
7
  import { typography } from '../theme/theme.js';
8
8
  import { ColorToken } from '../../utils/colors.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Palette, ContextValue, Theme, Mode } from "./types";
3
2
  export declare const PALETTE: Readonly<Palette>;
4
3
  /**
@@ -28,6 +27,6 @@ export declare const useSwitchable: ({ theme }: {
28
27
  theme: Theme;
29
28
  }) => {
30
29
  mode: Mode;
31
- toggle: (event: import("react").MouseEvent<Element, MouseEvent>) => void;
30
+ toggle: (event: import("react").MouseEvent) => void;
32
31
  colors: Record<import("../../utils/colors").ColorToken, string>;
33
32
  };
@@ -4,7 +4,7 @@ import { useClassNames } from '../../hooks/use-class-names.js';
4
4
  import { ComponentToken, TimePickerClassToken } from '../../utils/class-name.js';
5
5
  import Button from '../button/button.js';
6
6
  import dayjs from 'dayjs';
7
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
8
8
  import { useTheme } from '../theme/hooks.js';
9
9
  import { ColorToken } from '../../utils/colors.js';
10
10
  import clsx from 'clsx';
@@ -5,7 +5,7 @@ import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, TimePickerClassToken } from '../../utils/class-name.js';
6
6
  import Panel from './panel.js';
7
7
  import { useValue } from './hooks.js';
8
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
8
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
9
9
  import { useEvent } from '@aiszlab/relax';
10
10
  import { styles } from '../input/input.js';
11
11
 
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { ContextValue } from "./types";
3
2
  export declare const Context: import("react").Context<ContextValue>;
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
  import { Context } from './context.js';
4
4
  import { useClassNames } from '../../hooks/use-class-names.js';
5
5
  import { ComponentToken, TimelineClassToken } from '../../utils/class-name.js';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Portal from '../portal/portal.js';
3
3
  import Popper from '../popper/popper.js';
4
- import _stylex from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
4
+ import _stylex from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
5
5
  import Button from '../button/button.js';
6
6
  import { useTheme } from '../theme/hooks.js';
7
7
  import { ColorToken } from '../../utils/colors.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ContextValue } from "./types";
3
2
  declare const Context: import("react").Context<ContextValue>;
4
3
  export default Context;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { TreeProps } from "./types";
3
2
  /**
4
3
  * @description
@@ -1,4 +1,4 @@
1
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
1
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
2
  import React, { useContext } from 'react';
3
3
  import Node from './node.js';
4
4
  import clsx from 'clsx';
@@ -3,7 +3,7 @@ import { useClassNames } from '../../hooks/use-class-names.js';
3
3
  import { ComponentToken, TreeClassToken } from '../../utils/class-name.js';
4
4
  import Context from './context.js';
5
5
  import { Checkbox } from '../checkbox/index.js';
6
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
6
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
7
7
  import clsx from 'clsx';
8
8
  import { useTheme } from '../theme/hooks.js';
9
9
  import { ColorToken } from '../../utils/colors.js';
@@ -7,37 +7,39 @@ export type UploadProps = {
7
7
  /**
8
8
  * @description
9
9
  * on upload wrapper click handler
10
+ * @default void 0
10
11
  */
11
- onClick: () => void;
12
+ onClick?: () => void;
12
13
  /**
13
14
  * @description
14
15
  * disabled
15
- *
16
16
  * @default false
17
17
  */
18
18
  disabled?: boolean;
19
19
  /**
20
20
  * @description
21
21
  * multiple
22
- *
23
22
  * @default false
24
23
  */
25
24
  multiple?: boolean;
26
25
  /**
27
26
  * @description
28
27
  * children
28
+ * @default void 0
29
29
  */
30
30
  children?: ReactNode;
31
31
  /**
32
32
  * @description
33
33
  * uploader
34
+ * @default void 0
34
35
  */
35
- uploader: (file: File) => Promise<string>;
36
+ uploader?: (file: File) => Promise<string>;
36
37
  /**
37
38
  * @description
38
39
  * error
40
+ * @default void 0
39
41
  */
40
- onError?: (event: any) => void;
42
+ onError?: (error: unknown) => void;
41
43
  };
42
44
  /**
43
45
  * @description
@@ -54,7 +56,7 @@ export type UploadedsRef = {
54
56
  * @description
55
57
  * uploaded list props
56
58
  */
57
- export type UploadedsProps = Pick<UploadProps, "uploader">;
59
+ export type UploadedsProps = Pick<UploadProps, "uploader" | "onError">;
58
60
  /**
59
61
  * @description
60
62
  * status
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { UploadProps } from "./types";
3
- declare const Upload: ({ onClick: _onClick, disabled, multiple, children, uploader, onError }: UploadProps) => React.JSX.Element;
3
+ declare const Upload: ({ onClick: _onClick, disabled, multiple, children: _children, uploader, onError }: UploadProps) => React.JSX.Element;
4
4
  export default Upload;
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react';
1
+ import React, { useRef, useMemo, cloneElement } from 'react';
2
2
  import { useEvent } from '@aiszlab/relax';
3
3
  import { Keyboard } from '../../utils/keyboard.js';
4
4
  import Uploadeds from './uploadeds.js';
@@ -7,7 +7,7 @@ const Upload = ({
7
7
  onClick: _onClick,
8
8
  disabled,
9
9
  multiple,
10
- children,
10
+ children: _children,
11
11
  uploader,
12
12
  onError
13
13
  }) => {
@@ -28,7 +28,7 @@ const Upload = ({
28
28
  });
29
29
  const onClick = useEvent(() => {
30
30
  inputRef.current?.click();
31
- _onClick();
31
+ _onClick?.();
32
32
  });
33
33
  const onKeyDown = useEvent(e => {
34
34
  if (e.key !== Keyboard.Enter) return;
@@ -47,6 +47,12 @@ const Upload = ({
47
47
  className: "musae-1s85apg"
48
48
  }
49
49
  };
50
+ const children = useMemo(() => {
51
+ // @ts-ignore
52
+ return cloneElement(_children, {
53
+ disabled
54
+ });
55
+ }, [_children, disabled]);
50
56
  return React.createElement("div", null, React.createElement("div", {
51
57
  ...(!disabled && {
52
58
  onClick,
@@ -64,7 +70,8 @@ const Upload = ({
64
70
  onChange: onChange
65
71
  }), children), React.createElement(Uploadeds, {
66
72
  ref: uploadedsRef,
67
- uploader: uploader
73
+ uploader: uploader,
74
+ onError: onError
68
75
  }));
69
76
  };
70
77
  var Upload$1 = Upload;
@@ -4,7 +4,8 @@ import Loading from '../icon/icons/mock/loading.js';
4
4
  import Clear from '../icon/icons/content/clear.js';
5
5
 
6
6
  const Uploadeds = forwardRef(({
7
- uploader
7
+ uploader,
8
+ onError
8
9
  }, ref) => {
9
10
  const [items, setItems] = useState(new Map());
10
11
  const _counter = useRef(0);
@@ -22,17 +23,21 @@ const Uploadeds = forwardRef(({
22
23
  useImperativeHandle(ref, () => {
23
24
  return {
24
25
  add: async file => {
26
+ const hasUploader = !!uploader;
27
+ const status = hasUploader ? "loading" : "success";
25
28
  // push current file
26
29
  const id = _counter.current++;
27
30
  setItems(items => {
28
31
  return new Map(items).set(id, {
29
32
  file,
30
- status: "loading"
33
+ status
31
34
  });
32
35
  });
33
36
  // call request by user provided
34
- const url = await uploader(file).catch(() => {
37
+ if (!hasUploader) return;
38
+ const url = await uploader(file).catch(error => {
35
39
  loaded(id, "error");
40
+ onError?.(error);
36
41
  return null;
37
42
  });
38
43
  if (!url) return;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @description
4
3
  * repaint child
@@ -1,5 +1,5 @@
1
1
  import React, { useMemo } from 'react';
2
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
3
3
 
4
4
  const styles = {
5
5
  column: props => [{
@@ -1,4 +1,4 @@
1
- import { props } from '../../node_modules/@stylexjs/stylex/lib/es/stylex.js';
1
+ import { props } from '../../node_modules/.pnpm/@stylexjs_stylex@0.6.1/node_modules/@stylexjs/stylex/lib/es/stylex.js';
2
2
  import React from 'react';
3
3
  import { useRepaint } from './hooks.js';
4
4
  import clsx from 'clsx';