alouette 19.2.0 → 19.3.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 CHANGED
@@ -3,6 +3,12 @@
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.3.0](https://github.com/christophehurpeau/alouette/compare/alouette@19.2.0...alouette@19.3.0) (2026-06-27)
7
+
8
+ ### Features
9
+
10
+ * select component
11
+
6
12
  ## [19.2.0](https://github.com/christophehurpeau/alouette/compare/alouette@19.1.0...alouette@19.2.0) (2026-06-22)
7
13
 
8
14
  ### 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 { SelectOption, SelectProps } from "./ui/inputs/Select.shared";
58
+ export { Select } from "./ui/inputs/Select";
57
59
  export type { BadgeProps } from "./ui/feedback/Badge";
58
60
  export { Badge } from "./ui/feedback/Badge";
59
61
  export type { MessageProps } from "./ui/feedback/Message";
@@ -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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C;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,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"}
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from "react";
2
+ import { type SelectProps } from "./Select.shared";
3
+ export declare function Select({ accent, ...rest }: SelectProps): ReactNode;
4
+ //# sourceMappingURL=Select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/ui/inputs/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AASjD,OAAO,EAEL,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAC;AAwKzB,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,GAAG,SAAS,CAMlE"}
@@ -0,0 +1,30 @@
1
+ import { type ReactNode } from "react";
2
+ import type { Accent } from "../../core/AlouetteConfig";
3
+ export interface SelectOption {
4
+ label: string;
5
+ value: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface SelectProps {
9
+ options: SelectOption[];
10
+ /** Controlled selected value. */
11
+ value?: string;
12
+ /** Initial value for uncontrolled usage. */
13
+ defaultValue?: string;
14
+ onValueChange?: (value: string) => void;
15
+ placeholder?: string;
16
+ disabled?: boolean;
17
+ accent?: Accent;
18
+ "aria-label"?: string;
19
+ "aria-labelledby"?: string;
20
+ testID?: string;
21
+ }
22
+ export declare function useControllableValue(controlled: string | undefined, defaultValue: string | undefined, onValueChange?: (value: string) => void): readonly [string | undefined, (next: string) => void];
23
+ export declare const selectTriggerBaseClassName: string;
24
+ export interface SelectTriggerContentProps {
25
+ label?: string;
26
+ placeholder?: string;
27
+ disabled?: boolean;
28
+ }
29
+ export declare function SelectTriggerContent({ label, placeholder, disabled, }: SelectTriggerContentProps): ReactNode;
30
+ //# sourceMappingURL=Select.shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.shared.d.ts","sourceRoot":"","sources":["../../../../src/ui/inputs/Select.shared.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAIxD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GACtC,SAAS,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,CAevD;AAMD,eAAO,MAAM,0BAA0B,QAI5B,CAAC;AAeZ,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,WAAW,EACX,QAAQ,GACT,EAAE,yBAAyB,GAAG,SAAS,CAqBvC"}
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from "@storybook/react-vite";
2
+ import { Select } from "./Select";
3
+ type ThisStory = StoryObj<typeof Select>;
4
+ declare const _default: {
5
+ title: string;
6
+ component: typeof Select;
7
+ parameters: {
8
+ componentSubtitle: string;
9
+ };
10
+ argTypes: {
11
+ placeholder: {
12
+ control: "text";
13
+ };
14
+ disabled: {
15
+ control: "boolean";
16
+ };
17
+ };
18
+ };
19
+ export default _default;
20
+ export declare const PreviewSelectStory: ThisStory;
21
+ export declare const Variants: ThisStory;
22
+ export declare const Tests: StoryObj<typeof Select>;
23
+ //# sourceMappingURL=Select.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../../src/ui/inputs/Select.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,KAAK,SAAS,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;;;;;;;;;;;;;;;;AAmBzC,wBAWgC;AAEhC,eAAO,MAAM,kBAAkB,EAAE,SAGhC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,SA0DtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,OAAO,MAAM,CA6BzC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from "react";
2
+ import { type SelectProps } from "./Select.shared";
3
+ export declare function Select({ options, value, defaultValue, onValueChange, placeholder, disabled, accent, testID, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, }: SelectProps): ReactNode;
4
+ //# sourceMappingURL=Select.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.web.d.ts","sourceRoot":"","sources":["../../../../src/ui/inputs/Select.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtD,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAC;AAgEzB,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,GAClC,EAAE,WAAW,GAAG,SAAS,CA0EzB"}
@@ -4,6 +4,7 @@ import { createContext, useContext, forwardRef, Children, cloneElement, Fragment
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';
7
+ import { CaretDownRegularIcon } from 'alouette-icons/phosphor-icons/CaretDownRegularIcon';
7
8
  import { CheckRegularIcon } from 'alouette-icons/phosphor-icons/CheckRegularIcon';
8
9
  import { InfoRegularIcon } from 'alouette-icons/phosphor-icons/InfoRegularIcon';
9
10
  import { WarningRegularIcon } from 'alouette-icons/phosphor-icons/WarningRegularIcon';
@@ -1789,6 +1790,190 @@ function Switch({ accent, ...rest }) {
1789
1790
  return /* @__PURE__ */ jsx(AccentScope, { accent, children: /* @__PURE__ */ jsx(SwitchInner, { ...rest }) });
1790
1791
  }
1791
1792
 
1793
+ function useControllableValue(controlled, defaultValue, onValueChange) {
1794
+ const [internal, setInternal] = useState(defaultValue);
1795
+ const value = controlled ?? internal;
1796
+ const setValue = useCallback(
1797
+ (next) => {
1798
+ if (controlled === void 0) {
1799
+ setInternal(next);
1800
+ }
1801
+ if (next !== value) {
1802
+ onValueChange?.(next);
1803
+ }
1804
+ },
1805
+ [controlled, onValueChange, value]
1806
+ );
1807
+ return [value, setValue];
1808
+ }
1809
+ const triggerLabelVariants = tv({
1810
+ base: "flex-1 text-base",
1811
+ variants: {
1812
+ // Mirrors InputText: sharp value, form-placeholder, form-disabled-text.
1813
+ state: {
1814
+ value: "text-sharp",
1815
+ placeholder: "text-form-placeholder",
1816
+ disabled: "text-form-disabled-text"
1817
+ }
1818
+ },
1819
+ defaultVariants: { state: "value" }
1820
+ });
1821
+ function SelectTriggerContent({
1822
+ label,
1823
+ placeholder,
1824
+ disabled
1825
+ }) {
1826
+ const state = (() => {
1827
+ if (label === void 0) return "placeholder";
1828
+ if (disabled) return "disabled";
1829
+ return "value";
1830
+ })();
1831
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1832
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, className: triggerLabelVariants({ state }), children: label ?? placeholder ?? "" }),
1833
+ /* @__PURE__ */ jsx(
1834
+ Icon,
1835
+ {
1836
+ icon: /* @__PURE__ */ jsx(CaretDownRegularIcon, {}),
1837
+ size: 18,
1838
+ className: disabled ? "text-form-disabled-text" : "text-muted"
1839
+ }
1840
+ )
1841
+ ] });
1842
+ }
1843
+
1844
+ const wrapperVariants = tv(
1845
+ {
1846
+ base: [
1847
+ "flex-row flex-1 rounded-md border min-h-11",
1848
+ "transition-[border-color,outline-color] duration-200 ease-in",
1849
+ "outline-interactive-outlined-pressable"
1850
+ // for a proper outline color transition
1851
+ ].join(" "),
1852
+ variants: {
1853
+ // bg lives in each branch (not base) so the disabled bg never competes
1854
+ // with bg-highlight: two same-specificity background utilities would let
1855
+ // stylesheet order, not className order, decide the winner.
1856
+ disabled: {
1857
+ true: "bg-disabled-interactive-muted border-interactive-outlined-disabled cursor-not-allowed",
1858
+ false: [
1859
+ "bg-highlight",
1860
+ "border-interactive-outlined-pressable",
1861
+ "hover:border-interactive-outlined-hover",
1862
+ "focus-within:border-interactive-outlined-focus",
1863
+ "focus-within:outline-1 focus-within:outline-interactive-outlined-focus focus-within:outline-offset-0",
1864
+ "active:border-interactive-outlined-active"
1865
+ ].join(" ")
1866
+ }
1867
+ },
1868
+ defaultVariants: { disabled: false }
1869
+ },
1870
+ { twMerge: false }
1871
+ );
1872
+ const paddingX = 16;
1873
+ const caretReserve = 26;
1874
+ const selectStyle = (disabled) => ({
1875
+ appearance: "none",
1876
+ WebkitAppearance: "none",
1877
+ boxSizing: "border-box",
1878
+ minHeight: 44,
1879
+ width: "auto",
1880
+ margin: 0,
1881
+ border: 0,
1882
+ background: "transparent",
1883
+ color: "transparent",
1884
+ font: "inherit",
1885
+ paddingTop: 0,
1886
+ paddingBottom: 0,
1887
+ paddingLeft: paddingX,
1888
+ paddingRight: paddingX + caretReserve,
1889
+ outline: "none",
1890
+ cursor: disabled ? "not-allowed" : "pointer"
1891
+ });
1892
+ function Select({
1893
+ options,
1894
+ value,
1895
+ defaultValue,
1896
+ onValueChange,
1897
+ placeholder,
1898
+ disabled,
1899
+ accent,
1900
+ testID,
1901
+ "aria-label": ariaLabel,
1902
+ "aria-labelledby": ariaLabelledby
1903
+ }) {
1904
+ const [current, setValue] = useControllableValue(
1905
+ value,
1906
+ defaultValue,
1907
+ onValueChange
1908
+ );
1909
+ const selected = options.find((option) => option.value === current);
1910
+ const [sharpColor, disabledTextColor, placeholderColor, highlightColor] = useThemeToken([
1911
+ "--color-sharp",
1912
+ "--color-form-disabled-text",
1913
+ "--color-form-placeholder",
1914
+ "--color-highlight"
1915
+ ]);
1916
+ const optionStyle = (optionDisabled) => ({
1917
+ color: optionDisabled ? disabledTextColor : sharpColor,
1918
+ backgroundColor: highlightColor
1919
+ });
1920
+ return /* @__PURE__ */ jsx(AccentScope, { accent, children: /* @__PURE__ */ jsxs(View$1, { className: wrapperVariants({ disabled }), children: [
1921
+ /* @__PURE__ */ jsxs(
1922
+ "select",
1923
+ {
1924
+ value: current ?? "",
1925
+ disabled,
1926
+ "aria-label": ariaLabel,
1927
+ "aria-labelledby": ariaLabelledby,
1928
+ "data-testid": testID,
1929
+ style: selectStyle(disabled),
1930
+ onChange: (event) => {
1931
+ setValue(event.target.value);
1932
+ },
1933
+ children: [
1934
+ placeholder === void 0 ? null : /* @__PURE__ */ jsx(
1935
+ "option",
1936
+ {
1937
+ disabled: true,
1938
+ value: "",
1939
+ style: {
1940
+ color: placeholderColor,
1941
+ backgroundColor: highlightColor
1942
+ },
1943
+ children: placeholder
1944
+ }
1945
+ ),
1946
+ options.map((option) => /* @__PURE__ */ jsx(
1947
+ "option",
1948
+ {
1949
+ value: option.value,
1950
+ disabled: option.disabled,
1951
+ style: optionStyle(option.disabled),
1952
+ children: option.label
1953
+ },
1954
+ option.value
1955
+ ))
1956
+ ]
1957
+ }
1958
+ ),
1959
+ /* @__PURE__ */ jsx(
1960
+ View$1,
1961
+ {
1962
+ pointerEvents: "none",
1963
+ className: "absolute inset-0 flex-row items-center justify-between gap-xs px-m",
1964
+ children: /* @__PURE__ */ jsx(
1965
+ SelectTriggerContent,
1966
+ {
1967
+ label: selected?.label,
1968
+ placeholder,
1969
+ disabled
1970
+ }
1971
+ )
1972
+ }
1973
+ )
1974
+ ] }) });
1975
+ }
1976
+
1792
1977
  const badgeVariants = tv(
1793
1978
  {
1794
1979
  slots: {
@@ -2084,5 +2269,5 @@ function ExternalLink({
2084
2269
  );
2085
2270
  }
2086
2271
 
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 };
2272
+ 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, Select, 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 };
2088
2273
  //# sourceMappingURL=index-browser.es.js.map