zero-to-app 3.2.1 → 3.2.2
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/dist/brand/brand-config.d.ts +65 -0
- package/dist/brand/brand-config.d.ts.map +1 -0
- package/dist/brand/brand-config.js +68 -0
- package/dist/brand/brand-config.js.map +1 -0
- package/dist/brand/brand-context.d.ts +55 -0
- package/dist/brand/brand-context.d.ts.map +1 -0
- package/dist/brand/brand-context.js +76 -0
- package/dist/brand/brand-context.js.map +1 -0
- package/dist/brand/brand-types.d.ts +92 -0
- package/dist/brand/brand-types.d.ts.map +1 -0
- package/dist/brand/brand-types.js +2 -0
- package/dist/brand/brand-types.js.map +1 -0
- package/dist/brand/default-brand.d.ts +11 -0
- package/dist/brand/default-brand.d.ts.map +1 -0
- package/dist/brand/default-brand.js +32 -0
- package/dist/brand/default-brand.js.map +1 -0
- package/dist/brand/index.d.ts +6 -0
- package/dist/brand/index.d.ts.map +1 -0
- package/dist/brand/index.js +8 -0
- package/dist/brand/index.js.map +1 -0
- package/dist/brand/palette-generator.d.ts +64 -0
- package/dist/brand/palette-generator.d.ts.map +1 -0
- package/dist/brand/palette-generator.js +292 -0
- package/dist/brand/palette-generator.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/navigation/app-tabs/app-tabs.d.ts +63 -0
- package/dist/components/navigation/app-tabs/app-tabs.d.ts.map +1 -0
- package/dist/components/navigation/app-tabs/app-tabs.js +13 -0
- package/dist/components/navigation/app-tabs/app-tabs.js.map +1 -0
- package/dist/components/navigation/app-tabs/app-tabs.web.d.ts +47 -0
- package/dist/components/navigation/app-tabs/app-tabs.web.d.ts.map +1 -0
- package/dist/components/navigation/app-tabs/app-tabs.web.js +104 -0
- package/dist/components/navigation/app-tabs/app-tabs.web.js.map +1 -0
- package/dist/components/navigation/app-tabs/index.d.ts +3 -0
- package/dist/components/navigation/app-tabs/index.d.ts.map +1 -0
- package/dist/components/navigation/app-tabs/index.js +3 -0
- package/dist/components/navigation/app-tabs/index.js.map +1 -0
- package/dist/components/navigation/drawer/drawer.d.ts +24 -0
- package/dist/components/navigation/drawer/drawer.d.ts.map +1 -0
- package/dist/components/navigation/drawer/drawer.js +82 -0
- package/dist/components/navigation/drawer/drawer.js.map +1 -0
- package/dist/components/navigation/index.d.ts +10 -0
- package/dist/components/navigation/index.d.ts.map +1 -0
- package/dist/components/navigation/index.js +11 -0
- package/dist/components/navigation/index.js.map +1 -0
- package/dist/components/navigation/native-header.d.ts +25 -0
- package/dist/components/navigation/native-header.d.ts.map +1 -0
- package/dist/components/navigation/native-header.js +32 -0
- package/dist/components/navigation/native-header.js.map +1 -0
- package/dist/components/navigation/shared/sidebar-styles.d.ts +34 -0
- package/dist/components/navigation/shared/sidebar-styles.d.ts.map +1 -0
- package/dist/components/navigation/shared/sidebar-styles.js +34 -0
- package/dist/components/navigation/shared/sidebar-styles.js.map +1 -0
- package/dist/components/navigation/sidebar/index.d.ts +10 -0
- package/dist/components/navigation/sidebar/index.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/index.js +7 -0
- package/dist/components/navigation/sidebar/index.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-footer.d.ts +18 -0
- package/dist/components/navigation/sidebar/sidebar-footer.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-footer.js +27 -0
- package/dist/components/navigation/sidebar/sidebar-footer.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-header.d.ts +26 -0
- package/dist/components/navigation/sidebar/sidebar-header.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-header.js +38 -0
- package/dist/components/navigation/sidebar/sidebar-header.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-item.d.ts +36 -0
- package/dist/components/navigation/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-item.js +63 -0
- package/dist/components/navigation/sidebar/sidebar-item.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-section.d.ts +34 -0
- package/dist/components/navigation/sidebar/sidebar-section.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar-section.js +56 -0
- package/dist/components/navigation/sidebar/sidebar-section.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar.d.ts +2 -0
- package/dist/components/navigation/sidebar/sidebar.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar.js +4 -0
- package/dist/components/navigation/sidebar/sidebar.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar.native.d.ts +23 -0
- package/dist/components/navigation/sidebar/sidebar.native.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar.native.js +80 -0
- package/dist/components/navigation/sidebar/sidebar.native.js.map +1 -0
- package/dist/components/navigation/sidebar/sidebar.web.d.ts +26 -0
- package/dist/components/navigation/sidebar/sidebar.web.d.ts.map +1 -0
- package/dist/components/navigation/sidebar/sidebar.web.js +90 -0
- package/dist/components/navigation/sidebar/sidebar.web.js.map +1 -0
- package/dist/components/navigation/themed-stack.d.ts +25 -0
- package/dist/components/navigation/themed-stack.d.ts.map +1 -0
- package/dist/components/navigation/themed-stack.js +37 -0
- package/dist/components/navigation/themed-stack.js.map +1 -0
- package/dist/components/shared/index.d.ts +3 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/components/shared/index.js +2 -0
- package/dist/components/shared/index.js.map +1 -0
- package/dist/components/shared/types.d.ts +82 -0
- package/dist/components/shared/types.d.ts.map +1 -0
- package/dist/components/shared/types.js +2 -0
- package/dist/components/shared/types.js.map +1 -0
- package/dist/components/shared/utils.d.ts +19 -0
- package/dist/components/shared/utils.d.ts.map +1 -0
- package/dist/components/shared/utils.js +23 -0
- package/dist/components/shared/utils.js.map +1 -0
- package/dist/components/ui/button.d.ts +132 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +252 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/chip.d.ts +88 -0
- package/dist/components/ui/chip.d.ts.map +1 -0
- package/dist/components/ui/chip.js +129 -0
- package/dist/components/ui/chip.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +88 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +66 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/container.d.ts +31 -0
- package/dist/components/ui/container.d.ts.map +1 -0
- package/dist/components/ui/container.js +46 -0
- package/dist/components/ui/container.js.map +1 -0
- package/dist/components/ui/fab.d.ts +51 -0
- package/dist/components/ui/fab.d.ts.map +1 -0
- package/dist/components/ui/fab.js +142 -0
- package/dist/components/ui/fab.js.map +1 -0
- package/dist/components/ui/index.d.ts +23 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +22 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/screen.d.ts +40 -0
- package/dist/components/ui/screen.d.ts.map +1 -0
- package/dist/components/ui/screen.js +57 -0
- package/dist/components/ui/screen.js.map +1 -0
- package/dist/components/ui/slider.d.ts +47 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +41 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/themed-image.d.ts +7 -0
- package/dist/components/ui/themed-image.d.ts.map +1 -0
- package/dist/components/ui/themed-image.js +9 -0
- package/dist/components/ui/themed-image.js.map +1 -0
- package/dist/components/ui/themed-view.d.ts +20 -0
- package/dist/components/ui/themed-view.d.ts.map +1 -0
- package/dist/components/ui/themed-view.js +75 -0
- package/dist/components/ui/themed-view.js.map +1 -0
- package/dist/components/ui/typography.d.ts +110 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/components/ui/typography.js +69 -0
- package/dist/components/ui/typography.js.map +1 -0
- package/dist/context/layout-context.d.ts +66 -0
- package/dist/context/layout-context.d.ts.map +1 -0
- package/dist/context/layout-context.js +83 -0
- package/dist/context/layout-context.js.map +1 -0
- package/dist/context/scroll-context.d.ts +8 -0
- package/dist/context/scroll-context.d.ts.map +1 -0
- package/dist/context/scroll-context.js +16 -0
- package/dist/context/scroll-context.js.map +1 -0
- package/dist/context/sidebar-context.d.ts +74 -0
- package/dist/context/sidebar-context.d.ts.map +1 -0
- package/dist/context/sidebar-context.js +95 -0
- package/dist/context/sidebar-context.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-breakpoint.d.ts +8 -0
- package/dist/hooks/use-breakpoint.d.ts.map +1 -0
- package/dist/hooks/use-breakpoint.js +10 -0
- package/dist/hooks/use-breakpoint.js.map +1 -0
- package/dist/hooks/use-dimensions.d.ts +31 -0
- package/dist/hooks/use-dimensions.d.ts.map +1 -0
- package/dist/hooks/use-dimensions.js +44 -0
- package/dist/hooks/use-dimensions.js.map +1 -0
- package/dist/hooks/use-route-navigation.d.ts +19 -0
- package/dist/hooks/use-route-navigation.d.ts.map +1 -0
- package/dist/hooks/use-route-navigation.js +25 -0
- package/dist/hooks/use-route-navigation.js.map +1 -0
- package/dist/icons/icon-utils.d.ts +24 -0
- package/dist/icons/icon-utils.d.ts.map +1 -0
- package/dist/icons/icon-utils.js +57 -0
- package/dist/icons/icon-utils.js.map +1 -0
- package/dist/icons/index.d.ts +13 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +12 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/theme/high-contrast-theme.d.ts +19 -0
- package/dist/theme/high-contrast-theme.d.ts.map +1 -0
- package/dist/theme/high-contrast-theme.js +257 -0
- package/dist/theme/high-contrast-theme.js.map +1 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-config.d.ts +150 -0
- package/dist/theme/theme-config.d.ts.map +1 -0
- package/dist/theme/theme-config.js +318 -0
- package/dist/theme/theme-config.js.map +1 -0
- package/dist/theme/theme.d.ts +106 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +135 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/utils/contrast-checker.d.ts +51 -0
- package/dist/utils/contrast-checker.d.ts.map +1 -0
- package/dist/utils/contrast-checker.js +97 -0
- package/dist/utils/contrast-checker.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GestureResponderEvent, View } from 'react-native';
|
|
3
|
+
import { type IconLibrary } from '../../icons';
|
|
4
|
+
import type { InteractiveComponentProps, LoadableComponentProps } from '../shared/types';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for button icons.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // Using Feather icons (default)
|
|
11
|
+
* <Button title="Next" icon={{ name: 'arrow-right' }} />
|
|
12
|
+
*
|
|
13
|
+
* // Using MaterialIcons
|
|
14
|
+
* <Button title="Save" icon={{ library: 'MaterialIcons', name: 'save', size: 20 }} />
|
|
15
|
+
*
|
|
16
|
+
* // Custom color
|
|
17
|
+
* <Button title="Delete" icon={{ name: 'trash-2', color: '#FF0000' }} />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export interface IconConfig {
|
|
21
|
+
/** Icon library to use. @default 'Feather' */
|
|
22
|
+
library?: IconLibrary;
|
|
23
|
+
/** Name of the icon from the specified library */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Icon size in pixels. @default 18 */
|
|
26
|
+
size?: number;
|
|
27
|
+
/** Custom icon color. Defaults to button text color */
|
|
28
|
+
color?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Material Design 3 button variants.
|
|
32
|
+
* - `filled`: High-emphasis, solid background (default)
|
|
33
|
+
* - `elevated`: Medium-emphasis with shadow/elevation
|
|
34
|
+
* - `tonal`: Medium-emphasis with secondary container color
|
|
35
|
+
* - `outlined`: Medium-emphasis with border, no fill
|
|
36
|
+
* - `text`: Low-emphasis, text only
|
|
37
|
+
*/
|
|
38
|
+
export type ButtonVariant = 'elevated' | 'filled' | 'tonal' | 'outlined' | 'text';
|
|
39
|
+
export declare const ButtonVariants: readonly ["filled", "elevated", "tonal", "outlined", "text"];
|
|
40
|
+
/**
|
|
41
|
+
* Props for the Button component.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Basic usage
|
|
46
|
+
* <Button title="Click me" onPress={() => console.log('Pressed!')} />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* // Different variants
|
|
52
|
+
* <Button title="Primary Action" variant="filled" />
|
|
53
|
+
* <Button title="Secondary" variant="tonal" />
|
|
54
|
+
* <Button title="Cancel" variant="outlined" />
|
|
55
|
+
* <Button title="Learn more" variant="text" />
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // With icon
|
|
61
|
+
* <Button
|
|
62
|
+
* title="Continue"
|
|
63
|
+
* icon={{ name: 'arrow-right' }}
|
|
64
|
+
* iconPosition="right"
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // Loading state
|
|
71
|
+
* <Button title="Submitting..." loading={true} />
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* // Custom colors (use sparingly - prefer variants)
|
|
77
|
+
* <Button
|
|
78
|
+
* title="Custom"
|
|
79
|
+
* backgroundColor="#FF6B35"
|
|
80
|
+
* color="#FFFFFF"
|
|
81
|
+
* />
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export interface ButtonProps extends Omit<InteractiveComponentProps, 'onPress'>, LoadableComponentProps {
|
|
85
|
+
/** Button label text */
|
|
86
|
+
title: string;
|
|
87
|
+
/** Press handler. Receives optional GestureResponderEvent */
|
|
88
|
+
onPress?: (event?: GestureResponderEvent) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Visual style variant following M3 button spec.
|
|
91
|
+
* @default 'filled'
|
|
92
|
+
*/
|
|
93
|
+
variant?: ButtonVariant;
|
|
94
|
+
/** Optional icon configuration */
|
|
95
|
+
icon?: IconConfig;
|
|
96
|
+
/**
|
|
97
|
+
* Position of the icon relative to the title.
|
|
98
|
+
* @default 'right'
|
|
99
|
+
*/
|
|
100
|
+
iconPosition?: 'left' | 'right';
|
|
101
|
+
/**
|
|
102
|
+
* Override text color. Use sparingly - prefer semantic variants.
|
|
103
|
+
* Useful for special cases like destructive actions.
|
|
104
|
+
*/
|
|
105
|
+
color?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Override background color. Use sparingly - prefer semantic variants.
|
|
108
|
+
*/
|
|
109
|
+
backgroundColor?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Button size affecting height.
|
|
112
|
+
* - `small`: 32dp
|
|
113
|
+
* - `medium`: 40dp (default)
|
|
114
|
+
* - `large`: 56dp
|
|
115
|
+
* @default 'medium'
|
|
116
|
+
*/
|
|
117
|
+
size?: 'small' | 'medium' | 'large';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Material Design 3 Button component
|
|
121
|
+
* https://m3.material.io/components/buttons
|
|
122
|
+
*
|
|
123
|
+
* Supports five variants:
|
|
124
|
+
* - filled: High-emphasis actions (default)
|
|
125
|
+
* - elevated: Medium-emphasis actions with elevation
|
|
126
|
+
* - tonal: Medium-emphasis with container color
|
|
127
|
+
* - outlined: Medium-emphasis with border
|
|
128
|
+
* - text: Low-emphasis actions
|
|
129
|
+
*/
|
|
130
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<View>>;
|
|
131
|
+
export { Button };
|
|
132
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAEL,qBAAqB,EAIrB,IAAI,EAIL,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAKzF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,UAAU;IACzB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAClF,eAAO,MAAM,cAAc,8DAA+D,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,EAAE,sBAAsB;IACrG,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClD;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kCAAkC;IAClC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAGD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,0EAgQV,CAAC;AAmDH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// 1. IMPORTS
|
|
3
|
+
import { forwardRef, useEffect, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, Platform, Pressable, StyleSheet, View, } from 'react-native';
|
|
5
|
+
import { Typography } from './typography';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
import { renderIcon } from '../../icons';
|
|
8
|
+
import { blurOnWeb } from '../shared/utils';
|
|
9
|
+
export const ButtonVariants = ['filled', 'elevated', 'tonal', 'outlined', 'text'];
|
|
10
|
+
// 3. COMPONENT
|
|
11
|
+
/**
|
|
12
|
+
* Material Design 3 Button component
|
|
13
|
+
* https://m3.material.io/components/buttons
|
|
14
|
+
*
|
|
15
|
+
* Supports five variants:
|
|
16
|
+
* - filled: High-emphasis actions (default)
|
|
17
|
+
* - elevated: Medium-emphasis actions with elevation
|
|
18
|
+
* - tonal: Medium-emphasis with container color
|
|
19
|
+
* - outlined: Medium-emphasis with border
|
|
20
|
+
* - text: Low-emphasis actions
|
|
21
|
+
*/
|
|
22
|
+
const Button = forwardRef(({ title, variant = 'filled', loading = false, disabled = false, icon, onPress, iconPosition = 'right', style, testID, accessibilityLabel, accessibilityHint, color, backgroundColor, size = 'medium', }, ref) => {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const tokens = theme.tokens;
|
|
25
|
+
// Track hover and focus states (web-only features)
|
|
26
|
+
const [hovered, setHovered] = useState(false);
|
|
27
|
+
const [focused, setFocused] = useState(false);
|
|
28
|
+
// Respect reduce-motion preference where available and map sizes
|
|
29
|
+
const [reduceMotionEnabled, setReduceMotionEnabled] = useState(false);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
let mounted = true;
|
|
32
|
+
try {
|
|
33
|
+
// dynamically require to avoid bundler differences across platforms
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
35
|
+
const { AccessibilityInfo } = require('react-native');
|
|
36
|
+
AccessibilityInfo?.isReduceMotionEnabled?.().then((enabled) => {
|
|
37
|
+
if (mounted)
|
|
38
|
+
setReduceMotionEnabled(!!enabled);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
// ignore if not available
|
|
43
|
+
}
|
|
44
|
+
return () => { mounted = false; };
|
|
45
|
+
}, []);
|
|
46
|
+
// Visual heights in dp per size token
|
|
47
|
+
const sizeMap = {
|
|
48
|
+
small: 32,
|
|
49
|
+
medium: 40,
|
|
50
|
+
large: 56,
|
|
51
|
+
};
|
|
52
|
+
// default to 'medium' if not provided via props
|
|
53
|
+
const visualHeight = sizeMap[size] ?? sizeMap.medium;
|
|
54
|
+
// Ensure a minimum touch target of 48dp
|
|
55
|
+
const touchHeight = Math.max(48, visualHeight);
|
|
56
|
+
// Dynamic styles based on state
|
|
57
|
+
const getButtonStyle = ({ pressed }) => {
|
|
58
|
+
const t = tokens.button;
|
|
59
|
+
let bg;
|
|
60
|
+
let borderColor;
|
|
61
|
+
let elevation;
|
|
62
|
+
if (disabled) {
|
|
63
|
+
bg = t.disabledBg;
|
|
64
|
+
borderColor = variant === 'outlined' ? theme.outlineVariant : undefined;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
switch (variant) {
|
|
68
|
+
case 'filled':
|
|
69
|
+
bg = t.filledBg;
|
|
70
|
+
if (Platform.OS !== 'web') {
|
|
71
|
+
elevation = pressed ? tokens.elevation.level0 : tokens.elevation.level1;
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
case 'elevated':
|
|
75
|
+
bg = t.elevatedBg;
|
|
76
|
+
elevation = pressed ? tokens.elevation.level1 : tokens.elevation.level3;
|
|
77
|
+
break;
|
|
78
|
+
case 'tonal':
|
|
79
|
+
bg = t.tonalBg;
|
|
80
|
+
break;
|
|
81
|
+
case 'outlined':
|
|
82
|
+
bg = 'transparent';
|
|
83
|
+
borderColor = t.outlinedBorder;
|
|
84
|
+
break;
|
|
85
|
+
case 'text':
|
|
86
|
+
bg = 'transparent';
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Apply custom background color override
|
|
91
|
+
if (backgroundColor) {
|
|
92
|
+
bg = backgroundColor;
|
|
93
|
+
}
|
|
94
|
+
const baseStyle = [
|
|
95
|
+
styles.base,
|
|
96
|
+
styles[variant],
|
|
97
|
+
// reserve touch target height for accessibility
|
|
98
|
+
{ minHeight: touchHeight },
|
|
99
|
+
{ borderRadius: theme.shape.buttonBorderRadius },
|
|
100
|
+
bg ? { backgroundColor: bg } : null,
|
|
101
|
+
borderColor ? { borderColor } : null,
|
|
102
|
+
disabled ? styles.disabled : null,
|
|
103
|
+
];
|
|
104
|
+
// Add elevation shadow for elevated buttons
|
|
105
|
+
if (elevation !== undefined && elevation > 0) {
|
|
106
|
+
baseStyle.push({
|
|
107
|
+
shadowColor: theme.shadow,
|
|
108
|
+
shadowOffset: { width: 0, height: Math.max(1, Math.floor(elevation / 2)) },
|
|
109
|
+
shadowOpacity: 0.08,
|
|
110
|
+
shadowRadius: Math.max(1, Math.floor(elevation / 2)),
|
|
111
|
+
elevation: elevation,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Add focus ring for web/keyboard navigation
|
|
115
|
+
if (focused && Platform.OS === 'web') {
|
|
116
|
+
baseStyle.push({
|
|
117
|
+
borderWidth: tokens.focusRing.width,
|
|
118
|
+
borderColor: tokens.focusRing.color,
|
|
119
|
+
borderStyle: 'solid',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
// M3 state layer: subtle overlay on hover (8% opacity) and press (12% opacity)
|
|
123
|
+
if (Platform.OS === 'web' && !disabled) {
|
|
124
|
+
if (pressed) {
|
|
125
|
+
baseStyle.push({ opacity: 0.88 });
|
|
126
|
+
}
|
|
127
|
+
else if (hovered) {
|
|
128
|
+
baseStyle.push({ opacity: 0.92 });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// subtle transform for hover/press unless user requests reduced motion
|
|
132
|
+
if (!reduceMotionEnabled) {
|
|
133
|
+
if (pressed) {
|
|
134
|
+
baseStyle.push({ transform: [{ scale: 0.997 }] });
|
|
135
|
+
}
|
|
136
|
+
else if (hovered && Platform.OS === 'web') {
|
|
137
|
+
baseStyle.push({ transform: [{ translateY: -1 }, { scale: 1.01 }] });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Add custom style last
|
|
141
|
+
if (style) {
|
|
142
|
+
baseStyle.push(style);
|
|
143
|
+
}
|
|
144
|
+
return baseStyle;
|
|
145
|
+
};
|
|
146
|
+
// Get text color based on variant and state
|
|
147
|
+
const getTextColor = (isDisabled) => {
|
|
148
|
+
if (color)
|
|
149
|
+
return color;
|
|
150
|
+
if (isDisabled)
|
|
151
|
+
return tokens.button.disabledText;
|
|
152
|
+
const t = tokens.button;
|
|
153
|
+
switch (variant) {
|
|
154
|
+
case 'filled':
|
|
155
|
+
return t.filledText;
|
|
156
|
+
case 'elevated':
|
|
157
|
+
return t.elevatedText;
|
|
158
|
+
case 'tonal':
|
|
159
|
+
// tonal should use a high-contrast label (avoid looking disabled)
|
|
160
|
+
return theme.onSurface;
|
|
161
|
+
case 'outlined':
|
|
162
|
+
return t.outlinedText;
|
|
163
|
+
case 'text':
|
|
164
|
+
return t.textColor;
|
|
165
|
+
default:
|
|
166
|
+
return t.filledText;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const getIconColor = (isDisabled) => {
|
|
170
|
+
if (icon?.color)
|
|
171
|
+
return icon.color;
|
|
172
|
+
return getTextColor(isDisabled);
|
|
173
|
+
};
|
|
174
|
+
const textColor = getTextColor(disabled);
|
|
175
|
+
const iconColor = getIconColor(disabled);
|
|
176
|
+
if (loading) {
|
|
177
|
+
return (_jsx(View, { ref: ref, testID: testID, style: [
|
|
178
|
+
styles.base,
|
|
179
|
+
styles[variant],
|
|
180
|
+
{ minHeight: touchHeight },
|
|
181
|
+
{ borderRadius: theme.shape.buttonBorderRadius },
|
|
182
|
+
backgroundColor && { backgroundColor },
|
|
183
|
+
], accessibilityRole: "button", accessibilityLabel: accessibilityLabel ?? title, accessibilityHint: accessibilityHint, accessibilityState: { disabled: true, busy: true }, children: _jsx(ActivityIndicator, { size: "small", color: textColor }) }));
|
|
184
|
+
}
|
|
185
|
+
const renderButtonIcon = (position) => {
|
|
186
|
+
if (!icon || iconPosition !== position)
|
|
187
|
+
return null;
|
|
188
|
+
const iconSize = icon.size || 18;
|
|
189
|
+
const iconLibrary = icon.library || 'Feather';
|
|
190
|
+
return (_jsx(View, { style: position === 'left' ? styles.iconLeft : styles.iconRight, children: renderIcon(icon, iconLibrary, iconSize, iconColor) }));
|
|
191
|
+
};
|
|
192
|
+
return (_jsx(Pressable, { ref: ref, testID: testID, onPress: disabled ? undefined : (e) => {
|
|
193
|
+
blurOnWeb(e);
|
|
194
|
+
onPress?.(e);
|
|
195
|
+
}, disabled: disabled, style: getButtonStyle, onHoverIn: () => setHovered(true), onHoverOut: () => setHovered(false), onFocus: () => setFocused(true), onBlur: () => setFocused(false), accessibilityRole: "button", accessibilityLabel: accessibilityLabel ?? title, accessibilityHint: accessibilityHint, accessibilityState: { disabled },
|
|
196
|
+
// Platform-specific ripple effect for Android
|
|
197
|
+
android_ripple: !disabled && Platform.OS === 'android'
|
|
198
|
+
? {
|
|
199
|
+
color: theme.primary + '40', // 25% opacity
|
|
200
|
+
borderless: false,
|
|
201
|
+
}
|
|
202
|
+
: undefined, children: _jsxs(View, { style: [styles.contentContainer, { height: visualHeight }], children: [renderButtonIcon('left'), _jsx(Typography, { variant: "labelLarge", weight: "medium", color: textColor, numberOfLines: 1, align: "center", children: title }), renderButtonIcon('right')] }) }));
|
|
203
|
+
});
|
|
204
|
+
Button.displayName = 'Button';
|
|
205
|
+
// 4. STYLES
|
|
206
|
+
const styles = StyleSheet.create({
|
|
207
|
+
base: {
|
|
208
|
+
alignItems: 'center',
|
|
209
|
+
justifyContent: 'center',
|
|
210
|
+
},
|
|
211
|
+
filled: {
|
|
212
|
+
paddingHorizontal: 24,
|
|
213
|
+
minWidth: 100,
|
|
214
|
+
},
|
|
215
|
+
elevated: {
|
|
216
|
+
paddingHorizontal: 24,
|
|
217
|
+
minWidth: 100,
|
|
218
|
+
},
|
|
219
|
+
tonal: {
|
|
220
|
+
paddingHorizontal: 24,
|
|
221
|
+
minWidth: 100,
|
|
222
|
+
},
|
|
223
|
+
outlined: {
|
|
224
|
+
backgroundColor: 'transparent',
|
|
225
|
+
borderWidth: 1,
|
|
226
|
+
paddingHorizontal: 24,
|
|
227
|
+
minWidth: 100,
|
|
228
|
+
},
|
|
229
|
+
text: {
|
|
230
|
+
backgroundColor: 'transparent',
|
|
231
|
+
paddingHorizontal: 12,
|
|
232
|
+
minWidth: 100,
|
|
233
|
+
},
|
|
234
|
+
disabled: {
|
|
235
|
+
opacity: 0.38, // M3 disabled opacity
|
|
236
|
+
},
|
|
237
|
+
contentContainer: {
|
|
238
|
+
flexDirection: 'row',
|
|
239
|
+
alignItems: 'center',
|
|
240
|
+
justifyContent: 'center',
|
|
241
|
+
gap: 8,
|
|
242
|
+
},
|
|
243
|
+
iconLeft: {
|
|
244
|
+
marginRight: 0, // gap handles spacing
|
|
245
|
+
},
|
|
246
|
+
iconRight: {
|
|
247
|
+
marginLeft: 0, // gap handles spacing
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
// 5. EXPORTS
|
|
251
|
+
export { Button };
|
|
252
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":";AAAA,aAAa;AACb,OAAc,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EACL,iBAAiB,EAEjB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,IAAI,GAIL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuC5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAkF3F,eAAe;AACf;;;;;;;;;;GAUG;AACH,MAAM,MAAM,GAAG,UAAU,CAAoB,CAAC,EAC5C,KAAK,EACL,OAAO,GAAG,QAAQ,EAClB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,OAAO,EACP,YAAY,GAAG,OAAO,EACtB,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACL,eAAe,EACf,IAAI,GAAG,QAAQ,GAChB,EAAE,GAAG,EAAE,EAAE;IACR,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,KAAK,CAAC,MA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AAsB;KACvC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,CAAC,EAAE,sBAAsB;KACtC;CACF,CAAC,CAAC;AAEH,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type IconLibrary } from '../../icons';
|
|
2
|
+
import type { InteractiveComponentProps } from '../shared/types';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the chip's trailing icon.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChipIconConfig {
|
|
7
|
+
/** Icon library to use. @default 'Feather' */
|
|
8
|
+
library?: IconLibrary;
|
|
9
|
+
/** Name of the icon from the specified library */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Icon size in pixels. @default 18 */
|
|
12
|
+
size?: number;
|
|
13
|
+
/** Custom icon color. Defaults to chip text color */
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Material Design 3 chip visual variants.
|
|
18
|
+
* - `outlined`: Transparent background with 1dp border (default)
|
|
19
|
+
* - `filled`: Solid secondaryContainer background, no border
|
|
20
|
+
*/
|
|
21
|
+
export type ChipVariant = 'filled' | 'outlined';
|
|
22
|
+
export declare const ChipVariants: readonly ["filled", "outlined"];
|
|
23
|
+
/**
|
|
24
|
+
* Props for the Chip component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* // Outlined chip (default)
|
|
29
|
+
* <Chip label="Design" onPress={() => {}} />
|
|
30
|
+
*
|
|
31
|
+
* // Filled chip
|
|
32
|
+
* <Chip label="TypeScript" variant="filled" onPress={() => {}} />
|
|
33
|
+
*
|
|
34
|
+
* // Filter chip — toggleable with checkmark
|
|
35
|
+
* <Chip label="Wireless" selected={on} onPress={() => setOn(v => !v)} />
|
|
36
|
+
*
|
|
37
|
+
* // Chip with trailing icon and separate icon press
|
|
38
|
+
* <Chip
|
|
39
|
+
* label="React Native"
|
|
40
|
+
* variant="filled"
|
|
41
|
+
* icon={{ name: 'x' }}
|
|
42
|
+
* onPress={() => {}}
|
|
43
|
+
* onIconPress={() => removeTag('React Native')}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export interface ChipProps extends InteractiveComponentProps {
|
|
48
|
+
/** Chip label text */
|
|
49
|
+
label: string;
|
|
50
|
+
/**
|
|
51
|
+
* Visual style variant.
|
|
52
|
+
* - `outlined`: Border, transparent background (default)
|
|
53
|
+
* - `filled`: Solid tonal background, no border
|
|
54
|
+
* @default 'outlined'
|
|
55
|
+
*/
|
|
56
|
+
variant?: ChipVariant;
|
|
57
|
+
/**
|
|
58
|
+
* Selected state — shows a leading checkmark and uses selectedBg color.
|
|
59
|
+
* Use for filter chip behaviour.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
selected?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Optional trailing icon rendered to the right of the label.
|
|
65
|
+
* Provide `onIconPress` to make it independently pressable.
|
|
66
|
+
*/
|
|
67
|
+
icon?: ChipIconConfig;
|
|
68
|
+
/**
|
|
69
|
+
* Called when the trailing icon is pressed independently.
|
|
70
|
+
* When provided, the icon becomes its own pressable target separate from `onPress`.
|
|
71
|
+
*/
|
|
72
|
+
onIconPress?: () => void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Material Design 3 Chip component
|
|
76
|
+
* https://m3.material.io/components/chips
|
|
77
|
+
*
|
|
78
|
+
* Height: 32dp visual / 48dp touch target via hitSlop
|
|
79
|
+
* Shape: CornerSmall (8dp border radius)
|
|
80
|
+
* Variants: filled, outlined
|
|
81
|
+
* Behavioural props: selected (filter checkmark), icon + onIconPress (trailing action)
|
|
82
|
+
*/
|
|
83
|
+
declare const Chip: {
|
|
84
|
+
({ label, variant, selected, disabled, icon, onPress, onIconPress, style, testID, accessibilityLabel, accessibilityHint, }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
displayName: string;
|
|
86
|
+
};
|
|
87
|
+
export { Chip };
|
|
88
|
+
//# sourceMappingURL=chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAKjE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAChD,eAAO,MAAM,YAAY,iCAAkC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,SAAU,SAAQ,yBAAyB;IAC1D,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAGD;;;;;;;;GAQG;AACH,QAAA,MAAM,IAAI;gIAYP,SAAS;;CA4IX,CAAC;AA4BF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// 1. IMPORTS
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Platform, Pressable, StyleSheet, View, } from 'react-native';
|
|
5
|
+
import { Typography } from './typography';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
import { renderIcon } from '../../icons';
|
|
8
|
+
import { blurOnWeb } from '../shared/utils';
|
|
9
|
+
export const ChipVariants = ['filled', 'outlined'];
|
|
10
|
+
// 3. COMPONENT
|
|
11
|
+
/**
|
|
12
|
+
* Material Design 3 Chip component
|
|
13
|
+
* https://m3.material.io/components/chips
|
|
14
|
+
*
|
|
15
|
+
* Height: 32dp visual / 48dp touch target via hitSlop
|
|
16
|
+
* Shape: CornerSmall (8dp border radius)
|
|
17
|
+
* Variants: filled, outlined
|
|
18
|
+
* Behavioural props: selected (filter checkmark), icon + onIconPress (trailing action)
|
|
19
|
+
*/
|
|
20
|
+
const Chip = ({ label, variant = 'outlined', selected = false, disabled = false, icon, onPress, onIconPress, style, testID, accessibilityLabel, accessibilityHint, }) => {
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const t = theme.tokens.chip;
|
|
23
|
+
const [hovered, setHovered] = useState(false);
|
|
24
|
+
const [focused, setFocused] = useState(false);
|
|
25
|
+
const getBg = () => {
|
|
26
|
+
if (disabled)
|
|
27
|
+
return variant === 'filled' ? t.disabledBg : 'transparent';
|
|
28
|
+
if (selected)
|
|
29
|
+
return t.selectedBg;
|
|
30
|
+
if (variant === 'filled')
|
|
31
|
+
return t.filledBg;
|
|
32
|
+
return 'transparent';
|
|
33
|
+
};
|
|
34
|
+
const getTextColor = () => {
|
|
35
|
+
if (disabled)
|
|
36
|
+
return t.disabledText;
|
|
37
|
+
if (selected)
|
|
38
|
+
return t.selectedText;
|
|
39
|
+
if (variant === 'filled')
|
|
40
|
+
return t.filledText;
|
|
41
|
+
return t.outlinedText;
|
|
42
|
+
};
|
|
43
|
+
const getBorderColor = () => {
|
|
44
|
+
if (variant === 'filled' || selected)
|
|
45
|
+
return undefined;
|
|
46
|
+
if (disabled)
|
|
47
|
+
return t.disabledBorder;
|
|
48
|
+
return t.outlinedBorder;
|
|
49
|
+
};
|
|
50
|
+
const textColor = getTextColor();
|
|
51
|
+
const borderColor = getBorderColor();
|
|
52
|
+
const bg = getBg();
|
|
53
|
+
const borderRadius = theme.borderRadius.sm; // M3 CornerSmall = 8dp
|
|
54
|
+
// Padding: 8dp on side with leading/trailing content, 12dp otherwise
|
|
55
|
+
const paddingLeft = selected ? 8 : 12;
|
|
56
|
+
const paddingRight = icon ? 8 : 12;
|
|
57
|
+
const getInnerStyle = () => {
|
|
58
|
+
const base = [
|
|
59
|
+
styles.chip,
|
|
60
|
+
{
|
|
61
|
+
backgroundColor: bg,
|
|
62
|
+
borderRadius,
|
|
63
|
+
paddingLeft,
|
|
64
|
+
paddingRight,
|
|
65
|
+
},
|
|
66
|
+
borderColor ? { borderWidth: 1, borderColor } : null,
|
|
67
|
+
disabled ? styles.disabled : null,
|
|
68
|
+
];
|
|
69
|
+
// Focus ring on the visual element
|
|
70
|
+
if (focused && Platform.OS === 'web') {
|
|
71
|
+
base.push({
|
|
72
|
+
outlineWidth: theme.tokens.focusRing.width,
|
|
73
|
+
outlineColor: theme.tokens.focusRing.color,
|
|
74
|
+
outlineStyle: 'solid',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (Platform.OS === 'web' && !disabled) {
|
|
78
|
+
if (hovered) {
|
|
79
|
+
base.push({ opacity: 0.92 });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (style) {
|
|
83
|
+
base.push(style);
|
|
84
|
+
}
|
|
85
|
+
return base;
|
|
86
|
+
};
|
|
87
|
+
const getPressableStyle = ({ pressed }) => {
|
|
88
|
+
const base = [styles.pressable];
|
|
89
|
+
if (Platform.OS === 'web' && pressed && !disabled) {
|
|
90
|
+
base.push({ opacity: 0.88 });
|
|
91
|
+
}
|
|
92
|
+
return base;
|
|
93
|
+
};
|
|
94
|
+
return (_jsx(Pressable, { testID: testID, onPress: disabled ? undefined : (e) => {
|
|
95
|
+
blurOnWeb(e);
|
|
96
|
+
onPress?.();
|
|
97
|
+
}, disabled: disabled, style: getPressableStyle, hitSlop: 8, onHoverIn: () => setHovered(true), onHoverOut: () => setHovered(false), onFocus: () => setFocused(true), onBlur: () => setFocused(false), accessibilityRole: "button", accessibilityLabel: accessibilityLabel ?? label, accessibilityHint: accessibilityHint, accessibilityState: { disabled, selected }, android_ripple: !disabled && Platform.OS === 'android'
|
|
98
|
+
? { color: theme.secondary + '40', borderless: false }
|
|
99
|
+
: undefined, children: _jsxs(View, { style: getInnerStyle(), children: [selected && (_jsx(View, { style: styles.iconWrapper, children: renderIcon({ name: 'check' }, 'Feather', 16, textColor) })), _jsx(Typography, { variant: "labelLarge", color: textColor, numberOfLines: 1, children: label }), icon && (onIconPress ? (_jsx(Pressable, { onPress: disabled ? undefined : (e) => {
|
|
100
|
+
blurOnWeb(e);
|
|
101
|
+
onIconPress?.();
|
|
102
|
+
}, style: styles.iconWrapper, accessibilityRole: "button", accessibilityLabel: `${label} action`, hitSlop: 4, children: renderIcon(icon, icon.library ?? 'Feather', icon.size ?? 18, icon.color ?? textColor) })) : (_jsx(View, { style: styles.iconWrapper, children: renderIcon(icon, icon.library ?? 'Feather', icon.size ?? 18, icon.color ?? textColor) })))] }) }));
|
|
103
|
+
};
|
|
104
|
+
Chip.displayName = 'Chip';
|
|
105
|
+
// 4. STYLES
|
|
106
|
+
const styles = StyleSheet.create({
|
|
107
|
+
// Transparent touch target — no background, extends via hitSlop
|
|
108
|
+
pressable: {
|
|
109
|
+
alignSelf: 'flex-start',
|
|
110
|
+
},
|
|
111
|
+
// Visual chip container — 32dp height, all visual styling lives here
|
|
112
|
+
chip: {
|
|
113
|
+
height: 32,
|
|
114
|
+
minWidth: 56,
|
|
115
|
+
flexDirection: 'row',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
gap: 8,
|
|
118
|
+
},
|
|
119
|
+
iconWrapper: {
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
},
|
|
123
|
+
disabled: {
|
|
124
|
+
opacity: 0.38,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
// 5. EXPORTS
|
|
128
|
+
export { Chip };
|
|
129
|
+
//# sourceMappingURL=chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.js","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":";AAAA,aAAa;AACb,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,IAAI,GAIL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAwB5C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC;AAsD5D,eAAe;AACf;;;;;;;;GAQG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,KAAK,EACL,OAAO,GAAG,UAAU,EACpB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,OAAO,EACP,WAAW,EACX,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,iBAAiB,GACP,EAAE,EAAE;IACd,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;IAE5B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,KAAK,GAAG,GAAW,EAAE;QACzB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