@ponti-studios/ui 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -3
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +3 -0
- package/dist/components/data-display/accordion.d.ts +10 -0
- package/dist/components/data-display/accordion.js +53 -0
- package/{src/components/data-display/index.ts → dist/components/data-display/index.d.ts} +1 -10
- package/dist/components/data-display/index.js +8 -0
- package/dist/components/data-display/metric-card.d.ts +9 -0
- package/dist/components/data-display/metric-card.js +25 -0
- package/dist/components/data-display/sort-controls.d.ts +13 -0
- package/dist/components/data-display/sort-controls.js +57 -0
- package/dist/components/data-display/sort-row.d.ts +10 -0
- package/dist/components/data-display/sort-row.js +52 -0
- package/dist/components/data-display/table.d.ts +10 -0
- package/dist/components/data-display/table.js +57 -0
- package/dist/components/feedback/alert.d.ts +9 -0
- package/dist/components/feedback/alert.js +38 -0
- package/dist/components/feedback/empty-state.d.ts +18 -0
- package/dist/components/feedback/empty-state.js +36 -0
- package/{src/components/feedback/index.ts → dist/components/feedback/index.d.ts} +2 -0
- package/dist/components/feedback/index.js +7 -0
- package/dist/components/feedback/progress.d.ts +6 -0
- package/dist/components/feedback/progress.js +25 -0
- package/dist/components/feedback/skeleton.d.ts +2 -0
- package/dist/components/feedback/skeleton.js +11 -0
- package/dist/components/feedback/spinner.d.ts +14 -0
- package/dist/components/feedback/spinner.js +27 -0
- package/dist/components/feedback/update-guard.d.ts +13 -0
- package/dist/components/feedback/update-guard.js +38 -0
- package/dist/components/filters/active-filters-bar.d.ts +14 -0
- package/dist/components/filters/active-filters-bar.js +44 -0
- package/dist/components/filters/filter-chip.d.ts +11 -0
- package/dist/components/filters/filter-chip.js +33 -0
- package/dist/components/filters/filter-select.d.ts +17 -0
- package/dist/components/filters/filter-select.js +46 -0
- package/dist/components/filters/index.js +4 -0
- package/dist/components/forms/checkbox.d.ts +4 -0
- package/dist/components/forms/checkbox.js +24 -0
- package/dist/components/forms/date-month-select.d.ts +11 -0
- package/dist/components/forms/date-month-select.js +47 -0
- package/dist/components/forms/date-picker.d.ts +60 -0
- package/dist/components/forms/date-picker.js +193 -0
- package/dist/components/forms/date-utils.d.ts +14 -0
- package/dist/components/forms/date-utils.js +18 -0
- package/dist/components/forms/drop-zone.d.ts +42 -0
- package/dist/components/forms/drop-zone.js +184 -0
- package/{src/components/forms/index.ts → dist/components/forms/index.d.ts} +3 -9
- package/dist/components/forms/index.js +17 -0
- package/dist/components/forms/input.d.ts +3 -0
- package/dist/components/forms/input.js +15 -0
- package/dist/components/forms/label.d.ts +3 -0
- package/dist/components/forms/label.js +14 -0
- package/dist/components/forms/passkey-management.d.ts +14 -0
- package/dist/components/forms/passkey-management.js +132 -0
- package/dist/components/forms/radio-group.d.ts +6 -0
- package/dist/components/forms/radio-group.js +28 -0
- package/dist/components/forms/select.d.ts +18 -0
- package/dist/components/forms/select.js +103 -0
- package/dist/components/forms/slider.d.ts +9 -0
- package/dist/components/forms/slider.js +25 -0
- package/dist/components/forms/stepper.d.ts +15 -0
- package/dist/components/forms/stepper.js +41 -0
- package/dist/components/forms/switch.d.ts +6 -0
- package/dist/components/forms/switch.js +21 -0
- package/dist/components/forms/text-field.d.ts +15 -0
- package/dist/components/forms/text-field.js +46 -0
- package/dist/components/forms/text-field.types.d.ts +8 -0
- package/dist/components/forms/textarea.d.ts +3 -0
- package/dist/components/forms/textarea.js +14 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/layout/particle-background.d.ts +19 -0
- package/dist/components/layout/particle-background.js +171 -0
- package/dist/components/layout/scroll-area.d.ts +9 -0
- package/dist/components/layout/scroll-area.js +35 -0
- package/dist/components/layout/section-intro.d.ts +12 -0
- package/dist/components/layout/section-intro.js +28 -0
- package/dist/components/layout/surface-panel.d.ts +7 -0
- package/dist/components/layout/surface-panel.js +11 -0
- package/dist/components/navigation/app-navigation.d.ts +67 -0
- package/dist/components/navigation/app-navigation.js +106 -0
- package/{src/components/navigation/index.ts → dist/components/navigation/index.d.ts} +1 -7
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/pagination-controls.d.ts +7 -0
- package/dist/components/navigation/pagination-controls.js +50 -0
- package/dist/components/navigation/tabs.d.ts +7 -0
- package/dist/components/navigation/tabs.js +35 -0
- package/dist/components/overlays/bottom-sheet.d.ts +20 -0
- package/dist/components/overlays/bottom-sheet.js +101 -0
- package/dist/components/overlays/command.d.ts +29 -0
- package/dist/components/overlays/command.js +123 -0
- package/dist/components/overlays/dialog.d.ts +30 -0
- package/dist/components/overlays/dialog.js +105 -0
- package/dist/components/overlays/dropdown-menu.d.ts +29 -0
- package/dist/components/overlays/dropdown-menu.js +128 -0
- package/dist/components/overlays/index.d.ts +7 -0
- package/dist/components/overlays/index.js +8 -0
- package/dist/components/overlays/popover.d.ts +14 -0
- package/dist/components/overlays/popover.js +56 -0
- package/dist/components/overlays/sheet.d.ts +27 -0
- package/dist/components/overlays/sheet.js +81 -0
- package/dist/components/overlays/tooltip.d.ts +10 -0
- package/dist/components/overlays/tooltip.js +23 -0
- package/dist/components/primitives/avatar.d.ts +14 -0
- package/dist/components/primitives/avatar.js +72 -0
- package/dist/components/primitives/badge.d.ts +7 -0
- package/dist/components/primitives/badge.js +27 -0
- package/dist/components/primitives/button.d.ts +13 -0
- package/dist/components/primitives/button.js +113 -0
- package/{src/components/primitives/button.types.ts → dist/components/primitives/button.types.d.ts} +4 -6
- package/dist/components/primitives/card.d.ts +9 -0
- package/dist/components/primitives/card.js +56 -0
- package/{src/components/primitives/index.ts → dist/components/primitives/index.d.ts} +1 -9
- package/dist/components/primitives/index.js +7 -0
- package/dist/components/primitives/segmented-control.d.ts +20 -0
- package/dist/components/primitives/segmented-control.js +27 -0
- package/dist/components/primitives/separator.d.ts +4 -0
- package/dist/components/primitives/separator.js +16 -0
- package/dist/constants/chart-colors.d.ts +33 -0
- package/dist/constants/chart-colors.js +31 -0
- package/dist/hooks/index.js +9 -0
- package/{src/hooks/sort.types.ts → dist/hooks/sort.types.d.ts} +2 -4
- package/dist/hooks/use-api-client.d.ts +30 -0
- package/dist/hooks/use-api-client.js +106 -0
- package/dist/hooks/use-debounced-value.d.ts +1 -0
- package/dist/hooks/use-debounced-value.js +12 -0
- package/dist/hooks/use-derived-filter-state.d.ts +20 -0
- package/dist/hooks/use-derived-filter-state.js +39 -0
- package/dist/hooks/use-filter-state.d.ts +12 -0
- package/dist/hooks/use-filter-state.js +37 -0
- package/dist/hooks/use-media-query.d.ts +6 -0
- package/dist/hooks/use-media-query.js +27 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/hooks/use-sort.d.ts +11 -0
- package/dist/hooks/use-sort.js +14 -0
- package/{src/index.ts → dist/index.d.ts} +4 -32
- package/dist/index.js +15 -0
- package/dist/integrations/service-worker.d.ts +2 -0
- package/dist/integrations/service-worker.js +2 -0
- package/dist/lib/auth.d.ts +2 -0
- package/dist/lib/auth.js +7 -0
- package/dist/lib/clipboard.d.ts +1 -0
- package/dist/lib/clipboard.js +10 -0
- package/dist/lib/index.js +4 -0
- package/{src/lib/slot.tsx → dist/lib/slot.d.ts} +2 -15
- package/dist/lib/slot.js +14 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/native/components.d.ts +41 -0
- package/dist/native/components.js +135 -0
- package/dist/native/index.js +3 -0
- package/dist/native/theme.d.ts +19 -0
- package/dist/native/theme.js +58 -0
- package/dist/styles/tokens/css-vars.d.ts +7 -0
- package/dist/styles/tokens/css-vars.js +5 -0
- package/dist/styles/tokens/generated/dark.colors.generated.d.ts +40 -0
- package/dist/styles/tokens/generated/dark.colors.generated.js +39 -0
- package/dist/styles/tokens/generated/foundations.generated.d.ts +323 -0
- package/dist/styles/tokens/generated/foundations.generated.js +453 -0
- package/dist/styles/tokens/generated/light.colors.generated.d.ts +40 -0
- package/dist/styles/tokens/generated/light.colors.generated.js +39 -0
- package/dist/styles/tokens/index.d.ts +317 -0
- package/dist/styles/tokens/index.js +14 -0
- package/dist/styles.css +1 -1
- package/dist/translations/en.d.ts +34 -0
- package/dist/translations/index.d.ts +39 -0
- package/dist/translations/ui-provider.d.ts +9 -0
- package/dist/translations/ui-provider.js +16 -0
- package/dist/types/upload.d.ts +36 -0
- package/package.json +50 -33
- package/src/components/data-display/accordion.stories.tsx +0 -57
- package/src/components/data-display/accordion.tsx +0 -86
- package/src/components/data-display/metric-card.stories.tsx +0 -48
- package/src/components/data-display/metric-card.tsx +0 -20
- package/src/components/data-display/sort-controls.stories.tsx +0 -45
- package/src/components/data-display/sort-controls.tsx +0 -96
- package/src/components/data-display/sort-row.tsx +0 -88
- package/src/components/data-display/table.stories.tsx +0 -75
- package/src/components/data-display/table.tsx +0 -80
- package/src/components/feedback/alert.stories.tsx +0 -51
- package/src/components/feedback/alert.tsx +0 -64
- package/src/components/feedback/empty-state.tsx +0 -76
- package/src/components/feedback/progress.stories.tsx +0 -54
- package/src/components/feedback/progress.tsx +0 -41
- package/src/components/feedback/skeleton.stories.tsx +0 -36
- package/src/components/feedback/skeleton.tsx +0 -7
- package/src/components/feedback/spinner.stories.tsx +0 -52
- package/src/components/feedback/spinner.tsx +0 -47
- package/src/components/feedback/update-guard.stories.tsx +0 -28
- package/src/components/feedback/update-guard.tsx +0 -57
- package/src/components/filters/active-filters-bar.stories.tsx +0 -114
- package/src/components/filters/active-filters-bar.tsx +0 -61
- package/src/components/filters/filter-chip.tsx +0 -57
- package/src/components/filters/filter-select.stories.tsx +0 -71
- package/src/components/filters/filter-select.tsx +0 -68
- package/src/components/forms/checkbox.stories.tsx +0 -35
- package/src/components/forms/checkbox.tsx +0 -38
- package/src/components/forms/date-month-select.stories.tsx +0 -26
- package/src/components/forms/date-month-select.tsx +0 -79
- package/src/components/forms/date-picker.stories.tsx +0 -188
- package/src/components/forms/date-picker.tsx +0 -303
- package/src/components/forms/date-utils.ts +0 -37
- package/src/components/forms/drop-zone.stories.tsx +0 -140
- package/src/components/forms/drop-zone.tsx +0 -298
- package/src/components/forms/input.stories.tsx +0 -47
- package/src/components/forms/input.tsx +0 -24
- package/src/components/forms/label.stories.tsx +0 -16
- package/src/components/forms/label.tsx +0 -25
- package/src/components/forms/passkey-management.stories.tsx +0 -85
- package/src/components/forms/passkey-management.tsx +0 -168
- package/src/components/forms/radio-group.stories.tsx +0 -46
- package/src/components/forms/radio-group.tsx +0 -44
- package/src/components/forms/select.stories.tsx +0 -207
- package/src/components/forms/select.tsx +0 -182
- package/src/components/forms/slider.stories.tsx +0 -70
- package/src/components/forms/slider.tsx +0 -50
- package/src/components/forms/stepper.stories.tsx +0 -111
- package/src/components/forms/stepper.tsx +0 -66
- package/src/components/forms/switch.stories.tsx +0 -144
- package/src/components/forms/switch.tsx +0 -39
- package/src/components/forms/text-field.stories.tsx +0 -87
- package/src/components/forms/text-field.tsx +0 -75
- package/src/components/forms/text-field.types.ts +0 -9
- package/src/components/forms/textarea.stories.tsx +0 -150
- package/src/components/forms/textarea.tsx +0 -22
- package/src/components/layout/particle-background.stories.tsx +0 -38
- package/src/components/layout/particle-background.tsx +0 -378
- package/src/components/layout/scroll-area.stories.tsx +0 -91
- package/src/components/layout/scroll-area.tsx +0 -79
- package/src/components/layout/section-intro.stories.tsx +0 -29
- package/src/components/layout/section-intro.tsx +0 -31
- package/src/components/layout/surface-panel.stories.tsx +0 -32
- package/src/components/layout/surface-panel.tsx +0 -23
- package/src/components/navigation/app-navigation.stories.tsx +0 -217
- package/src/components/navigation/app-navigation.tsx +0 -234
- package/src/components/navigation/pagination-controls.stories.tsx +0 -41
- package/src/components/navigation/pagination-controls.tsx +0 -46
- package/src/components/navigation/tabs.stories.tsx +0 -48
- package/src/components/navigation/tabs.tsx +0 -52
- package/src/components/overlays/bottom-sheet.stories.tsx +0 -52
- package/src/components/overlays/bottom-sheet.tsx +0 -179
- package/src/components/overlays/command.stories.tsx +0 -65
- package/src/components/overlays/command.tsx +0 -227
- package/src/components/overlays/dialog.stories.tsx +0 -148
- package/src/components/overlays/dialog.tsx +0 -203
- package/src/components/overlays/dropdown-menu.stories.tsx +0 -74
- package/src/components/overlays/dropdown-menu.tsx +0 -236
- package/src/components/overlays/index.ts +0 -56
- package/src/components/overlays/popover.stories.tsx +0 -51
- package/src/components/overlays/popover.tsx +0 -78
- package/src/components/overlays/sheet.stories.tsx +0 -68
- package/src/components/overlays/sheet.tsx +0 -155
- package/src/components/overlays/tooltip.stories.tsx +0 -29
- package/src/components/overlays/tooltip.tsx +0 -41
- package/src/components/primitives/avatar-placeholder.svg +0 -13
- package/src/components/primitives/avatar.stories.tsx +0 -72
- package/src/components/primitives/avatar.tsx +0 -136
- package/src/components/primitives/badge.stories.tsx +0 -43
- package/src/components/primitives/badge.tsx +0 -43
- package/src/components/primitives/button.stories.tsx +0 -113
- package/src/components/primitives/button.tsx +0 -131
- package/src/components/primitives/card.stories.tsx +0 -59
- package/src/components/primitives/card.tsx +0 -66
- package/src/components/primitives/segmented-control.stories.tsx +0 -54
- package/src/components/primitives/segmented-control.tsx +0 -73
- package/src/components/primitives/separator.stories.tsx +0 -34
- package/src/components/primitives/separator.tsx +0 -27
- package/src/constants/chart-colors.ts +0 -39
- package/src/env.d.ts +0 -9
- package/src/hooks/use-api-client.ts +0 -122
- package/src/hooks/use-debounced-value.ts +0 -12
- package/src/hooks/use-derived-filter-state.ts +0 -70
- package/src/hooks/use-filter-state.ts +0 -66
- package/src/hooks/use-media-query.ts +0 -69
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-sort.ts +0 -20
- package/src/lib/auth.ts +0 -5
- package/src/lib/clipboard.ts +0 -8
- package/src/lib/utils.ts +0 -6
- package/src/native/components.tsx +0 -198
- package/src/native/theme.tsx +0 -69
- package/src/storybook/controls.ts +0 -117
- package/src/storybook/options.ts +0 -52
- package/src/styles/build.ts +0 -1
- package/src/styles/index.css +0 -423
- package/src/styles/nokia.css +0 -36
- package/src/styles/package.css +0 -3
- package/src/styles/tokens/chart-colors.stories.tsx +0 -189
- package/src/styles/tokens/color-systems.stories.tsx +0 -190
- package/src/styles/tokens/css-vars.ts +0 -15
- package/src/styles/tokens/generated/dark-class.css +0 -39
- package/src/styles/tokens/generated/dark.colors.generated.ts +0 -39
- package/src/styles/tokens/generated/dark.css +0 -39
- package/src/styles/tokens/generated/foundations.css +0 -149
- package/src/styles/tokens/generated/foundations.generated.ts +0 -454
- package/src/styles/tokens/generated/light.colors.generated.ts +0 -39
- package/src/styles/tokens/generated/light.css +0 -39
- package/src/styles/tokens/index.ts +0 -70
- package/src/styles/tokens/layout.stories.tsx +0 -50
- package/src/styles/tokens/scripts/check-foundations.mjs +0 -126
- package/src/styles/tokens/scripts/check-source.mjs +0 -53
- package/src/styles/tokens/source/dark.tokens.json +0 -138
- package/src/styles/tokens/source/foundations.tokens.json +0 -344
- package/src/styles/tokens/source/light.tokens.json +0 -138
- package/src/styles/tokens/style-dictionary.dark-class.json +0 -16
- package/src/styles/tokens/style-dictionary.dark-storybook.json +0 -16
- package/src/styles/tokens/style-dictionary.dark.json +0 -21
- package/src/styles/tokens/style-dictionary.foundations.json +0 -21
- package/src/styles/tokens/style-dictionary.light-storybook.json +0 -16
- package/src/styles/tokens/style-dictionary.light.json +0 -21
- package/src/styles/tokens/typography.stories.tsx +0 -157
- package/src/translations/en.ts +0 -34
- package/src/translations/index.ts +0 -32
- package/src/types/upload.ts +0 -42
- /package/{src/components/filters/index.ts → dist/components/filters/index.d.ts} +0 -0
- /package/{src/components/layout/index.ts → dist/components/layout/index.d.ts} +0 -0
- /package/{src/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
- /package/{src/lib/index.ts → dist/lib/index.d.ts} +0 -0
- /package/{src/native/index.ts → dist/native/index.d.ts} +0 -0
package/dist/lib/auth.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
-
import type { ReactElement } from "react";
|
|
3
1
|
import * as React from "react";
|
|
4
|
-
|
|
5
2
|
export interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
|
|
3
|
+
children?: React.ReactNode;
|
|
7
4
|
}
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Generic `asChild` primitive: merges the props it receives onto its single
|
|
11
7
|
* child instead of rendering its own DOM element. Lets compound components
|
|
@@ -17,13 +13,4 @@ export interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
17
13
|
* event handlers chain instead of one overwriting the other, and
|
|
18
14
|
* `className`/`style` merge instead of replacing.
|
|
19
15
|
*/
|
|
20
|
-
export const Slot
|
|
21
|
-
if (!React.isValidElement(children)) return null;
|
|
22
|
-
const child = children as ReactElement<Record<string, unknown>>;
|
|
23
|
-
const merged = mergeProps<"div">(
|
|
24
|
-
props as React.ComponentPropsWithRef<"div">,
|
|
25
|
-
child.props as React.ComponentPropsWithRef<"div">,
|
|
26
|
-
);
|
|
27
|
-
return React.cloneElement(child, { ...merged, ref } as Record<string, unknown>);
|
|
28
|
-
});
|
|
29
|
-
Slot.displayName = "Slot";
|
|
16
|
+
export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
package/dist/lib/slot.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { mergeProps as t } from "@base-ui/react/merge-props";
|
|
3
|
+
//#region src/lib/slot.tsx
|
|
4
|
+
var n = e.forwardRef(({ children: n, ...r }, i) => {
|
|
5
|
+
if (!e.isValidElement(n)) return null;
|
|
6
|
+
let a = n, o = t(r, a.props);
|
|
7
|
+
return e.cloneElement(a, {
|
|
8
|
+
...o,
|
|
9
|
+
ref: i
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
n.displayName = "Slot";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as Slot };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
import { type PressableProps, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
export type NativeButtonVariant = "primary" | "secondary" | "ghost" | "destructive";
|
|
4
|
+
export type NativeButtonSize = "small" | "medium" | "large";
|
|
5
|
+
export interface NativeButtonProps {
|
|
6
|
+
label: string;
|
|
7
|
+
onPress: PressableProps["onPress"];
|
|
8
|
+
variant?: NativeButtonVariant;
|
|
9
|
+
size?: NativeButtonSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
accessibilityLabel?: string;
|
|
13
|
+
accessibilityHint?: string;
|
|
14
|
+
leading?: ReactNode;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
}
|
|
17
|
+
export declare function NativeButton({ label, onPress, variant, size, disabled, loading, accessibilityLabel, accessibilityHint, leading, style, }: NativeButtonProps): React.JSX.Element;
|
|
18
|
+
export interface NativeSurfaceProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
tone?: "card" | "muted" | "background";
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
}
|
|
23
|
+
export declare function NativeSurface({ children, tone, style }: NativeSurfaceProps): React.JSX.Element;
|
|
24
|
+
export type NativeBadgeVariant = "default" | "secondary" | "accent" | "success" | "warning" | "destructive";
|
|
25
|
+
export interface NativeBadgeProps {
|
|
26
|
+
label: string;
|
|
27
|
+
variant?: NativeBadgeVariant;
|
|
28
|
+
accessibilityLabel?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function NativeBadge({ label, variant, accessibilityLabel }: NativeBadgeProps): React.JSX.Element;
|
|
31
|
+
export interface NativeTabItem<Value extends string = string> {
|
|
32
|
+
value: Value;
|
|
33
|
+
label: string;
|
|
34
|
+
accessibilityLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface NativeTabBarProps<Value extends string> {
|
|
37
|
+
items: readonly NativeTabItem<Value>[];
|
|
38
|
+
value: Value;
|
|
39
|
+
onChange: (value: Value) => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function NativeTabBar<Value extends string>({ items, value, onChange }: NativeTabBarProps<Value>): React.JSX.Element;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { useNativeTheme as e } from "./theme.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { Pressable as r, Text as i, View as a } from "react-native";
|
|
5
|
+
//#region src/native/components.tsx
|
|
6
|
+
function o({ label: a, onPress: o, variant: c = "primary", size: l = "medium", disabled: u = !1, loading: d = !1, accessibilityLabel: f, accessibilityHint: p, leading: m, style: h }) {
|
|
7
|
+
let { colors: g, spacing: _, textSizes: v, fontWeights: y, radii: b } = e(), x = u || d, [S, C] = x ? [g.muted, g.tertiary] : s(c, g), w = l === "small" ? _[2] : l === "large" ? _[4] : _[3], T = l === "small" ? _[3] : _[4], E = l === "small" ? v.sm : l === "large" ? v.lg : v.base;
|
|
8
|
+
return /* @__PURE__ */ n(r, {
|
|
9
|
+
accessibilityRole: "button",
|
|
10
|
+
accessibilityLabel: f ?? a,
|
|
11
|
+
accessibilityHint: p,
|
|
12
|
+
accessibilityState: {
|
|
13
|
+
disabled: x,
|
|
14
|
+
busy: d
|
|
15
|
+
},
|
|
16
|
+
disabled: x,
|
|
17
|
+
onPress: o,
|
|
18
|
+
style: [{
|
|
19
|
+
minHeight: l === "large" ? _[14] : _[12],
|
|
20
|
+
paddingHorizontal: T,
|
|
21
|
+
paddingVertical: w,
|
|
22
|
+
borderRadius: b.lg,
|
|
23
|
+
backgroundColor: S,
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
flexDirection: "row",
|
|
27
|
+
gap: _[2]
|
|
28
|
+
}, h],
|
|
29
|
+
children: [m, /* @__PURE__ */ t(i, {
|
|
30
|
+
style: {
|
|
31
|
+
color: C,
|
|
32
|
+
fontSize: E,
|
|
33
|
+
fontWeight: y.semibold
|
|
34
|
+
},
|
|
35
|
+
children: a
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function s(e, t) {
|
|
40
|
+
switch (e) {
|
|
41
|
+
case "primary": return [t.primary, t["primary-foreground"]];
|
|
42
|
+
case "destructive": return [t.destructive, t["destructive-foreground"]];
|
|
43
|
+
case "secondary": return [t.secondary, t["text-primary"]];
|
|
44
|
+
case "ghost": return ["transparent", t["text-primary"]];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function c({ children: n, tone: r = "card", style: i }) {
|
|
48
|
+
let { colors: o, spacing: s, radii: c } = e();
|
|
49
|
+
return /* @__PURE__ */ t(a, {
|
|
50
|
+
style: [{
|
|
51
|
+
backgroundColor: r === "muted" ? o.muted : r === "background" ? o.background : o.card,
|
|
52
|
+
borderColor: o["border-default"],
|
|
53
|
+
borderWidth: s.px,
|
|
54
|
+
borderRadius: c.xl,
|
|
55
|
+
padding: s[4],
|
|
56
|
+
gap: s[2]
|
|
57
|
+
}, i],
|
|
58
|
+
children: n
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function l({ label: n, variant: r = "default", accessibilityLabel: o }) {
|
|
62
|
+
let { colors: s, spacing: c, textSizes: l, fontWeights: d, radii: f } = e(), [p, m] = u(r, s);
|
|
63
|
+
return /* @__PURE__ */ t(a, {
|
|
64
|
+
accessibilityRole: "text",
|
|
65
|
+
accessibilityLabel: o ?? n,
|
|
66
|
+
style: {
|
|
67
|
+
alignSelf: "flex-start",
|
|
68
|
+
paddingHorizontal: c[2],
|
|
69
|
+
paddingVertical: c[1],
|
|
70
|
+
borderRadius: f.full,
|
|
71
|
+
backgroundColor: p
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ t(i, {
|
|
74
|
+
style: {
|
|
75
|
+
color: m,
|
|
76
|
+
fontSize: l.sm,
|
|
77
|
+
fontWeight: d.medium
|
|
78
|
+
},
|
|
79
|
+
children: n
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function u(e, t) {
|
|
84
|
+
switch (e) {
|
|
85
|
+
case "secondary": return [t.secondary, t["text-primary"]];
|
|
86
|
+
case "accent": return [t.accent, t["text-primary"]];
|
|
87
|
+
case "success": return [t.success, t["success-foreground"]];
|
|
88
|
+
case "warning": return [t.warning, t["warning-foreground"]];
|
|
89
|
+
case "destructive": return [t.destructive, t["destructive-foreground"]];
|
|
90
|
+
case "default": return [t.primary, t["primary-foreground"]];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function d({ items: n, value: o, onChange: s }) {
|
|
94
|
+
let { colors: c, spacing: l, textSizes: u, fontWeights: d, radii: f } = e();
|
|
95
|
+
return /* @__PURE__ */ t(a, {
|
|
96
|
+
accessibilityRole: "tablist",
|
|
97
|
+
style: {
|
|
98
|
+
flexDirection: "row",
|
|
99
|
+
backgroundColor: c.card,
|
|
100
|
+
borderTopColor: c["border-default"],
|
|
101
|
+
borderTopWidth: l.px,
|
|
102
|
+
padding: l[2],
|
|
103
|
+
gap: l[1]
|
|
104
|
+
},
|
|
105
|
+
children: n.map((e) => {
|
|
106
|
+
let n = e.value === o;
|
|
107
|
+
return /* @__PURE__ */ t(r, {
|
|
108
|
+
accessibilityRole: "tab",
|
|
109
|
+
accessibilityLabel: e.accessibilityLabel ?? e.label,
|
|
110
|
+
accessibilityState: { selected: n },
|
|
111
|
+
onPress: () => s(e.value),
|
|
112
|
+
style: ({ pressed: e }) => ({
|
|
113
|
+
flex: 1,
|
|
114
|
+
minHeight: l[12],
|
|
115
|
+
paddingHorizontal: l[2],
|
|
116
|
+
paddingVertical: l[2],
|
|
117
|
+
borderRadius: f.lg,
|
|
118
|
+
backgroundColor: n ? c.accent : e ? c.secondary : c.card,
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
justifyContent: "center"
|
|
121
|
+
}),
|
|
122
|
+
children: /* @__PURE__ */ t(i, {
|
|
123
|
+
style: {
|
|
124
|
+
color: n ? c["text-primary"] : c["text-secondary"],
|
|
125
|
+
fontSize: u.sm,
|
|
126
|
+
fontWeight: n ? d.semibold : d.normal
|
|
127
|
+
},
|
|
128
|
+
children: e.label
|
|
129
|
+
})
|
|
130
|
+
}, e.value);
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { l as NativeBadge, o as NativeButton, c as NativeSurface, d as NativeTabBar };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NativeThemeProvider as e, useNativeTheme as t } from "./theme.js";
|
|
2
|
+
import { NativeBadge as n, NativeButton as r, NativeSurface as i, NativeTabBar as a } from "./components.js";
|
|
3
|
+
export { n as NativeBadge, r as NativeButton, i as NativeSurface, a as NativeTabBar, e as NativeThemeProvider, t as useNativeTheme };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type TextStyle } from "react-native";
|
|
3
|
+
import { fontWeights, radii, spacing, textLineHeights, textSizes, type ColorMode, type ColorTheme } from "../styles/tokens";
|
|
4
|
+
export type NativeColorPreference = ColorMode | "system";
|
|
5
|
+
export interface NativeTheme {
|
|
6
|
+
mode: ColorMode;
|
|
7
|
+
colors: ColorTheme;
|
|
8
|
+
spacing: typeof spacing;
|
|
9
|
+
textSizes: typeof textSizes;
|
|
10
|
+
textLineHeights: typeof textLineHeights;
|
|
11
|
+
fontWeights: Readonly<Record<keyof typeof fontWeights, NonNullable<TextStyle["fontWeight"]>>>;
|
|
12
|
+
radii: typeof radii;
|
|
13
|
+
}
|
|
14
|
+
export interface NativeThemeProviderProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
colorPreference?: NativeColorPreference;
|
|
17
|
+
}
|
|
18
|
+
export declare function NativeThemeProvider({ children, colorPreference }: NativeThemeProviderProps): React.JSX.Element;
|
|
19
|
+
export declare function useNativeTheme(): NativeTheme;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { colorThemes as e, fontWeights as t, radii as n, spacing as r, textLineHeights as i, textSizes as a } from "../styles/tokens/index.js";
|
|
2
|
+
import { createContext as o, useContext as s, useMemo as c } from "react";
|
|
3
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
4
|
+
import { useColorScheme as u } from "react-native";
|
|
5
|
+
//#region src/native/theme.tsx
|
|
6
|
+
function d(e) {
|
|
7
|
+
switch (t[e]) {
|
|
8
|
+
case "100": return "100";
|
|
9
|
+
case "200": return "200";
|
|
10
|
+
case "300": return "300";
|
|
11
|
+
case "400": return "400";
|
|
12
|
+
case "500": return "500";
|
|
13
|
+
case "600": return "600";
|
|
14
|
+
case "700": return "700";
|
|
15
|
+
case "800": return "800";
|
|
16
|
+
case "900": return "900";
|
|
17
|
+
default: throw Error(`Unsupported native font-weight token: ${t[e]}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
var f = {
|
|
21
|
+
thin: d("thin"),
|
|
22
|
+
extralight: d("extralight"),
|
|
23
|
+
light: d("light"),
|
|
24
|
+
normal: d("normal"),
|
|
25
|
+
medium: d("medium"),
|
|
26
|
+
semibold: d("semibold"),
|
|
27
|
+
bold: d("bold"),
|
|
28
|
+
extrabold: d("extrabold"),
|
|
29
|
+
black: d("black")
|
|
30
|
+
}, p = o({
|
|
31
|
+
mode: "light",
|
|
32
|
+
colors: e.light,
|
|
33
|
+
spacing: r,
|
|
34
|
+
textSizes: a,
|
|
35
|
+
textLineHeights: i,
|
|
36
|
+
fontWeights: f,
|
|
37
|
+
radii: n
|
|
38
|
+
});
|
|
39
|
+
function m({ children: t, colorPreference: o = "system" }) {
|
|
40
|
+
let s = u(), d = o === "system" ? s === "dark" ? "dark" : "light" : o, m = c(() => ({
|
|
41
|
+
mode: d,
|
|
42
|
+
colors: e[d],
|
|
43
|
+
spacing: r,
|
|
44
|
+
textSizes: a,
|
|
45
|
+
textLineHeights: i,
|
|
46
|
+
fontWeights: f,
|
|
47
|
+
radii: n
|
|
48
|
+
}), [d]);
|
|
49
|
+
return /* @__PURE__ */ l(p.Provider, {
|
|
50
|
+
value: m,
|
|
51
|
+
children: t
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function h() {
|
|
55
|
+
return s(p);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { m as NativeThemeProvider, h as useNativeTheme };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color tokens as CSS `var()` references, for consumers whose runtime resolves
|
|
3
|
+
* the CSS cascade (i.e. web). Kept out of `./tokens` because React Native has
|
|
4
|
+
* no cascade — a `var(--token)` string there fails silently, rendering as an
|
|
5
|
+
* unparseable color rather than throwing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const colors: Record<"accent" | "accent-foreground" | "background" | "border-default" | "card" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-negative" | "chart-neutral" | "chart-positive" | "control-border" | "destructive" | "destructive-foreground" | "focus-ring" | "muted" | "overlay-scrim" | "popover" | "primary" | "primary-foreground" | "secondary" | "success" | "success-foreground" | "tertiary" | "text-accent" | "text-destructive" | "text-primary" | "text-secondary" | "text-success" | "text-warning" | "warning" | "warning-foreground", `var(--${string})`>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: {
|
|
5
|
+
background: string;
|
|
6
|
+
card: string;
|
|
7
|
+
secondary: string;
|
|
8
|
+
popover: string;
|
|
9
|
+
muted: string;
|
|
10
|
+
"text-primary": string;
|
|
11
|
+
"text-secondary": string;
|
|
12
|
+
tertiary: string;
|
|
13
|
+
primary: string;
|
|
14
|
+
accent: string;
|
|
15
|
+
destructive: string;
|
|
16
|
+
success: string;
|
|
17
|
+
warning: string;
|
|
18
|
+
"text-success": string;
|
|
19
|
+
"text-warning": string;
|
|
20
|
+
"success-foreground": string;
|
|
21
|
+
"warning-foreground": string;
|
|
22
|
+
"primary-foreground": string;
|
|
23
|
+
"accent-foreground": string;
|
|
24
|
+
"destructive-foreground": string;
|
|
25
|
+
"text-destructive": string;
|
|
26
|
+
"text-accent": string;
|
|
27
|
+
"border-default": string;
|
|
28
|
+
"control-border": string;
|
|
29
|
+
"focus-ring": string;
|
|
30
|
+
"chart-1": string;
|
|
31
|
+
"chart-2": string;
|
|
32
|
+
"chart-3": string;
|
|
33
|
+
"chart-4": string;
|
|
34
|
+
"chart-5": string;
|
|
35
|
+
"chart-positive": string;
|
|
36
|
+
"chart-negative": string;
|
|
37
|
+
"chart-neutral": string;
|
|
38
|
+
"overlay-scrim": string;
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/styles/tokens/generated/dark.colors.generated.ts
|
|
2
|
+
var e = {
|
|
3
|
+
background: "#0a0a0a",
|
|
4
|
+
card: "#111111",
|
|
5
|
+
secondary: "#1a1a1a",
|
|
6
|
+
popover: "#111111",
|
|
7
|
+
muted: "#141414",
|
|
8
|
+
"text-primary": "#fafafa",
|
|
9
|
+
"text-secondary": "#a3a3a3",
|
|
10
|
+
tertiary: "#a3a3a3",
|
|
11
|
+
primary: "#ededed",
|
|
12
|
+
accent: "#1e293b",
|
|
13
|
+
destructive: "#dc2626",
|
|
14
|
+
success: "#22c55e",
|
|
15
|
+
warning: "#f59e0b",
|
|
16
|
+
"text-success": "#4ade80",
|
|
17
|
+
"text-warning": "#fcd34d",
|
|
18
|
+
"success-foreground": "#0a0a0a",
|
|
19
|
+
"warning-foreground": "#0a0a0a",
|
|
20
|
+
"primary-foreground": "#0a0a0a",
|
|
21
|
+
"accent-foreground": "#93c5fd",
|
|
22
|
+
"destructive-foreground": "#ffffff",
|
|
23
|
+
"text-destructive": "#fca5a5",
|
|
24
|
+
"text-accent": "#60a5fa",
|
|
25
|
+
"border-default": "#262626",
|
|
26
|
+
"control-border": "#707070",
|
|
27
|
+
"focus-ring": "#3b82f6",
|
|
28
|
+
"chart-1": "#3b82f6",
|
|
29
|
+
"chart-2": "#ededed",
|
|
30
|
+
"chart-3": "#737373",
|
|
31
|
+
"chart-4": "#93c5fd",
|
|
32
|
+
"chart-5": "#3f3f46",
|
|
33
|
+
"chart-positive": "#22c55e",
|
|
34
|
+
"chart-negative": "#ef4444",
|
|
35
|
+
"chart-neutral": "#a3a3a3",
|
|
36
|
+
"overlay-scrim": "#000000"
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { e as default };
|