@lssm/lib.ui-kit 1.7.4 → 1.9.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 +82 -0
- package/dist/node_modules/react-hook-form/dist/index.esm.js +27 -16
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -1
- package/dist/node_modules/zod/v4/core/core.js.map +1 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -2
- package/dist/node_modules/zod/v4/core/registries.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/accordion.js +4 -4
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts +11 -11
- package/dist/ui/alert-dialog.js +9 -9
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts +4 -4
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +3 -3
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +3 -3
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.js +1 -1
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/breadcrumb.js +6 -6
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts +7 -7
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +6 -6
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/checkbox.d.ts +3 -3
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/collapsible.d.ts +8 -8
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/context-menu.d.ts +16 -16
- package/dist/ui/context-menu.js +9 -9
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/date-picker.d.ts +2 -2
- package/dist/ui/date-range-picker.d.ts +2 -2
- package/dist/ui/datetime-picker.d.ts +2 -2
- package/dist/ui/dialog.d.ts +10 -10
- package/dist/ui/dialog.js +7 -7
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/dropdown-menu.js +9 -9
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/empty-state.d.ts +4 -4
- package/dist/ui/empty-state.d.ts.map +1 -1
- package/dist/ui/empty.d.ts +9 -9
- package/dist/ui/empty.d.ts.map +1 -1
- package/dist/ui/empty.js +6 -6
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/fab.d.ts +3 -3
- package/dist/ui/fab.d.ts.map +1 -1
- package/dist/ui/field.d.ts +14 -14
- package/dist/ui/field.d.ts.map +1 -1
- package/dist/ui/field.js +10 -11
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/form.d.ts +7 -7
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +5 -6
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts +6 -6
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/input.d.ts +2 -2
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/link.d.ts +2 -2
- package/dist/ui/link.d.ts.map +1 -1
- package/dist/ui/link.js +1 -1
- package/dist/ui/link.js.map +1 -1
- package/dist/ui/loading-button.d.ts +2 -2
- package/dist/ui/loading-button.d.ts.map +1 -1
- package/dist/ui/loading-button.js +1 -1
- package/dist/ui/loading-button.js.map +1 -1
- package/dist/ui/loading-overlay.d.ts +2 -2
- package/dist/ui/loading-overlay.d.ts.map +1 -1
- package/dist/ui/loading-screen.d.ts +2 -2
- package/dist/ui/marketing/FeatureGrid.d.ts +2 -2
- package/dist/ui/marketing/Hero.d.ts +2 -2
- package/dist/ui/marketing/PricingTable.d.ts +2 -2
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +11 -11
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/molecules/SkeletonList.d.ts +2 -2
- package/dist/ui/navigation-menu.d.ts +12 -12
- package/dist/ui/navigation-menu.js +6 -6
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +2 -2
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +0 -1
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/dist/ui/organisms/ListPage/ListPage.d.ts +2 -2
- package/dist/ui/page-header.d.ts +4 -4
- package/dist/ui/page-header.d.ts.map +1 -1
- package/dist/ui/password-strength.d.ts +2 -2
- package/dist/ui/popover.d.ts +6 -6
- package/dist/ui/popover.js +1 -1
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/progress.js +1 -1
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/radio-group.js +2 -2
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/select.d.ts +13 -13
- package/dist/ui/select.js +7 -7
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.d.ts +2 -2
- package/dist/ui/separator.js +1 -1
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/stack.d.ts +4 -4
- package/dist/ui/stack.js +3 -3
- package/dist/ui/stack.js.map +1 -1
- package/dist/ui/stepper.d.ts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/switch.js +2 -2
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.d.ts +8 -8
- package/dist/ui/table.js +7 -7
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +11 -11
- package/dist/ui/tabs.js +3 -3
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text.d.ts +2 -2
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/text.js +1 -1
- package/dist/ui/text.js.map +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/time-picker.d.ts +2 -2
- package/dist/ui/time-picker.d.ts.map +1 -1
- package/dist/ui/toggle-group.d.ts +4 -4
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +3 -3
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.d.ts +6 -6
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +2 -2
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.d.ts +6 -6
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/typography.d.ts +12 -12
- package/dist/ui/typography.d.ts.map +1 -1
- package/dist/ui/typography.js +11 -11
- package/dist/ui/typography.js.map +1 -1
- package/dist/ui/useColorScheme.d.ts +2 -2
- package/dist/ui/useColorScheme.d.ts.map +1 -1
- package/dist/ui/usecases/UseCaseCard.d.ts +2 -2
- package/dist/ui/usecases/UserStoryCard.d.ts +2 -2
- package/dist/ui/usecases/UserStoryCard.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/ui/popover.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as PopoverPrimitive from "@rn-primitives/popover";
|
|
|
8
8
|
//#region ui/popover.tsx
|
|
9
9
|
const Popover = PopoverPrimitive.Root;
|
|
10
10
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
11
|
-
function PopoverContent({ className, align = "center", sideOffset = 4, portalHost
|
|
11
|
+
function PopoverContent({ className, align = "center", sideOffset = 4, portalHost, ...props }) {
|
|
12
12
|
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, {
|
|
13
13
|
hostName: portalHost,
|
|
14
14
|
children: /* @__PURE__ */ jsx(PopoverPrimitive.Overlay, {
|
package/dist/ui/popover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":[],"sources":["../../ui/popover.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@rn-primitives/popover';\nimport { Platform, StyleSheet } from 'react-native';\nimport Animated, { FadeIn, FadeOut } from 'react-native-reanimated';\nimport { cn } from './utils';\nimport { TextClassContext } from './text';\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n portalHost,\n ...props\n}: PopoverPrimitive.ContentProps & {\n ref?: React.RefObject<PopoverPrimitive.ContentRef>;\n portalHost?: string;\n}) {\n return (\n <PopoverPrimitive.Portal hostName={portalHost}>\n <PopoverPrimitive.Overlay\n style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}\n >\n <Animated.View entering={FadeIn.duration(200)} exiting={FadeOut}>\n <TextClassContext.Provider value=\"text-popover-foreground\">\n <PopoverPrimitive.Content\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'border-border bg-popover shadow-foreground/5 web:cursor-auto web:outline-hidden web:animate-in web:fade-in-0 web:zoom-in-95 web:data-[side=bottom]:slide-in-from-top-2 web:data-[side=left]:slide-in-from-right-2 web:data-[side=right]:slide-in-from-left-2 web:data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md',\n className\n )}\n {...props}\n />\n </TextClassContext.Provider>\n </Animated.View>\n </PopoverPrimitive.Overlay>\n </PopoverPrimitive.Portal>\n );\n}\n\nexport { Popover, PopoverContent, PopoverTrigger };\n"],"mappings":";;;;;;;;AAMA,MAAM,UAAU,iBAAiB;AAEjC,MAAM,iBAAiB,iBAAiB;AAExC,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,aAAa,GACb,
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../ui/popover.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@rn-primitives/popover';\nimport { Platform, StyleSheet } from 'react-native';\nimport Animated, { FadeIn, FadeOut } from 'react-native-reanimated';\nimport { cn } from './utils';\nimport { TextClassContext } from './text';\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n portalHost,\n ...props\n}: PopoverPrimitive.ContentProps & {\n ref?: React.RefObject<PopoverPrimitive.ContentRef>;\n portalHost?: string;\n}) {\n return (\n <PopoverPrimitive.Portal hostName={portalHost}>\n <PopoverPrimitive.Overlay\n style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}\n >\n <Animated.View entering={FadeIn.duration(200)} exiting={FadeOut}>\n <TextClassContext.Provider value=\"text-popover-foreground\">\n <PopoverPrimitive.Content\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'border-border bg-popover shadow-foreground/5 web:cursor-auto web:outline-hidden web:animate-in web:fade-in-0 web:zoom-in-95 web:data-[side=bottom]:slide-in-from-top-2 web:data-[side=left]:slide-in-from-right-2 web:data-[side=right]:slide-in-from-left-2 web:data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md',\n className\n )}\n {...props}\n />\n </TextClassContext.Provider>\n </Animated.View>\n </PopoverPrimitive.Overlay>\n </PopoverPrimitive.Portal>\n );\n}\n\nexport { Popover, PopoverContent, PopoverTrigger };\n"],"mappings":";;;;;;;;AAMA,MAAM,UAAU,iBAAiB;AAEjC,MAAM,iBAAiB,iBAAiB;AAExC,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,aAAa,GACb,YACA,GAAG,SAIF;AACD,QACE,oBAAC,iBAAiB;EAAO,UAAU;YACjC,oBAAC,iBAAiB;GAChB,OAAO,SAAS,OAAO,QAAQ,WAAW,eAAe;aAEzD,oBAAC,SAAS;IAAK,UAAU,OAAO,SAAS,IAAI;IAAE,SAAS;cACtD,oBAAC,iBAAiB;KAAS,OAAM;eAC/B,oBAAC,iBAAiB;MACT;MACK;MACZ,WAAW,GACT,qVACA,UACD;MACD,GAAI;OACJ;MACwB;KACd;IACS;GACH"}
|
package/dist/ui/progress.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime144 from "react/jsx-runtime";
|
|
3
3
|
import * as ProgressPrimitive from "@rn-primitives/progress";
|
|
4
4
|
|
|
5
5
|
//#region ui/progress.d.ts
|
|
@@ -11,7 +11,7 @@ declare function Progress({
|
|
|
11
11
|
}: ProgressPrimitive.RootProps & {
|
|
12
12
|
ref?: React$1.RefObject<ProgressPrimitive.RootRef>;
|
|
13
13
|
indicatorClassName?: string;
|
|
14
|
-
}):
|
|
14
|
+
}): react_jsx_runtime144.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Progress };
|
|
17
17
|
//# sourceMappingURL=progress.d.ts.map
|
package/dist/ui/progress.js
CHANGED
|
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
import * as ProgressPrimitive from "@rn-primitives/progress";
|
|
7
7
|
|
|
8
8
|
//#region ui/progress.tsx
|
|
9
|
-
function Progress({ className, value, indicatorClassName
|
|
9
|
+
function Progress({ className, value, indicatorClassName, ...props }) {
|
|
10
10
|
return /* @__PURE__ */ jsx(ProgressPrimitive.Root, {
|
|
11
11
|
className: cn("bg-secondary relative h-4 w-full overflow-hidden rounded-full", className),
|
|
12
12
|
...props,
|
package/dist/ui/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":[],"sources":["../../ui/progress.tsx"],"sourcesContent":["import * as ProgressPrimitive from '@rn-primitives/progress';\nimport * as React from 'react';\nimport { Platform, View } from 'react-native';\nimport Animated, {\n Extrapolation,\n interpolate,\n useAnimatedStyle,\n useDerivedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport { cn } from './utils';\n\nfunction Progress({\n className,\n value,\n indicatorClassName,\n ...props\n}: ProgressPrimitive.RootProps & {\n ref?: React.RefObject<ProgressPrimitive.RootRef>;\n indicatorClassName?: string;\n}) {\n return (\n <ProgressPrimitive.Root\n className={cn(\n 'bg-secondary relative h-4 w-full overflow-hidden rounded-full',\n className\n )}\n {...props}\n >\n <Indicator value={value} className={indicatorClassName} />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n\nfunction Indicator({\n value,\n className,\n}: {\n value: number | undefined | null;\n className?: string;\n}) {\n const progress = useDerivedValue(() => value ?? 0);\n\n const indicator = useAnimatedStyle(() => {\n return {\n width: withSpring(\n `${interpolate(progress.value, [0, 100], [1, 100], Extrapolation.CLAMP)}%`,\n { overshootClamping: true }\n ),\n };\n });\n\n if (Platform.OS === 'web') {\n return (\n <View\n className={cn(\n 'bg-primary web:transition-all h-full w-full flex-1',\n className\n )}\n style={{ transform: `translateX(-${100 - (value ?? 0)}%)` }}\n >\n <ProgressPrimitive.Indicator\n className={cn('h-full w-full', className)}\n />\n </View>\n );\n }\n\n return (\n <ProgressPrimitive.Indicator asChild>\n <Animated.View\n style={indicator}\n className={cn('bg-foreground h-full', className)}\n />\n </ProgressPrimitive.Indicator>\n );\n}\n"],"mappings":";;;;;;;;AAYA,SAAS,SAAS,EAChB,WACA,OACA,
|
|
1
|
+
{"version":3,"file":"progress.js","names":[],"sources":["../../ui/progress.tsx"],"sourcesContent":["import * as ProgressPrimitive from '@rn-primitives/progress';\nimport * as React from 'react';\nimport { Platform, View } from 'react-native';\nimport Animated, {\n Extrapolation,\n interpolate,\n useAnimatedStyle,\n useDerivedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport { cn } from './utils';\n\nfunction Progress({\n className,\n value,\n indicatorClassName,\n ...props\n}: ProgressPrimitive.RootProps & {\n ref?: React.RefObject<ProgressPrimitive.RootRef>;\n indicatorClassName?: string;\n}) {\n return (\n <ProgressPrimitive.Root\n className={cn(\n 'bg-secondary relative h-4 w-full overflow-hidden rounded-full',\n className\n )}\n {...props}\n >\n <Indicator value={value} className={indicatorClassName} />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n\nfunction Indicator({\n value,\n className,\n}: {\n value: number | undefined | null;\n className?: string;\n}) {\n const progress = useDerivedValue(() => value ?? 0);\n\n const indicator = useAnimatedStyle(() => {\n return {\n width: withSpring(\n `${interpolate(progress.value, [0, 100], [1, 100], Extrapolation.CLAMP)}%`,\n { overshootClamping: true }\n ),\n };\n });\n\n if (Platform.OS === 'web') {\n return (\n <View\n className={cn(\n 'bg-primary web:transition-all h-full w-full flex-1',\n className\n )}\n style={{ transform: `translateX(-${100 - (value ?? 0)}%)` }}\n >\n <ProgressPrimitive.Indicator\n className={cn('h-full w-full', className)}\n />\n </View>\n );\n }\n\n return (\n <ProgressPrimitive.Indicator asChild>\n <Animated.View\n style={indicator}\n className={cn('bg-foreground h-full', className)}\n />\n </ProgressPrimitive.Indicator>\n );\n}\n"],"mappings":";;;;;;;;AAYA,SAAS,SAAS,EAChB,WACA,OACA,oBACA,GAAG,SAIF;AACD,QACE,oBAAC,kBAAkB;EACjB,WAAW,GACT,iEACA,UACD;EACD,GAAI;YAEJ,oBAAC;GAAiB;GAAO,WAAW;IAAsB;GACnC;;AAM7B,SAAS,UAAU,EACjB,OACA,aAIC;CACD,MAAM,WAAW,sBAAsB,SAAS,EAAE;CAElD,MAAM,YAAY,uBAAuB;AACvC,SAAO,EACL,OAAO,WACL,GAAG,YAAY,SAAS,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,cAAc,MAAM,CAAC,IACxE,EAAE,mBAAmB,MAAM,CAC5B,EACF;GACD;AAEF,KAAI,SAAS,OAAO,MAClB,QACE,oBAAC;EACC,WAAW,GACT,sDACA,UACD;EACD,OAAO,EAAE,WAAW,eAAe,OAAO,SAAS,GAAG,KAAK;YAE3D,oBAAC,kBAAkB,aACjB,WAAW,GAAG,iBAAiB,UAAU,GACzC;GACG;AAIX,QACE,oBAAC,kBAAkB;EAAU;YAC3B,oBAAC,SAAS;GACR,OAAO;GACP,WAAW,GAAG,wBAAwB,UAAU;IAChD;GAC0B"}
|
package/dist/ui/radio-group.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime145 from "react/jsx-runtime";
|
|
2
2
|
import * as RadioGroupPrimitive from "@rn-primitives/radio-group";
|
|
3
3
|
|
|
4
4
|
//#region ui/radio-group.d.ts
|
|
5
5
|
declare function RadioGroup({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: RadioGroupPrimitive.RootProps & React.RefAttributes<RadioGroupPrimitive.RootRef>):
|
|
8
|
+
}: RadioGroupPrimitive.RootProps & React.RefAttributes<RadioGroupPrimitive.RootRef>): react_jsx_runtime145.JSX.Element;
|
|
9
9
|
declare function RadioGroupItem({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: RadioGroupPrimitive.ItemProps & React.RefAttributes<RadioGroupPrimitive.ItemRef>):
|
|
12
|
+
}: RadioGroupPrimitive.ItemProps & React.RefAttributes<RadioGroupPrimitive.ItemRef>): react_jsx_runtime145.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { RadioGroup, RadioGroupItem };
|
|
15
15
|
//# sourceMappingURL=radio-group.d.ts.map
|
package/dist/ui/radio-group.js
CHANGED
|
@@ -4,13 +4,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import * as RadioGroupPrimitive from "@rn-primitives/radio-group";
|
|
5
5
|
|
|
6
6
|
//#region ui/radio-group.tsx
|
|
7
|
-
function RadioGroup({ className
|
|
7
|
+
function RadioGroup({ className, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
9
9
|
className: cn("gap-3", className),
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
function RadioGroupItem({ className
|
|
13
|
+
function RadioGroupItem({ className, ...props }) {
|
|
14
14
|
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
15
15
|
className: cn("border-input dark:bg-input/30 aspect-square size-4 shrink-0 items-center justify-center rounded-full border shadow-2xs shadow-black/5", Platform.select({ web: "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 outline-hidden transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed" }), props.disabled && "opacity-50", className),
|
|
16
16
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":[],"sources":["../../ui/radio-group.tsx"],"sourcesContent":["import { cn } from './utils';\nimport * as RadioGroupPrimitive from '@rn-primitives/radio-group';\nimport { Platform } from 'react-native';\n\nfunction RadioGroup({\n className,\n ...props\n}: RadioGroupPrimitive.RootProps &\n React.RefAttributes<RadioGroupPrimitive.RootRef>) {\n return (\n <RadioGroupPrimitive.Root className={cn('gap-3', className)} {...props} />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: RadioGroupPrimitive.ItemProps &\n React.RefAttributes<RadioGroupPrimitive.ItemRef>) {\n return (\n <RadioGroupPrimitive.Item\n className={cn(\n 'border-input dark:bg-input/30 aspect-square size-4 shrink-0 items-center justify-center rounded-full border shadow-2xs shadow-black/5',\n Platform.select({\n web: 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 outline-hidden transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed',\n }),\n props.disabled && 'opacity-50',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"bg-primary size-2 rounded-full\" />\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;AAIA,SAAS,WAAW,EAClB,
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":[],"sources":["../../ui/radio-group.tsx"],"sourcesContent":["import { cn } from './utils';\nimport * as RadioGroupPrimitive from '@rn-primitives/radio-group';\nimport { Platform } from 'react-native';\n\nfunction RadioGroup({\n className,\n ...props\n}: RadioGroupPrimitive.RootProps &\n React.RefAttributes<RadioGroupPrimitive.RootRef>) {\n return (\n <RadioGroupPrimitive.Root className={cn('gap-3', className)} {...props} />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: RadioGroupPrimitive.ItemProps &\n React.RefAttributes<RadioGroupPrimitive.ItemRef>) {\n return (\n <RadioGroupPrimitive.Item\n className={cn(\n 'border-input dark:bg-input/30 aspect-square size-4 shrink-0 items-center justify-center rounded-full border shadow-2xs shadow-black/5',\n Platform.select({\n web: 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 outline-hidden transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed',\n }),\n props.disabled && 'opacity-50',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"bg-primary size-2 rounded-full\" />\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;AAIA,SAAS,WAAW,EAClB,WACA,GAAG,SAE+C;AAClD,QACE,oBAAC,oBAAoB;EAAK,WAAW,GAAG,SAAS,UAAU;EAAE,GAAI;GAAS;;AAI9E,SAAS,eAAe,EACtB,WACA,GAAG,SAE+C;AAClD,QACE,oBAAC,oBAAoB;EACnB,WAAW,GACT,yIACA,SAAS,OAAO,EACd,KAAK,kPACN,CAAC,EACF,MAAM,YAAY,cAClB,UACD;EACD,GAAI;YAEJ,oBAAC,oBAAoB,aAAU,WAAU,mCAAmC;GACnD"}
|
package/dist/ui/select.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_native56 from "react-native";
|
|
3
3
|
import { View } from "react-native";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime147 from "react/jsx-runtime";
|
|
5
5
|
import * as _rn_primitives_select0 from "@rn-primitives/select";
|
|
6
6
|
|
|
7
7
|
//#region ui/select.d.ts
|
|
8
8
|
type Option = _rn_primitives_select0.Option;
|
|
9
|
-
declare const Select: React$1.ForwardRefExoticComponent<
|
|
9
|
+
declare const Select: React$1.ForwardRefExoticComponent<react_native56.ViewProps & {
|
|
10
10
|
asChild?: boolean;
|
|
11
11
|
} & {
|
|
12
12
|
value?: _rn_primitives_select0.Option;
|
|
@@ -18,14 +18,14 @@ declare const Select: React$1.ForwardRefExoticComponent<react_native35.ViewProps
|
|
|
18
18
|
name?: string;
|
|
19
19
|
required?: boolean;
|
|
20
20
|
} & React$1.RefAttributes<View>>;
|
|
21
|
-
declare const SelectGroup: React$1.ForwardRefExoticComponent<
|
|
21
|
+
declare const SelectGroup: React$1.ForwardRefExoticComponent<react_native56.ViewProps & {
|
|
22
22
|
asChild?: boolean;
|
|
23
23
|
} & React$1.RefAttributes<View>>;
|
|
24
|
-
declare const SelectValue: React$1.ForwardRefExoticComponent<
|
|
24
|
+
declare const SelectValue: React$1.ForwardRefExoticComponent<react_native56.TextProps & {
|
|
25
25
|
asChild?: boolean;
|
|
26
26
|
} & {
|
|
27
27
|
placeholder: string;
|
|
28
|
-
} & React$1.RefAttributes<
|
|
28
|
+
} & React$1.RefAttributes<react_native56.Text>>;
|
|
29
29
|
declare function SelectTrigger({
|
|
30
30
|
ref,
|
|
31
31
|
className,
|
|
@@ -34,21 +34,21 @@ declare function SelectTrigger({
|
|
|
34
34
|
}: _rn_primitives_select0.TriggerProps & {
|
|
35
35
|
ref?: React$1.RefObject<_rn_primitives_select0.TriggerRef>;
|
|
36
36
|
children?: React$1.ReactNode;
|
|
37
|
-
}):
|
|
37
|
+
}): react_jsx_runtime147.JSX.Element;
|
|
38
38
|
/**
|
|
39
39
|
* Platform: WEB ONLY
|
|
40
40
|
*/
|
|
41
41
|
declare function SelectScrollUpButton({
|
|
42
42
|
className,
|
|
43
43
|
...props
|
|
44
|
-
}: _rn_primitives_select0.ScrollUpButtonProps):
|
|
44
|
+
}: _rn_primitives_select0.ScrollUpButtonProps): react_jsx_runtime147.JSX.Element | null;
|
|
45
45
|
/**
|
|
46
46
|
* Platform: WEB ONLY
|
|
47
47
|
*/
|
|
48
48
|
declare function SelectScrollDownButton({
|
|
49
49
|
className,
|
|
50
50
|
...props
|
|
51
|
-
}: _rn_primitives_select0.ScrollDownButtonProps):
|
|
51
|
+
}: _rn_primitives_select0.ScrollDownButtonProps): react_jsx_runtime147.JSX.Element | null;
|
|
52
52
|
declare function SelectContent({
|
|
53
53
|
className,
|
|
54
54
|
children,
|
|
@@ -59,26 +59,26 @@ declare function SelectContent({
|
|
|
59
59
|
ref?: React$1.RefObject<_rn_primitives_select0.ContentRef>;
|
|
60
60
|
className?: string;
|
|
61
61
|
portalHost?: string;
|
|
62
|
-
}):
|
|
62
|
+
}): react_jsx_runtime147.JSX.Element;
|
|
63
63
|
declare function SelectLabel({
|
|
64
64
|
className,
|
|
65
65
|
...props
|
|
66
66
|
}: _rn_primitives_select0.LabelProps & {
|
|
67
67
|
ref?: React$1.RefObject<_rn_primitives_select0.LabelRef>;
|
|
68
|
-
}):
|
|
68
|
+
}): react_jsx_runtime147.JSX.Element;
|
|
69
69
|
declare function SelectItem({
|
|
70
70
|
className,
|
|
71
71
|
children,
|
|
72
72
|
...props
|
|
73
73
|
}: _rn_primitives_select0.ItemProps & {
|
|
74
74
|
ref?: React$1.RefObject<_rn_primitives_select0.ItemRef>;
|
|
75
|
-
}):
|
|
75
|
+
}): react_jsx_runtime147.JSX.Element;
|
|
76
76
|
declare function SelectSeparator({
|
|
77
77
|
className,
|
|
78
78
|
...props
|
|
79
79
|
}: _rn_primitives_select0.SeparatorProps & {
|
|
80
80
|
ref?: React$1.RefObject<_rn_primitives_select0.SeparatorRef>;
|
|
81
|
-
}):
|
|
81
|
+
}): react_jsx_runtime147.JSX.Element;
|
|
82
82
|
//#endregion
|
|
83
83
|
export { type Option, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
84
84
|
//# sourceMappingURL=select.d.ts.map
|
package/dist/ui/select.js
CHANGED
|
@@ -12,7 +12,7 @@ import * as SelectPrimitive from "@rn-primitives/select";
|
|
|
12
12
|
const Select = SelectPrimitive.Root;
|
|
13
13
|
const SelectGroup = SelectPrimitive.Group;
|
|
14
14
|
const SelectValue = SelectPrimitive.Value;
|
|
15
|
-
function SelectTrigger({ ref, className, children
|
|
15
|
+
function SelectTrigger({ ref, className, children, ...props }) {
|
|
16
16
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
17
17
|
ref,
|
|
18
18
|
className: cn("native:h-12 border-input bg-background text-muted-foreground web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 flex h-10 flex-row items-center justify-between rounded-md border px-3 py-2 text-sm [&>span]:line-clamp-1", props.disabled && "web:cursor-not-allowed opacity-50", className),
|
|
@@ -27,7 +27,7 @@ function SelectTrigger({ ref, className, children,...props }) {
|
|
|
27
27
|
/**
|
|
28
28
|
* Platform: WEB ONLY
|
|
29
29
|
*/
|
|
30
|
-
function SelectScrollUpButton({ className
|
|
30
|
+
function SelectScrollUpButton({ className, ...props }) {
|
|
31
31
|
if (Platform.OS !== "web") return null;
|
|
32
32
|
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
33
33
|
className: cn("web:cursor-default flex items-center justify-center py-1", className),
|
|
@@ -41,7 +41,7 @@ function SelectScrollUpButton({ className,...props }) {
|
|
|
41
41
|
/**
|
|
42
42
|
* Platform: WEB ONLY
|
|
43
43
|
*/
|
|
44
|
-
function SelectScrollDownButton({ className
|
|
44
|
+
function SelectScrollDownButton({ className, ...props }) {
|
|
45
45
|
if (Platform.OS !== "web") return null;
|
|
46
46
|
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
47
47
|
className: cn("web:cursor-default flex items-center justify-center py-1", className),
|
|
@@ -52,7 +52,7 @@ function SelectScrollDownButton({ className,...props }) {
|
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function SelectContent({ className, children, position = "popper", portalHost
|
|
55
|
+
function SelectContent({ className, children, position = "popper", portalHost, ...props }) {
|
|
56
56
|
const { open } = SelectPrimitive.useRootContext();
|
|
57
57
|
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, {
|
|
58
58
|
hostName: portalHost,
|
|
@@ -79,13 +79,13 @@ function SelectContent({ className, children, position = "popper", portalHost,..
|
|
|
79
79
|
})
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
function SelectLabel({ className
|
|
82
|
+
function SelectLabel({ className, ...props }) {
|
|
83
83
|
return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
84
84
|
className: cn("native:pb-2 native:pl-10 native:text-base text-popover-foreground py-1.5 pr-2 pl-8 text-sm font-semibold", className),
|
|
85
85
|
...props
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
function SelectItem({ className, children
|
|
88
|
+
function SelectItem({ className, children, ...props }) {
|
|
89
89
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
90
90
|
className: cn("web:group native:py-2 native:pl-10 active:bg-accent web:cursor-default web:select-none web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent relative flex w-full flex-row items-center rounded-xs py-1.5 pr-2 pl-8", props.disabled && "web:pointer-events-none opacity-50", className),
|
|
91
91
|
...props,
|
|
@@ -99,7 +99,7 @@ function SelectItem({ className, children,...props }) {
|
|
|
99
99
|
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { className: "native:text-lg native:text-base text-popover-foreground web:group-focus:text-accent-foreground text-sm" })]
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function SelectSeparator({ className
|
|
102
|
+
function SelectSeparator({ className, ...props }) {
|
|
103
103
|
return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
104
104
|
className: cn("bg-muted -mx-1 my-1 h-px", className),
|
|
105
105
|
...props
|
package/dist/ui/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":[],"sources":["../../ui/select.tsx"],"sourcesContent":["import * as SelectPrimitive from '@rn-primitives/select';\nimport * as React from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport Animated, { FadeIn, FadeOut } from 'react-native-reanimated';\nimport { Check } from './icons/Check';\nimport { ChevronDown } from './icons/ChevronDown';\nimport { ChevronUp } from './icons/ChevronUp';\nimport { cn } from './utils';\n\ntype Option = SelectPrimitive.Option;\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nfunction SelectTrigger({\n ref,\n className,\n children,\n ...props\n}: SelectPrimitive.TriggerProps & {\n ref?: React.RefObject<SelectPrimitive.TriggerRef>;\n children?: React.ReactNode;\n}) {\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'native:h-12 border-input bg-background text-muted-foreground web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 flex h-10 flex-row items-center justify-between rounded-md border px-3 py-2 text-sm [&>span]:line-clamp-1',\n props.disabled && 'web:cursor-not-allowed opacity-50',\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown\n size={16}\n aria-hidden={true}\n className=\"text-foreground opacity-50\"\n />\n </SelectPrimitive.Trigger>\n );\n}\n\n/**\n * Platform: WEB ONLY\n */\nfunction SelectScrollUpButton({\n className,\n ...props\n}: SelectPrimitive.ScrollUpButtonProps) {\n if (Platform.OS !== 'web') {\n return null;\n }\n return (\n <SelectPrimitive.ScrollUpButton\n className={cn(\n 'web:cursor-default flex items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronUp size={14} className=\"text-foreground\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\n/**\n * Platform: WEB ONLY\n */\nfunction SelectScrollDownButton({\n className,\n ...props\n}: SelectPrimitive.ScrollDownButtonProps) {\n if (Platform.OS !== 'web') {\n return null;\n }\n return (\n <SelectPrimitive.ScrollDownButton\n className={cn(\n 'web:cursor-default flex items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronDown size={14} className=\"text-foreground\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'popper',\n portalHost,\n ...props\n}: SelectPrimitive.ContentProps & {\n ref?: React.RefObject<SelectPrimitive.ContentRef>;\n className?: string;\n portalHost?: string;\n}) {\n const { open } = SelectPrimitive.useRootContext();\n\n return (\n <SelectPrimitive.Portal hostName={portalHost}>\n <SelectPrimitive.Overlay\n style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}\n >\n <Animated.View className=\"z-50\" entering={FadeIn} exiting={FadeOut}>\n <SelectPrimitive.Content\n className={cn(\n 'border-border bg-popover shadow-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border px-1 py-2 shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n open\n ? 'web:animate-in web:fade-in-0 web:zoom-in-95'\n : 'web:animate-out web:fade-out-0 web:zoom-out-95',\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </Animated.View>\n </SelectPrimitive.Overlay>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.LabelProps & {\n ref?: React.RefObject<SelectPrimitive.LabelRef>;\n}) {\n return (\n <SelectPrimitive.Label\n className={cn(\n 'native:pb-2 native:pl-10 native:text-base text-popover-foreground py-1.5 pr-2 pl-8 text-sm font-semibold',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.ItemProps & {\n ref?: React.RefObject<SelectPrimitive.ItemRef>;\n}) {\n return (\n <SelectPrimitive.Item\n className={cn(\n 'web:group native:py-2 native:pl-10 active:bg-accent web:cursor-default web:select-none web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent relative flex w-full flex-row items-center rounded-xs py-1.5 pr-2 pl-8',\n props.disabled && 'web:pointer-events-none opacity-50',\n className\n )}\n {...props}\n >\n <View className=\"native:left-3.5 native:pt-px absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check\n size={16}\n strokeWidth={3}\n className=\"text-popover-foreground\"\n />\n </SelectPrimitive.ItemIndicator>\n </View>\n <SelectPrimitive.ItemText className=\"native:text-lg native:text-base text-popover-foreground web:group-focus:text-accent-foreground text-sm\" />\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.SeparatorProps & {\n ref?: React.RefObject<SelectPrimitive.SeparatorRef>;\n}) {\n return (\n <SelectPrimitive.Separator\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n type Option,\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,SAAS,gBAAgB;AAE/B,MAAM,cAAc,gBAAgB;AAEpC,MAAM,cAAc,gBAAgB;AAEpC,SAAS,cAAc,EACrB,KACA,WACA,
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../ui/select.tsx"],"sourcesContent":["import * as SelectPrimitive from '@rn-primitives/select';\nimport * as React from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport Animated, { FadeIn, FadeOut } from 'react-native-reanimated';\nimport { Check } from './icons/Check';\nimport { ChevronDown } from './icons/ChevronDown';\nimport { ChevronUp } from './icons/ChevronUp';\nimport { cn } from './utils';\n\ntype Option = SelectPrimitive.Option;\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nfunction SelectTrigger({\n ref,\n className,\n children,\n ...props\n}: SelectPrimitive.TriggerProps & {\n ref?: React.RefObject<SelectPrimitive.TriggerRef>;\n children?: React.ReactNode;\n}) {\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'native:h-12 border-input bg-background text-muted-foreground web:ring-offset-background web:focus:outline-hidden web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 flex h-10 flex-row items-center justify-between rounded-md border px-3 py-2 text-sm [&>span]:line-clamp-1',\n props.disabled && 'web:cursor-not-allowed opacity-50',\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown\n size={16}\n aria-hidden={true}\n className=\"text-foreground opacity-50\"\n />\n </SelectPrimitive.Trigger>\n );\n}\n\n/**\n * Platform: WEB ONLY\n */\nfunction SelectScrollUpButton({\n className,\n ...props\n}: SelectPrimitive.ScrollUpButtonProps) {\n if (Platform.OS !== 'web') {\n return null;\n }\n return (\n <SelectPrimitive.ScrollUpButton\n className={cn(\n 'web:cursor-default flex items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronUp size={14} className=\"text-foreground\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\n/**\n * Platform: WEB ONLY\n */\nfunction SelectScrollDownButton({\n className,\n ...props\n}: SelectPrimitive.ScrollDownButtonProps) {\n if (Platform.OS !== 'web') {\n return null;\n }\n return (\n <SelectPrimitive.ScrollDownButton\n className={cn(\n 'web:cursor-default flex items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronDown size={14} className=\"text-foreground\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'popper',\n portalHost,\n ...props\n}: SelectPrimitive.ContentProps & {\n ref?: React.RefObject<SelectPrimitive.ContentRef>;\n className?: string;\n portalHost?: string;\n}) {\n const { open } = SelectPrimitive.useRootContext();\n\n return (\n <SelectPrimitive.Portal hostName={portalHost}>\n <SelectPrimitive.Overlay\n style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}\n >\n <Animated.View className=\"z-50\" entering={FadeIn} exiting={FadeOut}>\n <SelectPrimitive.Content\n className={cn(\n 'border-border bg-popover shadow-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 rounded-md border px-1 py-2 shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n open\n ? 'web:animate-in web:fade-in-0 web:zoom-in-95'\n : 'web:animate-out web:fade-out-0 web:zoom-out-95',\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </Animated.View>\n </SelectPrimitive.Overlay>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.LabelProps & {\n ref?: React.RefObject<SelectPrimitive.LabelRef>;\n}) {\n return (\n <SelectPrimitive.Label\n className={cn(\n 'native:pb-2 native:pl-10 native:text-base text-popover-foreground py-1.5 pr-2 pl-8 text-sm font-semibold',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.ItemProps & {\n ref?: React.RefObject<SelectPrimitive.ItemRef>;\n}) {\n return (\n <SelectPrimitive.Item\n className={cn(\n 'web:group native:py-2 native:pl-10 active:bg-accent web:cursor-default web:select-none web:outline-hidden web:hover:bg-accent/50 web:focus:bg-accent relative flex w-full flex-row items-center rounded-xs py-1.5 pr-2 pl-8',\n props.disabled && 'web:pointer-events-none opacity-50',\n className\n )}\n {...props}\n >\n <View className=\"native:left-3.5 native:pt-px absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check\n size={16}\n strokeWidth={3}\n className=\"text-popover-foreground\"\n />\n </SelectPrimitive.ItemIndicator>\n </View>\n <SelectPrimitive.ItemText className=\"native:text-lg native:text-base text-popover-foreground web:group-focus:text-accent-foreground text-sm\" />\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.SeparatorProps & {\n ref?: React.RefObject<SelectPrimitive.SeparatorRef>;\n}) {\n return (\n <SelectPrimitive.Separator\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n type Option,\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,SAAS,gBAAgB;AAE/B,MAAM,cAAc,gBAAgB;AAEpC,MAAM,cAAc,gBAAgB;AAEpC,SAAS,cAAc,EACrB,KACA,WACA,UACA,GAAG,SAIF;AACD,QACE,qBAAC,gBAAgB;EACV;EACL,WAAW,GACT,2RACA,MAAM,YAAY,qCAClB,UACD;EACD,GAAI;aAEH,UACD,oBAAC;GACC,MAAM;GACN,eAAa;GACb,WAAU;IACV;GACsB;;;;;AAO9B,SAAS,qBAAqB,EAC5B,WACA,GAAG,SACmC;AACtC,KAAI,SAAS,OAAO,MAClB,QAAO;AAET,QACE,oBAAC,gBAAgB;EACf,WAAW,GACT,4DACA,UACD;EACD,GAAI;YAEJ,oBAAC;GAAU,MAAM;GAAI,WAAU;IAAoB;GACpB;;;;;AAOrC,SAAS,uBAAuB,EAC9B,WACA,GAAG,SACqC;AACxC,KAAI,SAAS,OAAO,MAClB,QAAO;AAET,QACE,oBAAC,gBAAgB;EACf,WAAW,GACT,4DACA,UACD;EACD,GAAI;YAEJ,oBAAC;GAAY,MAAM;GAAI,WAAU;IAAoB;GACpB;;AAIvC,SAAS,cAAc,EACrB,WACA,UACA,WAAW,UACX,YACA,GAAG,SAKF;CACD,MAAM,EAAE,SAAS,gBAAgB,gBAAgB;AAEjD,QACE,oBAAC,gBAAgB;EAAO,UAAU;YAChC,oBAAC,gBAAgB;GACf,OAAO,SAAS,OAAO,QAAQ,WAAW,eAAe;aAEzD,oBAAC,SAAS;IAAK,WAAU;IAAO,UAAU;IAAQ,SAAS;cACzD,qBAAC,gBAAgB;KACf,WAAW,GACT,mRACA,aAAa,YACX,mIACF,OACI,gDACA,kDACJ,UACD;KACS;KACV,GAAI;;MAEJ,oBAAC,yBAAuB;MACxB,oBAAC,gBAAgB;OACf,WAAW,GACT,OACA,aAAa,YACX,gFACH;OAEA;QACwB;MAC3B,oBAAC,2BAAyB;;MACF;KACZ;IACQ;GACH;;AAI7B,SAAS,YAAY,EACnB,WACA,GAAG,SAGF;AACD,QACE,oBAAC,gBAAgB;EACf,WAAW,GACT,4GACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,WAAW,EAClB,WACA,UACA,GAAG,SAGF;AACD,QACE,qBAAC,gBAAgB;EACf,WAAW,GACT,+NACA,MAAM,YAAY,sCAClB,UACD;EACD,GAAI;aAEJ,oBAAC;GAAK,WAAU;aACd,oBAAC,gBAAgB,2BACf,oBAAC;IACC,MAAM;IACN,aAAa;IACb,WAAU;KACV,GAC4B;IAC3B,EACP,oBAAC,gBAAgB,YAAS,WAAU,2GAA2G;GAC1H;;AAI3B,SAAS,gBAAgB,EACvB,WACA,GAAG,SAGF;AACD,QACE,oBAAC,gBAAgB;EACf,WAAW,GAAG,4BAA4B,UAAU;EACpD,GAAI;GACJ"}
|
package/dist/ui/separator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime67 from "react/jsx-runtime";
|
|
3
3
|
import * as SeparatorPrimitive from "@rn-primitives/separator";
|
|
4
4
|
|
|
5
5
|
//#region ui/separator.d.ts
|
|
@@ -10,7 +10,7 @@ declare function Separator({
|
|
|
10
10
|
...props
|
|
11
11
|
}: SeparatorPrimitive.RootProps & {
|
|
12
12
|
ref?: React$1.RefObject<SeparatorPrimitive.RootRef>;
|
|
13
|
-
}):
|
|
13
|
+
}): react_jsx_runtime67.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Separator };
|
|
16
16
|
//# sourceMappingURL=separator.d.ts.map
|
package/dist/ui/separator.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import * as SeparatorPrimitive from "@rn-primitives/separator";
|
|
5
5
|
|
|
6
6
|
//#region ui/separator.tsx
|
|
7
|
-
function Separator({ className, orientation = "horizontal", decorative = true
|
|
7
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
|
|
9
9
|
decorative,
|
|
10
10
|
orientation,
|
package/dist/ui/separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../ui/separator.tsx"],"sourcesContent":["import * as SeparatorPrimitive from '@rn-primitives/separator';\nimport * as React from 'react';\nimport { cn } from './utils';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: SeparatorPrimitive.RootProps & {\n ref?: React.RefObject<SeparatorPrimitive.RootRef>;\n}) {\n return (\n <SeparatorPrimitive.Root\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'bg-border shrink-0',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n"],"mappings":";;;;;;AAIA,SAAS,UAAU,EACjB,WACA,cAAc,cACd,aAAa,
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../ui/separator.tsx"],"sourcesContent":["import * as SeparatorPrimitive from '@rn-primitives/separator';\nimport * as React from 'react';\nimport { cn } from './utils';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: SeparatorPrimitive.RootProps & {\n ref?: React.RefObject<SeparatorPrimitive.RootRef>;\n}) {\n return (\n <SeparatorPrimitive.Root\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'bg-border shrink-0',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n"],"mappings":";;;;;;AAIA,SAAS,UAAU,EACjB,WACA,cAAc,cACd,aAAa,MACb,GAAG,SAGF;AACD,QACE,oBAAC,mBAAmB;EACN;EACC;EACb,WAAW,GACT,sBACA,gBAAgB,eAAe,gBAAgB,eAC/C,UACD;EACD,GAAI;GACJ"}
|
package/dist/ui/skeleton.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime139 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region ui/skeleton.d.ts
|
|
6
6
|
declare function Skeleton({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
9
|
-
}: Omit<React$1.ComponentPropsWithoutRef<typeof View>, 'style'>):
|
|
9
|
+
}: Omit<React$1.ComponentPropsWithoutRef<typeof View>, 'style'>): react_jsx_runtime139.JSX.Element;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Skeleton };
|
|
12
12
|
//# sourceMappingURL=skeleton.d.ts.map
|
package/dist/ui/skeleton.js
CHANGED
|
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region ui/skeleton.tsx
|
|
8
8
|
const duration = 1e3;
|
|
9
|
-
function Skeleton({ className
|
|
9
|
+
function Skeleton({ className, ...props }) {
|
|
10
10
|
const sv = useSharedValue(1);
|
|
11
11
|
React$1.useEffect(() => {
|
|
12
12
|
sv.value = withRepeat(withSequence(withTiming(.5, { duration }), withTiming(1, { duration })), -1);
|
package/dist/ui/skeleton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","names":[],"sources":["../../ui/skeleton.tsx"],"sourcesContent":["import * as React from 'react';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withSequence,\n withTiming,\n} from 'react-native-reanimated';\nimport { cn } from './utils';\nimport { View } from 'react-native';\n\nconst duration = 1000;\n\nfunction Skeleton({\n className,\n ...props\n // }: Omit<React.ComponentPropsWithoutRef<typeof Animated.View>, 'style'>) {\n}: Omit<React.ComponentPropsWithoutRef<typeof View>, 'style'>) {\n const sv = useSharedValue(1);\n\n React.useEffect(() => {\n sv.value = withRepeat(\n withSequence(withTiming(0.5, { duration }), withTiming(1, { duration })),\n -1\n );\n }, []);\n\n const style = useAnimatedStyle(() => ({\n opacity: sv.value,\n }));\n\n return (\n <Animated.View\n style={style}\n className={cn('bg-secondary dark:bg-muted rounded-md', className)}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;AAWA,MAAM,WAAW;AAEjB,SAAS,SAAS,EAChB,
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":[],"sources":["../../ui/skeleton.tsx"],"sourcesContent":["import * as React from 'react';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withSequence,\n withTiming,\n} from 'react-native-reanimated';\nimport { cn } from './utils';\nimport { View } from 'react-native';\n\nconst duration = 1000;\n\nfunction Skeleton({\n className,\n ...props\n // }: Omit<React.ComponentPropsWithoutRef<typeof Animated.View>, 'style'>) {\n}: Omit<React.ComponentPropsWithoutRef<typeof View>, 'style'>) {\n const sv = useSharedValue(1);\n\n React.useEffect(() => {\n sv.value = withRepeat(\n withSequence(withTiming(0.5, { duration }), withTiming(1, { duration })),\n -1\n );\n }, []);\n\n const style = useAnimatedStyle(() => ({\n opacity: sv.value,\n }));\n\n return (\n <Animated.View\n style={style}\n className={cn('bg-secondary dark:bg-muted rounded-md', className)}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;AAWA,MAAM,WAAW;AAEjB,SAAS,SAAS,EAChB,WACA,GAAG,SAE0D;CAC7D,MAAM,KAAK,eAAe,EAAE;AAE5B,SAAM,gBAAgB;AACpB,KAAG,QAAQ,WACT,aAAa,WAAW,IAAK,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,EAAE,UAAU,CAAC,CAAC,EACxE,GACD;IACA,EAAE,CAAC;CAEN,MAAM,QAAQ,wBAAwB,EACpC,SAAS,GAAG,OACb,EAAE;AAEH,QACE,oBAAC,SAAS;EACD;EACP,WAAW,GAAG,yCAAyC,UAAU;EACjE,GAAI;GACJ"}
|
package/dist/ui/stack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { View, ViewProps } from "react-native";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime140 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import * as class_variance_authority_types10 from "class-variance-authority/types";
|
|
6
6
|
|
|
@@ -50,7 +50,7 @@ declare function Box({
|
|
|
50
50
|
gap,
|
|
51
51
|
wrap,
|
|
52
52
|
...props
|
|
53
|
-
}: BoxProps):
|
|
53
|
+
}: BoxProps): react_jsx_runtime140.JSX.Element;
|
|
54
54
|
declare function HStack({
|
|
55
55
|
className,
|
|
56
56
|
spacing,
|
|
@@ -61,7 +61,7 @@ declare function HStack({
|
|
|
61
61
|
gap,
|
|
62
62
|
wrap,
|
|
63
63
|
...props
|
|
64
|
-
}: HStackProps):
|
|
64
|
+
}: HStackProps): react_jsx_runtime140.JSX.Element;
|
|
65
65
|
declare function VStack({
|
|
66
66
|
className,
|
|
67
67
|
spacing,
|
|
@@ -71,7 +71,7 @@ declare function VStack({
|
|
|
71
71
|
padding,
|
|
72
72
|
gap,
|
|
73
73
|
...props
|
|
74
|
-
}: VStackProps):
|
|
74
|
+
}: VStackProps): react_jsx_runtime140.JSX.Element;
|
|
75
75
|
//#endregion
|
|
76
76
|
export { Box, type BoxProps, HStack, type HStackProps, VStack, type VStackProps };
|
|
77
77
|
//# sourceMappingURL=stack.d.ts.map
|
package/dist/ui/stack.js
CHANGED
|
@@ -191,7 +191,7 @@ const boxVariants = cva([baseStyle, "flex-row"], {
|
|
|
191
191
|
wrap: "wrap"
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
-
function Box({ className, spacing, align, justify, width, padding, gap, wrap
|
|
194
|
+
function Box({ className, spacing, align, justify, width, padding, gap, wrap, ...props }) {
|
|
195
195
|
return /* @__PURE__ */ jsx(View, {
|
|
196
196
|
className: cn(boxVariants({
|
|
197
197
|
spacing,
|
|
@@ -205,7 +205,7 @@ function Box({ className, spacing, align, justify, width, padding, gap, wrap,...
|
|
|
205
205
|
...props
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function HStack({ className, spacing, align, justify, width, padding, gap, wrap
|
|
208
|
+
function HStack({ className, spacing, align, justify, width, padding, gap, wrap, ...props }) {
|
|
209
209
|
return /* @__PURE__ */ jsx(View, {
|
|
210
210
|
className: cn(hStackVariants({
|
|
211
211
|
spacing,
|
|
@@ -219,7 +219,7 @@ function HStack({ className, spacing, align, justify, width, padding, gap, wrap,
|
|
|
219
219
|
...props
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
function VStack({ className, spacing, align, justify, width, padding, gap
|
|
222
|
+
function VStack({ className, spacing, align, justify, width, padding, gap, ...props }) {
|
|
223
223
|
return /* @__PURE__ */ jsx(View, {
|
|
224
224
|
className: cn(vStackVariants({
|
|
225
225
|
spacing,
|
package/dist/ui/stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","names":[],"sources":["../../ui/stack.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ViewProps } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from './utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst baseStyle = 'flex';\n\n// VStack variants using cva\nconst vStackVariants = cva(\n [baseStyle, 'flex-col'], // base classes\n {\n variants: {\n spacing: {\n none: '',\n xs: 'gap-y-1',\n sm: 'gap-y-2',\n md: 'gap-y-4',\n lg: 'gap-y-6',\n xl: 'gap-y-8',\n '2xl': 'gap-y-12',\n },\n align: {\n stretch: 'items-stretch',\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n width: {\n auto: 'w-auto',\n full: 'w-full',\n screen: 'w-screen',\n fit: 'w-fit',\n },\n padding: {\n none: '',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n },\n gap: {\n none: '',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n },\n defaultVariants: {\n spacing: 'md',\n align: 'stretch',\n justify: 'start',\n width: 'auto',\n padding: 'none',\n gap: 'none',\n },\n }\n);\n\n// HStack variants using cva\nconst hStackVariants = cva(\n [baseStyle, 'flex-row'], // base classes\n {\n variants: {\n spacing: {\n none: '',\n xs: 'gap-x-1',\n sm: 'gap-x-2',\n md: 'gap-x-4',\n lg: 'gap-x-6',\n xl: 'gap-x-8',\n '2xl': 'gap-x-12',\n },\n align: {\n stretch: 'items-stretch',\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n width: {\n auto: 'w-auto',\n full: 'w-full',\n screen: 'w-screen',\n fit: 'w-fit',\n },\n padding: {\n none: '',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n },\n gap: {\n none: '',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n wrap: {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n reverse: 'flex-wrap-reverse',\n },\n },\n defaultVariants: {\n spacing: 'md',\n align: 'center',\n justify: 'start',\n width: 'auto',\n padding: 'none',\n gap: 'none',\n wrap: 'wrap',\n },\n }\n);\n\nconst boxVariants = cva(\n [baseStyle, 'flex-row'], // base classes\n {\n variants: {\n spacing: {\n none: '',\n xs: 'gap-x-1',\n sm: 'gap-x-2',\n md: 'gap-x-4',\n lg: 'gap-x-6',\n xl: 'gap-x-8',\n '2xl': 'gap-x-12',\n },\n align: {\n stretch: 'items-stretch',\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n width: {\n auto: 'w-auto',\n full: 'w-full',\n screen: 'w-screen',\n fit: 'w-fit',\n },\n padding: {\n none: '',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n },\n gap: {\n none: '',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n wrap: {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n reverse: 'flex-wrap-reverse',\n },\n },\n defaultVariants: {\n spacing: 'md',\n align: 'center',\n justify: 'center',\n width: 'auto',\n padding: 'none',\n gap: 'none',\n wrap: 'wrap',\n },\n }\n);\n\ntype BoxProps = ViewProps &\n VariantProps<typeof boxVariants> & {\n ref?: React.RefObject<React.ComponentRef<typeof View>>;\n };\n\ntype VStackProps = ViewProps &\n VariantProps<typeof vStackVariants> & {\n ref?: React.RefObject<React.ComponentRef<typeof View>>;\n };\n\ntype HStackProps = ViewProps &\n VariantProps<typeof hStackVariants> & {\n ref?: React.RefObject<React.ComponentRef<typeof View>>;\n };\n\nfunction Box({\n className,\n spacing,\n align,\n justify,\n width,\n padding,\n gap,\n wrap,\n ...props\n}: BoxProps) {\n return (\n <View\n className={cn(\n boxVariants({ spacing, align, justify, width, padding, gap, wrap }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction HStack({\n className,\n spacing,\n align,\n justify,\n width,\n padding,\n gap,\n wrap,\n ...props\n}: HStackProps) {\n return (\n <View\n className={cn(\n hStackVariants({ spacing, align, justify, width, padding, gap, wrap }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction VStack({\n className,\n spacing,\n align,\n justify,\n width,\n padding,\n gap,\n ...props\n}: VStackProps) {\n return (\n <View\n className={cn(\n vStackVariants({ spacing, align, justify, width, padding, gap }),\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n HStack,\n VStack,\n type HStackProps,\n type VStackProps,\n Box,\n type BoxProps,\n};\n"],"mappings":";;;;;;;AAMA,MAAM,YAAY;AAGlB,MAAM,iBAAiB,IACrB,CAAC,WAAW,WAAW,EACvB;CACE,UAAU;EACR,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACT;EACD,OAAO;GACL,MAAM;GACN,MAAM;GACN,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;EACP,SAAS;EACT,KAAK;EACN;CACF,CACF;AAGD,MAAM,iBAAiB,IACrB,CAAC,WAAW,WAAW,EACvB;CACE,UAAU;EACR,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,QAAQ;GACR,KAAK;GACL,UAAU;GACX;EACD,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACT;EACD,OAAO;GACL,MAAM;GACN,MAAM;GACN,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,MAAM;GACJ,QAAQ;GACR,MAAM;GACN,SAAS;GACV;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;EACP,SAAS;EACT,KAAK;EACL,MAAM;EACP;CACF,CACF;AAED,MAAM,cAAc,IAClB,CAAC,WAAW,WAAW,EACvB;CACE,UAAU;EACR,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,QAAQ;GACR,KAAK;GACL,UAAU;GACX;EACD,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACT;EACD,OAAO;GACL,MAAM;GACN,MAAM;GACN,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,MAAM;GACJ,QAAQ;GACR,MAAM;GACN,SAAS;GACV;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;EACP,SAAS;EACT,KAAK;EACL,MAAM;EACP;CACF,CACF;AAiBD,SAAS,IAAI,EACX,WACA,SACA,OACA,SACA,OACA,SACA,KACA,
|
|
1
|
+
{"version":3,"file":"stack.js","names":[],"sources":["../../ui/stack.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ViewProps } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from './utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst baseStyle = 'flex';\n\n// VStack variants using cva\nconst vStackVariants = cva(\n [baseStyle, 'flex-col'], // base classes\n {\n variants: {\n spacing: {\n none: '',\n xs: 'gap-y-1',\n sm: 'gap-y-2',\n md: 'gap-y-4',\n lg: 'gap-y-6',\n xl: 'gap-y-8',\n '2xl': 'gap-y-12',\n },\n align: {\n stretch: 'items-stretch',\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n width: {\n auto: 'w-auto',\n full: 'w-full',\n screen: 'w-screen',\n fit: 'w-fit',\n },\n padding: {\n none: '',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n },\n gap: {\n none: '',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n },\n defaultVariants: {\n spacing: 'md',\n align: 'stretch',\n justify: 'start',\n width: 'auto',\n padding: 'none',\n gap: 'none',\n },\n }\n);\n\n// HStack variants using cva\nconst hStackVariants = cva(\n [baseStyle, 'flex-row'], // base classes\n {\n variants: {\n spacing: {\n none: '',\n xs: 'gap-x-1',\n sm: 'gap-x-2',\n md: 'gap-x-4',\n lg: 'gap-x-6',\n xl: 'gap-x-8',\n '2xl': 'gap-x-12',\n },\n align: {\n stretch: 'items-stretch',\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n width: {\n auto: 'w-auto',\n full: 'w-full',\n screen: 'w-screen',\n fit: 'w-fit',\n },\n padding: {\n none: '',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n },\n gap: {\n none: '',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n wrap: {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n reverse: 'flex-wrap-reverse',\n },\n },\n defaultVariants: {\n spacing: 'md',\n align: 'center',\n justify: 'start',\n width: 'auto',\n padding: 'none',\n gap: 'none',\n wrap: 'wrap',\n },\n }\n);\n\nconst boxVariants = cva(\n [baseStyle, 'flex-row'], // base classes\n {\n variants: {\n spacing: {\n none: '',\n xs: 'gap-x-1',\n sm: 'gap-x-2',\n md: 'gap-x-4',\n lg: 'gap-x-6',\n xl: 'gap-x-8',\n '2xl': 'gap-x-12',\n },\n align: {\n stretch: 'items-stretch',\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n baseline: 'items-baseline',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n width: {\n auto: 'w-auto',\n full: 'w-full',\n screen: 'w-screen',\n fit: 'w-fit',\n },\n padding: {\n none: '',\n xs: 'p-1',\n sm: 'p-2',\n md: 'p-4',\n lg: 'p-6',\n xl: 'p-8',\n },\n gap: {\n none: '',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n wrap: {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n reverse: 'flex-wrap-reverse',\n },\n },\n defaultVariants: {\n spacing: 'md',\n align: 'center',\n justify: 'center',\n width: 'auto',\n padding: 'none',\n gap: 'none',\n wrap: 'wrap',\n },\n }\n);\n\ntype BoxProps = ViewProps &\n VariantProps<typeof boxVariants> & {\n ref?: React.RefObject<React.ComponentRef<typeof View>>;\n };\n\ntype VStackProps = ViewProps &\n VariantProps<typeof vStackVariants> & {\n ref?: React.RefObject<React.ComponentRef<typeof View>>;\n };\n\ntype HStackProps = ViewProps &\n VariantProps<typeof hStackVariants> & {\n ref?: React.RefObject<React.ComponentRef<typeof View>>;\n };\n\nfunction Box({\n className,\n spacing,\n align,\n justify,\n width,\n padding,\n gap,\n wrap,\n ...props\n}: BoxProps) {\n return (\n <View\n className={cn(\n boxVariants({ spacing, align, justify, width, padding, gap, wrap }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction HStack({\n className,\n spacing,\n align,\n justify,\n width,\n padding,\n gap,\n wrap,\n ...props\n}: HStackProps) {\n return (\n <View\n className={cn(\n hStackVariants({ spacing, align, justify, width, padding, gap, wrap }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction VStack({\n className,\n spacing,\n align,\n justify,\n width,\n padding,\n gap,\n ...props\n}: VStackProps) {\n return (\n <View\n className={cn(\n vStackVariants({ spacing, align, justify, width, padding, gap }),\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n HStack,\n VStack,\n type HStackProps,\n type VStackProps,\n Box,\n type BoxProps,\n};\n"],"mappings":";;;;;;;AAMA,MAAM,YAAY;AAGlB,MAAM,iBAAiB,IACrB,CAAC,WAAW,WAAW,EACvB;CACE,UAAU;EACR,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACT;EACD,OAAO;GACL,MAAM;GACN,MAAM;GACN,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;EACP,SAAS;EACT,KAAK;EACN;CACF,CACF;AAGD,MAAM,iBAAiB,IACrB,CAAC,WAAW,WAAW,EACvB;CACE,UAAU;EACR,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,QAAQ;GACR,KAAK;GACL,UAAU;GACX;EACD,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACT;EACD,OAAO;GACL,MAAM;GACN,MAAM;GACN,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,MAAM;GACJ,QAAQ;GACR,MAAM;GACN,SAAS;GACV;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;EACP,SAAS;EACT,KAAK;EACL,MAAM;EACP;CACF,CACF;AAED,MAAM,cAAc,IAClB,CAAC,WAAW,WAAW,EACvB;CACE,UAAU;EACR,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,QAAQ;GACR,KAAK;GACL,UAAU;GACX;EACD,SAAS;GACP,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACT;EACD,OAAO;GACL,MAAM;GACN,MAAM;GACN,QAAQ;GACR,KAAK;GACN;EACD,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,MAAM;GACJ,QAAQ;GACR,MAAM;GACN,SAAS;GACV;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;EACT,OAAO;EACP,SAAS;EACT,KAAK;EACL,MAAM;EACP;CACF,CACF;AAiBD,SAAS,IAAI,EACX,WACA,SACA,OACA,SACA,OACA,SACA,KACA,MACA,GAAG,SACQ;AACX,QACE,oBAAC;EACC,WAAW,GACT,YAAY;GAAE;GAAS;GAAO;GAAS;GAAO;GAAS;GAAK;GAAM,CAAC,EACnE,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,OAAO,EACd,WACA,SACA,OACA,SACA,OACA,SACA,KACA,MACA,GAAG,SACW;AACd,QACE,oBAAC;EACC,WAAW,GACT,eAAe;GAAE;GAAS;GAAO;GAAS;GAAO;GAAS;GAAK;GAAM,CAAC,EACtE,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,OAAO,EACd,WACA,SACA,OACA,SACA,OACA,SACA,KACA,GAAG,SACW;AACd,QACE,oBAAC;EACC,WAAW,GACT,eAAe;GAAE;GAAS;GAAO;GAAS;GAAO;GAAS;GAAK,CAAC,EAChE,UACD;EACD,GAAI;GACJ"}
|
package/dist/ui/stepper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime143 from "react/jsx-runtime";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as class_variance_authority_types13 from "class-variance-authority/types";
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ declare function Stepper({
|
|
|
17
17
|
total,
|
|
18
18
|
size,
|
|
19
19
|
className
|
|
20
|
-
}: StepperProps):
|
|
20
|
+
}: StepperProps): react_jsx_runtime143.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Stepper, StepperProps };
|
|
23
23
|
//# sourceMappingURL=stepper.d.ts.map
|
package/dist/ui/switch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime128 from "react/jsx-runtime";
|
|
3
3
|
import * as SwitchPrimitives from "@rn-primitives/switch";
|
|
4
4
|
|
|
5
5
|
//#region ui/switch.d.ts
|
|
@@ -8,7 +8,7 @@ declare function SwitchNative({
|
|
|
8
8
|
...props
|
|
9
9
|
}: SwitchPrimitives.RootProps & {
|
|
10
10
|
ref?: React$1.RefObject<SwitchPrimitives.RootRef>;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime128.JSX.Element;
|
|
12
12
|
declare const Switch: typeof SwitchNative;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { Switch };
|
package/dist/ui/switch.js
CHANGED
|
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import * as SwitchPrimitives from "@rn-primitives/switch";
|
|
8
8
|
|
|
9
9
|
//#region ui/switch.tsx
|
|
10
|
-
function SwitchWeb({ className
|
|
10
|
+
function SwitchWeb({ className, ...props }) {
|
|
11
11
|
return /* @__PURE__ */ jsx(SwitchPrimitives.Root, {
|
|
12
12
|
className: cn("peer focus-visible:ring-ring focus-visible:ring-offset-background h-6 w-11 shrink-0 cursor-pointer flex-row items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed", props.checked ? "bg-primary" : "bg-input", props.disabled && "opacity-50", className),
|
|
13
13
|
...props,
|
|
@@ -24,7 +24,7 @@ const RGB_COLORS = {
|
|
|
24
24
|
input: "rgb(39, 39, 42)"
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
function SwitchNative({ className
|
|
27
|
+
function SwitchNative({ className, ...props }) {
|
|
28
28
|
const { colorScheme } = useColorScheme();
|
|
29
29
|
const translateX = useDerivedValue(() => props.checked ? 18 : 0);
|
|
30
30
|
const animatedRootStyle = useAnimatedStyle(() => {
|
package/dist/ui/switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","names":[],"sources":["../../ui/switch.tsx"],"sourcesContent":["import * as SwitchPrimitives from '@rn-primitives/switch';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\nimport Animated, {\n interpolateColor,\n useAnimatedStyle,\n useDerivedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useColorScheme } from './useColorScheme';\nimport { cn } from './utils';\n\nfunction SwitchWeb({\n className,\n ...props\n}: SwitchPrimitives.RootProps & {\n ref?: React.RefObject<SwitchPrimitives.RootRef>;\n}) {\n return (\n <SwitchPrimitives.Root\n className={cn(\n 'peer focus-visible:ring-ring focus-visible:ring-offset-background h-6 w-11 shrink-0 cursor-pointer flex-row items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed',\n props.checked ? 'bg-primary' : 'bg-input',\n props.disabled && 'opacity-50',\n className\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n 'bg-background shadow-foreground/5 pointer-events-none block h-5 w-5 rounded-full shadow-md ring-0 transition-transform',\n props.checked ? 'translate-x-5' : 'translate-x-0'\n )}\n />\n </SwitchPrimitives.Root>\n );\n}\n\nconst RGB_COLORS = {\n light: {\n primary: 'rgb(24, 24, 27)',\n input: 'rgb(228, 228, 231)',\n },\n dark: {\n primary: 'rgb(250, 250, 250)',\n input: 'rgb(39, 39, 42)',\n },\n} as const;\n\nfunction SwitchNative({\n className,\n ...props\n}: SwitchPrimitives.RootProps & {\n ref?: React.RefObject<SwitchPrimitives.RootRef>;\n}) {\n const { colorScheme } = useColorScheme();\n const translateX = useDerivedValue(() => (props.checked ? 18 : 0));\n const animatedRootStyle = useAnimatedStyle(() => {\n return {\n backgroundColor: interpolateColor(\n translateX.value,\n [0, 18],\n [RGB_COLORS[colorScheme].input, RGB_COLORS[colorScheme].primary]\n ),\n };\n });\n const animatedThumbStyle = useAnimatedStyle(() => ({\n transform: [\n { translateX: withTiming(translateX.value, { duration: 200 }) },\n ],\n }));\n return (\n <Animated.View\n style={animatedRootStyle}\n className={cn(\n 'h-8 w-[46px] rounded-full',\n props.disabled && 'opacity-50'\n )}\n >\n <SwitchPrimitives.Root\n className={cn(\n 'h-8 w-[46px] shrink-0 flex-row items-center rounded-full border-2 border-transparent',\n props.checked ? 'bg-primary' : 'bg-input',\n className\n )}\n {...props}\n >\n <Animated.View style={animatedThumbStyle}>\n <SwitchPrimitives.Thumb\n className={\n 'bg-background shadow-foreground/25 h-7 w-7 rounded-full shadow-md ring-0'\n }\n />\n </Animated.View>\n </SwitchPrimitives.Root>\n </Animated.View>\n );\n}\n\nconst Switch = Platform.select({\n web: SwitchWeb,\n default: SwitchNative,\n});\n\nexport { Switch };\n"],"mappings":";;;;;;;;;AAYA,SAAS,UAAU,EACjB,
|
|
1
|
+
{"version":3,"file":"switch.js","names":[],"sources":["../../ui/switch.tsx"],"sourcesContent":["import * as SwitchPrimitives from '@rn-primitives/switch';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\nimport Animated, {\n interpolateColor,\n useAnimatedStyle,\n useDerivedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useColorScheme } from './useColorScheme';\nimport { cn } from './utils';\n\nfunction SwitchWeb({\n className,\n ...props\n}: SwitchPrimitives.RootProps & {\n ref?: React.RefObject<SwitchPrimitives.RootRef>;\n}) {\n return (\n <SwitchPrimitives.Root\n className={cn(\n 'peer focus-visible:ring-ring focus-visible:ring-offset-background h-6 w-11 shrink-0 cursor-pointer flex-row items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed',\n props.checked ? 'bg-primary' : 'bg-input',\n props.disabled && 'opacity-50',\n className\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n 'bg-background shadow-foreground/5 pointer-events-none block h-5 w-5 rounded-full shadow-md ring-0 transition-transform',\n props.checked ? 'translate-x-5' : 'translate-x-0'\n )}\n />\n </SwitchPrimitives.Root>\n );\n}\n\nconst RGB_COLORS = {\n light: {\n primary: 'rgb(24, 24, 27)',\n input: 'rgb(228, 228, 231)',\n },\n dark: {\n primary: 'rgb(250, 250, 250)',\n input: 'rgb(39, 39, 42)',\n },\n} as const;\n\nfunction SwitchNative({\n className,\n ...props\n}: SwitchPrimitives.RootProps & {\n ref?: React.RefObject<SwitchPrimitives.RootRef>;\n}) {\n const { colorScheme } = useColorScheme();\n const translateX = useDerivedValue(() => (props.checked ? 18 : 0));\n const animatedRootStyle = useAnimatedStyle(() => {\n return {\n backgroundColor: interpolateColor(\n translateX.value,\n [0, 18],\n [RGB_COLORS[colorScheme].input, RGB_COLORS[colorScheme].primary]\n ),\n };\n });\n const animatedThumbStyle = useAnimatedStyle(() => ({\n transform: [\n { translateX: withTiming(translateX.value, { duration: 200 }) },\n ],\n }));\n return (\n <Animated.View\n style={animatedRootStyle}\n className={cn(\n 'h-8 w-[46px] rounded-full',\n props.disabled && 'opacity-50'\n )}\n >\n <SwitchPrimitives.Root\n className={cn(\n 'h-8 w-[46px] shrink-0 flex-row items-center rounded-full border-2 border-transparent',\n props.checked ? 'bg-primary' : 'bg-input',\n className\n )}\n {...props}\n >\n <Animated.View style={animatedThumbStyle}>\n <SwitchPrimitives.Thumb\n className={\n 'bg-background shadow-foreground/25 h-7 w-7 rounded-full shadow-md ring-0'\n }\n />\n </Animated.View>\n </SwitchPrimitives.Root>\n </Animated.View>\n );\n}\n\nconst Switch = Platform.select({\n web: SwitchWeb,\n default: SwitchNative,\n});\n\nexport { Switch };\n"],"mappings":";;;;;;;;;AAYA,SAAS,UAAU,EACjB,WACA,GAAG,SAGF;AACD,QACE,oBAAC,iBAAiB;EAChB,WAAW,GACT,iSACA,MAAM,UAAU,eAAe,YAC/B,MAAM,YAAY,cAClB,UACD;EACD,GAAI;YAEJ,oBAAC,iBAAiB,SAChB,WAAW,GACT,0HACA,MAAM,UAAU,kBAAkB,gBACnC,GACD;GACoB;;AAI5B,MAAM,aAAa;CACjB,OAAO;EACL,SAAS;EACT,OAAO;EACR;CACD,MAAM;EACJ,SAAS;EACT,OAAO;EACR;CACF;AAED,SAAS,aAAa,EACpB,WACA,GAAG,SAGF;CACD,MAAM,EAAE,gBAAgB,gBAAgB;CACxC,MAAM,aAAa,sBAAuB,MAAM,UAAU,KAAK,EAAG;CAClE,MAAM,oBAAoB,uBAAuB;AAC/C,SAAO,EACL,iBAAiB,iBACf,WAAW,OACX,CAAC,GAAG,GAAG,EACP,CAAC,WAAW,aAAa,OAAO,WAAW,aAAa,QAAQ,CACjE,EACF;GACD;CACF,MAAM,qBAAqB,wBAAwB,EACjD,WAAW,CACT,EAAE,YAAY,WAAW,WAAW,OAAO,EAAE,UAAU,KAAK,CAAC,EAAE,CAChE,EACF,EAAE;AACH,QACE,oBAAC,SAAS;EACR,OAAO;EACP,WAAW,GACT,6BACA,MAAM,YAAY,aACnB;YAED,oBAAC,iBAAiB;GAChB,WAAW,GACT,wFACA,MAAM,UAAU,eAAe,YAC/B,UACD;GACD,GAAI;aAEJ,oBAAC,SAAS;IAAK,OAAO;cACpB,oBAAC,iBAAiB,SAChB,WACE,6EAEF;KACY;IACM;GACV;;AAIpB,MAAM,SAAS,SAAS,OAAO;CAC7B,KAAK;CACL,SAAS;CACV,CAAC"}
|