@easypost/easy-ui 1.0.0-alpha.84 → 1.0.0-alpha.86
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/MultiSelect/MultiSelect.d.ts +11 -1
- package/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/MultiSelect/MultiSelect.stories.d.ts +2 -0
- package/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
- package/MultiSelect/index.js +5 -3
- package/MultiSelect/index.mjs +6 -4
- package/PillGroup/PillGroup.d.ts +10 -1
- package/PillGroup/PillGroup.d.ts.map +1 -1
- package/PillGroup/PillGroup.stories.d.ts +2 -0
- package/PillGroup/PillGroup.stories.d.ts.map +1 -1
- package/PillGroup/PillGroupContext.d.ts +9 -0
- package/PillGroup/PillGroupContext.d.ts.map +1 -0
- package/PillGroup/index.js +1 -1
- package/PillGroup/index.mjs +1 -1
- package/__chunks__/{PillGroup-B9WQ2to5.js → PillGroup-BWNzHd3P.js} +29 -7
- package/__chunks__/{PillGroup-CuPREwvS.mjs → PillGroup-D0TUV_Qh.mjs} +30 -8
- package/package.json +2 -2
- package/style.css +20 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @easypost/easy-ui
|
|
2
2
|
|
|
3
|
+
## 1.0.0-alpha.86
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 21cb65b: feat: support background colors and borderless config for PillGroup and add pillBackground and isPillBorderless prop to MultiSelect
|
|
8
|
+
|
|
9
|
+
## 1.0.0-alpha.85
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [80a9b78]
|
|
14
|
+
- @easypost/easy-ui-icons@1.0.0-alpha.44
|
|
15
|
+
|
|
3
16
|
## 1.0.0-alpha.84
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@ import { Key, useFilter } from "react-aria";
|
|
|
3
3
|
import { ComboBoxProps } from "react-aria-components";
|
|
4
4
|
import { AsyncListData, useAsyncList, useListData } from "react-stately";
|
|
5
5
|
import { MenuOverlayProps } from "../Menu/MenuOverlay";
|
|
6
|
-
import { PillProps } from "../PillGroup";
|
|
6
|
+
import { PillProps, PillBackground } from "../PillGroup";
|
|
7
7
|
import { MultiSelectDropdownOption, MultiSelectDropdownOptionText } from "./MultiSelectDropdown";
|
|
8
8
|
export type Item = {
|
|
9
9
|
key: Key;
|
|
@@ -64,6 +64,16 @@ export type MultiSelectProps<T extends object> = {
|
|
|
64
64
|
* the currently selected items.
|
|
65
65
|
*/
|
|
66
66
|
selectedItems: T[];
|
|
67
|
+
/**
|
|
68
|
+
* The background of individual pills. Maps to token theme colors.
|
|
69
|
+
*/
|
|
70
|
+
pillBackground?: PillBackground;
|
|
71
|
+
/**
|
|
72
|
+
* Whether or not individual pills have a border.
|
|
73
|
+
*
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
isPillBorderless?: boolean;
|
|
67
77
|
};
|
|
68
78
|
/**
|
|
69
79
|
* An input and dropdown that allows users to select multiple options from a list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../src/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAoB,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../src/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAoB,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAa,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAEL,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,GAAG,SAAS,CAAC;AAE5C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;IAC/C;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAE3D;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAEhD;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAEzC;;;OAGG;IACH,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAE3C;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAE1C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;IAEjE;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAEjD;;;OAGG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAExC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAEzC;;;OAGG;IACH,aAAa,EAAE,CAAC,EAAE,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,qBAuJrE;yBAvJe,WAAW;;;;;AAwK3B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAChD,YAAY,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -8,4 +8,6 @@ export declare const AsyncDropdown: Story;
|
|
|
8
8
|
export declare const WithIcons: Story;
|
|
9
9
|
export declare const DisabledKeys: Story;
|
|
10
10
|
export declare const MaxItemsUntilScroll: Story;
|
|
11
|
+
export declare const PillBackground: Story;
|
|
12
|
+
export declare const PillBorder: Story;
|
|
11
13
|
//# sourceMappingURL=MultiSelect.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.stories.d.ts","sourceRoot":"","sources":["../../src/MultiSelect/MultiSelect.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiSelect.stories.d.ts","sourceRoot":"","sources":["../../src/MultiSelect/MultiSelect.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAUlD,OAAO,EAEL,WAAW,EAIZ,MAAM,eAAe,CAAC;AAyBvB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAelC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,gBAAgB,EAAE,KAoC9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAqC3B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KA2CvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAwC1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAwCjC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KA2C5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAyCxB,CAAC"}
|
package/MultiSelect/index.js
CHANGED
|
@@ -57,7 +57,7 @@ const utils = require("../__chunks__/utils-B-3LZYje.js");
|
|
|
57
57
|
const useHover = require("../__chunks__/useHover-BMIowV0x.js");
|
|
58
58
|
const useFocusRing = require("../__chunks__/useFocusRing-ygRrwBu3.js");
|
|
59
59
|
const mergeProps = require("../__chunks__/mergeProps-d7wJkv71.js");
|
|
60
|
-
const PillGroup = require("../__chunks__/PillGroup-
|
|
60
|
+
const PillGroup = require("../__chunks__/PillGroup-BWNzHd3P.js");
|
|
61
61
|
const Dialog = require("../__chunks__/Dialog-D1oLQPjX.js");
|
|
62
62
|
const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
|
|
63
63
|
const useResizeObserver = require("../__chunks__/useResizeObserver-BsbT3mjh.js");
|
|
@@ -1881,7 +1881,7 @@ const styles = {
|
|
|
1881
1881
|
};
|
|
1882
1882
|
function MultiSelect(props) {
|
|
1883
1883
|
const { children, disabledKeys, dropdownItems = [], inputValue, isLoading, maxItemsUntilScroll = utilities.DEFAULT_MAX_ITEMS_UNTIL_SCROLL, onInputChange = () => {
|
|
1884
|
-
}, onSelectionChange, placeholder, renderPill, selectedItems } = props;
|
|
1884
|
+
}, onSelectionChange, placeholder, renderPill, selectedItems, pillBackground, isPillBorderless } = props;
|
|
1885
1885
|
const rootRef = React.useRef(null);
|
|
1886
1886
|
const clearComboBoxButtonRef = React.useRef(null);
|
|
1887
1887
|
const menuRef = React.useRef(null);
|
|
@@ -1939,7 +1939,9 @@ function MultiSelect(props) {
|
|
|
1939
1939
|
gap: "1"
|
|
1940
1940
|
},
|
|
1941
1941
|
onRemove: onRemoveSelectedItem,
|
|
1942
|
-
label: "Selected items"
|
|
1942
|
+
label: "Selected items",
|
|
1943
|
+
background: pillBackground,
|
|
1944
|
+
isBorderless: isPillBorderless
|
|
1943
1945
|
}, renderPill) : React.createElement(VisuallyHidden.$5c3e21d68f1c4674$export$439d29a4e110a164, null, React.createElement(Text.Text, null, "No selected items")), React.createElement("div", {
|
|
1944
1946
|
className: styles.comboBoxContainer
|
|
1945
1947
|
}, React.createElement($d01f2c01039c0eec$export$72b9695b8216309a, {
|
package/MultiSelect/index.mjs
CHANGED
|
@@ -56,8 +56,8 @@ import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415, a as $64fa3d84918910a7$
|
|
|
56
56
|
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/useHover-CwJuylzq.mjs";
|
|
57
57
|
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-DAMeUI3t.mjs";
|
|
58
58
|
import { f as $ff5963eb1fccf552$export$e08e3b67e392101e, $ as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../__chunks__/mergeProps-CORsYhTp.mjs";
|
|
59
|
-
import { $ as $0d86e9c8f07f9a7b$export$79c0c687a5963b0a, a as $eed445e0843c11d0$export$7ff8f37d2d81a48d, b as $e1995378a142960e$export$bf788dd355e3a401, c as $01b77f81d0f07f68$export$75b6ee27786ba447, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, e as $514c0188e459b4c0$export$9afb8bc826b033ea, f as $eed445e0843c11d0$export$41f133550aa26f48, g as $eed445e0843c11d0$export$a11e76429ed99b4, P as PillGroup } from "../__chunks__/PillGroup-
|
|
60
|
-
import { h } from "../__chunks__/PillGroup-
|
|
59
|
+
import { $ as $0d86e9c8f07f9a7b$export$79c0c687a5963b0a, a as $eed445e0843c11d0$export$7ff8f37d2d81a48d, b as $e1995378a142960e$export$bf788dd355e3a401, c as $01b77f81d0f07f68$export$75b6ee27786ba447, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, e as $514c0188e459b4c0$export$9afb8bc826b033ea, f as $eed445e0843c11d0$export$41f133550aa26f48, g as $eed445e0843c11d0$export$a11e76429ed99b4, P as PillGroup } from "../__chunks__/PillGroup-D0TUV_Qh.mjs";
|
|
60
|
+
import { h } from "../__chunks__/PillGroup-D0TUV_Qh.mjs";
|
|
61
61
|
import { c as $de32f1b87079253c$export$d2f961adcb0afbe, d as $07b14b47974efb58$export$9b9a0cd73afb7ca4, a as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../__chunks__/Dialog-71SzSgdZ.mjs";
|
|
62
62
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../__chunks__/filterDOMProps-EDDcM64A.mjs";
|
|
63
63
|
import { $ as $9daab02d461809db$export$683480f191c0e3ea } from "../__chunks__/useResizeObserver-Dyb4wvuA.mjs";
|
|
@@ -1864,7 +1864,7 @@ const styles = {
|
|
|
1864
1864
|
};
|
|
1865
1865
|
function MultiSelect(props) {
|
|
1866
1866
|
const { children, disabledKeys, dropdownItems = [], inputValue, isLoading, maxItemsUntilScroll = DEFAULT_MAX_ITEMS_UNTIL_SCROLL, onInputChange = () => {
|
|
1867
|
-
}, onSelectionChange, placeholder, renderPill, selectedItems } = props;
|
|
1867
|
+
}, onSelectionChange, placeholder, renderPill, selectedItems, pillBackground, isPillBorderless } = props;
|
|
1868
1868
|
const rootRef = useRef(null);
|
|
1869
1869
|
const clearComboBoxButtonRef = useRef(null);
|
|
1870
1870
|
const menuRef = useRef(null);
|
|
@@ -1922,7 +1922,9 @@ function MultiSelect(props) {
|
|
|
1922
1922
|
gap: "1"
|
|
1923
1923
|
},
|
|
1924
1924
|
onRemove: onRemoveSelectedItem,
|
|
1925
|
-
label: "Selected items"
|
|
1925
|
+
label: "Selected items",
|
|
1926
|
+
background: pillBackground,
|
|
1927
|
+
isBorderless: isPillBorderless
|
|
1926
1928
|
}, renderPill) : React__default.createElement($5c3e21d68f1c4674$export$439d29a4e110a164, null, React__default.createElement(Text, null, "No selected items")), React__default.createElement("div", {
|
|
1927
1929
|
className: styles.comboBoxContainer
|
|
1928
1930
|
}, React__default.createElement($d01f2c01039c0eec$export$72b9695b8216309a, {
|
package/PillGroup/PillGroup.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { TagGroupProps, TagListProps } from "react-aria-components";
|
|
3
|
-
import { IconSymbol } from "../types";
|
|
3
|
+
import { IconSymbol, ThemeTokenNamespace } from "../types";
|
|
4
4
|
import { HorizontalStackProps } from "../HorizontalStack";
|
|
5
|
+
export type PillBackground = ThemeTokenNamespace<"color">;
|
|
5
6
|
/**
|
|
6
7
|
* Assists in managing state for list data for `<PillGroup />`
|
|
7
8
|
*
|
|
@@ -14,6 +15,14 @@ export type PillGroupProps<T> = Pick<TagGroupProps, "onRemove"> & Pick<TagListPr
|
|
|
14
15
|
label: string;
|
|
15
16
|
/** HorizontalStack props except children and as */
|
|
16
17
|
horizontalStackContainerProps?: Omit<HorizontalStackProps, "children" | "as">;
|
|
18
|
+
/** The background of individual pills. Maps to token theme colors. */
|
|
19
|
+
background?: PillBackground;
|
|
20
|
+
/**
|
|
21
|
+
* Whether or not individual pills have a border.
|
|
22
|
+
*
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
isBorderless?: boolean;
|
|
17
26
|
};
|
|
18
27
|
/**
|
|
19
28
|
* A `<PillGroup />` displays a focusable list of labels, categories, keywords, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillGroup.d.ts","sourceRoot":"","sources":["../../src/PillGroup/PillGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PillGroup.d.ts","sourceRoot":"","sources":["../../src/PillGroup/PillGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAKzE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAY3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,uCAEpD;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,GAC7D,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC5C,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,6BAA6B,CAAC,EAAE,IAAI,CAClC,oBAAoB,EACpB,UAAU,GAAG,IAAI,CAClB,CAAC;IACF,sEAAsE;IACtE,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,qBA+CnE;yBA/Ce,SAAS;sBAwDJ,SAAS;;AAP9B,MAAM,MAAM,SAAS,GAAG;IACtB,wBAAwB;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -8,4 +8,6 @@ export declare const StandardIconSymbol: Story;
|
|
|
8
8
|
export declare const ImageSymbol: Story;
|
|
9
9
|
export declare const Positioning: Story;
|
|
10
10
|
export declare const Removal: Story;
|
|
11
|
+
export declare const Background: Story;
|
|
12
|
+
export declare const Border: Story;
|
|
11
13
|
//# sourceMappingURL=PillGroup.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PillGroup.stories.d.ts","sourceRoot":"","sources":["../../src/PillGroup/PillGroup.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAoC,MAAM,aAAa,CAAC;AAE1E,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAOxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAOhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAWhC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAWzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAgBzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAsBrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"PillGroup.stories.d.ts","sourceRoot":"","sources":["../../src/PillGroup/PillGroup.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAoC,MAAM,aAAa,CAAC;AAE1E,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAOxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAOhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAWhC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAWzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAgBzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAsBrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAuBxB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAwBpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PillBackground } from "./PillGroup";
|
|
2
|
+
type InternalPillGroupContextType = {
|
|
3
|
+
background: PillBackground;
|
|
4
|
+
isBorderless: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const InternalPillGroupContext: import("react").Context<InternalPillGroupContextType | null>;
|
|
7
|
+
export declare function useInternalPillGroupContext(): InternalPillGroupContextType;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=PillGroupContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillGroupContext.d.ts","sourceRoot":"","sources":["../../src/PillGroup/PillGroupContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,4BAA4B,GAAG;IAClC,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,wBAAwB,8DACqB,CAAC;AAE3D,wBAAgB,2BAA2B,iCAQ1C"}
|
package/PillGroup/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const PillGroup = require("../__chunks__/PillGroup-
|
|
3
|
+
const PillGroup = require("../__chunks__/PillGroup-BWNzHd3P.js");
|
|
4
4
|
exports.PillGroup = PillGroup.PillGroup;
|
|
5
5
|
exports.usePillListState = PillGroup.usePillListState;
|
package/PillGroup/index.mjs
CHANGED
|
@@ -2127,11 +2127,21 @@ const $eaf9e70818b436db$export$3288d34c523a1192 = /* @__PURE__ */ $e1995378a1429
|
|
|
2127
2127
|
]
|
|
2128
2128
|
}, renderProps.children)));
|
|
2129
2129
|
});
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2132
|
-
const
|
|
2130
|
+
const InternalPillGroupContext = React.createContext(null);
|
|
2131
|
+
function useInternalPillGroupContext() {
|
|
2132
|
+
const pillGroupContext = React.useContext(InternalPillGroupContext);
|
|
2133
|
+
if (!pillGroupContext) {
|
|
2134
|
+
throw new Error("InternalPillGroupContext must be used inside a <PillGroup />");
|
|
2135
|
+
}
|
|
2136
|
+
return pillGroupContext;
|
|
2137
|
+
}
|
|
2138
|
+
const Pill$1 = "_Pill_tvu53_4";
|
|
2139
|
+
const borderless = "_borderless_tvu53_14";
|
|
2140
|
+
const remove = "_remove_tvu53_18";
|
|
2141
|
+
const list = "_list_tvu53_30";
|
|
2133
2142
|
const styles = {
|
|
2134
2143
|
Pill: Pill$1,
|
|
2144
|
+
borderless,
|
|
2135
2145
|
remove,
|
|
2136
2146
|
list
|
|
2137
2147
|
};
|
|
@@ -2141,22 +2151,34 @@ function usePillListState(initialItems) {
|
|
|
2141
2151
|
});
|
|
2142
2152
|
}
|
|
2143
2153
|
function PillGroup(props) {
|
|
2144
|
-
const { label, items, children, horizontalStackContainerProps = {} } = props;
|
|
2154
|
+
const { label, items, children, horizontalStackContainerProps = {}, background = "neutral.000", isBorderless = false } = props;
|
|
2145
2155
|
const { align, blockAlign, gap, wrap = true, inline } = horizontalStackContainerProps;
|
|
2156
|
+
const context2 = React.useMemo(() => {
|
|
2157
|
+
return {
|
|
2158
|
+
background,
|
|
2159
|
+
isBorderless
|
|
2160
|
+
};
|
|
2161
|
+
}, [background, isBorderless]);
|
|
2146
2162
|
const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, utilities_css.getResponsiveDesignToken("pill-group", "gap", "space", gap)), utilities_css.getComponentToken("pill-group", "align", align)), utilities_css.getComponentToken("pill-group", "block-align", blockAlign)), utilities_css.getComponentToken("pill-group", "wrap", wrap ? "wrap" : "nowrap")), utilities_css.getComponentToken("pill-group", "display", inline ? "inline-flex" : "flex"));
|
|
2147
|
-
return React.createElement(
|
|
2163
|
+
return React.createElement(InternalPillGroupContext.Provider, {
|
|
2164
|
+
value: context2
|
|
2165
|
+
}, React.createElement($eaf9e70818b436db$export$67ea30858aaf75e3, __spreadValues({}, props), React.createElement(Text.Text, {
|
|
2148
2166
|
visuallyHidden: true
|
|
2149
2167
|
}, React.createElement($01b77f81d0f07f68$export$b04be29aa201d4f5, null, label)), React.createElement($eaf9e70818b436db$export$f9fef0f55402315b, {
|
|
2150
2168
|
items,
|
|
2151
2169
|
className: styles.list,
|
|
2152
2170
|
style
|
|
2153
|
-
}, children));
|
|
2171
|
+
}, children)));
|
|
2154
2172
|
}
|
|
2155
2173
|
function Pill(props) {
|
|
2156
2174
|
const { label, icon } = props;
|
|
2175
|
+
const { background, isBorderless } = useInternalPillGroupContext();
|
|
2176
|
+
const style = __spreadValues({}, utilities_css.getComponentThemeToken("pill", "background", "color", background));
|
|
2177
|
+
const className = utilities_css.classNames(styles.Pill, isBorderless && styles.borderless);
|
|
2157
2178
|
return React.createElement($eaf9e70818b436db$export$3288d34c523a1192, __spreadValues({
|
|
2158
2179
|
textValue: label,
|
|
2159
|
-
className
|
|
2180
|
+
className,
|
|
2181
|
+
style
|
|
2160
2182
|
}, props), ({ allowsRemoving }) => React.createElement(React.Fragment, null, icon && React.createElement(Icon.Icon, {
|
|
2161
2183
|
size: "xs",
|
|
2162
2184
|
symbol: icon,
|
|
@@ -62,7 +62,7 @@ import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedSt
|
|
|
62
62
|
import { C as Close } from "./Close-Cq6Q6MN6.mjs";
|
|
63
63
|
import { I as Icon } from "./Icon-0SN9dbwU.mjs";
|
|
64
64
|
import { T as Text } from "./Text-CX5GoBTS.mjs";
|
|
65
|
-
import { getComponentToken, getResponsiveDesignToken } from "../utilities/css.mjs";
|
|
65
|
+
import { getComponentToken, getResponsiveDesignToken, getComponentThemeToken, classNames } from "../utilities/css.mjs";
|
|
66
66
|
function $0d86e9c8f07f9a7b$export$762f73dccccd255d(options) {
|
|
67
67
|
let { initialItems = [], initialSelectedKeys, getKey = (item) => {
|
|
68
68
|
var _item_id;
|
|
@@ -2126,11 +2126,21 @@ const $eaf9e70818b436db$export$3288d34c523a1192 = /* @__PURE__ */ $e1995378a1429
|
|
|
2126
2126
|
]
|
|
2127
2127
|
}, renderProps.children)));
|
|
2128
2128
|
});
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
const
|
|
2129
|
+
const InternalPillGroupContext = createContext(null);
|
|
2130
|
+
function useInternalPillGroupContext() {
|
|
2131
|
+
const pillGroupContext = useContext(InternalPillGroupContext);
|
|
2132
|
+
if (!pillGroupContext) {
|
|
2133
|
+
throw new Error("InternalPillGroupContext must be used inside a <PillGroup />");
|
|
2134
|
+
}
|
|
2135
|
+
return pillGroupContext;
|
|
2136
|
+
}
|
|
2137
|
+
const Pill$1 = "_Pill_tvu53_4";
|
|
2138
|
+
const borderless = "_borderless_tvu53_14";
|
|
2139
|
+
const remove = "_remove_tvu53_18";
|
|
2140
|
+
const list = "_list_tvu53_30";
|
|
2132
2141
|
const styles = {
|
|
2133
2142
|
Pill: Pill$1,
|
|
2143
|
+
borderless,
|
|
2134
2144
|
remove,
|
|
2135
2145
|
list
|
|
2136
2146
|
};
|
|
@@ -2140,22 +2150,34 @@ function usePillListState(initialItems) {
|
|
|
2140
2150
|
});
|
|
2141
2151
|
}
|
|
2142
2152
|
function PillGroup(props) {
|
|
2143
|
-
const { label, items, children, horizontalStackContainerProps = {} } = props;
|
|
2153
|
+
const { label, items, children, horizontalStackContainerProps = {}, background = "neutral.000", isBorderless = false } = props;
|
|
2144
2154
|
const { align, blockAlign, gap, wrap = true, inline } = horizontalStackContainerProps;
|
|
2155
|
+
const context = useMemo(() => {
|
|
2156
|
+
return {
|
|
2157
|
+
background,
|
|
2158
|
+
isBorderless
|
|
2159
|
+
};
|
|
2160
|
+
}, [background, isBorderless]);
|
|
2145
2161
|
const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, getResponsiveDesignToken("pill-group", "gap", "space", gap)), getComponentToken("pill-group", "align", align)), getComponentToken("pill-group", "block-align", blockAlign)), getComponentToken("pill-group", "wrap", wrap ? "wrap" : "nowrap")), getComponentToken("pill-group", "display", inline ? "inline-flex" : "flex"));
|
|
2146
|
-
return React__default.createElement(
|
|
2162
|
+
return React__default.createElement(InternalPillGroupContext.Provider, {
|
|
2163
|
+
value: context
|
|
2164
|
+
}, React__default.createElement($eaf9e70818b436db$export$67ea30858aaf75e3, __spreadValues({}, props), React__default.createElement(Text, {
|
|
2147
2165
|
visuallyHidden: true
|
|
2148
2166
|
}, React__default.createElement($01b77f81d0f07f68$export$b04be29aa201d4f5, null, label)), React__default.createElement($eaf9e70818b436db$export$f9fef0f55402315b, {
|
|
2149
2167
|
items,
|
|
2150
2168
|
className: styles.list,
|
|
2151
2169
|
style
|
|
2152
|
-
}, children));
|
|
2170
|
+
}, children)));
|
|
2153
2171
|
}
|
|
2154
2172
|
function Pill(props) {
|
|
2155
2173
|
const { label, icon } = props;
|
|
2174
|
+
const { background, isBorderless } = useInternalPillGroupContext();
|
|
2175
|
+
const style = __spreadValues({}, getComponentThemeToken("pill", "background", "color", background));
|
|
2176
|
+
const className = classNames(styles.Pill, isBorderless && styles.borderless);
|
|
2156
2177
|
return React__default.createElement($eaf9e70818b436db$export$3288d34c523a1192, __spreadValues({
|
|
2157
2178
|
textValue: label,
|
|
2158
|
-
className
|
|
2179
|
+
className,
|
|
2180
|
+
style
|
|
2159
2181
|
}, props), ({ allowsRemoving }) => React__default.createElement(React__default.Fragment, null, icon && React__default.createElement(Icon, {
|
|
2160
2182
|
size: "xs",
|
|
2161
2183
|
symbol: icon,
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easypost/easy-ui",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.86",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"**/*.css"
|
|
6
6
|
],
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@easypost/easy-ui-icons": "1.0.0-alpha.
|
|
8
|
+
"@easypost/easy-ui-icons": "1.0.0-alpha.44",
|
|
9
9
|
"@easypost/easy-ui-tokens": "1.0.0-alpha.16",
|
|
10
10
|
"@react-aria/toast": "^3.0.1",
|
|
11
11
|
"@react-aria/utils": "^3.28.2",
|
package/style.css
CHANGED
|
@@ -1500,16 +1500,21 @@
|
|
|
1500
1500
|
}/**
|
|
1501
1501
|
* Do not edit directly, this file was auto-generated.
|
|
1502
1502
|
*/
|
|
1503
|
-
.
|
|
1503
|
+
._Pill_tvu53_4 {
|
|
1504
1504
|
display: inline-flex;
|
|
1505
1505
|
border-radius: var(--ezui-shape-border-radius-md);
|
|
1506
1506
|
padding: calc(var(--ezui-space-1) - var(--ezui-shape-border-width-1));
|
|
1507
1507
|
gap: var(--ezui-space-0-5);
|
|
1508
1508
|
border: var(--ezui-shape-border-width-1) solid var(--ezui-color-gray-400);
|
|
1509
1509
|
align-items: center;
|
|
1510
|
+
background: var(--ezui-c-pill-background);
|
|
1510
1511
|
}
|
|
1511
1512
|
|
|
1512
|
-
.
|
|
1513
|
+
._borderless_tvu53_14 {
|
|
1514
|
+
border: none;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
._remove_tvu53_18 {
|
|
1513
1518
|
appearance: none;
|
|
1514
1519
|
margin: 0;
|
|
1515
1520
|
padding: 0;
|
|
@@ -1521,56 +1526,56 @@
|
|
|
1521
1526
|
cursor: pointer;
|
|
1522
1527
|
}
|
|
1523
1528
|
|
|
1524
|
-
.
|
|
1529
|
+
._list_tvu53_30 {
|
|
1525
1530
|
display: var(--ezui-c-pill-group-display);
|
|
1526
1531
|
flex-wrap: var(--ezui-c-pill-group-wrap);
|
|
1527
1532
|
align-items: var(--ezui-c-pill-group-block-align);
|
|
1528
1533
|
justify-content: var(--ezui-c-pill-group-align);
|
|
1529
1534
|
min-width: 0;
|
|
1530
1535
|
}
|
|
1531
|
-
.
|
|
1536
|
+
._list_tvu53_30 {
|
|
1532
1537
|
--ezui-c-pill-group-gap-xs: initial;
|
|
1533
1538
|
}
|
|
1534
|
-
.
|
|
1539
|
+
._list_tvu53_30 {
|
|
1535
1540
|
--ezui-c-pill-group-gap-sm: initial;
|
|
1536
1541
|
}
|
|
1537
|
-
.
|
|
1542
|
+
._list_tvu53_30 {
|
|
1538
1543
|
--ezui-c-pill-group-gap-md: initial;
|
|
1539
1544
|
}
|
|
1540
|
-
.
|
|
1545
|
+
._list_tvu53_30 {
|
|
1541
1546
|
--ezui-c-pill-group-gap-lg: initial;
|
|
1542
1547
|
}
|
|
1543
|
-
.
|
|
1548
|
+
._list_tvu53_30 {
|
|
1544
1549
|
--ezui-c-pill-group-gap-xl: initial;
|
|
1545
1550
|
}
|
|
1546
|
-
.
|
|
1551
|
+
._list_tvu53_30 {
|
|
1547
1552
|
--ezui-c-pill-group-gap-xxl: initial;
|
|
1548
1553
|
}
|
|
1549
|
-
.
|
|
1554
|
+
._list_tvu53_30 {
|
|
1550
1555
|
gap: var(--ezui-c-pill-group-gap-xs);
|
|
1551
1556
|
}
|
|
1552
1557
|
@media (min-width: 30em) {
|
|
1553
|
-
.
|
|
1558
|
+
._list_tvu53_30 {
|
|
1554
1559
|
gap: var(--ezui-c-pill-group-gap-sm, var(--ezui-c-pill-group-gap-xs, initial));
|
|
1555
1560
|
}
|
|
1556
1561
|
}
|
|
1557
1562
|
@media (min-width: 40em) {
|
|
1558
|
-
.
|
|
1563
|
+
._list_tvu53_30 {
|
|
1559
1564
|
gap: var(--ezui-c-pill-group-gap-md, var(--ezui-c-pill-group-gap-sm, var(--ezui-c-pill-group-gap-xs, initial)));
|
|
1560
1565
|
}
|
|
1561
1566
|
}
|
|
1562
1567
|
@media (min-width: 64em) {
|
|
1563
|
-
.
|
|
1568
|
+
._list_tvu53_30 {
|
|
1564
1569
|
gap: var(--ezui-c-pill-group-gap-lg, var(--ezui-c-pill-group-gap-md, var(--ezui-c-pill-group-gap-sm, var(--ezui-c-pill-group-gap-xs, initial))));
|
|
1565
1570
|
}
|
|
1566
1571
|
}
|
|
1567
1572
|
@media (min-width: 85em) {
|
|
1568
|
-
.
|
|
1573
|
+
._list_tvu53_30 {
|
|
1569
1574
|
gap: var(--ezui-c-pill-group-gap-xl, var(--ezui-c-pill-group-gap-lg, var(--ezui-c-pill-group-gap-md, var(--ezui-c-pill-group-gap-sm, var(--ezui-c-pill-group-gap-xs, initial)))));
|
|
1570
1575
|
}
|
|
1571
1576
|
}
|
|
1572
1577
|
@media (min-width: 120em) {
|
|
1573
|
-
.
|
|
1578
|
+
._list_tvu53_30 {
|
|
1574
1579
|
gap: var(--ezui-c-pill-group-gap-xxl, var(--ezui-c-pill-group-gap-xl, var(--ezui-c-pill-group-gap-lg, var(--ezui-c-pill-group-gap-md, var(--ezui-c-pill-group-gap-sm, var(--ezui-c-pill-group-gap-xs, initial))))));
|
|
1575
1580
|
}
|
|
1576
1581
|
}/**
|