@sincpro/mobile-ui 0.7.1 → 1.0.1
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 +7 -5
- package/dist/Actions/Actions.Button.d.ts +91 -91
- package/dist/Actions/Actions.Button.js +36 -43
- package/dist/Actions/Actions.FAB.js +5 -5
- package/dist/Actions/Actions.FilterButton.js +3 -3
- package/dist/Actions/Actions.IconButton.d.ts +31 -31
- package/dist/Actions/Actions.IconButton.js +4 -4
- package/dist/Actions/index.d.ts +11 -11
- package/dist/Actions/index.js +5 -5
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +1 -1
- package/dist/Dialog/BottomSheet/index.d.ts +1 -1
- package/dist/Dialog/BottomSheet/index.js +1 -1
- package/dist/Dialog/Confirmation.context.js +3 -3
- package/dist/Dialog/Dialog.ActionSheet.js +26 -10
- package/dist/Dialog/Dialog.Confirmation.js +5 -5
- package/dist/Dialog/Dialog.EditValue.js +4 -4
- package/dist/Dialog/Dialog.Sheet.js +19 -8
- package/dist/Dialog/index.d.ts +5 -5
- package/dist/Dialog/index.js +5 -5
- package/dist/Display/Display.Accordion.js +5 -5
- package/dist/Display/Display.Avatar.d.ts +30 -30
- package/dist/Display/Display.Avatar.js +2 -2
- package/dist/Display/Display.AvatarGroup.js +3 -3
- package/dist/Display/Display.Badge.d.ts +3 -3
- package/dist/Display/Display.Badge.js +1 -1
- package/dist/Display/Display.Card.d.ts +15 -15
- package/dist/Display/Display.Card.js +4 -4
- package/dist/Display/Display.Carousel.js +2 -2
- package/dist/Display/Display.Chip.d.ts +3 -3
- package/dist/Display/Display.Chip.js +12 -12
- package/dist/Display/Display.CircleButton.d.ts +1 -1
- package/dist/Display/Display.CircleButton.js +3 -3
- package/dist/Display/Display.CopyableText.js +2 -2
- package/dist/Display/Display.CountRecords.js +2 -2
- package/dist/Display/Display.DataTable.js +2 -2
- package/dist/Display/Display.Date.d.ts +1 -1
- package/dist/Display/Display.Date.js +5 -5
- package/dist/Display/Display.Divider.d.ts +24 -24
- package/dist/Display/Display.Divider.js +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +58 -39
- package/dist/Display/Display.GradientSurface.js +31 -15
- package/dist/Display/Display.Icon.d.ts +1 -1
- package/dist/Display/Display.Icon.js +1 -1
- package/dist/Display/Display.IconBadge.js +3 -3
- package/dist/Display/Display.Image.js +4 -4
- package/dist/Display/Display.KeyValue.js +2 -2
- package/dist/Display/Display.ListItem.js +5 -5
- package/dist/Display/Display.Logo.d.ts +3 -3
- package/dist/Display/Display.Logo.js +2 -2
- package/dist/Display/Display.MediaCard.js +4 -4
- package/dist/Display/Display.MediaEmbed.js +7 -7
- package/dist/Display/Display.MenuButton.d.ts +4 -4
- package/dist/Display/Display.MenuButton.js +6 -6
- package/dist/Display/Display.MenuCard.d.ts +1 -1
- package/dist/Display/Display.MenuCard.js +3 -3
- package/dist/Display/Display.MenuGrid.d.ts +1 -1
- package/dist/Display/Display.MenuGrid.js +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +2 -2
- package/dist/Display/Display.Pattern.d.ts +33 -12
- package/dist/Display/Display.Pattern.js +60 -14
- package/dist/Display/Display.PriceTag.js +2 -2
- package/dist/Display/Display.ProductCard.js +7 -7
- package/dist/Display/Display.Rating.js +3 -3
- package/dist/Display/Display.SearchHistory.js +6 -6
- package/dist/Display/Display.SectionHeader.js +4 -4
- package/dist/Display/Display.Stat.js +2 -2
- package/dist/Display/Display.StatCard.js +4 -4
- package/dist/Display/Display.StatusDot.js +3 -3
- package/dist/Display/Display.Story.js +3 -3
- package/dist/Display/Display.StoryTray.js +5 -5
- package/dist/Display/Display.StoryViewer.js +4 -4
- package/dist/Display/Display.SwipeableRow.js +4 -4
- package/dist/Display/Display.Tag.js +2 -2
- package/dist/Display/Display.Timeline.js +4 -4
- package/dist/Display/Display.Tooltip.js +3 -3
- package/dist/Display/index.d.ts +45 -45
- package/dist/Display/index.js +42 -42
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/ErrorBoundary.js +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +3 -3
- package/dist/Feedback/Feedback.Banner.js +5 -5
- package/dist/Feedback/Feedback.DomainSplashScreen.js +5 -4
- package/dist/Feedback/Feedback.Empty.js +3 -3
- package/dist/Feedback/Feedback.EmptyState.js +5 -5
- package/dist/Feedback/Feedback.Error.js +4 -4
- package/dist/Feedback/Feedback.Loading.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.js +2 -2
- package/dist/Feedback/Feedback.PermissionCard.js +5 -5
- package/dist/Feedback/Feedback.Progress.js +6 -4
- package/dist/Feedback/Feedback.ProgressCircle.js +1 -1
- package/dist/Feedback/Feedback.Skeleton.js +5 -4
- package/dist/Feedback/Feedback.Spinner.js +3 -3
- package/dist/Feedback/Feedback.Splash.d.ts +1 -1
- package/dist/Feedback/Feedback.Splash.js +7 -6
- package/dist/Feedback/Toast.context.js +7 -7
- package/dist/Feedback/index.d.ts +13 -13
- package/dist/Feedback/index.js +13 -13
- package/dist/Form/Form.Button.d.ts +2 -2
- package/dist/Form/Form.Button.js +1 -1
- package/dist/Form/Form.Checkbox.js +4 -4
- package/dist/Form/Form.ControlledCheckbox.js +1 -1
- package/dist/Form/Form.ControlledInput.js +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.js +1 -1
- package/dist/Form/Form.ControlledRadioButton.js +1 -1
- package/dist/Form/Form.DatePicker.js +5 -5
- package/dist/Form/Form.Dropdown.js +8 -8
- package/dist/Form/Form.FAB.d.ts +2 -2
- package/dist/Form/Form.FAB.js +1 -1
- package/dist/Form/Form.FilterButton.d.ts +2 -2
- package/dist/Form/Form.FilterButton.js +1 -1
- package/dist/Form/Form.FractionalQuantityInput.js +4 -4
- package/dist/Form/Form.IconButton.d.ts +2 -2
- package/dist/Form/Form.IconButton.js +1 -1
- package/dist/Form/Form.Input.js +4 -4
- package/dist/Form/Form.InputField.d.ts +1 -1
- package/dist/Form/Form.InputField.js +3 -3
- package/dist/Form/Form.MonetaryInput.js +5 -4
- package/dist/Form/Form.PasswordInput.d.ts +1 -1
- package/dist/Form/Form.PasswordInput.js +3 -3
- package/dist/Form/Form.PinInput.js +5 -5
- package/dist/Form/Form.QuantitySelector.js +3 -3
- package/dist/Form/Form.RadioButton.js +4 -4
- package/dist/Form/Form.SearchBar.js +4 -4
- package/dist/Form/Form.Select.js +33 -18
- package/dist/Form/Form.Slider.js +3 -3
- package/dist/Form/Form.Switch.js +4 -4
- package/dist/Form/Form.TextInput.js +3 -3
- package/dist/Form/index.d.ts +27 -27
- package/dist/Form/index.js +25 -25
- package/dist/Navigation/Navigation.AppBar.d.ts +5 -4
- package/dist/Navigation/Navigation.AppBar.js +10 -10
- package/dist/Navigation/Navigation.BottomNav.d.ts +1 -1
- package/dist/Navigation/Navigation.BottomNav.js +25 -16
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +1 -1
- package/dist/Navigation/Navigation.CollapsingHeader.js +3 -3
- package/dist/Navigation/Navigation.FloatingBar.js +2 -2
- package/dist/Navigation/Navigation.Header.js +6 -6
- package/dist/Navigation/Navigation.HeaderToolbar.js +5 -5
- package/dist/Navigation/Navigation.Menu.js +7 -7
- package/dist/Navigation/Navigation.MenuSection.js +2 -2
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.RowItem.js +2 -2
- package/dist/Navigation/Navigation.SearchBar.js +6 -6
- package/dist/Navigation/Navigation.SegmentedControl.js +4 -4
- package/dist/Navigation/Navigation.Steps.js +5 -5
- package/dist/Navigation/Navigation.TabIcon.js +2 -2
- package/dist/Navigation/Navigation.TabItem.js +2 -2
- package/dist/Navigation/Navigation.Tabs.js +5 -5
- package/dist/Navigation/index.d.ts +19 -19
- package/dist/Navigation/index.js +15 -15
- package/dist/Typography/Typography.Heading.d.ts +1 -1
- package/dist/Typography/Typography.Heading.js +1 -1
- package/dist/Typography/Typography.Text.d.ts +2 -2
- package/dist/Typography/Typography.Text.js +8 -6
- package/dist/Typography/index.d.ts +2 -2
- package/dist/Typography/index.js +2 -2
- package/dist/branding.d.ts +22 -0
- package/dist/branding.js +20 -3
- package/dist/icons/AddItemIcon.d.ts +1 -1
- package/dist/icons/ArrangeCircle.d.ts +1 -1
- package/dist/icons/ArrowDownIcon.d.ts +1 -1
- package/dist/icons/ArrowUpIcon.d.ts +1 -1
- package/dist/icons/BoxIcon.d.ts +1 -1
- package/dist/icons/BoxTimeIcon.d.ts +1 -1
- package/dist/icons/CalendarIcon.d.ts +1 -1
- package/dist/icons/CardIcon.d.ts +1 -1
- package/dist/icons/CashierIcon.d.ts +1 -1
- package/dist/icons/DuoIcon.d.ts +1 -1
- package/dist/icons/HomeIcon.d.ts +1 -1
- package/dist/icons/HomeIconOutlined.d.ts +1 -1
- package/dist/icons/LogoIcon.d.ts +1 -1
- package/dist/icons/MoneyReceiveIcon.d.ts +1 -1
- package/dist/icons/PinIcon.d.ts +1 -1
- package/dist/icons/PrinterIcon.d.ts +1 -1
- package/dist/icons/ProfileIcon.d.ts +1 -1
- package/dist/icons/SettingsIcon.d.ts +1 -1
- package/dist/icons/SinpeIcon.d.ts +1 -1
- package/dist/icons/ToggleOffIcon.d.ts +1 -1
- package/dist/icons/WalletMoneyIcon.d.ts +1 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.js +26 -24
- package/dist/layouts/AuthContainer.d.ts +5 -2
- package/dist/layouts/AuthContainer.js +6 -6
- package/dist/layouts/Container.js +1 -1
- package/dist/layouts/GradientContainer.js +1 -1
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.js +4 -4
- package/dist/primitives/AspectRatio.js +1 -1
- package/dist/primitives/BaseButton.d.ts +85 -85
- package/dist/primitives/BaseButton.js +34 -50
- package/dist/primitives/Box.js +1 -1
- package/dist/primitives/Pressable.js +1 -1
- package/dist/primitives/Row.js +1 -1
- package/dist/primitives/Stack.js +1 -1
- package/dist/primitives/index.d.ts +6 -6
- package/dist/primitives/index.js +6 -6
- package/dist/theme/active.d.ts +1 -1
- package/dist/theme/active.js +14 -1
- package/dist/theme/build.d.ts +33 -0
- package/dist/theme/build.js +118 -0
- package/dist/theme/color.d.ts +26 -0
- package/dist/theme/color.js +109 -0
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/contrast.d.ts +29 -0
- package/dist/theme/contrast.js +57 -0
- package/dist/theme/css-vars.d.ts +3 -1
- package/dist/theme/css-vars.js +29 -3
- package/dist/theme/dark.d.ts +3 -4
- package/dist/theme/dark.js +91 -48
- package/dist/theme/default.d.ts +5 -1
- package/dist/theme/default.js +89 -41
- package/dist/theme/define.d.ts +4 -1
- package/dist/theme/define.js +4 -1
- package/dist/theme/globals.css +61 -46
- package/dist/theme/index.d.ts +14 -10
- package/dist/theme/index.js +13 -9
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +2 -2
- package/dist/theme/types.d.ts +77 -16
- package/dist/theme/types.js +13 -3
- package/dist/theme/typography.d.ts +4 -4
- package/dist/theme/typography.js +26 -28
- package/dist/theme/useTheme.d.ts +1 -1
- package/dist/theme/useTheme.js +1 -1
- package/dist/theme/validate.d.ts +16 -0
- package/dist/theme/validate.js +200 -0
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +2 -2
- package/dist/views/AppSplashView.d.ts +2 -2
- package/dist/views/AppSplashView.js +3 -3
- package/dist/views/AuthFormView.d.ts +1 -1
- package/dist/views/AuthFormView.js +3 -3
- package/dist/views/FormViewV2.d.ts +2 -2
- package/dist/views/FormViewV2.js +9 -9
- package/dist/views/ListViewV2.d.ts +3 -3
- package/dist/views/ListViewV2.js +16 -16
- package/dist/views/Wizard/Wizard.context.js +1 -1
- package/dist/views/Wizard/Wizard.d.ts +1 -1
- package/dist/views/Wizard/Wizard.js +1 -1
- package/dist/views/Wizard/index.d.ts +4 -4
- package/dist/views/Wizard/index.js +2 -2
- package/dist/views/types/IFormView.d.ts +1 -1
- package/dist/views/types/IListView.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +2 -2
- package/dist/widgets/CircleButton.js +1 -1
- package/dist/widgets/GeoPermissionCard.js +3 -3
- package/dist/widgets/HomeHeader.js +3 -3
- package/dist/widgets/JSONViewer.js +2 -2
- package/dist/widgets/MenuCard.d.ts +2 -2
- package/dist/widgets/MenuCard.js +1 -1
- package/dist/widgets/MenuGrid.d.ts +3 -3
- package/dist/widgets/MenuGrid.js +1 -1
- package/dist/widgets/MenuSection.d.ts +2 -2
- package/dist/widgets/MenuSection.js +1 -1
- package/dist/widgets/PromoBanner.js +3 -3
- package/dist/widgets/PromoModal.js +4 -4
- package/dist/widgets/QuickActions.js +3 -3
- package/dist/widgets/ScreenHeader.js +2 -2
- package/dist/widgets/TimeZoneSelector.d.ts +1 -1
- package/dist/widgets/TimeZoneSelector.js +4 -4
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
- package/dist/widgets/TimeZoneSelectorModal.js +5 -5
- package/dist/widgets/index.d.ts +16 -16
- package/dist/widgets/index.js +10 -10
- package/package.json +56 -50
- package/tailwind.preset.js +19 -0
- package/dist/icons/icon_getters.d.ts +0 -6
- package/dist/icons/icon_getters.js +0 -23
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sincpro/mobile-ui
|
|
2
2
|
|
|
3
|
-
**Sincpro Mobile Design System** — the UI contract between design and engineering for React Native / Expo SDK
|
|
3
|
+
**Sincpro Mobile Design System** — the UI contract between design and engineering for React Native / Expo SDK 57 applications.
|
|
4
4
|
|
|
5
5
|
This package is maintained by Sincpro as part of the mobile framework ecosystem. Anyone can read the source and use the components. What Sincpro provides is the commitment behind it: stable APIs, predictable behavior, long-term support, and a team that ensures this keeps working as platforms evolve. Build on it knowing it will still be there.
|
|
6
6
|
|
|
@@ -29,6 +29,7 @@ module.exports = {
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
```tsx
|
|
32
|
+
import { Actions } from "@sincpro/mobile-ui/Actions";
|
|
32
33
|
import { Display } from "@sincpro/mobile-ui/Display";
|
|
33
34
|
import { Form } from "@sincpro/mobile-ui/Form";
|
|
34
35
|
import { useToast, ToastProvider } from "@sincpro/mobile-ui/Feedback";
|
|
@@ -39,9 +40,9 @@ export default function InvoiceScreen() {
|
|
|
39
40
|
<Display.Card>
|
|
40
41
|
<Display.KeyValue label="Invoice #" value="INV-0042" copyable />
|
|
41
42
|
<Display.Monetary amount={1500.00} variant="dataLarge" />
|
|
42
|
-
<
|
|
43
|
+
<Actions.Button onPress={() => toast.success("Invoice sent")}>
|
|
43
44
|
Send Invoice
|
|
44
|
-
</
|
|
45
|
+
</Actions.Button>
|
|
45
46
|
</Display.Card>
|
|
46
47
|
);
|
|
47
48
|
}
|
|
@@ -153,7 +154,7 @@ import { ConfirmationProvider, useConfirmationContext } from "@sincpro/mobile-ui
|
|
|
153
154
|
|
|
154
155
|
// Controlled sheet — built on RN Modal, no native peer deps
|
|
155
156
|
<Sheet visible={open} onClose={() => setOpen(false)} title="Options">
|
|
156
|
-
<
|
|
157
|
+
<Actions.Button onPress={confirm}>Confirm</Actions.Button>
|
|
157
158
|
</Sheet>
|
|
158
159
|
|
|
159
160
|
// Imperative confirmation
|
|
@@ -257,7 +258,7 @@ import { Display } from "@sincpro/mobile-ui/Display";
|
|
|
257
258
|
| `Form.ControlledCheckbox` | `Checkbox` + react-hook-form |
|
|
258
259
|
| `Form.ControlledDropdown` | `Dropdown` + react-hook-form |
|
|
259
260
|
| `Form.ControlledMonetaryInput` | `MonetaryInput` + react-hook-form |
|
|
260
|
-
| `
|
|
261
|
+
| `Actions.Button` / `IconButton` / `FAB` | Action components (preferred over deprecated `Form.Button` aliases) |
|
|
261
262
|
|
|
262
263
|
### Feedback
|
|
263
264
|
|
|
@@ -338,6 +339,7 @@ import { Display } from "@sincpro/mobile-ui/Display";
|
|
|
338
339
|
| `FormViewV2` | Dynamic form view with field management |
|
|
339
340
|
| `AuthFormView` | Authentication form layout |
|
|
340
341
|
| `Wizard` / `useWizard` | Multi-step wizard with guards and lifecycle hooks |
|
|
342
|
+
| `AppSplashView` | Branded splash screen with logo and loading state |
|
|
341
343
|
|
|
342
344
|
### Widgets
|
|
343
345
|
|
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
declare const button: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
variant: {
|
|
5
|
-
primary:
|
|
6
|
-
accent:
|
|
7
|
-
cta:
|
|
8
|
-
secondary:
|
|
9
|
-
outline:
|
|
10
|
-
outlineDanger:
|
|
11
|
-
outlineBlack:
|
|
12
|
-
flat:
|
|
13
|
-
link:
|
|
14
|
-
transparent:
|
|
5
|
+
primary: "bg-accent";
|
|
6
|
+
accent: "bg-transparent";
|
|
7
|
+
cta: "bg-accent";
|
|
8
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
9
|
+
outline: "bg-transparent border border-primary";
|
|
10
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
11
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
12
|
+
flat: "bg-text-primary/10";
|
|
13
|
+
link: "bg-transparent min-h-0";
|
|
14
|
+
transparent: "bg-transparent border border-border-light";
|
|
15
15
|
};
|
|
16
16
|
size: {
|
|
17
|
-
small:
|
|
18
|
-
medium:
|
|
19
|
-
large:
|
|
17
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
18
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
19
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
20
20
|
};
|
|
21
21
|
disabled: {
|
|
22
|
-
true:
|
|
22
|
+
true: "opacity-70";
|
|
23
23
|
};
|
|
24
|
-
}, undefined, "rounded-
|
|
24
|
+
}, undefined, "rounded-md items-center justify-center flex-row min-h-[44px]", {
|
|
25
25
|
variant: {
|
|
26
|
-
primary:
|
|
27
|
-
accent:
|
|
28
|
-
cta:
|
|
29
|
-
secondary:
|
|
30
|
-
outline:
|
|
31
|
-
outlineDanger:
|
|
32
|
-
outlineBlack:
|
|
33
|
-
flat:
|
|
34
|
-
link:
|
|
35
|
-
transparent:
|
|
26
|
+
primary: "bg-accent";
|
|
27
|
+
accent: "bg-transparent";
|
|
28
|
+
cta: "bg-accent";
|
|
29
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
30
|
+
outline: "bg-transparent border border-primary";
|
|
31
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
32
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
33
|
+
flat: "bg-text-primary/10";
|
|
34
|
+
link: "bg-transparent min-h-0";
|
|
35
|
+
transparent: "bg-transparent border border-border-light";
|
|
36
36
|
};
|
|
37
37
|
size: {
|
|
38
|
-
small:
|
|
39
|
-
medium:
|
|
40
|
-
large:
|
|
38
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
39
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
40
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
41
41
|
};
|
|
42
42
|
disabled: {
|
|
43
|
-
true:
|
|
43
|
+
true: "opacity-70";
|
|
44
44
|
};
|
|
45
|
-
}, undefined, import("tailwind-variants").
|
|
45
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
46
46
|
variant: {
|
|
47
|
-
primary:
|
|
48
|
-
accent:
|
|
49
|
-
cta:
|
|
50
|
-
secondary:
|
|
51
|
-
outline:
|
|
52
|
-
outlineDanger:
|
|
53
|
-
outlineBlack:
|
|
54
|
-
flat:
|
|
55
|
-
link:
|
|
56
|
-
transparent:
|
|
47
|
+
primary: "bg-accent";
|
|
48
|
+
accent: "bg-transparent";
|
|
49
|
+
cta: "bg-accent";
|
|
50
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
51
|
+
outline: "bg-transparent border border-primary";
|
|
52
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
53
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
54
|
+
flat: "bg-text-primary/10";
|
|
55
|
+
link: "bg-transparent min-h-0";
|
|
56
|
+
transparent: "bg-transparent border border-border-light";
|
|
57
57
|
};
|
|
58
58
|
size: {
|
|
59
|
-
small:
|
|
60
|
-
medium:
|
|
61
|
-
large:
|
|
59
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
60
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
61
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
62
62
|
};
|
|
63
63
|
disabled: {
|
|
64
|
-
true:
|
|
64
|
+
true: "opacity-70";
|
|
65
65
|
};
|
|
66
|
-
}, undefined
|
|
66
|
+
}, undefined>>;
|
|
67
67
|
declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
68
68
|
variant: {
|
|
69
|
-
primary:
|
|
70
|
-
accent:
|
|
71
|
-
cta:
|
|
72
|
-
secondary:
|
|
73
|
-
outline:
|
|
74
|
-
outlineDanger:
|
|
75
|
-
outlineBlack:
|
|
76
|
-
flat:
|
|
77
|
-
link:
|
|
78
|
-
transparent:
|
|
69
|
+
primary: "bg-accent";
|
|
70
|
+
accent: "bg-transparent";
|
|
71
|
+
cta: "bg-accent";
|
|
72
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
73
|
+
outline: "bg-transparent border border-primary";
|
|
74
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
75
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
76
|
+
flat: "bg-text-primary/10";
|
|
77
|
+
link: "bg-transparent";
|
|
78
|
+
transparent: "bg-transparent border border-border-light";
|
|
79
79
|
};
|
|
80
80
|
size: {
|
|
81
|
-
small:
|
|
82
|
-
medium:
|
|
83
|
-
large:
|
|
81
|
+
small: "w-9 h-9";
|
|
82
|
+
medium: "w-11 h-11";
|
|
83
|
+
large: "w-[52px] h-[52px]";
|
|
84
84
|
};
|
|
85
85
|
disabled: {
|
|
86
|
-
true:
|
|
86
|
+
true: "opacity-70";
|
|
87
87
|
};
|
|
88
|
-
}, undefined, "rounded-
|
|
88
|
+
}, undefined, "rounded-md items-center justify-center aspect-square", {
|
|
89
89
|
variant: {
|
|
90
|
-
primary:
|
|
91
|
-
accent:
|
|
92
|
-
cta:
|
|
93
|
-
secondary:
|
|
94
|
-
outline:
|
|
95
|
-
outlineDanger:
|
|
96
|
-
outlineBlack:
|
|
97
|
-
flat:
|
|
98
|
-
link:
|
|
99
|
-
transparent:
|
|
90
|
+
primary: "bg-accent";
|
|
91
|
+
accent: "bg-transparent";
|
|
92
|
+
cta: "bg-accent";
|
|
93
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
94
|
+
outline: "bg-transparent border border-primary";
|
|
95
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
96
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
97
|
+
flat: "bg-text-primary/10";
|
|
98
|
+
link: "bg-transparent";
|
|
99
|
+
transparent: "bg-transparent border border-border-light";
|
|
100
100
|
};
|
|
101
101
|
size: {
|
|
102
|
-
small:
|
|
103
|
-
medium:
|
|
104
|
-
large:
|
|
102
|
+
small: "w-9 h-9";
|
|
103
|
+
medium: "w-11 h-11";
|
|
104
|
+
large: "w-[52px] h-[52px]";
|
|
105
105
|
};
|
|
106
106
|
disabled: {
|
|
107
|
-
true:
|
|
107
|
+
true: "opacity-70";
|
|
108
108
|
};
|
|
109
|
-
}, undefined, import("tailwind-variants").
|
|
109
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
110
110
|
variant: {
|
|
111
|
-
primary:
|
|
112
|
-
accent:
|
|
113
|
-
cta:
|
|
114
|
-
secondary:
|
|
115
|
-
outline:
|
|
116
|
-
outlineDanger:
|
|
117
|
-
outlineBlack:
|
|
118
|
-
flat:
|
|
119
|
-
link:
|
|
120
|
-
transparent:
|
|
111
|
+
primary: "bg-accent";
|
|
112
|
+
accent: "bg-transparent";
|
|
113
|
+
cta: "bg-accent";
|
|
114
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
115
|
+
outline: "bg-transparent border border-primary";
|
|
116
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
117
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
118
|
+
flat: "bg-text-primary/10";
|
|
119
|
+
link: "bg-transparent";
|
|
120
|
+
transparent: "bg-transparent border border-border-light";
|
|
121
121
|
};
|
|
122
122
|
size: {
|
|
123
|
-
small:
|
|
124
|
-
medium:
|
|
125
|
-
large:
|
|
123
|
+
small: "w-9 h-9";
|
|
124
|
+
medium: "w-11 h-11";
|
|
125
|
+
large: "w-[52px] h-[52px]";
|
|
126
126
|
};
|
|
127
127
|
disabled: {
|
|
128
|
-
true:
|
|
128
|
+
true: "opacity-70";
|
|
129
129
|
};
|
|
130
|
-
}, undefined
|
|
130
|
+
}, undefined>>;
|
|
131
131
|
export interface ButtonProps extends VariantProps<typeof button> {
|
|
132
132
|
title: string;
|
|
133
133
|
onPress?: () => void;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { useConfirmationContext } from "../Dialog/Confirmation.context";
|
|
3
|
-
import Icon from "../Display/Display.Icon";
|
|
4
|
-
import { theme } from "../theme";
|
|
5
|
-
import { tv } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
7
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
2
|
+
import { useConfirmationContext } from "../Dialog/Confirmation.context.js";
|
|
3
|
+
import Icon from "../Display/Display.Icon.js";
|
|
4
|
+
import { theme } from "../theme/index.js";
|
|
5
|
+
import { tv } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
8
7
|
import { useCallback } from "react";
|
|
9
8
|
import { ActivityIndicator, TouchableOpacity, View } from "react-native";
|
|
10
9
|
import { runOnJS } from "react-native-reanimated";
|
|
11
10
|
// ─── Style variants ───────────────────────────────────────────────────────────
|
|
12
11
|
const button = tv({
|
|
13
|
-
base: "rounded-
|
|
12
|
+
base: "rounded-md items-center justify-center flex-row min-h-[44px]",
|
|
14
13
|
variants: {
|
|
15
14
|
variant: {
|
|
16
|
-
primary: "
|
|
17
|
-
accent: "
|
|
18
|
-
cta: "
|
|
19
|
-
secondary: "bg-bg-muted",
|
|
15
|
+
primary: "bg-accent",
|
|
16
|
+
accent: "bg-transparent",
|
|
17
|
+
cta: "bg-accent",
|
|
18
|
+
secondary: "bg-bg-muted border border-border-strong",
|
|
20
19
|
outline: "bg-transparent border border-primary",
|
|
21
20
|
outlineDanger: "bg-transparent border border-danger",
|
|
22
21
|
outlineBlack: "bg-transparent border border-border-strong",
|
|
@@ -39,13 +38,13 @@ const button = tv({
|
|
|
39
38
|
},
|
|
40
39
|
});
|
|
41
40
|
const buttonIcon = tv({
|
|
42
|
-
base: "rounded-
|
|
41
|
+
base: "rounded-md items-center justify-center aspect-square",
|
|
43
42
|
variants: {
|
|
44
43
|
variant: {
|
|
45
|
-
primary: "
|
|
46
|
-
accent: "
|
|
47
|
-
cta: "
|
|
48
|
-
secondary: "bg-bg-muted",
|
|
44
|
+
primary: "bg-accent",
|
|
45
|
+
accent: "bg-transparent",
|
|
46
|
+
cta: "bg-accent",
|
|
47
|
+
secondary: "bg-bg-muted border border-border-strong",
|
|
49
48
|
outline: "bg-transparent border border-primary",
|
|
50
49
|
outlineDanger: "bg-transparent border border-danger",
|
|
51
50
|
outlineBlack: "bg-transparent border border-border-strong",
|
|
@@ -70,26 +69,26 @@ const buttonIcon = tv({
|
|
|
70
69
|
const textColor = tv({
|
|
71
70
|
variants: {
|
|
72
71
|
variant: {
|
|
73
|
-
primary: "text-
|
|
74
|
-
accent: "text-text-
|
|
72
|
+
primary: "text-text-on-accent",
|
|
73
|
+
accent: "text-text-accent",
|
|
75
74
|
cta: "text-text-on-accent",
|
|
76
75
|
secondary: "text-text-primary",
|
|
77
|
-
outline: "text-
|
|
76
|
+
outline: "text-text-accent",
|
|
78
77
|
outlineDanger: "text-danger",
|
|
79
78
|
outlineBlack: "text-text-primary",
|
|
80
79
|
flat: "text-text-primary",
|
|
81
|
-
link: "text-
|
|
82
|
-
transparent: "text-
|
|
80
|
+
link: "text-text-accent",
|
|
81
|
+
transparent: "text-text-inverse",
|
|
83
82
|
},
|
|
84
83
|
disabled: {
|
|
85
84
|
true: "opacity-50",
|
|
86
85
|
},
|
|
87
86
|
},
|
|
88
87
|
compoundVariants: [
|
|
89
|
-
{ variant: "primary", disabled: true, className: "text-
|
|
90
|
-
{ variant: "accent", disabled: true, className: "text-text-
|
|
88
|
+
{ variant: "primary", disabled: true, className: "text-text-on-accent" },
|
|
89
|
+
{ variant: "accent", disabled: true, className: "text-text-accent" },
|
|
91
90
|
{ variant: "cta", disabled: true, className: "text-text-on-accent" },
|
|
92
|
-
{ variant: "transparent", disabled: true, className: "text-
|
|
91
|
+
{ variant: "transparent", disabled: true, className: "text-text-inverse/70" },
|
|
93
92
|
{
|
|
94
93
|
variant: ["secondary", "outline", "link"],
|
|
95
94
|
disabled: true,
|
|
@@ -104,15 +103,15 @@ const textColor = tv({
|
|
|
104
103
|
// ─── Color / size helpers ─────────────────────────────────────────────────────
|
|
105
104
|
function getLoadingColor(variant) {
|
|
106
105
|
const map = {
|
|
107
|
-
primary: theme.text.
|
|
108
|
-
accent: theme.text.
|
|
109
|
-
cta: theme.text.
|
|
106
|
+
primary: theme.text.onAccent,
|
|
107
|
+
accent: theme.text.accent,
|
|
108
|
+
cta: theme.text.onAccent,
|
|
110
109
|
secondary: theme.text.primary,
|
|
111
|
-
outline: theme.
|
|
110
|
+
outline: theme.text.accent,
|
|
112
111
|
outlineDanger: theme.danger,
|
|
113
112
|
outlineBlack: theme.text.primary,
|
|
114
113
|
flat: theme.text.primary,
|
|
115
|
-
link: theme.
|
|
114
|
+
link: theme.text.accent,
|
|
116
115
|
transparent: theme.text.inverse,
|
|
117
116
|
};
|
|
118
117
|
return map[variant] ?? theme.text.inverse;
|
|
@@ -120,8 +119,8 @@ function getLoadingColor(variant) {
|
|
|
120
119
|
function getIconColor(variant, disabled) {
|
|
121
120
|
if (disabled) {
|
|
122
121
|
const map = {
|
|
123
|
-
primary: theme.
|
|
124
|
-
accent: theme.text.
|
|
122
|
+
primary: theme.text.onAccent + "70",
|
|
123
|
+
accent: theme.text.accent + "70",
|
|
125
124
|
cta: theme.text.onAccent + "70",
|
|
126
125
|
secondary: theme.text.disabled,
|
|
127
126
|
outline: theme.icon.disabled,
|
|
@@ -134,15 +133,15 @@ function getIconColor(variant, disabled) {
|
|
|
134
133
|
return map[variant] ?? theme.icon.disabled;
|
|
135
134
|
}
|
|
136
135
|
const map = {
|
|
137
|
-
primary: theme.
|
|
138
|
-
accent: theme.text.
|
|
136
|
+
primary: theme.text.onAccent,
|
|
137
|
+
accent: theme.text.accent,
|
|
139
138
|
cta: theme.text.onAccent,
|
|
140
139
|
secondary: theme.text.primary,
|
|
141
|
-
outline: theme.
|
|
140
|
+
outline: theme.text.accent,
|
|
142
141
|
outlineDanger: theme.danger,
|
|
143
142
|
outlineBlack: theme.text.primary,
|
|
144
143
|
flat: theme.text.primary,
|
|
145
|
-
link: theme.
|
|
144
|
+
link: theme.text.accent,
|
|
146
145
|
transparent: theme.icon.inverse,
|
|
147
146
|
};
|
|
148
147
|
return map[variant] ?? theme.icon.inverse;
|
|
@@ -179,11 +178,8 @@ const Button = ({ title, onPress, confirm, variant = "primary", size = "medium",
|
|
|
179
178
|
if (variant === "link") {
|
|
180
179
|
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: handlePress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title })) }));
|
|
181
180
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return (_jsx(LinearGradient, { colors: gradientColors, end: { x: 1, y: 1 }, start: { x: 0, y: 0 }, style: { borderRadius: 13, opacity: disabled ? 0.7 : 1 }, children: _jsx(TouchableOpacity, { activeOpacity: 0.8, disabled: disabled || loading, onPress: handlePress, children: _jsx(View, { className: button({ size, disabled }), style: { backgroundColor: "transparent" }, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsxs(_Fragment, { children: [icon ? _jsx(View, { className: "mr-2", children: icon }) : null, _jsx(Typography.Text, { allowFontScaling: false, bold: true, className: textColorClass, ellipsizeMode: "tail", numberOfLines: 1, variant: textVariantValue, children: title })] })) }) }) }));
|
|
185
|
-
}
|
|
186
|
-
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: handlePress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsxs(_Fragment, { children: [icon ? _jsx(View, { className: "mr-2", children: icon }) : null, _jsx(Typography.Text, { allowFontScaling: false, bold: true, className: textColorClass, ellipsizeMode: "tail", numberOfLines: 1, variant: textVariantValue, children: title })] })) }));
|
|
181
|
+
const emphasize = variant === "primary" || variant === "cta";
|
|
182
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: handlePress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsxs(_Fragment, { children: [icon ? _jsx(View, { className: "mr-2", children: icon }) : null, _jsx(Typography.Text, { allowFontScaling: false, className: textColorClass, ellipsizeMode: "tail", numberOfLines: 1, semibold: emphasize, variant: textVariantValue, children: title })] })) }));
|
|
187
183
|
};
|
|
188
184
|
const ButtonIcon = ({ icon, onPress, confirm, variant = "primary", size = "medium", loading = false, disabled = false, className, }) => {
|
|
189
185
|
const { show, hide } = useConfirmationContext();
|
|
@@ -208,9 +204,6 @@ const ButtonIcon = ({ icon, onPress, confirm, variant = "primary", size = "mediu
|
|
|
208
204
|
runOnJS(onPress)();
|
|
209
205
|
}
|
|
210
206
|
}, [onPress, confirm, show, hide]);
|
|
211
|
-
if (variant === "primary") {
|
|
212
|
-
return (_jsx(LinearGradient, { colors: theme.gradient.primary, end: { x: 1, y: 1 }, start: { x: 0, y: 0 }, style: { borderRadius: 13, opacity: disabled ? 0.7 : 1 }, children: _jsx(TouchableOpacity, { activeOpacity: 0.8, disabled: disabled || loading, onPress: handlePress, children: _jsx(View, { className: buttonIcon({ size, disabled }), style: { backgroundColor: "transparent" }, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }) }) }));
|
|
213
|
-
}
|
|
214
207
|
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: buttonIcon({ variant, size, disabled, className }), disabled: disabled || loading, onPress: handlePress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }));
|
|
215
208
|
};
|
|
216
209
|
const ButtonWithIcon = Object.assign(Button, { Icon: ButtonIcon });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Icon from "../Display/Display.Icon";
|
|
3
|
-
import Pressable from "../primitives/Pressable";
|
|
4
|
-
import { theme } from "../theme";
|
|
5
|
-
import { cn } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import Icon from "../Display/Display.Icon.js";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { theme } from "../theme/index.js";
|
|
5
|
+
import { cn } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
7
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
8
|
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, }) {
|
|
9
9
|
const insets = useSafeAreaInsets();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { tv } from "../theme/tw";
|
|
3
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import { tv } from "../theme/tw.js";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
4
|
import { TouchableOpacity, View } from "react-native";
|
|
5
5
|
const filterButton = tv({
|
|
6
6
|
base: "rounded-lg items-center justify-center py-2 px-3 min-h-[36px]",
|
|
@@ -17,7 +17,7 @@ const filterText = tv({
|
|
|
17
17
|
variants: {
|
|
18
18
|
active: {
|
|
19
19
|
true: "text-white",
|
|
20
|
-
false: "text-
|
|
20
|
+
false: "text-text-accent",
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
defaultVariants: { active: false },
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
2
|
-
import { IconType } from "../utils/icon";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
|
+
import { IconType } from "../utils/icon.js";
|
|
3
3
|
declare const iconButton: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
variant: {
|
|
5
|
-
primary:
|
|
6
|
-
secondary:
|
|
7
|
-
tertiary:
|
|
8
|
-
ghost:
|
|
5
|
+
primary: "bg-primary";
|
|
6
|
+
secondary: "bg-bg-card border border-primary";
|
|
7
|
+
tertiary: "bg-accent";
|
|
8
|
+
ghost: "bg-transparent";
|
|
9
9
|
};
|
|
10
10
|
size: {
|
|
11
|
-
small:
|
|
12
|
-
medium:
|
|
13
|
-
large:
|
|
11
|
+
small: "w-8 h-8";
|
|
12
|
+
medium: "w-10 h-10";
|
|
13
|
+
large: "w-12 h-12";
|
|
14
14
|
};
|
|
15
15
|
rounded: {
|
|
16
|
-
true:
|
|
16
|
+
true: "rounded-full";
|
|
17
17
|
};
|
|
18
18
|
disabled: {
|
|
19
|
-
true:
|
|
19
|
+
true: "opacity-50";
|
|
20
20
|
};
|
|
21
21
|
}, undefined, "rounded-lg items-center justify-center", {
|
|
22
22
|
variant: {
|
|
23
|
-
primary:
|
|
24
|
-
secondary:
|
|
25
|
-
tertiary:
|
|
26
|
-
ghost:
|
|
23
|
+
primary: "bg-primary";
|
|
24
|
+
secondary: "bg-bg-card border border-primary";
|
|
25
|
+
tertiary: "bg-accent";
|
|
26
|
+
ghost: "bg-transparent";
|
|
27
27
|
};
|
|
28
28
|
size: {
|
|
29
|
-
small:
|
|
30
|
-
medium:
|
|
31
|
-
large:
|
|
29
|
+
small: "w-8 h-8";
|
|
30
|
+
medium: "w-10 h-10";
|
|
31
|
+
large: "w-12 h-12";
|
|
32
32
|
};
|
|
33
33
|
rounded: {
|
|
34
|
-
true:
|
|
34
|
+
true: "rounded-full";
|
|
35
35
|
};
|
|
36
36
|
disabled: {
|
|
37
|
-
true:
|
|
37
|
+
true: "opacity-50";
|
|
38
38
|
};
|
|
39
|
-
}, undefined, import("tailwind-variants").
|
|
39
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
40
40
|
variant: {
|
|
41
|
-
primary:
|
|
42
|
-
secondary:
|
|
43
|
-
tertiary:
|
|
44
|
-
ghost:
|
|
41
|
+
primary: "bg-primary";
|
|
42
|
+
secondary: "bg-bg-card border border-primary";
|
|
43
|
+
tertiary: "bg-accent";
|
|
44
|
+
ghost: "bg-transparent";
|
|
45
45
|
};
|
|
46
46
|
size: {
|
|
47
|
-
small:
|
|
48
|
-
medium:
|
|
49
|
-
large:
|
|
47
|
+
small: "w-8 h-8";
|
|
48
|
+
medium: "w-10 h-10";
|
|
49
|
+
large: "w-12 h-12";
|
|
50
50
|
};
|
|
51
51
|
rounded: {
|
|
52
|
-
true:
|
|
52
|
+
true: "rounded-full";
|
|
53
53
|
};
|
|
54
54
|
disabled: {
|
|
55
|
-
true:
|
|
55
|
+
true: "opacity-50";
|
|
56
56
|
};
|
|
57
|
-
}, undefined
|
|
57
|
+
}, undefined>>;
|
|
58
58
|
export interface IconButtonProps extends VariantProps<typeof iconButton> {
|
|
59
59
|
icon?: string;
|
|
60
60
|
type?: IconType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { Display } from "../Display";
|
|
3
|
-
import { theme } from "../theme";
|
|
4
|
-
import { tv } from "../theme/tw";
|
|
2
|
+
import { Display } from "../Display/index.js";
|
|
3
|
+
import { theme } from "../theme/index.js";
|
|
4
|
+
import { tv } from "../theme/tw.js";
|
|
5
5
|
import { ActivityIndicator, TouchableOpacity } from "react-native";
|
|
6
6
|
const iconButton = tv({
|
|
7
7
|
base: "rounded-lg items-center justify-center",
|
|
@@ -32,7 +32,7 @@ const iconButton = tv({
|
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
34
|
function IconButton({ icon, type = "feather", onPress, variant = "ghost", size = "medium", loading = false, disabled = false, rounded = false, iconColor, className, }) {
|
|
35
|
-
const resolvedColor = iconColor ?? theme.
|
|
35
|
+
const resolvedColor = iconColor ?? theme.text.accent;
|
|
36
36
|
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: iconButton({ variant, size, rounded, disabled, className }), disabled: disabled || loading, onPress: onPress, children: loading ? (_jsx(ActivityIndicator, { color: resolvedColor, size: "small" })) : (_jsx(Display.Icon, { color: resolvedColor, name: icon, size: 24, type: type })) }));
|
|
37
37
|
}
|
|
38
38
|
export default IconButton;
|
package/dist/Actions/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import FAB from "
|
|
2
|
-
import { FilterButtonGroup } from "
|
|
3
|
-
import IconButton from "
|
|
1
|
+
import FAB from "./Actions.FAB.js";
|
|
2
|
+
import { FilterButtonGroup } from "./Actions.FilterButton.js";
|
|
3
|
+
import IconButton from "./Actions.IconButton.js";
|
|
4
4
|
export declare const Actions: {
|
|
5
|
-
/** Primary action button
|
|
6
|
-
Button: import("react").FC<import("
|
|
7
|
-
Icon: import("react").FC<import("
|
|
5
|
+
/** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
|
|
6
|
+
Button: import("react").FC<import("./Actions.Button.js").ButtonProps> & {
|
|
7
|
+
Icon: import("react").FC<import("./Actions.Button.js").ButtonIconProps>;
|
|
8
8
|
};
|
|
9
9
|
/** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
|
|
10
10
|
IconButton: typeof IconButton;
|
|
11
11
|
/** Floating Action Button — fixed bottom-right/left, label-optional. */
|
|
12
12
|
FAB: typeof FAB;
|
|
13
13
|
/** Chip-style active/inactive toggle — use inside `Actions.FilterButtonGroup`. */
|
|
14
|
-
FilterButton: import("react").FC<import("
|
|
14
|
+
FilterButton: import("react").FC<import("./Actions.FilterButton.js").FilterButtonProps>;
|
|
15
15
|
/** Horizontal scroll container for `Actions.FilterButton` chips. */
|
|
16
16
|
FilterButtonGroup: typeof FilterButtonGroup;
|
|
17
17
|
};
|
|
18
|
-
export type { ButtonIconProps, ButtonProps } from "
|
|
19
|
-
export type { FABProps } from "
|
|
20
|
-
export type { FilterButtonProps } from "
|
|
21
|
-
export type { IconButtonProps } from "
|
|
18
|
+
export type { ButtonIconProps, ButtonProps } from "./Actions.Button.js";
|
|
19
|
+
export type { FABProps } from "./Actions.FAB.js";
|
|
20
|
+
export type { FilterButtonProps } from "./Actions.FilterButton.js";
|
|
21
|
+
export type { IconButtonProps } from "./Actions.IconButton.js";
|
|
22
22
|
export default Actions;
|
package/dist/Actions/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ButtonWithIcon from "
|
|
2
|
-
import FAB from "
|
|
3
|
-
import { FilterButton, FilterButtonGroup, } from "
|
|
4
|
-
import IconButton from "
|
|
1
|
+
import ButtonWithIcon from "./Actions.Button.js";
|
|
2
|
+
import FAB from "./Actions.FAB.js";
|
|
3
|
+
import { FilterButton, FilterButtonGroup, } from "./Actions.FilterButton.js";
|
|
4
|
+
import IconButton from "./Actions.IconButton.js";
|
|
5
5
|
export const Actions = {
|
|
6
|
-
/** Primary action button
|
|
6
|
+
/** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
|
|
7
7
|
Button: ButtonWithIcon,
|
|
8
8
|
/** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
|
|
9
9
|
IconButton,
|