@molecule/app-ui-react 4.14.0 → 4.14.1
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 +95 -117
- package/dist/components/Accordion.d.ts +1 -11
- package/dist/components/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion.js +1 -82
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Alert.d.ts +1 -25
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js +1 -60
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Avatar.d.ts +1 -11
- package/dist/components/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar.js +1 -28
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Checkbox.d.ts +1 -11
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +1 -27
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Pagination.d.ts +1 -11
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +1 -79
- package/dist/components/Pagination.js.map +1 -1
- package/dist/components/RadioGroup.d.ts +1 -11
- package/dist/components/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup.js +1 -35
- package/dist/components/RadioGroup.js.map +1 -1
- package/dist/components/Select.d.ts +1 -26
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +1 -71
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Spinner.d.ts +1 -16
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner.js +1 -29
- package/dist/components/Spinner.js.map +1 -1
- package/dist/components/Switch.d.ts +1 -11
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +1 -32
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Table.d.ts +1 -11
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +1 -57
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs.d.ts +1 -11
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs.js +1 -75
- package/dist/components/Tabs.js.map +1 -1
- package/dist/components/Textarea.d.ts +1 -10
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +1 -27
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/Toast.d.ts +2 -14
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +8 -89
- package/dist/components/Toast.js.map +1 -1
- package/dist/elements/Anchor.d.ts +1 -1
- package/dist/elements/Box.d.ts +1 -15
- package/dist/elements/Box.d.ts.map +1 -1
- package/dist/elements/Box.js +1 -55
- package/dist/elements/Box.js.map +1 -1
- package/dist/elements/CheckField.d.ts +1 -16
- package/dist/elements/CheckField.d.ts.map +1 -1
- package/dist/elements/CheckField.js +1 -52
- package/dist/elements/CheckField.js.map +1 -1
- package/dist/elements/Image.d.ts +1 -16
- package/dist/elements/Image.d.ts.map +1 -1
- package/dist/elements/Image.js +1 -21
- package/dist/elements/Image.js.map +1 -1
- package/dist/elements/Pressable.d.ts +1 -16
- package/dist/elements/Pressable.d.ts.map +1 -1
- package/dist/elements/Pressable.js +1 -41
- package/dist/elements/Pressable.js.map +1 -1
- package/dist/elements/ScrollArea.d.ts +1 -15
- package/dist/elements/ScrollArea.d.ts.map +1 -1
- package/dist/elements/ScrollArea.js +1 -41
- package/dist/elements/ScrollArea.js.map +1 -1
- package/dist/elements/SelectField.d.ts +1 -10
- package/dist/elements/SelectField.d.ts.map +1 -1
- package/dist/elements/SelectField.js +1 -63
- package/dist/elements/SelectField.js.map +1 -1
- package/dist/elements/Svg.d.ts +1 -123
- package/dist/elements/Svg.d.ts.map +1 -1
- package/dist/elements/Svg.js +1 -179
- package/dist/elements/Svg.js.map +1 -1
- package/dist/elements/TableBox.d.ts +1 -15
- package/dist/elements/TableBox.d.ts.map +1 -1
- package/dist/elements/TableBox.js +1 -17
- package/dist/elements/TableBox.js.map +1 -1
- package/dist/elements/TableCell.d.ts +1 -15
- package/dist/elements/TableCell.d.ts.map +1 -1
- package/dist/elements/TableCell.js +1 -17
- package/dist/elements/TableCell.js.map +1 -1
- package/dist/elements/Text.d.ts +1 -18
- package/dist/elements/Text.d.ts.map +1 -1
- package/dist/elements/Text.js +1 -20
- package/dist/elements/Text.js.map +1 -1
- package/dist/elements/TextField.d.ts +1 -17
- package/dist/elements/TextField.d.ts.map +1 -1
- package/dist/elements/TextField.js +1 -104
- package/dist/elements/TextField.js.map +1 -1
- package/dist/elements/drag.d.ts +1 -14
- package/dist/elements/drag.d.ts.map +1 -1
- package/dist/elements/drag.js +1 -27
- package/dist/elements/drag.js.map +1 -1
- package/dist/elements/flow.d.ts +1 -16
- package/dist/elements/flow.d.ts.map +1 -1
- package/dist/elements/flow.js +1 -17
- package/dist/elements/flow.js.map +1 -1
- package/dist/elements/hover.d.ts +1 -9
- package/dist/elements/hover.d.ts.map +1 -1
- package/dist/elements/hover.js +1 -22
- package/dist/elements/hover.js.map +1 -1
- package/dist/elements/measure.d.ts +1 -24
- package/dist/elements/measure.d.ts.map +1 -1
- package/dist/elements/measure.js +1 -19
- package/dist/elements/measure.js.map +1 -1
- package/dist/elements/paste.d.ts +1 -4
- package/dist/elements/paste.d.ts.map +1 -1
- package/dist/elements/paste.js +1 -14
- package/dist/elements/paste.js.map +1 -1
- package/dist/elements/ref.d.ts +1 -15
- package/dist/elements/ref.d.ts.map +1 -1
- package/dist/elements/ref.js +1 -17
- package/dist/elements/ref.js.map +1 -1
- package/dist/elements/style.d.ts +1 -34
- package/dist/elements/style.d.ts.map +1 -1
- package/dist/elements/style.js +1 -50
- package/dist/elements/style.js.map +1 -1
- package/dist/elements/types.d.ts +1 -22
- package/dist/elements/types.d.ts.map +1 -1
- package/dist/elements/types.js +1 -6
- package/dist/elements/types.js.map +1 -1
- package/dist/elements/viewport.d.ts +1 -52
- package/dist/elements/viewport.d.ts.map +1 -1
- package/dist/elements/viewport.js +1 -103
- package/dist/elements/viewport.js.map +1 -1
- package/dist/index.native.d.ts +1 -0
- package/dist/index.native.d.ts.map +1 -1
- package/dist/index.native.js +1 -0
- package/dist/index.native.js.map +1 -1
- package/dist/kit.native.d.ts +12 -0
- package/dist/kit.native.d.ts.map +1 -0
- package/dist/kit.native.js +11 -0
- package/dist/kit.native.js.map +1 -0
- package/dist/kit.web.d.ts +39 -0
- package/dist/kit.web.d.ts.map +1 -0
- package/dist/kit.web.js +34 -0
- package/dist/kit.web.js.map +1 -0
- package/dist/platform/index.d.ts +1 -28
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +1 -179
- package/dist/platform/index.js.map +1 -1
- package/dist/utilities/initials.d.ts +1 -12
- package/dist/utilities/initials.d.ts.map +1 -1
- package/dist/utilities/initials.js +1 -22
- package/dist/utilities/initials.js.map +1 -1
- package/dist/utilities/isReactNode.d.ts +1 -15
- package/dist/utilities/isReactNode.d.ts.map +1 -1
- package/dist/utilities/isReactNode.js +1 -26
- package/dist/utilities/isReactNode.js.map +1 -1
- package/dist/utilities/mergeRefs.d.ts +1 -19
- package/dist/utilities/mergeRefs.d.ts.map +1 -1
- package/dist/utilities/mergeRefs.js +1 -33
- package/dist/utilities/mergeRefs.js.map +1 -1
- package/dist/utilities/renderIcon.d.ts +3 -17
- package/dist/utilities/renderIcon.d.ts.map +1 -1
- package/dist/utilities/renderIcon.js +6 -31
- package/dist/utilities/renderIcon.js.map +1 -1
- package/dist/utilities/rootProps.d.ts +1 -19
- package/dist/utilities/rootProps.d.ts.map +1 -1
- package/dist/utilities/rootProps.js +1 -18
- package/dist/utilities/rootProps.js.map +1 -1
- package/package.json +13 -5
- package/dist/platform/arrow.d.ts +0 -5
- package/dist/platform/arrow.d.ts.map +0 -1
- package/dist/platform/arrow.js +0 -49
- package/dist/platform/arrow.js.map +0 -1
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-28T03:39:23.780Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-react
|
|
@@ -78,7 +78,7 @@ function ConfirmDelete({ onConfirm }: { onConfirm: () => void }) {
|
|
|
78
78
|
## Installation
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
npm install @molecule/app-ui-react @molecule/app-filesystem @molecule/app-i18n @molecule/app-icons @molecule/app-inline-style-dom @molecule/app-overlay-dom @molecule/app-pointer-events-dom @molecule/app-react @molecule/app-ui react react-dom
|
|
81
|
+
npm install @molecule/app-ui-react @molecule/app-filesystem @molecule/app-i18n @molecule/app-icons @molecule/app-inline-style-dom @molecule/app-overlay-dom @molecule/app-pointer-events-dom @molecule/app-react @molecule/app-react-ui-kit-components @molecule/app-ui react react-dom
|
|
82
82
|
npm install -D @types/react @types/react-dom
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -2962,46 +2962,6 @@ function cn(...inputs: (string | undefined | null | false)[]): string
|
|
|
2962
2962
|
|
|
2963
2963
|
### Constants
|
|
2964
2964
|
|
|
2965
|
-
#### `Accordion`
|
|
2966
|
-
|
|
2967
|
-
Accordion component.
|
|
2968
|
-
|
|
2969
|
-
```typescript
|
|
2970
|
-
const Accordion: React.ForwardRefExoticComponent<
|
|
2971
|
-
AccordionProps<string> & React.RefAttributes<HTMLDivElement>
|
|
2972
|
-
>
|
|
2973
|
-
```
|
|
2974
|
-
|
|
2975
|
-
#### `Alert`
|
|
2976
|
-
|
|
2977
|
-
Alert component.
|
|
2978
|
-
|
|
2979
|
-
`role="alert"` is assertive: it interrupts a screen reader immediately,
|
|
2980
|
-
which is correct ONLY for content that appears dynamically (a validation
|
|
2981
|
-
error after submit, a save failure). An Alert rendered statically with
|
|
2982
|
-
the rest of the page (an informational banner already in the initial
|
|
2983
|
-
render) has nothing to interrupt — announcing it assertively on mount is
|
|
2984
|
-
the same over-announcing trap the Toast role fix addresses. `live`
|
|
2985
|
-
(default `true`, matching the previous unconditional behavior so no
|
|
2986
|
-
existing dynamic-error usage silently goes quiet) makes this honest and
|
|
2987
|
-
caller-controlled: pass `live={false}` for a banner that is part of the
|
|
2988
|
-
page's normal content, and it announces politely (`role="status"`)
|
|
2989
|
-
instead of interrupting.
|
|
2990
|
-
|
|
2991
|
-
```typescript
|
|
2992
|
-
const Alert: React.ForwardRefExoticComponent<
|
|
2993
|
-
AlertProps & { live?: boolean } & React.RefAttributes<HTMLDivElement>
|
|
2994
|
-
>
|
|
2995
|
-
```
|
|
2996
|
-
|
|
2997
|
-
#### `Avatar`
|
|
2998
|
-
|
|
2999
|
-
Avatar component.
|
|
3000
|
-
|
|
3001
|
-
```typescript
|
|
3002
|
-
const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>
|
|
3003
|
-
```
|
|
3004
|
-
|
|
3005
2965
|
#### `Badge`
|
|
3006
2966
|
|
|
3007
2967
|
Badge component.
|
|
@@ -3084,16 +3044,6 @@ const CardFooter: React.ForwardRefExoticComponent<
|
|
|
3084
3044
|
>
|
|
3085
3045
|
```
|
|
3086
3046
|
|
|
3087
|
-
#### `Checkbox`
|
|
3088
|
-
|
|
3089
|
-
Checkbox component.
|
|
3090
|
-
|
|
3091
|
-
```typescript
|
|
3092
|
-
const Checkbox: React.ForwardRefExoticComponent<
|
|
3093
|
-
CheckboxProps & React.RefAttributes<HTMLInputElement>
|
|
3094
|
-
>
|
|
3095
|
-
```
|
|
3096
|
-
|
|
3097
3047
|
#### `ConfirmButton`
|
|
3098
3048
|
|
|
3099
3049
|
Confirms a destructive action and forwards its host handle.
|
|
@@ -3302,16 +3252,6 @@ const PageShell: React.ForwardRefExoticComponent<
|
|
|
3302
3252
|
>
|
|
3303
3253
|
```
|
|
3304
3254
|
|
|
3305
|
-
#### `Pagination`
|
|
3306
|
-
|
|
3307
|
-
Pagination component.
|
|
3308
|
-
|
|
3309
|
-
```typescript
|
|
3310
|
-
const Pagination: React.ForwardRefExoticComponent<
|
|
3311
|
-
PaginationProps & React.RefAttributes<HTMLElement>
|
|
3312
|
-
>
|
|
3313
|
-
```
|
|
3314
|
-
|
|
3315
3255
|
#### `Progress`
|
|
3316
3256
|
|
|
3317
3257
|
Progress component.
|
|
@@ -3320,16 +3260,6 @@ Progress component.
|
|
|
3320
3260
|
const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>
|
|
3321
3261
|
```
|
|
3322
3262
|
|
|
3323
|
-
#### `RadioGroup`
|
|
3324
|
-
|
|
3325
|
-
RadioGroup component.
|
|
3326
|
-
|
|
3327
|
-
```typescript
|
|
3328
|
-
const RadioGroup: React.ForwardRefExoticComponent<
|
|
3329
|
-
RadioGroupProps<string> & React.RefAttributes<HTMLDivElement>
|
|
3330
|
-
>
|
|
3331
|
-
```
|
|
3332
|
-
|
|
3333
3263
|
#### `ResponsiveAppShell`
|
|
3334
3264
|
|
|
3335
3265
|
The responsive app shell family — see the {@link ResponsiveAppShellBase |
|
|
@@ -3348,14 +3278,6 @@ const ResponsiveAppShell: typeof ResponsiveAppShellBase & {
|
|
|
3348
3278
|
}
|
|
3349
3279
|
```
|
|
3350
3280
|
|
|
3351
|
-
#### `Select`
|
|
3352
|
-
|
|
3353
|
-
Select with an optional label, hint, validation error and grouped choices.
|
|
3354
|
-
|
|
3355
|
-
```typescript
|
|
3356
|
-
const Select: ForwardRefExoticComponent<ReactSelectProps & RefAttributes<HTMLSelectElement>>
|
|
3357
|
-
```
|
|
3358
|
-
|
|
3359
3281
|
#### `Separator`
|
|
3360
3282
|
|
|
3361
3283
|
Separator component.
|
|
@@ -3394,95 +3316,150 @@ const SkeletonCircle: React.ForwardRefExoticComponent<
|
|
|
3394
3316
|
>
|
|
3395
3317
|
```
|
|
3396
3318
|
|
|
3397
|
-
#### `
|
|
3319
|
+
#### `Toast`
|
|
3320
|
+
|
|
3321
|
+
Renders a notification and forwards its renderer's host handle.
|
|
3322
|
+
|
|
3323
|
+
```typescript
|
|
3324
|
+
const Toast: ForwardRefExoticComponent<ToastProps & RefAttributes<ElementHandle>>
|
|
3325
|
+
```
|
|
3326
|
+
|
|
3327
|
+
#### `ToastContainer`
|
|
3328
|
+
|
|
3329
|
+
Positions notifications in a portal and forwards its host handle.
|
|
3330
|
+
|
|
3331
|
+
```typescript
|
|
3332
|
+
const ToastContainer: ForwardRefExoticComponent<ToastContainerProps & RefAttributes<ElementHandle>>
|
|
3333
|
+
```
|
|
3334
|
+
|
|
3335
|
+
#### `useToast`
|
|
3336
|
+
|
|
3337
|
+
Adds and removes notifications using React-renderable content.
|
|
3398
3338
|
|
|
3399
|
-
|
|
3339
|
+
```typescript
|
|
3340
|
+
const useToast: () => ToastContextValue<ToastProps>
|
|
3341
|
+
```
|
|
3400
3342
|
|
|
3401
|
-
|
|
3402
|
-
|
|
3343
|
+
#### `Tooltip`
|
|
3344
|
+
|
|
3345
|
+
Displays supplemental content and forwards the tooltip's host handle while visible.
|
|
3403
3346
|
|
|
3404
3347
|
```typescript
|
|
3405
|
-
const
|
|
3406
|
-
|
|
3348
|
+
const Tooltip: ForwardRefExoticComponent<TooltipProps & RefAttributes<ElementHandle>>
|
|
3349
|
+
```
|
|
3350
|
+
|
|
3351
|
+
#### `FileField`
|
|
3352
|
+
|
|
3353
|
+
Renders a browser chooser with its own target or separately rendered triggers.
|
|
3354
|
+
|
|
3355
|
+
```typescript
|
|
3356
|
+
const FileField: ForwardRefExoticComponent<
|
|
3357
|
+
FileFieldProps<ReactNode> & RefAttributes<FileFieldHandle>
|
|
3407
3358
|
>
|
|
3408
3359
|
```
|
|
3409
3360
|
|
|
3410
|
-
#### `
|
|
3361
|
+
#### `Accordion`
|
|
3411
3362
|
|
|
3412
|
-
|
|
3363
|
+
Accordion with its browser root ref.
|
|
3413
3364
|
|
|
3414
3365
|
```typescript
|
|
3415
|
-
const
|
|
3366
|
+
const Accordion: ForwardRefExoticComponent<AccordionProps & RefAttributes<HTMLDivElement>>
|
|
3416
3367
|
```
|
|
3417
3368
|
|
|
3418
|
-
#### `
|
|
3369
|
+
#### `Alert`
|
|
3419
3370
|
|
|
3420
|
-
|
|
3371
|
+
Alert with its browser root ref.
|
|
3421
3372
|
|
|
3422
3373
|
```typescript
|
|
3423
|
-
const
|
|
3424
|
-
|
|
3374
|
+
const Alert: ForwardRefExoticComponent<
|
|
3375
|
+
AlertProps & { live?: boolean } & RefAttributes<HTMLDivElement>
|
|
3425
3376
|
>
|
|
3426
3377
|
```
|
|
3427
3378
|
|
|
3428
|
-
#### `
|
|
3379
|
+
#### `Avatar`
|
|
3429
3380
|
|
|
3430
|
-
|
|
3381
|
+
Avatar with its browser root ref.
|
|
3431
3382
|
|
|
3432
3383
|
```typescript
|
|
3433
|
-
const
|
|
3384
|
+
const Avatar: ForwardRefExoticComponent<AvatarProps & RefAttributes<HTMLDivElement>>
|
|
3434
3385
|
```
|
|
3435
3386
|
|
|
3436
|
-
#### `
|
|
3387
|
+
#### `Checkbox`
|
|
3437
3388
|
|
|
3438
|
-
|
|
3389
|
+
Checkbox with its browser input ref.
|
|
3439
3390
|
|
|
3440
3391
|
```typescript
|
|
3441
|
-
const
|
|
3392
|
+
const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>
|
|
3442
3393
|
```
|
|
3443
3394
|
|
|
3444
|
-
#### `
|
|
3395
|
+
#### `Pagination`
|
|
3445
3396
|
|
|
3446
|
-
|
|
3397
|
+
Pagination with its navigation element ref.
|
|
3447
3398
|
|
|
3448
3399
|
```typescript
|
|
3449
|
-
const
|
|
3400
|
+
const Pagination: ForwardRefExoticComponent<PaginationProps & RefAttributes<HTMLElement>>
|
|
3450
3401
|
```
|
|
3451
3402
|
|
|
3452
|
-
#### `
|
|
3403
|
+
#### `RadioGroup`
|
|
3453
3404
|
|
|
3454
|
-
|
|
3405
|
+
Radio group with its browser root ref.
|
|
3455
3406
|
|
|
3456
3407
|
```typescript
|
|
3457
|
-
const
|
|
3408
|
+
const RadioGroup: ForwardRefExoticComponent<RadioGroupProps & RefAttributes<HTMLDivElement>>
|
|
3458
3409
|
```
|
|
3459
3410
|
|
|
3460
|
-
#### `
|
|
3411
|
+
#### `Select`
|
|
3461
3412
|
|
|
3462
|
-
|
|
3413
|
+
Select with its browser select element ref.
|
|
3463
3414
|
|
|
3464
3415
|
```typescript
|
|
3465
|
-
const
|
|
3416
|
+
const Select: ForwardRefExoticComponent<ReactSelectProps & RefAttributes<HTMLSelectElement>>
|
|
3466
3417
|
```
|
|
3467
3418
|
|
|
3468
|
-
#### `
|
|
3419
|
+
#### `Spinner`
|
|
3469
3420
|
|
|
3470
|
-
|
|
3421
|
+
Loading indicator with its browser root ref.
|
|
3471
3422
|
|
|
3472
3423
|
```typescript
|
|
3473
|
-
const
|
|
3424
|
+
const Spinner: ForwardRefExoticComponent<
|
|
3425
|
+
SpinnerProps & { 'data-mol-id'?: string } & RefAttributes<HTMLDivElement>
|
|
3426
|
+
>
|
|
3474
3427
|
```
|
|
3475
3428
|
|
|
3476
|
-
#### `
|
|
3429
|
+
#### `Switch`
|
|
3477
3430
|
|
|
3478
|
-
|
|
3431
|
+
Switch with its browser button ref.
|
|
3479
3432
|
|
|
3480
3433
|
```typescript
|
|
3481
|
-
const
|
|
3482
|
-
|
|
3434
|
+
const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLButtonElement>>
|
|
3435
|
+
```
|
|
3436
|
+
|
|
3437
|
+
#### `Table`
|
|
3438
|
+
|
|
3439
|
+
Data table with its browser table element ref.
|
|
3440
|
+
|
|
3441
|
+
```typescript
|
|
3442
|
+
const Table: ForwardRefExoticComponent<
|
|
3443
|
+
TableProps<Record<string, unknown>> & RefAttributes<HTMLTableElement>
|
|
3483
3444
|
>
|
|
3484
3445
|
```
|
|
3485
3446
|
|
|
3447
|
+
#### `Tabs`
|
|
3448
|
+
|
|
3449
|
+
Tabs with their browser root ref.
|
|
3450
|
+
|
|
3451
|
+
```typescript
|
|
3452
|
+
const Tabs: ForwardRefExoticComponent<TabsProps & RefAttributes<HTMLDivElement>>
|
|
3453
|
+
```
|
|
3454
|
+
|
|
3455
|
+
#### `Textarea`
|
|
3456
|
+
|
|
3457
|
+
Textarea with its browser textarea element ref.
|
|
3458
|
+
|
|
3459
|
+
```typescript
|
|
3460
|
+
const Textarea: ForwardRefExoticComponent<TextareaProps & RefAttributes<HTMLTextAreaElement>>
|
|
3461
|
+
```
|
|
3462
|
+
|
|
3486
3463
|
## Injection Notes
|
|
3487
3464
|
|
|
3488
3465
|
### Requirements
|
|
@@ -3492,9 +3469,9 @@ Peer dependencies:
|
|
|
3492
3469
|
- `@molecule/app-filesystem` ^1.1.0
|
|
3493
3470
|
- `@molecule/app-i18n` ^1.3.0
|
|
3494
3471
|
- `@molecule/app-icons` ^1.0.1
|
|
3495
|
-
- `@molecule/app-react` ^4.
|
|
3472
|
+
- `@molecule/app-react` ^4.17.0
|
|
3496
3473
|
- `@molecule/app-ui` ^1.16.0
|
|
3497
|
-
- `@molecule/app-ui-react-native` ^2.
|
|
3474
|
+
- `@molecule/app-ui-react-native` ^2.3.0 _(optional)_
|
|
3498
3475
|
- `react` ^18.0.0 || ^19.0.0
|
|
3499
3476
|
- `react-dom` ^18.0.0 || ^19.0.0
|
|
3500
3477
|
|
|
@@ -3507,6 +3484,7 @@ Peer dependencies:
|
|
|
3507
3484
|
- `@molecule/app-overlay-dom`
|
|
3508
3485
|
- `@molecule/app-pointer-events-dom`
|
|
3509
3486
|
- `@molecule/app-react`
|
|
3487
|
+
- `@molecule/app-react-ui-kit-components`
|
|
3510
3488
|
- `@molecule/app-ui`
|
|
3511
3489
|
- `@molecule/app-ui-react-native` _(optional)_
|
|
3512
3490
|
- `react`
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Accordion component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { AccordionProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Accordion component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Accordion: React.ForwardRefExoticComponent<AccordionProps<string> & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export { Accordion } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/components/Accordion.
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/components/Accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Accordion component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { createContext, forwardRef, useCallback, useContext, useId, useState } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { Box, Pressable } from '@molecule/app-ui-react/elements';
|
|
11
|
-
import { renderIcon } from '../utilities/renderIcon.js';
|
|
12
|
-
const AccordionContext = createContext(null);
|
|
13
|
-
const useAccordionContext = () => {
|
|
14
|
-
const { t } = useTranslation();
|
|
15
|
-
const context = useContext(AccordionContext);
|
|
16
|
-
if (!context) {
|
|
17
|
-
throw new Error(t('react.error.useAccordionOutsideProvider', undefined, {
|
|
18
|
-
defaultValue: 'Accordion components must be used within an Accordion',
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
return context;
|
|
22
|
-
};
|
|
23
|
-
const AccordionItemComponent = ({ item, className, disabled, }) => {
|
|
24
|
-
const { expandedItems, toggleItem } = useAccordionContext();
|
|
25
|
-
const isDisabled = disabled || item.disabled;
|
|
26
|
-
const isExpanded = expandedItems.includes(item.value);
|
|
27
|
-
const contentId = useId();
|
|
28
|
-
const triggerId = useId();
|
|
29
|
-
const cm = getClassMap();
|
|
30
|
-
return (_jsxs(Box, { as: "div", className: cm.cn(cm.accordionItem, className), "data-state": isExpanded ? 'open' : 'closed', children: [_jsxs(Pressable, { as: "button", id: triggerId, type: "button", className: cm.cn(cm.accordion({ variant: 'default' }), cm.accordionTriggerBase), onClick: () => !isDisabled && toggleItem(item.value), "aria-expanded": isExpanded, "aria-controls": contentId, "data-state": isExpanded ? 'open' : 'closed', disabled: isDisabled, children: [item.header, renderIcon('chevron-down', cm.accordionChevron)] }), _jsx(Box, { as: "div", id: contentId, role: "region", "aria-labelledby": triggerId, "data-state": isExpanded ? 'open' : 'closed', className: cm.accordionContent, webStyle: {
|
|
31
|
-
display: isExpanded ? 'block' : 'none',
|
|
32
|
-
}, children: _jsx(Box, { as: "div", className: cm.accordionContentInner, children: item.content }) })] }));
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Accordion component.
|
|
36
|
-
*/
|
|
37
|
-
export const Accordion = forwardRef(({ items, value, defaultValue, onChange, multiple = false, collapsible = true, className, style, testId, automationId, disabled, }, ref) => {
|
|
38
|
-
const cm = getClassMap();
|
|
39
|
-
// Normalize value to array
|
|
40
|
-
const normalizeValue = (v) => {
|
|
41
|
-
if (v === undefined)
|
|
42
|
-
return [];
|
|
43
|
-
return Array.isArray(v) ? v : [v];
|
|
44
|
-
};
|
|
45
|
-
const [internalExpanded, setInternalExpanded] = useState(() => normalizeValue(defaultValue));
|
|
46
|
-
// Use controlled value if provided, otherwise use internal state
|
|
47
|
-
const expandedItems = value !== undefined ? normalizeValue(value) : internalExpanded;
|
|
48
|
-
const toggleItem = useCallback((itemValue) => {
|
|
49
|
-
let newExpanded;
|
|
50
|
-
if (expandedItems.includes(itemValue)) {
|
|
51
|
-
// Collapsing
|
|
52
|
-
if (!collapsible && expandedItems.length === 1) {
|
|
53
|
-
// Can't collapse if not collapsible and it's the only expanded item
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
newExpanded = expandedItems.filter((v) => v !== itemValue);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
// Expanding
|
|
60
|
-
if (multiple) {
|
|
61
|
-
newExpanded = [...expandedItems, itemValue];
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
newExpanded = [itemValue];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (value === undefined) {
|
|
68
|
-
setInternalExpanded(newExpanded);
|
|
69
|
-
}
|
|
70
|
-
// Call onChange with appropriate type
|
|
71
|
-
if (onChange) {
|
|
72
|
-
if (multiple) {
|
|
73
|
-
onChange(newExpanded);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
onChange((newExpanded[0] || ''));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, [expandedItems, multiple, collapsible, value, onChange]);
|
|
80
|
-
return (_jsx(AccordionContext.Provider, { value: { expandedItems, toggleItem, multiple }, children: _jsx(Box, { as: "div", ref: ref, className: cm.cn(cm.accordionRoot, className), webStyle: style, "data-testid": testId, "data-mol-id": automationId, children: items.map((item) => (_jsx(AccordionItemComponent, { item: item, disabled: disabled }, item.value))) }) }));
|
|
81
|
-
});
|
|
82
|
-
Accordion.displayName = 'Accordion';
|
|
1
|
+
export { Accordion } from '#kit';
|
|
83
2
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../src/components/Accordion.
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../src/components/Accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Alert component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { AlertProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Alert component.
|
|
10
|
-
*
|
|
11
|
-
* `role="alert"` is assertive: it interrupts a screen reader immediately,
|
|
12
|
-
* which is correct ONLY for content that appears dynamically (a validation
|
|
13
|
-
* error after submit, a save failure). An Alert rendered statically with
|
|
14
|
-
* the rest of the page (an informational banner already in the initial
|
|
15
|
-
* render) has nothing to interrupt — announcing it assertively on mount is
|
|
16
|
-
* the same over-announcing trap the Toast role fix addresses. `live`
|
|
17
|
-
* (default `true`, matching the previous unconditional behavior so no
|
|
18
|
-
* existing dynamic-error usage silently goes quiet) makes this honest and
|
|
19
|
-
* caller-controlled: pass `live={false}` for a banner that is part of the
|
|
20
|
-
* page's normal content, and it announces politely (`role="status"`)
|
|
21
|
-
* instead of interrupting.
|
|
22
|
-
*/
|
|
23
|
-
export declare const Alert: React.ForwardRefExoticComponent<AlertProps & {
|
|
24
|
-
live?: boolean;
|
|
25
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export { Alert } from '#kit';
|
|
26
2
|
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/components/Alert.
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/components/Alert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA"}
|
package/dist/components/Alert.js
CHANGED
|
@@ -1,61 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Alert component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { slot } from '@molecule/app-react/render';
|
|
10
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
11
|
-
import { Box, Pressable, Text } from '@molecule/app-ui-react/elements';
|
|
12
|
-
import { renderIcon } from '../utilities/renderIcon.js';
|
|
13
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
14
|
-
const statusVariantMap = {
|
|
15
|
-
primary: 'default',
|
|
16
|
-
secondary: 'default',
|
|
17
|
-
success: 'success',
|
|
18
|
-
warning: 'warning',
|
|
19
|
-
error: 'error',
|
|
20
|
-
info: 'info',
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Map alert status to icon name.
|
|
24
|
-
*/
|
|
25
|
-
const statusIconMap = {
|
|
26
|
-
info: 'info-circle',
|
|
27
|
-
success: 'check-circle',
|
|
28
|
-
warning: 'exclamation-triangle',
|
|
29
|
-
error: 'x-circle',
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Alert component.
|
|
33
|
-
*
|
|
34
|
-
* `role="alert"` is assertive: it interrupts a screen reader immediately,
|
|
35
|
-
* which is correct ONLY for content that appears dynamically (a validation
|
|
36
|
-
* error after submit, a save failure). An Alert rendered statically with
|
|
37
|
-
* the rest of the page (an informational banner already in the initial
|
|
38
|
-
* render) has nothing to interrupt — announcing it assertively on mount is
|
|
39
|
-
* the same over-announcing trap the Toast role fix addresses. `live`
|
|
40
|
-
* (default `true`, matching the previous unconditional behavior so no
|
|
41
|
-
* existing dynamic-error usage silently goes quiet) makes this honest and
|
|
42
|
-
* caller-controlled: pass `live={false}` for a banner that is part of the
|
|
43
|
-
* page's normal content, and it announces politely (`role="status"`)
|
|
44
|
-
* instead of interrupting.
|
|
45
|
-
*/
|
|
46
|
-
export const Alert = forwardRef(({ children, title, status = 'info', variant, live = true, dismissible, onDismiss, icon: iconProp, dismissLabel, className, style, testId, ...rest }, ref) => {
|
|
47
|
-
const icon = slot(iconProp);
|
|
48
|
-
const { t } = useTranslation();
|
|
49
|
-
const cm = getClassMap();
|
|
50
|
-
const alertVariant = statusVariantMap[status] || 'default';
|
|
51
|
-
const iconName = statusIconMap[alertVariant];
|
|
52
|
-
const defaultIcon = iconName ? renderIcon(iconName, cm.iconMd) : null;
|
|
53
|
-
const alertClasses = cm.cn(cm.alert({ variant: alertVariant }),
|
|
54
|
-
// The core contract types variant="left-accent"; render it as a 4px
|
|
55
|
-
// status-colored leading bar (previously silently dropped).
|
|
56
|
-
variant === 'left-accent' && cm.alertLeftAccent({ variant: alertVariant }), className);
|
|
57
|
-
const role = live ? 'alert' : 'status';
|
|
58
|
-
return (_jsxs(Box, { as: "div", ref: ref, role: role, className: alertClasses, webStyle: style, "data-testid": testId, ...rootProps(rest), children: [(icon || defaultIcon) && (_jsx(Box, { as: "span", className: cm.alertIconWrapper, children: (icon || defaultIcon) })), _jsxs(Box, { as: "div", className: cm.alertContent, children: [title && (_jsx(Text, { as: "h5", className: cm.alertTitle, children: title })), _jsx(Box, { as: "div", className: cm.alertDescription, children: children })] }), dismissible && (_jsx(Pressable, { as: "button", type: "button", onClick: onDismiss, className: cm.alertDismiss, "aria-label": dismissLabel ?? t('ui.alert.dismiss', undefined, { defaultValue: 'Dismiss' }), children: renderIcon('x-mark', cm.iconSm) }))] }));
|
|
59
|
-
});
|
|
60
|
-
Alert.displayName = 'Alert';
|
|
1
|
+
export { Alert } from '#kit';
|
|
61
2
|
//# sourceMappingURL=Alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/components/Alert.
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/components/Alert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Avatar component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { AvatarProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Avatar component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
export { Avatar } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/components/Avatar.
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/components/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Avatar component.
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { forwardRef, useState } from 'react';
|
|
8
|
-
import { useTranslation } from '@molecule/app-react';
|
|
9
|
-
import { slot } from '@molecule/app-react/render';
|
|
10
|
-
import { getClassMap } from '@molecule/app-ui';
|
|
11
|
-
import { Box, Image, Text } from '@molecule/app-ui-react/elements';
|
|
12
|
-
import { getInitials } from '../utilities/initials.js';
|
|
13
|
-
import { renderIcon } from '../utilities/renderIcon.js';
|
|
14
|
-
import { rootProps } from '../utilities/rootProps.js';
|
|
15
|
-
/**
|
|
16
|
-
* Avatar component.
|
|
17
|
-
*/
|
|
18
|
-
export const Avatar = forwardRef(({ src, alt, name, size = 'md', rounded = true, fallback: fallbackProp, className, style, testId, ...rest }, ref) => {
|
|
19
|
-
const fallback = slot(fallbackProp);
|
|
20
|
-
const [imageError, setImageError] = useState(false);
|
|
21
|
-
const { t } = useTranslation();
|
|
22
|
-
const cm = getClassMap();
|
|
23
|
-
const avatarSize = typeof size === 'number' ? undefined : size;
|
|
24
|
-
const containerClasses = cm.cn(cm.avatar({ size: avatarSize }), !rounded && cm.avatarSquare, className);
|
|
25
|
-
const customSize = typeof size === 'number' ? { width: size, height: size } : undefined;
|
|
26
|
-
return (_jsx(Box, { as: "div", ref: ref, className: containerClasses, webStyle: { ...style, ...customSize }, "data-testid": testId, ...rootProps(rest), children: src && !imageError ? (_jsx(Image, { src: src, alt: alt || name || t('ui.avatar.alt', undefined, { defaultValue: 'Avatar' }), className: cm.avatarImage, onError: () => setImageError(true) })) : (_jsx(Box, { as: "div", className: cm.avatarFallback, children: fallback ? (fallback) : name ? (_jsx(Text, { as: "span", className: cm.avatarInitials, children: getInitials(name) })) : (renderIcon('user', cm.avatarFallbackIcon)) })) }));
|
|
27
|
-
});
|
|
28
|
-
Avatar.displayName = 'Avatar';
|
|
1
|
+
export { Avatar } from '#kit';
|
|
29
2
|
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../src/components/Avatar.
|
|
1
|
+
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../src/components/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Checkbox component.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { CheckboxProps } from '@molecule/app-ui';
|
|
8
|
-
/**
|
|
9
|
-
* Checkbox component.
|
|
10
|
-
*/
|
|
11
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
1
|
+
export { Checkbox } from '#kit';
|
|
12
2
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA"}
|