@uniformdev/design-system 17.7.1-alpha.176 → 17.7.1-alpha.211
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 +44 -24
- package/dist/index.d.ts +9 -2
- package/dist/index.js +44 -24
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -390,7 +390,7 @@ var inputIcon = css2`
|
|
|
390
390
|
display: flex;
|
|
391
391
|
position: absolute;
|
|
392
392
|
inset: 0 var(--spacing-base) 0 auto;
|
|
393
|
-
pointer-
|
|
393
|
+
pointer-events: none;
|
|
394
394
|
`;
|
|
395
395
|
var inputWithIcon = css2`
|
|
396
396
|
padding-right: var(--spacing-2xl);
|
|
@@ -490,6 +490,12 @@ var textarea = css2`
|
|
|
490
490
|
${input("wrap")};
|
|
491
491
|
display: block;
|
|
492
492
|
`;
|
|
493
|
+
var inputSelectCompact = css2`
|
|
494
|
+
font-size: var(--fs-xs);
|
|
495
|
+
padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-xs);
|
|
496
|
+
border-color: var(--gray-300);
|
|
497
|
+
background-position: right var(--spacing-xs) center;
|
|
498
|
+
`;
|
|
493
499
|
|
|
494
500
|
// src/styles/Animations.styles.ts
|
|
495
501
|
import { keyframes } from "@emotion/react";
|
|
@@ -2757,8 +2763,8 @@ import { CgChevronRight } from "react-icons/cg";
|
|
|
2757
2763
|
|
|
2758
2764
|
// src/components/Drawer/Drawer.styles.ts
|
|
2759
2765
|
import { css as css27, keyframes as keyframes2 } from "@emotion/react";
|
|
2760
|
-
var drawerStyles = css27`
|
|
2761
|
-
background-color:
|
|
2766
|
+
var drawerStyles = (bgColor = "var(--white)") => css27`
|
|
2767
|
+
background-color: ${bgColor};
|
|
2762
2768
|
display: flex;
|
|
2763
2769
|
gap: var(--spacing-sm);
|
|
2764
2770
|
flex-direction: column;
|
|
@@ -2778,8 +2784,8 @@ var drawerHeaderStyles = css27`
|
|
|
2778
2784
|
font-size: var(--fs-lg);
|
|
2779
2785
|
font-weight: var(--fw-bold);
|
|
2780
2786
|
`;
|
|
2781
|
-
var drawerRendererStyles = css27`
|
|
2782
|
-
position:
|
|
2787
|
+
var drawerRendererStyles = (position) => css27`
|
|
2788
|
+
position: ${position};
|
|
2783
2789
|
inset: 0;
|
|
2784
2790
|
overflow: hidden;
|
|
2785
2791
|
z-index: var(--z-10);
|
|
@@ -2889,28 +2895,39 @@ function isEqualDrawerInstance(a, b) {
|
|
|
2889
2895
|
// src/components/Drawer/Drawer.tsx
|
|
2890
2896
|
import { jsx as jsx30, jsxs as jsxs17 } from "@emotion/react/jsx-runtime";
|
|
2891
2897
|
var Drawer = React10.forwardRef(
|
|
2892
|
-
({ id, stackId, instanceKey, onRequestClose, header, children }, ref) => {
|
|
2898
|
+
({ id, stackId, instanceKey, onRequestClose, header, bgColor, children }, ref) => {
|
|
2893
2899
|
const { registerDrawer, unregisterDrawer } = useDrawer();
|
|
2894
2900
|
const closeButtonRef = useRef2(null);
|
|
2895
2901
|
const component = useMemo(() => {
|
|
2896
2902
|
const headerId = `dialog-header-${stackId}-${id}`;
|
|
2897
|
-
return /* @__PURE__ */ jsxs17(
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2903
|
+
return /* @__PURE__ */ jsxs17(
|
|
2904
|
+
"div",
|
|
2905
|
+
{
|
|
2906
|
+
ref,
|
|
2907
|
+
id,
|
|
2908
|
+
role: "dialog",
|
|
2909
|
+
tabIndex: -1,
|
|
2910
|
+
"aria-labelledby": headerId,
|
|
2911
|
+
css: drawerStyles(bgColor),
|
|
2912
|
+
children: [
|
|
2913
|
+
/* @__PURE__ */ jsx30(
|
|
2914
|
+
Button,
|
|
2915
|
+
{
|
|
2916
|
+
ref: closeButtonRef,
|
|
2917
|
+
type: "button",
|
|
2918
|
+
onClick: onRequestClose,
|
|
2919
|
+
css: drawerCloseButtonStyles,
|
|
2920
|
+
title: "Close dialog",
|
|
2921
|
+
buttonType: "ghost",
|
|
2922
|
+
children: /* @__PURE__ */ jsx30(Icon, { icon: CgChevronRight, iconColor: "gray", size: "1.5rem" })
|
|
2923
|
+
}
|
|
2924
|
+
),
|
|
2925
|
+
header ? /* @__PURE__ */ jsx30("div", { id: headerId, css: drawerHeaderStyles, children: header }) : null,
|
|
2926
|
+
/* @__PURE__ */ jsx30("div", { css: drawerInnerStyles, children })
|
|
2927
|
+
]
|
|
2928
|
+
}
|
|
2929
|
+
);
|
|
2930
|
+
}, [children, header, id, stackId, bgColor, onRequestClose, ref]);
|
|
2914
2931
|
useEffect4(() => {
|
|
2915
2932
|
registerDrawer({
|
|
2916
2933
|
drawer: {
|
|
@@ -2941,6 +2958,7 @@ var maxLayeringInPx = 64;
|
|
|
2941
2958
|
var idealDistanceBetweenLayersInPx = 16;
|
|
2942
2959
|
var DrawerRenderer = ({
|
|
2943
2960
|
stackId,
|
|
2961
|
+
position = "absolute",
|
|
2944
2962
|
width = "45%",
|
|
2945
2963
|
minWidth = "0",
|
|
2946
2964
|
maxWidth = "100%",
|
|
@@ -2951,7 +2969,7 @@ var DrawerRenderer = ({
|
|
|
2951
2969
|
if (drawersToRender.length === 0) {
|
|
2952
2970
|
return null;
|
|
2953
2971
|
}
|
|
2954
|
-
return /* @__PURE__ */ jsx31("div", { css: drawerRendererStyles, ...otherProps, children: drawersToRender.map(({ component, id, stackId: stackId2, onRequestClose }, index) => /* @__PURE__ */ jsx31(
|
|
2972
|
+
return /* @__PURE__ */ jsx31("div", { css: drawerRendererStyles(position), ...otherProps, children: drawersToRender.map(({ component, id, stackId: stackId2, onRequestClose }, index) => /* @__PURE__ */ jsx31(
|
|
2955
2973
|
DrawerWrapper,
|
|
2956
2974
|
{
|
|
2957
2975
|
index,
|
|
@@ -3624,6 +3642,7 @@ var InputSelect = ({
|
|
|
3624
3642
|
warningMessage,
|
|
3625
3643
|
showLabel = true,
|
|
3626
3644
|
labelCta,
|
|
3645
|
+
compact,
|
|
3627
3646
|
classNameContainer,
|
|
3628
3647
|
classNameControl,
|
|
3629
3648
|
classNameLabel,
|
|
@@ -3656,6 +3675,7 @@ var InputSelect = ({
|
|
|
3656
3675
|
input("wrap"),
|
|
3657
3676
|
inputSelect,
|
|
3658
3677
|
errorMessage ? inputError : void 0,
|
|
3678
|
+
compact ? inputSelectCompact : void 0,
|
|
3659
3679
|
typeof classNameControl === "object" ? classNameControl : void 0
|
|
3660
3680
|
],
|
|
3661
3681
|
className: typeof classNameControl === "string" ? classNameControl : "",
|
package/dist/index.d.ts
CHANGED
|
@@ -403,6 +403,7 @@ declare const useDrawer: () => DrawerContextValue;
|
|
|
403
403
|
interface DrawerProps extends Omit<DrawerItem, 'component'> {
|
|
404
404
|
header?: React__default.ReactNode;
|
|
405
405
|
children?: React__default.ReactNode;
|
|
406
|
+
bgColor?: 'var(--gray-50)' | 'var(--white)';
|
|
406
407
|
}
|
|
407
408
|
/**
|
|
408
409
|
* A drawer component that opens from the right side of is parent. The component is used in combination with DrawerProvider and DrawerRenderer
|
|
@@ -426,8 +427,12 @@ interface DrawerRendererProps extends Omit<React__default.HTMLAttributes<HTMLDiv
|
|
|
426
427
|
* @default '100%'
|
|
427
428
|
*/
|
|
428
429
|
maxWidth?: string;
|
|
430
|
+
/** Sets the css position value
|
|
431
|
+
* @default 'absolute'
|
|
432
|
+
*/
|
|
433
|
+
position?: 'absolute' | 'fixed';
|
|
429
434
|
}
|
|
430
|
-
declare const DrawerRenderer: ({ stackId, width, minWidth, maxWidth, ...otherProps }: DrawerRendererProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
|
|
435
|
+
declare const DrawerRenderer: ({ stackId, position, width, minWidth, maxWidth, ...otherProps }: DrawerRendererProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
|
|
431
436
|
interface DrawerRendererItemProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
432
437
|
index: number;
|
|
433
438
|
totalDrawers: number;
|
|
@@ -709,6 +714,8 @@ type InputSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
|
709
714
|
warningMessage?: string;
|
|
710
715
|
/** (optional) allows react components to be added inline with the label element */
|
|
711
716
|
labelCta?: JSX.Element;
|
|
717
|
+
/** (optional) styles the component in a compact format */
|
|
718
|
+
compact?: boolean;
|
|
712
719
|
/**
|
|
713
720
|
* (optional) sets an overriding classname on the container element
|
|
714
721
|
* @deprecated */
|
|
@@ -726,7 +733,7 @@ type InputSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
|
726
733
|
* Input Select Component
|
|
727
734
|
* @example <InputSelect label="my label" options={[{label: "option 1"}, {label: "option 2"}]} />
|
|
728
735
|
*/
|
|
729
|
-
declare const InputSelect: ({ label, defaultOption, options, caption, errorMessage, warningMessage, showLabel, labelCta, classNameContainer, classNameControl, classNameLabel, ...props }: InputSelectProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
736
|
+
declare const InputSelect: ({ label, defaultOption, options, caption, errorMessage, warningMessage, showLabel, labelCta, compact, classNameContainer, classNameControl, classNameLabel, ...props }: InputSelectProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
730
737
|
|
|
731
738
|
type InputToggleProps = React$1.HTMLAttributes<HTMLInputElement> & {
|
|
732
739
|
/** sets the label value */
|
package/dist/index.js
CHANGED
|
@@ -527,7 +527,7 @@ var inputIcon = import_react3.css`
|
|
|
527
527
|
display: flex;
|
|
528
528
|
position: absolute;
|
|
529
529
|
inset: 0 var(--spacing-base) 0 auto;
|
|
530
|
-
pointer-
|
|
530
|
+
pointer-events: none;
|
|
531
531
|
`;
|
|
532
532
|
var inputWithIcon = import_react3.css`
|
|
533
533
|
padding-right: var(--spacing-2xl);
|
|
@@ -627,6 +627,12 @@ var textarea = import_react3.css`
|
|
|
627
627
|
${input("wrap")};
|
|
628
628
|
display: block;
|
|
629
629
|
`;
|
|
630
|
+
var inputSelectCompact = import_react3.css`
|
|
631
|
+
font-size: var(--fs-xs);
|
|
632
|
+
padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-xs);
|
|
633
|
+
border-color: var(--gray-300);
|
|
634
|
+
background-position: right var(--spacing-xs) center;
|
|
635
|
+
`;
|
|
630
636
|
|
|
631
637
|
// src/styles/Animations.styles.ts
|
|
632
638
|
var import_react4 = require("@emotion/react");
|
|
@@ -2890,8 +2896,8 @@ var import_cg7 = require("react-icons/cg");
|
|
|
2890
2896
|
|
|
2891
2897
|
// src/components/Drawer/Drawer.styles.ts
|
|
2892
2898
|
var import_react33 = require("@emotion/react");
|
|
2893
|
-
var drawerStyles = import_react33.css`
|
|
2894
|
-
background-color:
|
|
2899
|
+
var drawerStyles = (bgColor = "var(--white)") => import_react33.css`
|
|
2900
|
+
background-color: ${bgColor};
|
|
2895
2901
|
display: flex;
|
|
2896
2902
|
gap: var(--spacing-sm);
|
|
2897
2903
|
flex-direction: column;
|
|
@@ -2911,8 +2917,8 @@ var drawerHeaderStyles = import_react33.css`
|
|
|
2911
2917
|
font-size: var(--fs-lg);
|
|
2912
2918
|
font-weight: var(--fw-bold);
|
|
2913
2919
|
`;
|
|
2914
|
-
var drawerRendererStyles = import_react33.css`
|
|
2915
|
-
position:
|
|
2920
|
+
var drawerRendererStyles = (position) => import_react33.css`
|
|
2921
|
+
position: ${position};
|
|
2916
2922
|
inset: 0;
|
|
2917
2923
|
overflow: hidden;
|
|
2918
2924
|
z-index: var(--z-10);
|
|
@@ -3022,28 +3028,39 @@ function isEqualDrawerInstance(a, b) {
|
|
|
3022
3028
|
// src/components/Drawer/Drawer.tsx
|
|
3023
3029
|
var import_jsx_runtime29 = require("@emotion/react/jsx-runtime");
|
|
3024
3030
|
var Drawer = import_react35.default.forwardRef(
|
|
3025
|
-
({ id, stackId, instanceKey, onRequestClose, header, children }, ref) => {
|
|
3031
|
+
({ id, stackId, instanceKey, onRequestClose, header, bgColor, children }, ref) => {
|
|
3026
3032
|
const { registerDrawer, unregisterDrawer } = useDrawer();
|
|
3027
3033
|
const closeButtonRef = (0, import_react35.useRef)(null);
|
|
3028
3034
|
const component = (0, import_react35.useMemo)(() => {
|
|
3029
3035
|
const headerId = `dialog-header-${stackId}-${id}`;
|
|
3030
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3037
|
+
"div",
|
|
3038
|
+
{
|
|
3039
|
+
ref,
|
|
3040
|
+
id,
|
|
3041
|
+
role: "dialog",
|
|
3042
|
+
tabIndex: -1,
|
|
3043
|
+
"aria-labelledby": headerId,
|
|
3044
|
+
css: drawerStyles(bgColor),
|
|
3045
|
+
children: [
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3047
|
+
Button,
|
|
3048
|
+
{
|
|
3049
|
+
ref: closeButtonRef,
|
|
3050
|
+
type: "button",
|
|
3051
|
+
onClick: onRequestClose,
|
|
3052
|
+
css: drawerCloseButtonStyles,
|
|
3053
|
+
title: "Close dialog",
|
|
3054
|
+
buttonType: "ghost",
|
|
3055
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { icon: import_cg7.CgChevronRight, iconColor: "gray", size: "1.5rem" })
|
|
3056
|
+
}
|
|
3057
|
+
),
|
|
3058
|
+
header ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { id: headerId, css: drawerHeaderStyles, children: header }) : null,
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { css: drawerInnerStyles, children })
|
|
3060
|
+
]
|
|
3061
|
+
}
|
|
3062
|
+
);
|
|
3063
|
+
}, [children, header, id, stackId, bgColor, onRequestClose, ref]);
|
|
3047
3064
|
(0, import_react35.useEffect)(() => {
|
|
3048
3065
|
registerDrawer({
|
|
3049
3066
|
drawer: {
|
|
@@ -3074,6 +3091,7 @@ var maxLayeringInPx = 64;
|
|
|
3074
3091
|
var idealDistanceBetweenLayersInPx = 16;
|
|
3075
3092
|
var DrawerRenderer = ({
|
|
3076
3093
|
stackId,
|
|
3094
|
+
position = "absolute",
|
|
3077
3095
|
width = "45%",
|
|
3078
3096
|
minWidth = "0",
|
|
3079
3097
|
maxWidth = "100%",
|
|
@@ -3084,7 +3102,7 @@ var DrawerRenderer = ({
|
|
|
3084
3102
|
if (drawersToRender.length === 0) {
|
|
3085
3103
|
return null;
|
|
3086
3104
|
}
|
|
3087
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { css: drawerRendererStyles, ...otherProps, children: drawersToRender.map(({ component, id, stackId: stackId2, onRequestClose }, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { css: drawerRendererStyles(position), ...otherProps, children: drawersToRender.map(({ component, id, stackId: stackId2, onRequestClose }, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3088
3106
|
DrawerWrapper,
|
|
3089
3107
|
{
|
|
3090
3108
|
index,
|
|
@@ -3757,6 +3775,7 @@ var InputSelect = ({
|
|
|
3757
3775
|
warningMessage,
|
|
3758
3776
|
showLabel = true,
|
|
3759
3777
|
labelCta,
|
|
3778
|
+
compact,
|
|
3760
3779
|
classNameContainer,
|
|
3761
3780
|
classNameControl,
|
|
3762
3781
|
classNameLabel,
|
|
@@ -3789,6 +3808,7 @@ var InputSelect = ({
|
|
|
3789
3808
|
input("wrap"),
|
|
3790
3809
|
inputSelect,
|
|
3791
3810
|
errorMessage ? inputError : void 0,
|
|
3811
|
+
compact ? inputSelectCompact : void 0,
|
|
3792
3812
|
typeof classNameControl === "object" ? classNameControl : void 0
|
|
3793
3813
|
],
|
|
3794
3814
|
className: typeof classNameControl === "string" ? classNameControl : "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/design-system",
|
|
3
|
-
"version": "17.7.1-alpha.
|
|
3
|
+
"version": "17.7.1-alpha.211+e51b76310",
|
|
4
4
|
"description": "Uniform design system components",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"files": [
|
|
46
46
|
"/dist"
|
|
47
47
|
],
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "e51b76310a677d0f0f2b35bfa1f7416c733cf25d"
|
|
49
49
|
}
|