@telegraph/select 0.0.12 → 0.0.14
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 +13 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +24 -58
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Select/Select.d.ts +3 -16
- package/dist/types/Select/Select.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @telegraph/select
|
|
2
2
|
|
|
3
|
+
## 0.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @telegraph/combobox@0.0.52
|
|
9
|
+
|
|
10
|
+
## 0.0.13
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`6d87d10`](https://github.com/knocklabs/telegraph/commit/6d87d102d5ece0eae0a9dc5a33c67c183c7f510e) Thanks [@kylemcd](https://github.com/kylemcd)! - remove logic now contained in combobox from select component
|
|
15
|
+
|
|
3
16
|
## 0.0.12
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("@telegraph/combobox"),l=({size:r="1",value:t,onValueChange:n,triggerProps:s,contentProps:b,optionsProps:c,children:i,...x})=>o.jsxs(e.Combobox.Root,{value:t,onValueChange:n,closeOnSelect:!Array.isArray(t),...x,children:[o.jsx(e.Combobox.Trigger,{size:r,...s}),o.jsx(e.Combobox.Content,{...b,children:o.jsx(e.Combobox.Options,{...c,children:i})})]}),m=({value:r,children:t,...n})=>o.jsx(e.Combobox.Option,{value:r,label:t,...n}),j={Root:l,Option:m};exports.Select=j;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { Combobox } from \"@telegraph/combobox\";\nimport { TgphComponentProps } from \"@telegraph/helpers\";\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { Combobox } from \"@telegraph/combobox\";\nimport { TgphComponentProps } from \"@telegraph/helpers\";\n\ntype Option = TgphComponentProps<typeof Combobox.Option>;\n\ntype RootProps = TgphComponentProps<typeof Combobox.Root> & {\n size?: TgphComponentProps<typeof Combobox.Trigger>[\"size\"];\n triggerProps?: TgphComponentProps<typeof Combobox.Trigger>;\n contentProps?: TgphComponentProps<typeof Combobox.Content>;\n optionsProps?: TgphComponentProps<typeof Combobox.Options>;\n};\nconst Root = ({\n size = \"1\",\n value,\n onValueChange,\n triggerProps,\n contentProps,\n optionsProps,\n children,\n ...props\n}: RootProps) => {\n return (\n <Combobox.Root\n value={value}\n onValueChange={onValueChange}\n closeOnSelect={!Array.isArray(value)}\n {...props}\n >\n <Combobox.Trigger size={size} {...triggerProps} />\n <Combobox.Content {...contentProps}>\n <Combobox.Options {...optionsProps}>{children}</Combobox.Options>\n </Combobox.Content>\n </Combobox.Root>\n );\n};\n\ntype OptionProps = Omit<TgphComponentProps<typeof Combobox.Option>, \"label\">;\n\nconst Option = ({ value, children, ...props }: OptionProps) => {\n return <Combobox.Option value={value} label={children} {...props} />;\n};\n\nconst Select = { Root, Option };\ntype SelectProps = RootProps;\n\nexport { Select };\nexport type { SelectProps, OptionProps, Option };\n"],"names":["Root","size","value","onValueChange","triggerProps","contentProps","optionsProps","children","props","jsxs","Combobox","jsx","Option","Select"],"mappings":"sJAWMA,EAAO,CAAC,CACZ,KAAAC,EAAO,IACP,MAAAC,EACA,cAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,KAACC,EAAAA,SAAS,KAAT,CACC,MAAAR,EACA,cAAAC,EACA,cAAe,CAAC,MAAM,QAAQD,CAAK,EAClC,GAAGM,EAEJ,SAAA,CAAAG,EAAA,IAACD,EAAS,SAAA,QAAT,CAAiB,KAAAT,EAAa,GAAGG,CAAc,CAAA,EAC/CO,EAAAA,IAAAD,EAAAA,SAAS,QAAT,CAAkB,GAAGL,EACpB,SAACM,MAAAD,EAAAA,SAAS,QAAT,CAAkB,GAAGJ,EAAe,SAAAC,CAAS,CAAA,CAChD,CAAA,CAAA,CAAA,CACF,EAMEK,EAAS,CAAC,CAAE,MAAAV,EAAO,SAAAK,EAAU,GAAGC,KAC7BG,EAAA,IAACD,WAAS,OAAT,CAAgB,MAAAR,EAAc,MAAOK,EAAW,GAAGC,EAAO,EAG9DK,EAAS,CAAE,KAAAb,EAAM,OAAAY,CAAO"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,62 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Combobox as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
size: l = "1",
|
|
6
|
-
multiple: s = !1,
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Combobox as o } from "@telegraph/combobox";
|
|
3
|
+
const x = ({
|
|
4
|
+
size: n = "1",
|
|
7
5
|
value: r,
|
|
8
|
-
onValueChange:
|
|
9
|
-
triggerProps:
|
|
10
|
-
contentProps:
|
|
11
|
-
optionsProps:
|
|
12
|
-
children:
|
|
13
|
-
...
|
|
14
|
-
}) =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var e;
|
|
28
|
-
return {
|
|
29
|
-
value: o,
|
|
30
|
-
label: (e = m.find((n) => n.value === o)) == null ? void 0 : e.label
|
|
31
|
-
};
|
|
32
|
-
}) : r ? {
|
|
33
|
-
value: r,
|
|
34
|
-
label: (t = m.find((o) => o.value === r)) == null ? void 0 : t.label
|
|
35
|
-
} : void 0;
|
|
36
|
-
}, [s, r, m]);
|
|
37
|
-
return /* @__PURE__ */ x(
|
|
38
|
-
i.Root,
|
|
39
|
-
{
|
|
40
|
-
value: A,
|
|
41
|
-
onValueChange: (t) => {
|
|
42
|
-
if (s && t && Array.isArray(t)) {
|
|
43
|
-
const n = u;
|
|
44
|
-
n == null || n(t.map((O) => O.value));
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const o = u, e = t.value;
|
|
48
|
-
o(e);
|
|
49
|
-
},
|
|
50
|
-
closeOnSelect: !s,
|
|
51
|
-
...y,
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ p(i.Trigger, { size: l, ...f }),
|
|
54
|
-
/* @__PURE__ */ p(i.Content, { ...b, children: /* @__PURE__ */ p(i.Options, { ...d, children: c }) })
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}, v = ({ value: l, children: s, ...r }) => /* @__PURE__ */ p(i.Option, { value: l, label: s, ...r }), h = { Root: g, Option: v };
|
|
6
|
+
onValueChange: e,
|
|
7
|
+
triggerProps: i,
|
|
8
|
+
contentProps: s,
|
|
9
|
+
optionsProps: c,
|
|
10
|
+
children: l,
|
|
11
|
+
...p
|
|
12
|
+
}) => /* @__PURE__ */ m(
|
|
13
|
+
o.Root,
|
|
14
|
+
{
|
|
15
|
+
value: r,
|
|
16
|
+
onValueChange: e,
|
|
17
|
+
closeOnSelect: !Array.isArray(r),
|
|
18
|
+
...p,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ t(o.Trigger, { size: n, ...i }),
|
|
21
|
+
/* @__PURE__ */ t(o.Content, { ...s, children: /* @__PURE__ */ t(o.Options, { ...c, children: l }) })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
), O = ({ value: n, children: r, ...e }) => /* @__PURE__ */ t(o.Option, { value: n, label: r, ...e }), d = { Root: x, Option: O };
|
|
59
25
|
export {
|
|
60
|
-
|
|
26
|
+
d as Select
|
|
61
27
|
};
|
|
62
28
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { Combobox } from \"@telegraph/combobox\";\nimport { TgphComponentProps } from \"@telegraph/helpers\";\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { Combobox } from \"@telegraph/combobox\";\nimport { TgphComponentProps } from \"@telegraph/helpers\";\n\ntype Option = TgphComponentProps<typeof Combobox.Option>;\n\ntype RootProps = TgphComponentProps<typeof Combobox.Root> & {\n size?: TgphComponentProps<typeof Combobox.Trigger>[\"size\"];\n triggerProps?: TgphComponentProps<typeof Combobox.Trigger>;\n contentProps?: TgphComponentProps<typeof Combobox.Content>;\n optionsProps?: TgphComponentProps<typeof Combobox.Options>;\n};\nconst Root = ({\n size = \"1\",\n value,\n onValueChange,\n triggerProps,\n contentProps,\n optionsProps,\n children,\n ...props\n}: RootProps) => {\n return (\n <Combobox.Root\n value={value}\n onValueChange={onValueChange}\n closeOnSelect={!Array.isArray(value)}\n {...props}\n >\n <Combobox.Trigger size={size} {...triggerProps} />\n <Combobox.Content {...contentProps}>\n <Combobox.Options {...optionsProps}>{children}</Combobox.Options>\n </Combobox.Content>\n </Combobox.Root>\n );\n};\n\ntype OptionProps = Omit<TgphComponentProps<typeof Combobox.Option>, \"label\">;\n\nconst Option = ({ value, children, ...props }: OptionProps) => {\n return <Combobox.Option value={value} label={children} {...props} />;\n};\n\nconst Select = { Root, Option };\ntype SelectProps = RootProps;\n\nexport { Select };\nexport type { SelectProps, OptionProps, Option };\n"],"names":["Root","size","value","onValueChange","triggerProps","contentProps","optionsProps","children","props","jsxs","Combobox","jsx","Option","Select"],"mappings":";;AAWA,MAAMA,IAAO,CAAC;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAACC,EAAS;AAAA,EAAT;AAAA,IACC,OAAAR;AAAA,IACA,eAAAC;AAAA,IACA,eAAe,CAAC,MAAM,QAAQD,CAAK;AAAA,IAClC,GAAGM;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAG,EAACD,EAAS,SAAT,EAAiB,MAAAT,GAAa,GAAGG,EAAc,CAAA;AAAA,MAC/C,gBAAAO,EAAAD,EAAS,SAAT,EAAkB,GAAGL,GACpB,UAAC,gBAAAM,EAAAD,EAAS,SAAT,EAAkB,GAAGJ,GAAe,UAAAC,EAAS,CAAA,EAChD,CAAA;AAAA,IAAA;AAAA,EAAA;AACF,GAMEK,IAAS,CAAC,EAAE,OAAAV,GAAO,UAAAK,GAAU,GAAGC,QAC7B,gBAAAG,EAACD,EAAS,QAAT,EAAgB,OAAAR,GAAc,OAAOK,GAAW,GAAGC,GAAO,GAG9DK,IAAS,EAAE,MAAAb,GAAM,QAAAY,EAAO;"}
|
|
@@ -2,29 +2,16 @@ import { Combobox } from '@telegraph/combobox';
|
|
|
2
2
|
import { TgphComponentProps } from '@telegraph/helpers';
|
|
3
3
|
|
|
4
4
|
type Option = TgphComponentProps<typeof Combobox.Option>;
|
|
5
|
-
type
|
|
6
|
-
type MultipleValue = Array<string>;
|
|
7
|
-
type RootProps = Omit<TgphComponentProps<typeof Combobox.Root>, "value" | "onValueChange" | "layout"> & {
|
|
5
|
+
type RootProps = TgphComponentProps<typeof Combobox.Root> & {
|
|
8
6
|
size?: TgphComponentProps<typeof Combobox.Trigger>["size"];
|
|
9
7
|
triggerProps?: TgphComponentProps<typeof Combobox.Trigger>;
|
|
10
8
|
contentProps?: TgphComponentProps<typeof Combobox.Content>;
|
|
11
9
|
optionsProps?: TgphComponentProps<typeof Combobox.Options>;
|
|
12
|
-
|
|
13
|
-
} & ({
|
|
14
|
-
multiple?: true;
|
|
15
|
-
value?: MultipleValue;
|
|
16
|
-
onValueChange?: (value: MultipleValue) => void;
|
|
17
|
-
layout?: TgphComponentProps<typeof Combobox.Root>["layout"];
|
|
18
|
-
} | {
|
|
19
|
-
multiple?: false;
|
|
20
|
-
value?: SingleValue;
|
|
21
|
-
onValueChange?: (value: SingleValue) => void;
|
|
22
|
-
layout?: never;
|
|
23
|
-
});
|
|
10
|
+
};
|
|
24
11
|
type OptionProps = Omit<TgphComponentProps<typeof Combobox.Option>, "label">;
|
|
25
12
|
declare const Option: ({ value, children, ...props }: OptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
13
|
declare const Select: {
|
|
27
|
-
Root: ({ size,
|
|
14
|
+
Root: ({ size, value, onValueChange, triggerProps, contentProps, optionsProps, children, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
15
|
Option: ({ value, children, ...props }: OptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
16
|
};
|
|
30
17
|
type SelectProps = RootProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,MAAM,GAAG,kBAAkB,CAAC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEzD,KAAK,SAAS,GAAG,kBAAkB,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG;IAC1D,IAAI,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3D,YAAY,CAAC,EAAE,kBAAkB,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC5D,CAAC;AA0BF,KAAK,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AAE7E,QAAA,MAAM,MAAM,kCAAmC,WAAW,4CAEzD,CAAC;AAEF,QAAA,MAAM,MAAM;yGAtBT,SAAS;4CAkBmC,WAAW;CAI3B,CAAC;AAChC,KAAK,WAAW,GAAG,SAAS,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/select",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "A simple select component built on top of @telegraph/combobox",
|
|
5
5
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/select",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"preview": "vite preview"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@telegraph/combobox": "0.0.
|
|
33
|
+
"@telegraph/combobox": "0.0.52",
|
|
34
34
|
"@telegraph/helpers": "0.0.7"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"react": "^18.2.0",
|
|
45
45
|
"react-dom": "^18.3.1",
|
|
46
46
|
"typescript": "^5.5.4",
|
|
47
|
-
"vite": "^
|
|
47
|
+
"vite": "^6.0.11"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^18.2.0",
|