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
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# orn-ui
|
|
2
|
+
|
|
3
|
+
Fast, tree-shakeable, atomic-design component library for React Native.
|
|
4
|
+
**Zero runtime dependencies** — only `react` and `react-native` as peers.
|
|
5
|
+
|
|
6
|
+
35 components (atoms, molecules, organisms), fully typed, themeable
|
|
7
|
+
(light/dark), 246 tests, 90%/85% (lines/branches) coverage gate.
|
|
8
|
+
|
|
9
|
+
Docs, props tables and demo GIFs: **[orn-ui.dev](https://orn-ui.dev)**
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
**The whole package:**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add orn-ui
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { UIProvider, Button } from 'orn-ui';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Only what you import (subpath exports — same package, smaller bundle):**
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { UIProvider } from 'orn-ui/theme';
|
|
27
|
+
import { Button } from 'orn-ui/button';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Copy the source into your project, no npm dependency:**
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx orn-ui add button select wizard
|
|
34
|
+
# or the whole catalog:
|
|
35
|
+
npx orn-ui add --all
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Resolves transitive dependencies and writes the real `.tsx` files under
|
|
39
|
+
`src/components/ui/` (configurable via `--path`), preserving the folder
|
|
40
|
+
structure so relative imports keep working untouched. `npx orn-ui --help`
|
|
41
|
+
for `init`/`add`/`list` and all flags.
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import { UIProvider, Button, Card, Title } from 'orn-ui';
|
|
47
|
+
|
|
48
|
+
function App() {
|
|
49
|
+
return (
|
|
50
|
+
<UIProvider mode="system">
|
|
51
|
+
<Card>
|
|
52
|
+
<Title>Hello orn-ui</Title>
|
|
53
|
+
<Button title="Continue" onPress={() => {}} />
|
|
54
|
+
</Card>
|
|
55
|
+
</UIProvider>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Wrap your app once in `UIProvider` — it resolves light/dark (`mode:
|
|
61
|
+
'system' | 'light' | 'dark'`, controlled or not) and injects theme, icons,
|
|
62
|
+
safe-area insets and labels to everything below it.
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
// Custom theme
|
|
66
|
+
import { createTheme, UIProvider } from 'orn-ui';
|
|
67
|
+
|
|
68
|
+
const theme = createTheme({
|
|
69
|
+
light: { colors: { primary: '#004cef' } },
|
|
70
|
+
dark: { colors: { primary: '#3d7bff' } },
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
<UIProvider theme={theme}>{children}</UIProvider>;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
// Safe-area insets from your app (react-native-safe-area-context, optional)
|
|
78
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
79
|
+
|
|
80
|
+
const insets = useSafeAreaInsets();
|
|
81
|
+
<UIProvider insets={insets}>{children}</UIProvider>;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Components
|
|
85
|
+
|
|
86
|
+
- **Atoms**: `Title`/`Subtitle`/`Body`/`Caption`, `Button`, `IconButton`,
|
|
87
|
+
`Input`, `Checkbox`, `Badge`, `Card`, `Divider`, `Avatar`, `Image`,
|
|
88
|
+
`Spinner`, `EmptyState`, `KeyValueRow`, `Fab`, `PressableScale`
|
|
89
|
+
- **Molecules**: `Stepper`, `OptionCard`, `InfoRow`, `FormActions`,
|
|
90
|
+
`AvatarHeader`, `ThemeToggle`, `Steps`
|
|
91
|
+
- **Organisms**: `Modal`, `BottomSheet`, `Select`, `Alert`/`AlertProvider`,
|
|
92
|
+
`Screen`, `List`, `SearchList`, `Toast`/`ToastProvider`, `DatePicker`,
|
|
93
|
+
`DateField`, `Wizard`
|
|
94
|
+
|
|
95
|
+
Every component's full prop table lives on [orn-ui.dev](https://orn-ui.dev).
|
|
96
|
+
|
|
97
|
+
## Why zero dependencies
|
|
98
|
+
|
|
99
|
+
No third-party runtime code means no supply-chain surface, no version
|
|
100
|
+
conflicts with the rest of your app, and no surprise breaking changes from a
|
|
101
|
+
transitive dependency. Icons are drawn with RN primitives (`View` + border +
|
|
102
|
+
transform), no icon font, no async asset loading — and swappable: pass your
|
|
103
|
+
own `icons` renderer to `UIProvider` to replace them.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT
|
package/bin/orn-ui.mjs
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// CLI de instalación por componente. Cero dependencias (solo node:*), para
|
|
3
|
+
// no romper la promesa de "orn-ui: cero dependencias en tiempo de ejecución"
|
|
4
|
+
// ni siquiera en su tooling. Copia archivos de origen al proyecto del
|
|
5
|
+
// consumidor — no es un paquete npm que se importa, es código que se posee.
|
|
6
|
+
//
|
|
7
|
+
// El registry que usa por defecto es el que viene EMPACADO dentro de este
|
|
8
|
+
// mismo paquete (../registry/*.json, ver package.json "files"): así
|
|
9
|
+
// `npx orn-ui@0.2.0 add button` siempre resuelve contra la versión 0.2.0,
|
|
10
|
+
// sin llamada de red y sin poder desincronizarse. `--registry <url>` es un
|
|
11
|
+
// escape hatch para servir un fork o una versión específica desde
|
|
12
|
+
// orn-ui-docs (que publica el mismo registry en /r/*.json).
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import https from 'node:https';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
|
|
18
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
const LOCAL_REGISTRY_DIR = path.join(__dirname, '..', 'registry');
|
|
20
|
+
const CONFIG_FILE = 'orn-ui.json';
|
|
21
|
+
const DEFAULT_DEST = 'src/components/ui';
|
|
22
|
+
|
|
23
|
+
function log(...args) {
|
|
24
|
+
console.log(...args);
|
|
25
|
+
}
|
|
26
|
+
function fail(message) {
|
|
27
|
+
console.error(`[orn-ui] ${message}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function fetchUrl(url) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
https
|
|
34
|
+
.get(url, (res) => {
|
|
35
|
+
if (res.statusCode !== 200) {
|
|
36
|
+
reject(new Error(`${url} -> HTTP ${res.statusCode}`));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let data = '';
|
|
40
|
+
res.on('data', (chunk) => (data += chunk));
|
|
41
|
+
res.on('end', () => resolve(data));
|
|
42
|
+
})
|
|
43
|
+
.on('error', reject);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Carga registry/<name>.json, del registry local empacado o de --registry <url>. */
|
|
48
|
+
async function loadRegistryEntry(name, registryUrl) {
|
|
49
|
+
if (registryUrl) {
|
|
50
|
+
const url = `${registryUrl.replace(/\/$/, '')}/${name}.json`;
|
|
51
|
+
return JSON.parse(await fetchUrl(url));
|
|
52
|
+
}
|
|
53
|
+
const localPath = path.join(LOCAL_REGISTRY_DIR, `${name}.json`);
|
|
54
|
+
if (!fs.existsSync(localPath)) {
|
|
55
|
+
fail(
|
|
56
|
+
`no encontré "${name}" en el registry local (${localPath}). ` +
|
|
57
|
+
`¿Nombre de componente correcto? Corre "orn-ui list".`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return JSON.parse(fs.readFileSync(localPath, 'utf8'));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function loadIndex(registryUrl) {
|
|
64
|
+
if (registryUrl) {
|
|
65
|
+
const url = `${registryUrl.replace(/\/$/, '')}/index.json`;
|
|
66
|
+
return JSON.parse(await fetchUrl(url));
|
|
67
|
+
}
|
|
68
|
+
return JSON.parse(fs.readFileSync(path.join(LOCAL_REGISTRY_DIR, 'index.json'), 'utf8'));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function readConfig(cwd) {
|
|
72
|
+
const configPath = path.join(cwd, CONFIG_FILE);
|
|
73
|
+
if (!fs.existsSync(configPath)) return null;
|
|
74
|
+
return JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function writeConfig(cwd, config) {
|
|
78
|
+
fs.writeFileSync(path.join(cwd, CONFIG_FILE), `${JSON.stringify(config, null, 2)}\n`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Resuelve el árbol de dependencias (BFS) para una lista de slugs pedidos. */
|
|
82
|
+
async function resolveInstallSet(slugs, registryUrl) {
|
|
83
|
+
const entries = new Map(); // name -> entry (incluye "core")
|
|
84
|
+
const queue = [...slugs];
|
|
85
|
+
while (queue.length) {
|
|
86
|
+
const name = queue.shift();
|
|
87
|
+
if (entries.has(name)) continue;
|
|
88
|
+
const entry = await loadRegistryEntry(name, registryUrl);
|
|
89
|
+
entries.set(name, entry);
|
|
90
|
+
for (const dep of entry.registryDependencies ?? []) queue.push(dep);
|
|
91
|
+
}
|
|
92
|
+
return entries;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function writeEntryFiles(entry, destDir, { overwrite, dryRun }) {
|
|
96
|
+
const written = [];
|
|
97
|
+
for (const file of entry.files) {
|
|
98
|
+
const target = path.join(destDir, file.path);
|
|
99
|
+
const exists = fs.existsSync(target);
|
|
100
|
+
if (exists && !overwrite) {
|
|
101
|
+
log(` ${'skip'.padEnd(9)} ${file.path} (ya existe, usa --overwrite para pisarlo)`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (!dryRun) {
|
|
105
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
106
|
+
fs.writeFileSync(target, file.content);
|
|
107
|
+
}
|
|
108
|
+
written.push(file.path);
|
|
109
|
+
log(` ${exists ? 'overwrite' : 'write'.padEnd(9)} ${file.path}`);
|
|
110
|
+
}
|
|
111
|
+
return written;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async function cmdInit(args) {
|
|
115
|
+
const cwd = args.cwd ?? process.cwd();
|
|
116
|
+
const existing = readConfig(cwd);
|
|
117
|
+
if (existing && !args.force) {
|
|
118
|
+
fail(`ya existe ${CONFIG_FILE} en ${cwd}. Usa --force para sobrescribir la configuración.`);
|
|
119
|
+
}
|
|
120
|
+
const destPath = args.path ?? DEFAULT_DEST;
|
|
121
|
+
|
|
122
|
+
const config = { $schema: 'https://orn-ui.dev/registry-config.json', path: destPath, installed: [] };
|
|
123
|
+
const core = await loadRegistryEntry('core', args.registry);
|
|
124
|
+
log(`Instalando core (theme + icons) en ${destPath}/ ...`);
|
|
125
|
+
writeEntryFiles(core, path.join(cwd, destPath), args);
|
|
126
|
+
writeConfig(cwd, config);
|
|
127
|
+
log(`\n${CONFIG_FILE} creado. Envolvé tu app en <UIProvider> (import desde ${destPath}/theme).`);
|
|
128
|
+
log(`Ahora: orn-ui add button select wizard ...`);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function cmdAdd(args) {
|
|
132
|
+
const cwd = args.cwd ?? process.cwd();
|
|
133
|
+
let config = readConfig(cwd);
|
|
134
|
+
const destPath = args.path ?? config?.path ?? DEFAULT_DEST;
|
|
135
|
+
if (!config) config = { path: destPath, installed: [] };
|
|
136
|
+
|
|
137
|
+
let slugs = args.positional;
|
|
138
|
+
if (args.all) {
|
|
139
|
+
const index = await loadIndex(args.registry);
|
|
140
|
+
slugs = index.components.map((c) => c.slug);
|
|
141
|
+
}
|
|
142
|
+
if (!slugs.length) fail('especificá al menos un componente: orn-ui add button select ...\n o: orn-ui add --all');
|
|
143
|
+
|
|
144
|
+
log(`Resolviendo dependencias de: ${slugs.join(', ')}`);
|
|
145
|
+
const entries = await resolveInstallSet(slugs, args.registry);
|
|
146
|
+
log(`Instalando ${entries.size} paquete(s) (incluye deps transitivas) en ${destPath}/:\n`);
|
|
147
|
+
|
|
148
|
+
const installedNow = new Set(config.installed ?? []);
|
|
149
|
+
for (const [name, entry] of entries) {
|
|
150
|
+
writeEntryFiles(entry, path.join(cwd, destPath), args);
|
|
151
|
+
installedNow.add(name);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (!args.dryRun) {
|
|
155
|
+
config.installed = [...installedNow].sort();
|
|
156
|
+
writeConfig(cwd, config);
|
|
157
|
+
}
|
|
158
|
+
log(`\nListo. ${entries.size} paquete(s) escritos bajo ${destPath}/.`);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function cmdList(args) {
|
|
162
|
+
const index = await loadIndex(args.registry);
|
|
163
|
+
const byCategory = new Map();
|
|
164
|
+
for (const c of index.components) {
|
|
165
|
+
if (!byCategory.has(c.category)) byCategory.set(c.category, []);
|
|
166
|
+
byCategory.get(c.category).push(c);
|
|
167
|
+
}
|
|
168
|
+
for (const [category, items] of byCategory) {
|
|
169
|
+
log(`\n${category}`);
|
|
170
|
+
for (const item of items) log(` ${item.slug.padEnd(20)} ${item.exportedNames.join(', ')}`);
|
|
171
|
+
}
|
|
172
|
+
log(`\n${index.components.length} componentes. Instalá con: orn-ui add <slug> [<slug> ...]`);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function parseArgs(argv) {
|
|
176
|
+
const args = { positional: [] };
|
|
177
|
+
for (let i = 0; i < argv.length; i++) {
|
|
178
|
+
const a = argv[i];
|
|
179
|
+
if (a === '--overwrite') args.overwrite = true;
|
|
180
|
+
else if (a === '--dry-run') args.dryRun = true;
|
|
181
|
+
else if (a === '--force') args.force = true;
|
|
182
|
+
else if (a === '--all') args.all = true;
|
|
183
|
+
else if (a === '--path') args.path = argv[++i];
|
|
184
|
+
else if (a === '--cwd') args.cwd = argv[++i];
|
|
185
|
+
else if (a === '--registry') args.registry = argv[++i];
|
|
186
|
+
else if (a === '--help' || a === '-h') args.help = true;
|
|
187
|
+
else args.positional.push(a);
|
|
188
|
+
}
|
|
189
|
+
return args;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const HELP = `orn-ui — instala componentes de orn-ui como código fuente en tu proyecto.
|
|
193
|
+
|
|
194
|
+
Uso:
|
|
195
|
+
orn-ui init [--path <dir>] Crea orn-ui.json e instala el core (theme + icons)
|
|
196
|
+
orn-ui add <slug...> [--all] Instala uno o más componentes (+ sus deps)
|
|
197
|
+
orn-ui list Lista todos los componentes disponibles
|
|
198
|
+
|
|
199
|
+
Flags:
|
|
200
|
+
--path <dir> Carpeta destino (default: src/components/ui, o el de orn-ui.json)
|
|
201
|
+
--overwrite Pisa archivos existentes
|
|
202
|
+
--dry-run No escribe nada, solo muestra qué haría
|
|
203
|
+
--registry <url> Usa un registry remoto en vez del empacado en este paquete
|
|
204
|
+
--cwd <dir> Working directory (default: process.cwd())
|
|
205
|
+
|
|
206
|
+
Para instalar TODO de una: "pnpm add orn-ui" y "import { Button } from 'orn-ui'" —
|
|
207
|
+
este CLI es para cuando querés solo algunos componentes, sin la dependencia npm.`;
|
|
208
|
+
|
|
209
|
+
async function main() {
|
|
210
|
+
const [, , command, ...rest] = process.argv;
|
|
211
|
+
const args = parseArgs(rest);
|
|
212
|
+
|
|
213
|
+
if (!command || args.help) {
|
|
214
|
+
log(HELP);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
if (command === 'init') await cmdInit(args);
|
|
220
|
+
else if (command === 'add') await cmdAdd(args);
|
|
221
|
+
else if (command === 'list') await cmdList(args);
|
|
222
|
+
else fail(`comando desconocido "${command}". Corre "orn-ui --help".`);
|
|
223
|
+
} catch (err) {
|
|
224
|
+
fail(err.message ?? String(err));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
main();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Avatar = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _UIProvider = require("../theme/UIProvider");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
const styles = _reactNative.StyleSheet.create({
|
|
13
|
+
circle: {
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
alignItems: 'center'
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Avatar
|
|
21
|
+
* Círculo con ícono/iniciales adentro. Usado a la izquierda de filas de
|
|
22
|
+
* lista o como header de detalle (junto a AvatarHeader).
|
|
23
|
+
*/
|
|
24
|
+
const Avatar = exports.Avatar = /*#__PURE__*/(0, _react.memo)(({
|
|
25
|
+
size = 44,
|
|
26
|
+
backgroundColor,
|
|
27
|
+
children,
|
|
28
|
+
style
|
|
29
|
+
}) => {
|
|
30
|
+
const colors = (0, _UIProvider.useColors)();
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
32
|
+
style: [styles.circle, {
|
|
33
|
+
width: size,
|
|
34
|
+
height: size,
|
|
35
|
+
borderRadius: size / 2,
|
|
36
|
+
backgroundColor: backgroundColor || colors.primary + '15'
|
|
37
|
+
}, style],
|
|
38
|
+
children: children
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
Avatar.displayName = 'Avatar';
|
|
42
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_UIProvider","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","styles","StyleSheet","create","circle","justifyContent","alignItems","Avatar","exports","memo","size","backgroundColor","children","style","colors","useColors","jsx","View","width","height","borderRadius","primary","displayName"],"sourceRoot":"../../../src","sources":["atoms/Avatar.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAAgD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,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
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Badge = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _createStyles = require("../theme/createStyles");
|
|
10
|
+
var _UIProvider = require("../theme/UIProvider");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
const useStyles = (0, _createStyles.createStyles)(theme => ({
|
|
14
|
+
badge: {
|
|
15
|
+
paddingHorizontal: theme.tokens.spacing.md - 2,
|
|
16
|
+
paddingVertical: theme.tokens.spacing.xs + 1,
|
|
17
|
+
borderRadius: theme.tokens.radius.full,
|
|
18
|
+
alignSelf: 'flex-start'
|
|
19
|
+
},
|
|
20
|
+
text: {
|
|
21
|
+
fontSize: theme.tokens.fontSize.xs,
|
|
22
|
+
fontWeight: theme.tokens.fontWeight.bold,
|
|
23
|
+
letterSpacing: 0.3
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Badge
|
|
29
|
+
* Pill de estado. `variant` cubre los casos comunes (éxito/error/advertencia/
|
|
30
|
+
* info/neutral); `backgroundColor`/`textColor` quedan para casos que no
|
|
31
|
+
* encajan en el set semántico.
|
|
32
|
+
*/
|
|
33
|
+
const Badge = exports.Badge = /*#__PURE__*/(0, _react.memo)(({
|
|
34
|
+
label,
|
|
35
|
+
variant = 'neutral',
|
|
36
|
+
backgroundColor,
|
|
37
|
+
textColor,
|
|
38
|
+
style
|
|
39
|
+
}) => {
|
|
40
|
+
const theme = (0, _UIProvider.useTheme)();
|
|
41
|
+
const styles = useStyles();
|
|
42
|
+
const allowFontScaling = (0, _UIProvider.useAllowFontScaling)();
|
|
43
|
+
const {
|
|
44
|
+
colors
|
|
45
|
+
} = theme;
|
|
46
|
+
const palette = {
|
|
47
|
+
success: {
|
|
48
|
+
bg: colors.success + '20',
|
|
49
|
+
fg: colors.success
|
|
50
|
+
},
|
|
51
|
+
error: {
|
|
52
|
+
bg: colors.error + '20',
|
|
53
|
+
fg: colors.error
|
|
54
|
+
},
|
|
55
|
+
warning: {
|
|
56
|
+
bg: colors.warning + '20',
|
|
57
|
+
fg: colors.warning
|
|
58
|
+
},
|
|
59
|
+
info: {
|
|
60
|
+
bg: colors.secondary + '20',
|
|
61
|
+
fg: colors.secondary
|
|
62
|
+
},
|
|
63
|
+
neutral: {
|
|
64
|
+
bg: colors.inputBackground,
|
|
65
|
+
fg: colors.textLight
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
69
|
+
style: [styles.badge, {
|
|
70
|
+
backgroundColor: backgroundColor ?? palette[variant].bg
|
|
71
|
+
}, style],
|
|
72
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
73
|
+
allowFontScaling: allowFontScaling,
|
|
74
|
+
style: [styles.text, {
|
|
75
|
+
color: textColor ?? palette[variant].fg
|
|
76
|
+
}],
|
|
77
|
+
children: label
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
Badge.displayName = 'Badge';
|
|
82
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createStyles","_UIProvider","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useStyles","createStyles","theme","badge","paddingHorizontal","tokens","spacing","md","paddingVertical","xs","borderRadius","radius","full","alignSelf","text","fontSize","fontWeight","bold","letterSpacing","Badge","exports","memo","label","variant","backgroundColor","textColor","style","useTheme","styles","allowFontScaling","useAllowFontScaling","colors","palette","success","bg","fg","error","warning","info","secondary","neutral","inputBackground","textLight","jsx","View","children","Text","color","displayName"],"sourceRoot":"../../../src","sources":["atoms/Badge.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAAoE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAA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