@molecule/app-ui-react 3.0.5 → 3.1.0
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 +46 -1
- package/dist/components/OptimisticToggleButton.d.ts +45 -0
- package/dist/components/OptimisticToggleButton.d.ts.map +1 -0
- package/dist/components/OptimisticToggleButton.js +42 -0
- package/dist/components/OptimisticToggleButton.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- 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-11T02:37:03.267Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-react
|
|
@@ -13,6 +13,12 @@ React UI components for molecule.dev.
|
|
|
13
13
|
Provides React implementations of the `@molecule/app-ui` component
|
|
14
14
|
interfaces using the UIClassMap abstraction from `@molecule/app-ui`.
|
|
15
15
|
|
|
16
|
+
Server-backed boolean actions use `OptimisticToggleButton`: pass a loaded `value`, a
|
|
17
|
+
`commit(desired)` returning the confirmed boolean, and translated `activeLabel` and
|
|
18
|
+
`inactiveLabel`. The label and pressed state change on the first tap; saves run in order
|
|
19
|
+
and the newest failure rolls back. Mount after the initial record loads, key by record,
|
|
20
|
+
and keep it mounted during refetches. Authorization and self-record checks stay in the app.
|
|
21
|
+
|
|
16
22
|
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
17
23
|
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
18
24
|
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
@@ -1702,6 +1708,28 @@ interface LoadErrorBannerProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
1702
1708
|
}
|
|
1703
1709
|
```
|
|
1704
1710
|
|
|
1711
|
+
#### `OptimisticToggleButtonProps`
|
|
1712
|
+
|
|
1713
|
+
Props for {@link OptimisticToggleButton}. Labels come from the application's translations.
|
|
1714
|
+
|
|
1715
|
+
```typescript
|
|
1716
|
+
interface OptimisticToggleButtonProps extends Omit<
|
|
1717
|
+
ButtonProps,
|
|
1718
|
+
'children' | 'onClick' | 'loading' | 'loadingText' | 'type' | 'value'
|
|
1719
|
+
> {
|
|
1720
|
+
/** The loaded server value. Mount the button only after its initial record exists. */
|
|
1721
|
+
value: boolean
|
|
1722
|
+
/** Saves the desired boolean and returns the server-confirmed boolean; reject on failure. */
|
|
1723
|
+
commit: (desired: boolean) => Promise<boolean>
|
|
1724
|
+
/** Label when the displayed value is true. */
|
|
1725
|
+
activeLabel: React.ReactNode
|
|
1726
|
+
/** Label when the displayed value is false. */
|
|
1727
|
+
inactiveLabel: React.ReactNode
|
|
1728
|
+
/** Receives a failed save after the controller has restored the last confirmed value. */
|
|
1729
|
+
onError?: (error: unknown) => void
|
|
1730
|
+
}
|
|
1731
|
+
```
|
|
1732
|
+
|
|
1705
1733
|
#### `PanelCloseProviderProps`
|
|
1706
1734
|
|
|
1707
1735
|
Props for {@link PanelCloseProvider}.
|
|
@@ -3167,6 +3195,23 @@ const Modal: React.ForwardRefExoticComponent<
|
|
|
3167
3195
|
>
|
|
3168
3196
|
```
|
|
3169
3197
|
|
|
3198
|
+
#### `OptimisticToggleButton`
|
|
3199
|
+
|
|
3200
|
+
An optimistic server-backed toggle: the first tap changes its label and pressed state,
|
|
3201
|
+
including while a previous save is pending. Saves run in order, using the latest desired
|
|
3202
|
+
boolean. The newest failure rolls back; `onError` lets the app show its own error message.
|
|
3203
|
+
|
|
3204
|
+
Render this button after the record loads, give it a key per record, and keep it mounted
|
|
3205
|
+
during same-record refetches. Keep authorization and self-record checks in the app.
|
|
3206
|
+
`disabled` is for those permissions, never for a pending save. Local UI switches use Button
|
|
3207
|
+
or Switch without a server commit.
|
|
3208
|
+
|
|
3209
|
+
```typescript
|
|
3210
|
+
const OptimisticToggleButton: React.ForwardRefExoticComponent<
|
|
3211
|
+
OptimisticToggleButtonProps & React.RefAttributes<HTMLButtonElement>
|
|
3212
|
+
>
|
|
3213
|
+
```
|
|
3214
|
+
|
|
3170
3215
|
#### `PageHeader`
|
|
3171
3216
|
|
|
3172
3217
|
PageHeader component.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A server-backed boolean button that changes its label immediately and saves in order.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { ButtonProps } from '@molecule/app-ui';
|
|
8
|
+
/** Props for {@link OptimisticToggleButton}. Labels come from the application's translations. */
|
|
9
|
+
export interface OptimisticToggleButtonProps extends Omit<ButtonProps, 'children' | 'onClick' | 'loading' | 'loadingText' | 'type' | 'value'> {
|
|
10
|
+
/** The loaded server value. Mount the button only after its initial record exists. */
|
|
11
|
+
value: boolean;
|
|
12
|
+
/** Saves the desired boolean and returns the server-confirmed boolean; reject on failure. */
|
|
13
|
+
commit: (desired: boolean) => Promise<boolean>;
|
|
14
|
+
/** Label when the displayed value is true. */
|
|
15
|
+
activeLabel: React.ReactNode;
|
|
16
|
+
/** Label when the displayed value is false. */
|
|
17
|
+
inactiveLabel: React.ReactNode;
|
|
18
|
+
/** Receives a failed save after the controller has restored the last confirmed value. */
|
|
19
|
+
onError?: (error: unknown) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An optimistic server-backed toggle: the first tap changes its label and pressed state,
|
|
23
|
+
* including while a previous save is pending. Saves run in order, using the latest desired
|
|
24
|
+
* boolean. The newest failure rolls back; `onError` lets the app show its own error message.
|
|
25
|
+
*
|
|
26
|
+
* Render this button after the record loads, give it a key per record, and keep it mounted
|
|
27
|
+
* during same-record refetches. Keep authorization and self-record checks in the app.
|
|
28
|
+
* `disabled` is for those permissions, never for a pending save. Local UI switches use Button
|
|
29
|
+
* or Switch without a server commit.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* {repository && canStar && (
|
|
34
|
+
* <OptimisticToggleButton
|
|
35
|
+
* key={repository.id}
|
|
36
|
+
* value={repository.starred}
|
|
37
|
+
* commit={async (desired) => (await saveStar(repository.id, desired)).starred}
|
|
38
|
+
* activeLabel={t('repository.unstar', undefined, { defaultValue: 'Unstar' })}
|
|
39
|
+
* inactiveLabel={t('repository.star', undefined, { defaultValue: 'Star' })}
|
|
40
|
+
* />
|
|
41
|
+
* )}
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const OptimisticToggleButton: React.ForwardRefExoticComponent<OptimisticToggleButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
45
|
+
//# sourceMappingURL=OptimisticToggleButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptimisticToggleButton.d.ts","sourceRoot":"","sources":["../../src/components/OptimisticToggleButton.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD,iGAAiG;AACjG,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CACvD,WAAW,EACX,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,OAAO,CACtE;IACC,sFAAsF;IACtF,KAAK,EAAE,OAAO,CAAA;IACd,6FAA6F;IAC7F,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9C,8CAA8C;IAC9C,WAAW,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,+CAA+C;IAC/C,aAAa,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,yFAAyF;IACzF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,sBAAsB,uGAqBlC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A server-backed boolean button that changes its label immediately and saves in order.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
import { useOptimisticValue } from '@molecule/app-react';
|
|
9
|
+
import { Button } from './Button.js';
|
|
10
|
+
/**
|
|
11
|
+
* An optimistic server-backed toggle: the first tap changes its label and pressed state,
|
|
12
|
+
* including while a previous save is pending. Saves run in order, using the latest desired
|
|
13
|
+
* boolean. The newest failure rolls back; `onError` lets the app show its own error message.
|
|
14
|
+
*
|
|
15
|
+
* Render this button after the record loads, give it a key per record, and keep it mounted
|
|
16
|
+
* during same-record refetches. Keep authorization and self-record checks in the app.
|
|
17
|
+
* `disabled` is for those permissions, never for a pending save. Local UI switches use Button
|
|
18
|
+
* or Switch without a server commit.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* {repository && canStar && (
|
|
23
|
+
* <OptimisticToggleButton
|
|
24
|
+
* key={repository.id}
|
|
25
|
+
* value={repository.starred}
|
|
26
|
+
* commit={async (desired) => (await saveStar(repository.id, desired)).starred}
|
|
27
|
+
* activeLabel={t('repository.unstar', undefined, { defaultValue: 'Unstar' })}
|
|
28
|
+
* inactiveLabel={t('repository.star', undefined, { defaultValue: 'Star' })}
|
|
29
|
+
* />
|
|
30
|
+
* )}
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const OptimisticToggleButton = forwardRef(({ value, commit, activeLabel, inactiveLabel, onError, ...props }, ref) => {
|
|
34
|
+
const toggle = useOptimisticValue({
|
|
35
|
+
value,
|
|
36
|
+
commit: (desired) => commit(desired),
|
|
37
|
+
onError: (error) => onError?.(error),
|
|
38
|
+
});
|
|
39
|
+
return (_jsx(Button, { "data-mol-id": "optimistic-toggle", ...props, ref: ref, type: "button", "aria-pressed": toggle.value, "aria-busy": toggle.pending, onClick: () => toggle.update((current) => !current), children: toggle.value ? activeLabel : inactiveLabel }));
|
|
40
|
+
});
|
|
41
|
+
OptimisticToggleButton.displayName = 'OptimisticToggleButton';
|
|
42
|
+
//# sourceMappingURL=OptimisticToggleButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptimisticToggleButton.js","sourceRoot":"","sources":["../../src/components/OptimisticToggleButton.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAmBpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAC9C,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACxE,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAChC,KAAK;QACL,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;QACpC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;KACrC,CAAC,CAAA;IACF,OAAO,CACL,KAAC,MAAM,mBACO,mBAAmB,KAC3B,KAAK,EACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,kBACC,MAAM,CAAC,KAAK,eACf,MAAM,CAAC,OAAO,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,YAElD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,GACpC,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAA"}
|
|
@@ -23,6 +23,7 @@ export * from './LanguagePicker.js';
|
|
|
23
23
|
export * from './Layout.js';
|
|
24
24
|
export * from './LoadErrorBanner.js';
|
|
25
25
|
export * from './Modal.js';
|
|
26
|
+
export * from './OptimisticToggleButton.js';
|
|
26
27
|
export * from './PageHeader.js';
|
|
27
28
|
export * from './PageShell.js';
|
|
28
29
|
export * from './Pagination.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,a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c,YAAY,CAAA;AAC1B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export * from './LanguagePicker.js';
|
|
|
23
23
|
export * from './Layout.js';
|
|
24
24
|
export * from './LoadErrorBanner.js';
|
|
25
25
|
export * from './Modal.js';
|
|
26
|
+
export * from './OptimisticToggleButton.js';
|
|
26
27
|
export * from './PageHeader.js';
|
|
27
28
|
export * from './PageShell.js';
|
|
28
29
|
export * from './Pagination.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,c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AAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* Provides React implementations of the `@molecule/app-ui` component
|
|
5
5
|
* interfaces using the UIClassMap abstraction from `@molecule/app-ui`.
|
|
6
6
|
*
|
|
7
|
+
* Server-backed boolean actions use `OptimisticToggleButton`: pass a loaded `value`, a
|
|
8
|
+
* `commit(desired)` returning the confirmed boolean, and translated `activeLabel` and
|
|
9
|
+
* `inactiveLabel`. The label and pressed state change on the first tap; saves run in order
|
|
10
|
+
* and the newest failure rolls back. Mount after the initial record loads, key by record,
|
|
11
|
+
* and keep it mounted during refetches. Authorization and self-record checks stay in the app.
|
|
12
|
+
*
|
|
7
13
|
* @example
|
|
8
14
|
* ```tsx
|
|
9
15
|
* import { setClassMap } from '@molecule/app-ui'
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoIG;AAEH,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* Provides React implementations of the `@molecule/app-ui` component
|
|
5
5
|
* interfaces using the UIClassMap abstraction from `@molecule/app-ui`.
|
|
6
6
|
*
|
|
7
|
+
* Server-backed boolean actions use `OptimisticToggleButton`: pass a loaded `value`, a
|
|
8
|
+
* `commit(desired)` returning the confirmed boolean, and translated `activeLabel` and
|
|
9
|
+
* `inactiveLabel`. The label and pressed state change on the first tap; saves run in order
|
|
10
|
+
* and the newest failure rolls back. Mount after the initial record loads, key by record,
|
|
11
|
+
* and keep it mounted during refetches. Authorization and self-record checks stay in the app.
|
|
12
|
+
*
|
|
7
13
|
* @example
|
|
8
14
|
* ```tsx
|
|
9
15
|
* import { setClassMap } from '@molecule/app-ui'
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoIG;AAEH,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-ui-react",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "React UI components for molecule.dev",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@molecule/app-i18n": "1.1.2",
|
|
46
46
|
"@molecule/app-icons": "1.0.3",
|
|
47
|
-
"@molecule/app-react": "3.
|
|
47
|
+
"@molecule/app-react": "3.5.0",
|
|
48
48
|
"@testing-library/react": "16.3.3",
|
|
49
49
|
"@types/node": "26.6.5",
|
|
50
50
|
"@types/react": "19.3.0",
|