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
|
@@ -2,33 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { useTheme } from './UIProvider';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* createStyles(factory)
|
|
7
|
-
*
|
|
8
|
-
* theme (WeakMap<Theme, Styles>),
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Returns a useStyles() hook that memoizes the resulting StyleSheet per
|
|
9
|
+
* theme (WeakMap<Theme, Styles>), not per component instance. All rows of a
|
|
10
|
+
* list share the same styles object: without this, N rows ⇒ N
|
|
11
|
+
* StyleSheet.create() per render, which is what every component of the
|
|
12
|
+
* original app did with `useMemo(() => createStyles(colors), [colors])`.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* The cache lives in the factory's closure (one WeakMap per createStyles
|
|
15
|
+
* call, i.e. one per component), so themes from different <UIProvider>s in
|
|
16
|
+
* the same tree don't collide with each other.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The `factory` type follows RN's pattern for typed StyleSheets
|
|
19
|
+
* (`T extends NamedStyles<T> | NamedStyles<any>`): it is what gives TS the
|
|
20
|
+
* context to infer literals ('row', 'center', ...) instead of widening them
|
|
21
|
+
* to `string` inside the returned object. `NamedStyles` is declared here:
|
|
22
|
+
* react-native 0.88's generated types (Expo SDK 58) no longer export
|
|
23
|
+
* `StyleSheet.NamedStyles`.
|
|
21
24
|
*/
|
|
25
|
+
|
|
22
26
|
export function createStyles(factory) {
|
|
23
27
|
const cache = new WeakMap();
|
|
24
28
|
return function useStyles() {
|
|
25
29
|
const theme = useTheme();
|
|
26
30
|
let styles = cache.get(theme);
|
|
27
31
|
if (!styles) {
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
+
// The cast is safe: StyleSheet.create<T>(...) with the factory's same T
|
|
33
|
+
// always returns T; TS can't prove it on its own inside a generic body
|
|
34
|
+
// (T could be "instantiated" with an unrelated subtype from its point
|
|
35
|
+
// of view, even though at runtime it is the same).
|
|
32
36
|
styles = StyleSheet.create(factory(theme));
|
|
33
37
|
cache.set(theme, styles);
|
|
34
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","useTheme","createStyles","factory","cache","WeakMap","useStyles","theme","styles","get","create","set"],"sourceRoot":"../../../src","sources":["theme/createStyles.ts"],"mappings":";;AAAA,SAASA,UAAU,
|
|
1
|
+
{"version":3,"names":["StyleSheet","useTheme","createStyles","factory","cache","WeakMap","useStyles","theme","styles","get","create","set"],"sourceRoot":"../../../src","sources":["theme/createStyles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAyD,cAAc;AAC1F,SAASC,QAAQ,QAAQ,cAAc;;AAGvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAO,SAASC,YAAYA,CAC1BC,OAA6C,EACpC;EACT,MAAMC,KAAK,GAAG,IAAIC,OAAO,CAAW,CAAC;EAErC,OAAO,SAASC,SAASA,CAAA,EAAM;IAC7B,MAAMC,KAAK,GAAGN,QAAQ,CAAC,CAAC;IACxB,IAAIO,MAAM,GAAGJ,KAAK,CAACK,GAAG,CAACF,KAAK,CAAC;IAC7B,IAAI,CAACC,MAAM,EAAE;MACX;MACA;MACA;MACA;MACAA,MAAM,GAAGR,UAAU,CAACU,MAAM,CAACP,OAAO,CAACI,KAAK,CAAC,CAAM;MAC/CH,KAAK,CAACO,GAAG,CAACJ,KAAK,EAAEC,MAAM,CAAC;IAC1B;IACA,OAAOA,MAAM;EACf,CAAC;AACH","ignoreList":[]}
|
|
@@ -21,7 +21,7 @@ function mergeDeep(base, patch) {
|
|
|
21
21
|
}
|
|
22
22
|
const capitalize = name => name.charAt(0).toUpperCase() + name.slice(1);
|
|
23
23
|
|
|
24
|
-
/**
|
|
24
|
+
/** Expands each `brand` hex into the accent's four roles in a scheme. */
|
|
25
25
|
function brandColors(brand, scheme, palette) {
|
|
26
26
|
if (!brand) return {};
|
|
27
27
|
const accents = typeof brand === 'string' ? {
|
|
@@ -40,12 +40,12 @@ function brandColors(brand, scheme, palette) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Builds the light/dark theme pair consumed by <UIProvider theme={...}>.
|
|
44
|
+
* Never mutates the defaults: each call produces new objects, safe to share
|
|
45
|
+
* between different providers (tests, multi-brand in the same tree).
|
|
46
46
|
*
|
|
47
|
-
* `brand`
|
|
48
|
-
*
|
|
47
|
+
* `brand` is applied before `colors`, so a hand-written role always wins
|
|
48
|
+
* over the derived one.
|
|
49
49
|
*/
|
|
50
50
|
export function createTheme(overrides) {
|
|
51
51
|
const tokens = mergeDeep(defaultTokens, overrides?.tokens);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export { spacing, radius, fontSize, fontWeight, lineHeight, duration, shadow, tokens } from './tokens';
|
|
3
|
+
export { spacing, radius, fontSize, fontWeight, lineHeight, letterSpacing, duration, shadow, tokens } from './tokens';
|
|
4
4
|
export { lightPalette, darkPalette } from './palettes';
|
|
5
5
|
export { createTheme, defaultTheme } from './createTheme';
|
|
6
6
|
export { deriveAccent, contrast, luminance, AA_CONTRAST } from './colors';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["spacing","radius","fontSize","fontWeight","lineHeight","duration","shadow","tokens","lightPalette","darkPalette","createTheme","defaultTheme","deriveAccent","contrast","luminance","AA_CONTRAST","defaultLabels","zeroInsets","createStyles","UIProvider","useTheme","useColors","useThemeMode","useIcons","useInsets","useLabels","useAllowFontScaling"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,QAAQ,UAAU;
|
|
1
|
+
{"version":3,"names":["spacing","radius","fontSize","fontWeight","lineHeight","letterSpacing","duration","shadow","tokens","lightPalette","darkPalette","createTheme","defaultTheme","deriveAccent","contrast","luminance","AA_CONTRAST","defaultLabels","zeroInsets","createStyles","UIProvider","useTheme","useColors","useThemeMode","useIcons","useInsets","useLabels","useAllowFontScaling"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AAErH,SAASC,YAAY,EAAEC,WAAW,QAAQ,YAAY;AAEtD,SAASC,WAAW,EAAEC,YAAY,QAAQ,eAAe;AAEzD,SAASC,YAAY,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,UAAU;AAEzE,SAASC,aAAa,QAAQ,UAAU;AAExC,SAASC,UAAU,QAAQ,UAAU;AAErC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SACEC,UAAU,EACVC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,SAAS,EACTC,SAAS,EACTC,mBAAmB,QACd,cAAc","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** Structurally identical to react-native-safe-area-context's EdgeInsets, without depending on the package. */
|
|
4
4
|
|
|
5
5
|
export const zeroInsets = {
|
|
6
6
|
top: 0,
|
|
@@ -13,6 +13,34 @@ export const defaultLabels = {
|
|
|
13
13
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
14
14
|
weekdaysShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
|
15
15
|
selectDate: 'Select date',
|
|
16
|
-
clear: 'Clear'
|
|
16
|
+
clear: 'Clear',
|
|
17
|
+
showPassword: 'Show password',
|
|
18
|
+
hidePassword: 'Hide password',
|
|
19
|
+
required: 'required',
|
|
20
|
+
requiredError: 'This field is required',
|
|
21
|
+
minLengthError: 'Enter at least {n} characters',
|
|
22
|
+
maxLengthError: 'Enter at most {n} characters',
|
|
23
|
+
patternError: 'Invalid format',
|
|
24
|
+
quantity: 'Quantity',
|
|
25
|
+
increment: 'Increment',
|
|
26
|
+
decrement: 'Decrement',
|
|
27
|
+
stepOf: 'Step {n} of {total}: {label}',
|
|
28
|
+
stepCompleted: 'completed',
|
|
29
|
+
stepCurrent: 'current',
|
|
30
|
+
stepPending: 'pending',
|
|
31
|
+
previousMonth: 'Previous month',
|
|
32
|
+
nextMonth: 'Next month',
|
|
33
|
+
moveUp: 'Move up',
|
|
34
|
+
moveDown: 'Move down',
|
|
35
|
+
scan: 'Scan',
|
|
36
|
+
slideOf: 'Slide {n} of {total}',
|
|
37
|
+
pauseSlides: 'Pause automatic slides',
|
|
38
|
+
resumeSlides: 'Resume automatic slides',
|
|
39
|
+
themeSystem: 'Auto',
|
|
40
|
+
themeLight: 'Light',
|
|
41
|
+
themeDark: 'Dark',
|
|
42
|
+
back: 'Back',
|
|
43
|
+
next: 'Next',
|
|
44
|
+
finish: 'Finish'
|
|
17
45
|
};
|
|
18
46
|
//# sourceMappingURL=labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defaultLabels","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","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":";;AAyEA,OAAO,MAAMA,aAAqB,GAAG;EACnCC,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":[]}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Each color is a `string`, not a literal (`as const`): light and dark have
|
|
5
|
+
* different values for the same key, and createTheme() must be able to
|
|
6
|
+
* accept any hex/rgba in the overrides — literal typing would prevent it.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Each accent comes in four roles, and they are not interchangeable:
|
|
9
9
|
*
|
|
10
|
-
* `primary`
|
|
11
|
-
* `onPrimary`
|
|
12
|
-
* `primarySoft`
|
|
13
|
-
* `primaryText`
|
|
14
|
-
*
|
|
10
|
+
* `primary` solid fill (button background, selected day, FAB).
|
|
11
|
+
* `onPrimary` text/icon *on top of* that fill.
|
|
12
|
+
* `primarySoft` tinted background for selected states and pills.
|
|
13
|
+
* `primaryText` accent text/icon over `surface`, `background`
|
|
14
|
+
* or over its own `primarySoft`.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* The reason is contrast: an accent that reads well as a fill doesn't read
|
|
17
|
+
* as text. Components used to use `colors.primary` for both things and tinted
|
|
18
|
+
* it by appending alpha to the hex (`colors.primary + '15'`), which in dark
|
|
19
|
+
* gave 2.6:1 over the surface — well below WCAG AA's 4.5:1. Every pair in
|
|
20
|
+
* this palette passes AA in both schemes.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
const neutral = {
|
|
@@ -38,9 +38,9 @@ export const lightPalette = {
|
|
|
38
38
|
onSuccess: '#00320f',
|
|
39
39
|
successSoft: '#e3f6e9',
|
|
40
40
|
successText: '#116a30',
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
41
|
+
// Red goes with white text, which is what people expect from a destructive
|
|
42
|
+
// button. #ff3b30 doesn't reach 4.5:1 with white and forced near-black text
|
|
43
|
+
// over red; this shade does, and still reads as an alert red.
|
|
44
44
|
error: '#dc2626',
|
|
45
45
|
onError: '#ffffff',
|
|
46
46
|
errorSoft: '#fdeaea',
|
|
@@ -51,19 +51,20 @@ export const lightPalette = {
|
|
|
51
51
|
warningText: '#8a4b00',
|
|
52
52
|
background: '#f8f9fa',
|
|
53
53
|
surface: '#ffffff',
|
|
54
|
+
surfaceRaised: '#ffffff',
|
|
54
55
|
text: '#333333',
|
|
55
56
|
textLight: '#666666',
|
|
56
57
|
border: '#e5e7eb',
|
|
57
58
|
inputBackground: '#f5f7fa',
|
|
58
59
|
overlay: 'rgba(0,0,0,0.5)',
|
|
59
60
|
scrim: 'rgba(248,249,250,0.8)',
|
|
60
|
-
skeleton: '#
|
|
61
|
+
skeleton: '#e3e5e8'
|
|
61
62
|
};
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* `onPrimary`
|
|
65
|
+
* The dark accents are NOT the light ones: over `#1e1e1e` the accent's
|
|
66
|
+
* lightness has to go up and that of the text on top has to go down (which
|
|
67
|
+
* is why `onPrimary` is dark blue here and white in light).
|
|
67
68
|
*/
|
|
68
69
|
export const darkPalette = {
|
|
69
70
|
...neutral,
|
|
@@ -89,12 +90,13 @@ export const darkPalette = {
|
|
|
89
90
|
warningText: '#f5c97e',
|
|
90
91
|
background: '#121212',
|
|
91
92
|
surface: '#1e1e1e',
|
|
93
|
+
surfaceRaised: '#303036',
|
|
92
94
|
text: '#ecedee',
|
|
93
95
|
textLight: '#9ba1a6',
|
|
94
|
-
border: '#
|
|
96
|
+
border: '#3a3a40',
|
|
95
97
|
inputBackground: '#232326',
|
|
96
98
|
overlay: 'rgba(0,0,0,0.6)',
|
|
97
99
|
scrim: 'rgba(18,18,18,0.8)',
|
|
98
|
-
skeleton: '#
|
|
100
|
+
skeleton: '#44444b'
|
|
99
101
|
};
|
|
100
102
|
//# sourceMappingURL=palettes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["neutral","white","black","lightPalette","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","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;AAED,OAAO,MAAMC,YAAyB,GAAG;EACvC,GAAGH,OAAO;EAEVI,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,aAAa,EAAE,SAAS;EAExBC,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtB;EACA;EACA;EACAC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,SAAS,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,uBAAuB;EAC9BC,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAwB,GAAG;EACtC,GAAGlC,OAAO;EAEVI,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,aAAa,EAAE,SAAS;EAExBC,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EAEtBC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,SAAS,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":[]}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
// createTheme()
|
|
7
|
-
//
|
|
8
|
-
//
|
|
5
|
+
// Numeric scales are typed explicitly as `number` (not `as const`):
|
|
6
|
+
// createTheme() must be able to override any value with any other number:
|
|
7
|
+
// with literal typing, overriding `radius.md` to `999` would fail because
|
|
8
|
+
// the inferred type would be the literal `8`, not `number`.
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Spacing scale. Always use these values instead of magic numbers so the
|
|
12
|
+
* vertical/horizontal rhythm is consistent across components.
|
|
13
13
|
*/
|
|
14
14
|
export const spacing = {
|
|
15
15
|
xxs: 2,
|
|
@@ -40,8 +40,8 @@ export const fontSize = {
|
|
|
40
40
|
xxl: 24
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
// fontWeight
|
|
44
|
-
//
|
|
43
|
+
// fontWeight does need literals: RN's TextStyle.fontWeight requires a union
|
|
44
|
+
// of specific strings ('400' | '500' | ...), not an arbitrary `string`.
|
|
45
45
|
export const fontWeight = {
|
|
46
46
|
regular: '400',
|
|
47
47
|
medium: '500',
|
|
@@ -51,19 +51,32 @@ export const fontWeight = {
|
|
|
51
51
|
export const lineHeight = {
|
|
52
52
|
sm: 16,
|
|
53
53
|
md: 20,
|
|
54
|
-
lg: 24
|
|
54
|
+
lg: 24,
|
|
55
|
+
xl: 30
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Tracking (letterSpacing) in points. `tight` offsets the extra room that
|
|
60
|
+
* large sizes bring by default (titles); `normal` is the system's;
|
|
61
|
+
* `wide` spaces out small caps.
|
|
62
|
+
*/
|
|
63
|
+
export const letterSpacing = {
|
|
64
|
+
tight: -0.5,
|
|
65
|
+
normal: 0,
|
|
66
|
+
/** Short, small, uppercase labels (Badge): a little room makes them legible. */
|
|
67
|
+
wide: 0.3
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** Durations in ms for Animated.timing/spring. */
|
|
58
71
|
export const duration = {
|
|
59
72
|
fast: 150,
|
|
60
73
|
base: 200,
|
|
61
74
|
slow: 250
|
|
62
75
|
};
|
|
63
76
|
/**
|
|
64
|
-
*
|
|
65
|
-
* `shadowColor`
|
|
66
|
-
*
|
|
77
|
+
* Cross-platform shadows: shadow* for iOS, elevation for Android.
|
|
78
|
+
* `shadowColor` is left fixed at black — a per-theme shadow color is too
|
|
79
|
+
* fine a detail to justify the complexity of resolving it here.
|
|
67
80
|
*/
|
|
68
81
|
export const shadow = {
|
|
69
82
|
none: Platform.select({
|
|
@@ -111,6 +124,7 @@ export const tokens = {
|
|
|
111
124
|
fontSize,
|
|
112
125
|
fontWeight,
|
|
113
126
|
lineHeight,
|
|
127
|
+
letterSpacing,
|
|
114
128
|
duration,
|
|
115
129
|
shadow
|
|
116
130
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","spacing","xxs","xs","sm","md","lg","xl","xxl","xxxl","radius","none","full","fontSize","fontWeight","regular","medium","semibold","bold","lineHeight","duration","fast","base","slow","shadow","select","android","elevation","default","shadowOpacity","shadowColor","shadowOffset","width","height","shadowRadius","tokens"],"sourceRoot":"../../../src","sources":["theme/tokens.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAwB,cAAc;;AAEvD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAkF,GAAG;EAChGC,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;AAED,OAAO,MAAMC,MAAkF,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;AAED,OAAO,MAAMC,QAAkE,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;AACA,OAAO,MAAMM,UAAU,GAAG;EACxBC,OAAO,EAAE,KAAK;EACdC,MAAM,EAAE,KAAK;EACbC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAU;AAEV,OAAO,MAAMC,
|
|
1
|
+
{"version":3,"names":["Platform","spacing","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","select","android","elevation","default","shadowOpacity","shadowColor","shadowOffset","width","height","shadowRadius","tokens"],"sourceRoot":"../../../src","sources":["theme/tokens.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAwB,cAAc;;AAEvD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAkF,GAAG;EAChGC,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;AAED,OAAO,MAAMC,MAAkF,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;AAED,OAAO,MAAMC,QAAkE,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;AACA,OAAO,MAAMM,UAAU,GAAG;EACxBC,OAAO,EAAE,KAAK;EACdC,MAAM,EAAE,KAAK;EACbC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAU;AAEV,OAAO,MAAMC,UAAqD,GAAG;EACnEf,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMa,aAA0D,GAAG;EACxEC,KAAK,EAAE,CAAC,GAAG;EACXC,MAAM,EAAE,CAAC;EACT;EACAC,IAAI,EAAE;AACR,CAAC;;AAED;AACA,OAAO,MAAMC,QAAkD,GAAG;EAChEC,IAAI,EAAE,GAAG;EACTC,IAAI,EAAE,GAAG;EACTC,IAAI,EAAE;AACR,CAAC;AAOD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAAwD,GAAG;EACtEjB,IAAI,EAAEX,QAAQ,CAAC6B,MAAM,CAAC;IACpBC,OAAO,EAAE;MAAEC,SAAS,EAAE;IAAE,CAAC;IACzBC,OAAO,EAAE;MAAEC,aAAa,EAAE;IAAE;EAC9B,CAAC,CAAgB;EACjB7B,EAAE,EAAE;IACF8B,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCJ,aAAa,EAAE,IAAI;IACnBK,YAAY,EAAE,CAAC;IACfP,SAAS,EAAE;EACb,CAAC;EACD1B,EAAE,EAAE;IACF6B,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCJ,aAAa,EAAE,GAAG;IAClBK,YAAY,EAAE,CAAC;IACfP,SAAS,EAAE;EACb,CAAC;EACDzB,EAAE,EAAE;IACF4B,WAAW,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;AAED,OAAO,MAAMQ,MAAM,GAAG;EACpBtC,OAAO;EACPS,MAAM;EACNG,QAAQ;EACRC,UAAU;EACVK,UAAU;EACVC,aAAa;EACbI,QAAQ;EACRI;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo, useRef } from 'react';
|
|
4
|
+
import { useKeyboardHost } from './KeyboardAvoidance';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Registers a text field with the nearest keyboard host (a Screen's content or
|
|
8
|
+
* the root UIProvider) so it stays visible above the keyboard. `boxRef` is the
|
|
9
|
+
* block that has to be seen whole: label, field and error.
|
|
10
|
+
*
|
|
11
|
+
* Call `focus()` from the TextInput's onFocus (and again when the block grows,
|
|
12
|
+
* e.g. an error shows up while typing) and `blur()` from onBlur. Inside a
|
|
13
|
+
* container that already handles the keyboard there is no host and both are
|
|
14
|
+
* no-ops.
|
|
15
|
+
*/
|
|
16
|
+
export function useKeyboardField(boxRef) {
|
|
17
|
+
const host = useKeyboardHost();
|
|
18
|
+
const field = useRef({
|
|
19
|
+
measure: () => new Promise(resolve => {
|
|
20
|
+
const node = boxRef.current;
|
|
21
|
+
if (!node) return resolve(null);
|
|
22
|
+
node.measureInWindow((_x, y, _w, height) => resolve({
|
|
23
|
+
y,
|
|
24
|
+
height
|
|
25
|
+
}));
|
|
26
|
+
})
|
|
27
|
+
}).current;
|
|
28
|
+
return useMemo(() => ({
|
|
29
|
+
focus: () => host?.focus(field),
|
|
30
|
+
blur: () => host?.blur(field)
|
|
31
|
+
}), [host, field]);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=useKeyboardField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","useRef","useKeyboardHost","useKeyboardField","boxRef","host","field","measure","Promise","resolve","node","current","measureInWindow","_x","y","_w","height","focus","blur"],"sourceRoot":"../../../src","sources":["theme/useKeyboardField.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,MAAM,QAA2C,OAAO;AAE1E,SAASC,eAAe,QAA4B,qBAAqB;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,MAAmD,EAAE;EACpF,MAAMC,IAAI,GAAGH,eAAe,CAAC,CAAC;EAC9B,MAAMI,KAAK,GAAGL,MAAM,CAAgB;IAClCM,OAAO,EAAEA,CAAA,KACP,IAAIC,OAAO,CAAEC,OAAO,IAAK;MACvB,MAAMC,IAAI,GAAGN,MAAM,CAACO,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,OAAOX,OAAO,CACZ,OAAO;IACLiB,KAAK,EAAEA,CAAA,KAAMZ,IAAI,EAAEY,KAAK,CAACX,KAAK,CAAC;IAC/BY,IAAI,EAAEA,CAAA,KAAMb,IAAI,EAAEa,IAAI,CAACZ,KAAK;EAC9B,CAAC,CAAC,EACF,CAACD,IAAI,EAAEC,KAAK,CACd,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { AccessibilityInfo } from 'react-native';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Follows the system "reduce motion" setting: when it is on, animations jump
|
|
8
|
+
* to their final state instead of being disabled, so callbacks and unmounting
|
|
9
|
+
* still happen the same way.
|
|
10
|
+
*/
|
|
11
|
+
export function useReduceMotion() {
|
|
12
|
+
const [reduceMotion, setReduceMotion] = useState(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
let alive = true;
|
|
15
|
+
// The state is only updated if the setting is on: the initial value is
|
|
16
|
+
// already `false` and a setState from false to false would cost a render per mount.
|
|
17
|
+
AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
|
|
18
|
+
if (alive && enabled) setReduceMotion(true);
|
|
19
|
+
});
|
|
20
|
+
const sub = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotion);
|
|
21
|
+
return () => {
|
|
22
|
+
alive = false;
|
|
23
|
+
sub.remove();
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return reduceMotion;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useReduceMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useState","AccessibilityInfo","useReduceMotion","reduceMotion","setReduceMotion","alive","isReduceMotionEnabled","then","enabled","sub","addEventListener","remove"],"sourceRoot":"../../../src","sources":["theme/useReduceMotion.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,iBAAiB,QAAQ,cAAc;;AAEhD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAY;EACzC,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGJ,QAAQ,CAAC,KAAK,CAAC;EAEvDD,SAAS,CAAC,MAAM;IACd,IAAIM,KAAK,GAAG,IAAI;IAChB;IACA;IACAJ,iBAAiB,CAACK,qBAAqB,CAAC,CAAC,CAACC,IAAI,CAAEC,OAAO,IAAK;MAC1D,IAAIH,KAAK,IAAIG,OAAO,EAAEJ,eAAe,CAAC,IAAI,CAAC;IAC7C,CAAC,CAAC;IACF,MAAMK,GAAG,GAAGR,iBAAiB,CAACS,gBAAgB,CAAC,qBAAqB,EAAEN,eAAe,CAAC;IACtF,OAAO,MAAM;MACXC,KAAK,GAAG,KAAK;MACbI,GAAG,CAACE,MAAM,CAAC,CAAC;IACd,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOR,YAAY;AACrB","ignoreList":[]}
|
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { type ImageSourcePropType, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { IconName } from '../icons/types';
|
|
3
4
|
export interface AvatarProps {
|
|
5
|
+
/** Diameter in pt. @default 44 */
|
|
4
6
|
size?: number;
|
|
7
|
+
/** Photo. If it fails to load, falls back to the initials of `name` (or the icon). */
|
|
8
|
+
source?: ImageSourcePropType;
|
|
9
|
+
/** Person's name: produces the initials and the accessible name. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Icon shown when there is no photo or name. @default 'user' */
|
|
12
|
+
iconName?: IconName;
|
|
13
|
+
/** Fill of the circle. @default colors.primarySoft */
|
|
5
14
|
backgroundColor?: string;
|
|
6
|
-
|
|
15
|
+
/** Color of the initials and icon. @default colors.primaryText */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Custom content; takes precedence over source/name/iconName. */
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/** Accessible name. Without it (and without `name`) the avatar is decorative. @default name */
|
|
20
|
+
accessibilityLabel?: string;
|
|
7
21
|
style?: StyleProp<ViewStyle>;
|
|
22
|
+
testID?: string;
|
|
8
23
|
}
|
|
24
|
+
/** "Ada Lovelace" → "AL", "ada" → "A", " " → "". Handles characters outside the BMP. */
|
|
25
|
+
export declare function initialsOf(name: string): string;
|
|
9
26
|
/**
|
|
10
27
|
* Avatar
|
|
11
|
-
*
|
|
12
|
-
*
|
|
28
|
+
* Circle with a photo, initials or an icon. Used on the left of list rows
|
|
29
|
+
* or as a detail header (alongside AvatarHeader).
|
|
30
|
+
*
|
|
31
|
+
* Priority: `children` → `source` (if it loads) → initials of `name` →
|
|
32
|
+
* `iconName` → `user` icon. A broken photo doesn't leave an empty circle: it
|
|
33
|
+
* falls back to the initials.
|
|
34
|
+
*
|
|
35
|
+
* Gestalt:
|
|
36
|
+
* - Similarity: all avatars in a list share shape and size, so a column of
|
|
37
|
+
* people scans as a series even when it mixes photos, initials and icons.
|
|
38
|
+
* - Closure: the circle clips the photo (overflow hidden); initials and the
|
|
39
|
+
* icon scale with `size` so the content always stays inside.
|
|
40
|
+
*
|
|
41
|
+
* Accessibility: with `name` (or `accessibilityLabel`) it announces itself as
|
|
42
|
+
* an image with that name; with neither it is decorative.
|
|
13
43
|
*/
|
|
14
|
-
export declare const Avatar: React.MemoExoticComponent<({ size, backgroundColor, children, style }: AvatarProps) => React.JSX.Element>;
|
|
44
|
+
export declare const Avatar: React.MemoExoticComponent<({ size, source, name, iconName, backgroundColor, color, children, accessibilityLabel, style, testID, }: AvatarProps) => React.JSX.Element>;
|
|
15
45
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/atoms/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/atoms/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+FAA+F;IAC/F,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,qIAYd,WAAW,uBAmDf,CAAC"}
|
|
@@ -2,18 +2,29 @@ import React from 'react';
|
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
export type BadgeVariant = 'success' | 'error' | 'warning' | 'info' | 'neutral';
|
|
4
4
|
export interface BadgeProps {
|
|
5
|
+
/** Text of the pill, on a single line (truncated with "…"). */
|
|
5
6
|
label: string;
|
|
7
|
+
/** Semantic color set: success, error, warning, info or neutral. @default 'neutral' */
|
|
6
8
|
variant?: BadgeVariant;
|
|
7
9
|
/** Manual override, takes precedence over `variant`. */
|
|
8
10
|
backgroundColor?: string;
|
|
11
|
+
/** Manual text color, takes precedence over `variant`. */
|
|
9
12
|
textColor?: string;
|
|
10
13
|
style?: StyleProp<ViewStyle>;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Badge
|
|
14
|
-
*
|
|
15
|
-
* info/neutral); `backgroundColor`/`textColor`
|
|
16
|
-
*
|
|
17
|
+
* Status pill. `variant` covers the common cases (success/error/warning/
|
|
18
|
+
* info/neutral); `backgroundColor`/`textColor` are for cases that don't
|
|
19
|
+
* fit the semantic set.
|
|
20
|
+
*
|
|
21
|
+
* Gestalt, similarity: all badges share shape, size and typography; only
|
|
22
|
+
* the color changes, and it changes by meaning (green = ok, red = error…),
|
|
23
|
+
* so a column of statuses scans at a glance. The meaning also goes in the
|
|
24
|
+
* text: never rely on color alone (color blindness).
|
|
25
|
+
* Every `*Soft`/`*Text` pair in the theme meets WCAG AA in light and dark;
|
|
26
|
+
* with custom colors, contrast is up to whoever passes them.
|
|
27
|
+
* A single line: a long label is truncated with "…" instead of deforming the pill.
|
|
17
28
|
*/
|
|
18
29
|
export declare const Badge: React.MemoExoticComponent<({ label, variant, backgroundColor, textColor, style }: BadgeProps) => React.JSX.Element>;
|
|
19
30
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/atoms/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhF,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAYD
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/atoms/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhF,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAYD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,oFAA4E,UAAU,uBAuBtG,CAAC"}
|
|
@@ -4,27 +4,58 @@ import type { IconName } from '../icons/types';
|
|
|
4
4
|
export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'link' | 'destructive';
|
|
5
5
|
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
export interface ButtonProps {
|
|
7
|
+
/** Visible label. Also the accessible name unless `accessibilityLabel` is set. */
|
|
7
8
|
title: string;
|
|
9
|
+
/** Called on press. Not called while `disabled` or `loading`. */
|
|
8
10
|
onPress: (e: GestureResponderEvent) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Semantic style: `primary` is the filled focal action; the others step the visual weight down.
|
|
13
|
+
* @default 'primary'
|
|
14
|
+
*/
|
|
9
15
|
variant?: ButtonVariant;
|
|
16
|
+
/** Density: padding and font size. `sm` gets extra touch area through `hitSlop`. @default 'md' */
|
|
10
17
|
size?: ButtonSize;
|
|
18
|
+
/** Shows a spinner over the hidden label (the width doesn't change) and blocks presses. @default false */
|
|
11
19
|
loading?: boolean;
|
|
20
|
+
/** Paints the disabled colors and ignores presses. @default false */
|
|
12
21
|
disabled?: boolean;
|
|
13
22
|
style?: StyleProp<ViewStyle>;
|
|
23
|
+
/** Extra style for the label text. */
|
|
14
24
|
textStyle?: StyleProp<TextStyle>;
|
|
25
|
+
/** Custom node to the left of the label. Takes precedence over `leftIconName`. */
|
|
15
26
|
leftIcon?: React.ReactNode;
|
|
27
|
+
/** Custom node to the right of the label. Takes precedence over `rightIconName`. */
|
|
16
28
|
rightIcon?: React.ReactNode;
|
|
29
|
+
/** Icon from the library's set to the left of the label, sized to match `size`. */
|
|
17
30
|
leftIconName?: IconName;
|
|
31
|
+
/** Icon from the library's set to the right of the label, sized to match `size`. */
|
|
18
32
|
rightIconName?: IconName;
|
|
33
|
+
/** Color of `leftIconName`/`rightIconName`. Defaults to the label color of the variant. */
|
|
19
34
|
iconColor?: string;
|
|
20
35
|
testID?: string;
|
|
36
|
+
/** What screen readers announce. @default title */
|
|
21
37
|
accessibilityLabel?: string;
|
|
22
38
|
}
|
|
23
39
|
/**
|
|
24
40
|
* Button
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
41
|
+
* The library's only button component. `variant` sets the semantic style,
|
|
42
|
+
* `size` the density. The "pressed" feedback animates only `transform`
|
|
43
|
+
* (Animated.spring, useNativeDriver) — never opacity or layout — and is
|
|
44
|
+
* skipped when Reduce Motion is on.
|
|
45
|
+
*
|
|
46
|
+
* Gestalt:
|
|
47
|
+
* - Focal point (Von Restorff): `primary` is the only one filled with the
|
|
48
|
+
* accent and a shadow; there should be one per screen or group. The other
|
|
49
|
+
* variants step the visual weight down (secondary → outline → ghost → link).
|
|
50
|
+
* - Similarity: all variants share shape, radius and typography, so a row of
|
|
51
|
+
* buttons reads as a single group of actions; only what conveys the
|
|
52
|
+
* hierarchy changes (fill, border, color).
|
|
53
|
+
* - Proximity: icon and label sit `spacing.sm` apart, much less than the
|
|
54
|
+
* padding, so they read as a single label.
|
|
55
|
+
*
|
|
56
|
+
* Fitts: `sm` and `link` are less than 44pt tall and make up for it with `hitSlop`.
|
|
57
|
+
* While `loading`, the label is invisible but keeps its space: the button
|
|
58
|
+
* doesn't change width (no layout jumps).
|
|
28
59
|
*/
|
|
29
60
|
export declare const Button: React.MemoExoticComponent<({ title, onPress, variant, size, loading, disabled, style, textStyle, leftIcon, rightIcon, leftIconName, rightIconName, iconColor, testID, accessibilityLabel, }: ButtonProps) => React.JSX.Element>;
|
|
30
61
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/atoms/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/atoms/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAOL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kGAAkG;IAClG,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,0GAA0G;IAC1G,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,sCAAsC;IACtC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,kFAAkF;IAClF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oFAAoF;IACpF,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,mFAAmF;IACnF,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,oFAAoF;IACpF,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAsED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,+LAiBd,WAAW,uBA8Ff,CAAC"}
|