orn-ui 0.2.10 → 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 +66 -51
- package/README.md +3 -7
- 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 +174 -154
- 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 +176 -156
- 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 +193 -164
- 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
|
@@ -8,31 +8,34 @@ var _reactNative = require("react-native");
|
|
|
8
8
|
var _UIProvider = require("./UIProvider");
|
|
9
9
|
/**
|
|
10
10
|
* createStyles(factory)
|
|
11
|
-
*
|
|
12
|
-
* theme (WeakMap<Theme, Styles>),
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* Returns a useStyles() hook that memoizes the resulting StyleSheet per
|
|
12
|
+
* theme (WeakMap<Theme, Styles>), not per component instance. All rows of a
|
|
13
|
+
* list share the same styles object: without this, N rows ⇒ N
|
|
14
|
+
* StyleSheet.create() per render, which is what every component of the
|
|
15
|
+
* original app did with `useMemo(() => createStyles(colors), [colors])`.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The cache lives in the factory's closure (one WeakMap per createStyles
|
|
18
|
+
* call, i.e. one per component), so themes from different <UIProvider>s in
|
|
19
|
+
* the same tree don't collide with each other.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
21
|
+
* The `factory` type follows RN's pattern for typed StyleSheets
|
|
22
|
+
* (`T extends NamedStyles<T> | NamedStyles<any>`): it is what gives TS the
|
|
23
|
+
* context to infer literals ('row', 'center', ...) instead of widening them
|
|
24
|
+
* to `string` inside the returned object. `NamedStyles` is declared here:
|
|
25
|
+
* react-native 0.88's generated types (Expo SDK 58) no longer export
|
|
26
|
+
* `StyleSheet.NamedStyles`.
|
|
25
27
|
*/
|
|
28
|
+
|
|
26
29
|
function createStyles(factory) {
|
|
27
30
|
const cache = new WeakMap();
|
|
28
31
|
return function useStyles() {
|
|
29
32
|
const theme = (0, _UIProvider.useTheme)();
|
|
30
33
|
let styles = cache.get(theme);
|
|
31
34
|
if (!styles) {
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
35
|
+
// The cast is safe: StyleSheet.create<T>(...) with the factory's same T
|
|
36
|
+
// always returns T; TS can't prove it on its own inside a generic body
|
|
37
|
+
// (T could be "instantiated" with an unrelated subtype from its point
|
|
38
|
+
// of view, even though at runtime it is the same).
|
|
36
39
|
styles = _reactNative.StyleSheet.create(factory(theme));
|
|
37
40
|
cache.set(theme, styles);
|
|
38
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_UIProvider","createStyles","factory","cache","WeakMap","useStyles","theme","useTheme","styles","get","StyleSheet","create","set"],"sourceRoot":"../../../src","sources":["theme/createStyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_UIProvider","createStyles","factory","cache","WeakMap","useStyles","theme","useTheme","styles","get","StyleSheet","create","set"],"sourceRoot":"../../../src","sources":["theme/createStyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGO,SAASE,YAAYA,CAC1BC,OAA6C,EACpC;EACT,MAAMC,KAAK,GAAG,IAAIC,OAAO,CAAW,CAAC;EAErC,OAAO,SAASC,SAASA,CAAA,EAAM;IAC7B,MAAMC,KAAK,GAAG,IAAAC,oBAAQ,EAAC,CAAC;IACxB,IAAIC,MAAM,GAAGL,KAAK,CAACM,GAAG,CAACH,KAAK,CAAC;IAC7B,IAAI,CAACE,MAAM,EAAE;MACX;MACA;MACA;MACA;MACAA,MAAM,GAAGE,uBAAU,CAACC,MAAM,CAACT,OAAO,CAACI,KAAK,CAAC,CAAM;MAC/CH,KAAK,CAACS,GAAG,CAACN,KAAK,EAAEE,MAAM,CAAC;IAC1B;IACA,OAAOA,MAAM;EACf,CAAC;AACH","ignoreList":[]}
|
|
@@ -26,7 +26,7 @@ function mergeDeep(base, patch) {
|
|
|
26
26
|
}
|
|
27
27
|
const capitalize = name => name.charAt(0).toUpperCase() + name.slice(1);
|
|
28
28
|
|
|
29
|
-
/**
|
|
29
|
+
/** Expands each `brand` hex into the accent's four roles in a scheme. */
|
|
30
30
|
function brandColors(brand, scheme, palette) {
|
|
31
31
|
if (!brand) return {};
|
|
32
32
|
const accents = typeof brand === 'string' ? {
|
|
@@ -45,12 +45,12 @@ function brandColors(brand, scheme, palette) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* Builds the light/dark theme pair consumed by <UIProvider theme={...}>.
|
|
49
|
+
* Never mutates the defaults: each call produces new objects, safe to share
|
|
50
|
+
* between different providers (tests, multi-brand in the same tree).
|
|
51
51
|
*
|
|
52
|
-
* `brand`
|
|
53
|
-
*
|
|
52
|
+
* `brand` is applied before `colors`, so a hand-written role always wins
|
|
53
|
+
* over the derived one.
|
|
54
54
|
*/
|
|
55
55
|
function createTheme(overrides) {
|
|
56
56
|
const tokens = mergeDeep(_tokens.tokens, overrides?.tokens);
|
|
@@ -75,6 +75,12 @@ Object.defineProperty(exports, "fontWeight", {
|
|
|
75
75
|
return _tokens.fontWeight;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
Object.defineProperty(exports, "letterSpacing", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _tokens.letterSpacing;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
78
84
|
Object.defineProperty(exports, "lightPalette", {
|
|
79
85
|
enumerable: true,
|
|
80
86
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_tokens","require","_palettes","_createTheme","_colors","_labels","_insets","_createStyles","_UIProvider"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_tokens","require","_palettes","_createTheme","_colors","_labels","_insets","_createStyles","_UIProvider"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.zeroInsets = void 0;
|
|
7
|
-
/**
|
|
7
|
+
/** Structurally identical to react-native-safe-area-context's EdgeInsets, without depending on the package. */
|
|
8
8
|
|
|
9
9
|
const zeroInsets = exports.zeroInsets = {
|
|
10
10
|
top: 0,
|
|
@@ -17,6 +17,34 @@ const defaultLabels = exports.defaultLabels = {
|
|
|
17
17
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
18
18
|
weekdaysShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
|
19
19
|
selectDate: 'Select date',
|
|
20
|
-
clear: 'Clear'
|
|
20
|
+
clear: 'Clear',
|
|
21
|
+
showPassword: 'Show password',
|
|
22
|
+
hidePassword: 'Hide password',
|
|
23
|
+
required: 'required',
|
|
24
|
+
requiredError: 'This field is required',
|
|
25
|
+
minLengthError: 'Enter at least {n} characters',
|
|
26
|
+
maxLengthError: 'Enter at most {n} characters',
|
|
27
|
+
patternError: 'Invalid format',
|
|
28
|
+
quantity: 'Quantity',
|
|
29
|
+
increment: 'Increment',
|
|
30
|
+
decrement: 'Decrement',
|
|
31
|
+
stepOf: 'Step {n} of {total}: {label}',
|
|
32
|
+
stepCompleted: 'completed',
|
|
33
|
+
stepCurrent: 'current',
|
|
34
|
+
stepPending: 'pending',
|
|
35
|
+
previousMonth: 'Previous month',
|
|
36
|
+
nextMonth: 'Next month',
|
|
37
|
+
moveUp: 'Move up',
|
|
38
|
+
moveDown: 'Move down',
|
|
39
|
+
scan: 'Scan',
|
|
40
|
+
slideOf: 'Slide {n} of {total}',
|
|
41
|
+
pauseSlides: 'Pause automatic slides',
|
|
42
|
+
resumeSlides: 'Resume automatic slides',
|
|
43
|
+
themeSystem: 'Auto',
|
|
44
|
+
themeLight: 'Light',
|
|
45
|
+
themeDark: 'Dark',
|
|
46
|
+
back: 'Back',
|
|
47
|
+
next: 'Next',
|
|
48
|
+
finish: 'Finish'
|
|
21
49
|
};
|
|
22
50
|
//# sourceMappingURL=labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defaultLabels","exports","close","cancel","confirm","loading","loadingMore","noResultsTitle","noResultsDescription","search","selectPlaceholder","months","weekdaysShort","selectDate","clear"],"sourceRoot":"../../../src","sources":["theme/labels.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["defaultLabels","exports","close","cancel","confirm","loading","loadingMore","noResultsTitle","noResultsDescription","search","selectPlaceholder","months","weekdaysShort","selectDate","clear","showPassword","hidePassword","required","requiredError","minLengthError","maxLengthError","patternError","quantity","increment","decrement","stepOf","stepCompleted","stepCurrent","stepPending","previousMonth","nextMonth","moveUp","moveDown","scan","slideOf","pauseSlides","resumeSlides","themeSystem","themeLight","themeDark","back","next","finish"],"sourceRoot":"../../../src","sources":["theme/labels.ts"],"mappings":";;;;;;AAyEO,MAAMA,aAAqB,GAAAC,OAAA,CAAAD,aAAA,GAAG;EACnCE,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,IAAI;EACbC,OAAO,EAAE,YAAY;EACrBC,WAAW,EAAE,iBAAiB;EAC9BC,cAAc,EAAE,kBAAkB;EAClCC,oBAAoB,EAAE,6BAA6B;EACnDC,MAAM,EAAE,WAAW;EACnBC,iBAAiB,EAAE,WAAW;EAC9BC,MAAM,EAAE,CACN,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EACtD,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CACjE;EACDC,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EAClDC,UAAU,EAAE,aAAa;EACzBC,KAAK,EAAE,OAAO;EACdC,YAAY,EAAE,eAAe;EAC7BC,YAAY,EAAE,eAAe;EAC7BC,QAAQ,EAAE,UAAU;EACpBC,aAAa,EAAE,wBAAwB;EACvCC,cAAc,EAAE,+BAA+B;EAC/CC,cAAc,EAAE,8BAA8B;EAC9CC,YAAY,EAAE,gBAAgB;EAC9BC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EACtBC,MAAM,EAAE,8BAA8B;EACtCC,aAAa,EAAE,WAAW;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,gBAAgB;EAC/BC,SAAS,EAAE,YAAY;EACvBC,MAAM,EAAE,SAAS;EACjBC,QAAQ,EAAE,WAAW;EACrBC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,sBAAsB;EAC/BC,WAAW,EAAE,wBAAwB;EACrCC,YAAY,EAAE,yBAAyB;EACvCC,WAAW,EAAE,MAAM;EACnBC,UAAU,EAAE,OAAO;EACnBC,SAAS,EAAE,MAAM;EACjBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACV,CAAC","ignoreList":[]}
|
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.lightPalette = exports.darkPalette = void 0;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Each color is a `string`, not a literal (`as const`): light and dark have
|
|
9
|
+
* different values for the same key, and createTheme() must be able to
|
|
10
|
+
* accept any hex/rgba in the overrides — literal typing would prevent it.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* Each accent comes in four roles, and they are not interchangeable:
|
|
13
13
|
*
|
|
14
|
-
* `primary`
|
|
15
|
-
* `onPrimary`
|
|
16
|
-
* `primarySoft`
|
|
17
|
-
* `primaryText`
|
|
18
|
-
*
|
|
14
|
+
* `primary` solid fill (button background, selected day, FAB).
|
|
15
|
+
* `onPrimary` text/icon *on top of* that fill.
|
|
16
|
+
* `primarySoft` tinted background for selected states and pills.
|
|
17
|
+
* `primaryText` accent text/icon over `surface`, `background`
|
|
18
|
+
* or over its own `primarySoft`.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* The reason is contrast: an accent that reads well as a fill doesn't read
|
|
21
|
+
* as text. Components used to use `colors.primary` for both things and tinted
|
|
22
|
+
* it by appending alpha to the hex (`colors.primary + '15'`), which in dark
|
|
23
|
+
* gave 2.6:1 over the surface — well below WCAG AA's 4.5:1. Every pair in
|
|
24
|
+
* this palette passes AA in both schemes.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
const neutral = {
|
|
@@ -42,9 +42,9 @@ const lightPalette = exports.lightPalette = {
|
|
|
42
42
|
onSuccess: '#00320f',
|
|
43
43
|
successSoft: '#e3f6e9',
|
|
44
44
|
successText: '#116a30',
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
45
|
+
// Red goes with white text, which is what people expect from a destructive
|
|
46
|
+
// button. #ff3b30 doesn't reach 4.5:1 with white and forced near-black text
|
|
47
|
+
// over red; this shade does, and still reads as an alert red.
|
|
48
48
|
error: '#dc2626',
|
|
49
49
|
onError: '#ffffff',
|
|
50
50
|
errorSoft: '#fdeaea',
|
|
@@ -55,19 +55,20 @@ const lightPalette = exports.lightPalette = {
|
|
|
55
55
|
warningText: '#8a4b00',
|
|
56
56
|
background: '#f8f9fa',
|
|
57
57
|
surface: '#ffffff',
|
|
58
|
+
surfaceRaised: '#ffffff',
|
|
58
59
|
text: '#333333',
|
|
59
60
|
textLight: '#666666',
|
|
60
61
|
border: '#e5e7eb',
|
|
61
62
|
inputBackground: '#f5f7fa',
|
|
62
63
|
overlay: 'rgba(0,0,0,0.5)',
|
|
63
64
|
scrim: 'rgba(248,249,250,0.8)',
|
|
64
|
-
skeleton: '#
|
|
65
|
+
skeleton: '#e3e5e8'
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* `onPrimary`
|
|
69
|
+
* The dark accents are NOT the light ones: over `#1e1e1e` the accent's
|
|
70
|
+
* lightness has to go up and that of the text on top has to go down (which
|
|
71
|
+
* is why `onPrimary` is dark blue here and white in light).
|
|
71
72
|
*/
|
|
72
73
|
const darkPalette = exports.darkPalette = {
|
|
73
74
|
...neutral,
|
|
@@ -93,12 +94,13 @@ const darkPalette = exports.darkPalette = {
|
|
|
93
94
|
warningText: '#f5c97e',
|
|
94
95
|
background: '#121212',
|
|
95
96
|
surface: '#1e1e1e',
|
|
97
|
+
surfaceRaised: '#303036',
|
|
96
98
|
text: '#ecedee',
|
|
97
99
|
textLight: '#9ba1a6',
|
|
98
|
-
border: '#
|
|
100
|
+
border: '#3a3a40',
|
|
99
101
|
inputBackground: '#232326',
|
|
100
102
|
overlay: 'rgba(0,0,0,0.6)',
|
|
101
103
|
scrim: 'rgba(18,18,18,0.8)',
|
|
102
|
-
skeleton: '#
|
|
104
|
+
skeleton: '#44444b'
|
|
103
105
|
};
|
|
104
106
|
//# sourceMappingURL=palettes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["neutral","white","black","lightPalette","exports","primary","onPrimary","primarySoft","primaryText","secondary","onSecondary","secondarySoft","secondaryText","success","onSuccess","successSoft","successText","error","onError","errorSoft","errorText","warning","onWarning","warningSoft","warningText","background","surface","text","textLight","border","inputBackground","overlay","scrim","skeleton","darkPalette"],"sourceRoot":"../../../src","sources":["theme/palettes.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["neutral","white","black","lightPalette","exports","primary","onPrimary","primarySoft","primaryText","secondary","onSecondary","secondarySoft","secondaryText","success","onSuccess","successSoft","successText","error","onError","errorSoft","errorText","warning","onWarning","warningSoft","warningText","background","surface","surfaceRaised","text","textLight","border","inputBackground","overlay","scrim","skeleton","darkPalette"],"sourceRoot":"../../../src","sources":["theme/palettes.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgDA,MAAMA,OAAO,GAAG;EACdC,KAAK,EAAE,SAAS;EAChBC,KAAK,EAAE;AACT,CAAC;AAEM,MAAMC,YAAyB,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACvC,GAAGH,OAAO;EAEVK,OAAO,EAAE,SAAS;EA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,EAAE,SAAS;EACpBC,SAAS,EAAE,SAAS;EAEpBC,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,SAAS;EACxBC,IAAI,EAAE,SAAS;EACfC,SAAS,EAAE,SAAS;EACpBC,MAAM,EAAE,SAAS;EACjBC,eAAe,EAAE,SAAS;EAC1BC,OAAO,EAAE,iBAAiB;EAC1BC,KAAK,EAAE,oBAAoB;EAC3BC,QAAQ,EAAE;AACZ,CAAC","ignoreList":[]}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.tokens = exports.spacing = exports.shadow = exports.radius = exports.lineHeight = exports.fontWeight = exports.fontSize = exports.duration = void 0;
|
|
6
|
+
exports.tokens = exports.spacing = exports.shadow = exports.radius = exports.lineHeight = exports.letterSpacing = exports.fontWeight = exports.fontSize = exports.duration = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
-
//
|
|
9
|
-
// createTheme()
|
|
10
|
-
//
|
|
11
|
-
//
|
|
8
|
+
// Numeric scales are typed explicitly as `number` (not `as const`):
|
|
9
|
+
// createTheme() must be able to override any value with any other number:
|
|
10
|
+
// with literal typing, overriding `radius.md` to `999` would fail because
|
|
11
|
+
// the inferred type would be the literal `8`, not `number`.
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Spacing scale. Always use these values instead of magic numbers so the
|
|
15
|
+
* vertical/horizontal rhythm is consistent across components.
|
|
16
16
|
*/
|
|
17
17
|
const spacing = exports.spacing = {
|
|
18
18
|
xxs: 2,
|
|
@@ -43,8 +43,8 @@ const fontSize = exports.fontSize = {
|
|
|
43
43
|
xxl: 24
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
// fontWeight
|
|
47
|
-
//
|
|
46
|
+
// fontWeight does need literals: RN's TextStyle.fontWeight requires a union
|
|
47
|
+
// of specific strings ('400' | '500' | ...), not an arbitrary `string`.
|
|
48
48
|
const fontWeight = exports.fontWeight = {
|
|
49
49
|
regular: '400',
|
|
50
50
|
medium: '500',
|
|
@@ -54,19 +54,32 @@ const fontWeight = exports.fontWeight = {
|
|
|
54
54
|
const lineHeight = exports.lineHeight = {
|
|
55
55
|
sm: 16,
|
|
56
56
|
md: 20,
|
|
57
|
-
lg: 24
|
|
57
|
+
lg: 24,
|
|
58
|
+
xl: 30
|
|
58
59
|
};
|
|
59
60
|
|
|
60
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Tracking (letterSpacing) in points. `tight` offsets the extra room that
|
|
63
|
+
* large sizes bring by default (titles); `normal` is the system's;
|
|
64
|
+
* `wide` spaces out small caps.
|
|
65
|
+
*/
|
|
66
|
+
const letterSpacing = exports.letterSpacing = {
|
|
67
|
+
tight: -0.5,
|
|
68
|
+
normal: 0,
|
|
69
|
+
/** Short, small, uppercase labels (Badge): a little room makes them legible. */
|
|
70
|
+
wide: 0.3
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** Durations in ms for Animated.timing/spring. */
|
|
61
74
|
const duration = exports.duration = {
|
|
62
75
|
fast: 150,
|
|
63
76
|
base: 200,
|
|
64
77
|
slow: 250
|
|
65
78
|
};
|
|
66
79
|
/**
|
|
67
|
-
*
|
|
68
|
-
* `shadowColor`
|
|
69
|
-
*
|
|
80
|
+
* Cross-platform shadows: shadow* for iOS, elevation for Android.
|
|
81
|
+
* `shadowColor` is left fixed at black — a per-theme shadow color is too
|
|
82
|
+
* fine a detail to justify the complexity of resolving it here.
|
|
70
83
|
*/
|
|
71
84
|
const shadow = exports.shadow = {
|
|
72
85
|
none: _reactNative.Platform.select({
|
|
@@ -114,6 +127,7 @@ const tokens = exports.tokens = {
|
|
|
114
127
|
fontSize,
|
|
115
128
|
fontWeight,
|
|
116
129
|
lineHeight,
|
|
130
|
+
letterSpacing,
|
|
117
131
|
duration,
|
|
118
132
|
shadow
|
|
119
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","spacing","exports","xxs","xs","sm","md","lg","xl","xxl","xxxl","radius","none","full","fontSize","fontWeight","regular","medium","semibold","bold","lineHeight","duration","fast","base","slow","shadow","Platform","select","android","elevation","default","shadowOpacity","shadowColor","shadowOffset","width","height","shadowRadius","tokens"],"sourceRoot":"../../../src","sources":["theme/tokens.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO,MAAMC,OAAkF,GAAAC,OAAA,CAAAD,OAAA,GAAG;EAChGE,GAAG,EAAE,CAAC;EACNC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE,EAAE;EACPC,IAAI,EAAE;AACR,CAAC;AAEM,MAAMC,MAAkF,GAAAT,OAAA,CAAAS,MAAA,GAAG;EAChGC,IAAI,EAAE,CAAC;EACPR,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE,EAAE;EACPI,IAAI,EAAE;AACR,CAAC;AAEM,MAAMC,QAAkE,GAAAZ,OAAA,CAAAY,QAAA,GAAG;EAChFV,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE;AACP,CAAC;;AAED;AACA;AACO,MAAMM,UAAU,GAAAb,OAAA,CAAAa,UAAA,GAAG;EACxBC,OAAO,EAAE,KAAK;EACdC,MAAM,EAAE,KAAK;EACbC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAU;AAEH,MAAMC,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","spacing","exports","xxs","xs","sm","md","lg","xl","xxl","xxxl","radius","none","full","fontSize","fontWeight","regular","medium","semibold","bold","lineHeight","letterSpacing","tight","normal","wide","duration","fast","base","slow","shadow","Platform","select","android","elevation","default","shadowOpacity","shadowColor","shadowOffset","width","height","shadowRadius","tokens"],"sourceRoot":"../../../src","sources":["theme/tokens.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO,MAAMC,OAAkF,GAAAC,OAAA,CAAAD,OAAA,GAAG;EAChGE,GAAG,EAAE,CAAC;EACNC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE,EAAE;EACPC,IAAI,EAAE;AACR,CAAC;AAEM,MAAMC,MAAkF,GAAAT,OAAA,CAAAS,MAAA,GAAG;EAChGC,IAAI,EAAE,CAAC;EACPR,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE,EAAE;EACPI,IAAI,EAAE;AACR,CAAC;AAEM,MAAMC,QAAkE,GAAAZ,OAAA,CAAAY,QAAA,GAAG;EAChFV,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE;AACP,CAAC;;AAED;AACA;AACO,MAAMM,UAAU,GAAAb,OAAA,CAAAa,UAAA,GAAG;EACxBC,OAAO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AW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCJ,aAAa,EAAE,IAAI;IACnBK,YAAY,EAAE,EAAE;IAChBP,SAAS,EAAE;EACb;AACF,CAAC;AAEM,MAAMQ,MAAM,GAAAvC,OAAA,CAAAuC,MAAA,GAAG;EACpBxC,OAAO;EACPU,MAAM;EACNG,QAAQ;EACRC,UAAU;EACVK,UAAU;EACVC,aAAa;EACbI,QAAQ;EACRI;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useKeyboardField = useKeyboardField;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _KeyboardAvoidance = require("./KeyboardAvoidance");
|
|
9
|
+
/**
|
|
10
|
+
* Registers a text field with the nearest keyboard host (a Screen's content or
|
|
11
|
+
* the root UIProvider) so it stays visible above the keyboard. `boxRef` is the
|
|
12
|
+
* block that has to be seen whole: label, field and error.
|
|
13
|
+
*
|
|
14
|
+
* Call `focus()` from the TextInput's onFocus (and again when the block grows,
|
|
15
|
+
* e.g. an error shows up while typing) and `blur()` from onBlur. Inside a
|
|
16
|
+
* container that already handles the keyboard there is no host and both are
|
|
17
|
+
* no-ops.
|
|
18
|
+
*/
|
|
19
|
+
function useKeyboardField(boxRef) {
|
|
20
|
+
const host = (0, _KeyboardAvoidance.useKeyboardHost)();
|
|
21
|
+
const field = (0, _react.useRef)({
|
|
22
|
+
measure: () => new Promise(resolve => {
|
|
23
|
+
const node = boxRef.current;
|
|
24
|
+
if (!node) return resolve(null);
|
|
25
|
+
node.measureInWindow((_x, y, _w, height) => resolve({
|
|
26
|
+
y,
|
|
27
|
+
height
|
|
28
|
+
}));
|
|
29
|
+
})
|
|
30
|
+
}).current;
|
|
31
|
+
return (0, _react.useMemo)(() => ({
|
|
32
|
+
focus: () => host?.focus(field),
|
|
33
|
+
blur: () => host?.blur(field)
|
|
34
|
+
}), [host, field]);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=useKeyboardField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_KeyboardAvoidance","useKeyboardField","boxRef","host","useKeyboardHost","field","useRef","measure","Promise","resolve","node","current","measureInWindow","_x","y","_w","height","useMemo","focus","blur"],"sourceRoot":"../../../src","sources":["theme/useKeyboardField.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,kBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAACC,MAAmD,EAAE;EACpF,MAAMC,IAAI,GAAG,IAAAC,kCAAe,EAAC,CAAC;EAC9B,MAAMC,KAAK,GAAG,IAAAC,aAAM,EAAgB;IAClCC,OAAO,EAAEA,CAAA,KACP,IAAIC,OAAO,CAAEC,OAAO,IAAK;MACvB,MAAMC,IAAI,GAAGR,MAAM,CAACS,OAAO;MAC3B,IAAI,CAACD,IAAI,EAAE,OAAOD,OAAO,CAAC,IAAI,CAAC;MAC/BC,IAAI,CAACE,eAAe,CAAC,CAACC,EAAE,EAAEC,CAAC,EAAEC,EAAE,EAAEC,MAAM,KAAKP,OAAO,CAAC;QAAEK,CAAC;QAAEE;MAAO,CAAC,CAAC,CAAC;IACrE,CAAC;EACL,CAAC,CAAC,CAACL,OAAO;EAEV,OAAO,IAAAM,cAAO,EACZ,OAAO;IACLC,KAAK,EAAEA,CAAA,KAAMf,IAAI,EAAEe,KAAK,CAACb,KAAK,CAAC;IAC/Bc,IAAI,EAAEA,CAAA,KAAMhB,IAAI,EAAEgB,IAAI,CAACd,KAAK;EAC9B,CAAC,CAAC,EACF,CAACF,IAAI,EAAEE,KAAK,CACd,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useReduceMotion = useReduceMotion;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
/**
|
|
10
|
+
* Follows the system "reduce motion" setting: when it is on, animations jump
|
|
11
|
+
* to their final state instead of being disabled, so callbacks and unmounting
|
|
12
|
+
* still happen the same way.
|
|
13
|
+
*/
|
|
14
|
+
function useReduceMotion() {
|
|
15
|
+
const [reduceMotion, setReduceMotion] = (0, _react.useState)(false);
|
|
16
|
+
(0, _react.useEffect)(() => {
|
|
17
|
+
let alive = true;
|
|
18
|
+
// The state is only updated if the setting is on: the initial value is
|
|
19
|
+
// already `false` and a setState from false to false would cost a render per mount.
|
|
20
|
+
_reactNative.AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
|
|
21
|
+
if (alive && enabled) setReduceMotion(true);
|
|
22
|
+
});
|
|
23
|
+
const sub = _reactNative.AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotion);
|
|
24
|
+
return () => {
|
|
25
|
+
alive = false;
|
|
26
|
+
sub.remove();
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
29
|
+
return reduceMotion;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=useReduceMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","useReduceMotion","reduceMotion","setReduceMotion","useState","useEffect","alive","AccessibilityInfo","isReduceMotionEnabled","then","enabled","sub","addEventListener","remove"],"sourceRoot":"../../../src","sources":["theme/useReduceMotion.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAAA,EAAY;EACzC,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEvD,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,KAAK,GAAG,IAAI;IAChB;IACA;IACAC,8BAAiB,CAACC,qBAAqB,CAAC,CAAC,CAACC,IAAI,CAAEC,OAAO,IAAK;MAC1D,IAAIJ,KAAK,IAAII,OAAO,EAAEP,eAAe,CAAC,IAAI,CAAC;IAC7C,CAAC,CAAC;IACF,MAAMQ,GAAG,GAAGJ,8BAAiB,CAACK,gBAAgB,CAAC,qBAAqB,EAAET,eAAe,CAAC;IACtF,OAAO,MAAM;MACXG,KAAK,GAAG,KAAK;MACbK,GAAG,CAACE,MAAM,CAAC,CAAC;IACd,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOX,YAAY;AACrB","ignoreList":[]}
|
|
@@ -1,36 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { memo } from 'react';
|
|
4
|
-
import { StyleSheet, View } from 'react-native';
|
|
5
|
-
import { useColors } from '../theme/UIProvider';
|
|
3
|
+
import React, { memo, useState } from 'react';
|
|
4
|
+
import { Image as RNImage, StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { useAllowFontScaling, useColors, useTheme } from '../theme/UIProvider';
|
|
6
|
+
import { Icon } from '../icons/Icon';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const styles = StyleSheet.create({
|
|
8
9
|
circle: {
|
|
9
10
|
justifyContent: 'center',
|
|
10
|
-
alignItems: 'center'
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
overflow: 'hidden'
|
|
11
13
|
}
|
|
12
14
|
});
|
|
13
15
|
|
|
16
|
+
/** "Ada Lovelace" → "AL", "ada" → "A", " " → "". Handles characters outside the BMP. */
|
|
17
|
+
export function initialsOf(name) {
|
|
18
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
19
|
+
if (words.length === 0) return '';
|
|
20
|
+
const first = Array.from(words[0])[0] ?? '';
|
|
21
|
+
const last = words.length > 1 ? Array.from(words[words.length - 1])[0] ?? '' : '';
|
|
22
|
+
return (first + last).toUpperCase();
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
/**
|
|
15
26
|
* Avatar
|
|
16
|
-
*
|
|
17
|
-
*
|
|
27
|
+
* Circle with a photo, initials or an icon. Used on the left of list rows
|
|
28
|
+
* or as a detail header (alongside AvatarHeader).
|
|
29
|
+
*
|
|
30
|
+
* Priority: `children` → `source` (if it loads) → initials of `name` →
|
|
31
|
+
* `iconName` → `user` icon. A broken photo doesn't leave an empty circle: it
|
|
32
|
+
* falls back to the initials.
|
|
33
|
+
*
|
|
34
|
+
* Gestalt:
|
|
35
|
+
* - Similarity: all avatars in a list share shape and size, so a column of
|
|
36
|
+
* people scans as a series even when it mixes photos, initials and icons.
|
|
37
|
+
* - Closure: the circle clips the photo (overflow hidden); initials and the
|
|
38
|
+
* icon scale with `size` so the content always stays inside.
|
|
39
|
+
*
|
|
40
|
+
* Accessibility: with `name` (or `accessibilityLabel`) it announces itself as
|
|
41
|
+
* an image with that name; with neither it is decorative.
|
|
18
42
|
*/
|
|
19
43
|
export const Avatar = /*#__PURE__*/memo(({
|
|
20
44
|
size = 44,
|
|
45
|
+
source,
|
|
46
|
+
name,
|
|
47
|
+
iconName,
|
|
21
48
|
backgroundColor,
|
|
49
|
+
color,
|
|
22
50
|
children,
|
|
23
|
-
|
|
51
|
+
accessibilityLabel,
|
|
52
|
+
style,
|
|
53
|
+
testID
|
|
24
54
|
}) => {
|
|
25
55
|
const colors = useColors();
|
|
56
|
+
const theme = useTheme();
|
|
57
|
+
const allowFontScaling = useAllowFontScaling();
|
|
58
|
+
const [failed, setFailed] = useState(false);
|
|
59
|
+
const fg = color ?? colors.primaryText;
|
|
60
|
+
const label = accessibilityLabel ?? name;
|
|
61
|
+
const initials = name ? initialsOf(name) : '';
|
|
62
|
+
let content = children;
|
|
63
|
+
if (content == null) {
|
|
64
|
+
if (source && !failed) {
|
|
65
|
+
content = /*#__PURE__*/_jsx(RNImage, {
|
|
66
|
+
source: source,
|
|
67
|
+
style: {
|
|
68
|
+
width: size,
|
|
69
|
+
height: size
|
|
70
|
+
},
|
|
71
|
+
onError: () => setFailed(true),
|
|
72
|
+
accessibilityIgnoresInvertColors: true
|
|
73
|
+
});
|
|
74
|
+
} else if (initials) {
|
|
75
|
+
content = /*#__PURE__*/_jsx(Text, {
|
|
76
|
+
allowFontScaling: allowFontScaling,
|
|
77
|
+
numberOfLines: 1,
|
|
78
|
+
style: {
|
|
79
|
+
color: fg,
|
|
80
|
+
fontSize: Math.round(size * 0.4),
|
|
81
|
+
fontWeight: theme.tokens.fontWeight.semibold
|
|
82
|
+
},
|
|
83
|
+
children: initials
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
content = /*#__PURE__*/_jsx(Icon, {
|
|
87
|
+
name: iconName ?? 'user',
|
|
88
|
+
size: Math.round(size * 0.5),
|
|
89
|
+
color: fg
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
26
93
|
return /*#__PURE__*/_jsx(View, {
|
|
94
|
+
testID: testID,
|
|
95
|
+
accessible: !!label,
|
|
96
|
+
accessibilityRole: label ? 'image' : undefined,
|
|
97
|
+
accessibilityLabel: label,
|
|
27
98
|
style: [styles.circle, {
|
|
28
99
|
width: size,
|
|
29
100
|
height: size,
|
|
30
101
|
borderRadius: size / 2,
|
|
31
102
|
backgroundColor: backgroundColor || colors.primarySoft
|
|
32
103
|
}, style],
|
|
33
|
-
children:
|
|
104
|
+
children: content
|
|
34
105
|
});
|
|
35
106
|
});
|
|
36
107
|
Avatar.displayName = 'Avatar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","StyleSheet","View","useColors","jsx","_jsx","styles","create","circle","justifyContent","alignItems","Avatar","size","backgroundColor","children","style","colors","width","height","borderRadius","primarySoft","displayName"],"sourceRoot":"../../../src","sources":["atoms/Avatar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["React","memo","useState","Image","RNImage","StyleSheet","Text","View","useAllowFontScaling","useColors","useTheme","Icon","jsx","_jsx","styles","create","circle","justifyContent","alignItems","overflow","initialsOf","name","words","trim","split","filter","Boolean","length","first","Array","from","last","toUpperCase","Avatar","size","source","iconName","backgroundColor","color","children","accessibilityLabel","style","testID","colors","theme","allowFontScaling","failed","setFailed","fg","primaryText","label","initials","content","width","height","onError","accessibilityIgnoresInvertColors","numberOfLines","fontSize","Math","round","fontWeight","tokens","semibold","accessible","accessibilityRole","undefined","borderRadius","primarySoft","displayName"],"sourceRoot":"../../../src","sources":["atoms/Avatar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SACEC,KAAK,IAAIC,OAAO,EAChBC,UAAU,EACVC,IAAI,EACJC,IAAI,QAIC,cAAc;AACrB,SAASC,mBAAmB,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,qBAAqB;AAC9E,SAASC,IAAI,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAwBrC,MAAMC,MAAM,GAAGT,UAAU,CAACU,MAAM,CAAC;EAC/BC,MAAM,EAAE;IAAEC,cAAc,EAAE,QAAQ;IAAEC,UAAU,EAAE,QAAQ;IAAEC,QAAQ,EAAE;EAAS;AAC/E,CAAC,CAAC;;AAEF;AACA,OAAO,SAASC,UAAUA,CAACC,IAAY,EAAU;EAC/C,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;EACtD,IAAIJ,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE;EACjC,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACR,KAA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