@boostdev/design-system-components 1.0.3 → 1.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/AGENTS.md +5 -5
- package/dist/client.cjs +236 -153
- package/dist/client.css +547 -483
- package/dist/client.d.cts +53 -94
- package/dist/client.d.ts +53 -94
- package/dist/client.js +237 -163
- package/dist/index.cjs +236 -153
- package/dist/index.css +547 -483
- package/dist/index.d.cts +53 -94
- package/dist/index.d.ts +53 -94
- package/dist/index.js +237 -163
- package/dist/native/index.cjs +991 -0
- package/dist/native/index.d.cts +208 -0
- package/dist/native/index.d.ts +208 -0
- package/dist/native/index.js +968 -0
- package/dist/web-components.d.ts +303 -0
- package/dist/web-components.js +1968 -0
- package/package.json +27 -5
- package/src/components/interaction/Button/Button.module.css +10 -7
- package/src/components/interaction/Button/Button.native.spec.tsx +35 -0
- package/src/components/interaction/Button/Button.native.stories.tsx +42 -0
- package/src/components/interaction/Button/Button.native.tsx +95 -0
- package/src/components/interaction/Button/Button.stories.tsx +1 -1
- package/src/components/interaction/Button/Button.tsx +2 -2
- package/src/components/interaction/Command/Command.mdx +16 -0
- package/src/components/interaction/Command/Command.stories.tsx +1 -1
- package/src/components/interaction/Command/Command.tsx +2 -2
- package/src/components/interaction/Dialog/Dialog.stories.tsx +1 -1
- package/src/components/interaction/Dialog/Dialog.tsx +2 -2
- package/src/components/interaction/Drawer/Drawer.mdx +14 -0
- package/src/components/interaction/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/interaction/Drawer/Drawer.tsx +2 -2
- package/src/components/interaction/DropdownMenu/DropdownMenu.stories.tsx +1 -1
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +2 -2
- package/src/components/interaction/Popover/Popover.mdx +17 -0
- package/src/components/interaction/Popover/Popover.module.css +70 -13
- package/src/components/interaction/Popover/Popover.spec.tsx +68 -4
- package/src/components/interaction/Popover/Popover.stories.tsx +1 -1
- package/src/components/interaction/Popover/Popover.tsx +76 -20
- package/src/components/interaction/Rating/Rating.stories.tsx +1 -1
- package/src/components/interaction/Rating/Rating.tsx +2 -2
- package/src/components/interaction/Toast/Toast.module.css +6 -1
- package/src/components/interaction/Toast/Toast.spec.tsx +21 -0
- package/src/components/interaction/Toast/Toast.stories.tsx +1 -1
- package/src/components/interaction/Toast/Toast.tsx +22 -2
- package/src/components/interaction/form/Checkbox/Checkbox.mdx +2 -2
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +3 -3
- package/src/components/interaction/form/Checkbox/Checkbox.native.spec.tsx +42 -0
- package/src/components/interaction/form/Checkbox/Checkbox.native.stories.tsx +36 -0
- package/src/components/interaction/form/Checkbox/Checkbox.native.tsx +80 -0
- package/src/components/interaction/form/Checkbox/Checkbox.stories.tsx +1 -1
- package/src/components/interaction/form/Checkbox/Checkbox.tsx +2 -2
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.mdx +44 -0
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.stories.tsx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +2 -2
- package/src/components/interaction/form/Combobox/Combobox.mdx +21 -0
- package/src/components/interaction/form/Combobox/Combobox.module.css +1 -1
- package/src/components/interaction/form/Combobox/Combobox.stories.tsx +1 -1
- package/src/components/interaction/form/Combobox/Combobox.tsx +2 -2
- package/src/components/interaction/form/FileInput/FileInput.mdx +14 -0
- package/src/components/interaction/form/FileInput/FileInput.module.css +1 -1
- package/src/components/interaction/form/FileInput/FileInput.stories.tsx +1 -1
- package/src/components/interaction/form/FileInput/FileInput.tsx +2 -2
- package/src/components/interaction/form/FormInput/FormInput.stories.tsx +1 -1
- package/src/components/interaction/form/FormInput/FormInput.tsx +2 -2
- package/src/components/interaction/form/NumberInput/NumberInput.mdx +16 -0
- package/src/components/interaction/form/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +2 -2
- package/src/components/interaction/form/Radio/Radio.mdx +3 -3
- package/src/components/interaction/form/Radio/Radio.module.css +3 -3
- package/src/components/interaction/form/Radio/Radio.native.stories.tsx +46 -0
- package/src/components/interaction/form/Radio/Radio.native.tsx +79 -0
- package/src/components/interaction/form/Radio/Radio.stories.tsx +1 -1
- package/src/components/interaction/form/Radio/Radio.tsx +2 -2
- package/src/components/interaction/form/RadioGroup/RadioGroup.mdx +45 -0
- package/src/components/interaction/form/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +2 -2
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.stories.tsx +1 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +2 -2
- package/src/components/interaction/form/Select/Select.stories.tsx +1 -1
- package/src/components/interaction/form/Select/Select.tsx +2 -2
- package/src/components/interaction/form/Slider/Slider.mdx +1 -1
- package/src/components/interaction/form/Slider/Slider.module.css +4 -4
- package/src/components/interaction/form/Slider/Slider.stories.tsx +1 -1
- package/src/components/interaction/form/Slider/Slider.tsx +2 -2
- package/src/components/interaction/form/Switch/Switch.mdx +4 -4
- package/src/components/interaction/form/Switch/Switch.module.css +3 -3
- package/src/components/interaction/form/Switch/Switch.native.spec.tsx +60 -0
- package/src/components/interaction/form/Switch/Switch.native.stories.tsx +35 -0
- package/src/components/interaction/form/Switch/Switch.native.tsx +59 -0
- package/src/components/interaction/form/Switch/Switch.stories.tsx +1 -1
- package/src/components/interaction/form/Switch/Switch.tsx +2 -2
- package/src/components/interaction/form/Textarea/Textarea.mdx +17 -0
- package/src/components/interaction/form/Textarea/Textarea.stories.tsx +1 -1
- package/src/components/interaction/form/Textarea/Textarea.tsx +2 -2
- package/src/components/interaction/form/atoms/InputContainer.tsx +2 -1
- package/src/components/interaction/form/atoms/Label.native.stories.tsx +18 -0
- package/src/components/interaction/form/atoms/Label.native.tsx +29 -0
- package/src/components/interaction/form/atoms/Label.tsx +5 -3
- package/src/components/interaction/form/atoms/Message.native.spec.tsx +30 -0
- package/src/components/interaction/form/atoms/Message.native.stories.tsx +22 -0
- package/src/components/interaction/form/atoms/Message.native.tsx +34 -0
- package/src/components/interaction/form/atoms/Message.tsx +5 -3
- package/src/components/layout/ButtonGroup/ButtonGroup.native.stories.tsx +50 -0
- package/src/components/layout/ButtonGroup/ButtonGroup.native.tsx +34 -0
- package/src/components/layout/ButtonGroup/ButtonGroup.stories.tsx +1 -1
- package/src/components/layout/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/components/layout/Card/Card.native.stories.tsx +53 -0
- package/src/components/layout/Card/Card.native.tsx +89 -0
- package/src/components/layout/Card/Card.stories.tsx +1 -1
- package/src/components/layout/Card/Card.tsx +2 -2
- package/src/components/layout/IconWrapper/IconWrapper.mdx +2 -2
- package/src/components/layout/IconWrapper/IconWrapper.native.spec.tsx +39 -0
- package/src/components/layout/IconWrapper/IconWrapper.native.stories.tsx +41 -0
- package/src/components/layout/IconWrapper/IconWrapper.native.tsx +20 -0
- package/src/components/layout/IconWrapper/IconWrapper.stories.tsx +1 -1
- package/src/components/layout/IconWrapper/IconWrapper.tsx +2 -2
- package/src/components/layout/SectionHeader/SectionHeader.mdx +13 -0
- package/src/components/layout/SectionHeader/SectionHeader.native.stories.tsx +38 -0
- package/src/components/layout/SectionHeader/SectionHeader.native.tsx +79 -0
- package/src/components/layout/SectionHeader/SectionHeader.stories.tsx +1 -1
- package/src/components/layout/SectionHeader/SectionHeader.tsx +2 -2
- package/src/components/ui/Accordion/Accordion.mdx +14 -0
- package/src/components/ui/Accordion/Accordion.stories.tsx +1 -1
- package/src/components/ui/Accordion/Accordion.tsx +2 -2
- package/src/components/ui/Alert/Alert.native.stories.tsx +43 -0
- package/src/components/ui/Alert/Alert.native.tsx +94 -0
- package/src/components/ui/Alert/Alert.stories.tsx +1 -1
- package/src/components/ui/Alert/Alert.tsx +2 -2
- package/src/components/ui/Avatar/Avatar.native.spec.tsx +47 -0
- package/src/components/ui/Avatar/Avatar.native.stories.tsx +34 -0
- package/src/components/ui/Avatar/Avatar.native.tsx +85 -0
- package/src/components/ui/Avatar/Avatar.stories.tsx +1 -1
- package/src/components/ui/Avatar/Avatar.tsx +2 -2
- package/src/components/ui/Badge/Badge.mdx +2 -2
- package/src/components/ui/Badge/Badge.native.stories.tsx +36 -0
- package/src/components/ui/Badge/Badge.native.tsx +50 -0
- package/src/components/ui/Badge/Badge.stories.tsx +1 -1
- package/src/components/ui/Badge/Badge.tsx +2 -2
- package/src/components/ui/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/components/ui/Calendar/Calendar.mdx +16 -0
- package/src/components/ui/Calendar/Calendar.stories.tsx +1 -1
- package/src/components/ui/Calendar/Calendar.tsx +2 -2
- package/src/components/ui/Carousel/Carousel.stories.tsx +1 -1
- package/src/components/ui/Carousel/Carousel.tsx +2 -2
- package/src/components/ui/Collapsible/Collapsible.stories.tsx +1 -1
- package/src/components/ui/Collapsible/Collapsible.tsx +2 -2
- package/src/components/ui/DescriptionList/DescriptionList.stories.tsx +1 -1
- package/src/components/ui/DescriptionList/DescriptionList.tsx +2 -2
- package/src/components/ui/Link/Link.mdx +14 -0
- package/src/components/ui/Link/Link.stories.tsx +1 -1
- package/src/components/ui/Link/Link.tsx +2 -2
- package/src/components/ui/Loading/Loading.native.spec.tsx +24 -0
- package/src/components/ui/Loading/Loading.native.stories.tsx +33 -0
- package/src/components/ui/Loading/Loading.native.tsx +29 -0
- package/src/components/ui/Loading/Loading.stories.tsx +1 -1
- package/src/components/ui/Loading/Loading.tsx +2 -2
- package/src/components/ui/NotificationBanner/NotificationBanner.native.stories.tsx +39 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.native.tsx +76 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.stories.tsx +1 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.tsx +2 -2
- package/src/components/ui/Pagination/Pagination.module.css +1 -1
- package/src/components/ui/Pagination/Pagination.stories.tsx +1 -1
- package/src/components/ui/Pagination/Pagination.tsx +2 -2
- package/src/components/ui/Progress/Progress.mdx +1 -1
- package/src/components/ui/Progress/Progress.module.css +1 -1
- package/src/components/ui/Progress/Progress.native.stories.tsx +34 -0
- package/src/components/ui/Progress/Progress.native.tsx +84 -0
- package/src/components/ui/Progress/Progress.stories.tsx +1 -1
- package/src/components/ui/Progress/Progress.tsx +2 -2
- package/src/components/ui/ProgressCircle/ProgressCircle.module.css +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.stories.tsx +1 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.tsx +2 -2
- package/src/components/ui/Separator/Separator.mdx +14 -0
- package/src/components/ui/Separator/Separator.native.stories.tsx +42 -0
- package/src/components/ui/Separator/Separator.native.tsx +32 -0
- package/src/components/ui/Separator/Separator.stories.tsx +1 -1
- package/src/components/ui/Separator/Separator.tsx +2 -2
- package/src/components/ui/Skeleton/Skeleton.native.stories.tsx +33 -0
- package/src/components/ui/Skeleton/Skeleton.native.tsx +41 -0
- package/src/components/ui/Skeleton/Skeleton.stories.tsx +1 -1
- package/src/components/ui/Skeleton/Skeleton.tsx +2 -3
- package/src/components/ui/SkipLink/SkipLink.stories.tsx +1 -1
- package/src/components/ui/SkipLink/SkipLink.tsx +5 -3
- package/src/components/ui/Table/Table.mdx +14 -0
- package/src/components/ui/Table/Table.stories.tsx +1 -1
- package/src/components/ui/Table/Table.tsx +2 -2
- package/src/components/ui/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/ui/Tabs/Tabs.tsx +2 -2
- package/src/components/ui/Tooltip/Tooltip.mdx +14 -0
- package/src/components/ui/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/ui/Tooltip/Tooltip.tsx +2 -2
- package/src/components/ui/Typography/Typography.mdx +13 -0
- package/src/components/ui/Typography/Typography.native.stories.tsx +38 -0
- package/src/components/ui/Typography/Typography.native.tsx +65 -0
- package/src/components/ui/Typography/Typography.stories.tsx +1 -1
- package/src/components/ui/Typography/Typography.tsx +2 -2
- package/src/css/bdc.css +8 -0
- package/src/index.ts +1 -0
- package/src/native/ThemeContext.tsx +28 -0
- package/src/native/tokens.ts +13 -0
- package/src/native.ts +39 -0
- package/src/react-augment.d.ts +13 -0
- package/src/stories/DesignSystem/DarkMode.mdx +130 -0
- package/src/types.ts +2 -0
- package/src/typings.d.ts +3 -0
- package/src/web-components/globals.ts +61 -0
- package/src/web-components/index.ts +12 -0
- package/src/web-components/interaction/BdsButton.stories.tsx +60 -0
- package/src/web-components/interaction/BdsPopover.stories.tsx +70 -0
- package/src/web-components/interaction/BdsToastProvider.stories.tsx +73 -0
- package/src/web-components/interaction/bds-button.spec.ts +95 -0
- package/src/web-components/interaction/bds-button.ts +293 -0
- package/src/web-components/interaction/bds-popover.spec.ts +126 -0
- package/src/web-components/interaction/bds-popover.ts +217 -0
- package/src/web-components/interaction/bds-toast-provider.spec.ts +122 -0
- package/src/web-components/interaction/bds-toast-provider.ts +211 -0
- package/src/web-components/test/helpers.ts +14 -0
- package/src/web-components/ui/BdsAlert.stories.tsx +60 -0
- package/src/web-components/ui/BdsBadge.stories.tsx +37 -0
- package/src/web-components/ui/bds-alert.spec.ts +109 -0
- package/src/web-components/ui/bds-alert.ts +209 -0
- package/src/web-components/ui/bds-badge.spec.ts +51 -0
- package/src/web-components/ui/bds-badge.ts +88 -0
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/native.ts
|
|
21
|
+
var native_exports = {};
|
|
22
|
+
__export(native_exports, {
|
|
23
|
+
Alert: () => Alert,
|
|
24
|
+
Avatar: () => Avatar,
|
|
25
|
+
Badge: () => Badge,
|
|
26
|
+
Button: () => Button,
|
|
27
|
+
ButtonGroup: () => ButtonGroup,
|
|
28
|
+
Card: () => Card,
|
|
29
|
+
Checkbox: () => Checkbox,
|
|
30
|
+
IconWrapper: () => IconWrapper,
|
|
31
|
+
Label: () => Label,
|
|
32
|
+
Loading: () => Loading,
|
|
33
|
+
Message: () => Message,
|
|
34
|
+
NotificationBanner: () => NotificationBanner,
|
|
35
|
+
Progress: () => Progress,
|
|
36
|
+
Radio: () => Radio,
|
|
37
|
+
SectionHeader: () => SectionHeader,
|
|
38
|
+
Separator: () => Separator,
|
|
39
|
+
Skeleton: () => Skeleton,
|
|
40
|
+
Switch: () => Switch,
|
|
41
|
+
ThemeProvider: () => ThemeProvider,
|
|
42
|
+
Typography: () => Typography,
|
|
43
|
+
animation: () => import_native.animation,
|
|
44
|
+
border: () => import_native.border,
|
|
45
|
+
colors: () => import_native.colors,
|
|
46
|
+
font: () => import_native.font,
|
|
47
|
+
lineHeight: () => lineHeight,
|
|
48
|
+
spacing: () => import_native.spacing,
|
|
49
|
+
useTheme: () => useTheme,
|
|
50
|
+
zIndex: () => import_native.zIndex
|
|
51
|
+
});
|
|
52
|
+
module.exports = __toCommonJS(native_exports);
|
|
53
|
+
|
|
54
|
+
// src/native/ThemeContext.tsx
|
|
55
|
+
var import_react = require("react");
|
|
56
|
+
var import_react_native = require("react-native");
|
|
57
|
+
|
|
58
|
+
// src/native/tokens.ts
|
|
59
|
+
var import_native = require("@boostdev/design-system-foundation/native");
|
|
60
|
+
var lineHeight = {
|
|
61
|
+
display: Math.round(import_native.font.size.display * import_native.font.lineHeight.display),
|
|
62
|
+
heading1: Math.round(import_native.font.size.heading1 * import_native.font.lineHeight.heading),
|
|
63
|
+
heading2: Math.round(import_native.font.size.heading2 * import_native.font.lineHeight.heading),
|
|
64
|
+
heading3: Math.round(import_native.font.size.heading3 * import_native.font.lineHeight.heading),
|
|
65
|
+
body: Math.round(import_native.font.size.body * import_native.font.lineHeight.body),
|
|
66
|
+
bodyS: Math.round(import_native.font.size.bodyS * import_native.font.lineHeight.body)
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/native/ThemeContext.tsx
|
|
70
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
71
|
+
var ThemeContext = (0, import_react.createContext)(null);
|
|
72
|
+
function ThemeProvider({ children }) {
|
|
73
|
+
const scheme = (0, import_react_native.useColorScheme)();
|
|
74
|
+
const isDark = scheme === "dark";
|
|
75
|
+
const value = (0, import_react.useMemo)(
|
|
76
|
+
() => ({ colors: isDark ? import_native.colors.dark : import_native.colors.light, isDark }),
|
|
77
|
+
[isDark]
|
|
78
|
+
);
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeContext.Provider, { value, children });
|
|
80
|
+
}
|
|
81
|
+
function useTheme() {
|
|
82
|
+
const ctx = (0, import_react.useContext)(ThemeContext);
|
|
83
|
+
if (!ctx) throw new Error("useTheme must be used within ThemeProvider");
|
|
84
|
+
return ctx;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// src/components/ui/Typography/Typography.native.tsx
|
|
88
|
+
var import_react_native2 = require("react-native");
|
|
89
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
90
|
+
var styles = import_react_native2.StyleSheet.create({
|
|
91
|
+
base: {
|
|
92
|
+
fontFamily: import_native.font.family.body,
|
|
93
|
+
fontWeight: import_native.font.weight.body
|
|
94
|
+
},
|
|
95
|
+
h1: {
|
|
96
|
+
fontSize: import_native.font.size.heading1,
|
|
97
|
+
fontFamily: import_native.font.family.heading,
|
|
98
|
+
fontWeight: import_native.font.weight.heading,
|
|
99
|
+
lineHeight: lineHeight.heading1
|
|
100
|
+
},
|
|
101
|
+
h2: {
|
|
102
|
+
fontSize: import_native.font.size.heading2,
|
|
103
|
+
fontFamily: import_native.font.family.heading,
|
|
104
|
+
fontWeight: import_native.font.weight.heading,
|
|
105
|
+
lineHeight: lineHeight.heading2
|
|
106
|
+
},
|
|
107
|
+
h3: {
|
|
108
|
+
fontSize: import_native.font.size.heading3,
|
|
109
|
+
fontFamily: import_native.font.family.heading,
|
|
110
|
+
fontWeight: import_native.font.weight.heading,
|
|
111
|
+
lineHeight: lineHeight.heading3
|
|
112
|
+
},
|
|
113
|
+
body: {
|
|
114
|
+
fontSize: import_native.font.size.body,
|
|
115
|
+
lineHeight: lineHeight.body
|
|
116
|
+
},
|
|
117
|
+
body_s: {
|
|
118
|
+
fontSize: import_native.font.size.bodyS,
|
|
119
|
+
lineHeight: lineHeight.bodyS
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
var accessibilityRoles = {
|
|
123
|
+
h1: "header",
|
|
124
|
+
h2: "header",
|
|
125
|
+
h3: "header",
|
|
126
|
+
body: "text",
|
|
127
|
+
body_s: "text"
|
|
128
|
+
};
|
|
129
|
+
function Typography({ variant = "body", children, style }) {
|
|
130
|
+
const { colors: colors2 } = useTheme();
|
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
132
|
+
import_react_native2.Text,
|
|
133
|
+
{
|
|
134
|
+
accessibilityRole: accessibilityRoles[variant],
|
|
135
|
+
style: [styles.base, styles[variant], { color: colors2.colorOnBg }, style],
|
|
136
|
+
children
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// src/components/ui/Badge/Badge.native.tsx
|
|
142
|
+
var import_react_native3 = require("react-native");
|
|
143
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
144
|
+
var styles2 = import_react_native3.StyleSheet.create({
|
|
145
|
+
badge: {
|
|
146
|
+
alignSelf: "flex-start",
|
|
147
|
+
flexDirection: "row",
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
justifyContent: "center",
|
|
150
|
+
paddingVertical: import_native.spacing.xxs,
|
|
151
|
+
paddingHorizontal: import_native.spacing.xs,
|
|
152
|
+
borderRadius: 999
|
|
153
|
+
},
|
|
154
|
+
text: {
|
|
155
|
+
fontSize: import_native.font.size.bodyS,
|
|
156
|
+
fontFamily: import_native.font.family.body,
|
|
157
|
+
fontWeight: import_native.font.weight.semibold,
|
|
158
|
+
lineHeight: import_native.font.size.bodyS
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
function Badge({ children, variant = "primary", style }) {
|
|
162
|
+
const { colors: colors2 } = useTheme();
|
|
163
|
+
const variantColors = {
|
|
164
|
+
primary: { bg: colors2.colorInteractive, text: colors2.colorOnInteractive },
|
|
165
|
+
secondary: { bg: colors2.colorBgSubtle, text: colors2.colorOnBgSubtle },
|
|
166
|
+
success: { bg: colors2.colorSuccess, text: colors2.colorOnSuccess },
|
|
167
|
+
error: { bg: colors2.colorError, text: colors2.colorOnError },
|
|
168
|
+
warning: { bg: colors2.colorWarning, text: colors2.colorOnWarning }
|
|
169
|
+
};
|
|
170
|
+
const { bg, text } = variantColors[variant];
|
|
171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [styles2.badge, { backgroundColor: bg }, style], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [styles2.text, { color: text }], children }) });
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// src/components/ui/Avatar/Avatar.native.tsx
|
|
175
|
+
var import_react_native4 = require("react-native");
|
|
176
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
177
|
+
var sizeMap = {
|
|
178
|
+
small: { container: 32, fontSize: import_native.font.size.bodyS },
|
|
179
|
+
medium: { container: 48, fontSize: import_native.font.size.body },
|
|
180
|
+
large: { container: 72, fontSize: import_native.font.size.heading3 }
|
|
181
|
+
};
|
|
182
|
+
function getInitials(name) {
|
|
183
|
+
return name.split(" ").filter(Boolean).slice(0, 2).map((word) => word[0].toUpperCase()).join("");
|
|
184
|
+
}
|
|
185
|
+
var styles3 = import_react_native4.StyleSheet.create({
|
|
186
|
+
container: {
|
|
187
|
+
borderRadius: 999,
|
|
188
|
+
overflow: "hidden",
|
|
189
|
+
alignItems: "center",
|
|
190
|
+
justifyContent: "center"
|
|
191
|
+
},
|
|
192
|
+
image: {
|
|
193
|
+
width: "100%",
|
|
194
|
+
height: "100%"
|
|
195
|
+
},
|
|
196
|
+
initials: {
|
|
197
|
+
fontFamily: import_native.font.family.body,
|
|
198
|
+
fontWeight: import_native.font.weight.semibold
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
function Avatar({ src, alt, name, size = "medium", style }) {
|
|
202
|
+
const { colors: colors2 } = useTheme();
|
|
203
|
+
const { container, fontSize } = sizeMap[size];
|
|
204
|
+
const label = alt ?? name ?? "User avatar";
|
|
205
|
+
if (src) {
|
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
207
|
+
import_react_native4.View,
|
|
208
|
+
{
|
|
209
|
+
style: [styles3.container, { width: container, height: container }, style],
|
|
210
|
+
accessibilityLabel: label,
|
|
211
|
+
accessibilityRole: "image",
|
|
212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Image, { source: { uri: src }, style: styles3.image })
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
const initials = name ? getInitials(name) : "";
|
|
217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
218
|
+
import_react_native4.View,
|
|
219
|
+
{
|
|
220
|
+
style: [
|
|
221
|
+
styles3.container,
|
|
222
|
+
{ width: container, height: container, backgroundColor: colors2.colorBlue },
|
|
223
|
+
style
|
|
224
|
+
],
|
|
225
|
+
accessibilityLabel: label,
|
|
226
|
+
accessibilityRole: "image",
|
|
227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
228
|
+
import_react_native4.Text,
|
|
229
|
+
{
|
|
230
|
+
style: [styles3.initials, { fontSize, color: colors2.colorOnBlue }],
|
|
231
|
+
importantForAccessibility: "no",
|
|
232
|
+
accessibilityElementsHidden: true,
|
|
233
|
+
children: initials
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// src/components/ui/Separator/Separator.native.tsx
|
|
241
|
+
var import_react_native5 = require("react-native");
|
|
242
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
243
|
+
var styles4 = import_react_native5.StyleSheet.create({
|
|
244
|
+
horizontal: {
|
|
245
|
+
height: import_react_native5.StyleSheet.hairlineWidth,
|
|
246
|
+
width: "100%"
|
|
247
|
+
},
|
|
248
|
+
vertical: {
|
|
249
|
+
width: import_react_native5.StyleSheet.hairlineWidth,
|
|
250
|
+
alignSelf: "stretch"
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
function Separator({ orientation = "horizontal", style }) {
|
|
254
|
+
const { colors: colors2 } = useTheme();
|
|
255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
256
|
+
import_react_native5.View,
|
|
257
|
+
{
|
|
258
|
+
accessibilityRole: "none",
|
|
259
|
+
style: [
|
|
260
|
+
orientation === "vertical" ? styles4.vertical : styles4.horizontal,
|
|
261
|
+
{ backgroundColor: colors2.colorBgSubtle },
|
|
262
|
+
style
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/components/ui/Loading/Loading.native.tsx
|
|
269
|
+
var import_react_native6 = require("react-native");
|
|
270
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
271
|
+
var rnSize = {
|
|
272
|
+
small: "small",
|
|
273
|
+
medium: "large",
|
|
274
|
+
large: "large"
|
|
275
|
+
};
|
|
276
|
+
function Loading({ size = "medium", accessibilityLabel = "Loading", style }) {
|
|
277
|
+
const { colors: colors2 } = useTheme();
|
|
278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
279
|
+
import_react_native6.ActivityIndicator,
|
|
280
|
+
{
|
|
281
|
+
size: rnSize[size],
|
|
282
|
+
color: colors2.colorInteractive,
|
|
283
|
+
style,
|
|
284
|
+
accessibilityRole: "progressbar",
|
|
285
|
+
accessibilityLabel
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// src/components/ui/Progress/Progress.native.tsx
|
|
291
|
+
var import_react_native7 = require("react-native");
|
|
292
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
293
|
+
var trackHeight = {
|
|
294
|
+
small: 4,
|
|
295
|
+
medium: 8,
|
|
296
|
+
large: 12
|
|
297
|
+
};
|
|
298
|
+
var styles5 = import_react_native7.StyleSheet.create({
|
|
299
|
+
container: {
|
|
300
|
+
width: "100%"
|
|
301
|
+
},
|
|
302
|
+
labelRow: {
|
|
303
|
+
flexDirection: "row",
|
|
304
|
+
justifyContent: "space-between",
|
|
305
|
+
marginBottom: import_native.spacing.xxs
|
|
306
|
+
},
|
|
307
|
+
labelText: {
|
|
308
|
+
fontSize: import_native.font.size.bodyS,
|
|
309
|
+
fontFamily: import_native.font.family.body,
|
|
310
|
+
lineHeight: lineHeight.bodyS
|
|
311
|
+
},
|
|
312
|
+
track: {
|
|
313
|
+
width: "100%",
|
|
314
|
+
borderRadius: import_native.border.radius.xs,
|
|
315
|
+
overflow: "hidden"
|
|
316
|
+
},
|
|
317
|
+
fill: {
|
|
318
|
+
height: "100%",
|
|
319
|
+
borderRadius: import_native.border.radius.xs
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
function Progress({
|
|
323
|
+
value,
|
|
324
|
+
max = 100,
|
|
325
|
+
label,
|
|
326
|
+
showLabel = false,
|
|
327
|
+
size = "medium",
|
|
328
|
+
style
|
|
329
|
+
}) {
|
|
330
|
+
const { colors: colors2 } = useTheme();
|
|
331
|
+
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
332
|
+
const height = trackHeight[size];
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native7.View, { style: [styles5.container, style], children: [
|
|
334
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native7.View, { style: styles5.labelRow, children: [
|
|
335
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native7.Text, { style: [styles5.labelText, { color: colors2.colorOnBg }], children: label }),
|
|
336
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native7.Text, { style: [styles5.labelText, { color: colors2.colorOnBgSubtle }], children: [
|
|
337
|
+
Math.round(percentage),
|
|
338
|
+
"%"
|
|
339
|
+
] })
|
|
340
|
+
] }),
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
342
|
+
import_react_native7.View,
|
|
343
|
+
{
|
|
344
|
+
style: [styles5.track, { height, backgroundColor: colors2.colorBgSubtle }],
|
|
345
|
+
accessibilityRole: "progressbar",
|
|
346
|
+
accessibilityLabel: label,
|
|
347
|
+
accessibilityValue: { min: 0, max, now: value },
|
|
348
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
349
|
+
import_react_native7.View,
|
|
350
|
+
{
|
|
351
|
+
style: [
|
|
352
|
+
styles5.fill,
|
|
353
|
+
{ width: `${percentage}%`, backgroundColor: colors2.colorInteractive }
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
)
|
|
359
|
+
] });
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// src/components/ui/Skeleton/Skeleton.native.tsx
|
|
363
|
+
var import_react2 = require("react");
|
|
364
|
+
var import_react_native8 = require("react-native");
|
|
365
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
366
|
+
var styles6 = import_react_native8.StyleSheet.create({
|
|
367
|
+
skeleton: {
|
|
368
|
+
borderRadius: 4,
|
|
369
|
+
overflow: "hidden"
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
function Skeleton({ style }) {
|
|
373
|
+
const { colors: colors2 } = useTheme();
|
|
374
|
+
const opacity = (0, import_react2.useRef)(new import_react_native8.Animated.Value(1)).current;
|
|
375
|
+
(0, import_react2.useEffect)(() => {
|
|
376
|
+
const anim = import_react_native8.Animated.loop(
|
|
377
|
+
import_react_native8.Animated.sequence([
|
|
378
|
+
import_react_native8.Animated.timing(opacity, { toValue: 0.4, duration: 700, useNativeDriver: true }),
|
|
379
|
+
import_react_native8.Animated.timing(opacity, { toValue: 1, duration: 700, useNativeDriver: true })
|
|
380
|
+
])
|
|
381
|
+
);
|
|
382
|
+
anim.start();
|
|
383
|
+
return () => anim.stop();
|
|
384
|
+
}, [opacity]);
|
|
385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
386
|
+
import_react_native8.Animated.View,
|
|
387
|
+
{
|
|
388
|
+
importantForAccessibility: "no-hide-descendants",
|
|
389
|
+
style: [
|
|
390
|
+
styles6.skeleton,
|
|
391
|
+
{ backgroundColor: colors2.colorBgSubtle, opacity },
|
|
392
|
+
style
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// src/components/ui/Alert/Alert.native.tsx
|
|
399
|
+
var import_react_native9 = require("react-native");
|
|
400
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
401
|
+
var styles7 = import_react_native9.StyleSheet.create({
|
|
402
|
+
alert: {
|
|
403
|
+
flexDirection: "row",
|
|
404
|
+
alignItems: "flex-start",
|
|
405
|
+
padding: import_native.spacing.m,
|
|
406
|
+
borderRadius: import_native.border.radius.s,
|
|
407
|
+
gap: import_native.spacing.xs
|
|
408
|
+
},
|
|
409
|
+
icon: {
|
|
410
|
+
flexShrink: 0,
|
|
411
|
+
marginTop: 2
|
|
412
|
+
},
|
|
413
|
+
content: {
|
|
414
|
+
flex: 1,
|
|
415
|
+
gap: import_native.spacing.xxs
|
|
416
|
+
},
|
|
417
|
+
title: {
|
|
418
|
+
fontSize: import_native.font.size.body,
|
|
419
|
+
fontFamily: import_native.font.family.body,
|
|
420
|
+
fontWeight: import_native.font.weight.semibold,
|
|
421
|
+
lineHeight: lineHeight.body
|
|
422
|
+
},
|
|
423
|
+
body: {
|
|
424
|
+
fontSize: import_native.font.size.bodyS,
|
|
425
|
+
fontFamily: import_native.font.family.body,
|
|
426
|
+
lineHeight: lineHeight.bodyS
|
|
427
|
+
},
|
|
428
|
+
dismiss: {
|
|
429
|
+
padding: import_native.spacing.xxs,
|
|
430
|
+
flexShrink: 0
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
function Alert({
|
|
434
|
+
variant = "info",
|
|
435
|
+
icon,
|
|
436
|
+
title,
|
|
437
|
+
children,
|
|
438
|
+
onDismiss,
|
|
439
|
+
style
|
|
440
|
+
}) {
|
|
441
|
+
const { colors: colors2 } = useTheme();
|
|
442
|
+
const isUrgent = variant === "error" || variant === "warning";
|
|
443
|
+
const variantColors = {
|
|
444
|
+
info: { bg: colors2.colorBlueSubtle, text: colors2.colorOnBlueSubtle },
|
|
445
|
+
success: { bg: colors2.colorSuccessSubtle, text: colors2.colorOnSuccessSubtle },
|
|
446
|
+
warning: { bg: colors2.colorOrangeSubtle, text: colors2.colorOnOrangeSubtle },
|
|
447
|
+
error: { bg: colors2.colorRedSubtle, text: colors2.colorOnRedSubtle }
|
|
448
|
+
};
|
|
449
|
+
const { bg, text } = variantColors[variant];
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
451
|
+
import_react_native9.View,
|
|
452
|
+
{
|
|
453
|
+
accessibilityRole: isUrgent ? "alert" : "none",
|
|
454
|
+
accessibilityLiveRegion: isUrgent ? "assertive" : "polite",
|
|
455
|
+
style: [styles7.alert, { backgroundColor: bg }, style],
|
|
456
|
+
children: [
|
|
457
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.View, { style: styles7.icon, children: icon }),
|
|
458
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native9.View, { style: styles7.content, children: [
|
|
459
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.Text, { style: [styles7.title, { color: text }], children: title }),
|
|
460
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.Text, { style: [styles7.body, { color: text }], children })
|
|
461
|
+
] }),
|
|
462
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
463
|
+
import_react_native9.Pressable,
|
|
464
|
+
{
|
|
465
|
+
onPress: onDismiss,
|
|
466
|
+
style: styles7.dismiss,
|
|
467
|
+
accessibilityLabel: "Dismiss alert",
|
|
468
|
+
accessibilityRole: "button",
|
|
469
|
+
hitSlop: 8,
|
|
470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.Text, { style: { color: text, fontSize: 16 }, children: "\u2715" })
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// src/components/ui/NotificationBanner/NotificationBanner.native.tsx
|
|
479
|
+
var import_react_native10 = require("react-native");
|
|
480
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
481
|
+
var styles8 = import_react_native10.StyleSheet.create({
|
|
482
|
+
banner: {
|
|
483
|
+
flexDirection: "row",
|
|
484
|
+
alignItems: "center",
|
|
485
|
+
paddingVertical: import_native.spacing.s,
|
|
486
|
+
paddingHorizontal: import_native.spacing.m,
|
|
487
|
+
gap: import_native.spacing.xs
|
|
488
|
+
},
|
|
489
|
+
content: {
|
|
490
|
+
flex: 1,
|
|
491
|
+
fontSize: import_native.font.size.bodyS,
|
|
492
|
+
fontFamily: import_native.font.family.body,
|
|
493
|
+
lineHeight: lineHeight.bodyS
|
|
494
|
+
},
|
|
495
|
+
dismiss: {
|
|
496
|
+
padding: import_native.spacing.xxs,
|
|
497
|
+
flexShrink: 0
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
function NotificationBanner({
|
|
501
|
+
variant = "info",
|
|
502
|
+
children,
|
|
503
|
+
action,
|
|
504
|
+
onDismiss,
|
|
505
|
+
style
|
|
506
|
+
}) {
|
|
507
|
+
const { colors: colors2 } = useTheme();
|
|
508
|
+
const isUrgent = variant === "error" || variant === "warning";
|
|
509
|
+
const variantColors = {
|
|
510
|
+
info: { bg: colors2.colorBlueSubtle, text: colors2.colorOnBlueSubtle },
|
|
511
|
+
success: { bg: colors2.colorSuccessSubtle, text: colors2.colorOnSuccessSubtle },
|
|
512
|
+
warning: { bg: colors2.colorOrangeSubtle, text: colors2.colorOnOrangeSubtle },
|
|
513
|
+
error: { bg: colors2.colorRedSubtle, text: colors2.colorOnRedSubtle }
|
|
514
|
+
};
|
|
515
|
+
const { bg, text } = variantColors[variant];
|
|
516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
517
|
+
import_react_native10.View,
|
|
518
|
+
{
|
|
519
|
+
accessibilityRole: isUrgent ? "alert" : "none",
|
|
520
|
+
accessibilityLiveRegion: isUrgent ? "assertive" : "polite",
|
|
521
|
+
style: [styles8.banner, { backgroundColor: bg }, style],
|
|
522
|
+
children: [
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.Text, { style: [styles8.content, { color: text }], children }),
|
|
524
|
+
action,
|
|
525
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
526
|
+
import_react_native10.Pressable,
|
|
527
|
+
{
|
|
528
|
+
onPress: onDismiss,
|
|
529
|
+
style: styles8.dismiss,
|
|
530
|
+
accessibilityLabel: "Dismiss notification",
|
|
531
|
+
accessibilityRole: "button",
|
|
532
|
+
hitSlop: 8,
|
|
533
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.Text, { style: { color: text, fontSize: 16 }, children: "\u2715" })
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// src/components/layout/Card/Card.native.tsx
|
|
542
|
+
var import_react_native11 = require("react-native");
|
|
543
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
544
|
+
var paddingMap = {
|
|
545
|
+
none: 0,
|
|
546
|
+
small: import_native.spacing.s,
|
|
547
|
+
medium: import_native.spacing.m,
|
|
548
|
+
large: import_native.spacing.xxl
|
|
549
|
+
};
|
|
550
|
+
var alignMap = {
|
|
551
|
+
start: "flex-start",
|
|
552
|
+
center: "center",
|
|
553
|
+
end: "flex-end"
|
|
554
|
+
};
|
|
555
|
+
var styles9 = import_react_native11.StyleSheet.create({
|
|
556
|
+
card: {
|
|
557
|
+
borderRadius: import_native.border.radius.s,
|
|
558
|
+
overflow: "hidden"
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
function Card({
|
|
562
|
+
children,
|
|
563
|
+
variant = "default",
|
|
564
|
+
padding = "medium",
|
|
565
|
+
textAlign = "start",
|
|
566
|
+
style,
|
|
567
|
+
onPress,
|
|
568
|
+
accessibilityLabel
|
|
569
|
+
}) {
|
|
570
|
+
const { colors: colors2 } = useTheme();
|
|
571
|
+
const variantStyle = {
|
|
572
|
+
backgroundColor: colors2.colorBg,
|
|
573
|
+
...variant === "elevated" && {
|
|
574
|
+
shadowColor: "#000",
|
|
575
|
+
shadowOffset: { width: 0, height: 2 },
|
|
576
|
+
shadowOpacity: 0.1,
|
|
577
|
+
shadowRadius: 8,
|
|
578
|
+
elevation: 4
|
|
579
|
+
},
|
|
580
|
+
...variant === "outlined" && {
|
|
581
|
+
borderWidth: 1,
|
|
582
|
+
borderColor: colors2.colorBgSubtle
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
const inner = {
|
|
586
|
+
padding: paddingMap[padding],
|
|
587
|
+
alignItems: alignMap[textAlign]
|
|
588
|
+
};
|
|
589
|
+
if (onPress) {
|
|
590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
591
|
+
import_react_native11.Pressable,
|
|
592
|
+
{
|
|
593
|
+
onPress,
|
|
594
|
+
accessibilityRole: "button",
|
|
595
|
+
accessibilityLabel,
|
|
596
|
+
style: ({ pressed }) => [styles9.card, variantStyle, inner, pressed && { opacity: 0.8 }, style],
|
|
597
|
+
children
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native11.View, { style: [styles9.card, variantStyle, inner, style], children });
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// src/components/layout/SectionHeader/SectionHeader.native.tsx
|
|
605
|
+
var import_react_native12 = require("react-native");
|
|
606
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
607
|
+
var alignMap2 = {
|
|
608
|
+
start: "flex-start",
|
|
609
|
+
center: "center",
|
|
610
|
+
end: "flex-end"
|
|
611
|
+
};
|
|
612
|
+
var titleStyles = import_react_native12.StyleSheet.create({
|
|
613
|
+
small: {
|
|
614
|
+
fontSize: import_native.font.size.heading3,
|
|
615
|
+
fontFamily: import_native.font.family.heading,
|
|
616
|
+
fontWeight: import_native.font.weight.heading,
|
|
617
|
+
lineHeight: lineHeight.heading3
|
|
618
|
+
},
|
|
619
|
+
medium: {
|
|
620
|
+
fontSize: import_native.font.size.heading2,
|
|
621
|
+
fontFamily: import_native.font.family.heading,
|
|
622
|
+
fontWeight: import_native.font.weight.heading,
|
|
623
|
+
lineHeight: lineHeight.heading2
|
|
624
|
+
},
|
|
625
|
+
large: {
|
|
626
|
+
fontSize: import_native.font.size.heading1,
|
|
627
|
+
fontFamily: import_native.font.family.heading,
|
|
628
|
+
fontWeight: import_native.font.weight.heading,
|
|
629
|
+
lineHeight: lineHeight.heading1
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
var styles10 = import_react_native12.StyleSheet.create({
|
|
633
|
+
container: {
|
|
634
|
+
gap: import_native.spacing.xxs
|
|
635
|
+
},
|
|
636
|
+
subtitle: {
|
|
637
|
+
fontSize: import_native.font.size.bodyS,
|
|
638
|
+
fontFamily: import_native.font.family.body,
|
|
639
|
+
lineHeight: lineHeight.bodyS
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
function SectionHeader({
|
|
643
|
+
title,
|
|
644
|
+
subtitle,
|
|
645
|
+
alignment = "start",
|
|
646
|
+
size = "medium",
|
|
647
|
+
style
|
|
648
|
+
}) {
|
|
649
|
+
const { colors: colors2 } = useTheme();
|
|
650
|
+
const align = alignMap2[alignment];
|
|
651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native12.View, { style: [styles10.container, { alignItems: align }, style], children: [
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
653
|
+
import_react_native12.Text,
|
|
654
|
+
{
|
|
655
|
+
accessibilityRole: "header",
|
|
656
|
+
style: [titleStyles[size], { color: colors2.colorOnBg }],
|
|
657
|
+
children: title
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native12.Text, { style: [styles10.subtitle, { color: colors2.colorOnBgSubtle }], children: subtitle })
|
|
661
|
+
] });
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// src/components/layout/IconWrapper/IconWrapper.native.tsx
|
|
665
|
+
var import_react_native13 = require("react-native");
|
|
666
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
667
|
+
function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
669
|
+
import_react_native13.View,
|
|
670
|
+
{
|
|
671
|
+
style: [{ alignItems: "center", justifyContent: "center" }, style],
|
|
672
|
+
importantForAccessibility: accessibilityElementsHidden ? "no-hide-descendants" : "auto",
|
|
673
|
+
accessibilityElementsHidden,
|
|
674
|
+
children
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// src/components/layout/ButtonGroup/ButtonGroup.native.tsx
|
|
680
|
+
var import_react_native14 = require("react-native");
|
|
681
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
682
|
+
var styles11 = import_react_native14.StyleSheet.create({
|
|
683
|
+
group: {
|
|
684
|
+
flexDirection: "row",
|
|
685
|
+
flexWrap: "wrap",
|
|
686
|
+
gap: import_native.spacing.xs
|
|
687
|
+
},
|
|
688
|
+
column: {
|
|
689
|
+
flexDirection: "column",
|
|
690
|
+
gap: import_native.spacing.xs
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
function ButtonGroup({ children, variant, accessibilityLabel, style }) {
|
|
694
|
+
const isColumn = variant === "card" || variant === "modal";
|
|
695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
696
|
+
import_react_native14.View,
|
|
697
|
+
{
|
|
698
|
+
accessibilityLabel,
|
|
699
|
+
style: [isColumn ? styles11.column : styles11.group, style],
|
|
700
|
+
children
|
|
701
|
+
}
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// src/components/interaction/Button/Button.native.tsx
|
|
706
|
+
var import_react_native15 = require("react-native");
|
|
707
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
708
|
+
var sizeTokens = {
|
|
709
|
+
small: { height: 36, px: import_native.spacing.m, fontSize: import_native.font.size.bodyS, radius: import_native.border.radius.xs },
|
|
710
|
+
medium: { height: 48, px: import_native.spacing.m, fontSize: import_native.font.size.body, radius: import_native.border.radius.s },
|
|
711
|
+
large: { height: 56, px: import_native.spacing.xxl, fontSize: import_native.font.size.heading3, radius: import_native.border.radius.m }
|
|
712
|
+
};
|
|
713
|
+
var styles12 = import_react_native15.StyleSheet.create({
|
|
714
|
+
pressable: {
|
|
715
|
+
flexDirection: "row",
|
|
716
|
+
alignItems: "center",
|
|
717
|
+
justifyContent: "center",
|
|
718
|
+
gap: import_native.spacing.xs,
|
|
719
|
+
alignSelf: "flex-start"
|
|
720
|
+
},
|
|
721
|
+
label: {
|
|
722
|
+
fontFamily: import_native.font.family.body,
|
|
723
|
+
fontWeight: import_native.font.weight.semibold,
|
|
724
|
+
includeFontPadding: false
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
function Button({
|
|
728
|
+
children,
|
|
729
|
+
variant = "default",
|
|
730
|
+
size = "medium",
|
|
731
|
+
iconStart,
|
|
732
|
+
iconEnd,
|
|
733
|
+
disabled = false,
|
|
734
|
+
onPress,
|
|
735
|
+
accessibilityLabel,
|
|
736
|
+
style
|
|
737
|
+
}) {
|
|
738
|
+
const { colors: colors2 } = useTheme();
|
|
739
|
+
const { height, px, fontSize, radius } = sizeTokens[size];
|
|
740
|
+
const primaryColor = colors2.colorGreen;
|
|
741
|
+
const onPrimaryColor = colors2.colorOnGreen;
|
|
742
|
+
const ghostTextColor = colors2.colorGreenStrong;
|
|
743
|
+
const containerStyle = {
|
|
744
|
+
height,
|
|
745
|
+
paddingHorizontal: px,
|
|
746
|
+
borderRadius: radius,
|
|
747
|
+
opacity: disabled ? 0.4 : 1,
|
|
748
|
+
...variant === "default" && { backgroundColor: primaryColor },
|
|
749
|
+
...variant === "ghost" && {
|
|
750
|
+
backgroundColor: "transparent",
|
|
751
|
+
borderWidth: 1,
|
|
752
|
+
borderColor: ghostTextColor
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
const textColor = variant === "default" ? onPrimaryColor : ghostTextColor;
|
|
756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
757
|
+
import_react_native15.Pressable,
|
|
758
|
+
{
|
|
759
|
+
onPress,
|
|
760
|
+
disabled,
|
|
761
|
+
accessibilityRole: "button",
|
|
762
|
+
accessibilityLabel,
|
|
763
|
+
accessibilityState: { disabled },
|
|
764
|
+
style: ({ pressed }) => [styles12.pressable, containerStyle, pressed && { opacity: 0.75 }, style],
|
|
765
|
+
children: [
|
|
766
|
+
iconStart && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native15.View, { importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, children: iconStart }),
|
|
767
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native15.Text, { style: [styles12.label, { fontSize, color: textColor }], children }),
|
|
768
|
+
iconEnd && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native15.View, { importantForAccessibility: "no-hide-descendants", children: iconEnd })
|
|
769
|
+
]
|
|
770
|
+
}
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// src/components/interaction/form/Switch/Switch.native.tsx
|
|
775
|
+
var import_react_native18 = require("react-native");
|
|
776
|
+
|
|
777
|
+
// src/components/interaction/form/atoms/Label.native.tsx
|
|
778
|
+
var import_react_native16 = require("react-native");
|
|
779
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
780
|
+
function Label({ label, style }) {
|
|
781
|
+
const { colors: colors2 } = useTheme();
|
|
782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
783
|
+
import_react_native16.Text,
|
|
784
|
+
{
|
|
785
|
+
style: [
|
|
786
|
+
{
|
|
787
|
+
fontFamily: import_native.font.family.body,
|
|
788
|
+
fontSize: import_native.font.size.body,
|
|
789
|
+
lineHeight: lineHeight.body,
|
|
790
|
+
fontWeight: import_native.font.weight.semibold,
|
|
791
|
+
color: colors2.colorOnBg
|
|
792
|
+
},
|
|
793
|
+
style
|
|
794
|
+
],
|
|
795
|
+
children: label
|
|
796
|
+
}
|
|
797
|
+
);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// src/components/interaction/form/atoms/Message.native.tsx
|
|
801
|
+
var import_react_native17 = require("react-native");
|
|
802
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
803
|
+
var styles13 = import_react_native17.StyleSheet.create({
|
|
804
|
+
base: {
|
|
805
|
+
fontFamily: import_native.font.family.body,
|
|
806
|
+
fontSize: import_native.font.size.bodyS,
|
|
807
|
+
lineHeight: lineHeight.bodyS
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
function Message({ message, type, style }) {
|
|
811
|
+
const { colors: colors2 } = useTheme();
|
|
812
|
+
if (!message) return null;
|
|
813
|
+
const color = type === "error" ? colors2.colorError : colors2.colorOnBgSubtle;
|
|
814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
815
|
+
import_react_native17.Text,
|
|
816
|
+
{
|
|
817
|
+
accessibilityRole: type === "error" ? "alert" : "none",
|
|
818
|
+
accessibilityLiveRegion: type === "error" ? "assertive" : "polite",
|
|
819
|
+
style: [styles13.base, { color }, style],
|
|
820
|
+
children: message
|
|
821
|
+
}
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
// src/components/interaction/form/Switch/Switch.native.tsx
|
|
826
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
827
|
+
var styles14 = import_react_native18.StyleSheet.create({
|
|
828
|
+
container: {
|
|
829
|
+
gap: import_native.spacing.xxs
|
|
830
|
+
},
|
|
831
|
+
row: {
|
|
832
|
+
flexDirection: "row",
|
|
833
|
+
alignItems: "center",
|
|
834
|
+
gap: import_native.spacing.xs
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
function Switch({
|
|
838
|
+
label,
|
|
839
|
+
value = false,
|
|
840
|
+
onChange,
|
|
841
|
+
disabled = false,
|
|
842
|
+
error,
|
|
843
|
+
hint,
|
|
844
|
+
style
|
|
845
|
+
}) {
|
|
846
|
+
const { colors: colors2 } = useTheme();
|
|
847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native18.View, { style: [styles14.container, style], children: [
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native18.View, { style: styles14.row, children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
850
|
+
import_react_native18.Switch,
|
|
851
|
+
{
|
|
852
|
+
value,
|
|
853
|
+
onValueChange: onChange,
|
|
854
|
+
disabled,
|
|
855
|
+
accessibilityLabel: label,
|
|
856
|
+
accessibilityRole: "switch",
|
|
857
|
+
accessibilityState: { checked: value, disabled },
|
|
858
|
+
thumbColor: value ? colors2.colorOnInteractive : colors2.colorOnBg,
|
|
859
|
+
trackColor: { false: colors2.colorBgSubtle, true: colors2.colorInteractive }
|
|
860
|
+
}
|
|
861
|
+
),
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Label, { label })
|
|
863
|
+
] }),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Message, { type: "error", message: error }),
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Message, { type: "hint", message: hint })
|
|
866
|
+
] });
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// src/components/interaction/form/Checkbox/Checkbox.native.tsx
|
|
870
|
+
var import_react_native19 = require("react-native");
|
|
871
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
872
|
+
var BOX = 22;
|
|
873
|
+
var styles15 = import_react_native19.StyleSheet.create({
|
|
874
|
+
container: {
|
|
875
|
+
gap: import_native.spacing.xxs
|
|
876
|
+
},
|
|
877
|
+
row: {
|
|
878
|
+
flexDirection: "row",
|
|
879
|
+
alignItems: "center",
|
|
880
|
+
gap: import_native.spacing.xs,
|
|
881
|
+
minHeight: 44
|
|
882
|
+
},
|
|
883
|
+
box: {
|
|
884
|
+
width: BOX,
|
|
885
|
+
height: BOX,
|
|
886
|
+
borderRadius: import_native.border.radius.xs,
|
|
887
|
+
borderWidth: 2,
|
|
888
|
+
alignItems: "center",
|
|
889
|
+
justifyContent: "center"
|
|
890
|
+
},
|
|
891
|
+
checkmark: {
|
|
892
|
+
fontSize: 14,
|
|
893
|
+
fontWeight: "700",
|
|
894
|
+
lineHeight: 16
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
function Checkbox({
|
|
898
|
+
label,
|
|
899
|
+
name,
|
|
900
|
+
checked = false,
|
|
901
|
+
onChange,
|
|
902
|
+
disabled = false,
|
|
903
|
+
error,
|
|
904
|
+
hint,
|
|
905
|
+
style
|
|
906
|
+
}) {
|
|
907
|
+
const { colors: colors2 } = useTheme();
|
|
908
|
+
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorBgSubtle;
|
|
909
|
+
const bgColor = checked ? colors2.colorInteractive : "transparent";
|
|
910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native19.View, { style: [styles15.container, style], children: [
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
912
|
+
import_react_native19.Pressable,
|
|
913
|
+
{
|
|
914
|
+
onPress: () => !disabled && onChange?.(!checked),
|
|
915
|
+
accessibilityRole: "checkbox",
|
|
916
|
+
accessibilityLabel: typeof label === "string" ? label : name,
|
|
917
|
+
accessibilityState: { checked, disabled },
|
|
918
|
+
disabled,
|
|
919
|
+
style: ({ pressed }) => [styles15.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
920
|
+
children: [
|
|
921
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native19.View, { style: [styles15.box, { borderColor, backgroundColor: bgColor }], children: checked && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Label, { label: "\u2713", style: [styles15.checkmark, { color: colors2.colorOnInteractive }] }) }),
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Label, { label })
|
|
923
|
+
]
|
|
924
|
+
}
|
|
925
|
+
),
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Message, { type: "error", message: error }),
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Message, { type: "hint", message: hint })
|
|
928
|
+
] });
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// src/components/interaction/form/Radio/Radio.native.tsx
|
|
932
|
+
var import_react_native20 = require("react-native");
|
|
933
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
934
|
+
var DOT = 22;
|
|
935
|
+
var INNER = 10;
|
|
936
|
+
var styles16 = import_react_native20.StyleSheet.create({
|
|
937
|
+
container: {
|
|
938
|
+
gap: import_native.spacing.xxs
|
|
939
|
+
},
|
|
940
|
+
row: {
|
|
941
|
+
flexDirection: "row",
|
|
942
|
+
alignItems: "center",
|
|
943
|
+
gap: import_native.spacing.xs,
|
|
944
|
+
minHeight: 44
|
|
945
|
+
},
|
|
946
|
+
outer: {
|
|
947
|
+
width: DOT,
|
|
948
|
+
height: DOT,
|
|
949
|
+
borderRadius: DOT / 2,
|
|
950
|
+
borderWidth: 2,
|
|
951
|
+
alignItems: "center",
|
|
952
|
+
justifyContent: "center"
|
|
953
|
+
},
|
|
954
|
+
inner: {
|
|
955
|
+
width: INNER,
|
|
956
|
+
height: INNER,
|
|
957
|
+
borderRadius: INNER / 2
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
function Radio({
|
|
961
|
+
label,
|
|
962
|
+
name,
|
|
963
|
+
checked = false,
|
|
964
|
+
onChange,
|
|
965
|
+
disabled = false,
|
|
966
|
+
error,
|
|
967
|
+
hint,
|
|
968
|
+
style
|
|
969
|
+
}) {
|
|
970
|
+
const { colors: colors2 } = useTheme();
|
|
971
|
+
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorBgSubtle;
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native20.View, { style: [styles16.container, style], children: [
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
974
|
+
import_react_native20.Pressable,
|
|
975
|
+
{
|
|
976
|
+
onPress: () => !disabled && onChange?.(),
|
|
977
|
+
accessibilityRole: "radio",
|
|
978
|
+
accessibilityLabel: typeof label === "string" ? label : name,
|
|
979
|
+
accessibilityState: { checked, disabled },
|
|
980
|
+
disabled,
|
|
981
|
+
style: ({ pressed }) => [styles16.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
982
|
+
children: [
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native20.View, { style: [styles16.outer, { borderColor }], children: checked && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native20.View, { style: [styles16.inner, { backgroundColor: colors2.colorInteractive }] }) }),
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Label, { label })
|
|
985
|
+
]
|
|
986
|
+
}
|
|
987
|
+
),
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Message, { type: "error", message: error }),
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Message, { type: "hint", message: hint })
|
|
990
|
+
] });
|
|
991
|
+
}
|