@adam-milo/ui 1.0.35 → 1.0.40
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 +217 -337
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -108
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +4 -103
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +4 -230
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +9 -325
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +11 -279
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +2 -150
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +5 -65
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -71
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +4 -125
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -93
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +4 -42
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -482
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +5 -169
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +11 -44
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -38
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +2 -46
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -118
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +7 -55
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +2 -45
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +2 -53
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +2 -55
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -45
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +2 -72
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +10 -14
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -332
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +1 -0
- package/dist/index34.cjs +1 -0
- package/dist/index34.js +1 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +1 -0
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -386
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +15 -16
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +1 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +1 -0
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +3 -70
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +1 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +1 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +1 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +1 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +1 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +1 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +1 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +1 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +1 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +1 -0
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +2 -45
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +1 -9
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +1 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +1 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +1 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +1 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +1 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +1 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +1 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +1 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +1 -0
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -22
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +1 -0
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -21
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +1 -502
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +5 -0
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +1 -11
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +1 -39
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +1 -64
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +2 -212
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +1 -14
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +1 -293
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -61
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +4 -18
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +1 -129
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +1 -43
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -99
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +3 -71
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +1 -36
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +1 -14
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +1 -17
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +1 -6
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -297
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +2 -112
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -25
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +2 -39
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +1 -625
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +1 -721
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +1 -154
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +1 -173
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +1 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -112
- package/dist/src/components/core/button/Button.component.d.ts +2 -35
- package/dist/src/components/core/button/Button.component.d.ts.map +1 -1
- package/dist/src/components/core/button/Button.styles.d.ts +5 -0
- package/dist/src/components/core/button/Button.styles.d.ts.map +1 -0
- package/dist/src/components/core/button/Button.types.d.ts +11 -0
- package/dist/src/components/core/button/Button.types.d.ts.map +1 -0
- package/dist/src/components/core/icon-button/IconButton.component.d.ts +2 -33
- package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -1
- package/dist/src/components/core/icon-button/IconButton.styles.d.ts +3 -0
- package/dist/src/components/core/icon-button/IconButton.styles.d.ts.map +1 -0
- package/dist/src/components/core/icon-button/IconButton.types.d.ts +12 -0
- package/dist/src/components/core/icon-button/IconButton.types.d.ts.map +1 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts +2 -76
- package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts.map +1 -1
- package/dist/src/components/core/menu-icon-button/MenuIconButton.styles.d.ts +9 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.styles.d.ts.map +1 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.types.d.ts +11 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.types.d.ts.map +1 -0
- package/dist/src/components/data-display/card/Card.component.d.ts +2 -34
- package/dist/src/components/data-display/card/Card.component.d.ts.map +1 -1
- package/dist/src/components/data-display/card/Card.styles.d.ts +12 -0
- package/dist/src/components/data-display/card/Card.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/card/Card.types.d.ts +28 -0
- package/dist/src/components/data-display/card/Card.types.d.ts.map +1 -0
- package/dist/src/components/data-display/chip/Chip.component.d.ts +2 -33
- package/dist/src/components/data-display/chip/Chip.component.d.ts.map +1 -1
- package/dist/src/components/data-display/chip/Chip.styles.d.ts +24 -0
- package/dist/src/components/data-display/chip/Chip.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/chip/Chip.types.d.ts +11 -0
- package/dist/src/components/data-display/chip/Chip.types.d.ts.map +1 -0
- package/dist/src/components/data-display/chip-group/ChipGroup.component.d.ts +2 -69
- package/dist/src/components/data-display/chip-group/ChipGroup.component.d.ts.map +1 -1
- package/dist/src/components/data-display/chip-group/ChipGroup.styles.d.ts +14 -0
- package/dist/src/components/data-display/chip-group/ChipGroup.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/chip-group/ChipGroup.types.d.ts +21 -0
- package/dist/src/components/data-display/chip-group/ChipGroup.types.d.ts.map +1 -0
- package/dist/src/components/data-display/datatable/DataTable.component.d.ts +2 -22
- package/dist/src/components/data-display/datatable/DataTable.component.d.ts.map +1 -1
- package/dist/src/components/data-display/datatable/DataTable.styles.d.ts +10 -0
- package/dist/src/components/data-display/datatable/DataTable.styles.d.ts.map +1 -0
- package/dist/src/components/data-display/datatable/DataTable.types.d.ts +16 -0
- package/dist/src/components/data-display/datatable/DataTable.types.d.ts.map +1 -0
- package/dist/src/components/feedback/alert/Alert.component.d.ts +2 -16
- package/dist/src/components/feedback/alert/Alert.component.d.ts.map +1 -1
- package/dist/src/components/feedback/alert/Alert.styles.d.ts +10 -0
- package/dist/src/components/feedback/alert/Alert.styles.d.ts.map +1 -0
- package/dist/src/components/feedback/alert/Alert.types.d.ts +10 -0
- package/dist/src/components/feedback/alert/Alert.types.d.ts.map +1 -0
- package/dist/src/components/feedback/spinner/Spinner.component.d.ts +2 -59
- package/dist/src/components/feedback/spinner/Spinner.component.d.ts.map +1 -1
- package/dist/src/components/feedback/spinner/Spinner.styles.d.ts +7 -0
- package/dist/src/components/feedback/spinner/Spinner.styles.d.ts.map +1 -0
- package/dist/src/components/feedback/spinner/Spinner.types.d.ts +14 -0
- package/dist/src/components/feedback/spinner/Spinner.types.d.ts.map +1 -0
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts +2 -44
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.types.d.ts +10 -0
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.types.d.ts.map +1 -0
- package/dist/src/components/forms/checkbox/Checkbox.component.d.ts +2 -99
- package/dist/src/components/forms/checkbox/Checkbox.component.d.ts.map +1 -1
- package/dist/src/components/forms/checkbox/Checkbox.styles.d.ts +10 -0
- package/dist/src/components/forms/checkbox/Checkbox.styles.d.ts.map +1 -0
- package/dist/src/components/forms/checkbox/Checkbox.types.d.ts +17 -0
- package/dist/src/components/forms/checkbox/Checkbox.types.d.ts.map +1 -0
- package/dist/src/components/forms/email-input/EmailInput.component.d.ts +2 -28
- package/dist/src/components/forms/email-input/EmailInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/email-input/EmailInput.types.d.ts +7 -0
- package/dist/src/components/forms/email-input/EmailInput.types.d.ts.map +1 -0
- package/dist/src/components/forms/input/Input.component.d.ts +2 -107
- package/dist/src/components/forms/input/Input.component.d.ts.map +1 -1
- package/dist/src/components/forms/input/Input.styles.d.ts +13 -0
- package/dist/src/components/forms/input/Input.styles.d.ts.map +1 -0
- package/dist/src/components/forms/input/Input.types.d.ts +17 -0
- package/dist/src/components/forms/input/Input.types.d.ts.map +1 -0
- package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts +2 -41
- package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/numeric-input/NumericInput.types.d.ts +9 -0
- package/dist/src/components/forms/numeric-input/NumericInput.types.d.ts.map +1 -0
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts +2 -79
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/otp-input/OTPInput.styles.d.ts +12 -0
- package/dist/src/components/forms/otp-input/OTPInput.styles.d.ts.map +1 -0
- package/dist/src/components/forms/otp-input/OTPInput.types.d.ts +23 -0
- package/dist/src/components/forms/otp-input/OTPInput.types.d.ts.map +1 -0
- package/dist/src/components/forms/password-input/PasswordInput.component.d.ts +2 -25
- package/dist/src/components/forms/password-input/PasswordInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/password-input/PasswordInput.types.d.ts +6 -0
- package/dist/src/components/forms/password-input/PasswordInput.types.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts +2 -91
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.styles.d.ts +22 -0
- package/dist/src/components/forms/phone-input/PhoneInput.styles.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/PhoneInput.types.d.ts +19 -0
- package/dist/src/components/forms/phone-input/PhoneInput.types.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/countries.d.ts +3 -79
- package/dist/src/components/forms/phone-input/countries.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/countries.types.d.ts +12 -0
- package/dist/src/components/forms/phone-input/countries.types.d.ts.map +1 -0
- package/dist/src/components/forms/radio/Radio.component.d.ts +2 -97
- package/dist/src/components/forms/radio/Radio.component.d.ts.map +1 -1
- package/dist/src/components/forms/radio/Radio.styles.d.ts +10 -0
- package/dist/src/components/forms/radio/Radio.styles.d.ts.map +1 -0
- package/dist/src/components/forms/radio/Radio.types.d.ts +16 -0
- package/dist/src/components/forms/radio/Radio.types.d.ts.map +1 -0
- package/dist/src/components/forms/select/Select.component.d.ts +2 -94
- package/dist/src/components/forms/select/Select.component.d.ts.map +1 -1
- package/dist/src/components/forms/select/Select.styles.d.ts +18 -0
- package/dist/src/components/forms/select/Select.styles.d.ts.map +1 -0
- package/dist/src/components/forms/select/Select.types.d.ts +34 -0
- package/dist/src/components/forms/select/Select.types.d.ts.map +1 -0
- package/dist/src/components/forms/toggle/Toggle.component.d.ts +2 -77
- package/dist/src/components/forms/toggle/Toggle.component.d.ts.map +1 -1
- package/dist/src/components/forms/toggle/Toggle.styles.d.ts +23 -0
- package/dist/src/components/forms/toggle/Toggle.styles.d.ts.map +1 -0
- package/dist/src/components/forms/toggle/Toggle.types.d.ts +14 -0
- package/dist/src/components/forms/toggle/Toggle.types.d.ts.map +1 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts +2 -83
- package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts.map +1 -1
- package/dist/src/components/layout/auth-layout/AuthLayout.styles.d.ts +11 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.styles.d.ts.map +1 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.types.d.ts +16 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.types.d.ts.map +1 -0
- package/dist/src/components/layout/container/Container.component.d.ts +2 -23
- package/dist/src/components/layout/container/Container.component.d.ts.map +1 -1
- package/dist/src/components/layout/container/Container.styles.d.ts +15 -0
- package/dist/src/components/layout/container/Container.styles.d.ts.map +1 -0
- package/dist/src/components/layout/container/Container.types.d.ts +9 -0
- package/dist/src/components/layout/container/Container.types.d.ts.map +1 -0
- package/dist/src/components/layout/divider/Divider.component.d.ts +2 -36
- package/dist/src/components/layout/divider/Divider.component.d.ts.map +1 -1
- package/dist/src/components/layout/divider/Divider.styles.d.ts +4 -0
- package/dist/src/components/layout/divider/Divider.styles.d.ts.map +1 -0
- package/dist/src/components/layout/divider/Divider.types.d.ts +11 -0
- package/dist/src/components/layout/divider/Divider.types.d.ts.map +1 -0
- package/dist/src/components/layout/grid/Grid.component.d.ts +2 -50
- package/dist/src/components/layout/grid/Grid.component.d.ts.map +1 -1
- package/dist/src/components/layout/grid/Grid.styles.d.ts +79 -0
- package/dist/src/components/layout/grid/Grid.styles.d.ts.map +1 -0
- package/dist/src/components/layout/grid/Grid.types.d.ts +15 -0
- package/dist/src/components/layout/grid/Grid.types.d.ts.map +1 -0
- package/dist/src/components/layout/stack/Stack.component.d.ts +2 -18
- package/dist/src/components/layout/stack/Stack.component.d.ts.map +1 -1
- package/dist/src/components/layout/stack/Stack.styles.d.ts +5 -0
- package/dist/src/components/layout/stack/Stack.styles.d.ts.map +1 -0
- package/dist/src/components/layout/stack/Stack.types.d.ts +12 -0
- package/dist/src/components/layout/stack/Stack.types.d.ts.map +1 -0
- package/dist/src/components/navigation/tabs/Tabs.component.d.ts +2 -38
- package/dist/src/components/navigation/tabs/Tabs.component.d.ts.map +1 -1
- package/dist/src/components/navigation/tabs/Tabs.styles.d.ts +4 -0
- package/dist/src/components/navigation/tabs/Tabs.styles.d.ts.map +1 -0
- package/dist/src/components/navigation/tabs/Tabs.types.d.ts +17 -0
- package/dist/src/components/navigation/tabs/Tabs.types.d.ts.map +1 -0
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts +2 -55
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
- package/dist/src/components/overlays/dialog/Dialog.styles.d.ts +20 -0
- package/dist/src/components/overlays/dialog/Dialog.styles.d.ts.map +1 -0
- package/dist/src/components/overlays/dialog/Dialog.types.d.ts +41 -0
- package/dist/src/components/overlays/dialog/Dialog.types.d.ts.map +1 -0
- package/dist/src/components/typography/heading/Heading.component.d.ts +2 -89
- package/dist/src/components/typography/heading/Heading.component.d.ts.map +1 -1
- package/dist/src/components/typography/heading/Heading.styles.d.ts +9 -0
- package/dist/src/components/typography/heading/Heading.styles.d.ts.map +1 -0
- package/dist/src/components/typography/heading/Heading.types.d.ts +19 -0
- package/dist/src/components/typography/heading/Heading.types.d.ts.map +1 -0
- package/dist/src/components/typography/link/Link.component.d.ts +2 -77
- package/dist/src/components/typography/link/Link.component.d.ts.map +1 -1
- package/dist/src/components/typography/link/Link.styles.d.ts +9 -0
- package/dist/src/components/typography/link/Link.styles.d.ts.map +1 -0
- package/dist/src/components/typography/link/Link.types.d.ts +17 -0
- package/dist/src/components/typography/link/Link.types.d.ts.map +1 -0
- package/dist/src/components/typography/text/Text.component.d.ts +4 -91
- package/dist/src/components/typography/text/Text.component.d.ts.map +1 -1
- package/dist/src/components/typography/text/Text.styles.d.ts +8 -0
- package/dist/src/components/typography/text/Text.styles.d.ts.map +1 -0
- package/dist/src/components/typography/text/Text.types.d.ts +20 -0
- package/dist/src/components/typography/text/Text.types.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +8 -13
- package/dist/index2.cjs +0 -1
- package/dist/index2.js +0 -40
- package/dist/style.css +0 -1
package/dist/index7.js
CHANGED
|
@@ -1,61 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { forwardRef, useCallback } from "react";
|
|
3
|
-
import { Input } from "./index36.js";
|
|
4
|
-
const NumericInput = forwardRef(
|
|
5
|
-
({
|
|
6
|
-
min,
|
|
7
|
-
max,
|
|
8
|
-
step = 1,
|
|
9
|
-
allowDecimals = false,
|
|
10
|
-
validate,
|
|
11
|
-
"data-cy": dataCy,
|
|
12
|
-
"data-testid": dataTestId,
|
|
13
|
-
...props
|
|
14
|
-
}, ref) => {
|
|
15
|
-
const numericValidation = useCallback(
|
|
16
|
-
(value) => {
|
|
17
|
-
if (!value) return void 0;
|
|
18
|
-
const numValue = parseFloat(value);
|
|
19
|
-
if (isNaN(numValue)) {
|
|
20
|
-
return "Please enter a valid number";
|
|
21
|
-
}
|
|
22
|
-
if (!allowDecimals && !Number.isInteger(numValue)) {
|
|
23
|
-
return "Decimals are not allowed";
|
|
24
|
-
}
|
|
25
|
-
if (min !== void 0 && numValue < min) {
|
|
26
|
-
return `Must be at least ${min}`;
|
|
27
|
-
}
|
|
28
|
-
if (max !== void 0 && numValue > max) {
|
|
29
|
-
return `Must be at most ${max}`;
|
|
30
|
-
}
|
|
31
|
-
return void 0;
|
|
32
|
-
},
|
|
33
|
-
[min, max, allowDecimals]
|
|
34
|
-
);
|
|
35
|
-
const combinedValidation = useCallback(
|
|
36
|
-
(value) => {
|
|
37
|
-
if (!validate) return numericValidation(value);
|
|
38
|
-
return numericValidation(value) || validate(value);
|
|
39
|
-
},
|
|
40
|
-
[numericValidation, validate]
|
|
41
|
-
);
|
|
42
|
-
return /* @__PURE__ */ jsx(
|
|
43
|
-
Input,
|
|
44
|
-
{
|
|
45
|
-
ref,
|
|
46
|
-
type: "number",
|
|
47
|
-
min,
|
|
48
|
-
max,
|
|
49
|
-
validate: combinedValidation,
|
|
50
|
-
"data-cy": dataCy || "numeric-input",
|
|
51
|
-
"data-testid": dataTestId || "numeric-input",
|
|
52
|
-
...props,
|
|
53
|
-
step: allowDecimals ? "any" : step
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
NumericInput.displayName = "NumericInput";
|
|
59
|
-
export {
|
|
60
|
-
NumericInput
|
|
61
|
-
};
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{forwardRef as s}from"react";import{Input as a}from"./index37.js";const o=s(({showToggle:s=!0,"data-cy":o,"data-testid":r,...d},e)=>/* @__PURE__ */t(a,{ref:e,type:"password",showPasswordToggle:s,"data-cy":o||"password-input","data-testid":r||"password-input",...d}));o.displayName="PasswordInput";export{o as PasswordInput};
|
package/dist/index70.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index80.cjs"),t=require("./index81.cjs"),o=require("./index66.cjs"),i=require("./index67.cjs"),n=require("./index73.cjs"),a=require("./index77.cjs"),s=require("./index79.cjs"),p=require("./index82.cjs"),l=require("react/jsx-runtime"),d=require("./index83.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const f=c(e);var u="Popper",[h,x]=i.createContextScope(u),[g,m]=h(u),y=e=>{const{__scopePopper:r,children:t}=e,[o,i]=f.useState(null);return l.jsx(g,{scope:r,anchor:o,onAnchorChange:i,children:t})};y.displayName=u;var w="PopperAnchor",P=f.forwardRef((e,r)=>{const{__scopePopper:t,virtualRef:i,...a}=e,s=m(w,t),p=f.useRef(null),d=o.useComposedRefs(r,p),c=f.useRef(null);return f.useEffect(()=>{const e=c.current;c.current=i?.current||p.current,e!==c.current&&s.onAnchorChange(c.current)}),i?null:l.jsx(n.Primitive.div,{...a,ref:d})});P.displayName=w;var b="PopperContent",[v,j]=h(b),S=f.forwardRef((e,t)=>{const{__scopePopper:i,side:c="bottom",sideOffset:u=0,align:h="center",alignOffset:x=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:w=[],collisionPadding:P=0,sticky:j="partial",hideWhenDetached:S=!1,updatePositionStrategy:A="optimized",onPlaced:O,...C}=e,_=m(b,i),[H,z]=f.useState(null),E=o.useComposedRefs(t,e=>z(e)),[W,Y]=f.useState(null),D=p.useSize(W),N=D?.width??0,X=D?.height??0,k=c+("center"!==h?"-"+h:""),F="number"==typeof P?P:{top:0,right:0,bottom:0,left:0,...P},M=Array.isArray(w)?w:[w],B=M.length>0,I={padding:F,boundary:M.filter(q),altBoundary:B},{refs:L,floatingStyles:T,placement:U,isPositioned:G,middlewareData:J}=r.useFloating({strategy:"fixed",placement:k,whileElementsMounted:(...e)=>d.autoUpdate(...e,{animationFrame:"always"===A}),elements:{reference:_.anchor},middleware:[r.offset({mainAxis:u+X,alignmentAxis:x}),y&&r.shift({mainAxis:!0,crossAxis:!1,limiter:"partial"===j?r.limitShift():void 0,...I}),y&&r.flip({...I}),r.size({...I,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),W&&r.arrow({element:W,padding:g}),R({arrowWidth:N,arrowHeight:X}),S&&r.hide({strategy:"referenceHidden",...I})]}),[K,Q]=$(U),V=a.useCallbackRef(O);s.useLayoutEffect(()=>{G&&V?.()},[G,V]);const Z=J.arrow?.x,ee=J.arrow?.y,re=0!==J.arrow?.centerOffset,[te,oe]=f.useState();return s.useLayoutEffect(()=>{H&&oe(window.getComputedStyle(H).zIndex)},[H]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:G?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(v,{scope:i,placedSide:K,onArrowChange:Y,arrowX:Z,arrowY:ee,shouldHideArrow:re,children:l.jsx(n.Primitive.div,{"data-side":K,"data-align":Q,...C,ref:E,style:{...C.style,animation:G?void 0:"none"}})})})});S.displayName=b;var A="PopperArrow",O={top:"bottom",right:"left",bottom:"top",left:"right"},C=f.forwardRef(function(e,r){const{__scopePopper:o,...i}=e,n=j(A,o),a=O[n.placedSide];return l.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:l.jsx(t.Root,{...i,ref:r,style:{...i.style,display:"block"}})})});function q(e){return null!==e}C.displayName=A;var R=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[p,l]=$(t),d={start:"0%",center:"50%",end:"100%"}[l],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let u="",h="";return"bottom"===p?(u=n?d:`${c}px`,h=-s+"px"):"top"===p?(u=n?d:`${c}px`,h=`${o.floating.height+s}px`):"right"===p?(u=-s+"px",h=n?d:`${f}px`):"left"===p&&(u=`${o.floating.width+s}px`,h=n?d:`${f}px`),{data:{x:u,y:h}}}});function $(e){const[r,t="center"]=e.split("-");return[r,t]}var _=y,H=P,z=S,E=C;exports.Anchor=H,exports.Arrow=E,exports.Content=z,exports.Popper=y,exports.PopperAnchor=P,exports.PopperArrow=C,exports.PopperContent=S,exports.Root=_,exports.createPopperScope=x;
|
package/dist/index70.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
var PORTAL_NAME = "Portal";
|
|
7
|
-
var Portal = React.forwardRef((props, forwardedRef) => {
|
|
8
|
-
var _a;
|
|
9
|
-
const { container: containerProp, ...portalProps } = props;
|
|
10
|
-
const [mounted, setMounted] = React.useState(false);
|
|
11
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
12
|
-
const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
|
|
13
|
-
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
14
|
-
});
|
|
15
|
-
Portal.displayName = PORTAL_NAME;
|
|
16
|
-
export {
|
|
17
|
-
Portal
|
|
18
|
-
};
|
|
1
|
+
import*as e from"react";import{useFloating as r,offset as t,shift as o,flip as i,size as n,arrow as a,hide as s,limitShift as d}from"./index80.js";import{Root as p}from"./index81.js";import{useComposedRefs as l}from"./index66.js";import{createContextScope as c}from"./index67.js";import{Primitive as f}from"./index73.js";import{useCallbackRef as m}from"./index77.js";import{useLayoutEffect as h}from"./index79.js";import{useSize as g}from"./index82.js";import{jsx as u}from"react/jsx-runtime";import{autoUpdate as x}from"./index83.js";var y="Popper",[w,v]=c(y),[b,P]=w(y),A=r=>{const{__scopePopper:t,children:o}=r,[i,n]=e.useState(null);/* @__PURE__ */
|
|
2
|
+
return u(b,{scope:t,anchor:i,onAnchorChange:n,children:o})};A.displayName=y;var j="PopperAnchor",S=e.forwardRef((r,t)=>{const{__scopePopper:o,virtualRef:i,...n}=r,a=P(j,o),s=e.useRef(null),d=l(t,s),p=e.useRef(null);return e.useEffect(()=>{const e=p.current;p.current=i?.current||s.current,e!==p.current&&a.onAnchorChange(p.current)}),i?null:/* @__PURE__ */u(f.div,{...n,ref:d})});S.displayName=j;var $="PopperContent",[O,_]=w($),C=e.forwardRef((p,c)=>{const{__scopePopper:y,side:w="bottom",sideOffset:v=0,align:b="center",alignOffset:A=0,arrowPadding:j=0,avoidCollisions:S=!0,collisionBoundary:_=[],collisionPadding:C=0,sticky:H="partial",hideWhenDetached:R=!1,updatePositionStrategy:W="optimized",onPlaced:X,...z}=p,D=P($,y),[k,B]=e.useState(null),F=l(c,e=>B(e)),[I,L]=e.useState(null),M=g(I),q=M?.width??0,G=M?.height??0,J=w+("center"!==b?"-"+b:""),K="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},Q=Array.isArray(_)?_:[_],T=Q.length>0,U={padding:K,boundary:Q.filter(Y),altBoundary:T},{refs:V,floatingStyles:Z,placement:ee,isPositioned:re,middlewareData:te}=r({strategy:"fixed",placement:J,whileElementsMounted:(...e)=>x(...e,{animationFrame:"always"===W}),elements:{reference:D.anchor},middleware:[t({mainAxis:v+G,alignmentAxis:A}),S&&o({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?d():void 0,...U}),S&&i({...U}),n({...U,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),I&&a({element:I,padding:j}),E({arrowWidth:q,arrowHeight:G}),R&&s({strategy:"referenceHidden",...U})]}),[oe,ie]=N(ee),ne=m(X);h(()=>{re&&ne?.()},[re,ne]);const ae=te.arrow?.x,se=te.arrow?.y,de=0!==te.arrow?.centerOffset,[pe,le]=e.useState();return h(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),/* @__PURE__ */u("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:p.dir,children:/* @__PURE__ */u(O,{scope:y,placedSide:oe,onArrowChange:L,arrowX:ae,arrowY:se,shouldHideArrow:de,children:/* @__PURE__ */u(f.div,{"data-side":oe,"data-align":ie,...z,ref:F,style:{...z.style,animation:re?void 0:"none"}})})})});C.displayName=$;var H="PopperArrow",R={top:"bottom",right:"left",bottom:"top",left:"right"},W=e.forwardRef(function(e,r){const{__scopePopper:t,...o}=e,i=_(H,t),n=R[i.placedSide];
|
|
3
|
+
/* @__PURE__ */
|
|
4
|
+
return u("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */u(p,{...o,ref:r,style:{...o.style,display:"block"}})})});function Y(e){return null!==e}W.displayName=H;var E=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[d,p]=N(t),l={start:"0%",center:"50%",end:"100%"}[p],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let m="",h="";return"bottom"===d?(m=n?l:`${c}px`,h=-s+"px"):"top"===d?(m=n?l:`${c}px`,h=`${o.floating.height+s}px`):"right"===d?(m=-s+"px",h=n?l:`${f}px`):"left"===d&&(m=`${o.floating.width+s}px`,h=n?l:`${f}px`),{data:{x:m,y:h}}}});function N(e){const[r,t="center"]=e.split("-");return[r,t]}var X=A,z=S,D=C,k=W;export{z as Anchor,k as Arrow,D as Content,A as Popper,S as PopperAnchor,W as PopperArrow,C as PopperContent,X as Root,v as createPopperScope};
|
package/dist/index71.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index73.cjs"),o=require("./index79.cjs"),n=require("react/jsx-runtime");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const i=c(e);var a=i.forwardRef((e,c)=>{const{container:a,...u}=e,[s,l]=i.useState(!1);o.useLayoutEffect(()=>l(!0),[]);const d=a||s&&globalThis?.document?.body;return d?t.createPortal(n.jsx(r.Primitive.div,{...u,ref:c}),d):null});a.displayName="Portal",exports.Portal=a;
|
package/dist/index71.js
CHANGED
|
@@ -1,129 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useComposedRefs } from "./index65.js";
|
|
3
|
-
import { useLayoutEffect as useLayoutEffect2 } from "./index78.js";
|
|
4
|
-
function useStateMachine(initialState, machine) {
|
|
5
|
-
return React.useReducer((state, event) => {
|
|
6
|
-
const nextState = machine[state][event];
|
|
7
|
-
return nextState ?? state;
|
|
8
|
-
}, initialState);
|
|
9
|
-
}
|
|
10
|
-
var Presence = (props) => {
|
|
11
|
-
const { present, children } = props;
|
|
12
|
-
const presence = usePresence(present);
|
|
13
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
|
|
14
|
-
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
15
|
-
const forceMount = typeof children === "function";
|
|
16
|
-
return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
|
|
17
|
-
};
|
|
18
|
-
Presence.displayName = "Presence";
|
|
19
|
-
function usePresence(present) {
|
|
20
|
-
const [node, setNode] = React.useState();
|
|
21
|
-
const stylesRef = React.useRef(null);
|
|
22
|
-
const prevPresentRef = React.useRef(present);
|
|
23
|
-
const prevAnimationNameRef = React.useRef("none");
|
|
24
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
25
|
-
const [state, send] = useStateMachine(initialState, {
|
|
26
|
-
mounted: {
|
|
27
|
-
UNMOUNT: "unmounted",
|
|
28
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
29
|
-
},
|
|
30
|
-
unmountSuspended: {
|
|
31
|
-
MOUNT: "mounted",
|
|
32
|
-
ANIMATION_END: "unmounted"
|
|
33
|
-
},
|
|
34
|
-
unmounted: {
|
|
35
|
-
MOUNT: "mounted"
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
React.useEffect(() => {
|
|
39
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
40
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
41
|
-
}, [state]);
|
|
42
|
-
useLayoutEffect2(() => {
|
|
43
|
-
const styles = stylesRef.current;
|
|
44
|
-
const wasPresent = prevPresentRef.current;
|
|
45
|
-
const hasPresentChanged = wasPresent !== present;
|
|
46
|
-
if (hasPresentChanged) {
|
|
47
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
48
|
-
const currentAnimationName = getAnimationName(styles);
|
|
49
|
-
if (present) {
|
|
50
|
-
send("MOUNT");
|
|
51
|
-
} else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
|
|
52
|
-
send("UNMOUNT");
|
|
53
|
-
} else {
|
|
54
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
55
|
-
if (wasPresent && isAnimating) {
|
|
56
|
-
send("ANIMATION_OUT");
|
|
57
|
-
} else {
|
|
58
|
-
send("UNMOUNT");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
prevPresentRef.current = present;
|
|
62
|
-
}
|
|
63
|
-
}, [present, send]);
|
|
64
|
-
useLayoutEffect2(() => {
|
|
65
|
-
if (node) {
|
|
66
|
-
let timeoutId;
|
|
67
|
-
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
68
|
-
const handleAnimationEnd = (event) => {
|
|
69
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
70
|
-
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
71
|
-
if (event.target === node && isCurrentAnimation) {
|
|
72
|
-
send("ANIMATION_END");
|
|
73
|
-
if (!prevPresentRef.current) {
|
|
74
|
-
const currentFillMode = node.style.animationFillMode;
|
|
75
|
-
node.style.animationFillMode = "forwards";
|
|
76
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
77
|
-
if (node.style.animationFillMode === "forwards") {
|
|
78
|
-
node.style.animationFillMode = currentFillMode;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const handleAnimationStart = (event) => {
|
|
85
|
-
if (event.target === node) {
|
|
86
|
-
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
90
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
91
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
92
|
-
return () => {
|
|
93
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
94
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
95
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
96
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
97
|
-
};
|
|
98
|
-
} else {
|
|
99
|
-
send("ANIMATION_END");
|
|
100
|
-
}
|
|
101
|
-
}, [node, send]);
|
|
102
|
-
return {
|
|
103
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
104
|
-
ref: React.useCallback((node2) => {
|
|
105
|
-
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
106
|
-
setNode(node2);
|
|
107
|
-
}, [])
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function getAnimationName(styles) {
|
|
111
|
-
return (styles == null ? void 0 : styles.animationName) || "none";
|
|
112
|
-
}
|
|
113
|
-
function getElementRef(element) {
|
|
114
|
-
var _a, _b;
|
|
115
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
116
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
117
|
-
if (mayWarn) {
|
|
118
|
-
return element.ref;
|
|
119
|
-
}
|
|
120
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
121
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
122
|
-
if (mayWarn) {
|
|
123
|
-
return element.props.ref;
|
|
124
|
-
}
|
|
125
|
-
return element.props.ref || element.ref;
|
|
126
|
-
}
|
|
127
|
-
export {
|
|
128
|
-
Presence
|
|
129
|
-
};
|
|
1
|
+
import*as r from"react";import o from"react-dom";import{Primitive as t}from"./index73.js";import{useLayoutEffect as e}from"./index79.js";import{jsx as a}from"react/jsx-runtime";var m=r.forwardRef((m,i)=>{const{container:s,...f}=m,[n,c]=r.useState(!1);e(()=>c(!0),[]);const d=s||n&&globalThis?.document?.body;return d?o.createPortal(/* @__PURE__ */a(t.div,{...f,ref:i}),d):null});m.displayName="Portal";export{m as Portal};
|
package/dist/index72.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),n=require("./index66.cjs"),t=require("./index79.cjs");function r(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}return n.default=e,Object.freeze(n)}const o=r(e);var i=e=>{const{present:r,children:i}=e,s=function(e){const[n,r]=o.useState(),i=o.useRef(null),s=o.useRef(e),c=o.useRef("none"),a=e?"mounted":"unmounted",[d,l]=function(e,n){return o.useReducer((e,t)=>n[e][t]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=u(i.current);c.current="mounted"===d?e:"none"},[d]),t.useLayoutEffect(()=>{const n=i.current,t=s.current;if(t!==e){const r=c.current,o=u(n);if(e)l("MOUNT");else if("none"===o||"none"===n?.display)l("UNMOUNT");else{l(t&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}},[e,l]),t.useLayoutEffect(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const o=u(i.current).includes(CSS.escape(r.animationName));if(r.target===n&&o&&(l("ANIMATION_END"),!s.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},o=e=>{e.target===n&&(c.current=u(i.current))};return n.addEventListener("animationstart",o),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",o),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:o.useCallback(e=>{i.current=e?getComputedStyle(e):null,r(e)},[])}}(r),c="function"==typeof i?i({present:s.isPresent}):o.Children.only(i),a=n.useComposedRefs(s.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(c));return"function"==typeof i||s.isPresent?o.cloneElement(c,{ref:a}):null};function u(e){return e?.animationName||"none"}i.displayName="Presence",exports.Presence=i;
|
package/dist/index72.js
CHANGED
|
@@ -1,43 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as ReactDOM from "react-dom";
|
|
3
|
-
import { createSlot } from "./index73.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
var NODES = [
|
|
6
|
-
"a",
|
|
7
|
-
"button",
|
|
8
|
-
"div",
|
|
9
|
-
"form",
|
|
10
|
-
"h2",
|
|
11
|
-
"h3",
|
|
12
|
-
"img",
|
|
13
|
-
"input",
|
|
14
|
-
"label",
|
|
15
|
-
"li",
|
|
16
|
-
"nav",
|
|
17
|
-
"ol",
|
|
18
|
-
"p",
|
|
19
|
-
"select",
|
|
20
|
-
"span",
|
|
21
|
-
"svg",
|
|
22
|
-
"ul"
|
|
23
|
-
];
|
|
24
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
25
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
26
|
-
const Node = React.forwardRef((props, forwardedRef) => {
|
|
27
|
-
const { asChild, ...primitiveProps } = props;
|
|
28
|
-
const Comp = asChild ? Slot : node;
|
|
29
|
-
if (typeof window !== "undefined") {
|
|
30
|
-
window[Symbol.for("radix-ui")] = true;
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
33
|
-
});
|
|
34
|
-
Node.displayName = `Primitive.${node}`;
|
|
35
|
-
return { ...primitive, [node]: Node };
|
|
36
|
-
}, {});
|
|
37
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
38
|
-
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
Primitive,
|
|
42
|
-
dispatchDiscreteCustomEvent
|
|
43
|
-
};
|
|
1
|
+
import*as e from"react";import{useComposedRefs as n}from"./index66.js";import{useLayoutEffect as t}from"./index79.js";var r=r=>{const{present:i,children:u}=r,s=function(n){const[r,i]=e.useState(),u=e.useRef(null),s=e.useRef(n),a=e.useRef("none"),c=n?"mounted":"unmounted",[d,m]=function(n,t){return e.useReducer((e,n)=>t[e][n]??e,n)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=o(u.current);a.current="mounted"===d?e:"none"},[d]),t(()=>{const e=u.current,t=s.current;if(t!==n){const r=a.current,i=o(e);if(n)m("MOUNT");else if("none"===i||"none"===e?.display)m("UNMOUNT");else{m(t&&r!==i?"ANIMATION_OUT":"UNMOUNT")}s.current=n}},[n,m]),t(()=>{if(r){let e;const n=r.ownerDocument.defaultView??window,t=t=>{const i=o(u.current).includes(CSS.escape(t.animationName));if(t.target===r&&i&&(m("ANIMATION_END"),!s.current)){const t=r.style.animationFillMode;r.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=t)})}},i=e=>{e.target===r&&(a.current=o(u.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",t),r.addEventListener("animationend",t),()=>{n.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",t),r.removeEventListener("animationend",t)}}m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:e.useCallback(e=>{u.current=e?getComputedStyle(e):null,i(e)},[])}}(i),a="function"==typeof u?u({present:s.isPresent}):e.Children.only(u),c=n(s.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof u||s.isPresent?e.cloneElement(a,{ref:c}):null};function o(e){return e?.animationName||"none"}r.displayName="Presence";export{r as Presence};
|
package/dist/index73.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index74.cjs"),i=require("react/jsx-runtime");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=n(e),c=n(t);var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=r.createSlot(`Primitive.${t}`),c=o.forwardRef((e,r)=>{const{asChild:o,...c}=e,u=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:r})});return c.displayName=`Primitive.${t}`,{...e,[t]:c}},{});exports.Primitive=u,exports.dispatchDiscreteCustomEvent=function(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))};
|
package/dist/index73.js
CHANGED
|
@@ -1,99 +1 @@
|
|
|
1
|
-
import *
|
|
2
|
-
import { composeRefs } from "./index65.js";
|
|
3
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
4
|
-
// @__NO_SIDE_EFFECTS__
|
|
5
|
-
function createSlot(ownerName) {
|
|
6
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
7
|
-
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
8
|
-
const { children, ...slotProps } = props;
|
|
9
|
-
const childrenArray = React.Children.toArray(children);
|
|
10
|
-
const slottable = childrenArray.find(isSlottable);
|
|
11
|
-
if (slottable) {
|
|
12
|
-
const newElement = slottable.props.children;
|
|
13
|
-
const newChildren = childrenArray.map((child) => {
|
|
14
|
-
if (child === slottable) {
|
|
15
|
-
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
16
|
-
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
17
|
-
} else {
|
|
18
|
-
return child;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
22
|
-
}
|
|
23
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
24
|
-
});
|
|
25
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
26
|
-
return Slot2;
|
|
27
|
-
}
|
|
28
|
-
// @__NO_SIDE_EFFECTS__
|
|
29
|
-
function createSlotClone(ownerName) {
|
|
30
|
-
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
31
|
-
const { children, ...slotProps } = props;
|
|
32
|
-
if (React.isValidElement(children)) {
|
|
33
|
-
const childrenRef = getElementRef(children);
|
|
34
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
35
|
-
if (children.type !== React.Fragment) {
|
|
36
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
37
|
-
}
|
|
38
|
-
return React.cloneElement(children, props2);
|
|
39
|
-
}
|
|
40
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
41
|
-
});
|
|
42
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
43
|
-
return SlotClone;
|
|
44
|
-
}
|
|
45
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
46
|
-
// @__NO_SIDE_EFFECTS__
|
|
47
|
-
function createSlottable(ownerName) {
|
|
48
|
-
const Slottable2 = ({ children }) => {
|
|
49
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
50
|
-
};
|
|
51
|
-
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
52
|
-
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
53
|
-
return Slottable2;
|
|
54
|
-
}
|
|
55
|
-
function isSlottable(child) {
|
|
56
|
-
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
57
|
-
}
|
|
58
|
-
function mergeProps(slotProps, childProps) {
|
|
59
|
-
const overrideProps = { ...childProps };
|
|
60
|
-
for (const propName in childProps) {
|
|
61
|
-
const slotPropValue = slotProps[propName];
|
|
62
|
-
const childPropValue = childProps[propName];
|
|
63
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
64
|
-
if (isHandler) {
|
|
65
|
-
if (slotPropValue && childPropValue) {
|
|
66
|
-
overrideProps[propName] = (...args) => {
|
|
67
|
-
const result = childPropValue(...args);
|
|
68
|
-
slotPropValue(...args);
|
|
69
|
-
return result;
|
|
70
|
-
};
|
|
71
|
-
} else if (slotPropValue) {
|
|
72
|
-
overrideProps[propName] = slotPropValue;
|
|
73
|
-
}
|
|
74
|
-
} else if (propName === "style") {
|
|
75
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
76
|
-
} else if (propName === "className") {
|
|
77
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return { ...slotProps, ...overrideProps };
|
|
81
|
-
}
|
|
82
|
-
function getElementRef(element) {
|
|
83
|
-
var _a, _b;
|
|
84
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
85
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
86
|
-
if (mayWarn) {
|
|
87
|
-
return element.ref;
|
|
88
|
-
}
|
|
89
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
90
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
91
|
-
if (mayWarn) {
|
|
92
|
-
return element.props.ref;
|
|
93
|
-
}
|
|
94
|
-
return element.props.ref || element.ref;
|
|
95
|
-
}
|
|
96
|
-
export {
|
|
97
|
-
createSlot,
|
|
98
|
-
createSlottable
|
|
99
|
-
};
|
|
1
|
+
import*as r from"react";import*as i from"react-dom";import{createSlot as t}from"./index74.js";import{jsx as e}from"react/jsx-runtime";var o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((i,o)=>{const n=t(`Primitive.${o}`),a=r.forwardRef((r,i)=>{const{asChild:t,...a}=r,m=t?n:o;return"undefined"!=typeof window&&(window[/* @__PURE__ */Symbol.for("radix-ui")]=!0),/* @__PURE__ */e(m,{...a,ref:i})});return a.displayName=`Primitive.${o}`,{...i,[o]:a}},{});function n(r,t){r&&i.flushSync(()=>r.dispatchEvent(t))}export{o as Primitive,n as dispatchDiscreteCustomEvent};
|
package/dist/index74.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index66.cjs"),t=require("react/jsx-runtime");function n(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const o=n(e);function i(e){const t=o.forwardRef((e,t)=>{const{children:n,...i}=e;if(o.isValidElement(n)){const e=function(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning;if(t)return e.ref;if(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(n),l=function(e,r){const t={...r};for(const n in r){const o=e[n],i=r[n];/^on[A-Z]/.test(n)?o&&i?t[n]=(...e)=>{const r=i(...e);return o(...e),r}:o&&(t[n]=o):"style"===n?t[n]={...o,...i}:"className"===n&&(t[n]=[o,i].filter(Boolean).join(" "))}return{...e,...t}}(i,n.props);return n.type!==o.Fragment&&(l.ref=t?r.composeRefs(t,e):e),o.cloneElement(n,l)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l=Symbol("radix.slottable");function c(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l}exports.createSlot=function(e){const r=i(e),n=o.forwardRef((e,n)=>{const{children:i,...l}=e,s=o.Children.toArray(i),a=s.find(c);if(a){const e=a.props.children,i=s.map(r=>r===a?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:r);return t.jsx(r,{...l,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,i):null})}return t.jsx(r,{...l,ref:n,children:i})});return n.displayName=`${e}.Slot`,n},exports.createSlottable=function(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=l,r};
|
package/dist/index74.js
CHANGED
|
@@ -1,71 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function useControllableState({
|
|
5
|
-
prop,
|
|
6
|
-
defaultProp,
|
|
7
|
-
onChange = () => {
|
|
8
|
-
},
|
|
9
|
-
caller
|
|
10
|
-
}) {
|
|
11
|
-
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
12
|
-
defaultProp,
|
|
13
|
-
onChange
|
|
14
|
-
});
|
|
15
|
-
const isControlled = prop !== void 0;
|
|
16
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
17
|
-
{
|
|
18
|
-
const isControlledRef = React.useRef(prop !== void 0);
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
const wasControlled = isControlledRef.current;
|
|
21
|
-
if (wasControlled !== isControlled) {
|
|
22
|
-
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
23
|
-
const to = isControlled ? "controlled" : "uncontrolled";
|
|
24
|
-
console.warn(
|
|
25
|
-
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
isControlledRef.current = isControlled;
|
|
29
|
-
}, [isControlled, caller]);
|
|
30
|
-
}
|
|
31
|
-
const setValue = React.useCallback(
|
|
32
|
-
(nextValue) => {
|
|
33
|
-
var _a;
|
|
34
|
-
if (isControlled) {
|
|
35
|
-
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
36
|
-
if (value2 !== prop) {
|
|
37
|
-
(_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
setUncontrolledProp(nextValue);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
44
|
-
);
|
|
45
|
-
return [value, setValue];
|
|
46
|
-
}
|
|
47
|
-
function useUncontrolledState({
|
|
48
|
-
defaultProp,
|
|
49
|
-
onChange
|
|
50
|
-
}) {
|
|
51
|
-
const [value, setValue] = React.useState(defaultProp);
|
|
52
|
-
const prevValueRef = React.useRef(value);
|
|
53
|
-
const onChangeRef = React.useRef(onChange);
|
|
54
|
-
useInsertionEffect(() => {
|
|
55
|
-
onChangeRef.current = onChange;
|
|
56
|
-
}, [onChange]);
|
|
57
|
-
React.useEffect(() => {
|
|
58
|
-
var _a;
|
|
59
|
-
if (prevValueRef.current !== value) {
|
|
60
|
-
(_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
|
|
61
|
-
prevValueRef.current = value;
|
|
62
|
-
}
|
|
63
|
-
}, [value, prevValueRef]);
|
|
64
|
-
return [value, setValue, onChangeRef];
|
|
65
|
-
}
|
|
66
|
-
function isFunction(value) {
|
|
67
|
-
return typeof value === "function";
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
useControllableState
|
|
71
|
-
};
|
|
1
|
+
import*as n from"react";import{composeRefs as r}from"./index66.js";import{jsx as e,Fragment as t}from"react/jsx-runtime";function i(r){const t=/* @__PURE__ */o(r),i=n.forwardRef((r,i)=>{const{children:o,...l}=r,c=n.Children.toArray(o),a=c.find(s);if(a){const r=a.props.children,o=c.map(e=>e===a?n.Children.count(r)>1?n.Children.only(null):n.isValidElement(r)?r.props.children:null:e);/* @__PURE__ */
|
|
2
|
+
return e(t,{...l,ref:i,children:n.isValidElement(r)?n.cloneElement(r,void 0,o):null})}/* @__PURE__ */
|
|
3
|
+
return e(t,{...l,ref:i,children:o})});return i.displayName=`${r}.Slot`,i}function o(e){const t=n.forwardRef((e,t)=>{const{children:i,...o}=e;if(n.isValidElement(i)){const e=function(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning;if(e)return n.ref;if(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning,e)return n.props.ref;return n.props.ref||n.ref}(i),l=function(n,r){const e={...r};for(const t in r){const i=n[t],o=r[t];/^on[A-Z]/.test(t)?i&&o?e[t]=(...n)=>{const r=o(...n);return i(...n),r}:i&&(e[t]=i):"style"===t?e[t]={...i,...o}:"className"===t&&(e[t]=[i,o].filter(Boolean).join(" "))}return{...n,...e}}(o,i.props);return i.type!==n.Fragment&&(l.ref=t?r(t,e):e),n.cloneElement(i,l)}return n.Children.count(i)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l=/* @__PURE__ */Symbol("radix.slottable");function c(n){const r=({children:n})=>/* @__PURE__ */e(t,{children:n});return r.displayName=`${n}.Slottable`,r.__radixId=l,r}function s(r){return n.isValidElement(r)&&"function"==typeof r.type&&"__radixId"in r.type&&r.type.__radixId===l}export{i as createSlot,c as createSlottable};
|
package/dist/index75.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index79.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=r(e);var o=n[" useInsertionEffect ".trim().toString()]||t.useLayoutEffect;exports.useControllableState=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:u}){const[c,f,s]=function({defaultProp:e,onChange:t}){const[r,u]=n.useState(e),c=n.useRef(r),f=n.useRef(t);return o(()=>{f.current=t},[t]),n.useEffect(()=>{c.current!==r&&(f.current?.(r),c.current=r)},[r,c]),[r,u,f]}({defaultProp:t,onChange:r}),i=void 0!==e,a=i?e:c;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==i){}t.current=i},[i,u])}const l=n.useCallback(t=>{if(i){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else f(t)},[i,e,f,s]);return[a,l]};
|
package/dist/index75.js
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Primitive } from "./index72.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
5
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
6
|
-
position: "absolute",
|
|
7
|
-
border: 0,
|
|
8
|
-
width: 1,
|
|
9
|
-
height: 1,
|
|
10
|
-
padding: 0,
|
|
11
|
-
margin: -1,
|
|
12
|
-
overflow: "hidden",
|
|
13
|
-
clip: "rect(0, 0, 0, 0)",
|
|
14
|
-
whiteSpace: "nowrap",
|
|
15
|
-
wordWrap: "normal"
|
|
16
|
-
});
|
|
17
|
-
var NAME = "VisuallyHidden";
|
|
18
|
-
var VisuallyHidden = React.forwardRef(
|
|
19
|
-
(props, forwardedRef) => {
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
Primitive.span,
|
|
22
|
-
{
|
|
23
|
-
...props,
|
|
24
|
-
ref: forwardedRef,
|
|
25
|
-
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
VisuallyHidden.displayName = NAME;
|
|
31
|
-
var Root = VisuallyHidden;
|
|
32
|
-
export {
|
|
33
|
-
Root,
|
|
34
|
-
VISUALLY_HIDDEN_STYLES,
|
|
35
|
-
VisuallyHidden
|
|
36
|
-
};
|
|
1
|
+
import*as e from"react";import{useLayoutEffect as t}from"./index79.js";var r=e[" useInsertionEffect ".trim().toString()]||t;function n({prop:t,defaultProp:n,onChange:o=()=>{},caller:u}){const[c,f,s]=function({defaultProp:t,onChange:n}){const[o,u]=e.useState(t),c=e.useRef(o),f=e.useRef(n);return r(()=>{f.current=n},[n]),e.useEffect(()=>{c.current!==o&&(f.current?.(o),c.current=o)},[o,c]),[o,u,f]}({defaultProp:n,onChange:o}),a=void 0!==t,i=a?t:c;{const r=e.useRef(void 0!==t);e.useEffect(()=>{const e=r.current;if(e!==a){}r.current=a},[a,u])}const p=e.useCallback(e=>{if(a){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&s.current?.(r)}else f(e)},[a,t,f,s]);return[i,p]}export{n as useControllableState};
|
package/dist/index76.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index73.cjs"),t=require("react/jsx-runtime");function o(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const i=o(e);var n=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a=i.forwardRef((e,o)=>t.jsx(r.Primitive.span,{...e,ref:o,style:{...n,...e.style}}));a.displayName="VisuallyHidden";var s=a;exports.Root=s,exports.VISUALLY_HIDDEN_STYLES=n,exports.VisuallyHidden=a;
|
package/dist/index76.js
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
function useCallbackRef(callback) {
|
|
3
|
-
const callbackRef = React.useRef(callback);
|
|
4
|
-
React.useEffect(() => {
|
|
5
|
-
callbackRef.current = callback;
|
|
6
|
-
});
|
|
7
|
-
return React.useMemo(() => (...args) => {
|
|
8
|
-
var _a;
|
|
9
|
-
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
10
|
-
}, []);
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
useCallbackRef
|
|
14
|
-
};
|
|
1
|
+
import*as r from"react";import{Primitive as e}from"./index73.js";import{jsx as a}from"react/jsx-runtime";var i=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o=r.forwardRef((r,o)=>/* @__PURE__ */a(e.span,{...r,ref:o,style:{...i,...r.style}}));o.displayName="VisuallyHidden";var t=o;export{t as Root,i as VISUALLY_HIDDEN_STYLES,o as VisuallyHidden};
|
package/dist/index77.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("react"));exports.useCallbackRef=function(e){const r=t.useRef(e);return t.useEffect(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])};
|