@obisoft/ui 0.8.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 +45 -0
- package/package.json +52 -0
- package/src/components/AppHeader.tsx +67 -0
- package/src/components/BottomSheet.tsx +110 -0
- package/src/components/Button.tsx +117 -0
- package/src/components/Card.tsx +46 -0
- package/src/components/CenteredState.tsx +35 -0
- package/src/components/Chip.tsx +47 -0
- package/src/components/ChoiceField.tsx +44 -0
- package/src/components/DateRangeFilter.tsx +226 -0
- package/src/components/EmptyState.tsx +32 -0
- package/src/components/ErrorState.tsx +62 -0
- package/src/components/Fab.tsx +36 -0
- package/src/components/FormRow.tsx +39 -0
- package/src/components/FormWorkspaceShell.tsx +126 -0
- package/src/components/GlassTabBar.tsx +39 -0
- package/src/components/Icon.tsx +259 -0
- package/src/components/IconButton.tsx +73 -0
- package/src/components/ListFilterBar.tsx +134 -0
- package/src/components/ListRow.tsx +198 -0
- package/src/components/ListWorkspace.tsx +76 -0
- package/src/components/LoadingState.tsx +37 -0
- package/src/components/MetricCard.tsx +74 -0
- package/src/components/MetricsGrid.tsx +25 -0
- package/src/components/MiniBarChart.tsx +42 -0
- package/src/components/NavigationDrawer.tsx +243 -0
- package/src/components/QueryState.tsx +82 -0
- package/src/components/QueryWorkspace.tsx +74 -0
- package/src/components/ScanInputBar.tsx +69 -0
- package/src/components/ScannerShell.tsx +76 -0
- package/src/components/Screen.tsx +44 -0
- package/src/components/SearchArea.tsx +34 -0
- package/src/components/SegmentedControl.tsx +64 -0
- package/src/components/Skeleton.tsx +42 -0
- package/src/components/StatusBadge.tsx +23 -0
- package/src/components/SuccessState.tsx +41 -0
- package/src/components/TextField.tsx +47 -0
- package/src/components/ToggleRow.tsx +35 -0
- package/src/components/record-detail/RecordDetail.tsx +60 -0
- package/src/components/record-detail/RecordDetailActions.tsx +88 -0
- package/src/components/record-detail/RecordDetailField.tsx +43 -0
- package/src/components/record-detail/RecordDetailHero.tsx +46 -0
- package/src/components/record-detail/RecordDetailLine.tsx +36 -0
- package/src/components/record-detail/RecordDetailSection.tsx +36 -0
- package/src/components/record-detail/index.ts +7 -0
- package/src/components/record-detail/status.ts +16 -0
- package/src/gallery/catalog.ts +31 -0
- package/src/glass/AmbientBackground.tsx +29 -0
- package/src/glass/GlassSurface.tsx +107 -0
- package/src/index.ts +66 -0
- package/src/layout/Box.tsx +62 -0
- package/src/layout/Divider.tsx +8 -0
- package/src/layout/Row.tsx +7 -0
- package/src/layout/Stack.tsx +7 -0
- package/src/provider/ObiUIProvider.tsx +45 -0
- package/src/styles/useObiStyles.ts +288 -0
- package/src/theme/effects.ts +219 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/theme.ts +53 -0
- package/src/theme/tokens.ts +133 -0
- package/src/typography/ObiText.tsx +52 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, type TextProps, type TextStyle } from 'react-native';
|
|
3
|
+
import { useObiTheme } from '../provider/ObiUIProvider';
|
|
4
|
+
|
|
5
|
+
type Variant = 'caption' | 'body' | 'subtitle' | 'title' | 'display';
|
|
6
|
+
|
|
7
|
+
export type ObiTextProps = TextProps & {
|
|
8
|
+
variant?: Variant;
|
|
9
|
+
muted?: boolean;
|
|
10
|
+
subtle?: boolean;
|
|
11
|
+
weight?: TextStyle['fontWeight'];
|
|
12
|
+
tone?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function ObiText({
|
|
16
|
+
variant = 'body',
|
|
17
|
+
muted,
|
|
18
|
+
subtle,
|
|
19
|
+
weight,
|
|
20
|
+
tone = 'default',
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}: ObiTextProps) {
|
|
24
|
+
const theme = useObiTheme();
|
|
25
|
+
const toneColor = tone === 'primary'
|
|
26
|
+
? theme.colors.primary
|
|
27
|
+
: tone === 'success'
|
|
28
|
+
? theme.colors.success
|
|
29
|
+
: tone === 'warning'
|
|
30
|
+
? theme.colors.warning
|
|
31
|
+
: tone === 'danger'
|
|
32
|
+
? theme.colors.danger
|
|
33
|
+
: subtle
|
|
34
|
+
? theme.colors.textSubtle
|
|
35
|
+
: muted
|
|
36
|
+
? theme.colors.textMuted
|
|
37
|
+
: theme.colors.text;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Text
|
|
41
|
+
{...props}
|
|
42
|
+
style={[
|
|
43
|
+
{ color: toneColor, fontSize: theme.type[variant] },
|
|
44
|
+
weight ? { fontWeight: weight } : undefined,
|
|
45
|
+
style,
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Compatibilidad semántica con el nombre utilizado por OBI Ventas. */
|
|
52
|
+
export const AppText = ObiText;
|