orn-ui 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +67 -52
- package/README.md +5 -9
- package/lib/commonjs/atoms/Avatar.js +77 -5
- package/lib/commonjs/atoms/Avatar.js.map +1 -1
- package/lib/commonjs/atoms/Badge.js +17 -8
- package/lib/commonjs/atoms/Badge.js.map +1 -1
- package/lib/commonjs/atoms/Button.js +108 -39
- package/lib/commonjs/atoms/Button.js.map +1 -1
- package/lib/commonjs/atoms/Card.js +24 -2
- package/lib/commonjs/atoms/Card.js.map +1 -1
- package/lib/commonjs/atoms/Checkbox.js +41 -10
- package/lib/commonjs/atoms/Checkbox.js.map +1 -1
- package/lib/commonjs/atoms/Divider.js +30 -5
- package/lib/commonjs/atoms/Divider.js.map +1 -1
- package/lib/commonjs/atoms/EmptyState.js +58 -20
- package/lib/commonjs/atoms/EmptyState.js.map +1 -1
- package/lib/commonjs/atoms/Fab.js +32 -12
- package/lib/commonjs/atoms/Fab.js.map +1 -1
- package/lib/commonjs/atoms/Gradient.js +102 -36
- package/lib/commonjs/atoms/Gradient.js.map +1 -1
- package/lib/commonjs/atoms/IconButton.js +25 -4
- package/lib/commonjs/atoms/IconButton.js.map +1 -1
- package/lib/commonjs/atoms/Image.js +61 -25
- package/lib/commonjs/atoms/Image.js.map +1 -1
- package/lib/commonjs/atoms/Input.js +105 -17
- package/lib/commonjs/atoms/Input.js.map +1 -1
- package/lib/commonjs/atoms/KeyValueRow.js +37 -9
- package/lib/commonjs/atoms/KeyValueRow.js.map +1 -1
- package/lib/commonjs/atoms/PressableScale.js +25 -5
- package/lib/commonjs/atoms/PressableScale.js.map +1 -1
- package/lib/commonjs/atoms/ShinyText.js +29 -29
- package/lib/commonjs/atoms/Skeleton.js +28 -13
- package/lib/commonjs/atoms/Skeleton.js.map +1 -1
- package/lib/commonjs/atoms/Spinner.js +81 -22
- package/lib/commonjs/atoms/Spinner.js.map +1 -1
- package/lib/commonjs/atoms/Text.js +56 -5
- package/lib/commonjs/atoms/Text.js.map +1 -1
- package/lib/commonjs/atoms/Transition.js +46 -43
- package/lib/commonjs/atoms/Transition.js.map +1 -1
- package/lib/commonjs/atoms/index.js +6 -0
- package/lib/commonjs/atoms/index.js.map +1 -1
- package/lib/commonjs/atoms/inputValidation.js +56 -0
- package/lib/commonjs/atoms/inputValidation.js.map +1 -0
- package/lib/commonjs/icons/Icon.js +4 -4
- package/lib/commonjs/icons/defaultIcons.js +576 -24
- package/lib/commonjs/icons/defaultIcons.js.map +1 -1
- package/lib/commonjs/icons/index.js +6 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/molecules/AvatarHeader.js +47 -14
- package/lib/commonjs/molecules/AvatarHeader.js.map +1 -1
- package/lib/commonjs/molecules/FormActions.js +25 -9
- package/lib/commonjs/molecules/FormActions.js.map +1 -1
- package/lib/commonjs/molecules/InfoRow.js +30 -14
- package/lib/commonjs/molecules/InfoRow.js.map +1 -1
- package/lib/commonjs/molecules/OptionCard.js +37 -22
- package/lib/commonjs/molecules/OptionCard.js.map +1 -1
- package/lib/commonjs/molecules/SegmentedControl.js +103 -14
- package/lib/commonjs/molecules/SegmentedControl.js.map +1 -1
- package/lib/commonjs/molecules/Stepper.js +61 -16
- package/lib/commonjs/molecules/Stepper.js.map +1 -1
- package/lib/commonjs/molecules/Steps.js +105 -41
- package/lib/commonjs/molecules/Steps.js.map +1 -1
- package/lib/commonjs/molecules/SymmetricGrid.js +26 -18
- package/lib/commonjs/molecules/SymmetricGrid.js.map +1 -1
- package/lib/commonjs/organisms/Alert.js +49 -35
- package/lib/commonjs/organisms/Alert.js.map +1 -1
- package/lib/commonjs/organisms/AlertProvider.js +10 -10
- package/lib/commonjs/organisms/BottomSheet.js +137 -85
- package/lib/commonjs/organisms/BottomSheet.js.map +1 -1
- package/lib/commonjs/organisms/Chart.js +197 -156
- package/lib/commonjs/organisms/Chart.js.map +1 -1
- package/lib/commonjs/organisms/DateField.js +36 -20
- package/lib/commonjs/organisms/DateField.js.map +1 -1
- package/lib/commonjs/organisms/DatePicker.js +56 -33
- package/lib/commonjs/organisms/DatePicker.js.map +1 -1
- package/lib/commonjs/organisms/List.js +62 -34
- package/lib/commonjs/organisms/List.js.map +1 -1
- package/lib/commonjs/organisms/Modal.js +120 -82
- package/lib/commonjs/organisms/Modal.js.map +1 -1
- package/lib/commonjs/organisms/NavigationBar.js +63 -24
- package/lib/commonjs/organisms/NavigationBar.js.map +1 -1
- package/lib/commonjs/organisms/OptionWheel.js +64 -64
- package/lib/commonjs/organisms/OptionWheel.js.map +1 -1
- package/lib/commonjs/organisms/ReorderableList.js +48 -27
- package/lib/commonjs/organisms/ReorderableList.js.map +1 -1
- package/lib/commonjs/organisms/Screen.js +68 -35
- package/lib/commonjs/organisms/Screen.js.map +1 -1
- package/lib/commonjs/organisms/SearchList.js +56 -26
- package/lib/commonjs/organisms/SearchList.js.map +1 -1
- package/lib/commonjs/organisms/Select.js +45 -24
- package/lib/commonjs/organisms/Select.js.map +1 -1
- package/lib/commonjs/organisms/Slides.js +36 -23
- package/lib/commonjs/organisms/Slides.js.map +1 -1
- package/lib/commonjs/organisms/ThemeToggle.js +10 -9
- package/lib/commonjs/organisms/ThemeToggle.js.map +1 -1
- package/lib/commonjs/organisms/Timeline.js +73 -56
- package/lib/commonjs/organisms/Timeline.js.map +1 -1
- package/lib/commonjs/organisms/Toast.js +46 -15
- package/lib/commonjs/organisms/Toast.js.map +1 -1
- package/lib/commonjs/organisms/ToastProvider.js +14 -10
- package/lib/commonjs/organisms/ToastProvider.js.map +1 -1
- package/lib/commonjs/organisms/Wizard.js +40 -15
- package/lib/commonjs/organisms/Wizard.js.map +1 -1
- package/lib/commonjs/organisms/chart/frame.js +25 -25
- package/lib/commonjs/organisms/chart/frame.js.map +1 -1
- package/lib/commonjs/organisms/chart/marks.js +42 -42
- package/lib/commonjs/organisms/chart/math.js +84 -85
- package/lib/commonjs/organisms/chart/math.js.map +1 -1
- package/lib/commonjs/organisms/chart/palette.js +28 -28
- package/lib/commonjs/organisms/imperativeBridge.js +5 -5
- package/lib/commonjs/organisms/imperativeBridge.js.map +1 -1
- package/lib/commonjs/organisms/useSlides.js +53 -21
- package/lib/commonjs/organisms/useSlides.js.map +1 -1
- package/lib/commonjs/safe-area/SafeAreaUIProvider.js +9 -66
- package/lib/commonjs/safe-area/SafeAreaUIProvider.js.map +1 -1
- package/lib/commonjs/safe-area/index.js.map +1 -1
- package/lib/commonjs/theme/KeyboardAvoidance.js +206 -0
- package/lib/commonjs/theme/KeyboardAvoidance.js.map +1 -0
- package/lib/commonjs/theme/NativeOverlay.js +263 -0
- package/lib/commonjs/theme/NativeOverlay.js.map +1 -0
- package/lib/commonjs/theme/UIProvider.js +86 -33
- package/lib/commonjs/theme/UIProvider.js.map +1 -1
- package/lib/commonjs/theme/colors.js +17 -17
- package/lib/commonjs/theme/colors.js.map +1 -1
- package/lib/commonjs/theme/createStyles.js +19 -16
- package/lib/commonjs/theme/createStyles.js.map +1 -1
- package/lib/commonjs/theme/createTheme.js +6 -6
- package/lib/commonjs/theme/index.js +6 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/insets.js +1 -1
- package/lib/commonjs/theme/labels.js +29 -1
- package/lib/commonjs/theme/labels.js.map +1 -1
- package/lib/commonjs/theme/palettes.js +25 -23
- package/lib/commonjs/theme/palettes.js.map +1 -1
- package/lib/commonjs/theme/tokens.js +28 -14
- package/lib/commonjs/theme/tokens.js.map +1 -1
- package/lib/commonjs/theme/useKeyboardField.js +36 -0
- package/lib/commonjs/theme/useKeyboardField.js.map +1 -0
- package/lib/commonjs/theme/useReduceMotion.js +31 -0
- package/lib/commonjs/theme/useReduceMotion.js.map +1 -0
- package/lib/module/atoms/Avatar.js +79 -8
- package/lib/module/atoms/Avatar.js.map +1 -1
- package/lib/module/atoms/Badge.js +17 -8
- package/lib/module/atoms/Badge.js.map +1 -1
- package/lib/module/atoms/Button.js +110 -41
- package/lib/module/atoms/Button.js.map +1 -1
- package/lib/module/atoms/Card.js +24 -2
- package/lib/module/atoms/Card.js.map +1 -1
- package/lib/module/atoms/Checkbox.js +42 -11
- package/lib/module/atoms/Checkbox.js.map +1 -1
- package/lib/module/atoms/Divider.js +31 -6
- package/lib/module/atoms/Divider.js.map +1 -1
- package/lib/module/atoms/EmptyState.js +58 -20
- package/lib/module/atoms/EmptyState.js.map +1 -1
- package/lib/module/atoms/Fab.js +33 -13
- package/lib/module/atoms/Fab.js.map +1 -1
- package/lib/module/atoms/Gradient.js +103 -37
- package/lib/module/atoms/Gradient.js.map +1 -1
- package/lib/module/atoms/IconButton.js +25 -4
- package/lib/module/atoms/IconButton.js.map +1 -1
- package/lib/module/atoms/Image.js +61 -25
- package/lib/module/atoms/Image.js.map +1 -1
- package/lib/module/atoms/Input.js +108 -20
- package/lib/module/atoms/Input.js.map +1 -1
- package/lib/module/atoms/KeyValueRow.js +37 -9
- package/lib/module/atoms/KeyValueRow.js.map +1 -1
- package/lib/module/atoms/PressableScale.js +25 -5
- package/lib/module/atoms/PressableScale.js.map +1 -1
- package/lib/module/atoms/ShinyText.js +29 -29
- package/lib/module/atoms/Skeleton.js +30 -13
- package/lib/module/atoms/Skeleton.js.map +1 -1
- package/lib/module/atoms/Spinner.js +82 -23
- package/lib/module/atoms/Spinner.js.map +1 -1
- package/lib/module/atoms/Text.js +56 -5
- package/lib/module/atoms/Text.js.map +1 -1
- package/lib/module/atoms/Transition.js +41 -42
- package/lib/module/atoms/Transition.js.map +1 -1
- package/lib/module/atoms/index.js +1 -1
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/atoms/inputValidation.js +52 -0
- package/lib/module/atoms/inputValidation.js.map +1 -0
- package/lib/module/icons/Icon.js +4 -4
- package/lib/module/icons/defaultIcons.js +574 -24
- package/lib/module/icons/defaultIcons.js.map +1 -1
- package/lib/module/icons/index.js +1 -1
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/molecules/AvatarHeader.js +47 -14
- package/lib/module/molecules/AvatarHeader.js.map +1 -1
- package/lib/module/molecules/FormActions.js +25 -9
- package/lib/module/molecules/FormActions.js.map +1 -1
- package/lib/module/molecules/InfoRow.js +30 -14
- package/lib/module/molecules/InfoRow.js.map +1 -1
- package/lib/module/molecules/OptionCard.js +37 -22
- package/lib/module/molecules/OptionCard.js.map +1 -1
- package/lib/module/molecules/SegmentedControl.js +107 -18
- package/lib/module/molecules/SegmentedControl.js.map +1 -1
- package/lib/module/molecules/Stepper.js +63 -18
- package/lib/module/molecules/Stepper.js.map +1 -1
- package/lib/module/molecules/Steps.js +107 -43
- package/lib/module/molecules/Steps.js.map +1 -1
- package/lib/module/molecules/SymmetricGrid.js +26 -18
- package/lib/module/molecules/SymmetricGrid.js.map +1 -1
- package/lib/module/organisms/Alert.js +51 -37
- package/lib/module/organisms/Alert.js.map +1 -1
- package/lib/module/organisms/AlertProvider.js +10 -10
- package/lib/module/organisms/BottomSheet.js +142 -88
- package/lib/module/organisms/BottomSheet.js.map +1 -1
- package/lib/module/organisms/Chart.js +199 -158
- package/lib/module/organisms/Chart.js.map +1 -1
- package/lib/module/organisms/DateField.js +36 -20
- package/lib/module/organisms/DateField.js.map +1 -1
- package/lib/module/organisms/DatePicker.js +56 -33
- package/lib/module/organisms/DatePicker.js.map +1 -1
- package/lib/module/organisms/List.js +62 -34
- package/lib/module/organisms/List.js.map +1 -1
- package/lib/module/organisms/Modal.js +122 -84
- package/lib/module/organisms/Modal.js.map +1 -1
- package/lib/module/organisms/NavigationBar.js +64 -25
- package/lib/module/organisms/NavigationBar.js.map +1 -1
- package/lib/module/organisms/OptionWheel.js +64 -64
- package/lib/module/organisms/OptionWheel.js.map +1 -1
- package/lib/module/organisms/ReorderableList.js +48 -27
- package/lib/module/organisms/ReorderableList.js.map +1 -1
- package/lib/module/organisms/Screen.js +70 -37
- package/lib/module/organisms/Screen.js.map +1 -1
- package/lib/module/organisms/SearchList.js +56 -26
- package/lib/module/organisms/SearchList.js.map +1 -1
- package/lib/module/organisms/Select.js +46 -25
- package/lib/module/organisms/Select.js.map +1 -1
- package/lib/module/organisms/Slides.js +37 -24
- package/lib/module/organisms/Slides.js.map +1 -1
- package/lib/module/organisms/ThemeToggle.js +11 -10
- package/lib/module/organisms/ThemeToggle.js.map +1 -1
- package/lib/module/organisms/Timeline.js +73 -56
- package/lib/module/organisms/Timeline.js.map +1 -1
- package/lib/module/organisms/Toast.js +47 -16
- package/lib/module/organisms/Toast.js.map +1 -1
- package/lib/module/organisms/ToastProvider.js +15 -11
- package/lib/module/organisms/ToastProvider.js.map +1 -1
- package/lib/module/organisms/Wizard.js +41 -16
- package/lib/module/organisms/Wizard.js.map +1 -1
- package/lib/module/organisms/chart/frame.js +25 -25
- package/lib/module/organisms/chart/frame.js.map +1 -1
- package/lib/module/organisms/chart/marks.js +42 -42
- package/lib/module/organisms/chart/math.js +84 -85
- package/lib/module/organisms/chart/math.js.map +1 -1
- package/lib/module/organisms/chart/palette.js +28 -28
- package/lib/module/organisms/imperativeBridge.js +5 -5
- package/lib/module/organisms/imperativeBridge.js.map +1 -1
- package/lib/module/organisms/useSlides.js +53 -21
- package/lib/module/organisms/useSlides.js.map +1 -1
- package/lib/module/safe-area/SafeAreaUIProvider.js +10 -65
- package/lib/module/safe-area/SafeAreaUIProvider.js.map +1 -1
- package/lib/module/safe-area/index.js +1 -0
- package/lib/module/safe-area/index.js.map +1 -1
- package/lib/module/theme/KeyboardAvoidance.js +198 -0
- package/lib/module/theme/KeyboardAvoidance.js.map +1 -0
- package/lib/module/theme/NativeOverlay.js +257 -0
- package/lib/module/theme/NativeOverlay.js.map +1 -0
- package/lib/module/theme/UIProvider.js +88 -35
- package/lib/module/theme/UIProvider.js.map +1 -1
- package/lib/module/theme/colors.js +17 -17
- package/lib/module/theme/colors.js.map +1 -1
- package/lib/module/theme/createStyles.js +20 -16
- package/lib/module/theme/createStyles.js.map +1 -1
- package/lib/module/theme/createTheme.js +6 -6
- package/lib/module/theme/index.js +1 -1
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/insets.js +1 -1
- package/lib/module/theme/labels.js +29 -1
- package/lib/module/theme/labels.js.map +1 -1
- package/lib/module/theme/palettes.js +25 -23
- package/lib/module/theme/palettes.js.map +1 -1
- package/lib/module/theme/tokens.js +27 -13
- package/lib/module/theme/tokens.js.map +1 -1
- package/lib/module/theme/useKeyboardField.js +33 -0
- package/lib/module/theme/useKeyboardField.js.map +1 -0
- package/lib/module/theme/useReduceMotion.js +28 -0
- package/lib/module/theme/useReduceMotion.js.map +1 -0
- package/lib/typescript/atoms/Avatar.d.ts +35 -5
- package/lib/typescript/atoms/Avatar.d.ts.map +1 -1
- package/lib/typescript/atoms/Badge.d.ts +14 -3
- package/lib/typescript/atoms/Badge.d.ts.map +1 -1
- package/lib/typescript/atoms/Button.d.ts +34 -3
- package/lib/typescript/atoms/Button.d.ts.map +1 -1
- package/lib/typescript/atoms/Card.d.ts +13 -2
- package/lib/typescript/atoms/Card.d.ts.map +1 -1
- package/lib/typescript/atoms/Checkbox.d.ts +26 -1
- package/lib/typescript/atoms/Checkbox.d.ts.map +1 -1
- package/lib/typescript/atoms/Divider.d.ts +18 -1
- package/lib/typescript/atoms/Divider.d.ts.map +1 -1
- package/lib/typescript/atoms/EmptyState.d.ts +30 -3
- package/lib/typescript/atoms/EmptyState.d.ts.map +1 -1
- package/lib/typescript/atoms/Fab.d.ts +24 -4
- package/lib/typescript/atoms/Fab.d.ts.map +1 -1
- package/lib/typescript/atoms/Gradient.d.ts +21 -15
- package/lib/typescript/atoms/Gradient.d.ts.map +1 -1
- package/lib/typescript/atoms/IconButton.d.ts +18 -4
- package/lib/typescript/atoms/IconButton.d.ts.map +1 -1
- package/lib/typescript/atoms/Image.d.ts +39 -17
- package/lib/typescript/atoms/Image.d.ts.map +1 -1
- package/lib/typescript/atoms/Input.d.ts +57 -7
- package/lib/typescript/atoms/Input.d.ts.map +1 -1
- package/lib/typescript/atoms/KeyValueRow.d.ts +16 -4
- package/lib/typescript/atoms/KeyValueRow.d.ts.map +1 -1
- package/lib/typescript/atoms/PressableScale.d.ts +12 -5
- package/lib/typescript/atoms/PressableScale.d.ts.map +1 -1
- package/lib/typescript/atoms/ShinyText.d.ts +17 -17
- package/lib/typescript/atoms/ShinyText.d.ts.map +1 -1
- package/lib/typescript/atoms/Skeleton.d.ts +12 -7
- package/lib/typescript/atoms/Skeleton.d.ts.map +1 -1
- package/lib/typescript/atoms/Spinner.d.ts +29 -1
- package/lib/typescript/atoms/Spinner.d.ts.map +1 -1
- package/lib/typescript/atoms/Text.d.ts +46 -0
- package/lib/typescript/atoms/Text.d.ts.map +1 -1
- package/lib/typescript/atoms/Transition.d.ts +19 -15
- package/lib/typescript/atoms/Transition.d.ts.map +1 -1
- package/lib/typescript/atoms/index.d.ts +3 -3
- package/lib/typescript/atoms/index.d.ts.map +1 -1
- package/lib/typescript/atoms/inputValidation.d.ts +29 -0
- package/lib/typescript/atoms/inputValidation.d.ts.map +1 -0
- package/lib/typescript/icons/Icon.d.ts +4 -4
- package/lib/typescript/icons/defaultIcons.d.ts +19 -2
- package/lib/typescript/icons/defaultIcons.d.ts.map +1 -1
- package/lib/typescript/icons/index.d.ts +2 -2
- package/lib/typescript/icons/index.d.ts.map +1 -1
- package/lib/typescript/icons/types.d.ts +13 -3
- package/lib/typescript/icons/types.d.ts.map +1 -1
- package/lib/typescript/molecules/AvatarHeader.d.ts +23 -4
- package/lib/typescript/molecules/AvatarHeader.d.ts.map +1 -1
- package/lib/typescript/molecules/FormActions.d.ts +21 -4
- package/lib/typescript/molecules/FormActions.d.ts.map +1 -1
- package/lib/typescript/molecules/InfoRow.d.ts +17 -3
- package/lib/typescript/molecules/InfoRow.d.ts.map +1 -1
- package/lib/typescript/molecules/OptionCard.d.ts +20 -5
- package/lib/typescript/molecules/OptionCard.d.ts.map +1 -1
- package/lib/typescript/molecules/SegmentedControl.d.ts +18 -2
- package/lib/typescript/molecules/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/molecules/Stepper.d.ts +23 -7
- package/lib/typescript/molecules/Stepper.d.ts.map +1 -1
- package/lib/typescript/molecules/Steps.d.ts +18 -4
- package/lib/typescript/molecules/Steps.d.ts.map +1 -1
- package/lib/typescript/molecules/SymmetricGrid.d.ts +15 -5
- package/lib/typescript/molecules/SymmetricGrid.d.ts.map +1 -1
- package/lib/typescript/organisms/Alert.d.ts +28 -2
- package/lib/typescript/organisms/Alert.d.ts.map +1 -1
- package/lib/typescript/organisms/AlertProvider.d.ts +10 -10
- package/lib/typescript/organisms/AlertProvider.d.ts.map +1 -1
- package/lib/typescript/organisms/BottomSheet.d.ts +20 -5
- package/lib/typescript/organisms/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/organisms/Chart.d.ts +86 -75
- package/lib/typescript/organisms/Chart.d.ts.map +1 -1
- package/lib/typescript/organisms/DateField.d.ts +17 -3
- package/lib/typescript/organisms/DateField.d.ts.map +1 -1
- package/lib/typescript/organisms/DatePicker.d.ts +7 -11
- package/lib/typescript/organisms/DatePicker.d.ts.map +1 -1
- package/lib/typescript/organisms/List.d.ts +30 -3
- package/lib/typescript/organisms/List.d.ts.map +1 -1
- package/lib/typescript/organisms/Modal.d.ts +30 -3
- package/lib/typescript/organisms/Modal.d.ts.map +1 -1
- package/lib/typescript/organisms/NavigationBar.d.ts +26 -7
- package/lib/typescript/organisms/NavigationBar.d.ts.map +1 -1
- package/lib/typescript/organisms/OptionWheel.d.ts +20 -16
- package/lib/typescript/organisms/OptionWheel.d.ts.map +1 -1
- package/lib/typescript/organisms/ReorderableList.d.ts +20 -11
- package/lib/typescript/organisms/ReorderableList.d.ts.map +1 -1
- package/lib/typescript/organisms/Screen.d.ts +27 -8
- package/lib/typescript/organisms/Screen.d.ts.map +1 -1
- package/lib/typescript/organisms/SearchList.d.ts +46 -3
- package/lib/typescript/organisms/SearchList.d.ts.map +1 -1
- package/lib/typescript/organisms/Select.d.ts +26 -6
- package/lib/typescript/organisms/Select.d.ts.map +1 -1
- package/lib/typescript/organisms/Slides.d.ts +44 -26
- package/lib/typescript/organisms/Slides.d.ts.map +1 -1
- package/lib/typescript/organisms/ThemeToggle.d.ts +6 -2
- package/lib/typescript/organisms/ThemeToggle.d.ts.map +1 -1
- package/lib/typescript/organisms/Timeline.d.ts +26 -9
- package/lib/typescript/organisms/Timeline.d.ts.map +1 -1
- package/lib/typescript/organisms/Toast.d.ts +19 -4
- package/lib/typescript/organisms/Toast.d.ts.map +1 -1
- package/lib/typescript/organisms/ToastProvider.d.ts +8 -8
- package/lib/typescript/organisms/ToastProvider.d.ts.map +1 -1
- package/lib/typescript/organisms/Wizard.d.ts +24 -6
- package/lib/typescript/organisms/Wizard.d.ts.map +1 -1
- package/lib/typescript/organisms/chart/frame.d.ts +21 -21
- package/lib/typescript/organisms/chart/frame.d.ts.map +1 -1
- package/lib/typescript/organisms/chart/marks.d.ts +28 -28
- package/lib/typescript/organisms/chart/marks.d.ts.map +1 -1
- package/lib/typescript/organisms/chart/math.d.ts +69 -70
- package/lib/typescript/organisms/chart/math.d.ts.map +1 -1
- package/lib/typescript/organisms/chart/palette.d.ts +2 -2
- package/lib/typescript/organisms/chart/palette.d.ts.map +1 -1
- package/lib/typescript/organisms/imperativeBridge.d.ts +4 -4
- package/lib/typescript/organisms/useSlides.d.ts +8 -16
- package/lib/typescript/organisms/useSlides.d.ts.map +1 -1
- package/lib/typescript/safe-area/SafeAreaUIProvider.d.ts +9 -7
- package/lib/typescript/safe-area/SafeAreaUIProvider.d.ts.map +1 -1
- package/lib/typescript/safe-area/index.d.ts.map +1 -1
- package/lib/typescript/theme/KeyboardAvoidance.d.ts +62 -0
- package/lib/typescript/theme/KeyboardAvoidance.d.ts.map +1 -0
- package/lib/typescript/theme/NativeOverlay.d.ts +43 -0
- package/lib/typescript/theme/NativeOverlay.d.ts.map +1 -0
- package/lib/typescript/theme/UIProvider.d.ts +38 -20
- package/lib/typescript/theme/UIProvider.d.ts.map +1 -1
- package/lib/typescript/theme/colors.d.ts +13 -13
- package/lib/typescript/theme/colors.d.ts.map +1 -1
- package/lib/typescript/theme/createStyles.d.ts +20 -14
- package/lib/typescript/theme/createStyles.d.ts.map +1 -1
- package/lib/typescript/theme/createTheme.d.ts +5 -5
- package/lib/typescript/theme/index.d.ts +1 -1
- package/lib/typescript/theme/index.d.ts.map +1 -1
- package/lib/typescript/theme/insets.d.ts +1 -1
- package/lib/typescript/theme/insets.d.ts.map +1 -1
- package/lib/typescript/theme/labels.d.ts +57 -2
- package/lib/typescript/theme/labels.d.ts.map +1 -1
- package/lib/typescript/theme/palettes.d.ts +25 -19
- package/lib/typescript/theme/palettes.d.ts.map +1 -1
- package/lib/typescript/theme/tokens.d.ts +15 -8
- package/lib/typescript/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/theme/types.d.ts +7 -7
- package/lib/typescript/theme/types.d.ts.map +1 -1
- package/lib/typescript/theme/useKeyboardField.d.ts +17 -0
- package/lib/typescript/theme/useKeyboardField.d.ts.map +1 -0
- package/lib/typescript/theme/useReduceMotion.d.ts +7 -0
- package/lib/typescript/theme/useReduceMotion.d.ts.map +1 -0
- package/llms.txt +4 -4
- package/package.json +15 -14
- package/registry/alert-provider.json +4 -3
- package/registry/alert.json +3 -2
- package/registry/avatar-header.json +1 -1
- package/registry/avatar.json +3 -2
- package/registry/badge.json +1 -1
- package/registry/bottom-sheet.json +1 -1
- package/registry/button.json +3 -2
- package/registry/card.json +1 -1
- package/registry/chart.json +5 -5
- package/registry/checkbox.json +3 -2
- package/registry/core.json +31 -15
- package/registry/date-field.json +1 -1
- package/registry/date-picker.json +3 -2
- package/registry/divider.json +1 -1
- package/registry/empty-state.json +4 -2
- package/registry/fab.json +3 -2
- package/registry/form-actions.json +3 -2
- package/registry/gradient.json +1 -1
- package/registry/icon-button.json +3 -2
- package/registry/image.json +1 -1
- package/registry/index.json +79 -61
- package/registry/info-row.json +1 -1
- package/registry/input.json +5 -1
- package/registry/key-value-row.json +1 -1
- package/registry/list.json +3 -1
- package/registry/manifest.json +3 -1
- package/registry/modal.json +1 -1
- package/registry/navigation-bar.json +1 -1
- package/registry/option-card.json +3 -2
- package/registry/option-wheel.json +1 -1
- package/registry/pressable-scale.json +3 -2
- package/registry/reorderable-list.json +1 -1
- package/registry/screen.json +1 -1
- package/registry/search-list.json +7 -1
- package/registry/segmented-control.json +1 -1
- package/registry/select.json +1 -1
- package/registry/shiny-text.json +1 -1
- package/registry/skeleton.json +3 -2
- package/registry/slides.json +2 -2
- package/registry/spinner.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/steps.json +1 -1
- package/registry/symmetric-grid.json +1 -1
- package/registry/theme-toggle.json +1 -1
- package/registry/timeline.json +1 -1
- package/registry/title.json +1 -1
- package/registry/toast-provider.json +2 -2
- package/registry/toast.json +1 -1
- package/registry/transition.json +1 -1
- package/registry/wizard.json +1 -1
- package/src/atoms/Avatar.tsx +117 -26
- package/src/atoms/Badge.tsx +20 -9
- package/src/atoms/Button.tsx +102 -30
- package/src/atoms/Card.tsx +23 -3
- package/src/atoms/Checkbox.tsx +49 -12
- package/src/atoms/Divider.tsx +34 -4
- package/src/atoms/EmptyState.tsx +63 -16
- package/src/atoms/Fab.tsx +56 -9
- package/src/atoms/Gradient.tsx +92 -41
- package/src/atoms/IconButton.tsx +27 -4
- package/src/atoms/Image.tsx +74 -28
- package/src/atoms/Input.tsx +129 -19
- package/src/atoms/KeyValueRow.tsx +72 -28
- package/src/atoms/PressableScale.tsx +31 -7
- package/src/atoms/ShinyText.tsx +31 -31
- package/src/atoms/Skeleton.tsx +37 -17
- package/src/atoms/Spinner.tsx +87 -24
- package/src/atoms/Text.tsx +66 -6
- package/src/atoms/Transition.tsx +40 -44
- package/src/atoms/index.ts +3 -3
- package/src/atoms/inputValidation.ts +59 -0
- package/src/icons/Icon.tsx +4 -4
- package/src/icons/defaultIcons.tsx +445 -22
- package/src/icons/index.ts +2 -2
- package/src/icons/types.ts +26 -4
- package/src/molecules/AvatarHeader.tsx +88 -34
- package/src/molecules/FormActions.tsx +36 -6
- package/src/molecules/InfoRow.tsx +39 -12
- package/src/molecules/OptionCard.tsx +55 -20
- package/src/molecules/SegmentedControl.tsx +135 -15
- package/src/molecules/Stepper.tsx +73 -19
- package/src/molecules/Steps.tsx +121 -39
- package/src/molecules/SymmetricGrid.tsx +28 -12
- package/src/organisms/Alert.tsx +97 -26
- package/src/organisms/AlertProvider.tsx +13 -13
- package/src/organisms/BottomSheet.tsx +115 -43
- package/src/organisms/Chart.tsx +223 -165
- package/src/organisms/DateField.tsx +40 -15
- package/src/organisms/DatePicker.tsx +53 -32
- package/src/organisms/List.tsx +64 -15
- package/src/organisms/Modal.tsx +122 -63
- package/src/organisms/NavigationBar.tsx +73 -23
- package/src/organisms/OptionWheel.tsx +70 -66
- package/src/organisms/ReorderableList.tsx +49 -27
- package/src/organisms/Screen.tsx +79 -42
- package/src/organisms/SearchList.tsx +84 -20
- package/src/organisms/Select.tsx +63 -29
- package/src/organisms/Slides.tsx +63 -44
- package/src/organisms/ThemeToggle.tsx +15 -6
- package/src/organisms/Timeline.tsx +79 -62
- package/src/organisms/Toast.tsx +50 -15
- package/src/organisms/ToastProvider.tsx +17 -13
- package/src/organisms/Wizard.tsx +58 -21
- package/src/organisms/chart/frame.tsx +35 -35
- package/src/organisms/chart/marks.tsx +53 -53
- package/src/organisms/chart/math.ts +93 -94
- package/src/organisms/chart/palette.ts +28 -28
- package/src/organisms/imperativeBridge.ts +5 -5
- package/src/organisms/useSlides.ts +66 -31
- package/src/safe-area/SafeAreaUIProvider.tsx +9 -70
- package/src/safe-area/index.ts +1 -0
- package/src/theme/KeyboardAvoidance.tsx +216 -0
- package/src/theme/NativeOverlay.tsx +269 -0
- package/src/theme/UIProvider.tsx +109 -46
- package/src/theme/colors.ts +21 -21
- package/src/theme/createStyles.ts +23 -19
- package/src/theme/createTheme.ts +6 -6
- package/src/theme/index.ts +1 -1
- package/src/theme/insets.ts +1 -1
- package/src/theme/labels.ts +85 -2
- package/src/theme/palettes.ts +33 -25
- package/src/theme/tokens.ts +27 -13
- package/src/theme/types.ts +7 -7
- package/src/theme/useKeyboardField.ts +33 -0
- package/src/theme/useReduceMotion.ts +27 -0
|
@@ -13,13 +13,15 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
13
13
|
const useStyles = (0, _createStyles.createStyles)(theme => ({
|
|
14
14
|
title: {
|
|
15
15
|
fontSize: theme.tokens.fontSize.xxl,
|
|
16
|
+
lineHeight: theme.tokens.lineHeight.xl,
|
|
16
17
|
fontWeight: theme.tokens.fontWeight.bold,
|
|
17
|
-
letterSpacing:
|
|
18
|
+
letterSpacing: theme.tokens.letterSpacing.tight,
|
|
18
19
|
color: theme.colors.text
|
|
19
20
|
},
|
|
20
21
|
subtitle: {
|
|
21
22
|
fontSize: theme.tokens.fontSize.lg,
|
|
22
|
-
|
|
23
|
+
lineHeight: theme.tokens.lineHeight.lg,
|
|
24
|
+
fontWeight: theme.tokens.fontWeight.semibold,
|
|
23
25
|
color: theme.colors.text
|
|
24
26
|
},
|
|
25
27
|
body: {
|
|
@@ -29,10 +31,11 @@ const useStyles = (0, _createStyles.createStyles)(theme => ({
|
|
|
29
31
|
},
|
|
30
32
|
caption: {
|
|
31
33
|
fontSize: theme.tokens.fontSize.sm,
|
|
34
|
+
lineHeight: theme.tokens.lineHeight.sm,
|
|
32
35
|
color: theme.colors.textLight
|
|
33
36
|
}
|
|
34
37
|
}));
|
|
35
|
-
function makeVariant(variant, defaultColor) {
|
|
38
|
+
function makeVariant(variant, defaultColor, defaultRole) {
|
|
36
39
|
const Component = /*#__PURE__*/(0, _react.memo)(({
|
|
37
40
|
children,
|
|
38
41
|
style,
|
|
@@ -45,6 +48,7 @@ function makeVariant(variant, defaultColor) {
|
|
|
45
48
|
const allowFontScaling = (0, _UIProvider.useAllowFontScaling)();
|
|
46
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
47
50
|
allowFontScaling: allowFontScaling,
|
|
51
|
+
accessibilityRole: defaultRole,
|
|
48
52
|
style: [styles[variant], {
|
|
49
53
|
color: color || colors[defaultColor],
|
|
50
54
|
textAlign: align
|
|
@@ -53,11 +57,58 @@ function makeVariant(variant, defaultColor) {
|
|
|
53
57
|
children: children
|
|
54
58
|
});
|
|
55
59
|
});
|
|
56
|
-
Component.displayName = variant;
|
|
60
|
+
Component.displayName = String(variant);
|
|
57
61
|
return Component;
|
|
58
62
|
}
|
|
59
|
-
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Screen or section title: the highest step of the typographic hierarchy.
|
|
66
|
+
*
|
|
67
|
+
* Gestalt, focal point (Von Restorff): it is the only text in its block with
|
|
68
|
+
* size `xxl` and weight `bold`, so it breaks the series of Body/Caption and is
|
|
69
|
+
* the first thing read. That is why there should be only one per block: two
|
|
70
|
+
* Titles together cancel each other out. The `tight` tracking offsets the room
|
|
71
|
+
* the large size opens between letters so the word reads as a single shape
|
|
72
|
+
* (Prägnanz), and `lineHeight.xl` keeps the block compact when the title wraps.
|
|
73
|
+
*
|
|
74
|
+
* Accessibility: it is announced with `accessibilityRole="header"`, so
|
|
75
|
+
* VoiceOver/TalkBack can jump from title to title. It can be overridden by
|
|
76
|
+
* passing a different `accessibilityRole`.
|
|
77
|
+
*/
|
|
78
|
+
const Title = exports.Title = makeVariant('title', 'text', 'header');
|
|
79
|
+
/**
|
|
80
|
+
* Second step of the hierarchy: heads a group within the screen or
|
|
81
|
+
* accompanies a Title with a short piece of data.
|
|
82
|
+
*
|
|
83
|
+
* Gestalt, similarity: it shares its color with Body but steps up size (`lg`)
|
|
84
|
+
* and weight (`semibold`), so it is perceived as part of the same family and,
|
|
85
|
+
* at the same time, as the label of the block that follows. Proximity: it
|
|
86
|
+
* should sit closer to the content it heads than to the previous block. It is
|
|
87
|
+
* not an accessibility heading: if it marks a navigable section, use Title (or
|
|
88
|
+
* pass `accessibilityRole="header"`).
|
|
89
|
+
* `lineHeight.lg` (1.5×) keeps the text legible when it spans several lines.
|
|
90
|
+
*/
|
|
60
91
|
const Subtitle = exports.Subtitle = makeVariant('subtitle', 'text');
|
|
92
|
+
/**
|
|
93
|
+
* Running text: the default style for paragraphs, descriptions and values.
|
|
94
|
+
*
|
|
95
|
+
* Gestalt, similarity: all reading content shares size (`md`), regular weight
|
|
96
|
+
* and the `text` color, so it is perceived as a single level and the steps
|
|
97
|
+
* above (Title, Subtitle) and below (Caption) stand out by contrast.
|
|
98
|
+
* `lineHeight.md` (≈1.43×) gives the room between lines to read long
|
|
99
|
+
* paragraphs. If `color` is passed, the color/background pair must meet WCAG
|
|
100
|
+
* AA (4.5:1); the theme colors already guarantee it.
|
|
101
|
+
*/
|
|
61
102
|
const Body = exports.Body = makeVariant('body', 'text');
|
|
103
|
+
/**
|
|
104
|
+
* Secondary text: hints, metadata, dates, help below a field.
|
|
105
|
+
*
|
|
106
|
+
* Gestalt, figure and ground: size `sm` and color `textLight` bring it one
|
|
107
|
+
* step below Body, so it reads as context and doesn't compete with the
|
|
108
|
+
* content. Proximity: it sits right next to the element it explains.
|
|
109
|
+
* `textLight` meets WCAG AA over `surface` and `background` in light and dark
|
|
110
|
+
* (palettes tests); don't lighten it further. `lineHeight.sm` (≈1.33×) keeps
|
|
111
|
+
* the lines together when the hint spans several.
|
|
112
|
+
*/
|
|
62
113
|
const Caption = exports.Caption = makeVariant('caption', 'textLight');
|
|
63
114
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createStyles","_UIProvider","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useStyles","createStyles","theme","title","fontSize","tokens","xxl","fontWeight","bold","letterSpacing","color","colors","text","subtitle","lg","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createStyles","_UIProvider","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useStyles","createStyles","theme","title","fontSize","tokens","xxl","lineHeight","xl","fontWeight","bold","letterSpacing","tight","color","colors","text","subtitle","lg","semibold","body","md","caption","sm","textLight","makeVariant","variant","defaultColor","defaultRole","Component","memo","children","style","align","props","styles","useColors","allowFontScaling","useAllowFontScaling","jsx","Text","accessibilityRole","textAlign","displayName","String","Title","exports","Subtitle","Body","Caption"],"sourceRoot":"../../../src","sources":["atoms/Text.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAqE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC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AAC,UAAU,EAAE,MAAM,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMuB,IAAI,GAAAF,OAAA,CAAAE,IAAA,GAAGvB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMwB,OAAO,GAAAH,OAAA,CAAAG,OAAA,GAAGxB,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC","ignoreList":[]}
|
|
@@ -4,51 +4,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Transition = void 0;
|
|
7
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "useReduceMotion", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _useReduceMotion.useReduceMotion;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
8
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
14
|
var _reactNative = require("react-native");
|
|
10
15
|
var _UIProvider = require("../theme/UIProvider");
|
|
16
|
+
var _useReduceMotion = require("../theme/useReduceMotion");
|
|
11
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
19
|
const SCALE_FROM = {
|
|
14
20
|
scale: 0.92,
|
|
15
21
|
pop: 0.8
|
|
16
22
|
};
|
|
23
|
+
const hiddenStyle = {
|
|
24
|
+
pointerEvents: 'none'
|
|
25
|
+
};
|
|
26
|
+
/** 'pop' spring: bounces once and settles (~350 ms), without oscillating. */
|
|
27
|
+
const POP_SPRING = {
|
|
28
|
+
friction: 9,
|
|
29
|
+
tension: 90
|
|
30
|
+
};
|
|
17
31
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* animaciones saltan al estado final en vez de desactivarse, así que los
|
|
21
|
-
* callbacks y el desmontaje siguen ocurriendo igual.
|
|
22
|
-
*/
|
|
23
|
-
function useReduceMotion() {
|
|
24
|
-
const [reduceMotion, setReduceMotion] = (0, _react.useState)(false);
|
|
25
|
-
(0, _react.useEffect)(() => {
|
|
26
|
-
let alive = true;
|
|
27
|
-
// Sólo se actualiza el estado si el ajuste está activo: el valor inicial ya
|
|
28
|
-
// es `false` y un setState de false a false costaría un render por montaje.
|
|
29
|
-
_reactNative.AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
|
|
30
|
-
if (alive && enabled) setReduceMotion(true);
|
|
31
|
-
});
|
|
32
|
-
const sub = _reactNative.AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotion);
|
|
33
|
-
return () => {
|
|
34
|
-
alive = false;
|
|
35
|
-
sub.remove();
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
return reduceMotion;
|
|
39
|
-
}
|
|
32
|
+
// Lives in theme/ (UIProvider uses it too); re-exported here so existing
|
|
33
|
+
// imports don't break.
|
|
40
34
|
|
|
41
35
|
/**
|
|
42
36
|
* Transition
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
37
|
+
* Wraps any tree and animates it on enter and exit. Every preset boils down
|
|
38
|
+
* to `opacity` and `transform` over a single Animated.Value, which is what
|
|
39
|
+
* `useNativeDriver` knows how to send to the native thread: the animation runs
|
|
40
|
+
* there and the JS thread takes part in no frame — that is why there are no
|
|
41
|
+
* height, width or color presets, which would force a return to JS every frame.
|
|
42
|
+
*
|
|
43
|
+
* The node stays mounted until the exit animation finishes, and the behavior
|
|
44
|
+
* is identical on iOS and Android: there is no per-platform branch. While
|
|
45
|
+
* exiting (or hidden with `keepMounted`) it stops receiving touches and leaves
|
|
46
|
+
* the accessibility tree: what is invisible isn't read.
|
|
48
47
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
48
|
+
* Gestalt, common fate: what enters or exits together is perceived as a group;
|
|
49
|
+
* with a per-index `delay` the list enters in reading order (continuity).
|
|
50
|
+
* Respects Reduce Motion: jumps to the final state, callbacks still fire.
|
|
52
51
|
*/
|
|
53
52
|
const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
54
53
|
children,
|
|
@@ -56,7 +55,7 @@ const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
|
56
55
|
preset = 'fade',
|
|
57
56
|
duration,
|
|
58
57
|
delay = 0,
|
|
59
|
-
distance
|
|
58
|
+
distance,
|
|
60
59
|
spring,
|
|
61
60
|
appear = true,
|
|
62
61
|
keepMounted = false,
|
|
@@ -67,14 +66,18 @@ const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
|
67
66
|
testID
|
|
68
67
|
}) => {
|
|
69
68
|
const theme = (0, _UIProvider.useTheme)();
|
|
70
|
-
const
|
|
69
|
+
const travel = distance ?? theme.tokens.spacing.xxl;
|
|
70
|
+
// Resolved here, not inside the effect: depending on `theme` restarted the
|
|
71
|
+
// animation (and fired onEntered again) every time the theme changed.
|
|
72
|
+
const resolvedDuration = duration ?? theme.tokens.duration.base;
|
|
73
|
+
const reduceMotion = (0, _useReduceMotion.useReduceMotion)();
|
|
71
74
|
const internal = (0, _react.useRef)(new _reactNative.Animated.Value(visible && !appear ? 1 : 0)).current;
|
|
72
75
|
const progress = value ?? internal;
|
|
73
76
|
const driven = value === undefined;
|
|
74
77
|
const [mounted, setMounted] = (0, _react.useState)(visible || keepMounted);
|
|
75
78
|
|
|
76
|
-
//
|
|
77
|
-
//
|
|
79
|
+
// The callbacks live in a ref: passed inline they change identity on
|
|
80
|
+
// every render and, as effect dependencies, would restart the animation.
|
|
78
81
|
const callbacks = (0, _react.useRef)({
|
|
79
82
|
onEntered,
|
|
80
83
|
onExited
|
|
@@ -102,13 +105,12 @@ const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
|
102
105
|
}) : useSpring ? _reactNative.Animated.spring(progress, {
|
|
103
106
|
toValue,
|
|
104
107
|
delay,
|
|
105
|
-
|
|
106
|
-
tension: 90,
|
|
108
|
+
...POP_SPRING,
|
|
107
109
|
useNativeDriver: true
|
|
108
110
|
}) : _reactNative.Animated.timing(progress, {
|
|
109
111
|
toValue,
|
|
110
112
|
delay,
|
|
111
|
-
duration:
|
|
113
|
+
duration: resolvedDuration,
|
|
112
114
|
easing: visible ? _reactNative.Easing.out(_reactNative.Easing.cubic) : _reactNative.Easing.in(_reactNative.Easing.cubic),
|
|
113
115
|
useNativeDriver: true
|
|
114
116
|
});
|
|
@@ -124,7 +126,7 @@ const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
|
124
126
|
if (!keepMounted) setMounted(false);
|
|
125
127
|
});
|
|
126
128
|
return () => animation.stop();
|
|
127
|
-
}, [visible, driven, reduceMotion, spring, delay,
|
|
129
|
+
}, [visible, driven, reduceMotion, spring, delay, resolvedDuration, keepMounted, presets, progress]);
|
|
128
130
|
const animatedStyle = (0, _react.useMemo)(() => {
|
|
129
131
|
const transform = [];
|
|
130
132
|
let opacity;
|
|
@@ -143,7 +145,7 @@ const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
|
143
145
|
continue;
|
|
144
146
|
}
|
|
145
147
|
const vertical = item === 'slide-up' || item === 'slide-down';
|
|
146
|
-
const from = item === 'slide-up' || item === 'slide-left' ?
|
|
148
|
+
const from = item === 'slide-up' || item === 'slide-left' ? travel : -travel;
|
|
147
149
|
const offset = progress.interpolate({
|
|
148
150
|
inputRange: [0, 1],
|
|
149
151
|
outputRange: [from, 0]
|
|
@@ -158,12 +160,13 @@ const Transition = exports.Transition = /*#__PURE__*/(0, _react.memo)(({
|
|
|
158
160
|
opacity,
|
|
159
161
|
transform
|
|
160
162
|
};
|
|
161
|
-
}, [presets, progress,
|
|
163
|
+
}, [presets, progress, travel]);
|
|
162
164
|
if (!mounted) return null;
|
|
163
165
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
164
166
|
testID: testID,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
accessibilityElementsHidden: !visible,
|
|
168
|
+
importantForAccessibility: visible ? 'auto' : 'no-hide-descendants',
|
|
169
|
+
style: [style, animatedStyle, !visible && hiddenStyle],
|
|
167
170
|
children: children
|
|
168
171
|
});
|
|
169
172
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_UIProvider","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SCALE_FROM","scale","pop","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_UIProvider","_useReduceMotion","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SCALE_FROM","scale","pop","hiddenStyle","pointerEvents","POP_SPRING","friction","tension","Transition","exports","memo","children","visible","preset","duration","delay","distance","spring","appear","keepMounted","value","onEntered","onExited","style","testID","theme","useTheme","travel","tokens","spacing","xxl","resolvedDuration","base","reduceMotion","useReduceMotion","internal","useRef","Animated","Value","current","progress","driven","undefined","mounted","setMounted","useState","callbacks","useEffect","presetKey","Array","isArray","join","presets","useMemo","split","toValue","useSpring","includes","animation","timing","useNativeDriver","easing","Easing","out","cubic","in","start","finished","stop","animatedStyle","transform","opacity","item","push","interpolate","inputRange","outputRange","vertical","from","offset","translateY","translateX","jsx","View","accessibilityElementsHidden","importantForAccessibility","displayName"],"sourceRoot":"../../../src","sources":["atoms/Transition.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAA2D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAA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wE,IAAI,CAAC,EAAE,CAAC;UAAE,CAAC;QACxF,CAAC,CAAC;QACF;MACF;MACA,MAAMK,QAAQ,GAAGL,IAAI,KAAK,UAAU,IAAIA,IAAI,KAAK,YAAY;MAC7D,MAAMM,IAAI,GAAGN,IAAI,KAAK,UAAU,IAAIA,IAAI,KAAK,YAAY,GAAG7C,MAAM,GAAG,CAACA,MAAM;MAC5E,MAAMoD,MAAM,GAAGvC,QAAQ,CAACkC,WAAW,CAAC;QAAEC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAAEC,WAAW,EAAE,CAACE,IAAI,EAAE,CAAC;MAAE,CAAC,CAAC;MACnFR,SAAS,CAACG,IAAI,CAACI,QAAQ,GAAG;QAAEG,UAAU,EAAED;MAAO,CAAC,GAAG;QAAEE,UAAU,EAAEF;MAAO,CAAC,CAAC;IAC5E;IAEA,OAAO;MAAER,OAAO;MAAED;IAAU,CAAC;EAC/B,CAAC,EAAE,CAAClB,OAAO,EAAEZ,QAAQ,EAAEb,MAAM,CAAC,CAAC;EAE/B,IAAI,CAACgB,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACE,IAAA/D,WAAA,CAAAsG,GAAA,EAACzG,YAAA,CAAA4D,QAAQ,CAAC8C,IAAI;IACZ3D,MAAM,EAAEA,MAAO;IACf4D,2BAA2B,EAAE,CAACxE,OAAQ;IACtCyE,yBAAyB,EAAEzE,OAAO,GAAG,MAAM,GAAG,qBAAsB;IACpEW,KAAK,EAAE,CAACA,KAAK,EAAE8C,aAAa,EAAE,CAACzD,OAAO,IAAIT,WAAW,CAAE;IAAAQ,QAAA,EAEtDA;EAAQ,CACI,CAAC;AAEpB,CACF,CAAC;AACDH,UAAU,CAAC8E,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -135,6 +135,12 @@ Object.defineProperty(exports, "Transition", {
|
|
|
135
135
|
return _Transition.Transition;
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
+
Object.defineProperty(exports, "initialsOf", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _Avatar.initialsOf;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
138
144
|
Object.defineProperty(exports, "prefetchImage", {
|
|
139
145
|
enumerable: true,
|
|
140
146
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Text","require","_Button","_IconButton","_Input","_Checkbox","_Badge","_Card","_Divider","_Gradient","_Avatar","_Image","_Spinner","_Skeleton","_Transition","_ShinyText","_EmptyState","_KeyValueRow","_Fab","_PressableScale"],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_Text","require","_Button","_IconButton","_Input","_Checkbox","_Badge","_Card","_Divider","_Gradient","_Avatar","_Image","_Spinner","_Skeleton","_Transition","_ShinyText","_EmptyState","_KeyValueRow","_Fab","_PressableScale"],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AAEA,IAAAQ,SAAA,GAAAR,OAAA;AAEA,IAAAS,OAAA,GAAAT,OAAA;AAEA,IAAAU,MAAA,GAAAV,OAAA;AAEA,IAAAW,QAAA,GAAAX,OAAA;AAEA,IAAAY,SAAA,GAAAZ,OAAA;AAEA,IAAAa,WAAA,GAAAb,OAAA;AAEA,IAAAc,UAAA,GAAAd,OAAA;AAEA,IAAAe,WAAA,GAAAf,OAAA;AAEA,IAAAgB,YAAA,GAAAhB,OAAA;AAEA,IAAAiB,IAAA,GAAAjB,OAAA;AAEA,IAAAkB,eAAA,GAAAlB,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateInputValue = validateInputValue;
|
|
7
|
+
/** A rule's value, optionally with its own message instead of the default label. */
|
|
8
|
+
|
|
9
|
+
function unpack(rule) {
|
|
10
|
+
return typeof rule === 'object' && rule !== null && 'value' in rule && 'message' in rule ? rule : {
|
|
11
|
+
value: rule
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Error for the value, or undefined if it is valid. Order: required, min
|
|
17
|
+
* length, max length, pattern, custom validation — a single error is shown,
|
|
18
|
+
* the first one. An empty optional field is valid: the other rules don't run on nothing.
|
|
19
|
+
*/
|
|
20
|
+
function validateInputValue(value, {
|
|
21
|
+
required,
|
|
22
|
+
rules
|
|
23
|
+
}, labels) {
|
|
24
|
+
if (value.trim() === '') return required ? labels.requiredError : undefined;
|
|
25
|
+
if (!rules) return undefined;
|
|
26
|
+
if (rules.minLength !== undefined) {
|
|
27
|
+
const {
|
|
28
|
+
value: n,
|
|
29
|
+
message
|
|
30
|
+
} = unpack(rules.minLength);
|
|
31
|
+
if (value.length < n) return message ?? labels.minLengthError.replace('{n}', String(n));
|
|
32
|
+
}
|
|
33
|
+
if (rules.maxLength !== undefined) {
|
|
34
|
+
const {
|
|
35
|
+
value: n,
|
|
36
|
+
message
|
|
37
|
+
} = unpack(rules.maxLength);
|
|
38
|
+
if (value.length > n) return message ?? labels.maxLengthError.replace('{n}', String(n));
|
|
39
|
+
}
|
|
40
|
+
if (rules.pattern !== undefined) {
|
|
41
|
+
const {
|
|
42
|
+
value: re,
|
|
43
|
+
message
|
|
44
|
+
} = unpack(rules.pattern);
|
|
45
|
+
// A RegExp with the `g` flag keeps lastIndex between calls: reset it.
|
|
46
|
+
re.lastIndex = 0;
|
|
47
|
+
if (!re.test(value)) return message ?? labels.patternError;
|
|
48
|
+
}
|
|
49
|
+
if (rules.validate) {
|
|
50
|
+
const result = rules.validate(value);
|
|
51
|
+
if (typeof result === 'string' && result !== '') return result;
|
|
52
|
+
if (result === false) return labels.patternError;
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=inputValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["unpack","rule","value","validateInputValue","required","rules","labels","trim","requiredError","undefined","minLength","n","message","length","minLengthError","replace","String","maxLength","maxLengthError","pattern","re","lastIndex","test","patternError","validate","result"],"sourceRoot":"../../../src","sources":["atoms/inputValidation.ts"],"mappings":";;;;;;AAEA;;AAiBA,SAASA,MAAMA,CAAIC,IAAuB,EAAkC;EAC1E,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,KAAK,IAAI,IAAI,OAAO,IAAIA,IAAI,IAAI,SAAS,IAAIA,IAAI,GACnFA,IAAI,GACL;IAAEC,KAAK,EAAED;EAAU,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,kBAAkBA,CAChCD,KAAa,EACb;EAAEE,QAAQ;EAAEC;AAAkD,CAAC,EAC/DC,MAAc,EACM;EACpB,IAAIJ,KAAK,CAACK,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,OAAOH,QAAQ,GAAGE,MAAM,CAACE,aAAa,GAAGC,SAAS;EAC3E,IAAI,CAACJ,KAAK,EAAE,OAAOI,SAAS;EAE5B,IAAIJ,KAAK,CAACK,SAAS,KAAKD,SAAS,EAAE;IACjC,MAAM;MAAEP,KAAK,EAAES,CAAC;MAAEC;IAAQ,CAAC,GAAGZ,MAAM,CAACK,KAAK,CAACK,SAAS,CAAC;IACrD,IAAIR,KAAK,CAACW,MAAM,GAAGF,CAAC,EAAE,OAAOC,OAAO,IAAIN,MAAM,CAACQ,cAAc,CAACC,OAAO,CAAC,KAAK,EAAEC,MAAM,CAACL,CAAC,CAAC,CAAC;EACzF;EACA,IAAIN,KAAK,CAACY,SAAS,KAAKR,SAAS,EAAE;IACjC,MAAM;MAAEP,KAAK,EAAES,CAAC;MAAEC;IAAQ,CAAC,GAAGZ,MAAM,CAACK,KAAK,CAACY,SAAS,CAAC;IACrD,IAAIf,KAAK,CAACW,MAAM,GAAGF,CAAC,EAAE,OAAOC,OAAO,IAAIN,MAAM,CAACY,cAAc,CAACH,OAAO,CAAC,KAAK,EAAEC,MAAM,CAACL,CAAC,CAAC,CAAC;EACzF;EACA,IAAIN,KAAK,CAACc,OAAO,KAAKV,SAAS,EAAE;IAC/B,MAAM;MAAEP,KAAK,EAAEkB,EAAE;MAAER;IAAQ,CAAC,GAAGZ,MAAM,CAACK,KAAK,CAACc,OAAO,CAAC;IACpD;IACAC,EAAE,CAACC,SAAS,GAAG,CAAC;IAChB,IAAI,CAACD,EAAE,CAACE,IAAI,CAACpB,KAAK,CAAC,EAAE,OAAOU,OAAO,IAAIN,MAAM,CAACiB,YAAY;EAC5D;EACA,IAAIlB,KAAK,CAACmB,QAAQ,EAAE;IAClB,MAAMC,MAAM,GAAGpB,KAAK,CAACmB,QAAQ,CAACtB,KAAK,CAAC;IACpC,IAAI,OAAOuB,MAAM,KAAK,QAAQ,IAAIA,MAAM,KAAK,EAAE,EAAE,OAAOA,MAAM;IAC9D,IAAIA,MAAM,KAAK,KAAK,EAAE,OAAOnB,MAAM,CAACiB,YAAY;EAClD;EACA,OAAOd,SAAS;AAClB","ignoreList":[]}
|
|
@@ -11,10 +11,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
12
|
/**
|
|
13
13
|
* Icon
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Resolves the glyph through the active renderer (UIProvider.icons, the
|
|
15
|
+
* zero-dep default if none was configured). Internal use by the library —
|
|
16
|
+
* public components expose `icon?: ReactNode` in addition to this, so the
|
|
17
|
+
* consumer can inject any icon without going through the name system.
|
|
18
18
|
*/
|
|
19
19
|
const Icon = exports.Icon = /*#__PURE__*/(0, _react.memo)(({
|
|
20
20
|
name,
|