@telegraph/combobox 0.1.28 → 0.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 +19 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Combobox/Combobox.d.ts +10 -10
- package/dist/types/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/Combobox/index.d.ts +1 -0
- package/dist/types/Combobox/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -8,7 +8,7 @@ import { default as React } from 'react';
|
|
|
8
8
|
import { Primitives } from './Combobox.primitives';
|
|
9
9
|
import { DefinedOption, Option } from './Combobox.types';
|
|
10
10
|
type LayoutValue<O> = O extends DefinedOption | string | undefined ? never : "truncate" | "wrap";
|
|
11
|
-
type RootProps<O extends (Option | Array<Option>) | (string | Array<string>), LB extends boolean> = {
|
|
11
|
+
export type RootProps<O extends (Option | Array<Option>) | (string | Array<string>), LB extends boolean> = {
|
|
12
12
|
value?: O;
|
|
13
13
|
defaultValue?: O;
|
|
14
14
|
onValueChange?: (value: O) => void;
|
|
@@ -49,33 +49,33 @@ declare const Root: <O extends (Option | Array<Option>) | (string | Array<string
|
|
|
49
49
|
type ChildrenValue = string | Array<string> | never;
|
|
50
50
|
type ChildrenFnValue<V extends ChildrenValue> = V extends never ? never : V extends string ? DefinedOption | undefined : Array<DefinedOption>;
|
|
51
51
|
type TriggerBaseProps = RemappedOmit<TgphComponentProps<typeof TelegraphButton.Root> & TgphComponentProps<typeof TelegraphMenu.Trigger>, "children">;
|
|
52
|
-
type TriggerProps<V extends ChildrenValue> = TriggerBaseProps & {
|
|
52
|
+
export type TriggerProps<V extends ChildrenValue> = TriggerBaseProps & {
|
|
53
53
|
placeholder?: string;
|
|
54
54
|
children?: React.ReactNode | ((props: {
|
|
55
55
|
value: ChildrenFnValue<V>;
|
|
56
56
|
}) => React.ReactNode);
|
|
57
57
|
};
|
|
58
58
|
declare const Trigger: <V extends ChildrenValue>({ size, children, ...props }: TriggerProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
type ContentProps<T extends TgphElement> = TgphComponentProps<typeof TelegraphMenu.Content<T>>;
|
|
60
|
-
declare const Content: <T extends TgphElement>({ style, children, tgphRef, ...props }: ContentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
-
type OptionsProps<T extends TgphElement> = TgphComponentProps<typeof Stack<T>>;
|
|
62
|
-
declare const Options: <T extends TgphElement>({ tgphRef, ...props }: OptionsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
-
type OptionProps<T extends TgphElement> = TgphComponentProps<typeof TelegraphMenu.Button<T>> & {
|
|
59
|
+
export type ContentProps<T extends TgphElement = "div"> = TgphComponentProps<typeof TelegraphMenu.Content<T>>;
|
|
60
|
+
declare const Content: <T extends TgphElement = "div">({ style, children, tgphRef, ...props }: ContentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export type OptionsProps<T extends TgphElement = "div"> = TgphComponentProps<typeof Stack<T>>;
|
|
62
|
+
declare const Options: <T extends TgphElement = "div">({ tgphRef, ...props }: OptionsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export type OptionProps<T extends TgphElement = "button"> = TgphComponentProps<typeof TelegraphMenu.Button<T>> & {
|
|
64
64
|
value: DefinedOption["value"];
|
|
65
65
|
label?: DefinedOption["label"];
|
|
66
66
|
selected?: boolean | null;
|
|
67
67
|
};
|
|
68
68
|
declare const Option: <T extends TgphElement>({ value, label, selected, onSelect, children, ...props }: OptionProps<T>) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
69
|
-
type SearchProps = TgphComponentProps<typeof TelegraphInput> & {
|
|
69
|
+
export type SearchProps = TgphComponentProps<typeof TelegraphInput> & {
|
|
70
70
|
label?: string;
|
|
71
71
|
};
|
|
72
72
|
declare const Search: ({ label, placeholder, tgphRef, value: controlledValueProp, onValueChange: onValueChangeProp, ...props }: SearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
type EmptyProps<T extends TgphElement> = TgphComponentProps<typeof Stack<T>> & {
|
|
73
|
+
export type EmptyProps<T extends TgphElement = "div"> = TgphComponentProps<typeof Stack<T>> & {
|
|
74
74
|
icon?: TgphComponentProps<typeof Icon> | null;
|
|
75
75
|
message?: string | null;
|
|
76
76
|
};
|
|
77
77
|
declare const Empty: <T extends TgphElement>({ icon, message, children, ...props }: EmptyProps<T>) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
78
|
-
type CreateProps<T extends TgphElement, LB extends boolean> = TgphComponentProps<typeof TelegraphMenu.Button<T>> & {
|
|
78
|
+
export type CreateProps<T extends TgphElement = "button", LB extends boolean = false> = TgphComponentProps<typeof TelegraphMenu.Button<T>> & {
|
|
79
79
|
leadingText?: string;
|
|
80
80
|
} & (LB extends true ? {
|
|
81
81
|
values: Array<DefinedOption>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/Combobox/Combobox.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAO,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EACV,a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AE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,cAAc,EAAE,IAAI,CAAC;CACtB,GACD;IACE,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,CAAC,CAAC;AAET,QAAA,MAAM,MAAM,GAAI,CAAC,SAAS,WAAW,EAAE,EAAE,SAAS,OAAO,EAAE,uEAOxD,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,wDAuCpB,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAS;IACrB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,UAAU,CAAC;CAC/B,CAAC;AAcF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { Combobox } from './Combobox';
|
|
2
|
+
export type { RootProps as ComboboxRootProps, TriggerProps as ComboboxTriggerProps, ContentProps as ComboboxContentProps, OptionsProps as ComboboxOptionsProps, OptionProps as ComboboxOptionProps, SearchProps as ComboboxSearchProps, EmptyProps as ComboboxEmptyProps, CreateProps as ComboboxCreateProps, } from './Combobox';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,SAAS,IAAI,iBAAiB,EAC9B,YAAY,IAAI,oBAAoB,EACpC,YAAY,IAAI,oBAAoB,EACpC,YAAY,IAAI,oBAAoB,EACpC,WAAW,IAAI,mBAAmB,EAClC,WAAW,IAAI,mBAAmB,EAClC,UAAU,IAAI,kBAAkB,EAChC,WAAW,IAAI,mBAAmB,GACnC,MAAM,YAAY,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { Combobox } from './Combobox';
|
|
2
|
+
export type { ComboboxRootProps, ComboboxTriggerProps, ComboboxContentProps, ComboboxOptionsProps, ComboboxOptionProps, ComboboxSearchProps, ComboboxEmptyProps, ComboboxCreateProps, } from './Combobox';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/combobox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A styled menu, triggered by a Select, that combines an Input and Single- or Multi-select.",
|
|
5
5
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/combobox",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"@radix-ui/react-portal": "^1.1.10",
|
|
38
38
|
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
39
39
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
40
|
-
"@telegraph/button": "^0.
|
|
40
|
+
"@telegraph/button": "^0.4.0",
|
|
41
41
|
"@telegraph/compose-refs": "^0.0.8",
|
|
42
42
|
"@telegraph/helpers": "^0.0.15",
|
|
43
|
-
"@telegraph/icon": "^0.
|
|
44
|
-
"@telegraph/input": "^0.
|
|
45
|
-
"@telegraph/layout": "^0.
|
|
46
|
-
"@telegraph/menu": "^0.
|
|
47
|
-
"@telegraph/tag": "^0.0
|
|
48
|
-
"@telegraph/tooltip": "^0.0
|
|
49
|
-
"@telegraph/truncate": "^0.0
|
|
50
|
-
"@telegraph/typography": "^0.
|
|
43
|
+
"@telegraph/icon": "^0.4.0",
|
|
44
|
+
"@telegraph/input": "^0.2.0",
|
|
45
|
+
"@telegraph/layout": "^0.4.0",
|
|
46
|
+
"@telegraph/menu": "^0.2.0",
|
|
47
|
+
"@telegraph/tag": "^0.1.0",
|
|
48
|
+
"@telegraph/tooltip": "^0.1.0",
|
|
49
|
+
"@telegraph/truncate": "^0.1.0",
|
|
50
|
+
"@telegraph/typography": "^0.2.0",
|
|
51
51
|
"lucide-react": "^0.544.0",
|
|
52
52
|
"motion": "^12.23.12"
|
|
53
53
|
},
|