@uniformdev/design-system 18.18.1-alpha.12 → 18.19.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/dist/esm/index.js +30 -7
- package/dist/index.d.ts +7 -5
- package/dist/index.js +33 -6
- package/package.json +5 -4
package/dist/esm/index.js
CHANGED
|
@@ -1196,7 +1196,9 @@ var customIcons = {
|
|
|
1196
1196
|
// src/components/Icons/IconsProvider.tsx
|
|
1197
1197
|
import { jsx as jsx5 } from "@emotion/react/jsx-runtime";
|
|
1198
1198
|
var IconContext = createContext({
|
|
1199
|
+
/** object mapping of available icons */
|
|
1199
1200
|
iconsMap: {},
|
|
1201
|
+
/** sets the loading state of the icon */
|
|
1200
1202
|
isLoading: true
|
|
1201
1203
|
});
|
|
1202
1204
|
function useIconContext() {
|
|
@@ -8275,6 +8277,7 @@ var Button = React5.forwardRef(
|
|
|
8275
8277
|
ghost: buttonGhost,
|
|
8276
8278
|
ghostDestructive: buttonGhostDestructive,
|
|
8277
8279
|
unimportant: buttonUnimportant,
|
|
8280
|
+
/** @deprecated */
|
|
8278
8281
|
tertiary: buttonTertiary
|
|
8279
8282
|
};
|
|
8280
8283
|
const btnSize = {
|
|
@@ -9018,6 +9021,9 @@ var counterIcon = css24`
|
|
|
9018
9021
|
// src/components/Counter/Counter.tsx
|
|
9019
9022
|
import { jsx as jsx27, jsxs as jsxs15 } from "@emotion/react/jsx-runtime";
|
|
9020
9023
|
var Counter = ({ count }) => {
|
|
9024
|
+
if (typeof count === "undefined") {
|
|
9025
|
+
return null;
|
|
9026
|
+
}
|
|
9021
9027
|
const isTripleDigits = count > 99 ? /* @__PURE__ */ jsxs15("span", { css: counterTripleValue, title: `${count}`, children: [
|
|
9022
9028
|
"99",
|
|
9023
9029
|
/* @__PURE__ */ jsx27(Icon, { icon: "math-plus", iconColor: "currentColor", size: "0.5rem", css: counterIcon })
|
|
@@ -9078,6 +9084,7 @@ import * as React8 from "react";
|
|
|
9078
9084
|
// src/components/Details/Details.styles.ts
|
|
9079
9085
|
import { css as css26 } from "@emotion/react";
|
|
9080
9086
|
var details = css26`
|
|
9087
|
+
cursor: pointer;
|
|
9081
9088
|
&[open] {
|
|
9082
9089
|
& > summary svg {
|
|
9083
9090
|
rotate: 0deg;
|
|
@@ -9712,6 +9719,7 @@ function InputComboBox(props) {
|
|
|
9712
9719
|
...base,
|
|
9713
9720
|
margin: "0",
|
|
9714
9721
|
padding: "0",
|
|
9722
|
+
// Prevents input shadow when focused within the select area
|
|
9715
9723
|
"& > input": {
|
|
9716
9724
|
boxShadow: "none !important"
|
|
9717
9725
|
},
|
|
@@ -9731,11 +9739,13 @@ function InputComboBox(props) {
|
|
|
9731
9739
|
return {
|
|
9732
9740
|
...base,
|
|
9733
9741
|
className: "input-combobox-control",
|
|
9742
|
+
// Used to provide overriding styles for blue focus ring and offset borders
|
|
9734
9743
|
border: state.isFocused ? "1px solid transparent" : "1px solid var(--gray-400)",
|
|
9735
9744
|
lineHeight: 1.25,
|
|
9736
9745
|
outline: state.isFocused ? "1px solid var(--brand-secondary-1)" : "none",
|
|
9737
9746
|
outlineOffset: 0,
|
|
9738
9747
|
minHeight: "58px",
|
|
9748
|
+
// matches the min-height of other input fields
|
|
9739
9749
|
boxShadow: "none",
|
|
9740
9750
|
"&:hover": {
|
|
9741
9751
|
boxShadow: "none"
|
|
@@ -10169,6 +10179,7 @@ var LimitsBar = ({ current, max, label }) => {
|
|
|
10169
10179
|
const colorMap = {
|
|
10170
10180
|
base: "var(--gray-400)",
|
|
10171
10181
|
warn: "#facc15",
|
|
10182
|
+
// Not in the design system token at present
|
|
10172
10183
|
danger: "var(--brand-secondary-5)"
|
|
10173
10184
|
};
|
|
10174
10185
|
const statusColor = progressBarValue === 100 ? colorMap.danger : progressBarValue >= 75 ? colorMap.warn : colorMap.base;
|
|
@@ -11312,7 +11323,7 @@ var TableCellData = React14.forwardRef(
|
|
|
11312
11323
|
);
|
|
11313
11324
|
|
|
11314
11325
|
// src/components/Tabs/Tabs.tsx
|
|
11315
|
-
import { createContext as createContext4, useContext as useContext5, useEffect as useEffect7 } from "react";
|
|
11326
|
+
import { createContext as createContext4, useContext as useContext5, useEffect as useEffect7, useMemo as useMemo2 } from "react";
|
|
11316
11327
|
import {
|
|
11317
11328
|
Tab as ReakitTab,
|
|
11318
11329
|
TabList as ReakitTabList,
|
|
@@ -11342,6 +11353,7 @@ var tabButtonStyles = css54`
|
|
|
11342
11353
|
var tabButtonGroupStyles = css54`
|
|
11343
11354
|
display: flex;
|
|
11344
11355
|
gap: var(--spacing-base);
|
|
11356
|
+
border-bottom: 1px solid var(--gray-300);
|
|
11345
11357
|
`;
|
|
11346
11358
|
|
|
11347
11359
|
// src/components/Tabs/Tabs.tsx
|
|
@@ -11354,15 +11366,26 @@ var useCurrentTab = () => {
|
|
|
11354
11366
|
}
|
|
11355
11367
|
return context;
|
|
11356
11368
|
};
|
|
11357
|
-
var Tabs = ({ children, onSelectedIdChange, ...props }) => {
|
|
11358
|
-
const
|
|
11369
|
+
var Tabs = ({ children, onSelectedIdChange, useHashForState, selectedId, ...props }) => {
|
|
11370
|
+
const selected = useMemo2(() => {
|
|
11371
|
+
if (selectedId)
|
|
11372
|
+
return selectedId;
|
|
11373
|
+
return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
|
|
11374
|
+
}, [selectedId, useHashForState]);
|
|
11375
|
+
const tab = useTabState({ ...props, selectedId: selected });
|
|
11359
11376
|
useEffect7(() => {
|
|
11360
11377
|
var _a;
|
|
11361
|
-
|
|
11362
|
-
|
|
11378
|
+
const selectedValueWithoutNull = (_a = tab.selectedId) != null ? _a : void 0;
|
|
11379
|
+
onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
|
|
11380
|
+
if (useHashForState && typeof window !== "undefined") {
|
|
11381
|
+
window.location.hash = selectedValueWithoutNull != null ? selectedValueWithoutNull : "";
|
|
11382
|
+
}
|
|
11383
|
+
}, [tab.selectedId, onSelectedIdChange, useHashForState]);
|
|
11363
11384
|
useEffect7(() => {
|
|
11364
|
-
tab.
|
|
11365
|
-
|
|
11385
|
+
if (selected && selected !== tab.selectedId) {
|
|
11386
|
+
tab.setSelectedId(selected);
|
|
11387
|
+
}
|
|
11388
|
+
}, [selected]);
|
|
11366
11389
|
return /* @__PURE__ */ jsx67(CurrentTabContext.Provider, { value: tab, children });
|
|
11367
11390
|
};
|
|
11368
11391
|
var TabButtonGroup = ({ children, ...props }) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { RefObject, ReactNode, HTMLAttributes } from 'react';
|
|
3
|
+
import { GroupBase } from 'react-select';
|
|
4
|
+
export { ActionMeta, FormatOptionLabelContext, FormatOptionLabelMeta, GetOptionLabel, GetOptionValue, GroupBase, GroupHeadingProps, GroupProps, MenuListProps, MenuPlacement, MultiValue, MultiValueGenericProps, MultiValueProps, MultiValueRemoveProps, OnChangeValue, OptionContext, OptionProps, Options, OptionsOrGroups } from 'react-select';
|
|
3
5
|
import * as _emotion_react from '@emotion/react';
|
|
4
6
|
import { SerializedStyles } from '@emotion/react';
|
|
5
7
|
import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
|
|
@@ -7,7 +9,6 @@ import { LottieComponentProps } from 'lottie-react';
|
|
|
7
9
|
import { ButtonProps as ButtonProps$1 } from 'reakit/Button';
|
|
8
10
|
import { MenuProps as MenuProps$1, MenuItemHTMLProps } from 'reakit';
|
|
9
11
|
import { IconType as IconType$1, IconBaseProps } from 'react-icons';
|
|
10
|
-
import { GroupBase } from 'react-select';
|
|
11
12
|
import InternalSelect from 'react-select/dist/declarations/src/Select';
|
|
12
13
|
import { StateManagerProps } from 'react-select/dist/declarations/src/useStateManager';
|
|
13
14
|
import { MenuHTMLProps, MenuProps as MenuProps$2, MenuStateReturn } from 'reakit/Menu';
|
|
@@ -367,11 +368,11 @@ type CardContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
|
|
|
367
368
|
declare const CardContainer: ({ bgColor, padding, withLastColumn, children, ...props }: CardContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
368
369
|
|
|
369
370
|
type CounterProps = {
|
|
370
|
-
/** sets the count value, a 0 will show a dot instead of a number */
|
|
371
|
-
count: number;
|
|
371
|
+
/** sets the count value, a 0 will show a dot instead of a number. Undefined will cause the counter to disappear. */
|
|
372
|
+
count: number | undefined;
|
|
372
373
|
};
|
|
373
374
|
/** @example <Counter count={1} /> */
|
|
374
|
-
declare const Counter: ({ count }: CounterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
375
|
+
declare const Counter: ({ count }: CounterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
|
|
375
376
|
|
|
376
377
|
type TextAlignProps = 'left' | 'right' | 'center';
|
|
377
378
|
type BoxHeightProps = 'auto' | 'xs' | 'sm' | 'md' | 'lg';
|
|
@@ -1119,8 +1120,9 @@ interface TabsProps {
|
|
|
1119
1120
|
manual?: boolean;
|
|
1120
1121
|
orientation?: TabState['orientation'];
|
|
1121
1122
|
onSelectedIdChange?: (tabName: string | undefined) => void;
|
|
1123
|
+
useHashForState?: boolean;
|
|
1122
1124
|
}
|
|
1123
|
-
declare const Tabs: ({ children, onSelectedIdChange, ...props }: TabsProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1125
|
+
declare const Tabs: ({ children, onSelectedIdChange, useHashForState, selectedId, ...props }: TabsProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1124
1126
|
declare const TabButtonGroup: ({ children, ...props }: Partial<TabListProps>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1125
1127
|
interface TabButtonProps extends Partial<TabProps> {
|
|
1126
1128
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -1343,7 +1347,9 @@ var customIcons = {
|
|
|
1343
1347
|
// src/components/Icons/IconsProvider.tsx
|
|
1344
1348
|
var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
|
|
1345
1349
|
var IconContext = (0, import_react12.createContext)({
|
|
1350
|
+
/** object mapping of available icons */
|
|
1346
1351
|
iconsMap: {},
|
|
1352
|
+
/** sets the loading state of the icon */
|
|
1347
1353
|
isLoading: true
|
|
1348
1354
|
});
|
|
1349
1355
|
function useIconContext() {
|
|
@@ -8422,6 +8428,7 @@ var Button = React5.forwardRef(
|
|
|
8422
8428
|
ghost: buttonGhost,
|
|
8423
8429
|
ghostDestructive: buttonGhostDestructive,
|
|
8424
8430
|
unimportant: buttonUnimportant,
|
|
8431
|
+
/** @deprecated */
|
|
8425
8432
|
tertiary: buttonTertiary
|
|
8426
8433
|
};
|
|
8427
8434
|
const btnSize = {
|
|
@@ -9161,6 +9168,9 @@ var counterIcon = import_react31.css`
|
|
|
9161
9168
|
// src/components/Counter/Counter.tsx
|
|
9162
9169
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
9163
9170
|
var Counter = ({ count }) => {
|
|
9171
|
+
if (typeof count === "undefined") {
|
|
9172
|
+
return null;
|
|
9173
|
+
}
|
|
9164
9174
|
const isTripleDigits = count > 99 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { css: counterTripleValue, title: `${count}`, children: [
|
|
9165
9175
|
"99",
|
|
9166
9176
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { icon: "math-plus", iconColor: "currentColor", size: "0.5rem", css: counterIcon })
|
|
@@ -9221,6 +9231,7 @@ var React8 = __toESM(require("react"));
|
|
|
9221
9231
|
// src/components/Details/Details.styles.ts
|
|
9222
9232
|
var import_react33 = require("@emotion/react");
|
|
9223
9233
|
var details = import_react33.css`
|
|
9234
|
+
cursor: pointer;
|
|
9224
9235
|
&[open] {
|
|
9225
9236
|
& > summary svg {
|
|
9226
9237
|
rotate: 0deg;
|
|
@@ -9855,6 +9866,7 @@ function InputComboBox(props) {
|
|
|
9855
9866
|
...base,
|
|
9856
9867
|
margin: "0",
|
|
9857
9868
|
padding: "0",
|
|
9869
|
+
// Prevents input shadow when focused within the select area
|
|
9858
9870
|
"& > input": {
|
|
9859
9871
|
boxShadow: "none !important"
|
|
9860
9872
|
},
|
|
@@ -9874,11 +9886,13 @@ function InputComboBox(props) {
|
|
|
9874
9886
|
return {
|
|
9875
9887
|
...base,
|
|
9876
9888
|
className: "input-combobox-control",
|
|
9889
|
+
// Used to provide overriding styles for blue focus ring and offset borders
|
|
9877
9890
|
border: state.isFocused ? "1px solid transparent" : "1px solid var(--gray-400)",
|
|
9878
9891
|
lineHeight: 1.25,
|
|
9879
9892
|
outline: state.isFocused ? "1px solid var(--brand-secondary-1)" : "none",
|
|
9880
9893
|
outlineOffset: 0,
|
|
9881
9894
|
minHeight: "58px",
|
|
9895
|
+
// matches the min-height of other input fields
|
|
9882
9896
|
boxShadow: "none",
|
|
9883
9897
|
"&:hover": {
|
|
9884
9898
|
boxShadow: "none"
|
|
@@ -10312,6 +10326,7 @@ var LimitsBar = ({ current, max, label }) => {
|
|
|
10312
10326
|
const colorMap = {
|
|
10313
10327
|
base: "var(--gray-400)",
|
|
10314
10328
|
warn: "#facc15",
|
|
10329
|
+
// Not in the design system token at present
|
|
10315
10330
|
danger: "var(--brand-secondary-5)"
|
|
10316
10331
|
};
|
|
10317
10332
|
const statusColor = progressBarValue === 100 ? colorMap.danger : progressBarValue >= 75 ? colorMap.warn : colorMap.base;
|
|
@@ -11480,6 +11495,7 @@ var tabButtonStyles = import_react66.css`
|
|
|
11480
11495
|
var tabButtonGroupStyles = import_react66.css`
|
|
11481
11496
|
display: flex;
|
|
11482
11497
|
gap: var(--spacing-base);
|
|
11498
|
+
border-bottom: 1px solid var(--gray-300);
|
|
11483
11499
|
`;
|
|
11484
11500
|
|
|
11485
11501
|
// src/components/Tabs/Tabs.tsx
|
|
@@ -11492,15 +11508,26 @@ var useCurrentTab = () => {
|
|
|
11492
11508
|
}
|
|
11493
11509
|
return context;
|
|
11494
11510
|
};
|
|
11495
|
-
var Tabs = ({ children, onSelectedIdChange, ...props }) => {
|
|
11496
|
-
const
|
|
11511
|
+
var Tabs = ({ children, onSelectedIdChange, useHashForState, selectedId, ...props }) => {
|
|
11512
|
+
const selected = (0, import_react67.useMemo)(() => {
|
|
11513
|
+
if (selectedId)
|
|
11514
|
+
return selectedId;
|
|
11515
|
+
return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
|
|
11516
|
+
}, [selectedId, useHashForState]);
|
|
11517
|
+
const tab = (0, import_Tab.useTabState)({ ...props, selectedId: selected });
|
|
11497
11518
|
(0, import_react67.useEffect)(() => {
|
|
11498
11519
|
var _a;
|
|
11499
|
-
|
|
11500
|
-
|
|
11520
|
+
const selectedValueWithoutNull = (_a = tab.selectedId) != null ? _a : void 0;
|
|
11521
|
+
onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
|
|
11522
|
+
if (useHashForState && typeof window !== "undefined") {
|
|
11523
|
+
window.location.hash = selectedValueWithoutNull != null ? selectedValueWithoutNull : "";
|
|
11524
|
+
}
|
|
11525
|
+
}, [tab.selectedId, onSelectedIdChange, useHashForState]);
|
|
11501
11526
|
(0, import_react67.useEffect)(() => {
|
|
11502
|
-
tab.
|
|
11503
|
-
|
|
11527
|
+
if (selected && selected !== tab.selectedId) {
|
|
11528
|
+
tab.setSelectedId(selected);
|
|
11529
|
+
}
|
|
11530
|
+
}, [selected]);
|
|
11504
11531
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CurrentTabContext.Provider, { value: tab, children });
|
|
11505
11532
|
};
|
|
11506
11533
|
var TabButtonGroup = ({ children, ...props }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/design-system",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.19.0",
|
|
4
4
|
"description": "Uniform design system components",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"test": "jest --maxWorkers=1 --passWithNoTests",
|
|
15
15
|
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
|
|
16
16
|
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
|
|
17
|
-
"create:component": "hygen component with-prompt"
|
|
17
|
+
"create:component": "hygen component with-prompt",
|
|
18
|
+
"document": "api-extractor run --local"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@emotion/jest": "11.10.5",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"postcss": "8.4.21",
|
|
27
28
|
"react": "18.2.0",
|
|
28
29
|
"react-dom": "18.2.0",
|
|
29
|
-
"tsup": "6.
|
|
30
|
+
"tsup": "6.6.3"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@emotion/react": "11.10.5",
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"publishConfig": {
|
|
50
51
|
"access": "public"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "bd4414826a6d38b928b5ba2ea68e58160b784562"
|
|
53
54
|
}
|