@easypost/easy-ui 1.0.0-alpha.4 → 1.0.0-alpha.6
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/Badge/index.js +32 -26
- package/Badge/index.mjs +32 -26
- package/Banner/index.js +15 -16
- package/Banner/index.mjs +15 -16
- package/Button/Button.d.ts +61 -0
- package/Button/Button.d.ts.map +1 -1
- package/Button/index.js +34 -69
- package/Button/index.mjs +33 -68
- package/CHANGELOG.md +21 -0
- package/Card/index.js +84 -5
- package/Card/index.mjs +84 -5
- package/Checkbox/index.js +84 -72
- package/Checkbox/index.mjs +84 -72
- package/CodeBlock/index.js +43 -49
- package/CodeBlock/index.mjs +43 -49
- package/DropdownButton/DropdownButton.d.ts +48 -0
- package/DropdownButton/DropdownButton.d.ts.map +1 -1
- package/DropdownButton/index.js +29 -101
- package/DropdownButton/index.mjs +29 -85
- package/HorizontalGrid/index.js +11 -31
- package/HorizontalGrid/index.mjs +11 -31
- package/HorizontalStack/index.js +48 -4
- package/HorizontalStack/index.mjs +48 -4
- package/Icon/Icon.d.ts +51 -0
- package/Icon/Icon.d.ts.map +1 -1
- package/Icon/index.js +38 -4
- package/Icon/index.mjs +38 -4
- package/IconButton/IconButton.d.ts +62 -0
- package/IconButton/IconButton.d.ts.map +1 -1
- package/IconButton/index.js +26 -43
- package/IconButton/index.mjs +25 -42
- package/InputField/Label.d.ts +2 -2
- package/InputField/index.js +282 -10
- package/InputField/index.mjs +266 -10
- package/InputField/utilities.d.ts +1 -1
- package/InputField/utilities.d.ts.map +1 -1
- package/Menu/MenuOverlay.d.ts.map +1 -1
- package/Menu/index.js +178 -1958
- package/Menu/index.mjs +168 -1948
- package/Menu/utilities.d.ts +11 -0
- package/Menu/utilities.d.ts.map +1 -0
- package/Notification/index.js +1534 -14
- package/Notification/index.mjs +1518 -14
- package/Provider/index.js +15 -15
- package/Provider/index.mjs +15 -15
- package/RadioGroup/index.js +63 -63
- package/RadioGroup/index.mjs +63 -63
- package/Select/Select.d.ts +88 -0
- package/Select/Select.d.ts.map +1 -0
- package/Select/Select.stories.d.ts +17 -0
- package/Select/Select.stories.d.ts.map +1 -0
- package/Select/Select.test.d.ts +2 -0
- package/Select/Select.test.d.ts.map +1 -0
- package/Select/SelectContext.d.ts +14 -0
- package/Select/SelectContext.d.ts.map +1 -0
- package/Select/SelectField.d.ts +62 -0
- package/Select/SelectField.d.ts.map +1 -0
- package/Select/SelectOption.d.ts +23 -0
- package/Select/SelectOption.d.ts.map +1 -0
- package/Select/SelectOverlay.d.ts +3 -0
- package/Select/SelectOverlay.d.ts.map +1 -0
- package/Select/SelectSection.d.ts +22 -0
- package/Select/SelectSection.d.ts.map +1 -0
- package/Select/SelectTrigger.d.ts +30 -0
- package/Select/SelectTrigger.d.ts.map +1 -0
- package/Select/index.d.ts +2 -0
- package/Select/index.d.ts.map +1 -0
- package/Select/index.js +816 -0
- package/Select/index.mjs +816 -0
- package/SelectorErrorTooltip/index.js +102 -11
- package/SelectorErrorTooltip/index.mjs +86 -11
- package/Text/index.js +85 -4
- package/Text/index.mjs +85 -4
- package/TextField/index.js +19 -38
- package/TextField/index.mjs +19 -38
- package/Textarea/index.js +20 -37
- package/Textarea/index.mjs +20 -37
- package/Theme/index.js +145 -9
- package/Theme/index.mjs +145 -9
- package/Toggle/index.js +51 -50
- package/Toggle/index.mjs +51 -50
- package/Tooltip/index.js +299 -10
- package/Tooltip/index.mjs +299 -10
- package/UnstyledButton/index.js +4 -4
- package/UnstyledButton/index.mjs +3 -3
- package/VerticalStack/index.js +13 -47
- package/VerticalStack/index.mjs +13 -47
- package/__chunks__/ExpandMore400-7c5263a4.mjs +49 -0
- package/__chunks__/ExpandMore400-92646971.js +65 -0
- package/__chunks__/InputIcon-2317befd.mjs +148 -0
- package/__chunks__/InputIcon-d3963cf8.js +147 -0
- package/__chunks__/{import-e7f45c7e.mjs → import-0561e1ba.mjs} +3 -3
- package/__chunks__/{import-b7971a11.mjs → import-19bc38ac.mjs} +72 -34
- package/__chunks__/{import-01299af6.js → import-24a482e1.js} +3 -2
- package/__chunks__/{import-baa3cd0c.mjs → import-29af6941.mjs} +4 -3
- package/__chunks__/{import-0d1b4d93.js → import-2b302763.js} +193 -141
- package/__chunks__/{import-ab878fb6.mjs → import-3d962a94.mjs} +205 -153
- package/__chunks__/{import-86330a7c.mjs → import-6a831ca1.mjs} +16 -15
- package/__chunks__/{import-7545401a.js → import-8b6c0bc7.js} +3 -3
- package/__chunks__/{import-63bf0645.js → import-a1e0f814.js} +47 -9
- package/__chunks__/{import-3ab42f86.js → import-a2023d8f.js} +35 -22
- package/__chunks__/{import-76076ca6.js → import-dea5a24d.js} +15 -14
- package/__chunks__/{import-856e0385.mjs → import-f1f4792a.mjs} +36 -23
- package/__chunks__/{UnstyledButton-883f0c6c.mjs → index-29d7bca9.mjs} +17 -42
- package/__chunks__/{UnstyledButton-96172ec0.js → index-3985350a.js} +17 -42
- package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
- package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
- package/__chunks__/{real-module-e4cd2301.mjs → real-module-515df21d.mjs} +1 -1
- package/__chunks__/{real-module-ae2a4342.js → real-module-e36b1436.js} +1 -1
- package/__chunks__/useTriggerWidth-156b038a.js +2030 -0
- package/__chunks__/useTriggerWidth-addcd1d6.mjs +2031 -0
- package/package.json +11 -11
- package/style.css +1423 -1196
- package/utilities/css.js +14 -58
- package/utilities/css.mjs +14 -58
- package/__chunks__/Card-7bbd41e0.mjs +0 -110
- package/__chunks__/Card-dac53c75.js +0 -109
- package/__chunks__/HorizontalStack-a441c63f.mjs +0 -80
- package/__chunks__/HorizontalStack-a862839b.js +0 -79
- package/__chunks__/Icon-3d00481a.js +0 -44
- package/__chunks__/Icon-a75b5201.mjs +0 -45
- package/__chunks__/InputField-4fbaae06.js +0 -487
- package/__chunks__/InputField-a272f602.mjs +0 -472
- package/__chunks__/Notification-b8eafec6.mjs +0 -1456
- package/__chunks__/Notification-c5b34eb3.js +0 -1471
- package/__chunks__/SelectorErrorTooltip-43c5e29e.js +0 -84
- package/__chunks__/SelectorErrorTooltip-b6204987.mjs +0 -69
- package/__chunks__/Text-1ae70c19.js +0 -102
- package/__chunks__/Text-4ae50d5c.mjs +0 -103
- package/__chunks__/Theme-4e498252.mjs +0 -132
- package/__chunks__/Theme-751e5575.js +0 -131
- package/__chunks__/Tooltip-bd55165e.js +0 -317
- package/__chunks__/Tooltip-f7e67b21.mjs +0 -318
package/CodeBlock/index.js
CHANGED
|
@@ -19,13 +19,13 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
21
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
22
|
-
const _import = require("../__chunks__/import-
|
|
22
|
+
const _import = require("../__chunks__/import-a1e0f814.js");
|
|
23
23
|
const React = require("react");
|
|
24
|
-
const
|
|
24
|
+
const Card_index = require("../Card/index.js");
|
|
25
25
|
const omit = require("../__chunks__/omit-fca26542.js");
|
|
26
26
|
const tokens = require("../__chunks__/tokens-e696ca96.js");
|
|
27
27
|
const utilities_css = require("../utilities/css.js");
|
|
28
|
-
const overlayscrollbarsReact_es = require("../__chunks__/overlayscrollbars-react.es-
|
|
28
|
+
const overlayscrollbarsReact_es = require("../__chunks__/overlayscrollbars-react.es-f2a0bcff.js");
|
|
29
29
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
30
30
|
if (source == null)
|
|
31
31
|
return {};
|
|
@@ -5120,25 +5120,22 @@ SyntaxHighlighter$1.registerLanguage(SnippetLanguage.PYTHON, python$1);
|
|
|
5120
5120
|
SyntaxHighlighter$1.registerLanguage(SnippetLanguage.RUBY, ruby$1);
|
|
5121
5121
|
SyntaxHighlighter$1.registerLanguage(SnippetLanguage.SHELL, shellSession$1);
|
|
5122
5122
|
function useEasyUiSyntaxHighlighterTheme(maxLines) {
|
|
5123
|
-
return React.useMemo(
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
}),
|
|
5140
|
-
[maxLines]
|
|
5141
|
-
);
|
|
5123
|
+
return React.useMemo(() => buildTheme({
|
|
5124
|
+
maxLines,
|
|
5125
|
+
fontFamily: tokens.ezuiTokens["font.family.mono"],
|
|
5126
|
+
fontSize: `${utilities_css.pxToRem(14)}rem`,
|
|
5127
|
+
base: tokens.ezuiTokens["theme.base.color.text.code.base"],
|
|
5128
|
+
lineNumber: tokens.ezuiTokens["theme.base.color.text.code.lineNumber"],
|
|
5129
|
+
comment: tokens.ezuiTokens["theme.base.color.text.code.comment"],
|
|
5130
|
+
punctuation: tokens.ezuiTokens["theme.base.color.text.code.punctuation"],
|
|
5131
|
+
property: tokens.ezuiTokens["theme.base.color.text.code.property"],
|
|
5132
|
+
selector: tokens.ezuiTokens["theme.base.color.text.code.selector"],
|
|
5133
|
+
operator: tokens.ezuiTokens["theme.base.color.text.code.operator"],
|
|
5134
|
+
operatorBg: "transparent",
|
|
5135
|
+
variable: tokens.ezuiTokens["theme.base.color.text.code.variable"],
|
|
5136
|
+
function: tokens.ezuiTokens["theme.base.color.text.code.function"],
|
|
5137
|
+
keyword: tokens.ezuiTokens["theme.base.color.text.code.keyword"]
|
|
5138
|
+
}), [maxLines]);
|
|
5142
5139
|
}
|
|
5143
5140
|
function buildTheme(config) {
|
|
5144
5141
|
return {
|
|
@@ -5347,7 +5344,12 @@ function useScrollbar(codeBlockRef) {
|
|
|
5347
5344
|
const $block = codeBlockRef.current;
|
|
5348
5345
|
const $pre = $block == null ? void 0 : $block.querySelector("pre");
|
|
5349
5346
|
if ($block && $pre) {
|
|
5350
|
-
initialize({
|
|
5347
|
+
initialize({
|
|
5348
|
+
target: $block,
|
|
5349
|
+
elements: {
|
|
5350
|
+
viewport: $pre
|
|
5351
|
+
}
|
|
5352
|
+
});
|
|
5351
5353
|
let innerTimeout;
|
|
5352
5354
|
const outerTimeout = setTimeout(() => {
|
|
5353
5355
|
const ogTabIndex = $block.getAttribute("tabindex");
|
|
@@ -5369,34 +5371,26 @@ function useScrollbar(codeBlockRef) {
|
|
|
5369
5371
|
}
|
|
5370
5372
|
}, [initialize, codeBlockRef]);
|
|
5371
5373
|
}
|
|
5372
|
-
const CodeBlock$1 = "
|
|
5374
|
+
const CodeBlock$1 = "_CodeBlock_1f5ii_5";
|
|
5373
5375
|
const styles = {
|
|
5374
5376
|
CodeBlock: CodeBlock$1
|
|
5375
5377
|
};
|
|
5376
|
-
const CodeBlock = React.forwardRef(
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
style: syntaxTheme,
|
|
5394
|
-
showLineNumbers
|
|
5395
|
-
},
|
|
5396
|
-
code
|
|
5397
|
-
)
|
|
5398
|
-
));
|
|
5399
|
-
}
|
|
5400
|
-
);
|
|
5378
|
+
const CodeBlock = React.forwardRef((props, ref) => {
|
|
5379
|
+
const { code, language, maxLines, showLineNumbers } = props;
|
|
5380
|
+
const codeBlockRef = React.useRef(null);
|
|
5381
|
+
const syntaxTheme = useEasyUiSyntaxHighlighterTheme(maxLines);
|
|
5382
|
+
useScrollbar(codeBlockRef);
|
|
5383
|
+
return React.createElement(Card_index.Card, {
|
|
5384
|
+
background: "primary"
|
|
5385
|
+
}, React.createElement("div", {
|
|
5386
|
+
className: styles.CodeBlock,
|
|
5387
|
+
ref: _import.$5dc95899b306f630$export$c9058316764c140e(ref, codeBlockRef),
|
|
5388
|
+
tabIndex: maxLines != null ? 0 : void 0
|
|
5389
|
+
}, React.createElement(SyntaxHighlighter$1, {
|
|
5390
|
+
language,
|
|
5391
|
+
style: syntaxTheme,
|
|
5392
|
+
showLineNumbers
|
|
5393
|
+
}, code)));
|
|
5394
|
+
});
|
|
5401
5395
|
CodeBlock.displayName = "CodeBlock";
|
|
5402
5396
|
exports.CodeBlock = CodeBlock;
|
package/CodeBlock/index.mjs
CHANGED
|
@@ -17,13 +17,13 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import {
|
|
20
|
+
import { z as $5dc95899b306f630$export$c9058316764c140e } from "../__chunks__/import-19bc38ac.mjs";
|
|
21
21
|
import React__default, { useMemo, useEffect, forwardRef, useRef } from "react";
|
|
22
|
-
import {
|
|
22
|
+
import { Card } from "../Card/index.mjs";
|
|
23
23
|
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "../__chunks__/omit-f17deb8f.mjs";
|
|
24
24
|
import { e as ezuiTokens } from "../__chunks__/tokens-6be8e137.mjs";
|
|
25
25
|
import { pxToRem } from "../utilities/css.mjs";
|
|
26
|
-
import { S } from "../__chunks__/overlayscrollbars-react.es-
|
|
26
|
+
import { S } from "../__chunks__/overlayscrollbars-react.es-7f332a3b.mjs";
|
|
27
27
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
28
28
|
if (source == null)
|
|
29
29
|
return {};
|
|
@@ -5118,25 +5118,22 @@ SyntaxHighlighter$1.registerLanguage(SnippetLanguage.PYTHON, python$1);
|
|
|
5118
5118
|
SyntaxHighlighter$1.registerLanguage(SnippetLanguage.RUBY, ruby$1);
|
|
5119
5119
|
SyntaxHighlighter$1.registerLanguage(SnippetLanguage.SHELL, shellSession$1);
|
|
5120
5120
|
function useEasyUiSyntaxHighlighterTheme(maxLines) {
|
|
5121
|
-
return useMemo(
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
}),
|
|
5138
|
-
[maxLines]
|
|
5139
|
-
);
|
|
5121
|
+
return useMemo(() => buildTheme({
|
|
5122
|
+
maxLines,
|
|
5123
|
+
fontFamily: ezuiTokens["font.family.mono"],
|
|
5124
|
+
fontSize: `${pxToRem(14)}rem`,
|
|
5125
|
+
base: ezuiTokens["theme.base.color.text.code.base"],
|
|
5126
|
+
lineNumber: ezuiTokens["theme.base.color.text.code.lineNumber"],
|
|
5127
|
+
comment: ezuiTokens["theme.base.color.text.code.comment"],
|
|
5128
|
+
punctuation: ezuiTokens["theme.base.color.text.code.punctuation"],
|
|
5129
|
+
property: ezuiTokens["theme.base.color.text.code.property"],
|
|
5130
|
+
selector: ezuiTokens["theme.base.color.text.code.selector"],
|
|
5131
|
+
operator: ezuiTokens["theme.base.color.text.code.operator"],
|
|
5132
|
+
operatorBg: "transparent",
|
|
5133
|
+
variable: ezuiTokens["theme.base.color.text.code.variable"],
|
|
5134
|
+
function: ezuiTokens["theme.base.color.text.code.function"],
|
|
5135
|
+
keyword: ezuiTokens["theme.base.color.text.code.keyword"]
|
|
5136
|
+
}), [maxLines]);
|
|
5140
5137
|
}
|
|
5141
5138
|
function buildTheme(config) {
|
|
5142
5139
|
return {
|
|
@@ -5345,7 +5342,12 @@ function useScrollbar(codeBlockRef) {
|
|
|
5345
5342
|
const $block = codeBlockRef.current;
|
|
5346
5343
|
const $pre = $block == null ? void 0 : $block.querySelector("pre");
|
|
5347
5344
|
if ($block && $pre) {
|
|
5348
|
-
initialize({
|
|
5345
|
+
initialize({
|
|
5346
|
+
target: $block,
|
|
5347
|
+
elements: {
|
|
5348
|
+
viewport: $pre
|
|
5349
|
+
}
|
|
5350
|
+
});
|
|
5349
5351
|
let innerTimeout;
|
|
5350
5352
|
const outerTimeout = setTimeout(() => {
|
|
5351
5353
|
const ogTabIndex = $block.getAttribute("tabindex");
|
|
@@ -5367,35 +5369,27 @@ function useScrollbar(codeBlockRef) {
|
|
|
5367
5369
|
}
|
|
5368
5370
|
}, [initialize, codeBlockRef]);
|
|
5369
5371
|
}
|
|
5370
|
-
const CodeBlock$1 = "
|
|
5372
|
+
const CodeBlock$1 = "_CodeBlock_1f5ii_5";
|
|
5371
5373
|
const styles = {
|
|
5372
5374
|
CodeBlock: CodeBlock$1
|
|
5373
5375
|
};
|
|
5374
|
-
const CodeBlock = forwardRef(
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
style: syntaxTheme,
|
|
5392
|
-
showLineNumbers
|
|
5393
|
-
},
|
|
5394
|
-
code
|
|
5395
|
-
)
|
|
5396
|
-
));
|
|
5397
|
-
}
|
|
5398
|
-
);
|
|
5376
|
+
const CodeBlock = forwardRef((props, ref) => {
|
|
5377
|
+
const { code, language, maxLines, showLineNumbers } = props;
|
|
5378
|
+
const codeBlockRef = useRef(null);
|
|
5379
|
+
const syntaxTheme = useEasyUiSyntaxHighlighterTheme(maxLines);
|
|
5380
|
+
useScrollbar(codeBlockRef);
|
|
5381
|
+
return React__default.createElement(Card, {
|
|
5382
|
+
background: "primary"
|
|
5383
|
+
}, React__default.createElement("div", {
|
|
5384
|
+
className: styles.CodeBlock,
|
|
5385
|
+
ref: $5dc95899b306f630$export$c9058316764c140e(ref, codeBlockRef),
|
|
5386
|
+
tabIndex: maxLines != null ? 0 : void 0
|
|
5387
|
+
}, React__default.createElement(SyntaxHighlighter$1, {
|
|
5388
|
+
language,
|
|
5389
|
+
style: syntaxTheme,
|
|
5390
|
+
showLineNumbers
|
|
5391
|
+
}, code)));
|
|
5392
|
+
});
|
|
5399
5393
|
CodeBlock.displayName = "CodeBlock";
|
|
5400
5394
|
export {
|
|
5401
5395
|
CodeBlock
|
|
@@ -12,6 +12,54 @@ export type DropdownButtonProps = AriaButtonProps & {
|
|
|
12
12
|
/** Content inside button */
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Typically used as a trigger to display a set of options for
|
|
17
|
+
* the user to choose from.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Can be used alongside Easy UI's `<Menu />` as the trigger element.
|
|
21
|
+
* Comes pre-styled with separator and right-aligned arrow icon. Supports
|
|
22
|
+
* multiple colors and an outlined variant. Underlying element is a button.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* _Default:_
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { DropdownButton } from "@easypost/easy-ui/DropdownButton";
|
|
28
|
+
*
|
|
29
|
+
* export function Component() {
|
|
30
|
+
* return (
|
|
31
|
+
* <DropdownButton onPress={() => alert("clicked")}>Button</DropdownButton>
|
|
32
|
+
* );
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* _Outlined variant:_
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { DropdownButton } from "@easypost/easy-ui/DropdownButton";
|
|
40
|
+
*
|
|
41
|
+
* export function Component() {
|
|
42
|
+
* return (
|
|
43
|
+
* <DropdownButton onPress={() => alert("clicked")} variant="outlined">
|
|
44
|
+
* Button
|
|
45
|
+
* </DropdownButton>
|
|
46
|
+
* );
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
* @example
|
|
50
|
+
* _Success color:_
|
|
51
|
+
* ```tsx
|
|
52
|
+
* import { DropdownButton } from "@easypost/easy-ui/DropdownButton";
|
|
53
|
+
*
|
|
54
|
+
* export function Component() {
|
|
55
|
+
* return (
|
|
56
|
+
* <DropdownButton onPress={() => alert("clicked")} color="success">
|
|
57
|
+
* Button
|
|
58
|
+
* </DropdownButton>
|
|
59
|
+
* );
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
15
63
|
export declare const DropdownButton: React.ForwardRefExoticComponent<AriaButtonProps<"button"> & {
|
|
16
64
|
/** Button color */
|
|
17
65
|
color?: ButtonColor | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownButton.d.ts","sourceRoot":"","sources":["../../src/DropdownButton/DropdownButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,mBAAmB;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,sBAAsB;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"DropdownButton.d.ts","sourceRoot":"","sources":["../../src/DropdownButton/DropdownButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,mBAAmB;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qBAAqB;IACrB,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,sBAAsB;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,cAAc;IA1DzB,mBAAmB;;IAEnB,qBAAqB;;IAErB,sBAAsB;;IAEtB,6BAA6B;eAClB,SAAS;8BAgFrB,CAAC"}
|
package/DropdownButton/index.js
CHANGED
|
@@ -28,79 +28,25 @@ var __objRest = (source, exclude) => {
|
|
|
28
28
|
return target;
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
31
|
+
const ExpandMore400 = require("../__chunks__/ExpandMore400-92646971.js");
|
|
31
32
|
const React = require("react");
|
|
32
|
-
const
|
|
33
|
-
const
|
|
33
|
+
const UnstyledButton_index = require("../__chunks__/index-3985350a.js");
|
|
34
|
+
const Icon_index = require("../Icon/index.js");
|
|
34
35
|
const utilities_css = require("../utilities/css.js");
|
|
35
|
-
require("../__chunks__/import-
|
|
36
|
+
require("../__chunks__/import-a1e0f814.js");
|
|
36
37
|
require("../__chunks__/omit-fca26542.js");
|
|
37
|
-
require("../__chunks__/import-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
n.default = e;
|
|
52
|
-
return Object.freeze(n);
|
|
53
|
-
}
|
|
54
|
-
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
55
|
-
var __defProp2 = Object.defineProperty;
|
|
56
|
-
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
57
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
58
|
-
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
59
|
-
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
60
|
-
var __spreadValues2 = (a, b) => {
|
|
61
|
-
for (var prop in b || (b = {}))
|
|
62
|
-
if (__hasOwnProp2.call(b, prop))
|
|
63
|
-
__defNormalProp2(a, prop, b[prop]);
|
|
64
|
-
if (__getOwnPropSymbols2)
|
|
65
|
-
for (var prop of __getOwnPropSymbols2(b)) {
|
|
66
|
-
if (__propIsEnum2.call(b, prop))
|
|
67
|
-
__defNormalProp2(a, prop, b[prop]);
|
|
68
|
-
}
|
|
69
|
-
return a;
|
|
70
|
-
};
|
|
71
|
-
var __objRest2 = (source, exclude) => {
|
|
72
|
-
var target = {};
|
|
73
|
-
for (var prop in source)
|
|
74
|
-
if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
75
|
-
target[prop] = source[prop];
|
|
76
|
-
if (source != null && __getOwnPropSymbols2)
|
|
77
|
-
for (var prop of __getOwnPropSymbols2(source)) {
|
|
78
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop))
|
|
79
|
-
target[prop] = source[prop];
|
|
80
|
-
}
|
|
81
|
-
return target;
|
|
82
|
-
};
|
|
83
|
-
const ExpandMore400 = (_a) => {
|
|
84
|
-
var _b = _a, {
|
|
85
|
-
title,
|
|
86
|
-
titleId
|
|
87
|
-
} = _b, props = __objRest2(_b, [
|
|
88
|
-
"title",
|
|
89
|
-
"titleId"
|
|
90
|
-
]);
|
|
91
|
-
return /* @__PURE__ */ React__namespace.createElement("svg", __spreadValues2({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React__namespace.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React__namespace.createElement("path", { d: "M480-345 240-585l43-43 197 198 197-197 43 43-240 239Z" }));
|
|
92
|
-
};
|
|
93
|
-
const DropdownButton$1 = "_DropdownButton_11vxe_5";
|
|
94
|
-
const colorPrimary = "_colorPrimary_11vxe_26";
|
|
95
|
-
const colorSecondary = "_colorSecondary_11vxe_34";
|
|
96
|
-
const colorSuccess = "_colorSuccess_11vxe_42";
|
|
97
|
-
const colorWarning = "_colorWarning_11vxe_50";
|
|
98
|
-
const colorNeutral = "_colorNeutral_11vxe_58";
|
|
99
|
-
const colorSupport = "_colorSupport_11vxe_66";
|
|
100
|
-
const colorInverse = "_colorInverse_11vxe_72";
|
|
101
|
-
const variantOutlined = "_variantOutlined_11vxe_78";
|
|
102
|
-
const variantFilled = "_variantFilled_11vxe_109";
|
|
103
|
-
const pipeSeparator = "_pipeSeparator_11vxe_136";
|
|
38
|
+
require("../__chunks__/import-2b302763.js");
|
|
39
|
+
const DropdownButton$1 = "_DropdownButton_1ynin_5";
|
|
40
|
+
const colorPrimary = "_colorPrimary_1ynin_26";
|
|
41
|
+
const colorSecondary = "_colorSecondary_1ynin_34";
|
|
42
|
+
const colorSuccess = "_colorSuccess_1ynin_42";
|
|
43
|
+
const colorWarning = "_colorWarning_1ynin_50";
|
|
44
|
+
const colorNeutral = "_colorNeutral_1ynin_58";
|
|
45
|
+
const colorSupport = "_colorSupport_1ynin_66";
|
|
46
|
+
const colorInverse = "_colorInverse_1ynin_72";
|
|
47
|
+
const variantOutlined = "_variantOutlined_1ynin_78";
|
|
48
|
+
const variantFilled = "_variantFilled_1ynin_109";
|
|
49
|
+
const pipeSeparator = "_pipeSeparator_1ynin_136";
|
|
104
50
|
const styles = {
|
|
105
51
|
DropdownButton: DropdownButton$1,
|
|
106
52
|
colorPrimary,
|
|
@@ -114,36 +60,18 @@ const styles = {
|
|
|
114
60
|
variantFilled,
|
|
115
61
|
pipeSeparator
|
|
116
62
|
};
|
|
117
|
-
const DropdownButton = React.forwardRef(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
UnstyledButton.logWarningIfInvalidColorVariantCombination(color, variant);
|
|
131
|
-
return /* @__PURE__ */ React.createElement(
|
|
132
|
-
UnstyledButton.UnstyledButton,
|
|
133
|
-
__spreadValues({
|
|
134
|
-
isDisabled,
|
|
135
|
-
ref: inRef,
|
|
136
|
-
className: utilities_css.classNames(
|
|
137
|
-
styles.DropdownButton,
|
|
138
|
-
styles[utilities_css.variationName("variant", variant)],
|
|
139
|
-
styles[utilities_css.variationName("color", color)]
|
|
140
|
-
)
|
|
141
|
-
}, restProps),
|
|
142
|
-
/* @__PURE__ */ React.createElement("span", null, children),
|
|
143
|
-
/* @__PURE__ */ React.createElement("span", { className: utilities_css.classNames(styles.pipeSeparator) }),
|
|
144
|
-
/* @__PURE__ */ React.createElement(Icon.Icon, { symbol: ExpandMore400 })
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
);
|
|
63
|
+
const DropdownButton = React.forwardRef((props, inRef) => {
|
|
64
|
+
const _a = props, { color = "primary", variant = "filled", isDisabled = false, children = "Button" } = _a, restProps = __objRest(_a, ["color", "variant", "isDisabled", "children"]);
|
|
65
|
+
UnstyledButton_index.logWarningIfInvalidColorVariantCombination(color, variant);
|
|
66
|
+
return React.createElement(UnstyledButton_index.UnstyledButton, __spreadValues({
|
|
67
|
+
isDisabled,
|
|
68
|
+
ref: inRef,
|
|
69
|
+
className: utilities_css.classNames(styles.DropdownButton, styles[utilities_css.variationName("variant", variant)], styles[utilities_css.variationName("color", color)])
|
|
70
|
+
}, restProps), React.createElement("span", null, children), React.createElement("span", {
|
|
71
|
+
className: utilities_css.classNames(styles.pipeSeparator)
|
|
72
|
+
}), React.createElement(Icon_index.Icon, {
|
|
73
|
+
symbol: ExpandMore400.ExpandMore400
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
148
76
|
DropdownButton.displayName = "DropdownButton";
|
|
149
77
|
exports.DropdownButton = DropdownButton;
|
package/DropdownButton/index.mjs
CHANGED
|
@@ -26,63 +26,25 @@ var __objRest = (source, exclude) => {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
|
-
import
|
|
29
|
+
import { E as ExpandMore400 } from "../__chunks__/ExpandMore400-7c5263a4.mjs";
|
|
30
30
|
import React__default, { forwardRef } from "react";
|
|
31
|
-
import { l as logWarningIfInvalidColorVariantCombination, U as UnstyledButton } from "../__chunks__/
|
|
32
|
-
import {
|
|
31
|
+
import { l as logWarningIfInvalidColorVariantCombination, U as UnstyledButton } from "../__chunks__/index-29d7bca9.mjs";
|
|
32
|
+
import { Icon } from "../Icon/index.mjs";
|
|
33
33
|
import { classNames, variationName } from "../utilities/css.mjs";
|
|
34
|
-
import "../__chunks__/import-
|
|
34
|
+
import "../__chunks__/import-19bc38ac.mjs";
|
|
35
35
|
import "../__chunks__/omit-f17deb8f.mjs";
|
|
36
|
-
import "../__chunks__/import-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (__propIsEnum2.call(b, prop))
|
|
49
|
-
__defNormalProp2(a, prop, b[prop]);
|
|
50
|
-
}
|
|
51
|
-
return a;
|
|
52
|
-
};
|
|
53
|
-
var __objRest2 = (source, exclude) => {
|
|
54
|
-
var target = {};
|
|
55
|
-
for (var prop in source)
|
|
56
|
-
if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
57
|
-
target[prop] = source[prop];
|
|
58
|
-
if (source != null && __getOwnPropSymbols2)
|
|
59
|
-
for (var prop of __getOwnPropSymbols2(source)) {
|
|
60
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop))
|
|
61
|
-
target[prop] = source[prop];
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
};
|
|
65
|
-
const ExpandMore400 = (_a) => {
|
|
66
|
-
var _b = _a, {
|
|
67
|
-
title,
|
|
68
|
-
titleId
|
|
69
|
-
} = _b, props = __objRest2(_b, [
|
|
70
|
-
"title",
|
|
71
|
-
"titleId"
|
|
72
|
-
]);
|
|
73
|
-
return /* @__PURE__ */ React.createElement("svg", __spreadValues2({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "M480-345 240-585l43-43 197 198 197-197 43 43-240 239Z" }));
|
|
74
|
-
};
|
|
75
|
-
const DropdownButton$1 = "_DropdownButton_11vxe_5";
|
|
76
|
-
const colorPrimary = "_colorPrimary_11vxe_26";
|
|
77
|
-
const colorSecondary = "_colorSecondary_11vxe_34";
|
|
78
|
-
const colorSuccess = "_colorSuccess_11vxe_42";
|
|
79
|
-
const colorWarning = "_colorWarning_11vxe_50";
|
|
80
|
-
const colorNeutral = "_colorNeutral_11vxe_58";
|
|
81
|
-
const colorSupport = "_colorSupport_11vxe_66";
|
|
82
|
-
const colorInverse = "_colorInverse_11vxe_72";
|
|
83
|
-
const variantOutlined = "_variantOutlined_11vxe_78";
|
|
84
|
-
const variantFilled = "_variantFilled_11vxe_109";
|
|
85
|
-
const pipeSeparator = "_pipeSeparator_11vxe_136";
|
|
36
|
+
import "../__chunks__/import-3d962a94.mjs";
|
|
37
|
+
const DropdownButton$1 = "_DropdownButton_1ynin_5";
|
|
38
|
+
const colorPrimary = "_colorPrimary_1ynin_26";
|
|
39
|
+
const colorSecondary = "_colorSecondary_1ynin_34";
|
|
40
|
+
const colorSuccess = "_colorSuccess_1ynin_42";
|
|
41
|
+
const colorWarning = "_colorWarning_1ynin_50";
|
|
42
|
+
const colorNeutral = "_colorNeutral_1ynin_58";
|
|
43
|
+
const colorSupport = "_colorSupport_1ynin_66";
|
|
44
|
+
const colorInverse = "_colorInverse_1ynin_72";
|
|
45
|
+
const variantOutlined = "_variantOutlined_1ynin_78";
|
|
46
|
+
const variantFilled = "_variantFilled_1ynin_109";
|
|
47
|
+
const pipeSeparator = "_pipeSeparator_1ynin_136";
|
|
86
48
|
const styles = {
|
|
87
49
|
DropdownButton: DropdownButton$1,
|
|
88
50
|
colorPrimary,
|
|
@@ -96,37 +58,19 @@ const styles = {
|
|
|
96
58
|
variantFilled,
|
|
97
59
|
pipeSeparator
|
|
98
60
|
};
|
|
99
|
-
const DropdownButton = forwardRef(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
logWarningIfInvalidColorVariantCombination(color, variant);
|
|
113
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
114
|
-
UnstyledButton,
|
|
115
|
-
__spreadValues({
|
|
116
|
-
isDisabled,
|
|
117
|
-
ref: inRef,
|
|
118
|
-
className: classNames(
|
|
119
|
-
styles.DropdownButton,
|
|
120
|
-
styles[variationName("variant", variant)],
|
|
121
|
-
styles[variationName("color", color)]
|
|
122
|
-
)
|
|
123
|
-
}, restProps),
|
|
124
|
-
/* @__PURE__ */ React__default.createElement("span", null, children),
|
|
125
|
-
/* @__PURE__ */ React__default.createElement("span", { className: classNames(styles.pipeSeparator) }),
|
|
126
|
-
/* @__PURE__ */ React__default.createElement(Icon, { symbol: ExpandMore400 })
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
);
|
|
61
|
+
const DropdownButton = forwardRef((props, inRef) => {
|
|
62
|
+
const _a = props, { color = "primary", variant = "filled", isDisabled = false, children = "Button" } = _a, restProps = __objRest(_a, ["color", "variant", "isDisabled", "children"]);
|
|
63
|
+
logWarningIfInvalidColorVariantCombination(color, variant);
|
|
64
|
+
return React__default.createElement(UnstyledButton, __spreadValues({
|
|
65
|
+
isDisabled,
|
|
66
|
+
ref: inRef,
|
|
67
|
+
className: classNames(styles.DropdownButton, styles[variationName("variant", variant)], styles[variationName("color", color)])
|
|
68
|
+
}, restProps), React__default.createElement("span", null, children), React__default.createElement("span", {
|
|
69
|
+
className: classNames(styles.pipeSeparator)
|
|
70
|
+
}), React__default.createElement(Icon, {
|
|
71
|
+
symbol: ExpandMore400
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
130
74
|
DropdownButton.displayName = "DropdownButton";
|
|
131
75
|
export {
|
|
132
76
|
DropdownButton
|
package/HorizontalGrid/index.js
CHANGED
|
@@ -20,14 +20,7 @@ const React = require("react");
|
|
|
20
20
|
const utilities_css = require("../utilities/css.js");
|
|
21
21
|
function formatHorizontalGrid(columns) {
|
|
22
22
|
if (typeof columns === "object" && columns !== null && !Array.isArray(columns)) {
|
|
23
|
-
return Object.fromEntries(
|
|
24
|
-
Object.entries(columns).map(
|
|
25
|
-
([breakpointAlias, breakpointHorizontalGrid]) => [
|
|
26
|
-
breakpointAlias,
|
|
27
|
-
getColumnValue(breakpointHorizontalGrid)
|
|
28
|
-
]
|
|
29
|
-
)
|
|
30
|
-
);
|
|
23
|
+
return Object.fromEntries(Object.entries(columns).map(([breakpointAlias, breakpointHorizontalGrid]) => [breakpointAlias, getColumnValue(breakpointHorizontalGrid)]));
|
|
31
24
|
}
|
|
32
25
|
return getColumnValue(columns);
|
|
33
26
|
}
|
|
@@ -54,31 +47,18 @@ function getColumnValue(columns) {
|
|
|
54
47
|
}
|
|
55
48
|
}).join(" ");
|
|
56
49
|
}
|
|
57
|
-
const HorizontalGrid$1 = "
|
|
50
|
+
const HorizontalGrid$1 = "_HorizontalGrid_1wcnj_5";
|
|
58
51
|
const styles = {
|
|
59
52
|
HorizontalGrid: HorizontalGrid$1
|
|
60
53
|
};
|
|
61
|
-
const HorizontalGrid = React.forwardRef(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} = props;
|
|
71
|
-
const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, utilities_css.getResponsiveValue(
|
|
72
|
-
"horizontal-grid",
|
|
73
|
-
"grid-template-columns",
|
|
74
|
-
formatHorizontalGrid(columns)
|
|
75
|
-
)), utilities_css.getResponsiveDesignToken("horizontal-grid", "gap", "space", gap)), utilities_css.getComponentToken("horizontal-grid", "align-items", alignItems)), utilities_css.getComponentToken(
|
|
76
|
-
"horizontal-grid",
|
|
77
|
-
"display",
|
|
78
|
-
inline ? "inline-grid" : "grid"
|
|
79
|
-
));
|
|
80
|
-
return /* @__PURE__ */ React.createElement(As, { className: styles.HorizontalGrid, style, ref }, children);
|
|
81
|
-
}
|
|
82
|
-
);
|
|
54
|
+
const HorizontalGrid = React.forwardRef((props, ref) => {
|
|
55
|
+
const { alignItems, as: As = "div", children, columns, gap, inline } = props;
|
|
56
|
+
const style = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, utilities_css.getResponsiveValue("horizontal-grid", "grid-template-columns", formatHorizontalGrid(columns))), utilities_css.getResponsiveDesignToken("horizontal-grid", "gap", "space", gap)), utilities_css.getComponentToken("horizontal-grid", "align-items", alignItems)), utilities_css.getComponentToken("horizontal-grid", "display", inline ? "inline-grid" : "grid"));
|
|
57
|
+
return React.createElement(As, {
|
|
58
|
+
className: styles.HorizontalGrid,
|
|
59
|
+
style,
|
|
60
|
+
ref
|
|
61
|
+
}, children);
|
|
62
|
+
});
|
|
83
63
|
HorizontalGrid.displayName = "HorizontalGrid";
|
|
84
64
|
exports.HorizontalGrid = HorizontalGrid;
|