@molecule/app-ui-react 4.1.6 → 4.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -10
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +20 -3
- package/dist/components/Toast.js.map +1 -1
- package/dist/utilities/rootProps.d.ts +20 -0
- package/dist/utilities/rootProps.d.ts.map +1 -0
- package/dist/utilities/rootProps.js +19 -0
- package/dist/utilities/rootProps.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-19T18:18:10.884Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-react
|
|
@@ -101,6 +101,12 @@ interface CSSProperties {
|
|
|
101
101
|
|
|
102
102
|
Base props shared by all components.
|
|
103
103
|
|
|
104
|
+
Ref element: a component that renders one main element gives the caller that element, the one
|
|
105
|
+
that takes `className` and `style`. Each UI kit hands it over in its framework's own way: React
|
|
106
|
+
and Solid a `ref`, Vue a template ref's `$el`, Svelte `bind:ref`, Angular the component's
|
|
107
|
+
`element()` signal. It is empty while the element is not rendered (a closed Tooltip, Dropdown or
|
|
108
|
+
Modal). A component's own doc names the element when it is not the outermost one.
|
|
109
|
+
|
|
104
110
|
```typescript
|
|
105
111
|
interface BaseProps {
|
|
106
112
|
/**
|
|
@@ -127,7 +133,11 @@ interface BaseProps {
|
|
|
127
133
|
automationId?: string
|
|
128
134
|
|
|
129
135
|
/**
|
|
130
|
-
*
|
|
136
|
+
* Disables the controls the component renders: a disabled Button, Input, Textarea, Select,
|
|
137
|
+
* Checkbox, Switch, RadioGroup, Tabs, Accordion or Pagination takes no input, a disabled
|
|
138
|
+
* Dropdown never opens, and a disabled Card never calls `onClick` (an interactive one is
|
|
139
|
+
* announced as disabled and leaves the tab order). A component that renders no control
|
|
140
|
+
* (Badge, Spinner, Skeleton, a layout box) ignores it.
|
|
131
141
|
*/
|
|
132
142
|
disabled?: boolean
|
|
133
143
|
}
|
|
@@ -321,6 +331,8 @@ interface ButtonProps extends ButtonElementProps {
|
|
|
321
331
|
|
|
322
332
|
Props for the Input component (text field, email, password, etc.).
|
|
323
333
|
|
|
334
|
+
Ref element: the native `<input>`.
|
|
335
|
+
|
|
324
336
|
```typescript
|
|
325
337
|
interface InputProps extends InputElementProps {
|
|
326
338
|
/**
|
|
@@ -386,6 +398,8 @@ interface InputProps extends InputElementProps {
|
|
|
386
398
|
|
|
387
399
|
Props for the Textarea component.
|
|
388
400
|
|
|
401
|
+
Ref element: the native `<textarea>`.
|
|
402
|
+
|
|
389
403
|
```typescript
|
|
390
404
|
interface TextareaProps extends TextareaElementProps {
|
|
391
405
|
/**
|
|
@@ -458,6 +472,8 @@ interface SelectOption<T = string> {
|
|
|
458
472
|
|
|
459
473
|
Props for the Select dropdown component (single or multi-select).
|
|
460
474
|
|
|
475
|
+
Ref element: the native `<select>`.
|
|
476
|
+
|
|
461
477
|
```typescript
|
|
462
478
|
interface SelectProps<T = string> extends SelectElementProps {
|
|
463
479
|
/**
|
|
@@ -511,6 +527,8 @@ interface SelectProps<T = string> extends SelectElementProps {
|
|
|
511
527
|
|
|
512
528
|
Props for the Checkbox component.
|
|
513
529
|
|
|
530
|
+
Ref element: the native `<input type="checkbox">`.
|
|
531
|
+
|
|
514
532
|
```typescript
|
|
515
533
|
interface CheckboxProps extends InputElementProps {
|
|
516
534
|
/**
|
|
@@ -620,6 +638,8 @@ interface RadioGroupProps<T = string> extends BaseProps {
|
|
|
620
638
|
|
|
621
639
|
Props for the Switch/Toggle component.
|
|
622
640
|
|
|
641
|
+
Ref element: the `role="switch"` button.
|
|
642
|
+
|
|
623
643
|
```typescript
|
|
624
644
|
interface SwitchProps extends InputElementProps {
|
|
625
645
|
/**
|
|
@@ -648,6 +668,8 @@ interface SwitchProps extends InputElementProps {
|
|
|
648
668
|
|
|
649
669
|
Props for the Modal/Dialog component.
|
|
650
670
|
|
|
671
|
+
Ref element: the dialog (`role="dialog"`), empty while closed.
|
|
672
|
+
|
|
651
673
|
```typescript
|
|
652
674
|
interface ModalProps extends HTMLElementProps {
|
|
653
675
|
/**
|
|
@@ -816,6 +838,8 @@ interface BadgeProps extends HTMLElementProps {
|
|
|
816
838
|
|
|
817
839
|
Props for the Tooltip component (hover/focus popover with informational text).
|
|
818
840
|
|
|
841
|
+
Ref element: the `role="tooltip"` box, empty while hidden.
|
|
842
|
+
|
|
819
843
|
```typescript
|
|
820
844
|
interface TooltipProps extends HTMLElementProps {
|
|
821
845
|
/**
|
|
@@ -1343,6 +1367,8 @@ interface TableColumn<T> {
|
|
|
1343
1367
|
|
|
1344
1368
|
Props for the Table component.
|
|
1345
1369
|
|
|
1370
|
+
Ref element: the `<table>`.
|
|
1371
|
+
|
|
1346
1372
|
```typescript
|
|
1347
1373
|
interface TableProps<T> extends HTMLElementProps {
|
|
1348
1374
|
/**
|
|
@@ -2233,20 +2259,26 @@ type Children = unknown
|
|
|
2233
2259
|
|
|
2234
2260
|
#### `EventHandler`
|
|
2235
2261
|
|
|
2236
|
-
Framework-agnostic event handler.
|
|
2262
|
+
Framework-agnostic event handler. An unannotated handler's event is `E`. It is declared as a
|
|
2263
|
+
method (as React types its own handlers), so TypeScript compares its parameter both ways: a
|
|
2264
|
+
handler written for the event a kit passes, such as `(event: Event) => void` on the Vue, Solid,
|
|
2265
|
+
Svelte and Angular kits or `(event: React.ChangeEvent<HTMLInputElement>) => void` on React's,
|
|
2266
|
+
is accepted too.
|
|
2237
2267
|
|
|
2238
2268
|
```typescript
|
|
2239
|
-
type EventHandler<E =
|
|
2269
|
+
type EventHandler<E extends KitEvent = KitEvent> = {
|
|
2270
|
+
handle(event: E): void
|
|
2271
|
+
}['handle']
|
|
2240
2272
|
```
|
|
2241
2273
|
|
|
2242
|
-
- `event` — The
|
|
2274
|
+
- `event` — The event, as the kit hands it (see {@link KitEvent}).
|
|
2243
2275
|
|
|
2244
2276
|
#### `MouseEventHandler`
|
|
2245
2277
|
|
|
2246
2278
|
Framework-agnostic mouse event handler.
|
|
2247
2279
|
|
|
2248
2280
|
```typescript
|
|
2249
|
-
type MouseEventHandler = EventHandler<
|
|
2281
|
+
type MouseEventHandler = EventHandler<KitMouseEvent>
|
|
2250
2282
|
```
|
|
2251
2283
|
|
|
2252
2284
|
#### `KeyboardEventHandler`
|
|
@@ -2254,7 +2286,7 @@ type MouseEventHandler = EventHandler<MouseEvent>
|
|
|
2254
2286
|
Framework-agnostic keyboard event handler.
|
|
2255
2287
|
|
|
2256
2288
|
```typescript
|
|
2257
|
-
type KeyboardEventHandler = EventHandler<
|
|
2289
|
+
type KeyboardEventHandler = EventHandler<KitKeyboardEvent>
|
|
2258
2290
|
```
|
|
2259
2291
|
|
|
2260
2292
|
#### `FocusEventHandler`
|
|
@@ -2262,7 +2294,7 @@ type KeyboardEventHandler = EventHandler<KeyboardEvent>
|
|
|
2262
2294
|
Framework-agnostic focus event handler.
|
|
2263
2295
|
|
|
2264
2296
|
```typescript
|
|
2265
|
-
type FocusEventHandler = EventHandler<
|
|
2297
|
+
type FocusEventHandler = EventHandler<KitFocusEvent>
|
|
2266
2298
|
```
|
|
2267
2299
|
|
|
2268
2300
|
#### `ChangeEventHandler`
|
|
@@ -2270,7 +2302,7 @@ type FocusEventHandler = EventHandler<FocusEvent>
|
|
|
2270
2302
|
Framework-agnostic change event handler.
|
|
2271
2303
|
|
|
2272
2304
|
```typescript
|
|
2273
|
-
type ChangeEventHandler = EventHandler<
|
|
2305
|
+
type ChangeEventHandler = EventHandler<KitEvent>
|
|
2274
2306
|
```
|
|
2275
2307
|
|
|
2276
2308
|
#### `FormEventHandler`
|
|
@@ -2278,7 +2310,7 @@ type ChangeEventHandler = EventHandler<Event>
|
|
|
2278
2310
|
Framework-agnostic form event handler.
|
|
2279
2311
|
|
|
2280
2312
|
```typescript
|
|
2281
|
-
type FormEventHandler = EventHandler<
|
|
2313
|
+
type FormEventHandler = EventHandler<KitEvent>
|
|
2282
2314
|
```
|
|
2283
2315
|
|
|
2284
2316
|
#### `Size`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAA;AAKd,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAA;AAKd,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,kBAAkB,CAAA;AA6BhE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,mFAuJjB,CAAA;AAID;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID;;;GAGG;AACH,eAAO,MAAM,cAAc,4FAa1B,CAAA;AAID;;GAEG;AACH,UAAU,iBAAiB;IACzB,MAAM,EAAE,CAAC,UAAU,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,KAAK,MAAM,CAAA;IAC1D,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC;AAID;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAO,iBAW3B,CAAA;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;CAClC;AAID;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2BtD,CAAA"}
|
package/dist/components/Toast.js
CHANGED
|
@@ -9,6 +9,7 @@ import { createPortal } from 'react-dom';
|
|
|
9
9
|
import { useTranslation } from '@molecule/app-react';
|
|
10
10
|
import { getClassMap } from '@molecule/app-ui';
|
|
11
11
|
import { renderIcon } from '../utilities/renderIcon.js';
|
|
12
|
+
import { rootProps } from '../utilities/rootProps.js';
|
|
12
13
|
/**
|
|
13
14
|
* Map status to toast variant.
|
|
14
15
|
*/
|
|
@@ -40,7 +41,7 @@ const statusIconMap = {
|
|
|
40
41
|
* the polite `role="status"` so routine confirmations don't interrupt a
|
|
41
42
|
* screen reader mid-sentence the way an assertive announcement does.
|
|
42
43
|
*/
|
|
43
|
-
export const Toast = forwardRef(({ children, title, description, status = 'info', duration = 5000, dismissible = true, onDismiss, position: _position = 'bottom-right', closeLabel, className, style, testId, }, ref) => {
|
|
44
|
+
export const Toast = forwardRef(({ children, title, description, status = 'info', duration = 5000, dismissible = true, onDismiss, position: _position = 'bottom-right', closeLabel, className, style, testId, onMouseEnter, onMouseLeave, onFocus, onBlur, ...rest }, ref) => {
|
|
44
45
|
const [isVisible, setIsVisible] = useState(true);
|
|
45
46
|
const { t } = useTranslation();
|
|
46
47
|
const cm = getClassMap();
|
|
@@ -107,7 +108,22 @@ export const Toast = forwardRef(({ children, title, description, status = 'info'
|
|
|
107
108
|
// routine confirmation is the same over-announcing trap `role="alert"`
|
|
108
109
|
// creates everywhere it's used for non-urgent content.
|
|
109
110
|
const role = variant === 'warning' || variant === 'error' ? 'alert' : 'status';
|
|
110
|
-
return (_jsxs("div", { ref: ref, role: role, "data-state": "open", className: cm.cn(cm.toast({ variant }), className), style: style, "data-testid": testId,
|
|
111
|
+
return (_jsxs("div", { ref: ref, role: role, "data-state": "open", className: cm.cn(cm.toast({ variant }), className), style: style, "data-testid": testId, ...rootProps(rest),
|
|
112
|
+
// The timer pauses while the pointer or focus is on the toast; the caller's handlers
|
|
113
|
+
// for the same events run after it.
|
|
114
|
+
onMouseEnter: (event) => {
|
|
115
|
+
pauseTimer();
|
|
116
|
+
onMouseEnter?.(event);
|
|
117
|
+
}, onMouseLeave: (event) => {
|
|
118
|
+
resumeTimer();
|
|
119
|
+
onMouseLeave?.(event);
|
|
120
|
+
}, onFocus: (event) => {
|
|
121
|
+
pauseTimer();
|
|
122
|
+
onFocus?.(event);
|
|
123
|
+
}, onBlur: (event) => {
|
|
124
|
+
resumeTimer();
|
|
125
|
+
onBlur?.(event);
|
|
126
|
+
}, children: [statusIcon && _jsx("span", { className: cm.toastIconWrapper, children: statusIcon }), _jsxs("div", { className: cm.toastContentWrapper, children: [title && _jsx("div", { className: cm.toastTitle, children: title }), !!(description || children) && (_jsx("div", { className: cm.toastDescription, children: description || children }))] }), dismissible && (_jsx("button", { type: "button", onClick: handleDismiss, className: cm.toastClose, "aria-label": closeLabel ?? t('ui.toast.close', undefined, { defaultValue: 'Close' }), children: renderIcon('x-mark', cm.iconSm) }))] }));
|
|
111
127
|
});
|
|
112
128
|
Toast.displayName = 'Toast';
|
|
113
129
|
// positionClasses removed — use cm.toastContainer({ position }) instead
|
|
@@ -149,7 +165,8 @@ let toastCounter = 0;
|
|
|
149
165
|
export const ToastProvider = ({ children, position = 'bottom-right', }) => {
|
|
150
166
|
const [toasts, setToasts] = useState([]);
|
|
151
167
|
const addToast = useCallback((toast) => {
|
|
152
|
-
|
|
168
|
+
// A caller's `id` is the toast's handle and its element id; otherwise one is generated.
|
|
169
|
+
const id = toast.id ?? `toast-${++toastCounter}`;
|
|
153
170
|
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
154
171
|
return id;
|
|
155
172
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD;;GAEG;AACH,MAAM,gBAAgB,GACpB;IACE,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACb,CAAA;AAEH;;GAEG;AACH,MAAM,aAAa,GAA6B;IAC9C,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,cAAc;IACv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D,OAAO,EAAE,CAAA;IACX,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAC7C,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;IACtD,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,MAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,aAC5D,QAAQ,EACT,KAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,YAC/B,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,KAAC,KAAK,OAAoB,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,IAA3D,KAAK,CAAC,EAAE,CAAuD,CAC5E,CAAC,GACa,IACK,CACzB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props a component spreads onto its root element.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The caller's rest props for a component's root element, with `BaseProps.automationId`
|
|
8
|
+
* rendered as the `data-mol-id` attribute it documents. Spread raw, React would write
|
|
9
|
+
* `automationId` to the DOM as an unknown attribute (with a dev warning) and the automation
|
|
10
|
+
* hook an agent or E2E test looks for would never appear.
|
|
11
|
+
*
|
|
12
|
+
* @param rest - The props the component does not consume itself.
|
|
13
|
+
* @returns The props to spread onto the root element.
|
|
14
|
+
*/
|
|
15
|
+
export declare function rootProps<T extends {
|
|
16
|
+
automationId?: string;
|
|
17
|
+
}>(rest: T): Omit<T, 'automationId'> & {
|
|
18
|
+
'data-mol-id'?: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=rootProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootProps.d.ts","sourceRoot":"","sources":["../../src/utilities/rootProps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3D,IAAI,EAAE,CAAC,GACN,IAAI,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAGtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props a component spreads onto its root element.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The caller's rest props for a component's root element, with `BaseProps.automationId`
|
|
8
|
+
* rendered as the `data-mol-id` attribute it documents. Spread raw, React would write
|
|
9
|
+
* `automationId` to the DOM as an unknown attribute (with a dev warning) and the automation
|
|
10
|
+
* hook an agent or E2E test looks for would never appear.
|
|
11
|
+
*
|
|
12
|
+
* @param rest - The props the component does not consume itself.
|
|
13
|
+
* @returns The props to spread onto the root element.
|
|
14
|
+
*/
|
|
15
|
+
export function rootProps(rest) {
|
|
16
|
+
const { automationId, ...others } = rest;
|
|
17
|
+
return automationId === undefined ? others : { ...others, 'data-mol-id': automationId };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=rootProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootProps.js","sourceRoot":"","sources":["../../src/utilities/rootProps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CACvB,IAAO;IAEP,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IACxC,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,CAAA;AACzF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-ui-react",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"description": "React UI primitive bundle for molecule.dev — Button, Modal, Tooltip, Toast, Alert, Card, Badge, Avatar, Tabs, Accordion, Dropdown, Select, Checkbox, Switch, Input, Table, Spinner, Skeleton, Progress and more. Import these primitives; do not rebuild them.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@molecule/app-i18n": "1.2.2",
|
|
46
46
|
"@molecule/app-icons": "1.0.4",
|
|
47
|
-
"@molecule/app-react": "4.
|
|
47
|
+
"@molecule/app-react": "4.10.0",
|
|
48
48
|
"@testing-library/react": "16.3.3",
|
|
49
49
|
"@types/node": "26.6.5",
|
|
50
50
|
"@types/react": "19.3.0",
|