orn-ui 0.1.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/README.md +107 -0
- package/bin/orn-ui.mjs +228 -0
- package/lib/commonjs/atoms/Avatar.js +42 -0
- package/lib/commonjs/atoms/Avatar.js.map +1 -0
- package/lib/commonjs/atoms/Badge.js +82 -0
- package/lib/commonjs/atoms/Badge.js.map +1 -0
- package/lib/commonjs/atoms/Button.js +222 -0
- package/lib/commonjs/atoms/Button.js.map +1 -0
- package/lib/commonjs/atoms/Card.js +33 -0
- package/lib/commonjs/atoms/Card.js.map +1 -0
- package/lib/commonjs/atoms/Checkbox.js +107 -0
- package/lib/commonjs/atoms/Checkbox.js.map +1 -0
- package/lib/commonjs/atoms/Divider.js +27 -0
- package/lib/commonjs/atoms/Divider.js.map +1 -0
- package/lib/commonjs/atoms/EmptyState.js +69 -0
- package/lib/commonjs/atoms/EmptyState.js.map +1 -0
- package/lib/commonjs/atoms/Fab.js +62 -0
- package/lib/commonjs/atoms/Fab.js.map +1 -0
- package/lib/commonjs/atoms/IconButton.js +60 -0
- package/lib/commonjs/atoms/IconButton.js.map +1 -0
- package/lib/commonjs/atoms/Image.js +113 -0
- package/lib/commonjs/atoms/Image.js.map +1 -0
- package/lib/commonjs/atoms/Input.js +173 -0
- package/lib/commonjs/atoms/Input.js.map +1 -0
- package/lib/commonjs/atoms/KeyValueRow.js +60 -0
- package/lib/commonjs/atoms/KeyValueRow.js.map +1 -0
- package/lib/commonjs/atoms/PressableScale.js +60 -0
- package/lib/commonjs/atoms/PressableScale.js.map +1 -0
- package/lib/commonjs/atoms/Spinner.js +156 -0
- package/lib/commonjs/atoms/Spinner.js.map +1 -0
- package/lib/commonjs/atoms/Text.js +63 -0
- package/lib/commonjs/atoms/Text.js.map +1 -0
- package/lib/commonjs/atoms/index.js +135 -0
- package/lib/commonjs/atoms/index.js.map +1 -0
- package/lib/commonjs/icons/Icon.js +40 -0
- package/lib/commonjs/icons/Icon.js.map +1 -0
- package/lib/commonjs/icons/defaultIcons.js +386 -0
- package/lib/commonjs/icons/defaultIcons.js.map +1 -0
- package/lib/commonjs/icons/index.js +20 -0
- package/lib/commonjs/icons/index.js.map +1 -0
- package/lib/commonjs/icons/types.js +6 -0
- package/lib/commonjs/icons/types.js.map +1 -0
- package/lib/commonjs/index.js +61 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/molecules/AvatarHeader.js +87 -0
- package/lib/commonjs/molecules/AvatarHeader.js.map +1 -0
- package/lib/commonjs/molecules/FormActions.js +47 -0
- package/lib/commonjs/molecules/FormActions.js.map +1 -0
- package/lib/commonjs/molecules/InfoRow.js +83 -0
- package/lib/commonjs/molecules/InfoRow.js.map +1 -0
- package/lib/commonjs/molecules/OptionCard.js +98 -0
- package/lib/commonjs/molecules/OptionCard.js.map +1 -0
- package/lib/commonjs/molecules/Stepper.js +104 -0
- package/lib/commonjs/molecules/Stepper.js.map +1 -0
- package/lib/commonjs/molecules/Steps.js +220 -0
- package/lib/commonjs/molecules/Steps.js.map +1 -0
- package/lib/commonjs/molecules/ThemeToggle.js +91 -0
- package/lib/commonjs/molecules/ThemeToggle.js.map +1 -0
- package/lib/commonjs/molecules/index.js +55 -0
- package/lib/commonjs/molecules/index.js.map +1 -0
- package/lib/commonjs/organisms/Alert.js +223 -0
- package/lib/commonjs/organisms/Alert.js.map +1 -0
- package/lib/commonjs/organisms/AlertProvider.js +109 -0
- package/lib/commonjs/organisms/AlertProvider.js.map +1 -0
- package/lib/commonjs/organisms/BottomSheet.js +154 -0
- package/lib/commonjs/organisms/BottomSheet.js.map +1 -0
- package/lib/commonjs/organisms/DateField.js +147 -0
- package/lib/commonjs/organisms/DateField.js.map +1 -0
- package/lib/commonjs/organisms/DatePicker.js +253 -0
- package/lib/commonjs/organisms/DatePicker.js.map +1 -0
- package/lib/commonjs/organisms/List.js +143 -0
- package/lib/commonjs/organisms/List.js.map +1 -0
- package/lib/commonjs/organisms/Modal.js +286 -0
- package/lib/commonjs/organisms/Modal.js.map +1 -0
- package/lib/commonjs/organisms/Screen.js +75 -0
- package/lib/commonjs/organisms/Screen.js.map +1 -0
- package/lib/commonjs/organisms/SearchList.js +180 -0
- package/lib/commonjs/organisms/SearchList.js.map +1 -0
- package/lib/commonjs/organisms/Select.js +178 -0
- package/lib/commonjs/organisms/Select.js.map +1 -0
- package/lib/commonjs/organisms/Toast.js +157 -0
- package/lib/commonjs/organisms/Toast.js.map +1 -0
- package/lib/commonjs/organisms/ToastProvider.js +131 -0
- package/lib/commonjs/organisms/ToastProvider.js.map +1 -0
- package/lib/commonjs/organisms/Wizard.js +116 -0
- package/lib/commonjs/organisms/Wizard.js.map +1 -0
- package/lib/commonjs/organisms/index.js +127 -0
- package/lib/commonjs/organisms/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/theme/UIProvider.js +110 -0
- package/lib/commonjs/theme/UIProvider.js.map +1 -0
- package/lib/commonjs/theme/createStyles.js +42 -0
- package/lib/commonjs/theme/createStyles.js.map +1 -0
- package/lib/commonjs/theme/createTheme.js +50 -0
- package/lib/commonjs/theme/createTheme.js.map +1 -0
- package/lib/commonjs/theme/index.js +151 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/insets.js +15 -0
- package/lib/commonjs/theme/insets.js.map +1 -0
- package/lib/commonjs/theme/labels.js +18 -0
- package/lib/commonjs/theme/labels.js.map +1 -0
- package/lib/commonjs/theme/palettes.js +42 -0
- package/lib/commonjs/theme/palettes.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +120 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/theme/types.js +6 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/module/atoms/Avatar.js +37 -0
- package/lib/module/atoms/Avatar.js.map +1 -0
- package/lib/module/atoms/Badge.js +77 -0
- package/lib/module/atoms/Badge.js.map +1 -0
- package/lib/module/atoms/Button.js +217 -0
- package/lib/module/atoms/Button.js.map +1 -0
- package/lib/module/atoms/Card.js +28 -0
- package/lib/module/atoms/Card.js.map +1 -0
- package/lib/module/atoms/Checkbox.js +102 -0
- package/lib/module/atoms/Checkbox.js.map +1 -0
- package/lib/module/atoms/Divider.js +22 -0
- package/lib/module/atoms/Divider.js.map +1 -0
- package/lib/module/atoms/EmptyState.js +64 -0
- package/lib/module/atoms/EmptyState.js.map +1 -0
- package/lib/module/atoms/Fab.js +57 -0
- package/lib/module/atoms/Fab.js.map +1 -0
- package/lib/module/atoms/IconButton.js +55 -0
- package/lib/module/atoms/IconButton.js.map +1 -0
- package/lib/module/atoms/Image.js +108 -0
- package/lib/module/atoms/Image.js.map +1 -0
- package/lib/module/atoms/Input.js +168 -0
- package/lib/module/atoms/Input.js.map +1 -0
- package/lib/module/atoms/KeyValueRow.js +55 -0
- package/lib/module/atoms/KeyValueRow.js.map +1 -0
- package/lib/module/atoms/PressableScale.js +55 -0
- package/lib/module/atoms/PressableScale.js.map +1 -0
- package/lib/module/atoms/Spinner.js +151 -0
- package/lib/module/atoms/Spinner.js.map +1 -0
- package/lib/module/atoms/Text.js +58 -0
- package/lib/module/atoms/Text.js.map +1 -0
- package/lib/module/atoms/index.js +18 -0
- package/lib/module/atoms/index.js.map +1 -0
- package/lib/module/icons/Icon.js +35 -0
- package/lib/module/icons/Icon.js.map +1 -0
- package/lib/module/icons/defaultIcons.js +381 -0
- package/lib/module/icons/defaultIcons.js.map +1 -0
- package/lib/module/icons/index.js +5 -0
- package/lib/module/icons/index.js.map +1 -0
- package/lib/module/icons/types.js +4 -0
- package/lib/module/icons/types.js.map +1 -0
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/molecules/AvatarHeader.js +82 -0
- package/lib/module/molecules/AvatarHeader.js.map +1 -0
- package/lib/module/molecules/FormActions.js +42 -0
- package/lib/module/molecules/FormActions.js.map +1 -0
- package/lib/module/molecules/InfoRow.js +78 -0
- package/lib/module/molecules/InfoRow.js.map +1 -0
- package/lib/module/molecules/OptionCard.js +93 -0
- package/lib/module/molecules/OptionCard.js.map +1 -0
- package/lib/module/molecules/Stepper.js +99 -0
- package/lib/module/molecules/Stepper.js.map +1 -0
- package/lib/module/molecules/Steps.js +215 -0
- package/lib/module/molecules/Steps.js.map +1 -0
- package/lib/module/molecules/ThemeToggle.js +86 -0
- package/lib/module/molecules/ThemeToggle.js.map +1 -0
- package/lib/module/molecules/index.js +10 -0
- package/lib/module/molecules/index.js.map +1 -0
- package/lib/module/organisms/Alert.js +218 -0
- package/lib/module/organisms/Alert.js.map +1 -0
- package/lib/module/organisms/AlertProvider.js +103 -0
- package/lib/module/organisms/AlertProvider.js.map +1 -0
- package/lib/module/organisms/BottomSheet.js +149 -0
- package/lib/module/organisms/BottomSheet.js.map +1 -0
- package/lib/module/organisms/DateField.js +142 -0
- package/lib/module/organisms/DateField.js.map +1 -0
- package/lib/module/organisms/DatePicker.js +247 -0
- package/lib/module/organisms/DatePicker.js.map +1 -0
- package/lib/module/organisms/List.js +138 -0
- package/lib/module/organisms/List.js.map +1 -0
- package/lib/module/organisms/Modal.js +281 -0
- package/lib/module/organisms/Modal.js.map +1 -0
- package/lib/module/organisms/Screen.js +70 -0
- package/lib/module/organisms/Screen.js.map +1 -0
- package/lib/module/organisms/SearchList.js +175 -0
- package/lib/module/organisms/SearchList.js.map +1 -0
- package/lib/module/organisms/Select.js +173 -0
- package/lib/module/organisms/Select.js.map +1 -0
- package/lib/module/organisms/Toast.js +152 -0
- package/lib/module/organisms/Toast.js.map +1 -0
- package/lib/module/organisms/ToastProvider.js +125 -0
- package/lib/module/organisms/ToastProvider.js.map +1 -0
- package/lib/module/organisms/Wizard.js +111 -0
- package/lib/module/organisms/Wizard.js.map +1 -0
- package/lib/module/organisms/index.js +16 -0
- package/lib/module/organisms/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theme/UIProvider.js +97 -0
- package/lib/module/theme/UIProvider.js.map +1 -0
- package/lib/module/theme/createStyles.js +38 -0
- package/lib/module/theme/createStyles.js.map +1 -0
- package/lib/module/theme/createTheme.js +45 -0
- package/lib/module/theme/createTheme.js.map +1 -0
- package/lib/module/theme/index.js +10 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/insets.js +11 -0
- package/lib/module/theme/insets.js.map +1 -0
- package/lib/module/theme/labels.js +14 -0
- package/lib/module/theme/labels.js.map +1 -0
- package/lib/module/theme/palettes.js +38 -0
- package/lib/module/theme/palettes.js.map +1 -0
- package/lib/module/theme/tokens.js +117 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/typescript/atoms/Avatar.d.ts +15 -0
- package/lib/typescript/atoms/Avatar.d.ts.map +1 -0
- package/lib/typescript/atoms/Badge.d.ts +19 -0
- package/lib/typescript/atoms/Badge.d.ts.map +1 -0
- package/lib/typescript/atoms/Button.d.ts +30 -0
- package/lib/typescript/atoms/Button.d.ts.map +1 -0
- package/lib/typescript/atoms/Card.d.ts +8 -0
- package/lib/typescript/atoms/Card.d.ts.map +1 -0
- package/lib/typescript/atoms/Checkbox.d.ts +11 -0
- package/lib/typescript/atoms/Checkbox.d.ts.map +1 -0
- package/lib/typescript/atoms/Divider.d.ts +8 -0
- package/lib/typescript/atoms/Divider.d.ts.map +1 -0
- package/lib/typescript/atoms/EmptyState.d.ts +12 -0
- package/lib/typescript/atoms/EmptyState.d.ts.map +1 -0
- package/lib/typescript/atoms/Fab.d.ts +22 -0
- package/lib/typescript/atoms/Fab.d.ts.map +1 -0
- package/lib/typescript/atoms/IconButton.d.ts +23 -0
- package/lib/typescript/atoms/IconButton.d.ts.map +1 -0
- package/lib/typescript/atoms/Image.d.ts +45 -0
- package/lib/typescript/atoms/Image.d.ts.map +1 -0
- package/lib/typescript/atoms/Input.d.ts +24 -0
- package/lib/typescript/atoms/Input.d.ts.map +1 -0
- package/lib/typescript/atoms/KeyValueRow.d.ts +17 -0
- package/lib/typescript/atoms/KeyValueRow.d.ts.map +1 -0
- package/lib/typescript/atoms/PressableScale.d.ts +15 -0
- package/lib/typescript/atoms/PressableScale.d.ts.map +1 -0
- package/lib/typescript/atoms/Spinner.d.ts +20 -0
- package/lib/typescript/atoms/Spinner.d.ts.map +1 -0
- package/lib/typescript/atoms/Text.d.ts +13 -0
- package/lib/typescript/atoms/Text.d.ts.map +1 -0
- package/lib/typescript/atoms/index.d.ts +31 -0
- package/lib/typescript/atoms/index.d.ts.map +1 -0
- package/lib/typescript/icons/Icon.d.ts +18 -0
- package/lib/typescript/icons/Icon.d.ts.map +1 -0
- package/lib/typescript/icons/defaultIcons.d.ts +5 -0
- package/lib/typescript/icons/defaultIcons.d.ts.map +1 -0
- package/lib/typescript/icons/index.d.ts +5 -0
- package/lib/typescript/icons/index.d.ts.map +1 -0
- package/lib/typescript/icons/types.d.ts +10 -0
- package/lib/typescript/icons/types.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +6 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/molecules/AvatarHeader.d.ts +20 -0
- package/lib/typescript/molecules/AvatarHeader.d.ts.map +1 -0
- package/lib/typescript/molecules/FormActions.d.ts +21 -0
- package/lib/typescript/molecules/FormActions.d.ts.map +1 -0
- package/lib/typescript/molecules/InfoRow.d.ts +17 -0
- package/lib/typescript/molecules/InfoRow.d.ts.map +1 -0
- package/lib/typescript/molecules/OptionCard.d.ts +20 -0
- package/lib/typescript/molecules/OptionCard.d.ts.map +1 -0
- package/lib/typescript/molecules/Stepper.d.ts +15 -0
- package/lib/typescript/molecules/Stepper.d.ts.map +1 -0
- package/lib/typescript/molecules/Steps.d.ts +29 -0
- package/lib/typescript/molecules/Steps.d.ts.map +1 -0
- package/lib/typescript/molecules/ThemeToggle.d.ts +15 -0
- package/lib/typescript/molecules/ThemeToggle.d.ts.map +1 -0
- package/lib/typescript/molecules/index.d.ts +15 -0
- package/lib/typescript/molecules/index.d.ts.map +1 -0
- package/lib/typescript/organisms/Alert.d.ts +29 -0
- package/lib/typescript/organisms/Alert.d.ts.map +1 -0
- package/lib/typescript/organisms/AlertProvider.d.ts +32 -0
- package/lib/typescript/organisms/AlertProvider.d.ts.map +1 -0
- package/lib/typescript/organisms/BottomSheet.d.ts +15 -0
- package/lib/typescript/organisms/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/organisms/DateField.d.ts +26 -0
- package/lib/typescript/organisms/DateField.d.ts.map +1 -0
- package/lib/typescript/organisms/DatePicker.d.ts +49 -0
- package/lib/typescript/organisms/DatePicker.d.ts.map +1 -0
- package/lib/typescript/organisms/List.d.ts +35 -0
- package/lib/typescript/organisms/List.d.ts.map +1 -0
- package/lib/typescript/organisms/Modal.d.ts +25 -0
- package/lib/typescript/organisms/Modal.d.ts.map +1 -0
- package/lib/typescript/organisms/Screen.d.ts +26 -0
- package/lib/typescript/organisms/Screen.d.ts.map +1 -0
- package/lib/typescript/organisms/SearchList.d.ts +40 -0
- package/lib/typescript/organisms/SearchList.d.ts.map +1 -0
- package/lib/typescript/organisms/Select.d.ts +25 -0
- package/lib/typescript/organisms/Select.d.ts.map +1 -0
- package/lib/typescript/organisms/Toast.d.ts +28 -0
- package/lib/typescript/organisms/Toast.d.ts.map +1 -0
- package/lib/typescript/organisms/ToastProvider.d.ts +36 -0
- package/lib/typescript/organisms/ToastProvider.d.ts.map +1 -0
- package/lib/typescript/organisms/Wizard.d.ts +40 -0
- package/lib/typescript/organisms/Wizard.d.ts.map +1 -0
- package/lib/typescript/organisms/index.d.ts +27 -0
- package/lib/typescript/organisms/index.d.ts.map +1 -0
- package/lib/typescript/theme/UIProvider.d.ts +47 -0
- package/lib/typescript/theme/UIProvider.d.ts.map +1 -0
- package/lib/typescript/theme/createStyles.d.ts +21 -0
- package/lib/typescript/theme/createStyles.d.ts.map +1 -0
- package/lib/typescript/theme/createTheme.d.ts +9 -0
- package/lib/typescript/theme/createTheme.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +14 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/insets.d.ts +9 -0
- package/lib/typescript/theme/insets.d.ts.map +1 -0
- package/lib/typescript/theme/labels.d.ts +13 -0
- package/lib/typescript/theme/labels.d.ts.map +1 -0
- package/lib/typescript/theme/palettes.d.ts +24 -0
- package/lib/typescript/theme/palettes.d.ts.map +1 -0
- package/lib/typescript/theme/tokens.d.ts +41 -0
- package/lib/typescript/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/theme/types.d.ts +24 -0
- package/lib/typescript/theme/types.d.ts.map +1 -0
- package/package.json +311 -0
- package/registry/alert-provider.json +21 -0
- package/registry/alert.json +19 -0
- package/registry/avatar-header.json +18 -0
- package/registry/avatar.json +18 -0
- package/registry/badge.json +18 -0
- package/registry/bottom-sheet.json +18 -0
- package/registry/button.json +18 -0
- package/registry/card.json +18 -0
- package/registry/checkbox.json +18 -0
- package/registry/core.json +64 -0
- package/registry/date-field.json +24 -0
- package/registry/date-picker.json +23 -0
- package/registry/divider.json +18 -0
- package/registry/empty-state.json +18 -0
- package/registry/fab.json +19 -0
- package/registry/form-actions.json +19 -0
- package/registry/icon-button.json +19 -0
- package/registry/image.json +20 -0
- package/registry/index.json +465 -0
- package/registry/info-row.json +19 -0
- package/registry/input.json +18 -0
- package/registry/key-value-row.json +18 -0
- package/registry/list.json +20 -0
- package/registry/manifest.json +263 -0
- package/registry/modal.json +21 -0
- package/registry/option-card.json +18 -0
- package/registry/pressable-scale.json +18 -0
- package/registry/screen.json +18 -0
- package/registry/search-list.json +23 -0
- package/registry/select.json +18 -0
- package/registry/spinner.json +18 -0
- package/registry/stepper.json +18 -0
- package/registry/steps.json +18 -0
- package/registry/theme-toggle.json +18 -0
- package/registry/title.json +21 -0
- package/registry/toast-provider.json +20 -0
- package/registry/toast.json +18 -0
- package/registry/wizard.json +20 -0
- package/src/atoms/Avatar.tsx +40 -0
- package/src/atoms/Badge.tsx +55 -0
- package/src/atoms/Button.tsx +186 -0
- package/src/atoms/Card.tsx +27 -0
- package/src/atoms/Checkbox.tsx +75 -0
- package/src/atoms/Divider.tsx +14 -0
- package/src/atoms/EmptyState.tsx +60 -0
- package/src/atoms/Fab.tsx +63 -0
- package/src/atoms/IconButton.tsx +53 -0
- package/src/atoms/Image.tsx +137 -0
- package/src/atoms/Input.tsx +166 -0
- package/src/atoms/KeyValueRow.tsx +48 -0
- package/src/atoms/PressableScale.tsx +52 -0
- package/src/atoms/Spinner.tsx +127 -0
- package/src/atoms/Text.tsx +58 -0
- package/src/atoms/index.ts +30 -0
- package/src/icons/Icon.tsx +27 -0
- package/src/icons/defaultIcons.tsx +292 -0
- package/src/icons/index.ts +4 -0
- package/src/icons/types.ts +27 -0
- package/src/index.ts +5 -0
- package/src/molecules/AvatarHeader.tsx +69 -0
- package/src/molecules/FormActions.tsx +52 -0
- package/src/molecules/InfoRow.tsx +52 -0
- package/src/molecules/OptionCard.tsx +82 -0
- package/src/molecules/Stepper.tsx +76 -0
- package/src/molecules/Steps.tsx +198 -0
- package/src/molecules/ThemeToggle.tsx +67 -0
- package/src/molecules/index.ts +14 -0
- package/src/organisms/Alert.tsx +162 -0
- package/src/organisms/AlertProvider.tsx +125 -0
- package/src/organisms/BottomSheet.tsx +95 -0
- package/src/organisms/DateField.tsx +134 -0
- package/src/organisms/DatePicker.tsx +255 -0
- package/src/organisms/List.tsx +154 -0
- package/src/organisms/Modal.tsx +251 -0
- package/src/organisms/Screen.tsx +84 -0
- package/src/organisms/SearchList.tsx +186 -0
- package/src/organisms/Select.tsx +156 -0
- package/src/organisms/Toast.tsx +135 -0
- package/src/organisms/ToastProvider.tsx +166 -0
- package/src/organisms/Wizard.tsx +137 -0
- package/src/organisms/index.ts +26 -0
- package/src/theme/UIProvider.tsx +129 -0
- package/src/theme/createStyles.ts +40 -0
- package/src/theme/createTheme.ts +49 -0
- package/src/theme/index.ts +22 -0
- package/src/theme/insets.ts +9 -0
- package/src/theme/labels.ts +23 -0
- package/src/theme/palettes.ts +53 -0
- package/src/theme/tokens.ts +113 -0
- package/src/theme/types.ts +27 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
{
|
|
2
|
+
"core": {
|
|
3
|
+
"bytes": 24213
|
|
4
|
+
},
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"name": "Title",
|
|
8
|
+
"slug": "title",
|
|
9
|
+
"category": "atoms",
|
|
10
|
+
"exportedNames": [
|
|
11
|
+
"Title",
|
|
12
|
+
"Subtitle",
|
|
13
|
+
"Body",
|
|
14
|
+
"Caption"
|
|
15
|
+
],
|
|
16
|
+
"registryDependencies": [
|
|
17
|
+
"core"
|
|
18
|
+
],
|
|
19
|
+
"bytes": 1844
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Button",
|
|
23
|
+
"slug": "button",
|
|
24
|
+
"category": "atoms",
|
|
25
|
+
"exportedNames": [
|
|
26
|
+
"Button"
|
|
27
|
+
],
|
|
28
|
+
"registryDependencies": [
|
|
29
|
+
"core"
|
|
30
|
+
],
|
|
31
|
+
"bytes": 6614
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "IconButton",
|
|
35
|
+
"slug": "icon-button",
|
|
36
|
+
"category": "atoms",
|
|
37
|
+
"exportedNames": [
|
|
38
|
+
"IconButton"
|
|
39
|
+
],
|
|
40
|
+
"registryDependencies": [
|
|
41
|
+
"core",
|
|
42
|
+
"pressable-scale"
|
|
43
|
+
],
|
|
44
|
+
"bytes": 1744
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "Input",
|
|
48
|
+
"slug": "input",
|
|
49
|
+
"category": "atoms",
|
|
50
|
+
"exportedNames": [
|
|
51
|
+
"Input"
|
|
52
|
+
],
|
|
53
|
+
"registryDependencies": [
|
|
54
|
+
"core"
|
|
55
|
+
],
|
|
56
|
+
"bytes": 5439
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Checkbox",
|
|
60
|
+
"slug": "checkbox",
|
|
61
|
+
"category": "atoms",
|
|
62
|
+
"exportedNames": [
|
|
63
|
+
"Checkbox"
|
|
64
|
+
],
|
|
65
|
+
"registryDependencies": [
|
|
66
|
+
"core"
|
|
67
|
+
],
|
|
68
|
+
"bytes": 2632
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "Badge",
|
|
72
|
+
"slug": "badge",
|
|
73
|
+
"category": "atoms",
|
|
74
|
+
"exportedNames": [
|
|
75
|
+
"Badge"
|
|
76
|
+
],
|
|
77
|
+
"registryDependencies": [
|
|
78
|
+
"core"
|
|
79
|
+
],
|
|
80
|
+
"bytes": 2030
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "Card",
|
|
84
|
+
"slug": "card",
|
|
85
|
+
"category": "atoms",
|
|
86
|
+
"exportedNames": [
|
|
87
|
+
"Card"
|
|
88
|
+
],
|
|
89
|
+
"registryDependencies": [
|
|
90
|
+
"core"
|
|
91
|
+
],
|
|
92
|
+
"bytes": 711
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "Divider",
|
|
96
|
+
"slug": "divider",
|
|
97
|
+
"category": "atoms",
|
|
98
|
+
"exportedNames": [
|
|
99
|
+
"Divider"
|
|
100
|
+
],
|
|
101
|
+
"registryDependencies": [
|
|
102
|
+
"core"
|
|
103
|
+
],
|
|
104
|
+
"bytes": 489
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "Avatar",
|
|
108
|
+
"slug": "avatar",
|
|
109
|
+
"category": "atoms",
|
|
110
|
+
"exportedNames": [
|
|
111
|
+
"Avatar"
|
|
112
|
+
],
|
|
113
|
+
"registryDependencies": [
|
|
114
|
+
"core"
|
|
115
|
+
],
|
|
116
|
+
"bytes": 1015
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "Image",
|
|
120
|
+
"slug": "image",
|
|
121
|
+
"category": "atoms",
|
|
122
|
+
"exportedNames": [
|
|
123
|
+
"Image",
|
|
124
|
+
"prefetchImage"
|
|
125
|
+
],
|
|
126
|
+
"registryDependencies": [
|
|
127
|
+
"core",
|
|
128
|
+
"spinner"
|
|
129
|
+
],
|
|
130
|
+
"bytes": 4620
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "Spinner",
|
|
134
|
+
"slug": "spinner",
|
|
135
|
+
"category": "atoms",
|
|
136
|
+
"exportedNames": [
|
|
137
|
+
"Spinner"
|
|
138
|
+
],
|
|
139
|
+
"registryDependencies": [
|
|
140
|
+
"core"
|
|
141
|
+
],
|
|
142
|
+
"bytes": 4626
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "EmptyState",
|
|
146
|
+
"slug": "empty-state",
|
|
147
|
+
"category": "atoms",
|
|
148
|
+
"exportedNames": [
|
|
149
|
+
"EmptyState"
|
|
150
|
+
],
|
|
151
|
+
"registryDependencies": [
|
|
152
|
+
"core"
|
|
153
|
+
],
|
|
154
|
+
"bytes": 1925
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "KeyValueRow",
|
|
158
|
+
"slug": "key-value-row",
|
|
159
|
+
"category": "atoms",
|
|
160
|
+
"exportedNames": [
|
|
161
|
+
"KeyValueRow"
|
|
162
|
+
],
|
|
163
|
+
"registryDependencies": [
|
|
164
|
+
"core"
|
|
165
|
+
],
|
|
166
|
+
"bytes": 1764
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "Fab",
|
|
170
|
+
"slug": "fab",
|
|
171
|
+
"category": "atoms",
|
|
172
|
+
"exportedNames": [
|
|
173
|
+
"Fab"
|
|
174
|
+
],
|
|
175
|
+
"registryDependencies": [
|
|
176
|
+
"core",
|
|
177
|
+
"pressable-scale"
|
|
178
|
+
],
|
|
179
|
+
"bytes": 1784
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "PressableScale",
|
|
183
|
+
"slug": "pressable-scale",
|
|
184
|
+
"category": "atoms",
|
|
185
|
+
"exportedNames": [
|
|
186
|
+
"PressableScale"
|
|
187
|
+
],
|
|
188
|
+
"registryDependencies": [
|
|
189
|
+
"core"
|
|
190
|
+
],
|
|
191
|
+
"bytes": 1565
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "Stepper",
|
|
195
|
+
"slug": "stepper",
|
|
196
|
+
"category": "molecules",
|
|
197
|
+
"exportedNames": [
|
|
198
|
+
"Stepper"
|
|
199
|
+
],
|
|
200
|
+
"registryDependencies": [
|
|
201
|
+
"core"
|
|
202
|
+
],
|
|
203
|
+
"bytes": 2842
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "OptionCard",
|
|
207
|
+
"slug": "option-card",
|
|
208
|
+
"category": "molecules",
|
|
209
|
+
"exportedNames": [
|
|
210
|
+
"OptionCard"
|
|
211
|
+
],
|
|
212
|
+
"registryDependencies": [
|
|
213
|
+
"core"
|
|
214
|
+
],
|
|
215
|
+
"bytes": 3005
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "InfoRow",
|
|
219
|
+
"slug": "info-row",
|
|
220
|
+
"category": "molecules",
|
|
221
|
+
"exportedNames": [
|
|
222
|
+
"InfoRow"
|
|
223
|
+
],
|
|
224
|
+
"registryDependencies": [
|
|
225
|
+
"core",
|
|
226
|
+
"avatar"
|
|
227
|
+
],
|
|
228
|
+
"bytes": 1967
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "FormActions",
|
|
232
|
+
"slug": "form-actions",
|
|
233
|
+
"category": "molecules",
|
|
234
|
+
"exportedNames": [
|
|
235
|
+
"FormActions"
|
|
236
|
+
],
|
|
237
|
+
"registryDependencies": [
|
|
238
|
+
"core",
|
|
239
|
+
"button"
|
|
240
|
+
],
|
|
241
|
+
"bytes": 1527
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "AvatarHeader",
|
|
245
|
+
"slug": "avatar-header",
|
|
246
|
+
"category": "molecules",
|
|
247
|
+
"exportedNames": [
|
|
248
|
+
"AvatarHeader"
|
|
249
|
+
],
|
|
250
|
+
"registryDependencies": [
|
|
251
|
+
"core"
|
|
252
|
+
],
|
|
253
|
+
"bytes": 2486
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "ThemeToggle",
|
|
257
|
+
"slug": "theme-toggle",
|
|
258
|
+
"category": "molecules",
|
|
259
|
+
"exportedNames": [
|
|
260
|
+
"ThemeToggle"
|
|
261
|
+
],
|
|
262
|
+
"registryDependencies": [
|
|
263
|
+
"core"
|
|
264
|
+
],
|
|
265
|
+
"bytes": 2440
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "Steps",
|
|
269
|
+
"slug": "steps",
|
|
270
|
+
"category": "molecules",
|
|
271
|
+
"exportedNames": [
|
|
272
|
+
"Steps"
|
|
273
|
+
],
|
|
274
|
+
"registryDependencies": [
|
|
275
|
+
"core"
|
|
276
|
+
],
|
|
277
|
+
"bytes": 7306
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "Modal",
|
|
281
|
+
"slug": "modal",
|
|
282
|
+
"category": "organisms",
|
|
283
|
+
"exportedNames": [
|
|
284
|
+
"Modal"
|
|
285
|
+
],
|
|
286
|
+
"registryDependencies": [
|
|
287
|
+
"core",
|
|
288
|
+
"title",
|
|
289
|
+
"icon-button",
|
|
290
|
+
"pressable-scale"
|
|
291
|
+
],
|
|
292
|
+
"bytes": 9588
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "BottomSheet",
|
|
296
|
+
"slug": "bottom-sheet",
|
|
297
|
+
"category": "organisms",
|
|
298
|
+
"exportedNames": [
|
|
299
|
+
"BottomSheet"
|
|
300
|
+
],
|
|
301
|
+
"registryDependencies": [
|
|
302
|
+
"core"
|
|
303
|
+
],
|
|
304
|
+
"bytes": 3765
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "Select",
|
|
308
|
+
"slug": "select",
|
|
309
|
+
"category": "organisms",
|
|
310
|
+
"exportedNames": [
|
|
311
|
+
"Select"
|
|
312
|
+
],
|
|
313
|
+
"registryDependencies": [
|
|
314
|
+
"core"
|
|
315
|
+
],
|
|
316
|
+
"bytes": 5348
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "Alert",
|
|
320
|
+
"slug": "alert",
|
|
321
|
+
"category": "organisms",
|
|
322
|
+
"exportedNames": [
|
|
323
|
+
"Alert"
|
|
324
|
+
],
|
|
325
|
+
"registryDependencies": [
|
|
326
|
+
"core",
|
|
327
|
+
"button"
|
|
328
|
+
],
|
|
329
|
+
"bytes": 6138
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "AlertProvider",
|
|
333
|
+
"slug": "alert-provider",
|
|
334
|
+
"category": "organisms",
|
|
335
|
+
"exportedNames": [
|
|
336
|
+
"AlertProvider",
|
|
337
|
+
"useAlert"
|
|
338
|
+
],
|
|
339
|
+
"registryDependencies": [
|
|
340
|
+
"core",
|
|
341
|
+
"alert",
|
|
342
|
+
"button"
|
|
343
|
+
],
|
|
344
|
+
"bytes": 3819
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"name": "Screen",
|
|
348
|
+
"slug": "screen",
|
|
349
|
+
"category": "organisms",
|
|
350
|
+
"exportedNames": [
|
|
351
|
+
"Screen"
|
|
352
|
+
],
|
|
353
|
+
"registryDependencies": [
|
|
354
|
+
"core"
|
|
355
|
+
],
|
|
356
|
+
"bytes": 2814
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "List",
|
|
360
|
+
"slug": "list",
|
|
361
|
+
"category": "organisms",
|
|
362
|
+
"exportedNames": [
|
|
363
|
+
"List"
|
|
364
|
+
],
|
|
365
|
+
"registryDependencies": [
|
|
366
|
+
"core",
|
|
367
|
+
"empty-state",
|
|
368
|
+
"spinner"
|
|
369
|
+
],
|
|
370
|
+
"bytes": 4779
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "SearchList",
|
|
374
|
+
"slug": "search-list",
|
|
375
|
+
"category": "organisms",
|
|
376
|
+
"exportedNames": [
|
|
377
|
+
"SearchList"
|
|
378
|
+
],
|
|
379
|
+
"registryDependencies": [
|
|
380
|
+
"core",
|
|
381
|
+
"input",
|
|
382
|
+
"empty-state",
|
|
383
|
+
"spinner",
|
|
384
|
+
"icon-button",
|
|
385
|
+
"pressable-scale"
|
|
386
|
+
],
|
|
387
|
+
"bytes": 5861
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "Toast",
|
|
391
|
+
"slug": "toast",
|
|
392
|
+
"category": "organisms",
|
|
393
|
+
"exportedNames": [
|
|
394
|
+
"Toast"
|
|
395
|
+
],
|
|
396
|
+
"registryDependencies": [
|
|
397
|
+
"core"
|
|
398
|
+
],
|
|
399
|
+
"bytes": 4411
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "ToastProvider",
|
|
403
|
+
"slug": "toast-provider",
|
|
404
|
+
"category": "organisms",
|
|
405
|
+
"exportedNames": [
|
|
406
|
+
"ToastProvider",
|
|
407
|
+
"useToast"
|
|
408
|
+
],
|
|
409
|
+
"registryDependencies": [
|
|
410
|
+
"core",
|
|
411
|
+
"toast"
|
|
412
|
+
],
|
|
413
|
+
"bytes": 4920
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "DatePicker",
|
|
417
|
+
"slug": "date-picker",
|
|
418
|
+
"category": "organisms",
|
|
419
|
+
"exportedNames": [
|
|
420
|
+
"DatePicker",
|
|
421
|
+
"buildMonthGrid",
|
|
422
|
+
"DEFAULT_MONTH_NAMES",
|
|
423
|
+
"DEFAULT_WEEKDAY_NAMES"
|
|
424
|
+
],
|
|
425
|
+
"registryDependencies": [
|
|
426
|
+
"core",
|
|
427
|
+
"icon-button",
|
|
428
|
+
"pressable-scale"
|
|
429
|
+
],
|
|
430
|
+
"bytes": 10093
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"name": "DateField",
|
|
434
|
+
"slug": "date-field",
|
|
435
|
+
"category": "organisms",
|
|
436
|
+
"exportedNames": [
|
|
437
|
+
"DateField"
|
|
438
|
+
],
|
|
439
|
+
"registryDependencies": [
|
|
440
|
+
"core",
|
|
441
|
+
"modal",
|
|
442
|
+
"title",
|
|
443
|
+
"icon-button",
|
|
444
|
+
"pressable-scale",
|
|
445
|
+
"date-picker",
|
|
446
|
+
"button"
|
|
447
|
+
],
|
|
448
|
+
"bytes": 4545
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"name": "Wizard",
|
|
452
|
+
"slug": "wizard",
|
|
453
|
+
"category": "organisms",
|
|
454
|
+
"exportedNames": [
|
|
455
|
+
"Wizard"
|
|
456
|
+
],
|
|
457
|
+
"registryDependencies": [
|
|
458
|
+
"core",
|
|
459
|
+
"steps",
|
|
460
|
+
"button"
|
|
461
|
+
],
|
|
462
|
+
"bytes": 4569
|
|
463
|
+
}
|
|
464
|
+
]
|
|
465
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "InfoRow",
|
|
3
|
+
"slug": "info-row",
|
|
4
|
+
"type": "component",
|
|
5
|
+
"category": "molecules",
|
|
6
|
+
"exportedNames": [
|
|
7
|
+
"InfoRow"
|
|
8
|
+
],
|
|
9
|
+
"files": [
|
|
10
|
+
{
|
|
11
|
+
"path": "molecules/InfoRow.tsx",
|
|
12
|
+
"content": "import React, { memo } from 'react';\nimport { Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport { createStyles } from '../theme/createStyles';\nimport { useAllowFontScaling, useColors } from '../theme/UIProvider';\nimport { Icon } from '../icons/Icon';\nimport type { IconName } from '../icons/types';\nimport { Avatar } from '../atoms/Avatar';\n\nexport interface InfoRowProps {\n icon: IconName;\n label: string;\n value: string | null | undefined;\n placeholder: string;\n style?: StyleProp<ViewStyle>;\n}\n\nconst useStyles = createStyles((theme) => ({\n row: { flexDirection: 'row', alignItems: 'center' },\n icon: { marginRight: theme.tokens.spacing.md },\n textContainer: { flex: 1 },\n label: { fontSize: theme.tokens.fontSize.sm, color: theme.colors.textLight, marginBottom: 2 },\n value: { fontSize: theme.tokens.fontSize.md + 1, color: theme.colors.text, fontWeight: theme.tokens.fontWeight.medium },\n placeholder: { color: theme.colors.textLight, fontStyle: 'italic' },\n}));\n\n/**\n * InfoRow\n * Ícono circular a la izquierda + label/valor apilado a la derecha. Muestra\n * `placeholder` en itálica si no hay valor. Pensado para modales de detalle.\n */\nexport const InfoRow = memo(({ icon, label, value, placeholder, style }: InfoRowProps) => {\n const colors = useColors();\n const styles = useStyles();\n const allowFontScaling = useAllowFontScaling();\n\n return (\n <View style={[styles.row, style]}>\n <Avatar size={40} backgroundColor={colors.inputBackground} style={styles.icon}>\n <Icon name={icon} size={20} color={colors.textLight} />\n </Avatar>\n <View style={styles.textContainer}>\n <Text allowFontScaling={allowFontScaling} style={styles.label}>\n {label}\n </Text>\n <Text allowFontScaling={allowFontScaling} style={[styles.value, !value && styles.placeholder]}>\n {value || placeholder}\n </Text>\n </View>\n </View>\n );\n});\nInfoRow.displayName = 'InfoRow';\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"registryDependencies": [
|
|
16
|
+
"core",
|
|
17
|
+
"avatar"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Input",
|
|
3
|
+
"slug": "input",
|
|
4
|
+
"type": "component",
|
|
5
|
+
"category": "atoms",
|
|
6
|
+
"exportedNames": [
|
|
7
|
+
"Input"
|
|
8
|
+
],
|
|
9
|
+
"files": [
|
|
10
|
+
{
|
|
11
|
+
"path": "atoms/Input.tsx",
|
|
12
|
+
"content": "import React, { memo, useRef, useState } from 'react';\nimport {\n ActivityIndicator,\n Animated,\n Text,\n TextInput,\n TouchableOpacity,\n View,\n type StyleProp,\n type TextInputProps,\n type ViewStyle,\n} from 'react-native';\nimport { createStyles } from '../theme/createStyles';\nimport { useAllowFontScaling, useColors } from '../theme/UIProvider';\nimport { Icon } from '../icons/Icon';\nimport type { IconName } from '../icons/types';\n\nexport interface InputProps extends Omit<TextInputProps, 'style'> {\n label?: string;\n /** Muestra un asterisco junto al label. Puramente visual, no valida nada. */\n required?: boolean;\n error?: string;\n containerStyle?: StyleProp<ViewStyle>;\n style?: TextInputProps['style'];\n leftIconName?: IconName;\n rightIconName?: IconName;\n onRightIconPress?: () => void;\n isPassword?: boolean;\n isLoading?: boolean;\n}\n\nconst useStyles = createStyles((theme) => ({\n container: { marginBottom: theme.tokens.spacing.lg, width: '100%' },\n label: {\n marginBottom: theme.tokens.spacing.sm,\n fontSize: theme.tokens.fontSize.md,\n fontWeight: theme.tokens.fontWeight.medium,\n color: theme.colors.text,\n },\n required: { color: theme.colors.error },\n inputWrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n backgroundColor: theme.colors.inputBackground,\n borderRadius: theme.tokens.radius.lg,\n borderWidth: 2,\n minHeight: 50,\n },\n input: {\n flex: 1,\n paddingVertical: theme.tokens.spacing.md,\n paddingHorizontal: theme.tokens.spacing.lg,\n fontSize: theme.tokens.fontSize.lg,\n color: theme.colors.text,\n },\n leftIcon: { marginLeft: theme.tokens.spacing.lg, marginRight: -theme.tokens.spacing.xs },\n rightIcon: { padding: theme.tokens.spacing.sm + 2, marginRight: theme.tokens.spacing.xs },\n errorText: { marginTop: theme.tokens.spacing.xs, fontSize: theme.tokens.fontSize.sm, color: theme.colors.error },\n}));\n\n/**\n * Input\n * El borde anima color entre border/primary/error con Animated (no\n * useNativeDriver: los navegadores de color en RN sin Fabric solo son\n * confiables en el hilo de JS; el costo es despreciable, se anima un borde).\n */\nexport const Input = memo(\n ({\n label,\n required = false,\n error,\n containerStyle,\n leftIconName,\n rightIconName,\n onRightIconPress,\n isPassword = false,\n isLoading = false,\n style,\n onFocus,\n onBlur,\n testID,\n ...props\n }: InputProps) => {\n const colors = useColors();\n const styles = useStyles();\n const allowFontScaling = useAllowFontScaling();\n const [isFocused, setIsFocused] = useState(false);\n const [showPassword, setShowPassword] = useState(false);\n const focusProgress = useRef(new Animated.Value(0)).current;\n\n const handleFocus: TextInputProps['onFocus'] = (e) => {\n setIsFocused(true);\n Animated.timing(focusProgress, { toValue: 1, duration: 200, useNativeDriver: false }).start();\n onFocus?.(e);\n };\n\n const handleBlur: TextInputProps['onBlur'] = (e) => {\n setIsFocused(false);\n Animated.timing(focusProgress, { toValue: 0, duration: 200, useNativeDriver: false }).start();\n onBlur?.(e);\n };\n\n const borderColor = error\n ? colors.error\n : focusProgress.interpolate({ outputRange: [colors.border, colors.primary], inputRange: [0, 1] });\n\n return (\n <View style={[styles.container, containerStyle]} testID={testID}>\n {label && (\n <Text allowFontScaling={allowFontScaling} style={styles.label}>\n {label}\n {required && <Text style={styles.required}> *</Text>}\n </Text>\n )}\n\n <Animated.View style={[styles.inputWrapper, { borderColor }]}>\n {leftIconName && <Icon name={leftIconName} size={20} color={colors.textLight} style={styles.leftIcon} />}\n\n <TextInput\n style={[styles.input, style]}\n placeholderTextColor={colors.textLight}\n onFocus={handleFocus}\n onBlur={handleBlur}\n secureTextEntry={isPassword && !showPassword}\n allowFontScaling={allowFontScaling}\n textAlignVertical=\"center\"\n accessibilityLabel={label ?? props.placeholder}\n {...props}\n />\n\n {isLoading ? (\n <View style={styles.rightIcon}>\n <ActivityIndicator size=\"small\" color={colors.primary} />\n </View>\n ) : isPassword ? (\n <TouchableOpacity\n onPress={() => setShowPassword((v) => !v)}\n style={styles.rightIcon}\n accessibilityRole=\"button\"\n accessibilityLabel={showPassword ? 'Hide password' : 'Show password'}\n >\n <Icon name={showPassword ? 'eye-off' : 'eye'} size={20} color={colors.textLight} />\n </TouchableOpacity>\n ) : rightIconName ? (\n <TouchableOpacity\n onPress={onRightIconPress}\n style={styles.rightIcon}\n disabled={!onRightIconPress}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Clear\"\n >\n <Icon name={rightIconName} size={20} color={colors.textLight} />\n </TouchableOpacity>\n ) : null}\n </Animated.View>\n\n {!!error && (\n <Text allowFontScaling={allowFontScaling} style={styles.errorText}>\n {error}\n </Text>\n )}\n </View>\n );\n }\n);\nInput.displayName = 'Input';\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"registryDependencies": [
|
|
16
|
+
"core"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "KeyValueRow",
|
|
3
|
+
"slug": "key-value-row",
|
|
4
|
+
"type": "component",
|
|
5
|
+
"category": "atoms",
|
|
6
|
+
"exportedNames": [
|
|
7
|
+
"KeyValueRow"
|
|
8
|
+
],
|
|
9
|
+
"files": [
|
|
10
|
+
{
|
|
11
|
+
"path": "atoms/KeyValueRow.tsx",
|
|
12
|
+
"content": "import React, { memo } from 'react';\nimport { Text, View, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\nimport { createStyles } from '../theme/createStyles';\nimport { useAllowFontScaling } from '../theme/UIProvider';\n\nexport interface KeyValueRowProps {\n label: React.ReactNode;\n value: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n valueStyle?: StyleProp<TextStyle>;\n}\n\nconst useStyles = createStyles((theme) => ({\n row: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },\n label: { fontSize: theme.tokens.fontSize.sm, fontWeight: theme.tokens.fontWeight.semibold, color: theme.colors.textLight },\n value: { fontSize: theme.tokens.fontSize.sm, textAlign: 'right', color: theme.colors.text },\n}));\n\n/**\n * KeyValueRow\n * Fila label (izquierda) / value (derecha). Si label/value son string o\n * number, se renderizan con el estilo default; si ya vienen envueltos en un\n * componente de texto propio, se respetan tal cual.\n */\nexport const KeyValueRow = memo(({ label, value, style, labelStyle, valueStyle }: KeyValueRowProps) => {\n const styles = useStyles();\n const allowFontScaling = useAllowFontScaling();\n return (\n <View style={[styles.row, style]}>\n {typeof label === 'string' || typeof label === 'number' ? (\n <Text allowFontScaling={allowFontScaling} style={[styles.label, labelStyle]}>\n {label}\n </Text>\n ) : (\n label\n )}\n {typeof value === 'string' || typeof value === 'number' ? (\n <Text allowFontScaling={allowFontScaling} style={[styles.value, valueStyle]}>\n {value}\n </Text>\n ) : (\n value\n )}\n </View>\n );\n});\nKeyValueRow.displayName = 'KeyValueRow';\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"registryDependencies": [
|
|
16
|
+
"core"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "List",
|
|
3
|
+
"slug": "list",
|
|
4
|
+
"type": "component",
|
|
5
|
+
"category": "organisms",
|
|
6
|
+
"exportedNames": [
|
|
7
|
+
"List"
|
|
8
|
+
],
|
|
9
|
+
"files": [
|
|
10
|
+
{
|
|
11
|
+
"path": "organisms/List.tsx",
|
|
12
|
+
"content": "import React, { memo, useCallback } from 'react';\nimport {\n ActivityIndicator,\n FlatList,\n Platform,\n RefreshControl,\n Text,\n View,\n type FlatListProps,\n type ViewStyle,\n} from 'react-native';\nimport { createStyles } from '../theme/createStyles';\nimport { useColors, useLabels } from '../theme/UIProvider';\nimport { EmptyState } from '../atoms/EmptyState';\nimport { Spinner } from '../atoms/Spinner';\nimport type { IconName } from '../icons/types';\n\nexport interface ListProps<T> {\n data: T[];\n keyExtractor: (item: T) => string;\n renderItem: FlatListProps<T>['renderItem'];\n\n isLoading: boolean;\n isLoadingMore?: boolean;\n /** Controlado por el consumidor: mientras es false, se muestra un spinner de pantalla completa. @default true */\n isReady?: boolean;\n loadingText?: string;\n loadingMoreText?: string;\n\n onEndReached?: () => void;\n onEndReachedThreshold?: number;\n onRefresh?: () => void;\n\n emptyTitle?: string;\n emptyDescription?: string;\n emptyIconName?: IconName;\n\n ListHeaderComponent?: FlatListProps<T>['ListHeaderComponent'];\n ListFooterComponent?: FlatListProps<T>['ListFooterComponent'];\n\n contentContainerStyle?: ViewStyle;\n containerStyle?: ViewStyle;\n\n /** Componente de lista a usar (FlashList, etc). @default FlatList */\n ListComponent?: React.ComponentType<any>;\n listProps?: Record<string, unknown>;\n}\n\nconst useStyles = createStyles((theme) => ({\n container: { flex: 1, backgroundColor: theme.colors.background },\n loadingOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: theme.colors.background + 'CC',\n zIndex: 10,\n justifyContent: 'center',\n alignItems: 'center',\n },\n loadingText: { marginTop: theme.tokens.spacing.md, color: theme.colors.textLight, fontWeight: theme.tokens.fontWeight.medium },\n listContent: { padding: theme.tokens.spacing.md, paddingBottom: Platform.OS === 'android' ? 100 : 80 },\n footerLoader: { paddingVertical: theme.tokens.spacing.xl, alignItems: 'center' },\n}));\n\n/**\n * List\n * Lista con estados de carga/paginación/vacío resueltos, sin atarse a\n * expo-router ni a FlashList: `ListComponent` permite inyectar cualquiera\n * (por defecto FlatList del propio React Native).\n */\nexport function List<T>({\n data,\n keyExtractor,\n renderItem,\n isLoading,\n isLoadingMore = false,\n isReady = true,\n loadingText,\n loadingMoreText,\n onEndReached,\n onEndReachedThreshold = 0.3,\n onRefresh,\n emptyTitle,\n emptyDescription,\n emptyIconName,\n ListHeaderComponent,\n ListFooterComponent,\n contentContainerStyle,\n containerStyle,\n ListComponent = FlatList,\n listProps,\n}: ListProps<T>) {\n const colors = useColors();\n const styles = useStyles();\n const labels = useLabels();\n const resolvedLoadingText = loadingText ?? labels.loading;\n const resolvedLoadingMoreText = loadingMoreText ?? labels.loadingMore;\n\n const renderFooter = useCallback(() => {\n if (ListFooterComponent) {\n return typeof ListFooterComponent === 'function' ? <ListFooterComponent /> : (ListFooterComponent as React.ReactElement);\n }\n if (!isLoadingMore) return null;\n return (\n <View style={styles.footerLoader}>\n <Spinner text={resolvedLoadingMoreText} fullscreen={false} />\n </View>\n );\n }, [isLoadingMore, resolvedLoadingMoreText, ListFooterComponent, styles.footerLoader]);\n\n const renderEmpty = useCallback(() => {\n if (isLoading) return null;\n return <EmptyState title={emptyTitle} description={emptyDescription} iconName={emptyIconName} style={{ marginTop: 50 }} />;\n }, [isLoading, emptyTitle, emptyDescription, emptyIconName]);\n\n if (!isReady) {\n return (\n <View style={styles.container}>\n <Spinner text={resolvedLoadingText} />\n </View>\n );\n }\n\n return (\n <View style={[styles.container, containerStyle]}>\n {isLoading && data.length === 0 && (\n <View style={styles.loadingOverlay} pointerEvents=\"none\">\n <ActivityIndicator size=\"large\" color={colors.primary} />\n <Text style={styles.loadingText}>{resolvedLoadingText}</Text>\n </View>\n )}\n\n <ListComponent\n data={data}\n keyExtractor={keyExtractor}\n renderItem={renderItem}\n contentContainerStyle={[styles.listContent, contentContainerStyle]}\n onEndReached={onEndReached}\n onEndReachedThreshold={onEndReachedThreshold}\n ListHeaderComponent={ListHeaderComponent}\n ListFooterComponent={renderFooter}\n ListEmptyComponent={renderEmpty}\n refreshControl={\n onRefresh ? (\n <RefreshControl refreshing={isLoading} onRefresh={onRefresh} colors={[colors.primary]} tintColor={colors.primary} />\n ) : undefined\n }\n {...listProps}\n />\n </View>\n );\n}\n"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"registryDependencies": [
|
|
16
|
+
"core",
|
|
17
|
+
"empty-state",
|
|
18
|
+
"spinner"
|
|
19
|
+
]
|
|
20
|
+
}
|