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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useRef","Animated","Pressable","jsx","_jsx","AnimatedPressable","createAnimatedComponent","PressableScale","scaleTo","style","children","onPressIn","onPressOut","disabled","props","scale","Value","current","animateTo","value","spring","toValue","useNativeDriver","
|
|
1
|
+
{"version":3,"names":["React","memo","useRef","Animated","Pressable","useReduceMotion","jsx","_jsx","PRESS_SPRING","speed","bounciness","AnimatedPressable","createAnimatedComponent","PressableScale","scaleTo","style","children","onPressIn","onPressOut","disabled","accessibilityRole","accessibilityState","props","scale","Value","current","reduceMotion","animateTo","value","spring","toValue","useNativeDriver","start","handlePressIn","e","handlePressOut","transform","displayName"],"sourceRoot":"../../../src","sources":["atoms/PressableScale.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,MAAM,QAAQ,OAAO;AAC3C,SACEC,QAAQ,EACRC,SAAS,QAKJ,cAAc;AACrB,SAASC,eAAe,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAU/C;AACA,MAAMC,YAAY,GAAG;EAAEC,KAAK,EAAE,EAAE;EAAEC,UAAU,EAAE;AAAE,CAAU;AAE1D,MAAMC,iBAAiB,GAAGR,QAAQ,CAACS,uBAAuB,CAACR,SAAS,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMS,cAAc,gBAAGZ,IAAI,CAChC,CAAC;EACCa,OAAO,GAAG,IAAI;EACdC,KAAK;EACLC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,QAAQ;EACRC,iBAAiB,GAAG,QAAQ;EAC5BC,kBAAkB;EAClB,GAAGC;AACgB,CAAC,KAAK;EACzB,MAAMC,KAAK,GAAGrB,MAAM,CAAC,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
//
|
|
23
|
+
// Only top/left: an absoluteFill would stretch the letter to the group's width
|
|
24
|
+
// and realign it. Anchored to the corner it lands exactly on the one below.
|
|
25
25
|
overlay: {
|
|
26
26
|
position: 'absolute',
|
|
27
27
|
top: 0,
|
|
28
28
|
left: 0
|
|
29
29
|
},
|
|
30
|
-
//
|
|
31
|
-
//
|
|
30
|
+
// A word and the spaces that follow it: line breaks happen between
|
|
31
|
+
// groups, never between the letters of a word.
|
|
32
32
|
group: {
|
|
33
33
|
flexDirection: 'row'
|
|
34
34
|
}
|
|
@@ -39,7 +39,7 @@ const ALIGN = {
|
|
|
39
39
|
right: 'flex-end'
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
/**
|
|
42
|
+
/** A word with the spaces that follow it, and the index of its first letter. */
|
|
43
43
|
|
|
44
44
|
function toGroups(text) {
|
|
45
45
|
const chars = Array.from(text);
|
|
@@ -50,8 +50,8 @@ function toGroups(text) {
|
|
|
50
50
|
if (current.length === 0) start = index;
|
|
51
51
|
current.push(char);
|
|
52
52
|
const next = chars[index + 1];
|
|
53
|
-
//
|
|
54
|
-
//
|
|
53
|
+
// Closes the group when the run of spaces following the word ends:
|
|
54
|
+
// that way the space travels with it and never starts a line on its own.
|
|
55
55
|
const isSpace = /\s/.test(char);
|
|
56
56
|
if (isSpace && next !== undefined && !/\s/.test(next)) {
|
|
57
57
|
groups.push({
|
|
@@ -70,23 +70,23 @@ function toGroups(text) {
|
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* ShinyText
|
|
73
|
-
*
|
|
74
|
-
* `background-clip: text`
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
73
|
+
* A band of light sweeps across the text from left to right. Without
|
|
74
|
+
* `background-clip: text` or masks —which React Native lacks in the supported
|
|
75
|
+
* range— the shine is composed letter by letter: each one carries its resting
|
|
76
|
+
* color and, overlaid on top, the same letter in the shine color with animated
|
|
77
|
+
* opacity. The band is a moving interpolation window: the only thing that
|
|
78
|
+
* changes per frame is `opacity`, which means the whole animation runs on the
|
|
79
|
+
* native thread and JS takes part in no frame.
|
|
80
80
|
*
|
|
81
|
-
* Gestalt,
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
81
|
+
* Gestalt, common fate: the letters light up in sequence and at the same
|
|
82
|
+
* rhythm, so they read as one moving thing —a word lighting up— and not as N
|
|
83
|
+
* letters blinking on their own. That is why the band width is relative to
|
|
84
|
+
* the text and not a fixed number of pixels: a long title and a short one take
|
|
85
|
+
* the same time and are perceived the same.
|
|
86
86
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* With "reduce motion" on, or with `animated={false}`, the text renders flat
|
|
88
|
+
* in `shineColor` —legible, a single node and selectable— because the effect
|
|
89
|
+
* is decorative and nothing it communicates lives in the shine.
|
|
90
90
|
*/
|
|
91
91
|
export const ShinyText = /*#__PURE__*/memo(({
|
|
92
92
|
text,
|
|
@@ -106,9 +106,9 @@ export const ShinyText = /*#__PURE__*/memo(({
|
|
|
106
106
|
const reduceMotion = useReduceMotion();
|
|
107
107
|
const progress = useRef(new Animated.Value(0)).current;
|
|
108
108
|
const base = color ?? theme.colors.textLight;
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
109
|
+
// The accent, not `text`: against `textLight` the difference is only in
|
|
110
|
+
// luminance and the sweep is barely visible. The shine changes hue as well
|
|
111
|
+
// as lightness, which is what makes the motion readable.
|
|
112
112
|
const shine = shineColor ?? theme.colors.primary;
|
|
113
113
|
const running = animated && !reduceMotion && text.length > 0;
|
|
114
114
|
useEffect(() => {
|
|
@@ -135,9 +135,9 @@ export const ShinyText = /*#__PURE__*/memo(({
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
const total = Array.from(text).length;
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
//
|
|
138
|
+
// The band enters on the left and exits on the right, so the normalized
|
|
139
|
+
// path measures 1 + 2·spread. `half` is half a band on that scale: the
|
|
140
|
+
// stretch of progress a letter takes to light up.
|
|
141
141
|
const half = spread / (1 + 2 * spread);
|
|
142
142
|
return /*#__PURE__*/_jsx(View, {
|
|
143
143
|
testID: testID,
|
|
@@ -152,7 +152,7 @@ export const ShinyText = /*#__PURE__*/memo(({
|
|
|
152
152
|
children: group.chars.map((char, offset) => {
|
|
153
153
|
const index = group.start + offset;
|
|
154
154
|
const position = total === 1 ? 0.5 : index / (total - 1);
|
|
155
|
-
//
|
|
155
|
+
// Progress at which the center of the band falls on this letter.
|
|
156
156
|
const peak = (position + spread) / (1 + 2 * spread);
|
|
157
157
|
const charStyle = [styles.text, style];
|
|
158
158
|
return /*#__PURE__*/_jsxs(View, {
|
|
@@ -4,21 +4,33 @@ import React, { memo, useEffect, useRef } from 'react';
|
|
|
4
4
|
import { Animated, Easing, View } from 'react-native';
|
|
5
5
|
import { createStyles } from '../theme/createStyles';
|
|
6
6
|
import { useTheme } from '../theme/UIProvider';
|
|
7
|
+
import { useReduceMotion } from './Transition';
|
|
8
|
+
|
|
9
|
+
/** Half a pulse cycle (opaque → faint). A loading loop, not a transition: it doesn't come from `duration`. */
|
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const PULSE_HALF_MS = 700;
|
|
8
12
|
const useStyles = createStyles(theme => ({
|
|
9
13
|
block: {
|
|
10
14
|
backgroundColor: theme.colors.skeleton
|
|
11
15
|
},
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
// Each line takes exactly `lineHeight.md` (Body's): a `fontSize.md` bar
|
|
17
|
+
// plus half the leading above and below. That way the fake paragraph
|
|
18
|
+
// measures the same as the real one and nothing jumps when the content arrives.
|
|
19
|
+
textLine: {
|
|
20
|
+
marginVertical: (theme.tokens.lineHeight.md - theme.tokens.fontSize.md) / 2
|
|
14
21
|
}
|
|
15
22
|
}));
|
|
16
23
|
|
|
17
24
|
/**
|
|
18
25
|
* Skeleton
|
|
19
|
-
* Placeholder
|
|
20
|
-
*
|
|
21
|
-
*
|
|
26
|
+
* Placeholder that pulses while the real content arrives. It reserves the
|
|
27
|
+
* exact space of what it replaces, so the screen doesn't jump when the data
|
|
28
|
+
* shows up — which is precisely what a centered Spinner can't do.
|
|
29
|
+
*
|
|
30
|
+
* Gestalt, similarity: the silhouette repeats the shape and size of the
|
|
31
|
+
* content (a circle for avatars, Body-height lines for text), so the eye
|
|
32
|
+
* already groups the screen before the data arrives. Respects Reduce Motion:
|
|
33
|
+
* no pulse, a static block.
|
|
22
34
|
*/
|
|
23
35
|
export const Skeleton = /*#__PURE__*/memo(({
|
|
24
36
|
width = '100%',
|
|
@@ -33,32 +45,37 @@ export const Skeleton = /*#__PURE__*/memo(({
|
|
|
33
45
|
}) => {
|
|
34
46
|
const theme = useTheme();
|
|
35
47
|
const styles = useStyles();
|
|
48
|
+
const reduceMotion = useReduceMotion();
|
|
49
|
+
const pulsing = animated && !reduceMotion;
|
|
36
50
|
const pulse = useRef(new Animated.Value(0)).current;
|
|
37
51
|
useEffect(() => {
|
|
38
|
-
if (!
|
|
52
|
+
if (!pulsing) return;
|
|
39
53
|
const loop = Animated.loop(Animated.sequence([Animated.timing(pulse, {
|
|
40
54
|
toValue: 1,
|
|
41
|
-
duration:
|
|
55
|
+
duration: PULSE_HALF_MS,
|
|
42
56
|
useNativeDriver: true,
|
|
43
57
|
easing: Easing.inOut(Easing.quad)
|
|
44
58
|
}), Animated.timing(pulse, {
|
|
45
59
|
toValue: 0,
|
|
46
|
-
duration:
|
|
60
|
+
duration: PULSE_HALF_MS,
|
|
47
61
|
useNativeDriver: true,
|
|
48
62
|
easing: Easing.inOut(Easing.quad)
|
|
49
63
|
})]));
|
|
50
64
|
loop.start();
|
|
51
|
-
return () =>
|
|
52
|
-
|
|
65
|
+
return () => {
|
|
66
|
+
loop.stop();
|
|
67
|
+
pulse.setValue(0);
|
|
68
|
+
};
|
|
69
|
+
}, [pulsing, pulse]);
|
|
53
70
|
const isCircle = variant === 'circle';
|
|
54
71
|
const isText = variant === 'text';
|
|
55
|
-
const opacity =
|
|
72
|
+
const opacity = pulsing ? pulse.interpolate({
|
|
56
73
|
inputRange: [0, 1],
|
|
57
74
|
outputRange: [1, 0.4]
|
|
58
75
|
}) : 1;
|
|
59
76
|
const resolvedHeight = isCircle ? width : isText ? theme.tokens.fontSize.md : height;
|
|
60
77
|
const resolvedRadius = radius ?? (isCircle ? theme.tokens.radius.full : isText ? theme.tokens.radius.xs : theme.tokens.radius.sm);
|
|
61
|
-
const barStyle = barWidth => [styles.block, {
|
|
78
|
+
const barStyle = barWidth => [styles.block, isText && styles.textLine, {
|
|
62
79
|
width: barWidth,
|
|
63
80
|
height: resolvedHeight,
|
|
64
81
|
borderRadius: resolvedRadius,
|
|
@@ -70,7 +87,7 @@ export const Skeleton = /*#__PURE__*/memo(({
|
|
|
70
87
|
};
|
|
71
88
|
if (isText && lines > 1) {
|
|
72
89
|
return /*#__PURE__*/_jsx(View, {
|
|
73
|
-
style:
|
|
90
|
+
style: style,
|
|
74
91
|
testID: testID,
|
|
75
92
|
...a11y,
|
|
76
93
|
children: Array.from({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useEffect","useRef","Animated","Easing","View","createStyles","useTheme","jsx","_jsx","useStyles","theme","block","backgroundColor","colors","skeleton","
|
|
1
|
+
{"version":3,"names":["React","memo","useEffect","useRef","Animated","Easing","View","createStyles","useTheme","useReduceMotion","jsx","_jsx","PULSE_HALF_MS","useStyles","theme","block","backgroundColor","colors","skeleton","textLine","marginVertical","tokens","lineHeight","md","fontSize","Skeleton","width","height","variant","radius","lines","lastLineWidth","animated","style","testID","styles","reduceMotion","pulsing","pulse","Value","current","loop","sequence","timing","toValue","duration","useNativeDriver","easing","inOut","quad","start","stop","setValue","isCircle","isText","opacity","interpolate","inputRange","outputRange","resolvedHeight","resolvedRadius","full","xs","sm","barStyle","barWidth","borderRadius","a11y","accessibilityElementsHidden","importantForAccessibility","children","Array","from","length","_","i","displayName"],"sourceRoot":"../../../src","sources":["atoms/Skeleton.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,SAAS,EAAEC,MAAM,QAA6B,OAAO;AAC3E,SACEC,QAAQ,EACRC,MAAM,EACNC,IAAI,QAIC,cAAc;AACrB,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,eAAe,QAAQ,cAAc;;AAE9C;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,MAAMC,aAAa,GAAG,GAAG;AAuBzB,MAAMC,SAAS,GAAGN,YAAY,CAAEO,KAAK,KAAM;EACzCC,KAAK,EAAE;IAAEC,eAAe,EAAEF,KAAK,CAACG,MAAM,CAACC;EAAS,CAAC;EACjD;EACA;EACA;EACAC,QAAQ,EAAE;IACRC,cAAc,EAAE,CAACN,KAAK,CAACO,MAAM,CAACC,UAAU,CAACC,EAAE,GAAGT,KAAK,CAACO,MAAM,CAACG,QAAQ,CAACD,EAAE,IAAI;EAC5E;AACF,CAAC,CAAC,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,QAAQ,gBAAGxB,IAAI,CAC1B,CAAC;EACCyB,KAAK,GAAG,MAAM;EACdC,MAAM,GAAG,EAAE;EACXC,OAAO,GAAG,MAAM;EAChBC,MAAM;EACNC,KAAK,GAAG,CAAC;EACTC,aAAa,GAAG,KAAK;EACrBC,QAAQ,GAAG,IAAI;EACfC,KAAK;EACLC;AACa,CAAC,KAAK;EACnB,MAAMpB,KAAK,GAAGN,QAAQ,CAAC,CAAC;EACxB,MAAM2B,MAAM,GAAGtB,SAAS,CAAC,CAAC;EAC1B,MAAMuB,YAAY,GAAG3B,eAAe,CAAC,CAAC;EACtC,MAAM4B,OAAO,GAAGL,QAAQ,IAAI,CAACI,YAAY;EACzC,MAAME,KAAK,GAAGnC,M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;IAACC,MAAM,EAAEA,MAAO;IAAA,GAAKiC;EAAI,CAAG,CAAC;AACrF,CACF,CAAC;AACD1C,QAAQ,CAACmD,WAAW,GAAG,UAAU","ignoreList":[]}
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
import React, { memo, useEffect, useRef } from 'react';
|
|
4
4
|
import { ActivityIndicator, Animated, Easing, Text, View } from 'react-native';
|
|
5
5
|
import { createStyles } from '../theme/createStyles';
|
|
6
|
-
import { useAllowFontScaling, useColors } from '../theme/UIProvider';
|
|
6
|
+
import { useAllowFontScaling, useColors, useLabels } from '../theme/UIProvider';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
// Rhythm of the looping indicators. They are not UI transitions (those use
|
|
9
|
+
// theme.tokens.duration): they are the pulse of a continuous animation.
|
|
10
|
+
const DOT_PULSE_MS = 320;
|
|
11
|
+
const DOT_STAGGER_MS = 140;
|
|
12
|
+
const RING_TURN_MS = 900;
|
|
8
13
|
const useStyles = createStyles(theme => ({
|
|
9
14
|
container: {
|
|
10
15
|
justifyContent: 'center',
|
|
@@ -16,33 +21,36 @@ const useStyles = createStyles(theme => ({
|
|
|
16
21
|
color: theme.colors.textLight,
|
|
17
22
|
fontSize: theme.tokens.fontSize.md
|
|
18
23
|
},
|
|
24
|
+
logo: {
|
|
25
|
+
marginBottom: theme.tokens.spacing.xl
|
|
26
|
+
},
|
|
19
27
|
dots: {
|
|
20
28
|
flexDirection: 'row',
|
|
21
29
|
gap: theme.tokens.spacing.sm
|
|
22
30
|
}
|
|
23
31
|
}));
|
|
24
32
|
|
|
25
|
-
/**
|
|
33
|
+
/** Three dots that pulse in sequence. Animated + useNativeDriver: runs on the native thread. */
|
|
26
34
|
const DotsIndicator = /*#__PURE__*/memo(({
|
|
27
35
|
color,
|
|
28
36
|
dotSize
|
|
29
37
|
}) => {
|
|
30
38
|
const dots = [useRef(new Animated.Value(0)).current, useRef(new Animated.Value(0)).current, useRef(new Animated.Value(0)).current];
|
|
31
39
|
useEffect(() => {
|
|
32
|
-
const animations = dots.map((dot, i) => Animated.loop(Animated.sequence([Animated.delay(i *
|
|
40
|
+
const animations = dots.map((dot, i) => Animated.loop(Animated.sequence([Animated.delay(i * DOT_STAGGER_MS), Animated.timing(dot, {
|
|
33
41
|
toValue: 1,
|
|
34
|
-
duration:
|
|
42
|
+
duration: DOT_PULSE_MS,
|
|
35
43
|
useNativeDriver: true,
|
|
36
44
|
easing: Easing.out(Easing.quad)
|
|
37
45
|
}), Animated.timing(dot, {
|
|
38
46
|
toValue: 0,
|
|
39
|
-
duration:
|
|
47
|
+
duration: DOT_PULSE_MS,
|
|
40
48
|
useNativeDriver: true,
|
|
41
49
|
easing: Easing.in(Easing.quad)
|
|
42
|
-
}), Animated.delay((2 - i) *
|
|
50
|
+
}), Animated.delay((2 - i) * DOT_STAGGER_MS)])));
|
|
43
51
|
animations.forEach(a => a.start());
|
|
44
|
-
//
|
|
45
|
-
//
|
|
52
|
+
// Without stop() the loops keep running after unmount and keep the
|
|
53
|
+
// Animated tree alive.
|
|
46
54
|
return () => animations.forEach(a => a.stop());
|
|
47
55
|
}, []);
|
|
48
56
|
return /*#__PURE__*/_jsx(View, {
|
|
@@ -72,7 +80,12 @@ const DotsIndicator = /*#__PURE__*/memo(({
|
|
|
72
80
|
});
|
|
73
81
|
DotsIndicator.displayName = 'DotsIndicator';
|
|
74
82
|
|
|
75
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Spinning ring: a faint fixed track and, on top, an arc (a single side of
|
|
85
|
+
* the border) that spins. The track uses `opacity` instead of appending alpha
|
|
86
|
+
* to the color (`color + '33'`), which only worked with 6-digit hex and broke
|
|
87
|
+
* with `rgb()` or color names.
|
|
88
|
+
*/
|
|
76
89
|
const RingIndicator = /*#__PURE__*/memo(({
|
|
77
90
|
color,
|
|
78
91
|
diameter
|
|
@@ -81,31 +94,64 @@ const RingIndicator = /*#__PURE__*/memo(({
|
|
|
81
94
|
useEffect(() => {
|
|
82
95
|
const animation = Animated.loop(Animated.timing(spin, {
|
|
83
96
|
toValue: 1,
|
|
84
|
-
duration:
|
|
97
|
+
duration: RING_TURN_MS,
|
|
85
98
|
useNativeDriver: true,
|
|
86
99
|
easing: Easing.linear
|
|
87
100
|
}));
|
|
88
101
|
animation.start();
|
|
89
102
|
return () => animation.stop();
|
|
90
103
|
}, []);
|
|
91
|
-
|
|
104
|
+
const ring = {
|
|
105
|
+
width: diameter,
|
|
106
|
+
height: diameter,
|
|
107
|
+
borderRadius: diameter / 2,
|
|
108
|
+
borderWidth: Math.max(2, diameter / 10)
|
|
109
|
+
};
|
|
110
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
92
111
|
style: {
|
|
93
112
|
width: diameter,
|
|
94
|
-
height: diameter
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
inputRange: [0, 1],
|
|
102
|
-
outputRange: ['0deg', '360deg']
|
|
103
|
-
})
|
|
113
|
+
height: diameter
|
|
114
|
+
},
|
|
115
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
116
|
+
style: [ring, {
|
|
117
|
+
position: 'absolute',
|
|
118
|
+
borderColor: color,
|
|
119
|
+
opacity: 0.2
|
|
104
120
|
}]
|
|
105
|
-
}
|
|
121
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
122
|
+
style: [ring, {
|
|
123
|
+
borderColor: 'transparent',
|
|
124
|
+
borderTopColor: color,
|
|
125
|
+
transform: [{
|
|
126
|
+
rotate: spin.interpolate({
|
|
127
|
+
inputRange: [0, 1],
|
|
128
|
+
outputRange: ['0deg', '360deg']
|
|
129
|
+
})
|
|
130
|
+
}]
|
|
131
|
+
}]
|
|
132
|
+
})]
|
|
106
133
|
});
|
|
107
134
|
});
|
|
108
135
|
RingIndicator.displayName = 'RingIndicator';
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Spinner
|
|
139
|
+
* Indeterminate loading indicator, with optional text below.
|
|
140
|
+
*
|
|
141
|
+
* Gestalt:
|
|
142
|
+
* - Common fate: the three `dots` pulse in sequence, at the same rhythm, and
|
|
143
|
+
* read as a single indicator moving forward.
|
|
144
|
+
* - Proximity: the text sits `spacing.md` from the indicator, so it reads as
|
|
145
|
+
* its explanation and not as loose text on the screen. The `logo` sits
|
|
146
|
+
* further away (`spacing.xl`): it is the screen's brand, not part of the indicator.
|
|
147
|
+
* - Focal point: with `logo`, the logo is the first thing seen and the
|
|
148
|
+
* indicator stays as a secondary signal that the app is loading.
|
|
149
|
+
*
|
|
150
|
+
* Accessibility: it is announced as a busy `progressbar`, with `text` (or
|
|
151
|
+
* `labels.loading`) as its name. The animation doesn't stop with Reduce
|
|
152
|
+
* Motion: it is the signal that something is happening, like the system's
|
|
153
|
+
* ActivityIndicator.
|
|
154
|
+
*/
|
|
109
155
|
export const Spinner = /*#__PURE__*/memo(({
|
|
110
156
|
size = 'large',
|
|
111
157
|
color,
|
|
@@ -113,9 +159,12 @@ export const Spinner = /*#__PURE__*/memo(({
|
|
|
113
159
|
fullscreen = true,
|
|
114
160
|
variant = 'native',
|
|
115
161
|
indicator,
|
|
162
|
+
logo,
|
|
163
|
+
accessibilityLabel,
|
|
116
164
|
testID
|
|
117
165
|
}) => {
|
|
118
166
|
const colors = useColors();
|
|
167
|
+
const labels = useLabels();
|
|
119
168
|
const styles = useStyles();
|
|
120
169
|
const allowFontScaling = useAllowFontScaling();
|
|
121
170
|
const resolvedColor = color || colors.primary;
|
|
@@ -140,7 +189,17 @@ export const Spinner = /*#__PURE__*/memo(({
|
|
|
140
189
|
flex: 1
|
|
141
190
|
}],
|
|
142
191
|
testID: testID,
|
|
143
|
-
|
|
192
|
+
accessible: true,
|
|
193
|
+
accessibilityRole: "progressbar",
|
|
194
|
+
accessibilityLabel: accessibilityLabel ?? (text || labels.loading),
|
|
195
|
+
accessibilityState: {
|
|
196
|
+
busy: true
|
|
197
|
+
},
|
|
198
|
+
accessibilityLiveRegion: "polite",
|
|
199
|
+
children: [logo != null && /*#__PURE__*/_jsx(View, {
|
|
200
|
+
style: styles.logo,
|
|
201
|
+
children: logo
|
|
202
|
+
}), renderIndicator(), !!text && /*#__PURE__*/_jsx(Text, {
|
|
144
203
|
allowFontScaling: allowFontScaling,
|
|
145
204
|
style: styles.text,
|
|
146
205
|
children: text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useEffect","useRef","ActivityIndicator","Animated","Easing","Text","View","createStyles","useAllowFontScaling","useColors","jsx","_jsx","jsxs","_jsxs","useStyles","theme","container","justifyContent","alignItems","padding","tokens","spacing","xl","text","marginTop","md","color","colors","textLight","fontSize","dots","flexDirection","gap","sm","DotsIndicator","dotSize","Value","current","animations","map","dot","i","loop","sequence","delay","timing","toValue","duration","useNativeDriver","easing","out","quad","in","forEach","a","start","stop","style","children","width","height","borderRadius","backgroundColor","opacity","interpolate","inputRange","outputRange","transform","scale","displayName","RingIndicator","diameter","spin","animation","linear","borderWidth","Math","max","borderColor","borderTopColor","rotate","Spinner","size","fullscreen","variant","indicator","testID","styles","allowFontScaling","resolvedColor","primary","renderIndicator","flex"],"sourceRoot":"../../../src","sources":["atoms/Spinner.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACtD,SAASC,iBAAiB,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC9E,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,mBAAmB,EAAEC,SAAS,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["React","memo","useEffect","useRef","ActivityIndicator","Animated","Easing","Text","View","createStyles","useAllowFontScaling","useColors","useLabels","jsx","_jsx","jsxs","_jsxs","DOT_PULSE_MS","DOT_STAGGER_MS","RING_TURN_MS","useStyles","theme","container","justifyContent","alignItems","padding","tokens","spacing","xl","text","marginTop","md","color","colors","textLight","fontSize","logo","marginBottom","dots","flexDirection","gap","sm","DotsIndicator","dotSize","Value","current","animations","map","dot","i","loop","sequence","delay","timing","toValue","duration","useNativeDriver","easing","out","quad","in","forEach","a","start","stop","style","children","width","height","borderRadius","backgroundColor","opacity","interpolate","inputRange","outputRange","transform","scale","displayName","RingIndicator","diameter","spin","animation","linear","ring","borderWidth","Math","max","position","borderColor","borderTopColor","rotate","Spinner","size","fullscreen","variant","indicator","accessibilityLabel","testID","labels","styles","allowFontScaling","resolvedColor","primary","renderIndicator","flex","accessible","accessibilityRole","loading","accessibilityState","busy","accessibilityLiveRegion"],"sourceRoot":"../../../src","sources":["atoms/Spinner.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACtD,SAASC,iBAAiB,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC9E,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,mBAAmB,EAAEC,SAAS,EAAEC,SAAS,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA+BhF;AACA;AACA,MAAMC,YAAY,GAAG,GAAG;AACxB,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,YAAY,GAAG,GAAG;AAExB,MAAMC,SAAS,GAAGX,YAAY,CAAEY,KAAK,KAAM;EACzCC,SAAS,EAAE;IAAEC,cAAc,EAAE,QAAQ;IAAEC,UAAU,EAAE,QAAQ;IAAEC,OAAO,EAAEJ,KAAK,CAACK,MAAM,CAACC,OAAO,CAACC;EAAG,CAAC;EAC/FC,IAAI,EAAE;IAAEC,SAAS,EAAET,KAAK,CAACK,MAAM,CAACC,OAAO,CAACI,EAAE;IAAEC,KAAK,EAAEX,KAAK,CAACY,MAA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F,IAAA,CAACgE,aAAa;MAAC9C,KAAK,EAAEqE,aAAc;MAACtB,QAAQ,EAAEH,KAAK,GAAG;IAAE,CAAE,CAAC;IAC3F,oBAAO9D,IAAA,CAACV,iBAAiB;MAACwF,IAAI,EAAEA,IAAK;MAAC5D,KAAK,EAAEqE;IAAc,CAAE,CAAC;EAChE,CAAC;EAED,oBACErF,KAAA,CAACR,IAAI;IACHyD,KAAK,EAAE,CAACkC,MAAM,CAAC7E,SAAS,EAAEuE,UAAU,IAAI;MAAEW,IAAI,EAAE;IAAE,CAAC,CAAE;IACrDP,MAAM,EAAEA,MAAO;IACfQ,UAAU;IACVC,iBAAiB,EAAC,aAAa;IAC/BV,kBAAkB,EAAEA,kBAAkB,KAAKnE,IAAI,IAAIqE,MAAM,CAACS,OAAO,CAAE;IACnEC,kBAAkB,EAAE;MAAEC,IAAI,EAAE;IAAK,CAAE;IACnCC,uBAAuB,EAAC,QAAQ;IAAA5C,QAAA,GAE/B9B,IAAI,IAAI,IAAI,iBAAItB,IAAA,CAACN,IAAI;MAACyD,KAAK,EAAEkC,MAAM,CAAC/D,IAAK;MAAA8B,QAAA,EAAE9B;IAAI,CAAO,CAAC,EACvDmE,eAAe,CAAC,CAAC,EACjB,CAAC,CAAC1E,IAAI,iBACLf,IAAA,CAACP,IAAI;MAAC6F,gBAAgB,EAAEA,gBAAiB;MAACnC,KAAK,EAAEkC,MAAM,CAACtE,IAAK;MAAAqC,QAAA,EAC1DrC;IAAI,CACD,CACP;EAAA,CACG,CAAC;AAEX,CACF,CAAC;AACD8D,OAAO,CAACd,WAAW,GAAG,SAAS","ignoreList":[]}
|
package/lib/module/atoms/Text.js
CHANGED
|
@@ -8,13 +8,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
const useStyles = createStyles(theme => ({
|
|
9
9
|
title: {
|
|
10
10
|
fontSize: theme.tokens.fontSize.xxl,
|
|
11
|
+
lineHeight: theme.tokens.lineHeight.xl,
|
|
11
12
|
fontWeight: theme.tokens.fontWeight.bold,
|
|
12
|
-
letterSpacing:
|
|
13
|
+
letterSpacing: theme.tokens.letterSpacing.tight,
|
|
13
14
|
color: theme.colors.text
|
|
14
15
|
},
|
|
15
16
|
subtitle: {
|
|
16
17
|
fontSize: theme.tokens.fontSize.lg,
|
|
17
|
-
|
|
18
|
+
lineHeight: theme.tokens.lineHeight.lg,
|
|
19
|
+
fontWeight: theme.tokens.fontWeight.semibold,
|
|
18
20
|
color: theme.colors.text
|
|
19
21
|
},
|
|
20
22
|
body: {
|
|
@@ -24,10 +26,11 @@ const useStyles = createStyles(theme => ({
|
|
|
24
26
|
},
|
|
25
27
|
caption: {
|
|
26
28
|
fontSize: theme.tokens.fontSize.sm,
|
|
29
|
+
lineHeight: theme.tokens.lineHeight.sm,
|
|
27
30
|
color: theme.colors.textLight
|
|
28
31
|
}
|
|
29
32
|
}));
|
|
30
|
-
function makeVariant(variant, defaultColor) {
|
|
33
|
+
function makeVariant(variant, defaultColor, defaultRole) {
|
|
31
34
|
const Component = /*#__PURE__*/memo(({
|
|
32
35
|
children,
|
|
33
36
|
style,
|
|
@@ -40,6 +43,7 @@ function makeVariant(variant, defaultColor) {
|
|
|
40
43
|
const allowFontScaling = useAllowFontScaling();
|
|
41
44
|
return /*#__PURE__*/_jsx(RNText, {
|
|
42
45
|
allowFontScaling: allowFontScaling,
|
|
46
|
+
accessibilityRole: defaultRole,
|
|
43
47
|
style: [styles[variant], {
|
|
44
48
|
color: color || colors[defaultColor],
|
|
45
49
|
textAlign: align
|
|
@@ -48,11 +52,58 @@ function makeVariant(variant, defaultColor) {
|
|
|
48
52
|
children: children
|
|
49
53
|
});
|
|
50
54
|
});
|
|
51
|
-
Component.displayName = variant;
|
|
55
|
+
Component.displayName = String(variant);
|
|
52
56
|
return Component;
|
|
53
57
|
}
|
|
54
|
-
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Screen or section title: the highest step of the typographic hierarchy.
|
|
61
|
+
*
|
|
62
|
+
* Gestalt, focal point (Von Restorff): it is the only text in its block with
|
|
63
|
+
* size `xxl` and weight `bold`, so it breaks the series of Body/Caption and is
|
|
64
|
+
* the first thing read. That is why there should be only one per block: two
|
|
65
|
+
* Titles together cancel each other out. The `tight` tracking offsets the room
|
|
66
|
+
* the large size opens between letters so the word reads as a single shape
|
|
67
|
+
* (Prägnanz), and `lineHeight.xl` keeps the block compact when the title wraps.
|
|
68
|
+
*
|
|
69
|
+
* Accessibility: it is announced with `accessibilityRole="header"`, so
|
|
70
|
+
* VoiceOver/TalkBack can jump from title to title. It can be overridden by
|
|
71
|
+
* passing a different `accessibilityRole`.
|
|
72
|
+
*/
|
|
73
|
+
export const Title = makeVariant('title', 'text', 'header');
|
|
74
|
+
/**
|
|
75
|
+
* Second step of the hierarchy: heads a group within the screen or
|
|
76
|
+
* accompanies a Title with a short piece of data.
|
|
77
|
+
*
|
|
78
|
+
* Gestalt, similarity: it shares its color with Body but steps up size (`lg`)
|
|
79
|
+
* and weight (`semibold`), so it is perceived as part of the same family and,
|
|
80
|
+
* at the same time, as the label of the block that follows. Proximity: it
|
|
81
|
+
* should sit closer to the content it heads than to the previous block. It is
|
|
82
|
+
* not an accessibility heading: if it marks a navigable section, use Title (or
|
|
83
|
+
* pass `accessibilityRole="header"`).
|
|
84
|
+
* `lineHeight.lg` (1.5×) keeps the text legible when it spans several lines.
|
|
85
|
+
*/
|
|
55
86
|
export const Subtitle = makeVariant('subtitle', 'text');
|
|
87
|
+
/**
|
|
88
|
+
* Running text: the default style for paragraphs, descriptions and values.
|
|
89
|
+
*
|
|
90
|
+
* Gestalt, similarity: all reading content shares size (`md`), regular weight
|
|
91
|
+
* and the `text` color, so it is perceived as a single level and the steps
|
|
92
|
+
* above (Title, Subtitle) and below (Caption) stand out by contrast.
|
|
93
|
+
* `lineHeight.md` (≈1.43×) gives the room between lines to read long
|
|
94
|
+
* paragraphs. If `color` is passed, the color/background pair must meet WCAG
|
|
95
|
+
* AA (4.5:1); the theme colors already guarantee it.
|
|
96
|
+
*/
|
|
56
97
|
export const Body = makeVariant('body', 'text');
|
|
98
|
+
/**
|
|
99
|
+
* Secondary text: hints, metadata, dates, help below a field.
|
|
100
|
+
*
|
|
101
|
+
* Gestalt, figure and ground: size `sm` and color `textLight` bring it one
|
|
102
|
+
* step below Body, so it reads as context and doesn't compete with the
|
|
103
|
+
* content. Proximity: it sits right next to the element it explains.
|
|
104
|
+
* `textLight` meets WCAG AA over `surface` and `background` in light and dark
|
|
105
|
+
* (palettes tests); don't lighten it further. `lineHeight.sm` (≈1.33×) keeps
|
|
106
|
+
* the lines together when the hint spans several.
|
|
107
|
+
*/
|
|
57
108
|
export const Caption = makeVariant('caption', 'textLight');
|
|
58
109
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","Text","RNText","createStyles","useAllowFontScaling","useColors","jsx","_jsx","useStyles","theme","title","fontSize","tokens","xxl","fontWeight","bold","letterSpacing","color","colors","text","subtitle","lg","
|
|
1
|
+
{"version":3,"names":["React","memo","Text","RNText","createStyles","useAllowFontScaling","useColors","jsx","_jsx","useStyles","theme","title","fontSize","tokens","xxl","lineHeight","xl","fontWeight","bold","letterSpacing","tight","color","colors","text","subtitle","lg","semibold","body","md","caption","sm","textLight","makeVariant","variant","defaultColor","defaultRole","Component","children","style","align","props","styles","allowFontScaling","accessibilityRole","textAlign","displayName","String","Title","Subtitle","Body","Caption"],"sourceRoot":"../../../src","sources":["atoms/Text.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SACEC,IAAI,IAAIC,MAAM,QAKT,cAAc;AACrB,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,mBAAmB,EAAEC,SAAS,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASrE,MAAMC,SAAS,GAAGL,YAAY,CAAEM,KAAK,KAAM;EACzCC,KAAK,EAAE;IACLC,QAAQ,EA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