alouette 19.1.0 → 19.2.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/CHANGELOG.md +11 -0
- package/dist/definitions/index.d.ts +2 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/ui/containers/Box.d.ts +1 -0
- package/dist/definitions/ui/containers/Box.d.ts.map +1 -1
- package/dist/definitions/ui/feedback/Badge.d.ts +119 -0
- package/dist/definitions/ui/feedback/Badge.d.ts.map +1 -0
- package/dist/definitions/ui/feedback/Badge.stories.d.ts +50 -0
- package/dist/definitions/ui/feedback/Badge.stories.d.ts.map +1 -0
- package/dist/definitions/ui/inputs/Switch.web.d.ts.map +1 -1
- package/dist/index-browser.es.js +94 -15
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-node22.cjs +70 -0
- package/dist/index-node22.cjs.map +1 -1
- package/dist/index-node22.mjs +71 -2
- package/dist/index-node22.mjs.map +1 -1
- package/dist/index-react-native.cjs.js +70 -0
- package/dist/index-react-native.cjs.js.map +1 -1
- package/dist/index-react-native.es.js +71 -2
- package/dist/index-react-native.es.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/ui/containers/Box.tsx +24 -1
- package/src/ui/feedback/Badge.stories.tsx +83 -0
- package/src/ui/feedback/Badge.tsx +75 -0
- package/src/ui/inputs/Switch.web.tsx +23 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [19.2.0](https://github.com/christophehurpeau/alouette/compare/alouette@19.1.0...alouette@19.2.0) (2026-06-22)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add Badge component with variants and sizes
|
|
11
|
+
* add InteractiveBoxHitSlop component and change Switch to have smaller size
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add aria-disabled attribute to Switch component for better accessibility
|
|
16
|
+
|
|
6
17
|
## [19.1.0](https://github.com/christophehurpeau/alouette/compare/alouette@19.0.0...alouette@19.1.0) (2026-06-21)
|
|
7
18
|
|
|
8
19
|
### Features
|
|
@@ -54,6 +54,8 @@ export type { TextAreaProps } from "./ui/inputs/TextArea";
|
|
|
54
54
|
export { TextArea } from "./ui/inputs/TextArea";
|
|
55
55
|
export type { SwitchProps } from "./ui/inputs/Switch";
|
|
56
56
|
export { Switch } from "./ui/inputs/Switch";
|
|
57
|
+
export type { BadgeProps } from "./ui/feedback/Badge";
|
|
58
|
+
export { Badge } from "./ui/feedback/Badge";
|
|
57
59
|
export type { MessageProps } from "./ui/feedback/Message";
|
|
58
60
|
export { ConfirmationMessage, InfoMessage, Message, WarningMessage, } from "./ui/feedback/Message";
|
|
59
61
|
export type { PressableListItemProps } from "./ui/data/PressableListItem";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA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EACL,wBAAwB,EACxB,gCAAgC,GACjC,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACvE,YAAY,EACV,iBAAiB,EACjB,kCAAkC,EAClC,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -22,6 +22,7 @@ export declare const interactiveBoxVariants: import("tailwind-variants").TVRetur
|
|
|
22
22
|
export interface InteractiveBoxProps extends VariantProps<typeof interactiveBoxVariants>, PressableProps {
|
|
23
23
|
}
|
|
24
24
|
export declare const InteractiveBox: import("react").ForwardRefExoticComponent<InteractiveBoxProps & import("react").RefAttributes<RNView>>;
|
|
25
|
+
export declare const InteractiveBoxHitSlop: import("react").ForwardRefExoticComponent<InteractiveBoxProps & import("react").RefAttributes<RNView>>;
|
|
25
26
|
export type SafeAreaBoxProps = Omit<BoxProps, "style">;
|
|
26
27
|
export declare const SafeAreaBox: import("react").ForwardRefExoticComponent<SafeAreaBoxProps & import("react").RefAttributes<RNView>>;
|
|
27
28
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/ui/containers/Box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/ui/containers/Box.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,IAAI,IAAI,MAAM,EACd,KAAK,SAAS,IAAI,WAAW,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAMxD,eAAO,MAAM,cAAc,WAAW,CAAC;AAEvC,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,GAAG,6FAYf,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;mDAajC,CAAC;AAEH,MAAM,WAAW,mBACf,SAAQ,YAAY,CAAC,OAAO,sBAAsB,CAAC,EAAE,cAAc;CAAG;AAExE,eAAO,MAAM,cAAc,wGAU1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,wGAoBjC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAEvD,eAAO,MAAM,WAAW,qGAgBvB,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type VariantProps } from "tailwind-variants";
|
|
3
|
+
import type { Accent } from "../../core/AlouetteConfig";
|
|
4
|
+
import { type SVGIconElement } from "../primitives/Icon";
|
|
5
|
+
declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
6
|
+
size: {
|
|
7
|
+
sm: {
|
|
8
|
+
frame: string;
|
|
9
|
+
text: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
};
|
|
12
|
+
md: {
|
|
13
|
+
frame: string;
|
|
14
|
+
text: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
variant: {
|
|
19
|
+
solid: {
|
|
20
|
+
frame: string;
|
|
21
|
+
text: string;
|
|
22
|
+
icon: string;
|
|
23
|
+
};
|
|
24
|
+
"solid.enabled": {
|
|
25
|
+
frame: string;
|
|
26
|
+
text: string;
|
|
27
|
+
icon: string;
|
|
28
|
+
};
|
|
29
|
+
outlined: {
|
|
30
|
+
frame: string;
|
|
31
|
+
text: string;
|
|
32
|
+
icon: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}, {
|
|
36
|
+
frame: string;
|
|
37
|
+
text: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
}, undefined, {
|
|
40
|
+
size: {
|
|
41
|
+
sm: {
|
|
42
|
+
frame: string;
|
|
43
|
+
text: string;
|
|
44
|
+
icon: string;
|
|
45
|
+
};
|
|
46
|
+
md: {
|
|
47
|
+
frame: string;
|
|
48
|
+
text: string;
|
|
49
|
+
icon: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
variant: {
|
|
53
|
+
solid: {
|
|
54
|
+
frame: string;
|
|
55
|
+
text: string;
|
|
56
|
+
icon: string;
|
|
57
|
+
};
|
|
58
|
+
"solid.enabled": {
|
|
59
|
+
frame: string;
|
|
60
|
+
text: string;
|
|
61
|
+
icon: string;
|
|
62
|
+
};
|
|
63
|
+
outlined: {
|
|
64
|
+
frame: string;
|
|
65
|
+
text: string;
|
|
66
|
+
icon: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}, {
|
|
70
|
+
frame: string;
|
|
71
|
+
text: string;
|
|
72
|
+
icon: string;
|
|
73
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
74
|
+
size: {
|
|
75
|
+
sm: {
|
|
76
|
+
frame: string;
|
|
77
|
+
text: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
};
|
|
80
|
+
md: {
|
|
81
|
+
frame: string;
|
|
82
|
+
text: string;
|
|
83
|
+
icon: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
variant: {
|
|
87
|
+
solid: {
|
|
88
|
+
frame: string;
|
|
89
|
+
text: string;
|
|
90
|
+
icon: string;
|
|
91
|
+
};
|
|
92
|
+
"solid.enabled": {
|
|
93
|
+
frame: string;
|
|
94
|
+
text: string;
|
|
95
|
+
icon: string;
|
|
96
|
+
};
|
|
97
|
+
outlined: {
|
|
98
|
+
frame: string;
|
|
99
|
+
text: string;
|
|
100
|
+
icon: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}, {
|
|
104
|
+
frame: string;
|
|
105
|
+
text: string;
|
|
106
|
+
icon: string;
|
|
107
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
108
|
+
type BadgeVariantProps = VariantProps<typeof badgeVariants>;
|
|
109
|
+
type BadgeSize = NonNullable<BadgeVariantProps["size"]>;
|
|
110
|
+
export interface BadgeProps {
|
|
111
|
+
accent?: Accent;
|
|
112
|
+
size?: BadgeSize;
|
|
113
|
+
variant?: NonNullable<BadgeVariantProps["variant"]>;
|
|
114
|
+
icon?: SVGIconElement;
|
|
115
|
+
children?: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
export declare function Badge({ accent, size, variant, icon, children, }: BadgeProps): ReactNode;
|
|
118
|
+
export {};
|
|
119
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/ui/feedback/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,YAAY,EAAM,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAiClB,CAAC;AAEF,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC5D,KAAK,SAAS,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAIxD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,KAAK,CAAC,EACpB,MAAgB,EAChB,IAAW,EACX,OAAiB,EACjB,IAAI,EACJ,QAAQ,GACT,EAAE,UAAU,GAAG,SAAS,CAYxB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Badge } from "./Badge";
|
|
3
|
+
type ThisStory = StoryObj<typeof Badge>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof Badge;
|
|
7
|
+
parameters: {
|
|
8
|
+
componentSubtitle: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
accent: {
|
|
12
|
+
description: string;
|
|
13
|
+
control: "select";
|
|
14
|
+
options: import("../..").Accent[];
|
|
15
|
+
table: {
|
|
16
|
+
defaultValue: {
|
|
17
|
+
summary: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
variant: {
|
|
22
|
+
description: string;
|
|
23
|
+
control: "select";
|
|
24
|
+
options: readonly ["solid", "solid.enabled", "outlined"];
|
|
25
|
+
table: {
|
|
26
|
+
defaultValue: {
|
|
27
|
+
summary: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
size: {
|
|
32
|
+
description: string;
|
|
33
|
+
control: "select";
|
|
34
|
+
options: readonly ["sm", "md"];
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: {
|
|
37
|
+
summary: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
children: {
|
|
42
|
+
description: string;
|
|
43
|
+
control: "text";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
48
|
+
export declare const BadgePreviewStory: ThisStory;
|
|
49
|
+
export declare const BadgeVariantsStory: ThisStory;
|
|
50
|
+
//# sourceMappingURL=Badge.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../../src/ui/feedback/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,KAAK,SAAS,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKxC,wBA2B+B;AAE/B,eAAO,MAAM,iBAAiB,EAAE,SAI/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAoChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.web.d.ts","sourceRoot":"","sources":["../../../../src/ui/inputs/Switch.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.web.d.ts","sourceRoot":"","sources":["../../../../src/ui/inputs/Switch.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AA8CxD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAiED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,GAAG,SAAS,CAMlE"}
|
package/dist/index-browser.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import { VariableContextProvider, styled as styled$1 } from 'nativewind';
|
|
3
|
-
import { createContext, useContext, forwardRef,
|
|
3
|
+
import { createContext, useContext, forwardRef, Children, cloneElement, Fragment, useRef, useState, useEffect, isValidElement, useCallback } from 'react';
|
|
4
4
|
import { useColorScheme, View as View$1, Text as Text$1, ScrollView as ScrollView$1, FlatList as FlatList$1, SectionList as SectionList$1, Pressable, Platform, TextInput, useWindowDimensions } from 'react-native-web';
|
|
5
5
|
import { extendTailwindMerge, twMerge as twMerge$1 } from 'tailwind-merge';
|
|
6
6
|
import { tv } from 'tailwind-variants';
|
|
@@ -795,6 +795,26 @@ const InteractiveBox = forwardRef(
|
|
|
795
795
|
}
|
|
796
796
|
)
|
|
797
797
|
);
|
|
798
|
+
const InteractiveBoxHitSlop = forwardRef(
|
|
799
|
+
({ withFocusVisibleOutline, children, className, ...rest }, ref) => {
|
|
800
|
+
const child = Children.only(children);
|
|
801
|
+
return /* @__PURE__ */ jsx(
|
|
802
|
+
Pressable,
|
|
803
|
+
{
|
|
804
|
+
ref,
|
|
805
|
+
pointerEvents: "auto",
|
|
806
|
+
className: `flex-center ${className ?? ""}`,
|
|
807
|
+
...rest,
|
|
808
|
+
children: cloneElement(child, {
|
|
809
|
+
className: interactiveBoxVariants({
|
|
810
|
+
withFocusVisibleOutline,
|
|
811
|
+
className: child.props.className
|
|
812
|
+
})
|
|
813
|
+
})
|
|
814
|
+
}
|
|
815
|
+
);
|
|
816
|
+
}
|
|
817
|
+
);
|
|
798
818
|
const SafeAreaBox = forwardRef(
|
|
799
819
|
(props, ref) => {
|
|
800
820
|
const insets = useSafeAreaInsets();
|
|
@@ -1665,8 +1685,9 @@ const TextArea = forwardRef((props, ref) => {
|
|
|
1665
1685
|
return /* @__PURE__ */ jsx(InputText, { ref, multiline: true, ...props });
|
|
1666
1686
|
});
|
|
1667
1687
|
|
|
1668
|
-
const
|
|
1669
|
-
const
|
|
1688
|
+
const PRESSABLE_HEIGHT = 44;
|
|
1689
|
+
const TRACK_HEIGHT = 36;
|
|
1690
|
+
const TRACK_WIDTH = 58;
|
|
1670
1691
|
const THUMB_PADDING = TRACK_HEIGHT * 0.1;
|
|
1671
1692
|
const THUMB_SIZE = TRACK_HEIGHT * 0.8;
|
|
1672
1693
|
const TRAVEL_X = TRACK_WIDTH - THUMB_SIZE - THUMB_PADDING * 2;
|
|
@@ -1674,6 +1695,8 @@ const trackVariants = tv(
|
|
|
1674
1695
|
{
|
|
1675
1696
|
// TODO if we can fix web to use proper button, change aria-disabled to disabled
|
|
1676
1697
|
base: [
|
|
1698
|
+
"height-[36px] w-[58px]",
|
|
1699
|
+
// Must be identical to TRACK_HEIGHT and TRACK_WIDTH constants above
|
|
1677
1700
|
"relative rounded-full overflow-hidden shadow-lowered pointer-events-auto",
|
|
1678
1701
|
"transition-background-color duration-200 ease-in",
|
|
1679
1702
|
"outline-interactive-outlined-outline-focus",
|
|
@@ -1725,15 +1748,14 @@ function SwitchInner({
|
|
|
1725
1748
|
}) {
|
|
1726
1749
|
const [value, setValue] = useControllableChecked(checked, onValueChange);
|
|
1727
1750
|
return /* @__PURE__ */ jsx(
|
|
1728
|
-
|
|
1751
|
+
InteractiveBoxHitSlop,
|
|
1729
1752
|
{
|
|
1730
1753
|
withFocusVisibleOutline: true,
|
|
1731
1754
|
role: "switch",
|
|
1732
1755
|
"aria-checked": value,
|
|
1733
1756
|
"aria-disabled": disabled === true,
|
|
1734
1757
|
disabled,
|
|
1735
|
-
|
|
1736
|
-
style: { width: TRACK_WIDTH, height: TRACK_HEIGHT },
|
|
1758
|
+
style: { height: PRESSABLE_HEIGHT, width: TRACK_WIDTH },
|
|
1737
1759
|
onPress: () => {
|
|
1738
1760
|
setValue(!value);
|
|
1739
1761
|
},
|
|
@@ -1742,14 +1764,22 @@ function SwitchInner({
|
|
|
1742
1764
|
View$1,
|
|
1743
1765
|
{
|
|
1744
1766
|
"aria-disabled": disabled === true,
|
|
1745
|
-
className:
|
|
1746
|
-
style: {
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1767
|
+
className: trackVariants({ checked: value, forceStyle }),
|
|
1768
|
+
style: { width: TRACK_WIDTH, height: TRACK_HEIGHT },
|
|
1769
|
+
children: /* @__PURE__ */ jsx(
|
|
1770
|
+
View$1,
|
|
1771
|
+
{
|
|
1772
|
+
"aria-disabled": disabled === true,
|
|
1773
|
+
className: thumbVariants({}),
|
|
1774
|
+
style: {
|
|
1775
|
+
width: THUMB_SIZE,
|
|
1776
|
+
height: THUMB_SIZE,
|
|
1777
|
+
top: THUMB_PADDING,
|
|
1778
|
+
left: THUMB_PADDING,
|
|
1779
|
+
transform: [{ translateX: value ? TRAVEL_X : 0 }]
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
)
|
|
1753
1783
|
}
|
|
1754
1784
|
)
|
|
1755
1785
|
}
|
|
@@ -1759,6 +1789,55 @@ function Switch({ accent, ...rest }) {
|
|
|
1759
1789
|
return /* @__PURE__ */ jsx(AccentScope, { accent, children: /* @__PURE__ */ jsx(SwitchInner, { ...rest }) });
|
|
1760
1790
|
}
|
|
1761
1791
|
|
|
1792
|
+
const badgeVariants = tv(
|
|
1793
|
+
{
|
|
1794
|
+
slots: {
|
|
1795
|
+
frame: "flex-row items-center self-start rounded-full",
|
|
1796
|
+
text: "font-body-bold",
|
|
1797
|
+
icon: ""
|
|
1798
|
+
},
|
|
1799
|
+
variants: {
|
|
1800
|
+
size: {
|
|
1801
|
+
sm: { frame: "gap-xxs px-xs py-xxs", text: "text-xs", icon: "" },
|
|
1802
|
+
md: { frame: "gap-xs px-sm py-xxs", text: "text-sm", icon: "" }
|
|
1803
|
+
},
|
|
1804
|
+
variant: {
|
|
1805
|
+
solid: {
|
|
1806
|
+
frame: "bg-highlight-accent",
|
|
1807
|
+
text: "text-sharp",
|
|
1808
|
+
icon: "text-sharp"
|
|
1809
|
+
},
|
|
1810
|
+
"solid.enabled": {
|
|
1811
|
+
frame: "bg-enabled",
|
|
1812
|
+
text: "text-sharp",
|
|
1813
|
+
icon: "text-sharp"
|
|
1814
|
+
},
|
|
1815
|
+
outlined: {
|
|
1816
|
+
frame: "border border-accent",
|
|
1817
|
+
text: "text-accent",
|
|
1818
|
+
icon: "text-accent"
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
defaultVariants: { size: "md", variant: "solid" }
|
|
1823
|
+
},
|
|
1824
|
+
{ twMerge: false }
|
|
1825
|
+
);
|
|
1826
|
+
const ICON_SIZE$1 = { sm: 12, md: 16 };
|
|
1827
|
+
function Badge({
|
|
1828
|
+
accent = "brand",
|
|
1829
|
+
size = "md",
|
|
1830
|
+
variant = "solid",
|
|
1831
|
+
icon,
|
|
1832
|
+
children
|
|
1833
|
+
}) {
|
|
1834
|
+
const styles = badgeVariants({ size, variant });
|
|
1835
|
+
return /* @__PURE__ */ jsx(AccentScope, { accent, children: /* @__PURE__ */ jsxs(Box, { className: styles.frame(), children: [
|
|
1836
|
+
icon ? /* @__PURE__ */ jsx(Icon, { icon, size: ICON_SIZE$1[size], className: styles.icon() }) : null,
|
|
1837
|
+
/* @__PURE__ */ jsx(Text, { className: styles.text(), children })
|
|
1838
|
+
] }) });
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1762
1841
|
const messageFrameVariants = tv(
|
|
1763
1842
|
{
|
|
1764
1843
|
base: "flex-row items-center bg-highlight-accent overflow-hidden",
|
|
@@ -2005,5 +2084,5 @@ function ExternalLink({
|
|
|
2005
2084
|
);
|
|
2006
2085
|
}
|
|
2007
2086
|
|
|
2008
|
-
export { AccentScope, AlouetteDecorator, AlouetteProvider, Box, BreakpointNameEnum, Breakpoints, Button, ConfirmationMessage, ExternalLink, ExternalLinkButton, FlatList, GradientBackground, GradientScrollView, HStack, Icon, IconButton, InfoMessage, InputText, InteractiveBox, InternalLinkButton, Message, Paragraph, PresenceList, PresenceOne, PressableBox, PressableListItem, SafeAreaBox, SafeAreaProvider, ScopedTheme, ScrollView, SectionList, Separator, Stack, Story, StoryContainer, StoryDecorator, StoryGrid, StoryTitle, Surface, Switch, SwitchBreakpointsUsingDisplayNone, SwitchBreakpointsUsingNull, Text, TextArea, VStack, View, WarningMessage, animationDurationsMs, styled, themeVariables, useCurrentBreakpointName, useCurrentBreakpointNameFiltered, useCurrentMode, useCurrentTheme, useSafeAreaInsets, useThemeToken };
|
|
2087
|
+
export { AccentScope, AlouetteDecorator, AlouetteProvider, Badge, Box, BreakpointNameEnum, Breakpoints, Button, ConfirmationMessage, ExternalLink, ExternalLinkButton, FlatList, GradientBackground, GradientScrollView, HStack, Icon, IconButton, InfoMessage, InputText, InteractiveBox, InternalLinkButton, Message, Paragraph, PresenceList, PresenceOne, PressableBox, PressableListItem, SafeAreaBox, SafeAreaProvider, ScopedTheme, ScrollView, SectionList, Separator, Stack, Story, StoryContainer, StoryDecorator, StoryGrid, StoryTitle, Surface, Switch, SwitchBreakpointsUsingDisplayNone, SwitchBreakpointsUsingNull, Text, TextArea, VStack, View, WarningMessage, animationDurationsMs, styled, themeVariables, useCurrentBreakpointName, useCurrentBreakpointNameFiltered, useCurrentMode, useCurrentTheme, useSafeAreaInsets, useThemeToken };
|
|
2009
2088
|
//# sourceMappingURL=index-browser.es.js.map
|